vendor: 7,839 bytes, lines 1-17
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(a){if(a.ep)return;a.ep=!0;const c=s(a);fetch(a.href,c)}})();function od(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hb(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var s=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(n).forEach(function(o){var a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(s,o,a.get?a:{enumerable:!0,get:function(){return n[o]}})}),s}var Su={exports:{}},na={};/** 2 * @license React 3 * react-jsx-runtime.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var xp;function fb(){if(xp)return na;xp=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(o,a,c){var d=null;if(c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),"key"in a){c={};for(var m in a)m!=="key"&&(c[m]=a[m])}else c=a;return a=c.ref,{$$typeof:n,type:o,key:d,ref:a!==void 0?a:null,props:c}}return na.Fragment=e,na.jsx=s,na.jsxs=s,na}var bp;function mb(){return bp||(bp=1,Su.exports=fb()),Su.exports}var l=mb(),_u={exports:{}},xe={};/** 10 * @license React 11 * react.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var wp;function pb(){if(wp)return xe;wp=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function _(k){return k===null||typeof k!="object"?null:(k=w&&k[w]||k["@@iterator"],typeof k=="function"?k:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,E={};function I(k,M,J){this.props=k,this.context=M,this.refs=E,this.updater=J||C}I.prototype.isReactComponent={},I.prototype.setState=function(k,M){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,M,"setState")},I.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function U(){}U.prototype=I.prototype;function G(k,M,J){this.props=k,this.context=M,this.refs=E,this.updater=J||C}var F=G.prototype=new U;F.constructor=G,A(F,I.prototype),F.isPureReactComponent=!0;var P=Array.isArray;function $(){}var H={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function X(k,M,J){var ee=J.ref;return{$$typeof:n,type:k,key:M,ref:ee!==void 0?ee:null,props:J}}function q(k,M){return X(k.type,M,k.props)}function Q(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function ne(k){var M={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(J){return M[J]})}var se=/\/+/g;function fe(k,M){return typeof k=="object"&&k!==null&&k.key!=null?ne(""+k.key):M.toString(36)}function ge(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then($,$):(k.status="pending",k.then(function(M){k.status==="pending"&&(k.status="fulfilled",k.value=M)},function(M){k.status==="pending"&&(k.status="rejected",k.reason=M)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function z(k,M,J,ee,ce){var ue=typeof k;(ue==="undefined"||ue==="boolean")&&(k=null);var _e=!1;if(k===null)_e=!0;else switch(ue){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(k.$$typeof){case n:case e:_e=!0;break;case v:return _e=k._init,z(_e(k._payload),M,J,ee,ce)}}if(_e)return ce=ce(k),_e=ee===""?"."+fe(k,0):ee,P(ce)?(J="",_e!=null&&(J=_e.replace(se,"$&/")+"/"),z(ce,M,J,"",function(At){return At})):ce!=null&&(Q(ce)&&(ce=q(ce,J+(ce.key==null||k&&k.key===ce.key?"":(""+ce.key).replace(se,"$&/")+"/")+_e)),M.push(ce)),1;_e=0;var Qe=ee===""?".":ee+":";if(P(k))for(var Be=0;Be<k.length;Be++)ee=k[Be],ue=Qe+fe(ee,Be),_e+=z(ee,M,J,ue,ce);else if(Be=_(k),typeof Be=="function")for(k=Be.call(k),Be=0;!(ee=k.next()).done;)ee=ee.value,ue=Qe+fe(ee,Be++),_e+=z(ee,M,J,ue,ce);else if(ue==="object"){if(typeof k.then=="function")return z(ge(k),M,J,ee,ce);throw M=String(k),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return _e}function te(k,M,J){if(k==null)return k;var ee=[],ce=0;return z(k,ee,"","",function(ue){return M.call(J,ue,ce++)}),ee}function ae(k){if(k._status===-1){var M=k._result;M=M(),M.then(function(J){(k._status===0||k._status===-1)&&(k._status=1,k._result=J)},function(J){(k._status===0||k._status===-1)&&(k._status=2,k._result=J)}),k._status===-1&&(k._status=0,k._result=M)}if(k._status===1)return k._result.default;throw k._result}var ve=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Te={map:te,forEach:function(k,M,J){te(k,function(){M.apply(this,arguments)},J)},count:function(k){var M=0;return te(k,function(){M++}),M},toArray:function(k){return te(k,function(M){return M})||[]},only:function(k){if(!Q(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return xe.Activity=b,xe.Children=Te,xe.Component=I,xe.Fragment=s,xe.Profiler=a,xe.PureComponent=G,xe.StrictMode=o,xe.Suspense=y,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,xe.__COMPILER_RUNTIME={__proto__:null,c:function(k){return H.H.useMemoCache(k)}},xe.cache=function(k){return function(){return k.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(k,M,J){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ee=A({},k.props),ce=k.key;if(M!=null)for(ue in M.key!==void 0&&(ce=""+M.key),M)!Z.call(M,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&M.ref===void 0||(ee[ue]=M[ue]);var ue=arguments.length-2;if(ue===1)ee.children=J;else if(1<ue){for(var _e=Array(ue),Qe=0;Qe<ue;Qe++)_e[Qe]=arguments[Qe+2];ee.children=_e}return X(k.type,ce,ee)},xe.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null}
vendor: 15,354 bytes, lines 17-43
17,k.Provider=k,k.Consumer={$$typeof:c,_context:k},k},xe.createElement=function(k,M,J){var ee,ce={},ue=null;if(M!=null)for(ee in M.key!==void 0&&(ue=""+M.key),M)Z.call(M,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ce[ee]=M[ee]);var _e=arguments.length-2;if(_e===1)ce.children=J;else if(1<_e){for(var Qe=Array(_e),Be=0;Be<_e;Be++)Qe[Be]=arguments[Be+2];ce.children=Qe}if(k&&k.defaultProps)for(ee in _e=k.defaultProps,_e)ce[ee]===void 0&&(ce[ee]=_e[ee]);return X(k,ue,ce)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(k){return{$$typeof:m,render:k}},xe.isValidElement=Q,xe.lazy=function(k){return{$$typeof:v,_payload:{_status:-1,_result:k},_init:ae}},xe.memo=function(k,M){return{$$typeof:f,type:k,compare:M===void 0?null:M}},xe.startTransition=function(k){var M=H.T,J={};H.T=J;try{var ee=k(),ce=H.S;ce!==null&&ce(J,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then($,ve)}catch(ue){ve(ue)}finally{M!==null&&J.types!==null&&(M.types=J.types),H.T=M}},xe.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},xe.use=function(k){return H.H.use(k)},xe.useActionState=function(k,M,J){return H.H.useActionState(k,M,J)},xe.useCallback=function(k,M){return H.H.useCallback(k,M)},xe.useContext=function(k){return H.H.useContext(k)},xe.useDebugValue=function(){},xe.useDeferredValue=function(k,M){return H.H.useDeferredValue(k,M)},xe.useEffect=function(k,M){return H.H.useEffect(k,M)},xe.useEffectEvent=function(k){return H.H.useEffectEvent(k)},xe.useId=function(){return H.H.useId()},xe.useImperativeHandle=function(k,M,J){return H.H.useImperativeHandle(k,M,J)},xe.useInsertionEffect=function(k,M){return H.H.useInsertionEffect(k,M)},xe.useLayoutEffect=function(k,M){return H.H.useLayoutEffect(k,M)},xe.useMemo=function(k,M){return H.H.useMemo(k,M)},xe.useOptimistic=function(k,M){return H.H.useOptimistic(k,M)},xe.useReducer=function(k,M,J){return H.H.useReducer(k,M,J)},xe.useRef=function(k){return H.H.useRef(k)},xe.useState=function(k){return H.H.useState(k)},xe.useSyncExternalStore=function(k,M,J){return H.H.useSyncExternalStore(k,M,J)},xe.useTransition=function(){return H.H.useTransition()},xe.version="19.2.3",xe}var Sp;function ad(){return Sp||(Sp=1,_u.exports=pb()),_u.exports}var R=ad();const H0=od(R);var Tu={exports:{}},sa={},Cu={exports:{}},Eu={};/** 18 * @license React 19 * scheduler.production.js 20 * 21 * Copyright (c) Meta Platforms, Inc. and affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var _p;function gb(){return _p||(_p=1,(function(n){function e(z,te){var ae=z.length;z.push(te);e:for(;0<ae;){var ve=ae-1>>>1,Te=z[ve];if(0<a(Te,te))z[ve]=te,z[ae]=Te,ae=ve;else break e}}function s(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var te=z[0],ae=z.pop();if(ae!==te){z[0]=ae;e:for(var ve=0,Te=z.length,k=Te>>>1;ve<k;){var M=2*(ve+1)-1,J=z[M],ee=M+1,ce=z[ee];if(0>a(J,ae))ee<Te&&0>a(ce,J)?(z[ve]=ce,z[ee]=ae,ve=ee):(z[ve]=J,z[M]=ae,ve=M);else if(ee<Te&&0>a(ce,ae))z[ve]=ce,z[ee]=ae,ve=ee;else break e}}return te}function a(z,te){var ae=z.sortIndex-te.sortIndex;return ae!==0?ae:z.id-te.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var y=[],f=[],v=1,b=null,w=3,_=!1,C=!1,A=!1,E=!1,I=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function F(z){for(var te=s(f);te!==null;){if(te.callback===null)o(f);else if(te.startTime<=z)o(f),te.sortIndex=te.expirationTime,e(y,te);else break;te=s(f)}}function P(z){if(A=!1,F(z),!C)if(s(y)!==null)C=!0,$||($=!0,ne());else{var te=s(f);te!==null&&ge(P,te.startTime-z)}}var $=!1,H=-1,Z=5,X=-1;function q(){return E?!0:!(n.unstable_now()-X<Z)}function Q(){if(E=!1,$){var z=n.unstable_now();X=z;var te=!0;try{e:{C=!1,A&&(A=!1,U(H),H=-1),_=!0;var ae=w;try{t:{for(F(z),b=s(y);b!==null&&!(b.expirationTime>z&&q());){var ve=b.callback;if(typeof ve=="function"){b.callback=null,w=b.priorityLevel;var Te=ve(b.expirationTime<=z);if(z=n.unstable_now(),typeof Te=="function"){b.callback=Te,F(z),te=!0;break t}b===s(y)&&o(y),F(z)}else o(y);b=s(y)}if(b!==null)te=!0;else{var k=s(f);k!==null&&ge(P,k.startTime-z),te=!1}}break e}finally{b=null,w=ae,_=!1}te=void 0}}finally{te?ne():$=!1}}}var ne;if(typeof G=="function")ne=function(){G(Q)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,fe=se.port2;se.port1.onmessage=Q,ne=function(){fe.postMessage(null)}}else ne=function(){I(Q,0)};function ge(z,te){H=I(function(){z(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(z){switch(w){case 1:case 2:case 3:var te=3;break;default:te=w}var ae=w;w=te;try{return z()}finally{w=ae}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(z,te){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ae=w;w=z;try{return te()}finally{w=ae}},n.unstable_scheduleCallback=function(z,te,ae){var ve=n.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ve+ae:ve):ae=ve,z){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=ae+Te,z={id:v++,callback:te,priorityLevel:z,startTime:ae,expirationTime:Te,sortIndex:-1},ae>ve?(z.sortIndex=ae,e(f,z),s(y)===null&&z===s(f)&&(A?(U(H),H=-1):A=!0,ge(P,ae-ve))):(z.sortIndex=Te,e(y,z),C||_||(C=!0,$||($=!0,ne()))),z},n.unstable_shouldYield=q,n.unstable_wrapCallback=function(z){var te=w;return function(){var ae=w;w=te;try{return z.apply(this,arguments)}finally{w=ae}}}})(Eu)),Eu}var Tp;function yb(){return Tp||(Tp=1,Cu.exports=gb()),Cu.exports}var Nu={exports:{}},vt={};/** 26 * @license React 27 * react-dom.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var Cp;function vb(){if(Cp)return vt;Cp=1;var n=ad();function e(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+y+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(e(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},a=Symbol.for("react.portal");function c(y,f,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:b==null?null:""+b,children:y,containerInfo:f,implementation:v}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,vt.createPortal=function(y,f){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return c(y,f,null,v)},vt.flushSync=function(y){var f=d.T,v=o.p;try{if(d.T=null,o.p=2,y)return y()}finally{d.T=f,o.p=v,o.d.f()}},vt.preconnect=function(y,f){typeof y=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,o.d.C(y,f))},vt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},vt.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var v=f.as,b=m(v,f.crossOrigin),w=typeof f.integrity=="string"?f.integrity:void 0,_=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;v==="style"?o.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:_}):v==="script"&&o.d.X(y,{crossOrigin:b,integrity:w,fetchPriority:_,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},vt.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var v=m(f.as,f.crossOrigin);o.d.M(y,{crossOrigin:v,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&o.d.M(y)},vt.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var v=f.as,b=m(v,f.crossOrigin);o.d.L(y,v,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},vt.preloadModule=function(y,f){if(typeof y=="string")if(f){var v=m(f.as,f.crossOrigin);o.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:v,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else o.d.m(y)},vt.requestFormReset=function(y){o.d.r(y)},vt.unstable_batchedUpdates=function(y,f){return y(f)},vt.useFormState=function(y,f,v){return d.H.useFormState(y,f,v)},vt.useFormStatus=function(){return d.H.useHostTransitionStatus()},vt.version="19.2.3",vt}var Ep;function xb(){if(Ep)return Nu.exports;Ep=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Nu.exports=vb(),Nu.exports}/** 34 * @license React 35 * react-dom-client.production.js 36 * 37 * Copyright (c) Meta Platforms, Inc. and affiliates. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE file in the root directory of this source tree. 41 */var Np;function bb(){if(Np)return sa;Np=1;var n=yb(),e=ad(),s=xb();function o(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)i+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,r=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(r=i.return),t=i.return;while(t)}return i.tag===3?r:null}function d(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function m(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function y(t){if(c(t)!==t)throw Error(o(188))}function f(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(o(188));return i!==t?null:t}for(var r=t,u=i;;){var g=r.return;if(g===null)break;var x=g.alternate;if(x===null){if(u=g.return,u!==null){r=u;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===r)return y(g),t;if(x===u)return y(g),i;x=x.sibling}throw Error(o(188))}if(r.return!==u.return)r=g,u=x;else{for(var S=!1,T=g.child;T;){if(T===r){S=!0,r=g,u=x;break}if(T===u){S=!0,u=g,r=x;break}T=T.sibling}if(!S){for(T=x.child;T;){if(T===r){S=!0,r=x,u=g;break}if(T===u){S=!0,u=x,r=g;break}T=T.sibling}if(!S)throw Error(o(189))}}if(r.alternate!==u)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?t:i}function v(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=v(t),i!==null)return i;t=t.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),G=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ne(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var se=Symbol.for("react.client.reference");function fe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case I:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case $:return"SuspenseList";case X:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case G:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case F:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return i=t.displayName||null,i!==null?i:fe(t.type)||"Memo";case Z:i=t._payload,t=t._init;try{return fe(t(i))}catch{}}return null}var ge=Array.isArray,z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ve=[],Te=-1;function k(t){return{current:t}}function M(t){0>Te||(t.current=ve[Te],ve[Te]=null,Te--)}function J(t,i){Te++,ve[Te]=t.current,t.current=i}var ee=k(null),ce=k(null),ue=k(null),_e=k(null);function Qe(t,i){switch(J(ue,i),J(ce,t),J(ee,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Hm(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Hm(i),t=zm(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}M(ee),J(ee,t)}function Be(){M(ee),M(ce),M(ue)}function At(t){t.memoizedState!==null&&J(_e,t);var i=ee.current,r=zm(i,t.type);i!==r&&(J(ce,t),J(ee,r))}function Pt(t){ce.current===t&&(M(ee),M(ce)),_e.current===t&&(M(_e),Xo._currentValue=ae)}var hn,Rt;function Xe(t){if(hn===void 0)try{throw Error()}catch(r){var i=r.stack.trim().match(/\n( *(at )?)/);hn=i&&i[1]||"",Rt=-1<r.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+hn+t+Rt}var tt=!1;function Jt(t,i){if(!t||tt)return"";tt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(V){var B=V}Reflect.construct(t,[],W)}else{try{W.call()}catch(V){B=V}t.call(W.prototype)}}else{try{throw Error()}catch(V){B=V}(W=t())&&typeof W.catch=="function"&&W.catch(function(){})}}
vendor: 4,212 bytes, lines 43-48
43catch(V){if(V&&B&&typeof V.stack=="string")return[V.stack,B.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),S=x[0],T=x[1];if(S&&T){var N=S.split(` 44`),O=T.split(` 45`);for(g=u=0;u<N.length&&!N[u].includes("DetermineComponentFrameRoot");)u++;for(;g<O.length&&!O[g].includes("DetermineComponentFrameRoot");)g++;if(u===N.length||g===O.length)for(u=N.length-1,g=O.length-1;1<=u&&0<=g&&N[u]!==O[g];)g--;for(;1<=u&&0<=g;u--,g--)if(N[u]!==O[g]){if(u!==1||g!==1)do if(u--,g--,0>g||N[u]!==O[g]){var Y=` 46`+N[u].replace(" at new "," at ");return t.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",t.displayName)),Y}while(1<=u&&0<=g);break}}}finally{tt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Xe(r):""}function St(t,i){switch(t.tag){case 26:case 27:case 5:return Xe(t.type);case 16:return Xe("Lazy");case 13:return t.child!==i&&i!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return Jt(t.type,!1);case 11:return Jt(t.type.render,!1);case 1:return Jt(t.type,!0);case 31:return Xe("Activity");default:return""}}function js(t){try{var i="",r=null;do i+=St(t,r),r=t,t=t.return;while(t);return i}catch(u){return` 47Error generating stack: `+u.message+` 48`+u.stack}}var Wn=Object.prototype.hasOwnProperty,Xn=n.unstable_scheduleCallback,Zn=n.unstable_cancelCallback,si=n.unstable_shouldYield,ii=n.unstable_requestPaint,ct=n.unstable_now,be=n.unstable_getCurrentPriorityLevel,pa=n.unstable_ImmediatePriority,ga=n.unstable_UserBlockingPriority,oi=n.unstable_NormalPriority,rl=n.unstable_LowPriority,ya=n.unstable_IdlePriority,ll=n.log,cl=n.unstable_setDisableYieldValue,Is=null,_t=null;function Ae(t){if(typeof ll=="function"&&cl(t),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(Is,t)}catch{}}var me=Math.clz32?Math.clz32:He,De=Math.log,Me=Math.LN2;function He(t){return t>>>=0,t===0?32:31-(De(t)/Me|0)|0}var Ot=256,Sn=262144,es=4194304;function fn(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ts(t,i,r){var u=t.pendingLanes;if(u===0)return 0;var g=0,x=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var T=u&134217727;return T!==0?(u=T&~x,u!==0?g=fn(u):(S&=T,S!==0?g=fn(S):r||(r=T&~t,r!==0&&(g=fn(r))))):(T=u&~x,T!==0?g=fn(T):S!==0?g=fn(S):r||(r=u&~t,r!==0&&(g=fn(r)))),g===0?0:i!==0&&i!==g&&(i&x)===0&&(x=g&-g,r=i&-i,x>=r||x===32&&(r&4194048)!==0)?i:g}function An(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function va(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sd(){var t=es;return es<<=1,(es&62914560)===0&&(es=4194304),t}function ul(t){for(var i=[],r=0;31>r;r++)i.push(t);return i}function ho(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ev(t,i,r,u,g,x){var S=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var T=t.entanglements,N=t.expirationTimes,O=t.hiddenUpdates;for(r=S&~r;
vendor: 9,015 bytes, line 48
480<r;){var Y=31-me(r),W=1<<Y;T[Y]=0,N[Y]=-1;var B=O[Y];if(B!==null)for(O[Y]=null,Y=0;Y<B.length;Y++){var V=B[Y];V!==null&&(V.lane&=-536870913)}r&=~W}u!==0&&_d(t,u,0),x!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=x&~(S&~i))}function _d(t,i,r){t.pendingLanes|=i,t.suspendedLanes&=~i;var u=31-me(i);t.entangledLanes|=i,t.entanglements[u]=t.entanglements[u]|1073741824|r&261930}function Td(t,i){var r=t.entangledLanes|=i;for(t=t.entanglements;r;){var u=31-me(r),g=1<<u;g&i|t[u]&i&&(t[u]|=i),r&=~g}}function Cd(t,i){var r=i&-i;return r=(r&42)!==0?1:dl(r),(r&(t.suspendedLanes|i))!==0?0:r}function dl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function hl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ed(){var t=te.p;return t!==0?t:(t=window.event,t===void 0?32:hp(t.type))}function Nd(t,i){var r=te.p;try{return te.p=t,i()}finally{te.p=r}}var ns=Math.random().toString(36).slice(2),ft="__reactFiber$"+ns,kt="__reactProps$"+ns,ai="__reactContainer$"+ns,fl="__reactEvents$"+ns,tv="__reactListeners$"+ns,nv="__reactHandles$"+ns,Ad="__reactResources$"+ns,fo="__reactMarker$"+ns;function ml(t){delete t[ft],delete t[kt],delete t[fl],delete t[tv],delete t[nv]}function ri(t){var i=t[ft];if(i)return i;for(var r=t.parentNode;r;){if(i=r[ai]||r[ft]){if(r=i.alternate,i.child!==null||r!==null&&r.child!==null)for(t=Qm(t);t!==null;){if(r=t[ft])return r;t=Qm(t)}return i}t=r,r=t.parentNode}return null}function li(t){if(t=t[ft]||t[ai]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function mo(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(o(33))}function ci(t){var i=t[Ad];return i||(i=t[Ad]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ut(t){t[fo]=!0}var Rd=new Set,kd={};function Ms(t,i){ui(t,i),ui(t+"Capture",i)}function ui(t,i){for(kd[t]=i,t=0;t<i.length;t++)Rd.add(i[t])}var sv=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),jd={},Id={};function iv(t){return Wn.call(Id,t)?!0:Wn.call(jd,t)?!1:sv.test(t)?Id[t]=!0:(jd[t]=!0,!1)}function xa(t,i,r){if(iv(i))if(r===null)t.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+r)}}function ba(t,i,r){if(r===null)t.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+r)}}function Rn(t,i,r,u){if(u===null)t.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(i,r,""+u)}}function Kt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Md(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ov(t,i,r){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return g.call(this)},set:function(S){r=""+S,x.call(this,S)}}),Object.defineProperty(t,i,{enumerable:u.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function pl(t){if(!t._valueTracker){var i=Md(t)?"checked":"value";t._valueTracker=ov(t,i,""+t[i])}}function Dd(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var r=i.getValue(),u="";return t&&(u=Md(t)?t.checked?"true":"false":t.value),t=u,t!==r?(i.setValue(t),!0):!1}function wa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var av=/[\n"\\]/g;function Qt(t){return t.replace(av,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function gl(t,i,r,u,g,x,S,T){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),i!=null?S==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Kt(i)):t.value!==""+Kt(i)&&(t.value=""+Kt(i)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),i!=null?yl(t,S,Kt(i)):r!=null?yl(t,S,Kt(r)):u!=null&&t.removeAttribute("value"),g==null&&x!=null&&(t.defaultChecked=!!x),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+Kt(T):t.removeAttribute("name")}function Ud(t,i,r,u,g,x,S,T){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),i!=null||r!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){pl(t);return}r=r!=null?""+Kt(r):"",i=i!=null?""+Kt(i):r,T||i===t.value||(t.value=i),t.defaultValue=i}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=T?t.checked:!!u,t.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),pl(t)}function yl(t,i,r){i==="number"&&wa(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function di(t,i,r,u){if(t=t.options,i){i={};for(var g=0;g<r.length;g++)i["$"+r[g]]=!0;for(r=0;r<t.length;r++)g=i.hasOwnProperty("$"+t[r].value),t[r].selected!==g&&(t[r].selected=g),g&&u&&(t[r].defaultSelected=!0)}else{for(r=""+Kt(r),i=null,g=0;g<t.length;g++){if(t[g].value===r){t[g].selected=!0,u&&(t[g].defaultSelected=!0);return}i!==null||t[g].disabled||(i=t[g])}i!==null&&(i.selected=!0)}}function Ld(t,i,r){if(i!=null&&(i=""+Kt(i),i!==t.value&&(t.value=i),r==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=r!=null?""+Kt(r):""}function Pd(t,i,r,u){if(i==null){if(u!=null){if(r!=null)throw Error(o(92));if(ge(u)){if(1<u.length)throw Error(o(93));u=u[0]}r=u}r==null&&(r=""),i=r}r=Kt(i),t.defaultValue=r,u=t.textContent,u===r&&u!==""&&u!==null&&(t.value=u),pl(t)}function hi(t,i){if(i){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=i;return}}t.textContent=i}var rv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Od(t,i,r){var u=i.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?u?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":u?t.setProperty(i,r):typeof r!="number"||r===0||rv.has(i)?i==="float"?t.cssFloat=r:t[i]=(""+r).trim():t[i]=r+"px"}function Gd(t,i,r){if(i!=null&&typeof i!="object")throw Error(o(62));if(t=t.style,r!=null){for(var u in r)!r.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var g in i)u=i[g],i.hasOwnProperty(g)&&r[g]!==u&&Od(t,g,u)}else for(var x in i)i.hasOwnProperty(x)&&Od(t,x,i[x])}function vl(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),cv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Sa(t){return cv.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function kn(){}var xl=null;function bl(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fi=null,mi=null;function qd(t){var i=li(t);if(i&&(t=i.stateNode)){var r=t[kt]||null;e:switch(t=i.stateNode,i.type){case"input":if(gl(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),i=r.name,r.type==="radio"&&i!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Qt(""+i)+'"][type="radio"]'),i=0;i<r.length;i++){var u=r[i];if(u!==t&&u.form===t.form){var g=u[kt]||null;if(!g)throw Error(o(90));gl(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<r.length;i++)u=r[i],u.form===t.form&&Dd(u)}break e;case"textarea":Ld(t,r.value,r.defaultValue);break e;case"select":i=r.value,i!=null&&di(t,!!r.multiple,i,!1)}}}var wl=!1;function Bd(t,i,r){if(wl)return t(i,r);wl=!0;try{var u=t(i);return u}finally{if(wl=!1,(fi!==null||mi!==null)&&(cr(),fi&&(i=fi,t=mi,mi=fi=null,qd(i),t)))for(i=0;i<t.length;i++)qd(t[i])}}function po(t,i){var r=t.stateNode;if(r===null)return null;var u=r[kt]||null;if(u===null)return null;r=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(o(231,i,typeof r));return r}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sl=!1;if(jn)try{var go={};Object.defineProperty(go,"passive",{get:function(){Sl=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Sl=!1}var ss=null,_l=null,_a=null;function Hd(){if(_a)return _a;var t,i=_l,r=i.length,u,g="value"in ss?ss.value:ss.textContent,x=g.length;for(t=0;t<r&&i[t]===g[t];t++);var S=r-t;for(u=1;u<=S&&i[r-u]===g[x-u];u++);return _a=g.slice(t,1<u?1-u:void 0)}function Ta(t){var i=t.keyCode;
vendor: 6,364 bytes, line 48
48return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Ca(){return!0}function zd(){return!1}function jt(t){function i(r,u,g,x,S){this._reactName=r,this._targetInst=g,this.type=u,this.nativeEvent=x,this.target=S,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(r=t[T],this[T]=r?r(x):x[T]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ca:zd,this.isPropagationStopped=zd,this}return b(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ca)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ca)},persist:function(){},isPersistent:Ca}),i}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ea=jt(Ds),yo=b({},Ds,{view:0,detail:0}),uv=jt(yo),Tl,Cl,vo,Na=b({},yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nl,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==vo&&(vo&&t.type==="mousemove"?(Tl=t.screenX-vo.screenX,Cl=t.screenY-vo.screenY):Cl=Tl=0,vo=t),Tl)},movementY:function(t){return"movementY"in t?t.movementY:Cl}}),Vd=jt(Na),dv=b({},Na,{dataTransfer:0}),hv=jt(dv),fv=b({},yo,{relatedTarget:0}),El=jt(fv),mv=b({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),pv=jt(mv),gv=b({},Ds,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),yv=jt(gv),vv=b({},Ds,{data:0}),Fd=jt(vv),xv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sv(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=wv[t])?!!i[t]:!1}function Nl(){return Sv}var _v=b({},yo,{key:function(t){if(t.key){var i=xv[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Ta(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?bv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nl,charCode:function(t){return t.type==="keypress"?Ta(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ta(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Tv=jt(_v),Cv=b({},Na,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$d=jt(Cv),Ev=b({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nl}),Nv=jt(Ev),Av=b({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rv=jt(Av),kv=b({},Na,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),jv=jt(kv),Iv=b({},Ds,{newState:0,oldState:0}),Mv=jt(Iv),Dv=[9,13,27,32],Al=jn&&"CompositionEvent"in window,xo=null;jn&&"documentMode"in document&&(xo=document.documentMode);var Uv=jn&&"TextEvent"in window&&!xo,Yd=jn&&(!Al||xo&&8<xo&&11>=xo),Jd=" ",Kd=!1;function Qd(t,i){switch(t){case"keyup":return Dv.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pi=!1;function Lv(t,i){switch(t){case"compositionend":return Wd(i);case"keypress":return i.which!==32?null:(Kd=!0,Jd);case"textInput":return t=i.data,t===Jd&&Kd?null:t;default:return null}}function Pv(t,i){if(pi)return t==="compositionend"||!Al&&Qd(t,i)?(t=Hd(),_a=_l=ss=null,pi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Yd&&i.locale!=="ko"?null:i.data;default:return null}}var Ov={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xd(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Ov[t.type]:i==="textarea"}function Zd(t,i,r,u){fi?mi?mi.push(u):mi=[u]:fi=u,i=gr(i,"onChange"),0<i.length&&(r=new Ea("onChange","change",null,r,u),t.push({event:r,listeners:i}))}var bo=null,wo=null;function Gv(t){Lm(t,0)}function Aa(t){var i=mo(t);if(Dd(i))return t}function eh(t,i){if(t==="change")return i}var th=!1;if(jn){var Rl;if(jn){var kl="oninput"in document;if(!kl){var nh=document.createElement("div");nh.setAttribute("oninput","return;"),kl=typeof nh.oninput=="function"}Rl=kl}else Rl=!1;th=Rl&&(!document.documentMode||9<document.documentMode)}function sh(){bo&&(bo.detachEvent("onpropertychange",ih),wo=bo=null)}function ih(t){if(t.propertyName==="value"&&Aa(wo)){var i=[];Zd(i,wo,t,bl(t)),Bd(Gv,i)}}function qv(t,i,r){t==="focusin"?(sh(),bo=i,wo=r,bo.attachEvent("onpropertychange",ih)):t==="focusout"&&sh()}function Bv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Aa(wo)}function Hv(t,i){if(t==="click")return Aa(i)}function zv(t,i){if(t==="input"||t==="change")return Aa(i)}function Vv(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Gt=typeof Object.is=="function"?Object.is:Vv;function So(t,i){if(Gt(t,i))return!0;
vendor: 21,217 bytes, line 48
48if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var r=Object.keys(t),u=Object.keys(i);if(r.length!==u.length)return!1;for(u=0;u<r.length;u++){var g=r[u];if(!Wn.call(i,g)||!Gt(t[g],i[g]))return!1}return!0}function oh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ah(t,i){var r=oh(t);t=0;for(var u;r;){if(r.nodeType===3){if(u=t+r.textContent.length,t<=i&&u>=i)return{node:r,offset:i-t};t=u}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=oh(r)}}function rh(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?rh(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function lh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=wa(t.document);i instanceof t.HTMLIFrameElement;){try{var r=typeof i.contentWindow.location.href=="string"}catch{r=!1}if(r)t=i.contentWindow;else break;i=wa(t.document)}return i}function jl(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Fv=jn&&"documentMode"in document&&11>=document.documentMode,gi=null,Il=null,_o=null,Ml=!1;function ch(t,i,r){var u=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ml||gi==null||gi!==wa(u)||(u=gi,"selectionStart"in u&&jl(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_o&&So(_o,u)||(_o=u,u=gr(Il,"onSelect"),0<u.length&&(i=new Ea("onSelect","select",null,i,r),t.push({event:i,listeners:u}),i.target=gi)))}function Us(t,i){var r={};return r[t.toLowerCase()]=i.toLowerCase(),r["Webkit"+t]="webkit"+i,r["Moz"+t]="moz"+i,r}var yi={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionrun:Us("Transition","TransitionRun"),transitionstart:Us("Transition","TransitionStart"),transitioncancel:Us("Transition","TransitionCancel"),transitionend:Us("Transition","TransitionEnd")},Dl={},uh={};jn&&(uh=document.createElement("div").style,"AnimationEvent"in window||(delete yi.animationend.animation,delete yi.animationiteration.animation,delete yi.animationstart.animation),"TransitionEvent"in window||delete yi.transitionend.transition);function Ls(t){if(Dl[t])return Dl[t];if(!yi[t])return t;var i=yi[t],r;for(r in i)if(i.hasOwnProperty(r)&&r in uh)return Dl[t]=i[r];return t}var dh=Ls("animationend"),hh=Ls("animationiteration"),fh=Ls("animationstart"),$v=Ls("transitionrun"),Yv=Ls("transitionstart"),Jv=Ls("transitioncancel"),mh=Ls("transitionend"),ph=new Map,Ul="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ul.push("scrollEnd");function mn(t,i){ph.set(t,i),Ms(i,[t])}var Ra=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wt=[],vi=0,Ll=0;function ka(){for(var t=vi,i=Ll=vi=0;i<t;){var r=Wt[i];Wt[i++]=null;var u=Wt[i];Wt[i++]=null;var g=Wt[i];Wt[i++]=null;var x=Wt[i];if(Wt[i++]=null,u!==null&&g!==null){var S=u.pending;S===null?g.next=g:(g.next=S.next,S.next=g),u.pending=g}x!==0&&gh(r,g,x)}}function ja(t,i,r,u){Wt[vi++]=t,Wt[vi++]=i,Wt[vi++]=r,Wt[vi++]=u,Ll|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Pl(t,i,r,u){return ja(t,i,r,u),Ia(t)}function Ps(t,i){return ja(t,null,null,i),Ia(t)}function gh(t,i,r){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r);for(var g=!1,x=t.return;x!==null;)x.childLanes|=r,u=x.alternate,u!==null&&(u.childLanes|=r),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(g=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,g&&i!==null&&(g=31-me(r),t=x.hiddenUpdates,u=t[g],u===null?t[g]=[i]:u.push(i),i.lane=r|536870912),x):null}function Ia(t){if(50<Fo)throw Fo=0,$c=null,Error(o(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var xi={};function Kv(t,i,r,u){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(t,i,r,u){return new Kv(t,i,r,u)}function Ol(t){return t=t.prototype,!(!t||!t.isReactComponent)}function In(t,i){var r=t.alternate;return r===null?(r=qt(t.tag,i,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=i,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,i=t.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function yh(t,i){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,i=r.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Ma(t,i,r,u,g,x){var S=0;if(u=t,typeof t=="function")Ol(t)&&(S=1);else if(typeof t=="string")S=eb(t,r,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case X:return t=qt(31,r,i,g),t.elementType=X,t.lanes=x,t;case A:return Os(r.children,g,x,i);case E:S=8,g|=24;break;case I:return t=qt(12,r,i,g|2),t.elementType=I,t.lanes=x,t;case P:return t=qt(13,r,i,g),t.elementType=P,t.lanes=x,t;case $:return t=qt(19,r,i,g),t.elementType=$,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:S=10;break e;case U:S=9;break e;case F:S=11;break e;case H:S=14;break e;case Z:S=16,u=null;break e}S=29,r=Error(o(130,t===null?"null":typeof t,"")),u=null}return i=qt(S,r,i,g),i.elementType=t,i.type=u,i.lanes=x,i}function Os(t,i,r,u){return t=qt(7,t,u,i),t.lanes=r,t}function Gl(t,i,r){return t=qt(6,t,null,i),t.lanes=r,t}function vh(t){var i=qt(18,null,null,0);return i.stateNode=t,i}function ql(t,i,r){return i=qt(4,t.children!==null?t.children:[],t.key,i),i.lanes=r,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var xh=new WeakMap;function Xt(t,i){if(typeof t=="object"&&t!==null){var r=xh.get(t);return r!==void 0?r:(i={value:t,source:i,stack:js(i)},xh.set(t,i),i)}return{value:t,source:i,stack:js(i)}}var bi=[],wi=0,Da=null,To=0,Zt=[],en=0,is=null,_n=1,Tn="";function Mn(t,i){bi[wi++]=To,bi[wi++]=Da,Da=t,To=i}function bh(t,i,r){Zt[en++]=_n,Zt[en++]=Tn,Zt[en++]=is,is=t;var u=_n;t=Tn;var g=32-me(u)-1;u&=~(1<<g),r+=1;var x=32-me(i)+g;if(30<x){var S=g-g%5;x=(u&(1<<S)-1).toString(32),u>>=S,g-=S,_n=1<<32-me(i)+g|r<<g|u,Tn=x+t}else _n=1<<x|r<<g|u,Tn=t}function Bl(t){t.return!==null&&(Mn(t,1),bh(t,1,0))}function Hl(t){for(;t===Da;)Da=bi[--wi],bi[wi]=null,To=bi[--wi],bi[wi]=null;for(;t===is;)is=Zt[--en],Zt[en]=null,Tn=Zt[--en],Zt[en]=null,_n=Zt[--en],Zt[en]=null}function wh(t,i){Zt[en++]=_n,Zt[en++]=Tn,Zt[en++]=is,_n=i.id,Tn=i.overflow,is=t}var mt=null,Je=null,je=!1,os=null,tn=!1,zl=Error(o(519));function as(t){var i=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(Xt(i,t)),zl}function Sh(t){var i=t.stateNode,r=t.type,u=t.memoizedProps;switch(i[ft]=t,i[kt]=u,r){case"dialog":Ee("cancel",i),Ee("close",i);break;case"iframe":case"object":case"embed":Ee("load",i);break;case"video":case"audio":for(r=0;r<Yo.length;r++)Ee(Yo[r],i);break;case"source":Ee("error",i);break;case"img":case"image":case"link":Ee("error",i),Ee("load",i);break;case"details":Ee("toggle",i);break;case"input":Ee("invalid",i),Ud(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ee("invalid",i);break;case"textarea":Ee("invalid",i),Pd(i,u.value,u.defaultValue,u.children)}r=u.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||i.textContent===""+r||u.suppressHydrationWarning===!0||qm(i.textContent,r)?(u.popover!=null&&(Ee("beforetoggle",i),Ee("toggle",i)),u.onScroll!=null&&Ee("scroll",i),u.onScrollEnd!=null&&Ee("scrollend",i),u.onClick!=null&&(i.onclick=kn),i=!0):i=!1,i||as(t,!0)}function _h(t){for(mt=t.return;mt;)switch(mt.tag){case 5:case 31:case 13:tn=!1;return;case 27:case 3:tn=!0;return;default:mt=mt.return}}function Si(t){if(t!==mt)return!1;if(!je)return _h(t),je=!0,!1;var i=t.tag,r;if((r=i!==3&&i!==27)&&((r=i===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||ru(t.type,t.memoizedProps)),r=!r),r&&Je&&as(t),_h(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));Je=Km(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));Je=Km(t)}else i===27?(i=Je,bs(t.type)?(t=hu,hu=null,Je=t):Je=i):Je=mt?sn(t.stateNode.nextSibling):null;return!0}function Gs(){Je=mt=null,je=!1}function Vl(){var t=os;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),os=null),t}function Co(t){os===null?os=[t]:os.push(t)}var Fl=k(null),qs=null,Dn=null;function rs(t,i,r){J(Fl,i._currentValue),i._currentValue=r}function Un(t){t._currentValue=Fl.current,M(Fl)}function $l(t,i,r){for(;t!==null;){var u=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),t===r)break;t=t.return}}function Yl(t,i,r,u){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var x=g.dependencies;if(x!==null){var S=g.child;x=x.firstContext;e:for(;x!==null;){var T=x;x=g;for(var N=0;N<i.length;N++)if(T.context===i[N]){x.lanes|=r,T=x.alternate,T!==null&&(T.lanes|=r),$l(x.return,r,t),u||(S=null);break e}x=T.next}}else if(g.tag===18){if(S=g.return,S===null)throw Error(o(341));S.lanes|=r,x=S.alternate,x!==null&&(x.lanes|=r),$l(S,r,t),S=null}else S=g.child;if(S!==null)S.return=g;else for(S=g;S!==null;){if(S===t){S=null;break}if(g=S.sibling,g!==null){g.return=S.return,S=g;break}S=S.return}g=S}}function _i(t,i,r,u){t=null;for(var g=i,x=!1;g!==null;){if(!x){if((g.flags&524288)!==0)x=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var S=g.alternate;if(S===null)throw Error(o(387));if(S=S.memoizedProps,S!==null){var T=g.type;Gt(g.pendingProps.value,S.value)||(t!==null?t.push(T):t=[T])}}else if(g===_e.current){if(S=g.alternate,S===null)throw Error(o(387));S.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(Xo):t=[Xo])}g=g.return}t!==null&&Yl(i,t,r,u),i.flags|=262144}function Ua(t){for(t=t.firstContext;t!==null;){if(!Gt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Bs(t){qs=t,Dn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function pt(t){return Th(qs,t)}function La(t,i){return qs===null&&Bs(t),Th(t,i)}function Th(t,i){var r=i._currentValue;if(i={context:i,memoizedValue:r,next:null},Dn===null){if(t===null)throw Error(o(308));Dn=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Dn=Dn.next=i;return r}var Qv=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(r,u){t.push(u)}};this.abort=function(){i.aborted=!0,t.forEach(function(r){return r()})}},Wv=n.unstable_scheduleCallback,Xv=n.unstable_NormalPriority,it={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jl(){return{controller:new Qv,data:new Map,refCount:0}}function Eo(t){t.refCount--,t.refCount===0&&Wv(Xv,function(){t.controller.abort()})}var No=null,Kl=0,Ti=0,Ci=null;function Zv(t,i){if(No===null){var r=No=[];Kl=0,Ti=Xc(),Ci={status:"pending",value:void 0,then:function(u){r.push(u)}}}return Kl++,i.then(Ch,Ch),i}function Ch(){if(--Kl===0&&No!==null){Ci!==null&&(Ci.status="fulfilled");var t=No;No=null,Ti=0,Ci=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function ex(t,i){var r=[],u={status:"pending",value:null,reason:null,then:function(g){r.push(g)}};return t.then(function(){u.status="fulfilled",u.value=i;for(var g=0;g<r.length;g++)(0,r[g])(i)},function(g){for(u.status="rejected",u.reason=g,g=0;g<r.length;g++)(0,r[g])(void 0)}),u}var Eh=z.S;z.S=function(t,i){um=ct(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Zv(t,i),Eh!==null&&Eh(t,i)};var Hs=k(null);function Ql(){var t=Hs.current;return t!==null?t:$e.pooledCache}function Pa(t,i){i===null?J(Hs,Hs.current):J(Hs,i.pool)}function Nh(){var t=Ql();return t===null?null:{parent:it._currentValue,pool:t}}var Ei=Error(o(460)),Wl=Error(o(474)),Oa=Error(o(542)),Ga={then:function(){}};function Ah(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Rh(t,i,r){switch(r=t[r],r===void 0?t.push(i):r!==i&&(i.then(kn,kn),i=r),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,jh(t),t;default:if(typeof i.status=="string")i.then(kn,kn);else{if(t=$e,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=i,t.status="pending",t.then(function(u){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=u}},function(u){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,jh(t),t}throw Vs=i,Ei}}function zs(t){try{var i=t._init;return i(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Vs=r,Ei):r}}var Vs=null;function kh(){if(Vs===null)throw Error(o(459));var t=Vs;return Vs=null,t}function jh(t){if(t===Ei||t===Oa)throw Error(o(483))}var Ni=null,Ao=0;function qa(t){var i=Ao;return Ao+=1,Ni===null&&(Ni=[]),Rh(Ni,t,i)}function Ro(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Ba(t,i){throw i.$$typeof===w?Error(o(525)):(t=Object.prototype.toString.call(i),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Ih(t){function i(D,j){if(t){var L=D.deletions;L===null?(D.deletions=[j],D.flags|=16):L.push(j)}}function r(D,j){if(!t)return null;for(;j!==null;)i(D,j),j=j.sibling;return null}function u(D){for(var j=new Map;D!==null;)D.key!==null?j.set(D.key,D):j.set(D.index,D),D=D.sibling;return j}function g(D,j){return D=In(D,j),D.index=0,D.sibling=null,D}function x(D,j,L){return D.index=L,t?(L=D.alternate,L!==null?(L=L.index,L<j?(D.flags|=67108866,j):L):(D.flags|=67108866,j)):(D.flags|=1048576,j)}function S(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function T(D,j,L,K){return j===null||j.tag!==6?(j=Gl(L,D.mode,K),j.return=D,j):(j=g(j,L),j.return=D,j)}function N(D,j,L,K){var he=L.type;return he===A?Y(D,j,L.props.children,K,L.key):j!==null&&(j.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Z&&zs(he)===j.type)?(j=g(j,L.props),Ro(j,L),j.return=D,j):(j=Ma(L.type,L.key,L.props,null,D.mode,K),Ro(j,L),j.return=D,j)}function O(D,j,L,K){return j===null||j.tag!==4||j.stateNode.containerInfo!==L.containerInfo||j.stateNode.implementation!==L.implementation?(j=ql(L,D.mode,K),j.return=D,j):(j=g(j,L.children||[]),j.return=D,j)}function Y(D,j,L,K,he){return j===null||j.tag!==7?(j=Os(L,D.mode,K,he),j.return=D,j):(j=g(j,L),j.return=D,j)}function W(D,j,L){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Gl(""+j,D.mode,L),j.return=D,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case _:return L=Ma(j.type,j.key,j.props,null,D.mode,L),Ro(L,j),L.return=D,L;case C:return j=ql(j,D.mode,L),j.return=D,j;case Z:return j=zs(j),W(D,j,L)}if(ge(j)||ne(j))return j=Os(j,D.mode,L,null),j.return=D,j;if(typeof j.then=="function")return W(D,qa(j),L);if(j.$$typeof===G)return W(D,La(D,j),L);Ba(D,j)}return null}function B(D,j,L,K){var he=j!==null?j.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return he!==null?null:T(D,j,""+L,K);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return L.key===he?N(D,j,L,K):null;case C:return L.key===he?O(D,j,L,K):null;case Z:return L=zs(L),B(D,j,L,K)}if(ge(L)||ne(L))return he!==null?null:Y(D,j,L,K,null);if(typeof L.then=="function")return B(D,j,qa(L),K);if(L.$$typeof===G)return B(D,j,La(D,L),K);Ba(D,L)}return null}function V(D,j,L,K,he){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(L)||null,T(j,D,""+K,he);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return D=D.get(K.key===null?L:K.key)||null,N(j,D,K,he);case C:return D=D.get(K.key===null?L:K.key)||null,O(j,D,K,he);case Z:return K=zs(K),V(D,j,L,K,he)}if(ge(K)||ne(K))return D=D.get(L)||null,Y(j,D,K,he,null);if(typeof K.then=="function")return V(D,j,L,qa(K),he);if(K.$$typeof===G)return V(D,j,L,La(j,K),he);Ba(j,K)}return null}function re(D,j,L,K){for(var he=null,Ue=null,de=j,Se=j=0,ke=null;de!==null&&Se<L.length;Se++){de.index>Se?(ke=de,de=null):ke=de.sibling;var Le=B(D,de,L[Se],K);if(Le===null){de===null&&(de=ke);break}t&&de&&Le.alternate===null&&i(D,de),j=x(Le,j,Se),Ue===null?he=Le:Ue.sibling=Le,Ue=Le,de=ke}if(Se===L.length)return r(D,de),je&&Mn(D,Se),he;if(de===null){for(;Se<L.length;Se++)de=W(D,L[Se],K),de!==null&&(j=x(de,j,Se),Ue===null?he=de:Ue.sibling=de,Ue=de);return je&&Mn(D,Se),he}for(de=u(de);Se<L.length;Se++)ke=V(de,D,Se,L[Se],K),ke!==null&&(t&&ke.alternate!==null&&de.delete(ke.key===null?Se:ke.key),j=x(ke,j,Se),Ue===null?he=ke:Ue.sibling=ke,Ue=ke);return t&&de.forEach(function(Cs){return i(D,Cs)}),je&&Mn(D,Se),he}function pe(D,j,L,K){if(L==null)throw Error(o(151));for(var he=null,Ue=null,de=j,Se=j=0,ke=null,Le=L.next();de!==null&&!Le.done;Se++,Le=L.next()){de.index>Se?(ke=de,de=null):ke=de.sibling;var Cs=B(D,de,Le.value,K);if(Cs===null){de===null&&(de=ke);break}t&&de&&Cs.alternate===null&&i(D,de),j=x(Cs,j,Se),Ue===null?he=Cs:Ue.sibling=Cs,Ue=Cs,de=ke}if(Le.done)return r(D,de),je&&Mn(D,Se),he;if(de===null){for(;!Le.done;Se++,Le=L.next())Le=W(D,Le.value,K),Le!==null&&(j=x(Le,j,Se),Ue===null?he=Le:Ue.sibling=Le,Ue=Le);return je&&Mn(D,Se),he}for(de=u(de);!Le.done;Se++,Le=L.next())Le=V(de,D,Se,Le.value,K),Le!==null&&(t&&Le.alternate!==null&&de.delete(Le.key===null?Se:Le.key),j=x(Le,j,Se),Ue===null?he=Le:Ue.sibling=Le,Ue=Le);return t&&de.forEach(function(db){return i(D,db)}),je&&Mn(D,Se),he}function Fe(D,j,L,K){if(typeof L=="object"&&L!==null&&L.type===A&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _:e:{for(var he=L.key;j!==null;){if(j.key===he){if(he=L.type,he===A){if(j.tag===7){r(D,j.sibling),K=g(j,L.props.children),K.return=D,D=K;break e}}else if(j.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===Z&&zs(he)===j.type){r(D,j.sibling),K=g(j,L.props),Ro(K,L),K.return=D,D=K;break e}r(D,j);break}else i(D,j);j=j.sibling}L.type===A?(K=Os(L.props.children,D.mode,K,L.key),K.return=D,D=K):(K=Ma(L.type,L.key,L.props,null,D.mode,K),Ro(K,L),K.return=D,D=K)}return S(D);case C:e:{for(he=L.key;j!==null;){if(j.key===he)if(j.tag===4&&j.stateNode.containerInfo===L.containerInfo&&j.stateNode.implementation===L.implementation){r(D,j.sibling),K=g(j,L.children||[]),K.return=D,D=K;break e}else{r(D,j);break}else i(D,j);j=j.sibling}K=ql(L,D.mode,K),K.return=D,D=K}return S(D);case Z:return L=zs(L),Fe(D,j,L,K)}if(ge(L))return re(D,j,L,K);if(ne(L)){if(he=ne(L),typeof he!="function")throw Error(o(150));return L=he.call(L),pe(D,j,L,K)}if(typeof L.then=="function")return Fe(D,j,qa(L),K);if(L.$$typeof===G)return Fe(D,j,La(D,L),K);Ba(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,j!==null&&j.tag===6?(r(D,j.sibling),K=g(j,L),K.return=D,D=K):(r(D,j),K=Gl(L,D.mode,K),K.return=D,D=K),S(D)):r(D,j)}return function(D,j,L,K){try{Ao=0;var he=Fe(D,j,L,K);return Ni=null,he}catch(de){if(de===Ei||de===Oa)throw de;var Ue=qt(29,de,null,D.mode);return Ue.lanes=K,Ue.return=D,Ue}finally{}}}var Fs=Ih(!0),Mh=Ih(!1),ls=!1;function Xl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}
vendor: 7,570 bytes, line 48
48function Zl(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cs(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function us(t,i,r){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Oe&2)!==0){var g=u.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),u.pending=i,i=Ia(t),gh(t,null,r),i}return ja(t,u,i,r),Ia(t)}function ko(t,i,r){if(i=i.updateQueue,i!==null&&(i=i.shared,(r&4194048)!==0)){var u=i.lanes;u&=t.pendingLanes,r|=u,i.lanes=r,Td(t,r)}}function ec(t,i){var r=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,r===u)){var g=null,x=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};x===null?g=x=S:x=x.next=S,r=r.next}while(r!==null);x===null?g=x=i:x=x.next=i}else g=x=i;r={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=i:t.next=i,r.lastBaseUpdate=i}var tc=!1;function jo(){if(tc){var t=Ci;if(t!==null)throw t}}function Io(t,i,r,u){tc=!1;var g=t.updateQueue;ls=!1;var x=g.firstBaseUpdate,S=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var N=T,O=N.next;N.next=null,S===null?x=O:S.next=O,S=N;var Y=t.alternate;Y!==null&&(Y=Y.updateQueue,T=Y.lastBaseUpdate,T!==S&&(T===null?Y.firstBaseUpdate=O:T.next=O,Y.lastBaseUpdate=N))}if(x!==null){var W=g.baseState;S=0,Y=O=N=null,T=x;do{var B=T.lane&-536870913,V=B!==T.lane;if(V?(Re&B)===B:(u&B)===B){B!==0&&B===Ti&&(tc=!0),Y!==null&&(Y=Y.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var re=t,pe=T;B=i;var Fe=r;switch(pe.tag){case 1:if(re=pe.payload,typeof re=="function"){W=re.call(Fe,W,B);break e}W=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=pe.payload,B=typeof re=="function"?re.call(Fe,W,B):re,B==null)break e;W=b({},W,B);break e;case 2:ls=!0}}B=T.callback,B!==null&&(t.flags|=64,V&&(t.flags|=8192),V=g.callbacks,V===null?g.callbacks=[B]:V.push(B))}else V={lane:B,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Y===null?(O=Y=V,N=W):Y=Y.next=V,S|=B;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;V=T,T=V.next,V.next=null,g.lastBaseUpdate=V,g.shared.pending=null}}while(!0);Y===null&&(N=W),g.baseState=N,g.firstBaseUpdate=O,g.lastBaseUpdate=Y,x===null&&(g.shared.lanes=0),ps|=S,t.lanes=S,t.memoizedState=W}}function Dh(t,i){if(typeof t!="function")throw Error(o(191,t));t.call(i)}function Uh(t,i){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)Dh(r[t],i)}var Ai=k(null),Ha=k(0);function Lh(t,i){t=Vn,J(Ha,t),J(Ai,i),Vn=t|i.baseLanes}function nc(){J(Ha,Vn),J(Ai,Ai.current)}function sc(){Vn=Ha.current,M(Ai),M(Ha)}var Bt=k(null),nn=null;function ds(t){var i=t.alternate;J(nt,nt.current&1),J(Bt,t),nn===null&&(i===null||Ai.current!==null||i.memoizedState!==null)&&(nn=t)}function ic(t){J(nt,nt.current),J(Bt,t),nn===null&&(nn=t)}function Ph(t){t.tag===22?(J(nt,nt.current),J(Bt,t),nn===null&&(nn=t)):hs()}function hs(){J(nt,nt.current),J(Bt,Bt.current)}function Ht(t){M(Bt),nn===t&&(nn=null),M(nt)}var nt=k(0);function za(t){for(var i=t;i!==null;){if(i.tag===13){var r=i.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||uu(r)||du(r)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ln=0,we=null,ze=null,ot=null,Va=!1,Ri=!1,$s=!1,Fa=0,Mo=0,ki=null,tx=0;function Ze(){throw Error(o(321))}function oc(t,i){if(i===null)return!1;for(var r=0;r<i.length&&r<t.length;r++)if(!Gt(t[r],i[r]))return!1;return!0}function ac(t,i,r,u,g,x){return Ln=x,we=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=t===null||t.memoizedState===null?wf:wc,$s=!1,x=r(u,g),$s=!1,Ri&&(x=Gh(i,r,u,g)),Oh(t),x}function Oh(t){z.H=Lo;var i=ze!==null&&ze.next!==null;if(Ln=0,ot=ze=we=null,Va=!1,Mo=0,ki=null,i)throw Error(o(300));t===null||at||(t=t.dependencies,t!==null&&Ua(t)&&(at=!0))}function Gh(t,i,r,u){we=t;var g=0;do{if(Ri&&(ki=null),Mo=0,Ri=!1,25<=g)throw Error(o(301));if(g+=1,ot=ze=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=Sf,x=i(r,u)}while(Ri);return x}function nx(){var t=z.H,i=t.useState()[0];return i=typeof i.then=="function"?Do(i):i,t=t.useState()[0],(ze!==null?ze.memoizedState:null)!==t&&(we.flags|=1024),i}function rc(){var t=Fa!==0;return Fa=0,t}function lc(t,i,r){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~r}function cc(t){if(Va){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Va=!1}Ln=0,ot=ze=we=null,Ri=!1,Mo=Fa=0,ki=null}function Tt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?we.memoizedState=ot=t:ot=ot.next=t,ot}function st(){if(ze===null){var t=we.alternate;t=t!==null?t.memoizedState:null}else t=ze.next;var i=ot===null?we.memoizedState:ot.next;if(i!==null)ot=i,ze=t;else{if(t===null)throw we.alternate===null?Error(o(467)):Error(o(310));ze=t,t={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},ot===null?we.memoizedState=ot=t:ot=ot.next=t}return ot}function $a(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(t){var i=Mo;return Mo+=1,ki===null&&(ki=[]),t=Rh(ki,t,i),i=we,(ot===null?i.memoizedState:ot.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?wf:wc),t}function Ya(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Do(t);if(t.$$typeof===G)return pt(t)}throw Error(o(438,String(t)))}function uc(t){var i=null,r=we.updateQueue;if(r!==null&&(i=r.memoCache),i==null){var u=we.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),r===null&&(r=$a(),we.updateQueue=r),r.memoCache=i,r=i.data[i.index],r===void 0)for(r=i.data[i.index]=Array(t),u=0;u<t;u++)r[u]=q;return i.index++,r}function Pn(t,i){return typeof i=="function"?i(t):i}function Ja(t){var i=st();return dc(i,ze,t)}function dc(t,i,r){var u=t.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=r;var g=t.baseQueue,x=u.pending;if(x!==null){if(g!==null){var S=g.next;g.next=x.next,x.next=S}i.baseQueue=g=x,u.pending=null}if(x=t.baseState,g===null)t.memoizedState=x;else{i=g.next;var T=S=null,N=null,O=i,Y=!1;do{var W=O.lane&-536870913;if(W!==O.lane?(Re&W)===W:(Ln&W)===W){var B=O.revertLane;if(B===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),W===Ti&&(Y=!0);else if((Ln&B)===B){O=O.next,B===Ti&&(Y=!0);continue}else W={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},N===null?(T=N=W,S=x):N=N.next=W,we.lanes|=B,ps|=B;W=O.action,$s&&r(x,W),x=O.hasEagerState?O.eagerState:r(x,W)}else B={lane:W,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},N===null?(T=N=B,S=x):N=N.next=B,we.lanes|=W,ps|=W;O=O.next}
vendor: 14,252 bytes, line 48
48while(O!==null&&O!==i);if(N===null?S=x:N.next=T,!Gt(x,t.memoizedState)&&(at=!0,Y&&(r=Ci,r!==null)))throw r;t.memoizedState=x,t.baseState=S,t.baseQueue=N,u.lastRenderedState=x}return g===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function hc(t){var i=st(),r=i.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=t;var u=r.dispatch,g=r.pending,x=i.memoizedState;if(g!==null){r.pending=null;var S=g=g.next;do x=t(x,S.action),S=S.next;while(S!==g);Gt(x,i.memoizedState)||(at=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),r.lastRenderedState=x}return[x,u]}function qh(t,i,r){var u=we,g=st(),x=je;if(x){if(r===void 0)throw Error(o(407));r=r()}else r=i();var S=!Gt((ze||g).memoizedState,r);if(S&&(g.memoizedState=r,at=!0),g=g.queue,pc(zh.bind(null,u,g,t),[t]),g.getSnapshot!==i||S||ot!==null&&ot.memoizedState.tag&1){if(u.flags|=2048,ji(9,{destroy:void 0},Hh.bind(null,u,g,r,i),null),$e===null)throw Error(o(349));x||(Ln&127)!==0||Bh(u,i,r)}return r}function Bh(t,i,r){t.flags|=16384,t={getSnapshot:i,value:r},i=we.updateQueue,i===null?(i=$a(),we.updateQueue=i,i.stores=[t]):(r=i.stores,r===null?i.stores=[t]:r.push(t))}function Hh(t,i,r,u){i.value=r,i.getSnapshot=u,Vh(i)&&Fh(t)}function zh(t,i,r){return r(function(){Vh(i)&&Fh(t)})}function Vh(t){var i=t.getSnapshot;t=t.value;try{var r=i();return!Gt(t,r)}catch{return!0}}function Fh(t){var i=Ps(t,2);i!==null&&Lt(i,t,2)}function fc(t){var i=Tt();if(typeof t=="function"){var r=t;if(t=r(),$s){Ae(!0);try{r()}finally{Ae(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:t},i}function $h(t,i,r,u){return t.baseState=r,dc(t,ze,typeof u=="function"?u:Pn)}function sx(t,i,r,u,g){if(Wa(t))throw Error(o(485));if(t=i.action,t!==null){var x={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){x.listeners.push(S)}};z.T!==null?r(!0):x.isTransition=!1,u(x),r=i.pending,r===null?(x.next=i.pending=x,Yh(i,x)):(x.next=r.next,i.pending=r.next=x)}}function Yh(t,i){var r=i.action,u=i.payload,g=t.state;if(i.isTransition){var x=z.T,S={};z.T=S;try{var T=r(g,u),N=z.S;N!==null&&N(S,T),Jh(t,i,T)}catch(O){mc(t,i,O)}finally{x!==null&&S.types!==null&&(x.types=S.types),z.T=x}}else try{x=r(g,u),Jh(t,i,x)}catch(O){mc(t,i,O)}}function Jh(t,i,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(u){Kh(t,i,u)},function(u){return mc(t,i,u)}):Kh(t,i,r)}function Kh(t,i,r){i.status="fulfilled",i.value=r,Qh(i),t.state=r,i=t.pending,i!==null&&(r=i.next,r===i?t.pending=null:(r=r.next,i.next=r,Yh(t,r)))}function mc(t,i,r){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=r,Qh(i),i=i.next;while(i!==u)}t.action=null}function Qh(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Wh(t,i){return i}function Xh(t,i){if(je){var r=$e.formState;if(r!==null){e:{var u=we;if(je){if(Je){t:{for(var g=Je,x=tn;g.nodeType!==8;){if(!x){g=null;break t}if(g=sn(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){Je=sn(g.nextSibling),u=g.data==="F!";break e}}as(u)}u=!1}u&&(i=r[0])}}return r=Tt(),r.memoizedState=r.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wh,lastRenderedState:i},r.queue=u,r=vf.bind(null,we,u),u.dispatch=r,u=fc(!1),x=bc.bind(null,we,!1,u.queue),u=Tt(),g={state:i,dispatch:null,action:t,pending:null},u.queue=g,r=sx.bind(null,we,g,x,r),g.dispatch=r,u.memoizedState=t,[i,r,!1]}function Zh(t){var i=st();return ef(i,ze,t)}function ef(t,i,r){if(i=dc(t,i,Wh)[0],t=Ja(Pn)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=Do(i)}catch(S){throw S===Ei?Oa:S}else u=i;i=st();var g=i.queue,x=g.dispatch;return r!==i.memoizedState&&(we.flags|=2048,ji(9,{destroy:void 0},ix.bind(null,g,r),null)),[u,x,t]}function ix(t,i){t.action=i}function tf(t){var i=st(),r=ze;if(r!==null)return ef(i,r,t);st(),i=i.memoizedState,r=st();var u=r.queue.dispatch;return r.memoizedState=t,[i,u,!1]}function ji(t,i,r,u){return t={tag:t,create:r,deps:u,inst:i,next:null},i=we.updateQueue,i===null&&(i=$a(),we.updateQueue=i),r=i.lastEffect,r===null?i.lastEffect=t.next=t:(u=r.next,r.next=t,t.next=u,i.lastEffect=t),t}function nf(){return st().memoizedState}function Ka(t,i,r,u){var g=Tt();we.flags|=t,g.memoizedState=ji(1|i,{destroy:void 0},r,u===void 0?null:u)}function Qa(t,i,r,u){var g=st();u=u===void 0?null:u;var x=g.memoizedState.inst;ze!==null&&u!==null&&oc(u,ze.memoizedState.deps)?g.memoizedState=ji(i,x,r,u):(we.flags|=t,g.memoizedState=ji(1|i,x,r,u))}function sf(t,i){Ka(8390656,8,t,i)}function pc(t,i){Qa(2048,8,t,i)}function ox(t){we.flags|=4;var i=we.updateQueue;if(i===null)i=$a(),we.updateQueue=i,i.events=[t];else{var r=i.events;r===null?i.events=[t]:r.push(t)}}function of(t){var i=st().memoizedState;return ox({ref:i,nextImpl:t}),function(){if((Oe&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}function af(t,i){return Qa(4,2,t,i)}function rf(t,i){return Qa(4,4,t,i)}function lf(t,i){if(typeof i=="function"){t=t();var r=i(t);return function(){typeof r=="function"?r():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function cf(t,i,r){r=r!=null?r.concat([t]):null,Qa(4,4,lf.bind(null,i,t),r)}function gc(){}function uf(t,i){var r=st();i=i===void 0?null:i;var u=r.memoizedState;return i!==null&&oc(i,u[1])?u[0]:(r.memoizedState=[t,i],t)}function df(t,i){var r=st();i=i===void 0?null:i;var u=r.memoizedState;if(i!==null&&oc(i,u[1]))return u[0];if(u=t(),$s){Ae(!0);try{t()}finally{Ae(!1)}}return r.memoizedState=[u,i],u}function yc(t,i,r){return r===void 0||(Ln&1073741824)!==0&&(Re&261930)===0?t.memoizedState=i:(t.memoizedState=r,t=hm(),we.lanes|=t,ps|=t,r)}function hf(t,i,r,u){return Gt(r,i)?r:Ai.current!==null?(t=yc(t,r,u),Gt(t,i)||(at=!0),t):(Ln&42)===0||(Ln&1073741824)!==0&&(Re&261930)===0?(at=!0,t.memoizedState=r):(t=hm(),we.lanes|=t,ps|=t,i)}function ff(t,i,r,u,g){var x=te.p;te.p=x!==0&&8>x?x:8;var S=z.T,T={};z.T=T,bc(t,!1,i,r);try{var N=g(),O=z.S;if(O!==null&&O(T,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var Y=ex(N,u);Uo(t,i,Y,Ft(t))}else Uo(t,i,u,Ft(t))}catch(W){Uo(t,i,{then:function(){},status:"rejected",reason:W},Ft())}finally{te.p=x,S!==null&&T.types!==null&&(S.types=T.types),z.T=S}}function ax(){}function vc(t,i,r,u){if(t.tag!==5)throw Error(o(476));var g=mf(t).queue;ff(t,g,i,ae,r===null?ax:function(){return pf(t),r(u)})}function mf(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:ae},next:null};var r={};return i.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:r},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function pf(t){var i=mf(t);i.next===null&&(i=t.alternate.memoizedState),Uo(t,i.next.queue,{},Ft())}function xc(){return pt(Xo)}function gf(){return st().memoizedState}function yf(){return st().memoizedState}function rx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var r=Ft();t=cs(r);var u=us(i,t,r);u!==null&&(Lt(u,i,r),ko(u,i,r)),i={cache:Jl()},t.payload=i;return}i=i.return}}function lx(t,i,r){var u=Ft();r={lane:u,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wa(t)?xf(i,r):(r=Pl(t,i,r,u),r!==null&&(Lt(r,t,u),bf(r,i,u)))}function vf(t,i,r){var u=Ft();Uo(t,i,r,u)}function Uo(t,i,r,u){var g={lane:u,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Wa(t))xf(i,g);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var S=i.lastRenderedState,T=x(S,r);if(g.hasEagerState=!0,g.eagerState=T,Gt(T,S))return ja(t,i,g,0),$e===null&&ka(),!1}catch{}finally{}if(r=Pl(t,i,g,u),r!==null)return Lt(r,t,u),bf(r,i,u),!0}return!1}function bc(t,i,r,u){if(u={lane:2,revertLane:Xc(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wa(t)){if(i)throw Error(o(479))}else i=Pl(t,r,u,2),i!==null&&Lt(i,t,2)}function Wa(t){var i=t.alternate;return t===we||i!==null&&i===we}function xf(t,i){Ri=Va=!0;var r=t.pending;r===null?i.next=i:(i.next=r.next,r.next=i),t.pending=i}function bf(t,i,r){if((r&4194048)!==0){var u=i.lanes;u&=t.pendingLanes,r|=u,i.lanes=r,Td(t,r)}}var Lo={readContext:pt,use:Ya,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};Lo.useEffectEvent=Ze;var wf={readContext:pt,use:Ya,useCallback:function(t,i){return Tt().memoizedState=[t,i===void 0?null:i],t},useContext:pt,useEffect:sf,useImperativeHandle:function(t,i,r){r=r!=null?r.concat([t]):null,Ka(4194308,4,lf.bind(null,i,t),r)},useLayoutEffect:function(t,i){return Ka(4194308,4,t,i)},useInsertionEffect:function(t,i){Ka(4,2,t,i)},useMemo:function(t,i){var r=Tt();i=i===void 0?null:i;var u=t();if($s){Ae(!0);try{t()}finally{Ae(!1)}}return r.memoizedState=[u,i],u},useReducer:function(t,i,r){var u=Tt();if(r!==void 0){var g=r(i);if($s){Ae(!0);try{r(i)}finally{Ae(!1)}}}else g=i;return u.memoizedState=u.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},u.queue=t,t=t.dispatch=lx.bind(null,we,t),[u.memoizedState,t]},useRef:function(t){var i=Tt();return t={current:t},i.memoizedState=t},useState:function(t){t=fc(t);var i=t.queue,r=vf.bind(null,we,i);return i.dispatch=r,[t.memoizedState,r]},useDebugValue:gc,useDeferredValue:function(t,i){var r=Tt();return yc(r,t,i)},useTransition:function(){var t=fc(!1);return t=ff.bind(null,we,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,r){var u=we,g=Tt();if(je){if(r===void 0)throw Error(o(407));r=r()}else{if(r=i(),$e===null)throw Error(o(349));(Re&127)!==0||Bh(u,i,r)}g.memoizedState=r;var x={value:r,getSnapshot:i};return g.queue=x,sf(zh.bind(null,u,x,t),[t]),u.flags|=2048,ji(9,{destroy:void 0},Hh.bind(null,u,x,r,i),null),r},useId:function(){var t=Tt(),i=$e.identifierPrefix;if(je){var r=Tn,u=_n;r=(u&~(1<<32-me(u)-1)).toString(32)+r,i="_"+i+"R_"+r,r=Fa++,0<r&&(i+="H"+r.toString(32)),i+="_"}else r=tx++,i="_"+i+"r_"+r.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:xc,useFormState:Xh,useActionState:Xh,useOptimistic:function(t){var i=Tt();i.memoizedState=i.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=r,i=bc.bind(null,we,!0,r),r.dispatch=i,[t,i]},useMemoCache:uc,useCacheRefresh:function(){return Tt().memoizedState=rx.bind(null,we)},useEffectEvent:function(t){var i=Tt(),r={impl:t};return i.memoizedState=r,function(){if((Oe&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},wc={readContext:pt,use:Ya,useCallback:uf,useContext:pt,useEffect:pc,useImperativeHandle:cf,useInsertionEffect:af,useLayoutEffect:rf,useMemo:df,useReducer:Ja,useRef:nf,useState:function(){return Ja(Pn)},useDebugValue:gc,useDeferredValue:function(t,i){var r=st();return hf(r,ze.memoizedState,t,i)},useTransition:function(){var t=Ja(Pn)[0],i=st().memoizedState;return[typeof t=="boolean"?t:Do(t),i]},useSyncExternalStore:qh,useId:gf,useHostTransitionStatus:xc,useFormState:Zh,useActionState:Zh,useOptimistic:function(t,i){var r=st();return $h(r,ze,t,i)},useMemoCache:uc,useCacheRefresh:yf};wc.useEffectEvent=of;var Sf={readContext:pt,use:Ya,useCallback:uf,useContext:pt,useEffect:pc,useImperativeHandle:cf,useInsertionEffect:af,useLayoutEffect:rf,useMemo:df,useReducer:hc,useRef:nf,useState:function(){return hc(Pn)},useDebugValue:gc,useDeferredValue:function(t,i){var r=st();return ze===null?yc(r,t,i):hf(r,ze.memoizedState,t,i)},useTransition:function(){var t=hc(Pn)[0],i=st().memoizedState;return[typeof t=="boolean"?t:Do(t),i]},useSyncExternalStore:qh,useId:gf,useHostTransitionStatus:xc,useFormState:tf,useActionState:tf,useOptimistic:function(t,i){var r=st();return ze!==null?$h(r,ze,t,i):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:uc,useCacheRefresh:yf};Sf.useEffectEvent=of;function Sc(t,i,r,u){i=t.memoizedState,r=r(u,i),r=r==null?i:b({},i,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var _c={enqueueSetState:function(t,i,r){t=t._reactInternals;var u=Ft(),g=cs(u);g.payload=i,r!=null&&(g.callback=r),i=us(t,g,u),i!==null&&(Lt(i,t,u),ko(i,t,u))},enqueueReplaceState:function(t,i,r){t=t._reactInternals;var u=Ft(),g=cs(u);g.tag=1,g.payload=i,r!=null&&(g.callback=r),i=us(t,g,u),i!==null&&(Lt(i,t,u),ko(i,t,u))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var r=Ft(),u=cs(r);u.tag=2,i!=null&&(u.callback=i),i=us(t,u,r),i!==null&&(Lt(i,t,r),ko(i,t,r))}};function _f(t,i,r,u,g,x,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,x,S):i.prototype&&i.prototype.isPureReactComponent?!So(r,u)||!So(g,x):!0}function Tf(t,i,r,u){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(r,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(r,u),i.state!==t&&_c.enqueueReplaceState(i,i.state,null)}function Ys(t,i){var r=i;if("ref"in i){r={};for(var u in i)u!=="ref"&&(r[u]=i[u])}if(t=t.defaultProps){r===i&&(r=b({},r));for(var g in t)r[g]===void 0&&(r[g]=t[g])}return r}function Cf(t){Ra(t)}function Ef(t){console.error(t)}function Nf(t){Ra(t)}function Xa(t,i){try{var r=t.onUncaughtError;r(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Af(t,i,r){try{var u=t.onCaughtError;u(r.value,{componentStack:r.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Tc(t,i,r){return r=cs(r),r.tag=3,r.payload={element:null},r.callback=function(){Xa(t,i)},r}function Rf(t){return t=cs(t),t.tag=3,t}function kf(t,i,r,u){var g=r.type.getDerivedStateFromError;if(typeof g=="function"){var x=u.value;t.payload=function(){return g(x)},t.callback=function(){Af(i,r,u)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){Af(i,r,u),t
vendor: 4,453 bytes, line 48
48ypeof g!="function"&&(gs===null?gs=new Set([this]):gs.add(this));var T=u.stack;this.componentDidCatch(u.value,{componentStack:T!==null?T:""})})}function cx(t,i,r,u,g){if(r.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=r.alternate,i!==null&&_i(i,r,g,!0),r=Bt.current,r!==null){switch(r.tag){case 31:case 13:return nn===null?ur():r.alternate===null&&et===0&&(et=3),r.flags&=-257,r.flags|=65536,r.lanes=g,u===Ga?r.flags|=16384:(i=r.updateQueue,i===null?r.updateQueue=new Set([u]):i.add(u),Kc(t,u,g)),!1;case 22:return r.flags|=65536,u===Ga?r.flags|=16384:(i=r.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},r.updateQueue=i):(r=i.retryQueue,r===null?i.retryQueue=new Set([u]):r.add(u)),Kc(t,u,g)),!1}throw Error(o(435,r.tag))}return Kc(t,u,g),ur(),!1}if(je)return i=Bt.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,u!==zl&&(t=Error(o(422),{cause:u}),Co(Xt(t,r)))):(u!==zl&&(i=Error(o(423),{cause:u}),Co(Xt(i,r))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,u=Xt(u,r),g=Tc(t.stateNode,u,g),ec(t,g),et!==4&&(et=2)),!1;var x=Error(o(520),{cause:u});if(x=Xt(x,r),Vo===null?Vo=[x]:Vo.push(x),et!==4&&(et=2),i===null)return!0;u=Xt(u,r),r=i;do{switch(r.tag){case 3:return r.flags|=65536,t=g&-g,r.lanes|=t,t=Tc(r.stateNode,u,t),ec(r,t),!1;case 1:if(i=r.type,x=r.stateNode,(r.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(gs===null||!gs.has(x))))return r.flags|=65536,g&=-g,r.lanes|=g,g=Rf(g),kf(g,t,r,u),ec(r,g),!1}r=r.return}while(r!==null);return!1}var Cc=Error(o(461)),at=!1;function gt(t,i,r,u){i.child=t===null?Mh(i,null,r,u):Fs(i,t.child,r,u)}function jf(t,i,r,u,g){r=r.render;var x=i.ref;if("ref"in u){var S={};for(var T in u)T!=="ref"&&(S[T]=u[T])}else S=u;return Bs(i),u=ac(t,i,r,S,x,g),T=rc(),t!==null&&!at?(lc(t,i,g),On(t,i,g)):(je&&T&&Bl(i),i.flags|=1,gt(t,i,u,g),i.child)}function If(t,i,r,u,g){if(t===null){var x=r.type;return typeof x=="function"&&!Ol(x)&&x.defaultProps===void 0&&r.compare===null?(i.tag=15,i.type=x,Mf(t,i,x,u,g)):(t=Ma(r.type,null,u,i,i.mode,g),t.ref=i.ref,t.return=i,i.child=t)}if(x=t.child,!Mc(t,g)){var S=x.memoizedProps;if(r=r.compare,r=r!==null?r:So,r(S,u)&&t.ref===i.ref)return On(t,i,g)}return i.flags|=1,t=In(x,u),t.ref=i.ref,t.return=i,i.child=t}function Mf(t,i,r,u,g){if(t!==null){var x=t.memoizedProps;if(So(x,u)&&t.ref===i.ref)if(at=!1,i.pendingProps=u=x,Mc(t,g))(t.flags&131072)!==0&&(at=!0);else return i.lanes=t.lanes,On(t,i,g)}return Ec(t,i,r,u,g)}function Df(t,i,r,u){var g=u.children,x=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|r:r,t!==null){for(u=i.child=t.child,g=0;u!==null;)g=g|u.lanes|u.childLanes,u=u.sibling;u=g&~x}else u=0,i.child=null;return Uf(t,i,x,r,u)}if((r&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Pa(i,x!==null?x.cachePool:null),x!==null?Lh(i,x):nc(),Ph(i);else return u=i.lanes=536870912,Uf(t,i,x!==null?x.baseLanes|r:r,r,u)}else x!==null?(Pa(i,x.cachePool),Lh(i,x),hs(),i.memoizedState=null):(t!==null&&Pa(i,null),nc(),hs());return gt(t,i,g,r),i.child}function Po(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Uf(t,i,r,u,g){var x=Ql();return x=x===null?null:{parent:it._currentValue,pool:x},i.memoizedState={baseLanes:r,cachePool:x},t!==null&&Pa(i,null),nc(),Ph(i),t!==null&&_i(t,i,u,!0),i.childLanes=g,null}function Za(t,i){return i=tr({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Lf(t,i,r){return Fs(i,t.child,null,r),t=Za(i,i.pendingProps),t.flags|=2,Ht(i),i.memoizedState=null,t}function ux(t,i,r){var u=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(je){if(u.mode==="hidden")return t=Za(i,u),i.lanes=536870912,Po(null,t);if(ic(i),(t=Je)?(t=Jm(t,tn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:is!==null?{id:_n,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},r=vh(t),r.return=i,i.child=r,mt=i,Je=null)):t=null,t===null)throw as(i);return i.lanes=536870912,null}return Za(i,u)}var x=t.memoizedState;if(x!==null){var S=x.dehydrated;if(ic(i),g)if(i.flags&256)i.flags&=-257,i=Lf(t,i,r);
vendor: 4,533 bytes, line 48
48else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(o(558));else if(at||_i(t,i,r,!1),g=(r&t.childLanes)!==0,at||g){if(u=$e,u!==null&&(S=Cd(u,r),S!==0&&S!==x.retryLane))throw x.retryLane=S,Ps(t,S),Lt(u,t,S),Cc;ur(),i=Lf(t,i,r)}else t=x.treeContext,Je=sn(S.nextSibling),mt=i,je=!0,os=null,tn=!1,t!==null&&wh(i,t),i=Za(i,u),i.flags|=4096;return i}return t=In(t.child,{mode:u.mode,children:u.children}),t.ref=i.ref,i.child=t,t.return=i,t}function er(t,i){var r=i.ref;if(r===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(t===null||t.ref!==r)&&(i.flags|=4194816)}}function Ec(t,i,r,u,g){return Bs(i),r=ac(t,i,r,u,void 0,g),u=rc(),t!==null&&!at?(lc(t,i,g),On(t,i,g)):(je&&u&&Bl(i),i.flags|=1,gt(t,i,r,g),i.child)}function Pf(t,i,r,u,g,x){return Bs(i),i.updateQueue=null,r=Gh(i,u,r,g),Oh(t),u=rc(),t!==null&&!at?(lc(t,i,x),On(t,i,x)):(je&&u&&Bl(i),i.flags|=1,gt(t,i,r,x),i.child)}function Of(t,i,r,u,g){if(Bs(i),i.stateNode===null){var x=xi,S=r.contextType;typeof S=="object"&&S!==null&&(x=pt(S)),x=new r(u,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=_c,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=u,x.state=i.memoizedState,x.refs={},Xl(i),S=r.contextType,x.context=typeof S=="object"&&S!==null?pt(S):xi,x.state=i.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(Sc(i,r,S,u),x.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(S=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),S!==x.state&&_c.enqueueReplaceState(x,x.state,null),Io(i,u,x,g),jo(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(t===null){x=i.stateNode;var T=i.memoizedProps,N=Ys(r,T);x.props=N;var O=x.context,Y=r.contextType;S=xi,typeof Y=="object"&&Y!==null&&(S=pt(Y));var W=r.getDerivedStateFromProps;Y=typeof W=="function"||typeof x.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,Y||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T||O!==S)&&Tf(i,x,u,S),ls=!1;var B=i.memoizedState;x.state=B,Io(i,u,x,g),jo(),O=i.memoizedState,T||B!==O||ls?(typeof W=="function"&&(Sc(i,r,W,u),O=i.memoizedState),(N=ls||_f(i,r,N,u,B,O,S))?(Y||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=O),x.props=u,x.state=O,x.context=S,u=N):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{x=i.stateNode,Zl(t,i),S=i.memoizedProps,Y=Ys(r,S),x.props=Y,W=i.pendingProps,B=x.context,O=r.contextType,N=xi,typeof O=="object"&&O!==null&&(N=pt(O)),T=r.getDerivedStateFromProps,(O=typeof T=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(S!==W||B!==N)&&Tf(i,x,u,N),ls=!1,B=i.memoizedState,x.state=B,Io(i,u,x,g),jo();var V=i.memoizedState;S!==W||B!==V||ls||t!==null&&t.dependencies!==null&&Ua(t.dependencies)?(typeof T=="function"&&(Sc(i,r,T,u),V=i.memoizedState),(Y=ls||_f(i,r,Y,u,B,V,N)||t!==null&&t.dependencies!==null&&Ua(t.dependencies))?(O||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,V,N),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,V,N)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||S===t.memoizedProps&&B===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&B===t.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=V),x.props=u,x.state=V,x.context=N,u=Y):(typeof x.componentDidUpdate!="function"||S===t.memoizedProps&&B===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&B===t.memoizedState||(i.flags|=1024),u=!1)}
vendor: 2,553 bytes, line 48
48return x=u,er(t,i),u=(i.flags&128)!==0,x||u?(x=i.stateNode,r=u&&typeof r.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,t!==null&&u?(i.child=Fs(i,t.child,null,g),i.child=Fs(i,null,r,g)):gt(t,i,r,g),i.memoizedState=x.state,t=i.child):t=On(t,i,g),t}function Gf(t,i,r,u){return Gs(),i.flags|=256,gt(t,i,r,u),i.child}var Nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ac(t){return{baseLanes:t,cachePool:Nh()}}function Rc(t,i,r){return t=t!==null?t.childLanes&~r:0,i&&(t|=Vt),t}function qf(t,i,r){var u=i.pendingProps,g=!1,x=(i.flags&128)!==0,S;if((S=x)||(S=t!==null&&t.memoizedState===null?!1:(nt.current&2)!==0),S&&(g=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,t===null){if(je){if(g?ds(i):hs(),(t=Je)?(t=Jm(t,tn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:is!==null?{id:_n,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},r=vh(t),r.return=i,i.child=r,mt=i,Je=null)):t=null,t===null)throw as(i);return du(t)?i.lanes=32:i.lanes=536870912,null}var T=u.children;return u=u.fallback,g?(hs(),g=i.mode,T=tr({mode:"hidden",children:T},g),u=Os(u,g,r,null),T.return=i,u.return=i,T.sibling=u,i.child=T,u=i.child,u.memoizedState=Ac(r),u.childLanes=Rc(t,S,r),i.memoizedState=Nc,Po(null,u)):(ds(i),kc(i,T))}var N=t.memoizedState;if(N!==null&&(T=N.dehydrated,T!==null)){if(x)i.flags&256?(ds(i),i.flags&=-257,i=jc(t,i,r)):i.memoizedState!==null?(hs(),i.child=t.child,i.flags|=128,i=null):(hs(),T=u.fallback,g=i.mode,u=tr({mode:"visible",children:u.children},g),T=Os(T,g,r,null),T.flags|=2,u.return=i,T.return=i,u.sibling=T,i.child=u,Fs(i,t.child,null,r),u=i.child,u.memoizedState=Ac(r),u.childLanes=Rc(t,S,r),i.memoizedState=Nc,i=Po(null,u));else if(ds(i),du(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var O=S.dgst;S=O,u=Error(o(419)),u.stack="",u.digest=S,Co({value:u,source:null,stack:null}),i=jc(t,i,r)}else if(at||_i(t,i,r,!1),S=(r&t.childLanes)!==0,at||S){if(S=$e,S!==null&&(u=Cd(S,r),u!==0&&u!==N.retryLane))throw N.retryLane=u,Ps(t,u),Lt(S,t,u),Cc;uu(T)||ur(),i=jc(t,i,r)}else uu(T)?(i.flags|=192,i.child=t.child,i=null):(t=N.treeContext,Je=sn(T.nextSibling),mt=i,je=!0,os=null,tn=!1,t!==null&&wh(i,t),i=kc(i,u.children),i.flags|=4096);return i}return g?(hs(),T=u.fallback,g=i.mode,N=t.child,O=N.sibling,u=In(N,{mode:"hidden",children:u.children}),u.subtreeFlags=N.subtreeFlags&65011712,O!==null?T=In(O,T):(T=Os(T,g,r,null),T.flags|=2),T.return=i,u.return=i,u.sibling=T,i.child=u,Po(null,u),u=i.child,T=t.child.memoizedState,T===null?T=Ac(r):(g=T.cac
vendor: 6,530 bytes, line 48
48hePool,g!==null?(N=it._currentValue,g=g.parent!==N?{parent:N,pool:N}:g):g=Nh(),T={baseLanes:T.baseLanes|r,cachePool:g}),u.memoizedState=T,u.childLanes=Rc(t,S,r),i.memoizedState=Nc,Po(t.child,u)):(ds(i),r=t.child,t=r.sibling,r=In(r,{mode:"visible",children:u.children}),r.return=i,r.sibling=null,t!==null&&(S=i.deletions,S===null?(i.deletions=[t],i.flags|=16):S.push(t)),i.child=r,i.memoizedState=null,r)}function kc(t,i){return i=tr({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function tr(t,i){return t=qt(22,t,null,i),t.lanes=0,t}function jc(t,i,r){return Fs(i,t.child,null,r),t=kc(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Bf(t,i,r){t.lanes|=i;var u=t.alternate;u!==null&&(u.lanes|=i),$l(t.return,i,r)}function Ic(t,i,r,u,g,x){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:r,tailMode:g,treeForkCount:x}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=u,S.tail=r,S.tailMode=g,S.treeForkCount=x)}function Hf(t,i,r){var u=i.pendingProps,g=u.revealOrder,x=u.tail;u=u.children;var S=nt.current,T=(S&2)!==0;if(T?(S=S&1|2,i.flags|=128):S&=1,J(nt,S),gt(t,i,u,r),u=je?To:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bf(t,r,i);else if(t.tag===19)Bf(t,r,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(g){case"forwards":for(r=i.child,g=null;r!==null;)t=r.alternate,t!==null&&za(t)===null&&(g=r),r=r.sibling;r=g,r===null?(g=i.child,i.child=null):(g=r.sibling,r.sibling=null),Ic(i,!1,g,r,x,u);break;case"backwards":case"unstable_legacy-backwards":for(r=null,g=i.child,i.child=null;g!==null;){if(t=g.alternate,t!==null&&za(t)===null){i.child=g;break}t=g.sibling,g.sibling=r,r=g,g=t}Ic(i,!0,r,null,x,u);break;case"together":Ic(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function On(t,i,r){if(t!==null&&(i.dependencies=t.dependencies),ps|=i.lanes,(r&i.childLanes)===0)if(t!==null){if(_i(t,i,r,!1),(r&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(o(153));if(i.child!==null){for(t=i.child,r=In(t,t.pendingProps),i.child=r,r.return=i;t.sibling!==null;)t=t.sibling,r=r.sibling=In(t,t.pendingProps),r.return=i;r.sibling=null}return i.child}function Mc(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Ua(t)))}function dx(t,i,r){switch(i.tag){case 3:Qe(i,i.stateNode.containerInfo),rs(i,it,t.memoizedState.cache),Gs();break;case 27:case 5:At(i);break;case 4:Qe(i,i.stateNode.containerInfo);break;case 10:rs(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ic(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ds(i),i.flags|=128,null):(r&i.child.childLanes)!==0?qf(t,i,r):(ds(i),t=On(t,i,r),t!==null?t.sibling:null);ds(i);break;case 19:var g=(t.flags&128)!==0;if(u=(r&i.childLanes)!==0,u||(_i(t,i,r,!1),u=(r&i.childLanes)!==0),g){if(u)return Hf(t,i,r);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),J(nt,nt.current),u)break;return null;case 22:return i.lanes=0,Df(t,i,r,i.pendingProps);case 24:rs(i,it,t.memoizedState.cache)}return On(t,i,r)}function zf(t,i,r){if(t!==null)if(t.memoizedProps!==i.pendingProps)at=!0;else{if(!Mc(t,r)&&(i.flags&128)===0)return at=!1,dx(t,i,r);at=(t.flags&131072)!==0}else at=!1,je&&(i.flags&1048576)!==0&&bh(i,To,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")Ol(t)?(u=Ys(t,u),i.tag=1,i=Of(null,i,t,u,r)):(i.tag=0,i=Ec(null,i,t,u,r));else{if(t!=null){var g=t.$$typeof;if(g===F){i.tag=11,i=jf(null,i,t,u,r);break e}else if(g===H){i.tag=14,i=If(null,i,t,u,r);break e}}throw i=fe(t)||t,Error(o(306,i,""))}}return i;case 0:return Ec(t,i,i.type,i.pendingProps,r);case 1:return u=i.type,g=Ys(u,i.pendingProps),Of(t,i,u,g,r);case 3:e:{if(Qe(i,i.stateNode.containerInfo),t===null)throw Error(o(387));u=i.pendingProps;var x=i.memoizedState;g=x.element,Zl(t,i),Io(i,u,null,r);var S=i.memoizedState;if(u=S.cache,rs(i,it,u),u!==x.cache&&Yl(i,[it],r,!0),jo(),u=S.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Gf(t,i,u,r);break e}else if(u!==g){g=Xt(Error(o(424)),i),Co(g),i=Gf(t,i,u,r);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Je=sn(t.firstChild),mt=i,je=!0,os=null,tn=!0,r=Mh(i,null,u,r),i.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Gs(),u===g){i=On(t,i,r);break e}gt(t,i,u,r)}i=i.child}return i;case 26:return er(t,i),t===null?(r=ep(i.type,null,i.pendingProps,null))?i.memoizedState=r:je||(r=i.type,t=i.pendingProps,u=yr(ue.current).createElement(r),u[ft]=i,u[kt]=t,yt(u,r,t),ut(u),i.stateNode=u):i.memoizedState=ep(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return At(i),t===null&&je&&(u=i.stateNode=Wm(i.type,i.pendingProps,ue.current),mt=i,tn=!0,g=Je,bs(i.type)?(hu=g,Je=sn(u.firstChild)):Je=g),gt(t,i,i.pendingProps.children,r),er(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&je&&((g=u=Je)&&(u=Bx(u,i.type,i.pendingProps,tn),u!==null?(i.stateNode=u,mt=i,Je=sn(u.firstChild),tn=!1,g=!0):g=!1),g||as(i)),At(i),g=i.type,x=i.pendingProps,S=t!==null?t.memoizedProps:null,u=x.children,ru(g,x)?u=null:S!==null&&ru(g,S)&&(i.flags|=32),i.memoizedState!==null&&(g=ac(t,i,nx,null,null,r),Xo._currentValue=g),er(t,i),gt(t,i,u,r),i.child;case 6:return t===null&&je&&((t=r=Je)&&(r=Hx(r,i.pendingProps,tn),r!==null?(i.stateNode=r,mt=i,Je=null,t=!0):t=!1),t||as(i)),null;case 13:return qf(t,i,r);case 4:return Qe(i,i.stateNode.containerInfo),u=i.pendingProps,t===null?i.child=Fs(i,null,u,r):gt(t,i,u,r),i.child;case 11:return jf(t,i,i.type,i.pendingProps,r);case 7:return gt(t,i,i.pendingProps,r),i.child;case 8:return gt(t,i,i.pendingProps.children,r),i.child;case 12:return gt(t,i,i.pendingProps.children,r),i.child;case 10:return u=i.pendingProps,rs(i,i.type,u.value),gt(t,i,u.children,r),i.child;case 9:return g=i.type._context,u=i.pendingProps.children,Bs(i),g=pt(g),u=u(g),i.flags|=1,gt(t,i,u,r),i.child;case 14:return If(t,i,i.type,i.pendingProps,r);case 15:return Mf(t,i,i.type,i.pendingProps,r);case 19:return Hf(t,i,r);case 31:return ux(t,i,r);case 22:return Df(t,i,r,i.pendingProps);
vendor: 9,023 bytes, line 48
48case 24:return Bs(i),u=pt(it),t===null?(g=Ql(),g===null&&(g=$e,x=Jl(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=r),g=x),i.memoizedState={parent:u,cache:g},Xl(i),rs(i,it,g)):((t.lanes&r)!==0&&(Zl(t,i),Io(i,null,null,r),jo()),g=t.memoizedState,x=i.memoizedState,g.parent!==u?(g={parent:u,cache:u},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),rs(i,it,u)):(u=x.cache,rs(i,it,u),u!==g.cache&&Yl(i,[it],r,!0))),gt(t,i,i.pendingProps.children,r),i.child;case 29:throw i.pendingProps}throw Error(o(156,i.tag))}function Gn(t){t.flags|=4}function Dc(t,i,r,u,g){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(gm())t.flags|=8192;else throw Vs=Ga,Wl}else t.flags&=-16777217}function Vf(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!op(i))if(gm())t.flags|=8192;else throw Vs=Ga,Wl}function nr(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Sd():536870912,t.lanes|=i,Ui|=i)}function Oo(t,i){if(!je)switch(t.tailMode){case"hidden":i=t.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Ke(t){var i=t.alternate!==null&&t.alternate.child===t.child,r=0,u=0;if(i)for(var g=t.child;g!==null;)r|=g.lanes|g.childLanes,u|=g.subtreeFlags&65011712,u|=g.flags&65011712,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)r|=g.lanes|g.childLanes,u|=g.subtreeFlags,u|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=u,t.childLanes=r,i}function hx(t,i,r){var u=i.pendingProps;switch(Hl(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(i),null;case 1:return Ke(i),null;case 3:return r=i.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Un(it),Be(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Si(i)?Gn(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Vl())),Ke(i),null;case 26:var g=i.type,x=i.memoizedState;return t===null?(Gn(i),x!==null?(Ke(i),Vf(i,x)):(Ke(i),Dc(i,g,null,u,r))):x?x!==t.memoizedState?(Gn(i),Ke(i),Vf(i,x)):(Ke(i),i.flags&=-16777217):(t=t.memoizedProps,t!==u&&Gn(i),Ke(i),Dc(i,g,t,u,r)),null;case 27:if(Pt(i),r=ue.current,g=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==u&&Gn(i);else{if(!u){if(i.stateNode===null)throw Error(o(166));return Ke(i),null}t=ee.current,Si(i)?Sh(i):(t=Wm(g,u,r),i.stateNode=t,Gn(i))}return Ke(i),null;case 5:if(Pt(i),g=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==u&&Gn(i);else{if(!u){if(i.stateNode===null)throw Error(o(166));return Ke(i),null}if(x=ee.current,Si(i))Sh(i);else{var S=yr(ue.current);switch(x){case 1:x=S.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:x=S.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":x=S.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":x=S.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":x=S.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?S.createElement(g,{is:u.is}):S.createElement(g)}}x[ft]=i,x[kt]=u;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)x.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=x;e:switch(yt(x,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Gn(i)}}return Ke(i),Dc(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,r),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==u&&Gn(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(o(166));if(t=ue.current,Si(i)){if(t=i.stateNode,r=i.memoizedProps,u=null,g=mt,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}t[ft]=i,t=!!(t.nodeValue===r||u!==null&&u.suppressHydrationWarning===!0||qm(t.nodeValue,r)),t||as(i,!0)}else t=yr(t).createTextNode(u),t[ft]=i,i.stateNode=t}return Ke(i),null;case 31:if(r=i.memoizedState,t===null||t.memoizedState!==null){if(u=Si(i),r!==null){if(t===null){if(!u)throw Error(o(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[ft]=i}else Gs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ke(i),t=!1}else r=Vl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return i.flags&256?(Ht(i),i):(Ht(i),null);if((i.flags&128)!==0)throw Error(o(558))}return Ke(i),null;case 13:if(u=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=Si(i),u!==null&&u.dehydrated!==null){if(t===null){if(!g)throw Error(o(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));g[ft]=i}else Gs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ke(i),g=!1}else g=Vl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Ht(i),i):(Ht(i),null)}return Ht(i),(i.flags&128)!==0?(i.lanes=r,i):(r=u!==null,t=t!==null&&t.memoizedState!==null,r&&(u=i.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==g&&(u.flags|=2048)),r!==t&&r&&(i.child.flags|=8192),nr(i,i.updateQueue),Ke(i),null);case 4:return Be(),t===null&&nu(i.stateNode.containerInfo),Ke(i),null;case 10:return Un(i.type),Ke(i),null;case 19:if(M(nt),u=i.memoizedState,u===null)return Ke(i),null;if(g=(i.flags&128)!==0,x=u.rendering,x===null)if(g)Oo(u,!1);else{if(et!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(x=za(t),x!==null){for(i.flags|=128,Oo(u,!1),t=x.updateQueue,i.updateQueue=t,nr(i,t),i.subtreeFlags=0,t=r,r=i.child;r!==null;)yh(r,t),r=r.sibling;return J(nt,nt.current&1|2),je&&Mn(i,u.treeForkCount),i.child}t=t.sibling}u.tail!==null&&ct()>rr&&(i.flags|=128,g=!0,Oo(u,!1),i.lanes=4194304)}else{if(!g)if(t=za(x),t!==null){if(i.flags|=128,g=!0,t=t.updateQueue,i.updateQueue=t,nr(i,t),Oo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!x.alternate&&!je)return Ke(i),null}else 2*ct()-u.renderingStartTime>rr&&r!==536870912&&(i.flags|=128,g=!0,Oo(u,!1),i.lanes=4194304);u.isBackwards?(x.sibling=i.child,i.child=x):(t=u.last,t!==null?t.sibling=x:i.child=x,u.last=x)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ct(),t.sibling=null,r=nt.current,J(nt,g?r&1|2:r&1),je&&Mn(i,u.treeForkCount),t):(Ke(i),null);case 22:case 23:return Ht(i),sc(),u=i.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(r&536870912)!==0&&(i.flags&128)===0&&(Ke(i),i.subtreeFlags&6&&(i.flags|=8192)):Ke(i),r=i.updateQueue,r!==null&&nr(i,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==r&&(i.flags|=2048),t!==null&&M(Hs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Un(it),Ke(i),null;case 25:return null;case 30:return null}throw Error(o(156,i.tag))}function fx(t,i){switch(Hl(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Un(it),Be(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Pt(i),null;case 31:if(i.memoizedState!==null){if(Ht(i),i.alternate===null)throw Error(o(340));Gs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Ht(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(o(340));Gs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return M(nt),null;case 4:return Be(),null;case 10:return Un(i.type),null;case 22:case 23:return Ht(i),sc(),t!==null&&M(Hs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Un(it),null;case 25:return null;default:return null}}function Ff(t,i){switch(Hl(i),i.tag){case 3:Un(it),Be();break;case 26:case 27:case 5:Pt(i);break;case 4:Be();break;case 31:i.memoizedState!==null&&Ht(i);break;case 13:Ht(i);break;case 19:M(nt);break;case 10:Un(i.type);break;case 22:case 23:Ht(i),sc(),t!==null&&M(Hs);break;case 24:Un(it)}}function Go(t,i){try{var r=i.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var g=u.next;r=g;do{if((r.tag&t)===t){u=void 0;var x=r.create,S=r.inst;u=x(),S.destroy=u}r=r.next}
vendor: 18,867 bytes, line 48
48while(r!==g)}}catch(T){qe(i,i.return,T)}}function fs(t,i,r){try{var u=i.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var x=g.next;u=x;do{if((u.tag&t)===t){var S=u.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,g=i;var N=r,O=T;try{O()}catch(Y){qe(g,N,Y)}}}u=u.next}while(u!==x)}}catch(Y){qe(i,i.return,Y)}}function $f(t){var i=t.updateQueue;if(i!==null){var r=t.stateNode;try{Uh(i,r)}catch(u){qe(t,t.return,u)}}}function Yf(t,i,r){r.props=Ys(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(u){qe(t,i,u)}}function qo(t,i){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof r=="function"?t.refCleanup=r(u):r.current=u}}catch(g){qe(t,i,g)}}function Cn(t,i){var r=t.ref,u=t.refCleanup;if(r!==null)if(typeof u=="function")try{u()}catch(g){qe(t,i,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(g){qe(t,i,g)}else r.current=null}function Jf(t){var i=t.type,r=t.memoizedProps,u=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":r.autoFocus&&u.focus();break e;case"img":r.src?u.src=r.src:r.srcSet&&(u.srcset=r.srcSet)}}catch(g){qe(t,t.return,g)}}function Uc(t,i,r){try{var u=t.stateNode;Ux(u,t.type,r,i),u[kt]=i}catch(g){qe(t,t.return,g)}}function Kf(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bs(t.type)||t.tag===4}function Lc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Kf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pc(t,i,r){var u=t.tag;if(u===5||u===6)t=t.stateNode,i?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,i):(i=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,i.appendChild(t),r=r._reactRootContainer,r!=null||i.onclick!==null||(i.onclick=kn));else if(u!==4&&(u===27&&bs(t.type)&&(r=t.stateNode,i=null),t=t.child,t!==null))for(Pc(t,i,r),t=t.sibling;t!==null;)Pc(t,i,r),t=t.sibling}function sr(t,i,r){var u=t.tag;if(u===5||u===6)t=t.stateNode,i?r.insertBefore(t,i):r.appendChild(t);else if(u!==4&&(u===27&&bs(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(sr(t,i,r),t=t.sibling;t!==null;)sr(t,i,r),t=t.sibling}function Qf(t){var i=t.stateNode,r=t.memoizedProps;try{for(var u=t.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);yt(i,u,r),i[ft]=t,i[kt]=r}catch(x){qe(t,t.return,x)}}var qn=!1,rt=!1,Oc=!1,Wf=typeof WeakSet=="function"?WeakSet:Set,dt=null;function mx(t,i){if(t=t.containerInfo,ou=Tr,t=lh(t),jl(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var u=r.getSelection&&r.getSelection();if(u&&u.rangeCount!==0){r=u.anchorNode;var g=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{r.nodeType,x.nodeType}catch{r=null;break e}var S=0,T=-1,N=-1,O=0,Y=0,W=t,B=null;t:for(;;){for(var V;W!==r||g!==0&&W.nodeType!==3||(T=S+g),W!==x||u!==0&&W.nodeType!==3||(N=S+u),W.nodeType===3&&(S+=W.nodeValue.length),(V=W.firstChild)!==null;)B=W,W=V;for(;;){if(W===t)break t;if(B===r&&++O===g&&(T=S),B===x&&++Y===u&&(N=S),(V=W.nextSibling)!==null)break;W=B,B=W.parentNode}W=V}r=T===-1||N===-1?null:{start:T,end:N}}else r=null}r=r||{start:0,end:0}}else r=null;for(au={focusedElem:t,selectionRange:r},Tr=!1,dt=i;dt!==null;)if(i=dt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,dt=t;else for(;dt!==null;){switch(i=dt,x=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r<t.length;r++)g=t[r],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,r=i,g=x.memoizedProps,x=x.memoizedState,u=r.stateNode;try{var re=Ys(r.type,g);t=u.getSnapshotBeforeUpdate(re,x),u.__reactInternalSnapshotBeforeUpdate=t}catch(pe){qe(r,r.return,pe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,r=t.nodeType,r===9)cu(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":cu(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(o(163))}if(t=i.sibling,t!==null){t.return=i.return,dt=t;break}dt=i.return}}function Xf(t,i,r){var u=r.flags;switch(r.tag){case 0:case 11:case 15:Hn(t,r),u&4&&Go(5,r);break;case 1:if(Hn(t,r),u&4)if(t=r.stateNode,i===null)try{t.componentDidMount()}catch(S){qe(r,r.return,S)}else{var g=Ys(r.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(g,i,t.__reactInternalSnapshotBeforeUpdate)}catch(S){qe(r,r.return,S)}}u&64&&$f(r),u&512&&qo(r,r.return);break;case 3:if(Hn(t,r),u&64&&(t=r.updateQueue,t!==null)){if(i=null,r.child!==null)switch(r.child.tag){case 27:case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}try{Uh(t,i)}catch(S){qe(r,r.return,S)}}break;case 27:i===null&&u&4&&Qf(r);case 26:case 5:Hn(t,r),i===null&&u&4&&Jf(r),u&512&&qo(r,r.return);break;case 12:Hn(t,r);break;case 31:Hn(t,r),u&4&&tm(t,r);break;case 13:Hn(t,r),u&4&&nm(t,r),u&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=_x.bind(null,r),zx(t,r))));break;case 22:if(u=r.memoizedState!==null||qn,!u){i=i!==null&&i.memoizedState!==null||rt,g=qn;var x=rt;qn=u,(rt=i)&&!x?zn(t,r,(r.subtreeFlags&8772)!==0):Hn(t,r),qn=g,rt=x}break;case 30:break;default:Hn(t,r)}}function Zf(t){var i=t.alternate;i!==null&&(t.alternate=null,Zf(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&ml(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var We=null,It=!1;function Bn(t,i,r){for(r=r.child;r!==null;)em(t,i,r),r=r.sibling}function em(t,i,r){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(Is,r)}catch{}switch(r.tag){case 26:rt||Cn(r,i),Bn(t,i,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:rt||Cn(r,i);var u=We,g=It;bs(r.type)&&(We=r.stateNode,It=!1),Bn(t,i,r),Ko(r.stateNode),We=u,It=g;break;case 5:rt||Cn(r,i);case 6:if(u=We,g=It,We=null,Bn(t,i,r),We=u,It=g,We!==null)if(It)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(r.stateNode)}catch(x){qe(r,i,x)}else try{We.removeChild(r.stateNode)}catch(x){qe(r,i,x)}break;case 18:We!==null&&(It?(t=We,$m(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),zi(t)):$m(We,r.stateNode));break;case 4:u=We,g=It,We=r.stateNode.containerInfo,It=!0,Bn(t,i,r),We=u,It=g;break;case 0:case 11:case 14:case 15:fs(2,r,i),rt||fs(4,r,i),Bn(t,i,r);break;case 1:rt||(Cn(r,i),u=r.stateNode,typeof u.componentWillUnmount=="function"&&Yf(r,i,u)),Bn(t,i,r);break;case 21:Bn(t,i,r);break;case 22:rt=(u=rt)||r.memoizedState!==null,Bn(t,i,r),rt=u;break;default:Bn(t,i,r)}}function tm(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{zi(t)}catch(r){qe(i,i.return,r)}}}function nm(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{zi(t)}catch(r){qe(i,i.return,r)}}function px(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Wf),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Wf),i;default:throw Error(o(435,t.tag))}}function ir(t,i){var r=px(t);i.forEach(function(u){if(!r.has(u)){r.add(u);var g=Tx.bind(null,t,u);u.then(g,g)}})}function Mt(t,i){var r=i.deletions;if(r!==null)for(var u=0;u<r.length;u++){var g=r[u],x=t,S=i,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(bs(T.type)){We=T.stateNode,It=!1;break e}break;case 5:We=T.stateNode,It=!1;break e;case 3:case 4:We=T.stateNode.containerInfo,It=!0;break e}T=T.return}if(We===null)throw Error(o(160));em(x,S,g),We=null,It=!1,x=g.alternate,x!==null&&(x.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)sm(i,t),i=i.sibling}var pn=null;function sm(t,i){var r=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mt(i,t),Dt(t),u&4&&(fs(3,t,t.return),Go(3,t),fs(5,t,t.return));break;case 1:Mt(i,t),Dt(t),u&512&&(rt||r===null||Cn(r,r.return)),u&64&&qn&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?u:r.concat(u))));break;case 26:var g=pn;if(Mt(i,t),Dt(t),u&512&&(rt||r===null||Cn(r,r.return)),u&4){var x=r!==null?r.memoizedState:null;if(u=t.memoizedState,r===null)if(u===null)if(t.stateNode===null){e:{u=t.type,r=t.memoizedProps,g=g.ownerDocument||g;t:switch(u){case"title":x=g.getElementsByTagName("title")[0],(!x||x[fo]||x[ft]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=g.createElement(u),g.head.insertBefore(x,g.querySelector("head > title"))),yt(x,u,r),x[ft]=t,ut(x),u=x;break e;case"link":var S=sp("link","href",g).get(u+(r.href||""));if(S){for(var T=0;T<S.length;T++)if(x=S[T],x.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&x.getAttribute("rel")===(r.rel==null?null:r.rel)&&x.getAttribute("title")===(r.title==null?null:r.title)&&x.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(T,1);break t}}x=g.createElement(u),yt(x,u,r),g.head.appendChild(x);break;case"meta":if(S=sp("meta","content",g).get(u+(r.content||""))){for(T=0;T<S.length;T++)if(x=S[T],x.getAttribute("content")===(r.content==null?null:""+r.content)&&x.getAttribute("name")===(r.name==null?null:r.name)&&x.getAttribute("property")===(r.property==null?null:r.property)&&x.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&x.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(T,1);break t}}x=g.createElement(u),yt(x,u,r),g.head.appendChild(x);break;default:throw Error(o(468,u))}x[ft]=t,ut(x),u=x}t.stateNode=u}else ip(g,t.type,t.stateNode);else t.stateNode=np(g,u,t.memoizedProps);else x!==u?(x===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):x.count--,u===null?ip(g,t.type,t.stateNode):np(g,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Uc(t,t.memoizedProps,r.memoizedProps)}break;case 27:Mt(i,t),Dt(t),u&512&&(rt||r===null||Cn(r,r.return)),r!==null&&u&4&&Uc(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Mt(i,t),Dt(t),u&512&&(rt||r===null||Cn(r,r.return)),t.flags&32){g=t.stateNode;try{hi(g,"")}catch(re){qe(t,t.return,re)}}u&4&&t.stateNode!=null&&(g=t.memoizedProps,Uc(t,g,r!==null?r.memoizedProps:g)),u&1024&&(Oc=!0);break;case 6:if(Mt(i,t),Dt(t),u&4){if(t.stateNode===null)throw Error(o(162));u=t.memoizedProps,r=t.stateNode;try{r.nodeValue=u}catch(re){qe(t,t.return,re)}}break;case 3:if(br=null,g=pn,pn=vr(i.containerInfo),Mt(i,t),pn=g,Dt(t),u&4&&r!==null&&r.memoizedState.isDehydrated)try{zi(i.containerInfo)}catch(re){qe(t,t.return,re)}Oc&&(Oc=!1,im(t));break;case 4:u=pn,pn=vr(t.stateNode.containerInfo),Mt(i,t),Dt(t),pn=u;break;case 12:Mt(i,t),Dt(t);break;case 31:Mt(i,t),Dt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,ir(t,u)));break;case 13:Mt(i,t),Dt(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(ar=ct()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,ir(t,u)));break;case 22:g=t.memoizedState!==null;var N=r!==null&&r.memoizedState!==null,O=qn,Y=rt;if(qn=O||g,rt=Y||N,Mt(i,t),rt=Y,qn=O,Dt(t),u&8192)e:for(i=t.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(r===null||N||qn||rt||Js(t)),r=null,i=t;;){if(i.tag===5||i.tag===26){if(r===null){N=r=i;try{if(x=N.stateNode,g)S=x.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=N.stateNode;var W=N.memoizedProps.style,B=W!=null&&W.hasOwnProperty("display")?W.display:null;T.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(re){qe(N,N.return,re)}}}else if(i.tag===6){if(r===null){N=i;try{N.stateNode.nodeValue=g?"":N.memoizedProps}catch(re){qe(N,N.return,re)}}}else if(i.tag===18){if(r===null){N=i;try{var V=N.stateNode;g?Ym(V,!0):Ym(N.stateNode,!1)}catch(re){qe(N,N.return,re)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;r===i&&(r=null),i=i.return}r===i&&(r=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=t.updateQueue,u!==null&&(r=u.retryQueue,r!==null&&(u.retryQueue=null,ir(t,r))));break;case 19:Mt(i,t),Dt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,ir(t,u)));break;case 30:break;case 21:break;default:Mt(i,t),Dt(t)}}function Dt(t){var i=t.flags;if(i&2){try{for(var r,u=t.return;u!==null;){if(Kf(u)){r=u;break}u=u.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var g=r.stateNode,x=Lc(t);sr(t,x,g);break;case 5:var S=r.stateNode;r.flags&32&&(hi(S,""),r.flags&=-33);var T=Lc(t);sr(t,T,S);break;case 3:case 4:var N=r.stateNode.containerInfo,O=Lc(t);Pc(t,O,N);break;default:throw Error(o(161))}}catch(Y){qe(t,t.return,Y)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function im(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;im(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Hn(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Xf(t,i.alternate,i),i=i.sibling}function Js(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:fs(4,i,i.return),Js(i);break;case 1:Cn(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&Yf(i,i.return,r),Js(i);break;case 27:Ko(i.stateNode);case 26:case 5:Cn(i,i.return),Js(i);break;case 22:i.memoizedState===null&&Js(i);break;case 30:Js(i);break;default:Js(i)}t=t.sibling}}function zn(t,i,r){for(r=r&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,g=t,x=i,S=x.flags;switch(x.tag){case 0:case 11:case 15:zn(g,x,r),Go(4,x);break;case 1:if(zn(g,x,r),u=x,g=u.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(O){qe(u,u.return,O)}if(u=x,g=u.updateQueue,g!==null){var T=u.stateNode;try{var N=g.shared.hiddenCallbacks;if(N!==null)for(g.shared.hiddenCallbacks=null,g=0;g<N.length;g++)Dh(N[g],T)}catch(O){qe(u,u.return,O)}}r&&S&64&&$f(x),qo(x,x.return);break;case 27:Qf(x);case 26:case 5:zn(g,x,r),r&&u===null&&S&4&&Jf(x),qo(x,x.return);break;case 12:zn(g,x,r);break;case 31:zn(g,x,r),r&&S&4&&tm(g,x);break;case 13:zn(g,x,r),r&&S&4&&nm(g,x);break;case 22:x.memoizedState===null&&zn(g,x,r),qo(x,x.return);break;case 30:break;default:zn(g,x,r)}i=i.sibling}}function Gc(t,i){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Eo(r))}function qc(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Eo(t))}function gn(t,i,r,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)om(t,i,r,u),i=i.sibling}function om(t,i,r,u){var g=i.flags;switch(i.tag){case 0:case 11:case 15:gn(t,i,r,u),g&2048&&Go(9,i);break;case 1:gn(t,i,r,u);break;case 3:gn(t,i,r,u),g&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Eo(t)));break;case 12:if(g&2048){gn(t,i,r,u),t=i.stateNode;try{var x=i.memoizedProps,S=x.id,T=x.onPostCommit;typeof T=="function"&&T(S,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(N){qe(i,i.return,N)}}else gn(t,i,r,u);break;case 31:gn(t,i,r,u);break;case 13:gn(t,i,r,u);break;case 23:break;case 22:x=i.stateNode,S=i.alternate,i.memoizedState!==null?x._visibility&2?gn(t,i,r,u):Bo(t,i):x._visibility&2?gn(t,i,r,u):(x._visibility|=2,Ii(t,i,r,u,(i.subtreeFlags&10256)!==0||!1)),g&2048&&Gc(S,i);break;case 24:gn(t,i,r,u),g&2048&&qc(i.alternate,i);break;default:gn(t,i,r,u)}}function Ii(t,i,r,u,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=t,S=i,T=r,N=u,O=S.flags;switch(S.tag){case 0:case 11:case 15:Ii(x,S,T,N,g),Go(8,S);break;case 23:break;case 22:var Y=S.stateNode;S.memoizedState!==null?Y._visibility&2?Ii(x,S,T,N,g):Bo(x,S):(Y._visibility|=2,Ii(x,S,T,N,g)),g&&O&2048&&Gc(S.alternate,S);break;case 24:Ii(x,S,T,N,g),g&&O&2048&&qc(S.alternate,S);break;default:Ii(x,S,T,N,g)}i=i.sibling}}function Bo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var r=t,u=i,g=u.flags;switch(u.tag){case 22:Bo(r,u),g&2048&&Gc(u.alternate,u);break;case 24:Bo(r,u),g&2048&&qc(u.alternate,u);break;default:Bo(r,u)}i=i.sibling}}var Ho=8192;function Mi(t,i,r){if(t.subtreeFlags&Ho)for(t=t.child;t!==null;)am(t,i,r),t=t.sibling}function am(t,i,r){switch(t.tag){case 26:Mi(t,i,r),t.flags&Ho&&t.memoizedState!==null&&tb(r,pn,t.memoizedState,t.memoizedProps);break;case 5:Mi(t,i,r);break;case 3:case 4:var u=pn;pn=vr(t.stateNode.containerInfo),Mi(t,i,r),pn=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Ho,Ho=16777216,Mi(t,i,r),Ho=u):Mi(t,i,r));break;default:Mi(t,i,r)}}function rm(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function zo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var u=i[r];dt=u,cm(u,t)}rm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)lm(t),t=t.sibling}function lm(t){switch(t.tag){case 0:case 11:case 15:zo(t),t.flags&2048&&fs(9,t,t.return);break;case 3:zo(t);break;case 12:zo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,or(t)):zo(t);break;default:zo(t)}}function or(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var u=i[r];dt=u,cm(u,t)}rm(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:fs(8,i,i.return),or(i);break;case 22:r=i.stateNode,r._visibility&2&&(r._visibility&=-3,or(i));break;default:or(i)}t=t.sibling}}function cm(t,i){for(;dt!==null;){var r=dt;switch(r.tag){case 0:case 11:case 15:fs(8,r,i);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var u=r.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Eo(r.memoizedState.cache)}if(u=r.child,u!==null)u.return=r,dt=u;else e:for(r=t;dt!==null;){u=dt;var g=u.sibling,x=u.return;if(Zf(u),u===r){dt=null;break e}if(g!==null){g.return=x,dt=g;break e}dt=x}}}var gx={getCacheForType:function(t){var i=pt(it),r=i.data.get(t);return r===void 0&&(r=t(),i.data.set(t,r)),r},cacheSignal:function(){return pt(it).controller.signal}},yx=typeof WeakMap=="function"?WeakMap:Map,Oe=0,$e=null,Ce=null,Re=0,Ge=0,zt=null,ms=!1,Di=!1,Bc=!1,Vn=0,et=0,ps=0,Ks=0,Hc=0,Vt=0,Ui=0,Vo=null,Ut=null,zc=!1,ar=0,um=0,rr=1/0,lr
vendor: 16,877 bytes, line 48
48=null,gs=null,lt=0,ys=null,Li=null,Fn=0,Vc=0,Fc=null,dm=null,Fo=0,$c=null;function Ft(){return(Oe&2)!==0&&Re!==0?Re&-Re:z.T!==null?Xc():Ed()}function hm(){if(Vt===0)if((Re&536870912)===0||je){var t=Sn;Sn<<=1,(Sn&3932160)===0&&(Sn=262144),Vt=t}else Vt=536870912;return t=Bt.current,t!==null&&(t.flags|=32),Vt}function Lt(t,i,r){(t===$e&&(Ge===2||Ge===9)||t.cancelPendingCommit!==null)&&(Pi(t,0),vs(t,Re,Vt,!1)),ho(t,r),((Oe&2)===0||t!==$e)&&(t===$e&&((Oe&2)===0&&(Ks|=r),et===4&&vs(t,Re,Vt,!1)),En(t))}function fm(t,i,r){if((Oe&6)!==0)throw Error(o(327));var u=!r&&(i&127)===0&&(i&t.expiredLanes)===0||An(t,i),g=u?bx(t,i):Jc(t,i,!0),x=u;do{if(g===0){Di&&!u&&vs(t,i,0,!1);break}else{if(r=t.current.alternate,x&&!vx(r)){g=Jc(t,i,!1),x=!1;continue}if(g===2){if(x=i,t.errorRecoveryDisabledLanes&x)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var T=t;g=Vo;var N=T.current.memoizedState.isDehydrated;if(N&&(Pi(T,S).flags|=256),S=Jc(T,S,!1),S!==2){if(Bc&&!N){T.errorRecoveryDisabledLanes|=x,Ks|=x,g=4;break e}x=Ut,Ut=g,x!==null&&(Ut===null?Ut=x:Ut.push.apply(Ut,x))}g=S}if(x=!1,g!==2)continue}}if(g===1){Pi(t,0),vs(t,i,0,!0);break}e:{switch(u=t,x=g,x){case 0:case 1:throw Error(o(345));case 4:if((i&4194048)!==i)break;case 6:vs(u,i,Vt,!ms);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(o(329))}if((i&62914560)===i&&(g=ar+300-ct(),10<g)){if(vs(u,i,Vt,!ms),ts(u,0,!0)!==0)break e;Fn=i,u.timeoutHandle=Vm(mm.bind(null,u,r,Ut,lr,zc,i,Vt,Ks,Ui,ms,x,"Throttled",-0,0),g);break e}mm(u,r,Ut,lr,zc,i,Vt,Ks,Ui,ms,x,null,-0,0)}}break}while(!0);En(t)}function mm(t,i,r,u,g,x,S,T,N,O,Y,W,B,V){if(t.timeoutHandle=-1,W=i.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},am(i,x,W);var re=(x&62914560)===x?ar-ct():(x&4194048)===x?um-ct():0;if(re=nb(W,re),re!==null){Fn=x,t.cancelPendingCommit=re(Sm.bind(null,t,i,x,r,u,g,S,T,N,Y,W,null,B,V)),vs(t,x,S,!O);return}}Sm(t,i,x,r,u,g,S,T,N)}function vx(t){for(var i=t;;){var r=i.tag;if((r===0||r===11||r===15)&&i.flags&16384&&(r=i.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var u=0;u<r.length;u++){var g=r[u],x=g.getSnapshot;g=g.value;try{if(!Gt(x(),g))return!1}catch{return!1}}if(r=i.child,i.subtreeFlags&16384&&r!==null)r.return=i,i=r;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function vs(t,i,r,u){i&=~Hc,i&=~Ks,t.suspendedLanes|=i,t.pingedLanes&=~i,u&&(t.warmLanes|=i),u=t.expirationTimes;for(var g=i;0<g;){var x=31-me(g),S=1<<x;u[x]=-1,g&=~S}r!==0&&_d(t,r,i)}function cr(){return(Oe&6)===0?($o(0),!1):!0}function Yc(){if(Ce!==null){if(Ge===0)var t=Ce.return;else t=Ce,Dn=qs=null,cc(t),Ni=null,Ao=0,t=Ce;for(;t!==null;)Ff(t.alternate,t),t=t.return;Ce=null}}function Pi(t,i){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,Ox(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),Fn=0,Yc(),$e=t,Ce=r=In(t.current,null),Re=i,Ge=0,zt=null,ms=!1,Di=An(t,i),Bc=!1,Ui=Vt=Hc=Ks=ps=et=0,Ut=Vo=null,zc=!1,(i&8)!==0&&(i|=i&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=i;0<u;){var g=31-me(u),x=1<<g;i|=t[g],u&=~x}return Vn=i,ka(),r}function pm(t,i){we=null,z.H=Lo,i===Ei||i===Oa?(i=kh(),Ge=3):i===Wl?(i=kh(),Ge=4):Ge=i===Cc?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zt=i,Ce===null&&(et=1,Xa(t,Xt(i,t.current)))}function gm(){var t=Bt.current;return t===null?!0:(Re&4194048)===Re?nn===null:(Re&62914560)===Re||(Re&536870912)!==0?t===nn:!1}function ym(){var t=z.H;return z.H=Lo,t===null?Lo:t}function vm(){var t=z.A;return z.A=gx,t}function ur(){et=4,ms||(Re&4194048)!==Re&&Bt.current!==null||(Di=!0),(ps&134217727)===0&&(Ks&134217727)===0||$e===null||vs($e,Re,Vt,!1)}function Jc(t,i,r){var u=Oe;Oe|=2;var g=ym(),x=vm();($e!==t||Re!==i)&&(lr=null,Pi(t,i)),i=!1;var S=et;e:do try{if(Ge!==0&&Ce!==null){var T=Ce,N=zt;switch(Ge){case 8:Yc(),S=6;break e;case 3:case 2:case 9:case 6:Bt.current===null&&(i=!0);var O=Ge;if(Ge=0,zt=null,Oi(t,T,N,O),r&&Di){S=0;break e}break;default:O=Ge,Ge=0,zt=null,Oi(t,T,N,O)}}xx(),S=et;break}catch(Y){pm(t,Y)}while(!0);return i&&t.shellSuspendCounter++,Dn=qs=null,Oe=u,z.H=g,z.A=x,Ce===null&&($e=null,Re=0,ka()),S}function xx(){for(;Ce!==null;)xm(Ce)}function bx(t,i){var r=Oe;Oe|=2;var u=ym(),g=vm();$e!==t||Re!==i?(lr=null,rr=ct()+500,Pi(t,i)):Di=An(t,i);e:do try{if(Ge!==0&&Ce!==null){i=Ce;var x=zt;t:switch(Ge){case 1:Ge=0,zt=null,Oi(t,i,x,1);break;case 2:case 9:if(Ah(x)){Ge=0,zt=null,bm(i);break}i=function(){Ge!==2&&Ge!==9||$e!==t||(Ge=7),En(t)},x.then(i,i);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Ah(x)?(Ge=0,zt=null,bm(i)):(Ge=0,zt=null,Oi(t,i,x,7));break;case 5:var S=null;switch(Ce.tag){case 26:S=Ce.memoizedState;case 5:case 27:var T=Ce;if(S?op(S):T.stateNode.complete){Ge=0,zt=null;var N=T.sibling;if(N!==null)Ce=N;else{var O=T.return;O!==null?(Ce=O,dr(O)):Ce=null}break t}}Ge=0,zt=null,Oi(t,i,x,5);break;case 6:Ge=0,zt=null,Oi(t,i,x,6);break;case 8:Yc(),et=6;break e;default:throw Error(o(462))}}wx();break}catch(Y){pm(t,Y)}while(!0);return Dn=qs=null,z.H=u,z.A=g,Oe=r,Ce!==null?0:($e=null,Re=0,ka(),et)}function wx(){for(;Ce!==null&&!si();)xm(Ce)}function xm(t){var i=zf(t.alternate,t,Vn);t.memoizedProps=t.pendingProps,i===null?dr(t):Ce=i}function bm(t){var i=t,r=i.alternate;switch(i.tag){case 15:case 0:i=Pf(r,i,i.pendingProps,i.type,void 0,Re);break;case 11:i=Pf(r,i,i.pendingProps,i.type.render,i.ref,Re);break;case 5:cc(i);default:Ff(r,i),i=Ce=yh(i,Vn),i=zf(r,i,Vn)}t.memoizedProps=t.pendingProps,i===null?dr(t):Ce=i}function Oi(t,i,r,u){Dn=qs=null,cc(i),Ni=null,Ao=0;var g=i.return;try{if(cx(t,g,i,r,Re)){et=1,Xa(t,Xt(r,t.current)),Ce=null;return}}catch(x){if(g!==null)throw Ce=g,x;et=1,Xa(t,Xt(r,t.current)),Ce=null;return}i.flags&32768?(je||u===1?t=!0:Di||(Re&536870912)!==0?t=!1:(ms=t=!0,(u===2||u===9||u===3||u===6)&&(u=Bt.current,u!==null&&u.tag===13&&(u.flags|=16384))),wm(i,t)):dr(i)}function dr(t){var i=t;do{if((i.flags&32768)!==0){wm(i,ms);return}t=i.return;var r=hx(i.alternate,i,Vn);if(r!==null){Ce=r;return}if(i=i.sibling,i!==null){Ce=i;return}Ce=i=t}while(i!==null);et===0&&(et=5)}function wm(t,i){do{var r=fx(t.alternate,t);if(r!==null){r.flags&=32767,Ce=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!i&&(t=t.sibling,t!==null)){Ce=t;return}Ce=t=r}while(t!==null);et=6,Ce=null}function Sm(t,i,r,u,g,x,S,T,N){t.cancelPendingCommit=null;do hr();while(lt!==0);if((Oe&6)!==0)throw Error(o(327));if(i!==null){if(i===t.current)throw Error(o(177));if(x=i.lanes|i.childLanes,x|=Ll,ev(t,r,x,S,T,N),t===$e&&(Ce=$e=null,Re=0),Li=i,ys=t,Fn=r,Vc=x,Fc=g,dm=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Cx(oi,function(){return Nm(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=z.T,z.T=null,g=te.p,te.p=2,S=Oe,Oe|=4;try{mx(t,i,r)}finally{Oe=S,te.p=g,z.T=u}}lt=1,_m(),Tm(),Cm()}}function _m(){if(lt===1){lt=0;var t=ys,i=Li,r=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||r){r=z.T,z.T=null;var u=te.p;te.p=2;var g=Oe;Oe|=4;try{sm(i,t);var x=au,S=lh(t.containerInfo),T=x.focusedElem,N=x.selectionRange;if(S!==T&&T&&T.ownerDocument&&rh(T.ownerDocument.documentElement,T)){if(N!==null&&jl(T)){var O=N.start,Y=N.end;if(Y===void 0&&(Y=O),"selectionStart"in T)T.selectionStart=O,T.selectionEnd=Math.min(Y,T.value.length);else{var W=T.ownerDocument||document,B=W&&W.defaultView||window;if(B.getSelection){var V=B.getSelection(),re=T.textContent.length,pe=Math.min(N.start,re),Fe=N.end===void 0?pe:Math.min(N.end,re);!V.extend&&pe>Fe&&(S=Fe,Fe=pe,pe=S);var D=ah(T,pe),j=ah(T,Fe);if(D&&j&&(V.rangeCount!==1||V.anchorNode!==D.node||V.anchorOffset!==D.offset||V.focusNode!==j.node||V.focusOffset!==j.offset)){var L=W.createRange();L.setStart(D.node,D.offset),V.removeAllRanges(),pe>Fe?(V.addRange(L),V.extend(j.node,j.offset)):(L.setEnd(j.node,j.offset),V.addRange(L))}}}}for(W=[],V=T;V=V.parentNode;)V.nodeType===1&&W.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<W.length;T++){var K=W[T];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Tr=!!ou,au=ou=null}finally{Oe=g,te.p=u,z.T=r}}t.current=i,lt=2}}function Tm(){if(lt===2){lt=0;var t=ys,i=Li,r=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||r){r=z.T,z.T=null;var u=te.p;te.p=2;var g=Oe;Oe|=4;try{Xf(t,i.alternate,i)}finally{Oe=g,te.p=u,z.T=r}}lt=3}}function Cm(){if(lt===4||lt===3){lt=0,ii();var t=ys,i=Li,r=Fn,u=dm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?lt=5:(lt=0,Li=ys=null,Em(t,t.pendingLanes));var g=t.pendingLanes;if(g===0&&(gs=null),hl(r),i=i.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(Is,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=z.T,g=te.p,te.p=2,z.T=null;try{for(var x=t.onRecoverableError,S=0;S<u.length;S++){var T=u[S];x(T.value,{componentStack:T.stack})}}finally{z.T=i,te.p=g}}(Fn&3)!==0&&hr(),En(t),g=t.pendingLanes,(r&261930)!==0&&(g&42)!==0?t===$c?Fo++:(Fo=0,$c=t):Fo=0,$o(0)}}function Em(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Eo(i)))}function hr(){return _m(),Tm(),Cm(),Nm()}function Nm(){if(lt!==5)return!1;var t=ys,i=Vc;Vc=0;var r=hl(Fn),u=z.T,g=te.p;try{te.p=32>r?32:r,z.T=null,r=Fc,Fc=null;var x=ys,S=Fn;if(lt=0,Li=ys=null,Fn=0,(Oe&6)!==0)throw Error(o(331));var T=Oe;if(Oe|=4,lm(x.current),om(x,x.current,S,r),Oe=T,$o(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(Is,x)}catch{}return!0}finally{te.p=g,z.T=u,Em(t,i)}}function Am(t,i,r){i=Xt(r,i),i=Tc(t.stateNode,i,2),t=us(t,i,2),t!==null&&(ho(t,2),En(t))}function qe(t,i,r){if(t.tag===3)Am(t,t,r);else for(;i!==null;){if(i.tag===3){Am(i,t,r);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(gs===null||!gs.has(u))){t=Xt(r,t),r=Rf(2),u=us(i,r,2),u!==null&&(kf(r,u,i,t),ho(u,2),En(u));break}}i=i.return}}function Kc(t,i,r){var u=t.pingCache;if(u===null){u=t.pingCache=new yx;var g=new Set;u.set(i,g)}else g=u.get(i),g===void 0&&(g=new Set,u.set(i,g));g.has(r)||(Bc=!0,g.add(r),t=Sx.bind(null,t,i,r),i.then(t,t))}function Sx(t,i,r){var u=t.pingCache;u!==null&&u.delete(i),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,$e===t&&(Re&r)===r&&(et===4||et===3&&(Re&62914560)===Re&&300>ct()-ar?(Oe&2)===0&&Pi(t,0):Hc|=r,Ui===Re&&(Ui=0)),En(t)}function Rm(t,i){i===0&&(i=Sd()),t=Ps(t,i),t!==null&&(ho(t,i),En(t))}function _x(t){var i=t.memoizedState,r=0;i!==null&&(r=i.retryLane),Rm(t,r)}function Tx(t,i){var r=0;switch(t.tag){case 31:case 13:var u=t.stateNode,g=t.memoizedState;g!==null&&(r=g.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(i),Rm(t,r)}function Cx(t,i){return Xn(t,i)}var fr=null,Gi=null,Qc=!1,mr=!1,Wc=!1,xs=0;function En(t){t!==Gi&&t.next===null&&(Gi===null?fr=Gi=t:Gi=Gi.next=t),mr=!0,Qc||(Qc=!0,Nx())}function $o(t,i){if(!Wc&&mr){Wc=!0;do for(var r=!1,u=fr;u!==null;){if(t!==0){var g=u.pendingLanes;if(g===0)var x=0;else{var S=u.suspendedLanes,T=u.pingedLanes;x=(1<<31-me(42|t)+1)-1,x&=g&~(S&~T),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(r=!0,Mm(u,x))}else x=Re,x=ts(u,u===$e?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||An(u,x)||(r=!0,Mm(u,x));u=u.next}while(r);Wc=!1}}function Ex(){km()}function km(){mr=Qc=!1;var t=0;xs!==0&&Px()&&(t=xs);for(var i=ct(),r=null,u=fr;u!==null;){var g=u.next,x=jm(u,i);x===0?(u.next=null,r===null?fr=g:r.next=g,g===null&&(Gi=r)):(r=u,(t!==0||(x&3)!==0)&&(mr=!0)),u=g}lt!==0&<!==5||$o(t),xs!==0&&(xs=0)}function jm(t,i){for(var r=t.suspendedLanes,u=t.pingedLanes,g=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var S=31-me(x),T=1<<S,N=g[S];N===-1?((T&r)===0||(T&u)!==0)&&(g[S]=va(T,i)):N<=i&&(t.expiredLanes|=T),x&=~T}if(i=$e,r=Re,r=ts(t,t===i?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,r===0||t===i&&(Ge===2||Ge===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Zn(u),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||An(t,r)){if(i=r&-r,i===t.callbackPriority)return i;switch(u!==null&&Zn(u),hl(r)){case 2:case 8:r=ga;break;case 32:r=oi;break;case 268435456:r=ya;break;default:r=oi}return u=Im.bind(null,t),r=Xn(r,u),t.callbackPriority=i,t.callbackNode=r,i}return u!==null&&u!==null&&Zn(u),t.callbackPriority=2,t.callbackNode=null,2}function Im(t,i){if(lt!==0&<!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(hr()&&t.callbackNode!==r)return null;var u=Re;return u=ts(t,t===$e?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(fm(t,u,i),jm(t,ct()),t.callbackNode!=null&&t.callbackNode===r?Im.bind(null,t):null)}function Mm(t,i){if(hr())return null;fm(t,i,!0)}function Nx(){Gx(function(){(Oe&6)!==0?Xn(pa,Ex):km()})}function Xc(){if(xs===0){var t=Ti;t===0&&(t=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),xs=t}return xs}function Dm(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Sa(""+t)}function Um(t,i){var r=i.ownerDocument.createElement("input");return r.name=i.name,r.value=i.value,t.id&&r.setAttribute("form",t.id),i.parentNode.insertBefore(r,i),t=new FormData(t),r.parentNode.removeChild(r),t}function Ax(t,i,r,u,g){if(i==="submit"&&r&&r.stateNode===g){var x=Dm((g[kt]||null).action),S=u.submitter;S&&(i=(i=S[kt]||null)?Dm(i.formAction):S.getAttribute("formAction"),i!==null&&(x=i,S=null));var T=new Ea("action","action",null,u,g);t.push({event:T,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(xs!==0){var N=S?Um(g,S):new FormData(g);vc(r,{pending:!0,data:N,method:g.method,action:x},null,N)}}else typeof x=="function"&&(T.preventDefault(),N=S?Um(g,S):new FormData(g),vc(r,{pending:!0,data:N,method:g.method,action:x},x,N))},currentTarget:g}]})}}for(var Zc=0;Zc<Ul.length;Zc++){var eu=Ul[Zc],Rx=eu.toLowerCase(),kx=eu[0].toUpperCase()+eu.slice(1);mn(Rx,"on"+kx)}mn(dh,"onAnimationEnd"),mn(hh,"onAnimationIteration"),mn(fh,"onAnimationStart"),mn("dblclick","onDoubleClick"),mn("focusin","onFocus"),mn("focusout","onBlur"),mn($v,"onTransitionRun"),mn(Yv,"onTransitionStart"),mn(Jv,"onTransitionCancel"),mn(mh,"onTransitionEnd"),ui("onMouseEnter",["mouseout","mouseover"]),ui("onMouseLeave",["mouseout","mouseover"]),ui("onPointerEnter",["pointerout","pointerover"]),ui("onPointerLeave",["pointerout","pointerover"]),Ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yo));function Lm(t,i){i=(i&4)!==0;for(var r=0;r<t.length;r++){var u=t[r],g=u.event;u=u.listeners;e:{var x=void 0;if(i)for(var S=u.length-1;0<=S;S--){var T=u[S],N=T.instance,O=T.currentTarget;if(T=T.listener,N!==x&&g.isPropagationStopped())break e;x=T,g.currentTarget=O;try{x(g)}catch(Y){Ra(Y)}g.currentTarget=null,x=N}else for(S=0;S<u.length;S++){if(T=u[S],N=T.instance,O=T.currentTarget,T=T.listener,N!==x&&g.isPropagationStopped())break e;x=T,g.currentTarget=O;try{x(g)}catch(Y){Ra(Y)}g.currentTarget=null,x=N}}}}function Ee(t,i){var r=i[fl];r===void 0&&(r=i[fl]=new Set);var u=t+"__bubble";r.has(u)||(Pm(i,t,2,!1),r.add(u))}function tu(t,i,r){var u=0;i&&(u|=4),Pm(r,t,u,i)}var pr="_reactListening"+Math.random().toString(36).slice(2);function nu(t){if(!t[pr]){t[pr]=!0,Rd.forEach(function(r){r!=="selectionchange"&&(jx.has(r)||tu(r,!1,t),tu(r,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[pr]||(i[pr]=!0,tu("selectionchange",!1,i))}}function Pm(t,i,r,u){switch(hp(i)){case 2:var g=ob;break;case 8:g=ab;break;default:g=yu}r=g.bind(null,i,r,t),g=void 0,!Sl||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),u?g!==void 0?t.addEventListener(i,r,{capture:!0,passive:g}):t.addEventListener(i,r,!0):g!==void 0?t.addEventListener(i,r,{passive:g}):t.addEventListener(i,r,!1)}function su(t,i,r,u,g){var x=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var T=u.stateNode.containerInfo;
vendor: 2,649 bytes, line 48
48if(T===g)break;if(S===4)for(S=u.return;S!==null;){var N=S.tag;if((N===3||N===4)&&S.stateNode.containerInfo===g)return;S=S.return}for(;T!==null;){if(S=ri(T),S===null)return;if(N=S.tag,N===5||N===6||N===26||N===27){u=x=S;continue e}T=T.parentNode}}u=u.return}Bd(function(){var O=x,Y=bl(r),W=[];e:{var B=ph.get(t);if(B!==void 0){var V=Ea,re=t;switch(t){case"keypress":if(Ta(r)===0)break e;case"keydown":case"keyup":V=Tv;break;case"focusin":re="focus",V=El;break;case"focusout":re="blur",V=El;break;case"beforeblur":case"afterblur":V=El;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Vd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=hv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=Nv;break;case dh:case hh:case fh:V=pv;break;case mh:V=Rv;break;case"scroll":case"scrollend":V=uv;break;case"wheel":V=jv;break;case"copy":case"cut":case"paste":V=yv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=$d;break;case"toggle":case"beforetoggle":V=Mv}var pe=(i&4)!==0,Fe=!pe&&(t==="scroll"||t==="scrollend"),D=pe?B!==null?B+"Capture":null:B;pe=[];for(var j=O,L;j!==null;){var K=j;if(L=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||L===null||D===null||(K=po(j,D),K!=null&&pe.push(Jo(j,K,L))),Fe)break;j=j.return}0<pe.length&&(B=new V(B,re,null,r,Y),W.push({event:B,listeners:pe}))}}if((i&7)===0){e:{if(B=t==="mouseover"||t==="pointerover",V=t==="mouseout"||t==="pointerout",B&&r!==xl&&(re=r.relatedTarget||r.fromElement)&&(ri(re)||re[ai]))break e;if((V||B)&&(B=Y.window===Y?Y:(B=Y.ownerDocument)?B.defaultView||B.parentWindow:window,V?(re=r.relatedTarget||r.toElement,V=O,re=re?ri(re):null,re!==null&&(Fe=c(re),pe=re.tag,re!==Fe||pe!==5&&pe!==27&&pe!==6)&&(re=null)):(V=null,re=O),V!==re)){if(pe=Vd,K="onMouseLeave",D="onMouseEnter",j="mouse",(t==="pointerout"||t==="pointerover")&&(pe=$d,K="onPointerLeave",D="onPointerEnter",j="pointer"),Fe=V==null?B:mo(V),L=re==null?B:mo(re),B=new pe(K,j+"leave",V,r,Y),B.target=Fe,B.relatedTarget=L,K=null,ri(Y)===O&&(pe=new pe(D,j+"enter",re,r,Y),pe.target=L,pe.relatedTarget=Fe,K=pe),Fe=K,V&&re)t:{for(pe=Ix,D=V,j=re,L=0,K=D;K;K=pe(K))L++;K=0;for(var he=j;he;he=pe(he))K++;for(;0<L-K;)D=pe(D),L--;for(;0<K-L;)j=pe(j),K--;for(;L--;){if(D===j||j!==null&&D===j.alternate){pe=D;break t}D=pe(D),j=pe(j)}pe=null}else pe=null;V!==null&&Om(W,B,V,pe,!1),re!==null&&Fe!==null&&Om(W,Fe,re,pe,!0)}}
vendor: 5,189 bytes, lines 48-49
48e:{if(B=O?mo(O):window,V=B.nodeName&&B.nodeName.toLowerCase(),V==="select"||V==="input"&&B.type==="file")var Ue=eh;else if(Xd(B))if(th)Ue=zv;else{Ue=Bv;var de=qv}else V=B.nodeName,!V||V.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?O&&vl(O.elementType)&&(Ue=eh):Ue=Hv;if(Ue&&(Ue=Ue(t,O))){Zd(W,Ue,r,Y);break e}de&&de(t,B,O),t==="focusout"&&O&&B.type==="number"&&O.memoizedProps.value!=null&&yl(B,"number",B.value)}switch(de=O?mo(O):window,t){case"focusin":(Xd(de)||de.contentEditable==="true")&&(gi=de,Il=O,_o=null);break;case"focusout":_o=Il=gi=null;break;case"mousedown":Ml=!0;break;case"contextmenu":case"mouseup":case"dragend":Ml=!1,ch(W,r,Y);break;case"selectionchange":if(Fv)break;case"keydown":case"keyup":ch(W,r,Y)}var Se;if(Al)e:{switch(t){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else pi?Qd(t,r)&&(ke="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(ke="onCompositionStart");ke&&(Yd&&r.locale!=="ko"&&(pi||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&pi&&(Se=Hd()):(ss=Y,_l="value"in ss?ss.value:ss.textContent,pi=!0)),de=gr(O,ke),0<de.length&&(ke=new Fd(ke,t,null,r,Y),W.push({event:ke,listeners:de}),Se?ke.data=Se:(Se=Wd(r),Se!==null&&(ke.data=Se)))),(Se=Uv?Lv(t,r):Pv(t,r))&&(ke=gr(O,"onBeforeInput"),0<ke.length&&(de=new Fd("onBeforeInput","beforeinput",null,r,Y),W.push({event:de,listeners:ke}),de.data=Se)),Ax(W,t,O,r,Y)}Lm(W,i)})}function Jo(t,i,r){return{instance:t,listener:i,currentTarget:r}}function gr(t,i){for(var r=i+"Capture",u=[];t!==null;){var g=t,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=po(t,r),g!=null&&u.unshift(Jo(t,g,x)),g=po(t,i),g!=null&&u.push(Jo(t,g,x))),t.tag===3)return u;t=t.return}return[]}function Ix(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Om(t,i,r,u,g){for(var x=i._reactName,S=[];r!==null&&r!==u;){var T=r,N=T.alternate,O=T.stateNode;if(T=T.tag,N!==null&&N===u)break;T!==5&&T!==26&&T!==27||O===null||(N=O,g?(O=po(r,x),O!=null&&S.unshift(Jo(r,O,N))):g||(O=po(r,x),O!=null&&S.push(Jo(r,O,N)))),r=r.return}S.length!==0&&t.push({event:i,listeners:S})}var Mx=/\r\n?/g,Dx=/\u0000|\uFFFD/g;function Gm(t){return(typeof t=="string"?t:""+t).replace(Mx,` 49`).replace(Dx,"")}function qm(t,i){return i=Gm(i),Gm(t)===i}function Ve(t,i,r,u,g,x){switch(r){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||hi(t,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&hi(t,""+u);break;case"className":ba(t,"class",u);break;case"tabIndex":ba(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ba(t,r,u);break;case"style":Gd(t,u,x);break;case"data":if(i!=="object"){ba(t,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||r!=="href")){t.removeAttribute(r);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(r);break}u=Sa(""+u),t.setAttribute(r,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(r==="formAction"?(i!=="input"&&Ve(t,i,"name",g.name,g,null),Ve(t,i,"formEncType",g.formEncType,g,null),Ve(t,i,"formMethod",g.formMethod,g,null),Ve(t,i,"formTarget",g.formTarget,g,null)):(Ve(t,i,"encType",g.encType,g,null),Ve(t,i,"method",g.method,g,null),Ve(t,i,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(r);break}u=Sa(""+u),t.setAttribute(r,u);break;case"onClick":u!=null&&(t.onclick=kn);break;case"onScroll":u!=null&&Ee("scroll",t);break;case"onScrollEnd":u!=null&&Ee("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(r=u.__html,r!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=r}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}r=Sa(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(r,""+u):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":u===!0?t.setAttribute(r,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(r,u):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(r,u):t.removeAttribute(r);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(r):t.setAttribute(r,u);break;case"popover":Ee("beforetoggle",t),Ee("toggle",t),xa(t,"popover",u);break;case"xlinkActuate":Rn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Rn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Rn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Rn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Rn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Rn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":xa(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=lv.get(r)||r,xa(t,r,u))}}function iu(t,i,r,u,g,x){switch(r){case"style":Gd(t,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(r=u.__html,r!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=r}}break;case"children":typeof u=="string"?hi(t,u):(typeof u=="number"||typeof u=="bigint")&&hi(t,""+u);break;case"onScroll":u!=null&&Ee("scroll",t);break;case"onScrollEnd":u!=null&&Ee("scrollend",t);break;case"onClick":u!=null&&(t.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kd.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(g=r.endsWith("Capture"),i=r.slice(2,g?r.length-7:void 0),x=t[kt]||null,x=x!=null?x[r]:null,typeof x=="function"&&t.removeEventListener(i,x,g),typeof u=="function")){typeof x!="function"&&x!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(i,u,g);break e}r in t?t[r]=u:u===!0?t.setAttribute(r,""):xa(t,r,u)}}}function yt(t,i,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",t),Ee("load",t);var u=!1,g=!1,x;for(x in r)if(r.hasOwnProperty(x)){var S=r[x];if(S!=null)switch(x){case"src":u=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,i));default:Ve(t,i,x,S,r,null)}}g&&Ve(t,i,"srcSet",r.srcSet,r,null),u&&Ve(t,i,"src",r.src,r,null);return;case"input":Ee("invalid",t);var T=x=S=g=null,N=null,O=null;for(u in r)if(r.hasOwnProperty(u)){var Y=r[u];if(Y!=null)switch(u){case"name":g=Y;break;case"type":S=Y;break;case"checked":N=Y;break;case"defaultChecked":O=Y;break;case"value":x=Y;break;case"defaultValue":T=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,i));break;default:Ve(t,i,u,Y,r,null)}}Ud(t,x,T,N,O,S,g,!1);return;case"select":Ee("invalid",t),u=S=x=null;for(g in r)if(r.hasOwnProperty(g)&&(T=r[g],T!=null))switch(g){case"value":x=T;break;case"defaultValue":S=T;break;case"multiple":u=T;default:Ve(t,i,g,T,r,null)}i=x,r=S,t.multiple=!!u,i!=null?di(t,!!u,i,!1):r!=null&&di(t,!!u,r,!0);return;case"textarea":Ee("invalid",t),x=g=u=null;for(S in r)if(r.hasOwnProperty(S)&&(T=r[S],T!=null))switch(S){case"value":u=T;break;case"defaultValue":g=T;break;case"children":x=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:Ve(t,i,S,T,r,null)}Pd(t,u,g,x);return;case"option":for(N in r)if(r.hasOwnProperty(N)&&(u=r[N],u!=null))switch(N){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ve(t,i,N,u,r,null)}return;case"dialog":Ee("beforetoggle",t),Ee("toggle",t),Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":Ee("load",t);break;case"video":case"audio":for(u=0;
vendor: 5,137 bytes, line 49
49u<Yo.length;u++)Ee(Yo[u],t);break;case"image":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"embed":case"source":case"link":Ee("error",t),Ee("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(O in r)if(r.hasOwnProperty(O)&&(u=r[O],u!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,i));default:Ve(t,i,O,u,r,null)}return;default:if(vl(i)){for(Y in r)r.hasOwnProperty(Y)&&(u=r[Y],u!==void 0&&iu(t,i,Y,u,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(u=r[T],u!=null&&Ve(t,i,T,u,r,null))}function Ux(t,i,r,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,x=null,S=null,T=null,N=null,O=null,Y=null;for(V in r){var W=r[V];if(r.hasOwnProperty(V)&&W!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":N=W;default:u.hasOwnProperty(V)||Ve(t,i,V,null,u,W)}}for(var B in u){var V=u[B];if(W=r[B],u.hasOwnProperty(B)&&(V!=null||W!=null))switch(B){case"type":x=V;break;case"name":g=V;break;case"checked":O=V;break;case"defaultChecked":Y=V;break;case"value":S=V;break;case"defaultValue":T=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,i));break;default:V!==W&&Ve(t,i,B,V,u,W)}}gl(t,S,T,N,O,Y,x,g);return;case"select":V=S=T=B=null;for(x in r)if(N=r[x],r.hasOwnProperty(x)&&N!=null)switch(x){case"value":break;case"multiple":V=N;default:u.hasOwnProperty(x)||Ve(t,i,x,null,u,N)}for(g in u)if(x=u[g],N=r[g],u.hasOwnProperty(g)&&(x!=null||N!=null))switch(g){case"value":B=x;break;case"defaultValue":T=x;break;case"multiple":S=x;default:x!==N&&Ve(t,i,g,x,u,N)}i=T,r=S,u=V,B!=null?di(t,!!r,B,!1):!!u!=!!r&&(i!=null?di(t,!!r,i,!0):di(t,!!r,r?[]:"",!1));return;case"textarea":V=B=null;for(T in r)if(g=r[T],r.hasOwnProperty(T)&&g!=null&&!u.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ve(t,i,T,null,u,g)}for(S in u)if(g=u[S],x=r[S],u.hasOwnProperty(S)&&(g!=null||x!=null))switch(S){case"value":B=g;break;case"defaultValue":V=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:g!==x&&Ve(t,i,S,g,u,x)}Ld(t,B,V);return;case"option":for(var re in r)if(B=r[re],r.hasOwnProperty(re)&&B!=null&&!u.hasOwnProperty(re))switch(re){case"selected":t.selected=!1;break;default:Ve(t,i,re,null,u,B)}for(N in u)if(B=u[N],V=r[N],u.hasOwnProperty(N)&&B!==V&&(B!=null||V!=null))switch(N){case"selected":t.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Ve(t,i,N,B,u,V)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in r)B=r[pe],r.hasOwnProperty(pe)&&B!=null&&!u.hasOwnProperty(pe)&&Ve(t,i,pe,null,u,B);for(O in u)if(B=u[O],V=r[O],u.hasOwnProperty(O)&&B!==V&&(B!=null||V!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,i));break;default:Ve(t,i,O,B,u,V)}return;default:if(vl(i)){for(var Fe in r)B=r[Fe],r.hasOwnProperty(Fe)&&B!==void 0&&!u.hasOwnProperty(Fe)&&iu(t,i,Fe,void 0,u,B);for(Y in u)B=u[Y],V=r[Y],!u.hasOwnProperty(Y)||B===V||B===void 0&&V===void 0||iu(t,i,Y,B,u,V);return}}for(var D in r)B=r[D],r.hasOwnProperty(D)&&B!=null&&!u.hasOwnProperty(D)&&Ve(t,i,D,null,u,B);for(W in u)B=u[W],V=r[W],!u.hasOwnProperty(W)||B===V||B==null&&V==null||Ve(t,i,W,B,u,V)}function Bm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,r=performance.getEntriesByType("resource"),u=0;u<r.length;u++){var g=r[u],x=g.transferSize,S=g.initiatorType,T=g.duration;if(x&&T&&Bm(S)){for(S=0,T=g.responseEnd,u+=1;u<r.length;u++){var N=r[u],O=N.startTime;if(O>T)break;var Y=N.transferSize,W=N.initiatorType;Y&&Bm(W)&&(N=N.responseEnd,S+=Y*(N<T?1:(T-O)/(N-O)))}if(--u,i+=8*(x+S)/(g.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ou=null,au=null;function yr(t){return t.nodeType===9?t:t.ownerDocument}function Hm(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function zm(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function ru(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var lu=null;function Px(){var t=window.event;return t&&t.type==="popstate"?t===lu?!1:(lu=t,!0):(lu=null,!1)}var Vm=typeof setTimeout=="function"?setTimeout:void 0,Ox=typeof clearTimeout=="function"?clearTimeout:void 0,Fm=typeof Promise=="function"?Promise:void 0,Gx=typeof queueMicrotask=="function"?queueMicrotask:typeof Fm<"u"?function(t){return Fm.resolve(null).then(t).cat
vendor: 12,213 bytes, line 49
49ch(qx)}:Vm;function qx(t){setTimeout(function(){throw t})}function bs(t){return t==="head"}function $m(t,i){var r=i,u=0;do{var g=r.nextSibling;if(t.removeChild(r),g&&g.nodeType===8)if(r=g.data,r==="/$"||r==="/&"){if(u===0){t.removeChild(g),zi(i);return}u--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")u++;else if(r==="html")Ko(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,Ko(r);for(var x=r.firstChild;x;){var S=x.nextSibling,T=x.nodeName;x[fo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&x.rel.toLowerCase()==="stylesheet"||r.removeChild(x),x=S}}else r==="body"&&Ko(t.ownerDocument.body);r=g}while(r);zi(i)}function Ym(t,i){var r=t;t=0;do{var u=r.nextSibling;if(r.nodeType===1?i?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(i?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=u}while(r)}function cu(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var r=i;switch(i=i.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":cu(r),ml(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function Bx(t,i,r,u){for(;t.nodeType===1;){var g=r;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[fo])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var x=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=sn(t.nextSibling),t===null)break}return null}function Hx(t,i,r){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=sn(t.nextSibling),t===null))return null;return t}function Jm(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=sn(t.nextSibling),t===null))return null;return t}function uu(t){return t.data==="$?"||t.data==="$~"}function du(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function zx(t,i){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||r.readyState!=="loading")i();else{var u=function(){i(),r.removeEventListener("DOMContentLoaded",u)};r.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function sn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var hu=null;function Km(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(i===0)return sn(t.nextSibling);i--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||i++}t=t.nextSibling}return null}function Qm(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(i===0)return t;i--}else r!=="/$"&&r!=="/&"||i++}t=t.previousSibling}return null}function Wm(t,i,r){switch(i=yr(r),t){case"html":if(t=i.documentElement,!t)throw Error(o(452));return t;case"head":if(t=i.head,!t)throw Error(o(453));return t;case"body":if(t=i.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function Ko(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ml(t)}var on=new Map,Xm=new Set;function vr(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var $n=te.d;te.d={f:Vx,r:Fx,D:$x,C:Yx,L:Jx,m:Kx,X:Wx,S:Qx,M:Xx};function Vx(){var t=$n.f(),i=cr();return t||i}function Fx(t){var i=li(t);i!==null&&i.tag===5&&i.type==="form"?pf(i):$n.r(t)}var qi=typeof document>"u"?null:document;function Zm(t,i,r){var u=qi;if(u&&typeof i=="string"&&i){var g=Qt(i);g='link[rel="'+t+'"][href="'+g+'"]',typeof r=="string"&&(g+='[crossorigin="'+r+'"]'),Xm.has(g)||(Xm.add(g),t={rel:t,crossOrigin:r,href:i},u.querySelector(g)===null&&(i=u.createElement("link"),yt(i,"link",t),ut(i),u.head.appendChild(i)))}}function $x(t){$n.D(t),Zm("dns-prefetch",t,null)}function Yx(t,i){$n.C(t,i),Zm("preconnect",t,i)}function Jx(t,i,r){$n.L(t,i,r);var u=qi;if(u&&t&&i){var g='link[rel="preload"][as="'+Qt(i)+'"]';i==="image"&&r&&r.imageSrcSet?(g+='[imagesrcset="'+Qt(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(g+='[imagesizes="'+Qt(r.imageSizes)+'"]')):g+='[href="'+Qt(t)+'"]';var x=g;switch(i){case"style":x=Bi(t);break;case"script":x=Hi(t)}on.has(x)||(t=b({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:t,as:i},r),on.set(x,t),u.querySelector(g)!==null||i==="style"&&u.querySelector(Qo(x))||i==="script"&&u.querySelector(Wo(x))||(i=u.createElement("link"),yt(i,"link",t),ut(i),u.head.appendChild(i)))}}function Kx(t,i){$n.m(t,i);var r=qi;if(r&&t){var u=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+Qt(u)+'"][href="'+Qt(t)+'"]',x=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Hi(t)}if(!on.has(x)&&(t=b({rel:"modulepreload",href:t},i),on.set(x,t),r.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Wo(x)))return}u=r.createElement("link"),yt(u,"link",t),ut(u),r.head.appendChild(u)}}}function Qx(t,i,r){$n.S(t,i,r);var u=qi;if(u&&t){var g=ci(u).hoistableStyles,x=Bi(t);i=i||"default";var S=g.get(x);if(!S){var T={loading:0,preload:null};if(S=u.querySelector(Qo(x)))T.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":i},r),(r=on.get(x))&&fu(t,r);var N=S=u.createElement("link");ut(N),yt(N,"link",t),N._p=new Promise(function(O,Y){N.onload=O,N.onerror=Y}),N.addEventListener("load",function(){T.loading|=1}),N.addEventListener("error",function(){T.loading|=2}),T.loading|=4,xr(S,i,u)}S={type:"stylesheet",instance:S,count:1,state:T},g.set(x,S)}}}function Wx(t,i){$n.X(t,i);var r=qi;if(r&&t){var u=ci(r).hoistableScripts,g=Hi(t),x=u.get(g);x||(x=r.querySelector(Wo(g)),x||(t=b({src:t,async:!0},i),(i=on.get(g))&&mu(t,i),x=r.createElement("script"),ut(x),yt(x,"link",t),r.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(g,x))}}function Xx(t,i){$n.M(t,i);var r=qi;if(r&&t){var u=ci(r).hoistableScripts,g=Hi(t),x=u.get(g);x||(x=r.querySelector(Wo(g)),x||(t=b({src:t,async:!0,type:"module"},i),(i=on.get(g))&&mu(t,i),x=r.createElement("script"),ut(x),yt(x,"link",t),r.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(g,x))}}function ep(t,i,r,u){var g=(g=ue.current)?vr(g):null;if(!g)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(i=Bi(r.href),r=ci(g).hoistableStyles,u=r.get(i),u||(u={type:"style",instance:null,count:0,state:null},r.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Bi(r.href);var x=ci(g).hoistableStyles,S=x.get(t);if(S||(g=g.ownerDocument||g,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,S),(x=g.querySelector(Qo(t)))&&!x._p&&(S.instance=x,S.state.loading=5),on.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},on.set(t,r),x||Zx(g,t,r,S.state))),i&&u===null)throw Error(o(528,""));return S}if(i&&u!==null)throw Error(o(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Hi(r),r=ci(g).hoistableScripts,u=r.get(i),u||(u={type:"script",instance:null,count:0,state:null},r.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Bi(t){return'href="'+Qt(t)+'"'}function Qo(t){return'link[rel="stylesheet"]['+t+"]"}function tp(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function Zx(t,i,r,u){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=t.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),yt(i,"link",r),ut(i),t.head.appendChild(i))}function Hi(t){return'[src="'+Qt(t)+'"]'}function Wo(t){return"script[async]"+t}function np(t,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var u=t.querySelector('style[data-href~="'+Qt(r.href)+'"]');if(u)return i.instance=u,ut(u),u;var g=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ut(u),yt(u,"style",g),xr(u,r.precedence,t),i.instance=u;case"stylesheet":g=Bi(r.href);var x=t.querySelector(Qo(g));if(x)return i.state.loading|=4,i.instance=x,ut(x),x;u=tp(r),(g=on.get(g))&&fu(u,g),x=(t.ownerDocument||t).createElement("link"),ut(x);var S=x;return S._p=new Promise(function(T,N){S.onload=T,S.onerror=N}),yt(x,"link",u),i.state.loading|=4,xr(x,r.precedence,t),i.instance=x;case"script":return x=Hi(r.src),(g=t.querySelector(Wo(x)))?(i.instance=g,ut(g),g):(u=r,(g=on.get(x))&&(u=b({},r),mu(u,g)),t=t.ownerDocument||t,g=t.createElement("script"),ut(g),yt(g,"link",u),t.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(o(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,xr(u,r.precedence,t));return i.instance}function xr(t,i,r){for(var u=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,x=g,S=0;S<u.length;S++){var T=u[S];if(T.dataset.precedence===i)x=T;else if(x!==g)break}x?x.parentNode.insertBefore(t,x.nextSibling):(i=r.nodeType===9?r.head:r,i.insertBefore(t,i.firstChild))}function fu(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function mu(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var br=null;function sp(t,i,r){if(br===null){var u=new Map,g=br=new Map;g.set(r,u)}else g=br,u=g.get(r),u||(u=new Map,g.set(r,u));if(u.has(t))return u;for(u.set(t,null),r=r.getElementsByTagName(t),g=0;g<r.length;g++){var x=r[g];if(!(x[fo]||x[ft]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var S=x.getAttribute(i)||"";S=t+S;var T=u.get(S);T?T.push(x):u.set(S,[x])}}return u}function ip(t,i,r){t=t.ownerDocument||t,t.head.insertBefore(r,i==="title"?t.querySelector("head > title"):null)}function eb(t,i,r){if(r===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function op(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function tb(t,i,r,u){if(r.type==="stylesheet"&&(typeof u.media!="str
49ing"||matchMedia(u.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var g=Bi(u.href),x=i.querySelector(Qo(g));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=wr.bind(t),i.then(t,t)),r.state.loading|=4,r.instance=x,ut(x);return}x=i.ownerDocument||i,u=tp(u),(g=on.get(g))&&fu(u,g),x=x.createElement("link"),ut(x);var S=x;S._p=new Promise(function(T,N){S.onload=T,S.onerror=N}),yt(x,"link",u),r.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=wr.bind(t),i.addEventListener("load",r),i.addEventListener("error",r))}}var pu=0;function nb(t,i){return t.stylesheets&&t.count===0&&_r(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var u=setTimeout(function(){if(t.stylesheets&&_r(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+i);0<t.imgBytes&&pu===0&&(pu=62500*Lx());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&_r(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>pu?50:800)+i);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_r(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Sr=null;function _r(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Sr=new Map,i.forEach(sb,t),Sr=null,wr.call(t))}function sb(t,i){if(!(i.state.loading&4)){var r=Sr.get(t);if(r)var u=r.get(null);else{r=new Map,Sr.set(t,r);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<g.length;x++){var S=g[x];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),u=S)}u&&r.set(null,u)}g=i.instance,S=g.getAttribute("data-precedence"),x=r.get(S)||u,x===u&&r.set(null,g),r.set(S,g),this.count++,u=wr.bind(this),g.addEventListener("load",u),g.addEventListener("error",u),x?x.parentNode.insertBefore(g,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),i.state.loading|=4}}var Xo={$$typeof:G,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function ib(t,i,r,u,g,x,S,T,N){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ul(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ul(0),this.hiddenUpdates=ul(null),this.identifierPrefix=u,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function ap(t,i,r,u,g,x,S,T,N,O,Y,W){return t=new ib(t,i,r,S,N,O,Y,W,T),i=1,x===!0&&(i|=24),x=qt(3,null,null,i),t.current=x,x.stateNode=t,i=Jl(),i.refCount++,t.pooledCache=i,i.refCount++,x.memoizedState={element:u,isDehydrated:r,cache:i},Xl(x),t}function rp(t){return t?(t=xi,t):xi}function lp(t,i,r,u,g,x){g=rp(g),u.context===null?u.context=g:u.pendingContext=g,u=cs(i),u.payload={element:r},x=x===void 0?null:x,x!==null&&(u.callback=x),r=us(t,u,i),r!==null&&(Lt(r,t,i),ko(r,t,i))}function cp(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<i?r:i}}function gu(t,i){cp(t,i),(t=t.alternate)&&cp(t,i)}function up(t){if(t.tag===13||t.tag===31){var i=Ps(t,67108864);i!==null&&Lt(i,t,67108864),gu(t,67108864)}}function dp(t){if(t.tag===13||t.tag===31){var i=Ft();i=dl(i);var r=Ps(t,i);r!==null&&Lt(r,t,i),gu(t,i)}}var Tr=!0;function ob(t,i,r,u){var g=z.T;z.T=null;var x=te.p;try{te.p=2,yu(t,i,r,u)}finally{te.p=x,z.T=g}}function ab(t,i,r,u){var g=z.T;z.T=null;var x=te.p;try{te.p=8,yu(t,i,r,u)}finally{te.p=x,z.T=g}}function yu(t,i,r,u){if(Tr){var g=vu(u);if(g===null)su(t,i,u,Cr,r),fp(t,u);else if(lb(g,t,i,r,u))u.stopPropagation();else if(fp(t,u),i&4&&-1<rb.indexOf(t)){for(;g!==null;){var x=li(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var S=fn(x.pendingLanes);if(S!==0){var T=x;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var N=1<<31-me(S);T.entanglements[1]|=N,S&=~N}En(x),(Oe&6)===0&&(rr=ct()+500,$o(0))}}break;case 31:case 13:T=Ps(x,2),T!==null&&Lt(T,x,2),cr(),gu(x,2)}if(x=vu(u),x===null&&su(t,i,u,Cr,r),x===g)break;g=x}g!==null&&u.stopPropagation()}else su(t,i,u,null,r)}}function vu(t){return t=bl(t),xu(t)}var Cr=null;function xu(t){if(Cr=null,t=ri(t),t!==null){var i=c(t);if(i===null)t=null;else{var r=i.tag;if(r===13){if(t=d(i),t!==null)return t;t=null}else if(r===31){if(t=m(i),t!==null)return t;t=null}else if(r===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Cr=t,null}function hp(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close"
vendor: 3,889 bytes, line 49
49:case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case pa:return 2;case ga:return 8;case oi:case rl:return 32;case ya:return 268435456;default:return 32}default:return 32}}var bu=!1,ws=null,Ss=null,_s=null,Zo=new Map,ea=new Map,Ts=[],rb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function fp(t,i){switch(t){case"focusin":case"focusout":ws=null;break;case"dragenter":case"dragleave":Ss=null;break;case"mouseover":case"mouseout":_s=null;break;case"pointerover":case"pointerout":Zo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(i.pointerId)}}function ta(t,i,r,u,g,x){return t===null||t.nativeEvent!==x?(t={blockedOn:i,domEventName:r,eventSystemFlags:u,nativeEvent:x,targetContainers:[g]},i!==null&&(i=li(i),i!==null&&up(i)),t):(t.eventSystemFlags|=u,i=t.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),t)}function lb(t,i,r,u,g){switch(i){case"focusin":return ws=ta(ws,t,i,r,u,g),!0;case"dragenter":return Ss=ta(Ss,t,i,r,u,g),!0;case"mouseover":return _s=ta(_s,t,i,r,u,g),!0;case"pointerover":var x=g.pointerId;return Zo.set(x,ta(Zo.get(x)||null,t,i,r,u,g)),!0;case"gotpointercapture":return x=g.pointerId,ea.set(x,ta(ea.get(x)||null,t,i,r,u,g)),!0}return!1}function mp(t){var i=ri(t.target);if(i!==null){var r=c(i);if(r!==null){if(i=r.tag,i===13){if(i=d(r),i!==null){t.blockedOn=i,Nd(t.priority,function(){dp(r)});return}}else if(i===31){if(i=m(r),i!==null){t.blockedOn=i,Nd(t.priority,function(){dp(r)});return}}else if(i===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Er(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var r=vu(t.nativeEvent);if(r===null){r=t.nativeEvent;var u=new r.constructor(r.type,r);xl=u,r.target.dispatchEvent(u),xl=null}else return i=li(r),i!==null&&up(i),t.blockedOn=r,!1;i.shift()}return!0}function pp(t,i,r){Er(t)&&r.delete(i)}function cb(){bu=!1,ws!==null&&Er(ws)&&(ws=null),Ss!==null&&Er(Ss)&&(Ss=null),_s!==null&&Er(_s)&&(_s=null),Zo.forEach(pp),ea.forEach(pp)}function Nr(t,i){t.blockedOn===i&&(t.blockedOn=null,bu||(bu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cb)))}var Ar=null;function gp(t){Ar!==t&&(Ar=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ar===t&&(Ar=null);for(var i=0;i<t.length;i+=3){var r=t[i],u=t[i+1],g=t[i+2];if(typeof u!="function"){if(xu(u||r)===null)continue;break}var x=li(r);x!==null&&(t.splice(i,3),i-=3,vc(x,{pending:!0,data:g,method:r.method,action:u},u,g))}}))}function zi(t){function i(N){return Nr(N,t)}ws!==null&&Nr(ws,t),Ss!==null&&Nr(Ss,t),_s!==null&&Nr(_s,t),Zo.forEac
vendor: 4,109 bytes, line 49
49h(i),ea.forEach(i);for(var r=0;r<Ts.length;r++){var u=Ts[r];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Ts.length&&(r=Ts[0],r.blockedOn===null);)mp(r),r.blockedOn===null&&Ts.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(u=0;u<r.length;u+=3){var g=r[u],x=r[u+1],S=g[kt]||null;if(typeof x=="function")S||gp(r);else if(S){var T=null;if(x&&x.hasAttribute("formAction")){if(g=x,S=x[kt]||null)T=S.formAction;else if(xu(g)!==null)continue}else T=S.action;typeof T=="function"?r[u+1]=T:(r.splice(u,3),u-=3),gp(r)}}}function yp(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(S){return g=S})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),u||setTimeout(r,20)}function r(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,g=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(r,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function wu(t){this._internalRoot=t}Rr.prototype.render=wu.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(o(409));var r=i.current,u=Ft();lp(r,u,t,i,null,null)},Rr.prototype.unmount=wu.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;lp(t.current,2,null,t,null,null),cr(),i[ai]=null}};function Rr(t){this._internalRoot=t}Rr.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ed();t={blockedOn:null,target:t,priority:i};for(var r=0;r<Ts.length&&i!==0&&i<Ts[r].priority;r++);Ts.splice(r,0,t),r===0&&mp(t)}};var vp=e.version;if(vp!=="19.2.3")throw Error(o(527,vp,"19.2.3"));te.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=f(i),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var ub={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kr.isDisabled&&kr.supportsFiber)try{Is=kr.inject(ub),_t=kr}catch{}}return sa.createRoot=function(t,i){if(!a(t))throw Error(o(299));var r=!1,u="",g=Cf,x=Ef,S=Nf;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=ap(t,1,!1,null,null,r,u,null,g,x,S,yp),t[ai]=i.current,nu(t),new wu(i)},sa.hydrateRoot=function(t,i,r){if(!a(t))throw Error(o(299));var u=!1,g="",x=Cf,S=Ef,T=Nf,N=null;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(x=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(N=r.formState)),i=ap(t,1,!0,i,r??null,u,g,N,x,S,T,yp),i.context=rp(null),r=i.current,u=Ft(),u=dl(u),g=cs(u),g.callback=null,us(r,g,u),r=u,i.current.lanes=r,ho(i,r),En(i),t[ai]=i.current,nu(t),new Rr(i)},sa.version="19.2.3",sa}var Ap;function wb(){if(Ap)return Tu.exports;Ap=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Tu.exports=bb(),Tu.exports}var Sb=wb();const _b=od(Sb),Tb="modulepreload",Cb=function(n){return"/"+n},Rp={},io=function(e,s,o){let a=Promise.resolve();if(s&&s.length>0){let d=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}
49))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),y=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));a=d(s.map(f=>{if(f=Cb(f),f in Rp)return;Rp[f]=!0;const v=f.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":Tb,v||(w.as="script"),w.crossOrigin="",w.href=f,y&&w.setAttribute("nonce",y),document.head.appendChild(w),v)return new Promise((_,C)=>{w.addEventListener("load",_),w.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(d){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=d,window.dispatchEvent(m),!m.defaultPrevented)throw d}return a.then(d=>{for(const m of d||[])m.status==="rejected"&&c(m.reason);return e().catch(c)})},Eb=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...s)=>io(async()=>{const{default:o}=await Promise.resolve().then(()=>ao);return{default:o}},void 0).then(({default:o})=>o(...s)):e=fetch,(...s)=>e(...s)};class rd extends Error{constructor(e,s="FunctionsError",o){super(e),this.name=s,this.context=o}}class Nb extends rd{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Ab extends rd{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Rb extends rd{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Gu;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(Gu||(Gu={}));var kb=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};class jb{constructor(e,{headers:s={},customFetch:o,region:a=Gu.Any}={}){this.url=e,this.headers=s,this.region=a,this.fetch=Eb(o)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,s={}){var o;return kb(this,void 0,void 0,function*(){try{const{headers:a,method:c,body:d}=s;let m={},{region:y}=s;y||(y=this.region),y&&y!=="any"&&(m["x-region"]=y);let f;d&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(m["Content-Type"]="application/octet-stream",f=d):typeof d=="string"?(m["Content-Type"]="text/plain",f=d):typeof FormData<"u"&&d instanceof FormData?f=d:(m["Content-Type"]="application/json",f=JSON.stringify(d)));const v=yield this.fetch(`${this.url}/${e}`,{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},m),this.headers),a),body:f}).catch(C=>{throw new Nb(C)}),b=v.headers.get("x-relay-error");if(b&&b==="true")throw new Ab(v);if(!v.ok)throw new Rb(v);let w=((o=v.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),_;return w==="application/json"?_=yield v.json():w==="application/octet-stream"?_=yield v.blob():w==="text/event-stream"?_=v:w==="multipart/form-data"?_=yield v.formData():_=yield v.text(),{data:_,error:null}}catch(a){return{data:null,error:a}}})}}var xt={},Vi={},Fi={},$i={},Yi={},Ji={},Ib=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},oo=Ib();const Mb=oo.fetch,z0=oo.fetch.bind(oo),V0=oo.Headers,Db=oo.Request,Ub=oo.Response,ao=Object.freeze(Object.defineProperty({__proto__:null,Headers:V0,Request:Db,Response:Ub,default:z0,fetch:Mb},Symbol.toStringTag,{value:"Module"})),Lb=hb(ao);var jr={},kp;function Pb(){if(kp)return jr;kp=1,Object.defineProperty(jr,"__esModule",{value:!0});
49let n=class extends Error{constructor(s){super(s.message),this.name="PostgrestError",this.details=s.details,this.hint=s.hint,this.code=s.code}};return jr.default=n,jr}var jp;function F0(){if(jp)return Ji;jp=1;var n=Ji&&Ji.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ji,"__esModule",{value:!0});const e=n(Lb),s=n(Pb());class o{constructor(c){this.shouldThrowOnError=!1,this.method=c.method,this.url=c.url,this.headers=c.headers,this.schema=c.schema,this.body=c.body,this.shouldThrowOnError=c.shouldThrowOnError,this.signal=c.signal,this.isMaybeSingle=c.isMaybeSingle,c.fetch?this.fetch=c.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(c,d){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const m=this.fetch;let y=m(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async f=>{var v,b,w;let _=null,C=null,A=null,E=f.status,I=f.statusText;if(f.ok){if(this.method!=="HEAD"){const P=await f.text();P===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?C=P:C=JSON.parse(P))}const G=(v=this.headers.Prefer)===null||v===void 0?void 0:v.match(/count=(exact|planned|estimated)/),F=(b=f.headers.get("content-range"))===null||b===void 0?void 0:b.split("/");G&&F&&F.length>1&&(A=parseInt(F[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(C)&&(C.length>1?(_={code:"PGRST116",details:`Results contain ${C.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},C=null,A=null,E=406,I="Not Acceptable"):C.length===1?C=C[0]:C=null)}else{const G=await f.text();try{_=JSON.parse(G),Array.isArray(_)&&f.status===404&&(C=[],_=null,E=200,I="OK")}catch{f.status===404&&G===""?(E=204,I="No Content"):_={message:G}}if(_&&this.isMaybeSingle&&(!((w=_==null?void 0:_.details)===null||w===void 0)&&w.includes("0 rows"))&&(_=null,E=200,I="OK"),_&&this.shouldThrowOnError)throw new s.default(_)}return{error:_,data:C,count:A,status:E,statusText:I}});return this.shouldThrowOnError||(y=y.catch(f=>{var v,b,w;return{error:{message:`${(v=f==null?void 0:f.name)!==null&&v!==void 0?v:"FetchError"}: ${f==null?void 0:f.message}`,details:`${(b=f==null?void 0:f.stack)!==null&&b!==void 0?b:""}`,hint:"",code:`${(w=f==null?void 0:f.code)!==null&&w!==void 0?w:""}`},data:null,count:null,status:0,statusText:""}})),y.then(c,d)}}return Ji.default=o,Ji}var Ip;function $0(){if(Ip)return Yi;Ip=1;var n=Yi&&Yi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Yi,"__esModule",{value:!0});const e=n(F0());class s extends e.default{select(a){let c=!1;const d=(a??"*").split("").map(m=>/\s/.test(m)&&!c?"":(m==='"'&&(c=!c),m)).join("");return this.url.searchParams.set("select",d),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(a,{ascending:c=!0,nullsFirst:d,foreignTable:m,referencedTable:y=m}={}){const f=y?`${y}.order`:"order",v=this.url.searchParams.get(f);return this.url.searchParams.set(f,`${v?`${v},`:""}${a}.${c?"asc":"desc"}${d===void 0?"":d?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:c,referencedTable:d=c}={}){const m=typeof d>"u"?"limit":`${d}.limit`;return this.url.searchParams.set(m,`${a}`),this}range(a,c,{foreignTable:d,referencedTable:m=d}={}){const y=typeof m>"u"?"offset":`${m}.offset`,f=typeof m>"u"?"limit":`${m}.limit`;return this.url.searchParams.set(y,`${a}`),this.url.searchParams.set(f,`${c-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
49explain({analyze:a=!1,verbose:c=!1,settings:d=!1,buffers:m=!1,wal:y=!1,format:f="text"}={}){var v;const b=[a?"analyze":null,c?"verbose":null,d?"settings":null,m?"buffers":null,y?"wal":null].filter(Boolean).join("|"),w=(v=this.headers.Accept)!==null&&v!==void 0?v:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${f}; for="${w}"; options=${b};`,f==="json"?this:this}rollback(){var a;return((a=this.headers.Prefer)!==null&&a!==void 0?a:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return Yi.default=s,Yi}var Mp;function ld(){if(Mp)return $i;Mp=1;var n=$i&&$i.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty($i,"__esModule",{value:!0});const e=n($0());class s extends e.default{eq(a,c){return this.url.searchParams.append(a,`eq.${c}`),this}neq(a,c){return this.url.searchParams.append(a,`neq.${c}`),this}gt(a,c){return this.url.searchParams.append(a,`gt.${c}`),this}gte(a,c){return this.url.searchParams.append(a,`gte.${c}`),this}lt(a,c){return this.url.searchParams.append(a,`lt.${c}`),this}lte(a,c){return this.url.searchParams.append(a,`lte.${c}`),this}like(a,c){return this.url.searchParams.append(a,`like.${c}`),this}likeAllOf(a,c){return this.url.searchParams.append(a,`like(all).{${c.join(",")}}`),this}likeAnyOf(a,c){return this.url.searchParams.append(a,`like(any).{${c.join(",")}}`),this}ilike(a,c){return this.url.searchParams.append(a,`ilike.${c}`),this}ilikeAllOf(a,c){return this.url.searchParams.append(a,`ilike(all).{${c.join(",")}}`),this}ilikeAnyOf(a,c){return this.url.searchParams.append(a,`ilike(any).{${c.join(",")}}`),this}is(a,c){return this.url.searchParams.append(a,`is.${c}`),this}in(a,c){const d=Array.from(new Set(c)).map(m=>typeof m=="string"&&new RegExp("[,()]").test(m)?`"${m}"`:`${m}`).join(",");return this.url.searchParams.append(a,`in.(${d})`),this}contains(a,c){return typeof c=="string"?this.url.searchParams.append(a,`cs.${c}`):Array.isArray(c)?this.url.searchParams.append(a,`cs.{${c.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(c)}`),this}containedBy(a,c){return typeof c=="string"?this.url.searchParams.append(a,`cd.${c}`):Array.isArray(c)?this.url.searchParams.append(a,`cd.{${c.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(c)}`),this}rangeGt(a,c){return this.url.searchParams.append(a,`sr.${c}`),this}rangeGte(a,c){return this.url.searchParams.append(a,`nxl.${c}`),this}rangeLt(a,c){return this.url.searchParams.append(a,`sl.${c}`),this}rangeLte(a,c){return this.url.searchParams.append(a,`nxr.${c}`),this}rangeAdjacent(a,c){return this.url.searchParams.append(a,`adj.${c}`),this}overlaps(a,c){return typeof c=="string"?this.url.searchParams.append(a,`ov.${c}`):this.url.searchParams.append(a,`ov.{${c.join(",")}}`),this}textSearch(a,c,{config:d,type:m}={}){let y="";m==="plain"?y="pl":m==="phrase"?y="ph":m==="websearch"&&(y="w");const f=d===void 0?"":`(${d})`;return this.url.searchParams.append(a,`${y}fts${f}.${c}`),this}match(a){return Object.entries(a).forEach(([c,d])=>{this.url.searchParams.append(c,`eq.${d}`)}),this}not(a,c,d){return this.url.searchParams.append(a,`not.${c}.${d}`),this}or(a,{foreignTable:c,referencedTable:d=c}={}){const m=d?`${d}.or`:"or";return this.url.searchParams.append(m,`(${a})`),this}filter(a,c,d){return this.url.searchParams.append(a,`${c}.${d}`),this}}return $i.default=s,$i}var Dp;function Y0(){if(Dp)return Fi;Dp=1;var n=Fi&&Fi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Fi,"__esModule",{value:!0});const e=n(ld());class s{constructor(a,{headers:c={},schema:d,fetch:m}){this.url=a,this.headers=c,this.schema=d,this.fetch=m}select(a,{head:c=!1,count:d}={}){const m=c?"HEAD":"GET";let y=!1;const f=(a??"*").split("").map(v=>/\s/.test(v)&&!y?"":(v==='"'&&(y=!y),v)).join("");return this.url.searchParams.set("select",f),d&&(this.headers.Prefer=`count=${d}`),new e.default({method:m,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(a,{count:c,defaultToNull:d=!0}={}){const m="POST",y=[];if(this.headers.Prefer&&y.push(this.headers.Prefer),c&&y.push(`count=${c}`),d||y.push("missing=default"),this.headers.Prefer=y.join(","),Array.isArray(a)){const f=a.reduce((v,b)=>v.concat(Object.keys(b)),[]);if(f.length>0){const v=[...new Set(f)].map(b=>`"${b}"`);this.url.searchParams.set("columns",v.join(","))}}return new e.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:this.fetch,allowEmpty:!1})}upsert(a,{onConflict:c,ignoreDuplicates:d=!1,count:m,defaultToNull:y=!0}={}){const f="POST",v=[`resolution=${d?"ignore":"merge"}-duplicates`];if(c!==void 0&&this.url.searchParams.set("on_conflict",c),this.headers.Prefer&&v.push(this.headers.Prefer),m&&v.push(`count=${m}`),y||v.push("missing=default"),this.headers.Prefer=v.join(","),Array.isArray(a)){const b=a.reduce((w,_)=>w.concat(Object.keys(_)),[]);if(b.length>0){const w=[...new Set(b)].map(_=>`"${_}"`);this.url.searchParams.set("columns",w.join(","))}}return new e.default({method:f,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:this.fetch,allowEmpty:!1})}update(a,{count:c}={}){const d="PATCH",m=[];return this.headers.Prefer&&m.push(this.headers.Prefer),c&&m.push(`count=${c}`),this.headers.Prefer=m.join(","),new e.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:this.fetch,allowEmpty:!1})}delete({count:a}={}){const c="DELETE",d=[];return a&&d.push(`count=${a}`),this.headers.Prefer&&d.unshift(this.headers.Prefer),this.headers.Prefer=d.join(","),new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return Fi.default=s,Fi}var ia={},oa={},Up;function Ob(){return Up||(Up=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.version=void 0,oa.version="0.0.0-automated"),oa}var Lp;function Gb(){if(Lp)return ia;Lp=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.DEFAULT_HEADERS=void 0;const n=Ob();return ia.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${n.version}`},ia}var Pp;
49function qb(){if(Pp)return Vi;Pp=1;var n=Vi&&Vi.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Vi,"__esModule",{value:!0});const e=n(Y0()),s=n(ld()),o=Gb();class a{constructor(d,{headers:m={},schema:y,fetch:f}={}){this.url=d,this.headers=Object.assign(Object.assign({},o.DEFAULT_HEADERS),m),this.schemaName=y,this.fetch=f}from(d){const m=new URL(`${this.url}/${d}`);return new e.default(m,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(d){return new a(this.url,{headers:this.headers,schema:d,fetch:this.fetch})}rpc(d,m={},{head:y=!1,get:f=!1,count:v}={}){let b;const w=new URL(`${this.url}/rpc/${d}`);let _;y||f?(b=y?"HEAD":"GET",Object.entries(m).filter(([A,E])=>E!==void 0).map(([A,E])=>[A,Array.isArray(E)?`{${E.join(",")}}`:`${E}`]).forEach(([A,E])=>{w.searchParams.append(A,E)})):(b="POST",_=m);const C=Object.assign({},this.headers);return v&&(C.Prefer=`count=${v}`),new s.default({method:b,url:w,headers:C,schema:this.schemaName,body:_,fetch:this.fetch,allowEmpty:!1})}}return Vi.default=a,Vi}var Op;function Bb(){if(Op)return xt;Op=1;var n=xt&&xt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(xt,"__esModule",{value:!0}),xt.PostgrestBuilder=xt.PostgrestTransformBuilder=xt.PostgrestFilterBuilder=xt.PostgrestQueryBuilder=xt.PostgrestClient=void 0;const e=n(qb());xt.PostgrestClient=e.default;const s=n(Y0());xt.PostgrestQueryBuilder=s.default;const o=n(ld());xt.PostgrestFilterBuilder=o.default;const a=n($0());xt.PostgrestTransformBuilder=a.default;const c=n(F0());return xt.PostgrestBuilder=c.default,xt.default={PostgrestClient:e.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:a.default,PostgrestBuilder:c.default},xt}var Hb=Bb();const zb=od(Hb),{PostgrestClient:Vb,PostgrestQueryBuilder:G2,PostgrestFilterBuilder:q2,PostgrestTransformBuilder:B2,PostgrestBuilder:H2}=zb,Fb="2.10.2",$b={"X-Client-Info":`realtime-js/${Fb}`},Yb="1.0.0",J0=1e4,Jb=1e3;var to;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(to||(to={}));var $t;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})($t||($t={}));var vn;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(vn||(vn={}));var qu;(function(n){n.websocket="websocket"})(qu||(qu={}));var ei;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(ei||(ei={}));class Kb{constructor(){this.HEADER_LENGTH=1}decode(e,s){return e.constructor===ArrayBuffer?s(this._binaryDecode(e)):s(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const s=new DataView(e),o=new TextDecoder;return this._decodeBroadcast(e,s,o)}_decodeBroadcast(e,s,o){const a=s.getUint8(1),c=s.getUint8(2);let d=this.HEADER_LENGTH+2;const m=o.decode(e.slice(d,d+a));d=d+a;const y=o.decode(e.slice(d,d+c));d=d+c;const f=JSON.parse(o.decode(e.slice(d,e.byteLength)));return{ref:null,topic:m,event:y,payload:f}}}class K0{constructor(e,s){this.callback=e,this.timerCalc=s,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=s}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ye;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(Ye||(Ye={}));const Gp=(n,e,s={})=>{var o;const a=(o=s.skipTypes)!==null&&o!==void 0?o:[];return Object.keys(e).reduce((c,d)=>(c[d]=Qb(d,n,e,a),c),{})},Qb=(n,e,s,o)=>{const a=e.find(m=>m.name===n),c=a==null?void 0:a.type,d=s[n];
vendor: 13,933 bytes, line 49
49return c&&!o.includes(c)?Q0(c,d):Bu(d)},Q0=(n,e)=>{if(n.charAt(0)==="_"){const s=n.slice(1,n.length);return ew(e,s)}switch(n){case Ye.bool:return Wb(e);case Ye.float4:case Ye.float8:case Ye.int2:case Ye.int4:case Ye.int8:case Ye.numeric:case Ye.oid:return Xb(e);case Ye.json:case Ye.jsonb:return Zb(e);case Ye.timestamp:return tw(e);case Ye.abstime:case Ye.date:case Ye.daterange:case Ye.int4range:case Ye.int8range:case Ye.money:case Ye.reltime:case Ye.text:case Ye.time:case Ye.timestamptz:case Ye.timetz:case Ye.tsrange:case Ye.tstzrange:return Bu(e);default:return Bu(e)}},Bu=n=>n,Wb=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},Xb=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},Zb=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},ew=(n,e)=>{if(typeof n!="string")return n;const s=n.length-1,o=n[s];if(n[0]==="{"&&o==="}"){let c;const d=n.slice(1,s);try{c=JSON.parse("["+d+"]")}catch{c=d?d.split(","):[]}return c.map(m=>Q0(e,m))}return n},tw=n=>typeof n=="string"?n.replace(" ","T"):n,W0=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class Au{constructor(e,s,o={},a=J0){this.channel=e,this.event=s,this.payload=o,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,s){var o;return this._hasReceived(e)&&s((o=this.receivedResp)===null||o===void 0?void 0:o.response),this.recHooks.push({status:e,callback:s}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=s=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=s,this._matchReceive(s)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,s){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:s})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:s}){this.recHooks.filter(o=>o.status===e).forEach(o=>o.callback(s))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var qp;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(qp||(qp={}));class ha{constructor(e,s){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const o=(s==null?void 0:s.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(o.state,{},a=>{const{onJoin:c,onLeave:d,onSync:m}=this.caller;this.joinRef=this.channel._joinRef(),this.state=ha.syncState(this.state,a,c,d),this.pendingDiffs.forEach(y=>{this.state=ha.syncDiff(this.state,y,c,d)}),this.pendingDiffs=[],m()}),this.channel._on(o.diff,{},a=>{const{onJoin:c,onLeave:d,onSync:m}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=ha.syncDiff(this.state,a,c,d),m())}),this.onJoin((a,c,d)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:c,newPresences:d})}),this.onLeave((a,c,d)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:c,leftPresences:d})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,s,o,a){const c=this.cloneDeep(e),d=this.transformState(s),m={},y={};return this.map(c,(f,v)=>{d[f]||(y[f]=v)}),this.map(d,(f,v)=>{const b=c[f];if(b){const w=v.map(E=>E.presence_ref),_=b.map(E=>E.presence_ref),C=v.filter(E=>_.indexOf(E.presence_ref)<0),A=b.filter(E=>w.indexOf(E.presence_ref)<0);C.length>0&&(m[f]=C),A.length>0&&(y[f]=A)}else m[f]=v}),this.syncDiff(c,{joins:m,leaves:y},o,a)}static syncDiff(e,s,o,a){const{joins:c,leaves:d}={joins:this.transformState(s.joins),leaves:this.transformState(s.leaves)};return o||(o=()=>{}),a||(a=()=>{}),this.map(c,(m,y)=>{var f;const v=(f=e[m])!==null&&f!==void 0?f:[];if(e[m]=this.cloneDeep(y),v.length>0){const b=e[m].map(_=>_.presence_ref),w=v.filter(_=>b.indexOf(_.presence_ref)<0);e[m].unshift(...w)}o(m,v,y)}),this.map(d,(m,y)=>{let f=e[m];if(!f)return;const v=y.map(b=>b.presence_ref);f=f.filter(b=>v.indexOf(b.presence_ref)<0),e[m]=f,a(m,f,y),f.length===0&&delete e[m]}),e}static map(e,s){return Object.getOwnPropertyNames(e).map(o=>s(o,e[o]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((s,o)=>{const a=e[o];return"metas"in a?s[o]=a.metas.map(c=>(c.presence_ref=c.phx_ref,delete c.phx_ref,delete c.phx_ref_prev,c)):s[o]=a,s},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Bp;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(Bp||(Bp={}));var Hp;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes"})(Hp||(Hp={}));var zp;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(zp||(zp={}));class cd{constructor(e,s={config:{}},o){this.topic=e,this.params=s,this.socket=o,this.bindings={},this.state=$t.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},s.config),this.timeout=this.socket.timeout,this.joinPush=new Au(this,vn.join,this.params,this.timeout),this.rejoinTimer=new K0(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=$t.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=$t.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=$t.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=$t.errored,this.rejoinTimer.scheduleTimeout())}),this._on(vn.reply,{},(a,c)=>{this._trigger(this._replyEventName(c),a)}),this.presence=new ha(this),this.broadcastEndpointURL=W0(this.socket.endPoint)+"/api/broadcast"}subscribe(e,s=this.timeout){var o,a;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:c,presence:d,private:m}}=this.params;this._onError(v=>e&&e("CHANNEL_ERROR",v)),this._onClose(()=>e&&e("CLOSED"));const y={},f={broadcast:c,presence:d,postgres_changes:(a=(o=this.bindings.postgres_changes)===null||o===void 0?void 0:o.map(v=>v.filter))!==null&&a!==void 0?a:[],private:m};this.socket.accessToken&&(y.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:f},y)),this.joinedOnce=!0,this._rejoin(s),this.joinPush.receive("ok",({postgres_changes:v})=>{var b;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),v===void 0){e&&e("SUBSCRIBED");return}else{const w=this.bindings.postgres_changes,_=(b=w==null?void 0:w.length)!==null&&b!==void 0?b:0,C=[];for(let A=0;A<_;A++){const E=w[A],{filter:{event:I,schema:U,table:G,filter:F}}=E,P=v&&v[A];if(P&&P.event===I&&P.schema===U&&P.table===G&&P.filter===F)C.push(Object.assign(Object.assign({},E),{id:P.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=C,e&&e("SUBSCRIBED");return}}).receive("error",v=>{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(v).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}async track(e,s={}){return await this.send({type:"presence",event:"track",payload:e},s.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,s,o){return this._on(e,s,o)}async send(e,s={}){var o,a;if(!this._canPush()&&e.type==="broadcast"){const{event:c,payload:d}=e,m={method:"POST",headers:{Authorization:this.socket.accessToken?`Bearer ${this.socket.accessToken}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:c,payload:d}]})};try{const y=await this._fetchWithTimeout(this.broadcastEndpointURL,m,(o=s.timeout)!==null&&o!==void 0?o:this.timeout);return await((a=y.body)===null||a===void 0?void 0:a.cancel()),y.ok?"ok":"error"}catch(y){return y.name==="AbortError"?"timed out":"error"}}else return new Promise(c=>{var d,m,y;const f=this._push(e.type,e,s.timeout||this.timeout);e.type==="broadcast"&&!(!((y=(m=(d=this.params)===null||d===void 0?void 0:d.config)===null||m===void 0?void 0:m.broadcast)===null||y===void 0)&&y.ack)&&c("ok"),f.receive("ok",()=>c("ok")),f.receive("error",()=>c("error")),f.receive("timeout",()=>c("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=$t.leaving;const s=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(vn.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(o=>{const a=new Au(this,vn.leave,{},e);a.receive("ok",()=>{s(),o("ok")}).receive("timeout",()=>{s(),o("timed out")}).receive("error",()=>{o("error")}),a.send(),this._canPush()||a.trigger("ok",{})})}async _fetchWithTimeout(e,s,o){const a=new AbortController,c=setTimeout(()=>a.abort(),o),d=await this.socket.fetch(e,Object.assign(Object.assign({},s),{signal:a.signal}));return clearTimeout(c),d}_push(e,s,o=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new Au(this,e,s,o);return this._canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}_onMessage(e,s,o){return s}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,s,o){var a,c;const d=e.toLocaleLowerCase(),{close:m,error:y,leave:f,join:v}=vn;if(o&&[m,y,f,v].indexOf(d)>=0&&o!==this._joinRef())return;let w=this._onMessage(d,s,o);if(s&&!w)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(d)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(_=>{var C,A,E;return((C=_.filter)===null||C===void 0?void 0:C.event)==="*"||((E=(A=_.filter)===null||A===void 0?void 0:A.event)===null||E===void 0?void 0:E.toLocaleLowerCase())===d}).map(_=>_.callback(w,o)):(c=this.bindings[d])===null||c===void 0||c.filter(_=>{var C,A,E,I,U,G;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in _){const F=_.id,P=(C=_.filter)===null||C===void 0?void 0:C.event;return F&&((A=s.ids)===null||A===void 0?void 0:A.includes(F))&&(P==="*"||(P==null?void 0:P.toLocaleLowerCase())===((E=s.data)===null||E===void 0?void 0:E.type.toLocaleLowerCase()))}else{const F=(U=(I=_==null?void 0:_.filter)===null||I===void 0?void 0:I.event)===null||U===void 0?void 0:U.toLocaleLowerCase();return F==="*"||F===((G=s==null?void 0:s.event)===null||G===void 0?void 0:G.toLocaleLowerCase())}else return _.type.toLocaleLowerCase()===d}).map(_=>{if(typeof w=="object"&&"ids"in w){const C=w.data,{schema:A,table:E,commit_timestamp:I,type:U,errors:G}=C;w=Object.assign(Object.assign({},{schema:A,table:E,commit_timestamp:I,eventType:U,new:{},old:{},errors:G}),this._getPayloadRecords(C))}_.callback(w,o)})}_isClosed(){return this.state===$t.closed}_isJoined(){return this.state===$t.joined}_isJoining(){return this.state===$t.joining}_isLeaving(){return this.state===$t.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,s,o){const a=e.toLocaleLowerCase(),c={type:a,filter:s,callback:o};return this.bindings[a]?this.bindings[a].push(c):this.bindings[a]=[c],this}_off(e,s){const o=e.toLocaleLowerCase();return this.bindings[o]=this.bindings[o].filter(a=>{var c;return!(((c=a.type)===null||c===void 0?void 0:c.toLocaleLowerCase())===o&&cd.isEqual(a.filter,s))}),this}static isEqual(e,s){if(Object.keys(e).length!==Object.keys(s).length)return!1;for(const o in e)if(e[o]!==s[o])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(vn.close,{},e)}_onError(e){this._on(vn.error,{},s=>e(s))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=$t.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const s={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(s.new=Gp(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(s.old=Gp(e.columns,e.old_record)),s}}const nw=()=>{},sw=typeof WebSocket<"u";class iw{constructor(e,s){var o;this.accessToken=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=$b,this.params={},this.timeout=J0,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=nw,this.conn=null,this.sendBuffer=[],this.serializer
49=new Kb,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this._resolveFetch=c=>{let d;return c?d=c:typeof fetch>"u"?d=(...m)=>io(async()=>{const{default:y}=await Promise.resolve().then(()=>ao);return{default:y}},void 0).then(({default:y})=>y(...m)):d=fetch,(...m)=>d(...m)},this.endPoint=`${e}/${qu.websocket}`,this.httpEndpoint=W0(e),s!=null&&s.transport?this.transport=s.transport:this.transport=null,s!=null&&s.params&&(this.params=s.params),s!=null&&s.headers&&(this.headers=Object.assign(Object.assign({},this.headers),s.headers)),s!=null&&s.timeout&&(this.timeout=s.timeout),s!=null&&s.logger&&(this.logger=s.logger),s!=null&&s.heartbeatIntervalMs&&(this.heartbeatIntervalMs=s.heartbeatIntervalMs);const a=(o=s==null?void 0:s.params)===null||o===void 0?void 0:o.apikey;a&&(this.accessToken=a,this.apiKey=a),this.reconnectAfterMs=s!=null&&s.reconnectAfterMs?s.reconnectAfterMs:c=>[1e3,2e3,5e3,1e4][c-1]||1e4,this.encode=s!=null&&s.encode?s.encode:(c,d)=>d(JSON.stringify(c)),this.decode=s!=null&&s.decode?s.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new K0(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(s==null?void 0:s.fetch)}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this._endPointURL(),void 0,{headers:this.headers});return}if(sw){this.conn=new WebSocket(this._endPointURL()),this.setupConnection();return}this.conn=new ow(this._endPointURL(),void 0,{close:()=>{this.conn=null}}),io(async()=>{const{default:e}=await import("./browser-B3x0j3MT.js").then(s=>s.b);return{default:e}},[]).then(({default:e})=>{this.conn=new e(this._endPointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}disconnect(e,s){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,s??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const s=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),s}async removeAllChannels(){const e=await Promise.all(this.channels.map(s=>s.unsubscribe()));return this.disconnect(),e}log(e,s,o){this.logger(e,s,o)}connectionState(){switch(this.conn&&this.conn.readyState){case to.connecting:return ei.Connecting;case to.open:return ei.Open;case to.closing:return ei.Closing;default:return ei.Closed}}isConnected(){return this.connectionState()===ei.Open}channel(e,s={config:{}}){const o=new cd(`realtime:${e}`,s,this);return this.channels.push(o),o}push(e){const{topic:s,event:o,payload:a,ref:c}=e,d=()=>{this.encode(e,m=>{var y;(y=this.conn)===null||y===void 0||y.send(m)})};this.log("push",`${s} ${o} (${c})`,a),this.isConnected()?d():this.sendBuffer.push(d)}setAuth(e){this.accessToken=e,this.channels.forEach(s=>{e&&s.updateJoinPayload({access_token:e}),s.joinedOnce&&s._isJoined()&&s._push(vn.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let s=this.channels.find(o=>o.topic===e&&(o._isJoined()||o._isJoining()));s&&(this.log("transport",`leaving duplicate topic "${e}"`),s.unsubscribe())}_remove(e){this.channels=this.channels.filter(s=>s._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Yb}))}_onConnMessage(e){this.decode(e.data,s=>{let{topic:o,event:a,payload:c,ref:d}=s;(d&&d===this.pendingHeartbeatRef||a===(c==null?void 0:c.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${c.status||""} ${o} ${a} ${d&&"("+d+")"||""}`,c),this.channels.filter(m=>m._isMember(o)).forEach(m=>m._trigger(a,c,d)),this.stateChangeCallbacks.message.forEach(m=>m(s))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEac
vendor: 1,316 bytes, line 49
49h(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(s=>s(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(s=>s(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(vn.error))}_appendParams(e,s){if(Object.keys(s).length===0)return e;const o=e.match(/\?/)?"&":"?",a=new URLSearchParams(s);return`${e}${o}${a}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(Jb,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}}class ow{constructor(e,s,o){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=to.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=o.close}}
49class ud extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function bt(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class aw extends ud{constructor(e,s){super(e),this.name="StorageApiError",this.status=s}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class Vp extends ud{constructor(e,s){super(e),this.name="StorageUnknownError",this.originalError=s}}var rw=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};const X0=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...s)=>io(async()=>{const{default:o}=await Promise.resolve().then(()=>ao);return{default:o}},void 0).then(({default:o})=>o(...s)):e=fetch,(...s)=>e(...s)},lw=()=>rw(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield io(()=>Promise.resolve().then(()=>ao),void 0)).Response:Response});var ro=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};const Ru=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),cw=(n,e)=>ro(void 0,void 0,void 0,function*(){const s=yield lw();n instanceof s?n.json().then(o=>{e(new aw(Ru(o),n.status||500))}).catch(o=>{e(new Vp(Ru(o),o))}):e(new Vp(Ru(n),n))}),uw=(n,e,s,o)=>{const a={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(o),Object.assign(Object.assign({},a),s))};function Xr(n,e,s,o,a,c){return ro(this,void 0,void 0,function*(){return new Promise((d,m)=>{n(s,uw(e,o,a,c)).then(y=>{if(!y.ok)throw y;return o!=null&&o.noResolveJson?y:y.json()}).then(y=>d(y)).catch(y=>cw(y,m))})})}function Hu(n,e,s,o){return ro(this,void 0,void 0,function*(){return Xr(n,"GET",e,s,o)})}function As(n,e,s,o,a){return ro(this,void 0,void 0,function*(){return Xr(n,"POST",e,o,a,s)})}function dw(n,e,s,o,a){return ro(this,void 0,void 0,function*(){return Xr(n,"PUT",e,o,a,s)})}function Z0(n,e,s,o,a){return ro(this,void 0,void 0,function*(){return Xr(n,"DELETE",e,o,a,s)})}var an=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};const hw={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Fp={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class fw{constructor(e,s={},o,a){this.url=e,this.headers=s,this.bucketId=o,this.fetch=X0(a)}uploadOrUpdate(e,s,o,a){return an(this,void 0,void 0,function*(){try{let c;const d=Object.assign(Object.assign({},Fp),a),m=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(d.upsert)});typeof Blob<"u"&&o instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",o)):typeof FormData<"u"&&o instanceof FormData?(c=o,c.append("cacheControl",d.cacheControl)):(c=o,m["cache-control"]=`max-age=${d.cacheControl}`,m["content-type"]=d.contentType);const y=this._removeEmptyFolders(s),f=this._getFinalPath(y),v=yield this.fetch(`${this.url}/object/${f}`,Object.assign({method:e,body:c,headers:m},d!=null&&d.duplex?{duplex:d.duplex}:{})),b=yield v.json();return v.ok?{data:{path:y,id:b.Id,fullPath:b.Key},error:null}:{data:null,error:b}}catch(c){if(bt(c))return{data:null,error:c};throw c}})}upload(e,s,o){return an(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,s,o)})}uploadToSignedUrl(e,s,o,a){return an(this,void 0,void 0,function*(){const c=this._removeEmptyFolders(e),d=this._getFinalPath(c),m=new URL(this.url+`/object/upload/sign/${d}`);m.searchParams.set("token",s);try{let y;const f=Object.assign({upsert:Fp.upsert},a),v=Object.assign(Object.assign({},this.headers),{"x-upsert":String(f.upsert)});typeof Blob<"u"&&o instanceof Blob?(y=new FormData,y.append("cacheControl",f.cacheControl),y.append("",o)):typeof FormData<"u"&&o instanceof FormData?(y=o,y.append("cacheControl",f.cacheControl)):(y=o,v["cache-control"]=`max-age=${f.cac
49heControl}`,v["content-type"]=f.contentType);const b=yield this.fetch(m.toString(),{method:"PUT",body:y,headers:v}),w=yield b.json();return b.ok?{data:{path:c,fullPath:w.Key},error:null}:{data:null,error:w}}catch(y){if(bt(y))return{data:null,error:y};throw y}})}createSignedUploadUrl(e,s){return an(this,void 0,void 0,function*(){try{let o=this._getFinalPath(e);const a=Object.assign({},this.headers);s!=null&&s.upsert&&(a["x-upsert"]="true");const c=yield As(this.fetch,`${this.url}/object/upload/sign/${o}`,{},{headers:a}),d=new URL(this.url+c.url),m=d.searchParams.get("token");if(!m)throw new ud("No token returned by API");return{data:{signedUrl:d.toString(),path:e,token:m},error:null}}catch(o){if(bt(o))return{data:null,error:o};throw o}})}update(e,s,o){return an(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,s,o)})}move(e,s,o){return an(this,void 0,void 0,function*(){try{return{data:yield As(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:s,destinationBucket:o==null?void 0:o.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(bt(a))return{data:null,error:a};throw a}})}copy(e,s,o){return an(this,void 0,void 0,function*(){try{return{data:{path:(yield As(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:s,destinationBucket:o==null?void 0:o.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(bt(a))return{data:null,error:a};throw a}})}createSignedUrl(e,s,o){return an(this,void 0,void 0,function*(){try{let a=this._getFinalPath(e),c=yield As(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:s},o!=null&&o.transform?{transform:o.transform}:{}),{headers:this.headers});const d=o!=null&&o.download?`&download=${o.download===!0?"":o.download}`:"";return c={signedUrl:encodeURI(`${this.url}${c.signedURL}${d}`)},{data:c,error:null}}catch(a){if(bt(a))return{data:null,error:a};throw a}})}createSignedUrls(e,s,o){return an(this,void 0,void 0,function*(){try{const a=yield As(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:s,paths:e},{headers:this.headers}),c=o!=null&&o.download?`&download=${o.download===!0?"":o.download}`:"";return{data:a.map(d=>Object.assign(Object.assign({},d),{signedUrl:d.signedURL?encodeURI(`${this.url}${d.signedURL}${c}`):null})),error:null}}catch(a){if(bt(a))return{data:null,error:a};throw a}})}download(e,s){return an(this,void 0,void 0,function*(){const a=typeof(s==null?void 0:s.transform)<"u"?"render/image/authenticated":"object",c=this.transformOptsToQueryString((s==null?void 0:s.transform)||{}),d=c?`?${c}`:"";try{const m=this._getFinalPath(e);return{data:yield(yield Hu(this.fetch,`${this.url}/${a}/${m}${d}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(m){if(bt(m))return{data:null,error:m};throw m}})}getPublicUrl(e,s){const o=this._getFinalPath(e),a=[],c=s!=null&&s.download?`download=${s.download===!0?"":s.download}`:"";c!==""&&a.push(c);const m=typeof(s==null?void 0:s.transform)<"u"?"render/image":"object",y=this.transformOptsToQueryString((s==null?void 0:s.transform)||{});y!==""&&a.push(y);let f=a.join("&");return f!==""&&(f=`?${f}`),{data:{publicUrl:encodeURI(`${this.url}/${m}/public/${o}${f}`)}}}remove(e){return an(this,void 0,void 0,function*(){try{return{data:yield Z0(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(s){if(bt(s))return{data:null,error:s};throw s}})}list(e,s,o){return an(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},hw),s),{prefix:e||""});return{data:yield As(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},o),error:null}}catch(a){if(bt(a))return{data:null,error:a};throw a}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const s=[];return e.width&&s.push(`width=${e.width}`),e.height&&s.push(`height=${e.height}`),e.resize&&s.push(`resize=${e.resize}`),e.format&&s.push(`format=${e.format}`),e.quality&&s.push(`quality=${e.quality}`),s.join("&")}}const mw="2.6.0",pw={"X-Client-Info":`storage-js/${mw}`};var Ki=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}
49return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};class gw{constructor(e,s={},o){this.url=e,this.headers=Object.assign(Object.assign({},pw),s),this.fetch=X0(o)}listBuckets(){return Ki(this,void 0,void 0,function*(){try{return{data:yield Hu(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(bt(e))return{data:null,error:e};throw e}})}getBucket(e){return Ki(this,void 0,void 0,function*(){try{return{data:yield Hu(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(s){if(bt(s))return{data:null,error:s};throw s}})}createBucket(e,s={public:!1}){return Ki(this,void 0,void 0,function*(){try{return{data:yield As(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:s.public,file_size_limit:s.fileSizeLimit,allowed_mime_types:s.allowedMimeTypes},{headers:this.headers}),error:null}}catch(o){if(bt(o))return{data:null,error:o};throw o}})}updateBucket(e,s){return Ki(this,void 0,void 0,function*(){try{return{data:yield dw(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:s.public,file_size_limit:s.fileSizeLimit,allowed_mime_types:s.allowedMimeTypes},{headers:this.headers}),error:null}}catch(o){if(bt(o))return{data:null,error:o};throw o}})}emptyBucket(e){return Ki(this,void 0,void 0,function*(){try{return{data:yield As(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(s){if(bt(s))return{data:null,error:s};throw s}})}deleteBucket(e){return Ki(this,void 0,void 0,function*(){try{return{data:yield Z0(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(s){if(bt(s))return{data:null,error:s};throw s}})}}class yw extends gw{constructor(e,s={},o){super(e,s,o)}from(e){return new fw(this.url,this.headers,e,this.fetch)}}const vw="2.44.4";let ua="";typeof Deno<"u"?ua="deno":typeof document<"u"?ua="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ua="react-native":ua="node";const xw={"X-Client-Info":`supabase-js-${ua}/${vw}`},bw={headers:xw},ww={schema:"public"},Sw={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},_w={};var Tw=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};const Cw=n=>{let e;return n?e=n:typeof fetch>"u"?e=z0:e=fetch,(...s)=>e(...s)},Ew=()=>typeof Headers>"u"?V0:Headers,Nw=(n,e,s)=>{const o=Cw(s),a=Ew();return(c,d)=>Tw(void 0,void 0,void 0,function*(){var m;const y=(m=yield e())!==null&&m!==void 0?m:n;let f=new a(d==null?void 0:d.headers);return f.has("apikey")||f.set("apikey",n),f.has("Authorization")||f.set("Authorization",`Bearer ${y}`),o(c,Object.assign(Object.assign({},d),{headers:f}))})};function Aw(n){return n.replace(/\/$/,"")}function Rw(n,e){const{db:s,auth:o,realtime:a,global:c}=n,{db:d,auth:m,realtime:y,global:f}=e;return{db:Object.assign(Object.assign({},d),s),auth:Object.assign(Object.assign({},m),o),realtime:Object.assign(Object.assign({},y),a),global:Object.assign(Object.assign({},f),c)}}const ey="2.64.4",kw="http://localhost:9999",jw="supabase.auth.token",Iw={"X-Client-Info":`gotrue-js/${ey}`},$p=10,zu="X-Supabase-Api-Version",ty={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function Mw(n){return Math.round(Date.now()/1e3)+n}function Dw(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}const yn=()=>typeof document<"u",Qs={tested:!1,writable:!1},fa=()=>{if(!yn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qs.tested)return Qs.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),Qs.tested=!0,Qs.writable=!0}catch{Qs.tested=!0,Qs.writable=!1}return Qs.writable};function ku(n){const e={},s=new URL(n);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEac
49h((a,c)=>{e[c]=a})}catch{}return s.searchParams.forEach((o,a)=>{e[a]=o}),e}const ny=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...s)=>io(async()=>{const{default:o}=await Promise.resolve().then(()=>ao);return{default:o}},void 0).then(({default:o})=>o(...s)):e=fetch,(...s)=>e(...s)},Uw=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",sy=async(n,e,s)=>{await n.setItem(e,JSON.stringify(s))},Ir=async(n,e)=>{const s=await n.getItem(e);if(!s)return null;try{return JSON.parse(s)}catch{return s}},ju=async(n,e)=>{await n.removeItem(e)};function Lw(n){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",o,a,c,d,m,y,f,v=0;for(n=n.replace("-","+").replace("_","/");v<n.length;)d=e.indexOf(n.charAt(v++)),m=e.indexOf(n.charAt(v++)),y=e.indexOf(n.charAt(v++)),f=e.indexOf(n.charAt(v++)),o=d<<2|m>>4,a=(m&15)<<4|y>>2,c=(y&3)<<6|f,s=s+String.fromCharCode(o),y!=64&&a!=0&&(s=s+String.fromCharCode(a)),f!=64&&c!=0&&(s=s+String.fromCharCode(c));return s}class Zr{constructor(){this.promise=new Zr.promiseConstructor((e,s)=>{this.resolve=e,this.reject=s})}}Zr.promiseConstructor=Promise;function Yp(n){const e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,s=n.split(".");if(s.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(s[1]))throw new Error("JWT is not valid: payload is not in base64url format");const o=s[1];return JSON.parse(Lw(o))}async function Pw(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function Ow(n,e){return new Promise((o,a)=>{(async()=>{for(let c=0;c<1/0;c++)try{const d=await n(c);if(!e(c,null,d)){o(d);return}}catch(d){if(!e(c,d)){a(d);return}}})()})}function Gw(n){return("0"+n.toString(16)).substr(-2)}function qw(){const e=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",o=s.length;let a="";for(let c=0;c<56;c++)a+=s.charAt(Math.floor(Math.random()*o));return a}return crypto.getRandomValues(e),Array.from(e,Gw).join("")}async function Bw(n){const s=new TextEncoder().encode(n),o=await crypto.subtle.digest("SHA-256",s),a=new Uint8Array(o);return Array.from(a).map(c=>String.fromCharCode(c)).join("")}function Hw(n){return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function zw(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),n;const s=await Bw(n);return Hw(s)}async function Qi(n,e,s=!1){const o=qw();let a=o;s&&(a+="/PASSWORD_RECOVERY"),await sy(n,`${e}-code-verifier`,a);const c=await zw(o);return[c,o===c?"plain":"s256"]}const Vw=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Fw(n){const e=n.headers.get(zu);if(!e||!e.match(Vw))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}class dd extends Error{constructor(e,s,o){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=o}}function Ne(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}class $w extends dd{constructor(e,s,o){super(e,s,o),this.name="AuthApiError",this.status=s,this.code=o}}function Yw(n){return Ne(n)&&n.name==="AuthApiError"}class iy extends dd{constructor(e,s){super(e),this.name="AuthUnknownError",this.originalError=s}}class ti extends dd{constructor(e,s,o,a){super(e,o,a),this.name=s,this.status=o}}class Ws extends ti{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}class Iu extends ti{constructor(){super("Auth session or user missing","AuthInvalidToken
49ResponseError",500,void 0)}}class Mr extends ti{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Dr extends ti{constructor(e,s=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Jp extends ti{constructor(e,s=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Vu extends ti{constructor(e,s){super(e,"AuthRetryableFetchError",s,void 0)}}function Mu(n){return Ne(n)&&n.name==="AuthRetryableFetchError"}class Kp extends ti{constructor(e,s,o){super(e,"AuthWeakPasswordError",s,"weak_password"),this.reasons=o}}var Jw=function(n,e){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(s[o[a]]=n[o[a]]);return s};const Xs=n=>
49n.msg||n.message||n.error_description||n.error||JSON.stringify(n),Kw=[502,503,504];async function Qp(n){var e;if(!Uw(n))throw new Vu(Xs(n),0);if(Kw.includes(n.status))throw new Vu(Xs(n),n.status);let s;try{s=await n.json()}catch(c){throw new iy(Xs(c),c)}let o;const a=Fw(n);if(a&&a.getTime()>=ty["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?o=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(o=s.error_code),o){if(o==="weak_password")throw new Kp(Xs(s),n.status,((e=s.weak_password)===null||e===void 0?void 0:e.reasons)||[])}else if(typeof s=="object"&&s&&typeof s.weak_password=="object"&&s.weak_password&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.reasons.reduce((c,d)=>c&&typeof d=="string",!0))throw new Kp(Xs(s),n.status,s.weak_password.reasons);throw new $w(Xs(s),n.status||500,o)}const Qw=(n,e,s,o)=>{const a={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),a.body=JSON.stringify(o),Object.assign(Object.assign({},a),s))};async function Ie(n,e,s,o){var a;const c=Object.assign({},o==null?void 0:o.headers);c[zu]||(c[zu]=ty["2024-01-01"].name),o!=null&&o.jwt&&(c.Authorization=`Bearer ${o.jwt}`);const d=(a=o==null?void 0:o.query)!==null&&a!==void 0?a:{};o!=null&&o.redirectTo&&(d.redirect_to=o.redirectTo);const m=Object.keys(d).length?"?"+new URLSearchParams(d).toString():"",y=await Ww(n,e,s+m,{headers:c,noResolveJson:o==null?void 0:o.noResolveJson},{},o==null?void 0:o.body);return o!=null&&o.xform?o==null?void 0:o.xform(y):{data:Object.assign({},y),error:null}}async function Ww(n,e,s,o,a,c){const d=Qw(e,o,a,c);let m;try{m=await n(s,Object.assign({},d))}catch(y){throw console.error(y),new Vu(Xs(y),0)}if(m.ok||await Qp(m),o!=null&&o.noResolveJson)return m;try{return await m.json()}catch(y){await Qp(y)}}function Ns(n){var e;let s=null;tS(n)&&(s=Object.assign({},n),n.expires_at||(s.expires_at=Mw(n.expires_in)));const o=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:s,user:o},error:null}}function Wp(n){const e=Ns(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((s,o)=>s&&typeof o=="string",!0)&&(e.data.weak_password=n.weak_password),e}function Rs(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function Xw(n){return{data:n,error:null}}function Zw(n){const{action_link:e,email_otp:s,hashed_token:o,redirect_to:a,verification_type:c}=n,d=Jw(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),m={action_link:e,email_otp:s,hashed_token:o,redirect_to:a,verification_type:c},y=Object.assign({},d);return{data:{properties:m,user:y},error:null}}function eS(n){return n}function tS(n){return n.access_token&&n.refresh_token&&n.expires_in}var nS=function(n,e){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(s[o[a]]=n[o[a]]);return s};class sS{constructor({url:e="",headers:s={},fetch:o}){this.url=e,this.headers=s,this.fetch=ny(o),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,s="global"){try{return await Ie(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(o){if(Ne(o))return{data:null,error:o};throw o}}async inviteUserByEmail(e,s={}){try{return await Ie(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:Rs})}catch(o){if(Ne(o))return{data:{user:null},error:o};throw o}}async generateLink(e){try{const{options:s}=e,o=nS(e,["options"]),a=Object.assign(Object.assign({},o),s);return"newEmail"in o&&(a.new_email=o==null?void 0:o.newEmail,delete a.newEmail),await Ie(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:Zw,redirectTo:s==null?void 0:s.redirectTo})}catch(s){if(Ne(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(e){try{return await Ie(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Rs})}catch(s){if(Ne(s))return{data:{user:null},error:s};throw s}}async listUsers(e){var s,o,a,c,d,m,y;try{const f={nextPage:null,lastPage:0,total:0},v=await Ie(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(o=(s=e==null?void 0:e.page)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:"",per_page:(c=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&c!==void 0?c:""},xform:eS});if(v.error)throw v.error;const b=await v.json(),w=(d=v.headers.get("x-total-count"))!==null&&d!==void 0?d:0,_=(y=(m=v.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&y!==void 0?y:[];return _.length>0&&(_.forEach(C=>{const A=parseInt(C.split(";")[0].split("=")[1].substring(0,1)),E=JSON.parse(C.split(";")[1].split("=")[1]);f[`${E}Page`]=A}),f.total=parseInt(w)),{data:Object.assign(Object.assign({},b),f),error:null}}catch(f){if(Ne(f))return{data:{users:[]},error:f};throw f}}async getUserById(e){try{return await Ie(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Rs})}catch(s){if(Ne(s))return{data:{user:null},error:s};throw s}}async updateUserById(e,s){try{return await Ie(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:s,headers:this.headers,xform:Rs})}catch(o){if(Ne(o))return{data:{user:null},error:o};throw o}}
vendor: 21,094 bytes, line 49
49async deleteUser(e,s=!1){try{return await Ie(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:s},xform:Rs})}catch(o){if(Ne(o))return{data:{user:null},error:o};throw o}}async _listFactors(e){try{const{data:s,error:o}=await Ie(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:s,error:o}}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async _deleteFactor(e){try{return{data:await Ie(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}}}const iS={getItem:n=>fa()?globalThis.localStorage.getItem(n):null,setItem:(n,e)=>{fa()&&globalThis.localStorage.setItem(n,e)},removeItem:n=>{fa()&&globalThis.localStorage.removeItem(n)}};function Xp(n={}){return{getItem:e=>n[e]||null,setItem:(e,s)=>{n[e]=s},removeItem:e=>{delete n[e]}}}function oS(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const Wi={debug:!!(globalThis&&fa()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class oy extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class aS extends oy{}async function rS(n,e,s){Wi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);const o=new globalThis.AbortController;return e>0&&setTimeout(()=>{o.abort(),Wi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:o.signal},async a=>{if(a){Wi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,a.name);try{return await s()}finally{Wi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,a.name)}}else{if(e===0)throw Wi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new aS(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(Wi.debug)try{const c=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(c,null," "))}catch(c){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",c)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await s()}})}oS();const lS={url:kw,storageKey:jw,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Iw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},aa=30*1e3,Zp=3;async function eg(n,e,s){return await s()}class ma{constructor(e){var s,o;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=ma.nextInstanceID,ma.nextInstanceID+=1,this.instanceID>0&&yn()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},lS),e);if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new sS({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=ny(a.fetch),this.lock=a.lock||eg,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:yn()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=rS:this.lock=eg,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?a.storage?this.storage=a.storage:fa()?this.storage=iS:(this.memoryStorage={},this.storage=Xp(this.memoryStorage)):(this.memoryStorage={},this.storage=Xp(this.memoryStorage)),yn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(c){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",c)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async c=>{this._debug("received broadcast notification from other tab or client",c),await this._notifyAllSubscribers(c.data.event,c.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${ey}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{const e=yn()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:s,error:o}=await this._getSessionFromURL(e);if(o)return this._debug("#_initialize()","error detecting session from URL",o),(o==null?void 0:o.message)==="Identity is already linked"||(o==null?void 0:o.message)==="Identity is already linked to another user"?{error:o}:(await this._removeSession(),{error:o});const{session:a,redirectType:c}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",c),await this._saveSession(a),setTimeout(async()=>{c==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return Ne(e)?{error:e}:{error:new iy("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var s,o,a;try{const c=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(o=(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.data)!==null&&o!==void 0?o:{},gotrue_meta_security:{captcha_token:(a=e==null?void 0:e.options)===null||a===void 0?void 0:a.captchaToken}},xform:Ns}),{data:d,error:m}=c;if(m||!d)return{data:{user:null,session:null},error:m};const y=d.session,f=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",y)),{data:{user:f,session:y},error:null}}catch(c){if(Ne(c))return{data:{user:null,session:null},error:c};throw c}}async signUp(e){var s,o,a;try{let c;if("email"in e){const{email:v,password:b,options:w}=e;let _=null,C=null;this.flowType==="pkce"&&([_,C]=await Qi(this.storage,this.storageKey)),c=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:w==null?void 0:w.emailRedirectTo,body:{email:v,password:b,data:(s=w==null?void 0:w.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:w==null?void 0:w.captchaToken},code_challenge:_,code_challenge_method:C},xform:Ns})}else if("phone"in e){const{phone:v,password:b,options:w}=e;c=await Ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:v,password:b,data:(o=w==null?void 0:w.data)!==null&&o!==void 0?o:{},channel:(a=w==null?void 0:w.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:w==null?void 0:w.captchaToken}},xform:Ns})}else throw new Mr("You must provide either an email or phone number and a password");const{data:d,error:m}=c;if(m||!d)return{data:{user:null,session:null},error:m};const y=d.session,f=d.user;return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",y)),{data:{user:f,session:y},error:null}}catch(c){if(Ne(c))return{data:{user:null,session:null},error:c};throw c}}async signInWithPassword(e){try{let s;if("email"in e){const{email:c,password:d,options:m}=e;s=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:d,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:Wp})}else if("phone"in e){const{phone:c,password:d,options:m}=e;s=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:d,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:Wp})}else throw new Mr("You must provide either an email or phone number and a password");const{data:o,error:a}=s;return a?{data:{user:null,session:null},error:a}:!o||!o.session||!o.user?{data:{user:null,session:null},error:new Iu}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign({user:o.user,session:o.session},o.weak_password?{weakPassword:o.weak_password}:null),error:a})}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithOAuth(e){var s,o,a,c;return await this._handleProviderSignIn(e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(c=e.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const s=await Ir(this.storage,`${this.storageKey}-code-verifier`),[o,a]=(s??"").split("/"),{data:c,error:d}=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:o},xform:Ns});return await ju(this.storage,`${this.storageKey}-code-verifier`),d?{data:{user:null,session:null,redirectType:null},error:d}:!c||!c.session||!c.user?{data:{user:null,session:null,redirectType:null},error:new Iu}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:Object.assign(Object.assign({},c),{redirectType:a??null}),error:d})}async signInWithIdToken(e){try{const{options:s,provider:o,token:a,access_token:c,nonce:d}=e,m=await Ie(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:o,id_token:a,access_token:c,nonce:d,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:Ns}),{data:y,error:f}=m;return f?{data:{user:null,session:null},error:f}:!y||!y.session||!y.user?{data:{user:null,session:null},error:new Iu}:(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),{data:y,error:f})}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithOtp(e){var s,o,a,c,d;try{if("email"in e){const{email:m,options:y}=e;let f=null,v=null;this.flowType==="pkce"&&([f,v]=await Qi(this.storage,this.storageKey));const{error:b}=await Ie(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:m,data:(s=y==null?void 0:y.data)!==null&&s!==void 0?s:{},create_user:(o=y==null?void 0:y.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:f,code_challenge_method:v},redirectTo:y==null?void 0:y.emailRedirectTo});return{data:{user:null,session:null},error:b}}if("phone"in e){const{phone:m,options:y}=e,{data:f,error:v}=await Ie(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:m,data:(a=y==null?void 0:y.data)!==null&&a!==void 0?a:{},create_user:(c=y==null?void 0:y.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},channel:(d=y==null?void 0:y.channel)!==null&&d!==void 0?d:"sms"}});return{data:{user:null,session:null,messageId:f==null?void 0:f.message_id},error:v}}throw new Mr("You must provide either an email or phone number.")}catch(m){if(Ne(m))return{data:{user:null,session:null},error:m};throw m}}async verifyOtp(e){var s,o;try{let a,c;"options"in e&&(a=(s=e.options)===null||s===void 0?void 0:s.redirectTo,c=(o=e.options)===null||o===void 0?void 0:o.captchaToken);const{data:d,error:m}=await Ie(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:c}}),redirectTo:a,xform:Ns});if(m)throw m;if(!d)throw new Error("An error occurred on token verification.");const y=d.session,f=d.user;return y!=null&&y.access_token&&(await this._saveSession(y),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",y)),{data:{user:f,session:y},error:null}}catch(a){if(Ne(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(e){var s,o,a;try{let c=null,d=null;return this.flowType==="pkce"&&([c,d]=await Qi(this.storage,this.storageKey)),await Ie(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(o=(s=e.options)===null||s===void 0?void 0:s.redirectTo)!==null&&o!==void 0?o:void 0}),!((a=e==null?void 0:e.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:c,code_challenge_method:d}),headers:this.headers,xform:Xw})}catch(c){if(Ne(c))return{data:null,error:c};throw c}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:s},error:o}=e;if(o)throw o;if(!s)throw new Ws;const{error:a}=await Ie(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return{data:{user:null,session:null},error:a}})}catch(e){if(Ne(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const s=`${this.url}/resend`;if("email"in e){const{email:o,type:a,options:c}=e,{error:d}=await Ie(this.fetch,"POST",s,{headers:this.headers,body:{email:o,type:a,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:d}}else if("phone"in e){const{phone:o,type:a,options:c}=e,{data:d,error:m}=await Ie(this.fetch,"POST",s,{headers:this.headers,body:{phone:o,type:a,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}}});return{data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:m}}throw new Mr("You must provide either an email or phone number and a type")}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async s=>s))}async _acquireLock(e,s){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const o=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await o,await s()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const o=s();for(this.pendingInLock.push((async()=>{try{await o}catch{}})()),await o;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await o}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const s=await this.__loadSession();return await e(s)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const s=await Ir(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?e=s:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const o=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${o?"":" not"} expired`,"expires_at",e.expires_at),!o){if(this.storage.isServer){let d=this.suppressGetSessionWarning;e=new Proxy(e,{get:(y,f,v)=>(!d&&f==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),d=!0,this.suppressGetSessionWarning=!0),Reflect.get(y,f,v))})}return{data:{session:e},error:null}}const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);return c?{data:{session:null},error:c}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Rs}):await this._useSession(async s=>{var o,a,c;const{data:d,error:m}=s;if(m)throw m;return!(!((o=d.session)===null||o===void 0)&&o.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ws}:await Ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(a=d.session)===null||a===void 0?void 0:a.access_token)!==null&&c!==void 0?c:void 0,xform:Rs})})}catch(s){if(Ne(s))return{data:{user:null},error:s};throw s}}async updateUser(e,s={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,s))}async _updateUser(e,s={}){try{return await this._useSession(async o=>{const{data:a,error:c}=o;if(c)throw c;if(!a.session)throw new Ws;const d=a.session;let m=null,y=null;this.flowType==="pkce"&&e.email!=null&&([m,y]=await Qi(this.storage,this.storageKey));const{data:f,error:v}=await Ie(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s==null?void 0:s.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:m,code_challenge_method:y}),jwt:d.access_token,xform:Rs});if(v)throw v;return d.user=f.user,await this._saveSession(d),await this._notifyAllSubscribers("USER_UPDATED",d),{data:{user:d.user},error:null}})}catch(o){if(Ne(o))return{data:{user:null},error:o};throw o}}_decodeJWT(e){return Yp(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ws;const s=Date.now()/1e3;let o=s,a=!0,c=null;const d=Yp(e.access_token);if(d.exp&&(o=d.exp,a=o<=s),a){const{session:m,error:y}=await this._callRefreshToken(e.refresh_token);if(y)return{data:{user:null,session:null},error:y};if(!m)return{data:{user:null,session:null},error:null};c=m}else{const{data:m,error:y}=await this._getUser(e.access_token);if(y)throw y;c={access_token:e.access_token,refresh_token:e.refresh_token,user:m.user,token_type:"bearer",expires_in:o-s,expires_at:o},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return{data:{user:c.user,session:c},error:null}}catch(s){if(Ne(s))return{data:{session:null,user:null},error:s};throw s}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async s=>{var o;if(!e){const{data:d,error:m}=s;if(m)throw m;e=(o=d.session)!==null&&o!==void 0?o:void 0}if(!(e!=null&&e.refresh_token))throw new Ws;const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);return c?{data:{user:null,session:null},error:c}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async _getSessionFromURL(e){try{if(!yn())throw new Dr("No browser detected.");
49if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Dr("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Jp("Not a valid PKCE flow url.");const s=ku(window.location.href);if(e){if(!s.code)throw new Jp("No code detected.");const{data:U,error:G}=await this._exchangeCodeForSession(s.code);if(G)throw G;const F=new URL(window.location.href);return F.searchParams.delete("code"),window.history.replaceState(window.history.state,"",F.toString()),{data:{session:U.session,redirectType:null},error:null}}if(s.error||s.error_description||s.error_code)throw new Dr(s.error_description||"Error in URL with unspecified error_description",{error:s.error||"unspecified_error",code:s.error_code||"unspecified_code"});const{provider_token:o,provider_refresh_token:a,access_token:c,refresh_token:d,expires_in:m,expires_at:y,token_type:f}=s;if(!c||!m||!d||!f)throw new Dr("No session defined in URL");const v=Math.round(Date.now()/1e3),b=parseInt(m);let w=v+b;y&&(w=parseInt(y));const _=w-v;_*1e3<=aa&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${_}s, should have been closer to ${b}s`);const C=w-b;v-C>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",C,w,v):v-C<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",C,w,v);const{data:A,error:E}=await this._getUser(c);if(E)throw E;const I={provider_token:o,provider_refresh_token:a,access_token:c,expires_in:b,expires_at:w,refresh_token:d,token_type:f,user:A.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:I,redirectType:s.type},error:null}}catch(s){if(Ne(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantFlow(){const e=ku(window.location.href);return!!(yn()&&(e.access_token||e.error_description))}async _isPKCEFlow(){const e=ku(window.location.href),s=await Ir(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&s)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async s=>{var o;const{data:a,error:c}=s;if(c)return{error:c};const d=(o=a.session)===null||o===void 0?void 0:o.access_token;if(d){const{error:m}=await this.admin.signOut(d,e);if(m&&!(Yw(m)&&(m.status===404||m.status===401||m.status===403)))return{error:m}}return e!=="others"&&(await this._removeSession(),await ju(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){const s=Dw(),o={id:s,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",s),this.stateChangeEmitters.delete(s)}};return this._debug("#onAuthStateChange()","registered callback with id",s),this.stateChangeEmitters.set(s,o),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(s)})))(),{data:{subscription:o}}}async _emitInitialSession(e){return await this._useSession(async s=>{var o,a;try{const{data:{session:c},error:d}=s;if(d)throw d;await((o=this.stateChangeEmitters.get(e))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",e,"session",c)}catch(c){await((a=this.stateChangeEmitters.get(e))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",c),console.error(c)}})}async resetPasswordForEmail(e,s={}){let o=null,a=null;this.flowType==="pkce"&&([o,a]=await Qi(this.storage,this.storageKey,!0));try{return await Ie(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:o,code_challenge_method:a,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(c){if(Ne(c))return{data:null,error:c};throw c}}async getUserIdentities(){var e;try{const{data:s,error:o}=await this.getUser();if(o)throw o;return{data:{identities:(e=s.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async linkIdentity(e){var s;try{const{data:o,error:a}=await this._useSession(async c=>{var d,m,y,f,v;const{data:b,error:w}=c;if(w)throw w;const _=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(d=e.options)===null||d===void 0?void 0:d.redirectTo,scopes:(m=e.options)===null||m===void 0?void 0:m.scopes,queryParams:(y=e.options)===null||y===void 0?void 0:y.queryParams,skipBrowserRedirect:!0});return await Ie(this.fetch,"GET",_,{headers:this.headers,jwt:(v=(f=b.session)===null||f===void 0?void 0:f.access_token)!==null&&v!==void 0?v:void 0})});if(a)throw a;return yn()&&!(!((s=e.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(o==null?void 0:o.url),{data:{provider:e.provider,url:o==null?void 0:o.url},error:null}}catch(o){if(Ne(o))return{data:{provider:e.provider,url:null},error:o};throw o}}async unlinkIdentity(e){try{return await this._useSession(async s=>{var o,a;const{data:c,error:d}=s;
vendor: 5,366 bytes, line 49
49if(d)throw d;return await Ie(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(a=(o=c.session)===null||o===void 0?void 0:o.access_token)!==null&&a!==void 0?a:void 0})})}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async _refreshAccessToken(e){const s=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{const o=Date.now();return await Ow(async a=>(a>0&&await Pw(200*Math.pow(2,a-1)),this._debug(s,"refreshing attempt",a),await Ie(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ns})),(a,c)=>{const d=200*Math.pow(2,a);return c&&Mu(c)&&Date.now()+d-o<aa})}catch(o){if(this._debug(s,"error",o),Ne(o))return{data:{session:null,user:null},error:o};throw o}finally{this._debug(s,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,s){const o=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",s,"url",o),yn()&&!s.skipBrowserRedirect&&window.location.assign(o),{data:{provider:e,url:o},error:null}}async _recoverAndRefresh(){var e;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await Ir(this.storage,this.storageKey);if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const a=Math.round(Date.now()/1e3),c=((e=o.expires_at)!==null&&e!==void 0?e:1/0)<a+$p;if(this._debug(s,`session has${c?"":" not"} expired with margin of ${$p}s`),c){if(this.autoRefreshToken&&o.refresh_token){const{error:d}=await this._callRefreshToken(o.refresh_token);d&&(console.error(d),Mu(d)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",d),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(e){var s,o;if(!e)throw new Ws;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new Zr;const{data:c,error:d}=await this._refreshAccessToken(e);if(d)throw d;if(!c.session)throw new Ws;await this._saveSession(c.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",c.session);const m={session:c.session,error:null};return this.refreshingDeferred.resolve(m),m}catch(c){if(this._debug(a,"error",c),Ne(c)){const d={session:null,error:c};return Mu(c)||(await this._removeSession(),await this._notifyAllSubscribers("SIGNED_OUT",null)),(s=this.refreshingDeferred)===null||s===void 0||s.resolve(d),d}throw(o=this.refreshingDeferred)===null||o===void 0||o.reject(c),c}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(e,s,o=!0){const a=`#_notifyAllSubscribers(${e})`;this._debug(a,"begin",s,`broadcast = ${o}`);try{this.broadcastChannel&&o&&this.broadcastChannel.postMessage({event:e,session:s});const c=[],d=Array.from(this.stateChangeEmitters.values()).map(async m=>{try{await m.callback(e,s)}catch(y){c.push(y)}});if(await Promise.all(d),c.length>0){for(let m=0;m<c.length;m+=1)console.error(c[m]);throw c[0]}}finally{this._debug(a,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await sy(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await ju(this.storage,this.storageKey)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&yn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),aa);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async s=>{const{data:{session:o}}=s;if(!o||!o.refresh_token||!o.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((o.expires_at*1e3-e)/aa);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${aa}ms, refresh threshold is ${Zp} ticks`),a<=Zp&&await this._callRefreshToken(o.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s
49)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof oy)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!yn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const s=`#_onVisibilityChanged(${e})`;this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(s,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,s,o){const a=[`provider=${encodeURIComponent(s)}`];if(o!=null&&o.redirectTo&&a.push(`redirect_to=${encodeURIComponent(o.redirectTo)}`),o!=null&&o.scopes&&a.push(`scopes=${encodeURIComponent(o.scopes)}`),this.flowType==="pkce"){const[c,d]=await Qi(this.storage,this.storageKey),m=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(d)}`});a.push(m.toString())}if(o!=null&&o.queryParams){const c=new URLSearchParams(o.queryParams);a.push(c.toString())}return o!=null&&o.skipBrowserRedirect&&a.push(`skip_http_redirect=${o.skipBrowserRedirect}`),`${e}?${a.join("&")}`}async _unenroll(e){try{return await this._useSession(async s=>{var o;const{data:a,error:c}=s;return c?{data:null,error:c}:await Ie(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(o=a==null?void 0:a.session)===null||o===void 0?void 0:o.access_token})})}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async _enroll(e){try{return await this._useSession(async s=>{var o,a;const{data:c,error:d}=s;if(d)return{data:null,error:d};const{data:m,error:y}=await Ie(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:(o=c==null?void 0:c.session)===null||o===void 0?void 0:o.access_token});return y?{data:null,error:y}:(!((a=m==null?void 0:m.totp)===null||a===void 0)&&a.qr_code&&(m.totp.qr_code=`data:image/svg+xml;utf-8,${m.totp.qr_code}`),{data:m,error:null})})}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async s=>{var o;const{data:a,error:c}=s;if(c)return{data:null,error:c};const{data:d,error:m}=await Ie(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(o=a==null?void 0:a.session)===null||o===void 0?void 0:o.access_token});return m?{data:null,error:m}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+d.expires_in},d)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",d),{data:d,error:m})})}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async s=>{var o;const{data:a,error:c}=s;return c?{data:null,error:c}:await Ie(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:(o=a==null?void 0:a.session)===null||o===void 0?void 0:o.access_token})})}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}async _challengeAndVerify(e){const{data:s,error:o}=await this._challenge({factorId:e.factorId});return o?{data:null,error:o}:await this._verify({factorId:e.factorId,challengeId:s.id,code:e.code})}async _listFactors(){const{data:{user:e},error:s}=await this.getUser();if(s)return{data:null,error:s};const o=(e==null?void 0:e.factors)||[],a=o.filter(c=>c.factor_type==="totp"&&c.status==="verified");return{data:{all:o,totp:a},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var s,o;const{data:{session:a},error:c}=e;if(c)return{data:null,error:c};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const d=this._decodeJWT(a.access_token);let m=null;d.aal&&(m=d.aal);let y=m;((o=(s=a.user.factors)===null||s===void 0?void 0:s.filter(b=>b.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(y="aal2");const v=d.amr||[];return{data:{currentLevel:m,nextLevel:y,currentAuthenticationMethods:v},error:null}}))}}ma.nextInstanceID=0;const cS=ma;class uS extends cS{constructor(e){super(e)}}var dS=function(n,e,s,o){function a(c){return c instanceof s?c:new s(function(d){d(c)})}
49return new(s||(s=Promise))(function(c,d){function m(v){try{f(o.next(v))}catch(b){d(b)}}function y(v){try{f(o.throw(v))}catch(b){d(b)}}function f(v){v.done?c(v.value):a(v.value).then(m,y)}f((o=o.apply(n,e||[])).next())})};class hS{constructor(e,s,o){var a,c,d;if(this.supabaseUrl=e,this.supabaseKey=s,!e)throw new Error("supabaseUrl is required.");if(!s)throw new Error("supabaseKey is required.");const m=Aw(e);this.realtimeUrl=`${m}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${m}/auth/v1`,this.storageUrl=`${m}/storage/v1`,this.functionsUrl=`${m}/functions/v1`;const y=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f={db:ww,realtime:_w,auth:Object.assign(Object.assign({},Sw),{storageKey:y}),global:bw},v=Rw(o??{},f);this.storageKey=(a=v.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(c=v.global.headers)!==null&&c!==void 0?c:{},this.auth=this._initSupabaseAuthClient((d=v.auth)!==null&&d!==void 0?d:{},this.headers,v.global.fetch),this.fetch=Nw(s,this._getAccessToken.bind(this),v.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},v.realtime)),this.rest=new Vb(`${m}/rest/v1`,{headers:this.headers,schema:v.db.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new jb(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new yw(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,s={},o={}){return this.rest.rpc(e,s,o)}channel(e,s={config:{}}){return this.realtime.channel(e,s)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,s;return dS(this,void 0,void 0,function*(){const{data:o}=yield this.auth.getSession();return(s=(e=o.session)===null||e===void 0?void 0:e.access_token)!==null&&s!==void 0?s:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:s,detectSessionInUrl:o,storage:a,storageKey:c,flowType:d,debug:m},y,f){var v;const b={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new uS({url:this.authUrl,headers:Object.assign(Object.assign({},b),y),storageKey:c,autoRefreshToken:e,persistSession:s,detectSessionInUrl:o,storage:a,flowType:d,debug:m,fetch:f,hasCustomAuthorizationHeader:(v="Authorization"in this.headers)!==null&&v!==void 0?v:!1})}_initRealtimeClient(e){return new iw(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((s,o)=>{this._handleTokenChanged(s,"CLIENT",o==null?void 0:o.access_token)})}_handleTokenChanged(e,s,o){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==o?(this.realtime.setAuth(o??null),this.changedAccessToken=o):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),s=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const fS=(n,e,s)=>new hS(n,e,s),mS=({page:n,setPage:e,isLoggedIn:s})=>{const[o,a]=R.useState(!1),[c,d]=R.useState(!1);R.useEffect(()=>{const b=()=>{d(window.scrollY>20)};return window.addEventListener("scroll",b),()=>window.removeEventListener("scroll",b)},[]);const m=[{name:"Home",href:"#"},{name:"About",href:"#"},{name:"Stories",href:"#"},{name:"Manifesto",href:"#"},{name:"Research",href:"#"},{name:"Toolkit",href:"#"},{name:"GPTs",href:"#"},{name:"Engage",href:"#"}],y=b=>{e({name:b}),a(!1)},f=async()=>{await oe.auth.signOut(),a(!1)},v=[m.find(b=>b.name==="Home"),m.find(b=>b.name==="About"),m.find(b=>b.name==="Stories"),m.find(b=>b.name==="Manifesto"),m.find(b=>b.name==="Toolkit"),m.find(b=>b.name==="Research"),m.find(b=>b.name==="Engage"),m.find(b=>b.name==="GPTs")];return l.jsxs("header",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${c?"bg-white/80 backdrop-blur-md border-b border-slate-200 shadow-sm":"bg-white/50 backdrop-blur-sm border-transparent"}`,children:[l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"flex items-center justify-between h-20",children:[l.jsx("button",{onClick:()=>y("Home"),className:"text-2xl font-bold tracking-tight text-slate-900",children:"ECO-STAR NORTH"}),l.jsxs("nav",{className:"hidden xl:flex items-center space-x-6",children:[v.map(b=>b.target==="_blank"?l.jsx("a",{href:b.href,target:"_blank",rel:"noopener noreferrer",className:"transition-colors duration-200 text-base font-medium text-slate-600 hover:text-indigo-600",children:b.name},b.name):l.jsx("button",{onClick:()=>y(b.name),className:`transition-colors duration-200 text-base font-medium ${n.name===b.name?"text-indigo-600":"text-slate-600 hover:text-indigo-600"}`,children:b.name},b.name)),s&&l.jsx("button",{onClick:()=>y("Admin"),className:`transition-colors duration-200 text-base font-medium ${n.name==="Admin"?"text-indigo-600":"text-slate-600 hover:text-indigo-600"}`,children:"Admin"}),l.jsx("div",{className:"w-px h-6 bg-slate-300"}),s?l.jsx("button",{onClick:f,className:"px-4 py-2 rounded-lg bg-rose-50 text-rose-600 font-semibold hover:bg-rose-100 transition border border-rose-100",children:"Logout"}):l.jsx("button",{onClick:()=>y("Login"),className:"px-4 py-2 rounded-lg bg-slate-900 text-white hover:bg-slate-800 transition shadow-md hover:shadow-lg",children:"Login"})]}),l.jsx("div",{className:"xl:hidden",children:l.jsxs("button",{type:"button",onClick:()=>a(!o),className:"inline-flex items-center justify-center p-2 rounded-md text-slate-600 hover:text-slate-900 hover:bg-slate-100 focus:outline-none","aria-expanded":o,children:[l.jsx("span",{className:"sr-only",children:"Open main menu"}),o?l.jsx("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):l.jsx("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})]})})]})}),l.jsx("div",{className:`xl:hidden overflow-hidden transition-all duration-300 ease-in-out bg-white border-b border-slate-200 ${o?"max-h-[32rem]
49shadow-lg":"max-h-0"}`,children:l.jsxs("div",{className:"px-4 pt-2 pb-6 space-y-1 sm:px-6",children:[v.map(b=>b.target==="_blank"?l.jsx("a",{href:b.href,target:"_blank",rel:"noopener noreferrer",className:"w-full text-left block px-3 py-3 rounded-md text-base font-medium text-slate-600 hover:bg-slate-50 hover:text-slate-900",children:b.name},b.name):l.jsx("button",{onClick:()=>y(b.name),className:`w-full text-left block px-3 py-3 rounded-md text-base font-medium transition-colors duration-200 ${n.name===b.name?"bg-indigo-50 text-indigo-700":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"}`,children:b.name},b.name)),s&&l.jsx("button",{onClick:()=>y("Admin"),className:`w-full text-left block px-3 py-3 rounded-md text-base font-medium transition-colors duration-200 ${n.name==="Admin"?"bg-indigo-50 text-indigo-700":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"}`,children:"Admin"}),l.jsx("div",{className:"border-t border-slate-100 my-2 pt-2"}),s?l.jsx("button",{onClick:f,className:"w-full text-left block px-3 py-3 rounded-md text-base font-medium text-rose-600 hover:bg-rose-50",children:"Logout"}):l.jsx("button",{onClick:()=>y("Login"),className:"w-full text-left block px-3 py-3 rounded-md text-base font-medium text-slate-600 hover:bg-slate-50 hover:text-slate-900",children:"Login"})]})})]})},Yt=[{letter:"E",title:"Environment",question:"What is the environmental context and impact of your idea?",description:"Analyze your project's relationship with the planet. This is the foundation. Consider materials, energy use, supply chains, and end-of-life. Frame your innovation within the larger story of climate justice, ecosystem restoration, and the circular economy. How does your idea listen to and honor the land?",color:"text-teal-700",bgColor:"bg-teal-50",borderColor:"border-teal-200"},{letter:"C",title:"Customer",question:"Who is the customer? What is the unmet need?",description:"This is often the first light bulb moment. Identify the real customer â who is paying for the service or product? What do we know about them? Is there more than one? What need of theirs are you addressing? How do you know about it? What techniques have you used to get close to the customer to really understand the issue? Are you sure the need is not currently being met by any other organisation?",color:"text-cyan-700",bgColor:"bg-cyan-50",borderColor:"border-cyan-200"},{letter:"O",title:"Opportunity",question:"What extra opportunities exist outside the nominated customer group?",description:"What is the wider potential of your idea? Is there a way of extending the impact of your idea into other areas? Could you increase your return on investment by expanding or rolling out your innovation later on? What are the characteristics of the market you are looking at? Do you know the trends, the values, the social and technological changes that will affect the market? This is where you should demonstrate your deep knowledge of the particular market place.",color:"text-rose-700",bgColor:"bg-rose-50",borderColor:"border-rose-200"},{letter:"S",title:"Solution",question:"What is your idea for creating value for your customer?",description:"This is the articulation of the idea. Move from a general idea into a more detailed description of whom it will benefit, and how it will be developed and disseminated. Use creative techniques to stimulate new ideas. Describe your business model, estimate costs, and always undertake proof of concept. Develop fast prototyping even if it is for a service: nothing works faster to show you the efficacy of an idea. Identify risks and determine if and how you can manage them.",color:"text-amber-700",bgColor:"bg-amber-50",borderColor:"border-amber-200"},{letter:"T",title:"Team",question:"What knowledge, skills and contacts do you need to deliver your idea?",description:"Think in terms of attributes rather than individuals. Do you have access to all the necessary attributes in your team? If not, where else might you gain access to them? Be bold â think outside the obvious contacts, and look beyond your own networks. Be wary of focusing so hard on your own role that you lose sight of whether other organisations may need to cooperate for a successful roll-out.",color:"text-indigo-700",bgColor:"bg-indigo-50",borderColor:"border-indigo-200"},{letter:"A",title:"Advantage",question:"What is your competitive advantage?",description:"What do you offer that no one else is offering? To answer this, you need to know who or what the competition is and what they are offering. What do they do brilliantly and how can you learn from and enhance that? Try reframing the problem to see if you can identify an unconsidered advantage â NASA spent millions on a pen that would work in space, whereas the Russians simply asked âhow do we write in spaceâ and used a pencil!",color:"text-lime-700",bgColor:"bg-lime-50",borderColor:"border-lime-200"},{letter:"R",title:"Results",question:"What are the quantifiable results and return on investment?",description:"Numbers are really important here. Identify the specific return on investment. Give a t
49imeline showing projected out turn, with milestones, for example, looking at time to profitability and growth. Despite the need for numbers, donât disregard the qualitative results â demonstrate long term impact if possible. Show benefits to the end user e.g. measure changes in customer delight.",color:"text-fuchsia-700",bgColor:"bg-fuchsia-50",borderColor:"border-fuchsia-200"}],pS=({item:n,index:e,className:s=""})=>l.jsx("div",{className:`group bg-white rounded-2xl p-6 md:p-10 flex flex-col gap-6 transition-all duration-300 shadow-sm hover:shadow-xl border border-slate-100 hover:border-slate-200 h-full ${s}`,children:l.jsxs("div",{className:"flex-grow flex flex-col justify-center items-center text-center",children:[l.jsx("h3",{className:`text-3xl font-bold text-slate-800 group-hover:${n.color} transition-colors`,children:n.title}),l.jsx("p",{className:"text-slate-500 mt-2 text-lg italic font-medium",children:n.question}),l.jsx("p",{className:"text-slate-600 mt-4 leading-relaxed text-lg",children:n.description})]})}),Yn=({markdown:n="",className:e="text-lg text-slate-600 leading-relaxed",linkClassName:s="text-current hover:text-white underline decoration-white/50 decoration-2 underline-offset-2 transition-colors font-semibold"})=>{const o=a=>a.split(/(\[.*?\]\(.*?\))/g).map((d,m)=>{const y=d.match(/\[(.*?)\]\((.*?)\)/);return y?l.jsx("a",{href:y[2],target:"_blank",rel:"noopener noreferrer",className:s,children:y[1]},m):d});return l.jsx(l.Fragment,{children:n.split(` 50`).map((a,c)=>{if(a.trim()==="")return null;const d=a.split(/(\*\*.*?\*\*)/g);return l.jsx("p",{className:`mt-4 ${e} first:mt-0`,children:d.map((m,y)=>m.startsWith("**")&&m.endsWith("**")?l.jsx("strong",{className:"font-bold text-inherit",children:o(m.substring(2,m.length-2))},y):o(m))},c)})})},rn={hero:{subtitle1:"An Interactive Innovation Toolkit for the Arts, Creative and Climate Entrepreneurship",subtitle2:"Restorying the art and practice of possibility.",buttonText:"Take the Survey"},whatIs:{title:"What is ECO-STAR?",description:`A powerful methodology for creating compelling value, designed for creative entrepreneurs and community innovators. **E**nvironment, **C**ustomer, **O**pportunity, **S**olution, **T**eam, **A**dvantage, **R**esults. 51 52ECO-STAR North harnesses the power of multi-agent generative AI to explore possibilities, simulate outcomes, and accelerate co-creationâturning ideas into actionable strategies while keeping community knowledge and creativity at the center.`,subTitle:"Deconstructing the Methodology",subDescription:"ECO-STAR is a simple yet comprehensive framework that guides you through the critical stages of innovation. Each letter represents a key pillar to consider, ensuring your idea is viable, sustainable, and valuable."},supplyChain:{title:"Designing Resilient Supply Chains",description:"ECO-STAR North is more than a methodology; it is a digital infrastructure for designing resilient value chains. In the creative and social innovation sectors, the 'supply chain' moves knowledge, cultural capital, and relationships. Our tools facilitate the ethical sourcing of these intangible assets, ensuring your project is built on a foundation of trust, sustainability, and community needs."},origin:{title:"Origin of the Methodology",description:"CO-STAR was co-created by Dr. Herman Gyr, Laszlo Gyorffy, and Lisa Gyorffy as an evolution of innovation models that emerged in Silicon Valley. Building on their earlier work refining the NABC frameworkâoriginally developed by Curt Carlson at Sarnoffâthey designed CO-STAR as an alternative approach that integrated insights from several leading innovation methodologies."},toolkitCta:{title:"Ready to Build Your Idea?",description:"Explore our interactive toolkit to apply the ECO-STAR framework to your own projects and bring your vision to life.",buttonText:"Use the Toolkit"},vision:{title:"The ECO-STAR North Vision",description:`**Watch this short video to learn what ECO-STAR North is and how it works.** 53ECO-STAR North is an arts-based, AI-enabled platform designed to support community-led research, innovation, and economic development in Northern contexts. Grounded in creative practice and Indigenous knowledge, it helps communities articulate their values, explore opportunities, and build strategies on their own terms.`,videoUrl:"https://artsincubator.ca/ecostar/ECO-STAR-North.mp4"},nuclearAssessment:{title:"Integrated Nuclear Waste Impact Assessment Facilitation",description:"ECO-STAR North is designed to support upcoming integrated impact assessment processes led by the Impact Assessment Agency of Canada (IAAC) and the Canadian Nuclear Safety Commission (CNSC). Our tools help systematically gather, analyze, and integrate local and Indigenous knowledge alongside technical regulatory information, ensuring meaningful community participation in the assessment of the proposed Deep Geological Repository (DGR).",imageUrl:"https://artsincubator.ca/wp-content/uploads/2024/12/DGR2020_3D_Measurements-1.jpeg"},knowledgeCreation:{title:"Generative Epistemology and the Co-Creation of Knowledge",description:"Art becomes a way of knowing, sharing, and shaping knowledge collectively. Through storytelling, creative inquiry, and participatory making, ECO-STAR North fosters environments where knowledge emerges from relationships, lived experience, and connection to land and community. By designing space
53s that encourage dialogue and collaboration, creativity becomes infrastructure, enabling communities to co-create knowledge that shapes the future of their spaces and places.",imageUrl:"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/11/20250807_2237_Cozy-Heritage-Gallery-Transformation_remix_01k23vzgb0edd9vnhv5ym8yk65-1.jpeg"},partnersCta:{title:"Sponsors & Partners",description:"We are seeking partners, sponsors, artists, organizations, and innovators to join our mission. If you are passionate about fostering a sovereign and sustainable creative economy in the North, let's connect and build the future together.",buttonText:"Become a Partner"},acknowledgements:{title:"Acknowledgements",description:"This project has been seeded with generous support from the **[Minneapolis College of Art and Design Creative Entrepreneurship Program](https://www.mcad.edu/academics/undergraduate/majors/creative-entrepreneurship)**, **[The Arts Incubator Winnipeg](/)**, **[Art Borups Corners](/borupscorners)**, **[The Labovitz School of Business and Economics at the University of Minnesota Duluth](https://lsbe.d.umn.edu)**, **[Manitoba Arts Council](https://artscouncil.mb.ca)**, **[The Ontario Arts Council Multi and Inter-Arts Projects program](https://www.arts.on.ca/grants/multi-and-inter-arts-projects)**, the **[Government of Ontario](https://www.ontario.ca/page/government-ontario)**, **[Melgund Recreation, Arts and Culture](https://melgundrecreation.ca)**, **[The Local Services Board of Melgund](https://dymentcommunity.com)**, and the **[OpenAI Researcher Access Program](https://
53openai.smapply.org/prog/openai_researcher_access_program/)**."}},tg=({setPage:n})=>{var w,_,C,A,E,I,U,G;const[e,s]=R.useState([]),[o,a]=R.useState(0),[c,d]=R.useState(rn),[m,y]=R.useState(!0);R.useEffect(()=>{(async()=>{const{data:P,error:$}=await oe.from("costar_background_images").select("image_url, photo_credit");$||!P||P.length===0?console.error("Could not fetch background images",$):(s(P),a(Math.floor(Math.random()*P.length)));const{data:H,error:Z}=await oe.from("costar_pages").select("content").eq("slug","home").single();if(Z)console.error("Could not fetch home page content, using defaults.",Z);else if(H&&H.content){const X=H.content,q={hero:{...rn.hero,...X.hero},whatIs:{...rn.whatIs,...X.whatIs},supplyChain:{...rn.supplyChain,...X.supplyChain},origin:{...rn.origin,...X.origin},toolkitCta:{...rn.toolkitCta,...X.toolkitCta},vision:{...rn.vision,...X.vision},nuclearAssessment:{...rn.nuclearAssessment,...X.nuclearAssessment},knowledgeCreation:{...rn.knowledgeCreation,...X.knowledgeCreation},partnersCta:{...rn.partnersCta,...X.partnersCta},acknowledgements:{...rn.acknowledgements,...X.acknowledgements}};d(q)}y(!1)})()},[]),R.useEffect(()=>{if(e.length>1){const F=setInterval(()=>{a(P=>(P+1)%e.length)},8e3);return()=>clearInterval(F)}},[e.length]);const f=()=>{const F=document.getElementById("what-is-ecostar");F&&F.scrollIntoView({behavior:"smooth"})},v=e[o],b=c||rn;return m?l.jsx("div",{className:"pt-20 text-center py-48 text-slate-500",children:"Loading content..."}):l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsxs("section",{className:"relative min-h-[90vh] flex items-center overflow-hidden bg-slate-900",children:[e.map((F,P)=>l.jsx("div",{className:"absolute inset-0 bg-cover bg-center transition-opacity duration-1000 ease-in-out",style:{backgroundImage:`url(${F.image_url})`,opacity:P===o?1:0}},P)),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-slate-50 via-slate-50/90 to-slate-50/10 md:to-transparent"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-50 via-transparent to-transparent md:hidden"}),l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-20 pb-16",children:l.jsxs("div",{className:"max-w-2xl animate-fade-in",children:[l.jsxs("h1",{className:"text-5xl md:text-7xl lg:text-8xl font-black text-slate-900 tracking-tight leading-none mb-6",children:["ECO-STAR",l.jsx("br",{}),l.jsx("span",{className:"text-indigo-600",children:"NORTH"})]}),l.jsx("p",{className:"text-xl md:text-2xl text-slate-700 font-medium leading-relaxed max-w-xl",children:b.hero.subtitle1}),l.jsx("div",{className:"w-16 h-1 bg-indigo-600 mt-6 mb-6"}),l.jsx("p",{className:"text-lg text-slate-500 max-w-lg mb-10",children:b.hero.subtitle2}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[l.jsx("button",{onClick:()=>n({name:"Survey"}),className:"px-8 py-4 rounded-xl bg-indigo-600 text-white font-bold text-lg hover:bg-indigo-700 transition-all shadow-lg hover:shadow-indigo-200 hover:-translate-y-1",children:b.hero.buttonText}),l.jsx("button",{onClick:f,className:"px-8 py-4 rounded-xl bg-white text-slate-700 border border-slate-200 font-bold text-lg hover:bg-slate-50 transition-all shadow-md hover:shadow-lg hover:-translate-y-1",children:"Explore Methodology"})]})]})}),(v==null?void 0:v.photo_credit)&&l.jsxs("div",{className:"absolute bottom-4 right-4 text-xs text-white/80 bg-black/30 backdrop-blur-sm px-2 py-1 rounded-md tracking-wide z-20",children:["Photo by ",v.photo_credit]})]}),l.jsx("section",{className:"py-24 bg-white border-b border-slate-200",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-16 items-center",children:[l.jsxs("div",{className:"order-2 lg:order-1",children:[l.jsx("span",{className:"text-teal-600 font-bold tracking-wide uppercase text-sm mb-2 block",children:"Our Vision"}),l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-slate-900 mb-6 tracking-tight",children:b.vision.title}),l.jsx("div",{className:"text-lg text-slate-600 leading-relaxed",children:l.jsx(Yn,{markdown:b.vision.description,linkClassName:"text-indigo-600 hover:text-indigo-800 underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})})]}),l.jsxs("div",{className:"relative order-1 lg:order-2",children:[l.jsx("div",{className:"absolute -inset-4 bg-gradient-to-r from-teal-400 to-indigo-500 rounded-3xl opacity-20 blur-xl"}),l.jsx("div",{className:"relative rounded-2xl overflow-hidden shadow-2xl bg-slate-900 aspect-video ring-1 ring-slate-900/5",children:l.jsx("video",{src:b.vision.videoUrl,controls:!0,className:"w-full h-full object-cover",children:"Your browser does not support the video tag."})})]})]})})}),l.jsxs("section",{id:"what-is-ecostar",className:"py-24 bg-indigo-950 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle at 2px 2px, white 1px, transparent 0)",backgroundSize:"40px 40px"}}),l.jsx("div",{className:"absolute top-0 right-0 -mt-20 -mr-20 w-96 h-96 bg-indigo-500 rounded-full mix-blend-multiply filter blur-3xl op
53acity-20"}),l.jsx("div",{className:"absolute bottom-0 left-0 -mb-20 -ml-20 w-96 h-96 bg-teal-500 rounded-full mix-blend-multiply filter blur-3xl opacity-20"}),l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 max-w-[96rem] relative z-10",children:[l.jsxs("div",{className:"text-center max-w-4xl mx-auto mb-20",children:[l.jsx("span",{className:"text-indigo-300 font-bold tracking-wide uppercase text-sm mb-2 block",children:"The Framework"}),l.jsx("h2",{className:"text-4xl md:text-5xl font-black text-white tracking-tight",children:b.whatIs.title}),l.jsx("div",{className:"mt-6 text-xl text-indigo-100 leading-relaxed",children:l.jsx(Yn,{markdown:b.whatIs.description,className:"text-lg text-indigo-100 leading-relaxed",linkClassName:"text-indigo-300 hover:text-white underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})})]}),l.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 mx-auto",children:Yt.map((F,P)=>l.jsx(pS,{item:F,index:P,className:P===Yt.length-1?"lg:col-span-2":""},F.letter))})]})]}),l.jsx("section",{className:"py-24 bg-white border-t border-slate-100 relative overflow-hidden",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 relative z-10",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-slate-900 mb-8 tracking-tight",children:b.origin.title}),l.jsx("div",{className:"prose prose-lg mx-auto text-slate-600 leading-relaxed",children:l.jsx(Yn,{markdown:b.origin.description,linkClassName:"text-indigo-600 hover:text-indigo-800 underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})})]})})}),l.jsxs("section",{className:"py-32 bg-indigo-950 text-white relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle at 2px 2px, white 1px, transparent 0)",backgroundSize:"40px 40px"}}),l.jsx("div",{className:"absolute top-0 right-0 -mt-20 -mr-20 w-96 h-96 bg-indigo-500 rounded-full mix-blend-multiply filter blur-3xl op
53acity-20"}),l.jsx("div",{className:"absolute bottom-0 left-0 -mb-20 -ml-20 w-96 h-96 bg-teal-500 rounded-full mix-blend-multiply filter blur-3xl opacity-20"}),l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 text-center",children:[l.jsx("h2",{className:"text-4xl md:text-6xl font-black mb-8 tracking-tight",children:b.toolkitCta.title}),l.jsx("div",{className:"max-w-2xl mx-auto text-indigo-100 text-xl leading-relaxed mb-12",children:l.jsx(Yn,{markdown:b.toolkitCta.description,className:"text-indigo-100"})}),l.jsx("button",{onClick:()=>n({name:"Toolkit"}),className:"px-12 py-5 rounded-full bg-white text-indigo-950 font-bold text-lg hover:bg-indigo-50 transition-all shadow-2xl hover:shadow-white/20 transform hover:-translate-y-1",children:b.toolkitCta.buttonText})]})]}),l.jsx("section",{className:"py-24 bg-white border-t border-slate-100",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{className:"order-2 lg:order-1",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-slate-900 mb-6 tracking-tight",children:((w=b.supplyChain)==null?void 0:w.title)||"Designing Resilient Supply Chains"}),l.jsx("div",{className:"text-lg text-slate-600 leading-relaxed mb-8",children:l.jsx(Yn,{markdown:((_=b.supplyChain)==null?void 0:_.description)||"ECO-STAR North is more than a methodology; it is a digital infrastructure for designing resilient value chains. In the creative and social innovation sectors, the 'supply chain' moves knowledge, cultural capital, and relationships. Our tools facilitate the ethical sourcing of these intangible assets, ensuring your project is built on a foundation of trust, sustainability, and community needs.",linkClassName:"text-indigo-600 hover:text-indigo-800 underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})}),l.jsxs("button",{onClick:()=>n({name:"Toolkit"}),className:"text-indigo-600 font-bold text-lg hover:text-indigo-800 transition-colors flex items-center group",children:["Start Building Your Innovation Pipeline",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-2 transform group-hover:translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]}),l.jsxs("div",{className:"order-1 lg:order-2 rounded-2xl overflow-hidden shadow-lg h-64 md:h-80 relative group",children:[l.jsx("img",{src:"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/07/multi-inter-arts-borups-corners-september-2025-cindy-vegetables.jpg",alt:"Innovation Supply Chain",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900/60 to-transparent"}),l.jsxs("div",{className:"absolute bottom-0 left-0 p-8 text-white",children:[l.jsx("span",{className:"block text-sm font-bold text-indigo-200 uppercase tracking-widest mb-1",children:"Innovation Flows"}),l.jsx("span",{className:"block text-2xl font-bold",children:"From Raw Ideas to Community Impact"})]})]})]})})}),l.jsx("section",{className:"py-24 bg-slate-50 border-t border-slate-200",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{className:"order-2 lg:order-1",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-slate-900 mb-6 tracking-tight",children:((C=b.nuclearAssessment)==null?void 0:C.title)||"Integrated Nuclear Waste Impact Assessment Facilitation"}),l.jsx("div",{className:"text-lg text-slate-600 leading-relaxed mb-8",children:l.jsx(Yn,{markdown:((A=b.nuclearAssessment)==null?void 0:A.description)||"ECO-STAR North is designed to support upcoming integrated impact assessment processes led by the Impact Assessment Agency of Canada (IAAC) and the Canadian Nuclear Safety Commission (CNSC). Our tools help systematically gather, analyze, and integrate local and Indigenous knowledge alongside technical regulatory information, ensuring meaningful community participation in the assessment of the proposed Deep Geological Repository (DGR).",linkClassName:"text-indigo-600 hover:text-indigo-800 underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})}),l.jsxs("button",{onClick:()=>n({name:"Research"}),className:"text-indigo-600 font-bold text-lg hover:text-indigo-800 transition-colors flex items-center group",children:["Learn More about Integrated Assessment",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-2 transform group-hover:translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]}),l.jsxs("div",{className:"order-1 lg:order-2 rounded-2xl overflow-hidden shadow-lg h-64 md:h-80 relative group",children:[l.jsx("img",{src:((E=b.nuclearAssessment)==null?void 0:E.imageUrl)||"https://artsincubator.ca/wp-content/uploads/2024/12/DGR2020_3D_Measurements-1.jpeg",alt:"Integrated Assessment Visualization",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900/60 to-transparent"}),l.jsxs("div",{className:"absolute bottom-0 left-0 p-8 text-white",children:[l.jsx("span",{className:"block text-sm font-bold text-indigo-200 uppercase tracking-widest mb-1",children:"Community Impact"}),l.jsx("span",{className:"block text-2xl font-bold",children:"Informed Decision Making"})]})]})]})})}),l.jsx("section",{className:"py-24 bg-white border-t border-slate-200",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{className:"order-2 lg:order-1",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-slate-900 mb-6 tracking-tight",children:((I=b.knowledgeCreation)==null?void 0:I.title)||"Generative Epistemology and the Co-Creation of Knowledge"}),l.jsx("div",{className:"text-lg text-slate-600 leading-relaxed mb-8",children:l.jsx(Yn,{markdown:((U=b.knowledgeCreation)==null?void 0:U.description)||"Art becomes a way of knowing, sharing, and shaping knowledge collectively. Through storytelling, creative inquiry, and participatory making, ECO-STAR North fosters environments where knowledge emerges from relationships, lived experience, and connection to land and community. By designing space
53s that encourage dialogue and collaboration, creativity becomes infrastructure, enabling communities to co-create knowledge that shapes the future of their spaces and places.",linkClassName:"text-indigo-600 hover:text-indigo-800 underline decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-semibold"})}),l.jsxs("button",{onClick:()=>n({name:"MethodologyGenerator"}),className:"text-indigo-600 font-bold text-lg hover:text-indigo-800 transition-colors flex items-center group",children:["Create a Custom Methodology",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-2 transform group-hover:translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]}),l.jsxs("div",{className:"order-1 lg:order-2 rounded-2xl overflow-hidden shadow-lg h-64 md:h-80 relative group",children:[l.jsx("img",{src:((G=b.knowledgeCreation)==null?void 0:G.imageUrl)||"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/11/20250807_2237_Cozy-Heritage-Gallery-Transformation_remix_01k23vzgb0edd9vnhv5ym8yk65-1.jpeg",alt:"Generative Epistemology",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900/60 to-transparent"}),l.jsxs("div",{className:"absolute bottom-0 left-0 p-8 text-white",children:[l.jsx("span",{className:"block text-sm font-bold text-indigo-200 uppercase tracking-widest mb-1",children:"Co-Creation"}),l.jsx("span",{className:"block text-2xl font-bold",children:"Knowledge Infrastructure"})]})]})]})})}),l.jsxs("section",{className:"py-24 relative overflow-hidden bg-emerald-900",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-emerald-600 via-teal-600 to-cyan-700"}),l.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(255,255,255,0.4) 1px, transparent 0)",backgroundSize:"24px 24px"}}),l.jsx("div",{className:"absolute top-0 left-0 -mt-10 -ml-10 w-96 h-96 bg-yellow-400 rounded-full mix-blend-overlay filter blur-3xl op
53acity-25"}),l.jsx("div",{className:"absolute bottom-0 right-0 -mb-10 -mr-10 w-96 h-96 bg-cyan-400 rounded-full mix-blend-overlay filter blur-3xl opacity-30"}),l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 relative z-10",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[l.jsx("span",{className:"inline-block py-1 px-4 rounded-full bg-white/20 backdrop-blur-sm text-white text-xs font-bold tracking-widest uppercase mb-8 border border-white/30 shadow-sm",children:"Join the Ecosystem"}),l.jsx("h2",{className:"text-4xl md:text-6xl font-black text-white tracking-tight mb-8 drop-shadow-sm",children:b.partnersCta.title}),l.jsx("div",{className:"mt-6 text-xl text-emerald-50 leading-relaxed font-light",children:l.jsx(Yn,{markdown:b.partnersCta.description,className:"text-emerald-50"})}),l.jsx("div",{className:"mt-12",children:l.jsx("button",{onClick:()=>n({name:"Engage"}),className:"px-12 py-5 rounded-full bg-white text-emerald-700 font-extrabold text-xl hover:bg-emerald-50 transition-all shadow-2xl hover:shadow-white/20 transform hover:-translate-y-1 hover:scale-105 active:scale-95",children:b.partnersCta.buttonText})})]})})]}),l.jsx("section",{className:"py-24 bg-slate-50 border-t border-slate-200",children:l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900 mb-8",children:b.acknowledgements.title}),l.jsx("div",{className:"text-base text-slate-500 leading-relaxed",children:l.jsx(Yn,{markdown:b.acknowledgements.description,className:"text-base text-slate-500 leading-relaxed",linkClassName:"text-slate-700 hover:text-indigo-600 underline decoration-slate-300 hover:decoration-indigo-300 decoration-2 underline-offset-2 transition-colors font-bold"})})]})})})]})},gS=()=>l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("header",{className:"text-center mb-16",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-sky-600 to-indigo-600",children:"About ECO-STAR North"}),l.jsx("p",{className:"mt-6 text-xl md:text-2xl text-slate-600 leading-relaxed text-center max-w-4xl mx-auto font-light",children:"A Decolonized Innovation Ecosystem for Northern Arts and Creative Economies"})]}),l.jsx("div",{className:"prose prose-lg max-w-4xl mx-auto text-slate-600 leading-relaxed mb-12 text-center",children:l.jsx("p",{children:"ECO-STAR North is a regional innovation ecosystem designed to support inclusive, community-driven creative economies in Northwestern Ontario. By blending Indigenous knowledge systems with contemporary innovation practices, the project fosters collaboration across arts, technology, entrepreneurship, and community development. Through a networked approach, ECO-STAR North provides the mentorship, infrastructure, research, and resources needed to turn ideas into viable, scalable creative enterprises, while strengthening the social and cultural fabric of the region."})}),l.jsxs("div",{className:"w-full aspect-video rounded-3xl overflow-hidden shadow-lg mb-16 relative group",children:[l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2025/08/northern-arts-remote-communities.jpeg",alt:"Northern Arts Remote Communities",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900/30 to-transparent"})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 mb-16",children:[l.jsxs("div",{className:"bg-white p-8 md:p-10 rounded-3xl border border-slate-100 shadow-lg shadow-sky-100/50 hover:shadow-sky-100 transition-shadow",children:[l.jsxs("h2",{className:"text-3xl font-bold text-slate-900 mb-6 flex items-center",children:[l.jsx("span",{className:"w-12 h-12 rounded-full bg-sky-100 text-sky-600 flex items-center justify-center mr-4 text-xl",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),"Our Mission"]}),l.jsxs("ul",{className:"space-y-4 text-lg text-slate-600",children:[l.jsxs("li",{className:"flex items-start",children:[l.jsx("span",{className:"mt-2 w-2 h-2 bg-sky-500 rounded-full flex-shrink-0 mr-3"}),l.jsx("span",{children:"Provide accessible tools and resources that integrate Indigenous knowledge with innovation and creative entrepreneurship."})]}),l.jsxs("li",{className:"flex items-start",children:[l.jsx("span",{className:"mt-2 w-2 h-2 bg-sky-500 rounded-full flex-shrink-0 mr-3"}),l.jsx("span",{children:"Build a community of practice that encourages peer-to-peer learning, mentorship, and collaborative experimentation."})]}),l.jsxs("li",{className:"flex items-start",children:[l.jsx("span",{className:"mt-2 w-2 h-2 bg-sky-500 rounded-full flex-shrink-0 mr-3"}),l.jsx("span",{children:"Advocate for systemic change that recognizes the unique value of Northern creative and cultural industries."})]})]})]}),l.jsxs("div",{className:"bg-white p-8 md:p-10 rounded-3xl border border-slate-100 shadow-lg shadow-indigo-100/50 hover:shadow-indigo-100 transition-shadow",children:[l.jsxs("h2",{className:"text-3xl font-bold text-slate-900 mb-6 flex items-center",children:[l.jsx("span",{className:"w-12 h-12 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-4 text-xl",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),"Our Vision"]}),l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed",children:"ECO-STAR North envisions a Northern Ontario where creative economies thrive, community knowledge is mobilized, and cultural entrepreneurship drives sustainable economic and social impact. We aim to create resilient, inclusive innovation ecosystems that empower artists, entrepreneurs, and community leaders to shape the future of the region."})]})]}),l.jsxs("div",{className:"space-y-16",children:[l.jsx("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-200",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Building an Innovation Ecosystem"}),l.jsxs("div",{className:"prose prose-lg max-w-none text-slate-600 leading-relaxed",children:[l.jsx("p",{children:"As a regional hub for innovation, ECO-STAR North brings together arts, technology, and entrepreneurship in a coordinated ecosystem. The project activates physical spacesâsuch as community pavilions, galleries, terraces, and innovation labsâto serve as hub
53s for creativity, experimentation, and collaboration. Through participatory programs and workshops, participants gain skills in digital arts, design thinking, creative business management, and cultural entrepreneurship."}),l.jsx("p",{children:"The ecosystem approach ensures that local resources, networks, and knowledge are strategically leveraged, enabling small and medium-sized creative enterprises to grow, collaborate, and commercialize innovative products, services, and ideas. By connecting rural and urban communities, the project strengthens regional creative clusters, facilitates cross-sector partnerships, and builds pathways for sustained economic and cultural development."})]})]}),l.jsx("div",{className:"rounded-2xl overflow-hidden shadow-lg h-full min-h-[300px] border border-slate-100",children:l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2025/07/The-Arts-Incubator-Manitoba-Nunavut-Northwestern-Ontario-Minnesota.jpg",alt:"Map of the Innovation Ecosystem",className:"w-full h-full object-cover hover:scale-105 transition-transform duration-700"})})]})}),l.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 lg:gap-12 items-center",children:[l.jsxs("div",{className:"lg:col-span-5 order-2 lg:order-1 h-full min-h-[400px] relative rounded-3xl overflow-hidden shadow-xl group",children:[l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2025/09/multi-inter-arts-borups-corners-september-2025-craft-table.jpg",alt:"Community Craft Table",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900/90 via-slate-900/20 to-transparent flex flex-col justify-end p-8 md:p-10",children:[l.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Inclusivity at the Core"}),l.jsx("p",{className:"text-slate-200 text-lg font-light leading-relaxed",children:"Co-created with artists, Indigenous communities, and youth to ensure innovation is culturally grounded."})]})]}),l.jsxs("div",{className:"lg:col-span-7 order-1 lg:order-2",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Community-Led and Inclusive Innovation"}),l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed",children:"ECO-STAR North prioritizes participatory governance and community leadership. Programs and initiatives are co-created with artists, Indigenous communities, youth, and underrepresented groups, ensuring that innovation is inclusive, culturally grounded, and responsive to local needs. By fostering peer-to-peer learning, mentorship, and knowledge-sharing, the project strengthens human capital and promotes capacity-building across Northern Ontarioâs creative sector."})]})]}),l.jsxs("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-200",children:[l.jsxs("div",{className:"rounded-2xl overflow-hidden shadow-sm mb-10 h-64 md:h-80 relative group",children:[l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2025/07/fresh-ontario-strawberries-living-lab-northern-arts-project.jpg",alt:"Living Lab Strawberries",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-6 bg-gradient-to-t from-black/60 to-transparent",children:l.jsx("span",{className:"text-white/90 font-medium tracking-wide text-sm uppercase",children:"Living Labs & Local Economies"})})]}),l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Creative Entrepreneurship and Capacity-Building"}),l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed mb-6",children:"Through workshops, accelerator-style programs, and mentorship networks, ECO-STAR North supports entrepreneurial skill development, market readiness, and business innovation in the arts. These programs help Northern artists, creators, and innovators transform their work into sustainable enterprises, while generating social and economic impact in their communities."})]}),l.jsxs("div",{className:"bg-slate-50 p-8 rounded-2xl border border-slate-100",children:[l.jsx("h3",{className:"font-bold text-slate-800 mb-4 text-xl",children:"Participants gain practical knowledge in:"}),l.jsxs("ul",{className:"space-y-3",children:[l.jsxs("li",{className:"flex items-start text-slate-700",children:[l.jsx("svg",{className:"w-5 h-5 text-indigo-500 mr-3 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Creative business planning and management"]}),l.jsxs("li",{className:"flex items-start text-slate-700",children:[l.jsx("svg",{className:"w-5 h-5 text-indigo-500 mr-3 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Digital arts and technology integration"]}),l.jsxs("li",{className:"flex items-start text-slate-700",children:[l.jsx("svg",{className:"w-5 h-5 text-indigo-500 mr-3 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Project commercialization and market development"]}),l.jsxs("li",{className:"flex items-start text-slate-700",children:[l.jsx("svg",{className:"w-5 h-5 text-indigo-500 mr-3 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Collaborative project design and cross-sector partnerships"]})]})]})]})]}),l.jsx("div",{className:"bg-gradient-to-br from-slate-900 to-indigo-950 p-8 md:p-12 rounded-3xl border border-indigo-900 text-white",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"text-3xl font-bold text-white mb-6",children:"Strategic Roadmap & Platform Maturity"}),l.jsxs("p",{className:"text-lg text-indigo-100 leading-relaxed mb-8",children:["ECO-STAR North is asse
53ssed at ",l.jsx("strong",{children:"Technology Readiness Level (TRL) 7"}),", operating as a system prototype in an operational environment. Our platform is designed to align with and advance the goals of FedNor's ",l.jsx("a",{href:"https://fednor.canada.ca/en/our-programs/regional-economic-growth-through-innovation-regi/regional-innovation-ecosystems",target:"_blank",rel:"noopener noreferrer",className:"text-sky-300 hover:text-sky-100 hover:underline",children:"Regional Economic Growth through Innovation (REGI)"})," and ",l.jsx("a",{href:"https://fednor.canada.ca/en/our-programs/regional-artificial-intelligence-initiative-raii-northern-ontario",target:"_blank",rel:"noopener noreferrer",className:"text-sky-300 hover:text-sky-100 hover:underline",children:"Regional Artificial Intelligence Initiative (RAII)"}),"."]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-bold text-sky-400 mb-3",children:"Data Sovereignty & Indigenous Focus"}),l.jsx("p",{className:"text-slate-300 leading-relaxed",children:'We are actively investigating "Local AI" and Small Language Models (SLMs) that can be hosted on Canadian servers or on-device. This transition is critical to ensuring strict adherence to OCAP® principles (Ownership, Control, Access, and Possession), guaranteeing that Indigenous data remains under Indigenous control.'})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-bold text-sky-400 mb-3",children:"Northern Connectivity Solutions"}),l.jsx("p",{className:"text-slate-300 leading-relaxed",children:`Recognizing the infrastructure challenges in Northern Ontario, we are enhancing the platform's offline capabilities. Our roadmap includes "Offline Mode" functionality, allowing artists in fly-in communities to draft plans, complete assessments, and access resources without a persistent internet connection, syncing data only when connectivity is restored.`})]})]}),l.jsxs("div",{className:"mt-8 pt-8 border-t border-indigo-800/50",children:[l.jsx("h3",{className:"text-xl font-bold text-sky-400 mb-3",children:"Generative Economic Engine"}),l.jsx("p",{className:"text-slate-300 leading-relaxed",children:'Ultimately, ECO-STAR North functions as a "force multiplier" for the Northern innovation ecosystem. By automating the intellectual labor of business planning, grant writing, and impact measurement, we allow a small support team to serve thousands of creators. We are not just building a website; we are building a scalable infrastructure for immediate economic diversity and growth.'})]})]})}),l.jsx("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-200",children:l.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{className:"order-2 lg:order-1",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Research and Knowledge Networks"}),l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed",children:"ECO-STAR North integrates a regional research network that provides evidence-informed guidance, tracks emerging trends, and connects participants with national and international innovation communities. By combining research, practice, and entrepreneurship, the project ensures that innovation is strategically directed, culturally relevant, and regionally impactful."})]}),l.jsx("div",{className:"order-1 lg:order-2 rounded-2xl overflow-hidden shadow-md h-64 md:h-80 lg:h-full min-h-[300px]",children:l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2025/06/dyment-recreation-complex-melgund-township.jpg",alt:"Dyment Recreation Complex",className:"w-full h-full object-cover transition-transform duration-700 hover:scale-105"})})]})}),l.jsxs("div",{className:"pt-8 text-center",children:[l.jsx("h3",{className:"text-xl font-bold text-slate-900 mb-6",children:"Acknowledgements"}),l.jsxs("p",{className:"text-slate-500 leading-relaxed max-w-4xl mx-auto",children:["This project has been seeded with generous support from the ",l.jsx("a",{href:"https://www.mcad.edu/academics/undergraduate/majors/creative-entrepreneurship",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"Minneapolis College of Art and Design Creative Entrepreneurship Program"}),", ",l.jsx("a",{href:"/",className:"font-bold text-slate-700 hover:text-indigo-600",children:"The Arts Incubator Winnipeg"}),", ",l.jsx("a",{href:"/borupscorners",className:"font-bold text-slate-700 hover:text-indigo-600",children:"Art Borups Corners"}),", ",l.jsx("a",{href:"https://lsbe.d.umn.edu",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"The Labovitz School of Business and Economics at the University of Minnesota Duluth"}),", ",l.jsx("a",{href:"https://artscouncil.mb.ca",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"Manitoba Arts Council"}),", ",l.jsx("a",{href:"https://www.arts.on.ca/grants/multi-and-inter-arts-projects",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"The Ontario Arts Council Multi and Inter-Arts Projects program"}),", the ",l.jsx("a",{href:"https://www.ontario.ca/page/government-ontario",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"Government of Ontario"}),", ",l.jsx("a",{href:"https://melgundrecreation.ca",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"Melgund Recreation, Arts and Culture"}),", ",l.jsx("a",{href:"https://dymentcommunity.com",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"The Local Services Board of Melgund"}),", and the ",l.jsx("a",{href:"https://openai.smapply.org/prog/openai_researcher_access_program/",target:"_blank",rel:"noopener noreferrer",className:"font-bold text-slate-700 hover:text-indigo-600",children:"OpenAI Researcher Access Program"}),"."]})]})]})]})}),ng={teal:{border:"border-teal-200",hoverBorder:"hover:border-teal-400",bg:"bg-teal-50",text:"text-teal-800",hoverShadow:"hover:shadow-teal-100"},cyan:{border:"border-cyan-200",hoverBorder:"hover:border-cyan-400",bg:"bg-cyan-50",text:"text-cyan-800",hoverShadow:"hover:shadow-cyan-100"},rose:{border:"border-rose-200",hoverBorder:"hover:border-rose-400",bg:"bg-rose-50",text:"text-rose-800",hoverShadow:"hover:shadow-rose-100"},amber:{border:"border-amber-200",hoverBorder:"hover:border-amber-400",bg:"bg-amber-50",text:"text-amber-800",hoverShadow:"hover:shadow-amber-100"},indigo:{border:"border-indigo-200",hoverBorder:"hover:border-indigo-400",bg:"bg-indigo-50",text:"text-indigo-800",hoverShadow:"hover:shadow-indigo-100"},lime:{border:"border-lime-200",hoverBorder:"hover:border-lime-400",bg:"bg-lime-50",text:"text-lime-800",hoverShadow:"hover:shadow-lime-100"},fuchsia:{border:"border-fuchsia-200",hoverBorder:"hover:border-fuchsia-400",bg:"bg-fuchsia-50",text:"text-fuchsia-800",hoverShadow:"hover:shadow-fuchsia-100"},sky:{border:"border-sky-200",hoverBorder:"hover:border-sky-400",bg:"bg-sky-50",text:"text-sky-800",hoverShadow:"hover:shadow-sky-100"},purple:{border:"border-purple-200",hoverBorder:"hover:border-purple-400",bg:"bg-purple-50",text:"text-purple-800",hoverShadow:"hover:shadow-
53purple-100"},green:{border:"border-green-200",hoverBorder:"hover:border-green-400",bg:"bg-green-50",text:"text-green-800",hoverShadow:"hover:shadow-green-100"},slate:{border:"border-slate-200",hoverBorder:"hover:border-slate-400",bg:"bg-white",text:"text-slate-800",hoverShadow:"hover:shadow-slate-100"},orange:{border:"border-orange-200",hoverBorder:"hover:border-orange-400",bg:"bg-orange-50",text:"text-orange-800",hoverShadow:"hover:shadow-orange-100"},yellow:{border:"border-yellow-200",hoverBorder:"hover:border-yellow-400",bg:"bg-yellow-50",text:"text-yellow-800",hoverShadow:"hover:shadow-yellow-100"},pink:{border:"border-pink-200",hoverBorder:"hover:border-pink-400",bg:"bg-pink-50",text:"text-pink-800",hoverShadow:"hover:shadow-pink-100"},violet:{border:"border-violet-200",hoverBorder:"hover:border-violet-400",bg:"bg-violet-50",text:"text-violet-800",hoverShadow:"hover:shadow-violet-100"},red:{border:"border-red-200",hoverBorder:"hover:border-red-400",bg:"bg-red-50",text:"text-red-800",hoverShadow:"hover:shadow-red-100"},emerald:{border:"border-emerald-200",hoverBorder:"hover:border-emerald-400",bg:"bg-emerald-50",text:"text-emerald-800",hoverShadow:"hover:shadow-emerald-100"}},yS=({setPage:n})=>{const[e,s]=R.useState([]),[o,a]=R.useState(!0);return R.useEffect(()=>{(async()=>{a(!0);const{data:d,error:m}=await oe.from("costar_manifesto_articles").select("slug, title, excerpt, color").order("sort_order",{ascending:!0});m?console.error("Error fetching manifesto summaries:",m):s(d),a(!1)})()},[]),l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("header",{className:"text-center mb-16 md:mb-20",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-teal-500 to-indigo-600",children:"The ECO-STAR North Manifesto"}),l.jsx("p",{className:"mt-4 text-2xl md:text-3xl text-slate-800 font-light",children:"Principles for Sovereign Creators"}),l.jsx("p",{className:"mt-8 max-w-2xl mx-auto text-lg text-slate-600",children:"This is not a manual; it's a spark. A collection of provocations designed for the artist, the community builder, and the caretaker of the land. It's a guide for building with purpose, a compass for navigating a future we must create together. Explore the principles that form the heart of our work."})]}),o?l.jsx("div",{className:"text-center text-slate-500",children:"Loading principles..."}):l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:e.map(c=>{const d=ng[c.color]||ng.slate;return l.jsxs("button",{onClick:()=>n({name:"ManifestoArticle",params:{slug:c.slug}}),className:`w-full text-left flex flex-col p-8 rounded-2xl border transition-all duration-300 hover:-translate-y-2 shadow-sm hover:shadow-xl ${d.border} ${d.hoverBorder} ${d.bg} ${d.hoverShadow||"hover:shadow-slate-200"} group`,children:[l.jsx("h2",{className:`text-2xl font-bold ${d.text} mb-4`,children:c.title}),l.jsx("p",{className:"text-slate-600 leading-relaxed flex-grow text-base",children:c.excerpt}),l.jsxs("div",{className:`mt-6 font-semibold flex items-center ${d.text} group-hover:underline`,children:["Read Principle",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})]},c.slug)})})]})})},sg={teal:{gradient:"from-teal-500 to-sky-600",prose:"prose-teal",text:"text-teal-700"},cyan:{gradient:"from-cyan-500 to-sky-600",prose:"prose-cyan",text:"text-cyan-700"},rose:{gradient:"from-rose-500 to-red-600",prose:"prose-rose",text:"text-rose-700"},amber:{gradient:"from-amber-500 to-orange-600",prose:"prose-amber",text:"text-amber-700"},indigo:{gradient:"from-indigo-500 to-purple-600",prose:"prose-indigo",text:"text-indigo-700"},lime:{gradient:"from-lime-500 to-green-600",prose:"prose-lime",text:"text-lime-700"},fuchsia:{gradient:"from-fuchsia-500 to-purple-600",prose:"prose-fuchsia",text:"text-fuchsia-700"},sky:{gradient:"from-sky-500 to-blue-600",prose:"prose-sky",text:"text-sky-700"},purple:{gradient:"from-purple-500 to-violet-600",prose:"prose-purple",text:"text-purple-700"},green:{gradient:"from-green-500 to-emerald-600",prose:"prose-green",text:"text-green-700"},slate:{gradient:"from-slate-600 to-slate-800",prose:"prose-slate",text:"text-slate-700"},orange:{gradient:"from-orange-500 to-red-600",prose:"prose-orange",text:"text-orange-700"},yellow:{gradient:"from-yellow-500 to-amber-600",prose:"prose-yellow",text:"text-yellow-700"},pink:{gradient:"from-pink-500 to-rose-600",prose:"prose-pink",text:"text-pink-700"},violet:{gradient:"from-violet-500 to-purple-600",prose:"prose-violet",text:"text-violet-700"},red:{gradient:"from-red-500 to-rose-600",prose:"prose-red",text:"text-red-700"},emerald:{gradient:"from-emerald-500 to-teal-600",prose:"prose-emerald",text:"text-emerald-700"}},vS=({slug:n,setPage:e})=>
53{const[s,o]=R.useState(null),[a,c]=R.useState(!0);if(R.useEffect(()=>{(async()=>{if(!n)return;c(!0);const{data:y,error:f}=await oe.from("costar_manifesto_articles").select("title, subtitle, content, color").eq("slug",n).single();f?console.error("Error fetching manifesto article:",f):o(y),c(!1)})()},[n]),a)return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsx("div",{className:"max-w-4xl mx-auto text-center",children:l.jsx("p",{className:"text-slate-500",children:"Loading principle..."})})});if(!s)return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[l.jsx("h1",{className:"text-4xl font-bold text-rose-500",children:"Principle Not Found"}),l.jsx("p",{className:"mt-4 text-slate-600",children:"The requested manifesto principle could not be found."})]})});const d=sg[s.color]||sg.slate;return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsx("div",{className:"max-w-7xl mx-auto",children:l.jsxs("div",{className:"grid lg:grid-cols-12 gap-12 items-start",children:[l.jsxs("div",{className:"lg:col-span-4 lg:sticky lg:top-32",children:[l.jsxs("button",{onClick:()=>e({name:"Manifesto"}),className:"inline-flex items-center text-slate-500 hover:text-slate-800 transition-colors mb-8 group",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 transform group-hover:-translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),"Back to Manifesto"]}),l.jsx("h1",{className:`text-4xl md:text-6xl font-black tracking-tight leading-tight text-transparent bg-clip-text bg-gradient-to-r ${d.gradient}`,children:s.title}),l.jsx("p",{className:"mt-6 text-xl md:text-2xl text-slate-500 font-light leading-relaxed",children:s.subtitle}),l.jsx("div",{className:`mt-8 w-20 h-1 bg-gradient-to-r ${d.gradient} rounded-full opacity-50`})]}),l.jsx("div",{className:"lg:col-span-8",children:l.jsx("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-100 shadow-sm",children:l.jsx("div",{className:`prose prose-lg max-w-none text-slate-700 ${d.prose}`,dangerouslySetInnerHTML:{__html:s.content}})})})]})})})},xS=[{page:"UseCoStar",title:"Use ECO-STAR",description:"Walk through the complete ECO-STAR framework step-by-step and generate a powerful innovation pitch for your idea.",status:"Ready",color:"amber"},{page:"PersonaCreator",title:"The Customer Persona Creator",description:"Transform a brief description of your audience into a detailed, empathetic user persona to better understand their needs and motivations.",status:"Ready",color:"cyan"},{page:"FiveWhys",title:'The "Five Whys" Analysis',description:"Use this classic technique to drill down past surface-level issues and uncover the true, root cause of a customer or community need.",status:"Ready",color:"rose"},{page:"TeamMapper",title:"The Team Attribute Mapper",description:"Visually map the essential skills, community connections, and attributes needed for your project, moving beyond simple job titles.",status:"Ready",color:"indigo"},{page:"AdvantageAnalyzer",title:"The Advantage Analyzer",description:"Analyze your idea against competitors to clearly define your unique, defensible advantage and identify key market differentiators.",status:"Ready",color:"lime"},{page:"RoadmapPlanner",title:"The Results & Roadmap Planner",description:"Translate your vision into a tangible plan with key performance indicators (KPIs) and a sample 3-step roadmap to guide your project.",status:"Ready",color:"fuchsia"},{page:"ReframingChallenge",title:"The Reframing Challenge",description:'Learn to find simpler, more elegant solutions by reframing the core problem, inspired by the "NASA pen vs. Russian pencil" story.',status:"Ready",color:"lime"},{page:"InterestCompatibility",title:"Interest Compatibility Assessment",description:"Assess the alignment between your personal interests and the core principles of ECO-STAR to find your most authentic and impactful innovation path.",status:"Ready",color:"sky"},{page:"LessonPlanGenerator",title:"Lesson Plan Generator",description:"Create custom, Common Core-aligned lesson plans for your classroom, integrating ECO-STAR principles into any subject.",status:"Ready",color:"purple"},{page:"WorkshopPlanner",title:"Workshop Planner",description:"Design a detailed agenda and facilitation guide for any workshop, from a one-hour ideation session to a full-day strategic planning event.",status:"Ready",color:"orange"},{page:"SocialMediaPostGenerator",title:"Social Media Post Generator",description:"Generate authentic, engaging social media posts based on your topics, style, and language preferences, complete with a CSV download option.",status:"Ready",color:"pink"},{page:"MethodologyGenerator",title:"Methodology Generator",description:"Fuse the ECO-STAR framework with established research methodologies to create a custom approach for your project.",status:"Ready",color:"violet"}],bS=({setActivePage:n})=>{const e={amber:{accent:"border-l-amber-400",text:"text-amber-700",buttonBg:"bg-amber-600",buttonHoverBg:"hover:bg-amber-700"},cyan:{accent:"border-l-cyan-400",text:"text-cyan-700",buttonBg:"bg-cyan-600",buttonHoverBg:"hover:bg-cyan-700"},lime:{accent:"border-l-lime-400",text:"text-lime-700",buttonBg:"bg-lime-600",buttonHoverBg:"hover:bg-lime-700"},indigo:{accent:"border-l-indigo-400",text:"text-indigo-700",buttonBg:"bg-indigo-600",buttonHoverBg:"hover:bg-indigo-700"},rose:{accent:"border-l-rose-400",text:"text-rose-700",buttonBg:"bg-rose-600",buttonHoverBg:"hover:bg-rose-700"},fuchsia:{accent:"border-l-fuchsia-400",text:"text-fuchsia-700",buttonBg:"bg-fuchsia-600",buttonHoverBg:"hover:bg-fuchsia-700"},sky:{accent:"border-l-sky-400",text:"text-sky-700",buttonBg:"bg-sky-600",buttonHoverBg:"hover:bg-sky-700"},purple:{accent:"border-l-purple-400",text:"text-purple-700",buttonBg:"bg-purple-600",buttonHoverBg:"hover:bg-purple-700"},orange:{accent:"border-l-orange-400",text:"text-orange-700",buttonBg:"bg-orange-600",buttonHoverBg:"hover:bg-orange-700"},pink:{accent:"border-l-pink-400",text:"text-pink-700",buttonBg:"bg-pink-600",buttonHoverBg:"hover:bg-pink-700"},violet:{accent:"border-l-violet-400",text:"text-violet-700",buttonBg:"bg-violet-600",buttonHoverBg:"hover:bg-violet-700"}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-violet-600",children:"Innovation Toolkit"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed text-center max-w-3xl mx-auto",children:"A collection of interactive exercises designed to help you apply the ECO-STAR methodology and strengthen your innovative ideas."}),l.jsx("div",{className:"mt-16 grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:xS.map(s=>{const o=e[s.color];return l.jsxs("div",{className:"flex flex-col bg-white rounded-xl shadow-sm hover:shadow-xl transition-all duration-300 border border-slate-200 overflow-hidden group",children:[l.jsx("div",{className:`h-2 w-full ${o.buttonBg}`}),l.jsxs("div",{className:"p-8 flex flex-col flex-grow",children:[l.jsx("h2",{className:`text-xl font-bold text-slate-800 group-hover:${o.text} transition-colors`,children:s.title}),l.jsx("p",{className:"mt-3 text-slate-600 leading-relaxed flex-grow text-sm",children:s.description}),l.jsx("div",{className:"mt-6 pt-6 border-t border-slate-100",children:s.status==="Ready"?l.jsx("button",{onClick:()=>n({name:s.page}),className:`w-full py-2.5 rounded-lg font-semibold text-white transition-colors ${o.buttonBg} ${o.buttonHoverBg}`,children:"Start Exercise"}):l.jsx("span",{className:"inline-block px-3 py-1 rounded-full bg-slate-100 text-slate-500 text-xs font-semibold",children:s.status})})]})]},s.page)})})]})})},ig=l.jsxs("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-200 shadow-sm",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Overview"}),l.jsxs("div",{className:"prose prose-lg max-w-none text-slate-600 leading-relaxed",children:[l.jsx("p",{children:"ECO-STAR North is a community-led research initiative and regional innovation ecosystem designed to support creative, climate-focused, and arts entrepreneurs in Northern Canada and other culturally aligned regions. The project addresses the urgent need for place-based, culturally grounded innovation methodologies that integrate Indigenous knowledge systems with contemporary practices, strengthening locally rooted, resilient creative economies while connecting them to broader regional and cross-sector networks."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Digital Innovation for Northern Arts and Culture"}
vendor: 9,672 bytes, line 53
53),l.jsx("p",{children:"This program is pioneering spaces that explore digital transformation as a tool for northern arts, artists, and collectives working with minimal resources. Leveraging accessible digital platforms, creative software, and emerging technologies, projects provide artists with opportunities to expand their practice beyond the constraints of geography and infrastructure. In doing so, they foster experimentation with digital storytelling, virtual collaboration, and new forms of creative expression, helping northern practitioners connect with wider audiences and markets while preserving the distinct cultural and environmental perspectives of their communities."}),l.jsx("p",{children:"Beyond technology, these initiatives also focus on sectoral development, offering mentorship, peer networks, and strategic guidance that help artists and collectives professionalize their practice, diversify income streams, and build sustainable creative careers. By integrating hands-on digital skill-building with capacity development, the projects empower northern arts ecosystems to thrive even under resource-limited conditions, positioning local artists not just as cultural contributors but as innovators who can shape the future of creative practice in the North."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Research Focus"}),l.jsx("p",{children:"ECO-STAR North is guided by three interrelated priorities:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Integration:"})," How can Western innovation models be thoughtfully combined with Indigenous epistemologies, such as Inuit Qaujimajatuqangit (IQ), to create hybrid frameworks that amplify local knowledge and practice?"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Sovereignty:"})," What unique challenges and opportunities shape the development of sovereign creative economies in the North, and how can communities retain control over cultural, economic, and technological assets?"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Technology and Knowledge:"})," How can AI, digital platforms, and emerging technologies serve as âthird knowledge systemsâ, augmenting rather than replacing Indigenous and community-based ways of knowing?"]})]}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Methodology"}),l.jsx("p",{children:"The project employs a Participatory Action Research (PAR) approach, centering collaboration among artists, entrepreneurs, Elders, youth, and regional stakeholders. Participants co-design, test, and refine tools and practices that reflect both Indigenous and Western innovation logics, creating solutions that are context-sensitive, culturally meaningful, and community-owned. By linking local initiatives to broader regional innovation networks, ECO-STAR North strengthens collaborative capacity, knowledge sharing, and cross-sector innovation across Northern Ontario and similar regions."}),l.jsx("div",{className:"my-10 border-t border-slate-100"}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mb-6",children:"Strategic Alignment"}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 mb-8",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-xl font-bold text-indigo-700 mb-2 flex items-center gap-2",children:l.jsx("a",{href:"https://fednor.canada.ca/en/our-programs/regional-economic-growth-through-innovation-regi/regional-innovation-ecosystems",target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:"Regional Innovation Ecosystems (RIE)"})}),l.jsx("p",{className:"text-base text-slate-600",children:"Operating as a digital extension of a business incubator, the platform decolonizes innovation methodologies to enhance capacity for underrepresented groups. It fosters strategic cluster development by enabling small organizations to synthesize rigorous research frameworks, encouraging regional partnerships and inclusive growth."})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-xl font-bold text-indigo-700 mb-2 flex items-center gap-2",children:l.jsx("a",{href:"https://fednor.canada.ca/en/our-programs/regional-artificial-intelligence-initiative-raii-northern-ontario",target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:"Regional AI Initiative (RAII)"})}),l.jsx("p",{className:"text-base text-slate-600",children:'Accelerating AI adoption (Pillar 2) and serving as a demonstration of Northern-developed AI technology (Pillar 1). The platform acts as an accessible "AI Wrapper" for the creative sector, abstracting complex workflows into intuitive interfaces that bridge the skills gap and enable safe experimentation.'})]})]}),l.jsxs("div",{className:"mb-12",children:[l.jsx("h4",{className:"text-xl font-bold text-indigo-700 mb-3 flex items-center gap-2",children:l.jsxs("a",{href:"https://ised-isde.canada.ca/site/ai-strategy/en",target:"_blank",rel:"noopener noreferrer",className:"hover:underline flex items-center gap-2",children:["Pan-Canadian AI Strategy",l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-indigo-400",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),l.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})}),l.jsx("p",{className:"text-base text-slate-600 mb-4",children:"ECO-STAR North exemplifies the Pan-Canadian AI Strategy by translating advanced AI research into accessible, culturally grounded tools for Northern and Indigenous entrepreneurs. Acting as a âlast mileâ adoption platform, it brings generative AI capabilities into the creative, arts, and climate entrepreneurship sectorsâareas often overlooked in mainstream AI commercialization. By automating complex intellectual tasks such as business modeling, grant writing, and impact measurement, the platform accelerates the path from idea to viable venture, enabling small teams to support large networks of creators. Its design prioritizes human-centered co-creation, embedding participatory action research and Indigenous knowledge systems (Inuit Qaujimajatuqangit) into every workflow, ensuring AI augments rather than replaces local ways of knowing."}),l.jsx("p",{className:"text-base text-slate-600",children:"The platform also pioneers responsible and sovereign AI in Indigenous contexts, with a roadmap toward local hosting and small language models that comply with OCAP® principles. Beyond commercialization, ECO-STAR North builds regional capacity by upskilling artists and community leaders, democratizing access to advanced AI models in remote communities and bridging the digital divide. By framing the project as both a Regional AI Adoption Hub and a âforce multiplierâ for Northern economic development, it aligns directly with the strategyâs pillars of adoption, talent development, and ethical deployment, ensuring that Canadaâs AI investments generate inclusive, measurable, and sustainable impact."})]}),l.jsxs("div",{className:"mb-12",children:[l.jsx("h4",{className:"text-xl font-bold text-indigo-700 mb-3 flex items-center gap-2",children:l.jsxs("a",{href:"https://www.iaac-aeic.gc.ca/050/evaluations/document/164317?culture=en-CA",target:"_blank",rel:"noopener noreferrer",className:"hover:underline flex items-center gap-2",children:["Nuclear Impact Assessment Consultations",l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-indigo-400",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),l.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[l.jsx("div",{className:"flex-1",children:l.jsx("p",{className:"text-base text-slate-600 leading-relaxed",children:"ECO-STAR North is designed to support upcoming integrated impact assessment processes and engagements led by the Impact Assessment Agency of Canada (IAAC) in collaboration with the Canadian Nuclear Safety Commission (CNSC). The tool helps systematically gather, analyze, and integrate local and Indigenous knowledge alongside technical and regulatory information. By doing so, ECO-STAR North ensures that environmental, social, and cultural perspectives from communities are meaningfully incorporated into the assessment of the proposed Deep Geological Repository (DGR), a facility to safely store Canadaâs used nuclear fuel."})}),l.jsx("div",{className:"w-full md:w-1/3",children:l.jsx("img",{src:"https://artsincubator.ca/wp-content/uploads/2024/12/DGR2020_3D_Measurements-1.jpeg",alt:"Deep Geological Repository Illustration",className:"w-full h-auto rounded-xl shadow-md border border-slate-100 transition-transform duration-500 hover:scale-105"})})]})]}),l.jsxs("div",{className:"bg-slate-50 border-l-4 border-indigo-500 p-6 my-12 rounded-r-lg",children:[l.jsx("h4",{className:"text-xl font-bold text-indigo-900 mb-2",children:"Current Status: TRL 7"}),l.jsx("p",{className:"text-indigo-800 font-medium",children:"System Prototype Demonstration in an Operational Environment"}),l.jsx("p",{className:"mt-2 text-slate-600 text-base",children:"The ECO-STAR North prototype is fully functional and publicly accessible. It integrates user interfaces, authentication, database systems, and generative AI engines under real-world conditions. Users can complete end-to-e
53nd workflowsâlogging in, generating business plans, saving outputs, and interacting with AI toolsâdemonstrating that the technology is ready for deployment, scaling, and adoption."})]}),l.jsx("h3",{className:"text-3xl font-bold text-slate-900 mb-8 pt-8 border-t border-slate-200",children:"Resilient Innovation Supply Chains"}),l.jsx("p",{className:"mb-12 text-slate-600 text-lg",children:"ECO-STAR North is not just an innovation methodology; it is a digital infrastructure for designing resilient value chains for the creative and climate sectors. By adapting supply chain management principles to the flow of knowledge, culture, and relationships, the platform supports entrepreneurs through three critical phases."}),l.jsxs("div",{className:"space-y-16",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[l.jsxs("div",{className:"order-2 md:order-1",children:[l.jsx("h4",{className:"text-2xl font-bold text-teal-700 mb-3",children:"Upstream: Ethical Sourcing of Knowledge and Capital"}),l.jsx("p",{className:"text-base text-slate-600",children:"At the foundation of ECO-STAR North is the recognition that innovation in the creative and social sectors relies on knowledge, relationships, and cultural capital as its raw materials. The platform facilitates the ethical and strategic sourcing of these inputs through tools that map team attributes, assess community connections, and integrate both Indigenous epistemologies and Western methodologies. By aligning personal motivation with project goals, ECO-STAR North ensures that the human and intellectual resources powering an innovation supply chain are resilient, sustainable, and locally rooted. This upstream focus prevents fragile projects that rely solely on technical expertise, embedding trust, cultural relevance, and social cohesion at the start."})]}),l.jsx("div",{className:"order-1 md:order-2 rounded-2xl overflow-hidden shadow-md",children:l.jsx("img",{src:"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/07/multi-inter-arts-borups-corners-september-2025-cindy-vegetables.jpg",alt:"Fresh vegetables representing ethical sourcing and raw materials",className:"w-full h-full object-cover transition-transform duration-700 hover:scale-105"})})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[l.jsx("div",{className:"rounded-2xl overflow-hidden shadow-md order-1",children:l.jsx("img",{src:"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/09/northwestern-ontario-arts-exhibition-fall-2025-1.jpg",alt:"Art exhibition representing transformation and production",className:"w-full h-full object-cover transition-transform duration-700 hover:scale-105"})}),l.jsxs("div",{className:"order-2",children:[l.jsx("h4",{className:"text-2xl font-bold text-amber-700 mb-3",children:"Midstream: Transformation and Production"}),l.jsx("p",{className:"text-base text-slate-600",children:"ECO-STAR North provides structured processes for transforming ideas into viable ventures, effectively serving as a production line for innovation. Tools guide users to systematically assemble all elements of a projectâenvironment, customer, opportunity, solution, team, advantage, and resultsâwhile optimizing processes to reduce wasted effort and resources. Techniques such reframing challenges and root cause analysis allow entrepreneurs to continuously refine their approach, ensuring that projects are not only feasible but efficient and adaptable to local conditions. This midstream phase transforms abstract concepts into actionable strategies that are ready to deliver measurable value."})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[l.jsxs("div",{className:"order-2 md:order-1",children:[l.jsx("h4",{className:"text-2xl font-bold text-indigo-700 mb-3",children:"Downstream and Circularity: Distribution, Impact, and Sovereignty"}),l.jsx("p",{className:"text-base text-slate-600",children:"The platform emphasizes delivering value to the community while maintaining a circular, environmentally conscious approach. Tools for audience profiling, narrative generation, and roadmap planning support effective distribution and impact measurement, ensuring that innovation is driven by real community needs rather than assumptions. By integrating environment and local context at every step, ECO-STAR North enables the design of sovereign, community-centered supply chains where knowledge, culture, and economic benefits circulate locally. This downstream and circular focus ensures that creative and climate-focused ventures not only succeed but reinfor
53ce community resilience, sustainability, and self-determination."})]}),l.jsx("div",{className:"order-1 md:order-2 rounded-2xl overflow-hidden shadow-md",children:l.jsx("img",{src:"https://artsincubator.ca/borupscorners/wp-content/uploads/2025/07/melgund-township-recreation-arts-music.jpg",alt:"Community music event representing distribution and impact",className:"w-full h-full object-cover transition-transform duration-700 hover:scale-105"})})]})]}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-16 mb-4",children:"Expected Outcomes"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsx("li",{children:"A validated decolonized innovation toolkit for creative entrepreneurship within regional ecosystems."}),l.jsx("li",{children:"Case studies and applied examples demonstrating hybrid innovation frameworks in Northern contexts."}),l.jsx("li",{children:"A set of guiding principles for embedding Indigenous worldviews within regional innovation and creative ecosystems."})]}),l.jsx("p",{className:"mt-8 italic text-slate-500 border-l-4 border-slate-200 pl-6 py-2",children:"By centering relationality, reciprocity, and respect for both land and knowledge sovereignty, ECO-STAR North models a new paradigm of innovationâone that connects local creativity, regional collaboration, and sustainable entrepreneurship, ensuring that Northern communities can lead in arts-driven innovation while contributing to resilient and inclusive regional innovation ecosystems."})]})]}),wS=l.jsxs("div",{className:"bg-white p-8 md:p-12 rounded-3xl border border-slate-200 shadow-sm",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-6",children:"Introduction: Grounding Innovation in Northern Realities"}),l.jsxs("div",{className:"prose prose-lg max-w-none text-slate-600 leading-relaxed",children:[l.jsx("p",{children:"ECO-STAR North is a community-led innovation ecosystem designed to support creative, climate, and arts entrepreneurship across Northern Canada. Our work responds to the limitations of dominant entrepreneurial models, which often prioritize speed, disruption, and individual gain over sustainability, relationality, and collective well-being."}),l.jsx("p",{children:"This toolkit is intended to help communities, organizations, and regional networks adapt innovation frameworks to local realities, integrating Indigenous knowledge systems, cultural values, and Northern contexts into the design and implementation of creative economies."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"The Story of Our Inquiry"}),l.jsx("p",{children:"Our process began with a simple question: What would innovation look like if it started from respect for the land, ancestral knowledge, and community wealth-building?"}),l.jsx("p",{children:"The CO-STAR framework offered a flexible approach to value creation but reflected Western assumptions. ECO-STAR North restories CO-STAR, blending it with Northern and Indigenous worldviews to create methods that are culturally grounded, contextually relevant, and co-created with communities."}),l.jsx("p",{children:"This process is not only about transforming toolsâit is about transforming relationships, worldviews, and the ways communities engage with innovation, ensuring that knowledge, creativity, and economic activity support collective well-being."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Building a Community of Practice"}),l.jsx("p",{children:"At the heart of ECO-STAR North is a Community of Practice (CoP)âa network of Indigenous and non-Indigenous artists, entrepreneurs, youth, Elders, and regional partners. This community:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsx("li",{children:"Co-designs and tests tools, programs, and methodologies."}),l.jsx("li",{children:"Shares lived experiences, cultural teachings, and creative insights."}),l.jsx("li",{children:"Shapes practices for community-led innovation, entrepreneurship, and ecosystem development."})]}),l.jsx("p",{className:"mt-4",children:"Workshops, restorative circles, and collaborative projects serve as both knowledge-generating space
53s and testing grounds, ensuring that the methods are practical, actionable, and community-owned."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"AI and Technology as a Third Knowledge System"}),l.jsx("p",{children:"ECO-STAR North explores Generative AI and digital platforms as complementary toolsâa âthird knowledge systemâ that:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsx("li",{children:"Augments Indigenous and local knowledge without replacing it."}),l.jsx("li",{children:"Supports creative entrepreneurship, project visualization, and cultural storytelling."}),l.jsx("li",{children:"Enhances capacity-building for communities and emerging creators."})]}),l.jsx("p",{className:"mt-4",children:"All technology use is guided by ethical protocols, data sovereignty, and community priorities, ensuring innovation serves community interests and strengthens knowledge systems rather than undermining them."}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"The ECO-STAR Methodology: Pillars for Community-Led Innovation"}),l.jsx("p",{children:"Our approach adapts the seven pillars of the CO-STAR framework for Northern, Indigenous, and rural contexts. Each pillar guides practical actions for communities, entrepreneurs, and regional networks:"}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:[l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-teal-700 text-lg mb-1",children:"E â Environment"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Integrate ecological sustainability, climate resilience, and creative practices. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: developing eco-conscious arts projects or sustainable material sourcing."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-cyan-700 text-lg mb-1",children:"C â Customer"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Understand local and global audiences, market needs, and community-defined value. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: designing arts and climate ventures that respond to regional demand."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-rose-700 text-lg mb-1",children:"O â Opportunity"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Identify and leverage local assets, cultural distinctiveness, and untapped creative economy sectors. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: assessing circular economy models for Northern enterprises."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-amber-700 text-lg mb-1",children:"S â Solution"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Co-create and test products, services, or models that address Northern challenges and aspirations. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: digital platforms connecting remote artists to global markets."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-indigo-700 text-lg mb-1",children:"T â Team"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Foster collaborative leadership, intergenerational mentorship, and capacity-building for entrepreneurial teams. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: supporting collective ownership and knowledge transfer in creative enterprises."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center",children:[l.jsx("p",{className:"font-bold text-lime-700 text-lg mb-1",children:"A â Advantage"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Articulate and leverage the unique competitive benef
53its of Northern and Indigenous ventures. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: promoting authenticity, cultural depth, and regional narratives for market positioning."})]})]}),l.jsxs("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100 flex flex-col justify-center md:col-span-2",children:[l.jsx("p",{className:"font-bold text-fuchsia-700 text-lg mb-1",children:"R â Results"}),l.jsxs("p",{className:"text-sm leading-relaxed",children:["Measure social, cultural, economic, and environmental impacts through decolonized and context-sensitive metrics. ",l.jsx("span",{className:"italic text-slate-500 block mt-1",children:"Example: evaluating contributions to community well-being, cultural revitalization, and food security."})]})]})]}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Methodology & Approach"}),l.jsx("p",{children:"ECO-STAR North combines Participatory Action Research (PAR), Indigenous research principles, and co-creation to ensure outcomes are meaningful and community-owned. Key principles include:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Ethical Engagement:"})," Respect, reciprocity, relevance, responsibility."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Two-Eyed Seeing:"})," Integrating Indigenous and Western knowledge systems."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Co-Creation:"})," Communities are equal partners at every stage."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Knowledge Mobilization:"})," Translating research into practical tools, resources, and strategies."]})]}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Expected Outcomes"}),l.jsx("p",{children:"Through this toolkit and research program, ECO-STAR North aims to:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 mt-4",children:[l.jsx("li",{children:"Strengthen resilience, cultural vitality, and economic viability of Northern arts and creative ventures."}),l.jsx("li",{children:"Support inclusive, decolonized entrepreneurial frameworks for Indigenous and Northern communities."}),l.jsx("li",{children:"Amplify the voices, innovations, and contributions of Northern and Indigenous creators."}),l.jsx("li",{children:"Inform policy, programming, and investment strategies for regional innovation ecosystems."})]}),l.jsx("h3",{className:"text-2xl font-bold text-slate-900 mt-10 mb-4",children:"Call to Collaboration"}),l.jsx("p",{children:"ECO-STAR North invites researchers, knowledge holders, entrepreneurs, and community leaders to join our innovation ecosystem. Through partnership, co-creation, and shared inquiry, we can build robust, inclusive, and culturally grounded systems of innovation that empower the next generation of Northern creators and entrepreneurs."})]})]}),SS=n=>{if(!n.url)return l.jsx("span",{className:"text-2xl font-bold text-slate-800 block mb-1",children:n.name});const s=n.url.includes("@")&&!n.url.startsWith("http")?`mailto:${n.url}`:n.url;return l.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-2xl font-bold text-slate-800 hover:text-indigo-600 transition-colors duration-200 block mb-1",children:n.name})},_S=()=>{const[n,e]=R.useState([]),[s,o]=R.useState(!0);return R.useEffect(()=>{(async()=>{o(!0);const{data:c,error:d}=await oe.from("costar_team").select("*").order("sort_order",{ascending:!0});d?console.error("Error fetching team members:",d):e(c),o(!1)})()},[]),l.jsxs("div",{children:[l.jsx("div",{className:"max-w-4xl mx-auto text-center mb-16",children:l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed",children:"ECO-STAR North is guided by a dedicated team of researchers, community organizers, and innovators. Our collective experience spans community-led development, Indigenous research methodologies, arts administration, and technology."})}),s?l.jsx("div",{className:"text-center text-slate-500",children:"Loading team members..."}):n.length>0?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(a=>l.jsxs("div",{className:"bg-white border border-slate-200 rounded-2xl p-8 shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-300 flex flex-col h-full",children:[a.image_url&&l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx("img",{src:a.image_url,alt:a.name,className:"w-32 h-32 rounded-full object-cover border-4 border-slate-50"})}),l.jsxs("div",{className:"mb-4 text-center md:text-left",children:[SS(a),l.jsx("p",{className:"text-indigo-600 font-bold text-sm tracking-wide uppercase",children:a.affiliation}),a.role&&l.jsx("p",{className:"text-slate-500 italic mt-1 text-sm",children:a.role})]}),l.jsx("p",{className:"text-slate-600 leading-relaxed text-sm flex-grow whitespace-pre-wrap",children:a.bio})]},a.id))}):l.jsx("p",{className:"text-center text-slate-500",children:"Team members have not been added yet."})]})},TS=()=>{const[n,e]=R.useState("abstract"),[s,o]=R.useState([]),[a,c]=R.use
53State(!0);R.useEffect(()=>{(async()=>{c(!0);const{data:v,error:b}=await oe.from("costar_research").select("*").order("year",{ascending:!1});b?console.error("Error fetching related research:",b):o(v),c(!1)})()},[]);const d={inactive:"border-transparent text-slate-500 hover:text-slate-900 hover:border-slate-300",active:"border-b-2 border-teal-500 text-teal-700 font-semibold"},m=()=>a?l.jsx("p",{className:"text-center text-slate-500",children:"Loading related research..."}):l.jsxs("div",{children:[l.jsx("div",{className:"max-w-4xl mx-auto text-center mb-16",children:l.jsx("p",{className:"text-lg text-slate-600 leading-relaxed",children:"Our work is part of a larger conversation. This collection of research and references highlights the foundational studies and community-led projects that have informed our approach."})}),s.length===0?l.jsx("p",{className:"text-center text-slate-500",children:"No related research items have been added yet."}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map(f=>l.jsxs("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"block bg-white p-8 rounded-2xl border border-slate-200 hover:border-teal-400 hover:shadow-xl hover:-translate-y-1 transition-all duration-300 flex flex-col h-full",children:[l.jsx("span",{className:"inline-block bg-teal-50 text-teal-700 text-xs font-bold px-2 py-1 rounded mb-4 w-fit",children:f.year}),l.jsx("h4",{className:"text-xl font-bold text-slate-900 mb-3 leading-snug",children:f.title}),l.jsx("p",{className:"text-slate-500 text-sm mt-auto font-medium border-t border-slate-100 pt-4",children:f.researcher})]},f.id))})]}),y=()=>{switch(n){case"abstract":return ig;case"narrative":return wS;case"related":return l.jsx(m,{});case"team":return l.jsx(_S,{});default:return ig}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("header",{className:"text-center mb-16",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight !leading-tight text-transparent bg-clip-text bg-gradient-to-r from-purple-500 to-teal-500",children:"ECO-STAR North Research"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed max-w-3xl mx-auto",children:"Exploring a decolonized approach to innovation and sovereign creative economies."})]}),l.jsx("div",{className:"border-b border-slate-200 mb-12 overflow-x-auto",children:l.jsxs("nav",{className:"-mb-px flex space-x-8 justify-center min-w-max px-4","aria-label":"Tabs",children:[l.jsx("button",{onClick:()=>e("abstract"),className:`whitespace-nowrap py-4 px-4 border-b-2 font-medium text-lg transition-colors duration-200 ${n==="abstract"?d.active:d.inactive}`,children:"Strategic Alignment"}),l.jsx("button",{onClick:()=>e("narrative"),className:`whitespace-nowrap py-4 px-4 border-b-2 font-medium text-lg transition-colors duration-200 ${n==="narrative"?d.active:d.inactive}`,children:"Narrative Report"}),l.jsx("button",{onClick:()=>e("related"),className:`whitespace-nowrap py-4 px-4 border-b-2 font-medium text-lg transition-colors duration-200 ${n==="related"?d.active:d.inactive}`,children:"Related Research"}),l.jsx("button",{onClick:()=>e("team"),className:`whitespace-nowrap py-4 px-4 border-b-2 font-medium text-lg transition-colors duration-200 ${n==="team"?d.active:d.inactive}`,children:"Our Team"})]})}),l.jsx("article",{children:y()})]})})};var CS={};/** 54 * @license 55 * Copyright 2025 Google LLC 56 * SPDX-License-Identifier: Apache-2.0 57 */let ES,NS;function AS(){return{geminiUrl:ES,vertexUrl:NS}}
57function RS(n,e,s,o){var a,c;if(!(n!=null&&n.baseUrl)){const d=AS();return e?(a=d.vertexUrl)!==null&&a!==void 0?a:s:(c=d.geminiUrl)!==null&&c!==void 0?c:o}return n.baseUrl}/** 58 * @license 59 * Copyright 2025 Google LLC 60 * SPDX-License-Identifier: Apache-2.0 61 */class Kn{}function ie(n,e){const s=/\{([^}]+)\}/g;return n.replace(s,(o,a)=>{if(Object.prototype.hasOwnProperty.call(e,a)){const c=e[a];return c!=null?String(c):""}else throw new Error(`Key '${a}' not found in valueMap.`)})}function p(n,e,s){for(let c=0;c<e.length-1;c++){const d=e[c];if(d.endsWith("[]")){const m=d.slice(0,-2);if(!(m in n))if(Array.isArray(s))n[m]=Array.from({length:s.length},()=>({}));else throw new Error(`Value must be a list given an array path ${d}`);if(Array.isArray(n[m])){const y=n[m];if(Array.isArray(s))for(let f=0;f<y.length;f++){const v=y[f];p(v,e.slice(c+1),s[f])}else for(const f of y)p(f,e.slice(c+1),s)}return}else if(d.endsWith("[0]")){const m=d.slice(0,-3);m in n||(n[m]=[{}]);const y=n[m];p(y[0],e.slice(c+1),s);return}(!n[d]||typeof n[d]!="object")&&(n[d]={}),n=n[d]}const o=e[e.length-1],a=n[o];if(a!==void 0){if(!s||typeof s=="object"&&Object.keys(s).length===0||s===a)return;if(typeof a=="object"&&typeof s=="object"&&a!==null&&s!==null)Object.assign(a,s);else throw new Error(`Cannot set value for an existing key. Key: ${o}`)}else o==="_self"&&typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(n,s):n[o]=s}function h(n,e,s=void 0){try{if(e.length===1&&e[0]==="_self")return n;for(let o=0;o<e.length;o++){if(typeof n!="object"||n===null)return s;const a=e[o];if(a.endsWith("[]")){const c=a.slice(0,-2);if(c in n){const d=n[c];return Array.isArray(d)?d.map(m=>h(m,e.slice(o+1),s)):s}else return s}else n=n[a]}return n}catch(o){if(o instanceof TypeError)return s;throw o}}function kS(n,e){for(const[s,o]of Object.entries(e)){const a=s.split("."),c=o.split("."),d=new Set;let m=-1;for(let y=0;y<a.length;y++)if(a[y]==="*"){m=y;break}if(m!==-1&&c.length>m)for(let y=m;y<c.length;y++){const f=c[y];f!=="*"&&!f.endsWith("[]")&&!f.endsWith("[0]")&&d.add(f)}Fu(n,a,c,0,d)}}function Fu(n,e,s,o,a){if(o>=e.length||typeof n!="object"||n===null)return;const c=e[o];if(c.endsWith("[]")){const d=c.slice(0,-2),m=n;if(d in m&&Array.isArray(m[d]))for(const y of m[d])Fu(y,e,s,o+1,a)}else if(c==="*"){if(typeof n=="object"&&n!==null&&!Array.isArray(n)){const d=n,m=Object.keys(d).filter(f=>!f.startsWith("_")&&!a.has(f)),y={};for(const f of m)y[f]=d[f];for(const[f,v]of Object.entries(y)){const b=[];for(const w of s.slice(o))w==="*"?b.push(f):b.push(w);p(d,b,v)}for(const f of m)delete d[f]}}else{const d=n;c in d&&Fu(d[c],e,s,o+1,a)}}/** 62 * @license 63 * Copyright 2025 Google LLC 64 * SPDX-License-Identifier: Apache-2.0 65 */function hd(n){if(typeof n!="string")throw new Error("fromImageBytes must be a string");return n}/** 66 * @license 67 * Copyright 2025 Google LLC 68 * SPDX-License-Identifier: Apache-2.0 69 */function jS(n){const e={},s=h(n,["operationName"]);s!=null&&p(e,["operationName"],s);const o=h(n,["resourceName"]);return o!=null&&p(e,["_url","resourceName"],o),e}function IS(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response","generateVideoResponse"]);return d!=null&&p(e,["response"],DS(d)),e}function MS(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response"]);return d!=null&&p(e,["response"],US(d)),e}function DS(n){const e={},s=h(n,["generatedSamples"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>LS(d))),p(e,["generatedVideos"],c)}const o=h(n,["raiMediaFilteredCount"]);o!=null&&p(e,["raiMediaFilteredCount"],o);const a=h(n,["raiMediaFilteredReasons"]);return a!=null&&p(e,["raiMediaFilteredReasons"],a),e}function US(n){const e={},s=h(n,["videos"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>PS(d))),p(e,["generatedVideos"],c)}const o=h(n,["raiMediaFilteredCount"]);o!=null&&p(e,["raiMediaFilteredCount"],o);const a=h(n,["raiMediaFilteredReasons"]);return a!=null&&p(e,["raiMediaFilteredReasons"],a),e}function LS(n){const e={},s=h(n,["video"]);return s!=null&&p(e,["video"],zS(s)),e}function PS(n){const e={},s=h(n,["_self"]);return s!=null&&p(e,["video"],VS(s)),e}function OS(n){const e={},s=h(n,["operationName"]);return s!=null&&p(e,["_url","operationName"],s),e}function GS(n){const e={},s=h(n,["operationName"]);return s!=null&&p(e,["_url","operationName"],s),e}function qS(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response"]);return d!=null&&p(e,["response"],BS(d)),e}function BS(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["parent"]);o!=null&&p(e,["parent"],o);const a=h(n,["documentName"]);return a!=null&&p(e,["documentName"],a),e}function ay(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response"]);return d!=null&&p(e,["response"],HS(d)),e}function HS(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["parent"]);o!=null&&p(e,["parent"],o);const a=h(n,["documentName"]);return a!=null&&p(e,["documentName"],a),e}function zS(n){const e={},s=h(n,["uri"]);s!=null&&p(e,["uri"],s);const o=h(n,["encodedVideo"]);o!=null&&p(e,["videoBytes"],hd(o));const a=h(n,["encoding"]);return a!=null&&p(e,["mimeType"],a),e}function VS(n){const e={},s=h(n,["gcsUri"]);s!=null&&p(e,["uri"],s);const o=h(n,["bytesBase64Encoded"]);o!=null&&p(e,["videoBytes"],hd(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["mimeType"],a),e}/** 70 * @license 71 * Copyright 2025 Google LLC 72 * SPDX-License-Identifier: Apache-2.0 73 */var og;(function(n){n.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",n.OUTCOME_OK="OUTCOME_OK",n.OUTCOME_FAILED="OUTCOME_FAILED",n.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(og||(og={}));var ag;(function(n){n.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",n.PYTHON="PYTHON"})(ag||(ag={}));var rg;(function(n){n.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",n.SILENT="SILENT",n.WHEN_IDLE="WHEN_IDLE",n.INTERRUPT="INTERRUPT"})(rg||(rg={}));var le;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.STRING="STRING",n.NUMBER="NUMBER",n.INTEGER="INTEGER",n.BOOLEAN="BOOLEAN",n.ARRAY="ARRAY",n.OBJECT="OBJECT",n.NULL="NULL"})(le||(le={}));var lg;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(lg||(lg={}));var cg;(function(n){n.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",n.SIMPLE_SEARCH="SIMPLE_SEARCH",n.ELASTIC_SEARCH="ELASTIC_SEARCH"})(cg||(cg={}));var ug;(function(n){n.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",n.NO_AUTH="NO_AUTH",n.API_KEY_AUTH="API_KEY_AUTH",
73n.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",n.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",n.OAUTH="OAUTH",n.OIDC_AUTH="OIDC_AUTH"})(ug||(ug={}));var dg;(function(n){n.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",n.HTTP_IN_QUERY="HTTP_IN_QUERY",n.HTTP_IN_HEADER="HTTP_IN_HEADER",n.HTTP_IN_PATH="HTTP_IN_PATH",n.HTTP_IN_BODY="HTTP_IN_BODY",n.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(dg||(dg={}));var hg;(function(n){n.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",n.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",n.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",n.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(hg||(hg={}));var fg;(function(n){n.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH",n.MINIMAL="MINIMAL"})(fg||(fg={}));var mg;(function(n){n.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",n.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",n.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",n.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",n.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",n.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",n.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",n.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",n.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(mg||(mg={}));var pg;(function(n){n.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",n.SEVERITY="SEVERITY",n.PROBABILITY="PROBABILITY"})(pg||(pg={}));var gg;(function(n){n.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE",n.OFF="OFF"})(gg||(gg={}));var yg;(function(n){n.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",n.STOP="STOP",n.MAX_TOKENS="MAX_TOKENS",n.SAFETY="SAFETY",n.RECITATION="RECITATION",n.LANGUAGE="LANGUAGE",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.SPII="SPII",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.IMAGE_SAFETY="IMAGE_SAFETY",n.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",n.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",n.NO_IMAGE="NO_IMAGE",n.IMAGE_RECITATION="IMAGE_RECITATION",n.IMAGE_OTHER="IMAGE_OTHER"})(yg||(yg={}));var vg;(function(n){n.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",n.NEGLIGIBLE="NEGLIGIBLE",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH"})(vg||(vg={}));var xg;(function(n){n.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",n.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",n.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",n.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",n.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(xg||(xg={}));var bg;(function(n){n.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",n.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",n.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",n.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",n.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(bg||(bg={}));var wg;(function(n){n.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",n.SAFETY="SAFETY",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.IMAGE_SAFETY="IMAGE_SAFETY",n.MODEL_ARMOR="MODEL_ARMOR",n.JAILBREAK="JAILBREAK"})(wg||(wg={}));var Sg;(function(n){n.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",n.ON_DEMAND="ON_DEMAND",n.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Sg||(Sg={}));var $r;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.AUDIO="AUDIO"})($r||($r={}));var _g;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(_g||(_g={}));var Tg;(function(n){n.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",n.TUNING_MODE_FULL="TUNING_MODE_FULL",n.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(Tg||(Tg={}));var Cg;(function(n){n.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",n.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",n.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",n.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",n.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",n.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",n.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(Cg||(Cg={}));var $u;(function(n){n.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",n.JOB_STATE_QUEUED="JOB_STATE_QUEUED",n.JOB_STATE_PENDING="JOB_STATE_PENDING",n.JOB_STATE_RUNNING="JOB_STATE_RUNNING",n.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",n.JOB_STATE_FAILED="JOB_STATE_FAILED",n.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",n.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",n.JOB_STATE_PAUSED="JOB_STATE_PAUSED",n.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",n.JOB_STATE_UPDATING="JOB_STATE_UPDATING",n.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})($u||($u={}));var Eg;(function(n){n.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",n.TUNING_TASK_I2V="TUNING_TASK_I2V",n.TUNING_TASK_T2V="TUNING_TASK_T2V",n.TUNING_TASK_R2V="TUNING_TASK_R2V"})(Eg||(Eg={}));var Ng;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",n.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(Ng||(Ng={}));var Ag;(function(n){n.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",n.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",n.BALANCED="BALANCED",n.PRIORITIZE_COST="PRIORITIZE_COST"})(Ag||(Ag={}));var Rg;(function(n){n.UNSPECIFIED="UNSPECIFIED",n.BLOCKING="BLOCKING",n.NON_BLOCKING="NON_BLOCKING"})(Rg||(Rg={}));var kg;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(kg||(kg={}));var jg;(function(n){n.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",n.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(jg||(jg={}));var Ig;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.AUTO="AUTO",n.ANY="ANY",n.NONE="NONE",
73n.VALIDATED="VALIDATED"})(Ig||(Ig={}));var Mg;(function(n){n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE"})(Mg||(Mg={}));var Dg;(function(n){n.DONT_ALLOW="DONT_ALLOW",n.ALLOW_ADULT="ALLOW_ADULT",n.ALLOW_ALL="ALLOW_ALL"})(Dg||(Dg={}));var Ug;(function(n){n.auto="auto",n.en="en",n.ja="ja",n.ko="ko",n.hi="hi",n.zh="zh",n.pt="pt",n.es="es"})(Ug||(Ug={}));var Lg;(function(n){n.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",n.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",n.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",n.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",n.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(Lg||(Lg={}));var Pg;(function(n){n.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",n.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",n.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",n.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(Pg||(Pg={}));var Og;(function(n){n.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",n.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",n.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",n.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(Og||(Og={}));var Gg;(function(n){n.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",n.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",n.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",n.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",n.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",n.EDIT_MODE_STYLE="EDIT_MODE_STYLE",n.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",n.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Gg||(Gg={}));var qg;(function(n){n.FOREGROUND="FOREGROUND",n.BACKGROUND="BACKGROUND",n.PROMPT="PROMPT",n.SEMANTIC="SEMANTIC",n.INTERACTIVE="INTERACTIVE"})(qg||(qg={}));var Bg;(function(n){n.ASSET="ASSET",n.STYLE="STYLE"})(Bg||(Bg={}));var Hg;(function(n){n.INSERT="INSERT",n.REMOVE="REMOVE",n.REMOVE_STATIC="REMOVE_STATIC",n.OUTPAINT="OUTPAINT"})(Hg||(Hg={}));var zg;(function(n){n.OPTIMIZED="OPTIMIZED",n.LOSSLESS="LOSSLESS"})(zg||(zg={}));var Vg;(function(n){n.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",n.PREFERENCE_TUNING="PREFERENCE_TUNING"})(Vg||(Vg={}));var Fg;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.STATE_PENDING="STATE_PENDING",n.STATE_ACTIVE="STATE_ACTIVE",n.STATE_FAILED="STATE_FAILED"})(Fg||(Fg={}));var $g;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.PROCESSING="PROCESSING",n.ACTIVE="ACTIVE",n.FAILED="FAILED"})($g||($g={}));var Yg;(function(n){n.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",n.UPLOADED="UPLOADED",n.GENERATED="GENERATED"})(Yg||(Yg={}));var Jg;(function(n){n.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.RESPONSE_REJECTED="RESPONSE_REJECTED",n.NEED_MORE_INPUT="NEED_MORE_INPUT"})(Jg||(Jg={}));var Kg;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.VIDEO="VIDEO",n.AUDIO="AUDIO",n.DOCUMENT="DOCUMENT"})(Kg||(Kg={}));var Qg;(function(n){n.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",n.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",n.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(Qg||(Qg={}));var Wg;(function(n){n.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",n.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",n.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(Wg||(Wg={}));var Xg;(function(n){n.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",n.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",n.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(Xg||(Xg={}));var Zg;(function(n){n.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",n.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",n.NO_INTERRUPTION="NO_INTERRUPTION"})(Zg||(Zg={}));var e0;(function(n){n.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",n.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",n.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(e0||(e0={}));var t0;(function(n){n.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",n.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",n.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",n.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",n.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",n.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",n.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",n.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",n.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",n.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",n.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",n.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",n.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(t0||(t0={}));var n0;(function(n){n.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",n.QUALITY="QUALITY",n.DIVERSITY="DIVERSITY",n.VOCALIZATION="VOCALIZATION"})(n0||(n0={}));var Zi;(function(n){n.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",n.PLAY="PLAY",n.PAUSE="PAUSE",n.STOP="STOP",n.RESET_CONTEXT="RESET_CONTEXT"})(Zi||(Zi={}));class Yu{constructor(e){const s={};for(const o of e.headers.entries())s[o[0]]=o[1];this.headers=s,this.responseInternal=e}json(){return this.responseInternal.json()}}class ra{get text(){var e,s,o,a,c,d,m,y;if(((a=(o=(s=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||s===void 0?void 0:s.content)===null||o===void 0?void 0:o.parts)===null||a===void 0?void 0:a.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let f="",v=!1;const b=[];for(const w of(y=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)!==null&&y!==void 0?y:[]){for(const[_,C]of Object.entries(w))_!=="text"&&_!=="thought"&&_!=="thoughtSignature"&&(C!==null||C!==void 0)&&b.push(_);if(typeof w.text=="string"){if(typeof w.thought=="boolean"&&w.thought)continue;v=!0,f+=w.text}}return b.length>0&&console.warn(`there are non-text parts ${b} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),v?f:void 0}get data(){var e,s,o,a,c,d,m,y;if(((a=(o=(s=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||s===void 0?void 0:s.content)===null||o===void 0?void 0:o.parts)===null||a===void 0?void 0:a.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let f="";const v=[];for(const b of(y=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)!==null&&y!==void 0?y:[]){for(const[w,_]of Object.entries(b))w!=="inlineData"&&(_!==null||_!==void 0)&&v.push(w);
73b.inlineData&&typeof b.inlineData.data=="string"&&(f+=atob(b.inlineData.data))}return v.length>0&&console.warn(`there are non-data parts ${v} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),f.length>0?btoa(f):void 0}get functionCalls(){var e,s,o,a,c,d,m,y;if(((a=(o=(s=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||s===void 0?void 0:s.content)===null||o===void 0?void 0:o.parts)===null||a===void 0?void 0:a.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const f=(y=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||y===void 0?void 0:y.filter(v=>v.functionCall).map(v=>v.functionCall).filter(v=>v!==void 0);if((f==null?void 0:f.length)!==0)return f}get executableCode(){var e,s,o,a,c,d,m,y,f;if(((a=(o=(s=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||s===void 0?void 0:s.content)===null||o===void 0?void 0:o.parts)===null||a===void 0?void 0:a.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const v=(y=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||y===void 0?void 0:y.filter(b=>b.executableCode).map(b=>b.executableCode).filter(b=>b!==void 0);if((v==null?void 0:v.length)!==0)return(f=v==null?void 0:v[0])===null||f===void 0?void 0:f.code}get codeExecutionResult(){var e,s,o,a,c,d,m,y,f;if(((a=(o=(s=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||s===void 0?void 0:s.content)===null||o===void 0?void 0:o.parts)===null||a===void 0?void 0:a.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const v=(y=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||y===void 0?void 0:y.filter(b=>b.codeExecutionResult).map(b=>b.codeExecutionResult).filter(b=>b!==void 0);if((v==null?void 0:v.length)!==0)return(f=v==null?void 0:v[0])===null||f===void 0?void 0:f.output}}class s0{}class i0{}class FS{}class $S{}class YS{}class JS{}class o0{}class a0{}class r0{}class KS{}class Yr{_fromAPIResponse({apiResponse:e,_isVertexAI:s}){const o=new Yr;let a;const c=e;return s?a=MS(c):a=IS(c),Object.assign(o,a),o}}class l0{}class c0{}class u0{}class d0{}class QS{}class WS{}class XS{}class fd{_fromAPIResponse({apiResponse:e,_isVertexAI:s}){const o=new fd,c=qS(e);return Object.assign(o,c),o}}class ZS{}class e_{}class t_{}class h0{}class n_{get text(){var e,s,o;let a="",c=!1;const d=[];for(const m of(o=(s=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||s===void 0?void 0:s.parts)!==null&&o!==void 0?o:[]){for(const[y,f]of Object.entries(m))y!=="text"&&y!=="thought"&&f!==null&&d.push(y);if(typeof m.text=="string"){if(typeof m.thought=="boolean"&&m.thought)continue;c=!0,a+=m.text}}return d.length>0&&console.warn(`there are non-text parts ${d} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),c?a:void 0}get data(){var e,s,o;let a="";const c=[];for(const d of(o=(s=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||s===void 0?void 0:s.parts)!==null&&o!==void 0?o:[]){for(const[m,y]of Object.entries(d))m!=="inlineData"&&y!==null&&c.push(m);d.inlineData&&typeof d.inlineData.data=="string"&&(a+=atob(d.inlineData.data))}return c.length>0&&console.warn(`there are non-data parts ${c} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),a.length>0?btoa(a):void 0}}class s_{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class md{_fromAPIResponse({apiResponse:e,_isVertexAI:s}){const o=new md,c=ay(e);return Object.assign(o,c),o}}/** 74 * @license 75 * Copyright 2025 Google LLC 76 * SPDX-License-Identifier: Apache-2.0 77 */function Pe(n,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(n.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const s=e.split("/",2);return`publishers/${s[0]}/models/${s[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function ry(n,e){const s=Pe(n,e);return s?s.startsWith("publishers/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/${s}`:s.startsWith("models/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/publishers/google/${s}`:s:""}function ly(n){return Array.isArray(n)?n.map(e=>Jr(e)):[Jr(n)]}function Jr(n){if(typeof n=="object"&&n!==null)return n;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof n}`)}function cy(n){const e=Jr(n);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function uy(n){const e=Jr(n);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function f0(n){if(n==null)throw new Error("PartUnion is required");if(typeof n=="object")return n;if(typeof n=="string")return{text:n};throw new Error(`Unsupported part type: ${typeof n}`)}function dy(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("PartListUnion is required");return Array.isArray(n)?n.map(e=>f0(e)):[f0(n)]}function Ju(n){return n!=null&&typeof n=="object"&&"parts"in n&&Array.isArray(n.parts)}function m0(n){return n!=null&&typeof n=="object"&&"functionCall"in n}function p0(n){return n!=null&&typeof n=="object"&&"functionResponse"in n}function wt(n){if(n==null)throw new Error("ContentUnion is required");return Ju(n)?n:{role:"user",parts:dy(n)}}function pd(n,e){if(!e)return[];if(n.isVertexAI()&&Array.isArray(e))return e.flatMap(s=>{const o=wt(s);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]});if(n.isVertexAI()){const s=wt(e);return s.parts&&s.parts.length>0&&s.parts[0].text!==void 0?[s.parts[0].text]:[]}return Array.isArray(e)?e.map(s=>wt(s)):[wt(e)]}function cn(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("contents are required");if(!Array.isArray(n)){if(m0(n)||p0(n))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[wt(n)]}const e=[],s=[],o=Ju(n[0]);for(const a of n){const c=Ju(a);if(c!=o)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(c)e.push(a);else{if(m0(a)||p0(a))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");s.push(a)}}return o||e.push({role:"user",parts:dy(s)}),e}function i_(n,e){n.includes("null")&&(e.nullable=!0);const s=n.filter(o=>o!=="null");if(s.length===1)e.type=Object.values(le).includes(s[0].toUpperCase())?s[0].toUpperCase():le.TYPE_UNSPECIFIED;else{e.anyOf=[];for(const o of s)e.anyOf.push({type:Object.values(le).includes(o.toUpperCase())?o.toUpperCase():le.TYPE_UNSPECIFIED})}}function no(n){const e={},s=["items"],o=["anyOf"],a=["properties"];
77if(n.type&&n.anyOf)throw new Error("type and anyOf cannot be both populated.");const c=n.anyOf;c!=null&&c.length==2&&(c[0].type==="null"?(e.nullable=!0,n=c[1]):c[1].type==="null"&&(e.nullable=!0,n=c[0])),n.type instanceof Array&&i_(n.type,e);for(const[d,m]of Object.entries(n))if(m!=null)if(d=="type"){if(m==="null")throw new Error("type: null can not be the only possible type for the field.");if(m instanceof Array)continue;e.type=Object.values(le).includes(m.toUpperCase())?m.toUpperCase():le.TYPE_UNSPECIFIED}else if(s.includes(d))e[d]=no(m);else if(o.includes(d)){const y=[];for(const f of m){if(f.type=="null"){e.nullable=!0;continue}y.push(no(f))}e[d]=y}else if(a.includes(d)){const y={};for(const[f,v]of Object.entries(m))y[f]=no(v);e[d]=y}else{if(d==="additionalProperties")continue;e[d]=m}return e}function gd(n){return no(n)}function yd(n){if(typeof n=="object")return n;if(typeof n=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:n}}};throw new Error(`Unsupported speechConfig type: ${typeof n}`)}function vd(n){if("multiSpeakerVoiceConfig"in n)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return n}function lo(n){if(n.functionDeclarations)for(const e of n.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=no(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=no(e.response));return n}function co(n){if(n==null)throw new Error("tools is required");if(!Array.isArray(n))throw new Error("tools is required and must be an array of Tools");const e=[];for(const s of n)e.push(s);return e}function o_(n,e,s,o=1){const a=!e.startsWith(`${s}/`)&&e.split("/").length===o;return n.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${n.getProject()}/${e}`:e.startsWith(`${s}/`)?`projects/${n.getProject()}/locations/${n.getLocation()}/${e}`:a?`projects/${n.getProject()}/locations/${n.getLocation()}/${s}/${e}`:e:a?`${s}/${e}`:e}function Qn(n,e){if(typeof e!="string")throw new Error("name must be a string");return o_(n,e,"cachedContents")}function hy(n){switch(n){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return n}}function ks(n){return hd(n)}function a_(n){return n!=null&&typeof n=="object"&&"name"in n}function r_(n){return n!=null&&typeof n=="object"&&"video"in n}function l_(n){return n!=null&&typeof n=="object"&&"uri"in n}function fy(n){var e;let s;if(a_(n)&&(s=n.name),!(l_(n)&&(s=n.uri,s===void 0))&&!(r_(n)&&(s=(e=n.video)===null||e===void 0?void 0:e.uri,s===void 0))){if(typeof n=="string"&&(s=n),s===void 0)throw new Error("Could not extract file name from the provided input.");if(s.startsWith("https://")){const a=s.split("files/")[1].match(/[a-z0-9]+/);if(a===null)throw new Error(`Could not extract file name from URI ${s}`);s=a[0]}else s.startsWith("files/")&&(s=s.split("files/")[1]);return s}}function my(n,e){let s;return n.isVertexAI()?s=e?"publishers/google/models":"models":s=e?"models":"tunedModels",s}function py(n){for(const e of["models","tunedModels","publisherModels"])if(c_(n,e))return n[e];return[]}function c_(n,e){return n!==null&&typeof n=="object"&&e in n}function u_(n,e={}){const s=n,o={name:s.name,description:s.description,parametersJsonSchema:s.inputSchema};return s.outputSchema&&(o.responseJsonSchema=s.outputSchema),e.behavior&&(o.behavior=e.behavior),{functionDeclarations:[o]}}function d_(n,e={}){const s=[],o=new Set;for(const a of n){const c=a.name;if(o.has(c))throw new Error(`Duplicate function name ${c} found in MCP tools. Please ensure function names are unique.`);o.add(c);const d=u_(a,e);d.functionDeclarations&&s.push(...d.functionDeclarations)}return{functionDeclarations:s}}function gy(n,e){let s;if(typeof e=="string")if(n.isVertexAI())if(e.startsWith("gs://"))s={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))s={format:"bigquery",bigqueryUri:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))s={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(n.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");s={inlinedRequests:e}}else s=e;
77const o=[s.gcsUri,s.bigqueryUri].filter(Boolean).length,a=[s.inlinedRequests,s.fileName].filter(Boolean).length;if(n.isVertexAI()){if(a>0||o!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(o>0||a!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return s}function h_(n){if(typeof n!="string")return n;const e=n;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function yy(n){if(typeof n!="object"||n===null)return{};const e=n,s=e.inlinedResponses;if(typeof s!="object"||s===null)return n;const a=s.inlinedResponses;if(!Array.isArray(a)||a.length===0)return n;let c=!1;for(const d of a){if(typeof d!="object"||d===null)continue;const y=d.response;if(typeof y!="object"||y===null)continue;if(y.embedding!==void 0){c=!0;break}}return c&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),n}function uo(n,e){const s=e;if(!n.isVertexAI()){if(/batches\/[^/]+$/.test(s))return s.split("/").pop();throw new Error(`Invalid batch job name: ${s}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(s))return s.split("/").pop();if(/^\d+$/.test(s))return s;throw new Error(`Invalid batch job name: ${s}.`)}function vy(n){const e=n;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}/** 78 * @license 79 * Copyright 2025 Google LLC 80 * SPDX-License-Identifier: Apache-2.0 81 */function f_(n){const e={},s=h(n,["responsesFile"]);s!=null&&p(e,["fileName"],s);const o=h(n,["inlinedResponses","inlinedResponses"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>Y_(d))),p(e,["inlinedResponses"],c)}const a=h(n,["inlinedEmbedContentResponses","inlinedResponses"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["inlinedEmbedContentResponses"],c)}return e}function m_(n){const e={},s=h(n,["predictionsFormat"]);s!=null&&p(e,["format"],s);const o=h(n,["gcsDestination","outputUriPrefix"]);o!=null&&p(e,["gcsUri"],o);const a=h(n,["bigqueryDestination","outputUri"]);return a!=null&&p(e,["bigqueryUri"],a),e}function p_(n){const e={},s=h(n,["format"]);s!=null&&p(e,["predictionsFormat"],s);const o=h(n,["gcsUri"]);o!=null&&p(e,["gcsDestination","outputUriPrefix"],o);const a=h(n,["bigqueryUri"]);if(a!=null&&p(e,["bigqueryDestination","outputUri"],a),h(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(h(n,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(h(n,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return e}function Vr(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata","displayName"]);o!=null&&p(e,["displayName"],o);const a=h(n,["metadata","state"]);a!=null&&p(e,["state"],vy(a));const c=h(n,["metadata","createTime"]);c!=null&&p(e,["createTime"],c);const d=h(n,["metadata","endTime"]);d!=null&&p(e,["endTime"],d);const m=h(n,["metadata","updateTime"]);m!=null&&p(e,["updateTime"],m);const y=h(n,["metadata","model"]);y!=null&&p(e,["model"],y);const f=h(n,["metadata","output"]);return f!=null&&p(e,["dest"],f_(yy(f))),e}function Ku(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["displayName"]);o!=null&&p(e,["displayName"],o);const a=h(n,["state"]);a!=null&&p(e,["state"],vy(a));const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["createTime"]);d!=null&&p(e,["createTime"],d);const m=h(n,["startTime"]);m!=null&&p(e,["startTime"],m);const y=h(n,["endTime"]);y!=null&&p(e,["endTime"],y);const f=h(n,["updateTime"]);f!=null&&p(e,["updateTime"],f);const v=h(n,["model"]);v!=null&&p(e,["model"],v);
81const b=h(n,["inputConfig"]);b!=null&&p(e,["src"],g_(b));const w=h(n,["outputConfig"]);w!=null&&p(e,["dest"],m_(yy(w)));const _=h(n,["completionStats"]);return _!=null&&p(e,["completionStats"],_),e}function g_(n){const e={},s=h(n,["instancesFormat"]);s!=null&&p(e,["format"],s);const o=h(n,["gcsSource","uris"]);o!=null&&p(e,["gcsUri"],o);const a=h(n,["bigquerySource","inputUri"]);return a!=null&&p(e,["bigqueryUri"],a),e}function y_(n,e){const s={};if(h(e,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(h(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(h(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const o=h(e,["fileName"]);o!=null&&p(s,["fileName"],o);const a=h(e,["inlinedRequests"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>$_(n,d))),p(s,["requests","requests"],c)}return s}function v_(n){const e={},s=h(n,["format"]);s!=null&&p(e,["instancesFormat"],s);const o=h(n,["gcsUri"]);o!=null&&p(e,["gcsSource","uris"],o);const a=h(n,["bigqueryUri"]);if(a!=null&&p(e,["bigquerySource","inputUri"],a),h(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(h(n,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return e}function x_(n){const e={},s=h(n,["data"]);if(s!=null&&p(e,["data"],s),h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function b_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function w_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function S_(n){const e={},s=h(n,["content"]);s!=null&&p(e,["content"],s);const o=h(n,["citationMetadata"]);o!=null&&p(e,["citationMetadata"],__(o));const a=h(n,["tokenCount"]);a!=null&&p(e,["tokenCount"],a);const c=h(n,["finishReason"]);c!=null&&p(e,["finishReason"],c);const d=h(n,["avgLogprobs"]);d!=null&&p(e,["avgLogprobs"],d);const m=h(n,["groundingMetadata"]);m!=null&&p(e,["groundingMetadata"],m);const y=h(n,["index"]);y!=null&&p(e,["index"],y);const f=h(n,["logprobsResult"]);f!=null&&p(e,["logprobsResult"],f);const v=h(n,["safetyRatings"]);if(v!=null){let w=v;Array.isArray(w)&&(w=w.map(_=>_)),p(e,["safetyRatings"],w)}const b=h(n,["urlContextMetadata"]);return b!=null&&p(e,["urlContextMetadata"],b),e}function __(n){const e={},s=h(n,["citationSources"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>a)),p(e,["citations"],o)}return e}function xy(n){const e={},s=h(n,["parts"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>eT(c))),p(e,["parts"],a)}const o=h(n,["role"]);return o!=null&&p(e,["role"],o),e}function T_(n,e){const s={},o=h(n,["displayName"]);if(e!==void 0&&o!=null&&p(e,["batch","displayName"],o),h(n,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return s}function C_(n,e){const s={},o=h(n,["displayName"]);e!==void 0&&o!=null&&p(e,["displayName"],o);const a=h(n,["dest"]);return e!==void 0&&a!=null&&p(e,["outputConfig"],p_(h_(a))),s}function g0(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["src"]);a!=null&&p(s,["batch","inputConfig"],y_(n,gy(n,a)));const c=h(e,["config"]);return c!=null&&T_(c,s),s}function E_(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["model"],Pe(n,o));const a=h(e,["src"]);a!=null&&p(s,["inputConfig"],v_(gy(n,a)));const c=h(e,["config"]);return c!=null&&C_(c,s),s}function N_(n,e){const s={},o=h(n,["displayName"]);return e!==void 0&&o!=null&&p(e,["batch","displayName"],o),s}function A_(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["src"]);a!=null&&p(s,["batch","inputConfig"],U_(n,a));const c=h(e,["config"]);return c!=null&&N_(c,s),s}function R_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function k_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function j_(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["name"]);o!=null&&p(e,["name"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);return c!=null&&p(e,["error"],c),e}function I_(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["name"]);o!=null&&p(e,["name"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);return c!=null&&p(e,["error"],c),e}function M_(n,e){const s={},o=h(e,["contents"]);if(o!=null){let c=pd(n,o);Array.isArray(c)&&(c=c.map(d=>
81d)),p(s,["requests[]","request","content"],c)}const a=h(e,["config"]);return a!=null&&(p(s,["_self"],D_(a,s)),kS(s,{"requests[].*":"requests[].request.*"})),s}function D_(n,e){const s={},o=h(n,["taskType"]);e!==void 0&&o!=null&&p(e,["requests[]","taskType"],o);const a=h(n,["title"]);e!==void 0&&a!=null&&p(e,["requests[]","title"],a);const c=h(n,["outputDimensionality"]);if(e!==void 0&&c!=null&&p(e,["requests[]","outputDimensionality"],c),h(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(h(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return s}function U_(n,e){const s={},o=h(e,["fileName"]);o!=null&&p(s,["file_name"],o);const a=h(e,["inlinedRequests"]);return a!=null&&p(s,["requests"],M_(n,a)),s}function L_(n){const e={};if(h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=h(n,["fileUri"]);s!=null&&p(e,["fileUri"],s);const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function P_(n){const e={},s=h(n,["id"]);s!=null&&p(e,["id"],s);const o=h(n,["args"]);o!=null&&p(e,["args"],o);const a=h(n,["name"]);if(a!=null&&p(e,["name"],a),h(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(h(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function O_(n){const e={},s=h(n,["mode"]);s!=null&&p(e,["mode"],s);const o=h(n,["allowedFunctionNames"]);if(o!=null&&p(e,["allowedFunctionNames"],o),h(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function G_(n,e,s){const o={},a=h(e,["systemInstruction"]);s!==void 0&&a!=null&&p(s,["systemInstruction"],xy(wt(a)));const c=h(e,["temperature"]);c!=null&&p(o,["temperature"],c);const d=h(e,["topP"]);d!=null&&p(o,["topP"],d);const m=h(e,["topK"]);m!=null&&p(o,["topK"],m);const y=h(e,["candidateCount"]);y!=null&&p(o,["candidateCount"],y);const f=h(e,["maxOutputTokens"]);f!=null&&p(o,["maxOutputTokens"],f);const v=h(e,["stopSequences"]);v!=null&&p(o,["stopSequences"],v);const b=h(e,["responseLogprobs"]);b!=null&&p(o,["responseLogprobs"],b);const w=h(e,["logprobs"]);w!=null&&p(o,["logprobs"],w);const _=h(e,["presencePenalty"]);_!=null&&p(o,["presencePenalty"],_);const C=h(e,["frequencyPenalty"]);C!=null&&p(o,["frequencyPenalty"],C);const A=h(e,["seed"]);A!=null&&p(o,["seed"],A);const E=h(e,["responseMimeType"]);E!=null&&p(o,["responseMimeType"],E);const I=h(e,["responseSchema"]);I!=null&&p(o,["responseSchema"],gd(I));const U=h(e,["responseJsonSchema"]);if(U!=null&&p(o,["responseJsonSchema"],U),h(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(h(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const G=h(e,["safetySettings"]);if(s!==void 0&&G!=null){let se=G;Array.isArray(se)&&(se=se.map(fe=>tT(fe))),p(s,["safetySettings"],se)}const F=h(e,["tools"]);if(s!==void 0&&F!=null){let se=co(F);Array.isArray(se)&&(se=se.map(fe=>sT(lo(fe)))),p(s,["tools"],se)}const P=h(e,["toolConfig"]);if(s!==void 0&&P!=null&&p(s,["toolConfig"],nT(P)),h(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const $=h(e,["cachedContent"]);s!==void 0&&$!=null&&p(s,["cachedContent"],Qn(n,$));const H=h(e,["responseModalities"]);H!=null&&p(o,["responseModalities"],H);const Z=h(e,["mediaResolution"]);Z!=null&&p(o,["mediaResolution"],Z);const X=h(e,["speechConfig"]);if(X!=null&&p(o,["speechConfig"],yd(X)),h(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const q=h(e,["thinkingConfig"]);q!=null&&p(o,["thinkingConfig"],q);const Q=h(e,["imageConfig"]);Q!=null&&p(o,["imageConfig"],F_(Q));const ne=h(e,["enableEnhancedCivicAnswers"]);return ne!=null&&p(o,["enableEnhancedCivicAnswers"],ne),o}function q_(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["candidates"]);if(o!=null){let y=o;Array.isArray(y)&&(y=y.map(f=>S_(f))),p(e,["candidates"],y)}const a=h(n,["modelVersion"]);a!=null&&p(e,["modelVersion"],a);const c=h(n,["promptFeedback"]);c!=null&&p(e,["promptFeedback"],c);const d=h(n,["responseId"]);d!=null&&p(e,["responseId"],d);const m=h(n,["usageMetadata"]);return m!=null&&p(e,["usageMetadata"],m),e}function B_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function H_(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],uo(n,o)),s}function z_(n){const e={};if(h(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const s=h(n,["enableWidget"]);return s!=null&&p(e,["enableWidget"],s),e}function V_(n){const e={};if(h(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(h(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const s=h(n,["timeRangeFilter"]);return s!=null&&p(e,["timeRangeFilter"],s),e}function F_(n){const e={},s=h(n,["aspectRatio"]);s!=null&&p(e,["aspectRatio"],s);const o=h(n,["imageSize"]);if(o!=null&&p(e,["imageSize"],o),h(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(h(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return e}function $_(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["request","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let m=cn(a);Array.isArray(m)&&(m=m.map(y=>xy(y))),p(s,["request","contents"],m)}const c=h(e,["metadata"]);c!=null&&p(s,["metadata"],c);const d=h(e,["config"]);return d!=null&&p(s,["request","generationConfig"],G_(n,d,h(s,["request"],{}))),s}function Y_(n){const e={},s=h(n,["response"]);s!=null&&p(e,["response"],q_(s));const o=h(n,["error"]);return o!=null&&p(e,["error"],o),e}function J_(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);if(e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),h(n,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return s}function K_(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);e!==void 0&&a!=null&&p(e,["_query","pageToken"],a);const c=h(n,["filter"]);return e!==void 0&&c!=null&&p(e,["_query","filter"],c),s}function Q_(n){const e={},s=h(n,["config"]);return s!=null&&J_(s,e),e}function W_(n){const e={},s=h(n,["config"]);return s!=null&&K_(s,e),e}function X_(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["operations"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>Vr(d))),p(e,["batchJobs"],c)}return e}function Z_(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["batchPredictionJobs"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>Ku(d))),p(e,["batchJobs"],c)}return e}function eT(n){const e={},s=h(n,["mediaResolution"]);s!=null&&p(e,["mediaResolution"],s);const o=h(n,["codeExecutionResult"]);o!=null&&p(e,["codeExecutionResult"],o);const a=h(n,["executableCode"]);a!=null&&p(e,["executableCode"],a);const c=h(n,["fileData"]);c!=null&&p(e,["fileData"],L_(c));const d=h(n,["functionCall"]);d!=null&&p(e,["functionCall"],P_(d));const m=h(n,["functionResponse"]);m!=null&&p(e,["functionResponse"],m);const y=h(n,["inlineData"]);y!=null&&p(e,["inlineData"],x_(y));const f=h(n,["text"]);f!=null&&p(e,["text"],f);const v=h(n,["thought"]);v!=null&&p(e,["thought"],v);const b=h(n,["thoughtSignature"]);b!=null&&p(e,["thoughtSignature"],b);const w=h(n,["videoMetadata"]);return w!=null&&p(e,["videoMetadata"],w),e}function tT(n){const e={},s=h(n,["category"]);if(s!=null&&p(e,["category"],s),h(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=h(n,["threshold"]);return o!=null&&p(e,["threshold"],o),e}function nT(n){const e={},s=h(n,["functionCallingConfig"]);s!=null&&p(e,["functionCallingConfig"],O_(s));const o=h(n,["retrievalConfig"]);return o!=null&&p(e,["retrievalConfig"],o),e}function sT(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let v=s;Array.isArray(v)&&(v=v.map(b=>b)),p(e,["functionDeclarations"],v)}if(h(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=h(n,["googleSearchRetrieval"]);o!=null&&p(e,["googleSearchRetrieval"],o);const a=h(n,["computerUse"]);a!=null&&p(e,["computerUse"],a);const c=h(n,["fileSearch"]);c!=null&&p(e,["fileSearch"],c);const d=h(n,["codeExecution"]);if(d!=null&&p(e,["codeExecution"],d),h(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const m=h(n,["googleMaps"]);m!=null&&p(e,["googleMaps"],z_(m));const y=h(n,["googleSearch"]);y!=null&&p(e,["googleSearch"],V_(y));const f=h(n,["urlContext"]);
81return f!=null&&p(e,["urlContext"],f),e}/** 82 * @license 83 * Copyright 2025 Google LLC 84 * SPDX-License-Identifier: Apache-2.0 85 */var Jn;(function(n){n.PAGED_ITEM_BATCH_JOBS="batchJobs",n.PAGED_ITEM_MODELS="models",n.PAGED_ITEM_TUNING_JOBS="tuningJobs",n.PAGED_ITEM_FILES="files",n.PAGED_ITEM_CACHED_CONTENTS="cachedContents",n.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",n.PAGED_ITEM_DOCUMENTS="documents"})(Jn||(Jn={}));class ni{constructor(e,s,o,a){this.pageInternal=[],this.paramsInternal={},this.requestInternal=s,this.init(e,o,a)}init(e,s,o){var a,c;this.nameInternal=e,this.pageInternal=s[this.nameInternal]||[],this.sdkHttpResponseInternal=s==null?void 0:s.sdkHttpResponse,this.idxInternal=0;let d={config:{}};!o||Object.keys(o).length===0?d={config:{}}:typeof o=="object"?d=Object.assign({},o):d=o,d.config&&(d.config.pageToken=s.nextPageToken),this.paramsInternal=d,this.pageInternalSize=(c=(a=d.config)===null||a===void 0?void 0:a.pageSize)!==null&&c!==void 0?c:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}/** 86 * @license 87 * Copyright 2025 Google LLC 88 * SPDX-License-Identifier: Apache-2.0 89 */class iT extends Kn{constructor(e){super(),this.apiClient=e,this.list=async(s={})=>new ni(Jn.PAGED_ITEM_BATCH_JOBS,o=>this.listInternal(o),await this.listInternal(s),s),this.create=async s=>(this.apiClient.isVertexAI()&&(s.config=this.formatDestination(s.src,s.config)),this.createInternal(s)),this.createEmbeddings=async s=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(s)}}createInlinedGenerateContentRequest(e){const s=g0(this.apiClient,e),o=s._url,a=ie("{model}:batchGenerateContent",o),m=s.batch.inputConfig.requests,y=m.requests,f=[];for(const v of y){const b=Object.assign({},v);if(b.systemInstruction){const w=b.systemInstruction;delete b.systemInstruction;const _=b.request;_.systemInstruction=w,b.request=_}f.push(b)}return m.requests=f,delete s.config,delete s._url,delete s._query,{path:a,body:s}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,s){const o=s?Object.assign({},s):{},a=Date.now().toString();if(o.displayName||(o.displayName=`genaiBatchJob_${a}`),o.dest===void 0){const c=this.getGcsUri(e),d=this.getBigqueryUri(e);if(c)c.endsWith(".jsonl")?o.dest=`${c.slice(0,-6)}/dest`:o.dest=`${c}_dest_${a}`;else if(d)o.dest=`${d}_dest_${a}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return o}async createInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=E_(this.apiClient,e);return m=ie("batchPredictionJobs",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>Ku(v))}else{const f=g0(this.apiClient,e);return m=ie("{model}:batchGenerateContent",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>
89Vr(v))}}async createEmbeddingsInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=A_(this.apiClient,e);return c=ie("{model}:asyncBatchEmbedContent",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>Vr(y))}}async get(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=H_(this.apiClient,e);return m=ie("batchPredictionJobs/{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>Ku(v))}else{const f=B_(this.apiClient,e);return m=ie("batches/{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Vr(v))}}async cancel(e){var s,o,a,c;let d="",m={};if(this.apiClient.isVertexAI()){const y=w_(this.apiClient,e);d=ie("batchPredictionJobs/{name}:cancel",y._url),m=y._query,delete y._url,delete y._query,await this.apiClient.request({path:d,queryParams:m,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}else{const y=b_(this.apiClient,e);d=ie("batches/{name}:cancel",y._url),m=y._query,delete y._url,delete y._query,await this.apiClient.request({path:d,queryParams:m,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal})}}async listInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=W_(e);return m=ie("batchPredictionJobs",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=Z_(v),w=new h0;return Object.assign(w,b),w})}else{const f=Q_(e);return m=ie("batches",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=X_(v),w=new h0;return Object.assign(w,b),w})}}async delete(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=k_(this.apiClient,e);return m=ie("batchPredictionJobs/{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>I_(v))}else{const f=R_(this.apiClient,e);return m=ie("batches/{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>j_(v))}}}/** 90 * @license 91 * Copyright 2025 Google LLC 92 * SPDX-License-Identifier: Apache-2.0 93 */function oT(n){const e={},s=h(n,["data"]);if(s!=null&&p(e,["data"],s),h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function y0(n){const e={},s=h(n,["parts"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>AT(c))),p(e,["parts"],a)}const o=h(n,["role"]);return o!=null&&p(e,["role"],o),e}function aT(n,e){const s={},o=h(n,["ttl"]);e!==void 0&&o!=null&&p(e,["ttl"],o);const a=h(n,["expireTime"]);e!==void 0&&a!=null&&p(e,["expireTime"],a);const c=h(n,["displayName"]);e!==void 0&&c!=null&&p(e,["displayName"],c);const d=h(n,["contents"]);if(e!==void 0&&d!=null){let v=cn(d);Array.isArray(v)&&(v=v.map(b=>y0(b))),p(e,["contents"],v)}const m=h(n,["systemInstruction"]);e!==void 0&&m!=null&&p(e,["systemInstruction"],y0(wt(m)));const y=h(n,["tools"]);if(e!==void 0&&y!=null){let v=y;Array.isArray(v)&&(v=v.map(b=>kT(b))),p(e,["tools"],v)}const f=h(n,["toolConfig"]);if(e!==void 0&&f!=null&&p(e,["toolConfig"],RT(f)),h(n,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return s}function rT(n,e){const s={},o=h(n,["ttl"]);e!==void 0&&o!=null&&p(e,["ttl"],o);const a=h(n,["expireTime"]);e!==void 0&&a!=null&&p(e,["expireTime"],a);const c=h(n,["displayName"]);e!==void 0&&c!=null&&p(e,["displayName"],c);const d=h(n,["contents"]);if(e!==void 0&&d!=null){let b=cn(d);Array.isArray(b)&&(b=b.map(w=>w)),p(e,["contents"],b)}const m=h(n,["systemInstruction"]);e!==void 0&&m!=null&&p(e,["systemInstruction"],wt(m));const y=h(n,["tools"]);if(e!==void 0&&y!=null){let b=y;Array.isArray(b)&&(b=b.map(w=>jT(w))),p(e,["tools"],b)}const f=h(n,["toolConfig"]);e!==void 0&&f!=null&&p(e,["toolConfig"],f);const v=h(n,["kmsKeyName"]);return e!==void 0&&v!=null&&p(e,["encryption_spec","kmsKeyName"],v),s}function lT(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["model"],ry(n,o));const a=h(e,["config"]);return a!=null&&aT(a,s),s}function cT(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["model"],ry(n,o));const a=h(e,["config"]);return a!=null&&rT(a,s),s}function uT(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],Qn(n,o)),s}function dT(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],Qn(n,o)),s}function hT(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function fT(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function mT(n){const e={};if(h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=h(n,["fileUri"]);s!=null&&p(e,["fileUri"],s);const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function pT(n){const e={},s=h(n,["id"]);s!=null&&p(e,["id"],s);const o=h(n,["args"]);o!=null&&p(e,["args"],o);const a=h(n,["name"]);if(a!=null&&p(e,["name"],a),h(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(h(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function gT(n){const e={},s=h(n,["mode"]);s!=null&&p(e,["mode"],s);const o=h(n,["allowedFunctionNames"]);if(o!=null&&p(e,["allowedFunctionNames"],o),h(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function yT(n){const e={};if(h(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const s=h(n,["description"]);s!=null&&p(e,["description"],s);const o=h(n,["name"]);o!=null&&p(e,["name"],o);const a=h(n,["parameters"]);a!=null&&p(e,["parameters"],a);const c=h(n,["parametersJsonSchema"]);c!=null&&p(e,["parametersJsonSchema"],c);const d=h(n,["response"]);d!=null&&p(e,["response"],d);const m=h(n,["responseJsonSchema"]);return m!=null&&p(e,["responseJsonSchema"],m),e}function vT(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],Qn(n,o)),s}function xT(n,e){const s={},o=h(e,["name"]);return o!=null&&p(s,["_url","name"],Qn(n,o)),s}function bT(n){const e={};if(h(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const s=h(n,["enableWidget"]);return s!=null&&p(e,["enableWidget"],s),e}function wT(n){const e={};if(h(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(h(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const s=h(n,["timeRangeFilter"]);return s!=null&&p(e,["timeRangeFilter"],s),e}function ST(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);return e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),s}function _T(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);return e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),s}function TT(n){const e={},s=h(n,["config"]);return s!=null&&ST(s,e),e}function CT(n){const e={},s=h(n,["config"]);return s!=null&&_T(s,e),e}function ET(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["cachedContents"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["cachedContents"],c)}return e}function NT(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["cachedContents"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["cachedContents"],c)}return e}function AT(n){const e={},s=h(n,["mediaResolution"]);s!=null&&p(e,["mediaResolution"],s);const o=h(n,["codeExecutionResult"]);o!=null&&p(e,["codeExecutionResult"],o);const a=h(n,["executableCode"]);a!=null&&p(e,["executableCode"],a);const c=h(n,["fileData"]);c!=null&&p(e,["fileData"],mT(c));const d=h(n,["functionCall"]);d!=null&&p(e,["functionCall"],pT(d));const m=h(n,["functionResponse"]);m!=null&&p(e,["functionResponse"],m);const y=h(n,["inlineData"]);y!=null&&p(e,["inlineData"],oT(y));const f=h(n,["text"]);f!=null&&p(e,["text"],f);const v=h(n,["thought"]);v!=null&&p(e,["thought"],v);const b=h(n,["thoughtSignature"]);b!=null&&p(e,["thoughtSignature"],b);const w=h(n,["videoMetadata"]);return w!=null&&p(e,["videoMetadata"],w),e}function RT(n){const e={},s=h(n,["functionCallingConfig"]);s!=null&&p(e,["functionCallingConfig"],gT(s));const o=h(n,["retrievalConfig"]);return o!=null&&p(e,["retrievalConfig"],o),e}function kT(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let v=s;Array.isArray(v)&&(v=v.map(b=>b)),p(e,["functionDeclarations"],v)}if(h(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=h(n,["googleSearchRetrieval"]);o!=null&&p(e,["googleSearchRetrieval"],o);const a=h(n,["computerUse"]);a!=null&&p(e,["computerUse"],a);const c=h(n,["fileSearch"]);c!=null&&p(e,["fileSearch"],c);const d=h(n,["codeExecution"]);if(d!=null&&p(e,["codeExecution"],d),h(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const m=h(n,["googleMaps"]);m!=null&&p(e,["googleMaps"],bT(m));const y=h(n,["googleSearch"]);y!=null&&p(e,["googleSearch"],wT(y));const f=h(n,["urlContext"]);
93return f!=null&&p(e,["urlContext"],f),e}function jT(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let b=s;Array.isArray(b)&&(b=b.map(w=>yT(w))),p(e,["functionDeclarations"],b)}const o=h(n,["retrieval"]);o!=null&&p(e,["retrieval"],o);const a=h(n,["googleSearchRetrieval"]);a!=null&&p(e,["googleSearchRetrieval"],a);const c=h(n,["computerUse"]);if(c!=null&&p(e,["computerUse"],c),h(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const d=h(n,["codeExecution"]);d!=null&&p(e,["codeExecution"],d);const m=h(n,["enterpriseWebSearch"]);m!=null&&p(e,["enterpriseWebSearch"],m);const y=h(n,["googleMaps"]);y!=null&&p(e,["googleMaps"],y);const f=h(n,["googleSearch"]);f!=null&&p(e,["googleSearch"],f);const v=h(n,["urlContext"]);return v!=null&&p(e,["urlContext"],v),e}function IT(n,e){const s={},o=h(n,["ttl"]);e!==void 0&&o!=null&&p(e,["ttl"],o);const a=h(n,["expireTime"]);return e!==void 0&&a!=null&&p(e,["expireTime"],a),s}function MT(n,e){const s={},o=h(n,["ttl"]);e!==void 0&&o!=null&&p(e,["ttl"],o);const a=h(n,["expireTime"]);return e!==void 0&&a!=null&&p(e,["expireTime"],a),s}function DT(n,e){const s={},o=h(e,["name"]);o!=null&&p(s,["_url","name"],Qn(n,o));const a=h(e,["config"]);return a!=null&&IT(a,s),s}function UT(n,e){const s={},o=h(e,["name"]);o!=null&&p(s,["_url","name"],Qn(n,o));const a=h(e,["config"]);return a!=null&&MT(a,s),s}/** 94 * @license 95 * Copyright 2025 Google LLC 96 * SPDX-License-Identifier: Apache-2.0 97 */class LT extends Kn{constructor(e){super(),this.apiClient=e,this.list=async(s={})=>new ni(Jn.PAGED_ITEM_CACHED_CONTENTS,o=>this.listInternal(o),await this.listInternal(s),s)}async create(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=cT(this.apiClient,e);return m=ie("cachedContents",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>v)}else{const f=lT(this.apiClient,e);return m=ie("cachedContents",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>v)}}async get(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=xT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>v)}else{const f=vT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>v)}}async delete(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=dT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=fT(v),w=new u0;return Object.assign(w,b),w})}else{const f=uT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=hT(v),w=new u0;return Object.assign(w,b),w})}}async update(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=UT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>v)}else{const f=DT(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>v)}}async listInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=CT(e);return m=ie("cachedContents",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=NT(v),w=new d0;return Object.assign(w,b),w})}else{const f=TT(e);return m=ie("cachedContents",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=ET(v),w=new d0;return Object.assign(w,b),w})}}}function Kr(n,e){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(s[o[a]]=n[o[a]]);return s}function v0(n){var e=typeof Symbol=="function"&&Symbol.iterator,s=e&&n[e],o=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ye(n){return this instanceof ye?(this.v=n,this):new ye(n)}function xn(n,e,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=s.apply(n,e||[]),a,c=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),m("next"),m("throw"),m("return",d),a[Symbol.asyncIterator]=function(){return this},a;function d(_){return function(C){return Promise.resolve(C).then(_,b)}}function m(_,C){o[_]&&(a[_]=function(A){return new Promise(function(E,I){c.push([_,A,E,I])>1||y(_,A)})}
97,C&&(a[_]=C(a[_])))}function y(_,C){try{f(o[_](C))}catch(A){w(c[0][3],A)}}function f(_){_.value instanceof ye?Promise.resolve(_.value.v).then(v,b):w(c[0][2],_)}function v(_){y("next",_)}function b(_){y("throw",_)}function w(_,C){_(C),c.shift(),c.length&&y(c[0][0],c[0][1])}}function bn(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],s;return e?e.call(n):(n=typeof v0=="function"?v0(n):n[Symbol.iterator](),s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s);function o(c){s[c]=n[c]&&function(d){return new Promise(function(m,y){d=n[c](d),a(m,y,d.done,d.value)})}}function a(c,d,m,y){Promise.resolve(y).then(function(f){c({value:f,done:m})},d)}}/** 98 * @license 99 * Copyright 2025 Google LLC 100 * SPDX-License-Identifier: Apache-2.0 101 */function PT(n){var e;if(n.candidates==null||n.candidates.length===0)return!1;const s=(e=n.candidates[0])===null||e===void 0?void 0:e.content;return s===void 0?!1:by(s)}function by(n){if(n.parts===void 0||n.parts.length===0)return!1;for(const e of n.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function OT(n){if(n.length!==0){for(const e of n)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function x0(n){if(n===void 0||n.length===0)return[];const e=[],s=n.length;let o=0;for(;o<s;)if(n[o].role==="user")e.push(n[o]),o++;else{const a=[];let c=!0;for(;o<s&&n[o].role==="model";)a.push(n[o]),c&&!by(n[o])&&(c=!1),o++;c?e.push(...a):e.pop()}return e}class GT{constructor(e,s){this.modelsModule=e,this.apiClient=s}create(e){return new qT(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}}class qT{constructor(e,s,o,a={},c=[]){this.apiClient=e,this.modelsModule=s,this.model=o,this.config=a,this.history=c,this.sendPromise=Promise.resolve(),OT(c)}async sendMessage(e){var s;await this.sendPromise;const o=wt(e.message),a=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(o),config:(s=e.config)!==null&&s!==void 0?s:this.config});return this.sendPromise=(async()=>{var c,d,m;const y=await a,f=(d=(c=y.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content,v=y.automaticFunctionCallingHistory,b=this.getHistory(!0).length;let w=[];v!=null&&(w=(m=v.slice(b))!==null&&m!==void 0?m:[]);const _=f?[f]:[];this.recordHistory(o,_,w)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),a}async sendMessageStream(e){var s;await this.sendPromise;const o=wt(e.message),a=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(o),config:(s=e.config)!==null&&s!==void 0?s:this.config});this.sendPromise=a.then(()=>{}).catch(()=>{});const c=await a;return this.processStreamResponse(c,o)}getHistory(e=!1){const s=e?x0(this.history):this.history;return structuredClone(s)}processStreamResponse(e,s){return xn(this,arguments,function*(){var a,c,d,m,y,f;const v=[];try{for(var b=!0,w=bn(e),_;_=yield ye(w.next()),a=_.done,!a;b=!0){m=_.value,b=!1;const C=m;if(PT(C)){const A=(f=(y=C.candidates)===null||y===void 0?void 0:y[0])===null||f===void 0?void 0:f.content;A!==void 0&&v.push(A)}yield yield ye(C)}}catch(C){c={error:C}}finally{try{!b&&!a&&(d=w.return)&&(yield ye(d.call(w)))}finally{if(c)throw c.error}}this.recordHistory(s,v)})}recordHistory(e,s,o){let a=[];s.length>0&&s.every(c=>c.role!==void 0)?a=s:a.push({role:"model",parts:[]}),o&&o.length>0?this.history.push(...x0(o)):this.history.push(e),this.history.push(...a)}}/** 102 * @license 103 * Copyright 2025 Google LLC 104 * SPDX-License-Identifier: Apache-2.0 105 */class el extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,el.prototype)}}/** 106 * @license 107 * Copyright 2025 Google LLC 108 * SPDX-License-Identifier: Apache-2.0 109 */function BT(n){const e={},s=h(n,["file"]);return s!=null&&p(e,["file"],s),e}function HT(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function zT(n){const e={},s=h(n,["name"]);return s!=null&&p(e,["_url","file"],fy(s)),e}function VT(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function FT(n){const e={},s=h(n,["name"]);return s!=null&&p(e,["_url","file"],fy(s)),e}function $T(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);return e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),s}function YT(n){const e={},s=h(n,["config"]);return s!=null&&$T(s,e),e}function JT(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["files"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["files"],c)}return e}/** 110 * @license 111 * Copyright 2025 Google LLC 112 * SPDX-License-Identifier: Apache-2.0 113 */class KT extends Kn{constructor(e){super(),this.apiClient=e,this.list=async(s={})=>new ni(Jn.PAGED_ITEM_FILES,o=>this.listInternal(o),await this.listInternal(s),s)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(s=>s)}async download(e){await this.apiClient.downloadFile(e)}
113async listInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=YT(e);return c=ie("files",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>{const f=JT(y),v=new ZS;return Object.assign(v,f),v})}}async createInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=BT(e);return c=ie("upload/v1beta/files",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=HT(y),v=new e_;return Object.assign(v,f),v})}}async get(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=FT(e);return c=ie("files/{file}",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>y)}}async delete(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=zT(e);return c=ie("files/{file}",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>{const f=VT(y),v=new t_;return Object.assign(v,f),v})}}}/** 114 * @license 115 * Copyright 2025 Google LLC 116 * SPDX-License-Identifier: Apache-2.0 117 */function Fr(n){const e={},s=h(n,["data"]);if(s!=null&&p(e,["data"],s),h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function QT(n){const e={},s=h(n,["parts"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>hC(c))),p(e,["parts"],a)}const o=h(n,["role"]);return o!=null&&p(e,["role"],o),e}function WT(n){const e={};if(h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=h(n,["fileUri"]);s!=null&&p(e,["fileUri"],s);const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function XT(n){const e={},s=h(n,["id"]);s!=null&&p(e,["id"],s);const o=h(n,["args"]);o!=null&&p(e,["args"],o);const a=h(n,["name"]);if(a!=null&&p(e,["name"],a),h(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(h(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function ZT(n){const e={};if(h(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const s=h(n,["description"]);s!=null&&p(e,["description"],s);const o=h(n,["name"]);o!=null&&p(e,["name"],o);const a=h(n,["parameters"]);a!=null&&p(e,["parameters"],a);const c=h(n,["parametersJsonSchema"]);c!=null&&p(e,["parametersJsonSchema"],c);const d=h(n,["response"]);d!=null&&p(e,["response"],d);const m=h(n,["responseJsonSchema"]);return m!=null&&p(e,["responseJsonSchema"],m),e}function eC(n){const e={},s=h(n,["modelSelectionConfig"]);s!=null&&p(e,["modelConfig"],s);const o=h(n,["responseJsonSchema"]);o!=null&&p(e,["responseJsonSchema"],o);const a=h(n,["audioTimestamp"]);a!=null&&p(e,["audioTimestamp"],a);const c=h(n,["candidateCount"]);c!=null&&p(e,["candidateCount"],c);const d=h(n,["enableAffectiveDialog"]);d!=null&&p(e,["enableAffectiveDialog"],d);const m=h(n,["frequencyPenalty"]);m!=null&&p(e,["frequencyPenalty"],m);const y=h(n,["logprobs"]);y!=null&&p(e,["logprobs"],y);const f=h(n,["maxOutputTokens"]);f!=null&&p(e,["maxOutputTokens"],f);const v=h(n,["mediaResolution"]);v!=null&&p(e,["mediaResolution"],v);const b=h(n,["presencePenalty"]);b!=null&&p(e,["presencePenalty"],b);const w=h(n,["responseLogprobs"]);w!=null&&p(e,["responseLogprobs"],w);const _=h(n,["responseMimeType"]);_!=null&&p(e,["responseMimeType"],_);const C=h(n,["responseModalities"]);C!=null&&p(e,["responseModalities"],C);const A=h(n,["responseSchema"]);A!=null&&p(e,["responseSchema"],A);
117const E=h(n,["routingConfig"]);E!=null&&p(e,["routingConfig"],E);const I=h(n,["seed"]);I!=null&&p(e,["seed"],I);const U=h(n,["speechConfig"]);U!=null&&p(e,["speechConfig"],U);const G=h(n,["stopSequences"]);G!=null&&p(e,["stopSequences"],G);const F=h(n,["temperature"]);F!=null&&p(e,["temperature"],F);const P=h(n,["thinkingConfig"]);P!=null&&p(e,["thinkingConfig"],P);const $=h(n,["topK"]);$!=null&&p(e,["topK"],$);const H=h(n,["topP"]);if(H!=null&&p(e,["topP"],H),h(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return e}function tC(n){const e={};if(h(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const s=h(n,["enableWidget"]);return s!=null&&p(e,["enableWidget"],s),e}function nC(n){const e={};if(h(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(h(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const s=h(n,["timeRangeFilter"]);return s!=null&&p(e,["timeRangeFilter"],s),e}function sC(n,e){const s={},o=h(n,["generationConfig"]);e!==void 0&&o!=null&&p(e,["setup","generationConfig"],o);const a=h(n,["responseModalities"]);e!==void 0&&a!=null&&p(e,["setup","generationConfig","responseModalities"],a);const c=h(n,["temperature"]);e!==void 0&&c!=null&&p(e,["setup","generationConfig","temperature"],c);const d=h(n,["topP"]);e!==void 0&&d!=null&&p(e,["setup","generationConfig","topP"],d);const m=h(n,["topK"]);e!==void 0&&m!=null&&p(e,["setup","generationConfig","topK"],m);const y=h(n,["maxOutputTokens"]);e!==void 0&&y!=null&&p(e,["setup","generationConfig","maxOutputTokens"],y);const f=h(n,["mediaResolution"]);e!==void 0&&f!=null&&p(e,["setup","generationConfig","mediaResolution"],f);const v=h(n,["seed"]);e!==void 0&&v!=null&&p(e,["setup","generationConfig","seed"],v);const b=h(n,["speechConfig"]);e!==void 0&&b!=null&&p(e,["setup","generationConfig","speechConfig"],vd(b));const w=h(n,["thinkingConfig"]);e!==void 0&&w!=null&&p(e,["setup","generationConfig","thinkingConfig"],w);const _=h(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&p(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=h(n,["systemInstruction"]);e!==void 0&&C!=null&&p(e,["setup","systemInstruction"],QT(wt(C)));const A=h(n,["tools"]);if(e!==void 0&&A!=null){let $=co(A);Array.isArray($)&&($=$.map(H=>mC(lo(H)))),p(e,["setup","tools"],$)}const E=h(n,["sessionResumption"]);e!==void 0&&E!=null&&p(e,["setup","sessionResumption"],fC(E));const I=h(n,["inputAudioTranscription"]);e!==void 0&&I!=null&&p(e,["setup","inputAudioTranscription"],I);const U=h(n,["outputAudioTranscription"]);e!==void 0&&U!=null&&p(e,["setup","outputAudioTranscription"],U);const G=h(n,["realtimeInputConfig"]);e!==void 0&&G!=null&&p(e,["setup","realtimeInputConfig"],G);const F=h(n,["contextWindowCompression"]);e!==void 0&&F!=null&&p(e,["setup","contextWindowCompression"],F);const P=h(n,["proactivity"]);if(e!==void 0&&P!=null&&p(e,["setup","proactivity"],P),h(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return s}function iC(n,e){const s={},o=h(n,["generationConfig"]);e!==void 0&&o!=null&&p(e,["setup","generationConfig"],eC(o));const a=h(n,["responseModalities"]);e!==void 0&&a!=null&&p(e,["setup","generationConfig","responseModalities"],a);const c=h(n,["temperature"]);e!==void 0&&c!=null&&p(e,["setup","generationConfig","temperature"],c);const d=h(n,["topP"]);e!==void 0&&d!=null&&p(e,["setup","generationConfig","topP"],d);const m=h(n,["topK"]);e!==void 0&&m!=null&&p(e,["setup","generationConfig","topK"],m);const y=h(n,["maxOutputTokens"]);e!==void 0&&y!=null&&p(e,["setup","generationConfig","maxOutputTokens"],y);const f=h(n,["mediaResolution"]);e!==void 0&&f!=null&&p(e,["setup","generationConfig","mediaResolution"],f);const v=h(n,["seed"]);e!==void 0&&v!=null&&p(e,["setup","generationConfig","seed"],v);const b=h(n,["speechConfig"]);e!==void 0&&b!=null&&p(e,["setup","generationConfig","speechConfig"],vd(b));const w=h(n,["thinkingConfig"]);e!==void 0&&w!=null&&p(e,["setup","generationConfig","thinkingConfig"],w);const _=h(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&p(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=h(n,["systemInstruction"]);e!==void 0&&C!=null&&p(e,["setup","systemInstruction"],wt(C));const A=h(n,["tools"]);if(e!==void 0&&A!=null){let H=co(A);Array.isArray(H)&&(H=H.map(Z=>pC(lo(Z)))),p(e,["setup","tools"],H)}const E=h(n,["sessionResumption"]);e!==void 0&&E!=null&&p(e,["setup","sessionResumption"],E);const I=h(n,["inputAudioTranscription"]);e!==void 0&&I!=null&&p(e,["setup","inputAudioTranscription"],I);const U=h(n,["outputAudioTranscription"]);e!==void 0&&U!=null&&p(e,["setup","outputAudioTranscription"],U);const G=h(n,["realtimeInputConfig"]);e!==void 0&&G!=null&&p(e,["setup","realtimeInputConfig"],G);const F=h(n,["contextWindowCompression"]);e!==void 0&&F!=null&&p(e,["setup","contextWindowCompression"],F);const P=h(n,["proactivity"]);e!==void 0&&P!=null&&p(e,["setup","proactivity"],P);const $=h(n,["explicitVadSignal"]);return e!==void 0&&$!=null&&p(e,["setup","explicitVadSignal"],$),s}function oC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["setup","model"],Pe(n,o));const a=h(e,["config"]);return a!=null&&p(s,["config"],sC(a,s)),s}function aC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["setup","model"],Pe(n,o));const a=h(e,["config"]);return a!=null&&p(s,["config"],iC(a,s)),s}function rC(n){const e={},s=h(n,["musicGenerationConfig"]);return s!=null&&p(e,["musicGenerationConfig"],s),e}function lC(n){const e={},s=h(n,["weightedPrompts"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>a)),p(e,["weightedPrompts"],o)}return e}function cC(n){const e={},s=h(n,["media"]);if(s!=null){let f=ly(s);Array.isArray(f)&&(f=f.map(v=>Fr(v))),p(e,["mediaChunks"],f)}const o=h(n,["audio"]);o!=null&&p(e,["audio"],Fr(uy(o)));const a=h(n,["audioStreamEnd"]);a!=null&&p(e,["audioStreamEnd"],a);const c=h(n,["video"]);c!=null&&p(e,["video"],Fr(cy(c)));const d=h(n,["text"]);d!=null&&p(e,["text"],d);const m=h(n,["activityStart"]);m!=null&&p(e,["activityStart"],m);const y=h(n,["activityEnd"]);return y!=null&&p(e,["activityEnd"],y),e}function uC(n){const e={},s=h(n,["media"]);if(s!=null){let f=ly(s);Array.isArray(f)&&(f=f.map(v=>v)),p(e,["mediaChunks"],f)}const o=h(n,["audio"]);o!=null&&p(e,["audio"],uy(o));const a=h(n,["audioStreamEnd"]);a!=null&&p(e,["audioStreamEnd"],a);const c=h(n,["video"]);c!=null&&p(e,["video"],cy(c));const d=h(n,["text"]);d!=null&&p(e,["text"],d);const m=h(n,["activityStart"]);m!=null&&p(e,["activityStart"],m);const y=h(n,["activityEnd"]);return y!=null&&p(e,["activityEnd"],y),e}function dC(n){const e={},s=h(n,["setupComplete"]);s!=null&&p(e,["setupComplete"],s);const o=h(n,["serverContent"]);o!=null&&p(e,["serverContent"],o);const a=h(n,["toolCall"]);a!=null&&p(e,["toolCall"],a);const c=h(n,["toolCallCancellation"]);c!=null&&p(e,["toolCallCancellation"],c);const d=h(n,["usageMetadata"]);d!=null&&p(e,["usageMetadata"],gC(d));const m=h(n,["goAway"]);m!=null&&p(e,["goAway"],m);const y=h(n,["sessionResumptionUpdate"]);y!=null&&p(e,["sessionResumptionUpdate"],y);const f=h(n,["voiceActivityDetectionSignal"]);return f!=null&&p(e,["voiceActivityDetectionSignal"],f),e}function hC(n){const e={},s=h(n,["mediaResolution"]);s!=null&&p(e,["mediaResolution"],s);const o=h(n,["codeExecutionResult"]);o!=null&&p(e,["codeExecutionResult"],o);const a=h(n,["executableCode"]);a!=null&&p(e,["executableCode"],a);const c=h(n,["fileData"]);c!=null&&p(e,["fileData"],WT(c));const d=h(n,["functionCall"]);d!=null&&p(e,["functionCall"],XT(d));const m=h(n,["functionResponse"]);m!=null&&p(e,["functionResponse"],m);const y=h(n,["inlineData"]);y!=null&&p(e,["inlineData"],Fr(y));const f=h(n,["text"]);f!=null&&p(e,["text"],f);const v=h(n,["thought"]);v!=null&&p(e,["thought"],v);const b=h(n,["thoughtSignature"]);b!=null&&p(e,["thoughtSignature"],b);const w=h(n,["videoMetadata"]);return w!=null&&p(e,["videoMetadata"],w),e}function fC(n){const e={},s=h(n,["handle"]);if(s!=null&&p(e,["handle"],s),h(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function mC(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let v=s;Array.isArray(v)&&(v=v.map(b=>b)),p(e,["functionDeclarations"],v)}if(h(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=h(n,["googleSearchRetrieval"]);o!=null&&p(e,["googleSearchRetrieval"],o);const a=h(n,["computerUse"]);a!=null&&p(e,["computerUse"],a);const c=h(n,["fileSearch"]);c!=null&&p(e,["fileSearch"],c);const d=h(n,["codeExecution"]);if(d!=null&&p(e,["codeExecution"],d),h(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const m=h(n,["googleMaps"]);m!=null&&p(e,["googleMaps"],tC(m));const y=h(n,["googleSearch"]);y!=null&&p(e,["googleSearch"],nC(y));const f=h(n,["urlContext"]);
117return f!=null&&p(e,["urlContext"],f),e}function pC(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let b=s;Array.isArray(b)&&(b=b.map(w=>ZT(w))),p(e,["functionDeclarations"],b)}const o=h(n,["retrieval"]);o!=null&&p(e,["retrieval"],o);const a=h(n,["googleSearchRetrieval"]);a!=null&&p(e,["googleSearchRetrieval"],a);const c=h(n,["computerUse"]);if(c!=null&&p(e,["computerUse"],c),h(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const d=h(n,["codeExecution"]);d!=null&&p(e,["codeExecution"],d);const m=h(n,["enterpriseWebSearch"]);m!=null&&p(e,["enterpriseWebSearch"],m);const y=h(n,["googleMaps"]);y!=null&&p(e,["googleMaps"],y);const f=h(n,["googleSearch"]);f!=null&&p(e,["googleSearch"],f);const v=h(n,["urlContext"]);return v!=null&&p(e,["urlContext"],v),e}function gC(n){const e={},s=h(n,["promptTokenCount"]);s!=null&&p(e,["promptTokenCount"],s);const o=h(n,["cachedContentTokenCount"]);o!=null&&p(e,["cachedContentTokenCount"],o);const a=h(n,["candidatesTokenCount"]);a!=null&&p(e,["responseTokenCount"],a);const c=h(n,["toolUsePromptTokenCount"]);c!=null&&p(e,["toolUsePromptTokenCount"],c);const d=h(n,["thoughtsTokenCount"]);d!=null&&p(e,["thoughtsTokenCount"],d);const m=h(n,["totalTokenCount"]);m!=null&&p(e,["totalTokenCount"],m);const y=h(n,["promptTokensDetails"]);if(y!=null){let _=y;Array.isArray(_)&&(_=_.map(C=>C)),p(e,["promptTokensDetails"],_)}const f=h(n,["cacheTokensDetails"]);if(f!=null){let _=f;Array.isArray(_)&&(_=_.map(C=>C)),p(e,["cacheTokensDetails"],_)}
117const v=h(n,["candidatesTokensDetails"]);if(v!=null){let _=v;Array.isArray(_)&&(_=_.map(C=>C)),p(e,["responseTokensDetails"],_)}const b=h(n,["toolUsePromptTokensDetails"]);if(b!=null){let _=b;Array.isArray(_)&&(_=_.map(C=>C)),p(e,["toolUsePromptTokensDetails"],_)}const w=h(n,["trafficType"]);return w!=null&&p(e,["trafficType"],w),e}/** 118 * @license 119 * Copyright 2025 Google LLC 120 * SPDX-License-Identifier: Apache-2.0 121 */function yC(n){const e={},s=h(n,["data"]);if(s!=null&&p(e,["data"],s),h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function vC(n){const e={},s=h(n,["content"]);s!=null&&p(e,["content"],s);const o=h(n,["citationMetadata"]);o!=null&&p(e,["citationMetadata"],xC(o));const a=h(n,["tokenCount"]);a!=null&&p(e,["tokenCount"],a);const c=h(n,["finishReason"]);c!=null&&p(e,["finishReason"],c);const d=h(n,["avgLogprobs"]);d!=null&&p(e,["avgLogprobs"],d);const m=h(n,["groundingMetadata"]);m!=null&&p(e,["groundingMetadata"],m);const y=h(n,["index"]);y!=null&&p(e,["index"],y);const f=h(n,["logprobsResult"]);f!=null&&p(e,["logprobsResult"],f);const v=h(n,["safetyRatings"]);if(v!=null){let w=v;Array.isArray(w)&&(w=w.map(_=>_)),p(e,["safetyRatings"],w)}const b=h(n,["urlContextMetadata"]);return b!=null&&p(e,["urlContextMetadata"],b),e}function xC(n){const e={},s=h(n,["citationSources"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>a)),p(e,["citations"],o)}return e}function bC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let c=cn(a);Array.isArray(c)&&(c=c.map(d=>d)),p(s,["contents"],c)}return s}function wC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["tokensInfo"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>c)),p(e,["tokensInfo"],a)}return e}function SC(n){const e={},s=h(n,["values"]);s!=null&&p(e,["values"],s);const o=h(n,["statistics"]);return o!=null&&p(e,["statistics"],_C(o)),e}function _C(n){const e={},s=h(n,["truncated"]);s!=null&&p(e,["truncated"],s);const o=h(n,["token_count"]);return o!=null&&p(e,["tokenCount"],o),e}function tl(n){const e={},s=h(n,["parts"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>IE(c))),p(e,["parts"],a)}const o=h(n,["role"]);return o!=null&&p(e,["role"],o),e}function TC(n){const e={},s=h(n,["controlType"]);s!=null&&p(e,["controlType"],s);const o=h(n,["enableControlImageComputation"]);return o!=null&&p(e,["computeControl"],o),e}function CC(n){const e={};if(h(n,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(h(n,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(h(n,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return e}function EC(n,e){const s={},o=h(n,["systemInstruction"]);e!==void 0&&o!=null&&p(e,["systemInstruction"],wt(o));const a=h(n,["tools"]);if(e!==void 0&&a!=null){let d=a;Array.isArray(d)&&(d=d.map(m=>Ty(m))),p(e,["tools"],d)}const c=h(n,["generationConfig"]);return e!==void 0&&c!=null&&p(e,["generationConfig"],yE(c)),s}function NC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let d=cn(a);Array.isArray(d)&&(d=d.map(m=>tl(m))),p(s,["contents"],d)}const c=h(e,["config"]);return c!=null&&CC(c),s}function AC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let d=cn(a);Array.isArray(d)&&(d=d.map(m=>m)),p(s,["contents"],d)}const c=h(e,["config"]);return c!=null&&EC(c,s),s}function RC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["totalTokens"]);o!=null&&p(e,["totalTokens"],o);const a=h(n,["cachedContentTokenCount"]);return a!=null&&p(e,["cachedContentTokenCount"],a),e}function kC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["totalTokens"]);return o!=null&&p(e,["totalTokens"],o),e}function jC(n,e){const s={},o=h(e,["model"]);return o!=null&&p(s,["_url","name"],Pe(n,o)),s}function IC(n,e){const s={},o=h(e,["model"]);return o!=null&&p(s,["_url","name"],Pe(n,o)),s}function MC(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function DC(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}function UC(n,e){const s={},o=h(n,["outputGcsUri"]);e!==void 0&&o!=null&&p(e,["parameters","storageUri"],o);const a=h(n,["negativePrompt"]);e!==void 0&&a!=null&&p(e,["parameters","negativePrompt"],a);const c=h(n,["numberOfImages"]);
121e!==void 0&&c!=null&&p(e,["parameters","sampleCount"],c);const d=h(n,["aspectRatio"]);e!==void 0&&d!=null&&p(e,["parameters","aspectRatio"],d);const m=h(n,["guidanceScale"]);e!==void 0&&m!=null&&p(e,["parameters","guidanceScale"],m);const y=h(n,["seed"]);e!==void 0&&y!=null&&p(e,["parameters","seed"],y);const f=h(n,["safetyFilterLevel"]);e!==void 0&&f!=null&&p(e,["parameters","safetySetting"],f);const v=h(n,["personGeneration"]);e!==void 0&&v!=null&&p(e,["parameters","personGeneration"],v);const b=h(n,["includeSafetyAttributes"]);e!==void 0&&b!=null&&p(e,["parameters","includeSafetyAttributes"],b);const w=h(n,["includeRaiReason"]);e!==void 0&&w!=null&&p(e,["parameters","includeRaiReason"],w);const _=h(n,["language"]);e!==void 0&&_!=null&&p(e,["parameters","language"],_);const C=h(n,["outputMimeType"]);e!==void 0&&C!=null&&p(e,["parameters","outputOptions","mimeType"],C);const A=h(n,["outputCompressionQuality"]);e!==void 0&&A!=null&&p(e,["parameters","outputOptions","compressionQuality"],A);const E=h(n,["addWatermark"]);e!==void 0&&E!=null&&p(e,["parameters","addWatermark"],E);const I=h(n,["labels"]);e!==void 0&&I!=null&&p(e,["labels"],I);const U=h(n,["editMode"]);e!==void 0&&U!=null&&p(e,["parameters","editMode"],U);const G=h(n,["baseSteps"]);return e!==void 0&&G!=null&&p(e,["parameters","editConfig","baseSteps"],G),s}function LC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["prompt"]);a!=null&&p(s,["instances[0]","prompt"],a);const c=h(e,["referenceImages"]);if(c!=null){let m=c;Array.isArray(m)&&(m=m.map(y=>OE(y))),p(s,["instances[0]","referenceImages"],m)}const d=h(e,["config"]);return d!=null&&UC(d,s),s}function PC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["predictions"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>nl(c))),p(e,["generatedImages"],a)}return e}function OC(n,e){const s={},o=h(n,["taskType"]);e!==void 0&&o!=null&&p(e,["requests[]","taskType"],o);const a=h(n,["title"]);e!==void 0&&a!=null&&p(e,["requests[]","title"],a);const c=h(n,["outputDimensionality"]);if(e!==void 0&&c!=null&&p(e,["requests[]","outputDimensionality"],c),h(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(h(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return s}function GC(n,e){const s={},o=h(n,["taskType"]);e!==void 0&&o!=null&&p(e,["instances[]","task_type"],o);const a=h(n,["title"]);e!==void 0&&a!=null&&p(e,["instances[]","title"],a);const c=h(n,["outputDimensionality"]);e!==void 0&&c!=null&&p(e,["parameters","outputDimensionality"],c);const d=h(n,["mimeType"]);e!==void 0&&d!=null&&p(e,["instances[]","mimeType"],d);const m=h(n,["autoTruncate"]);return e!==void 0&&m!=null&&p(e,["parameters","autoTruncate"],m),s}function qC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let m=pd(n,a);Array.isArray(m)&&(m=m.map(y=>y)),p(s,["requests[]","content"],m)}const c=h(e,["config"]);c!=null&&OC(c,s);const d=h(e,["model"]);return d!==void 0&&p(s,["requests[]","model"],Pe(n,d)),s}function BC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let d=pd(n,a);Array.isArray(d)&&(d=d.map(m=>m)),p(s,["instances[]","content"],d)}const c=h(e,["config"]);return c!=null&&GC(c,s),s}function HC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["embeddings"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["embeddings"],c)}const a=h(n,["metadata"]);return a!=null&&p(e,["metadata"],a),e}function zC(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["predictions[]","embeddings"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>SC(d))),p(e,["embeddings"],c)}const a=h(n,["metadata"]);return a!=null&&p(e,["metadata"],a),e}function VC(n){const e={},s=h(n,["endpoint"]);s!=null&&p(e,["name"],s);const o=h(n,["deployedModelId"]);return o!=null&&p(e,["deployedModelId"],o),e}function FC(n){const e={};if(h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=h(n,["fileUri"]);s!=null&&p(e,["fileUri"],s);const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function $C(n){const e={},s=h(n,["id"]);s!=null&&p(e,["id"],s);const o=h(n,["args"]);o!=null&&p(e,["args"],o);const a=h(n,["name"]);if(a!=null&&p(e,["name"],a),h(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(h(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function YC(n){const e={},s=h(n,["mode"]);s!=null&&p(e,["mode"],s);const o=h(n,["allowedFunctionNames"]);if(o!=null&&p(e,["allowedFunctionNames"],o),h(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function JC(n){const e={};if(h(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const s=h(n,["description"]);s!=null&&p(e,["description"],s);const o=h(n,["name"]);o!=null&&p(e,["name"],o);const a=h(n,["parameters"]);a!=null&&p(e,["parameters"],a);const c=h(n,["parametersJsonSchema"]);c!=null&&p(e,["parametersJsonSchema"],c);const d=h(n,["response"]);d!=null&&p(e,["response"],d);const m=h(n,["responseJsonSchema"]);return m!=null&&p(e,["responseJsonSchema"],m),e}
121function KC(n,e,s){const o={},a=h(e,["systemInstruction"]);s!==void 0&&a!=null&&p(s,["systemInstruction"],tl(wt(a)));const c=h(e,["temperature"]);c!=null&&p(o,["temperature"],c);const d=h(e,["topP"]);d!=null&&p(o,["topP"],d);const m=h(e,["topK"]);m!=null&&p(o,["topK"],m);const y=h(e,["candidateCount"]);y!=null&&p(o,["candidateCount"],y);const f=h(e,["maxOutputTokens"]);f!=null&&p(o,["maxOutputTokens"],f);const v=h(e,["stopSequences"]);v!=null&&p(o,["stopSequences"],v);const b=h(e,["responseLogprobs"]);b!=null&&p(o,["responseLogprobs"],b);const w=h(e,["logprobs"]);w!=null&&p(o,["logprobs"],w);const _=h(e,["presencePenalty"]);_!=null&&p(o,["presencePenalty"],_);const C=h(e,["frequencyPenalty"]);C!=null&&p(o,["frequencyPenalty"],C);const A=h(e,["seed"]);A!=null&&p(o,["seed"],A);const E=h(e,["responseMimeType"]);E!=null&&p(o,["responseMimeType"],E);const I=h(e,["responseSchema"]);I!=null&&p(o,["responseSchema"],gd(I));const U=h(e,["responseJsonSchema"]);if(U!=null&&p(o,["responseJsonSchema"],U),h(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(h(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const G=h(e,["safetySettings"]);if(s!==void 0&&G!=null){let se=G;Array.isArray(se)&&(se=se.map(fe=>GE(fe))),p(s,["safetySettings"],se)}const F=h(e,["tools"]);if(s!==void 0&&F!=null){let se=co(F);Array.isArray(se)&&(se=se.map(fe=>$E(lo(fe)))),p(s,["tools"],se)}const P=h(e,["toolConfig"]);if(s!==void 0&&P!=null&&p(s,["toolConfig"],FE(P)),h(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const $=h(e,["cachedContent"]);s!==void 0&&$!=null&&p(s,["cachedContent"],Qn(n,$));const H=h(e,["responseModalities"]);H!=null&&p(o,["responseModalities"],H);const Z=h(e,["mediaResolution"]);Z!=null&&p(o,["mediaResolution"],Z);const X=h(e,["speechConfig"]);if(X!=null&&p(o,["speechConfig"],yd(X)),h(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const q=h(e,["thinkingConfig"]);q!=null&&p(o,["thinkingConfig"],q);const Q=h(e,["imageConfig"]);Q!=null&&p(o,["imageConfig"],SE(Q));const ne=h(e,["enableEnhancedCivicAnswers"]);return ne!=null&&p(o,["enableEnhancedCivicAnswers"],ne),o}function QC(n,e,s){const o={},a=h(e,["systemInstruction"]);s!==void 0&&a!=null&&p(s,["systemInstruction"],wt(a));const c=h(e,["temperature"]);c!=null&&p(o,["temperature"],c);const d=h(e,["topP"]);d!=null&&p(o,["topP"],d);const m=h(e,["topK"]);m!=null&&p(o,["topK"],m);const y=h(e,["candidateCount"]);y!=null&&p(o,["candidateCount"],y);const f=h(e,["maxOutputTokens"]);f!=null&&p(o,["maxOutputTokens"],f);const v=h(e,["stopSequences"]);v!=null&&p(o,["stopSequences"],v);const b=h(e,["responseLogprobs"]);b!=null&&p(o,["responseLogprobs"],b);const w=h(e,["logprobs"]);w!=null&&p(o,["logprobs"],w);const _=h(e,["presencePenalty"]);_!=null&&p(o,["presencePenalty"],_);const C=h(e,["frequencyPenalty"]);C!=null&&p(o,["frequencyPenalty"],C);const A=h(e,["seed"]);A!=null&&p(o,["seed"],A);const E=h(e,["responseMimeType"]);E!=null&&p(o,["responseMimeType"],E);const I=h(e,["responseSchema"]);I!=null&&p(o,["responseSchema"],gd(I));const U=h(e,["responseJsonSchema"]);U!=null&&p(o,["responseJsonSchema"],U);const G=h(e,["routingConfig"]);G!=null&&p(o,["routingConfig"],G);const F=h(e,["modelSelectionConfig"]);F!=null&&p(o,["modelConfig"],F);const P=h(e,["safetySettings"]);if(s!==void 0&&P!=null){let z=P;Array.isArray(z)&&(z=z.map(te=>te)),p(s,["safetySettings"],z)}const $=h(e,["tools"]);if(s!==void 0&&$!=null){let z=co($);Array.isArray(z)&&(z=z.map(te=>Ty(lo(te)))),p(s,["tools"],z)}const H=h(e,["toolConfig"]);s!==void 0&&H!=null&&p(s,["toolConfig"],H);const Z=h(e,["labels"]);s!==void 0&&Z!=null&&p(s,["labels"],Z);const X=h(e,["cachedContent"]);s!==void 0&&X!=null&&p(s,["cachedContent"],Qn(n,X));const q=h(e,["responseModalities"]);q!=null&&p(o,["responseModalities"],q);const Q=h(e,["mediaResolution"]);Q!=null&&p(o,["mediaResolution"],Q);const ne=h(e,["speechConfig"]);ne!=null&&p(o,["speechConfig"],yd(ne));const se=h(e,["audioTimestamp"]);se!=null&&p(o,["audioTimestamp"],se);const fe=h(e,["thinkingConfig"]);fe!=null&&p(o,["thinkingConfig"],fe);const ge=h(e,["imageConfig"]);if(ge!=null&&p(o,["imageConfig"],_E(ge)),h(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return o}function b0(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let d=cn(a);Array.isArray(d)&&(d=d.map(m=>tl(m))),p(s,["contents"],d)}const c=h(e,["config"]);return c!=null&&p(s,["generationConfig"],KC(n,c,s)),s}function w0(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["contents"]);if(a!=null){let d=cn(a);Array.isArray(d)&&(d=d.map(m=>m)),p(s,["contents"],d)}const c=h(e,["config"]);return c!=null&&p(s,["generationConfig"],QC(n,c,s)),s}function S0(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["candidates"]);if(o!=null){let y=o;Array.isArray(y)&&(y=y.map(f=>vC(f))),p(e,["candidates"],y)}const a=h(n,["modelVersion"]);a!=null&&p(e,["modelVersion"],a);const c=h(n,["promptFeedback"]);c!=null&&p(e,["promptFeedback"],c);const d=h(n,["responseId"]);d!=null&&p(e,["responseId"],d);const m=h(n,["usageMetadata"]);return m!=null&&p(e,["usageMetadata"],m),e}function _0(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["candidates"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(v=>v)),p(e,["candidates"],f)}const a=h(n,["createTime"]);a!=null&&p(e,["createTime"],a);const c=h(n,["modelVersion"]);c!=null&&p(e,["modelVersion"],c);const d=h(n,["promptFeedback"]);d!=null&&p(e,["promptFeedback"],d);const m=h(n,["responseId"]);m!=null&&p(e,["responseId"],m);const y=h(n,["usageMetadata"]);return y!=null&&p(e,["usageMetadata"],y),e}function WC(n,e){const s={};if(h(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(h(n,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const o=h(n,["numberOfImages"]);
121e!==void 0&&o!=null&&p(e,["parameters","sampleCount"],o);const a=h(n,["aspectRatio"]);e!==void 0&&a!=null&&p(e,["parameters","aspectRatio"],a);const c=h(n,["guidanceScale"]);if(e!==void 0&&c!=null&&p(e,["parameters","guidanceScale"],c),h(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const d=h(n,["safetyFilterLevel"]);e!==void 0&&d!=null&&p(e,["parameters","safetySetting"],d);const m=h(n,["personGeneration"]);e!==void 0&&m!=null&&p(e,["parameters","personGeneration"],m);const y=h(n,["includeSafetyAttributes"]);e!==void 0&&y!=null&&p(e,["parameters","includeSafetyAttributes"],y);const f=h(n,["includeRaiReason"]);e!==void 0&&f!=null&&p(e,["parameters","includeRaiReason"],f);const v=h(n,["language"]);e!==void 0&&v!=null&&p(e,["parameters","language"],v);const b=h(n,["outputMimeType"]);e!==void 0&&b!=null&&p(e,["parameters","outputOptions","mimeType"],b);const w=h(n,["outputCompressionQuality"]);if(e!==void 0&&w!=null&&p(e,["parameters","outputOptions","compressionQuality"],w),h(n,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(h(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const _=h(n,["imageSize"]);if(e!==void 0&&_!=null&&p(e,["parameters","sampleImageSize"],_),h(n,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return s}function XC(n,e){const s={},o=h(n,["outputGcsUri"]);e!==void 0&&o!=null&&p(e,["parameters","storageUri"],o);const a=h(n,["negativePrompt"]);e!==void 0&&a!=null&&p(e,["parameters","negativePrompt"],a);const c=h(n,["numberOfImages"]);e!==void 0&&c!=null&&p(e,["parameters","sampleCount"],c);const d=h(n,["aspectRatio"]);e!==void 0&&d!=null&&p(e,["parameters","aspectRatio"],d);const m=h(n,["guidanceScale"]);e!==void 0&&m!=null&&p(e,["parameters","guidanceScale"],m);const y=h(n,["seed"]);e!==void 0&&y!=null&&p(e,["parameters","seed"],y);const f=h(n,["safetyFilterLevel"]);e!==void 0&&f!=null&&p(e,["parameters","safetySetting"],f);const v=h(n,["personGeneration"]);e!==void 0&&v!=null&&p(e,["parameters","personGeneration"],v);const b=h(n,["includeSafetyAttributes"]);e!==void 0&&b!=null&&p(e,["parameters","includeSafetyAttributes"],b);const w=h(n,["includeRaiReason"]);e!==void 0&&w!=null&&p(e,["parameters","includeRaiReason"],w);const _=h(n,["language"]);e!==void 0&&_!=null&&p(e,["parameters","language"],_);const C=h(n,["outputMimeType"]);e!==void 0&&C!=null&&p(e,["parameters","outputOptions","mimeType"],C);const A=h(n,["outputCompressionQuality"]);e!==void 0&&A!=null&&p(e,["parameters","outputOptions","compressionQuality"],A);const E=h(n,["addWatermark"]);e!==void 0&&E!=null&&p(e,["parameters","addWatermark"],E);const I=h(n,["labels"]);e!==void 0&&I!=null&&p(e,["labels"],I);const U=h(n,["imageSize"]);e!==void 0&&U!=null&&p(e,["parameters","sampleImageSize"],U);const G=h(n,["enhancePrompt"]);return e!==void 0&&G!=null&&p(e,["parameters","enhancePrompt"],G),s}function ZC(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["prompt"]);a!=null&&p(s,["instances[0]","prompt"],a);const c=h(e,["config"]);return c!=null&&WC(c,s),s}function eE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["prompt"]);a!=null&&p(s,["instances[0]","prompt"],a);const c=h(e,["config"]);return c!=null&&XC(c,s),s}function tE(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["predictions"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>fE(d))),p(e,["generatedImages"],c)}const a=h(n,["positivePromptSafetyAttributes"]);return a!=null&&p(e,["positivePromptSafetyAttributes"],Sy(a)),e}function nE(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["predictions"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>nl(d))),p(e,["generatedImages"],c)}const a=h(n,["positivePromptSafetyAttributes"]);return a!=null&&p(e,["positivePromptSafetyAttributes"],_y(a)),e}function sE(n,e){const s={},o=h(n,["numberOfVideos"]);
121if(e!==void 0&&o!=null&&p(e,["parameters","sampleCount"],o),h(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(h(n,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const a=h(n,["durationSeconds"]);if(e!==void 0&&a!=null&&p(e,["parameters","durationSeconds"],a),h(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const c=h(n,["aspectRatio"]);e!==void 0&&c!=null&&p(e,["parameters","aspectRatio"],c);const d=h(n,["resolution"]);e!==void 0&&d!=null&&p(e,["parameters","resolution"],d);const m=h(n,["personGeneration"]);if(e!==void 0&&m!=null&&p(e,["parameters","personGeneration"],m),h(n,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const y=h(n,["negativePrompt"]);e!==void 0&&y!=null&&p(e,["parameters","negativePrompt"],y);const f=h(n,["enhancePrompt"]);if(e!==void 0&&f!=null&&p(e,["parameters","enhancePrompt"],f),h(n,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const v=h(n,["lastFrame"]);e!==void 0&&v!=null&&p(e,["instances[0]","lastFrame"],sl(v));const b=h(n,["referenceImages"]);if(e!==void 0&&b!=null){let w=b;Array.isArray(w)&&(w=w.map(_=>oN(_))),p(e,["instances[0]","referenceImages"],w)}if(h(n,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(h(n,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return s}function iE(n,e){const s={},o=h(n,["numberOfVideos"]);e!==void 0&&o!=null&&p(e,["parameters","sampleCount"],o);const a=h(n,["outputGcsUri"]);e!==void 0&&a!=null&&p(e,["parameters","storageUri"],a);const c=h(n,["fps"]);e!==void 0&&c!=null&&p(e,["parameters","fps"],c);const d=h(n,["durationSeconds"]);e!==void 0&&d!=null&&p(e,["parameters","durationSeconds"],d);const m=h(n,["seed"]);e!==void 0&&m!=null&&p(e,["parameters","seed"],m);const y=h(n,["aspectRatio"]);e!==void 0&&y!=null&&p(e,["parameters","aspectRatio"],y);const f=h(n,["resolution"]);e!==void 0&&f!=null&&p(e,["parameters","resolution"],f);const v=h(n,["personGeneration"]);e!==void 0&&v!=null&&p(e,["parameters","personGeneration"],v);const b=h(n,["pubsubTopic"]);e!==void 0&&b!=null&&p(e,["parameters","pubsubTopic"],b);const w=h(n,["negativePrompt"]);e!==void 0&&w!=null&&p(e,["parameters","negativePrompt"],w);const _=h(n,["enhancePrompt"]);e!==void 0&&_!=null&&p(e,["parameters","enhancePrompt"],_);const C=h(n,["generateAudio"]);e!==void 0&&C!=null&&p(e,["parameters","generateAudio"],C);const A=h(n,["lastFrame"]);e!==void 0&&A!=null&&p(e,["instances[0]","lastFrame"],wn(A));const E=h(n,["referenceImages"]);if(e!==void 0&&E!=null){let G=E;Array.isArray(G)&&(G=G.map(F=>aN(F))),p(e,["instances[0]","referenceImages"],G)}const I=h(n,["mask"]);e!==void 0&&I!=null&&p(e,["instances[0]","mask"],iN(I));const U=h(n,["compressionQuality"]);return e!==void 0&&U!=null&&p(e,["parameters","compressionQuality"],U),s}function oE(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response","generateVideoResponse"]);return d!=null&&p(e,["response"],cE(d)),e}function aE(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response"]);return d!=null&&p(e,["response"],uE(d)),e}function rE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["prompt"]);a!=null&&p(s,["instances[0]","prompt"],a);const c=h(e,["image"]);c!=null&&p(s,["instances[0]","image"],sl(c));const d=h(e,["video"]);d!=null&&p(s,["instances[0]","video"],Cy(d));const m=h(e,["source"]);m!=null&&dE(m,s);const y=h(e,["config"]);return y!=null&&sE(y,s),s}function lE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["prompt"]);a!=null&&p(s,["instances[0]","prompt"],a);const c=h(e,["image"]);c!=null&&p(s,["instances[0]","image"],wn(c));const d=h(e,["video"]);d!=null&&p(s,["instances[0]","video"],Ey(d));const m=h(e,["source"]);m!=null&&hE(m,s);const y=h(e,["config"]);return y!=null&&iE(y,s),s}function cE(n){const e={},s=h(n,["generatedSamples"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>pE(d))),p(e,["generatedVideos"],c)}const o=h(n,["raiMediaFilteredCount"]);o!=null&&p(e,["raiMediaFilteredCount"],o);const a=h(n,["raiMediaFilteredReasons"]);return a!=null&&p(e,["raiMediaFilteredReasons"],a),e}function uE(n){const e={},s=h(n,["videos"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>gE(d))),p(e,["generatedVideos"],c)}const o=h(n,["raiMediaFilteredCount"]);o!=null&&p(e,["raiMediaFilteredCount"],o);const a=h(n,["raiMediaFilteredReasons"]);return a!=null&&p(e,["raiMediaFilteredReasons"],a),e}function dE(n,e){const s={},o=h(n,["prompt"]);e!==void 0&&o!=null&&p(e,["instances[0]","prompt"],o);const a=h(n,["image"]);e!==void 0&&a!=null&&p(e,["instances[0]","image"],sl(a));const c=h(n,["video"]);return e!==void 0&&c!=null&&p(e,["instances[0]","video"],Cy(c)),s}function hE(n,e){const s={},o=h(n,["prompt"]);e!==void 0&&o!=null&&p(e,["instances[0]","prompt"],o);const a=h(n,["image"]);e!==void 0&&a!=null&&p(e,["instances[0]","image"],wn(a));const c=h(n,["video"]);return e!==void 0&&c!=null&&p(e,["instances[0]","video"],Ey(c)),s}function fE(n){const e={},s=h(n,["_self"]);s!=null&&p(e,["image"],TE(s));const o=h(n,["raiFilteredReason"]);o!=null&&p(e,["raiFilteredReason"],o);const a=h(n,["_self"]);return a!=null&&p(e,["safetyAttributes"],Sy(a)),e}function nl(n){const e={},s=h(n,["_self"]);s!=null&&p(e,["image"],wy(s));const o=h(n,["raiFilteredReason"]);o!=null&&p(e,["raiFilteredReason"],o);const a=h(n,["_self"]);a!=null&&p(e,["safetyAttributes"],_y(a));const c=h(n,["prompt"]);return c!=null&&p(e,["enhancedPrompt"],c),e}function mE(n){const e={},s=h(n,["_self"]);s!=null&&p(e,["mask"],wy(s));const o=h(n,["labels"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>c)),p(e,["labels"],a)}return e}function pE(n){const e={},s=h(n,["video"]);return s!=null&&p(e,["video"],nN(s)),e}function gE(n){const e={},s=h(n,["_self"]);return s!=null&&p(e,["video"],sN(s)),e}function yE(n){const e={},s=h(n,["modelSelectionConfig"]);s!=null&&p(e,["modelConfig"],s);const o=h(n,["responseJsonSchema"]);o!=null&&p(e,["responseJsonSchema"],o);const a=h(n,["audioTimestamp"]);a!=null&&p(e,["audioTimestamp"],a);const c=h(n,["candidateCount"]);c!=null&&p(e,["candidateCount"],c);const d=h(n,["enableAffectiveDialog"]);d!=null&&p(e,["enableAffectiveDialog"],d);const m=h(n,["frequencyPenalty"]);m!=null&&p(e,["frequencyPenalty"],m);const y=h(n,["logprobs"]);y!=null&&p(e,["logprobs"],y);const f=h(n,["maxOutputTokens"]);f!=null&&p(e,["maxOutputTokens"],f);const v=h(n,["mediaResolution"]);v!=null&&p(e,["mediaResolution"],v);const b=h(n,["presencePenalty"]);b!=null&&p(e,["presencePenalty"],b);const w=h(n,["responseLogprobs"]);w!=null&&p(e,["responseLogprobs"],w);const _=h(n,["responseMimeType"]);_!=null&&p(e,["responseMimeType"],_);const C=h(n,["responseModalities"]);C!=null&&p(e,["responseModalities"],C);const A=h(n,["responseSchema"]);A!=null&&p(e,["responseSchema"],A);
121const E=h(n,["routingConfig"]);E!=null&&p(e,["routingConfig"],E);const I=h(n,["seed"]);I!=null&&p(e,["seed"],I);const U=h(n,["speechConfig"]);U!=null&&p(e,["speechConfig"],U);const G=h(n,["stopSequences"]);G!=null&&p(e,["stopSequences"],G);const F=h(n,["temperature"]);F!=null&&p(e,["temperature"],F);const P=h(n,["thinkingConfig"]);P!=null&&p(e,["thinkingConfig"],P);const $=h(n,["topK"]);$!=null&&p(e,["topK"],$);const H=h(n,["topP"]);if(H!=null&&p(e,["topP"],H),h(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return e}function vE(n,e){const s={},o=h(e,["model"]);return o!=null&&p(s,["_url","name"],Pe(n,o)),s}function xE(n,e){const s={},o=h(e,["model"]);return o!=null&&p(s,["_url","name"],Pe(n,o)),s}function bE(n){const e={};if(h(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const s=h(n,["enableWidget"]);return s!=null&&p(e,["enableWidget"],s),e}function wE(n){const e={};if(h(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(h(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const s=h(n,["timeRangeFilter"]);return s!=null&&p(e,["timeRangeFilter"],s),e}function SE(n){const e={},s=h(n,["aspectRatio"]);s!=null&&p(e,["aspectRatio"],s);const o=h(n,["imageSize"]);if(o!=null&&p(e,["imageSize"],o),h(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(h(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return e}function _E(n){const e={},s=h(n,["aspectRatio"]);s!=null&&p(e,["aspectRatio"],s);const o=h(n,["imageSize"]);o!=null&&p(e,["imageSize"],o);const a=h(n,["outputMimeType"]);a!=null&&p(e,["imageOutputOptions","mimeType"],a);const c=h(n,["outputCompressionQuality"]);return c!=null&&p(e,["imageOutputOptions","compressionQuality"],c),e}function TE(n){const e={},s=h(n,["bytesBase64Encoded"]);s!=null&&p(e,["imageBytes"],ks(s));const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function wy(n){const e={},s=h(n,["gcsUri"]);s!=null&&p(e,["gcsUri"],s);const o=h(n,["bytesBase64Encoded"]);o!=null&&p(e,["imageBytes"],ks(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["mimeType"],a),e}function sl(n){const e={};if(h(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const s=h(n,["imageBytes"]);s!=null&&p(e,["bytesBase64Encoded"],ks(s));const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function wn(n){const e={},s=h(n,["gcsUri"]);s!=null&&p(e,["gcsUri"],s);const o=h(n,["imageBytes"]);o!=null&&p(e,["bytesBase64Encoded"],ks(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["mimeType"],a),e}function CE(n,e,s){const o={},a=h(e,["pageSize"]);s!==void 0&&a!=null&&p(s,["_query","pageSize"],a);const c=h(e,["pageToken"]);s!==void 0&&c!=null&&p(s,["_query","pageToken"],c);const d=h(e,["filter"]);s!==void 0&&d!=null&&p(s,["_query","filter"],d);const m=h(e,["queryBase"]);return s!==void 0&&m!=null&&p(s,["_url","models_url"],my(n,m)),o}function EE(n,e,s){const o={},a=h(e,["pageSize"]);s!==void 0&&a!=null&&p(s,["_query","pageSize"],a);const c=h(e,["pageToken"]);s!==void 0&&c!=null&&p(s,["_query","pageToken"],c);const d=h(e,["filter"]);s!==void 0&&d!=null&&p(s,["_query","filter"],d);const m=h(e,["queryBase"]);return s!==void 0&&m!=null&&p(s,["_url","models_url"],my(n,m)),o}function NE(n,e){const s={},o=h(e,["config"]);return o!=null&&CE(n,o,s),s}function AE(n,e){const s={},o=h(e,["config"]);return o!=null&&EE(n,o,s),s}function RE(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["_self"]);if(a!=null){let c=py(a);Array.isArray(c)&&(c=c.map(d=>Qu(d))),p(e,["models"],c)}return e}function kE(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["_self"]);if(a!=null){let c=py(a);Array.isArray(c)&&(c=c.map(d=>Wu(d))),p(e,["models"],c)}return e}function jE(n){const e={},s=h(n,["maskMode"]);s!=null&&p(e,["maskMode"],s);const o=h(n,["segmentationClasses"]);o!=null&&p(e,["maskClasses"],o);const a=h(n,["maskDilation"]);return a!=null&&p(e,["dilation"],a),e}function Qu(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["displayName"]);o!=null&&p(e,["displayName"],o);const a=h(n,["description"]);a!=null&&p(e,["description"],a);const c=h(n,["version"]);c!=null&&p(e,["version"],c);const d=h(n,["_self"]);d!=null&&p(e,["tunedModelInfo"],YE(d));const m=h(n,["inputTokenLimit"]);m!=null&&p(e,["inputTokenLimit"],m);const y=h(n,["outputTokenLimit"]);y!=null&&p(e,["outputTokenLimit"],y);const f=h(n,["supportedGenerationMethods"]);f!=null&&p(e,["supportedActions"],f);const v=h(n,["temperature"]);v!=null&&p(e,["temperature"],v);const b=h(n,["maxTemperature"]);b!=null&&p(e,["maxTemperature"],b);const w=h(n,["topP"]);w!=null&&p(e,["topP"],w);const _=h(n,["topK"]);_!=null&&p(e,["topK"],_);const C=h(n,["thinking"]);
121return C!=null&&p(e,["thinking"],C),e}function Wu(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["displayName"]);o!=null&&p(e,["displayName"],o);const a=h(n,["description"]);a!=null&&p(e,["description"],a);const c=h(n,["versionId"]);c!=null&&p(e,["version"],c);const d=h(n,["deployedModels"]);if(d!=null){let b=d;Array.isArray(b)&&(b=b.map(w=>VC(w))),p(e,["endpoints"],b)}const m=h(n,["labels"]);m!=null&&p(e,["labels"],m);const y=h(n,["_self"]);y!=null&&p(e,["tunedModelInfo"],JE(y));const f=h(n,["defaultCheckpointId"]);f!=null&&p(e,["defaultCheckpointId"],f);const v=h(n,["checkpoints"]);if(v!=null){let b=v;Array.isArray(b)&&(b=b.map(w=>w)),p(e,["checkpoints"],b)}return e}function IE(n){const e={},s=h(n,["mediaResolution"]);s!=null&&p(e,["mediaResolution"],s);const o=h(n,["codeExecutionResult"]);o!=null&&p(e,["codeExecutionResult"],o);const a=h(n,["executableCode"]);a!=null&&p(e,["executableCode"],a);const c=h(n,["fileData"]);c!=null&&p(e,["fileData"],FC(c));const d=h(n,["functionCall"]);d!=null&&p(e,["functionCall"],$C(d));const m=h(n,["functionResponse"]);m!=null&&p(e,["functionResponse"],m);const y=h(n,["inlineData"]);y!=null&&p(e,["inlineData"],yC(y));const f=h(n,["text"]);f!=null&&p(e,["text"],f);const v=h(n,["thought"]);v!=null&&p(e,["thought"],v);const b=h(n,["thoughtSignature"]);b!=null&&p(e,["thoughtSignature"],b);const w=h(n,["videoMetadata"]);return w!=null&&p(e,["videoMetadata"],w),e}function ME(n){const e={},s=h(n,["productImage"]);return s!=null&&p(e,["image"],wn(s)),e}function DE(n,e){const s={},o=h(n,["numberOfImages"]);e!==void 0&&o!=null&&p(e,["parameters","sampleCount"],o);const a=h(n,["baseSteps"]);e!==void 0&&a!=null&&p(e,["parameters","baseSteps"],a);const c=h(n,["outputGcsUri"]);e!==void 0&&c!=null&&p(e,["parameters","storageUri"],c);const d=h(n,["seed"]);e!==void 0&&d!=null&&p(e,["parameters","seed"],d);const m=h(n,["safetyFilterLevel"]);e!==void 0&&m!=null&&p(e,["parameters","safetySetting"],m);const y=h(n,["personGeneration"]);e!==void 0&&y!=null&&p(e,["parameters","personGeneration"],y);const f=h(n,["addWatermark"]);e!==void 0&&f!=null&&p(e,["parameters","addWatermark"],f);const v=h(n,["outputMimeType"]);e!==void 0&&v!=null&&p(e,["parameters","outputOptions","mimeType"],v);const b=h(n,["outputCompressionQuality"]);e!==void 0&&b!=null&&p(e,["parameters","outputOptions","compressionQuality"],b);const w=h(n,["enhancePrompt"]);e!==void 0&&w!=null&&p(e,["parameters","enhancePrompt"],w);const _=h(n,["labels"]);return e!==void 0&&_!=null&&p(e,["labels"],_),s}function UE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["source"]);a!=null&&PE(a,s);const c=h(e,["config"]);return c!=null&&DE(c,s),s}function LE(n){const e={},s=h(n,["predictions"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>nl(a))),p(e,["generatedImages"],o)}return e}function PE(n,e){const s={},o=h(n,["prompt"]);e!==void 0&&o!=null&&p(e,["instances[0]","prompt"],o);const a=h(n,["personImage"]);e!==void 0&&a!=null&&p(e,["instances[0]","personImage","image"],wn(a));const c=h(n,["productImages"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(m=>ME(m))),p(e,["instances[0]","productImages"],d)}return s}function OE(n){const e={},s=h(n,["referenceImage"]);s!=null&&p(e,["referenceImage"],wn(s));const o=h(n,["referenceId"]);o!=null&&p(e,["referenceId"],o);const a=h(n,["referenceType"]);a!=null&&p(e,["referenceType"],a);const c=h(n,["maskImageConfig"]);c!=null&&p(e,["maskImageConfig"],jE(c));const d=h(n,["controlImageConfig"]);d!=null&&p(e,["controlImageConfig"],TC(d));const m=h(n,["styleImageConfig"]);m!=null&&p(e,["styleImageConfig"],m);const y=h(n,["subjectImageConfig"]);return y!=null&&p(e,["subjectImageConfig"],y),e}function Sy(n){const e={},s=h(n,["safetyAttributes","categories"]);s!=null&&p(e,["categories"],s);const o=h(n,["safetyAttributes","scores"]);o!=null&&p(e,["scores"],o);const a=h(n,["contentType"]);return a!=null&&p(e,["contentType"],a),e}function _y(n){const e={},s=h(n,["safetyAttributes","categories"]);s!=null&&p(e,["categories"],s);const o=h(n,["safetyAttributes","scores"]);o!=null&&p(e,["scores"],o);const a=h(n,["contentType"]);return a!=null&&p(e,["contentType"],a),e}function GE(n){const e={},s=h(n,["category"]);if(s!=null&&p(e,["category"],s),h(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=h(n,["threshold"]);return o!=null&&p(e,["threshold"],o),e}function qE(n){const e={},s=h(n,["image"]);return s!=null&&p(e,["image"],wn(s)),e}function BE(n,e){const s={},o=h(n,["mode"]);e!==void 0&&o!=null&&p(e,["parameters","mode"],o);const a=h(n,["maxPredictions"]);e!==void 0&&a!=null&&p(e,["parameters","maxPredictions"],a);const c=h(n,["confidenceThreshold"]);e!==void 0&&c!=null&&p(e,["parameters","confidenceThreshold"],c);const d=h(n,["maskDilation"]);e!==void 0&&d!=null&&p(e,["parameters","maskDilation"],d);const m=h(n,["binaryColorThreshold"]);e!==void 0&&m!=null&&p(e,["parameters","binaryColorThreshold"],m);const y=h(n,["labels"]);return e!==void 0&&y!=null&&p(e,["labels"],y),s}function HE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["source"]);a!=null&&VE(a,s);const c=h(e,["config"]);return c!=null&&BE(c,s),s}function zE(n){const e={},s=h(n,["predictions"]);if(s!=null){let o=s;Array.isArray(o)&&(o=o.map(a=>mE(a))),p(e,["generatedMasks"],o)}return e}function VE(n,e){const s={},o=h(n,["prompt"]);e!==void 0&&o!=null&&p(e,["instances[0]","prompt"],o);const a=h(n,["image"]);e!==void 0&&a!=null&&p(e,["instances[0]","image"],wn(a));const c=h(n,["scribbleImage"]);return e!==void 0&&c!=null&&p(e,["instances[0]","scribble"],qE(c)),s}function FE(n){const e={},s=h(n,["functionCallingConfig"]);s!=null&&p(e,["functionCallingConfig"],YC(s));const o=h(n,["retrievalConfig"]);return o!=null&&p(e,["retrievalConfig"],o),e}function $E(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let v=s;Array.isArray(v)&&(v=v.map(b=>b)),p(e,["functionDeclarations"],v)}if(h(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=h(n,["googleSearchRetrieval"]);o!=null&&p(e,["googleSearchRetrieval"],o);const a=h(n,["computerUse"]);a!=null&&p(e,["computerUse"],a);const c=h(n,["fileSearch"]);c!=null&&p(e,["fileSearch"],c);const d=h(n,["codeExecution"]);if(d!=null&&p(e,["codeExecution"],d),h(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const m=h(n,["googleMaps"]);m!=null&&p(e,["googleMaps"],bE(m));const y=h(n,["googleSearch"]);y!=null&&p(e,["googleSearch"],wE(y));const f=h(n,["urlContext"]);
121return f!=null&&p(e,["urlContext"],f),e}function Ty(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let b=s;Array.isArray(b)&&(b=b.map(w=>JC(w))),p(e,["functionDeclarations"],b)}const o=h(n,["retrieval"]);o!=null&&p(e,["retrieval"],o);const a=h(n,["googleSearchRetrieval"]);a!=null&&p(e,["googleSearchRetrieval"],a);const c=h(n,["computerUse"]);if(c!=null&&p(e,["computerUse"],c),h(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const d=h(n,["codeExecution"]);d!=null&&p(e,["codeExecution"],d);const m=h(n,["enterpriseWebSearch"]);m!=null&&p(e,["enterpriseWebSearch"],m);const y=h(n,["googleMaps"]);y!=null&&p(e,["googleMaps"],y);const f=h(n,["googleSearch"]);f!=null&&p(e,["googleSearch"],f);const v=h(n,["urlContext"]);return v!=null&&p(e,["urlContext"],v),e}function YE(n){const e={},s=h(n,["baseModel"]);s!=null&&p(e,["baseModel"],s);const o=h(n,["createTime"]);o!=null&&p(e,["createTime"],o);const a=h(n,["updateTime"]);return a!=null&&p(e,["updateTime"],a),e}function JE(n){const e={},s=h(n,["labels","google-vertex-llm-tuning-base-model-id"]);s!=null&&p(e,["baseModel"],s);const o=h(n,["createTime"]);o!=null&&p(e,["createTime"],o);const a=h(n,["updateTime"]);return a!=null&&p(e,["updateTime"],a),e}function KE(n,e){const s={},o=h(n,["displayName"]);e!==void 0&&o!=null&&p(e,["displayName"],o);const a=h(n,["description"]);e!==void 0&&a!=null&&p(e,["description"],a);const c=h(n,["defaultCheckpointId"]);return e!==void 0&&c!=null&&p(e,["defaultCheckpointId"],c),s}function QE(n,e){const s={},o=h(n,["displayName"]);e!==void 0&&o!=null&&p(e,["displayName"],o);const a=h(n,["description"]);e!==void 0&&a!=null&&p(e,["description"],a);const c=h(n,["defaultCheckpointId"]);return e!==void 0&&c!=null&&p(e,["defaultCheckpointId"],c),s}function WE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","name"],Pe(n,o));const a=h(e,["config"]);return a!=null&&KE(a,s),s}function XE(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["config"]);return a!=null&&QE(a,s),s}function ZE(n,e){const s={},o=h(n,["outputGcsUri"]);e!==void 0&&o!=null&&p(e,["parameters","storageUri"],o);const a=h(n,["safetyFilterLevel"]);e!==void 0&&a!=null&&p(e,["parameters","safetySetting"],a);const c=h(n,["personGeneration"]);e!==void 0&&c!=null&&p(e,["parameters","personGeneration"],c);const d=h(n,["includeRaiReason"]);e!==void 0&&d!=null&&p(e,["parameters","includeRaiReason"],d);const m=h(n,["outputMimeType"]);e!==void 0&&m!=null&&p(e,["parameters","outputOptions","mimeType"],m);const y=h(n,["outputCompressionQuality"]);e!==void 0&&y!=null&&p(e,["parameters","outputOptions","compressionQuality"],y);const f=h(n,["enhanceInputImage"]);e!==void 0&&f!=null&&p(e,["parameters","upscaleConfig","enhanceInputImage"],f);const v=h(n,["imagePreservationFactor"]);e!==void 0&&v!=null&&p(e,["parameters","upscaleConfig","imagePreservationFactor"],v);const b=h(n,["labels"]);e!==void 0&&b!=null&&p(e,["labels"],b);const w=h(n,["numberOfImages"]);e!==void 0&&w!=null&&p(e,["parameters","sampleCount"],w);const _=h(n,["mode"]);return e!==void 0&&_!=null&&p(e,["parameters","mode"],_),s}function eN(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["_url","model"],Pe(n,o));const a=h(e,["image"]);a!=null&&p(s,["instances[0]","image"],wn(a));const c=h(e,["upscaleFactor"]);c!=null&&p(s,["parameters","upscaleConfig","upscaleFactor"],c);const d=h(e,["config"]);return d!=null&&ZE(d,s),s}function tN(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["predictions"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>nl(c))),p(e,["generatedImages"],a)}return e}function nN(n){const e={},s=h(n,["uri"]);s!=null&&p(e,["uri"],s);const o=h(n,["encodedVideo"]);o!=null&&p(e,["videoBytes"],ks(o));const a=h(n,["encoding"]);return a!=null&&p(e,["mimeType"],a),e}function sN(n){const e={},s=h(n,["gcsUri"]);s!=null&&p(e,["uri"],s);const o=h(n,["bytesBase64Encoded"]);o!=null&&p(e,["videoBytes"],ks(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["mimeType"],a),e}function iN(n){const e={},s=h(n,["image"]);s!=null&&p(e,["_self"],wn(s));const o=h(n,["maskMode"]);return o!=null&&p(e,["maskMode"],o),e}function oN(n){const e={},s=h(n,["image"]);s!=null&&p(e,["image"],sl(s));const o=h(n,["referenceType"]);return o!=null&&p(e,["referenceType"],o),e}function aN(n){const e={},s=h(n,["image"]);s!=null&&p(e,["image"],wn(s));const o=h(n,["referenceType"]);return o!=null&&p(e,["referenceType"],o),e}function Cy(n){const e={},s=h(n,["uri"]);s!=null&&p(e,["uri"],s);const o=h(n,["videoBytes"]);o!=null&&p(e,["encodedVideo"],ks(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["encoding"],a),e}function Ey(n){const e={},s=h(n,["uri"]);s!=null&&p(e,["gcsUri"],s);const o=h(n,["videoBytes"]);
121o!=null&&p(e,["bytesBase64Encoded"],ks(o));const a=h(n,["mimeType"]);return a!=null&&p(e,["mimeType"],a),e}/** 122 * @license 123 * Copyright 2025 Google LLC 124 * SPDX-License-Identifier: Apache-2.0 125 */function rN(n,e){const s={},o=h(n,["displayName"]);return e!==void 0&&o!=null&&p(e,["displayName"],o),s}function lN(n){const e={},s=h(n,["config"]);return s!=null&&rN(s,e),e}function cN(n,e){const s={},o=h(n,["force"]);return e!==void 0&&o!=null&&p(e,["_query","force"],o),s}function uN(n){const e={},s=h(n,["name"]);s!=null&&p(e,["_url","name"],s);const o=h(n,["config"]);return o!=null&&cN(o,e),e}function dN(n){const e={},s=h(n,["name"]);return s!=null&&p(e,["_url","name"],s),e}function hN(n,e){const s={},o=h(n,["customMetadata"]);if(e!==void 0&&o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["customMetadata"],c)}const a=h(n,["chunkingConfig"]);return e!==void 0&&a!=null&&p(e,["chunkingConfig"],a),s}function fN(n){const e={},s=h(n,["name"]);s!=null&&p(e,["name"],s);const o=h(n,["metadata"]);o!=null&&p(e,["metadata"],o);const a=h(n,["done"]);a!=null&&p(e,["done"],a);const c=h(n,["error"]);c!=null&&p(e,["error"],c);const d=h(n,["response"]);return d!=null&&p(e,["response"],pN(d)),e}function mN(n){const e={},s=h(n,["fileSearchStoreName"]);s!=null&&p(e,["_url","file_search_store_name"],s);const o=h(n,["fileName"]);o!=null&&p(e,["fileName"],o);const a=h(n,["config"]);return a!=null&&hN(a,e),e}function pN(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["parent"]);o!=null&&p(e,["parent"],o);const a=h(n,["documentName"]);return a!=null&&p(e,["documentName"],a),e}function gN(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);return e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),s}function yN(n){const e={},s=h(n,["config"]);return s!=null&&gN(s,e),e}function vN(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["fileSearchStores"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["fileSearchStores"],c)}return e}function Ny(n,e){const s={},o=h(n,["mimeType"]);e!==void 0&&o!=null&&p(e,["mimeType"],o);const a=h(n,["displayName"]);e!==void 0&&a!=null&&p(e,["displayName"],a);const c=h(n,["customMetadata"]);if(e!==void 0&&c!=null){let m=c;Array.isArray(m)&&(m=m.map(y=>y)),p(e,["customMetadata"],m)}const d=h(n,["chunkingConfig"]);return e!==void 0&&d!=null&&p(e,["chunkingConfig"],d),s}function xN(n){const e={},s=h(n,["fileSearchStoreName"]);s!=null&&p(e,["_url","file_search_store_name"],s);const o=h(n,["config"]);return o!=null&&Ny(o,e),e}function bN(n){const e={},s=h(n,["sdkHttpResponse"]);return s!=null&&p(e,["sdkHttpResponse"],s),e}/** 126 * @license 127 * Copyright 2025 Google LLC 128 * SPDX-License-Identifier: Apache-2.0 129 */const wN="Content-Type",SN="X-Server-Timeout",_N="User-Agent",Xu="x-goog-api-client",TN="1.34.0",CN=`google-genai-sdk/${TN}`,EN="v1beta1",NN="v1beta";class AN{constructor(e){var s,o;this.clientOptions=Object.assign(Object.assign({},e),{project:e.project,location:e.location,apiKey:e.apiKey,vertexai:e.vertexai});const a={};this.clientOptions.vertexai?(a.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:EN,a.baseUrl=this.baseUrlFromProjectLocation(),this.normalizeAuthParameters()):(a.apiVersion=(o=this.clientOptions.apiVersion)!==null&&o!==void 0?o:NN,a.baseUrl="https://generativelanguage.googleapis.com/"),a.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=a,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(a,e.httpOptions))}baseUrlFromProjectLocation(){return this.clientOptions.project&&this.clientOptions.location&&this.clientOptions.location!=="global"?`https://${this.clientOptions.location}-aiplatform.googleapis.com/`:"https://aiplatform.googleapis.com/"}normalizeAuthParameters(){if(this.clientOptions.project&&this.clientOptions.location){this.clientOptions.apiKey=void 0;return}this.clientOptions.project=void 0,this.clientOptions.location=void 0}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}async getAuthHeaders(){const e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const o=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&o.push(e.apiVersion),o.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),s=new URL(e);return s.protocol=s.protocol=="http:"?"ws":"wss",s.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,s,o){const a=[this.getRequestUrlInternal(s)];return o&&a.push(this.getBaseResourcePath()),e!==""&&a.push(e),new URL(`${a.join("/")}`)}shouldPrependVertexProjectPath(e){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let s=this.clientOptions.httpOptions;e.httpOptions&&(s=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const o=this.shouldPrependVertexProjectPath(e),a=this.constructUrl(e.path,s,o);if(e.queryParams)for(const[d,m]of Object.entries(e.queryParams))a.searchParams.append(d,String(m));let c={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else c.body=e.body;return c=await this.includeExtraHttpOptionsToRequestInit(c,s,a.toString(),e.abortSignal),this.unaryApiCall(a,c,e.httpMethod)}patchHttpOptions(e,s){const o=JSON.parse(JSON.stringify(e));for(const[a,c]of Object.entries(s))typeof c=="object"?o[a]=Object.assign(Object.assign({},o[a]),c):c!==void 0&&(o[a]=c);return o}async requestStream(e){let s=this.clientOptions.httpOptions;e.httpOptions&&(s=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const o=this.shouldPrependVertexProjectPath(e),a=this.constructUrl(e.path,s,o);(!a.searchParams.has("alt")||a.searchParams.get("alt")!=="sse")&&a.searchParams.set("alt","sse");let c={};return c.body=e.body,c=await this.includeExtraHttpOptionsToRequestInit(c,s,a.toString(),e.abortSignal),this.streamApiCall(a,c,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,s,o,a){if(s&&s.timeout||a){const c=new AbortController,d=c.signal;if(s.timeout&&(s==null?void 0:s.timeout)>0){const m=setTimeout(()=>c.abort(),s.timeout);m&&typeof m.unref=="function"&&m.unref()}a&&a.addEventListener("abort",()=>{c.abort()}),e.signal=d}return s&&s.extraBody!==null&&RN(e,s.extraBody),e.headers=await this.getHeadersInternal(s,o),e}async unaryApiCall(e,s,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},s),{method:o})).then(async a=>(await T0(a),new Yu(a))).catch(a=>{throw a instanceof Error?a:new Error(JSON.stringify(a))})}async streamApiCall(e,s,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},s),{method:o})).then(async a=>
129(await T0(a),this.processStreamResponse(a))).catch(a=>{throw a instanceof Error?a:new Error(JSON.stringify(a))})}processStreamResponse(e){return xn(this,arguments,function*(){var o;const a=(o=e==null?void 0:e.body)===null||o===void 0?void 0:o.getReader(),c=new TextDecoder("utf-8");if(!a)throw new Error("Response body is empty");try{let d="";const m="data:",y=[` 130 131`,"\r\r",`\r 132\r 133`];for(;;){const{done:f,value:v}=yield ye(a.read());if(f){if(d.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const b=c.decode(v,{stream:!0});try{const C=JSON.parse(b);if("error"in C){const A=JSON.parse(JSON.stringify(C.error)),E=A.status,I=A.code,U=`got status: ${E}. ${JSON.stringify(C)}`;if(I>=400&&I<600)throw new el({message:U,status:I})}}catch(C){if(C.name==="ApiError")throw C}d+=b;let w=-1,_=0;for(;;){w=-1,_=0;for(const E of y){const I=d.indexOf(E);I!==-1&&(w===-1||I<w)&&(w=I,_=E.length)}if(w===-1)break;const C=d.substring(0,w);d=d.substring(w+_);const A=C.trim();if(A.startsWith(m)){const E=A.substring(m.length).trim();try{const I=new Response(E,{headers:e==null?void 0:e.headers,status:e==null?void 0:e.status,statusText:e==null?void 0:e.statusText});yield yield ye(new Yu(I))}catch(I){throw new Error(`exception parsing stream chunk ${E}. ${I}`)}}}}}finally{a.releaseLock()}})}async apiCall(e,s){return fetch(e,s).catch(o=>{throw new Error(`exception ${o} sending request`)})}getDefaultHeaders(){const e={},s=CN+" "+this.clientOptions.userAgentExtra;return e[_N]=s,e[Xu]=s,e[wN]="application/json",e}async getHeadersInternal(e,s){const o=new Headers;if(e&&e.headers){for(const[a,c]of Object.entries(e.headers))o.append(a,c);e.timeout&&e.timeout>0&&o.append(SN,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(o,s),o}getFileName(e){var s;let o="";return typeof e=="string"&&(o=e.replace(/[/\\]+$/,""),o=(s=o.split(/[/\\]/).pop())!==null&&s!==void 0?s:""),o}async uploadFile(e,s){var o;const a={};s!=null&&(a.mimeType=s.mimeType,a.name=s.name,a.displayName=s.displayName),a.name&&!a.name.startsWith("files/")&&(a.name=`files/${a.name}`);const c=this.clientOptions.uploader,d=await c.stat(e);a.sizeBytes=String(d.size);const m=(o=s==null?void 0:s.mimeType)!==null&&o!==void 0?o:d.type;if(m===void 0||m==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");a.mimeType=m;const y={file:a},f=this.getFileName(e),v=ie("upload/v1beta/files",y._url),b=await this.fetchUploadUrl(v,a.sizeBytes,a.mimeType,f,y,s==null?void 0:s.httpOptions);return c.upload(e,b,this)}async uploadFileToFileSearchStore(e,s,o){var a;const c=this.clientOptions.uploader,d=await c.stat(s),m=String(d.size),y=(a=o==null?void 0:o.mimeType)!==null&&a!==void 0?a:d.type;if(y===void 0||y==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const f=`upload/v1beta/${e}:uploadToFileSearchStore`,v=this.getFileName(s),b={};o!=null&&Ny(o,b);const w=await this.fetchUploadUrl(f,m,y,v,b,o==null?void 0:o.httpOptions);return c.uploadToFileSearchStore(s,w,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,s,o,a,c,d){var m;let y={};d?y=d:y={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s}`,"X-Goog-Upload-Header-Content-Type":`${o}`},a?{"X-Goog-Upload-File-Name":a}:{})};const f=await this.request({path:e,body:JSON.stringify(c),httpMethod:"POST",httpOptions:y});if(!f||!(f!=null&&f.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const v=(m=f==null?void 0:f.headers)===null||m===void 0?void 0:m["x-goog-upload-url"];if(v===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return v}}async function T0(n){var e;if(n===void 0)throw new Error("response is undefined");if(!n.ok){const s=n.status;let o;!((e=n.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?o=await n.json():o={error:{message:await n.text(),code:n.status,status:n.statusText}};const a=JSON.stringify(o);throw s>=400&&s<600?new el({message:a,status:s}):new Error(a)}}function RN(n,e){if(!e||Object.keys(e).length===0)return;if(n.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let s={};
133if(typeof n.body=="string"&&n.body.length>0)try{const c=JSON.parse(n.body);if(typeof c=="object"&&c!==null&&!Array.isArray(c))s=c;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function o(c,d){const m=Object.assign({},c);for(const y in d)if(Object.prototype.hasOwnProperty.call(d,y)){const f=d[y],v=m[y];f&&typeof f=="object"&&!Array.isArray(f)&&v&&typeof v=="object"&&!Array.isArray(v)?m[y]=o(v,f):(v&&f&&typeof v!=typeof f&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${y}". Original type: ${typeof v}, New type: ${typeof f}. Overwriting.`),m[y]=f)}return m}const a=o(s,e);n.body=JSON.stringify(a)}/** 134 * @license 135 * Copyright 2025 Google LLC 136 * SPDX-License-Identifier: Apache-2.0 137 */const kN="mcp_used/unknown";let jN=!1;function Ay(n){for(const e of n)if(IN(e)||typeof e=="object"&&"inputSchema"in e)return!0;return jN}function Ry(n){var e;const s=(e=n[Xu])!==null&&e!==void 0?e:"";n[Xu]=(s+` ${kN}`).trimStart()}function IN(n){return n!==null&&typeof n=="object"&&n instanceof xd}function MN(n){return xn(this,arguments,function*(s,o=100){let a,c=0;for(;c<o;){const d=yield ye(s.listTools({cursor:a}));for(const m of d.tools)yield yield ye(m),c++;if(!d.nextCursor)break;a=d.nextCursor}})}class xd{constructor(e=[],s){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=s}static create(e,s){return new xd(e,s)}async initialize(){var e,s,o,a;if(this.mcpTools.length>0)return;const c={},d=[];for(const v of this.mcpClients)try{for(var m=!0,y=(s=void 0,bn(MN(v))),f;f=await y.next(),e=f.done,!e;m=!0){a=f.value,m=!1;const b=a;d.push(b);const w=b.name;if(c[w])throw new Error(`Duplicate function name ${w} found in MCP tools. Please ensure function names are unique.`);c[w]=v}}catch(b){s={error:b}}finally{try{!m&&!e&&(o=y.return)&&await o.call(y)}finally{if(s)throw s.error}}this.mcpTools=d,this.functionNameToMcpClient=c}async tool(){return await this.initialize(),d_(this.mcpTools,this.config)}async callTool(e){await this.initialize();const s=[];for(const o of e)if(o.name in this.functionNameToMcpClient){const a=this.functionNameToMcpClient[o.name];let c;this.config.timeout&&(c={timeout:this.config.timeout});const d=await a.callTool({name:o.name,arguments:o.args},void 0,c);s.push({functionResponse:{name:o.name,response:d.isError?{error:d}:d}})}return s}}/** 138 * @license 139 * Copyright 2025 Google LLC 140 * SPDX-License-Identifier: Apache-2.0 141 */async function DN(n,e,s){const o=new s_;let a;s.data instanceof Blob?a=JSON.parse(await s.data.text()):a=JSON.parse(s.data),Object.assign(o,a),e(o)}class UN{constructor(e,s,o){this.apiClient=e,this.auth=s,this.webSocketFactory=o}async connect(e){var s,o;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const a=this.apiClient.getWebsocketBaseUrl(),c=this.apiClient.getApiVersion(),d=ON(this.apiClient.getDefaultHeaders()),m=this.apiClient.getApiKey(),y=`${a}/ws/google.ai.generativelanguage.${c}.GenerativeService.BidiGenerateMusic?key=${m}`;let f=()=>{};const v=new Promise(G=>{f=G}),b=e.callbacks,w=function(){f({})},_=this.apiClient,C={onopen:w,onmessage:G=>{DN(_,b.onmessage,G)},onerror:(s=b==null?void 0:b.onerror)!==null&&s!==void 0?s:function(G){},onclose:(o=b==null?void 0:b.onclose)!==null&&o!==void 0?o:function(G){}},A=this.webSocketFactory.create(y,PN(d),C);A.connect(),await v;const U={setup:{model:Pe(this.apiClient,e.model)}};return A.send(JSON.stringify(U)),new LN(A,this.apiClient)}}class LN{constructor(e,s){this.conn=e,this.apiClient=s}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const s=lC(e);this.conn.send(JSON.stringify({clientContent:s}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});const s=rC(e);this.conn.send(JSON.stringify(s))}sendPlaybackControl(e){const s={playbackControl:e};this.conn.send(JSON.stringify(s))}play(){this.sendPlaybackControl(Zi.PLAY)}pause(){this.sendPlaybackControl(Zi.PAUSE)}stop(){this.sendPlaybackControl(Zi.STOP)}resetContext(){this.sendPlaybackControl(Zi.RESET_CONTEXT)}
141close(){this.conn.close()}}function PN(n){const e={};return n.forEach((s,o)=>{e[o]=s}),e}function ON(n){const e=new Headers;for(const[s,o]of Object.entries(n))e.append(s,o);return e}/** 142 * @license 143 * Copyright 2025 Google LLC 144 * SPDX-License-Identifier: Apache-2.0 145 */const GN="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function qN(n,e,s){const o=new n_;let a;s.data instanceof Blob?a=await s.data.text():s.data instanceof ArrayBuffer?a=new TextDecoder().decode(s.data):a=s.data;const c=JSON.parse(a);if(n.isVertexAI()){const d=dC(c);Object.assign(o,d)}else Object.assign(o,c);e(o)}class BN{constructor(e,s,o){this.apiClient=e,this.auth=s,this.webSocketFactory=o,this.music=new UN(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var s,o,a,c,d,m;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const y=this.apiClient.getWebsocketBaseUrl(),f=this.apiClient.getApiVersion();let v;const b=this.apiClient.getHeaders();e.config&&e.config.tools&&Ay(e.config.tools)&&Ry(b);const w=FN(b);if(this.apiClient.isVertexAI())v=`${y}/ws/google.cloud.aiplatform.${f}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(w,v);else{const X=this.apiClient.getApiKey();let q="BidiGenerateContent",Q="key";X!=null&&X.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),f!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),q="BidiGenerateContentConstrained",Q="access_token"),v=`${y}/ws/google.ai.generativelanguage.${f}.GenerativeService.${q}?${Q}=${X}`}let _=()=>{};const C=new Promise(X=>{_=X}),A=e.callbacks,E=function(){var X;(X=A==null?void 0:A.onopen)===null||X===void 0||X.call(A),_({})},I=this.apiClient,U={onopen:E,onmessage:X=>{qN(I,A.onmessage,X)},onerror:(s=A==null?void 0:A.onerror)!==null&&s!==void 0?s:function(X){},onclose:(o=A==null?void 0:A.onclose)!==null&&o!==void 0?o:function(X){}},G=this.webSocketFactory.create(v,VN(w),U);G.connect(),await C;let F=Pe(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&F.startsWith("publishers/")){const X=this.apiClient.getProject(),q=this.apiClient.getLocation();F=`projects/${X}/locations/${q}/`+F}let P={};this.apiClient.isVertexAI()&&((a=e.config)===null||a===void 0?void 0:a.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[$r.AUDIO]}:e.config.responseModalities=[$r.AUDIO]),!((c=e.config)===null||c===void 0)&&c.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const $=(m=(d=e.config)===null||d===void 0?void 0:d.tools)!==null&&m!==void 0?m:[],H=[];for(const X of $)if(this.isCallableTool(X)){const q=X;H.push(await q.tool())}else H.push(X);H.length>0&&(e.config.tools=H);const Z={model:F,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?P=aC(this.apiClient,Z):P=oC(this.apiClient,Z),delete P.config,G.send(JSON.stringify(P)),new zN(G,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}}const HN={turnComplete:!0};class zN{constructor(e,s){this.conn=e,this.apiClient=s}tLiveClientContent(e,s){if(s.turns!==null&&s.turns!==void 0){let o=[];try{o=cn(s.turns),e.isVertexAI()||(o=o.map(a=>tl(a)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof s.turns}'`)}return{clientContent:{turns:o,turnComplete:s.turnComplete}}}return{clientContent:{turnComplete:s.turnComplete}}}tLiveClienttToolResponse(e,s){let o=[];if(s.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(s.functionResponses)?o=s.functionResponses:o=[s.functionResponses],o.length===0)throw new Error("functionResponses is required.");for(const c of o){if(typeof c!="object"||c===null||!("name"in c)||!("response"in c))throw new Error(`Could not parse function response, type '${typeof c}'.`);if(!e.isVertexAI()&&!("id"in c))throw new Error(GN)}return{toolResponse:{functionResponses:o}}}sendClientContent(e){e=Object.assign(Object.assign({},HN),e);const s=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(s))}sendRealtimeInput(e){let s={};this.apiClient.isVertexAI()?s={realtimeInput:uC(e)}:s={realtimeInput:cC(e)},this.conn.send(JSON.stringify(s))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const s=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(s))}
145close(){this.conn.close()}}function VN(n){const e={};return n.forEach((s,o)=>{e[o]=s}),e}function FN(n){const e=new Headers;for(const[s,o]of Object.entries(n))e.append(s,o);return e}/** 146 * @license 147 * Copyright 2025 Google LLC 148 * SPDX-License-Identifier: Apache-2.0 149 */const C0=10;function E0(n){var e,s,o;if(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let a=!1;for(const d of(s=n==null?void 0:n.tools)!==null&&s!==void 0?s:[])if(so(d)){a=!0;break}if(!a)return!0;const c=(o=n==null?void 0:n.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls;return c&&(c<0||!Number.isInteger(c))||c==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",c),!0):!1}function so(n){return"callTool"in n&&typeof n.callTool=="function"}function $N(n){var e,s,o;return(o=(s=(e=n.config)===null||e===void 0?void 0:e.tools)===null||s===void 0?void 0:s.some(a=>so(a)))!==null&&o!==void 0?o:!1}function N0(n){var e;const s=[];return!((e=n==null?void 0:n.config)===null||e===void 0)&&e.tools&&n.config.tools.forEach((o,a)=>{if(so(o))return;const c=o;c.functionDeclarations&&c.functionDeclarations.length>0&&s.push(a)}),s}function A0(n){var e;return!(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}/** 150 * @license 151 * Copyright 2025 Google LLC 152 * SPDX-License-Identifier: Apache-2.0 153 */class YN extends Kn{constructor(e){super(),this.apiClient=e,this.generateContent=async s=>{var o,a,c,d,m;const y=await this.processParamsMaybeAddMcpUsage(s);if(this.maybeMoveToResponseJsonSchem(s),!$N(s)||E0(s.config))return await this.generateContentInternal(y);const f=N0(s);if(f.length>0){const A=f.map(E=>`tools[${E}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${A}.`)}let v,b;const w=cn(y.contents),_=(c=(a=(o=y.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls)!==null&&c!==void 0?c:C0;let C=0;for(;C<_&&(v=await this.generateContentInternal(y),!(!v.functionCalls||v.functionCalls.length===0));){const A=v.candidates[0].content,E=[];for(const I of(m=(d=s.config)===null||d===void 0?void 0:d.tools)!==null&&m!==void 0?m:[])if(so(I)){const G=await I.callTool(v.functionCalls);E.push(...G)}C++,b={role:"user",parts:E},y.contents=cn(y.contents),y.contents.push(A),y.contents.push(b),A0(y.config)&&(w.push(A),w.push(b))}return A0(y.config)&&(v.automaticFunctionCallingHistory=w),v},this.generateContentStream=async s=>{var o,a,c,d,m;if(this.maybeMoveToResponseJsonSchem(s),E0(s.config)){const b=await this.processParamsMaybeAddMcpUsage(s);return await this.generateContentStreamInternal(b)}const y=N0(s);if(y.length>0){const b=y.map(w=>`tools[${w}]`).join(", ");throw new Error(`Incompatible tools found at ${b}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const f=(c=(a=(o=s==null?void 0:s.config)===null||o===void 0?void 0:o.toolConfig)===null||a===void 0?void 0:a.functionCallingConfig)===null||c===void 0?void 0:c.streamFunctionCallArguments,v=(m=(d=s==null?void 0:s.config)===null||d===void 0?void 0:d.automaticFunctionCalling)===null||m===void 0?void 0:m.disable;if(f&&!v)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(s)},this.generateImages=async s=>await this.generateImagesInternal(s).then(o=>{var a;let c;const d=[];if(o!=null&&o.generatedImages)for(const y of o.generatedImages)y&&(y!=null&&y.safetyAttributes)&&((a=y==null?void 0:y.safetyAttributes)===null||a===void 0?void 0:a.contentType)==="Positive Prompt"?c=y==null?void 0:y.safetyAttributes:d.push(y);let m;return c?m={generatedImages:d,positivePromptSafetyAttributes:c,sdkHttpResponse:o.sdkHttpResponse}:m={generatedImages:d,sdkHttpResponse:o.sdkHttpResponse},m}),this.list=async s=>{var o;const d={config:Object.assign(Object.assign({},{queryBase:!0}),s==null?void 0:s.config)};if(this.apiClient.isVertexAI()&&!d.config.queryBase){if(!((o=d.config)===null||o===void 0)&&o.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");d.config.filter="labels.tune-type:*"}return new ni(Jn.PAGED_ITEM_MODELS,m=>this.listInternal(m),await this.listInternal(d),d)},this.editImage=async s=>{const o={model:s.model,prompt:s.prompt,referenceImages:[],config:s.config};return s.referenceImages&&s.referenceImages&&(o.referenceImages=s.referenceImages.map(a=>a.toReferenceImageAPI())),await this.editImageInternal(o)},this.upscaleImage=async s=>{let o={numberOfImages:1,mode:"upscale"};s.config&&(o=Object.assign(Object.assign({},o),s.config));const a={model:s.model,image:s.image,upscaleFactor:s.upscaleFactor,config:o};return await this.upscaleImageInternal(a)},this.generateVideos=async s=>{var o,a,c,d,m,y;if((s.prompt||s.image||s.video)&&s.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((o=s.video)===null||o===void 0)&&o.uri&&
153(!((a=s.video)===null||a===void 0)&&a.videoBytes)?s.video={uri:s.video.uri,mimeType:s.video.mimeType}:!((d=(c=s.source)===null||c===void 0?void 0:c.video)===null||d===void 0)&&d.uri&&(!((y=(m=s.source)===null||m===void 0?void 0:m.video)===null||y===void 0)&&y.videoBytes)&&(s.source.video={uri:s.source.video.uri,mimeType:s.source.video.mimeType})),await this.generateVideosInternal(s)}}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var s,o,a;const c=(s=e.config)===null||s===void 0?void 0:s.tools;if(!c)return e;const d=await Promise.all(c.map(async y=>so(y)?await y.tool():y)),m={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:d})};if(m.config.tools=d,e.config&&e.config.tools&&Ay(e.config.tools)){const y=(a=(o=e.config.httpOptions)===null||o===void 0?void 0:o.headers)!==null&&a!==void 0?a:{};let f=Object.assign({},y);Object.keys(f).length===0&&(f=this.apiClient.getDefaultHeaders()),Ry(f),m.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:f})}return m}async initAfcToolsMap(e){var s,o,a;const c=new Map;for(const d of(o=(s=e.config)===null||s===void 0?void 0:s.tools)!==null&&o!==void 0?o:[])if(so(d)){const m=d,y=await m.tool();for(const f of(a=y.functionDeclarations)!==null&&a!==void 0?a:[]){if(!f.name)throw new Error("Function declaration name is required.");if(c.has(f.name))throw new Error(`Duplicate tool declaration name: ${f.name}`);c.set(f.name,m)}}return c}async processAfcStream(e){var s,o,a;const c=(a=(o=(s=e.config)===null||s===void 0?void 0:s.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls)!==null&&a!==void 0?a:C0;let d=!1,m=0;const y=await this.initAfcToolsMap(e);return(function(f,v,b){return xn(this,arguments,function*(){for(var w,_,C,A,E,I;m<c;){d&&(m++,d=!1);const P=yield ye(f.processParamsMaybeAddMcpUsage(b)),$=yield ye(f.generateContentStreamInternal(P)),H=[],Z=[];try{for(var U=!0,G=(_=void 0,bn($)),F;F=yield ye(G.next()),w=F.done,!w;U=!0){A=F.value,U=!1;const X=A;if(yield yield ye(X),X.candidates&&(!((E=X.candidates[0])===null||E===void 0)&&E.content)){Z.push(X.candidates[0].content);for(const q of(I=X.candidates[0].content.parts)!==null&&I!==void 0?I:[])if(m<c&&q.functionCall){if(!q.functionCall.name)throw new Error("Function call name was not returned by the model.");if(v.has(q.functionCall.name)){const Q=yield ye(v.get(q.functionCall.name).callTool([q.functionCall]));H.push(...Q)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${v.keys()}, mising tool: ${q.functionCall.name}`)}}}}catch(X){_={error:X}}finally{try{!U&&!w&&(C=G.return)&&(yield ye(C.call(G)))}finally{if(_)throw _.error}}if(H.length>0){d=!0;const X=new ra;X.candidates=[{content:{role:"user",parts:H}}],yield yield ye(X);const q=[];q.push(...Z),q.push({role:"user",parts:H});const Q=cn(b.contents).concat(q);b.contents=Q}else break}})})(this,y,e)}async generateContentInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=w0(this.apiClient,e);return m=ie("{model}:generateContent",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=_0(v),w=new ra;return Object.assign(w,b),w})}else{const f=b0(this.apiClient,e);return m=ie("{model}:generateContent",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=S0(v),w=new ra;return Object.assign(w,b),w})}}async generateContentStreamInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=w0(this.apiClient,e);return m=ie("{model}:streamGenerateContent?alt=sse",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.requestStream({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}),d.then(function(b){return xn(this,arguments,function*(){var w,_,C,A;try{for(var E=!0,I=bn(b),U;U=yield ye(I.next()),w=U.done,!w;E=!0){A=U.value,E=!1;const G=A,F=_0(yield ye(G.json()));F.sdkHttpResponse={headers:G.headers};const P=new ra;Object.assign(P,F),yield yield ye(P)}}catch(G){_={error:G}}finally{try{!E&&!w&&(C=I.return)&&(yield ye(C.call(I)))}finally{if(_)throw _.error}}})})}else{const f=b0(this.apiClient,e);return m=ie("{model}:streamGenerateContent?alt=sse",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.requestStream({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}),d.then(function(b){return xn(this,arguments,function*(){var w,_,C,A;try{for(var E=!0,I=bn(b),U;U=yield ye(I.next()),w=U.done,!w;E=!0){A=U.value,E=!1;const G=A,F=S0(yield ye(G.json()));F.sdkHttpResponse={headers:G.headers};const P=new ra;Object.assign(P,F),yield yield ye(P)}}catch(G){_={error:G}}finally{try{!E&&!w&&(C=I.return)&&(yield ye(C.call(I)))}finally{if(_)throw _.error}}})})}}async embedContent(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=BC(this.apiClient,e);return m=ie("{model}:predict",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=zC(v),w=new s0;return Object.assign(w,b),w})}else{const f=qC(this.apiClient,e);return m=ie("{model}:batchEmbedContents",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=HC(v),w=new s0;return Object.assign(w,b),w})}}async generateImagesInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=eE(this.apiClient,e);return m=ie("{model}:predict",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=nE(v),w=new i0;return Object.assign(w,b),w})}else{const f=ZC(this.apiClient,e);return m=ie("{model}:predict",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=tE(v),w=new i0;return Object.assign(w,b),w})}}async editImageInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=LC(this.apiClient,e);return c=ie("{model}:predict",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>{const f=PC(y),v=new FS;return Object.assign(v,f),v})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=eN(this.apiClient,e);return c=ie("{model}:predict",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>{const f=tN(y),v=new $S;return Object.assign(v,f),v})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=UE(this.apiClient,e);return c=ie("{model}:predict",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=LE(y),v=new YS;return Object.assign(v,f),v})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=HE(this.apiClient,e);return c=ie("{model}:predict",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=zE(y),v=new JS;return Object.assign(v,f),v})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=xE(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>Wu(v))}else{const f=vE(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Qu(v))}}async listInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=AE(this.apiClient,e);return m=ie("{models_url}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=kE(v),w=new o0;return Object.assign(w,b),w})}else{const f=NE(this.apiClient,e);return m=ie("{models_url}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=RE(v),w=new o0;return Object.assign(w,b),w})}}async update(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=XE(this.apiClient,e);return m=ie("{model}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>Wu(v))}else{const f=WE(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"PATCH",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Qu(v))}}async delete(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=IC(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=DC(v),w=new a0;return Object.assign(w,b),w})}else{const f=jC(this.apiClient,e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"DELETE",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=MC(v),w=new a0;return Object.assign(w,b),w})}}async countTokens(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=AC(this.apiClient,e);return m=ie("{model}:countTokens",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=kC(v),w=new r0;return Object.assign(w,b),w})}else{const f=NC(this.apiClient,e);return m=ie("{model}:countTokens",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=RC(v),w=new r0;return Object.assign(w,b),w})}}async computeTokens(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=bC(this.apiClient,e);return c=ie("{model}:computeTokens",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>{const f=wC(y),v=new KS;return Object.assign(v,f),v})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=lE(this.apiClient,e);return m=ie("{model}:predictLongRunning",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d.then(v=>{const b=aE(v),w=new Yr;return Object.assign(w,b),w})}else{const f=rE(this.apiClient,e);return m=ie("{model}:predictLongRunning",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.str
153ingify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>{const b=oE(v),w=new Yr;return Object.assign(w,b),w})}}}/** 154 * @license 155 * Copyright 2025 Google LLC 156 * SPDX-License-Identifier: Apache-2.0 157 */class JN extends Kn{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const s=e.operation,o=e.config;if(s.name===void 0||s.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const a=s.name.split("/operations/")[0];let c;o&&"httpOptions"in o&&(c=o.httpOptions);const d=await this.fetchPredictVideosOperationInternal({operationName:s.name,resourceName:a,config:{httpOptions:c}});return s._fromAPIResponse({apiResponse:d,_isVertexAI:!0})}else{const a=await this.getVideosOperationInternal({operationName:s.name,config:o});return s._fromAPIResponse({apiResponse:a,_isVertexAI:!1})}}async get(e){const s=e.operation,o=e.config;if(s.name===void 0||s.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const a=s.name.split("/operations/")[0];let c;o&&"httpOptions"in o&&(c=o.httpOptions);const d=await this.fetchPredictVideosOperationInternal({operationName:s.name,resourceName:a,config:{httpOptions:c}});return s._fromAPIResponse({apiResponse:d,_isVertexAI:!0})}else{const a=await this.getVideosOperationInternal({operationName:s.name,config:o});return s._fromAPIResponse({apiResponse:a,_isVertexAI:!1})}}async getVideosOperationInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=GS(e);return m=ie("{operationName}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json()),d}else{const f=OS(e);return m=ie("{operationName}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d}}async fetchPredictVideosOperationInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=jS(e);return c=ie("{resourceName}:fetchPredictOperation",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a}else throw new Error("This method is only supported by the Vertex AI.")}}/** 158 * @license 159 * Copyright 2025 Google LLC 160 * SPDX-License-Identifier: Apache-2.0 161 */function KN(n){const e={},s=h(n,["data"]);if(s!=null&&p(e,["data"],s),h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function QN(n){const e={},s=h(n,["parts"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(c=>oA(c))),p(e,["parts"],a)}const o=h(n,["role"]);return o!=null&&p(e,["role"],o),e}function WN(n,e,s){const o={},a=h(e,["expireTime"]);s!==void 0&&a!=null&&p(s,["expireTime"],a);const c=h(e,["newSessionExpireTime"]);s!==void 0&&c!=null&&p(s,["newSessionExpireTime"],c);const d=h(e,["uses"]);s!==void 0&&d!=null&&p(s,["uses"],d);const m=h(e,["liveConnectConstraints"]);s!==void 0&&m!=null&&p(s,["bidiGenerateContentSetup"],iA(n,m));const y=h(e,["lockAdditionalFields"]);return s!==void 0&&y!=null&&p(s,["fieldMask"],y),o}function XN(n,e){const s={},o=h(e,["config"]);return o!=null&&p(s,["config"],WN(n,o,s)),s}function ZN(n){const e={};if(h(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=h(n,["fileUri"]);s!=null&&p(e,["fileUri"],s);const o=h(n,["mimeType"]);return o!=null&&p(e,["mimeType"],o),e}function eA(n){const e={},s=h(n,["id"]);s!=null&&p(e,["id"],s);const o=h(n,["args"]);o!=null&&p(e,["args"],o);const a=h(n,["name"]);if(a!=null&&p(e,["name"],a),h(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(h(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function tA(n){const e={};if(h(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const s=h(n,["enableWidget"]);return s!=null&&p(e,["enableWidget"],s),e}function nA(n){const e={};if(h(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(h(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const s=h(n,["timeRangeFilter"]);return s!=null&&p(e,["timeRangeFilter"],s),e}function sA(n,e){const s={},o=h(n,["generationConfig"]);e!==void 0&&o!=null&&p(e,["setup","generationConfig"],o);const a=h(n,["responseModalities"]);e!==void 0&&a!=null&&p(e,["setup","generationConfig","responseModalities"],a);const c=h(n,["temperature"]);e!==void 0&&c!=null&&p(e,["setup","generationConfig","temperature"],
161c);const d=h(n,["topP"]);e!==void 0&&d!=null&&p(e,["setup","generationConfig","topP"],d);const m=h(n,["topK"]);e!==void 0&&m!=null&&p(e,["setup","generationConfig","topK"],m);const y=h(n,["maxOutputTokens"]);e!==void 0&&y!=null&&p(e,["setup","generationConfig","maxOutputTokens"],y);const f=h(n,["mediaResolution"]);e!==void 0&&f!=null&&p(e,["setup","generationConfig","mediaResolution"],f);const v=h(n,["seed"]);e!==void 0&&v!=null&&p(e,["setup","generationConfig","seed"],v);const b=h(n,["speechConfig"]);e!==void 0&&b!=null&&p(e,["setup","generationConfig","speechConfig"],vd(b));const w=h(n,["thinkingConfig"]);e!==void 0&&w!=null&&p(e,["setup","generationConfig","thinkingConfig"],w);const _=h(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&p(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=h(n,["systemInstruction"]);e!==void 0&&C!=null&&p(e,["setup","systemInstruction"],QN(wt(C)));const A=h(n,["tools"]);if(e!==void 0&&A!=null){let $=co(A);Array.isArray($)&&($=$.map(H=>rA(lo(H)))),p(e,["setup","tools"],$)}const E=h(n,["sessionResumption"]);e!==void 0&&E!=null&&p(e,["setup","sessionResumption"],aA(E));const I=h(n,["inputAudioTranscription"]);e!==void 0&&I!=null&&p(e,["setup","inputAudioTranscription"],I);const U=h(n,["outputAudioTranscription"]);e!==void 0&&U!=null&&p(e,["setup","outputAudioTranscription"],U);const G=h(n,["realtimeInputConfig"]);e!==void 0&&G!=null&&p(e,["setup","realtimeInputConfig"],G);const F=h(n,["contextWindowCompression"]);e!==void 0&&F!=null&&p(e,["setup","contextWindowCompression"],F);const P=h(n,["proactivity"]);if(e!==void 0&&P!=null&&p(e,["setup","proactivity"],P),h(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return s}function iA(n,e){const s={},o=h(e,["model"]);o!=null&&p(s,["setup","model"],Pe(n,o));const a=h(e,["config"]);return a!=null&&p(s,["config"],sA(a,s)),s}function oA(n){const e={},s=h(n,["mediaResolution"]);s!=null&&p(e,["mediaResolution"],s);const o=h(n,["codeExecutionResult"]);o!=null&&p(e,["codeExecutionResult"],o);const a=h(n,["executableCode"]);a!=null&&p(e,["executableCode"],a);const c=h(n,["fileData"]);c!=null&&p(e,["fileData"],ZN(c));const d=h(n,["functionCall"]);d!=null&&p(e,["functionCall"],eA(d));const m=h(n,["functionResponse"]);m!=null&&p(e,["functionResponse"],m);const y=h(n,["inlineData"]);y!=null&&p(e,["inlineData"],KN(y));const f=h(n,["text"]);f!=null&&p(e,["text"],f);const v=h(n,["thought"]);v!=null&&p(e,["thought"],v);const b=h(n,["thoughtSignature"]);b!=null&&p(e,["thoughtSignature"],b);const w=h(n,["videoMetadata"]);return w!=null&&p(e,["videoMetadata"],w),e}function aA(n){const e={},s=h(n,["handle"]);if(s!=null&&p(e,["handle"],s),h(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function rA(n){const e={},s=h(n,["functionDeclarations"]);if(s!=null){let v=s;Array.isArray(v)&&(v=v.map(b=>b)),p(e,["functionDeclarations"],v)}if(h(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=h(n,["googleSearchRetrieval"]);o!=null&&p(e,["googleSearchRetrieval"],o);const a=h(n,["computerUse"]);a!=null&&p(e,["computerUse"],a);const c=h(n,["fileSearch"]);c!=null&&p(e,["fileSearch"],c);const d=h(n,["codeExecution"]);if(d!=null&&p(e,["codeExecution"],d),h(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const m=h(n,["googleMaps"]);m!=null&&p(e,["googleMaps"],tA(m));const y=h(n,["googleSearch"]);y!=null&&p(e,["googleSearch"],nA(y));const f=h(n,["urlContext"]);return f!=null&&p(e,["urlContext"],f),e}/** 162 * @license 163 * Copyright 2025 Google LLC 164 * SPDX-License-Identifier: Apache-2.0 165 */function lA(n){const e=[];for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)){const o=n[s];if(typeof o=="object"&&o!=null&&Object.keys(o).length>0){const a=Object.keys(o).map(c=>`${s}.${c}`);e.push(...a)}else e.push(s)}return e.join(",")}function cA(n,e){let s=null;const o=n.bidiGenerateContentSetup;if(typeof o=="object"&&o!==null&&"setup"in o){const c=o.setup;typeof c=="object"&&c!==null?(n.bidiGenerateContentSetup=c,s=c):delete n.bidiGenerateContentSetup}else o!==void 0&&delete n.bidiGenerateContentSetup;const a=n.fieldMask;if(s){const c=lA(s);if(Array.isArray(e==null?void 0:e.lockAdditionalFields)&&(e==null?void 0:e.lockAdditionalFields.length)===0)c?n.fieldMask=c:delete n.fieldMask;else if(e!=null&&e.lockAdditionalFields&&e.lockAdditionalFields.length>0&&a!==null&&Array.isArray(a)&&a.length>0){const d=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let m=[];a.length>0&&(m=a.map(f=>d.includes(f)?`generationConfig.${f}`:f));const y=[];c&&y.push(c),m.length>0&&y.push(...m),y.length>0?n.fieldMask=y.join(","):delete n.fieldMask}else delete n.fieldMask}else a!==null&&Array.isArray(a)&&a.length>0?n.fieldMask=a.join(","):delete n.fieldMask;return n}class uA extends Kn{constructor(e){super(),this.apiClient=e}async create(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const m=XN(this.apiClient,e);c=ie("auth_tokens",m._url),d=m._query,delete m.config,delete m._url,delete m._query;const y=cA(m,e.config);return a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(f=>f.json()),a.then(f=>f)}}}/** 166 * @license 167 * Copyright 2025 Google LLC 168 * SPDX-License-Identifier: Apache-2.0 169 */function dA(n,e){const s={},o=h(n,["force"]);return e!==void 0&&o!=null&&p(e,["_query","force"],o),s}function hA(n){const e={},s=h(n,["name"]);s!=null&&p(e,["_url","name"],s);const o=h(n,["config"]);return o!=null&&dA(o,e),e}function fA(n){const e={},s=h(n,["name"]);return s!=null&&p(e,["_url","name"],s),e}function mA(n,e){const s={},o=h(n,["pageSize"]);e!==void 0&&o!=null&&p(e,["_query","pageSize"],o);const a=h(n,["pageToken"]);return e!==void 0&&a!=null&&p(e,["_query","pageToken"],a),s}function pA(n){const e={},s=h(n,["parent"]);s!=null&&p(e,["_url","parent"],s);const o=h(n,["config"]);return o!=null&&mA(o,e),e}function gA(n){const e={},s=h(n,["sdkHttpResponse"]);s!=null&&p(e,["sdkHttpResponse"],s);const o=h(n,["nextPageToken"]);o!=null&&p(e,["nextPageToken"],o);const a=h(n,["documents"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(d=>d)),p(e,["documents"],c)}return e}/** 170 * @license 171 * Copyright 2025 Google LLC 172 * SPDX-License-Identifier: Apache-2.0 173 */class yA extends Kn{constructor(e){super(),this.apiClient=e,this.list=async s=>new ni(Jn.PAGED_ITEM_DOCUMENTS,o=>this.listInternal({parent:s.parent,config:o.config}),await this.listInternal(s),s)}async get(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=fA(e);return c=ie("{name}",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>y)}}async delete(e){var s,o;let a="",c={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const d=hA(e);a=ie("{name}",d._url),c=d._query,delete d._url,delete d._query,await this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(d),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=pA(e);return c=ie("{parent}/documents",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=gA(y),v=new QS;return Object.assign(v,f),v})}}}/** 174 * @license 175 * Copyright 2025 Google LLC 176 * SPDX-License-Identifier: Apache-2.0 177 */class vA extends Kn{constructor(e,s=new yA(e)){super(),this.apiClient=e,this.documents=s,this.list=async(o={})=>new ni(Jn.PAGED_ITEM_FILE_SEARCH_STORES,a=>this.listInternal(a),await this.listInternal(o),o)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async create(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=lN(e);return c=ie("fileSearchStores",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>y)}}async get(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=dN(e);return c=ie("{name}",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>y)}}async delete(e){var s,o;let a="",c={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const d=uN(e);a=ie("{name}",d._url),c=d._query,delete d._url,delete d._query,await this.apiClient.request({path:a,queryParams:c,body:JSON.stringify(d),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=yN(e);return c=ie("fileSearchStores",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=vN(y),v=new WS;return Object.assign(v,f),v})}}async uploadToFileSearchStoreInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=xN(e);return c=ie("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=bN(y),v=new XS;return Object.assign(v,f),v})}}async importFile(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=mN(e);return c=ie("{file_search_store_name}:importFile",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json()),a.then(y=>{const f=fN(y),v=new fd;return Object.assign(v,f),v})}}}/** 178 * @license 179 * Copyright 2025 Google LLC 180 * SPDX-License-Identifier: Apache-2.0 181 */let ky=function(){const{crypto:n}=globalThis;if(n!=null&&n.randomUUID)return ky=n.randomUUID.bind(n),n.randomUUID();const e=new Uint8Array(1),s=n?()=>n.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^s()&15>>+o/4).toString(16))};const xA=()=>ky();/** 182 * @license 183 * Copyright 2025 Google LLC 184 * SPDX-License-Identifier: Apache-2.0 185 */function Zu(n){return typeof n=="object"&&n!==null&&("name"in n&&n.name==="AbortError"||"message"in n&&String(n.message).includes("FetchRequestCanceledException"))}const ed=n=>{if(n instanceof Error)return n;if(typeof n=="object"&&n!==null){try{if(Object.prototype.toString.call(n)==="[object Error]"){const e=new Error(n.message,n.cause?{cause:n.cause}:{});return n.stack&&(e.stack=n.stack),n.cause&&!e.cause&&(e.cause=n.cause),n.name&&(e.name=n.name),e}}catch{}try{return new Error(JSON.stringify(n))}catch{}}return new Error(n)};/** 186 * @license 187 * Copyright 2025 Google LLC 188 * SPDX-License-Identifier: Apache-2.0
189 */class un extends Error{}class Et extends un{constructor(e,s,o,a){super(`${Et.makeMessage(e,s,o)}`),this.status=e,this.headers=a,this.error=s}static makeMessage(e,s,o){const a=s!=null&&s.message?typeof s.message=="string"?s.message:JSON.stringify(s.message):s?JSON.stringify(s):o;return e&&a?`${e} ${a}`:e?`${e} status code (no body)`:a||"(no status code or body)"}static generate(e,s,o,a){if(!e||!a)return new il({message:o,cause:ed(s)});const c=s;return e===400?new Iy(e,c,o,a):e===401?new My(e,c,o,a):e===403?new Dy(e,c,o,a):e===404?new Uy(e,c,o,a):e===409?new Ly(e,c,o,a):e===422?new Py(e,c,o,a):e===429?new Oy(e,c,o,a):e>=500?new Gy(e,c,o,a):new Et(e,c,o,a)}}class td extends Et{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class il extends Et{constructor({message:e,cause:s}){super(void 0,void 0,e||"Connection error.",void 0),s&&(this.cause=s)}}class jy extends il{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Iy extends Et{}class My extends Et{}class Dy extends Et{}class Uy extends Et{}class Ly extends Et{}class Py extends Et{}class Oy extends Et{}class Gy extends Et{}/** 190 * @license 191 * Copyright 2025 Google LLC 192 * SPDX-License-Identifier: Apache-2.0 193 */const bA=/^[a-z][a-z0-9+.-]*:/i,wA=n=>bA.test(n);let nd=n=>(nd=Array.isArray,nd(n));const SA=nd;let _A=SA;const R0=_A;function TA(n){if(!n)return!0;for(const e in n)return!1;return!0}function CA(n,e){return Object.prototype.hasOwnProperty.call(n,e)}const EA=(n,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new un(`${n} must be an integer`);if(e<0)throw new un(`${n} must be a positive integer`);return e},NA=n=>{try{return JSON.parse(n)}catch{return}};/** 194 * @license 195 * Copyright 2025 Google LLC 196 * SPDX-License-Identifier: Apache-2.0 197 */const AA=n=>new Promise(e=>setTimeout(e,n));/** 198 * @license 199 * Copyright 2025 Google LLC 200 * SPDX-License-Identifier: Apache-2.0 201 */const Xi="0.0.1";/** 202 * @license 203 * Copyright 2025 Google LLC 204 * SPDX-License-Identifier: Apache-2.0 205 */function RA(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const kA=()=>{var n,e,s,o,a;const c=RA();if(c==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Xi,"X-Stainless-OS":j0(Deno.build.os),"X-Stainless-Arch":k0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(e=(n=Deno.version)===null||n===void 0?void 0:n.deno)!==null&&e!==void 0?e:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Xi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(c==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Xi,"X-Stainless-OS":j0((s=globalThis.process.platform)!==null&&s!==void 0?s:"unknown"),"X-Stainless-Arch":k0((o=globalThis.process.arch)!==null&&o!==void 0?o:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(a=globalThis.process.version)!==null&&a!==void 0?a:"unknown"};const d=jA();return d?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Xi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${d.browser}`,"X-Stainless-Runtime-Version":d.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Xi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function jA(){if(typeof navigator>"u"||!navigator)return null;const n=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:e,pattern:s}of n){const o=s.exec(navigator.userAgent);if(o){const a=o[1]||0,c=o[2]||0,d=o[3]||0;return{browser:e,version:`${a}.${c}.${d}`}}}return null}const k0=n=>n==="x32"?"x32":n==="x86_64"||n==="x64"?"x64":n==="arm"?"arm":n==="aarch64"||n==="arm64"?"arm64":n?`other:${n}`:"unknown",j0=n=>(n=n.toLowerCase(),n.includes("ios")?"iOS":n==="android"?"Android":n==="darwin"?"MacOS":n==="win32"?"Windows":n==="freebsd"?"FreeBSD":n==="openbsd"?"OpenBSD":n==="linux"?"Linux":n?`Other:${n}`:"Unknown");let Ur;const IA=()=>Ur??(Ur=kA());/** 206 * @license 207 * Copyright 2025 Google LLC 208 * SPDX-License-Identifier: Apache-2.0 209 */function MA(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function qy(...n){const e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...n)}function DA(n){let e=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():n[Symbol.iterator]();return qy({start(){},async pull(s){const{done:o,value:a}=await e.next();o?s.close():s.enqueue(a)},async cancel(){var s;await((s=e.return)===null||s===void 0?void 0:s.call(e))}})}function By(n){if(n[Symbol.asyncIterator])return n;const e=n.getReader();return{async next(){try{const s=await e.read();return s!=null&&s.done&&e.releaseLock(),s}catch(s){throw e.releaseLock(),s}},async return(){const s=e.cancel();return e.releaseLock(),await s,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function UA(n){var e,s;if(n===null||typeof n!="object")return;if(n[Symbol.asyncIterator]){await((s=(e=n[Symbol.asyncIterator]()).return)===null||s===void 0?void 0:s.call(e));return}const o=n.getReader(),a=o.cancel();o.releaseLock(),await a}/** 210 * @license 211 * Copyright 2025 Google LLC 212 * SPDX-License-Identifier: Apache-2.0 213 */const LA=({headers:n,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});/** 214 * @license 215 * Copyright 2025 Google LLC 216 * SPDX-License-Identifier: Apache-2.0 217 */const Hy=()=>{var n;if(typeof File>"u"){const{process:e}=globalThis,s=typeof((n=e==null?void 0:e.versions)===null||n===void 0?void 0:n.node)=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(s?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Du(n,e,s){return Hy(),new File(n,e??"unknown_file",s)}function PA(n){return(typeof n=="object"&&n!==null&&("name"in n&&n.name&&String(n.name)||"url"in n&&n.url&&String(n.url)||"filename"in n&&n.filename&&String(n.filename)||"path"in n&&n.path&&String(n.path))||"").split(/[\\/]/).pop()||void 0}const OA=n=>n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function";/** 218 * @license 219 * Copyright 2025 Google LLC 220 * SPDX-License-Identifier: Apache-2.0 221 */const zy=n=>n!=null&&typeof n=="object"&&typeof n.size=="number"&&typeof n.type=="string"&&typeof n.text=="function"&&typeof n.slice=="function"&&typeof n.arrayBuffer=="function",GA=n=>n!=null&&typeof n=="object"&&typeof n.name=="string"&&typeof n.lastModified=="number"&&zy(n),qA=n=>n!=null&&typeof n=="object"&&typeof n.url=="string"&&typeof n.blob=="function";async function BA(n,e,s){if(Hy(),n=await n,GA(n))return n instanceof File?n:Du([await n.arrayBuffer()],n.name);if(qA(n)){const a=await n.blob();return e||(e=new URL(n.url).pathname.split(/[\\/]/).pop()),Du(await sd(a),e,s)}const o=await sd(n);if(e||(e=PA(n)),!(s!=null&&s.type)){const a=o.find(c=>typeof c=="object"&&"type"in c&&c.type);
221typeof a=="string"&&(s=Object.assign(Object.assign({},s),{type:a}))}return Du(o,e,s)}async function sd(n){var e,s,o,a,c;let d=[];if(typeof n=="string"||ArrayBuffer.isView(n)||n instanceof ArrayBuffer)d.push(n);else if(zy(n))d.push(n instanceof Blob?n:await n.arrayBuffer());else if(OA(n))try{for(var m=!0,y=bn(n),f;f=await y.next(),e=f.done,!e;m=!0){a=f.value,m=!1;const v=a;d.push(...await sd(v))}}catch(v){s={error:v}}finally{try{!m&&!e&&(o=y.return)&&await o.call(y)}finally{if(s)throw s.error}}else{const v=(c=n==null?void 0:n.constructor)===null||c===void 0?void 0:c.name;throw new Error(`Unexpected data type: ${typeof n}${v?`; constructor: ${v}`:""}${HA(n)}`)}return d}function HA(n){return typeof n!="object"||n===null?"":`; props: [${Object.getOwnPropertyNames(n).map(s=>`"${s}"`).join(", ")}]`}/** 222 * @license 223 * Copyright 2025 Google LLC 224 * SPDX-License-Identifier: Apache-2.0 225 */class Vy{constructor(e){this._client=e}}Vy._key=[];/** 226 * @license 227 * Copyright 2025 Google LLC 228 * SPDX-License-Identifier: Apache-2.0 229 */function Fy(n){return n.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const I0=Object.freeze(Object.create(null)),zA=(n=Fy)=>(function(s,...o){if(s.length===1)return s[0];let a=!1;const c=[],d=s.reduce((v,b,w)=>{var _,C,A;/[?#]/.test(b)&&(a=!0);const E=o[w];let I=(a?encodeURIComponent:n)(""+E);return w!==o.length&&(E==null||typeof E=="object"&&E.toString===((A=Object.getPrototypeOf((C=Object.getPrototypeOf((_=E.hasOwnProperty)!==null&&_!==void 0?_:I0))!==null&&C!==void 0?C:I0))===null||A===void 0?void 0:A.toString))&&(I=E+"",c.push({start:v.length+b.length,length:I.length,error:`Value of type ${Object.prototype.toString.call(E).slice(8,-1)} is not a valid path parameter`})),v+b+(w===o.length?"":I)},""),m=d.split(/[?#]/,1)[0],y=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let f;for(;(f=y.exec(m))!==null;)c.push({start:f.index,length:f[0].length,error:`Value "${f[0]}" can't be safely passed as a path parameter`});if(c.sort((v,b)=>v.start-b.start),c.length>0){let v=0;const b=c.reduce((w,_)=>{const C=" ".repeat(_.start-v),A="^".repeat(_.length);return v=_.start+_.length,w+C+A},"");throw new un(`Path parameters result in path with invalid segments: 230${c.map(w=>w.error).join(` 231`)} 232${d} 233${b}`)}return d}),Lr=zA(Fy);/** 234 * @license 235 * Copyright 2025 Google LLC 236 * SPDX-License-Identifier: Apache-2.0 237 */class $y extends Vy{create(e,s){var o;const{api_version:a=this._client.apiVersion}=e,c=Kr(e,["api_version"]);if("model"in c&&"agent_config"in c)throw new un("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in c&&"generation_config"in c)throw new un("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Lr`/${a}/interactions`,Object.assign(Object.assign({body:c},s),{stream:(o=e.stream)!==null&&o!==void 0?o:!1}))}delete(e,s={},o){const{api_version:a=this._client.apiVersion}=s??{};return this._client.delete(Lr`/${a}/interactions/${e}`,o)}cancel(e,s={},o){const{api_version:a=this._client.apiVersion}=s??{};return this._client.post(Lr`/${a}/interactions/${e}/cancel`,o)}get(e,s={},o){var a;const c=s??{},{api_version:d=this._client.apiVersion}=c,m=Kr(c,["api_version"]);return this._client.get(Lr`/${d}/interactions/${e}`,Object.assign(Object.assign({query:m},o),{stream:(a=s==null?void 0:s.stream)!==null&&a!==void 0?a:!1}))}}$y._key=Object.freeze(["interactions"]);class Yy extends $y{}/** 238 * @license 239 * Copyright 2025 Google LLC 240 * SPDX-License-Identifier: Apache-2.0 241 */function VA(n){let e=0;for(const a of n)e+=a.length;const s=new Uint8Array(e);let o=0;for(const a of n)s.set(a,o),o+=a.length;return s}let Pr;function bd(n){let e;return(Pr??(e=new globalThis.TextEncoder,Pr=e.encode.bind(e)))(n)}let Or;function M0(n){let e;return(Or??(e=new globalThis.TextDecoder,Or=e.decode.bind(e)))(n)}/** 242 * @license 243 * Copyright 2025 Google LLC 244 * SPDX-License-Identifier: Apache-2.0 245 */class ol{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(e){if(e==null)return[];const s=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?bd(e):e;this.buffer=VA([this.buffer,s]);const o=[];let a;for(;(a=FA(this.buffer,this.carriageReturnIndex))!=null;){if(a.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=a.index;continue}if(this.carriageReturnIndex!=null&&(a.index!==this.carriageReturnIndex+1||a.carriage)){o.push(M0(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const c=this.carriageReturnIndex!==null?a.preceding-1:a.preceding,d=M0(this.buffer.subarray(0,c));o.push(d),this.buffer=this.buffer.subarray(a.index),this.carriageReturnIndex=null}return o}flush(){return this.buffer.length?this.decode(` 246`):[]}}ol.NEWLINE_CHARS=new Set([` 247`,"\r"]);ol.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function FA(n,e){for(let a=e??0;a<n.length;a++){if(n[a]===10)return{preceding:a,index:a+1,carriage:!1};if(n[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function $A(n){for(let o=0;o<n.length-1;o++){if(n[o]===10&&n[o+1]===10||n[o]===13&&n[o+1]===13)return o+2;if(n[o]===13&&n[o+1]===10&&o+3<n.length&&n[o+2]===13&&n[o+3]===10)return o+4}return-1}/** 248 * @license 249 * Copyright 2025 Google LLC 250 * SPDX-License-Identifier: Apache-2.0 251 */const Qr={off:0,error:200,warn:300,info:400,debug:500}
251,D0=(n,e,s)=>{if(n){if(CA(Qr,n))return n;Ct(s).warn(`${e} was set to ${JSON.stringify(n)}, expected one of ${JSON.stringify(Object.keys(Qr))}`)}};function da(){}function Gr(n,e,s){return!e||Qr[n]>Qr[s]?da:e[n].bind(e)}const YA={error:da,warn:da,info:da,debug:da};let U0=new WeakMap;function Ct(n){var e;const s=n.logger,o=(e=n.logLevel)!==null&&e!==void 0?e:"off";if(!s)return YA;const a=U0.get(s);if(a&&a[0]===o)return a[1];const c={error:Gr("error",s,o),warn:Gr("warn",s,o),info:Gr("info",s,o),debug:Gr("debug",s,o)};return U0.set(s,[o,c]),c}const Zs=n=>(n.options&&(n.options=Object.assign({},n.options),delete n.options.headers),n.headers&&(n.headers=Object.fromEntries((n.headers instanceof Headers?[...n.headers]:Object.entries(n.headers)).map(([e,s])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":s]))),"retryOfRequestLogID"in n&&(n.retryOfRequestLogID&&(n.retryOf=n.retryOfRequestLogID),delete n.retryOfRequestLogID),n);/** 252 * @license 253 * Copyright 2025 Google LLC 254 * SPDX-License-Identifier: Apache-2.0 255 */class eo{constructor(e,s,o){this.iterator=e,this.controller=s,this.client=o}static fromSSEResponse(e,s,o){let a=!1;const c=o?Ct(o):console;function d(){return xn(this,arguments,function*(){var y,f,v,b;if(a)throw new un("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let w=!1;try{try{for(var _=!0,C=bn(JA(e,s)),A;A=yield ye(C.next()),y=A.done,!y;_=!0){b=A.value,_=!1;const E=b;if(!w)if(E.data.startsWith("[DONE]")){w=!0;continue}else try{yield yield ye(JSON.parse(E.data))}catch(I){throw c.error("Could not parse message into JSON:",E.data),c.error("From chunk:",E.raw),I}}}catch(E){f={error:E}}finally{try{!_&&!y&&(v=C.return)&&(yield ye(v.call(C)))}finally{if(f)throw f.error}}w=!0}catch(E){if(Zu(E))return yield ye(void 0);throw E}finally{w||s.abort()}})}return new eo(d,s,o)}static fromReadableStream(e,s,o){let a=!1;function c(){return xn(this,arguments,function*(){var y,f,v,b;const w=new ol,_=By(e);try{for(var C=!0,A=bn(_),E;E=yield ye(A.next()),y=E.done,!y;C=!0){b=E.value,C=!1;const I=b;for(const U of w.decode(I))yield yield ye(U)}}catch(I){f={error:I}}finally{try{!C&&!y&&(v=A.return)&&(yield ye(v.call(A)))}finally{if(f)throw f.error}}for(const I of w.flush())yield yield ye(I)})}function d(){return xn(this,arguments,function*(){var y,f,v,b;if(a)throw new un("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let w=!1;try{try{for(var _=!0,C=bn(c()),A;A=yield ye(C.next()),y=A.done,!y;_=!0){b=A.value,_=!1;const E=b;w||E&&(yield yield ye(JSON.parse(E)))}}catch(E){f={error:E}}finally{try{!_&&!y&&(v=C.return)&&(yield ye(v.call(C)))}finally{if(f)throw f.error}}w=!0}catch(E){if(Zu(E))return yield ye(void 0);throw E}finally{w||s.abort()}})}return new eo(d,s,o)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],s=[],o=this.iterator(),a=c=>({next:()=>{if(c.length===0){const d=o.next();e.push(d),s.push(d)}return c.shift()}});return[new eo(()=>a(e),this.controller,this.client),new eo(()=>a(s),this.controller,this.client)]}toReadableStream(){const e=this;let s;return qy({async start(){s=e[Symbol.asyncIterator]()},async pull(o){try{const{value:a,done:c}=await s.next();if(c)return o.close();const d=bd(JSON.stringify(a)+` 256`);o.enqueue(d)}catch(a){o.error(a)}},async cancel(){var o;await((o=s.return)===null||o===void 0?void 0:o.call(s))}})}}function JA(n,e){return xn(this,arguments,function*(){var o,a,c,d;
256if(!n.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new un("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new un("Attempted to iterate over a response with no body");const m=new QA,y=new ol,f=By(n.body);try{for(var v=!0,b=bn(KA(f)),w;w=yield ye(b.next()),o=w.done,!o;v=!0){d=w.value,v=!1;const _=d;for(const C of y.decode(_)){const A=m.decode(C);A&&(yield yield ye(A))}}}catch(_){a={error:_}}finally{try{!v&&!o&&(c=b.return)&&(yield ye(c.call(b)))}finally{if(a)throw a.error}}for(const _ of y.flush()){const C=m.decode(_);C&&(yield yield ye(C))}})}function KA(n){return xn(this,arguments,function*(){var s,o,a,c;let d=new Uint8Array;try{for(var m=!0,y=bn(n),f;f=yield ye(y.next()),s=f.done,!s;m=!0){c=f.value,m=!1;const v=c;if(v==null)continue;const b=v instanceof ArrayBuffer?new Uint8Array(v):typeof v=="string"?bd(v):v;let w=new Uint8Array(d.length+b.length);w.set(d),w.set(b,d.length),d=w;let _;for(;(_=$A(d))!==-1;)yield yield ye(d.slice(0,_)),d=d.slice(_)}}catch(v){o={error:v}}finally{try{!m&&!s&&(a=y.return)&&(yield ye(a.call(y)))}finally{if(o)throw o.error}}d.length>0&&(yield yield ye(d))})}class QA{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const c={event:this.event,data:this.data.join(` 257`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],c}if(this.chunks.push(e),e.startsWith(":"))return null;let[s,o,a]=WA(e,":");return a.startsWith(" ")&&(a=a.substring(1)),s==="event"?this.event=a:s==="data"&&this.data.push(a),null}}function WA(n,e){const s=n.indexOf(e);return s!==-1?[n.substring(0,s),e,n.substring(s+e.length)]:[n,"",""]}/** 258 * @license 259 * Copyright 2025 Google LLC 260 * SPDX-License-Identifier: Apache-2.0 261 */async function XA(n,e){const{response:s,requestLogID:o,retryOfRequestLogID:a,startTime:c}=e,d=await(async()=>{var m;if(e.options.stream)return Ct(n).debug("response",s.status,s.url,s.headers,s.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(s,e.controller,n):eo.fromSSEResponse(s,e.controller,n);if(s.status===204)return null;if(e.options.__binaryResponse)return s;const y=s.headers.get("content-type"),f=(m=y==null?void 0:y.split(";")[0])===null||m===void 0?void 0:m.trim();return(f==null?void 0:f.includes("application/json"))||(f==null?void 0:f.endsWith("+json"))?await s.json():await s.text()})();return Ct(n).debug(`[${o}] response parsed`,Zs({retryOfRequestLogID:a,url:s.url,status:s.status,body:d,durationMs:Date.now()-c})),d}/** 262 * @license 263 * Copyright 2025 Google LLC 264 * SPDX-License-Identifier: Apache-2.0 265 */class wd extends Promise{constructor(e,s,o=XA){super(a=>{a(null)}),this.responsePromise=s,this.parseResponse=o,this.client=e}_thenUnwrap(e){return new wd(this.client,this.responsePromise,async(s,o)=>e(await this.parseResponse(s,o),o))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,s]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:s}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,s){return this.parse().then(e,s)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}/** 266 * @license 267 * Copyright 2025 Google LLC 268 * SPDX-License-Identifier: Apache-2.0 269 */const Jy=Symbol("brand.privateNullableHeaders");function*ZA(n){if(!n)return;if(Jy in n){const{values:o,nulls:a}=n;yield*o.entries();for(const c of a)yield[c,null];return}let e=!1,s;n instanceof Headers?s=n.entries():R0(n)?s=n:(e=!0,s=Object.entries(n??{}));for(let o of s){const a=o[0];if(typeof a!="string")throw new TypeError("expected header name to be a string");const c=R0(o[1])?o[1]:[o[1]];let d=!1;for(const m of c)m!==void 0&&(e&&!d&&(d=!0,yield[a,null]),yield[a,m])}}const la=n=>{const e=new Headers,s=new Set;for(const o of n){const a=new Set;for(const[c,d]of ZA(o)){const m=c.toLowerCase();a.has(m)||(e.delete(c),a.add(m)),d===null?(e.delete(c),s.add(m)):(e.append(c,d),s.delete(m))}}return{[Jy]:!0,values:e,nulls:s}};/** 270 * @license 271 * Copyright 2025 Google LLC 272 * SPDX-License-Identifier: Apache-2.0 273 */const Uu=n=>{var e,s,o,a,c,d;
273if(typeof globalThis.process<"u")return(o=(s=(e=CS)===null||e===void 0?void 0:e[n])===null||s===void 0?void 0:s.trim())!==null&&o!==void 0?o:void 0;if(typeof globalThis.Deno<"u")return(d=(c=(a=globalThis.Deno.env)===null||a===void 0?void 0:a.get)===null||c===void 0?void 0:c.call(a,n))===null||d===void 0?void 0:d.trim()};/** 274 * @license 275 * Copyright 2025 Google LLC 276 * SPDX-License-Identifier: Apache-2.0 277 */var Ky;class al{constructor(e){var s,o,a,c,d,m,y,{baseURL:f=Uu("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:v=(s=Uu("GEMINI_API_KEY"))!==null&&s!==void 0?s:null,apiVersion:b="v1beta"}=e,w=Kr(e,["baseURL","apiKey","apiVersion"]);const _=Object.assign(Object.assign({apiKey:v,apiVersion:b},w),{baseURL:f||"https://generativelanguage.googleapis.com"});this.baseURL=_.baseURL,this.timeout=(o=_.timeout)!==null&&o!==void 0?o:al.DEFAULT_TIMEOUT,this.logger=(a=_.logger)!==null&&a!==void 0?a:console;const C="warn";this.logLevel=C,this.logLevel=(d=(c=D0(_.logLevel,"ClientOptions.logLevel",this))!==null&&c!==void 0?c:D0(Uu("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&d!==void 0?d:C,this.fetchOptions=_.fetchOptions,this.maxRetries=(m=_.maxRetries)!==null&&m!==void 0?m:2,this.fetch=(y=_.fetch)!==null&&y!==void 0?y:MA(),this.encoder=LA,this._options=_,this.apiKey=v,this.apiVersion=b,this.clientAdapter=_.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:s}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!s.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){const s=la([e.headers]);if(!(s.values.has("authorization")||s.values.has("x-goog-api-key"))){if(this.apiKey)return la([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return la([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([s,o])=>typeof o<"u").map(([s,o])=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return`${encodeURIComponent(s)}=${encodeURIComponent(o)}`;if(o===null)return`${encodeURIComponent(s)}=`;throw new un(`Cannot stringify type ${typeof o}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Xi}`}defaultIdempotencyKey(){return`stainless-node-retry-${xA()}`}makeStatusError(e,s,o,a){return Et.generate(e,s,o,a)}buildURL(e,s,o){const a=!this.baseURLOverridden()&&o||this.baseURL,c=wA(e)?new URL(e):new URL(a+(a.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),d=this.defaultQuery();return TA(d)||(s=Object.assign(Object.assign({},d),s)),typeof s=="object"&&s&&!Array.isArray(s)&&(c.search=this.stringifyQuery(s)),c.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){const s=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${s}`}}async prepareRequest(e,{url:s,options:o}){}get(e,s){return this.methodRequest("get",e,s)}post(e,s){return this.methodRequest("post",e,s)}patch(e,s){return this.methodRequest("patch",e,s)}put(e,s){return this.methodRequest("put",e,s)}delete(e,s){return this.methodRequest("delete",e,s)}methodRequest(e,s,o){return this.request(Promise.resolve(o).then(a=>Object.assign({method:e,path:s},a)))}
277request(e,s=null){return new wd(this,this.makeRequest(e,s,void 0))}async makeRequest(e,s,o){var a,c,d;const m=await e,y=(a=m.maxRetries)!==null&&a!==void 0?a:this.maxRetries;s==null&&(s=y),await this.prepareOptions(m);const{req:f,url:v,timeout:b}=await this.buildRequest(m,{retryCount:y-s});await this.prepareRequest(f,{url:v,options:m});const w="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),_=o===void 0?"":`, retryOf: ${o}`,C=Date.now();if(Ct(this).debug(`[${w}] sending request`,Zs({retryOfRequestLogID:o,method:m.method,url:v,options:m,headers:f.headers})),!((c=m.signal)===null||c===void 0)&&c.aborted)throw new td;const A=new AbortController,E=await this.fetchWithTimeout(v,f,b,A).catch(ed),I=Date.now();if(E instanceof globalThis.Error){const G=`retrying, ${s} attempts remaining`;if(!((d=m.signal)===null||d===void 0)&&d.aborted)throw new td;const F=Zu(E)||/timed? ?out/i.test(String(E)+("cause"in E?String(E.cause):""));if(s)return Ct(this).info(`[${w}] connection ${F?"timed out":"failed"} - ${G}`),Ct(this).debug(`[${w}] connection ${F?"timed out":"failed"} (${G})`,Zs({retryOfRequestLogID:o,url:v,durationMs:I-C,message:E.message})),this.retryRequest(m,s,o??w);throw Ct(this).info(`[${w}] connection ${F?"timed out":"failed"} - error; no more retries left`),Ct(this).debug(`[${w}] connection ${F?"timed out":"failed"} (error; no more retries left)`,Zs({retryOfRequestLogID:o,url:v,durationMs:I-C,message:E.message})),F?new jy:new il({cause:E})}const U=`[${w}${_}] ${f.method} ${v} ${E.ok?"succeeded":"failed"} with status ${E.status} in ${I-C}ms`;if(!E.ok){const G=await this.shouldRetry(E);if(s&&G){const X=`retrying, ${s} attempts remaining`;return await UA(E.body),Ct(this).info(`${U} - ${X}`),Ct(this).debug(`[${w}] response error (${X})`,Zs({retryOfRequestLogID:o,url:E.url,status:E.status,headers:E.headers,durationMs:I-C})),this.retryRequest(m,s,o??w,E.headers)}const F=G?"error; no more retries left":"error; not retryable";Ct(this).info(`${U} - ${F}`);const P=await E.text().catch(X=>ed(X).message),$=NA(P),H=$?void 0:P;throw Ct(this).debug(`[${w}] response error (${F})`,Zs({retryOfRequestLogID:o,url:E.url,status:E.status,headers:E.headers,message:H,durationMs:Date.now()-C})),this.makeStatusError(E.status,$,H,E.headers)}return Ct(this).info(U),Ct(this).debug(`[${w}] response start`,Zs({retryOfRequestLogID:o,url:E.url,status:E.status,headers:E.headers,durationMs:I-C})),{response:E,options:m,controller:A,requestLogID:w,retryOfRequestLogID:o,startTime:C}}async fetchWithTimeout(e,s,o,a){const c=s||{},{signal:d,method:m}=c,y=Kr(c,["signal","method"]);d&&d.addEventListener("abort",()=>a.abort());const f=setTimeout(()=>a.abort(),o),v=globalThis.ReadableStream&&y.body instanceof globalThis.ReadableStream||typeof y.body=="object"&&y.body!==null&&Symbol.asyncIterator in y.body,b=Object.assign(Object.assign(Object.assign({signal:a.signal},v?{duplex:"half"}:{}),{method:"GET"}),y);m&&(b.method=m.toUpperCase());try{return await this.fetch.call(void 0,e,b)}finally{clearTimeout(f)}}async shouldRetry(e){const s=e.headers.get("x-should-retry");return s==="true"?!0:s==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,s,o,a){var c;let d;const m=a==null?void 0:a.get("retry-after-ms");if(m){const f=parseFloat(m);Number.isNaN(f)||(d=f)}const y=a==null?void 0:a.get("retry-after");if(y&&!d){const f=parseFloat(y);Number.isNaN(f)?d=Date.parse(y)-Date.now():d=f*1e3}if(!(d&&0<=d&&d<60*1e3)){const f=(c=e.maxRetries)!==null&&c!==void 0?c:this.maxRetries;d=this.calculateDefaultRetryTimeoutMillis(s,f)}return await AA(d),this.makeRequest(e,s-1,o)}calculateDefaultRetryTimeoutMillis(e,s){const c=s-e,d=Math.min(.5*Math.pow(2,c),8),m=1-Math.random()*.25;return d*m*1e3}async buildRequest(e,{retryCount:s=0}={}){var o,a,c;const d=Object.assign({},e),{method:m,path:y,query:f,defaultBaseURL:v}=d,b=this.buildURL(y,f,v);"timeout"in d&&EA("timeout",d.timeout),d.timeout=(o=d.timeout)!==null&&o!==void 0?o:this.timeout;const{bodyHeaders:w,body:_}=this.buildBody({options:d}),C=await this.buildHeaders({options:e,method:m,bodyHeaders:w,retryCount:s});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:m,headers:C},d.signal&&{signal:d.signal}),globalThis.ReadableStream&&_ instanceof globalThis.ReadableStream&&{duplex:"half"}),_&&{body:_}),(a=this.fetchOptions)!==null&&a!==void 0?a:{}),(c=d.fetchOptions)!==null&&c!==void 0?c:{}),url:b,timeout:d.timeout}}async buildHeaders({options:e,method:s,bodyHeaders:o,retryCount:a}){let c={};this.idempotencyHeader&&s!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),c[this.idempotencyHeader]=e.idempotencyKey);const d=await this.authHeaders(e);let m=la([c,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a)},e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{}
277),IA()),this._options.defaultHeaders,o,e.headers,d]);return this.validateHeaders(m),m.values}buildBody({options:{body:e,headers:s}}){if(!e)return{bodyHeaders:void 0,body:void 0};const o=la([s]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&o.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:DA(e)}:this.encoder({body:e,headers:o})}}al.DEFAULT_TIMEOUT=6e4;class ht extends al{constructor(){super(...arguments),this.interactions=new Yy(this)}}Ky=ht;ht.GeminiNextGenAPIClient=Ky;ht.GeminiNextGenAPIClientError=un;ht.APIError=Et;ht.APIConnectionError=il;ht.APIConnectionTimeoutError=jy;ht.APIUserAbortError=td;ht.NotFoundError=Uy;ht.ConflictError=Ly;ht.RateLimitError=Oy;ht.BadRequestError=Iy;ht.AuthenticationError=My;ht.InternalServerError=Gy;ht.PermissionDeniedError=Dy;ht.UnprocessableEntityError=Py;ht.toFile=BA;ht.Interactions=Yy;/** 278 * @license 279 * Copyright 2025 Google LLC 280 * SPDX-License-Identifier: Apache-2.0 281 */function e1(n,e){const s={},o=h(n,["name"]);return o!=null&&p(s,["_url","name"],o),s}function t1(n,e){const s={},o=h(n,["name"]);return o!=null&&p(s,["_url","name"],o),s}function n1(n,e){const s={},o=h(n,["sdkHttpResponse"]);return o!=null&&p(s,["sdkHttpResponse"],o),s}function s1(n,e){const s={},o=h(n,["sdkHttpResponse"]);return o!=null&&p(s,["sdkHttpResponse"],o),s}function i1(n,e,s){const o={};if(h(n,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const a=h(n,["tunedModelDisplayName"]);if(e!==void 0&&a!=null&&p(e,["displayName"],a),h(n,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const c=h(n,["epochCount"]);e!==void 0&&c!=null&&p(e,["tuningTask","hyperparameters","epochCount"],c);const d=h(n,["learningRateMultiplier"]);if(d!=null&&p(o,["tuningTask","hyperparameters","learningRateMultiplier"],d),h(n,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(h(n,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(h(n,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const m=h(n,["batchSize"]);e!==void 0&&m!=null&&p(e,["tuningTask","hyperparameters","batchSize"],m);const y=h(n,["learningRate"]);if(e!==void 0&&y!=null&&p(e,["tuningTask","hyperparameters","learningRate"],y),h(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(h(n,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");return o}function o1(n,e,s){const o={};let a=h(s,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){const _=h(n,["validationDataset"]);e!==void 0&&_!=null&&p(e,["supervisedTuningSpec"],L0(_))}else if(a==="PREFERENCE_TUNING"){const _=h(n,["validationDataset"]);e!==void 0&&_!=null&&p(e,["preferenceOptimizationSpec"],L0(_))}const c=h(n,["tunedModelDisplayName"]);e!==void 0&&c!=null&&p(e,["tunedModelDisplayName"],c);const d=h(n,["description"]);e!==void 0&&d!=null&&p(e,["description"],d);let m=h(s,["config","method"]);if(m===void 0&&(m="SUPERVISED_FINE_TUNING"),m==="SUPERVISED_FINE_TUNING"){const _=h(n,["epochCount"]);e!==void 0&&_!=null&&p(e,["supervisedTuningSpec","hyperParameters","epochCount"],_)}else if(m==="PREFERENCE_TUNING"){const _=h(n,["epochCount"]);e!==void 0&&_!=null&&p(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],_)}let y=h(s,["config","method"]);if(y===void 0&&(y="SUPERVISED_FINE_TUNING"),y==="SUPERVISED_FINE_TUNING"){const _=h(n,["learningRateMultiplier"]);e!==void 0&&_!=null&&p(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],_)}else if(y==="PREFERENCE_TUNING"){const _=h(n,["learningRateMultiplier"]);e!==void 0&&_!=null&&p(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],_)}let f=h(s,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){const _=h(n,["exportLastCheckpointOnly"]);e!==void 0&&_!=null&&p(e,["supervisedTuningSpec","exportLastCheckpointOnly"],_)}else if(f==="PREFERENCE_TUNING"){const _=h(n,["exportLastCheckpointOnly"]);e!==void 0&&_!=null&&p(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],_)}let v=h(s,["config","method"]);if(v===void 0&&(v="SUPERVISED_FINE_TUNING"),v==="SUPERVISED_FINE_TUNING"){const _=h(n,["adapterSize"]);e!==void 0&&_!=null&&p(e,["supervisedTuningSpec","hyperParameters","adapterSize"],_)}else if(v==="PREFERENCE_TUNING"){const _=h(n,["adapterSize"]);e!==void 0&&_!=null&&p(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],_)}if(h(n,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");
281if(h(n,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");const b=h(n,["labels"]);e!==void 0&&b!=null&&p(e,["labels"],b);const w=h(n,["beta"]);return e!==void 0&&w!=null&&p(e,["preferenceOptimizationSpec","hyperParameters","beta"],w),o}function a1(n,e){const s={},o=h(n,["baseModel"]);o!=null&&p(s,["baseModel"],o);const a=h(n,["preTunedModel"]);a!=null&&p(s,["preTunedModel"],a);const c=h(n,["trainingDataset"]);c!=null&&y1(c);const d=h(n,["config"]);return d!=null&&i1(d,s),s}function r1(n,e){const s={},o=h(n,["baseModel"]);o!=null&&p(s,["baseModel"],o);const a=h(n,["preTunedModel"]);a!=null&&p(s,["preTunedModel"],a);const c=h(n,["trainingDataset"]);c!=null&&v1(c,s,e);const d=h(n,["config"]);return d!=null&&o1(d,s,e),s}function l1(n,e){const s={},o=h(n,["name"]);return o!=null&&p(s,["_url","name"],o),s}function c1(n,e){const s={},o=h(n,["name"]);return o!=null&&p(s,["_url","name"],o),s}function u1(n,e,s){const o={},a=h(n,["pageSize"]);e!==void 0&&a!=null&&p(e,["_query","pageSize"],a);const c=h(n,["pageToken"]);e!==void 0&&c!=null&&p(e,["_query","pageToken"],c);const d=h(n,["filter"]);return e!==void 0&&d!=null&&p(e,["_query","filter"],d),o}function d1(n,e,s){const o={},a=h(n,["pageSize"]);e!==void 0&&a!=null&&p(e,["_query","pageSize"],a);const c=h(n,["pageToken"]);e!==void 0&&c!=null&&p(e,["_query","pageToken"],c);const d=h(n,["filter"]);return e!==void 0&&d!=null&&p(e,["_query","filter"],d),o}function h1(n,e){const s={},o=h(n,["config"]);return o!=null&&u1(o,s),s}function f1(n,e){const s={},o=h(n,["config"]);return o!=null&&d1(o,s),s}function m1(n,e){const s={},o=h(n,["sdkHttpResponse"]);o!=null&&p(s,["sdkHttpResponse"],o);const a=h(n,["nextPageToken"]);a!=null&&p(s,["nextPageToken"],a);const c=h(n,["tunedModels"]);if(c!=null){let d=c;Array.isArray(d)&&(d=d.map(m=>Qy(m))),p(s,["tuningJobs"],d)}return s}function p1(n,e){const s={},o=h(n,["sdkHttpResponse"]);o!=null&&p(s,["sdkHttpResponse"],o);const a=h(n,["nextPageToken"]);a!=null&&p(s,["nextPageToken"],a);const c=h(n,["tuningJobs"]);if(c!=null){let d=c;Array.isArray(d)&&(d=d.map(m=>id(m))),p(s,["tuningJobs"],d)}return s}function g1(n,e){const s={},o=h(n,["name"]);o!=null&&p(s,["model"],o);const a=h(n,["name"]);return a!=null&&p(s,["endpoint"],a),s}function y1(n,e){const s={};if(h(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(h(n,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const o=h(n,["examples"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(c=>c)),p(s,["examples","examples"],a)}return s}function v1(n,e,s){const o={};let a=h(s,["config","method"]);if(a===void 0&&(a="SUPERVISED_FINE_TUNING"),a==="SUPERVISED_FINE_TUNING"){const d=h(n,["gcsUri"]);e!==void 0&&d!=null&&p(e,["supervisedTuningSpec","trainingDatasetUri"],d)}else if(a==="PREFERENCE_TUNING"){const d=h(n,["gcsUri"]);e!==void 0&&d!=null&&p(e,["preferenceOptimizationSpec","trainingDatasetUri"],d)}let c=h(s,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){const d=h(n,["vertexDatasetResource"]);e!==void 0&&d!=null&&p(e,["supervisedTuningSpec","trainingDatasetUri"],d)}else if(c==="PREFERENCE_TUNING"){const d=h(n,["vertexDatasetResource"]);e!==void 0&&d!=null&&p(e,["preferenceOptimizationSpec","trainingDatasetUri"],d)}if(h(n,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return o}function Qy(n,e){const s={},o=h(n,["sdkHttpResponse"]);o!=null&&p(s,["sdkHttpResponse"],o);const a=h(n,["name"]);a!=null&&p(s,["name"],a);const c=h(n,["state"]);c!=null&&p(s,["state"],hy(c));const d=h(n,["createTime"]);d!=null&&p(s,["createTime"],d);const m=h(n,["tuningTask","startTime"]);m!=null&&p(s,["startTime"],m);const y=h(n,["tuningTask","completeTime"]);y!=null&&p(s,["endTime"],y);const f=h(n,["updateTime"]);f!=null&&p(s,["updateTime"],f);const v=h(n,["description"]);v!=null&&p(s,["description"],v);const b=h(n,["baseModel"]);b!=null&&p(s,["baseModel"],b);const w=h(n,["_self"]);return w!=null&&p(s,["tunedModel"],g1(w)),s}function id(n,e){const s={},o=h(n,["sdkHttpResponse"]);o!=null&&p(s,["sdkHttpResponse"],o);const a=h(n,["name"]);a!=null&&p(s,["name"],a);const c=h(n,["state"]);c!=null&&p(s,["state"],hy(c));const d=h(n,["createTime"]);d!=null&&p(s,["createTime"],d);const m=h(n,["startTime"]);m!=null&&p(s,["startTime"],m);const y=h(n,["endTime"]);y!=null&&p(s,["endTime"],y);const f=h(n,["updateTime"]);f!=null&&p(s,["updateTime"],f);const v=h(n,["error"]);v!=null&&p(s,["error"],v);const b=h(n,["description"]);b!=null&&p(s,["description"],b);const w=h(n,["baseModel"]);w!=null&&p(s,["baseModel"],w);const _=h(n,["tunedModel"]);_!=null&&p(s,["tunedModel"],_);const C=h(n,["preTunedModel"]);C!=null&&p(s,["preTunedModel"],C);const A=h(n,["supervisedTuningSpec"]);A!=null&&p(s,["supervisedTuningSpec"],A);const E=h(n,["preferenceOptimizationSpec"]);E!=null&&p(s,["preferenceOptimizationSpec"],E);const I=h(n,["tuningDataStats"]);I!=null&&p(s,["tuningDataStats"],I);const U=h(n,["encryptionSpec"]);U!=null&&p(s,["encryptionSpec"],U);const G=h(n,["partnerModelTuningSpec"]);G!=null&&p(s,["partnerModelTuningSpec"],G);const F=h(n,["customBaseModel"]);F!=null&&p(s,["customBaseModel"],F);const P=h(n,["experiment"]);P!=null&&p(s,["experiment"],P);const $=h(n,["labels"]);$!=null&&p(s,["labels"],$);const H=h(n,["outputUri"]);H!=null&&p(s,["outputUri"],H);const Z=h(n,["pipelineJob"]);Z!=null&&p(s,["pipelineJob"],Z);const X=h(n,["serviceAccount"]);X!=null&&p(s,["serviceAccount"],X);const q=h(n,["tunedModelDisplayName"]);q!=null&&p(s,["tunedModelDisplayName"],q);const Q=h(n,["veoTuningSpec"]);return Q!=null&&p(s,["veoTuningSpec"],Q),s}function x1(n,e){const s={},o=h(n,["sdkHttpResponse"]);o!=null&&p(s,["sdkHttpResponse"],o);const a=h(n,["name"]);a!=null&&p(s,["name"],a);const c=h(n,["metadata"]);c!=null&&p(s,["metadata"],c);const d=h(n,["done"]);d!=null&&p(s,["done"],d);const m=h(n,["error"]);return m!=null&&p(s,["error"],m),s}function L0(n,e){const s={},o=h(n,["gcsUri"]);o!=null&&p(s,["validationDatasetUri"],o);const a=h(n,["vertexDatasetResource"]);return a!=null&&p(s,["validationDatasetUri"],a),s}/** 282 * @license 283 * Copyright 2025 Google LLC 284 * SPDX-License-Identifier: Apache-2.0 285 */class b1 extends Kn{constructor(e){super(),this.apiClient=e,this.list=async(s={})=>new ni(Jn.PAGED_ITEM_TUNING_JOBS,o=>this.listInternal(o),await this.listInternal(s),s),this.get=async s=>await this.getInternal(s),this.tune=async s=>{var o;if(this.apiClient.isVertexAI())if(s.baseModel.startsWith("projects/")){const a={tunedModelName:s.baseModel};!((o=s.config)===null||o===void 0)&&o.preTunedModelCheckpointId&&(a.checkpointId=s.config.preTunedModelCheckpointId);const c=Object.assign(Object.assign({},s),{preTunedModel:a});return c.baseModel=void 0,await this.tuneInternal(c)}else{const a=Object.assign({},s);return await this.tuneInternal(a)}else{const a=Object.assign({},s),c=await this.tuneMldevInternal(a);let d="";return c.metadata!==void 0&&c.metadata.tunedModel!==void 0?d=c.metadata.tunedModel:c.name!==void 0&&c.name.includes("/operations/")&&(d=c.name.split("/operations/")[0]),{name:d,state:$u.JOB_STATE_QUEUED}}}}async getInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=c1(e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>id(v))}else{const f=l1(e);return m=ie("{name}",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>Qy(v))}}async listInternal(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=f1(e);return m=ie("tuningJobs",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=p1(v),w=new l0;return Object.assign(w,b),w})}else{const f=h1(e);return m=ie("tunedModels",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"GET",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=m1(v),w=new l0;return Object.assign(w,b),w})}}async cancel(e){var s,o,a,c;let d,m="",y={};if(this.apiClient.isVertexAI()){const f=t1(e);return m=ie("{name}:cancel",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=s1(v),w=new c0;return Object.assign(w,b),w})}else{const f=e1(e);return m=ie("{name}:cancel",f._url),y=f._query,delete f._url,delete f._query,d=this.apiClient.request({path:m,queryParams:y,body:JSON.stringify(f),httpMethod:"POST",httpOptions:(a=e.config)===null||a===void 0?void 0:a.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(b=>{const w=b;return w.sdkHttpResponse={headers:v.headers},w})),d.then(v=>{const b=n1(v),w=new c0;return Object.assign(w,b),w})}}async tuneInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI()){const m=r1(e,e);return c=ie("tuningJobs",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>id(y))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(e){var s,o;let a,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=a1(e);return c=ie("tunedModels",m._url),d=m._query,delete m._url,delete m._query,a=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(y=>y.json().then(f=>{const v=f;return v.sdkHttpResponse={headers:y.headers},v})),a.then(y=>x1(y))}}}/** 286 * @license 287 * Copyright 2025 Google LLC 288 * SPDX-License-Identifier: Apache-2.0 289 */class w1{async download(e,s){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const S1=1024*1024*8,_1=3,T1=1e3,C1=2,Wr="x-goog-upload-status";async function E1(n,e,s){var o;const a=await Wy(n,e,s),c=await(a==null?void 0:a.json());if(((o=a==null?void 0:a.headers)===null||o===void 0?void 0:o[Wr])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return c.file}async function N1(n,e,s){var o;const a=await Wy(n,e,s),c=await(a==null?void 0:a.json());if(((o=a==null?void 0:a.headers)===null||o===void 0?void 0:o[Wr])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const d=ay(c),m=new md;return Object.assign(m,d),m}async function Wy(n,e,s){var o,a;let c=0,d=0,m=new Yu(new Response),y="upload";for(c=n.size;d<c;){const f=Math.min(S1,c-d),v=n.slice(d,d+f);d+f>=c&&(y+=", finalize");let b=0,w=T1;for(;b<_1&&(m=await s.request({path:"",body:v,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:e,headers:{"X-Goog-Upload-Command":y,"X-Goog-Upload-Offset":String(d),"Content-Length":String(f)}}}),!(!((o=m==null?void 0:m.headers)===null||o===void 0)&&o[Wr]));)b++,await R1(w),w=w*C1;if(d+=f,((a=m==null?void 0:m.headers)===null||a===void 0?void 0:a[Wr])!=="active")break;if(c<=d)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return m}async function A1(n){return{size:n.size,type:n.type}}function R1(n){return new Promise(e=>setTimeout(e,n))}class k1{async upload(e,s,o){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await E1(e,s,o)}async uploadToFileSearchStore(e,s,o){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await N1(e,s,o)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await A1(e)}}/** 290 * @license 291 * Copyright 2025 Google LLC 292 * SPDX-License-Identifier: Apache-2.0 293 */class j1{create(e,s,o){return new I1(e,s,o)}}class I1{constructor(e,s,o){this.url=e,this.headers=s,this.callbacks=o}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose
293=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/** 294 * @license 295 * Copyright 2025 Google LLC 296 * SPDX-License-Identifier: Apache-2.0 297 */const P0="x-goog-api-key";class M1{constructor(e){this.apiKey=e}async addAuthHeaders(e,s){if(e.get(P0)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(P0,this.apiKey)}}}/** 298 * @license 299 * Copyright 2025 Google LLC 300 * SPDX-License-Identifier: Apache-2.0 301 */const D1="gl-node/";class Nt{get interactions(){if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const e=this.httpOptions;e!=null&&e.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const s=new ht({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:e==null?void 0:e.timeout});return this._interactions=s.interactions,this._interactions}constructor(e){var s;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(s=e.vertexai)!==null&&s!==void 0?s:!1,this.apiKey=e.apiKey;const o=RS(e.httpOptions,e.vertexai,void 0,void 0);o&&(e.httpOptions?e.httpOptions.baseUrl=o:e.httpOptions={baseUrl:o}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;const a=new M1(this.apiKey);this.apiClient=new AN({auth:a,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:D1+"web",uploader:new k1,downloader:new w1}),this.models=new YN(this.apiClient),this.live=new BN(this.apiClient,a,new j1),this.batches=new iT(this.apiClient),this.chats=new GT(this.models,this.apiClient),this.caches=new LT(this.apiClient),this.files=new KT(this.apiClient),this.operations=new JN(this.apiClient),this.authTokens=new uA(this.apiClient),this.tunings=new b1(this.apiClient),this.fileSearchStores=new vA(this.apiClient)}}const dn=({title:n,gradient:e,children:s})=>l.jsxs("div",{className:"mt-16 md:mt-24 pt-12 border-t-2 border-slate-200",children:[l.jsx("div",{className:"text-center",children:l.jsx("h2",{className:`text-3xl md:text-4xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r ${e}`,children:n})}),l.jsx("div",{className:"mt-8 prose prose-lg max-w-none text-slate-600 leading-relaxed",children:s})]}),qr=({text:n})=>{const e=n.split(/(\*\*.*?\*\*|\*.*?\*)/g);return l.jsx(l.Fragment,{children:e.map((s,o)=>s.startsWith("**")&&s.endsWith("**")?l.jsx("strong",{children:s.substring(2,s.length-2)},o):s.startsWith("*")&&s.endsWith("*")?l.jsx("em",{children:s.substring(1,s.length-1)},o):s)})},U1=({pitch:n})=>{const e=[],s=n.split(` 302`);let o=0;for(;o<s.length;){const a=s[o].trim();if(a.startsWith("# "))e.push({type:"h1",content:a.substring(2)}),o++;else if(a.startsWith("## "))e.push({type:"h2",content:a.substring(3)}),o++;else if(a.startsWith("- ")||a.startsWith("* ")){const c=[];for(;o<s.length&&(s[o].trim().startsWith("- ")||s[o].trim().startsWith("* "));)c.push(s[o].trim().substring(2)),o++;e.push({type:"ul",content:c})}else a.length>0&&e.push({type:"p",content:a}),o++}return l.jsx("div",{children:e.map((a,c)=>{switch(a.type){case"h1":return l.jsx("h1",{className:"text-3xl font-bold text-slate-800 mb-4",children:l.jsx(qr,{text:a.content})},c);case"h2":return l.jsx("h2",{className:"text-2xl font-bold text-slate-700 mt-6 mb-3",children:l.jsx(qr,{text:a.content})},c);case"p":return l.jsx("p",{className:"text-slate-600 leading-relaxed my-4",children:l.jsx(qr,{text:a.content})}
302,c);case"ul":return l.jsx("ul",{className:"list-disc list-outside pl-6 space-y-2 mb-4",children:a.content.map((d,m)=>l.jsx("li",{className:"text-slate-600 leading-relaxed",children:l.jsx(qr,{text:d})},m))},c);default:return null}})})},L1=()=>{const[n,e]=R.useState(0),[s,o]=R.useState({E:"",C:"",O:"",S:"",T:"",A:"",R:""}),[a,c]=R.useState(!1),[d,m]=R.useState(""),[y,f]=R.useState(""),v=Yt[n],b=A=>{const{name:E,value:I}=A.target;o(U=>({...U,[E]:I}))},w=async()=>{c(!0),f(""),m("");const A=`Based on the following ECO-STAR inputs, generate a concise and compelling innovation pitch. 303 Format the response using Markdown with the following structure: 304 - A main title (using a '#' heading). 305 - A short summary paragraph. 306 - A section for each ECO-STAR element (using '##' headings like '## Customer'). 307 - Bullet points under each section (using '-'). 308 - Use bold formatting for emphasis on key terms (e.g., **Key Term**). 309 310 - Environment (E): ${s.E} 311 - Customer (C): ${s.C} 312 - Opportunity (O): ${s.O} 313 - Solution (S): ${s.S} 314 - Team (T): ${s.T} 315 - Advantage (A): ${s.A} 316 - Results (R): ${s.R} 317 `;try{const I=await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:A});m(I.text)}catch(E){f("An error occurred while generating the pitch. Please try again."),console.error(E)}finally{c(!1)}},C={"text-teal-700":"focus:ring-teal-500","text-cyan-700":"focus:ring-cyan-500","text-rose-700":"focus:ring-rose-500","text-amber-700":"focus:ring-amber-500","text-indigo-700":"focus:ring-indigo-500","text-lime-700":"focus:ring-lime-500","text-fuchsia-700":"focus:ring-fuchsia-500"}[v.color]||"focus:ring-indigo-500";return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-rose-500",children:"Use ECO-STAR"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed text-center",children:"Use this interactive tool to build your own ECO-STAR. Fill out each section, and let AI help you craft the perfect pitch."}),l.jsxs("div",{className:`mt-12 bg-white border ${v.borderColor} rounded-2xl p-6 md:p-8 transition-all duration-300 shadow-sm`,children:[l.jsxs("div",{className:"flex items-start gap-6",children:[l.jsx("div",{className:`w-16 h-16 rounded-full flex-shrink-0 flex items-center justify-center font-black text-3xl ${v.color} ${v.bgColor} ${v.borderColor} border`,children:v.letter}),l.jsxs("div",{children:[l.jsx("h3",{className:`text-2xl font-bold ${v.color}`,children:v.title}),l.jsx("p",{className:"text-slate-500 mt-1 text-lg italic",children:v.question})]})]}),l.jsx("textarea",{name:v.letter,value:s[v.letter],onChange:b,rows:6,className:`w-full mt-6 bg-white border border-slate-300 rounded-lg p-4 text-slate-800 placeholder-slate-400 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition ${C}`,placeholder:`Brainstorm your ideas for "${v.title}" here...`})]}),l.jsxs("div",{className:"mt-6 flex justify-between items-center",children:[l.jsx("button",{onClick:()=>e(A=>Math.max(0,A-1)),disabled:n===0,className:"px-6 py-2.5 rounded-lg bg-white border border-slate-300 text-slate-600 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-slate-50 hover:text-slate-900 transition font-medium shadow-sm",children:"Previous"}),l.jsxs("span",{className:"text-slate-500 font-medium",children:["Step ",n+1," of ",Yt.length]}),n<Yt.length-1?l.jsx("button",{onClick:()=>e(A=>Math.min(Yt.length-1,A+1)),className:"px-6 py-2.5 rounded-lg bg-white border border-slate-300 text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition font-medium shadow-sm",children:"Next"}):l.jsx("button",{onClick:w,disabled:a,className:"px-6 py-2.5 rounded-lg bg-amber-600 text-white font-bold hover:bg-amber-700 transition disabled:opacity-50 disabled:cursor-wait shadow-md hover:shadow-lg",children:a?"Generating...":"Generate Pitch"})]}),(d||y||a)&&l.jsxs("div",{className:"mt-16",children:[l.jsx("h2",{className:"text-3xl font-bold text-center text-slate-900",children:"Your Innovation Pitch"}),l.jsxs("div",{className:"mt-6 bg-white p-8 rounded-xl border border-slate-200 shadow-sm min-h-[10rem] text-left",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Generating your pitch..."}),y&&l.jsx("div",{className:"text-center text-rose-600",children:y}),d&&l.jsx(U1,{pitch:d})]})]}),l.jsxs(dn,{title:"ECO-STAR: Your Story of Creating Value",gradient:"from-
317amber-400 to-rose-500",children:[l.jsx("p",{children:"Think of ECO-STAR not as a rigid business formula, but as a powerful narrative structure. Itâs a framework for telling a complete, compelling story about your ideaâa story that resonates with funders, partners, and the very community you aim to serve. In the worlds of art, community action, and climate innovation, a good story isn't just a pitch; it's how you build a movement."}),l.jsx("p",{children:"Each letter of ECO-STAR represents a crucial chapter in your innovation saga:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Environment:"})," What is the foundation of your story? This is the land, the ecosystem, the climate context. How does your idea honor its relationship with the natural world and contribute to a healthier planet?"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Customer:"})," Who is the hero of your story? This isn't a demographic; it's a person or community with real needs, dreams, and challenges. Your entire quest revolves around them."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Opportunity:"})," What is the wider world, the setting where your story unfolds? This is the contextâthe cultural shifts, the environmental pressures, the gaps in the current landscape that make your quest both timely and necessary."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Solution:"})," What is the magical gift, the transformative tool you are giving your hero? Itâs not just a product or service; it's the catalyst that empowers them to overcome their challenge."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Team:"})," Who are the trusted allies on this journey? This includes not only your core members but also the mentors, Elders, and community partners who bring essential wisdom and support."]}
317),l.jsxs("li",{children:[l.jsx("strong",{children:"Advantage:"})," What makes this particular quest unique? This is your special powerâthe secret sauce, the authentic voice, the deep community connection that no one else can replicate."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Results:"}),` What is the "happily ever after" you are creating? This is the vision of the future youâre buildingâa future with tangible, meaningful impact, whether that's a thriving local arts scene, a restored ecosystem, or a more connected community.`]})]}),l.jsx("p",{children:"By weaving these elements together, you move beyond a simple business plan. You craft a narrative of value, purpose, and impact that can inspire the hearts and minds needed to bring your vision to life."})]})]})})},P1=({text:n})=>l.jsx(l.Fragment,{children:n.split(/(\*\*.*?\*\*)/g).map((e,s)=>e.startsWith("**")&&e.endsWith("**")?l.jsx("strong",{className:"text-slate-900 font-semibold",children:e.substring(2,e.length-2)},s):e)}),O1=()=>{const[n,e]=R.useState(""),[s,o]=R.useState([]),[a,c]=R.useState(!1),[d,m]=R.useState(""),y=async()=>{if(!n.trim()){m("Please enter a problem statement.");return}c(!0),m(""),o([]);const f=` 318 Act as an expert innovation coach, like a modern-day combination of Clayton Christensen and a Zen master. 319 Your task is to help a user reframe their problem statement to uncover deeper, more elegant solutions, inspired by the "NASA spent millions on a pen, the Russians used a pencil" principle. 320 321 The user's initial problem is: "${n}" 322 323 Analyze this problem. Then, generate 3-4 distinct, reframed questions. Each question should: 324 1. Shift the perspective from the proposed solution to the core underlying need. 325 2. Be open-ended and thought-provoking. 326 3. Encourage simpler, more user-centric thinking. 327 328 Format your response as a simple list, with each reframed question on a new line, starting with a hyphen '-'. 329 Do not include any introductory or concluding text. Just the list. 330 Use bold formatting (**text**) for emphasis on key action words or concepts in your questions. 331 332 Example: 333 If the user says "I need to build a complex app to track inventory", you might respond with: 334 - How can we **know** our inventory levels with minimal effort? 335 - What is the **simplest way** for the team to see what's in stock? 336 - How might we **prevent** running out of items in the first place? 337 `;try{const w=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:f})).text.split(` 338`).map(_=>_.trim().replace(/^- /,"")).filter(_=>_.length>0);o(w)}catch(v){m("An error occurred while reframing the problem. Please try again."),console.error(v)}finally{c(!1)}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-lime-500 to-green-600",children:"The Reframing Challenge"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Sometimes the best solution comes from asking a better question. Describe a problem you're facing, and we'll help you reframe it to find a simpler path."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"problem",className:"block text-sm font-medium text-slate-600 mb-2",children:"Your Problem Statement"}),l.jsx("textarea",{id:"problem",rows:3,value:n,onChange:f=>e(f.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 text-slate-800 placeholder-slate-400 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-lime-500",placeholder:"e.g., I need to build a complicated website to sell my art."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:y,disabled:a,className:"px-8 py-3 rounded-lg bg-lime-600 text-white font-bold hover:bg-lime-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md hover:shadow-lg",children:a?"Reframing...":"Reframe My Problem"})})]}),(s.length>0||d||a)&&l.jsxs("div",{className:"mt-12",children:[l.jsx("h2",{className:"text-2xl font-bold text-center text-slate-900",children:"New Perspectives"}),l.jsxs("div",{className:"mt-6 space-y-4",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Thinking of new angles..."}),d&&l.jsx("div",{className:"text-center text-rose-600",children:d}),s.map((f,v)=>l.jsx("div",{className:"bg-white p-6 rounded-xl border border-lime-200
338shadow-sm",children:l.jsx("p",{className:"text-lg text-slate-700 leading-relaxed",children:l.jsx(P1,{text:f})})},v))]})]}),l.jsxs(dn,{title:"The Innovator's Lens: Asking a More Beautiful Question",gradient:"from-lime-500 to-green-600",children:[l.jsx("p",{children:"Weâve all heard the famous story: NASA spent millions developing a pen that could write in zero gravity, while the Russians simply used a pencil. While the details of the story are a bit of a myth, its lesson is profound. True innovation isn't always about adding complexity; often, it's about stripping it away to find the elegant, simple core of a solution. The key isn't having the most complicated answer, but asking the most insightful question."}),l.jsx("p",{children:`The Reframing Challenge is designed to help you do just that. It pushes you to question your initial assumptions and look at your problem from a completely different angle. It's a tool for sparking creativity and breaking out of conventional thinking. An artist reframes a common object to reveal its hidden beauty. A community organizer reframes a "problem" to see it as an "opportunity." This is the heart of the creative process.`}),l.jsx("p",{children:"This is especially critical for climate entrepreneurship. We are often conditioned to think in terms of massive, industrial-scale technological fixes. But what if we reframe the questions?"}),l.jsxs("ul",{children:[l.jsx("li",{children:'Instead of asking, "How do we build giant machines to capture carbon?" we might ask, "How can we empower forests and regenerative farms to do what they do best?"'}),l.jsx("li",{children:'Instead of, "How do we create a complex global recycling system?" we might ask, "How can we design products that create no waste in the first place?"'})]}),l.jsx("p",{children:"Reframing shifts our focus from brute-force solutions to elegant, nature-inspired, and community-centric ones. Itâs a small shift in perspective that can lead to a world of difference in impact."})]})]})})},G1=()=>{const[n,e]=R.useState(""),[s,o]=R.useState(null),[a,c]=R.useState(!1),[d,m]=R.useState(""),y=async()=>{if(!n.trim()){m("Please enter a project description.");return}c(!0),m(""),o(null);const v=` 339 Act as a strategic team builder and community organizer with deep expertise in building holistic, effective teams for innovative projects. 340 The user has a project described as: "${n}" 341 342 Your task is to analyze this project and identify the key roles needed for success. Go beyond traditional job titles. Think in terms of attributes, skills, and relationships. 343 344 Generate a list of roles categorized into three specific groups: 345 1. **Core Skills:** Tangible abilities required to build or execute the project (e.g., "Digital Marketing", "Grant Writing", "3D Modeling"). 346 2. **Community Connections:** People or roles defined by their relationships and trust within the target community (e.g., "A respected local Elder", "A youth group leader", "Someone with connections at the local council"). 347 3. **Essential Attributes:** Intangible qualities or personality types crucial for the team's culture and success (e.g., "A natural storyteller", "A patient mentor", "A resilient problem-solver"). 348 349 Provide a JSON object with the keys "coreSkills", "communityConnections", and "essentialAttributes". Each key should have an array of 3-5 string values. 350 `;try{const _=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:v,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{coreSkills:{type:le.ARRAY,items:{type:le.STRING}},communityConnections:{type:le.ARRAY,items:{type:le.STRING}},essentialAttributes:{type:le.ARRAY,items:{type:le.STRING}}},required:["coreSkills","communityConnections","essentialAttributes"]}}})).text.trim(),C=JSON.parse(_);o(C)}catch(b){m("An error occurred while mapping the team. Please try again."),console.error(b)}finally{c(!1)}},f=(v,b,w,_,C)=>l.jsxs("div",{children:[l.jsx("h3",{className:`text-2xl font-bold ${w} mb-4`,children:v}),l.jsx("div",{className:"flex flex-wrap gap-3",children:b.map((A,E)=>l.jsx("span",{className:`${_} border border-slate-200 ${C} px-4 py-2 rounded-full text-sm font-medium shadow-sm`,children:A},E))})]});return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-indigo-500 to-purple-600",children:"The Team Attribute Mapper"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"A great team is more than a list of job titles. Describe your project, and we'll help you map the essential skills, connections, and attributes needed for success."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-slate-700 mb-2",children:"Your Project Description"}),l.jsx("textarea",{id:"project",rows:4,value:n,onChange:v=>e(v.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-indigo-500 text-slate-900",placeholder:"e.g., An online platform to connect young artists in my community with experienced mentors and showcase their work."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:y,disabled:a,className:"px-8 py-3 rounded-md bg-indigo-600 text-white font-bold hover:bg-indigo-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:a?"Mapping...":"Map My Team"})})]}),(s||d||a)&&l.jsxs("div",{className:"mt-12",children:[l.jsx("h2",{className:"text-3xl font-bold text-center text-slate-900 mb-8",children:"Your Team Blueprint"}),l.jsxs("div",{className:"bg-white p-8 rounded-xl border border-slate-200 shadow-lg space-y-8",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Analyzing your project needs..."}),d&&l.jsx("div",{className:"text-center text-rose-500",children:d}),s&&l.jsxs(l.Fragment,{children:[f("Core Skills",s.coreSkills,"text-indigo-700","bg-indigo-50","text-indigo-800"),f("Community Connections",s.communityConnections,"text-purple-700","bg-purple-50","text-purple-800"),f("Essential Attributes",s.essentialAttributes,"text-slate-700","bg-slate-100","text-slate-800")]})]})]}),l.jsxs(dn,{title:"Your Team is an Ecosystem, Not an Org Chart",gradient:"from-indigo-500 to-purple-600",children:[l.jsx("p",{children:'When we think about building a "team," our minds often jump to traditional business roles: a CEO, a marketing lead, a developer. But projects rooted in creativity, community, and climate action require a more holistic view. A truly effective team is a living ecosystem, a network of diverse capabilities that work in harmony. This tool is designed to help you see beyond job titles and map the true DNA of the team you need to build.'}),l.jsx("p",{children:"We break this down into three crucial categories:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Core Skills:"}),` These are the tangible "what" of your project. They are the practical abilities needed to get the work done, whether it's grant writing, digital fabrication, or soil science. They form the functional backbone of your initiative.`]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Community Connections:"}),' This is the "who" and the "where." For any project to succeed, especially those with social or environmental goals, it needs to be built on a foundation of trust. Who are the natural connectors in your community? The respected Elders, the passionate youth leaders, the small business owners everyone knows? These relationships are often more valuable than any technical skill. They are your bridge to the heart of the community you serve.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Essential Attributes:"}),` This is the "how" and the "why." It's the culture and spirit of your team. A long-term climate project requires immense resilience. A community arts project needs a natural storyteller to share its impact. A mentorship program needs patient and empathetic guides. These intangible qualities are the cultural glue that holds everything together when challenges arise.`]})]}),l.jsx("p",{children:"By mapping your team across all three areas, you ensure you're not just building a group of employees, but cultivating a resilient, deeply connected, and purpose-driven community of collaborators."})]})]})})},q1=()=>{const[n,e]=R.useState(0),[s,o]=R.useState(Array(6).fill("")),[a,c]=R.use
350State(""),[d,m]=R.useState(!1),[y,f]=R.useState(""),v=(_,C)=>{const A=[...s];A[_]=C,o(A)},b=async()=>{if(s[5].trim()==="")return;m(!0),f(""),c(""),e(6);const _=` 351 Act as a root cause analysis expert, like Sakichi Toyoda, the originator of the 5 Whys technique. 352 A user has gone through the 5 Whys process to understand a problem. Their chain of reasoning is as follows: 353 354 Initial Problem: ${s[0]} 355 1. Why was that happening? Because... ${s[1]} 356 2. And why was that happening? Because... ${s[2]} 357 3. And why was that happening? Because... ${s[3]} 358 4. And why was that happening? Because... ${s[4]} 359 5. And why was that happening? Because... ${s[5]} 360 361 Your task is to analyze this entire chain and synthesize the findings into a single, concise statement that clearly identifies the **root cause**. 362 The root cause should be a fundamental process or cultural issue, not a surface-level symptom. 363 364 Format your response as a single, powerful sentence. Do not add any extra explanation or introductory text. 365 For example, if the chain leads to a lack of training, you might respond with: "The core issue is a lack of a structured onboarding and continuous training process for new team members." 366 `;try{const A=await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:_});c(A.text)}catch(C){f("An error occurred during analysis. Please try again."),console.error(C)}finally{m(!1)}},w=_=>n===_?l.jsxs("div",{className:"mt-6 animate-fade-in",children:[l.jsxs("label",{htmlFor:`why-${_}`,className:"block text-lg font-bold text-rose-700 mb-2",children:[_,". Why was that happening?"]}),l.jsx("textarea",{id:`why-${_}`,value:s[_],onChange:A=>v(_,A.target.value),rows:2,className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-rose-500 text-slate-900",placeholder:"Because...",autoFocus:!0}),_<5?l.jsx("button",{onClick:()=>{s[_].trim()&&e(A=>A+1)},disabled:!s[_].trim(),className:"mt-4 px-6 py-2 rounded-md bg-slate-200 text-slate-700 font-semibold hover:bg-slate-300 transition disabled:opacity-50",children:"Next Why â"}):l.jsx("button",{onClick:b,disabled:!s[_].trim()||d,className:"mt-4 px-8 py-3 rounded-md bg-rose-600 text-white font-bold hover:bg-rose-500 transition disabled:opacity-50 text-lg shadow-md",children:d?"Analyzing...":"Find Root Cause"})]}):null;return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-rose-500 to-red-600",children:'The "Five Whys" Analysis'}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:'Dig deeper than surface-level symptoms. Ask "Why?" five times to follow the chain of cause-and-effect to its true origin.'})]}),l.jsxs("div",{className:"mt-12 space-y-4",children:[n===0&&l.jsxs("div",{className:"text-center",children:[l.jsx("label",{htmlFor:"initial-problem",className:"block text-lg font-bold text-slate-700 mb-2",children:"Start by stating the problem you've observed."}),l.jsx("textarea",{id:"initial-problem",value:s[0],onChange:_=>v(0,_.target.value),rows:2,className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-rose-500 text-slate-900",placeholder:"e.g., Our community art workshops have low attendance."}),l.jsx("button",{onClick:()=>{s[0].trim()&&e(1)},disabled:!s[0].trim(),className:"mt-6 px-8 py-3 rounded-md bg-rose-600 text-white font-bold hover:bg-rose-500 transition disabled:opacity-50 text-lg shadow-md",children:"Start Analysis"})]}),n>0&&s.slice(0,n).map((_,C)=>l.jsxs("div",{className:`p-4 rounded-lg bg-white border border-slate-200 shadow-sm ${n===6?"":"opacity-80"}`,children:[l.jsx("p",{className:"text-slate-500 font-semibold text-sm uppercase tracking-wide",children:C===0?"Initial Problem:":`${C}. Why? Because...`}),l.jsx("p",{className:"text-slate-900 text-lg mt-1 font-medium",children:_})]},C)),n>0&&n<=5&&w(n)]}),n===6&&l.jsxs("div",{className:"mt-12 text-center",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Identified Root Cause"}),l.jsxs("div",{className:"bg-white p-8 rounded-xl border border-rose-200 shadow-lg min-h-[8rem] flex items-center justify-center",children:[d&&l.jsx("p",{className:"text-slate-500",children:"Analyzing the chain of events..."}),y&&l.jsx("p",{className:"text-rose-500",children:y}),a&&l.jsxs("p",{className:"text-2xl text-rose-700 leading-relaxed italic font-serif",children:['"',a,'"']})]})]}),l.jsxs(dn,{title:"The Detective's Mindset: Uncovering the Real Story",gradient:"from-rose-500 to-red-600",children:[l.jsx("p",{children:`Itâs incredibly easy to get caught up in fighting fires. We see a problemâa symptomâand our immediate instinct is to patch it. But this often leads to a frustrating cycle of fixing the same issues over and over again, because we never address what's truly causing them. The "Five Whys" is a simple but profoundly effective tool for moving beyond symptoms to find the root cause. It's like being a detective for your own idea, following a chain of clues until you uncover the real story.`}),l.jsx("p",{children:"Imagine a doctor who only ever treats a cough with syrup, without checking the patientâs lungs. They might provide temporary relief, but they'll never cure the underlying pneumonia. The Five Whys is your diagnostic tool to look deeper."}),l.jsx("p",{children:"This is vital for innovators in any field. For a creative entrepreneur, it can reveal unexpected insights about your audience. Let's say your community art workshops have low attendance."}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Why?"}),` People aren't signing up online. (Initial thought: "We need better marketing!")`]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Why?"})," Our target audience isn't very active on social media."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Why?"})," They are mostly elders who prefer face-to-face contact."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Why?"})," They feel disconnected from digital-first community events."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Why?"})," No one has created an accessible, welcoming, non-digital way for them to engage."]})]}),l.jsx("p",{children:`Suddenly, the problem isn't marketingâit's accessibility and inclusion. The root cause is a systemic barrier, and the solution is completely different. For a climate entrepreneur, this process can be the difference between a superficial fix and a systemic solution. By repeatedly asking "why," you move from treating the symptoms of a problem to transforming the system that creates it.`})]})]})})},B1=()=>
366{const[n,e]=R.useState(""),[s,o]=R.useState(null),[a,c]=R.useState(!1),[d,m]=R.useState(""),y=async()=>{if(!n.trim()){m("Please describe your target audience.");return}c(!0),m(""),o(null);const f=` 367 Act as a senior UX researcher and marketing strategist. Your task is to create a detailed and empathetic user persona based on a brief description provided by the user. 368 369 The user's description of their target audience is: "${n}" 370 371 From this, generate a complete user persona. The persona should be realistic and bring the user to life. 372 373 Provide a JSON object with the following structure: 374 - "name": A plausible first and last name. 375 - "age": A realistic age as a number. 376 - "location": A general location (e.g., "a remote northern community", "a bustling city suburb"). 377 - "occupation": A likely job or role. 378 - "goals": An array of 3-4 key goals relevant to the user's description. 379 - "frustrations": An array of 3-4 common frustrations or pain points. 380 - "motivations": An array of 3-4 core motivations. 381 - "bio": A short, narrative biography (2-3 sentences) that summarizes their story and personality. 382 `;try{const w=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:f,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{name:{type:le.STRING},age:{type:le.NUMBER},location:{type:le.STRING},occupation:{type:le.STRING},goals:{type:le.ARRAY,items:{type:le.STRING}},frustrations:{type:le.ARRAY,items:{type:le.STRING}},motivations:{type:le.ARRAY,items:{type:le.STRING}},bio:{type:le.STRING}},required:["name","age","location","occupation","goals","frustrations","motivations","bio"]}}})).text.trim(),_=JSON.parse(w);o(_)}catch(v){m("An error occurred while generating the persona. Please try again."),console.error(v)}finally{c(!1)}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-cyan-500 to-sky-600",children:"Customer Persona Creator"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Bring your customer to life. Briefly describe your target audience, and we'll generate a detailed persona to guide your innovation."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"audience",className:"block text-sm font-medium text-slate-700 mb-2",children:"Describe your target audience in one sentence"}),l.jsx("textarea",{id:"audience",rows:2,value:n,onChange:f=>e(f.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-cyan-500 text-slate-900",placeholder:"e.g., Young Indigenous artists in the NWT who want to sell their work online."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:y,disabled:a,className:"px-8 py-3 rounded-md bg-cyan-600 text-white font-bold hover:bg-cyan-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:a?"Generating...":"Create Persona"})})]}),(s||d||a)&&l.jsxs("div",{className:"mt-12",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Building your persona..."}),d&&l.jsx("div",{className:"text-center text-rose-500",children:d}),s&&l.jsxs("div",{className:"bg-white p-8 rounded-2xl border border-cyan-200 shadow-xl animate-fade-in",children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsx("h2",{className:"text-4xl font-bold text-cyan-700",children:s.name}),l.jsxs("p",{className:"text-slate-500 text-lg font-medium",children:[s.occupation,", Age ",s.age]}),l.jsx("p",{className:"text-slate-400",children:s.location})]}),l.jsxs("blockquote",{className:"border-l-4 border-cyan-400 pl-4 italic text-slate-600 text-lg my-6",children:['"',s.bio,'"']}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 mt-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-bold text-xl text-slate-800 mb-3",children:"Goals"}),l.jsx("ul",{className:"list-disc list-outside pl-5 space-y-2 text-slate-600",children:s.goals.map(f=>l.jsx("li",{children:f},f))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-bold text-xl text-slate-800 mb-3",children:"Frustrations"}),l.jsx("ul",{className:"list-disc list-outside pl-5 space-y-2 text-slate-600",children:s.frustrations.map(f=>l.jsx("li",{children:f},f))})]}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("h3",{className:"font-bold text-xl text-slate-800 mb-3",children:"Motivations"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:s.motivations.map(f=>l.jsx("span",{className:"bg-cyan-50 border border-cyan-100 text-cyan-800 px-3 py-1 rounded-full text-sm font-medium",children:f},f))})]})]})]})]}),l.jsxs(dn,{title:"Beyond Demographics: The Art of Seeing Your Customer",gradient:"from-cyan-500 to-sky-600",children:[l.jsx("p",{children:'At the heart of any meaningful creation is a deep sense of empathy. The Persona Creator isnât just about defining a "target market"; itâs an exercise in seeing the world through someone elseâs eyes. It transforms abstract data points into a living, breathing person with goals, frustrations, and a story of their own. This is the first and most critical step in creating something that truly matters.'}),l.jsx("p",{children:'For artists and creative entrepreneurs, this is often an intuitive process. You create for an audie
382nce you feel a connection with. A persona simply makes that intuition tangible. It gives you a touchstoneâa specific person to keep in mind as you make creative decisions. Will this resonate with "Sarah"? Does this solve a problem for "David"? It keeps your work grounded and purposeful.'}),l.jsx("p",{children:`In the context of climate innovation, the stakes are even higher. The "customer" might be a community facing coastal erosion or a farmer dealing with unpredictable weather. Building a persona forces you to move beyond technical solutions and connect with the human impact of the problem. It ensures that you're not just designing a clever piece of technology, but a tool that respects the culture, addresses the real-world anxieties, and aligns with the aspirations of the people you intend to serve.`}),l.jsx("p",{children:"A well-crafted persona serves as your North Star, helping you to:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Build Genuine Empathy:"})," Step out of your own perspective and into the lived experience of your audience."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Guide Decision-Making:"}),' From design choices to communication strategies, the persona provides a clear "why" for your actions.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Clarify Your Focus:"})," By designing for a specific person, you avoid the trap of trying to be everything to everyone, which often leads to being nothing to anyone."]})]})]})]})})},H1=()=>{const[n,e]=R.useState(""),[s,o]=R.useState(""),[a,c]=R.useState(null),[d,m]=R.useState(!1),[y,f]=R.useState(""),v=async()=>{if(!n.trim()||!s.trim()){f("Please describe your solution and at least one competitor.");return}m(!0),f(""),c(null);const b=` 383 Act as a top-tier business strategist and market analyst. Your task is to analyze a user's proposed solution and their listed competitors to identify a clear competitive advantage. 384 385 User's Solution: "${n}" 386 Listed Competitors: "${s}" 387 388 Your analysis should have two parts: 389 1. For each competitor, briefly list their key strengths and weaknesses in relation to the user's solution space. 390 2. Based on the analysis, suggest several distinct "Advantage Angles" for the user's solution. These should be actionable strategies or positioning statements that highlight their unique value. 391 392 Provide a JSON object with the following structure: 393 - "analysis": An array of objects, where each object has: 394 - "competitor": The name of the competitor. 395 - "strengths": An array of 2-3 strings describing their strengths. 396 - "weaknesses": An array of 2-3 strings describing their weaknesses. 397 - "advantageAngles": An array of 3-4 strings, each a suggested advantage angle for the user. 398 `;try{const C=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:b,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{analysis:{type:le.ARRAY,items:{type:le.OBJECT,properties:{competitor:{type:le.STRING},strengths:{type:le.ARRAY,items:{type:le.STRING}},weaknesses:{type:le.ARRAY,items:{type:le.STRING}}},required:["competitor","strengths","weaknesses"]}},advantageAngles:{type:le.ARRAY,items:{type:le.STRING}}},required:["analysis","advantageAngles"]}}})).text.trim(),A=JSON.parse(C);c(A)}catch(w){f("An error occurred during analysis. Please try again."),console.error(w)}finally{m(!1)}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-lime-500 to-green-600",children:"The Advantage Analyzer"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Define your unique edge. Describe your solution and its competitors to uncover your key competitive advantage."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"solution",className:"block text-sm font-medium text-slate-700 mb-2",children:"Your Solution"}),l.jsx("textarea",{id:"solution",rows:3,value:n,onChange:b=>e(b.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-lime-500 text-slate-900",placeholder:"e.g., A mobile app that connects tourists with local Indigenous guides for authentic cultural experiences."})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"competitors",className:"block text-sm font-medium text-slate-700 mb-2",children:"Competitors or Alternatives"}),l.jsx("textarea",{id:"competitors",rows:2,value:s,onChange:b=>o(b.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-lime-500 text-slate-900",placeholder:"e.g., Airbnb Experiences, generic tour companies, 'doing nothing'."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:v,disabled:d,className:"px-8 py-3 rounded-md bg-lime-600 text-white font-bold hover:bg-lime-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:d?"Analyzing...":"Find My Advantage"})})]}),(a||y||d)&&l.jsxs("div",{className:"mt-12",children:[l.jsx("h2",{className:"text-3xl font-bold text-center text-slate-900 mb-8",children:"Strategic Analysis"}),d&&l.jsx("div",{className:"text-center text-slate-500",children:"Scanning the competitive landscape..."}),y&&l.jsx("div",{className:"text-center text-rose-500",children:y}),a&&l.jsxs("div",{className:"space-y-8",children:[l.jsx("div",{className:"space-y-6",children:a.analysis.map(b=>l.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[l.jsx("h3",{className:"text-xl font-bold text-slate-800",children:b.competitor}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-x-6 mt-3",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold text-emerald-600 mb-1",children:"Strengths"}),l.jsx("ul",{className:"list-disc list-outside pl-5 text-sm text-slate-600",children:b.strengths.map(w=>l.jsx("li",{children:w}
398,w))})]}),l.jsxs("div",{className:"mt-3 md:mt-0",children:[l.jsx("h4",{className:"font-semibold text-rose-600 mb-1",children:"Weaknesses"}),l.jsx("ul",{className:"list-disc list-outside pl-5 text-sm text-slate-600",children:b.weaknesses.map(w=>l.jsx("li",{children:w},w))})]})]})]},b.competitor))}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-2xl font-bold text-lime-700 mb-4 text-center",children:"Your Advantage Angles"}),l.jsx("div",{className:"space-y-3",children:a.advantageAngles.map(b=>l.jsx("div",{className:"bg-lime-50 p-4 rounded-lg border border-lime-200 text-lime-800 text-center shadow-sm",children:l.jsx("p",{className:"font-medium text-lg",children:b})},b))})]})]})]}),l.jsxs(dn,{title:"What's Your Superpower? Defining Your Unique Gift",gradient:"from-lime-500 to-green-600",children:[l.jsx("p",{children:'The term "competitive advantage" can sound aggressive, like something out of a corporate boardroom battle. But for creative, community, and climate-focused innovators, itâs better to think of it in a different light: What is your unique gift to the world? What special value do you offer that no one else can? This tool helps you articulate that superpower with clarity and confidence.'}),l.jsx("p",{children:"Understanding your advantage isn't about crushing the competition. It's about knowing where you fit in the ecosystem and why your contribution is essential."}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"For an artist,"})," your advantage might be your unmistakable voice, your mastery of a rare technique, or your deep connection to a cultural heritage that imbues your work with meaning. It's what makes your art yours."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"For a community project,"})," your advantage is often your trust and authenticity. Youâre not an outsider imposing a solution; you are part of the community you serve. That embedded knowledge is something no large organization can replicate."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"For a climate entrepreneur,"})," your advantage could be your use of local, regenerative materials that others have overlooked, your circular economy model that eliminates waste, or your ability to mobilize a community around a shared environmental goal."]})]}),l.jsx("p",{children:`Remember to consider one of your biggest competitors: the status quo, or "doing nothing." Often, your greatest challenge isn't another company, but inspiring people to change their behavior. Your advantage, then, is your ability to tell a story so compelling that it moves people to act. This tool helps you find the heart of that story.`})]})]})})},z1=()=>{const[n,e]=R.useState(""),[s,o]=R.useState(""),[a,c]=R.useState(null),[d,m]=R.useState(!1),[y,f]=R.useState(""),v=async()=>{if(!n.trim()||!s.trim()){f("Please describe your project and a primary goal.");return}m(!0),f(""),c(null);const b=` 399 Act as a seasoned product manager and startup mentor. Your task is to help a user translate their innovative idea into an actionable plan. 400 401 User's Project Idea: "${n}" 402 User's Primary Goal (for next 6-12 months): "${s}" 403 404 Based on this information, generate two key components for their plan: 405 1. A list of 3-4 essential Key Performance Indicators (KPIs) they should track to measure progress towards their goal. 406 2. A simple, 3-step roadmap with clear milestones for the initial phases of the project. Each step should have a phase number, a title, and a brief description of key activities. 407 408 Provide a JSON object with the following structure: 409 - "kpis": An array of 3-4 strings, each being a key KPI. 410 - "roadmap": An array of exactly 3 objects, where each object has: 411 - "phase": A string like "Phase 1". 412 - "title": A concise title for the phase. 413 - "description": A short sentence describing the activities in that phase. 414 `;try{const C=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:b,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{kpis:{type:le.ARRAY,items:{type:le.STRING}},roadmap:{type:le.ARRAY,items:{type:le.OBJECT,properties:{phase:{type:le.STRING},title:{type:le.STRING},description:{type:le.STRING}},required:["phase","title","description"]}}},required:["kpis","roadmap"]}}})).text.trim(),A=JSON.parse(C);c(A)}catch(w){f("An error occurred while generating the plan. Please try again."),console.error(w)}finally{m(!1)}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-fuchsia-500 to-purple-600",children:"Results & Roadmap Planner"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"An idea without a plan is just a dream. Define your project and its main goal to generate key metrics and a sample roadmap."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"projectIdea",className:"block text-sm font-medium text-slate-700 mb-2",children:"Your Project Idea"}),l.jsx("textarea",{id:"projectIdea",rows:3,value:n,onChange:b=>e(b.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-fuchsia-500 text-slate-900",placeholder:"e.g., A subscription box service for artisanal products from northern Canada."})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"primaryGoal",className:"block text-sm font-medium text-slate-700 mb-2",children:"Your Primary Goal (Next 6-12 Months)"}),l.jsx("input",{type:"text",id:"primaryGoal",value:s,onChange:b=>o(b.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-fuchsia-500 text-slate-900",placeholder:"e.g., Secure the first 50 paying subscribers."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:v,disabled:d,className:"px-8 py-3 rounded-md bg-fuchsia-600 text-white font-bold hover:bg-fuchsia-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:d?"Planning...":"Generate My Plan"})})]}),(a||y||d)&&l.jsxs("div",{className:"mt-12",children:[l.jsx("h2",{className:"text-3xl font-bold text-center text-slate-900 mb-8",children:"Your Action Plan"}),d&&l.jsx("div",{className:"text-center text-slate-500",children:"Charting a course for your idea..."}),y&&l.jsx("div",{className:"text-center text-rose-500",children:y}),a&&l.jsxs("div",{className:"bg-white p-8 rounded-xl border border-slate-200 shadow-lg space-y-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-2xl font-bold text-fuchsia-700 mb-4",children:"Key Performance Indicators (KPIs)"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:a.kpis.map(b=>l.jsx("span",{className:"bg-fuchsia-50 text-fuchsia-800 border border-fuchsia-100 px-4 py-2 rounded-full font-medium",children:b},b))})]}),l.jsx("div",{className:"border-t border-slate-200 my-6"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-2xl font-bold text-fuchsia-700 mb-4",children:"Sample Roadmap"}),l.jsx("div",{className:"space-y-6",children:a.roadmap.map(b=>l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex-shrink-0 bg-fuchsia-100 text-fuchsia-700 font-bold rounded-full w-12 h-12 flex items-center justify-center text-sm border border-fuchsia-200",children:b.phase.replace("Phase ","")}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-bold text-slate-800 text-lg",children:b.title}),l.jsx("p",{className:"text-slate-600 leading-relaxed",children:b.description})]})]},b.phase))})]})]})]}),l.jsxs(dn,{title:"From Dream to Destination: Charting Your Course",gradient:"from-fuchsia-500 to-purple-600",children:[l.jsx("p",{children:'A powerful vision is the fuel for any great endeavor, but without a map, even the most passionate traveler can get lost. The Roadmap Planner is your tool for charting a course from your exciting idea to tangible, real-world results. It helps you translate your "what if" into "how to," creating a clear, actionable path that you can follow and share with others.'}),l.jsx("p",{children:`A key part of this is defining your Key Performance Indicators (KPIs). This sounds like corporate jargon, but it's really just about deciding what "success" actually looks like for you. And it doesn't have to be about money!`}),l.jsxs("ul",{children:[l.jsx("li",{children:`For a public art project, a KPI might be the "number of community members who contribute a brushstroke" or "mentions on social media that use words like 'pride' or 'beautiful'."`}),l.jsx("li",{children:'For a climate initiative focused on local food, a KPI could be the "pounds of produce shared between neighbors" or the "number of new gardeners mentored."'})]}),l.jsx("p",{children:"Your KPIs tell the story of your impact in a way that is both meaningful and measurable. They are essential for tracking your progress and for communicating your success to funders, partners, and your community."}),l.jsx("p",{children:"The three-phase roadmap turns your journey into a compelling narrative: The Setup (Phase 1), The Journey (Phase 2), and The First Arrival (Phase 3). This structure helps break a large, intimidating goal into manageable steps, making the entire process feel less like a project plan and more like an exciting adventure youâre about to embark on."})]})]})})},V1=()=>
414{const[n,e]=R.useState(""),[s,o]=R.useState(null),[a,c]=R.useState(!1),[d,m]=R.useState(""),y=async()=>{if(!n.trim()){m("Please list some of your interests.");return}c(!0),m(""),o(null);const f=` 415 Act as an innovation coach specializing in purpose-driven entrepreneurship. Your task is to analyze a user's personal interests and map them to the principles of the ECO-STAR framework (Environment, Customer, Opportunity, Solution, Team, Advantage, Results). 416 417 The user's interests are: "${n}" 418 419 For each of the seven ECO-STAR principles, identify a potential innovation path or project theme that strongly aligns with the user's interests. Frame each path as a "How might we..." question to spark creativity. Also, provide a brief rationale explaining the connection. 420 421 Provide a JSON object with a single key "assessment". The value should be an array of objects, one for each ECO-STAR principle. Each object should have the following structure: 422 - "principle": The name of the ECO-STAR principle (e.g., "Environment"). 423 - "letter": The letter of the principle (e.g., "E"). 424 - "question": The generated "How might we..." question. 425 - "rationale": A brief explanation of how the user's interests connect to this path. 426 `;try{const w=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:f,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{assessment:{type:le.ARRAY,items:{type:le.OBJECT,properties:{principle:{type:le.STRING},letter:{type:le.STRING},question:{type:le.STRING},rationale:{type:le.STRING}},required:["principle","letter","question","rationale"]}}},required:["assessment"]}}})).text.trim(),_=JSON.parse(w);o(_)}catch(v){m("An error occurred during the assessment. Please try again."),console.error(v)}finally{c(!1)}};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-sky-500 to-blue-600",children:"Interest Compatibility Assessment"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Discover your unique innovation path. List your interests and passions, and we'll reveal how they align with the core principles of ECO-STAR."})]}),l.jsxs("div",{className:"mt-12 space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"interests",className:"block text-sm font-medium text-slate-700 mb-2",children:"Your Interests & Passions"}),l.jsx("textarea",{id:"interests",rows:3,value:n,onChange:f=>e(f.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-sky-500 text-slate-900",placeholder:"e.g., Hiking, traditional storytelling, photography, community gardening, learning from elders..."})]}),l.jsx("div",{className:"text-center",children:l.jsx("button",{onClick:y,disabled:a,className:"px-8 py-3 rounded-md bg-sky-600 text-white font-bold hover:bg-sky-500 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:a?"Assessing...":"Assess Compatibility"})})]}),(s||d||a)&&l.jsxs("div",{className:"mt-12",children:[l.jsx("h2",{className:"text-3xl font-bold text-center text-slate-900 mb-8",children:"Your Innovation Pathways"}),a&&l.jsx("div",{className:"text-center text-slate-500",children:"Analyzing your interests..."}),d&&l.jsx("div",{className:"text-center text-rose-500",children:d}),s&&l.jsx("div",{className:"space-y-6",children:s.assessment.map((f,v)=>{const b=Yt.find(w=>w.letter===f.letter);return l.jsxs("div",{className:`p-6 rounded-xl border-2 bg-white ${b==null?void 0:b.borderColor} hover:shadow-lg transition-shadow`,children:[l.jsxs("h3",{className:`text-2xl font-bold ${b==null?void 0:b.color}`,children:[f.principle," (",f.letter,")"]}),l.jsxs("p",{className:"mt-4 text-lg italic text-slate-800 font-medium",children:['"',f.question,'"']}),l.jsx("p",{className:"mt-3 text-slate-600 leading-relaxed",children:f.rationale})]},v)})})]}),l.jsxs(dn,{title:"Your Ikigai: Where Passion Meets Purpose",gradient:"from-sky-500 to-blue-600",children:[l.jsx("p",{children:"The most powerful, resilient, and fulfilling innovations are not born from market analysis alone; they spring from a deep well of personal passion. When your work aligns with what you genuinely love, it ceases to be a job and becomes a vocation. This tool is designed to help you find that alignment, acting as a bridge between your personal interests and a structured framework for creating value."}),l.jsxs("p",{children:["The Japanese have a concept called ",l.jsx("strong",{children:'"Ikigai"'}),` (çãç²æ), which roughly translates to "a reason for being." It's often visualized as the intersection of four circles: what you love, what you're good at, what the world needs, and what you can be paid for. This assessment is a practical exercise in finding your Ikigai within the context of innovation. By mapping what you love to the ECO-STAR principles, you begin to see how your unique passions can address real-world needs in a structured and viable way.`]}),l.jsxs("ul",{children:[l.jsxs("li",{children:["Your passion for the ",l.jsx("strong",{children:"Environment"})," can become a regenerative business."]}),l.jsxs("li",{children:["Your empathy for a specific group of people (",l.jsx("strong",{children:"Customer"}),") can become a community-focused service."]}),l.jsxs("li",{children:["Your unique perspective can help you see an ",l.jsx("strong",{children:"Opportunity"})," others have missed."]})]}),l.jsx("p",{children:"When you build from this place of authentic interest, you unlock a sustainable source of motivation that will carry you through the inevitable challenges of bringing a new idea to life. Your work becomes an extension of who you are, creating not just economic value, but a profou
426nd sense of purpose."})]})]})})},F1=({content:n})=>{const e=y=>y.split(/(\*\*.*?\*\*)/g).map((f,v)=>f.startsWith("**")&&f.endsWith("**")?l.jsx("strong",{className:"font-semibold text-slate-900",children:f.substring(2,f.length-2)},v):f),s=[],o=n.split(` 427`);let a=[],c=[];const d=y=>{a.length>0&&(s.push(l.jsx("ul",{className:"list-disc list-outside pl-6 space-y-2 my-4",children:a.map((f,v)=>l.jsx("li",{className:"text-slate-700 leading-relaxed",children:e(f)},v))},y)),a=[])},m=y=>{c.length>0&&(s.push(l.jsx("ol",{className:"list-decimal list-outside pl-6 space-y-2 my-4",children:c.map((f,v)=>l.jsx("li",{className:"text-slate-700 leading-relaxed",children:e(f)},v))},y)),c=[])};return o.forEach((y,f)=>{const v=y.trim(),b=`block-${f}`;v.startsWith("## ")?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h2",{className:"text-2xl font-bold text-purple-700 mt-8 mb-4 pb-2 border-b border-purple-200",children:v.substring(3)},b))):v.startsWith("### ")?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h3",{className:"text-xl font-bold text-sky-700 mt-6 mb-3",children:v.substring(4)},b))):/^\*\*.+\*\*$/.test(v)?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h4",{className:"text-lg font-bold text-slate-800 mt-4 mb-2",children:v.substring(2,v.length-2)},b))):v.startsWith("- ")||v.startsWith("* ")?(m(`ol-${b}`),a.push(v.substring(2))):/^\d+\.\s/.test(v)?(d(`ul-${b}`),c.push(v.replace(/^\d+\.\s/,""))):v.length>0&&(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("p",{className:"text-slate-700 leading-relaxed my-3",children:e(v)},b)))}),d("ul-last"),m("ol-last"),l.jsx("div",{children:s})},Br=({label:n,id:e,value:s,onChange:o,children:a})=>l.jsxs("div",{children:[l.jsx("label",{htmlFor:e,className:"block text-sm font-medium text-slate-700 mb-2",children:n}),l.jsx("select",{id:e,name:e,value:s,onChange:o,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-purple-500 text-slate-900",children:a})]}),$1=()=>{const[n,e]=R.useState({gradeLevel:"6th-8th Grade",readingLevel:"Intermediate",ecoStarComponent:"Full ECO-STAR Introduction",subjectArea:"Creative Entrepreneurship",specificTopics:""}),[s,o]=R.useState(""),[a,c]=R.useState(!1),[d,m]=R.useState(""),[y,f]=R.useState(!1),[v,b]=R.useState("idle"),w=R.useRef(null),_=I=>{const{name:U,value:G}=I.target;e(F=>({...F,[U]:G}))},C=async()=>{c(!0),m(""),o(""),b("idle");const I=` 428 You are an expert curriculum designer and educational writer specializing in creating comprehensive, in-depth lesson plans that align with Common Core State Standards (CCSS). 429 Your task is to generate a highly detailed, thorough, and well-explained Common Core-aligned lesson plan based on the user's specifications. The final output should be between 2000 and 3000 words. 430 431 **Core Methodology:** 432 The lesson plan must be built around the **ECO-STAR methodology**, which stands for: 433 - **E**: Environment (The environmental context and impact) 434 - **C**: Customer (The user or community and their unmet need) 435 - **O**: Opportunity (Wider potential and market context) 436 - **S**: Solution (The idea for creating value) 437 - **T**: Team (Knowledge, skills, and contacts needed) 438 - **A**: Advantage (The unique competitive advantage) 439 - **R**: Results (Quantifiable results and return on investment) 440 Ensure you use this specific acronym and its meanings correctly and do not invent others. 441 442 **User Specifications:** 443 - **Grade Level:** ${n.gradeLevel} 444 - **Reading Level:** ${n.readingLevel} 445 - **ECO-STAR Component Focus:** ${n.ecoStarComponent} 446 - **Subject Area / Class Type:** ${n.subjectArea} 447 - **Specific Topics to Include (Optional):** ${n.specificTopics||"None"} 448 449 **Content Depth Requirements:** 450 - **Extreme Detail:** Each section must be significantly expanded with detailed explanations, step-by-step instructions for the teacher, sample questions to ask students, and potential student responses. 451 - **Rich Explanations:** Provide background context for concepts. For example, when introducing an ECO-STAR principle, explain what it means in detail and why it is important. 452 - **Word Count:** The total length of the lesson plan should be between 2000 and 3000 words. Be comprehensive and do not sacrifice detail for brevity. 453
454 **ABSOLUTELY CRITICAL OUTPUT FORMATTING RULES - NON-NEGOTIABLE & VICIOUSLY ENFORCED:** 455 You MUST generate the lesson plan using strict markdown. Any deviation is a failure. 456 457 - **THE DEFAULT IS PARAGRAPHS:** All descriptive text, explanations, and instructions MUST be standard paragraphs. Do not use lists unless the content is explicitly a list of items or sequential steps. 458 459 - **HEADINGS:** 460 - Main sections (e.g., '## Learning Objectives') MUST use a '##' heading. 461 - Sub-sections within 'Instructional Procedures' MUST use '###' headings (e.g., '### Step 1: Introduction & Modeling'). **DO NOT use a numbered list for these steps.** This is a critical instruction. 462 463 - **LISTS - USE SPARINGLY AND CORRECTLY:** 464 - **Bulleted Lists (-):** Use a hyphen '-' ONLY for lists of items where order does not matter (e.g., materials, objectives). 465 - **For lists of probing questions:** Each list item MUST begin with the topic in bold. Example: \`- **For Environment:** What school rules might affect your solution?\` 466 - **Numbered Lists (1.):** Use numbers (e.g., '1.', '2.') ONLY for a sequence of **MORE THAN ONE** consecutive, ordered actions that a teacher or student must follow. 467 - **NEGATIVE EXAMPLE (INCORRECT):** 468 1. The teacher will now explain the concept of the 'Customer'. 469 - **POSITIVE EXAMPLE (CORRECT):** 470 The teacher will now explain the concept of the 'Customer'. 471 - **POSITIVE EXAMPLE (CORRECT for a sequence):** 472 1. Distribute Handout 1 to each student. 473 2. Set a timer for 5 minutes. 474 3. Instruct students to quietly brainstorm ideas for the 'Environment' section. 475 476 - **SUB-CATEGORY LABELS (A COMMON FAILURE):** 477 - For labels like "Success Criteria:" or "Digital Resources:", you MUST format them as a **bolded paragraph on its own line**. They are NOT bullet points. They are headings for the list that follows. 478 - **CORRECT EXAMPLE:** 479 The teacher outlines the success criteria for the independent work. 480 481 **Success Criteria:** 482 - All seven sections of the ECO-STAR graphic organizer are completed. 483 - The chosen problem is clearly stated. 484 485 **LESSON PLAN STRUCTURE:** 486 The lesson plan MUST follow this exact structure: 487 488 ## [Lesson Title] 489 490 ## Learning Objectives 491 492 ## Essential Question 493 494 ## Materials & Resources 495 496 ## Hook / Anticipatory Set 497 498 ## Instructional Procedures 499 ### Step 1: Introduction & Modeling 500 ### Step 2: Guided Practice 501 ### Step 3: Independent Practice / Application 502 503 ## Assessment 504 ### Formative Assessment 505 ### Summative Assessment 506 507 ## Differentiation Strategies 508 ### For English Language Learners 509 ### For Students with Special Needs 510 ### For Advanced Learners/Early Finishers 511 512 --- 513 Generate the comprehensive and highly detailed lesson plan now, ensuring it meets all content, formatting, and length requirements. 514 `;try{const F=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-pro",contents:I})).text;o(F),b("saving");const P=F.match(/^## (.*)/m),$=P?P[1]:"Untitled Lesson Plan",{error:H}=await oe.from("costar_saved_lessons").insert({title:$,inputs:n,lesson_plan_content:F});H?(console.error("Error auto-saving lesson plan:",H),b("error")):b("saved")}catch(U){m("An error occurred while generating the lesson plan. Please try again."),console.error(U)}finally{c(!1)}},A=()=>{if(!w.current)return;const I=w.current.cloneNode(!0);I.querySelectorAll("h2, h3, h4").forEach(P=>{const $=P;$.style.paddingLeft="0",$.style.marginLeft="0"});const U=new Blob([I.innerHTML],{type:"text/html"}),G=new Blob([w.current.innerText],{type:"text/plain"}),F=new ClipboardItem({"text/html":U,"text/plain":G});navigator.clipboard.write([F]).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)}
514).catch(P=>{var $;console.error("Failed to copy rich text:",P),navigator.clipboard.writeText((($=w.current)==null?void 0:$.innerText)||"").then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})})},E=["Full ECO-STAR Introduction",...Yt.map(I=>`${I.letter} - ${I.title}`)];return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-purple-500 to-sky-600",children:"Lesson Plan Generator"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Create customized, Common Core-aligned lesson plans for your classroom, integrating ECO-STAR principles into any subject."})]}),l.jsxs("div",{className:"mt-12 bg-white border border-slate-200 rounded-2xl p-8 shadow-sm",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs(Br,{label:"Grade Level",id:"gradeLevel",value:n.gradeLevel,onChange:_,children:[l.jsx("option",{children:"Kindergarten-2nd Grade"}),l.jsx("option",{children:"3rd-5th Grade"}),l.jsx("option",{children:"6th-8th Grade"}),l.jsx("option",{children:"9th-12th Grade"}),l.jsx("option",{children:"University/College"})]}),l.jsxs(Br,{label:"Reading Level",id:"readingLevel",value:n.readingLevel,onChange:_,children:[l.jsx("option",{children:"Beginner"}),l.jsx("option",{children:"Intermediate"}),l.jsx("option",{children:"Advanced"}),l.jsx("option",{children:"College-Level"})]}),l.jsx(Br,{label:"ECO-STAR Component",id:"ecoStarComponent",value:n.ecoStarComponent,onChange:_,children:E.map(I=>l.jsx("option",{children:I},I))}),l.jsxs(Br,{label:"Class Type / Subject Area",id:"subjectArea",value:n.subjectArea,onChange:_,children:[l.jsx("option",{children:"Creative Entrepreneurship"}),l.jsx("option",{children:"Art & Design"}),l.jsx("option",{children:"Technology & AI"}),l.jsx("option",{children:"Creative Leadership"}),l.jsx("option",{children:"Critical Thinking"}),l.jsx("option",{children:"Environmental Science"}),l.jsx("option",{children:"Social Studies"}),l.jsx("option",{children:"Business & Marketing"})]}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("label",{htmlFor:"specificTopics",className:"block text-sm font-medium text-slate-700 mb-2",children:"Specific Topics (Optional)"}),l.jsx("textarea",{id:"specificTopics",name:"specificTopics",rows:3,value:n.specificTopics,onChange:_,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-purple-500 text-slate-900",placeholder:"e.g., Using recycled materials for a sculpture project, or interviewing local elders about community needs."})]})]}),l.jsx("div",{className:"text-center mt-8",children:l.jsx("button",{onClick:C,disabled:a,className:"px-8 py-3 rounded-md bg-purple-600 text-white font-bold hover:bg-purple-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:a?"Generating...":"Generate Lesson Plan"})})]}),(s||d||a)&&l.jsxs("div",{className:"mt-12",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Generated Lesson Plan"}),s&&!a&&l.jsx("div",{className:"flex gap-2",children:l.jsx("button",{onClick:A,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-700 transition w-24",children:y?"Copied!":"Copy"})})]}),l.jsxs("div",{className:"bg-white p-6 md:p-8 rounded-xl border border-slate-200 shadow-lg min-h-[20rem]",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Building your lesson plan... Please wait."}),d&&l.jsx("div",{className:"text-center text-rose-500",children:d}),s&&l.jsx("div",{ref:w,children:l.jsx(F1,{content:s})})]})]}),l.jsxs(dn,{title:"ECO-STAR in the Classroom: A Framework for Inquiry",gradient:"from-purple-500 to-sky-600",children:[l.jsx("p",{children:"Education is not just about transmitting information; it's about cultivating a mindset of curiosity, critical thinking, and creative problem-solving. The ECO-STAR framework serves as a powerful pedagogical tool for project-based learning, guiding students through a holistic process of inquiry that mirrors the real-world challenges of innovation."}),l.jsx("p",{children:"By integrating ECO-STAR into your curriculum, you can empower students to:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Think in Systems (Environment):"})," Understand how their ideas connect to larger ecological and social contexts."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Develop Empathy (Customer):"}
514)," Practice deep listening and human-centered design by focusing on the real needs of a community or user."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Become Critical Observers (Opportunity):"})," Learn to analyze the world around them, identify gaps, and see potential for positive change."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Foster Creativity & Iteration (Solution):"})," Engage in the hands-on process of brainstorming, prototyping, and refining their ideas."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cultivate Collaboration (Team):"})," Recognize the diverse skills and perspectives needed to bring a complex project to life."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Articulate Value (Advantage & Results):"})," Learn to communicate their unique vision and the tangible impact of their work."]})]}),l.jsx("p",{children:"This generator is designed to bridge the gap between this powerful framework and the day-to-day realities of the classroom, providing a structured yet flexible starting point for lessons that are not only aligned with standards but are also deeply engaging and relevant to the challenges of the 21st century."})]})]})})},Y1=({content:n})=>{const e=y=>y.split(/(\*\*.*?\*\*|\*.*?\*)/g).map((f,v)=>f.startsWith("**")&&f.endsWith("**")?l.jsx("strong",{className:"font-semibold text-slate-900",children:f.substring(2,f.length-2)},v):f.startsWith("*")&&f.endsWith("*")?l.jsx("em",{children:f.substring(1,f.length-1)},v):f),s=[],o=n.split(` 515`);let a=[],c=[];const d=y=>{a.length>0&&(s.push(l.jsx("ul",{className:"list-disc list-outside pl-6 space-y-2 my-4",children:a.map((f,v)=>l.jsx("li",{className:"text-slate-700 leading-relaxed",children:e(f)},v))},y)),a=[])},m=y=>{c.length>0&&(s.push(l.jsx("ol",{className:"list-decimal list-outside pl-6 space-y-2 my-4",children:c.map((f,v)=>l.jsx("li",{className:"text-slate-700 leading-relaxed",children:e(f)},v))},y)),c=[])};return o.forEach((y,f)=>{const v=y.trim(),b=`block-${f}`;v.startsWith("## ")?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h2",{className:"text-2xl font-bold text-orange-700 mt-8 mb-4 pb-2 border-b border-orange-200",children:v.substring(3)},b))):v.startsWith("### ")?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h3",{className:"text-xl font-bold text-sky-700 mt-6 mb-3",children:v.substring(4)},b))):/^\*\*.+\*\*$/.test(v)?(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("h4",{className:"text-lg font-bold text-slate-800 mt-4 mb-2",children:v.substring(2,v.length-2)},b))):v.startsWith("- ")||v.startsWith("* ")?(m(`ol-${b}`),a.push(v.substring(2))):/^\d+\.\s/.test(v)?(d(`ul-${b}`),c.push(v.replace(/^\d+\.\s/,""))):v.length>0&&(d(`ul-${b}`),m(`ol-${b}`),s.push(l.jsx("p",{className:"text-slate-700 leading-relaxed my-3",children:e(v)},b)))}),d("ul-last"),m("ol-last"),l.jsx("div",{children:s})},ca=({label:n,id:e,value:s,onChange:o,children:a})=>l.jsxs("div",{children:[l.jsx("label",{htmlFor:e,className:"block text-sm font-medium text-slate-700 mb-2",children:n}),l.jsx("select",{id:e,name:e,value:s,onChange:o,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-orange-500 text-slate-900",children:a})]}),J1=()=>{const[n,e]=R.useState({workshopType:"Innovation & Ideation",workshopLength:"4 Hours (Half-Day)",audience:"Artists and Creative Sector Workers",proficiencyLevel:"Introductory/Basic",ecoStarComponent:"Full ECO-STAR Introduction",desiredOutcomes:""}),[s,o]=R.useState(""),[a,c]=R.useState(!1),[d,m]=R.useState(""),[y,f]=R.useState(!1),v=R.useRef(null),b=A=>{const{name:E,value:I}=A.target;e(U=>({...U,[E]:I}))},w=async()=>{c(!0),m(""),o("");const A=` 516 You are an expert workshop facilitator and instructional designer with deep experience in creating engaging, effective, and transformative learning experiences. 517 Your task is to generate a comprehensive, in-depth, and highly detailed workshop facilitation guide based on the user's specifications. You must tailor the complexity of the content, the depth of explanations, and the nature of the activities to the specified audie
517nce proficiency level. The final output should be a multi-page document, approximately 2000-3000 words in length. 518 519 **Core Methodology:** 520 The workshop must be built around the **ECO-STAR innovation methodology** (Environment, Customer, Opportunity, Solution, Team, Advantage, Results). 521 522 **User Specifications:** 523 - **Type of Workshop:** ${n.workshopType} 524 - **Workshop Length:** ${n.workshopLength} 525 - **Target Audience:** ${n.audience} 526 - **Audience Proficiency Level:** ${n.proficiencyLevel} 527 - **ECO-STAR Component Focus:** ${n.ecoStarComponent} 528 - **Desired Outcomes:** ${n.desiredOutcomes||"General understanding and application of the specified ECO-STAR components."} 529 530 **Content Depth Requirements:** 531 - **Extreme Detail:** Each section must be significantly expanded. For the agenda, this means providing detailed facilitator talking points, step-by-step instructions for activities, specific questions to pose to the group, and time allocations for each segment. 532 - **Rich Explanations:** Provide background context. Explain the "why" behind each activity and how it connects to the overall learning objectives. 533 534 **ABSOLUTELY CRITICAL OUTPUT FORMATTING RULES - NON-NEGOTIABLE & VICIOUSLY ENFORCED:** 535 You MUST generate the workshop plan using strict markdown. Any deviation is a failure. 536 537 - **THE DEFAULT IS PARAGRAPHS:** All descriptive text, explanations, and instructions MUST be standard paragraphs. Do not use lists unless the content is explicitly a list of items. A single instruction is a paragraph, not a numbered list with one item. 538 539 - **HEADINGS:** 540 - Main sections (e.g., '## Workshop Overview & Goals') MUST use a '##' heading. 541 - Agenda items (e.g., '### 0:00-0:15 â Welcome & Icebreaker (15 mins)') MUST use a '###' heading. This is critical for the agenda structure. 542 543 - **LISTS:** 544 - Use a hyphen '-' ONLY for lists of items where order does not matter (e.g., materials). 545 546 - **SUB-CATEGORY LABELS:** 547 - For labels like "Facilitator Talking Points:" or "Activity Instructions:", you MUST format them as a **bolded paragraph on its own line**. They are NOT bullet points. They are headings for the text that follows. 548 - **CORRECT EXAMPLE:** 549 The facilitator will now introduce the concept of 'Environment'. 550 551 **Facilitator Talking Points:** 552 "Welcome everyone. Today, we're going to explore..." 553 554 **WORKSHOP PLAN STRUCTURE:** 555 The plan MUST follow this exact structure: 556 557 ## [Workshop Title] 558 559 ## Workshop Overview & Goals 560 561 ## Target Audience 562 563 ## Materials & Preparation 564 565 ## Workshop Agenda (Total Time: [Workshop Length]) 566 ### [Time Range] â [Activity Title] ([Duration]) 567 (Detailed description, talking points, and instructions here) 568 ### [Next Time Range] â [Next Activity Title] ([Duration]) 569 (And so on for the entire duration...) 570 571 ## Facilitator's Notes & Key Considerations 572 573 ## Follow-up Activities & Resources 574 575 --- 576 Generate the comprehensive facilitation guide now, ensuring it meets all content, formatting, and length requirements. 577 `;try{const U=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-pro",contents:A})).text;o(U)}catch(E){m("An error occurred while generating the workshop plan. Please try again."),console.error(E)}finally{c(!1)}},_=()=>{if(!v.current)return;const A=v.current.cloneNode(!0);A.querySelectorAll("h2, h3, h4").forEach(G=>{const F=G;F.style.paddingLeft="0",F.style.marginLeft="0"});const E=new Blob([A.innerHTML],{type:"text/html"}),I=new Blob([v.current.innerText],{type:"text/plain"}),U=new ClipboardItem({"text/html":E,"text/plain":I});navigator.clipboard.write([U]).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},C=["Full ECO-STAR Introduction",...Yt.map(A=>`${A.letter} - ${A.title}`)];return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-orange-500 to-rose-600",children:"Workshop Planner"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Design detailed facilitation guides for impactful workshops. From short ideation sprints to full-day strategic sessions, generate a complete plan in minutes."})]}),l.jsxs("div",{className:"mt-12 bg-white border border-slate-200 rounded-2xl p-8 shadow-sm",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs(ca,{label:"Type of Workshop",id:"workshopType",value:n.workshopType,onCh
577ange:b,children:[l.jsx("option",{children:"Innovation & Ideation"}),l.jsx("option",{children:"Strategic Planning"}),l.jsx("option",{children:"Team Building & Collaboration"}),l.jsx("option",{children:"Community Engagement"}),l.jsx("option",{children:"Creative Skills Development"})]}),l.jsxs(ca,{label:"Workshop Length",id:"workshopLength",value:n.workshopLength,onChange:b,children:[l.jsx("option",{children:"1 Hour"}),l.jsx("option",{children:"2 Hours"}),l.jsx("option",{children:"4 Hours (Half-Day)"}),l.jsx("option",{children:"8 Hours (Full-Day)"})]}),l.jsxs(ca,{label:"Target Audience",id:"audience",value:n.audience,onChange:b,children:[l.jsx("option",{children:"Artists and Creative Sector Workers"}),l.jsx("option",{children:"Youth and Elders"}),l.jsx("option",{children:"Boards and Organizations"}),l.jsx("option",{children:"Technology"}),l.jsx("option",{children:"General Public"}),l.jsx("option",{children:"Education and Research"})]}),l.jsxs(ca,{label:"Proficiency Level/Understanding",id:"proficiencyLevel",value:n.proficiencyLevel,onChange:b,children:[l.jsx("option",{children:"Introductory/Basic"}),l.jsx("option",{children:"General Knowledge"}),l.jsx("option",{children:"Advanced Understanding"})]}),l.jsx("div",{className:"md:col-span-2",children:l.jsx(ca,{label:"ECO-STAR Component Focus",id:"ecoStarComponent",value:n.ecoStarComponent,onChange:b,children:C.map(A=>l.jsx("option",{children:A},A))})}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("label",{htmlFor:"desiredOutcomes",className:"block text-sm font-medium text-slate-700 mb-2",children:"Desired Outcomes (Optional)"}),l.jsx("textarea",{id:"desiredOutcomes",name:"desiredOutcomes",rows:3,value:n.desiredOutcomes,onChange:b,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-orange-500 text-slate-900",placeholder:"e.g., Participants will leave with 3-5 concrete project ideas and a clear understanding of their target customer."})]})]}),l.jsx("div",{className:"text-center mt-8",children:l.jsx("button",{onClick:w,disabled:a,className:"px-8 py-3 rounded-md bg-orange-600 text-white font-bold hover:bg-orange-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:a?"Generating...":"Generate Workshop Plan"})})]}),(s||d||a)&&l.jsxs("div",{className:"mt-12",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Generated Workshop Plan"}),s&&!a&&l.jsx("button",{onClick:_,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-700 transition w-24",children:y?"Copied!":"Copy"})]}),l.jsxs("div",{className:"bg-white p-6 md:p-8 rounded-xl border border-slate-200 shadow-lg min-h-[20rem]",children:[a&&l.jsx("div",{className:"text-center text-slate-500",children:"Building your workshop plan... Please wait."}),d&&l.jsx("div",{className:"text-center text-rose-500",children:d}),s&&l.jsx("div",{ref:v,children:l.jsx(Y1,{content:s})})]})]}),l.jsxs(dn,{title:"The Art of Facilitation: Creating Spaces for Breakthroughs",gradient:"from-orange-500 to-rose-600",children:[l.jsx("p",{children:"A great workshop is more than just a presentation; it's a carefully designed experience. It's a temporary, intentional space where new ideas can emerge, collaborations can form, and breakthroughs can happen. The role of the facilitator is not to be a sage on the stage, but a guide on the sideâcreating the structure, posing the right questions, and holding the space for the group's collective intelligence to do its work."}),l.jsx("p",{children:"This Workshop Planner is designed to be your expert partner in that process. It helps you think through the critical elements of a successful gathering:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Clear Outcomes:"})," Beginning with the end in mind. What do you want participants to think, feel, or be able to do differently by the end of your time together?"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Logical Flow:"})," Crafting an agenda that builds momentum, moving from introductions and trust-building to deep work and concrete action steps."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Engaging Activities:"})," Designing interactive exercises that get people out of their chairs and their heads, fostering participation and creative thinking."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Thoughtful Preparation:"})," Considering all the details, from the physical space and materials needed to the digital tools that will support the work."]})]}),l.jsx("p",{children:"Whether you are leading your own team through a strategic planning session or guiding a community group through an i
577deation process, a well-thought-out plan is the foundation for a transformative experience. Use this tool to handle the structural design, so you can focus on the most important part: being present with the people in the room."})]})]})})},Hr=({label:n,id:e,name:s,value:o,onChange:a,children:c})=>l.jsxs("div",{children:[l.jsx("label",{htmlFor:e,className:"block text-sm font-medium text-slate-700 mb-2",children:n}),l.jsx("select",{id:e,name:s,value:o,onChange:a,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900",children:c})]}),O0=({label:n,id:e,name:s,value:o,onChange:a,placeholder:c,type:d="text"})=>l.jsxs("div",{children:[l.jsx("label",{htmlFor:e,className:"block text-sm font-medium text-slate-700 mb-2",children:n}),l.jsx("input",{id:e,name:s,type:d,value:o,onChange:a,placeholder:c,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900"})]}),Lu=({text:n})=>l.jsx(l.Fragment,{children:n.split(/(\*\*.*?\*\*)/g).map((e,s)=>e.startsWith("**")&&e.endsWith("**")?l.jsx("strong",{children:e.substring(2,e.length-2)},s):e)}),K1=()=>{const[n,e]=R.useState({topic:"Interdisciplinary arts",style:"Varied",hashtags:"#ECOSTARNorth",url:"",numTweets:"10",language:"English"}),[s,o]=R.useState(""),[a,c]=R.useState(""),[d,m]=R.useState(""),[y,f]=R.useState("1"),[v,b]=R.useState("days"),[w,_]=R.useState([]),[C,A]=R.useState(!1),[E,I]=R.useState(""),U=H=>{const{name:Z,value:X}=H.target;e(q=>({...q,[Z]:X}))},G=async()=>{A(!0),I(""),_([]);const H=n.topic==="Other"?a:n.topic;if(!H.trim()){I("Please specify a topic."),A(!1);return}let Z=H;const X="ECO-STAR: ";if(H.startsWith(X)){const ne=H.substring(X.length),se=Yt.find(fe=>fe.title===ne);se&&(Z=`The ECO-STAR principle of "${se.title}". This principle is about: ${se.description}`)}const q=n.hashtags.split(/[\s,]+/).filter(ne=>ne.length>0).map(ne=>`#${ne.replace(/^#/,"")}`).join(" "),Q=` 578 Act as a savvy and authentic social media manager for a non-profit focused on innovation, arts, community, and climate solutions. Your tone should be personable, engaging, and reflect the vocabulary and style of youth in 2025âthink authentic, focused, and tightly written. Avoid generic, corporate, or robotic language at all costs. Your goal is to create content that sparks conversation and builds community. 579 580 **Context for Analysis (if provided):** 581 Analyze the following text to extract key themes, ideas, and quotes to use in the generated posts. 582 --- 583 ${s||"No context provided."} 584 --- 585 586 Generate ${n.numTweets} social media posts (tweets) based on the following criteria: 587 588 - **Language:** ${n.language} 589 - **Topic:** ${Z} 590 - **Style:** ${n.style}. (If 'Varied', create a mix of different styles. If 'Focused', provide concise, direct statements about the topic. If 'Questioning/asking people what they think', primarily ask open-ended questions to the audience to spark conversation. If 'Storytelling', write a short narrative or personal anecdote related to the topic. If 'Call to Action', create posts that directly ask the audience to do something (e.g., visit a link, share their thoughts, join an event). If 'Ins
590pirational/Provocative', share a powerful quote, a challenging question, or a visionary statement to make people think. If 'Educational/Informative', share a key fact, a surprising statistic, or a clear definition related to the topic. If 'Behind-the-Scenes', give a glimpse into the process, the people, or the work being done related to the topic. If 'Encourage people to follow our adventures', create posts that invite the audience to join the journey, follow for updates, and be part of the story as it unfolds.) 591 - **Character Limit:** Each post must be between 150 and 200 characters. This is a strict limit. 592 - **Hashtags:** 593 - ALWAYS include the following mandatory hashtags: ${q} 594 - Also include 1-2 additional, highly-relevant hashtags per post. 595 - **Hashtag Integration:** Where it feels natural and grammatically correct, integrate hashtags directly into the sentences of the post. For example, "Our work in #community is all about fostering #innovation." For any hashtags that don't fit naturally, append them to the end of the post. 596 - **CRITICAL HASHTAG RULE:** These additional hashtags must be simple, high-traffic keywords for SEO purposes. They should NOT be crafty, trendy, or concatenated words. Think like an SEO expert. Good examples: #Art, #Community, #Innovation. Bad examples: #ArtisticFusion, #CommunityLove, #InnovateForGood. 597 - **URL:** A URL is provided separately for scheduling purposes. **DO NOT** include any URLs in the generated post text itself. The posts must consist of text and hashtags only. 598 - **Emojis:** Sparingly include 1-2 relevant emojis per post to enhance tone and visual appeal. Do not overuse them. 599 600 The posts should feel like they were written by a real, passionate person. 601 602 Provide a JSON object with a single key "posts". The value should be an array of strings, where each string is a complete tweet. 603 `;try{const fe=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:Q,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{posts:{type:le.ARRAY,items:{type:le.STRING},description:"An array of generated social media posts."}},required:["posts"]}}})).text.trim(),ge=JSON.parse(fe);_(ge.posts)}catch(ne){I("An error occurred while generating posts. Please try again."),console.error(ne)}finally{A(!1)}},F=()=>{_([]),I("")},P=H=>{const Z=H.getFullYear(),X=String(H.getMonth()+1).padStart(2,"0"),q=String(H.getDate()).padStart(2,"0");let Q=H.getHours();const ne=String(H.getMinutes()).padStart(2,"0"),se=String(H.getSeconds()).padStart(2,"0"),fe=Q>=12?"PM":"AM";Q=Q%12,Q=Q||12;const ge=String(Q).padStart(2,"0");return`${Z}-${X}-${q} ${ge}:${ne}:${se} ${fe}`},$=()=>{if(w.length===0)return;const H=k=>{if(k==null)return"";let M=String(k);return M.includes(",")||M.includes(` 604`)||M.includes('"')?(M=M.replace(/"/g,'""'),`"${M}"`):M},Z=["schedule_time","text","url"],X=d?new Date(d):null,q=parseInt(y,10),ne=[Z.join(","),...w.map((k,M)=>{let J="";if(X&&!isNaN(X.getTime())&&!isNaN(q)&&q>0){const ee=new Date(X.getTime());v==="minutes"?ee.setMinutes(ee.getMinutes()+M*q):v==="hours"?ee.setHours(ee.getHours()+M*q):ee.setDate(ee.getDate()+M*q),J=P(ee)}return[J,H(k),H(n.url)].join(",")})].join(` 605`),se=new Blob([ne],{type:"text/csv;charset=utf-8;"}),fe=document.createElement("a"),ge=URL.createObjectURL(se);fe.setAttribute("href",ge);const te=(n.topic==="Other"?a:n.topic).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/[\s-]+/g,"_").substring(0,25),ae=new Date,ve=`${ae.getFullYear()}${String(ae.getMonth()+1).padStart(2,"0")}${String(ae.getDate()).padStart(2,"0")}_${String(ae.getHours()).padStart(2,"0")}${String(ae.getMinutes()).padStart(2,"0")}`,Te=`ecostar_posts_${te}_${ve}.csv`;fe.setAttribute("download",Te),fe.style.visibility="hidden",document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(ge)};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-pink-500 to-rose-600",children:"Social Media Post Generator"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Generate personable and authentic social media posts to build your community and share your story."})]}),l.jsxs("div",{className:"mt-12 bg-white border border-slate-200 rounded-2xl p-8 shadow-sm",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs(Hr,{label:"Topic",id:"topic",name:"topic",value:n.topic,onChange:U,children:[l.jsx("option",{children:"Interdisciplinary arts"}),l.jsx("option",{children:"Social innovation"}),l.jsx("option",{children:"Tips and tricks for applying the ECO-STAR Methodology"}),Yt.map(H=>l.jsx("option",{children:`ECO-STAR: ${H.title}`},H.letter)),l.jsx("option",{children:"AI as a third knowledge system"}),l.jsx("option",{children:"AI and the arts"}),l.jsx("option",{children:"Community-led development"}),l.jsx("option",{children:"Creative leadership"}),l.jsx("option",{children:"Other"})]}),n.topic==="Other"?l.jsxs("div",{className:"md:col-span-1",children:[l.jsx("label",{htmlFor:"customTopic",className:"block text-sm font-medium text-slate-700 mb-2",children:"Custom Topic"}),l.jsx("input",{id:"customTopic",name:"customTopic",type:"text",value:a,onChange:H=>c(H.target.value),placeholder:"Enter your custom topic here",className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900"})]}):l.jsx("div",{className:"hidden md:block"}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("label",{htmlFor:"context",className:"block text-sm font-medium text-slate-700 mb-2",children:"Context (Optional)"}),l.jsx("textarea",{id:"context",name:"context",rows:5,value:s,onChange:H=>o(H.target.value),placeholder:"Paste an article, blog post, or other text here for the AI to analyze...",className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900"})]}),l.jsxs(Hr,{label:"Post Style",id:"style",name:"style",value:n.style,onChange:U,children:[l.jsx("option",{children:"Varied"}),l.jsx("option",{children:"Focused"}),l.jsx("option",{children:"Questioning/asking people what they think"}),l.jsx("option",{children:"Storytelling"}),l.jsx("option",{children:"Call to Action"}),l.jsx("option",{children:"Inspirational/Provocative"}),l.jsx("option",{children:"Educational/Informative"}),l.jsx("option",{children:"Behind-the-Scenes"}),l.jsx("option",{children:"Encourage people to follow our adventures"})]}),l.jsx(O0,{label:"Mandatory Hashtags",id:"hashtags",name:"hashtags",value:n.hashtags,onChange:U,placeholder:"#ECOSTARNorth #Innovation"}),l.jsx(O0,{label:"URL to Include (Optional)",id:"url",name:"url",value:n.url,onChange:U,placeholder:"https://example.com"}),l.jsxs(Hr,{label:"Number of Posts",id:"numTweets",name:"numTweets",value:n.numTweets,onChange:U,children:[l.jsx("option",{children:"10"}),l.jsx("option",{children:"20"}),l.jsx("option",{children:"50"})]}),l.jsxs("div",{className:"md:col-span-2 border-t border-slate-200 pt-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-800 mb-4",children:"Scheduling Options (for CSV export)"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"startTime",className:"block text-sm font-medium text-slate-700 mb-2",children:"Start Date & Time"}),l.jsx("input",{id:"startTime",name:"startTime",type:"datetime-local",value:d,onChange:H=>m(H.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900"})]}),l.jsxs("div",{className:"sm:col-span-2",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Post Frequency"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{id:"frequencyValue",name:"frequencyValue",type:"number",min:"1",value:y,onChange:H=>f(H.target.value),className:"w-1/3 bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900"}),l.jsxs("select",{id:"frequencyUnit",name:"frequencyUnit",value:v,onCh
605ange:H=>b(H.target.value),className:"w-2/3 bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-pink-500 text-slate-900",children:[l.jsx("option",{value:"minutes",children:"Minutes"}),l.jsx("option",{value:"hours",children:"Hours"}),l.jsx("option",{value:"days",children:"Days"})]})]})]})]})]}),l.jsxs(Hr,{label:"Language",id:"language",name:"language",value:n.language,onChange:U,children:[l.jsx("option",{children:"English"}),l.jsx("option",{children:"French"}),l.jsx("option",{children:"German"})]})]}),l.jsx("div",{className:"text-center mt-8",children:l.jsx("button",{onClick:G,disabled:C,className:"px-8 py-3 rounded-md bg-pink-600 text-white font-bold hover:bg-pink-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:C?"Generating...":"Generate Posts"})})]}),(w.length>0||E||C)&&l.jsxs("div",{className:"mt-12",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center mb-4 gap-4",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Generated Posts"}),w.length>0&&!C&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:F,className:"px-4 py-2 text-sm rounded-md bg-slate-200 text-slate-700 font-semibold hover:bg-slate-300 transition",children:"Clear"}),l.jsx("button",{onClick:$,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-700 transition",children:"Download as CSV"})]})]}),l.jsxs("div",{className:"bg-white p-6 md:p-8 rounded-xl border border-slate-200 shadow-lg min-h-[20rem]",children:[C&&l.jsx("div",{className:"text-center text-slate-500",children:"Generating content... This might take a moment."}),E&&l.jsx("div",{className:"text-center text-rose-500",children:E}),w.length>0&&l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-200",children:l.jsx("tr",{children:l.jsx("th",{className:"p-2 text-sm text-slate-500 font-semibold uppercase",children:"Post Text"})})}),l.jsx("tbody",{children:w.map((H,Z)=>l.jsx("tr",{className:"border-b border-slate-100 last:border-0 hover:bg-slate-50 transition",children:l.jsxs("td",{className:"p-3 text-slate-700 whitespace-pre-wrap leading-relaxed",children:[H,n.url&&l.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-sky-600 block mt-2 truncate hover:underline",children:n.url})]})},Z))})]})})]})]}),l.jsxs(dn,{title:"Crafting Your Digital Voice: Authenticity in a Crowded World",gradient:"from-pink-500 to-rose-600",children:[l.jsx("p",{children:"In today's digital world, a social media feed is more than just a marketing channel; it's a digital campfire. It's a space to tell your story, share your values, ask questions, and build a genuine community around your work. However, the pressure to constantly create content can lead to posts that feel generic, robotic, and disconnected from the human voice that makes your project unique."}),l.jsx("p",{children:"This Social Media Post Generator is designed to be a creative partner, not a content factory. It helps you brainstorm ideas and craft messages in a voice that is authentic to your mission. By providing different styles and topics, it encourages you to think about your digital presence as a dynamic conversation rather than a one-way broadcast."}),l.jsxs("ul",{children:[l.jsx("li",{children:l.jsx(Lu,{text:"**Focused** posts help you clearly articulate your core message, aligning with the Solution and Advantage principles of ECO-STAR."})}),l.jsx("li",{children:l.jsx(Lu,{text:"**Questioning** posts invite your community (Customer) into a dialogue, fostering engagement and co-creation."})}),l.jsx("li",{children:l.jsx(Lu,{text:"**Varied** posts create a rich and engaging narrative, reflecting the holistic nature of the entire ECO-STAR framework."})})]}),l.jsx("p",{children:"Use this tool to spark ideas and save time, but always remember to infuse the final posts with your own personal touch. The goal is not to automate your voice, but to amplify it, allowing you to spend more time on what truly matters: building relationships and making an impact."})]})]})})},Q1=({content:n})=>{const e=a=>a.split(/(\*\*.*?\*\*|\*.*?\*)/g).map((c,d)=>c.startsWith("**")&&c.endsWith("**")?l.jsx("strong",{className:"font-semibold text-slate-900",children:c.substring(2,c.length-2)},d):c.startsWith("*")&&c.endsWith("*")?l.jsx("em",{children:c.substring(1,c.length-1)},d):c),s=[];return n.split(` 606 607`).forEach((a,c)=>{const d=`block-${c}`,m=a.split(` 608`);let y=!1;const f=m.reduce((v,b)=>{const w=b.trim();return w.startsWith("- ")||w.startsWith("* ")?(y=!0,v.push(w.substring(2))):y&&w.length>0&&(v[v.length-1]+=" "+w),v},[]);a.trim().startsWith("## ")?s.push(l.jsx("h2",{className:"text-3xl font-bold text-violet-800 mt-10 mb-4",children:e(a.substring(3))},d)):a.trim().startsWith("### ")?s.push(l.jsx("h3",{className:"text-2xl font-semibold text-violet-700 mt-8 mb-4",children:e(a.substring(4))},d)):a.trim().startsWith("#### ")?s.push(l.jsx("h4",{className:"text-xl font-semibold text-slate-800 mt-6 mb-3",children:e(a.substring(5))},d)):y?s.push(l.jsx("ul",{className:"list-disc list-outside pl-6 space-y-2 my-4",children:f.map((v,b)=>l.jsx("li",{className:"text-slate-700 leading-relaxed",children:e(v)},b))},d)):a.trim().length>0&&s.push(l.jsx("p",{className:"text-slate-700 leading-relaxed my-6",children:e(a)},d))}),l.jsx("div",{children:s})},W1=()=>
608{const[n,e]=R.useState(""),[s,o]=R.useState([]),[a,c]=R.useState([]),[d,m]=R.useState([]),[y,f]=R.useState(""),[v,b]=R.useState(!1),[w,_]=R.useState(""),[C,A]=R.useState("idle"),[E,I]=R.useState(!1),U=R.useRef(null);R.useEffect(()=>{(async()=>{const{data:ne,error:se}=await oe.from("costar_methodologies").select("id, name, description, type").order("type").order("name");se?(console.error("Error fetching methodologies:",se),_("Could not load items from the database.")):c(ne)})()},[]);const G=Q=>{m(ne=>ne.some(se=>se.id===Q.id)?ne.filter(se=>se.id!==Q.id):[...ne,Q])},F=Q=>{o(ne=>{const se=ne.includes(Q)?ne.filter(fe=>fe!==Q):[...ne,Q];return se.length>2?se.slice(-2):se})},P=async()=>{if(!n.trim()){_("Please describe your project or research idea.");return}b(!0),_(""),f(""),A("idle");let Q;const ne=d.length===0;if(ne)Q=` 609 Act as a senior academic researcher and principal investigator with extensive experience in designing interdisciplinary research methodologies for major funding bodies like SSHRC, NSERC, and the US NSF. Your writing style must be formal, direct, rigorous, and professional. Avoid any jargon, "artsy" terms, or unnecessary filler words. The output must be a detailed, scholarly document suitable for a formal research proposal. 610 611 Your task is to create a locally/community-developed, comprehensive, and deeply theoretical research methodology for a user's specific project, with a specific emphasis on the provided focus areas. 612 613 Your response must be a large, detailed academic document of at least 1500-2000 words. 614 615 **Core Task:** 616 Synthesize the user's project idea with the **ECO-STAR innovation framework** and fuse it with the most effective and efficient established academic methodologies, epistemologies, approaches, and pedagogies relevant to the project. The goal is to create a novel, robust, synthesized methodological framework. 617 618 **User's Project / Research Idea:** 619 "${n}" 620 621 **Primary Focus Areas:** 622 "${s.length>0?s.join(", "):"None specified"}" 623 624 **The Foundational ECO-STAR Framework:** 625 You must weave every component of ECO-STAR throughout the generated methodology. 626 - **E (Environment):** Context, setting, ecological/social systems. 627 - **C (Customer):** The community, user, or participants at the heart of the research. 628 - **O (Opportunity):** The gap in knowledge, the potential for impact, the wider context. 629 - **S (Solution):** The proposed intervention, project, or research outcome. 630 - **T (Team):** The collaborative and relational aspects of the research team. 631 - **A (Advantage):** The unique perspective or contribution of this research. 632 - **R (Results):** The intended impact, outcomes, and measures of success (both qualitative and quantitative). 633 634 **CRITICAL INSTRUCTIONS FOR GENERATION:** 635 636 1. **Synthesize, Don't Just List:** Do not simply list methodologies. You must create a new, coherent framework. Invent a unique, academic-sounding name for this new synthesized methodology. 637 2. **Multi-Concept Fusion:** You are required to select and synthesize **one to three (1-3)** relevant concepts from **each** of the following academic categories: Methodologies, Epistemologies, Approaches, and Pedagogies. This is not optional. The resulting framework must be a true fusion of multiple concepts. 638 3. **Justify All Choices:** For every external methodology or concept you introduce (e.g., 'Grounded Theory', 'Participatory Action Research', 'Phenomenology'), you must provide a detailed explanation of what it is, **why you chose it** for this specific project, and **how it complements or enhances** a specific aspect of the ECO-STAR framework. 639 4. **Extreme Detail and Length:** Each section of the output must be thoroughly explained. Do not be brief. Elaborate on concepts, provide examples, and build a rigorous academic argument for the methodology's design. The total word count must be substantial (1500-2000 words). 640 5. **Structure and Formatting:** You must follow this strict markdown format. Use double newlines (i.e., a blank line) to separate paragraphs. Failure to do so will result in unreadable output. 641 642 ## A Synthesized Methodology: [Invent a formal and descriptive name here] 643 644 ### 1. Abstract & Core Philosophy 645 A dense, academic paragraph summarizing the entire methodology. It should state the core theoretical underpinnings and the primary purpose of this locally/community-developed approach in relation to the user's project. Explain the fundamental 'why' behind this unique fusion. 646 647 ### 2. Epistemological and Ontological Stance 648 A detailed section explaining the theory of knowledge (epistemology) and theory of being (ontology) that this methodology adopts. For example, does it adopt a constructivist, critical theory, or pragmatist stance? Justify this choice in relation to the project's goals. Connect this stance to the **Environment** and **Customer** pillars of ECO-STAR. 649 650 ### 3. A Phased Integrated Framework 651 Describe the methodology as a series of distinct phases. For each phase, provide a detailed narrative. 652 653 #### Phase 1: Contextual Immersion & Relational Grounding (Corresponds to E, C, O) 654 - Detail the activities in this phase. For example, 'Deep ethnographic observation', 'Community asset mapping', 'Restorative circles with stakeholders'. 655 - Introduce relevant methodologies (e.g., 'Ethnography', 'Participatory Action Research') and explain in detail why they are chosen and how they serve to define the **Environment**, understand the **Customer**, and identify the **Opportunity**. 656 657 #### Phase 2: Co-Design & Ideation Synthesis (Corresponds to S, T) 658 - Describe the process of developing the solution or intervention. 659 - Introduce relevant approaches (e.g., 'Human-Centered Design', 'Speculative Design', 'Systems Thinking') and explain in detail how they facilitate the creation of the **Solution** and the formation of a collaborative **Team**. 660 661 #### Phase 3: Prototyping, Implementation & Iterative Learning (Corresponds to A, R) 662 - Detail the action-oriented part of the research. 663 - Introduce relevant methods (e.g., 'Action Research Cycles', 'Developmental Evaluation') and explain in detail how they help to test the project's unique **Advantage** and measure meaningful **Results**. 664 665 ### 4. Ethical Considerations & Positionality
666 A crucial section discussing the ethical implications of this research. Address the researcher's positionality, data sovereignty, community ownership of outcomes, and how the methodology ensures a 'do no harm' and reciprocity-based approach. This strongly relates to the **Team** and **Customer** elements. 667 668 ### 5. Conclusion: Rationale for the Synthesized Framework 669 A final, powerful summary of why this specific, integrated methodology is superior to any single, off-the-shelf framework for the user's project. Reiterate the unique strengths of the design. 670 `;else{const se=d.map(ge=>`- ${ge.name} (${ge.type}): ${ge.description}`).join(` 671`),fe=Yt.map(ge=>`- ${ge.letter} (${ge.title}): ${ge.question}`).join(` 672`);Q=` 673 Act as an expert research designer and academic consultant specializing in the synthesis of interdisciplinary research frameworks. Your tone must be professional, direct, and scholarly. 674 675 Your task is to create a new, synthesized methodological approach tailored to a user's specific project, placing special emphasis on the user's selected focus areas. 676 677 **1. User's Project Description:** 678 "${n}" 679 680 **2. Primary Focus Areas:** 681 "${s.length>0?s.join(", "):"None specified"}" 682 683 **3. Core Framework: ECO-STAR** 684 This is the foundational structure. 685 ${fe} 686 687 **4. User-Selected Concepts to Integrate:** 688 These are the academic and creative concepts to be fused with the ECO-STAR framework in the context of the user's project. 689 ${se} 690 691 **Your Task:** 692 Generate a detailed description of a new, integrated methodology. Your response must be structured in markdown format as follows: 693 694 ## Integrated Methodology: [Invent a formal and descriptive name for the new methodology] 695 696 ### 1. Core Philosophy & Purpose 697 - A paragraph explaining the central idea of this integrated approach and why it's well-suited for the user's project. 698 699 ### 2. Guiding Principles 700 - A bulleted list of 4-6 core principles that combine the values of ECO-STAR and the selected items. 701 702 ### 3. Key Phases & Activities 703 - A description of a phased approach (e.g., Phase 1: Foundational Inquiry, Phase 2: Collaborative Design & Prototyping, etc.). 704 - For each phase, provide a bulleted list of recommended activities, explicitly drawing from the selected items and linking them to ECO-STAR components. For example: "Utilize *Photovoice* (from Arts-Based Research) to explore the **Customer's** lived experience." or "Conduct a *Systems Mapping* exercise to understand the **Opportunity** landscape." Crucially, you must explicitly integrate any user-selected **Disciplines** as practical methods for inquiry, creation, or communication within these activities (e.g., "Use *Storytelling* to document the Customer's journey," or "Apply *Filmmaking* techniques to disseminate the project's Results.") 705 706 ### 4. Rationale for this Integrated Approach 707 - A concluding paragraph summarizing the unique strengths of this synthesized methodology for the user's specific project. 708 709 Ensure the language is clear and academic. Use bold formatting to highlight key terms and methodology names. 710 `}try{const ge=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-3-pro-preview",contents:Q})).text;f(ge),A("saving");const z=ge.match(/^## .*?: (.*)/m),te=z?z[1]:"Untitled Methodology",{error:ae}=await oe.from("saved_methodologies").insert({project_description:n,selected_items:ne?null:d.map(ve=>({id:ve.id,name:ve.name,type:ve.type})),generated_methodology:ge,title:te,is_custom:ne});ae?(console.error("Error saving methodology:",ae),A("error")):A("saved")}catch(se){_("An error occurred while generating the methodology. Please try again."),console.error(se)}finally{b(!1)}},$=()=>{if(!U.current)return;const Q=U.current.cloneNode(!0);Q.querySelectorAll("h2, h3, h4").forEach(ge=>{const z=ge;z.style.paddingLeft="0",z.style.marginLeft="0"});const ne=new Blob([Q.innerHTML],{type:"text/html"}),se=new Blob([U.current.innerText],{type:"text/plain"}),fe=new ClipboardItem({"text/html":ne,"text/plain":se});navigator.clipboard.write([fe]).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)}
710).catch(ge=>{var z;console.error("Failed to copy rich text:",ge),navigator.clipboard.writeText(((z=U.current)==null?void 0:z.innerText)||"").then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})})},H={Methodology:"Methodologies",Epistemology:"Epistemologies",Pedagogy:"Pedagogies",Approach:"Approaches",Discipline:"Disciplines"},Z=a.reduce((Q,ne)=>{const se=ne.type||"Methodology",fe=H[se]||se+"s";return Q[fe]||(Q[fe]=[]),Q[fe].push(ne),Q},{}),X=["Epistemologies","Methodologies","Disciplines","Pedagogies","Approaches"],q=Object.keys(Z).sort((Q,ne)=>X.indexOf(Q)-X.indexOf(ne));return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-violet-500 to-purple-600",children:"Methodology Generator"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed",children:"Design a custom research methodology for your project. Apply the ECO-STAR framework and fuse it with established academic approaches, or let our AI build a unique framework based on your idea."})]}),l.jsxs("div",{className:"mt-12 bg-white border border-slate-200 rounded-2xl p-8 space-y-8 shadow-sm",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"projectDescription",className:"block text-lg font-bold text-slate-800 mb-2",children:"1. Describe Your Project or Research Idea"}),l.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"This is the only required field. Provide a detailed description for the best results."}),l.jsx("textarea",{id:"projectDescription",rows:4,value:n,onChange:Q=>e(Q.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:outline-none transition focus:ring-violet-500 text-slate-900",placeholder:"e.g., I want to create a digital platform for youth in my community to document and share traditional stories from our elders."})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"block text-lg font-bold text-slate-800 mb-2",children:"2. Select Focus Areas (Optional)"}),l.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"Select up to two areas to help tailor the methodology's language and emphasis."}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:["Arts and Creative Entrepreneurship","Climate Entrepreneurship","Community-Based Research","Community capacity building","Interest Compatibility"].map(Q=>l.jsx("button",{onClick:()=>F(Q),className:`text-left p-3 rounded-lg border-2 transition h-full ${s.includes(Q)?"border-violet-500 bg-violet-50 text-violet-900":"border-slate-200 hover:bg-slate-50 text-slate-600"}`,children:l.jsx("span",{className:"font-semibold",children:Q})},Q))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"block text-lg font-bold text-slate-800 mb-2",children:"3. Fuse with Specific Items (Optional)"}),l.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"If you leave this blank, the AI will automatically select and fuse the most relevant concepts for you into a detailed academic document."}),l.jsx("div",{className:"space-y-6",children:q.map(Q=>l.jsxs("div",{children:[l.jsx("h4",{className:"text-md font-semibold text-slate-700 mb-3 border-b border-slate-200 pb-2",children:Q}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3",children:Z[Q].map(ne=>l.jsx("button",{onClick:()=>G(ne),className:`text-left p-3 rounded-lg border-2 transition h-full ${d.some(se=>se.id===ne.id)?"border-violet-500 bg-violet-50 text-violet-900":"border-slate-200 hover:bg-slate-50 text-slate-600"}`,children:l.jsx("span",{className:"font-semibold",children:ne.name})},ne.id))})]},Q))})]}),l.jsx("div",{className:"text-center pt-4",children:l.jsx("button",{onClick:P,disabled:v,className:"px-8 py-3 rounded-md bg-violet-600 text-white font-bold hover:bg-violet-700 transition disabled:opacity-50 disabled:cursor-wait text-lg shadow-md",children:v?"Generating...":"Generate Methodology"})})]}),(y||w||v)&&l.jsxs("div",{className:"mt-12",children:[l.jsxs("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-4 mb-4",children:[l.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Your Custom Methodology"}),l.jsxs("div",{className:"flex items-center gap-4",children:[C!=="idle"&&!v&&l.jsx("span",{className:`text-sm px-3 py-1 rounded-full ${C==="saved"?"bg-emerald-100 text-emerald-700":C==="error"?"bg-rose-100 text-rose-700":"bg-sky-100 text-sky-700"}`,children:C==="saved"?"Saved":C==="error"?"Save Failed":"Saving..."}),y&&!v&&l.jsx("button",{onClick:$,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-700 transition w-24 shadow-sm",children:E?"Copied!":"Copy"})]})]}),l.jsxs("div",{className:"mt-6 bg-white p-6 md:p-8 rounded-xl border border-slate-200 shadow-lg min-h-[20rem]",children:[v&&l.jsx("div",{className:"text-center text-slate-500",children:"Synthesizing your custom approach... This may take a minute or two for detailed documents."}),w&&l.jsx("div",{className:"text-center text-rose-500",children:w}),y&&l.jsx("div",{ref:U,children:l.jsx(Q1,{content:y})})]})]}
710),l.jsxs(dn,{title:"Applying ECO-STAR: Building a Custom Methodology for Your Project",gradient:"from-violet-500 to-purple-600",children:[l.jsx("p",{children:"This tool is not for changing the ECO-STAR framework itself. Instead, it is a powerful synthesizer that helps you apply ECO-STAR to your specific project, enriching it with established academic theories and methods to create a robust, custom-tailored research plan."}),l.jsxs("p",{children:["In advanced research and innovation, a single, off-the-shelf methodology is often insufficient to address the complexities of a specific problem. The most effective practitioners are those who can thoughtfully select and combine elements from various frameworks to construct a new approach that is perfectly tailored to the context of their work. This process is known as ",l.jsx("strong",{children:"methodological synthesis"}),"."]}),l.jsx("p",{children:"This Methodology Generator is a tool for practicing this advanced research design. It encourages a move beyond rigid, pre-defined frameworks toward a more flexible and rigorous process. By applying the holistic, value-driven structure of ECO-STAR to your project and fusing it with the specific techniques of other established methodologies, you can design an approach that is both comprehensive and uniquely suited to your objectives."}),l.jsxs("ul",{children:[l.jsxs("li",{children:["Integrating with ",l.jsx("strong",{children:"Participatory Action Research"})," can embed the principle of community co-creation deeper into your process."]}),l.jsxs("li",{children:["Integrating with ",l.jsx("strong",{children:"Arts-Based Research"}),` can provide new, creative ways to understand your "Customer's" lived experience.`]}),l.jsxs("li",{children:["Integrating with ",l.jsx("strong",{children:"Grounded Theory"}),' can offer a rigorous way to analyze the "Opportunity" landscape and develop novel insights.']})]}),l.jsx("p",{children:"This is not about simply mixing and matching terms. It's a deliberate process of weaving together different ways of knowing to create a stronger, more resilient, and more insightful approach. It empowers you to build not just a project plan, but a sophisticated and defensible framework for discovery."})]})]})})},X1=()=>{const[n,e]=R.useState(""),[s,o]=R.useState(""),a=async c=>{c.preventDefault(),e("sending"),o("");const d=new FormData(c.currentTarget),m=d.get("name"),y=d.get("email"),f=d.get("message"),{error:v}=await oe.from("costar_contacts").insert([{name:m,email:y,message:f}]);v?(o("Sorry, there was an error sending your message. Please try again."),e(""),console.error("Contact form submission error:",v)):e("sent")};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsx("div",{className:"max-w-7xl mx-auto",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 lg:gap-24 items-start",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-fuchsia-500 to-indigo-600 mb-6",children:"Get in Touch"}),l.jsx("p",{className:"text-lg md:text-xl text-slate-600 leading-relaxed mb-8",children:"We are building a community of practice around sovereign innovation in the North. Whether you are an artist, a funder, a community leader, or a researcher, we want to hear from you."}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-fuchsia-100 flex items-center justify-center text-fuchsia-600 flex-shrink-0 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-bold text-slate-900 text-lg",children:"General Inquiries"}),l.jsx("p",{className:"text-slate-600",children:"Have questions about the methodology or want to discu
710ss how it can help your organization?"})]})]}),l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 flex-shrink-0 mt-1",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-bold text-slate-900 text-lg",children:"Partnerships"}),l.jsx("p",{className:"text-slate-600",children:"Interested in collaborating on a pilot project or supporting our research?"})]})]})]})]}),l.jsx("div",{className:"bg-white p-8 md:p-10 rounded-3xl shadow-xl border border-slate-100",children:n==="sent"?l.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 text-emerald-800 p-8 rounded-lg text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-4 text-emerald-600",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),l.jsx("h3",{className:"text-2xl font-bold mb-2",children:"Message Sent!"}),l.jsx("p",{children:"Thank you for reaching out. We'll get back to you shortly."})]}):l.jsxs("form",{onSubmit:a,className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"name",className:"block text-sm font-bold text-slate-700 mb-2",children:"Name"}),l.jsx("input",{type:"text",name:"name",id:"name",required:!0,className:"w-full bg-slate-50 border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-fuchsia-500 focus:outline-none transition text-slate-900",placeholder:"Your Name"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"block text-sm font-bold text-slate-700 mb-2",children:"Email"}),l.jsx("input",{type:"email",name:"email",id:"email",required:!0,className:"w-full bg-slate-50 border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-fuchsia-500 focus:outline-none transition text-slate-900",placeholder:"[email protected]"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"message",className:"block text-sm font-bold text-slate-700 mb-2",children:"Message"}),l.jsx("textarea",{name:"message",id:"message",rows:6,required:!0,className:"w-full bg-slate-50 border border-slate-300 rounded-lg p-4 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-fuchsia-500 focus:outline-none transition text-slate-900",placeholder:"How can we help?"})]}),s&&l.jsx("p",{className:"text-sm text-rose-500 text-center",children:s}),l.jsx("div",{children:l.jsx("button",{type:"submit",disabled:n==="sending",className:"w-full px-6 py-4 rounded-xl bg-fuchsia-600 text-white font-bold text-lg hover:bg-fuchsia-700 transition disabled:opacity-70 disabled:cursor-not-allowed shadow-lg hover:shadow-fuchsia-200 transform hover:-translate-y-1",children:n==="sending"?"Sending...":"Send Message"})})]})})]})})})},G0=()=>{const[n,e]=R.useState(""),[s,o]=R.useState(""),[a,c]=R.useState(""),[d,m]=R.useState(!1),y=async f=>{f.preventDefault(),c(""),m(!0);const{error:v}=await oe.auth.signInWithPassword({email:n,password:s});v&&c(v.message),m(!1)};return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-md mx-auto",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-slate-600 to-slate-800",children:"Admin Access"}),l.jsx("p",{className:"mt-4 text-lg text-slate-600",children:"Login to manage site content."})]}),l.jsx("div",{className:"bg-white border border-slate-200 rounded-2xl p-8 mt-10 shadow-sm",children:l.jsxs("form",{onSubmit:y,className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-slate-700 mb-2",children:"Email Address"}),l.jsx("input",{type:"email",name:"email",id:"email",value:n,onChange:f=>e(f.target.value),required:!0,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-indigo-500 focus:outline-none transition text-slate-900",placeholder:"[email protected]"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-slate-700 mb-2",children:"Password"}),l.jsx("input",{type:"password",name:"password",id:"password",value:s,onChange:f=>o(f.target.value),required:!0,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-indigo-500 focus:outline-none transition text-slate-900",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),a&&l.jsx("p",{className:"text-sm text-rose-500 text-center",children:a}),l.jsx("div",{children:l.jsx("button",{type:"submit",disabled:d,className:"w-full px-6 py-3 rounded-md bg-indigo-600 text-white font-bold text-lg hover:bg-indigo-700 transition disabled:opacity-70 disabled:cursor-not-allowed flex items-center justify-center shadow-md",children:d?l.jsxs(l.Fragment,{children:[l.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Signing In..."]}):"Sign In"})})]})})]})})},Pu=({title:n,value:e,icon:s})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-xl p-6 flex items-center gap-4",children:[l.jsx("div",{className:"bg-slate-700 p-3 rounded-full",children:s}),l.jsxs("div",{children:[l.jsx("div",{className:"text-3xl font-bold text-white",children:e}),l.jsx("div",{className:"text-sm text-slate-400",children:n})]})]}),q0=({stories:n,contacts:e,surveyResponses:s,setView:o})=>{const a={stories:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-emerald-300",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M9 4.804A7.968 7.968
7100 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z"})}),contacts:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-sky-300",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),l.jsx("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h1a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})]}),surveys:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-violet-300",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"}),l.jsx("path",{fillRule:"evenodd",d:"M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z",clipRule:"evenodd"})]})};return l.jsxs("div",{className:"space-y-10",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-emerald-300 to-sky-400",children:"Admin Dashboard"}),l.jsx("p",{className:"mt-2 text-lg text-slate-400",children:"Welcome! Here's a quick overview of your site."})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx(Pu,{title:"Total Stories",value:n.length,icon:a.stories}),l.jsx(Pu,{title:"Contact Submissions",value:e.length,icon:a.contacts}),l.jsx(Pu,{title:"Survey Responses",value:s.length,icon:a.surveys})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-6",children:[l.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Recent Contacts"}),l.jsxs("div",{className:"space-y-3",children:[e.length>0?e.map(c=>l.jsxs("div",{className:"bg-slate-800 p-3 rounded-md",children:[l.jsx("p",{className:"font-semibold text-slate-200",children:c.name}),l.jsx("p",{className:"text-sm text-slate-400 truncate",children:c.message})]},c.id)):l.jsx("p",{className:"text-slate-500",children:"No contact submissions yet."}),l.jsx("button",{onClick:()=>o("contacts"),className:"text-sm font-semibold text-sky-400 hover:text-sky-300 transition",children:"View all contacts â"})]})]}),l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-6",children:[l.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Recent Stories"}),l.jsxs("div",{className:"space-y-3",children:[n.length>0?n.map(c=>l.jsxs("div",{className:"bg-slate-800 p-3 rounded-md",children:[l.jsx("p",{className:"font-semibold text-slate-200",children:c.title}),l.jsx("p",{className:"text-sm text-slate-400",children:new Date(c.published_at).toLocaleDateString()})]},c.id)):l.jsx("p",{className:"text-slate-500",children:"No stories added yet."}),l.jsx("button",{onClick:()=>o("stories"),className:"text-sm font-semibold text-emerald-400 hover:text-emerald-300 transition",children:"View all stories â"})]})]})]})]})},Z1=({story:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Create New Story":"Editing Story"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Title"}),l.jsx("input",{name:"title",value:o.title,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"URL"}),l.jsx("input",{type:"url",name:"url",value:o.url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md",placeholder:"https://example.com/story"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Published Date"}),l.jsx("input",{type:"date",name:"published_at",value:o.published_at.split("T")[0],onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Excerpt (optional)"}),l.jsx("textarea",{name:"excerpt",value:o.excerpt||"",onChange:c,rows:3,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Story"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},e2=({article:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n),c=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(c.current&&!d.current){const f=new Quill(c.current,{theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],["link","image"],["clean"]]}});
710d.current=f,n.content&&f.clipboard.dangerouslyPasteHTML(n.content),f.on("text-change",()=>{a(v=>({...v,content:f.root.innerHTML}))})}},[n.content]),R.useEffect(()=>{a(n)},[n]);const m=f=>{a({...o,[f.target.name]:f.target.value})},y=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Create New Manifesto Article":"Editing Manifesto Article"}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Title"}),l.jsx("input",{name:"title",value:o.title,onChange:m,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Subtitle"}),l.jsx("input",{name:"subtitle",value:o.subtitle||"",onChange:m,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Slug (URL identifier)"}),l.jsx("input",{name:"slug",value:o.slug,onChange:m,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md",placeholder:"e.g., we-begin-with-the-land"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Color Theme"}),l.jsx("input",{name:"color",value:o.color,onChange:m,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Sort Order"}),l.jsx("input",{type:"number",name:"sort_order",value:o.sort_order,onChange:m,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Excerpt (for landing page)"}),l.jsx("textarea",{name:"excerpt",value:o.excerpt,onChange:m,rows:3,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Content"}),l.jsx("div",{ref:c})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:y,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Article"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},t2=({item:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Create New Research Item":"Editing Research Item"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Year"}),l.jsx("input",{type:"number",name:"year",value:o.year,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Title of Research"}),l.jsx("input",{name:"title",value:o.title,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Researcher/Org/Institution"}),l.jsx("input",{name:"researcher",value:o.researcher,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"URL of Research"}),l.jsx("input",{name:"url",value:o.url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Research Item"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},n2=({member:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Add New Team Member":"Editing Team Member"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Name"}),l.jsx("input",{name:"name",value:o.name,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Affiliation/Institution"}),l.jsx("input",{name:"affiliation",value:o.affiliation,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Role (optional)"}),l.jsx("input",{name:"role",value:o.role,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Bio"}),l.jsx("textarea",{name:"bio",value:o.bio,onChange:c,rows:5,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"URL / E-Mail"}),l.jsx("input",{name:"url",value:o.url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Image URL (optional)"}),l.jsx("input",{name:"image_url",value:o.image_url||"",onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Sort Order"}),l.jsx("input",{type:"number",name:"sort_order",value:o.sort_order,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Team Member"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},s2=({image:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Add New Backgroun
710d Image":"Editing Background Image"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Image URL"}),l.jsx("input",{name:"image_url",value:o.image_url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md",placeholder:"https://example.com/image.jpg"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Photo Credit (optional)"}),l.jsx("input",{name:"photo_credit",value:o.photo_credit||"",onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md",placeholder:"e.g., Jane Doe"})]})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Image"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},i2=({logo:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Add New Logo":"Editing Logo"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Funder Name (for alt text)"}),l.jsx("input",{name:"funder_name",value:o.funder_name,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Image URL"}),l.jsx("input",{name:"image_url",value:o.image_url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Funder URL (hyperlink)"}),l.jsx("input",{name:"funder_url",value:o.funder_url,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Sort Order"}),l.jsx("input",{type:"number",name:"sort_order",value:o.sort_order,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save Logo"}),l.jsx("button",{onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},o2=({question:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=y=>{const{name:f,value:v,type:b}=y.target,w=b==="checkbox",_=y.target.checked;a({...o,[f]:w?_:v})},d=y=>{a({...o,options:y.target.value.split(` 711`).filter(f=>f.trim()!=="")})},m=y=>{y.preventDefault(),e(o)};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:s,children:l.jsx("div",{className:"bg-slate-800 border border-slate-700 rounded-lg max-w-2xl w-full shadow-xl",onClick:y=>y.stopPropagation(),children:l.jsxs("form",{onSubmit:m,className:"space-y-6 p-8",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:o.id==="new"?"Create New Survey Question":"Edit Survey Question"}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"question_text",className:"block text-sm font-medium text-slate-300 mb-1",children:"Question Text"}),l.jsx("textarea",{id:"question_text",name:"question_text",value:o.question_text,onChange:c,rows:3,required:!0,className:"w-full bg-slate-900 p-2 border border-slate-600 rounded-md focus:ring-2 focus:ring-sky-500 focus:outline-none"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"question_description",className:"block text-sm font-medium text-slate-300 mb-1",children:"Question Description (Optional)"}),l.jsx("textarea",{id:"question_description",name:"question_description",value:o.question_description||"",onChange:c,rows:2,className:"w-full bg-slate-900 p-2 border border-slate-600 rounded-md focus:ring-2 focus:ring-sky-500 focus:outline-none"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"question_type",className:"block text-sm font-medium text-slate-300 mb-1",children:"Question Type"}),l.jsxs("select",{id:"question_type",name:"question_type",value:o.question_type,onCh
711ange:c,className:"w-full bg-slate-900 p-2 border border-slate-600 rounded-md focus:ring-2 focus:ring-sky-500 focus:outline-none",children:[l.jsx("option",{value:"multiple-choice",children:"Multiple Choice"}),l.jsx("option",{value:"checkbox",children:"Checkbox (select many)"}),l.jsx("option",{value:"textarea",children:"Text Area"}),l.jsx("option",{value:"contact",children:"Contact Information Section"})]})]}),l.jsxs("div",{className:"flex items-end pb-1 gap-6",children:[l.jsxs("label",{className:"flex items-center gap-2 text-slate-300 cursor-pointer",children:[l.jsx("input",{type:"checkbox",name:"has_other",checked:o.has_other,onChange:c,className:"h-5 w-5 rounded bg-slate-700 border-slate-600 text-sky-500 focus:ring-sky-500"}),l.jsx("span",{children:'Include "Other" option'})]}),l.jsxs("label",{className:"flex items-center gap-2 text-slate-300 cursor-pointer",children:[l.jsx("input",{type:"checkbox",name:"is_contact_section",checked:o.is_contact_section,onChange:c,className:"h-5 w-5 rounded bg-slate-700 border-slate-600 text-sky-500 focus:ring-sky-500"}),l.jsx("span",{children:"Is Contact Section"})]})]})]}),(o.question_type==="multiple-choice"||o.question_type==="checkbox"||o.is_contact_section)&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"options",className:"block text-sm font-medium text-slate-300 mb-1",children:"Options (one per line)"}),l.jsx("textarea",{id:"options",name:"options",value:(o.options||[]).join(` 712`),onChange:d,rows:5,className:"w-full bg-slate-900 p-2 border border-slate-600 rounded-md font-mono text-sm focus:ring-2 focus:ring-sky-500 focus:outline-none"})]}),l.jsxs("div",{className:"mt-6 flex gap-4 pt-4 border-t border-slate-700",children:[l.jsx("button",{type:"submit",className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition",children:"Save Question"}),l.jsx("button",{type:"button",onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})})})},a2=({gpt:n,onSave:e,onCancel:s})=>{const[o,a]=R.useState(n);R.useEffect(()=>{a(n)},[n]);const c=m=>{a({...o,[m.target.name]:m.target.value})},d=()=>{e(o)};return l.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:o.id==="new"?"Add New GPT":"Editing GPT"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Title"}),l.jsx("input",{name:"title",value:o.title,onChange:c,required:!0,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Description (optional)"}),l.jsx("textarea",{name:"description",value:o.description||"",onChange:c,rows:4,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"URL"}),l.jsx("input",{type:"url",name:"url",value:o.url,onChange:c,required:!0,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Sort Order"}),l.jsx("input",{type:"number",name:"sort_order",value:o.sort_order,onChange:c,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4",children:[l.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition mr-2",children:"Save GPT"}),l.jsx("button",{type:"button",onClick:s,className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]})},B0=({value:n,onChange:e})=>{const s=R.useRef(null),o=R.useRef(null),a=R.useRef(!1);return R.useEffect(()=>{s.current&&!o.current&&(o.current=new Quill(s.current,{theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],["link","image"],["clean"]]}}),o.current.on("text-change",()=>{a.current&&e(o.current.root.innerHTML)}))},[]),R.useEffect(()=>{if(o.current){n!==o.current.root.innerHTML&&o.current.clipboard.dangerouslyPasteHTML(n||"");const c=setTimeout(()=>{a.current=!0},100);return()=>clearTimeout(c)}},[n]),l.jsx("div",{ref:s})}
712,ln=({label:n,value:e,onChange:s})=>l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:n}),l.jsx("input",{type:"text",value:e,onChange:s,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),Es=({label:n,value:e,onChange:s,rows:o=4})=>l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:n}),l.jsx("textarea",{value:e,onChange:s,rows:o,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md font-mono text-sm"})]}),Nn=({title:n,children:e})=>l.jsxs("fieldset",{className:"bg-slate-800/50 border border-slate-700/50 rounded-lg p-6 space-y-4",children:[l.jsx("legend",{className:"px-2 text-lg font-bold text-white",children:n}),e]}),r2=({allPages:n,onSave:e})=>{const[s,o]=R.useState(""),[a,c]=R.useState(null),[d,m]=R.useState(!1);R.useEffect(()=>{if(s){const P=n.find($=>$.id===s);P&&c(structuredClone(P))}else c(null)},[s,n]),R.useLayoutEffect(()=>{if(s){const P=document.querySelector("main[key]");P&&(P.scrollTop=0)}},[s]);const y=async()=>{a&&(m(!0),await e(a),m(!1))},f=P=>{o(P.target.value)},v=(P,$,H)=>{c(Z=>({...Z,content:{...Z.content,[P]:{...Z.content[P],[$]:H}}}))},b=(P,$,H)=>{if(!a)return;const Z=[...a.content.sections],X={...Z[P]};X[$]=H,Z[P]=X,c({...a,content:{...a.content,sections:Z}})},w=()=>{if(!a)return;const P={heading:"New Section",body_html:"<p>New section content.</p>",list:[]};c({...a,content:{...a.content,sections:[...a.content.sections,P]}})},_=P=>{if(!a||!window.confirm("Are you sure you want to remove this section?"))return;const $=a.content.sections.filter((H,Z)=>Z!==P);c({...a,content:{...a.content,sections:$}})},C=(P,$)=>{if(!a)return;const H=$==="up"?P-1:P+1;if(H<0||H>=a.content.sections.length)return;const Z=[...a.content.sections],[X]=Z.splice(P,1);Z.splice(H,0,X),c({...a,content:{...a.content,sections:Z}})},A=()=>{var P,$,H,Z,X,q,Q,ne,se,fe,ge,z,te,ae,ve,Te,k,M,J,ee,ce,ue,_e,Qe,Be,At,Pt,hn,Rt,Xe,tt,Jt,St,js,Wn,Xn,Zn,si,ii,ct;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(Nn,{title:"Hero Section",children:[l.jsx(Es,{label:"Subtitle 1",value:(($=(P=a.content)==null?void 0:P.hero)==null?void 0:$.subtitle1)||"",onChange:be=>v("hero","subtitle1",be.target.value),rows:2}),l.jsx(ln,{label:"Subtitle 2",value:((Z=(H=a.content)==null?void 0:H.hero)==null?void 0:Z.subtitle2)||"",onChange:be=>v("hero","subtitle2",be.target.value)}),l.jsx(ln,{label:"Button Text",value:((q=(X=a.content)==null?void 0:X.hero)==null?void 0:q.buttonText)||"",onChange:be=>v("hero","buttonText",be.target.value)})]}),l.jsxs(Nn,{title:"What is ECO-STAR? Section",children:[l.jsx(ln,{label:"Title",value:((ne=(Q=a.content)==null?void 0:Q.whatIs)==null?void 0:ne.title)||"",onChange:be=>v("whatIs","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown)",value:((fe=(se=a.content)==null?void 0:se.whatIs)==null?void 0:fe.description)||"",onChange:be=>v("whatIs","description",be.target.value)}),l.jsx(ln,{label:"Subtitle",value:((z=(ge=a.content)==null?void 0:ge.whatIs)==null?void 0:z.subTitle)||"",onChange:be=>v("whatIs","subTitle",be.target.value)}),l.jsx(Es,{label:"Sub-description (Markdown)",value:((ae=(te=a.content)==null?void 0:te.whatIs)==null?void 0:ae.subDescription)||"",onChange:be=>v("whatIs","subDescription",be.target.value)})]}),l.jsxs(Nn,{title:"Origin Section",children:[l.jsx(ln,{label:"Title",value:((Te=(ve=a.content)==null?void 0:ve.origin)==null?void 0:Te.title)||"",onChange:be=>v("origin","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown)",value:((M=(k=a.content)==null?void 0:k.origin)==null?void 0:M.description)||"",onChange:be=>v("origin","description",be.target.value),rows:6})]}),l.jsxs(Nn,{title:"Toolkit CTA Section",children:[l.jsx(ln,{label:"Title",value:((ee=(J=a.content)==null?void 0:J.toolkitCta)==null?void 0:ee.title)||"",onChange:be=>v("toolkitCta","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown)",value:((ue=(ce=a.content)==null?void 0:ce.toolkitCta)==null?void 0:ue.description)||"",onChange:be=>v("toolkitCta","description",be.target.value),rows:2}),l.jsx(ln,{label:"Button Text",value:((Qe=(_e=a.content)==null?void 0:_e.toolkitCta)==null?void 0:Qe.buttonText)||"",onChange:be=>v("toolkitCta","buttonText",be.target.value)})]}),l.jsxs(Nn,{title:"Vision (Video) Section",children:[l.jsx(ln,{label:"Title",value:((At=(Be=a.content)==null?void 0:Be.vision)==null?void 0:At.title)||"",onChange:be=>v("vision","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown)",value:((hn=(Pt=a.content)==null?void 0:Pt.vision)==null?void 0:hn.description)||"",onChange:be=>v("vision","description",be.target.value),rows:2}),l.jsx(ln,{label:"Video URL",value:((Xe=(Rt=a.content)==null?void 0:Rt.vision)==null?void 0:Xe.videoUrl)||"",onChange:be=>v("vision","videoUrl",be.target.value)})]}),l.jsxs(Nn,{title:"Partners CTA Section",children:[l.jsx(ln,{label:"Title",value:((Jt=(tt=a.content)==null?void 0:tt.partnersCta)==null?void 0:Jt.title)||"",onChange:be=>v("partnersCta","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown)",value:((js=(St=a.content)==null?void 0:St.partnersCta)==null?void 0:js.description)||"",onChange:be=>v("partnersCta","description",be.target.value),rows:3}),l.jsx(ln,{label:"Button Text",value:((Xn=(Wn=a.content)==null?void 0:Wn.partnersCta)==null?void 0:Xn.buttonText)||"",onChange:be=>v("partnersCta","buttonText",be.target.value)})]}),l.jsxs(Nn,{title:"Acknowledgements Section",children:[l.jsx(ln,{label:"Title",value:((si=(Zn=a.content)==null?void 0:Zn.acknowledgements)==null?void 0:si.title)||"",onChange:be=>v("acknowledgements","title",be.target.value)}),l.jsx(Es,{label:"Description (Markdown with links)",value:((ct=(ii=a.content)==null?void 0:ii.acknowledgements)==null?void 0:ct.description)||"",onChange:be=>v("acknowledgements","description",be.target.value),rows:8})]})]})},E=()=>l.jsxs("div",{className:"space-y-8",children:[l.jsxs(Nn,{title:"Page Details",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Page Title"}),l.jsx("input",{type:"text",value:a.content.title||"",onChange:P=>c({...a,content:{...a.content,title:P.target.value}}),className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Page Subtitle"}),l.jsx("textarea",{value:a.content.subtitle||"",onChange:P=>c({...a,content:{...a.content,subtitle:P.target.value}}),rows:2,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]})]}),a.content.sections.map((P,$)=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-lg p-6 space-y-4 relative",children:[l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("h3",{className:"text-xl font-bold text-white mb-2",children:["Section ",$+1]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>C($,"up"),disabled:$===0,className:"px-2 py-1 text-xs rounded bg-slate-600 hover:bg-slate-500 disabled:opacity-50",children:"â"}),l.jsx("button",{onClick:()=>C($,"down"),disabled:$===a.content.sections.length-1,className:"px-2 py-1 text-xs rounded bg-slate-600 hover:bg-slate-500 disabled:opacity-50",children:"â"}),l.jsx("button",{onClick:()=>_($),className:"px-3 py-1 text-xs rounded bg-rose-600 hover:bg-rose-500",children:"Remove"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Heading"}),l.jsx("input",{type:"text",value:P.heading||"",onChange:H=>b($,"heading",H.target.value),className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Body"}),l.jsx(B0,{value:P.body_html||P.body||"",onChange:H=>b($,"body_html",H)})]})]},$)),l.jsx("button",{onClick:w,className:"px-5 py-2 rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-500 transition",children:"Add Section"})]}),I=()=>l.jsxs("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-4 mb-6",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Page Content"}),l.jsx("div",{className:"w-full md:w-72",children:l.jsxs("select",{value:s,onChange:f,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md focus:ring-2 focus:ring-sky-500 focus:outline-none","aria-label":"Select a page to edit",autoFocus:!0,children:[l.jsx("option",{value:"",disabled:!0,children:"Choose a page..."}),n.map(P=>l.jsx("option",{value:P.id,children:P.title},P.id))]})})]});if(!a)return l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-6 md:p-8",children:[I(),l.jsx("div",{className:"text-center py-16 border-2 border-dashed border-slate-600 rounded-lg",children:l.jsx("p",{className:"text-slate-400",children:"Please select a page from the dropdown to begin editing."})})]});const U=a.slug==="about",G=a.slug==="home",F=!U&&!G&&a.content&&typeof a.content=="object"&&("content_markdown"in a.content||"content_html"in a.content);return l.jsx("div",{className:"space-y-8",children:l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-6 md:p-8",children:[I(),G&&A(),U&&E(),F&&l.jsxs(Nn,{title:"Page Content",children:[l.jsx("p",{className:"text-slate-400 -mt-2 mb-4",children:"Editing content with Rich Text Editor."}),l.jsx(B0,{value:a.content.content_html||a.content.content_markdown||"",onChange:P=>{c($=>({...$,content:{...$.content,content_html:P}}))}})]}),!G&&!U&&!F&&l.jsxs(Nn,{title:"Raw JSON Content",children:[l.jsx("p",{className:"text-slate-400 mb-4",children:"Editing content as JSON. Be careful with the structure."}),l.jsx("textarea",{className:"w-full h-96 bg-slate-900 border border-slate-600 rounded-md p-4 font-mono text-sm",value:JSON.stringify(a.content,null,2),onChange:P=>{try{const $=JSON.parse(P.target.value);c({...a,content:$})}catch($){console.error("Invalid JSON:",$)}}})]}),l.jsx("div",{className:"mt-8 border-t border-slate-700 pt-6",children:l.jsx("button",{onClick:y,disabled:d,className:"px-6 py-3 rounded-md bg-emerald-600 text-white font-bold hover:bg-emerald-500 transition disabled:opacity-70 disabled:cursor-wait",children:d?"Saving...":`Save Changes to "${a.title}"`})})]})})},l2=({stories:n,onCreateStory:e,onEditStory:s,onDeleteStory:o})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Stories"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Create New Story"})]}),l.jsx("p",{className:"text-slate-400 mb-6",children:'Add, edit, or remove curated stories and articles that appear on the "Stories" page.'}),l.jsxs("div",{className:"space-y-3",children:[n.map(a=>l.jsxs("div",{className:"flex justify-between items-center bg-slate-800 p-4 rounded-md",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:a.title}),l.jsx("span",{className:"block text-sm text-slate-400",children:new Date(a.published_at).toLocaleDateString("en-US",{timeZone:"UTC"})})]}),l.jsxs("div",{children:[l.jsx("button",{onClick:()=>s(a),className:"px-4 py-1 rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(a.id),className:"px-4 py-1 rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},a.id)),n.length===0&&l.jsx("p",{className:"text-slate-500",children:"No stories have been added yet."})]})]}),zr=["costar_articles","costar_background_images","costar_contacts","costar_logos","costar_manifesto_articles","costar_methodologies","costar_pages","costar_research","costar_saved_lessons","costar_stories","costar_survey_responses","costar_team","saved_methodologies"],c2=({onRestoreComplete:n})=>
712{const[e,s]=R.useState(!1),[o,a]=R.useState(!1),[c,d]=R.useState(!1),[m,y]=R.useState(!1),[f,v]=R.useState(null),b=R.useRef(null),w=async()=>{s(!0),alert("Starting backup... This may take a moment. Your download will begin when it is ready.");try{const E={},I=[];(await Promise.allSettled(zr.map(Z=>oe.from(Z).select("*")))).forEach((Z,X)=>{const q=zr[X];if(Z.status==="fulfilled"){const{data:Q,error:ne}=Z.value;if(ne){const se=`Could not back up "${q}": ${ne.message}`;console.warn(se),I.push(se),E[q]=[]}else E[q]=Q}else{const Q=`Failed to query table "${q}": ${Z.reason}`;console.error(Q),I.push(Q),E[q]=[]}}),I.length>0&&alert(`Backup completed, but some tables could not be fetched: 713 714- ${I.join(` 715- `)} 716 717The backup file will contain data for all other tables.`);const G=JSON.stringify(E,null,2),F=new Blob([G],{type:"application/json"}),P=URL.createObjectURL(F),$=document.createElement("a");$.href=P;const H=new Date().toISOString().split("T")[0];$.download=`ecostar_backup_${H}.json`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(P)}catch(E){console.error("Backup failed:",E),alert(`Backup failed: ${E instanceof Error?E.message:"Unknown error"}`)}finally{s(!1)}},_=E=>{var G;const I=(G=E.target.files)==null?void 0:G[0];if(!I)return;const U=new FileReader;U.onload=F=>{var P;try{const $=(P=F.target)==null?void 0:P.result;if(typeof $!="string")throw new Error("File content is not readable.");const H=JSON.parse($),Z=Object.keys(H);if(!Z.every(q=>zr.includes(q)&&Array.isArray(H[q]))||Z.length===0)throw new Error("Invalid or empty backup file. It must be a JSON file with keys matching the database table names.");v(H),y(!0)}catch($){alert(`Error reading backup file: ${$ instanceof Error?$.message:"Unknown error"}`),v(null)}},U.readAsText(I),E.target.value=""},C=async()=>{if(f){a(!0),y(!1),alert("Starting restore process. This may take a while. The page will refresh upon completion.");try{for(const E of zr){const{error:I}=await oe.from(E).delete().neq("id","00000000-0000-0000-0000-000000000000");if(I)throw new Error(`Failed to clear table ${E}: ${I.message}`);const U=f[E];if(U&&U.length>0){const{error:G}=await oe.from(E).insert(U);if(G)throw new Error(`Failed to insert data into ${E}: ${G.message}`)}}alert("Restore completed successfully! Refreshing data..."),n()}catch(E){console.error("Restore failed:",E),alert(`Restore failed: ${E instanceof Error?E.message:"Unknown error"}`)}finally{a(!1),v(null)}}},A=async()=>{d(!0),alert("Starting image download... This may take a while depending on the number of images. Your download will begin when the zip file is ready.");try{const[E,I]=await Promise.all([oe.from("costar_background_images").select("image_url"),oe.from("costar_logos").select("image_url")]),U=new Set;E.data&&E.data.forEach(Z=>Z.image_url&&U.add(Z.image_url)),I.data&&I.data.forEach(Z=>Z.image_url&&U.add(Z.image_url));const G=Array.from(U);if(G.length===0){alert("No image URLs found in the database."),d(!1);return}if(typeof JSZip>"u"||typeof saveAs>"u")throw new Error("Required libraries (JSZip, FileSaver) are not loaded. Please check the index.html file.");const F=new JSZip,P=G.map(async Z=>{try{const X=await fetch(Z);if(!X.ok)return console.warn(`Failed to fetch image: ${Z} (status: ${X.status})`),null;const q=await X.blob(),Q=Z.substring(Z.lastIndexOf("/")+1).split("?")[0]||`image_${Math.random()}.jpg`;F.file(Q,q)}catch(X){console.warn(`Error fetching or adding image to zip: ${Z}`,X)}});await Promise.all(P);const $=await F.generateAsync({type:"blob"}),H=new Date().toISOString().split("T")[0];saveAs($,`ecostar_images_backup_${H}.zip`)}catch(E){console.error("Image download failed:",E),alert(`Image download failed: ${E instanceof Error?E.message:"Unknown error"}`)}finally{d(!1)}};return l.jsxs("div",{className:"space-y-12",children:[l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Data & Asset Management"}),l.jsx("p",{className:"text-slate-400 mb-6 max-w-2xl",children:"Create a full backup of all site content or restore the site from a backup file. You can also download all referenced images."}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[l.jsxs("button",{onClick:w,disabled:e||o,className:"flex-1 px-6 py-3 rounded-md bg-emerald-600 text-white font-bold hover:bg-emerald-500 transition disabled:opacity-70 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),e?"Backing Up...":"Backup All Data to JSON"]}),l.jsxs("button",{onClick:()=>{var E;
717return(E=b.current)==null?void 0:E.click()},disabled:o||e,className:"flex-1 px-6 py-3 rounded-md bg-rose-600 text-white font-bold hover:bg-rose-500 transition disabled:opacity-70 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),o?"Restoring...":"Restore from JSON Backup"]}),l.jsx("input",{type:"file",accept:".json",ref:b,onChange:_,className:"hidden"})]}),l.jsx("div",{className:"mt-4 border-t border-slate-700 pt-4",children:l.jsxs("button",{onClick:A,disabled:c||e||o,className:"w-full px-6 py-3 rounded-md bg-sky-600 text-white font-bold hover:bg-sky-500 transition disabled:opacity-70 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),c?"Zipping Images...":"Download All Images as ZIP"]})})]}),m&&l.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"bg-slate-800 border-2 border-rose-500 rounded-lg p-6 max-w-lg w-full m-4 shadow-xl",children:[l.jsxs("h2",{id:"modal-title",className:"text-xl font-bold text-rose-300 flex items-center gap-2",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.21 3.03-1.742 3.03H4.42c-1.532 0-2.492-1.696-1.742-3.03l5.58-9.92zM10 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"WARNING: Destructive Action"]}),l.jsx("p",{className:"mt-2 text-slate-300",children:"You are about to replace **ALL** data on this website with the content from the backup file. All current pages, stories, contacts, and other content will be permanently deleted."}),l.jsx("p",{className:"mt-4 text-white font-semibold",children:"This action cannot be undone. Are you absolutely sure you want to proceed?"}),l.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[l.jsx("button",{onClick:()=>y(!1),type:"button",className:"px-4 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"}),l.jsx("button",{onClick:C,type:"button",className:"px-4 py-2 rounded-md bg-rose-600 text-white font-semibold hover:bg-rose-500 transition",children:"Confirm & Restore Data"})]})]})})]})},u2=n=>{const{backgroundImages:e,logos:s,onCreateBackgroundImage:o,onEditBackgroundImage:a,onDeleteBackgroundImage:c,onCreateLogo:d,onEditLogo:m,onDeleteLogo:y}=n;return l.jsxs("div",{className:"space-y-12",children:[l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Homepage Backgrounds"}),l.jsx("button",{onClick:o,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Image"})]}),l.jsxs("div",{className:"space-y-3",children:[e.map(f=>l.jsxs("div",{className:"flex justify-between items-center bg-slate-800 p-4 rounded-md",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("img",{src:f.image_url,alt:"Thumbnail",className:"w-16 h-10 object-cover rounded-md flex-shrink-0 border border-slate-600"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-sm text-slate-400 truncate block max-w-md",children:f.image_url}),f.photo_credit&&l.jsxs("span",{className:"text-xs text-slate-500 block",children:["Credit: ",f.photo_credit]})]})]}),l.jsxs("div",{children:[l.jsx("button",{onClick:()=>a(f),className:"px-4 py-1 rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>c(f.id),className:"px-4 py-1 rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},f.id)),e.length===0&&l.jsx("p",{className:"text-slate-500",children:"No background images have been added yet."})]})]}),l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Footer Logos"}),l.jsx("button",{onClick:d,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Logo"})]}),l.jsxs("div",{className:"overflow-x-auto",children:[l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-sm text-slate-400",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Funder Name"}),l.jsx("th",{className:"p-2",children:"Image"}),l.jsx("th",{className:"p-2",children:"URL"}),l.jsx("th",{className:"p-2",children:"Order"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:s.map(f=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-middle font-medium",children:f.funder_name}),l.jsx("td",{className:"p-2 align-middle",children:l.jsx("img",{src:f.image_url,alt:f.funder_name,className:"h-8 bg-slate-200 p-1 rounded-sm"})}),l.jsx("td",{className:"p-2 align-middle",children:l.jsx("a",{href:f.funder_url,target:"_blank",rel:"noopener noreferrer",className:"text-sky-400 hover:underline truncate block max-w-xs",children:f.funder_url})}),l.jsx("td",{className:"p-2 align-middle",children:f.sort_order}),l.jsxs("td",{className:"p-2 align-middle whitespace-nowrap",children:[l.jsx("button",{onClick:()=>m(f),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>y(f.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},f.id))})]}),s.length===0&&l.jsx("p",{className:"text-slate-500 mt-4",children:"No logos have been added yet."})]})]})]})},d2=({teamMembers:n,onCreate:e,onEdit:s,onDelete:o})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Team"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Member"})]}),l.jsxs("div",{className:"overflow-x-auto",children:[l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-sm text-slate-400",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Name"}),l.jsx("th",{className:"p-2",children:"Affiliation"}),l.jsx("th",{className:"p-2",children:"Role"}),l.jsx("th",{className:"p-2",children:"Order"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:n.map(a=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top font-medium",children:a.name}),l.jsx("td",{className:"p-2 align-top",children:a.affiliation}),l.jsx("td",{className:"p-2 align-top",children:a.role}),l.jsx("td",{className:"p-2 align-top",children:a.sort_order}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap",children:[l.jsx("button",{onClick:()=>s(a),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(a.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},a.id))})]}),n.length===0&&l.jsx("p",{className:"text-slate-500 mt-4",children:"No team members have been added yet."})]})]}),h2=({articles:n,onCreate:e,onEdit:s,onDelete:o})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Manifesto"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Create New Art
717icle"})]}),l.jsxs("div",{className:"overflow-x-auto",children:[l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-sm text-slate-400",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Title"}),l.jsx("th",{className:"p-2",children:"Slug"}),l.jsx("th",{className:"p-2",children:"Order"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:n.map(a=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top font-medium",children:a.title}),l.jsx("td",{className:"p-2 align-top font-mono text-xs text-slate-400",children:a.slug}),l.jsx("td",{className:"p-2 align-top",children:a.sort_order}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap",children:[l.jsx("button",{onClick:()=>s(a),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(a.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},a.id))})]}),n.length===0&&l.jsx("p",{className:"text-slate-500 mt-4",children:"No manifesto articles have been added yet."})]})]}),f2=({contacts:n,setContacts:e})=>{const[s,o]=R.useState(null),[a,c]=R.useState(null),d=async f=>{if(!window.confirm("Are you sure you want to delete this message? This action cannot be undone."))return;const{error:v}=await oe.from("costar_contacts").delete().eq("id",f);v?alert("Error deleting contact: "+v.message):(e(b=>b.filter(w=>w.id!==f)),alert("Contact deleted."))},m=f=>{const v=`Name: ${f.name} 718Email: ${f.email} 719Date: ${new Date(f.created_at).toLocaleString()} 720 721Message: 722${f.message}`;navigator.clipboard.writeText(v).then(()=>{c(f.id),setTimeout(()=>c(null),2e3)})},y=()=>{if(n.length===0){alert("No contacts to export.");return}const f=E=>{if(E==null)return"";let I=String(E);return I.includes(",")||I.includes(` 723`)||I.includes('"')?(I=I.replace(/"/g,'""'),`"${I}"`):I},w=[["created_at","name","email","message"].join(","),...n.map(E=>[f(new Date(E.created_at).toISOString()),f(E.name),f(E.email),f(E.message)].join(","))].join(` 724`),_=new Blob([w],{type:"text/csv;charset=utf-8;"}),C=document.createElement("a"),A=URL.createObjectURL(_);C.setAttribute("href",A),C.setAttribute("download",`costar_contacts_${new Date().toISOString().split("T")[0]}.csv`),C.style.visibility="hidden",document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(A)};return l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Contact Form Submissions"}),l.jsx("button",{onClick:y,className:"px-4 py-2 rounded-md bg-sky-600 text-white hover:bg-sky-500 transition font-semibold text-sm",children:"Export to CSV"})]}),n.length>0?l.jsx("div",{className:"space-y-3",children:n.map(f=>l.jsxs("div",{className:"bg-slate-800 rounded-md",children:[l.jsxs("button",{onClick:()=>o(s===f.id?null:f.id),className:"w-full flex justify-between items-center p-4 text-left",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-white",children:f.name}),l.jsx("p",{className:"text-sm text-slate-400",children:f.email})]}),l.jsx("span",{className:"text-xs text-slate-500",children:new Date(f.created_at).toLocaleString()})]}),s===f.id&&l.jsxs("div",{className:"p-4 border-t border-slate-700",children:[l.jsx("p",{className:"text-slate-300 whitespace-pre-wrap",children:f.message}),l.jsxs("div",{className:"text-right mt-4 flex items-center justify-end gap-2",children:[l.jsx("button",{onClick:()=>m(f),className:"px-3 py-1 text-sm rounded bg-sky-600 hover:bg-sky-500 text-white transition w-20",children:a===f.id?"Copied!":"Copy"}),l.jsx("button",{onClick:()=>d(f.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 text-white transition",children:"Delete"})]})]})]},f.id))}):l.jsx("p",{className:"text-slate-400",children:"No contact submissions yet."})]})},m2=({surveyResponses:n})=>{const e=()=>{if(n.length===0){alert("No survey responses to export.");return}const s=v=>{if(v==null)return"";Array.isArray(v)&&(v=v.join("; "));let b=String(v);return b.includes(",")||b.includes(` 725`)||b.includes('"')?(b=b.replace(/"/g,'""'),`"${b}"`):b},o=new Set;
725n.forEach(v=>{Object.keys(v).forEach(b=>o.add(b))});const a=["id","created_at"].concat(Array.from(o).filter(v=>v!=="id"&&v!=="created_at").sort()),d=[a.join(","),...n.map(v=>a.map(b=>s(v[b])).join(","))].join(` 726`),m=new Blob([d],{type:"text/csv;charset=utf-8;"}),y=document.createElement("a"),f=URL.createObjectURL(m);y.setAttribute("href",f),y.setAttribute("download",`costar_survey_responses_${new Date().toISOString().split("T")[0]}.csv`),y.style.visibility="hidden",document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(f)};return l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Survey Responses"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-lg text-slate-300 mb-4",children:["Found ",n.length," survey submission",n.length!==1?"s":"","."]}),l.jsx("button",{onClick:e,className:"px-6 py-2 rounded-md bg-sky-600 text-white hover:bg-sky-500 transition font-semibold",children:"Download All as CSV"})]})]})},p2=({questions:n,onCreate:e,onEdit:s,onDelete:o,onReorder:a})=>{const[c,d]=R.useState(n),[m,y]=R.useState(null),f=R.useRef(null);H0.useEffect(()=>{d(n)},[n]);const v=(_,C)=>{y(C),_.dataTransfer.effectAllowed="move"},b=_=>{f.current=_},w=()=>{if(m===null||f.current===null||m===f.current){y(null);return}const _=[...c],[C]=_.splice(m,1);_.splice(f.current,0,C),d(_),a(_),y(null),f.current=null};return l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Survey Question Editor"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Question"})]}),l.jsx("p",{className:"text-slate-400 mb-6",children:"Drag and drop questions to reorder them. Changes to the order are saved automatically."}),c.length>0?l.jsx("ul",{className:"space-y-3",children:c.map((_,C)=>l.jsxs("li",{draggable:!0,onDragStart:A=>v(A,C),onDragEnter:()=>b(C),onDragEnd:w,onDragOver:A=>A.preventDefault(),className:`flex justify-between items-start bg-slate-800 p-4 rounded-md cursor-grab transition-opacity ${m===C?"opacity-50":""}`,children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-slate-500 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16m-7 6h7"})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-slate-200",children:_.question_text}),l.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["Type: ",_.question_type," ",_.has_other?"(+Other)":""," ",_.is_contact_section?"(Contact Section)":""]})]})]}),l.jsxs("div",{className:"flex-shrink-0 ml-4",children:[l.jsx("button",{onClick:()=>s(_),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(_.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},_.id))}):l.jsxs("div",{className:"text-center py-12 border-2 border-dashed border-slate-600 rounded-lg",children:[l.jsx("p",{className:"text-slate-400",children:"No survey questions have been created yet."}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:'Click "Add New Question" to get started.'})]})]})},g2=({researchItems:n,onCreate:e,onEdit:s,onDelete:o})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage Related Research"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Research"})]}),l.jsxs("div",{className:"overflow-x-auto",children:[l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-sm text-slate-400",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Year"}),l.jsx("th",{className:"p-2",children:"Title"}),l.jsx("th",{className:"p-2",children:"Researcher/Org"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:n.map(a=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top",children:a.year}),l.jsxs("td",{className:"p-2 align-top font-medium",children:[a.title,l.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block text-xs text-sky-400 hover:underline truncate max-w-xs",children:a.url})]}),l.jsx("td",{className:"p-2 align-top",children:a.researcher}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap",children:[l.jsx("button",{onClick:()=>s(a),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(a.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},a.id))})]}),n.length===0&&l.jsx("p",{className:"text-slate-500 mt-4",children:"No research items have been added yet."})]})]}),Ou=[{key:"use_ecostar_pitch",title:"Use ECO-STAR: Pitch Generation",content:`Based on the following ECO-STAR inputs, generate a concise and compelling innovation pitch. 727Format the response using Markdown with the following structure: 728- A main title (using a '#' heading). 729- A short summary paragraph. 730- A section for each ECO-STAR element (using '##' headings like '## Customer'). 731- Bullet points under each section (using '-'). 732- Use bold formatting for emphasis on key terms (e.g., **Key Term**). 733 734- Environment (E): {inputs.E} 735- Customer (C): {inputs.C} 736- Opportunity (O): {inputs.O} 737- Solution (S): {inputs.S}
738- Team (T): {inputs.T} 739- Advantage (A): {inputs.A} 740- Results (R): {inputs.R}`},{key:"reframing_challenge",title:"Reframing Challenge",content:`Act as an expert innovation coach, like a modern-day combination of Clayton Christensen and a Zen master. 741Your task is to help a user reframe their problem statement to uncover deeper, more elegant solutions, inspired by the "NASA spent millions on a pen, the Russians used a pencil" principle. 742 743The user's initial problem is: "{userInput}" 744 745Analyze this problem. Then, generate 3-4 distinct, reframed questions. Each question should: 7461. Shift the perspective from the proposed solution to the core underlying need. 7472. Be open-ended and thought-provoking. 7483. Encourage simpler, more user-centric thinking. 749 750Format your response as a simple list, with each reframed question on a new line, starting with a hyphen '-'. 751Do not include any introductory or concluding text. Just the list. 752Use bold formatting (**text**) for emphasis on key action words or concepts in your questions. 753 754Example: 755If the user says "I need to build a complex app to track inventory", you might respond with: 756- How can we **know** our inventory levels with minimal effort? 757- What is the **simplest way** for the team to see what's in stock? 758- How might we **prevent** running out of items in the first place?`},{key:"team_mapper",title:"Team Attribute Mapper",content:`Act as a strategic team builder and community organizer with deep expertise in building holistic, effective teams for innovative projects. 759The user has a project described as: "{userInput}" 760 761Your task is to analyze this project and identify the key roles needed for success. Go beyond traditional job titles. Think in terms of attributes, skills, and relationships. 762 763Generate a list of roles categorized into three specific groups: 7641. **Core Skills:** Tangible abilities required to build or execute the project (e.g., "Digital Marketing", "Grant Writing", "3D Modeling"). 7652. **Community Connections:** People or roles defined by their relationships and trust within the target community (e.g., "A respected local Elder", "A youth group leader", "Someone with connections at the local council"). 7663. **Essential Attributes:** Intangible qualities or personality types crucial for the team's culture and success (e.g., "A natural storyteller", "A patient mentor", "A resilient problem-solver"). 767 768Provide a JSON object with the keys "coreSkills", "communityConnections", and "essentialAttributes". Each key should have an array of 3-5 string values.`},{key:"five_whys",title:"Five Whys Analysis",content:`Act as a root cause analysis expert, like Sakichi Toyoda, the originator of the 5 Whys technique. 769A user has gone through the 5 Whys process to understand a problem. Their chain of reasoning is as follows: 770 771Initial Problem: {statement1} 7721. Why was that happening? Because... {statement2} 7732. And why was that happening? Because... {statement3} 7743. And why was that happening? Because... {statement4} 7754. And why was that happening? Because... {statement5} 7765. And why was that happening? Because... {statement6} 777 778Your task is to analyze this entire chain and synthesize the findings into a single, concise statement that clearly identifies the **root cause**. 779The root cause should be a fundamental process or cultural issue, not a surface-level symptom. 780 781Format your response as a single, powerful sentence. Do not add any extra explanation or introductory text. 782For example, if the chain leads to a lack of training, you might respond with: "The core issue is a lack of a structured onboarding and continuous training process for new team members."`},{key:"persona_creator",title:"Customer Persona Creator",content:`Act as a senior UX researcher and marketing strategist. Your task is to create a detailed and empathetic user persona based on a brief description provided by the user. 783 784The user's description of their target audience is: "{userInput}" 785 786From this, generate a complete user persona. The persona should be realistic and bring the user to life. 787 788Provide a JSON object with the following structure: 789- "name": A plausible first and last name. 790- "age": A realistic age as a number. 791- "location": A general location (e.g., "a remote northern community", "a bustling city suburb"). 792- "occupation": A likely job or role. 793- "goals": An array of 3-4 key goals relevant to the user's description. 794- "frustrations": An array of 3-4 common frustrations or pain points. 795- "motivations": An array of 3-4 core motivations. 796- "bio": A short, narrative biography (2-3 sentences) that summarizes their story and personality.`},{key:"advantage_analyzer",title:"Advantage Analyzer",content:`Act as a top-tier business strategist and market analyst. Your task is to analyze a user's proposed solution and their listed competitors to identify a clear competitive advantage. 797 798User's Solution: "{solutionInput}" 799Listed Competitors: "{competitorsInput}" 800
801Your analysis should have two parts: 8021. For each competitor, briefly list their key strengths and weaknesses in relation to the user's solution space. 8032. Based on the analysis, suggest several distinct "Advantage Angles" for the user's solution. These should be actionable strategies or positioning statements that highlight their unique value. 804 805Provide a JSON object with the following structure: 806- "analysis": An array of objects, where each object has: 807 - "competitor": The name of the competitor. 808 - "strengths": An array of 2-3 strings describing their strengths. 809 - "weaknesses": An array of 2-3 strings describing their weaknesses. 810- "advantageAngles": An array of 3-4 strings, each a suggested advantage angle for the user.`},{key:"roadmap_planner",title:"Results & Roadmap Planner",content:`Act as a seasoned product manager and startup mentor. Your task is to help a user translate their innovative idea into an actionable plan. 811 812User's Project Idea: "{projectIdeaInput}" 813User's Primary Goal (for next 6-12 months): "{goalInput}" 814 815Based on this information, generate two key components for their plan: 8161. A list of 3-4 essential Key Performance Indicators (KPIs) they should track to measure progress towards their goal. 8172. A simple, 3-step roadmap with clear milestones for the initial phases of the project. Each step should have a phase number, a title, and a brief description of key activities. 818 819Provide a JSON object with the following structure: 820- "kpis": An array of 3-4 strings, each being a key KPI. 821- "roadmap": An array of exactly 3 objects, where each object has: 822 - "phase": A string like "Phase 1". 823 - "title": A concise title for the phase. 824 - "description": A short sentence describing the activities in that phase.`},{key:"interest_compatibility",title:"Interest Compatibility Assessment",content:`Act as an innovation coach specializing in purpose-driven entrepreneurship. Your task is to analyze a user's personal interests and map them to the principles of the ECO-STAR framework (Environment, Customer, Opportunity, Solution, Team, Advantage, Results). 825 826The user's interests are: "{userInput}" 827 828For each of the seven ECO-STAR principles, identify a potential innovation path or project theme that strongly aligns with the user's interests. Frame each path as a "How might we..." question to spark creativity. Also, provide a brief rationale explaining the connection. 829 830Provide a JSON object with a single key "assessment". The value should be an array of objects, one for each ECO-STAR principle. Each object should have the following structure: 831- "principle": The name of the ECO-STAR principle (e.g., "Environment"). 832- "letter": The letter of the principle (e.g., "E"). 833- "question": The generated "How might we..." question. 834- "rationale": A brief explanation of how the user's interests connect to this path.`},{key:"lesson_plan_generator",title:"Lesson Plan Generator",content:`You are an expert curriculum designer and educational writer specializing in creating comprehensive, in-depth lesson plans that align with Common Core State Standards (CCSS). 835Your task is to generate a highly detailed, thorough, and well-explained Common Core-aligned lesson plan based on the user's specifications. The final output should be between 2000 and 3000 words. 836 837**Core Methodology:** 838The lesson plan must be built around the **ECO-STAR methodology**... 839 840**User Specifications:** 841- **Grade Level:** {gradeLevel} 842- **Reading Level:** {readingLevel} 843- **ECO-STAR Component Focus:** {ecoStarComponent} 844- **Subject Area / Class Type:** {subjectArea} 845- **Specific Topics to Include (Optional):** {specificTopics} 846 847(The full prompt includes extensive, multi-level formatting rules for headings, lists, and structure to ensure a detailed, well-organized output.)`},{key:"workshop_planner",title:"Workshop Planner",content:`You are an expert workshop facilitator and instructional designer with deep experience in creating engaging, effective, and transformative learning experiences. 848Your task is to generate a comprehensive, in-depth, and highly detailed workshop facilitation guide based on the user's specifications. The final output should be a multi-page document, approximately 2000-3000 words in length. 849 850**Core Methodology:** 851The workshop must be built around the **ECO-STAR innovation methodology**... 852 853**User Specifications:** 854- **Type of Workshop:** {workshopType} 855- **Workshop Length:** {workshopLength} 856- **Target Audience:** {audience} 857- **Audience Proficiency Level:** {proficiencyLevel} 858- **ECO-STAR Component Focus:** {ecoStarComponent} 859- **Desired Outcomes:** {desiredOutcomes} 860 861(The full prompt includes extensive formatting rules for headings, agenda items, and facilitator notes to create a professional guide.)`},{key:"social_media_generator",title:"Social Media Post Generator",content:`Act as a savvy and authentic social media manager for a non-profit focused on innovation, arts, community, and climate solutions. Your tone should be personable, engaging, and reflect the vocabulary and style of youth in 2025âthink authentic, focused, and tightly written. 862 863**Context for Analysis (if provided):** 864--- 865{context} 866--- 867 868Generate {numTweets} social media posts based on the following criteria: 869 870- **Language:** {language} 871- **Topic:** {topic} 872- **Style:** {style} 873- **Character Limit:** Each post must be between 150 and 200 characters. 874- **Hashtags:** Always include {hashtags}, plus 1-2 additional relevant, high-traffic SEO keywords. Integrate hashtags naturally or append at the end. 875- **URL:** DO NOT include any URLs in the generated post text. 876- **Emojis:** Sparingly include 1-2 relevant emojis per post. 877 878Provide a JSON object with a single key "posts", containing an array of str
878ings.`},{key:"methodology_generator_custom",title:"Methodology Generator (Custom AI-Selected)",content:`Act as a senior academic researcher and principal investigator... Your writing style must be formal, direct, rigorous, and professional. The output must be a detailed, scholarly document suitable for a formal research proposal (1500-2000 words). 879 880**Core Task:** 881Synthesize the user's project idea with the **ECO-STAR innovation framework** and fuse it with the most effective and efficient established academic methodologies, epistemologies, approaches, and pedagogies relevant to the project. The goal is to create a novel, robust, synthesized methodological framework. 882 883**User's Project / Research Idea:** 884"{projectDescription}" 885 886**Primary Focus Areas:** 887"{focusAreas}" 888 889(The full prompt includes extremely detailed instructions to synthesize multiple concepts from various academic categories, justify all choices, and follow a strict, multi-phase document structure to produce a rigorous academic paper.)`},{key:"methodology_generator_fused",title:"Methodology Generator (User-Fused)",content:`Act as an expert research designer and academic consultant specializing in the synthesis of interdisciplinary research frameworks. Your tone must be professional, direct, and scholarly. 890 891**1. User's Project Description:** 892"{projectDescription}" 893 894**2. Primary Focus Areas:** 895"{focusAreas}" 896 897**3. Core Framework: ECO-STAR** 898(The prompt includes the full ECO-STAR breakdown) 899 900**4. User-Selected Concepts to Integrate:** 901{selectedItems} 902 903**Your Task:** 904Generate a detailed description of a new, integrated methodology. Your response must be structured in markdown format... 905 906(The prompt specifies a detailed structure including Core Philosophy, Guiding Principles, Phased Activities, and a Rationale, instructing the AI to explicitly link selected concepts to ECO-STAR components.)`}],y2=()=>{const[n,e]=R.useState([]),[s,o]=R.useState(!0),[a,c]=R.useState(null),[d,m]=R.useState("");R.useEffect(()=>{(async()=>{o(!0),m("");const{data:w,error:_}=await oe.from("costar_prompts").select("prompt_key, title, content"),C=w;if(_||!C)m("Failed to load custom prompts from the database. Displaying defaults."),console.error(_),e(Ou);else{const A=new Map(C.map(I=>[I.prompt_key,I])),E=Ou.map(I=>{const U=A.get(I.key);return{key:I.key,title:(U==null?void 0:U.title)||I.title,content:(U==null?void 0:U.content)||I.content}});e(E)}o(!1)})()},[]);const y=(b,w)=>{e(_=>_.map(C=>C.key===b?{...C,content:w}:C))},f=b=>{const w=Ou.find(_=>_.key===b);w&&y(b,w.content)},v=async b=>{c(b.key);const{error:w}=await oe.from("costar_prompts").upsert({prompt_key:b.key,title:b.title,content:b.content},{onConflict:"prompt_key"});w&&(alert(`Error saving prompt "${b.title}": ${w.message}`),console.error(w)),c(null)};return s?l.jsx("p",{children:"Loading prompts..."}):d?l.jsx("p",{className:"text-rose-400",children:d}):l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-xl p-6",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Customize Toolkit Prompts"}),l.jsx("p",{className:"text-slate-400 mt-2",children:'Here you can customize the system prompts used by the AI Toolkit exercises. Changes saved here will be used for all future generations. The original prompts are always available via the "Restore Default" button.'})]}),n.map(b=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-xl p-6",children:[l.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:b.title}),l.jsx("textarea",{value:b.content,onChange:w=>y(b.key,w.target.value),rows:12,className:"w-full bg-slate-900 p-4 rounded-md text-slate-300 whitespace-pre-wrap font-mono text-sm border border-slate-600 focus:ring-2 focus:ring-sky-500 focus:outline-none transition","aria-label":`Prompt content for ${b.title}`}),l.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[l.jsx("button",{onClick:()=>v(b),disabled:a===b.key,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition disabled:opacity-70 disabled:cursor-wait",children:a===b.key?"Saving...":"Save"}),l.jsx("button",{onClick:()=>f(b.key),className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Restore Default"})]})]},b.key))]})},Xy=({content:n})=>{const e=s=>{const o=a=>a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return s.split(/\n\s*\n/).map(a=>{const c=a.trim();return c?c.startsWith("## ")?`<h2>${o(c.substring(3))}</h2>`:c.startsWith("### ")?`<h3>${o(c.substring(4))}</h3>`:c.startsWith("#### ")?`<h4>${o(c.substring(5))}</h4>`:c.startsWith("- ")||c.startsWith("* ")?`<ul>${c.split(` 907`).map(m=>`<li>${o(m.replace(/^[-*]\s*/,""))}</li>`).join("")}</ul>`:/^\d+\.\s/.test(c)?`<ol>${c.split(` 908`).map(m=>`<li>${o(m.replace(/^\d+\.\s/,""))}</li>`).join("")}</ol>`:`<p>${o(c)}</p>`:""}).join("")};return l.jsx("div",{className:"prose prose-invert prose-lg max-w-none prose-violet",dangerouslySetInnerHTML:{__html:e(n)}})},v2=({methodology:n,onClose:e})=>{const[s,o]=R.useState(!1),a=R.useRef(null),c=()=>{var d;(d=a.current)!=null&&d.innerText&&navigator.clipboard.writeText(a.current.innerText).then(()=>{o(!0),setTimeout(()=>
908o(!1),2e3)})};return n?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:e,"aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"bg-slate-800 border border-slate-700 rounded-lg max-w-4xl w-full max-h-[90vh] flex flex-col shadow-xl",onClick:d=>d.stopPropagation(),children:[l.jsxs("header",{className:"flex-shrink-0 p-4 border-b border-slate-700 flex justify-between items-center",children:[l.jsxs("div",{className:"flex-grow",children:[l.jsx("h2",{id:"modal-title",className:"text-lg font-bold text-white truncate pr-4",children:n.title}),l.jsxs("p",{className:"text-xs text-slate-400",children:["Generated on ",new Date(n.created_at).toLocaleDateString()]})]}),l.jsxs("div",{children:[l.jsx("button",{onClick:c,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-500 transition w-24 mr-2",children:s?"Copied!":"Copy Text"}),l.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Close"})]})]}),l.jsx("div",{className:"flex-grow overflow-y-auto p-6",children:l.jsx("div",{ref:a,children:l.jsx(Xy,{content:n.generated_methodology})})})]})}):null},x2=({methodology:n,onClose:e})=>{const[s,o]=R.useState(!1),a=R.useRef(null),c=()=>{if(!a.current)return;const d=a.current.cloneNode(!0);d.querySelectorAll("h2, h3, h4").forEach(v=>{const b=v;b.style.paddingLeft="0",b.style.marginLeft="0"});const m=new Blob([d.innerHTML],{type:"text/html"}),y=new Blob([a.current.innerText],{type:"text/plain"}),f=new ClipboardItem({"text/html":m,"text/plain":y});navigator.clipboard.write([f]).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})};return!n||!n.enhanced_methodology?null:l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:e,"aria-labelledby":"enhanced-modal-title",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"bg-slate-800 border border-slate-700 rounded-lg max-w-5xl w-full max-h-[90vh] flex flex-col shadow-2xl",onClick:d=>d.stopPropagation(),children:[l.jsxs("header",{className:"flex-shrink-0 p-4 border-b border-slate-700 flex justify-between items-center",children:[l.jsxs("h2",{id:"enhanced-modal-title",className:"text-xl font-bold text-white truncate pr-4",children:["Enhanced Methodology: ",n.title]}),l.jsxs("div",{children:[l.jsx("button",{onClick:c,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-500 transition w-24 mr-2",children:s?"Copied!":"Copy"}),l.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Close"})]})]}),l.jsx("div",{className:"flex-grow overflow-y-auto p-8",children:l.jsx("div",{ref:a,children:l.jsx(Xy,{content:n.enhanced_methodology.content})})})]})})}
908,b2=({isOpen:n,onClose:e,onConfirm:s,itemType:o})=>{if(!n||!o)return null;const a=o.endsWith("y")?o.slice(0,-1)+"ies":o+"s";return l.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"bg-slate-800 border border-slate-700 rounded-lg p-6 max-w-md w-full m-4 shadow-xl",children:[l.jsx("h2",{id:"modal-title",className:"text-xl font-bold text-white",children:"Confirm Generation"}),l.jsxs("p",{className:"mt-2 text-slate-300",children:["This will use AI to generate and add approximately 15 new **",a.toLowerCase(),"** to your database."]}),l.jsx("p",{className:"mt-2 text-slate-400 text-sm",children:"This process automatically checks for and skips duplicates. Are you sure you want to continue?"}),l.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[l.jsx("button",{onClick:e,type:"button",className:"px-4 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"}),l.jsx("button",{onClick:s,type:"button",className:"px-4 py-2 rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-500 transition",children:"Confirm & Generate"})]})]})})},w2=({isOpen:n,onClose:e,onConfirm:s,methodology:o})=>!n||!o?null:l.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm","aria-labelledby":"enhance-modal-title",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"bg-slate-800 border border-slate-700 rounded-lg p-6 max-w-md w-full m-4 shadow-xl",children:[l.jsx("h2",{id:"enhance-modal-title",className:"text-xl font-bold text-white",children:"Confirm Enhancement"}),l.jsxs("p",{className:"mt-2 text-slate-300",children:["You are about to enhance the methodology titled: ",l.jsx("strong",{className:"text-white",children:o.title}),"."]}),l.jsx("p",{className:"mt-2 text-slate-400 text-sm",children:"This will perform a multi-pass AI generation to radically enhance this methodology. It may take several minutes and incur costs. This action cannot be undone."}),l.jsx("p",{className:"mt-2 text-slate-400 text-sm",children:"Are you sure you want to proceed?"}),l.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[l.jsx("button",{onClick:e,type:"button",className:"px-4 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"}),l.jsx("button",{onClick:s,type:"button",className:"px-4 py-2 rounded-md bg-indigo-600 text-white font-semibold hover:bg-indigo-500 transition",children:"Confirm & Enhance"})]})]})}),S2=()=>{const[n,e]=R.useState([]),[s,o]=R.useState([]),[a,c]=R.useState(null),[d,m]=R.useState(null),[y,f]=R.useState(null),[v,b]=R.useState(!0),[w,_]=R.useState(null),[C,A]=R.useState(null),[E,I]=R.useState(!1),[U,G]=R.useState(null),[F,P]=R.useState({isOpen:!1,itemType:null}),[$,H]=R.useState({isOpen:!1,methodology:null}),[Z,X]=R.useState("manage"),q=async()=>{b(!0);const[M,J]=await Promise.all([oe.from("costar_methodologies").select("*").order("type").order("name"),oe.from("saved_methodologies").select("*").order("created_at",{ascending:!1})]);M.data&&e(M.data),M.error&&(console.error("Error fetching methodologies",M.error),alert("Error fetching methodologies: "+M.error.message)),J.data&&o(J.data),J.error&&(console.error("Error fetching saved methodologies",J.error),alert("Error fetching saved methodologies: "+J.error.message)),b(!1)};R.useEffect(()=>{q()},[]);const Q=M=>{const{name:J,value:ee}=M.target;c(J==="core_principles"?{...a,core_principles:ee.split(` 909`)}:{...a,[J]:ee})},ne=async()=>{I(!0);const{id:M,created_at:J,...ee}=a,{error:ce}=M==="new"?await oe.from("costar_methodologies").insert([ee]):await oe.from("costar_methodologies").update(ee).eq("id",M);ce?alert("Error saving item: "+ce.message):(c(null),await q()),I(!1)},se=async M=>{if(!window.confirm("Are you sure you want to delete this item?"))return;G(M);const{error:J}=await oe.from("costar_methodologies").delete().eq("id",M);J?alert("Error deleting item: "+J.message):await q(),G(null)},fe=async M=>{if(!window.confirm("Are you sure you want to delete this saved methodology?"))return;G(M);const{error:J}=await oe.from("saved_methodologies").delete().eq("id",M);J?alert("Error deleting item: "+J.message):await q(),G(null)},ge=()=>{c({id:"new",name:"",type:"Methodology",category:"",description:"",core_principles:[],example_uses:""})},z=M=>{P({isOpen:!0,itemType:M})},te=()=>{F.itemType&&k(F.itemType),P({isOpen:!1,itemType:null})},ae=M=>{H({isOpen:!0,methodology:M})},ve=()=>{$.methodology&&Te($.methodology),H({isOpen:!1,methodology:null})},Te=async M=>{A(M.id);try{const J=new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}),ce=M.generated_methodology.split(/(?=## )/g).filter(tt=>tt.trim().length>0).map(tt=>{const Jt=`You are a distinguished professor and leading academic in interdisciplinary research design. Your task is to take a section of a draft research methodology and expand it into a comprehensive, scholarly chapter of approximately 2000 words. Your writing must be formal, rigorous, and suitable for a doctoral thesis or major grant application. 910 911 **Original Project Context:** 912 - **Project Idea:** ${M.project_description} 913 - **Original Selected Concepts:** ${M.selected_items?M.selected_items.map(St=>St.name).join(", "):M.is_custom?"Custom AI-selected concepts":"N/A"} 914 915 **Methodology Section to Expand:** 916 --- 917 ${tt} 918 --- 919 920 **Your Task:** 921 1. **Radically Expand:** Elaborate on every point in the provided section. Increase the word count for this section alone to approximately 2000 words. 922 2. **Deepen Theoretical Foundations:** For every mentioned methodology, epistemology, approach, or discipline, provide a detailed academic definition, discuss its historical and theoretical context, and provide a rigorous justification for its inclusion in this specific project. 923 3. **Intensify ECO-STAR Integration:** Explicitly and repeatedly connect the concepts back to the core principles of the ECO-STAR framework (Environment, Customer, Opportunity, Solution, Team, Advantage, Results). Explain *how* and *why* each element is integrated. 924 4. **Incorporate Scholarly Language:** Use precise, academic language. 925 5. **Maintain Structure:** Preserve the original heading of the section. Use sub-headings (### and ####) to structure the expanded content logically. Use paragraphs as the default text block. 926 927 Produce the expanded section in markdown format.`;return J.models.generateContent({model:"gemini-2.5-pro",contents:Jt})}),Qe=`You are the lead editor of a prestigious academic journal. Your task is to take a collection of detailed methodology chapters and synthesize them into a single, cohesive document. You will write a new overarching introduction and a new concluding summary to frame the entire work. 928 929 **Full Document Content:** 930 --- 931 ${(await Promise.all(ce)).map(tt=>tt.text).join(` 932 933`)} 934 --- 935 936 **Your Task:** 937 1. **Write a New Introduction:** Create a comprehensive new introduction (approximately 500 words) titled "## Executive Summary and Methodological Vision". This must summarize the project, introduce the synthesized methodology by name, and explain the document's structure. 938 2. **Write a New Conclusion:** Create a strong concluding section (approximately 500 words) titled "## Conclusion: Synthesis and Contribution to the Field". This must summarize the framework's strengths and articulate its novel contribution. 939 3. **Combine and Return:** Prepend your new introduction to the full document content, and append your new conclusion. Return the entire, final, cohesive document as a single markdown string. Do not alter the body of the document.`,At=(await J.models.generateContent({model:"gemini-2.5-pro",contents:Qe})).text,Pt={...M,enhanced_methodology:{content:At}};f(Pt);const hn={content:At},{data:Rt,error:Xe}=await oe.from("saved_methodologies").update({enhanced_methodology:hn}).eq("id",M.id).select("*");if(Xe)throw Xe;if(!Rt||Rt.length===0)throw new Error("Database update verification failed. The enhanced methodology was not saved.");alert("Methodology enhanced and saved successfully!"),await q()}catch(J){console.error("Error enhancing methodology:",J);const ee=J instanceof Error?J.message:"An unknown error occurred.";alert(`The save operation failed: ${ee} 940 941IMPORTANT: You can still view and copy the generated content from the modal that has appeared.`)}finally{A(null)}},k=async M=>{const J=M.endsWith("y")?M.slice(0,-1)+"ies":M+"s";_(M);try{let ee,ce,ue;switch(M){case"Methodology":ee="an expert in social science, arts-based, and participatory research methodologies",ce="research methodologies and approaches",ue='"Social Science", "Arts-Based", "Community-Based", "Indigenous Methodologies"';break;case"Epistemology":ee="an expert in philosophy and the theory of knowledge",ce="epistemologies relevant to social science, arts, and community research",ue='"Positivism", "Constructivism", "Phenomenology", "Feminist Theory"';break;case"Pedagogy":ee="an expert in educational theory and practice",ce="pedagogies, especially those relevant to critical, creative, and community-based education",ue='"Critical Pedagogy", "Problem-Based
941Learning", "Place-Based Education", "Culturally Responsive Teaching"';break;case"Approach":ee="an expert in strategic and creative thinking",ce='high-level "approaches" or ways of thinking applicable to innovation and problem-solving',ue='"Strategic", "Design Thinking", "Systems Thinking", "Creative"';break;case"Discipline":ee="an expert in specific academic or creative disciplines",ce="creative or academic disciplines that can be applied to projects",ue='"Storytelling", "Filmmaking", "Visual Arts", "Sociology", "Ecology"';break}const _e=n.filter(Xe=>Xe.type===M).map(Xe=>Xe.name),Qe=` 942 You are ${ee}. Your task is to generate a list of 15 distinct, well-defined, and diverse ${ce}. 943 These items should NOT be from the following list of existing items: ${_e.join(", ")}. 944 945 For each item, provide a name, a category, a concise one-sentence description, a bulleted list of 3-4 core principles, and a one-sentence example of its use in a creative or community project. 946 947 **Categories:** Choose a relevant category for each item from a list like ${ue}. 948 949 **CRITICAL JSON FORMATTING:** 950 Provide a JSON object with a single key "${J.toLowerCase()}". The value should be an array of objects. Each object must have the following keys: 951 - "name": string 952 - "category": string 953 - "description": string 954 - "core_principles": array of strings 955 - "example_uses": string 956 `,Pt=(await new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"}).models.generateContent({model:"gemini-2.5-flash",contents:Qe,config:{responseMimeType:"application/json",responseSchema:{type:le.OBJECT,properties:{[J.toLowerCase()]:{type:le.ARRAY,items:{type:le.OBJECT,properties:{name:{type:le.STRING},category:{type:le.STRING},description:{type:le.STRING},core_principles:{type:le.ARRAY,items:{type:le.STRING}},example_uses:{type:le.STRING}},required:["name","category","description","core_principles","example_uses"]}}},required:[J.toLowerCase()]}}})).text.trim(),Rt=JSON.parse(Pt)[J.toLowerCase()];if(Rt&&Rt.length>0){const Xe=Rt.filter(tt=>!_e.some(Jt=>Jt.toLowerCase()===tt.name.toLowerCase())).map(tt=>({...tt,type:M}));if(Xe.length>0){const{error:tt}=await oe.from("costar_methodologies").insert(Xe);if(tt)throw tt}}await q()}catch(ee){console.error(`Error generating ${J}:`,ee),alert(`An error occurred while generating new ${J.toLowerCase()}. Please check the console for details.`)}finally{_(null)}};return a?l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8 space-y-4",children:[l.jsx("h2",{className:"text-3xl font-bold",children:a.id==="new"?"Create New Item":"Editing Item"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Name"}),l.jsx("input",{name:"name",value:a.name,onChange:Q,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Type"}),l.jsxs("select",{name:"type",value:a.type,onChange:Q,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md",children:[l.jsx("option",{children:"Methodology"}),l.jsx("option",{children:"Epistemology"}),l.jsx("option",{children:"Pedagogy"}),l.jsx("option",{children:"Approach"}),l.jsx("option",{children:"Discipline"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Category"}),l.jsx("input",{name:"category",value:a.category,onChange:Q,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Description"}),l.jsx("textarea",{name:"description",value:a.description,onChange:Q,rows:3,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Core Principles (one per line)"}),l.jsx("textarea",{name:"core_principles",value:a.core_principles.join(` 957`),onChange:Q,rows:4,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Example Uses"}),l.jsx("textarea",{name:"example_uses",value:a.example_uses,onChange:Q,rows:3,className:"w-full bg-slate-800 p-2 border border-slate-600 rounded-md"})]}),l.jsxs("div",{className:"mt-4 flex gap-2",children:[l.jsx("button",{onClick:ne,disabled:E,className:"px-5 py-2 rounded-md bg-emerald-600 text-white font-semibold hover:bg-emerald-500 transition disabled:opacity-50",children:E?"Saving...":"Save"}),l.jsx("button",{onClick:()=>c(null),className:"px-5 py-2 rounded-md bg-slate-600 text-white font-semibold hover:bg-slate-500 transition",children:"Cancel"})]})]}):l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-6 md:p-8",children:[l.jsx("div",{className:"border-b border-slate-600 mb-6",children:l.jsxs("nav",{className:"-mb-px flex space-x-6","aria-label":"Tabs",children:[l.jsx("button",{onClick:()=>X("manage"),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-md transition-colors duration-200 ${Z==="manage"?"border-sky-400 text-white":"border-transparent text-slate-400 hover:text-white"}`,children:"Manage Knowledge Base"}),l.jsxs("button",{onClick:()=>X("saved"),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-md transition-colors duration-200 ${Z==="saved"?"border-sky-400 text-white":"border-transparent text-slate-400 hover:text-white"}`,children:["Saved Methodologies (",s.length,")"]})]})}),v?l.jsx("p",{children:"Loading..."}):Z==="manage"?l.jsxs("div",{className:"space-y-10",children:[l.jsx("div",{className:"text-right",children:l.jsx("button",{onClick:ge,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New Item Manually"})}),["Methodology","Epistemology","Pedagogy","Approach","Discipline"].map(M=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center mb-4 gap-3",children:[l.jsx("h3",{className:"text-xl font-bold text-white",children:M.endsWith("y")?M.slice(0,-1)+"ies":M+"s"}),l.jsx("button",{onClick:()=>z(M),disabled:!!w,className:"px-4 py-2 text-sm rounded-md bg-sky-600 text-white font-semibold hover:bg-sky-500 transition disabled:opacity-50",children:w===M?"Generating...":"Generate More with AI"})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-xs text-slate-400 uppercase",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Name"}),l.jsx("th",{className:"p-2",children:"Category"}),l.jsx("th",{className:"p-2 hidden md:table-cell",children:"Description"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:n.filter(J=>J.type===M).map(J=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top font-medium",children:J.name}),l.jsx("td",{className:"p-2 align-top text-slate-400",children:J.category}),l.jsx("td",{className:"p-2 align-top text-sm text-slate-300 hidden md:table-cell",children:J.description}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap",children:[l.jsx("button",{onClick:()=>c(J),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>se(J.id),disabled:U===J.id,className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition disabled:opacity-50",children:U===J.id?"...":"Del"})]})]},J.id))})]})})]},M))]}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-xs text-slate-400 uppercase",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Title"}),l.jsx("th",{className:"p-2 hidden md:table-cell",children:"Project Description"}),l.jsx("th",{className:"p-2",children:"Type"}),l.jsx("th",{className:"p-2 hidden sm:table-cell",children:"Date"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:s.map(M=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top font-medium max-w-xs truncate",children:M.title}),l.jsx("td",{className:"p-2 align-top text-sm text-slate-300 hidden md:table-cell max-w-sm truncate",children:M.project_description}),l.jsx("td",{className:"p-2 align-top text-sm",children:l.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-semibold ${M.is_custom?"bg-violet-900 text-violet-300":"bg-sky-900 text-sky-300"}
957`,children:M.is_custom?"Custom":"Fused"})}),l.jsx("td",{className:"p-2 align-top text-xs text-slate-400 hidden sm:table-cell",children:new Date(M.created_at).toLocaleDateString()}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap text-sm",children:[l.jsx("button",{onClick:()=>m(M),className:"px-3 py-1 rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"View"}),M.enhanced_methodology&&l.jsx("button",{onClick:()=>f(M),className:"px-3 py-1 rounded bg-emerald-600 hover:bg-emerald-500 transition mr-2",children:"View Enhanced"}),l.jsx("button",{onClick:()=>ae(M),disabled:!!C,className:"px-3 py-1 rounded bg-indigo-600 hover:bg-indigo-500 transition mr-2 disabled:opacity-50",children:C===M.id?"...":"Enhance"}),l.jsx("button",{onClick:()=>fe(M.id),disabled:U===M.id,className:"px-3 py-1 rounded bg-rose-600 hover:bg-rose-500 transition disabled:opacity-50",children:U===M.id?"...":"Del"})]})]},M.id))})]})}),l.jsx(b2,{isOpen:F.isOpen,onClose:()=>P({isOpen:!1,itemType:null}),onConfirm:te,itemType:F.itemType}),l.jsx(w2,{isOpen:$.isOpen,onClose:()=>H({isOpen:!1,methodology:null}),onConfirm:ve,methodology:$.methodology}),d&&l.jsx(v2,{methodology:d,onClose:()=>m(null)}),y&&l.jsx(x2,{methodology:y,onClose:()=>f(null)})]})},_2=({gpts:n,onCreate:e,onEdit:s,onDelete:o})=>l.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-2xl p-8",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-2xl font-bold text-white",children:"Manage GPTs"}),l.jsx("button",{onClick:e,className:"px-4 py-2 rounded bg-emerald-600 hover:bg-emerald-500 transition font-semibold",children:"Add New GPT"})]}),l.jsxs("div",{className:"overflow-x-auto",children:[l.jsxs("table",{className:"w-full text-left",children:[l.jsx("thead",{className:"border-b border-slate-600 text-sm text-slate-400",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-2",children:"Title"}),l.jsx("th",{className:"p-2",children:"Description"}),l.jsx("th",{className:"p-2",children:"URL"}),l.jsx("th",{className:"p-2",children:"Order"}),l.jsx("th",{className:"p-2",children:"Actions"})]})}),l.jsx("tbody",{children:n.map(a=>l.jsxs("tr",{className:"border-b border-slate-700/50",children:[l.jsx("td",{className:"p-2 align-top font-medium",children:a.title}),l.jsx("td",{className:"p-2 align-top text-sm max-w-sm truncate",children:a.description}),l.jsx("td",{className:"p-2 align-top text-sm",children:l.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-sky-400 hover:underline truncate block max-w-xs",children:a.url})}),l.jsx("td",{className:"p-2 align-top",children:a.sort_order}),l.jsxs("td",{className:"p-2 align-top whitespace-nowrap",children:[l.jsx("button",{onClick:()=>s(a),className:"px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500 transition mr-2",children:"Edit"}),l.jsx("button",{onClick:()=>o(a.id),className:"px-3 py-1 text-sm rounded bg-rose-600 hover:bg-rose-500 transition",children:"Delete"})]})]},a.id))})]}),n.length===0&&l.jsx("p",{className:"text-slate-500 mt-4",children:"No GPTs have been added yet."})]})]}),T2=({activeView:n,setActiveView:e})=>{const s=({view:c,label:d,icon:m})=>l.jsxs("button",{onClick:()=>e(c),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors text-base ${n===c?"bg-indigo-50 text-indigo-700 font-semibold":"text-slate-600 hover:bg-slate-100"}`,children:[m,d]}),o=({children:c})=>l.jsx("h3",{className:"px-3 mt-6 mb-2 text-xs font-bold text-slate-400 uppercase tracking-wider",children:c}),a={dashboard:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"})}),pages:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})}),stories:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M9 4.804A7.968 7.968
9570 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z"})}),manifesto:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M4 2a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V4a2 2 0 00-2-2H4zm.293 3.293a1 1 0 011.414 0L10 9.586l4.293-4.293a1 1 0 111.414 1.414L11.414 11l4.293 4.293a1 1 0 01-1.414 1.414L10 12.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 11 4.293 6.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),research:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M10.394 2.08a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})}),assets:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z",clipRule:"evenodd"})}),team:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"})}),community:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),l.jsx("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h1a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})]}),ai:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),settings:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01-.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})};return l.jsx("aside",{className:"w-64 flex-shrink-0 bg-white border-r border-slate-200 p-4",children:l.jsxs("nav",{className:"flex flex-col gap-1",children:[l.jsx(s,{view:"dashboard",label:"Dashboard",icon:a.dashboard}),l.jsx(o,{children:"Content"}),l.jsx(s,{view:"pages",label:"Pages",icon:a.pages}),l.jsx(s,{view:"stories",label:"Stories",icon:a.stories}),l.jsx(s,{view:"manifesto",label:"Manifesto",icon:a.manifesto}),l.jsx(s,{view:"research",label:"Research",icon:a.research}),l.jsx(o,{children:"Site Assets"}),l.jsx(s,{view:"images",label:"Images & Logos",icon:a.assets}),l.jsx(s,{view:"team",label:"Team",icon:a.team}),l.jsx(o,{children:"Community"}),l.jsx(s,{view:"contacts",label:"Contact Submissions",icon:a.community}),l.jsx(s,{view:"survey",label:"Survey Responses",icon:a.community}),l.jsx(s,{view:"survey-editor",label:"Survey Editor",icon:a.settings}),l.jsx(o,{children:"AI Tools"}),l.jsx(s,{view:"gpts",label:"GPTs",icon:a.ai}),l.jsx(s,{view:"methodologies",label:"Methodology Hub",icon:a.ai}),l.jsx(s,{view:"prompts",label:"Toolkit Prompts",icon:a.ai}),l.jsx(o,{children:"System"}),l.jsx(s,{view:"settings",label:"Settings",icon:a.settings})]})})},C2=()=>
957{const[n,e]=R.useState([]),[s,o]=R.useState([]),[a,c]=R.useState([]),[d,m]=R.useState([]),[y,f]=R.useState([]),[v,b]=R.useState([]),[w,_]=R.useState([]),[C,A]=R.useState([]),[E,I]=R.useState([]),[U,G]=R.useState([]),[F,P]=R.useState([]),[$,H]=R.useState(!0),[Z,X]=R.useState("dashboard"),[q,Q]=R.useState(null),[ne,se]=R.useState(null),[fe,ge]=R.useState(null),[z,te]=R.useState(null),[ae,ve]=R.useState(null),[Te,k]=R.useState(null),[M,J]=R.useState(null),[ee,ce]=R.useState(null);R.useLayoutEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[Z]);const ue=async()=>{H(!0);const[Ae,me,De,Me,He,Ot,Sn,es,fn,ts,An]=await Promise.all([oe.from("costar_pages").select("*").order("title"),oe.from("costar_stories").select("*").order("published_at",{ascending:!1}),oe.from("costar_manifesto_articles").select("*").order("sort_order",{ascending:!0}),oe.from("costar_contacts").select("*").order("created_at",{ascending:!1}),oe.from("costar_research").select("*").order("year",{ascending:!1}),oe.from("costar_team").select("*").order("sort_order",{ascending:!0}),oe.from("costar_background_images").select("*").order("created_at"),oe.from("costar_logos").select("*").order("sort_order"),oe.from("costar_survey_responses").select("*").order("created_at",{ascending:!1}),oe.from("costar_survey_questions").select("*").order("sort_order"),oe.from("costar_gpts").select("*").order("sort_order")]);Ae.data&&e(Ae.data),me.data&&o(me.data),De.data&&c(De.data),Me.data&&m(Me.data),He.data&&f(He.data),Ot.data&&b(Ot.data),Sn.data&&_(Sn.data),es.data&&A(es.data),fn.data&&I(fn.data),ts.data&&G(ts.data),An.data&&P(An.data),[Ae,me,De,Me,He,Ot,Sn,es,fn,ts,An].forEach(va=>{va.error&&console.error("Error fetching data:",va.error)}),H(!1)};R.useEffect(()=>{ue()},[]);const _e=async Ae=>{const{error:me}=await oe.from("costar_pages").update({content:Ae.content,title:Ae.title}).eq("id",Ae.id);me?alert("Error saving page: "+me.message):(alert("Page saved!"),ue())},Qe=async Ae=>{const{id:me,...De}=Ae,{error:Me}=me==="new"?await oe.from("costar_stories").insert([De]):await oe.from("costar_stories").update(De).eq("id",me);Me?alert("Error saving story: "+Me.message):(alert("Story saved!"),Q(null),ue())},Be=async Ae=>{const{id:me,...De}=Ae,Me={...De,sort_order:Number(De.sort_order)||0},{error:He}=me==="new"?await oe.from("costar_manifesto_articles").insert([Me]):await oe.from("costar_manifesto_articles").update(Me).eq("id",me);He?alert("Error saving article: "+He.message):(alert("Article saved!"),se(null),ue())},At=async Ae=>{const{id:me,...De}=Ae,Me={...De,year:Number(De.year)||null},{error:He}=me==="new"?await oe.from("costar_research").insert([Me]):await oe.from("costar_research").update(Me).eq("id",me);He?alert("Error saving research item: "+He.message):(alert("Research item saved!"),ge(null),ue())},Pt=async Ae=>{const{id:me,...De}=Ae,Me={...De,sort_order:Number(De.sort_order)||0},{error:He}=me==="new"?await oe.from("costar_team").insert([Me]):await oe.from("costar_team").update(Me).eq("id",me);He?alert("Error saving team member: "+He.message):(alert("Team member saved!"),te(null),ue())},hn=async Ae=>{const{id:me,...De}=Ae,{error:Me}=me==="new"?await oe.from("costar_background_images").insert([De]):await oe.from("costar_background_images").update(De).eq("id",me);Me?alert("Error saving background image: "+Me.message):(alert("Background image saved!"),ve(null),ue())},Rt=async Ae=>{const{id:me,...De}=Ae,Me={...De,sort_order:Number(De.sort_order)||0},{error:He}=me==="new"?await oe.from("costar_logos").insert([Me]):await oe.from("costar_logos").update(Me).eq("id",me);He?alert("Error saving logo: "+He.message):(alert("Logo saved!"),k(null),ue())},Xe=async Ae=>{const{id:me,created_at:De,...Me}=Ae,He={...Me,sort_order:Number(Me.sort_order)},{error:Ot}=me==="new"?await oe.from("costar_survey_questions").insert([He]):await oe.from("costar_survey_questions").update(He).eq("id",me);Ot?alert("Error saving survey question: "+Ot.message):(alert("Survey question saved!"),J(null),ue())},tt=async Ae=>{const{id:me,...De}=Ae,Me={...De,sort_order:Number(De.sort_order)||0},{error:He}=me==="new"?await oe.from("costar_gpts").insert([Me]):await oe.from("costar_gpts").update(Me).eq("id",me);He?alert("Error saving GPT: "+He.message):(alert("GPT saved!"),ce(null),ue())},Jt=async Ae=>{const me=Ae.map((Me,He)=>({id:Me.id,sort_order:He})),{error:De}=await oe.from("costar_survey_questions").upsert(me);De?alert("Error saving question order: "+De.message):ue()},St=(Ae,me,De)=>
957async Me=>{if(!window.confirm(`Are you sure you want to delete this ${me}?`))return;const{error:He}=await oe.from(Ae).delete().eq("id",Me);He?alert(`Error deleting ${me}: ${He.message}`):(alert(`${me.charAt(0).toUpperCase()+me.slice(1)} deleted.`),De(Ot=>Ot.filter(Sn=>Sn.id!==Me)))},js=St("costar_stories","story",o),Wn=St("costar_manifesto_articles","manifesto article",c),Xn=St("costar_research","research item",f),Zn=St("costar_team","team member",b),si=St("costar_background_images","background image",_),ii=St("costar_logos","logo",A),ct=St("costar_survey_questions","survey question",G),be=St("costar_gpts","GPT",P),pa=()=>Q({id:"new",title:"New Story Title",excerpt:"",url:"",published_at:new Date().toISOString()}),ga=()=>se({id:"new",slug:"",title:"New Principle Title",subtitle:"",excerpt:"",color:"slate",content:"",sort_order:(a.length+1)*10}),oi=()=>ge({id:"new",year:new Date().getFullYear(),title:"",researcher:"",url:""}),rl=()=>te({id:"new",name:"",affiliation:"",role:"",bio:"",url:"",sort_order:(v.length+1)*10}),ya=()=>ve({id:"new",image_url:"",photo_credit:""}),ll=()=>k({id:"new",funder_name:"",image_url:"",funder_url:"",sort_order:(C.length+1)*10}),cl=()=>J({id:"new",question_text:"",question_type:"multiple-choice",options:[],has_other:!1,is_contact_section:!1,sort_order:U.length}),Is=()=>ce({id:"new",title:"New GPT",description:"",url:"",sort_order:(F.length+1)*10});if(q)return l.jsx(Z1,{story:q,onSave:Qe,onCancel:()=>Q(null)});if(ne)return l.jsx(e2,{article:ne,onSave:Be,onCancel:()=>se(null)});if(fe)return l.jsx(t2,{item:fe,onSave:At,onCancel:()=>ge(null)});if(z)return l.jsx(n2,{member:z,onSave:Pt,onCancel:()=>te(null)});if(ae)return l.jsx(s2,{image:ae,onSave:hn,onCancel:()=>ve(null)});if(Te)return l.jsx(i2,{logo:Te,onSave:Rt,onCancel:()=>k(null)});if(M)return l.jsx(o2,{question:M,onSave:Xe,onCancel:()=>J(null)});if(ee)return l.jsx(a2,{gpt:ee,onSave:tt,onCancel:()=>ce(null)});const _t=()=>{if($)return l.jsx("p",{className:"p-8 text-slate-500",children:"Loading content..."});switch(Z){case"dashboard":return l.jsx(q0,{stories:s.slice(0,5),contacts:d.slice(0,5),surveyResponses:E,setView:X});case"pages":return l.jsx(r2,{allPages:n,onSave:_e});case"stories":return l.jsx(l2,{stories:s,onCreateStory:pa,onEditStory:Q,onDeleteStory:js});case"manifesto":return l.jsx(h2,{articles:a,onCreate:ga,onEdit:se,onDelete:Wn});case"research":return l.jsx(g2,{researchItems:y,onCreate:oi,onEdit:ge,onDelete:Xn});case"images":return l.jsx(u2,{backgroundImages:w,logos:C,onCreateBackgroundImage:ya,onEditBackgroundImage:ve,onDeleteBackgroundImage:si,onCreateLogo:ll,onEditLogo:k,onDeleteLogo:ii});case"team":return l.jsx(d2,{teamMembers:v,onCreate:rl,onEdit:te,onDelete:Zn});case"contacts":return l.jsx(f2,{contacts:d,setContacts:m});case"survey":return l.jsx(m2,{surveyResponses:E});case"survey-editor":return l.jsx(p2,{questions:U,onCreate:cl,onEdit:J,onDelete:ct,onReorder:Jt});case"gpts":return l.jsx(_2,{gpts:F,onCreate:Is,onEdit:ce,onDelete:be});case"methodologies":return l.jsx(S2,{});case"prompts":return l.jsx(y2,{});case"settings":return l.jsx(c2,{onRestoreComplete:ue});default:return l.jsx(q0,{stories:s.slice(0,5),contacts:d.slice(0,5),surveyResponses:E,setView:X})}};return l.jsxs("div",{className:"pt-20 min-h-screen flex flex-col md:flex-row bg-slate-50",children:[l.jsx(T2,{activeView:Z,setActiveView:X}),l.jsx("main",{className:"flex-grow p-6 md:p-10 overflow-y-auto",children:_t()})]})},E2=({setPage:n})=>{const[e,s]=R.useState([]),[o,a]=R.useState(!0);R.useEffect(()=>{(async()=>{a(!0);const{data:m,error:y}=await oe.from("costar_stories").select("id, published_at, title, excerpt, url").order("published_at",{ascending:!1});y?console.error("Error fetching stories:",y):s(m),a(!1)})()},[]);const c=d=>new Date(d).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"});return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("header",{className:"text-center mb-16",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-teal-500 to-lime-600",children:"Stories & Insights"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed text-center max-w-3xl mx-auto",children:"A curated collection of articles and posts from around the web where we explore our methodology and related ideas."})]}),l.jsx("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:o?l.jsx("div",{className:"col-span-full text-center text-slate-500 py-20",children:"Loading stories..."}):e.length>0?e.map(d=>l.jsxs("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col bg-white rounded-2xl border border-slate-200 p-8 transition-all duration-300 hover:-translate-y-2 hover:shadow-xl hover:shadow-slate-200 hover:border-teal-300 group h-full",children:[l.jsx("p",{className:"text-sm font-semibold text-teal-600 mb-3 uppercase tracking-wide",children:c(d.published_at)}),l.jsx("h2",{className:"text-2xl font-bold text-slate-900 group-hover:text-teal-700 transition-colors mb-4 leading-tight",children:d.title}),d.excerpt&&l.jsx("p",{className:"text-slate-600 leading-relaxed text-base flex-grow mb-6",children:d.excerpt}),l.jsxs("div",{className:"mt-auto font-bold text-slate-800 flex items-center group-hover:text-teal-600 transition-colors",children:["Read Story",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-2 transform group-hover:translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]},d.id)):l.jsx("div",{className:"col-span-full text-center bg-slate-50 border border-dashed border-slate-300 rounded-lg p-12",children:l.jsx("p",{className:"text-slate-500",children:"No stories have been published yet."})})})]})})},N2=({articleId:n})=>
957{const[e,s]=R.useState(null),[o,a]=R.useState(!0);R.useEffect(()=>{(async()=>{if(!n)return;a(!0);const{data:y,error:f}=await oe.from("costar_articles").select("title, content, color").eq("id",n).single();f?console.error("Error fetching article:",f):s(y),a(!1)})()},[n]);const c={cyan:{gradient:"from-cyan-500 to-sky-600",prose:"prose-cyan"},rose:{gradient:"from-rose-500 to-red-600",prose:"prose-rose"},amber:{gradient:"from-amber-500 to-orange-600",prose:"prose-amber"},indigo:{gradient:"from-indigo-500 to-purple-600",prose:"prose-indigo"},lime:{gradient:"from-lime-500 to-green-600",prose:"prose-lime"}};if(o)return l.jsx("div",{className:"text-center pt-48 text-slate-500",children:"Loading article..."});if(!e)return l.jsx("div",{className:"text-center pt-48 text-rose-500",children:"Article not found."});const d=c[e.color]||c.cyan;return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("article",{className:"max-w-4xl mx-auto",children:[l.jsx("h1",{className:`text-4xl md:text-6xl font-black tracking-tight !leading-tight text-transparent bg-clip-text bg-gradient-to-r ${d.gradient} mb-16`,children:e.title}),l.jsx("div",{className:`prose prose-lg max-w-none text-slate-700 ${d.prose}`,dangerouslySetInnerHTML:{__html:e.content}})]})})},A2={"Add me to the mailing list":"contact_reason_mailing_list","Share the survey results with me":"contact_reason_share_results","I'd like more information on the project":"contact_reason_more_info"},R2=()=>{const[n,e]=R.useState([]),[s,o]=R.useState(!0),[a,c]=R.useState(0),[d,m]=R.useState({}),[y,f]=R.useState(!1),[v,b]=R.useState(""),[w,_]=R.useState(!1);R.useEffect(()=>{(async()=>{o(!0);const{data:Q,error:ne}=await oe.from("costar_survey_questions").select("*").order("sort_order",{ascending:!0});ne?(console.error("Error fetching survey questions:",ne),b("Could not load the survey. Please try again later.")):e(Q),o(!1)})()},[]);const C=(q,Q,ne)=>{const se={...d,[q]:Q};ne!==void 0&&(se[`${q}_other`]=ne),m(se)},A=(q,Q)=>{const ne=d[q]||[];let se;ne.includes(Q)?se=ne.filter(fe=>fe!==Q):se=[...ne,Q],C(q,se)},E=async()=>{_(!0),b("");const{error:q}=await oe.from("costar_survey_responses").insert([d]);q?(b("There was an error submitting your survey. Please try again."),console.error("Survey submission error:",q),_(!1)):(f(!0),_(!1))};if(s)return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-48 pb-24 text-center",children:l.jsx("p",{className:"text-slate-500",children:"Loading survey..."})});if(y)return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-2xl mx-auto text-center bg-emerald-50 border border-emerald-200 rounded-2xl p-8 md:p-12",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-emerald-700",children:"Thank You!"}),l.jsx("p",{className:"mt-4 text-lg text-slate-700",children:"Your responses have been recorded. We appreciate you taking the time to share your perspective."})]})});if(n.length===0&&!s)return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-48 pb-24 text-center",children:l.jsx("p",{className:"text-rose-500",children:v||"The survey is not available at this time."})});const I=n[a],{id:U,question_text:G,question_description:F,question_type:P,options:$,has_other:H,is_contact_section:Z}=I,X=a/n.length*100;return l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-sky-500 to-indigo-600 mb-2",children:"Community Survey"}),l.jsx("p",{className:"text-lg text-slate-500 text-center mb-10",children:"Your perspective is important to us."}),l.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2.5 mb-6",children:l.jsx("div",{className:"bg-sky-500 h-2.5 rounded-full transition-all duration-300",style:{width:`${X}%`}})}),l.jsxs("div",{className:"bg-white border border-slate-200 rounded-2xl p-8 shadow-sm",children:[l.jsxs("div",{className:"min-h-[20rem]",children:[l.jsxs("h2",{className:"text-2xl font-bold text-slate-900",children:[a+1,". ",G]}),F&&l.jsx("p",{className:"mt-2 text-slate-600 leading-relaxed",children:F}),l.jsxs("div",{className:"mt-6 space-y-4",children:[P==="multiple-choice"&&($==null?void 0:$.map(q=>l.jsx("div",{children:l.jsxs("label",{className:`block w-full text-left p-4 rounded-lg border-2 transition cursor-pointer ${d[U]===q?"border-sky-500 bg-sky-50":"border-slate-200 hover:bg-slate-50"}`,children:[l.jsx("input",{type:"radio",name:U,value:q,checked:d[U]===q,onCh
957ange:()=>C(U,q),className:"sr-only"}),l.jsx("span",{className:"text-lg text-slate-700",children:q})]})},q))),P==="checkbox"&&($==null?void 0:$.map(q=>{var Q,ne;return l.jsx("div",{children:l.jsxs("label",{className:`block w-full text-left p-4 rounded-lg border-2 transition cursor-pointer ${(Q=d[U])!=null&&Q.includes(q)?"border-sky-500 bg-sky-50":"border-slate-200 hover:bg-slate-50"}`,children:[l.jsx("input",{type:"checkbox",name:U,value:q,checked:((ne=d[U])==null?void 0:ne.includes(q))||!1,onChange:()=>A(U,q),className:"sr-only"}),l.jsx("span",{className:"text-lg text-slate-700",children:q})]})},q)})),H&&l.jsxs("div",{className:"pt-2",children:[l.jsxs("label",{className:`block w-full text-left p-4 rounded-lg border-2 transition cursor-pointer ${d[U]==="Other"?"border-sky-500 bg-sky-50":"border-slate-200 hover:bg-slate-50"}`,children:[l.jsx("input",{type:"radio",name:U,value:"Other",checked:d[U]==="Other",onChange:()=>C(U,"Other"),className:"sr-only"}),l.jsx("span",{className:"text-lg text-slate-700",children:"Other"})]}),d[U]==="Other"&&l.jsx("input",{type:"text",placeholder:"Please specify",value:d[`${U}_other`]||"",onChange:q=>C(U,"Other",q.target.value),className:"mt-2 w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-sky-500 focus:outline-none transition"})]}),P==="textarea"&&l.jsx("textarea",{value:d[U]||"",onChange:q=>C(U,q.target.value),rows:5,className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-sky-500 focus:outline-none transition"}),Z&&l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-slate-600 mb-6",children:"If you would like the results or would like to stay connected, please provide your details below."}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"contact_name",className:"sr-only",children:"Name"}),l.jsx("input",{type:"text",id:"contact_name",placeholder:"Your Name",value:d.contact_name||"",onChange:q=>C("contact_name",q.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-sky-500 focus:outline-none transition"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"contact_email",className:"sr-only",children:"Email"}),l.jsx("input",{type:"email",id:"contact_email",placeholder:"Your Email Address",value:d.contact_email||"",onChange:q=>C("contact_email",q.target.value),className:"w-full bg-white border border-slate-300 rounded-lg p-3 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-sky-500 focus:outline-none transition"})]}),l.jsx("div",{className:"pt-2 space-y-3",children:$==null?void 0:$.map(q=>{const Q=A2[q];return l.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer text-slate-700",children:[l.jsx("input",{type:"checkbox",checked:!!d[Q],onChange:()=>C(Q,!d[Q]),className:"h-5 w-5 rounded bg-slate-100 border-slate-300 text-sky-600 focus:ring-sky-500"}),l.jsx("span",{children:q})]},q)})})]})]})]})]}),l.jsx("div",{className:"mt-8 pt-4 border-t border-slate-100 text-center",children:l.jsx("p",{className:"text-xs text-slate-400",children:"All results are confidential. We will not share or disclose user e-mail addresses."})})]}),v&&l.jsx("p",{className:"text-center text-rose-500 mt-4",children:v}),l.jsxs("div",{className:"mt-6 flex justify-between items-center",children:[l.jsx("button",{onClick:()=>c(q=>q-1),disabled:a===0,className:"px-6 py-2 rounded-md bg-white border border-slate-300 text-slate-600 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-slate-50 hover:text-slate-900 transition shadow-sm",children:"Previous"}),a<n.length-1?l.jsx("button",{onClick:()=>c(q=>q+1),className:"px-6 py-2 rounded-md bg-white border border-slate-300 text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition shadow-sm",children:"Next"}):l.jsx("button",{onClick:E,disabled:w,className:"px-8 py-3 rounded-md bg-emerald-600 text-white font-bold hover:bg-emerald-700 transition disabled:opacity-70 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:w?"Submitting...":"Submit Survey"})]})]})})},k2=[{slug:"environment",title:"Environment",excerpt:"Analyze your project's relationship with the planet. This is the foundation. Consider materials, energy use, supply chains, and end-of-life. Frame your innovation within the larger story of climate justice, ecosystem restoration, and the circular economy. How does your idea listen to and honor the land?",color:"teal"},{slug:"customer",title:"Customer",excerpt:"This is often the first light bulb moment. Identify the real customer â who is paying for the service or product? What do we know about them? Is there more than one? What need of theirs are you addressing? How do you know about it? What techniques have you used to get close to the customer to really understand the issue? Are you sure the need is not currently being met by any other organisation?",color:"cyan"},{slug:"opportunity",title:"Opportunity",excerpt:"What is the wider potential of your idea? Is there a way of extending the impact of your idea into other areas? Could you increase your return on investment by expanding or rolling out your innovation later on? What are the characteristics of the market you are looking at? Do you know the trends, the values, the social and technological changes that will affect the market? This is where you should demonstrate your deep knowledge of the particular market place.",color:"rose"},{slug:"solution",title:"Solution",excerpt:"This is the articulation of the idea. Move from a general idea into a more detailed description of whom it will benef
957it, and how it will be developed and disseminated. Use creative techniques to stimulate new ideas. Describe your business model, estimate costs, and always undertake proof of concept. Develop fast prototyping even if it is for a service: nothing works faster to show you the efficacy of an idea. Identify risks and determine if and how you can manage them.",color:"amber"},{slug:"team",title:"Team",excerpt:"Think in terms of attributes rather than individuals. Do you have access to all the necessary attributes in your team? If not, where else might you gain access to them? Be bold â think outside the obvious contacts, and look beyond your own networks. Be wary of focusing so hard on your own role that you lose sight of whether other organisations may need to cooperate for a successful roll-out.",color:"indigo"},{slug:"advantage",title:"Advantage",excerpt:"What do you offer that no one else is offering? To answer this, you need to know who or what the competition is and what they are offering. What do they do brilliantly and how can you learn from and enhance that? Try reframing the problem to see if you can identify an unconsidered advantage â NASA spent millions on a pen that would work in space, whereas the Russians simply asked âhow do we write in spaceâ and used a pencil!",color:"lime"},{slug:"results",title:"Results",excerpt:"Numbers are really important here. Identify the specific return on investment. Give a timeline showing projected out turn, with milestones, for example, looking at time to profitability and growth. Despite the need for numbers, donât disregard the qualitative results â demonstrate long term impact if possible. Show benefits to the end user e.g. measure changes in customer delight.",color:"fuchsia"}],j2=({text:n})=>{const e=o=>{const a=/(\*\*.*?\*\*)|(\[.*?\]\(.*?\))/g;return o.split(a).filter(d=>d).map((d,m)=>{if(d.startsWith("**")&&d.endsWith("**"))return l.jsx("strong",{children:d.substring(2,d.length-2)},m);const y=d.match(/\[(.*?)\]\((.*?)\)/);if(y){const[,f,v]=y;return l.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline",children:f},m)}return d})},s=n.split(` 958`).map((o,a)=>o.trim().startsWith("* ")||o.trim().startsWith("- ")?l.jsx("li",{className:"ml-5 list-disc",children:e(o.trim().substring(2))},a):l.jsx("p",{children:e(o)},a));return l.jsx(l.Fragment,{children:s})},I2=()=>{const[n,e]=R.useState([]),[s,o]=R.useState(""),[a,c]=R.useState(!1),d=R.useRef(null);R.useEffect(()=>{e([{sender:"bot",text:`Hello! I'm the ECO-STAR North assistant. I can answer questions about the methodology, our team, or our research. 959 960Here are some things you can ask: 961* What is ECO-STAR? 962* Who is on the team? 963* Tell me about your research on Digital Return Platforms.`}])},[]),R.useEffect(()=>{var f;(f=d.current)==null||f.scrollIntoView({behavior:"smooth"})},[n,a]);const m=async f=>{const v=f.toLowerCase();if(/\b(what is|tell me about|explain)\b.*\beco-star\b/.test(v))return`ECO-STAR is a powerful methodology for creating compelling value, designed for creative entrepreneurs and community innovators. It stands for: 964 965${Yt.map(w=>`* **${w.letter} - ${w.title}:** ${w.question}`).join(` 966 967`)}`;if(/\b(manifesto|principles)\b/.test(v))return`The ECO-STAR North Manifesto is a set of guiding principles for sovereign creators. Key principles include: 968${k2.slice(0,7).map(w=>`* **${w.title}**`).join(` 969`)} 970 971You can explore all of them on the 'Manifesto' page.`;try{const b=`%${f}%`,w=oe.from("costar_research").select("id, title, researcher, url").or(`title.ilike.${b},researcher.ilike.${b}`),_=oe.from("costar_team").select("id, name, bio, affiliation, role, url").or(`name.ilike.${b},bio.ilike.${b},affiliation.ilike.${b},role.ilike.${b}`),C=oe.from("costar_stories").select("id, title, excerpt, url").or(`title.ilike.${b},excerpt.ilike.${b}`),A=oe.functions.invoke("semantic_search_knowledgebase",{body:{query:f}}),[E,I,U,G]=await Promise.allSettled([w,_,C,A]);let F=[];const P=(q,Q,ne)=>{q.status==="fulfilled"&&!q.value.error&&q.value.data?F.push(...q.value.data.map(ne)):(q.status==="rejected"||q.status==="fulfilled"&&q.value.error)&&console.error(`Error fetching from ${Q}:`,q.status==="rejected"?q.reason:q.value.error)};P(E,"Research",q=>({id:`research-${q.id}`,content:`Title: ${q.title} 972Researcher: ${q.researcher}${q.url?` 973URL: ${q.url}`:""}`,source_type:"Research"})),P(I,"Team",q=>({id:`team-${q.id}`,content:`Name: ${q.name} 974Affiliation: ${q.affiliation} 975Role: ${q.role} 976Bio: ${q.bio}${q.url?` 977Contact/URL: ${q.url}`:""}`,source_type:"Team Member"})),P(U,"Stories",q=>({id:`stories-${q.id}`,content:`Title: ${q.title} 978Excerpt: ${q.excerpt}${q.url?` 979URL: ${q.url}`:""}`,source_type:"Story"})),G.status==="fulfilled"&&!G.value.error&&G.value.data?F.push(...G.value.data.map(q=>
979({...q,id:`kb-${q.id}`}))):(G.status==="rejected"||G.status==="fulfilled"&&G.value.error)&&console.error("Supabase semantic search function error:",G.status==="rejected"?G.reason:G.value.error);const $=F.length>0?Array.from(new Map(F.map(q=>[q.id,q])).values()):[],H=new Nt({apiKey:"AIzaSyA-pti0_FiCPMbuNsi6n5GEOA4mUnGCwQM"});let Z;return $.length>0?Z=`You are a helpful and friendly research assistant for ECO-STAR North. 980 981 **CRITICAL INSTRUCTION:** Use the following information retrieved from our internal knowledge base to answer the user's question. Your answer MUST be based primarily on this information. 982 983 - Synthesize the information into a coherent, conversational answer. 984 - When you reference a specific piece of information (like a research paper, story, or team member), explicitly mention its type and title. For example: "I found a research paper titled '...'" or "According to our Manifesto principle 'We Begin with the Land'..." 985 - **ALWAYS include any URLs provided in the context as markdown links, like [Title of Document](url).** This is very important for user experience. 986 - If you provide a list, use markdown bullet points (* or -). 987 988 **Retrieved Context:** 989 --- 990 ${$.map(Q=>`Source Type: ${Q.source_type} 991Content: "${Q.content}"`).join(` 992 993--- 994 995`)} 996 --- 997 998 **User's Question:** "${f}" 999 1000 Now, answer the user's question. If the context doesn't directly answer the question, state that you couldn't find a specific match in the knowledge base but provide a helpful response based on your general understanding of ECO-STAR's mission. 1001 `:Z=`You are a helpful and friendly assistant for a project called ECO-STAR North, an innovation methodology for arts, creative, and climate entrepreneurship in Northern Canada. Your persona is knowledgeable, encouraging, and slightly academic but accessible. 1002 1003 Context: The ECO-STAR methodology stands for Environment, Customer, Opportunity, Solution, Team, Advantage, and Results. It's a framework designed to be culturally relevant and decolonized for Northern and Indigenous creators. 1004 1005 User's question: "${f}" 1006 1007 I couldn't find a specific match in our knowledge base for your query. Based on my general knowledge, provide a concise and helpful answer. If the question is outside of your scope (e.g., asking for the weather, personal opinions), politely say so.`,(await H.models.generateContent({model:"gemini-2.5-flash",contents:Z})).text}catch(b){return console.error("Gemini API or hybrid search error:",b),"I'm sorry, I'm having trouble connecting to my knowledge base right now. Please try again in a moment."}},y=async f=>{if(f.preventDefault(),!s.trim()||a)return;const v={text:s,sender:"user"};e(_=>[..._,v]),o(""),c(!0);const w={text:await m(s),sender:"bot"};e(_=>[..._,w]),c(!1)};return l.jsxs("div",{className:"pt-20 h-screen flex flex-col bg-slate-50",children:[l.jsxs("div",{className:"flex-grow overflow-y-auto p-4 md:p-6 space-y-6",children:[n.map((f,v)=>l.jsxs("div",{className:`flex items-end gap-3 ${f.sender==="user"?"justify-end":"justify-start"}`,children:[f.sender==="bot"&&l.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-100 flex-shrink-0 flex items-center justify-center font-bold text-indigo-700 border border-indigo-200",children:"E*"}),l.jsx("div",{className:`max-w-lg lg:max-w-2xl rounded-2xl p-4 shadow-sm ${f.sender==="user"?"bg-indigo-600 text-white rounded-br-none":"bg-white border border-slate-200 text-slate-800 rounded-bl-none"}`,children:l.jsx("div",{className:`prose prose-sm md:prose-base max-w-none ${f.sender==="user"?"prose-invert":""} prose-p:my-1 prose-li:my-1`,children:l.jsx(j2,{text:f.text})})})]},v)),a&&l.jsxs("div",{className:"flex items-end gap-3 justify-start",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-100 flex-shrink-0 flex items-center justify-center font-bold text-indigo-700 border border-indigo-200",children:"E*"}),l.jsx("div",{className:"max-w-lg rounded-2xl p-4 bg-white border border-slate-200 rounded-bl-none",children:l.jsxs("div",{className:"flex gap-1.5 items-center",children:[l.jsx("span",{className:"h-2 w-2 bg-slate-400 rounded-full animate-bounce [animation-delay:-0.3s]"}),l.jsx("span",{className:"h-2 w-2 bg-slate-400 rounded-full animate-bounce [animation-delay:-0.15s]"}),l.jsx("span",{className:"h-2 w-2 bg-slate-400 rounded-full animate-bounce"})]})})]}),l.jsx("div",{ref:d})]}),l.jsx("div",{className:"p-4 bg-white border-t border-slate-200",children:l.jsxs("form",{onSubmit:y,className:"max-w-4xl mx-auto flex gap-3 items-center",children:[l.jsx("textarea",{value:s,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),y(f))},placeholder:"Ask about ECO-STAR...",rows:1,className:"flex-grow bg-slate-50 border border-slate-300 rounded-xl p-4 text-slate-800 placeholder-slate-400 focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-indigo-500 focus:outline-none transition resize-none shadow-inner"}),l.jsx("button",{type:"submit",disabled:a||!s.trim(),className:"w-12 h-12 flex-shrink-0 bg-indigo-600 rounded-full text-white font-bold flex items-center justify-center hover:bg-indigo-700 transition disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg","aria-label":"Send message",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 transform rotate-90",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009
100715.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})]})})]})},M2=()=>{const[n,e]=R.useState([]),[s,o]=R.useState(!0);return R.useEffect(()=>{(async()=>{o(!0);const{data:c,error:d}=await oe.from("costar_gpts").select("id, title, description, url").order("sort_order",{ascending:!0});d?console.error("Error fetching GPTs:",d):e(c),o(!1)})()},[]),l.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-32 pb-16 md:pt-40 md:pb-24",children:l.jsxs("div",{className:"max-w-7xl mx-auto",children:[l.jsxs("header",{className:"text-center mb-16",children:[l.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tight text-center text-transparent bg-clip-text bg-gradient-to-r from-violet-500 to-sky-600",children:"Custom GPTs"}),l.jsx("p",{className:"mt-6 text-lg md:text-xl text-slate-600 leading-relaxed text-center max-w-3xl mx-auto",children:"Explore our collection of custom-trained GPTs, designed to assist with various aspects of the ECO-STAR methodology, research, and creative ideation."})]}),l.jsx("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:s?l.jsx("div",{className:"col-span-full text-center text-slate-500 py-12",children:"Loading GPTs..."}):n.length>0?n.map(a=>l.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col p-8 rounded-2xl border border-slate-200 bg-white transition-all duration-300 hover:-translate-y-2 hover:shadow-xl hover:shadow-slate-200 hover:border-violet-300 group h-full",children:[l.jsx("div",{className:"w-12 h-12 bg-violet-100 rounded-lg flex items-center justify-center mb-6 text-violet-600",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),l.jsx("h2",{className:"text-2xl font-bold text-slate-900 group-hover:text-violet-700 transition-colors mb-3",children:a.title}),a.description&&l.jsx("p",{className:"text-slate-600 leading-relaxed text-base flex-grow mb-6",children:a.description}),l.jsxs("div",{className:"mt-auto font-semibold text-violet-600 flex items-center group-hover:underline",children:["Open GPT",l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 ml-2 transform group-hover:translate-x-1 transition-transform",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]},a.id)):l.jsx("div",{className:"col-span-full text-center bg-white border border-dashed border-slate-300 rounded-lg p-12",children:l.jsx("p",{className:"text-slate-500",children:"No GPTs have been added yet."})})})]})})},D2="https://lhlrxojkdpvnzifqeiiv.supabase.co",U2="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxobHJ4b2prZHB2bnppZnFlaWl2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjMwODgzNzQsImV4cCI6MjA3ODY2NDM3NH0.HYTvCk9GdS1lb8SAkm_ZdcFQrnwKz3r0WbB9H5dc0Bo",oe=fS(D2,U2),L2=()=>{const[n,e]=R.useState({name:"Home"}),[s,o]=R.useState(null),[a,c]=R.useState([]);R.useEffect(()=>{oe.auth.getSession().then(({data:{session:f}})=>{o(f)});const{data:{subscription:m}}=oe.auth.onAuthStateChange((f,v)=>{o(v),f==="SIGNED_IN"?e({name:"Admin"}):f==="SIGNED_OUT"&&e({name:"Home"})});return(async()=>{const{data:f,error:v}=await oe.from("costar_logos").select("*").order("sort_order",{ascending:!0});f&&c(f),v&&console.error("Error fetching logos:",v)})(),()=>m.unsubscribe()},[]),R.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[n]);const d=()=>{var m,y;if(n.name==="Admin"&&!s)return l.jsx(G0,{});switch(n.name){case"Home":return l.jsx(tg,{setPage:e});case"About":return l.jsx(gS,{});case"Manifesto":return l.jsx(yS,{setPage:e});case"ManifestoArticle":return l.jsx(vS,{slug:(m=n.params)==null?void 0:m.slug,setPage:e});case"Toolkit":return l.jsx(bS,{setActivePage:e});case"Research":return l.jsx(TS,{});case"UseCoStar":return l.jsx(L1,{});case"ReframingChallenge":return l.jsx(O1,{});case"TeamMapper":return l.jsx(G1,{});case"FiveWhys":return l.jsx(q1,{});case"PersonaCreator":return l.jsx(B1,{});case"AdvantageAnalyzer":return l.jsx(H1,{});case"RoadmapPlanner":return l.jsx(z1,{});case"InterestCompatibility":return l.jsx(V1,{});case"LessonPlanGenerator":return l.jsx($1,{});case"WorkshopPlanner":return l.jsx(J1,{});case"SocialMediaPostGenerator":return l.jsx(K1,{});case"MethodologyGenerator":return l.jsx(W1,{});case"Stories":return l.jsx(E2,{setPage:e});case"Article":return l.jsx(N2,{articleId:(y=n.params)==null?void 0:y.id});case"Engage":return l.jsx(X1,{});case"Chat":return l.jsx(I2,{});case"GPTs":return l.jsx(M2,{});case"Login":return l.jsx(G0,{});case"Admin":return l.jsx(C2,{});case"Survey":return l.jsx(R2,{});default:return l.jsx(tg,{setPage:e})}};return l.jsxs("div",{className:"min-h-screen bg-slate-50 font-sans flex flex-col text-slate-600",children:[l.jsx(mS,{page:n,setPage:e,isLoggedIn:!!s}),l.jsx("main",{className:"flex-grow",children:d()}),n.name!=="Chat"&&l.jsxs("footer",{className:"text-center py-16 border-t border-slate-800 mt-16 bg-slate-900 text-slate-400",children:[l.jsxs("div",{className:"container md:max-w-screen-lg lg:max-w-screen-xl xl:max-w-screen-2xl mx-auto px-4 sm:px-6 lg:px-8 mb-10",children:[l.jsx("h3",{className:"text-sm text-slate-500 tracking-widest uppercase mb-8 font-bold",children:"Funded By"}),a.length>0?l.jsx("div",{className:"flex flex-wrap justify-center items-center gap-x-12 gap-y-8",children:a.map(m=>l.jsx("a",{href:m.funder_url,target:"_blank",rel:"noopener noreferrer","aria-label":m.funder_name,children:l.jsx("img",{src:m.image_url,alt:`${m.funder_name} logo`,className:"max-h-16 opacity-70 hover:opacity-100 hover:scale-105 transition-all duration-300"})},m.id))}):l.jsxs("div",{className:"bg-slate-800 border border-dashed border-slate-700 rounded-lg p-6 max-w-2xl mx-auto text-center",children:[l.jsx("p",{className:"text-slate-400",children:"No supporter logos have been added."}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Please add them via the 'Logos' tab in the Admin Dashboard."})]})]}),l.jsx("p",{className:"text-slate-500 text-sm",children:"© 2025 ECO-STAR NORTH | Minneapolis College of Art and Design, Art Borups Corners and The Arts Incubator Winnipeg"})]})]})},Zy=document.getElementById("root");
1007if(!Zy)throw new Error("Could not find root element to mount to");const P2=_b.createRoot(Zy);P2.render(l.jsx(H0.StrictMode,{children:l.jsx(L2,{})}));export{od as g};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.