scenri 0.17.2 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,106 +0,0 @@
1
- var Rb=e=>{throw TypeError(e)};var Pb=(e,t,n)=>t.has(e)||Rb("Cannot "+n);var Kr=(e,t,n)=>(Pb(e,t,"read from private field"),n?n.call(e):t.get(e)),Lb=(e,t,n)=>t.has(e)?Rb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Y2=(e,t,n,r)=>(Pb(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function kL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Q5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q2={exports:{}},Hd={},X2={exports:{}},hn={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 Tb;function SL(){if(Tb)return hn;Tb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function k(I,U,G){this.props=I,this.context=U,this.refs=x,this.updater=G||w}k.prototype.isReactComponent={},k.prototype.setState=function(I,U){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,U,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function S(){}S.prototype=k.prototype;function E(I,U,G){this.props=I,this.context=U,this.refs=x,this.updater=G||w}var j=E.prototype=new S;j.constructor=E,y(j,k.prototype),j.isPureReactComponent=!0;var N=Array.isArray,P=Object.prototype.hasOwnProperty,$={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function C(I,U,G){var ne,q={},le=null,Se=null;if(U!=null)for(ne in U.ref!==void 0&&(Se=U.ref),U.key!==void 0&&(le=""+U.key),U)P.call(U,ne)&&!M.hasOwnProperty(ne)&&(q[ne]=U[ne]);var Q=arguments.length-2;if(Q===1)q.children=G;else if(1<Q){for(var xe=Array(Q),ee=0;ee<Q;ee++)xe[ee]=arguments[ee+2];q.children=xe}if(I&&I.defaultProps)for(ne in Q=I.defaultProps,Q)q[ne]===void 0&&(q[ne]=Q[ne]);return{$$typeof:e,type:I,key:le,ref:Se,props:q,_owner:$.current}}function R(I,U){return{$$typeof:e,type:I.type,key:U,ref:I.ref,props:I.props,_owner:I._owner}}function T(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function H(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(G){return U[G]})}var D=/\/+/g;function K(I,U){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):U.toString(36)}function O(I,U,G,ne,q){var le=typeof I;(le==="undefined"||le==="boolean")&&(I=null);var Se=!1;if(I===null)Se=!0;else switch(le){case"string":case"number":Se=!0;break;case"object":switch(I.$$typeof){case e:case t:Se=!0}}if(Se)return Se=I,q=q(Se),I=ne===""?"."+K(Se,0):ne,N(q)?(G="",I!=null&&(G=I.replace(D,"$&/")+"/"),O(q,U,G,"",function(ee){return ee})):q!=null&&(T(q)&&(q=R(q,G+(!q.key||Se&&Se.key===q.key?"":(""+q.key).replace(D,"$&/")+"/")+I)),U.push(q)),1;if(Se=0,ne=ne===""?".":ne+":",N(I))for(var Q=0;Q<I.length;Q++){le=I[Q];var xe=ne+K(le,Q);Se+=O(le,U,G,xe,q)}else if(xe=v(I),typeof xe=="function")for(I=xe.call(I),Q=0;!(le=I.next()).done;)le=le.value,xe=ne+K(le,Q++),Se+=O(le,U,G,xe,q);else if(le==="object")throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Se}function Z(I,U,G){if(I==null)return I;var ne=[],q=0;return O(I,ne,"","",function(le){return U.call(G,le,q++)}),ne}function te(I){if(I._status===-1){var U=I._result;U=U(),U.then(function(G){(I._status===0||I._status===-1)&&(I._status=1,I._result=G)},function(G){(I._status===0||I._status===-1)&&(I._status=2,I._result=G)}),I._status===-1&&(I._status=0,I._result=U)}if(I._status===1)return I._result.default;throw I._result}var B={current:null},F={transition:null},X={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:F,ReactCurrentOwner:$};function z(){throw Error("act(...) is not supported in production builds of React.")}return hn.Children={map:Z,forEach:function(I,U,G){Z(I,function(){U.apply(this,arguments)},G)},count:function(I){var U=0;return Z(I,function(){U++}),U},toArray:function(I){return Z(I,function(U){return U})||[]},only:function(I){if(!T(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},hn.Component=k,hn.Fragment=n,hn.Profiler=a,hn.PureComponent=E,hn.StrictMode=r,hn.Suspense=f,hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,hn.act=z,hn.cloneElement=function(I,U,G){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ne=y({},I.props),q=I.key,le=I.ref,Se=I._owner;if(U!=null){if(U.ref!==void 0&&(le=U.ref,Se=$.current),U.key!==void 0&&(q=""+U.key),I.type&&I.type.defaultProps)var Q=I.type.defaultProps;for(xe in U)P.call(U,xe)&&!M.hasOwnProperty(xe)&&(ne[xe]=U[xe]===void 0&&Q!==void 0?Q[xe]:U[xe])}var xe=arguments.length-2;if(xe===1)ne.children=G;else if(1<xe){Q=Array(xe);for(var ee=0;ee<xe;ee++)Q[ee]=arguments[ee+2];ne.children=Q}return{$$typeof:e,type:I.type,key:q,ref:le,props:ne,_owner:Se}},hn.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:i,_context:I},I.Consumer=I},hn.createElement=C,hn.createFactory=function(I){var U=C.bind(null,I);return U.type=I,U},hn.createRef=function(){return{current:null}},hn.forwardRef=function(I){return{$$typeof:u,render:I}},hn.isValidElement=T,hn.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:te}},hn.memo=function(I,U){return{$$typeof:h,type:I,compare:U===void 0?null:U}},hn.startTransition=function(I){var U=F.transition;F.transition={};try{I()}finally{F.transition=U}},hn.unstable_act=z,hn.useCallback=function(I,U){return B.current.useCallback(I,U)},hn.useContext=function(I){return B.current.useContext(I)},hn.useDebugValue=function(){},hn.useDeferredValue=function(I){return B.current.useDeferredValue(I)},hn.useEffect=function(I,U){return B.current.useEffect(I,U)},hn.useId=function(){return B.current.useId()},hn.useImperativeHandle=function(I,U,G){return B.current.useImperativeHandle(I,U,G)},hn.useInsertionEffect=function(I,U){return B.current.useInsertionEffect(I,U)},hn.useLayoutEffect=function(I,U){return B.current.useLayoutEffect(I,U)},hn.useMemo=function(I,U){return B.current.useMemo(I,U)},hn.useReducer=function(I,U,G){return B.current.useReducer(I,U,G)},hn.useRef=function(I){return B.current.useRef(I)},hn.useState=function(I){return B.current.useState(I)},hn.useSyncExternalStore=function(I,U,G){return B.current.useSyncExternalStore(I,U,G)},hn.useTransition=function(){return B.current.useTransition()},hn.version="18.3.1",hn}var $b;function G6(){return $b||($b=1,X2.exports=SL()),X2.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Db;function EL(){if(Db)return Hd;Db=1;var e=G6(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,h){var p,g={},v=null,w=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(w=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(g[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:t,type:u,key:v,ref:w,props:g,_owner:a.current}}return Hd.Fragment=n,Hd.jsx=l,Hd.jsxs=l,Hd}var Hb;function CL(){return Hb||(Hb=1,q2.exports=EL()),q2.exports}var o=CL(),s=G6();const $n=Q5(s),ic=kL({__proto__:null,default:$n},[s]);var A1={},Q2={exports:{}},bs={},J2={exports:{}},eg={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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 Ob;function jL(){return Ob||(Ob=1,(function(e){function t(F,X){var z=F.length;F.push(X);e:for(;0<z;){var I=z-1>>>1,U=F[I];if(0<a(U,X))F[I]=X,F[z]=U,z=I;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var X=F[0],z=F.pop();if(z!==X){F[0]=z;e:for(var I=0,U=F.length,G=U>>>1;I<G;){var ne=2*(I+1)-1,q=F[ne],le=ne+1,Se=F[le];if(0>a(q,z))le<U&&0>a(Se,q)?(F[I]=Se,F[le]=z,I=le):(F[I]=q,F[ne]=z,I=ne);else if(le<U&&0>a(Se,z))F[I]=Se,F[le]=z,I=le;else break e}}return X}function a(F,X){var z=F.sortIndex-X.sortIndex;return z!==0?z:F.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,g=null,v=3,w=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(F){for(var X=n(h);X!==null;){if(X.callback===null)r(h);else if(X.startTime<=F)r(h),X.sortIndex=X.expirationTime,t(f,X);else break;X=n(h)}}function N(F){if(x=!1,j(F),!y)if(n(f)!==null)y=!0,te(P);else{var X=n(h);X!==null&&B(N,X.startTime-F)}}function P(F,X){y=!1,x&&(x=!1,S(C),C=-1),w=!0;var z=v;try{for(j(X),g=n(f);g!==null&&(!(g.expirationTime>X)||F&&!H());){var I=g.callback;if(typeof I=="function"){g.callback=null,v=g.priorityLevel;var U=I(g.expirationTime<=X);X=e.unstable_now(),typeof U=="function"?g.callback=U:g===n(f)&&r(f),j(X)}else r(f);g=n(f)}if(g!==null)var G=!0;else{var ne=n(h);ne!==null&&B(N,ne.startTime-X),G=!1}return G}finally{g=null,v=z,w=!1}}var $=!1,M=null,C=-1,R=5,T=-1;function H(){return!(e.unstable_now()-T<R)}function D(){if(M!==null){var F=e.unstable_now();T=F;var X=!0;try{X=M(!0,F)}finally{X?K():($=!1,M=null)}}else $=!1}var K;if(typeof E=="function")K=function(){E(D)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,Z=O.port2;O.port1.onmessage=D,K=function(){Z.postMessage(null)}}else K=function(){k(D,0)};function te(F){M=F,$||($=!0,K())}function B(F,X){C=k(function(){F(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,te(P))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var z=v;v=X;try{return F()}finally{v=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,X){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var z=v;v=F;try{return X()}finally{v=z}},e.unstable_scheduleCallback=function(F,X,z){var I=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?I+z:I):z=I,F){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=z+U,F={id:p++,callback:X,priorityLevel:F,startTime:z,expirationTime:U,sortIndex:-1},z>I?(F.sortIndex=z,t(h,F),n(f)===null&&F===n(h)&&(x?(S(C),C=-1):x=!0,B(N,z-I))):(F.sortIndex=U,t(f,F),y||w||(y=!0,te(P))),F},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(F){var X=v;return function(){var z=v;v=X;try{return F.apply(this,arguments)}finally{v=z}}}})(eg)),eg}var Ib;function AL(){return Ib||(Ib=1,J2.exports=jL()),J2.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 Fb;function NL(){if(Fb)return bs;Fb=1;var e=G6(),t=AL();function n(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,m=1;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(c,d){l(c,d),l(c+"Capture",d)}function l(c,d){for(a[c]=d,c=0;c<d.length;c++)r.add(d[c])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},g={};function v(c){return f.call(g,c)?!0:f.call(p,c)?!1:h.test(c)?g[c]=!0:(p[c]=!0,!1)}function w(c,d,m,b){if(m!==null&&m.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function y(c,d,m,b){if(d===null||typeof d>"u"||w(c,d,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function x(c,d,m,b,A,L,V){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=b,this.attributeNamespace=A,this.mustUseProperty=m,this.propertyName=c,this.type=d,this.sanitizeURL=L,this.removeEmptyString=V}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){k[c]=new x(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var d=c[0];k[d]=new x(d,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){k[c]=new x(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){k[c]=new x(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){k[c]=new x(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){k[c]=new x(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){k[c]=new x(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){k[c]=new x(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){k[c]=new x(c,5,!1,c.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new x(d,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new x(d,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var d=c.replace(S,E);k[d]=new x(d,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){k[c]=new x(c,1,!1,c.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){k[c]=new x(c,1,!1,c.toLowerCase(),null,!0,!0)});function j(c,d,m,b){var A=k.hasOwnProperty(d)?k[d]:null;(A!==null?A.type!==0:b||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,m,A,b)&&(m=null),b||A===null?v(d)&&(m===null?c.removeAttribute(d):c.setAttribute(d,""+m)):A.mustUseProperty?c[A.propertyName]=m===null?A.type===3?!1:"":m:(d=A.attributeName,b=A.attributeNamespace,m===null?c.removeAttribute(d):(A=A.type,m=A===3||A===4&&m===!0?"":""+m,b?c.setAttributeNS(b,d,m):c.setAttribute(d,m))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),$=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),F=Symbol.iterator;function X(c){return c===null||typeof c!="object"?null:(c=F&&c[F]||c["@@iterator"],typeof c=="function"?c:null)}var z=Object.assign,I;function U(c){if(I===void 0)try{throw Error()}catch(m){var d=m.stack.trim().match(/\n( *(at )?)/);I=d&&d[1]||""}return`
34
- `+I+c}var G=!1;function ne(c,d){if(!c||G)return"";G=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Ze){var b=Ze}Reflect.construct(c,[],d)}else{try{d.call()}catch(Ze){b=Ze}c.call(d.prototype)}else{try{throw Error()}catch(Ze){b=Ze}c()}}catch(Ze){if(Ze&&b&&typeof Ze.stack=="string"){for(var A=Ze.stack.split(`
35
- `),L=b.stack.split(`
36
- `),V=A.length-1,fe=L.length-1;1<=V&&0<=fe&&A[V]!==L[fe];)fe--;for(;1<=V&&0<=fe;V--,fe--)if(A[V]!==L[fe]){if(V!==1||fe!==1)do if(V--,fe--,0>fe||A[V]!==L[fe]){var ke=`
37
- `+A[V].replace(" at new "," at ");return c.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",c.displayName)),ke}while(1<=V&&0<=fe);break}}}finally{G=!1,Error.prepareStackTrace=m}return(c=c?c.displayName||c.name:"")?U(c):""}function q(c){switch(c.tag){case 5:return U(c.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return c=ne(c.type,!1),c;case 11:return c=ne(c.type.render,!1),c;case 1:return c=ne(c.type,!0),c;default:return""}}function le(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case M:return"Fragment";case $:return"Portal";case R:return"Profiler";case C:return"StrictMode";case K:return"Suspense";case O:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case H:return(c.displayName||"Context")+".Consumer";case T:return(c._context.displayName||"Context")+".Provider";case D:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Z:return d=c.displayName||null,d!==null?d:le(c.type)||"Memo";case te:d=c._payload,c=c._init;try{return le(c(d))}catch{}}return null}function Se(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(d);case 8:return d===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function Q(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function xe(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ee(c){var d=xe(c)?"checked":"value",m=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),b=""+c[d];if(!c.hasOwnProperty(d)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,L=m.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return A.call(this)},set:function(V){b=""+V,L.call(this,V)}}),Object.defineProperty(c,d,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(V){b=""+V},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function ae(c){c._valueTracker||(c._valueTracker=ee(c))}function re(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),b="";return c&&(b=xe(c)?c.checked?"true":"false":c.value),c=b,c!==m?(d.setValue(c),!0):!1}function _(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function ue(c,d){var m=d.checked;return z({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??c._wrapperState.initialChecked})}function We(c,d){var m=d.defaultValue==null?"":d.defaultValue,b=d.checked!=null?d.checked:d.defaultChecked;m=Q(d.value!=null?d.value:m),c._wrapperState={initialChecked:b,initialValue:m,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function Xe(c,d){d=d.checked,d!=null&&j(c,"checked",d,!1)}function ze(c,d){Xe(c,d);var m=Q(d.value),b=d.type;if(m!=null)b==="number"?(m===0&&c.value===""||c.value!=m)&&(c.value=""+m):c.value!==""+m&&(c.value=""+m);else if(b==="submit"||b==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?ce(c,d.type,m):d.hasOwnProperty("defaultValue")&&ce(c,d.type,Q(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function tt(c,d,m){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var b=d.type;if(!(b!=="submit"&&b!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,m||d===c.value||(c.value=d),c.defaultValue=d}m=c.name,m!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,m!==""&&(c.name=m)}function ce(c,d,m){(d!=="number"||_(c.ownerDocument)!==c)&&(m==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+m&&(c.defaultValue=""+m))}var ve=Array.isArray;function Pe(c,d,m,b){if(c=c.options,d){d={};for(var A=0;A<m.length;A++)d["$"+m[A]]=!0;for(m=0;m<c.length;m++)A=d.hasOwnProperty("$"+c[m].value),c[m].selected!==A&&(c[m].selected=A),A&&b&&(c[m].defaultSelected=!0)}else{for(m=""+Q(m),d=null,A=0;A<c.length;A++){if(c[A].value===m){c[A].selected=!0,b&&(c[A].defaultSelected=!0);return}d!==null||c[A].disabled||(d=c[A])}d!==null&&(d.selected=!0)}}function de(c,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},d,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function je(c,d){var m=d.value;if(m==null){if(m=d.children,d=d.defaultValue,m!=null){if(d!=null)throw Error(n(92));if(ve(m)){if(1<m.length)throw Error(n(93));m=m[0]}d=m}d==null&&(d=""),m=d}c._wrapperState={initialValue:Q(m)}}function Ue(c,d){var m=Q(d.value),b=Q(d.defaultValue);m!=null&&(m=""+m,m!==c.value&&(c.value=m),d.defaultValue==null&&c.defaultValue!==m&&(c.defaultValue=m)),b!=null&&(c.defaultValue=""+b)}function ye(c){var d=c.textContent;d===c._wrapperState.initialValue&&d!==""&&d!==null&&(c.value=d)}function Ee(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function be(c,d){return c==null||c==="http://www.w3.org/1999/xhtml"?Ee(d):c==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var Le,Qe=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,m,b,A){MSApp.execUnsafeLocalFunction(function(){return c(d,m,b,A)})}:c})(function(c,d){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=d;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Le.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;d.firstChild;)c.appendChild(d.firstChild)}});function Ke(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var nt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];Object.keys(nt).forEach(function(c){gt.forEach(function(d){d=d+c.charAt(0).toUpperCase()+c.substring(1),nt[d]=nt[c]})});function Pt(c,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||nt.hasOwnProperty(c)&&nt[c]?(""+d).trim():d+"px"}function Ut(c,d){c=c.style;for(var m in d)if(d.hasOwnProperty(m)){var b=m.indexOf("--")===0,A=Pt(m,d[m],b);m==="float"&&(m="cssFloat"),b?c.setProperty(m,A):c[m]=A}}var Nt=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cn(c,d){if(d){if(Nt[c]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,c));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function Fe(c,d){if(c.indexOf("-")===-1)return typeof d.is=="string";switch(c){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 pt=null;function it(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var St=null,xt=null,At=null;function Kt(c){if(c=xd(c)){if(typeof St!="function")throw Error(n(280));var d=c.stateNode;d&&(d=Vf(d),St(c.stateNode,c.type,d))}}function et(c){xt?At?At.push(c):At=[c]:xt=c}function mt(){if(xt){var c=xt,d=At;if(At=xt=null,Kt(c),d)for(c=0;c<d.length;c++)Kt(d[c])}}function ot(c,d){return c(d)}function kn(){}var ut=!1;function Gt(c,d,m){if(ut)return c(d,m);ut=!0;try{return ot(c,d,m)}finally{ut=!1,(xt!==null||At!==null)&&(kn(),mt())}}function Ft(c,d){var m=c.stateNode;if(m===null)return null;var b=Vf(m);if(b===null)return null;m=b[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(c=c.type,b=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!b;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(n(231,d,typeof m));return m}var en=!1;if(u)try{var Jt={};Object.defineProperty(Jt,"passive",{get:function(){en=!0}}),window.addEventListener("test",Jt,Jt),window.removeEventListener("test",Jt,Jt)}catch{en=!1}function se(c,d,m,b,A,L,V,fe,ke){var Ze=Array.prototype.slice.call(arguments,3);try{d.apply(m,Ze)}catch(at){this.onError(at)}}var oe=!1,we=null,ge=!1,J=null,Oe={onError:function(c){oe=!0,we=c}};function Be(c,d,m,b,A,L,V,fe,ke){oe=!1,we=null,se.apply(Oe,arguments)}function Ve(c,d,m,b,A,L,V,fe,ke){if(Be.apply(this,arguments),oe){if(oe){var Ze=we;oe=!1,we=null}else throw Error(n(198));ge||(ge=!0,J=Ze)}}function Ge(c){var d=c,m=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(m=d.return),c=d.return;while(c)}return d.tag===3?m:null}function me(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function _e(c){if(Ge(c)!==c)throw Error(n(188))}function W(c){var d=c.alternate;if(!d){if(d=Ge(c),d===null)throw Error(n(188));return d!==c?null:c}for(var m=c,b=d;;){var A=m.return;if(A===null)break;var L=A.alternate;if(L===null){if(b=A.return,b!==null){m=b;continue}break}if(A.child===L.child){for(L=A.child;L;){if(L===m)return _e(A),c;if(L===b)return _e(A),d;L=L.sibling}throw Error(n(188))}if(m.return!==b.return)m=A,b=L;else{for(var V=!1,fe=A.child;fe;){if(fe===m){V=!0,m=A,b=L;break}if(fe===b){V=!0,b=A,m=L;break}fe=fe.sibling}if(!V){for(fe=L.child;fe;){if(fe===m){V=!0,m=L,b=A;break}if(fe===b){V=!0,b=L,m=A;break}fe=fe.sibling}if(!V)throw Error(n(189))}}if(m.alternate!==b)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?c:d}function pe(c){return c=W(c),c!==null?Ie(c):null}function Ie(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=Ie(c);if(d!==null)return d;c=c.sibling}return null}var Te=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,vt=t.unstable_shouldYield,Ct=t.unstable_requestPaint,st=t.unstable_now,$t=t.unstable_getCurrentPriorityLevel,An=t.unstable_ImmediatePriority,Y=t.unstable_UserBlockingPriority,he=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,dt=null,wt=null;function Zt(c){if(wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(dt,c,void 0,(c.current.flags&128)===128)}catch{}}var Ht=Math.clz32?Math.clz32:wn,pn=Math.log,Wt=Math.LN2;function wn(c){return c>>>=0,c===0?32:31-(pn(c)/Wt|0)|0}var sn=64,In=4194304;function Dt(c){switch(c&-c){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: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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function On(c,d){var m=c.pendingLanes;if(m===0)return 0;var b=0,A=c.suspendedLanes,L=c.pingedLanes,V=m&268435455;if(V!==0){var fe=V&~A;fe!==0?b=Dt(fe):(L&=V,L!==0&&(b=Dt(L)))}else V=m&~A,V!==0?b=Dt(V):L!==0&&(b=Dt(L));if(b===0)return 0;if(d!==0&&d!==b&&(d&A)===0&&(A=b&-b,L=d&-d,A>=L||A===16&&(L&4194240)!==0))return d;if((b&4)!==0&&(b|=m&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=b;0<d;)m=31-Ht(d),A=1<<m,b|=c[m],d&=~A;return b}function Et(c,d){switch(c){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64: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 d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hn(c,d){for(var m=c.suspendedLanes,b=c.pingedLanes,A=c.expirationTimes,L=c.pendingLanes;0<L;){var V=31-Ht(L),fe=1<<V,ke=A[V];ke===-1?((fe&m)===0||(fe&b)!==0)&&(A[V]=Et(fe,d)):ke<=d&&(c.expiredLanes|=fe),L&=~fe}}function Ot(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function tn(){var c=sn;return sn<<=1,(sn&4194240)===0&&(sn=64),c}function Vn(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function ur(c,d,m){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-Ht(d),c[d]=m}function Zr(c,d){var m=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var b=c.eventTimes;for(c=c.expirationTimes;0<m;){var A=31-Ht(m),L=1<<A;d[A]=0,b[A]=-1,c[A]=-1,m&=~L}}function zn(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var b=31-Ht(m),A=1<<b;A&d|c[b]&d&&(c[b]|=d),m&=~A}}var yn=0;function Va(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var ko,So,ul,wa,Eo,ya=!1,ba=[],Vr=null,ts=null,Gs=null,za=new Map,Pr=new Map,Lr=[],Ba="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 submit".split(" ");function ci(c,d){switch(c){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":Gs=null;break;case"pointerover":case"pointerout":za.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pr.delete(d.pointerId)}}function ie(c,d,m,b,A,L){return c===null||c.nativeEvent!==L?(c={blockedOn:d,domEventName:m,eventSystemFlags:b,nativeEvent:L,targetContainers:[A]},d!==null&&(d=xd(d),d!==null&&So(d)),c):(c.eventSystemFlags|=b,d=c.targetContainers,A!==null&&d.indexOf(A)===-1&&d.push(A),c)}function De(c,d,m,b,A){switch(d){case"focusin":return Vr=ie(Vr,c,d,m,b,A),!0;case"dragenter":return ts=ie(ts,c,d,m,b,A),!0;case"mouseover":return Gs=ie(Gs,c,d,m,b,A),!0;case"pointerover":var L=A.pointerId;return za.set(L,ie(za.get(L)||null,c,d,m,b,A)),!0;case"gotpointercapture":return L=A.pointerId,Pr.set(L,ie(Pr.get(L)||null,c,d,m,b,A)),!0}return!1}function Je(c){var d=pl(c.target);if(d!==null){var m=Ge(d);if(m!==null){if(d=m.tag,d===13){if(d=me(m),d!==null){c.blockedOn=d,Eo(c.priority,function(){ul(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function Vt(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var m=Ac(c.domEventName,c.eventSystemFlags,d[0],c.nativeEvent);if(m===null){m=c.nativeEvent;var b=new m.constructor(m.type,m);pt=b,m.target.dispatchEvent(b),pt=null}else return d=xd(m),d!==null&&So(d),c.blockedOn=m,!1;d.shift()}return!0}function Yt(c,d,m){Vt(c)&&m.delete(d)}function Bn(){ya=!1,Vr!==null&&Vt(Vr)&&(Vr=null),ts!==null&&Vt(ts)&&(ts=null),Gs!==null&&Vt(Gs)&&(Gs=null),za.forEach(Yt),Pr.forEach(Yt)}function Nn(c,d){c.blockedOn===d&&(c.blockedOn=null,ya||(ya=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bn)))}function xn(c){function d(A){return Nn(A,c)}if(0<ba.length){Nn(ba[0],c);for(var m=1;m<ba.length;m++){var b=ba[m];b.blockedOn===c&&(b.blockedOn=null)}}for(Vr!==null&&Nn(Vr,c),ts!==null&&Nn(ts,c),Gs!==null&&Nn(Gs,c),za.forEach(d),Pr.forEach(d),m=0;m<Lr.length;m++)b=Lr[m],b.blockedOn===c&&(b.blockedOn=null);for(;0<Lr.length&&(m=Lr[0],m.blockedOn===null);)Je(m),m.blockedOn===null&&Lr.shift()}var Sn=N.ReactCurrentBatchConfig,hs=!0;function cd(c,d,m,b){var A=yn,L=Sn.transition;Sn.transition=null;try{yn=1,di(c,d,m,b)}finally{yn=A,Sn.transition=L}}function ui(c,d,m,b){var A=yn,L=Sn.transition;Sn.transition=null;try{yn=4,di(c,d,m,b)}finally{yn=A,Sn.transition=L}}function di(c,d,m,b){if(hs){var A=Ac(c,d,m,b);if(A===null)Fm(c,d,b,dl,m),ci(c,b);else if(De(A,c,d,m,b))b.stopPropagation();else if(ci(c,b),d&4&&-1<Ba.indexOf(c)){for(;A!==null;){var L=xd(A);if(L!==null&&ko(L),L=Ac(c,d,m,b),L===null&&Fm(c,d,b,dl,m),L===A)break;A=L}A!==null&&b.stopPropagation()}else Fm(c,d,b,null,m)}}var dl=null;function Ac(c,d,m,b){if(dl=null,c=it(b),c=pl(c),c!==null)if(d=Ge(c),d===null)c=null;else if(m=d.tag,m===13){if(c=me(d),c!==null)return c;c=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null);return dl=c,null}function ud(c){switch(c){case"cancel":case"click":case"close":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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($t()){case An:return 1;case Y:return 4;case he:case Me:return 16;case Ye:return 536870912;default:return 16}default:return 16}}var Ys=null,Nc=null,fl=null;function dd(){if(fl)return fl;var c,d=Nc,m=d.length,b,A="value"in Ys?Ys.value:Ys.textContent,L=A.length;for(c=0;c<m&&d[c]===A[c];c++);var V=m-c;for(b=1;b<=V&&d[m-b]===A[L-b];b++);return fl=A.slice(c,1<b?1-b:void 0)}function hl(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function Ce(){return!0}function ht(){return!1}function It(c){function d(m,b,A,L,V){this._reactName=m,this._targetInst=A,this.type=b,this.nativeEvent=L,this.target=V,this.currentTarget=null;for(var fe in c)c.hasOwnProperty(fe)&&(m=c[fe],this[fe]=m?m(L):L[fe]);return this.isDefaultPrevented=(L.defaultPrevented!=null?L.defaultPrevented:L.returnValue===!1)?Ce:ht,this.isPropagationStopped=ht,this}return z(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Ce)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Ce)},persist:function(){},isPersistent:Ce}),d}var qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=It(qt),mn=z({},qt,{view:0,detail:0}),ps=It(mn),Xt,Fn,Tn,Ua=z({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nm,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Tn&&(Tn&&c.type==="mousemove"?(Xt=c.screenX-Tn.screenX,Fn=c.screenY-Tn.screenY):Fn=Xt=0,Tn=c),Xt)},movementY:function(c){return"movementY"in c?c.movementY:Fn}}),Mc=It(Ua),xa=z({},Ua,{dataTransfer:0}),Tf=It(xa),$f=z({},mn,{relatedTarget:0}),Am=It($f),JR=z({},qt,{animationName:0,elapsedTime:0,pseudoElement:0}),eP=It(JR),tP=z({},qt,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),nP=It(tP),rP=z({},qt,{data:0}),bw=It(rP),sP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aP={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"},oP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iP(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=oP[c])?!!d[c]:!1}function Nm(){return iP}var lP=z({},mn,{key:function(c){if(c.key){var d=sP[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=hl(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?aP[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nm,charCode:function(c){return c.type==="keypress"?hl(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?hl(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),cP=It(lP),uP=z({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xw=It(uP),dP=z({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nm}),fP=It(dP),hP=z({},qt,{propertyName:0,elapsedTime:0,pseudoElement:0}),pP=It(hP),mP=z({},Ua,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),gP=It(mP),vP=[9,13,27,32],Mm=u&&"CompositionEvent"in window,fd=null;u&&"documentMode"in document&&(fd=document.documentMode);var wP=u&&"TextEvent"in window&&!fd,kw=u&&(!Mm||fd&&8<fd&&11>=fd),Sw=" ",Ew=!1;function Cw(c,d){switch(c){case"keyup":return vP.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jw(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Rc=!1;function yP(c,d){switch(c){case"compositionend":return jw(d);case"keypress":return d.which!==32?null:(Ew=!0,Sw);case"textInput":return c=d.data,c===Sw&&Ew?null:c;default:return null}}function bP(c,d){if(Rc)return c==="compositionend"||!Mm&&Cw(c,d)?(c=dd(),fl=Nc=Ys=null,Rc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return kw&&d.locale!=="ko"?null:d.data;default:return null}}var xP={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 Aw(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!xP[c.type]:d==="textarea"}function Nw(c,d,m,b){et(b),d=Ff(d,"onChange"),0<d.length&&(m=new fn("onChange","change",null,m,b),c.push({event:m,listeners:d}))}var hd=null,pd=null;function kP(c){Ww(c,0)}function Df(c){var d=Dc(c);if(re(d))return c}function SP(c,d){if(c==="change")return d}var Mw=!1;if(u){var Rm;if(u){var Pm="oninput"in document;if(!Pm){var Rw=document.createElement("div");Rw.setAttribute("oninput","return;"),Pm=typeof Rw.oninput=="function"}Rm=Pm}else Rm=!1;Mw=Rm&&(!document.documentMode||9<document.documentMode)}function Pw(){hd&&(hd.detachEvent("onpropertychange",Lw),pd=hd=null)}function Lw(c){if(c.propertyName==="value"&&Df(pd)){var d=[];Nw(d,pd,c,it(c)),Gt(kP,d)}}function EP(c,d,m){c==="focusin"?(Pw(),hd=d,pd=m,hd.attachEvent("onpropertychange",Lw)):c==="focusout"&&Pw()}function CP(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Df(pd)}function jP(c,d){if(c==="click")return Df(d)}function AP(c,d){if(c==="input"||c==="change")return Df(d)}function NP(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var ka=typeof Object.is=="function"?Object.is:NP;function md(c,d){if(ka(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),b=Object.keys(d);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var A=m[b];if(!f.call(d,A)||!ka(c[A],d[A]))return!1}return!0}function Tw(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function $w(c,d){var m=Tw(c);c=0;for(var b;m;){if(m.nodeType===3){if(b=c+m.textContent.length,c<=d&&b>=d)return{node:m,offset:d-c};c=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Tw(m)}}function Dw(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?Dw(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function Hw(){for(var c=window,d=_();d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=_(c.document)}return d}function Lm(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}function MP(c){var d=Hw(),m=c.focusedElem,b=c.selectionRange;if(d!==m&&m&&m.ownerDocument&&Dw(m.ownerDocument.documentElement,m)){if(b!==null&&Lm(m)){if(d=b.start,c=b.end,c===void 0&&(c=d),"selectionStart"in m)m.selectionStart=d,m.selectionEnd=Math.min(c,m.value.length);else if(c=(d=m.ownerDocument||document)&&d.defaultView||window,c.getSelection){c=c.getSelection();var A=m.textContent.length,L=Math.min(b.start,A);b=b.end===void 0?L:Math.min(b.end,A),!c.extend&&L>b&&(A=b,b=L,L=A),A=$w(m,L);var V=$w(m,b);A&&V&&(c.rangeCount!==1||c.anchorNode!==A.node||c.anchorOffset!==A.offset||c.focusNode!==V.node||c.focusOffset!==V.offset)&&(d=d.createRange(),d.setStart(A.node,A.offset),c.removeAllRanges(),L>b?(c.addRange(d),c.extend(V.node,V.offset)):(d.setEnd(V.node,V.offset),c.addRange(d)))}}for(d=[],c=m;c=c.parentNode;)c.nodeType===1&&d.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<d.length;m++)c=d[m],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var RP=u&&"documentMode"in document&&11>=document.documentMode,Pc=null,Tm=null,gd=null,$m=!1;function Ow(c,d,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;$m||Pc==null||Pc!==_(b)||(b=Pc,"selectionStart"in b&&Lm(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),gd&&md(gd,b)||(gd=b,b=Ff(Tm,"onSelect"),0<b.length&&(d=new fn("onSelect","select",null,d,m),c.push({event:d,listeners:b}),d.target=Pc)))}function Hf(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var Lc={animationend:Hf("Animation","AnimationEnd"),animationiteration:Hf("Animation","AnimationIteration"),animationstart:Hf("Animation","AnimationStart"),transitionend:Hf("Transition","TransitionEnd")},Dm={},Iw={};u&&(Iw=document.createElement("div").style,"AnimationEvent"in window||(delete Lc.animationend.animation,delete Lc.animationiteration.animation,delete Lc.animationstart.animation),"TransitionEvent"in window||delete Lc.transitionend.transition);function Of(c){if(Dm[c])return Dm[c];if(!Lc[c])return c;var d=Lc[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in Iw)return Dm[c]=d[m];return c}var Fw=Of("animationend"),_w=Of("animationiteration"),Zw=Of("animationstart"),Vw=Of("transitionend"),zw=new Map,Bw="abort auxClick 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(" ");function fi(c,d){zw.set(c,d),i(d,[c])}for(var Hm=0;Hm<Bw.length;Hm++){var Om=Bw[Hm],PP=Om.toLowerCase(),LP=Om[0].toUpperCase()+Om.slice(1);fi(PP,"on"+LP)}fi(Fw,"onAnimationEnd"),fi(_w,"onAnimationIteration"),fi(Zw,"onAnimationStart"),fi("dblclick","onDoubleClick"),fi("focusin","onFocus"),fi("focusout","onBlur"),fi(Vw,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vd="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(" "),TP=new Set("cancel close invalid load scroll toggle".split(" ").concat(vd));function Uw(c,d,m){var b=c.type||"unknown-event";c.currentTarget=m,Ve(b,d,void 0,c),c.currentTarget=null}function Ww(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var b=c[m],A=b.event;b=b.listeners;e:{var L=void 0;if(d)for(var V=b.length-1;0<=V;V--){var fe=b[V],ke=fe.instance,Ze=fe.currentTarget;if(fe=fe.listener,ke!==L&&A.isPropagationStopped())break e;Uw(A,fe,Ze),L=ke}else for(V=0;V<b.length;V++){if(fe=b[V],ke=fe.instance,Ze=fe.currentTarget,fe=fe.listener,ke!==L&&A.isPropagationStopped())break e;Uw(A,fe,Ze),L=ke}}}if(ge)throw c=J,ge=!1,J=null,c}function Gn(c,d){var m=d[Um];m===void 0&&(m=d[Um]=new Set);var b=c+"__bubble";m.has(b)||(Kw(d,c,2,!1),m.add(b))}function Im(c,d,m){var b=0;d&&(b|=4),Kw(m,c,b,d)}var If="_reactListening"+Math.random().toString(36).slice(2);function wd(c){if(!c[If]){c[If]=!0,r.forEach(function(m){m!=="selectionchange"&&(TP.has(m)||Im(m,!1,c),Im(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[If]||(d[If]=!0,Im("selectionchange",!1,d))}}function Kw(c,d,m,b){switch(ud(d)){case 1:var A=cd;break;case 4:A=ui;break;default:A=di}m=A.bind(null,d,m,c),A=void 0,!en||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(A=!0),b?A!==void 0?c.addEventListener(d,m,{capture:!0,passive:A}):c.addEventListener(d,m,!0):A!==void 0?c.addEventListener(d,m,{passive:A}):c.addEventListener(d,m,!1)}function Fm(c,d,m,b,A){var L=b;if((d&1)===0&&(d&2)===0&&b!==null)e:for(;;){if(b===null)return;var V=b.tag;if(V===3||V===4){var fe=b.stateNode.containerInfo;if(fe===A||fe.nodeType===8&&fe.parentNode===A)break;if(V===4)for(V=b.return;V!==null;){var ke=V.tag;if((ke===3||ke===4)&&(ke=V.stateNode.containerInfo,ke===A||ke.nodeType===8&&ke.parentNode===A))return;V=V.return}for(;fe!==null;){if(V=pl(fe),V===null)return;if(ke=V.tag,ke===5||ke===6){b=L=V;continue e}fe=fe.parentNode}}b=b.return}Gt(function(){var Ze=L,at=it(m),lt=[];e:{var rt=zw.get(c);if(rt!==void 0){var jt=fn,Rt=c;switch(c){case"keypress":if(hl(m)===0)break e;case"keydown":case"keyup":jt=cP;break;case"focusin":Rt="focus",jt=Am;break;case"focusout":Rt="blur",jt=Am;break;case"beforeblur":case"afterblur":jt=Am;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":jt=Mc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":jt=Tf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":jt=fP;break;case Fw:case _w:case Zw:jt=eP;break;case Vw:jt=pP;break;case"scroll":jt=ps;break;case"wheel":jt=gP;break;case"copy":case"cut":case"paste":jt=nP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":jt=xw}var Lt=(d&4)!==0,ir=!Lt&&c==="scroll",$e=Lt?rt!==null?rt+"Capture":null:rt;Lt=[];for(var Ae=Ze,He;Ae!==null;){He=Ae;var ft=He.stateNode;if(He.tag===5&&ft!==null&&(He=ft,$e!==null&&(ft=Ft(Ae,$e),ft!=null&&Lt.push(yd(Ae,ft,He)))),ir)break;Ae=Ae.return}0<Lt.length&&(rt=new jt(rt,Rt,null,m,at),lt.push({event:rt,listeners:Lt}))}}if((d&7)===0){e:{if(rt=c==="mouseover"||c==="pointerover",jt=c==="mouseout"||c==="pointerout",rt&&m!==pt&&(Rt=m.relatedTarget||m.fromElement)&&(pl(Rt)||Rt[Co]))break e;if((jt||rt)&&(rt=at.window===at?at:(rt=at.ownerDocument)?rt.defaultView||rt.parentWindow:window,jt?(Rt=m.relatedTarget||m.toElement,jt=Ze,Rt=Rt?pl(Rt):null,Rt!==null&&(ir=Ge(Rt),Rt!==ir||Rt.tag!==5&&Rt.tag!==6)&&(Rt=null)):(jt=null,Rt=Ze),jt!==Rt)){if(Lt=Mc,ft="onMouseLeave",$e="onMouseEnter",Ae="mouse",(c==="pointerout"||c==="pointerover")&&(Lt=xw,ft="onPointerLeave",$e="onPointerEnter",Ae="pointer"),ir=jt==null?rt:Dc(jt),He=Rt==null?rt:Dc(Rt),rt=new Lt(ft,Ae+"leave",jt,m,at),rt.target=ir,rt.relatedTarget=He,ft=null,pl(at)===Ze&&(Lt=new Lt($e,Ae+"enter",Rt,m,at),Lt.target=He,Lt.relatedTarget=ir,ft=Lt),ir=ft,jt&&Rt)t:{for(Lt=jt,$e=Rt,Ae=0,He=Lt;He;He=Tc(He))Ae++;for(He=0,ft=$e;ft;ft=Tc(ft))He++;for(;0<Ae-He;)Lt=Tc(Lt),Ae--;for(;0<He-Ae;)$e=Tc($e),He--;for(;Ae--;){if(Lt===$e||$e!==null&&Lt===$e.alternate)break t;Lt=Tc(Lt),$e=Tc($e)}Lt=null}else Lt=null;jt!==null&&Gw(lt,rt,jt,Lt,!1),Rt!==null&&ir!==null&&Gw(lt,ir,Rt,Lt,!0)}}e:{if(rt=Ze?Dc(Ze):window,jt=rt.nodeName&&rt.nodeName.toLowerCase(),jt==="select"||jt==="input"&&rt.type==="file")var Tt=SP;else if(Aw(rt))if(Mw)Tt=AP;else{Tt=CP;var zt=EP}else(jt=rt.nodeName)&&jt.toLowerCase()==="input"&&(rt.type==="checkbox"||rt.type==="radio")&&(Tt=jP);if(Tt&&(Tt=Tt(c,Ze))){Nw(lt,Tt,m,at);break e}zt&&zt(c,rt,Ze),c==="focusout"&&(zt=rt._wrapperState)&&zt.controlled&&rt.type==="number"&&ce(rt,"number",rt.value)}switch(zt=Ze?Dc(Ze):window,c){case"focusin":(Aw(zt)||zt.contentEditable==="true")&&(Pc=zt,Tm=Ze,gd=null);break;case"focusout":gd=Tm=Pc=null;break;case"mousedown":$m=!0;break;case"contextmenu":case"mouseup":case"dragend":$m=!1,Ow(lt,m,at);break;case"selectionchange":if(RP)break;case"keydown":case"keyup":Ow(lt,m,at)}var Bt;if(Mm)e:{switch(c){case"compositionstart":var Qt="onCompositionStart";break e;case"compositionend":Qt="onCompositionEnd";break e;case"compositionupdate":Qt="onCompositionUpdate";break e}Qt=void 0}else Rc?Cw(c,m)&&(Qt="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(Qt="onCompositionStart");Qt&&(kw&&m.locale!=="ko"&&(Rc||Qt!=="onCompositionStart"?Qt==="onCompositionEnd"&&Rc&&(Bt=dd()):(Ys=at,Nc="value"in Ys?Ys.value:Ys.textContent,Rc=!0)),zt=Ff(Ze,Qt),0<zt.length&&(Qt=new bw(Qt,c,null,m,at),lt.push({event:Qt,listeners:zt}),Bt?Qt.data=Bt:(Bt=jw(m),Bt!==null&&(Qt.data=Bt)))),(Bt=wP?yP(c,m):bP(c,m))&&(Ze=Ff(Ze,"onBeforeInput"),0<Ze.length&&(at=new bw("onBeforeInput","beforeinput",null,m,at),lt.push({event:at,listeners:Ze}),at.data=Bt))}Ww(lt,d)})}function yd(c,d,m){return{instance:c,listener:d,currentTarget:m}}function Ff(c,d){for(var m=d+"Capture",b=[];c!==null;){var A=c,L=A.stateNode;A.tag===5&&L!==null&&(A=L,L=Ft(c,m),L!=null&&b.unshift(yd(c,L,A)),L=Ft(c,d),L!=null&&b.push(yd(c,L,A))),c=c.return}return b}function Tc(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function Gw(c,d,m,b,A){for(var L=d._reactName,V=[];m!==null&&m!==b;){var fe=m,ke=fe.alternate,Ze=fe.stateNode;if(ke!==null&&ke===b)break;fe.tag===5&&Ze!==null&&(fe=Ze,A?(ke=Ft(m,L),ke!=null&&V.unshift(yd(m,ke,fe))):A||(ke=Ft(m,L),ke!=null&&V.push(yd(m,ke,fe)))),m=m.return}V.length!==0&&c.push({event:d,listeners:V})}var $P=/\r\n?/g,DP=/\u0000|\uFFFD/g;function Yw(c){return(typeof c=="string"?c:""+c).replace($P,`
38
- `).replace(DP,"")}function _f(c,d,m){if(d=Yw(d),Yw(c)!==d&&m)throw Error(n(425))}function Zf(){}var _m=null,Zm=null;function Vm(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var zm=typeof setTimeout=="function"?setTimeout:void 0,HP=typeof clearTimeout=="function"?clearTimeout:void 0,qw=typeof Promise=="function"?Promise:void 0,OP=typeof queueMicrotask=="function"?queueMicrotask:typeof qw<"u"?function(c){return qw.resolve(null).then(c).catch(IP)}:zm;function IP(c){setTimeout(function(){throw c})}function Bm(c,d){var m=d,b=0;do{var A=m.nextSibling;if(c.removeChild(m),A&&A.nodeType===8)if(m=A.data,m==="/$"){if(b===0){c.removeChild(A),xn(d);return}b--}else m!=="$"&&m!=="$?"&&m!=="$!"||b++;m=A}while(m);xn(d)}function hi(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return c}function Xw(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"){if(d===0)return c;d--}else m==="/$"&&d++}c=c.previousSibling}return null}var $c=Math.random().toString(36).slice(2),Wa="__reactFiber$"+$c,bd="__reactProps$"+$c,Co="__reactContainer$"+$c,Um="__reactEvents$"+$c,FP="__reactListeners$"+$c,_P="__reactHandles$"+$c;function pl(c){var d=c[Wa];if(d)return d;for(var m=c.parentNode;m;){if(d=m[Co]||m[Wa]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=Xw(c);c!==null;){if(m=c[Wa])return m;c=Xw(c)}return d}c=m,m=c.parentNode}return null}function xd(c){return c=c[Wa]||c[Co],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function Dc(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function Vf(c){return c[bd]||null}var Wm=[],Hc=-1;function pi(c){return{current:c}}function Yn(c){0>Hc||(c.current=Wm[Hc],Wm[Hc]=null,Hc--)}function Un(c,d){Hc++,Wm[Hc]=c.current,c.current=d}var mi={},zr=pi(mi),ms=pi(!1),ml=mi;function Oc(c,d){var m=c.type.contextTypes;if(!m)return mi;var b=c.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===d)return b.__reactInternalMemoizedMaskedChildContext;var A={},L;for(L in m)A[L]=d[L];return b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=A),A}function gs(c){return c=c.childContextTypes,c!=null}function zf(){Yn(ms),Yn(zr)}function Qw(c,d,m){if(zr.current!==mi)throw Error(n(168));Un(zr,d),Un(ms,m)}function Jw(c,d,m){var b=c.stateNode;if(d=d.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var A in b)if(!(A in d))throw Error(n(108,Se(c)||"Unknown",A));return z({},m,b)}function Bf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||mi,ml=zr.current,Un(zr,c),Un(ms,ms.current),!0}function ey(c,d,m){var b=c.stateNode;if(!b)throw Error(n(169));m?(c=Jw(c,d,ml),b.__reactInternalMemoizedMergedChildContext=c,Yn(ms),Yn(zr),Un(zr,c)):Yn(ms),Un(ms,m)}var jo=null,Uf=!1,Km=!1;function ty(c){jo===null?jo=[c]:jo.push(c)}function ZP(c){Uf=!0,ty(c)}function gi(){if(!Km&&jo!==null){Km=!0;var c=0,d=yn;try{var m=jo;for(yn=1;c<m.length;c++){var b=m[c];do b=b(!0);while(b!==null)}jo=null,Uf=!1}catch(A){throw jo!==null&&(jo=jo.slice(c+1)),Te(An,gi),A}finally{yn=d,Km=!1}}return null}var Ic=[],Fc=0,Wf=null,Kf=0,qs=[],Xs=0,gl=null,Ao=1,No="";function vl(c,d){Ic[Fc++]=Kf,Ic[Fc++]=Wf,Wf=c,Kf=d}function ny(c,d,m){qs[Xs++]=Ao,qs[Xs++]=No,qs[Xs++]=gl,gl=c;var b=Ao;c=No;var A=32-Ht(b)-1;b&=~(1<<A),m+=1;var L=32-Ht(d)+A;if(30<L){var V=A-A%5;L=(b&(1<<V)-1).toString(32),b>>=V,A-=V,Ao=1<<32-Ht(d)+A|m<<A|b,No=L+c}else Ao=1<<L|m<<A|b,No=c}function Gm(c){c.return!==null&&(vl(c,1),ny(c,1,0))}function Ym(c){for(;c===Wf;)Wf=Ic[--Fc],Ic[Fc]=null,Kf=Ic[--Fc],Ic[Fc]=null;for(;c===gl;)gl=qs[--Xs],qs[Xs]=null,No=qs[--Xs],qs[Xs]=null,Ao=qs[--Xs],qs[Xs]=null}var $s=null,Ds=null,Xn=!1,Sa=null;function ry(c,d){var m=ta(5,null,null,0);m.elementType="DELETED",m.stateNode=d,m.return=c,d=c.deletions,d===null?(c.deletions=[m],c.flags|=16):d.push(m)}function sy(c,d){switch(c.tag){case 5:var m=c.type;return d=d.nodeType!==1||m.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,$s=c,Ds=hi(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,$s=c,Ds=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(m=gl!==null?{id:Ao,overflow:No}:null,c.memoizedState={dehydrated:d,treeContext:m,retryLane:1073741824},m=ta(18,null,null,0),m.stateNode=d,m.return=c,c.child=m,$s=c,Ds=null,!0):!1;default:return!1}}function qm(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Xm(c){if(Xn){var d=Ds;if(d){var m=d;if(!sy(c,d)){if(qm(c))throw Error(n(418));d=hi(m.nextSibling);var b=$s;d&&sy(c,d)?ry(b,m):(c.flags=c.flags&-4097|2,Xn=!1,$s=c)}}else{if(qm(c))throw Error(n(418));c.flags=c.flags&-4097|2,Xn=!1,$s=c}}}function ay(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;$s=c}function Gf(c){if(c!==$s)return!1;if(!Xn)return ay(c),Xn=!0,!1;var d;if((d=c.tag!==3)&&!(d=c.tag!==5)&&(d=c.type,d=d!=="head"&&d!=="body"&&!Vm(c.type,c.memoizedProps)),d&&(d=Ds)){if(qm(c))throw oy(),Error(n(418));for(;d;)ry(c,d),d=hi(d.nextSibling)}if(ay(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));e:{for(c=c.nextSibling,d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"){if(d===0){Ds=hi(c.nextSibling);break e}d--}else m!=="$"&&m!=="$!"&&m!=="$?"||d++}c=c.nextSibling}Ds=null}}else Ds=$s?hi(c.stateNode.nextSibling):null;return!0}function oy(){for(var c=Ds;c;)c=hi(c.nextSibling)}function _c(){Ds=$s=null,Xn=!1}function Qm(c){Sa===null?Sa=[c]:Sa.push(c)}var VP=N.ReactCurrentBatchConfig;function kd(c,d,m){if(c=m.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var b=m.stateNode}if(!b)throw Error(n(147,c));var A=b,L=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===L?d.ref:(d=function(V){var fe=A.refs;V===null?delete fe[L]:fe[L]=V},d._stringRef=L,d)}if(typeof c!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,c))}return c}function Yf(c,d){throw c=Object.prototype.toString.call(d),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function iy(c){var d=c._init;return d(c._payload)}function ly(c){function d($e,Ae){if(c){var He=$e.deletions;He===null?($e.deletions=[Ae],$e.flags|=16):He.push(Ae)}}function m($e,Ae){if(!c)return null;for(;Ae!==null;)d($e,Ae),Ae=Ae.sibling;return null}function b($e,Ae){for($e=new Map;Ae!==null;)Ae.key!==null?$e.set(Ae.key,Ae):$e.set(Ae.index,Ae),Ae=Ae.sibling;return $e}function A($e,Ae){return $e=Ei($e,Ae),$e.index=0,$e.sibling=null,$e}function L($e,Ae,He){return $e.index=He,c?(He=$e.alternate,He!==null?(He=He.index,He<Ae?($e.flags|=2,Ae):He):($e.flags|=2,Ae)):($e.flags|=1048576,Ae)}function V($e){return c&&$e.alternate===null&&($e.flags|=2),$e}function fe($e,Ae,He,ft){return Ae===null||Ae.tag!==6?(Ae=z2(He,$e.mode,ft),Ae.return=$e,Ae):(Ae=A(Ae,He),Ae.return=$e,Ae)}function ke($e,Ae,He,ft){var Tt=He.type;return Tt===M?at($e,Ae,He.props.children,ft,He.key):Ae!==null&&(Ae.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===te&&iy(Tt)===Ae.type)?(ft=A(Ae,He.props),ft.ref=kd($e,Ae,He),ft.return=$e,ft):(ft=y1(He.type,He.key,He.props,null,$e.mode,ft),ft.ref=kd($e,Ae,He),ft.return=$e,ft)}function Ze($e,Ae,He,ft){return Ae===null||Ae.tag!==4||Ae.stateNode.containerInfo!==He.containerInfo||Ae.stateNode.implementation!==He.implementation?(Ae=B2(He,$e.mode,ft),Ae.return=$e,Ae):(Ae=A(Ae,He.children||[]),Ae.return=$e,Ae)}function at($e,Ae,He,ft,Tt){return Ae===null||Ae.tag!==7?(Ae=Cl(He,$e.mode,ft,Tt),Ae.return=$e,Ae):(Ae=A(Ae,He),Ae.return=$e,Ae)}function lt($e,Ae,He){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number")return Ae=z2(""+Ae,$e.mode,He),Ae.return=$e,Ae;if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case P:return He=y1(Ae.type,Ae.key,Ae.props,null,$e.mode,He),He.ref=kd($e,null,Ae),He.return=$e,He;case $:return Ae=B2(Ae,$e.mode,He),Ae.return=$e,Ae;case te:var ft=Ae._init;return lt($e,ft(Ae._payload),He)}if(ve(Ae)||X(Ae))return Ae=Cl(Ae,$e.mode,He,null),Ae.return=$e,Ae;Yf($e,Ae)}return null}function rt($e,Ae,He,ft){var Tt=Ae!==null?Ae.key:null;if(typeof He=="string"&&He!==""||typeof He=="number")return Tt!==null?null:fe($e,Ae,""+He,ft);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case P:return He.key===Tt?ke($e,Ae,He,ft):null;case $:return He.key===Tt?Ze($e,Ae,He,ft):null;case te:return Tt=He._init,rt($e,Ae,Tt(He._payload),ft)}if(ve(He)||X(He))return Tt!==null?null:at($e,Ae,He,ft,null);Yf($e,He)}return null}function jt($e,Ae,He,ft,Tt){if(typeof ft=="string"&&ft!==""||typeof ft=="number")return $e=$e.get(He)||null,fe(Ae,$e,""+ft,Tt);if(typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case P:return $e=$e.get(ft.key===null?He:ft.key)||null,ke(Ae,$e,ft,Tt);case $:return $e=$e.get(ft.key===null?He:ft.key)||null,Ze(Ae,$e,ft,Tt);case te:var zt=ft._init;return jt($e,Ae,He,zt(ft._payload),Tt)}if(ve(ft)||X(ft))return $e=$e.get(He)||null,at(Ae,$e,ft,Tt,null);Yf(Ae,ft)}return null}function Rt($e,Ae,He,ft){for(var Tt=null,zt=null,Bt=Ae,Qt=Ae=0,jr=null;Bt!==null&&Qt<He.length;Qt++){Bt.index>Qt?(jr=Bt,Bt=null):jr=Bt.sibling;var Mn=rt($e,Bt,He[Qt],ft);if(Mn===null){Bt===null&&(Bt=jr);break}c&&Bt&&Mn.alternate===null&&d($e,Bt),Ae=L(Mn,Ae,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn,Bt=jr}if(Qt===He.length)return m($e,Bt),Xn&&vl($e,Qt),Tt;if(Bt===null){for(;Qt<He.length;Qt++)Bt=lt($e,He[Qt],ft),Bt!==null&&(Ae=L(Bt,Ae,Qt),zt===null?Tt=Bt:zt.sibling=Bt,zt=Bt);return Xn&&vl($e,Qt),Tt}for(Bt=b($e,Bt);Qt<He.length;Qt++)jr=jt(Bt,$e,Qt,He[Qt],ft),jr!==null&&(c&&jr.alternate!==null&&Bt.delete(jr.key===null?Qt:jr.key),Ae=L(jr,Ae,Qt),zt===null?Tt=jr:zt.sibling=jr,zt=jr);return c&&Bt.forEach(function(Ci){return d($e,Ci)}),Xn&&vl($e,Qt),Tt}function Lt($e,Ae,He,ft){var Tt=X(He);if(typeof Tt!="function")throw Error(n(150));if(He=Tt.call(He),He==null)throw Error(n(151));for(var zt=Tt=null,Bt=Ae,Qt=Ae=0,jr=null,Mn=He.next();Bt!==null&&!Mn.done;Qt++,Mn=He.next()){Bt.index>Qt?(jr=Bt,Bt=null):jr=Bt.sibling;var Ci=rt($e,Bt,Mn.value,ft);if(Ci===null){Bt===null&&(Bt=jr);break}c&&Bt&&Ci.alternate===null&&d($e,Bt),Ae=L(Ci,Ae,Qt),zt===null?Tt=Ci:zt.sibling=Ci,zt=Ci,Bt=jr}if(Mn.done)return m($e,Bt),Xn&&vl($e,Qt),Tt;if(Bt===null){for(;!Mn.done;Qt++,Mn=He.next())Mn=lt($e,Mn.value,ft),Mn!==null&&(Ae=L(Mn,Ae,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn);return Xn&&vl($e,Qt),Tt}for(Bt=b($e,Bt);!Mn.done;Qt++,Mn=He.next())Mn=jt(Bt,$e,Qt,Mn.value,ft),Mn!==null&&(c&&Mn.alternate!==null&&Bt.delete(Mn.key===null?Qt:Mn.key),Ae=L(Mn,Ae,Qt),zt===null?Tt=Mn:zt.sibling=Mn,zt=Mn);return c&&Bt.forEach(function(xL){return d($e,xL)}),Xn&&vl($e,Qt),Tt}function ir($e,Ae,He,ft){if(typeof He=="object"&&He!==null&&He.type===M&&He.key===null&&(He=He.props.children),typeof He=="object"&&He!==null){switch(He.$$typeof){case P:e:{for(var Tt=He.key,zt=Ae;zt!==null;){if(zt.key===Tt){if(Tt=He.type,Tt===M){if(zt.tag===7){m($e,zt.sibling),Ae=A(zt,He.props.children),Ae.return=$e,$e=Ae;break e}}else if(zt.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===te&&iy(Tt)===zt.type){m($e,zt.sibling),Ae=A(zt,He.props),Ae.ref=kd($e,zt,He),Ae.return=$e,$e=Ae;break e}m($e,zt);break}else d($e,zt);zt=zt.sibling}He.type===M?(Ae=Cl(He.props.children,$e.mode,ft,He.key),Ae.return=$e,$e=Ae):(ft=y1(He.type,He.key,He.props,null,$e.mode,ft),ft.ref=kd($e,Ae,He),ft.return=$e,$e=ft)}return V($e);case $:e:{for(zt=He.key;Ae!==null;){if(Ae.key===zt)if(Ae.tag===4&&Ae.stateNode.containerInfo===He.containerInfo&&Ae.stateNode.implementation===He.implementation){m($e,Ae.sibling),Ae=A(Ae,He.children||[]),Ae.return=$e,$e=Ae;break e}else{m($e,Ae);break}else d($e,Ae);Ae=Ae.sibling}Ae=B2(He,$e.mode,ft),Ae.return=$e,$e=Ae}return V($e);case te:return zt=He._init,ir($e,Ae,zt(He._payload),ft)}if(ve(He))return Rt($e,Ae,He,ft);if(X(He))return Lt($e,Ae,He,ft);Yf($e,He)}return typeof He=="string"&&He!==""||typeof He=="number"?(He=""+He,Ae!==null&&Ae.tag===6?(m($e,Ae.sibling),Ae=A(Ae,He),Ae.return=$e,$e=Ae):(m($e,Ae),Ae=z2(He,$e.mode,ft),Ae.return=$e,$e=Ae),V($e)):m($e,Ae)}return ir}var Zc=ly(!0),cy=ly(!1),qf=pi(null),Xf=null,Vc=null,Jm=null;function e2(){Jm=Vc=Xf=null}function t2(c){var d=qf.current;Yn(qf),c._currentValue=d}function n2(c,d,m){for(;c!==null;){var b=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),c===m)break;c=c.return}}function zc(c,d){Xf=c,Jm=Vc=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&d)!==0&&(vs=!0),c.firstContext=null)}function Qs(c){var d=c._currentValue;if(Jm!==c)if(c={context:c,memoizedValue:d,next:null},Vc===null){if(Xf===null)throw Error(n(308));Vc=c,Xf.dependencies={lanes:0,firstContext:c}}else Vc=Vc.next=c;return d}var wl=null;function r2(c){wl===null?wl=[c]:wl.push(c)}function uy(c,d,m,b){var A=d.interleaved;return A===null?(m.next=m,r2(d)):(m.next=A.next,A.next=m),d.interleaved=m,Mo(c,b)}function Mo(c,d){c.lanes|=d;var m=c.alternate;for(m!==null&&(m.lanes|=d),m=c,c=c.return;c!==null;)c.childLanes|=d,m=c.alternate,m!==null&&(m.childLanes|=d),m=c,c=c.return;return m.tag===3?m.stateNode:null}var vi=!1;function s2(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dy(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Ro(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function wi(c,d,m){var b=c.updateQueue;if(b===null)return null;if(b=b.shared,(Cn&2)!==0){var A=b.pending;return A===null?d.next=d:(d.next=A.next,A.next=d),b.pending=d,Mo(c,m)}return A=b.interleaved,A===null?(d.next=d,r2(b)):(d.next=A.next,A.next=d),b.interleaved=d,Mo(c,m)}function Qf(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194240)!==0)){var b=d.lanes;b&=c.pendingLanes,m|=b,d.lanes=m,zn(c,m)}}function fy(c,d){var m=c.updateQueue,b=c.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var A=null,L=null;if(m=m.firstBaseUpdate,m!==null){do{var V={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};L===null?A=L=V:L=L.next=V,m=m.next}while(m!==null);L===null?A=L=d:L=L.next=d}else A=L=d;m={baseState:b.baseState,firstBaseUpdate:A,lastBaseUpdate:L,shared:b.shared,effects:b.effects},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}function Jf(c,d,m,b){var A=c.updateQueue;vi=!1;var L=A.firstBaseUpdate,V=A.lastBaseUpdate,fe=A.shared.pending;if(fe!==null){A.shared.pending=null;var ke=fe,Ze=ke.next;ke.next=null,V===null?L=Ze:V.next=Ze,V=ke;var at=c.alternate;at!==null&&(at=at.updateQueue,fe=at.lastBaseUpdate,fe!==V&&(fe===null?at.firstBaseUpdate=Ze:fe.next=Ze,at.lastBaseUpdate=ke))}if(L!==null){var lt=A.baseState;V=0,at=Ze=ke=null,fe=L;do{var rt=fe.lane,jt=fe.eventTime;if((b&rt)===rt){at!==null&&(at=at.next={eventTime:jt,lane:0,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null});e:{var Rt=c,Lt=fe;switch(rt=d,jt=m,Lt.tag){case 1:if(Rt=Lt.payload,typeof Rt=="function"){lt=Rt.call(jt,lt,rt);break e}lt=Rt;break e;case 3:Rt.flags=Rt.flags&-65537|128;case 0:if(Rt=Lt.payload,rt=typeof Rt=="function"?Rt.call(jt,lt,rt):Rt,rt==null)break e;lt=z({},lt,rt);break e;case 2:vi=!0}}fe.callback!==null&&fe.lane!==0&&(c.flags|=64,rt=A.effects,rt===null?A.effects=[fe]:rt.push(fe))}else jt={eventTime:jt,lane:rt,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null},at===null?(Ze=at=jt,ke=lt):at=at.next=jt,V|=rt;if(fe=fe.next,fe===null){if(fe=A.shared.pending,fe===null)break;rt=fe,fe=rt.next,rt.next=null,A.lastBaseUpdate=rt,A.shared.pending=null}}while(!0);if(at===null&&(ke=lt),A.baseState=ke,A.firstBaseUpdate=Ze,A.lastBaseUpdate=at,d=A.shared.interleaved,d!==null){A=d;do V|=A.lane,A=A.next;while(A!==d)}else L===null&&(A.shared.lanes=0);xl|=V,c.lanes=V,c.memoizedState=lt}}function hy(c,d,m){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var b=c[d],A=b.callback;if(A!==null){if(b.callback=null,b=m,typeof A!="function")throw Error(n(191,A));A.call(b)}}}var Sd={},Ka=pi(Sd),Ed=pi(Sd),Cd=pi(Sd);function yl(c){if(c===Sd)throw Error(n(174));return c}function a2(c,d){switch(Un(Cd,d),Un(Ed,c),Un(Ka,Sd),c=d.nodeType,c){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:be(null,"");break;default:c=c===8?d.parentNode:d,d=c.namespaceURI||null,c=c.tagName,d=be(d,c)}Yn(Ka),Un(Ka,d)}function Bc(){Yn(Ka),Yn(Ed),Yn(Cd)}function py(c){yl(Cd.current);var d=yl(Ka.current),m=be(d,c.type);d!==m&&(Un(Ed,c),Un(Ka,m))}function o2(c){Ed.current===c&&(Yn(Ka),Yn(Ed))}var Qn=pi(0);function e1(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var i2=[];function l2(){for(var c=0;c<i2.length;c++)i2[c]._workInProgressVersionPrimary=null;i2.length=0}var t1=N.ReactCurrentDispatcher,c2=N.ReactCurrentBatchConfig,bl=0,Jn=null,yr=null,Er=null,n1=!1,jd=!1,Ad=0,zP=0;function Br(){throw Error(n(321))}function u2(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!ka(c[m],d[m]))return!1;return!0}function d2(c,d,m,b,A,L){if(bl=L,Jn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,t1.current=c===null||c.memoizedState===null?KP:GP,c=m(b,A),jd){L=0;do{if(jd=!1,Ad=0,25<=L)throw Error(n(301));L+=1,Er=yr=null,d.updateQueue=null,t1.current=YP,c=m(b,A)}while(jd)}if(t1.current=a1,d=yr!==null&&yr.next!==null,bl=0,Er=yr=Jn=null,n1=!1,d)throw Error(n(300));return c}function f2(){var c=Ad!==0;return Ad=0,c}function Ga(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Er===null?Jn.memoizedState=Er=c:Er=Er.next=c,Er}function Js(){if(yr===null){var c=Jn.alternate;c=c!==null?c.memoizedState:null}else c=yr.next;var d=Er===null?Jn.memoizedState:Er.next;if(d!==null)Er=d,yr=c;else{if(c===null)throw Error(n(310));yr=c,c={memoizedState:yr.memoizedState,baseState:yr.baseState,baseQueue:yr.baseQueue,queue:yr.queue,next:null},Er===null?Jn.memoizedState=Er=c:Er=Er.next=c}return Er}function Nd(c,d){return typeof d=="function"?d(c):d}function h2(c){var d=Js(),m=d.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=c;var b=yr,A=b.baseQueue,L=m.pending;if(L!==null){if(A!==null){var V=A.next;A.next=L.next,L.next=V}b.baseQueue=A=L,m.pending=null}if(A!==null){L=A.next,b=b.baseState;var fe=V=null,ke=null,Ze=L;do{var at=Ze.lane;if((bl&at)===at)ke!==null&&(ke=ke.next={lane:0,action:Ze.action,hasEagerState:Ze.hasEagerState,eagerState:Ze.eagerState,next:null}),b=Ze.hasEagerState?Ze.eagerState:c(b,Ze.action);else{var lt={lane:at,action:Ze.action,hasEagerState:Ze.hasEagerState,eagerState:Ze.eagerState,next:null};ke===null?(fe=ke=lt,V=b):ke=ke.next=lt,Jn.lanes|=at,xl|=at}Ze=Ze.next}while(Ze!==null&&Ze!==L);ke===null?V=b:ke.next=fe,ka(b,d.memoizedState)||(vs=!0),d.memoizedState=b,d.baseState=V,d.baseQueue=ke,m.lastRenderedState=b}if(c=m.interleaved,c!==null){A=c;do L=A.lane,Jn.lanes|=L,xl|=L,A=A.next;while(A!==c)}else A===null&&(m.lanes=0);return[d.memoizedState,m.dispatch]}function p2(c){var d=Js(),m=d.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=c;var b=m.dispatch,A=m.pending,L=d.memoizedState;if(A!==null){m.pending=null;var V=A=A.next;do L=c(L,V.action),V=V.next;while(V!==A);ka(L,d.memoizedState)||(vs=!0),d.memoizedState=L,d.baseQueue===null&&(d.baseState=L),m.lastRenderedState=L}return[L,b]}function my(){}function gy(c,d){var m=Jn,b=Js(),A=d(),L=!ka(b.memoizedState,A);if(L&&(b.memoizedState=A,vs=!0),b=b.queue,m2(yy.bind(null,m,b,c),[c]),b.getSnapshot!==d||L||Er!==null&&Er.memoizedState.tag&1){if(m.flags|=2048,Md(9,wy.bind(null,m,b,A,d),void 0,null),Cr===null)throw Error(n(349));(bl&30)!==0||vy(m,d,A)}return A}function vy(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=Jn.updateQueue,d===null?(d={lastEffect:null,stores:null},Jn.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function wy(c,d,m,b){d.value=m,d.getSnapshot=b,by(d)&&xy(c)}function yy(c,d,m){return m(function(){by(d)&&xy(c)})}function by(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!ka(c,m)}catch{return!0}}function xy(c){var d=Mo(c,1);d!==null&&Aa(d,c,1,-1)}function ky(c){var d=Ga();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nd,lastRenderedState:c},d.queue=c,c=c.dispatch=WP.bind(null,Jn,c),[d.memoizedState,c]}function Md(c,d,m,b){return c={tag:c,create:d,destroy:m,deps:b,next:null},d=Jn.updateQueue,d===null?(d={lastEffect:null,stores:null},Jn.updateQueue=d,d.lastEffect=c.next=c):(m=d.lastEffect,m===null?d.lastEffect=c.next=c:(b=m.next,m.next=c,c.next=b,d.lastEffect=c)),c}function Sy(){return Js().memoizedState}function r1(c,d,m,b){var A=Ga();Jn.flags|=c,A.memoizedState=Md(1|d,m,void 0,b===void 0?null:b)}function s1(c,d,m,b){var A=Js();b=b===void 0?null:b;var L=void 0;if(yr!==null){var V=yr.memoizedState;if(L=V.destroy,b!==null&&u2(b,V.deps)){A.memoizedState=Md(d,m,L,b);return}}Jn.flags|=c,A.memoizedState=Md(1|d,m,L,b)}function Ey(c,d){return r1(8390656,8,c,d)}function m2(c,d){return s1(2048,8,c,d)}function Cy(c,d){return s1(4,2,c,d)}function jy(c,d){return s1(4,4,c,d)}function Ay(c,d){if(typeof d=="function")return c=c(),d(c),function(){d(null)};if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function Ny(c,d,m){return m=m!=null?m.concat([c]):null,s1(4,4,Ay.bind(null,d,c),m)}function g2(){}function My(c,d){var m=Js();d=d===void 0?null:d;var b=m.memoizedState;return b!==null&&d!==null&&u2(d,b[1])?b[0]:(m.memoizedState=[c,d],c)}function Ry(c,d){var m=Js();d=d===void 0?null:d;var b=m.memoizedState;return b!==null&&d!==null&&u2(d,b[1])?b[0]:(c=c(),m.memoizedState=[c,d],c)}function Py(c,d,m){return(bl&21)===0?(c.baseState&&(c.baseState=!1,vs=!0),c.memoizedState=m):(ka(m,d)||(m=tn(),Jn.lanes|=m,xl|=m,c.baseState=!0),d)}function BP(c,d){var m=yn;yn=m!==0&&4>m?m:4,c(!0);var b=c2.transition;c2.transition={};try{c(!1),d()}finally{yn=m,c2.transition=b}}function Ly(){return Js().memoizedState}function UP(c,d,m){var b=ki(c);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},Ty(c))$y(d,m);else if(m=uy(c,d,m,b),m!==null){var A=rs();Aa(m,c,b,A),Dy(m,d,b)}}function WP(c,d,m){var b=ki(c),A={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(Ty(c))$y(d,A);else{var L=c.alternate;if(c.lanes===0&&(L===null||L.lanes===0)&&(L=d.lastRenderedReducer,L!==null))try{var V=d.lastRenderedState,fe=L(V,m);if(A.hasEagerState=!0,A.eagerState=fe,ka(fe,V)){var ke=d.interleaved;ke===null?(A.next=A,r2(d)):(A.next=ke.next,ke.next=A),d.interleaved=A;return}}catch{}finally{}m=uy(c,d,A,b),m!==null&&(A=rs(),Aa(m,c,b,A),Dy(m,d,b))}}function Ty(c){var d=c.alternate;return c===Jn||d!==null&&d===Jn}function $y(c,d){jd=n1=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function Dy(c,d,m){if((m&4194240)!==0){var b=d.lanes;b&=c.pendingLanes,m|=b,d.lanes=m,zn(c,m)}}var a1={readContext:Qs,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},KP={readContext:Qs,useCallback:function(c,d){return Ga().memoizedState=[c,d===void 0?null:d],c},useContext:Qs,useEffect:Ey,useImperativeHandle:function(c,d,m){return m=m!=null?m.concat([c]):null,r1(4194308,4,Ay.bind(null,d,c),m)},useLayoutEffect:function(c,d){return r1(4194308,4,c,d)},useInsertionEffect:function(c,d){return r1(4,2,c,d)},useMemo:function(c,d){var m=Ga();return d=d===void 0?null:d,c=c(),m.memoizedState=[c,d],c},useReducer:function(c,d,m){var b=Ga();return d=m!==void 0?m(d):d,b.memoizedState=b.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},b.queue=c,c=c.dispatch=UP.bind(null,Jn,c),[b.memoizedState,c]},useRef:function(c){var d=Ga();return c={current:c},d.memoizedState=c},useState:ky,useDebugValue:g2,useDeferredValue:function(c){return Ga().memoizedState=c},useTransition:function(){var c=ky(!1),d=c[0];return c=BP.bind(null,c[1]),Ga().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,m){var b=Jn,A=Ga();if(Xn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Cr===null)throw Error(n(349));(bl&30)!==0||vy(b,d,m)}A.memoizedState=m;var L={value:m,getSnapshot:d};return A.queue=L,Ey(yy.bind(null,b,L,c),[c]),b.flags|=2048,Md(9,wy.bind(null,b,L,m,d),void 0,null),m},useId:function(){var c=Ga(),d=Cr.identifierPrefix;if(Xn){var m=No,b=Ao;m=(b&~(1<<32-Ht(b)-1)).toString(32)+m,d=":"+d+"R"+m,m=Ad++,0<m&&(d+="H"+m.toString(32)),d+=":"}else m=zP++,d=":"+d+"r"+m.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},GP={readContext:Qs,useCallback:My,useContext:Qs,useEffect:m2,useImperativeHandle:Ny,useInsertionEffect:Cy,useLayoutEffect:jy,useMemo:Ry,useReducer:h2,useRef:Sy,useState:function(){return h2(Nd)},useDebugValue:g2,useDeferredValue:function(c){var d=Js();return Py(d,yr.memoizedState,c)},useTransition:function(){var c=h2(Nd)[0],d=Js().memoizedState;return[c,d]},useMutableSource:my,useSyncExternalStore:gy,useId:Ly,unstable_isNewReconciler:!1},YP={readContext:Qs,useCallback:My,useContext:Qs,useEffect:m2,useImperativeHandle:Ny,useInsertionEffect:Cy,useLayoutEffect:jy,useMemo:Ry,useReducer:p2,useRef:Sy,useState:function(){return p2(Nd)},useDebugValue:g2,useDeferredValue:function(c){var d=Js();return yr===null?d.memoizedState=c:Py(d,yr.memoizedState,c)},useTransition:function(){var c=p2(Nd)[0],d=Js().memoizedState;return[c,d]},useMutableSource:my,useSyncExternalStore:gy,useId:Ly,unstable_isNewReconciler:!1};function Ea(c,d){if(c&&c.defaultProps){d=z({},d),c=c.defaultProps;for(var m in c)d[m]===void 0&&(d[m]=c[m]);return d}return d}function v2(c,d,m,b){d=c.memoizedState,m=m(b,d),m=m==null?d:z({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var o1={isMounted:function(c){return(c=c._reactInternals)?Ge(c)===c:!1},enqueueSetState:function(c,d,m){c=c._reactInternals;var b=rs(),A=ki(c),L=Ro(b,A);L.payload=d,m!=null&&(L.callback=m),d=wi(c,L,A),d!==null&&(Aa(d,c,A,b),Qf(d,c,A))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var b=rs(),A=ki(c),L=Ro(b,A);L.tag=1,L.payload=d,m!=null&&(L.callback=m),d=wi(c,L,A),d!==null&&(Aa(d,c,A,b),Qf(d,c,A))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=rs(),b=ki(c),A=Ro(m,b);A.tag=2,d!=null&&(A.callback=d),d=wi(c,A,b),d!==null&&(Aa(d,c,b,m),Qf(d,c,b))}};function Hy(c,d,m,b,A,L,V){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(b,L,V):d.prototype&&d.prototype.isPureReactComponent?!md(m,b)||!md(A,L):!0}function Oy(c,d,m){var b=!1,A=mi,L=d.contextType;return typeof L=="object"&&L!==null?L=Qs(L):(A=gs(d)?ml:zr.current,b=d.contextTypes,L=(b=b!=null)?Oc(c,A):mi),d=new d(m,L),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=o1,c.stateNode=d,d._reactInternals=c,b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=A,c.__reactInternalMemoizedMaskedChildContext=L),d}function Iy(c,d,m,b){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,b),d.state!==c&&o1.enqueueReplaceState(d,d.state,null)}function w2(c,d,m,b){var A=c.stateNode;A.props=m,A.state=c.memoizedState,A.refs={},s2(c);var L=d.contextType;typeof L=="object"&&L!==null?A.context=Qs(L):(L=gs(d)?ml:zr.current,A.context=Oc(c,L)),A.state=c.memoizedState,L=d.getDerivedStateFromProps,typeof L=="function"&&(v2(c,d,L,m),A.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(d=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),d!==A.state&&o1.enqueueReplaceState(A,A.state,null),Jf(c,m,A,b),A.state=c.memoizedState),typeof A.componentDidMount=="function"&&(c.flags|=4194308)}function Uc(c,d){try{var m="",b=d;do m+=q(b),b=b.return;while(b);var A=m}catch(L){A=`
39
- Error generating stack: `+L.message+`
40
- `+L.stack}return{value:c,source:d,stack:A,digest:null}}function y2(c,d,m){return{value:c,source:null,stack:m??null,digest:d??null}}function b2(c,d){try{console.error(d.value)}catch(m){setTimeout(function(){throw m})}}var qP=typeof WeakMap=="function"?WeakMap:Map;function Fy(c,d,m){m=Ro(-1,m),m.tag=3,m.payload={element:null};var b=d.value;return m.callback=function(){h1||(h1=!0,D2=b),b2(c,d)},m}function _y(c,d,m){m=Ro(-1,m),m.tag=3;var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var A=d.value;m.payload=function(){return b(A)},m.callback=function(){b2(c,d)}}var L=c.stateNode;return L!==null&&typeof L.componentDidCatch=="function"&&(m.callback=function(){b2(c,d),typeof b!="function"&&(bi===null?bi=new Set([this]):bi.add(this));var V=d.stack;this.componentDidCatch(d.value,{componentStack:V!==null?V:""})}),m}function Zy(c,d,m){var b=c.pingCache;if(b===null){b=c.pingCache=new qP;var A=new Set;b.set(d,A)}else A=b.get(d),A===void 0&&(A=new Set,b.set(d,A));A.has(m)||(A.add(m),c=uL.bind(null,c,d,m),d.then(c,c))}function Vy(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function zy(c,d,m,b,A){return(c.mode&1)===0?(c===d?c.flags|=65536:(c.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(d=Ro(-1,1),d.tag=2,wi(m,d,1))),m.lanes|=1),c):(c.flags|=65536,c.lanes=A,c)}var XP=N.ReactCurrentOwner,vs=!1;function ns(c,d,m,b){d.child=c===null?cy(d,null,m,b):Zc(d,c.child,m,b)}function By(c,d,m,b,A){m=m.render;var L=d.ref;return zc(d,A),b=d2(c,d,m,b,L,A),m=f2(),c!==null&&!vs?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~A,Po(c,d,A)):(Xn&&m&&Gm(d),d.flags|=1,ns(c,d,b,A),d.child)}function Uy(c,d,m,b,A){if(c===null){var L=m.type;return typeof L=="function"&&!V2(L)&&L.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(d.tag=15,d.type=L,Wy(c,d,L,b,A)):(c=y1(m.type,null,b,d,d.mode,A),c.ref=d.ref,c.return=d,d.child=c)}if(L=c.child,(c.lanes&A)===0){var V=L.memoizedProps;if(m=m.compare,m=m!==null?m:md,m(V,b)&&c.ref===d.ref)return Po(c,d,A)}return d.flags|=1,c=Ei(L,b),c.ref=d.ref,c.return=d,d.child=c}function Wy(c,d,m,b,A){if(c!==null){var L=c.memoizedProps;if(md(L,b)&&c.ref===d.ref)if(vs=!1,d.pendingProps=b=L,(c.lanes&A)!==0)(c.flags&131072)!==0&&(vs=!0);else return d.lanes=c.lanes,Po(c,d,A)}return x2(c,d,m,b,A)}function Ky(c,d,m){var b=d.pendingProps,A=b.children,L=c!==null?c.memoizedState:null;if(b.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Un(Kc,Hs),Hs|=m;else{if((m&1073741824)===0)return c=L!==null?L.baseLanes|m:m,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,Un(Kc,Hs),Hs|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=L!==null?L.baseLanes:m,Un(Kc,Hs),Hs|=b}else L!==null?(b=L.baseLanes|m,d.memoizedState=null):b=m,Un(Kc,Hs),Hs|=b;return ns(c,d,A,m),d.child}function Gy(c,d){var m=d.ref;(c===null&&m!==null||c!==null&&c.ref!==m)&&(d.flags|=512,d.flags|=2097152)}function x2(c,d,m,b,A){var L=gs(m)?ml:zr.current;return L=Oc(d,L),zc(d,A),m=d2(c,d,m,b,L,A),b=f2(),c!==null&&!vs?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~A,Po(c,d,A)):(Xn&&b&&Gm(d),d.flags|=1,ns(c,d,m,A),d.child)}function Yy(c,d,m,b,A){if(gs(m)){var L=!0;Bf(d)}else L=!1;if(zc(d,A),d.stateNode===null)l1(c,d),Oy(d,m,b),w2(d,m,b,A),b=!0;else if(c===null){var V=d.stateNode,fe=d.memoizedProps;V.props=fe;var ke=V.context,Ze=m.contextType;typeof Ze=="object"&&Ze!==null?Ze=Qs(Ze):(Ze=gs(m)?ml:zr.current,Ze=Oc(d,Ze));var at=m.getDerivedStateFromProps,lt=typeof at=="function"||typeof V.getSnapshotBeforeUpdate=="function";lt||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(fe!==b||ke!==Ze)&&Iy(d,V,b,Ze),vi=!1;var rt=d.memoizedState;V.state=rt,Jf(d,b,V,A),ke=d.memoizedState,fe!==b||rt!==ke||ms.current||vi?(typeof at=="function"&&(v2(d,m,at,b),ke=d.memoizedState),(fe=vi||Hy(d,m,fe,b,rt,ke,Ze))?(lt||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(d.flags|=4194308)):(typeof V.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=ke),V.props=b,V.state=ke,V.context=Ze,b=fe):(typeof V.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{V=d.stateNode,dy(c,d),fe=d.memoizedProps,Ze=d.type===d.elementType?fe:Ea(d.type,fe),V.props=Ze,lt=d.pendingProps,rt=V.context,ke=m.contextType,typeof ke=="object"&&ke!==null?ke=Qs(ke):(ke=gs(m)?ml:zr.current,ke=Oc(d,ke));var jt=m.getDerivedStateFromProps;(at=typeof jt=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(fe!==lt||rt!==ke)&&Iy(d,V,b,ke),vi=!1,rt=d.memoizedState,V.state=rt,Jf(d,b,V,A);var Rt=d.memoizedState;fe!==lt||rt!==Rt||ms.current||vi?(typeof jt=="function"&&(v2(d,m,jt,b),Rt=d.memoizedState),(Ze=vi||Hy(d,m,Ze,b,rt,Rt,ke)||!1)?(at||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(b,Rt,ke),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(b,Rt,ke)),typeof V.componentDidUpdate=="function"&&(d.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof V.componentDidUpdate!="function"||fe===c.memoizedProps&&rt===c.memoizedState||(d.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&rt===c.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=Rt),V.props=b,V.state=Rt,V.context=ke,b=Ze):(typeof V.componentDidUpdate!="function"||fe===c.memoizedProps&&rt===c.memoizedState||(d.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&rt===c.memoizedState||(d.flags|=1024),b=!1)}return k2(c,d,m,b,L,A)}function k2(c,d,m,b,A,L){Gy(c,d);var V=(d.flags&128)!==0;if(!b&&!V)return A&&ey(d,m,!1),Po(c,d,L);b=d.stateNode,XP.current=d;var fe=V&&typeof m.getDerivedStateFromError!="function"?null:b.render();return d.flags|=1,c!==null&&V?(d.child=Zc(d,c.child,null,L),d.child=Zc(d,null,fe,L)):ns(c,d,fe,L),d.memoizedState=b.state,A&&ey(d,m,!0),d.child}function qy(c){var d=c.stateNode;d.pendingContext?Qw(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Qw(c,d.context,!1),a2(c,d.containerInfo)}function Xy(c,d,m,b,A){return _c(),Qm(A),d.flags|=256,ns(c,d,m,b),d.child}var S2={dehydrated:null,treeContext:null,retryLane:0};function E2(c){return{baseLanes:c,cachePool:null,transitions:null}}function Qy(c,d,m){var b=d.pendingProps,A=Qn.current,L=!1,V=(d.flags&128)!==0,fe;if((fe=V)||(fe=c!==null&&c.memoizedState===null?!1:(A&2)!==0),fe?(L=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(A|=1),Un(Qn,A&1),c===null)return Xm(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((d.mode&1)===0?d.lanes=1:c.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(V=b.children,c=b.fallback,L?(b=d.mode,L=d.child,V={mode:"hidden",children:V},(b&1)===0&&L!==null?(L.childLanes=0,L.pendingProps=V):L=b1(V,b,0,null),c=Cl(c,b,m,null),L.return=d,c.return=d,L.sibling=c,d.child=L,d.child.memoizedState=E2(m),d.memoizedState=S2,c):C2(d,V));if(A=c.memoizedState,A!==null&&(fe=A.dehydrated,fe!==null))return QP(c,d,V,b,fe,A,m);if(L){L=b.fallback,V=d.mode,A=c.child,fe=A.sibling;var ke={mode:"hidden",children:b.children};return(V&1)===0&&d.child!==A?(b=d.child,b.childLanes=0,b.pendingProps=ke,d.deletions=null):(b=Ei(A,ke),b.subtreeFlags=A.subtreeFlags&14680064),fe!==null?L=Ei(fe,L):(L=Cl(L,V,m,null),L.flags|=2),L.return=d,b.return=d,b.sibling=L,d.child=b,b=L,L=d.child,V=c.child.memoizedState,V=V===null?E2(m):{baseLanes:V.baseLanes|m,cachePool:null,transitions:V.transitions},L.memoizedState=V,L.childLanes=c.childLanes&~m,d.memoizedState=S2,b}return L=c.child,c=L.sibling,b=Ei(L,{mode:"visible",children:b.children}),(d.mode&1)===0&&(b.lanes=m),b.return=d,b.sibling=null,c!==null&&(m=d.deletions,m===null?(d.deletions=[c],d.flags|=16):m.push(c)),d.child=b,d.memoizedState=null,b}function C2(c,d){return d=b1({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function i1(c,d,m,b){return b!==null&&Qm(b),Zc(d,c.child,null,m),c=C2(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function QP(c,d,m,b,A,L,V){if(m)return d.flags&256?(d.flags&=-257,b=y2(Error(n(422))),i1(c,d,V,b)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(L=b.fallback,A=d.mode,b=b1({mode:"visible",children:b.children},A,0,null),L=Cl(L,A,V,null),L.flags|=2,b.return=d,L.return=d,b.sibling=L,d.child=b,(d.mode&1)!==0&&Zc(d,c.child,null,V),d.child.memoizedState=E2(V),d.memoizedState=S2,L);if((d.mode&1)===0)return i1(c,d,V,null);if(A.data==="$!"){if(b=A.nextSibling&&A.nextSibling.dataset,b)var fe=b.dgst;return b=fe,L=Error(n(419)),b=y2(L,b,void 0),i1(c,d,V,b)}if(fe=(V&c.childLanes)!==0,vs||fe){if(b=Cr,b!==null){switch(V&-V){case 4:A=2;break;case 16:A=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(b.suspendedLanes|V))!==0?0:A,A!==0&&A!==L.retryLane&&(L.retryLane=A,Mo(c,A),Aa(b,c,A,-1))}return Z2(),b=y2(Error(n(421))),i1(c,d,V,b)}return A.data==="$?"?(d.flags|=128,d.child=c.child,d=dL.bind(null,c),A._reactRetry=d,null):(c=L.treeContext,Ds=hi(A.nextSibling),$s=d,Xn=!0,Sa=null,c!==null&&(qs[Xs++]=Ao,qs[Xs++]=No,qs[Xs++]=gl,Ao=c.id,No=c.overflow,gl=d),d=C2(d,b.children),d.flags|=4096,d)}function Jy(c,d,m){c.lanes|=d;var b=c.alternate;b!==null&&(b.lanes|=d),n2(c.return,d,m)}function j2(c,d,m,b,A){var L=c.memoizedState;L===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:A}:(L.isBackwards=d,L.rendering=null,L.renderingStartTime=0,L.last=b,L.tail=m,L.tailMode=A)}function eb(c,d,m){var b=d.pendingProps,A=b.revealOrder,L=b.tail;if(ns(c,d,b.children,m),b=Qn.current,(b&2)!==0)b=b&1|2,d.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Jy(c,m,d);else if(c.tag===19)Jy(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}b&=1}if(Un(Qn,b),(d.mode&1)===0)d.memoizedState=null;else switch(A){case"forwards":for(m=d.child,A=null;m!==null;)c=m.alternate,c!==null&&e1(c)===null&&(A=m),m=m.sibling;m=A,m===null?(A=d.child,d.child=null):(A=m.sibling,m.sibling=null),j2(d,!1,A,m,L);break;case"backwards":for(m=null,A=d.child,d.child=null;A!==null;){if(c=A.alternate,c!==null&&e1(c)===null){d.child=A;break}c=A.sibling,A.sibling=m,m=A,A=c}j2(d,!0,m,null,L);break;case"together":j2(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function l1(c,d){(d.mode&1)===0&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function Po(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),xl|=d.lanes,(m&d.childLanes)===0)return null;if(c!==null&&d.child!==c.child)throw Error(n(153));if(d.child!==null){for(c=d.child,m=Ei(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=Ei(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function JP(c,d,m){switch(d.tag){case 3:qy(d),_c();break;case 5:py(d);break;case 1:gs(d.type)&&Bf(d);break;case 4:a2(d,d.stateNode.containerInfo);break;case 10:var b=d.type._context,A=d.memoizedProps.value;Un(qf,b._currentValue),b._currentValue=A;break;case 13:if(b=d.memoizedState,b!==null)return b.dehydrated!==null?(Un(Qn,Qn.current&1),d.flags|=128,null):(m&d.child.childLanes)!==0?Qy(c,d,m):(Un(Qn,Qn.current&1),c=Po(c,d,m),c!==null?c.sibling:null);Un(Qn,Qn.current&1);break;case 19:if(b=(m&d.childLanes)!==0,(c.flags&128)!==0){if(b)return eb(c,d,m);d.flags|=128}if(A=d.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Un(Qn,Qn.current),b)break;return null;case 22:case 23:return d.lanes=0,Ky(c,d,m)}return Po(c,d,m)}var tb,A2,nb,rb;tb=function(c,d){for(var m=d.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},A2=function(){},nb=function(c,d,m,b){var A=c.memoizedProps;if(A!==b){c=d.stateNode,yl(Ka.current);var L=null;switch(m){case"input":A=ue(c,A),b=ue(c,b),L=[];break;case"select":A=z({},A,{value:void 0}),b=z({},b,{value:void 0}),L=[];break;case"textarea":A=de(c,A),b=de(c,b),L=[];break;default:typeof A.onClick!="function"&&typeof b.onClick=="function"&&(c.onclick=Zf)}cn(m,b);var V;m=null;for(Ze in A)if(!b.hasOwnProperty(Ze)&&A.hasOwnProperty(Ze)&&A[Ze]!=null)if(Ze==="style"){var fe=A[Ze];for(V in fe)fe.hasOwnProperty(V)&&(m||(m={}),m[V]="")}else Ze!=="dangerouslySetInnerHTML"&&Ze!=="children"&&Ze!=="suppressContentEditableWarning"&&Ze!=="suppressHydrationWarning"&&Ze!=="autoFocus"&&(a.hasOwnProperty(Ze)?L||(L=[]):(L=L||[]).push(Ze,null));for(Ze in b){var ke=b[Ze];if(fe=A!=null?A[Ze]:void 0,b.hasOwnProperty(Ze)&&ke!==fe&&(ke!=null||fe!=null))if(Ze==="style")if(fe){for(V in fe)!fe.hasOwnProperty(V)||ke&&ke.hasOwnProperty(V)||(m||(m={}),m[V]="");for(V in ke)ke.hasOwnProperty(V)&&fe[V]!==ke[V]&&(m||(m={}),m[V]=ke[V])}else m||(L||(L=[]),L.push(Ze,m)),m=ke;else Ze==="dangerouslySetInnerHTML"?(ke=ke?ke.__html:void 0,fe=fe?fe.__html:void 0,ke!=null&&fe!==ke&&(L=L||[]).push(Ze,ke)):Ze==="children"?typeof ke!="string"&&typeof ke!="number"||(L=L||[]).push(Ze,""+ke):Ze!=="suppressContentEditableWarning"&&Ze!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ze)?(ke!=null&&Ze==="onScroll"&&Gn("scroll",c),L||fe===ke||(L=[])):(L=L||[]).push(Ze,ke))}m&&(L=L||[]).push("style",m);var Ze=L;(d.updateQueue=Ze)&&(d.flags|=4)}},rb=function(c,d,m,b){m!==b&&(d.flags|=4)};function Rd(c,d){if(!Xn)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:b.sibling=null}}function Ur(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,b=0;if(d)for(var A=c.child;A!==null;)m|=A.lanes|A.childLanes,b|=A.subtreeFlags&14680064,b|=A.flags&14680064,A.return=c,A=A.sibling;else for(A=c.child;A!==null;)m|=A.lanes|A.childLanes,b|=A.subtreeFlags,b|=A.flags,A.return=c,A=A.sibling;return c.subtreeFlags|=b,c.childLanes=m,d}function eL(c,d,m){var b=d.pendingProps;switch(Ym(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ur(d),null;case 1:return gs(d.type)&&zf(),Ur(d),null;case 3:return b=d.stateNode,Bc(),Yn(ms),Yn(zr),l2(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(c===null||c.child===null)&&(Gf(d)?d.flags|=4:c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Sa!==null&&(I2(Sa),Sa=null))),A2(c,d),Ur(d),null;case 5:o2(d);var A=yl(Cd.current);if(m=d.type,c!==null&&d.stateNode!=null)nb(c,d,m,b,A),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!b){if(d.stateNode===null)throw Error(n(166));return Ur(d),null}if(c=yl(Ka.current),Gf(d)){b=d.stateNode,m=d.type;var L=d.memoizedProps;switch(b[Wa]=d,b[bd]=L,c=(d.mode&1)!==0,m){case"dialog":Gn("cancel",b),Gn("close",b);break;case"iframe":case"object":case"embed":Gn("load",b);break;case"video":case"audio":for(A=0;A<vd.length;A++)Gn(vd[A],b);break;case"source":Gn("error",b);break;case"img":case"image":case"link":Gn("error",b),Gn("load",b);break;case"details":Gn("toggle",b);break;case"input":We(b,L),Gn("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!L.multiple},Gn("invalid",b);break;case"textarea":je(b,L),Gn("invalid",b)}cn(m,L),A=null;for(var V in L)if(L.hasOwnProperty(V)){var fe=L[V];V==="children"?typeof fe=="string"?b.textContent!==fe&&(L.suppressHydrationWarning!==!0&&_f(b.textContent,fe,c),A=["children",fe]):typeof fe=="number"&&b.textContent!==""+fe&&(L.suppressHydrationWarning!==!0&&_f(b.textContent,fe,c),A=["children",""+fe]):a.hasOwnProperty(V)&&fe!=null&&V==="onScroll"&&Gn("scroll",b)}switch(m){case"input":ae(b),tt(b,L,!0);break;case"textarea":ae(b),ye(b);break;case"select":case"option":break;default:typeof L.onClick=="function"&&(b.onclick=Zf)}b=A,d.updateQueue=b,b!==null&&(d.flags|=4)}else{V=A.nodeType===9?A:A.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=Ee(m)),c==="http://www.w3.org/1999/xhtml"?m==="script"?(c=V.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof b.is=="string"?c=V.createElement(m,{is:b.is}):(c=V.createElement(m),m==="select"&&(V=c,b.multiple?V.multiple=!0:b.size&&(V.size=b.size))):c=V.createElementNS(c,m),c[Wa]=d,c[bd]=b,tb(c,d,!1,!1),d.stateNode=c;e:{switch(V=Fe(m,b),m){case"dialog":Gn("cancel",c),Gn("close",c),A=b;break;case"iframe":case"object":case"embed":Gn("load",c),A=b;break;case"video":case"audio":for(A=0;A<vd.length;A++)Gn(vd[A],c);A=b;break;case"source":Gn("error",c),A=b;break;case"img":case"image":case"link":Gn("error",c),Gn("load",c),A=b;break;case"details":Gn("toggle",c),A=b;break;case"input":We(c,b),A=ue(c,b),Gn("invalid",c);break;case"option":A=b;break;case"select":c._wrapperState={wasMultiple:!!b.multiple},A=z({},b,{value:void 0}),Gn("invalid",c);break;case"textarea":je(c,b),A=de(c,b),Gn("invalid",c);break;default:A=b}cn(m,A),fe=A;for(L in fe)if(fe.hasOwnProperty(L)){var ke=fe[L];L==="style"?Ut(c,ke):L==="dangerouslySetInnerHTML"?(ke=ke?ke.__html:void 0,ke!=null&&Qe(c,ke)):L==="children"?typeof ke=="string"?(m!=="textarea"||ke!=="")&&Ke(c,ke):typeof ke=="number"&&Ke(c,""+ke):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(a.hasOwnProperty(L)?ke!=null&&L==="onScroll"&&Gn("scroll",c):ke!=null&&j(c,L,ke,V))}switch(m){case"input":ae(c),tt(c,b,!1);break;case"textarea":ae(c),ye(c);break;case"option":b.value!=null&&c.setAttribute("value",""+Q(b.value));break;case"select":c.multiple=!!b.multiple,L=b.value,L!=null?Pe(c,!!b.multiple,L,!1):b.defaultValue!=null&&Pe(c,!!b.multiple,b.defaultValue,!0);break;default:typeof A.onClick=="function"&&(c.onclick=Zf)}switch(m){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Ur(d),null;case 6:if(c&&d.stateNode!=null)rb(c,d,c.memoizedProps,b);else{if(typeof b!="string"&&d.stateNode===null)throw Error(n(166));if(m=yl(Cd.current),yl(Ka.current),Gf(d)){if(b=d.stateNode,m=d.memoizedProps,b[Wa]=d,(L=b.nodeValue!==m)&&(c=$s,c!==null))switch(c.tag){case 3:_f(b.nodeValue,m,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&_f(b.nodeValue,m,(c.mode&1)!==0)}L&&(d.flags|=4)}else b=(m.nodeType===9?m:m.ownerDocument).createTextNode(b),b[Wa]=d,d.stateNode=b}return Ur(d),null;case 13:if(Yn(Qn),b=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Xn&&Ds!==null&&(d.mode&1)!==0&&(d.flags&128)===0)oy(),_c(),d.flags|=98560,L=!1;else if(L=Gf(d),b!==null&&b.dehydrated!==null){if(c===null){if(!L)throw Error(n(318));if(L=d.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(n(317));L[Wa]=d}else _c(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Ur(d),L=!1}else Sa!==null&&(I2(Sa),Sa=null),L=!0;if(!L)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=m,d):(b=b!==null,b!==(c!==null&&c.memoizedState!==null)&&b&&(d.child.flags|=8192,(d.mode&1)!==0&&(c===null||(Qn.current&1)!==0?br===0&&(br=3):Z2())),d.updateQueue!==null&&(d.flags|=4),Ur(d),null);case 4:return Bc(),A2(c,d),c===null&&wd(d.stateNode.containerInfo),Ur(d),null;case 10:return t2(d.type._context),Ur(d),null;case 17:return gs(d.type)&&zf(),Ur(d),null;case 19:if(Yn(Qn),L=d.memoizedState,L===null)return Ur(d),null;if(b=(d.flags&128)!==0,V=L.rendering,V===null)if(b)Rd(L,!1);else{if(br!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(V=e1(c),V!==null){for(d.flags|=128,Rd(L,!1),b=V.updateQueue,b!==null&&(d.updateQueue=b,d.flags|=4),d.subtreeFlags=0,b=m,m=d.child;m!==null;)L=m,c=b,L.flags&=14680066,V=L.alternate,V===null?(L.childLanes=0,L.lanes=c,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=V.childLanes,L.lanes=V.lanes,L.child=V.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=V.memoizedProps,L.memoizedState=V.memoizedState,L.updateQueue=V.updateQueue,L.type=V.type,c=V.dependencies,L.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),m=m.sibling;return Un(Qn,Qn.current&1|2),d.child}c=c.sibling}L.tail!==null&&st()>Gc&&(d.flags|=128,b=!0,Rd(L,!1),d.lanes=4194304)}else{if(!b)if(c=e1(V),c!==null){if(d.flags|=128,b=!0,m=c.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),Rd(L,!0),L.tail===null&&L.tailMode==="hidden"&&!V.alternate&&!Xn)return Ur(d),null}else 2*st()-L.renderingStartTime>Gc&&m!==1073741824&&(d.flags|=128,b=!0,Rd(L,!1),d.lanes=4194304);L.isBackwards?(V.sibling=d.child,d.child=V):(m=L.last,m!==null?m.sibling=V:d.child=V,L.last=V)}return L.tail!==null?(d=L.tail,L.rendering=d,L.tail=d.sibling,L.renderingStartTime=st(),d.sibling=null,m=Qn.current,Un(Qn,b?m&1|2:m&1),d):(Ur(d),null);case 22:case 23:return _2(),b=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==b&&(d.flags|=8192),b&&(d.mode&1)!==0?(Hs&1073741824)!==0&&(Ur(d),d.subtreeFlags&6&&(d.flags|=8192)):Ur(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function tL(c,d){switch(Ym(d),d.tag){case 1:return gs(d.type)&&zf(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return Bc(),Yn(ms),Yn(zr),l2(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 5:return o2(d),null;case 13:if(Yn(Qn),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(n(340));_c()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return Yn(Qn),null;case 4:return Bc(),null;case 10:return t2(d.type._context),null;case 22:case 23:return _2(),null;case 24:return null;default:return null}}var c1=!1,Wr=!1,nL=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Wc(c,d){var m=c.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){ar(c,d,b)}else m.current=null}function N2(c,d,m){try{m()}catch(b){ar(c,d,b)}}var sb=!1;function rL(c,d){if(_m=hs,c=Hw(),Lm(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var A=b.anchorOffset,L=b.focusNode;b=b.focusOffset;try{m.nodeType,L.nodeType}catch{m=null;break e}var V=0,fe=-1,ke=-1,Ze=0,at=0,lt=c,rt=null;t:for(;;){for(var jt;lt!==m||A!==0&&lt.nodeType!==3||(fe=V+A),lt!==L||b!==0&&lt.nodeType!==3||(ke=V+b),lt.nodeType===3&&(V+=lt.nodeValue.length),(jt=lt.firstChild)!==null;)rt=lt,lt=jt;for(;;){if(lt===c)break t;if(rt===m&&++Ze===A&&(fe=V),rt===L&&++at===b&&(ke=V),(jt=lt.nextSibling)!==null)break;lt=rt,rt=lt.parentNode}lt=jt}m=fe===-1||ke===-1?null:{start:fe,end:ke}}else m=null}m=m||{start:0,end:0}}else m=null;for(Zm={focusedElem:c,selectionRange:m},hs=!1,Mt=d;Mt!==null;)if(d=Mt,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Mt=c;else for(;Mt!==null;){d=Mt;try{var Rt=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Rt!==null){var Lt=Rt.memoizedProps,ir=Rt.memoizedState,$e=d.stateNode,Ae=$e.getSnapshotBeforeUpdate(d.elementType===d.type?Lt:Ea(d.type,Lt),ir);$e.__reactInternalSnapshotBeforeUpdate=Ae}break;case 3:var He=d.stateNode.containerInfo;He.nodeType===1?He.textContent="":He.nodeType===9&&He.documentElement&&He.removeChild(He.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ft){ar(d,d.return,ft)}if(c=d.sibling,c!==null){c.return=d.return,Mt=c;break}Mt=d.return}return Rt=sb,sb=!1,Rt}function Pd(c,d,m){var b=d.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var A=b=b.next;do{if((A.tag&c)===c){var L=A.destroy;A.destroy=void 0,L!==void 0&&N2(d,m,L)}A=A.next}while(A!==b)}}function u1(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&c)===c){var b=m.create;m.destroy=b()}m=m.next}while(m!==d)}}function M2(c){var d=c.ref;if(d!==null){var m=c.stateNode;switch(c.tag){case 5:c=m;break;default:c=m}typeof d=="function"?d(c):d.current=c}}function ab(c){var d=c.alternate;d!==null&&(c.alternate=null,ab(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&(delete d[Wa],delete d[bd],delete d[Um],delete d[FP],delete d[_P])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function ob(c){return c.tag===5||c.tag===3||c.tag===4}function ib(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||ob(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function R2(c,d,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?m.nodeType===8?m.parentNode.insertBefore(c,d):m.insertBefore(c,d):(m.nodeType===8?(d=m.parentNode,d.insertBefore(c,m)):(d=m,d.appendChild(c)),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Zf));else if(b!==4&&(c=c.child,c!==null))for(R2(c,d,m),c=c.sibling;c!==null;)R2(c,d,m),c=c.sibling}function P2(c,d,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(b!==4&&(c=c.child,c!==null))for(P2(c,d,m),c=c.sibling;c!==null;)P2(c,d,m),c=c.sibling}var Tr=null,Ca=!1;function yi(c,d,m){for(m=m.child;m!==null;)lb(c,d,m),m=m.sibling}function lb(c,d,m){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(dt,m)}catch{}switch(m.tag){case 5:Wr||Wc(m,d);case 6:var b=Tr,A=Ca;Tr=null,yi(c,d,m),Tr=b,Ca=A,Tr!==null&&(Ca?(c=Tr,m=m.stateNode,c.nodeType===8?c.parentNode.removeChild(m):c.removeChild(m)):Tr.removeChild(m.stateNode));break;case 18:Tr!==null&&(Ca?(c=Tr,m=m.stateNode,c.nodeType===8?Bm(c.parentNode,m):c.nodeType===1&&Bm(c,m),xn(c)):Bm(Tr,m.stateNode));break;case 4:b=Tr,A=Ca,Tr=m.stateNode.containerInfo,Ca=!0,yi(c,d,m),Tr=b,Ca=A;break;case 0:case 11:case 14:case 15:if(!Wr&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){A=b=b.next;do{var L=A,V=L.destroy;L=L.tag,V!==void 0&&((L&2)!==0||(L&4)!==0)&&N2(m,d,V),A=A.next}while(A!==b)}yi(c,d,m);break;case 1:if(!Wr&&(Wc(m,d),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(fe){ar(m,d,fe)}yi(c,d,m);break;case 21:yi(c,d,m);break;case 22:m.mode&1?(Wr=(b=Wr)||m.memoizedState!==null,yi(c,d,m),Wr=b):yi(c,d,m);break;default:yi(c,d,m)}}function cb(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var m=c.stateNode;m===null&&(m=c.stateNode=new nL),d.forEach(function(b){var A=fL.bind(null,c,b);m.has(b)||(m.add(b),b.then(A,A))})}}function ja(c,d){var m=d.deletions;if(m!==null)for(var b=0;b<m.length;b++){var A=m[b];try{var L=c,V=d,fe=V;e:for(;fe!==null;){switch(fe.tag){case 5:Tr=fe.stateNode,Ca=!1;break e;case 3:Tr=fe.stateNode.containerInfo,Ca=!0;break e;case 4:Tr=fe.stateNode.containerInfo,Ca=!0;break e}fe=fe.return}if(Tr===null)throw Error(n(160));lb(L,V,A),Tr=null,Ca=!1;var ke=A.alternate;ke!==null&&(ke.return=null),A.return=null}catch(Ze){ar(A,d,Ze)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)ub(d,c),d=d.sibling}function ub(c,d){var m=c.alternate,b=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(ja(d,c),Ya(c),b&4){try{Pd(3,c,c.return),u1(3,c)}catch(Lt){ar(c,c.return,Lt)}try{Pd(5,c,c.return)}catch(Lt){ar(c,c.return,Lt)}}break;case 1:ja(d,c),Ya(c),b&512&&m!==null&&Wc(m,m.return);break;case 5:if(ja(d,c),Ya(c),b&512&&m!==null&&Wc(m,m.return),c.flags&32){var A=c.stateNode;try{Ke(A,"")}catch(Lt){ar(c,c.return,Lt)}}if(b&4&&(A=c.stateNode,A!=null)){var L=c.memoizedProps,V=m!==null?m.memoizedProps:L,fe=c.type,ke=c.updateQueue;if(c.updateQueue=null,ke!==null)try{fe==="input"&&L.type==="radio"&&L.name!=null&&Xe(A,L),Fe(fe,V);var Ze=Fe(fe,L);for(V=0;V<ke.length;V+=2){var at=ke[V],lt=ke[V+1];at==="style"?Ut(A,lt):at==="dangerouslySetInnerHTML"?Qe(A,lt):at==="children"?Ke(A,lt):j(A,at,lt,Ze)}switch(fe){case"input":ze(A,L);break;case"textarea":Ue(A,L);break;case"select":var rt=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!L.multiple;var jt=L.value;jt!=null?Pe(A,!!L.multiple,jt,!1):rt!==!!L.multiple&&(L.defaultValue!=null?Pe(A,!!L.multiple,L.defaultValue,!0):Pe(A,!!L.multiple,L.multiple?[]:"",!1))}A[bd]=L}catch(Lt){ar(c,c.return,Lt)}}break;case 6:if(ja(d,c),Ya(c),b&4){if(c.stateNode===null)throw Error(n(162));A=c.stateNode,L=c.memoizedProps;try{A.nodeValue=L}catch(Lt){ar(c,c.return,Lt)}}break;case 3:if(ja(d,c),Ya(c),b&4&&m!==null&&m.memoizedState.isDehydrated)try{xn(d.containerInfo)}catch(Lt){ar(c,c.return,Lt)}break;case 4:ja(d,c),Ya(c);break;case 13:ja(d,c),Ya(c),A=c.child,A.flags&8192&&(L=A.memoizedState!==null,A.stateNode.isHidden=L,!L||A.alternate!==null&&A.alternate.memoizedState!==null||($2=st())),b&4&&cb(c);break;case 22:if(at=m!==null&&m.memoizedState!==null,c.mode&1?(Wr=(Ze=Wr)||at,ja(d,c),Wr=Ze):ja(d,c),Ya(c),b&8192){if(Ze=c.memoizedState!==null,(c.stateNode.isHidden=Ze)&&!at&&(c.mode&1)!==0)for(Mt=c,at=c.child;at!==null;){for(lt=Mt=at;Mt!==null;){switch(rt=Mt,jt=rt.child,rt.tag){case 0:case 11:case 14:case 15:Pd(4,rt,rt.return);break;case 1:Wc(rt,rt.return);var Rt=rt.stateNode;if(typeof Rt.componentWillUnmount=="function"){b=rt,m=rt.return;try{d=b,Rt.props=d.memoizedProps,Rt.state=d.memoizedState,Rt.componentWillUnmount()}catch(Lt){ar(b,m,Lt)}}break;case 5:Wc(rt,rt.return);break;case 22:if(rt.memoizedState!==null){hb(lt);continue}}jt!==null?(jt.return=rt,Mt=jt):hb(lt)}at=at.sibling}e:for(at=null,lt=c;;){if(lt.tag===5){if(at===null){at=lt;try{A=lt.stateNode,Ze?(L=A.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none"):(fe=lt.stateNode,ke=lt.memoizedProps.style,V=ke!=null&&ke.hasOwnProperty("display")?ke.display:null,fe.style.display=Pt("display",V))}catch(Lt){ar(c,c.return,Lt)}}}else if(lt.tag===6){if(at===null)try{lt.stateNode.nodeValue=Ze?"":lt.memoizedProps}catch(Lt){ar(c,c.return,Lt)}}else if((lt.tag!==22&&lt.tag!==23||lt.memoizedState===null||lt===c)&&lt.child!==null){lt.child.return=lt,lt=lt.child;continue}if(lt===c)break e;for(;lt.sibling===null;){if(lt.return===null||lt.return===c)break e;at===lt&&(at=null),lt=lt.return}at===lt&&(at=null),lt.sibling.return=lt.return,lt=lt.sibling}}break;case 19:ja(d,c),Ya(c),b&4&&cb(c);break;case 21:break;default:ja(d,c),Ya(c)}}function Ya(c){var d=c.flags;if(d&2){try{e:{for(var m=c.return;m!==null;){if(ob(m)){var b=m;break e}m=m.return}throw Error(n(160))}switch(b.tag){case 5:var A=b.stateNode;b.flags&32&&(Ke(A,""),b.flags&=-33);var L=ib(c);P2(c,L,A);break;case 3:case 4:var V=b.stateNode.containerInfo,fe=ib(c);R2(c,fe,V);break;default:throw Error(n(161))}}catch(ke){ar(c,c.return,ke)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function sL(c,d,m){Mt=c,db(c)}function db(c,d,m){for(var b=(c.mode&1)!==0;Mt!==null;){var A=Mt,L=A.child;if(A.tag===22&&b){var V=A.memoizedState!==null||c1;if(!V){var fe=A.alternate,ke=fe!==null&&fe.memoizedState!==null||Wr;fe=c1;var Ze=Wr;if(c1=V,(Wr=ke)&&!Ze)for(Mt=A;Mt!==null;)V=Mt,ke=V.child,V.tag===22&&V.memoizedState!==null?pb(A):ke!==null?(ke.return=V,Mt=ke):pb(A);for(;L!==null;)Mt=L,db(L),L=L.sibling;Mt=A,c1=fe,Wr=Ze}fb(c)}else(A.subtreeFlags&8772)!==0&&L!==null?(L.return=A,Mt=L):fb(c)}}function fb(c){for(;Mt!==null;){var d=Mt;if((d.flags&8772)!==0){var m=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:Wr||u1(5,d);break;case 1:var b=d.stateNode;if(d.flags&4&&!Wr)if(m===null)b.componentDidMount();else{var A=d.elementType===d.type?m.memoizedProps:Ea(d.type,m.memoizedProps);b.componentDidUpdate(A,m.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var L=d.updateQueue;L!==null&&hy(d,L,b);break;case 3:var V=d.updateQueue;if(V!==null){if(m=null,d.child!==null)switch(d.child.tag){case 5:m=d.child.stateNode;break;case 1:m=d.child.stateNode}hy(d,V,m)}break;case 5:var fe=d.stateNode;if(m===null&&d.flags&4){m=fe;var ke=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":ke.autoFocus&&m.focus();break;case"img":ke.src&&(m.src=ke.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Ze=d.alternate;if(Ze!==null){var at=Ze.memoizedState;if(at!==null){var lt=at.dehydrated;lt!==null&&xn(lt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Wr||d.flags&512&&M2(d)}catch(rt){ar(d,d.return,rt)}}if(d===c){Mt=null;break}if(m=d.sibling,m!==null){m.return=d.return,Mt=m;break}Mt=d.return}}function hb(c){for(;Mt!==null;){var d=Mt;if(d===c){Mt=null;break}var m=d.sibling;if(m!==null){m.return=d.return,Mt=m;break}Mt=d.return}}function pb(c){for(;Mt!==null;){var d=Mt;try{switch(d.tag){case 0:case 11:case 15:var m=d.return;try{u1(4,d)}catch(ke){ar(d,m,ke)}break;case 1:var b=d.stateNode;if(typeof b.componentDidMount=="function"){var A=d.return;try{b.componentDidMount()}catch(ke){ar(d,A,ke)}}var L=d.return;try{M2(d)}catch(ke){ar(d,L,ke)}break;case 5:var V=d.return;try{M2(d)}catch(ke){ar(d,V,ke)}}}catch(ke){ar(d,d.return,ke)}if(d===c){Mt=null;break}var fe=d.sibling;if(fe!==null){fe.return=d.return,Mt=fe;break}Mt=d.return}}var aL=Math.ceil,d1=N.ReactCurrentDispatcher,L2=N.ReactCurrentOwner,ea=N.ReactCurrentBatchConfig,Cn=0,Cr=null,dr=null,$r=0,Hs=0,Kc=pi(0),br=0,Ld=null,xl=0,f1=0,T2=0,Td=null,ws=null,$2=0,Gc=1/0,Lo=null,h1=!1,D2=null,bi=null,p1=!1,xi=null,m1=0,$d=0,H2=null,g1=-1,v1=0;function rs(){return(Cn&6)!==0?st():g1!==-1?g1:g1=st()}function ki(c){return(c.mode&1)===0?1:(Cn&2)!==0&&$r!==0?$r&-$r:VP.transition!==null?(v1===0&&(v1=tn()),v1):(c=yn,c!==0||(c=window.event,c=c===void 0?16:ud(c.type)),c)}function Aa(c,d,m,b){if(50<$d)throw $d=0,H2=null,Error(n(185));ur(c,m,b),((Cn&2)===0||c!==Cr)&&(c===Cr&&((Cn&2)===0&&(f1|=m),br===4&&Si(c,$r)),ys(c,b),m===1&&Cn===0&&(d.mode&1)===0&&(Gc=st()+500,Uf&&gi()))}function ys(c,d){var m=c.callbackNode;Hn(c,d);var b=On(c,c===Cr?$r:0);if(b===0)m!==null&&bt(m),c.callbackNode=null,c.callbackPriority=0;else if(d=b&-b,c.callbackPriority!==d){if(m!=null&&bt(m),d===1)c.tag===0?ZP(gb.bind(null,c)):ty(gb.bind(null,c)),OP(function(){(Cn&6)===0&&gi()}),m=null;else{switch(Va(b)){case 1:m=An;break;case 4:m=Y;break;case 16:m=he;break;case 536870912:m=Ye;break;default:m=he}m=Eb(m,mb.bind(null,c))}c.callbackPriority=d,c.callbackNode=m}}function mb(c,d){if(g1=-1,v1=0,(Cn&6)!==0)throw Error(n(327));var m=c.callbackNode;if(Yc()&&c.callbackNode!==m)return null;var b=On(c,c===Cr?$r:0);if(b===0)return null;if((b&30)!==0||(b&c.expiredLanes)!==0||d)d=w1(c,b);else{d=b;var A=Cn;Cn|=2;var L=wb();(Cr!==c||$r!==d)&&(Lo=null,Gc=st()+500,Sl(c,d));do try{lL();break}catch(fe){vb(c,fe)}while(!0);e2(),d1.current=L,Cn=A,dr!==null?d=0:(Cr=null,$r=0,d=br)}if(d!==0){if(d===2&&(A=Ot(c),A!==0&&(b=A,d=O2(c,A))),d===1)throw m=Ld,Sl(c,0),Si(c,b),ys(c,st()),m;if(d===6)Si(c,b);else{if(A=c.current.alternate,(b&30)===0&&!oL(A)&&(d=w1(c,b),d===2&&(L=Ot(c),L!==0&&(b=L,d=O2(c,L))),d===1))throw m=Ld,Sl(c,0),Si(c,b),ys(c,st()),m;switch(c.finishedWork=A,c.finishedLanes=b,d){case 0:case 1:throw Error(n(345));case 2:El(c,ws,Lo);break;case 3:if(Si(c,b),(b&130023424)===b&&(d=$2+500-st(),10<d)){if(On(c,0)!==0)break;if(A=c.suspendedLanes,(A&b)!==b){rs(),c.pingedLanes|=c.suspendedLanes&A;break}c.timeoutHandle=zm(El.bind(null,c,ws,Lo),d);break}El(c,ws,Lo);break;case 4:if(Si(c,b),(b&4194240)===b)break;for(d=c.eventTimes,A=-1;0<b;){var V=31-Ht(b);L=1<<V,V=d[V],V>A&&(A=V),b&=~L}if(b=A,b=st()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*aL(b/1960))-b,10<b){c.timeoutHandle=zm(El.bind(null,c,ws,Lo),b);break}El(c,ws,Lo);break;case 5:El(c,ws,Lo);break;default:throw Error(n(329))}}}return ys(c,st()),c.callbackNode===m?mb.bind(null,c):null}function O2(c,d){var m=Td;return c.current.memoizedState.isDehydrated&&(Sl(c,d).flags|=256),c=w1(c,d),c!==2&&(d=ws,ws=m,d!==null&&I2(d)),c}function I2(c){ws===null?ws=c:ws.push.apply(ws,c)}function oL(c){for(var d=c;;){if(d.flags&16384){var m=d.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var b=0;b<m.length;b++){var A=m[b],L=A.getSnapshot;A=A.value;try{if(!ka(L(),A))return!1}catch{return!1}}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Si(c,d){for(d&=~T2,d&=~f1,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var m=31-Ht(d),b=1<<m;c[m]=-1,d&=~b}}function gb(c){if((Cn&6)!==0)throw Error(n(327));Yc();var d=On(c,0);if((d&1)===0)return ys(c,st()),null;var m=w1(c,d);if(c.tag!==0&&m===2){var b=Ot(c);b!==0&&(d=b,m=O2(c,b))}if(m===1)throw m=Ld,Sl(c,0),Si(c,d),ys(c,st()),m;if(m===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,El(c,ws,Lo),ys(c,st()),null}function F2(c,d){var m=Cn;Cn|=1;try{return c(d)}finally{Cn=m,Cn===0&&(Gc=st()+500,Uf&&gi())}}function kl(c){xi!==null&&xi.tag===0&&(Cn&6)===0&&Yc();var d=Cn;Cn|=1;var m=ea.transition,b=yn;try{if(ea.transition=null,yn=1,c)return c()}finally{yn=b,ea.transition=m,Cn=d,(Cn&6)===0&&gi()}}function _2(){Hs=Kc.current,Yn(Kc)}function Sl(c,d){c.finishedWork=null,c.finishedLanes=0;var m=c.timeoutHandle;if(m!==-1&&(c.timeoutHandle=-1,HP(m)),dr!==null)for(m=dr.return;m!==null;){var b=m;switch(Ym(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&zf();break;case 3:Bc(),Yn(ms),Yn(zr),l2();break;case 5:o2(b);break;case 4:Bc();break;case 13:Yn(Qn);break;case 19:Yn(Qn);break;case 10:t2(b.type._context);break;case 22:case 23:_2()}m=m.return}if(Cr=c,dr=c=Ei(c.current,null),$r=Hs=d,br=0,Ld=null,T2=f1=xl=0,ws=Td=null,wl!==null){for(d=0;d<wl.length;d++)if(m=wl[d],b=m.interleaved,b!==null){m.interleaved=null;var A=b.next,L=m.pending;if(L!==null){var V=L.next;L.next=A,b.next=V}m.pending=b}wl=null}return c}function vb(c,d){do{var m=dr;try{if(e2(),t1.current=a1,n1){for(var b=Jn.memoizedState;b!==null;){var A=b.queue;A!==null&&(A.pending=null),b=b.next}n1=!1}if(bl=0,Er=yr=Jn=null,jd=!1,Ad=0,L2.current=null,m===null||m.return===null){br=1,Ld=d,dr=null;break}e:{var L=c,V=m.return,fe=m,ke=d;if(d=$r,fe.flags|=32768,ke!==null&&typeof ke=="object"&&typeof ke.then=="function"){var Ze=ke,at=fe,lt=at.tag;if((at.mode&1)===0&&(lt===0||lt===11||lt===15)){var rt=at.alternate;rt?(at.updateQueue=rt.updateQueue,at.memoizedState=rt.memoizedState,at.lanes=rt.lanes):(at.updateQueue=null,at.memoizedState=null)}var jt=Vy(V);if(jt!==null){jt.flags&=-257,zy(jt,V,fe,L,d),jt.mode&1&&Zy(L,Ze,d),d=jt,ke=Ze;var Rt=d.updateQueue;if(Rt===null){var Lt=new Set;Lt.add(ke),d.updateQueue=Lt}else Rt.add(ke);break e}else{if((d&1)===0){Zy(L,Ze,d),Z2();break e}ke=Error(n(426))}}else if(Xn&&fe.mode&1){var ir=Vy(V);if(ir!==null){(ir.flags&65536)===0&&(ir.flags|=256),zy(ir,V,fe,L,d),Qm(Uc(ke,fe));break e}}L=ke=Uc(ke,fe),br!==4&&(br=2),Td===null?Td=[L]:Td.push(L),L=V;do{switch(L.tag){case 3:L.flags|=65536,d&=-d,L.lanes|=d;var $e=Fy(L,ke,d);fy(L,$e);break e;case 1:fe=ke;var Ae=L.type,He=L.stateNode;if((L.flags&128)===0&&(typeof Ae.getDerivedStateFromError=="function"||He!==null&&typeof He.componentDidCatch=="function"&&(bi===null||!bi.has(He)))){L.flags|=65536,d&=-d,L.lanes|=d;var ft=_y(L,fe,d);fy(L,ft);break e}}L=L.return}while(L!==null)}bb(m)}catch(Tt){d=Tt,dr===m&&m!==null&&(dr=m=m.return);continue}break}while(!0)}function wb(){var c=d1.current;return d1.current=a1,c===null?a1:c}function Z2(){(br===0||br===3||br===2)&&(br=4),Cr===null||(xl&268435455)===0&&(f1&268435455)===0||Si(Cr,$r)}function w1(c,d){var m=Cn;Cn|=2;var b=wb();(Cr!==c||$r!==d)&&(Lo=null,Sl(c,d));do try{iL();break}catch(A){vb(c,A)}while(!0);if(e2(),Cn=m,d1.current=b,dr!==null)throw Error(n(261));return Cr=null,$r=0,br}function iL(){for(;dr!==null;)yb(dr)}function lL(){for(;dr!==null&&!vt();)yb(dr)}function yb(c){var d=Sb(c.alternate,c,Hs);c.memoizedProps=c.pendingProps,d===null?bb(c):dr=d,L2.current=null}function bb(c){var d=c;do{var m=d.alternate;if(c=d.return,(d.flags&32768)===0){if(m=eL(m,d,Hs),m!==null){dr=m;return}}else{if(m=tL(m,d),m!==null){m.flags&=32767,dr=m;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{br=6,dr=null;return}}if(d=d.sibling,d!==null){dr=d;return}dr=d=c}while(d!==null);br===0&&(br=5)}function El(c,d,m){var b=yn,A=ea.transition;try{ea.transition=null,yn=1,cL(c,d,m,b)}finally{ea.transition=A,yn=b}return null}function cL(c,d,m,b){do Yc();while(xi!==null);if((Cn&6)!==0)throw Error(n(327));m=c.finishedWork;var A=c.finishedLanes;if(m===null)return null;if(c.finishedWork=null,c.finishedLanes=0,m===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var L=m.lanes|m.childLanes;if(Zr(c,L),c===Cr&&(dr=Cr=null,$r=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||p1||(p1=!0,Eb(he,function(){return Yc(),null})),L=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||L){L=ea.transition,ea.transition=null;var V=yn;yn=1;var fe=Cn;Cn|=4,L2.current=null,rL(c,m),ub(m,c),MP(Zm),hs=!!_m,Zm=_m=null,c.current=m,sL(m),Ct(),Cn=fe,yn=V,ea.transition=L}else c.current=m;if(p1&&(p1=!1,xi=c,m1=A),L=c.pendingLanes,L===0&&(bi=null),Zt(m.stateNode),ys(c,st()),d!==null)for(b=c.onRecoverableError,m=0;m<d.length;m++)A=d[m],b(A.value,{componentStack:A.stack,digest:A.digest});if(h1)throw h1=!1,c=D2,D2=null,c;return(m1&1)!==0&&c.tag!==0&&Yc(),L=c.pendingLanes,(L&1)!==0?c===H2?$d++:($d=0,H2=c):$d=0,gi(),null}function Yc(){if(xi!==null){var c=Va(m1),d=ea.transition,m=yn;try{if(ea.transition=null,yn=16>c?16:c,xi===null)var b=!1;else{if(c=xi,xi=null,m1=0,(Cn&6)!==0)throw Error(n(331));var A=Cn;for(Cn|=4,Mt=c.current;Mt!==null;){var L=Mt,V=L.child;if((Mt.flags&16)!==0){var fe=L.deletions;if(fe!==null){for(var ke=0;ke<fe.length;ke++){var Ze=fe[ke];for(Mt=Ze;Mt!==null;){var at=Mt;switch(at.tag){case 0:case 11:case 15:Pd(8,at,L)}var lt=at.child;if(lt!==null)lt.return=at,Mt=lt;else for(;Mt!==null;){at=Mt;var rt=at.sibling,jt=at.return;if(ab(at),at===Ze){Mt=null;break}if(rt!==null){rt.return=jt,Mt=rt;break}Mt=jt}}}var Rt=L.alternate;if(Rt!==null){var Lt=Rt.child;if(Lt!==null){Rt.child=null;do{var ir=Lt.sibling;Lt.sibling=null,Lt=ir}while(Lt!==null)}}Mt=L}}if((L.subtreeFlags&2064)!==0&&V!==null)V.return=L,Mt=V;else e:for(;Mt!==null;){if(L=Mt,(L.flags&2048)!==0)switch(L.tag){case 0:case 11:case 15:Pd(9,L,L.return)}var $e=L.sibling;if($e!==null){$e.return=L.return,Mt=$e;break e}Mt=L.return}}var Ae=c.current;for(Mt=Ae;Mt!==null;){V=Mt;var He=V.child;if((V.subtreeFlags&2064)!==0&&He!==null)He.return=V,Mt=He;else e:for(V=Ae;Mt!==null;){if(fe=Mt,(fe.flags&2048)!==0)try{switch(fe.tag){case 0:case 11:case 15:u1(9,fe)}}catch(Tt){ar(fe,fe.return,Tt)}if(fe===V){Mt=null;break e}var ft=fe.sibling;if(ft!==null){ft.return=fe.return,Mt=ft;break e}Mt=fe.return}}if(Cn=A,gi(),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(dt,c)}catch{}b=!0}return b}finally{yn=m,ea.transition=d}}return!1}function xb(c,d,m){d=Uc(m,d),d=Fy(c,d,1),c=wi(c,d,1),d=rs(),c!==null&&(ur(c,1,d),ys(c,d))}function ar(c,d,m){if(c.tag===3)xb(c,c,m);else for(;d!==null;){if(d.tag===3){xb(d,c,m);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(bi===null||!bi.has(b))){c=Uc(m,c),c=_y(d,c,1),d=wi(d,c,1),c=rs(),d!==null&&(ur(d,1,c),ys(d,c));break}}d=d.return}}function uL(c,d,m){var b=c.pingCache;b!==null&&b.delete(d),d=rs(),c.pingedLanes|=c.suspendedLanes&m,Cr===c&&($r&m)===m&&(br===4||br===3&&($r&130023424)===$r&&500>st()-$2?Sl(c,0):T2|=m),ys(c,d)}function kb(c,d){d===0&&((c.mode&1)===0?d=1:(d=In,In<<=1,(In&130023424)===0&&(In=4194304)));var m=rs();c=Mo(c,d),c!==null&&(ur(c,d,m),ys(c,m))}function dL(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),kb(c,m)}function fL(c,d){var m=0;switch(c.tag){case 13:var b=c.stateNode,A=c.memoizedState;A!==null&&(m=A.retryLane);break;case 19:b=c.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(d),kb(c,m)}var Sb;Sb=function(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps||ms.current)vs=!0;else{if((c.lanes&m)===0&&(d.flags&128)===0)return vs=!1,JP(c,d,m);vs=(c.flags&131072)!==0}else vs=!1,Xn&&(d.flags&1048576)!==0&&ny(d,Kf,d.index);switch(d.lanes=0,d.tag){case 2:var b=d.type;l1(c,d),c=d.pendingProps;var A=Oc(d,zr.current);zc(d,m),A=d2(null,d,b,c,A,m);var L=f2();return d.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,gs(b)?(L=!0,Bf(d)):L=!1,d.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,s2(d),A.updater=o1,d.stateNode=A,A._reactInternals=d,w2(d,b,c,m),d=k2(null,d,b,!0,L,m)):(d.tag=0,Xn&&L&&Gm(d),ns(null,d,A,m),d=d.child),d;case 16:b=d.elementType;e:{switch(l1(c,d),c=d.pendingProps,A=b._init,b=A(b._payload),d.type=b,A=d.tag=pL(b),c=Ea(b,c),A){case 0:d=x2(null,d,b,c,m);break e;case 1:d=Yy(null,d,b,c,m);break e;case 11:d=By(null,d,b,c,m);break e;case 14:d=Uy(null,d,b,Ea(b.type,c),m);break e}throw Error(n(306,b,""))}return d;case 0:return b=d.type,A=d.pendingProps,A=d.elementType===b?A:Ea(b,A),x2(c,d,b,A,m);case 1:return b=d.type,A=d.pendingProps,A=d.elementType===b?A:Ea(b,A),Yy(c,d,b,A,m);case 3:e:{if(qy(d),c===null)throw Error(n(387));b=d.pendingProps,L=d.memoizedState,A=L.element,dy(c,d),Jf(d,b,null,m);var V=d.memoizedState;if(b=V.element,L.isDehydrated)if(L={element:b,isDehydrated:!1,cache:V.cache,pendingSuspenseBoundaries:V.pendingSuspenseBoundaries,transitions:V.transitions},d.updateQueue.baseState=L,d.memoizedState=L,d.flags&256){A=Uc(Error(n(423)),d),d=Xy(c,d,b,m,A);break e}else if(b!==A){A=Uc(Error(n(424)),d),d=Xy(c,d,b,m,A);break e}else for(Ds=hi(d.stateNode.containerInfo.firstChild),$s=d,Xn=!0,Sa=null,m=cy(d,null,b,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(_c(),b===A){d=Po(c,d,m);break e}ns(c,d,b,m)}d=d.child}return d;case 5:return py(d),c===null&&Xm(d),b=d.type,A=d.pendingProps,L=c!==null?c.memoizedProps:null,V=A.children,Vm(b,A)?V=null:L!==null&&Vm(b,L)&&(d.flags|=32),Gy(c,d),ns(c,d,V,m),d.child;case 6:return c===null&&Xm(d),null;case 13:return Qy(c,d,m);case 4:return a2(d,d.stateNode.containerInfo),b=d.pendingProps,c===null?d.child=Zc(d,null,b,m):ns(c,d,b,m),d.child;case 11:return b=d.type,A=d.pendingProps,A=d.elementType===b?A:Ea(b,A),By(c,d,b,A,m);case 7:return ns(c,d,d.pendingProps,m),d.child;case 8:return ns(c,d,d.pendingProps.children,m),d.child;case 12:return ns(c,d,d.pendingProps.children,m),d.child;case 10:e:{if(b=d.type._context,A=d.pendingProps,L=d.memoizedProps,V=A.value,Un(qf,b._currentValue),b._currentValue=V,L!==null)if(ka(L.value,V)){if(L.children===A.children&&!ms.current){d=Po(c,d,m);break e}}else for(L=d.child,L!==null&&(L.return=d);L!==null;){var fe=L.dependencies;if(fe!==null){V=L.child;for(var ke=fe.firstContext;ke!==null;){if(ke.context===b){if(L.tag===1){ke=Ro(-1,m&-m),ke.tag=2;var Ze=L.updateQueue;if(Ze!==null){Ze=Ze.shared;var at=Ze.pending;at===null?ke.next=ke:(ke.next=at.next,at.next=ke),Ze.pending=ke}}L.lanes|=m,ke=L.alternate,ke!==null&&(ke.lanes|=m),n2(L.return,m,d),fe.lanes|=m;break}ke=ke.next}}else if(L.tag===10)V=L.type===d.type?null:L.child;else if(L.tag===18){if(V=L.return,V===null)throw Error(n(341));V.lanes|=m,fe=V.alternate,fe!==null&&(fe.lanes|=m),n2(V,m,d),V=L.sibling}else V=L.child;if(V!==null)V.return=L;else for(V=L;V!==null;){if(V===d){V=null;break}if(L=V.sibling,L!==null){L.return=V.return,V=L;break}V=V.return}L=V}ns(c,d,A.children,m),d=d.child}return d;case 9:return A=d.type,b=d.pendingProps.children,zc(d,m),A=Qs(A),b=b(A),d.flags|=1,ns(c,d,b,m),d.child;case 14:return b=d.type,A=Ea(b,d.pendingProps),A=Ea(b.type,A),Uy(c,d,b,A,m);case 15:return Wy(c,d,d.type,d.pendingProps,m);case 17:return b=d.type,A=d.pendingProps,A=d.elementType===b?A:Ea(b,A),l1(c,d),d.tag=1,gs(b)?(c=!0,Bf(d)):c=!1,zc(d,m),Oy(d,b,A),w2(d,b,A,m),k2(null,d,b,!0,c,m);case 19:return eb(c,d,m);case 22:return Ky(c,d,m)}throw Error(n(156,d.tag))};function Eb(c,d){return Te(c,d)}function hL(c,d,m,b){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ta(c,d,m,b){return new hL(c,d,m,b)}function V2(c){return c=c.prototype,!(!c||!c.isReactComponent)}function pL(c){if(typeof c=="function")return V2(c)?1:0;if(c!=null){if(c=c.$$typeof,c===D)return 11;if(c===Z)return 14}return 2}function Ei(c,d){var m=c.alternate;return m===null?(m=ta(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&14680064,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m}function y1(c,d,m,b,A,L){var V=2;if(b=c,typeof c=="function")V2(c)&&(V=1);else if(typeof c=="string")V=5;else e:switch(c){case M:return Cl(m.children,A,L,d);case C:V=8,A|=8;break;case R:return c=ta(12,m,d,A|2),c.elementType=R,c.lanes=L,c;case K:return c=ta(13,m,d,A),c.elementType=K,c.lanes=L,c;case O:return c=ta(19,m,d,A),c.elementType=O,c.lanes=L,c;case B:return b1(m,A,L,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case T:V=10;break e;case H:V=9;break e;case D:V=11;break e;case Z:V=14;break e;case te:V=16,b=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return d=ta(V,m,d,A),d.elementType=c,d.type=b,d.lanes=L,d}function Cl(c,d,m,b){return c=ta(7,c,b,d),c.lanes=m,c}function b1(c,d,m,b){return c=ta(22,c,b,d),c.elementType=B,c.lanes=m,c.stateNode={isHidden:!1},c}function z2(c,d,m){return c=ta(6,c,null,d),c.lanes=m,c}function B2(c,d,m){return d=ta(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function mL(c,d,m,b,A){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vn(0),this.expirationTimes=Vn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.identifierPrefix=b,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function U2(c,d,m,b,A,L,V,fe,ke){return c=new mL(c,d,m,fe,ke),d===1?(d=1,L===!0&&(d|=8)):d=0,L=ta(3,null,null,d),c.current=L,L.stateNode=c,L.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},s2(L),c}function gL(c,d,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:b==null?null:""+b,children:c,containerInfo:d,implementation:m}}function Cb(c){if(!c)return mi;c=c._reactInternals;e:{if(Ge(c)!==c||c.tag!==1)throw Error(n(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(gs(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(c.tag===1){var m=c.type;if(gs(m))return Jw(c,m,d)}return d}function jb(c,d,m,b,A,L,V,fe,ke){return c=U2(m,b,!0,c,A,L,V,fe,ke),c.context=Cb(null),m=c.current,b=rs(),A=ki(m),L=Ro(b,A),L.callback=d??null,wi(m,L,A),c.current.lanes=A,ur(c,A,b),ys(c,b),c}function x1(c,d,m,b){var A=d.current,L=rs(),V=ki(A);return m=Cb(m),d.context===null?d.context=m:d.pendingContext=m,d=Ro(L,V),d.payload={element:c},b=b===void 0?null:b,b!==null&&(d.callback=b),c=wi(A,d,V),c!==null&&(Aa(c,A,V,L),Qf(c,A,V)),V}function k1(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function Ab(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<d?m:d}}function W2(c,d){Ab(c,d),(c=c.alternate)&&Ab(c,d)}function vL(){return null}var Nb=typeof reportError=="function"?reportError:function(c){console.error(c)};function K2(c){this._internalRoot=c}S1.prototype.render=K2.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(n(409));x1(c,d,null,null)},S1.prototype.unmount=K2.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;kl(function(){x1(null,c,null,null)}),d[Co]=null}};function S1(c){this._internalRoot=c}S1.prototype.unstable_scheduleHydration=function(c){if(c){var d=wa();c={blockedOn:null,target:c,priority:d};for(var m=0;m<Lr.length&&d!==0&&d<Lr[m].priority;m++);Lr.splice(m,0,c),m===0&&Je(c)}};function G2(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function E1(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function Mb(){}function wL(c,d,m,b,A){if(A){if(typeof b=="function"){var L=b;b=function(){var Ze=k1(V);L.call(Ze)}}var V=jb(d,b,c,0,null,!1,!1,"",Mb);return c._reactRootContainer=V,c[Co]=V.current,wd(c.nodeType===8?c.parentNode:c),kl(),V}for(;A=c.lastChild;)c.removeChild(A);if(typeof b=="function"){var fe=b;b=function(){var Ze=k1(ke);fe.call(Ze)}}var ke=U2(c,0,!1,null,null,!1,!1,"",Mb);return c._reactRootContainer=ke,c[Co]=ke.current,wd(c.nodeType===8?c.parentNode:c),kl(function(){x1(d,ke,m,b)}),ke}function C1(c,d,m,b,A){var L=m._reactRootContainer;if(L){var V=L;if(typeof A=="function"){var fe=A;A=function(){var ke=k1(V);fe.call(ke)}}x1(d,V,c,A)}else V=wL(m,d,c,A,b);return k1(V)}ko=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var m=Dt(d.pendingLanes);m!==0&&(zn(d,m|1),ys(d,st()),(Cn&6)===0&&(Gc=st()+500,gi()))}break;case 13:kl(function(){var b=Mo(c,1);if(b!==null){var A=rs();Aa(b,c,1,A)}}),W2(c,1)}},So=function(c){if(c.tag===13){var d=Mo(c,134217728);if(d!==null){var m=rs();Aa(d,c,134217728,m)}W2(c,134217728)}},ul=function(c){if(c.tag===13){var d=ki(c),m=Mo(c,d);if(m!==null){var b=rs();Aa(m,c,d,b)}W2(c,d)}},wa=function(){return yn},Eo=function(c,d){var m=yn;try{return yn=c,d()}finally{yn=m}},St=function(c,d,m){switch(d){case"input":if(ze(c,m),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<m.length;d++){var b=m[d];if(b!==c&&b.form===c.form){var A=Vf(b);if(!A)throw Error(n(90));re(b),ze(b,A)}}}break;case"textarea":Ue(c,m);break;case"select":d=m.value,d!=null&&Pe(c,!!m.multiple,d,!1)}},ot=F2,kn=kl;var yL={usingClientEntryPoint:!1,Events:[xd,Dc,Vf,et,mt,F2]},Dd={findFiberByHostInstance:pl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bL={bundleType:Dd.bundleType,version:Dd.version,rendererPackageName:Dd.rendererPackageName,rendererConfig:Dd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=pe(c),c===null?null:c.stateNode},findFiberByHostInstance:Dd.findFiberByHostInstance||vL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var j1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!j1.isDisabled&&j1.supportsFiber)try{dt=j1.inject(bL),wt=j1}catch{}}return bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yL,bs.createPortal=function(c,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G2(d))throw Error(n(200));return gL(c,d,null,m)},bs.createRoot=function(c,d){if(!G2(c))throw Error(n(299));var m=!1,b="",A=Nb;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onRecoverableError!==void 0&&(A=d.onRecoverableError)),d=U2(c,1,!1,null,null,m,!1,b,A),c[Co]=d.current,wd(c.nodeType===8?c.parentNode:c),new K2(d)},bs.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=pe(d),c=c===null?null:c.stateNode,c},bs.flushSync=function(c){return kl(c)},bs.hydrate=function(c,d,m){if(!E1(d))throw Error(n(200));return C1(null,c,d,!0,m)},bs.hydrateRoot=function(c,d,m){if(!G2(c))throw Error(n(405));var b=m!=null&&m.hydratedSources||null,A=!1,L="",V=Nb;if(m!=null&&(m.unstable_strictMode===!0&&(A=!0),m.identifierPrefix!==void 0&&(L=m.identifierPrefix),m.onRecoverableError!==void 0&&(V=m.onRecoverableError)),d=jb(d,null,c,1,m??null,A,!1,L,V),c[Co]=d.current,wd(c),b)for(c=0;c<b.length;c++)m=b[c],A=m._getVersion,A=A(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,A]:d.mutableSourceEagerHydrationData.push(m,A);return new S1(d)},bs.render=function(c,d,m){if(!E1(d))throw Error(n(200));return C1(null,c,d,!1,m)},bs.unmountComponentAtNode=function(c){if(!E1(c))throw Error(n(40));return c._reactRootContainer?(kl(function(){C1(null,null,c,!1,function(){c._reactRootContainer=null,c[Co]=null})}),!0):!1},bs.unstable_batchedUpdates=F2,bs.unstable_renderSubtreeIntoContainer=function(c,d,m,b){if(!E1(m))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return C1(c,d,m,!1,b)},bs.version="18.3.1-next-f1338f8080-20240426",bs}var _b;function J5(){if(_b)return Q2.exports;_b=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Q2.exports=NL(),Q2.exports}var Zb;function ML(){if(Zb)return A1;Zb=1;var e=J5();return A1.createRoot=e.createRoot,A1.hydrateRoot=e.hydrateRoot,A1}var RL=ML();/**
41
- * react-router v7.18.3
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var eS=e=>{throw TypeError(e)},tS=(e,t,n)=>t.has(e)||eS("Cannot "+n),sa=(e,t,n)=>(tS(e,t,"read from private field"),n?n.call(e):t.get(e)),Qd=(e,t,n)=>t.has(e)?eS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),qa=(e,t,n,r)=>(tS(e,t,"write to private field"),t.set(e,n),n),op=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ip=/^[\\/]{2}/;function nS(e,t){return t+e.replace(/\\/g,"/")}var Vb="popstate";function zb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function PL(e={}){function t(r,a){var h;let i=(h=a.state)==null?void 0:h.masked,{pathname:l,search:u,hash:f}=i||r.location;return w0("",{pathname:l,search:u,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:ls(a)}return TL(t,n,null,e)}function rn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function LL(){return Math.random().toString(36).substring(2,10)}function Bb(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function w0(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?yo(t):t,state:n,key:t&&t.key||r||LL(),mask:a}}function ls({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function yo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function TL(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,u="POP",f=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function g(){u="POP";let k=p(),S=k==null?null:k-h;h=k,f&&f({action:u,location:x.location,delta:S})}function v(k,S){u="PUSH";let E=zb(k)?k:w0(x.location,k,S);h=p()+1;let j=Bb(E,h),N=x.createHref(E.mask||E);try{l.pushState(j,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(N)}i&&f&&f({action:u,location:x.location,delta:1})}function w(k,S){u="REPLACE";let E=zb(k)?k:w0(x.location,k,S);h=p();let j=Bb(E,h),N=x.createHref(E.mask||E);l.replaceState(j,"",N),i&&f&&f({action:u,location:x.location,delta:0})}function y(k){return rS(a,k)}let x={get action(){return u},get location(){return e(a,l)},listen(k){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Vb,g),f=k,()=>{a.removeEventListener(Vb,g),f=null}},createHref(k){return t(a,k)},createURL:y,encodeLocation(k){let S=y(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:w,go(k){return l.go(k)}};return x}function rS(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),rn(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:ls(t);return a=a.replace(/ $/,"%20"),!n&&ip.test(a)&&(a=r+a),new URL(a,r)}var Jd,Ub=class{constructor(e){if(Qd(this,Jd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(sa(this,Jd).has(e))return sa(this,Jd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){sa(this,Jd).set(e,t)}};Jd=new WeakMap;var $L=new Set(["lazy","caseSensitive","path","id","index","children"]);function DL(e){return $L.has(e)}var HL=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function OL(e){return HL.has(e)}function IL(e){return e.index===!0}function y0(e,t,n=[],r={},a=!1){return e.map((i,l)=>{let u=[...n,String(l)],f=typeof i.id=="string"?i.id:u.join("-");if(rn(i.index!==!0||!i.children,"Cannot specify children on an index route"),rn(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),IL(i)){let h={...i,id:f};return r[f]=Wb(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=Wb(h,t(h)),i.children&&(h.children=y0(i.children,t,u,r,a)),h}})}function Wb(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function sS(e,t,n="/"){return Na(e,t,n,!1)}function Na(e,t,n,r,a){let i=typeof t=="string"?yo(t):t,l=zs(i.pathname||"/",n);if(l==null)return null;let u=a??sh(e),f=null,h=uS(l);for(let p=0;f==null&&p<u.length;++p)f=GL(u[p],h,r);return f}function aS(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function sh(e){let t=oS(e);return FL(t),t}function oS(e,t=[],n=[],r="",a=!1){let i=(l,u,f=a,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;rn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=ua([r,p.relativePath]),v=n.concat(p);l.children&&l.children.length>0&&(rn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),oS(l.children,t,v,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:WL(g,l.index),routesMeta:v.map((w,y)=>{let[x,k]=cS(w.relativePath,w.caseSensitive,y===v.length-1);return{...w,matcher:x,compiledParams:k}})})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let h of iS(l.path))i(l,u,!0,h)}),t}function iS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=iS(r.join("/")),u=[];return u.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&u.push(...l),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function FL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _L=/^:[\w-]+$/,ZL=3,VL=2,zL=1,BL=10,UL=-2,Kb=e=>e==="*";function WL(e,t){let n=e.split("/"),r=n.length;return n.some(Kb)&&(r+=UL),t&&(r+=VL),n.filter(a=>!Kb(a)).reduce((a,i)=>a+(_L.test(i)?ZL:i===""?zL:BL),r)}function KL(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function GL(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,p=i==="/"?t:t.slice(i.length)||"/",g={path:f.relativePath,caseSensitive:f.caseSensitive,end:h},v=f.matcher&&f.compiledParams?lS(g,p,f.matcher,f.compiledParams):Wi(g,p),w=f.route;if(!v&&h&&n&&!r[r.length-1].route.index&&(v=Wi({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),l.push({params:a,pathname:ua([i,v.pathname]),pathnameBase:XL(ua([i,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(i=ua([i,v.pathnameBase]))}return l}function us(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(qn(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",a=l=>l==null?"":typeof l=="string"?l:String(l),i=n.split(/\/+/).map((l,u,f)=>{if(u===f.length-1&&l==="*")return a(t["*"]);const p=l.match(/^:([\w-]+)(\??)(.*)/);if(p){const[,g,v,w]=p;let y=t[g];return rn(v==="?"||y!=null,`Missing ":${g}" param`),encodeURIComponent(a(y))+w}return l.replace(/\?$/g,"")}).filter(l=>!!l);return r+i.join("/")}function Wi(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=cS(e.path,e.caseSensitive,e.end);return lS(e,t,n,r)}function lS(e,t,n,r){let a=t.match(n);if(!a)return null;let i=a[0],l=Tu(i,1),u=a.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:g},v)=>{if(p==="*"){let y=u[v]||"";l=Tu(i.slice(0,i.length-y.length),1)}const w=u[v];return g&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:l,pattern:e}}function cS(e,t=!1,n=!0){qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,f,h,p)=>{if(r.push({paramName:u,isOptional:f!=null}),f){let g=p.charAt(h+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function uS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function zs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function YL({basename:e,pathname:t}){return t==="/"?e:ua([e,t])}var Y6=e=>op.test(e);function qL(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?yo(e):e,i;return n?(n=q6(n),n.startsWith("/")||n.startsWith("\\")?i=Gb(n.substring(1),"/"):i=Gb(n,t)):i=t,{pathname:i,search:QL(r),hash:JL(a)}}function Gb(e,t){let n=Tu(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function tg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function dS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lp(e){let t=dS(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function z0(e,t,n,r=!1){let a;typeof e=="string"?a=yo(e):(a={...e},rn(!a.pathname||!a.pathname.includes("?"),tg("?","pathname","search",a)),rn(!a.pathname||!a.pathname.includes("#"),tg("#","pathname","hash",a)),rn(!a.search||!a.search.includes("#"),tg("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=qL(a,u),h=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var q6=e=>e.replace(/[\\/]{2,}/g,"/"),ua=e=>q6(e.join("/"));function Tu(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var XL=e=>Tu(e).replace(/^\/*/,"/"),QL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,JL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,eT=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],B0=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function b0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function U0(e){let t=e.map(n=>n.route.path).filter(Boolean);return ua(t)||"/"}var fS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hS(e,t){let n=e;if(typeof n!="string"||!op.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(fS)try{let i=new URL(window.location.href),l=ip.test(n)?new URL(nS(n,i.protocol)):new URL(n),u=zs(l.pathname,t);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{qn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Hi=Symbol("Uninstrumented");function tT(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(i){let l=Object.keys(n);for(let u of l)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=mu(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(i=>{let l=a[i],u=n[`lazy.${i}`];if(typeof l=="function"&&u.length>0){let f=mu(u,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(a=>{let i=t[a];if(typeof i=="function"&&n[a].length>0){let l=i[Hi]??i,u=mu(n[a],l,(...f)=>Yb(f[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[Hi]=l,r[a]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let i=a[Hi]??a,l=mu(n.middleware,i,(...u)=>Yb(u[0]));return l?(l[Hi]=i,l):a})),r}function nT(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let i=Object.keys(a);for(let l of i)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[Hi]??e.navigate,a=mu(n.navigate,r,(...i)=>{let[l,u]=i;return{to:typeof l=="number"||typeof l=="string"?l:l?ls(l):".",...qb(e,u??{})}});a&&(a[Hi]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Hi]??e.fetch,a=mu(n.fetch,r,(...i)=>{let[l,,u,f]=i;return{href:u??".",fetcherKey:l,...qb(e,f??{})}});a&&(a[Hi]=r,e.fetch=a)}return e}function mu(e,t,n){return e.length===0?null:async(...r)=>{let a=await pS(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function pS(e,t,n,r){let a=e[r],i;if(a){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=pS(e,t,n,r-1),i=await l,rn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await a(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await u(),await l}else try{i={type:"success",value:await n()}}catch(l){i={type:"error",value:l}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Yb(e){let{request:t,context:n,params:r,pattern:a}=e;return{request:rT(t),params:{...r},pattern:a,context:sT(n)}}function qb(e,t){return{currentUrl:ls(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function rT(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function sT(e){if(oT(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var aT=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oT(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===aT}var Xb=new URL("http://localhost");function X6(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Xb)}catch{return Xb}}function ng(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function iT(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===""||e.slice(n.length).startsWith("//"):!1}function bu(e,t,n,r){let a=null;try{a=e==null?null:new URL(e,n)}catch{}let i=new URL(t,n),l=a!=null&&!ng(a,n),u=!ng(i,n);if(r==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!iT(e,a)||!ng(a,i)))throw new Error("External navigation is not allowed")}var mS=["POST","PUT","PATCH","DELETE"],lT=new Set(mS),cT=["GET",...mS],uT=new Set(cT),gS=new Set([301,302,303,307,308]),dT=new Set([307,308]),rg={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fT={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Od={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hT=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),vS="remix-router-transitions",wS=Symbol("ResetLoaderData"),Ll,iu,Ni,lu,pT=class{constructor(e){Qd(this,Ll),Qd(this,iu),Qd(this,Ni),Qd(this,lu),qa(this,Ll,e),qa(this,iu,sh(e))}get stableRoutes(){return sa(this,Ll)}get activeRoutes(){return sa(this,Ni)??sa(this,Ll)}get branches(){return sa(this,lu)??sa(this,iu)}get hasHMRRoutes(){return sa(this,Ni)!=null}setRoutes(e){qa(this,Ll,e),qa(this,iu,sh(e))}setHmrRoutes(e){qa(this,Ni,e),qa(this,lu,sh(e))}commitHmrRoutes(){sa(this,Ni)&&(qa(this,Ll,sa(this,Ni)),qa(this,iu,sa(this,lu)),qa(this,Ni,void 0),qa(this,lu,void 0))}};Ll=new WeakMap;iu=new WeakMap;Ni=new WeakMap;lu=new WeakMap;function mT(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";rn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||hT,i=a;if(e.instrumentations){let se=e.instrumentations;i=oe=>({...a(oe),...tT(se.map(we=>we.route).filter(Boolean),oe)})}let l={},u=new pT(y0(e.routes,i,void 0,l)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=e.dataStrategy||bT,p={...e.future},g=null,v=new Set,w=null,y=null,x=null,k=null,S=e.hydrationData!=null,E=Na(u.activeRoutes,e.history.location,f,!1,u.branches),j=!1,N=null,P,$;if(E==null&&!e.patchRoutesOnNavigation){let se=aa(404,{pathname:e.history.location.pathname}),{matches:oe,route:we}=N1(u.activeRoutes);P=!0,$=!P,E=oe,N={[we.id]:se}}else if(E&&!e.hydrationData&&ut(E,u.activeRoutes,e.history.location.pathname).active&&(E=null),E)if(E.some(se=>se.route.lazy))P=!1,$=!P;else if(!E.some(se=>Q6(se.route)))P=!0,$=!P;else{let se=e.hydrationData?e.hydrationData.loaderData:null,oe=e.hydrationData?e.hydrationData.errors:null,we=E;if(oe){let ge=E.findIndex(J=>oe[J.route.id]!==void 0);we=we.slice(0,ge+1)}$=!1,P=!0,we.forEach(ge=>{let J=yS(ge.route,se,oe);$=$||J.renderFallback,P=P&&!J.shouldLoad})}else{P=!1,$=!P,E=[];let se=ut(null,u.activeRoutes,e.history.location.pathname);se.active&&se.matches&&(j=!0,E=se.matches)}let M,C={historyAction:e.history.action,location:e.history.location,matches:E,initialized:P,renderFallback:$,navigation:rg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},R="POP",T=null,H=!1,D,K=!1,O=new Map,Z=null,te=!1,B=!1,F=new Set,X=new Map,z=0,I=-1,U=new Map,G=new Set,ne=new Map,q=new Map,le=new Set,Se=new Map,Q,xe=null;function ee(){if(g=e.history.listen(({action:se,location:oe,delta:we})=>{if(Q){Q(),Q=void 0;return}qn(Se.size===0||we!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ge=At({currentLocation:C.location,nextLocation:oe,historyAction:se});if(ge&&we!=null){let J=new Promise(Oe=>{Q=Oe});e.history.go(we*-1),xt(ge,{state:"blocked",location:oe,proceed(){xt(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),J.then(()=>e.history.go(we))},reset(){let Oe=new Map(C.blockers);Oe.set(ge,Od),_({blockers:Oe})}}),T==null||T.resolve(),T=null;return}return ze(se,oe)}),n){FT(t,O);let se=()=>_T(t,O);t.addEventListener("pagehide",se),Z=()=>t.removeEventListener("pagehide",se)}return C.initialized||ze("POP",C.location,{initialHydration:!0}),M}function ae(){g&&g(),Z&&Z(),v.clear(),D&&D.abort(),C.fetchers.forEach((se,oe)=>Pt(C.fetchers,oe)),C.blockers.forEach((se,oe)=>St(oe))}function re(se){if(v.add(se),w){let{newErrors:oe}=w;w=null,se(C,{deletedFetchers:[],newErrors:oe,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(se)}function _(se,oe={}){se.matches&&(se.matches=se.matches.map(J=>{let Oe=l[J.route.id],Be=J.route;return Be.element!==Oe.element||Be.errorElement!==Oe.errorElement||Be.hydrateFallbackElement!==Oe.hydrateFallbackElement?{...J,route:Oe}:J})),C={...C,...se};let we=[],ge=[];C.fetchers.forEach((J,Oe)=>{J.state==="idle"&&(le.has(Oe)?we.push(Oe):ge.push(Oe))}),le.forEach(J=>{!C.fetchers.has(J)&&!X.has(J)&&we.push(J)}),v.size===0&&(w={newErrors:se.errors??null}),[...v].forEach(J=>J(C,{deletedFetchers:we,newErrors:se.errors??null,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),we.forEach(J=>Pt(C.fetchers,J)),ge.forEach(J=>C.fetchers.delete(J))}function ue(se,oe,{flushSync:we}={}){var _e,W;let ge=C.actionData!=null&&C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&C.navigation.state==="loading"&&((_e=se.state)==null?void 0:_e._isRedirect)!==!0,J;oe.actionData?Object.keys(oe.actionData).length>0?J=oe.actionData:J=null:ge?J=C.actionData:J=null;let Oe=oe.loaderData?i3(C.loaderData,oe.loaderData,oe.matches||[],oe.errors):C.loaderData,Be=C.blockers;Be.size>0&&(Be=new Map(Be),Be.forEach((pe,Ie)=>Be.set(Ie,Od)));let Ve=te?!1:kn(se,oe.matches||C.matches),Ge=H===!0||C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&((W=se.state)==null?void 0:W._isRedirect)!==!0;u.commitHmrRoutes(),te||R==="POP"||(R==="PUSH"?e.history.push(se,se.state):R==="REPLACE"&&e.history.replace(se,se.state));let me;if(R==="POP"){let pe=O.get(C.location.pathname);pe&&pe.has(se.pathname)?me={currentLocation:C.location,nextLocation:se}:O.has(se.pathname)&&(me={currentLocation:se,nextLocation:C.location})}else if(K){let pe=O.get(C.location.pathname);pe?pe.add(se.pathname):(pe=new Set([se.pathname]),O.set(C.location.pathname,pe)),me={currentLocation:C.location,nextLocation:se}}_({...oe,actionData:J,loaderData:Oe,historyAction:R,location:se,initialized:!0,renderFallback:!1,navigation:rg,revalidation:"idle",restoreScrollPosition:Ve,preventScrollReset:Ge,blockers:Be},{viewTransitionOpts:me,flushSync:we===!0}),R="POP",H=!1,K=!1,te=!1,B=!1,T==null||T.resolve(),T=null,xe==null||xe.resolve(),xe=null}async function We(se,oe){if(T==null||T.resolve(),T=null,typeof se=="number"){T||(T=d3());let Te=T.promise;return e.history.go(se),Te}let we=x8(C.location,C.matches,f,se,oe==null?void 0:oe.fromRouteId,oe==null?void 0:oe.relative),{path:ge,submission:J,error:Oe}=Qb(!1,we,oe),Be;if(oe!=null&&oe.mask){let Te=typeof oe.mask=="string"?yo(oe.mask):{...C.location.mask,...oe.mask};if(Be={pathname:Te.pathname??"",search:Te.search??"",hash:Te.hash??""},ip.test(Be.pathname))throw new Error("External navigation is not allowed");Be.pathname.startsWith("\\")&&(Be.pathname=Be.pathname.replace(/^\\+/,"/")),bu(typeof oe.mask=="string"?oe.mask:ls(oe.mask),ls(Be),e.history.createURL("/"),"reject")}let Ve=C.location,Ge=w0(Ve,ge,oe&&oe.state,void 0,Be);Ge={...Ge,...e.history.encodeLocation(Ge)},bu(se==null?e.history.createHref(C.location):typeof se=="string"?se:ls(se),e.history.createHref(Ge.mask||Ge),e.history.createURL("/"),"reject");let me=oe&&oe.replace!=null?oe.replace:void 0,_e="PUSH";me===!0?_e="REPLACE":me===!1||J!=null&&Yr(J.formMethod)&&J.formAction===C.location.pathname+C.location.search&&(_e="REPLACE");let W=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,pe=(oe&&oe.flushSync)===!0,Ie=At({currentLocation:Ve,nextLocation:Ge,historyAction:_e});if(Ie){xt(Ie,{state:"blocked",location:Ge,proceed(){xt(Ie,{state:"proceeding",proceed:void 0,reset:void 0,location:Ge}),We(se,oe)},reset(){let Te=new Map(C.blockers);Te.set(Ie,Od),_({blockers:Te})}});return}await ze(_e,Ge,{submission:J,pendingError:Oe,preventScrollReset:W,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:pe,callSiteDefaultShouldRevalidate:oe&&oe.defaultShouldRevalidate})}function Xe(){xe||(xe=d3()),Le(),_({revalidation:"loading"});let se=xe.promise;return C.navigation.state==="submitting"?se:C.navigation.state==="idle"?(ze(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),se):(ze(R||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:K===!0}),se)}async function ze(se,oe,we){D&&D.abort(),D=null,R=se,te=(we&&we.startUninterruptedRevalidation)===!0,ot(C.location,C.matches),H=(we&&we.preventScrollReset)===!0,K=(we&&we.enableViewTransition)===!0;let ge=u.activeRoutes,J=we!=null&&we.initialHydration&&C.matches&&C.matches.length>0&&!j?C.matches:Na(ge,oe,f,!1,u.branches),Oe=(we&&we.flushSync)===!0;if(J&&C.initialized&&!B&&MT(C.location,oe)&&!(we&&we.submission&&Yr(we.submission.formMethod))){ue(oe,{matches:J},{flushSync:Oe});return}let Be=ut(J,ge,oe.pathname);if(Be.active&&Be.matches&&(J=Be.matches),!J){let{error:vt,notFoundMatches:Ct,route:st}=Kt(oe.pathname);ue(oe,{matches:Ct,loaderData:{},errors:{[st.id]:vt}},{flushSync:Oe});return}let Ve=we&&we.overrideNavigation?{...we.overrideNavigation,matches:J,historyAction:se}:void 0;D=new AbortController;let Ge=cu(e.history,oe,D.signal,we&&we.submission),me=e.getContext?await e.getContext():new Ub,_e;if(we&&we.pendingError)_e=[Ti(J).route.id,{type:"error",error:we.pendingError}];else if(we&&we.submission&&Yr(we.submission.formMethod)){let vt=await tt(Ge,oe,we.submission,J,se,me,Be.active,we&&we.initialHydration===!0,{replace:we.replace,flushSync:Oe});if(vt.shortCircuited)return;if(vt.pendingActionResult){let[Ct,st]=vt.pendingActionResult;if(Is(st)&&b0(st.error)&&st.error.status===404){D=null,ue(oe,{matches:vt.matches,loaderData:{},errors:{[Ct]:st.error}});return}}J=vt.matches||J,_e=vt.pendingActionResult,Ve=sg(oe,J,se,we.submission),Oe=!1,Be.active=!1,Ge=cu(e.history,Ge.url,Ge.signal)}let{shortCircuited:W,matches:pe,loaderData:Ie,errors:Te,workingFetchers:bt}=await ce(Ge,oe,J,se,me,Be.active,Ve,we&&we.submission,we&&we.fetcherSubmission,we&&we.replace,we&&we.initialHydration===!0,Oe,_e,we&&we.callSiteDefaultShouldRevalidate);W||(D=null,ue(oe,{matches:pe||J,...l3(_e),loaderData:Ie,errors:Te,...bt?{fetchers:bt}:{}}))}async function tt(se,oe,we,ge,J,Oe,Be,Ve,Ge={}){Le();let me=OT(oe,ge,J,we);if(_({navigation:me},{flushSync:Ge.flushSync===!0}),Be){let pe=await Gt(ge,oe.pathname,se.signal);if(pe.type==="aborted")return{shortCircuited:!0};if(pe.type==="error"){if(pe.partialMatches.length===0){let{matches:Te,route:bt}=N1(u.activeRoutes);return{matches:Te,pendingActionResult:[bt.id,{type:"error",error:pe.error}]}}let Ie=Ti(pe.partialMatches).route.id;return{matches:pe.partialMatches,pendingActionResult:[Ie,{type:"error",error:pe.error}]}}else if(pe.matches)ge=pe.matches;else{let{notFoundMatches:Ie,error:Te,route:bt}=Kt(oe.pathname);return{matches:Ie,pendingActionResult:[bt.id,{type:"error",error:Te}]}}}let _e,W=ah(ge,oe);if(!W.route.action&&!W.route.lazy)_e={type:"error",error:aa(405,{method:se.method,pathname:oe.pathname,routeId:W.route.id})};else{let pe=xu(i,l,se,oe,ge,W,Ve?[]:r,Oe),Ie=await Ee(se,oe,pe,Oe,null);if(_e=Ie[W.route.id],!_e){for(let Te of ge)if(Ie[Te.route.id]){_e=Ie[Te.route.id];break}}if(se.signal.aborted)return{shortCircuited:!0}}if(Zl(_e)){let pe;return Ge&&Ge.replace!=null?pe=Ge.replace:pe=s3(_e.response.headers.get("Location"),new URL(se.url),f,e.history)===C.location.pathname+C.location.search,await ye(se,_e,!0,{submission:we,replace:pe}),{shortCircuited:!0}}if(Is(_e)){let pe=Ti(ge,W.route.id);return(Ge&&Ge.replace)!==!0&&(R="PUSH"),{matches:ge,pendingActionResult:[pe.route.id,_e,W.route.id]}}return{matches:ge,pendingActionResult:[W.route.id,_e]}}async function ce(se,oe,we,ge,J,Oe,Be,Ve,Ge,me,_e,W,pe,Ie){let Te=Be||sg(oe,we,ge,Ve),bt=Ve||Ge||u3(Te),vt=!te&&!_e;if(Oe){if(vt){let wn=ve(pe);_({navigation:Te,...wn!==void 0?{actionData:wn}:{}},{flushSync:W})}let Wt=await Gt(we,oe.pathname,se.signal);if(Wt.type==="aborted")return{shortCircuited:!0};if(Wt.type==="error"){if(Wt.partialMatches.length===0){let{matches:sn,route:In}=N1(u.activeRoutes);return{matches:sn,loaderData:{},errors:{[In.id]:Wt.error}}}let wn=Ti(Wt.partialMatches).route.id;return{matches:Wt.partialMatches,loaderData:{},errors:{[wn]:Wt.error}}}else if(Wt.matches)we=Wt.matches;else{let{error:wn,notFoundMatches:sn,route:In}=Kt(oe.pathname);return{matches:sn,loaderData:{},errors:{[In.id]:wn}}}}let Ct=u.activeRoutes,{dsMatches:st,revalidatingFetchers:$t}=Jb(se,J,i,l,e.history,C,we,bt,oe,_e?[]:r,_e===!0,B,F,le,ne,G,Ct,f,e.patchRoutesOnNavigation!=null,u.branches,pe,Ie);if(I=++z,!e.dataStrategy&&!st.some(Wt=>Wt.shouldLoad)&&!st.some(Wt=>Wt.route.middleware&&Wt.route.middleware.length>0)&&$t.length===0){let Wt=new Map(C.fetchers),wn=Fe(Wt);return ue(oe,{matches:we,loaderData:{},errors:pe&&Is(pe[1])?{[pe[0]]:pe[1].error}:null,...l3(pe),...wn?{fetchers:Wt}:{}},{flushSync:W}),{shortCircuited:!0}}if(vt){let Wt={};if(!Oe){Wt.navigation=Te;let wn=ve(pe);wn!==void 0&&(Wt.actionData=wn)}$t.length>0&&(Wt.fetchers=Pe($t)),_(Wt,{flushSync:W})}$t.forEach(Wt=>{Nt(Wt.key),Wt.controller&&X.set(Wt.key,Wt.controller)});let An=()=>$t.forEach(Wt=>Nt(Wt.key));D&&D.signal.addEventListener("abort",An);let{loaderResults:Y,fetcherResults:he}=await be(st,$t,se,oe,J);if(se.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",An),$t.forEach(Wt=>X.delete(Wt.key));let Me=M1(Y);if(Me)return await ye(se,Me.result,!0,{replace:me}),{shortCircuited:!0};if(Me=M1(he),Me)return G.add(Me.key),await ye(se,Me.result,!0,{replace:me}),{shortCircuited:!0};let Ye=new Map(C.fetchers),{loaderData:dt,errors:wt}=o3(C,we,Y,pe,$t,he,Ye);_e&&C.errors&&(wt={...C.errors,...wt});let Zt=Fe(Ye),Ht=pt(I,Ye),pn=Zt||Ht||$t.length>0;return{matches:we,loaderData:dt,errors:wt,...pn?{workingFetchers:Ye}:{}}}function ve(se){if(se&&!Is(se[1]))return{[se[0]]:se[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function Pe(se){let oe=new Map(C.fetchers);return se.forEach(we=>{let ge=oe.get(we.key),J=Id(void 0,ge?ge.data:void 0);oe.set(we.key,J)}),oe}async function de(se,oe,we,ge){Nt(se);let J=(ge&&ge.flushSync)===!0,Oe=u.activeRoutes,Be=x8(C.location,C.matches,f,we,oe,ge==null?void 0:ge.relative),Ve=Na(Oe,Be,f,!1,u.branches),Ge=ut(Ve,Oe,Be);if(Ge.active&&Ge.matches&&(Ve=Ge.matches),!Ve){Ke(se,oe,aa(404,{pathname:Be}),{flushSync:J});return}let{path:me,submission:_e,error:W}=Qb(!0,Be,ge);if(W){Ke(se,oe,W,{flushSync:J});return}let pe=e.getContext?await e.getContext():new Ub,Ie=(ge&&ge.preventScrollReset)===!0;if(_e&&Yr(_e.formMethod)){await je(se,oe,me,Ve,pe,Ge.active,J,Ie,_e,ge&&ge.defaultShouldRevalidate);return}ne.set(se,{routeId:oe,path:me}),await Ue(se,oe,me,Ve,pe,Ge.active,J,Ie,_e)}async function je(se,oe,we,ge,J,Oe,Be,Ve,Ge,me){Le(),ne.delete(se);let _e=C.fetchers.get(se);Qe(se,IT(Ge,_e),{flushSync:Be});let W=new AbortController,pe=cu(e.history,we,W.signal,Ge);if(Oe){let Et=await Gt(ge,new URL(pe.url).pathname,pe.signal,se);if(Et.type==="aborted")return;if(Et.type==="error"){Ke(se,oe,Et.error,{flushSync:Be});return}else if(Et.matches)ge=Et.matches;else{Ke(se,oe,aa(404,{pathname:we}),{flushSync:Be});return}}let Ie=ah(ge,we);if(!Ie.route.action&&!Ie.route.lazy){let Et=aa(405,{method:Ge.formMethod,pathname:we,routeId:oe});Ke(se,oe,Et,{flushSync:Be});return}X.set(se,W);let Te=z,bt=xu(i,l,pe,we,ge,Ie,r,J),vt=await Ee(pe,we,bt,J,se),Ct=vt[Ie.route.id];if(!Ct){for(let Et of bt)if(vt[Et.route.id]){Ct=vt[Et.route.id];break}}if(pe.signal.aborted){X.get(se)===W&&X.delete(se);return}if(le.has(se)){if(Zl(Ct)||Is(Ct)){Qe(se,eo(void 0));return}}else{if(Zl(Ct))if(X.delete(se),I>Te){Qe(se,eo(void 0));return}else return G.add(se),Qe(se,Id(Ge)),ye(pe,Ct,!1,{fetcherSubmission:Ge,preventScrollReset:Ve});if(Is(Ct)){Ke(se,oe,Ct.error);return}}let st=C.navigation.location||C.location,$t=cu(e.history,st,W.signal),An=u.activeRoutes,Y=C.navigation.state!=="idle"?Na(An,C.navigation.location,f,!1,u.branches):C.matches;rn(Y,"Didn't find any matches after fetcher action");let he=++z;U.set(se,he);let{dsMatches:Me,revalidatingFetchers:Ye}=Jb($t,J,i,l,e.history,C,Y,Ge,st,r,!1,B,F,le,ne,G,An,f,e.patchRoutesOnNavigation!=null,u.branches,[Ie.route.id,Ct],me),dt=Id(Ge,Ct.data),wt=new Map(C.fetchers);wt.set(se,dt),Ye.filter(Et=>Et.key!==se).forEach(Et=>{let Hn=Et.key,Ot=wt.get(Hn),tn=Id(void 0,Ot?Ot.data:void 0);wt.set(Hn,tn),Nt(Hn),Et.controller&&X.set(Hn,Et.controller)}),_({fetchers:wt});let Zt=()=>Ye.forEach(Et=>Nt(Et.key));W.signal.addEventListener("abort",Zt);let{loaderResults:Ht,fetcherResults:pn}=await be(Me,Ye,$t,st,J);if(W.signal.aborted)return;W.signal.removeEventListener("abort",Zt),U.delete(se),X.delete(se),Ye.forEach(Et=>X.delete(Et.key));let Wt=C.fetchers.has(se),wn=Et=>{if(!Wt)return Et;let Hn=new Map(Et.fetchers);return Hn.set(se,eo(Ct.data)),{...Et,fetchers:Hn}},sn=M1(Ht);if(sn)return C=wn(C),ye($t,sn.result,!1,{preventScrollReset:Ve});if(sn=M1(pn),sn)return G.add(sn.key),C=wn(C),ye($t,sn.result,!1,{preventScrollReset:Ve});let In=new Map(C.fetchers);Wt&&In.set(se,eo(Ct.data));let{loaderData:Dt,errors:On}=o3(C,Y,Ht,void 0,Ye,pn,In);pt(he,In),C.navigation.state==="loading"&&he>I?(rn(R,"Expected pending action"),D&&D.abort(),ue(C.navigation.location,{matches:Y,loaderData:Dt,errors:On,fetchers:In})):(_({errors:On,loaderData:i3(C.loaderData,Dt,Y,On),fetchers:In}),B=!1)}async function Ue(se,oe,we,ge,J,Oe,Be,Ve,Ge){let me=C.fetchers.get(se);Qe(se,Id(Ge,me?me.data:void 0),{flushSync:Be});let _e=new AbortController,W=cu(e.history,we,_e.signal);if(Oe){let Ct=await Gt(ge,new URL(W.url).pathname,W.signal,se);if(Ct.type==="aborted")return;if(Ct.type==="error"){Ke(se,oe,Ct.error,{flushSync:Be});return}else if(Ct.matches)ge=Ct.matches;else{Ke(se,oe,aa(404,{pathname:we}),{flushSync:Be});return}}let pe=ah(ge,we);X.set(se,_e);let Ie=z,Te=xu(i,l,W,we,ge,pe,r,J),bt=await Ee(W,we,Te,J,se),vt=bt[pe.route.id];if(!vt){for(let Ct of ge)if(bt[Ct.route.id]){vt=bt[Ct.route.id];break}}if(X.get(se)===_e&&X.delete(se),!W.signal.aborted){if(le.has(se)){Qe(se,eo(void 0));return}if(Zl(vt))if(I>Ie){Qe(se,eo(void 0));return}else{G.add(se),await ye(W,vt,!1,{preventScrollReset:Ve});return}if(Is(vt)){Ke(se,oe,vt.error);return}Qe(se,eo(vt.data))}}async function ye(se,oe,we,{submission:ge,fetcherSubmission:J,preventScrollReset:Oe,replace:Be}={}){we||(T==null||T.resolve(),T=null),oe.response.headers.has("X-Remix-Revalidate")&&(B=!0);let Ve=oe.response.headers.get("Location");rn(Ve,"Expected a Location header on the redirect Response");let Ge=Ve,me=new URL(se.url);Ve=s3(Ve,me,f,e.history),bu(Ge,Ve,me,"allow-explicit");let _e=w0(C.location,Ve,{_isRedirect:!0});if(n){let vt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))vt=!0;else if(Y6(Ve)){const Ct=rS(t,Ve,!0);vt=Ct.origin!==t.location.origin||zs(Ct.pathname,f)==null}if(vt){Be?t.location.replace(Ve):t.location.assign(Ve);return}}D=null;let W=Be===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:pe,formAction:Ie,formEncType:Te}=C.navigation;!ge&&!J&&pe&&Ie&&Te&&(ge=u3(C.navigation));let bt=ge||J;if(dT.has(oe.response.status)&&bt&&Yr(bt.formMethod))await ze(W,_e,{submission:{...bt,formAction:Ve},preventScrollReset:Oe||H,enableViewTransition:we?K:void 0});else{let vt=sg(_e,[],W,ge);await ze(W,_e,{overrideNavigation:vt,fetcherSubmission:J,preventScrollReset:Oe||H,enableViewTransition:we?K:void 0})}}async function Ee(se,oe,we,ge,J){var Ve;let Oe,Be={};try{Oe=await kT(h,se,oe,we,J,ge,!1)}catch(Ge){return we.filter(me=>me.shouldLoad).forEach(me=>{Be[me.route.id]={type:"error",error:Ge}}),Be}if(se.signal.aborted)return Be;if(!Yr(se.method))for(let Ge of we){if(((Ve=Oe[Ge.route.id])==null?void 0:Ve.type)==="error")break;!Oe.hasOwnProperty(Ge.route.id)&&!C.loaderData.hasOwnProperty(Ge.route.id)&&(!C.errors||!C.errors.hasOwnProperty(Ge.route.id))&&Ge.shouldCallHandler()&&(Oe[Ge.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ge.route.id}`)})}for(let[Ge,me]of Object.entries(Oe))if(TT(me)){let _e=me.result;Be[Ge]={type:"redirect",response:jT(_e,se,Ge,we,f)}}else Be[Ge]=await CT(me);return Be}async function be(se,oe,we,ge,J){let Oe=Ee(we,ge,se,J,null),Be=Promise.all(oe.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let W=(await Ee(me.request,me.path,me.matches,J,me.key))[me.match.route.id];return{[me.key]:W}}else return Promise.resolve({[me.key]:{type:"error",error:aa(404,{pathname:me.path})}})})),Ve=await Oe,Ge=(await Be).reduce((me,_e)=>Object.assign(me,_e),{});return{loaderResults:Ve,fetcherResults:Ge}}function Le(){B=!0,ne.forEach((se,oe)=>{X.has(oe)&&F.add(oe),Nt(oe)})}function Qe(se,oe,we={}){let ge=new Map(C.fetchers);ge.set(se,oe),_({fetchers:ge},{flushSync:(we&&we.flushSync)===!0})}function Ke(se,oe,we,ge={}){let J=Ti(C.matches,oe),Oe=new Map(C.fetchers);Pt(Oe,se),_({errors:{[J.route.id]:we},fetchers:Oe},{flushSync:(ge&&ge.flushSync)===!0})}function nt(se){return q.set(se,(q.get(se)||0)+1),le.has(se)&&le.delete(se),C.fetchers.get(se)||fT}function gt(se,oe){Nt(se,oe==null?void 0:oe.reason),Qe(se,eo(null))}function Pt(se,oe){let we=C.fetchers.get(oe);X.has(oe)&&!(we&&we.state==="loading"&&U.has(oe))&&Nt(oe),ne.delete(oe),U.delete(oe),G.delete(oe),le.delete(oe),F.delete(oe),se.delete(oe)}function Ut(se){let oe=(q.get(se)||0)-1;oe<=0?(q.delete(se),le.add(se)):q.set(se,oe),_({fetchers:new Map(C.fetchers)})}function Nt(se,oe){let we=X.get(se);we&&(we.abort(oe),X.delete(se))}function cn(se,oe){for(let we of se){let ge=oe.get(we);rn(ge,`Expected fetcher: ${we}`);let J=eo(ge.data);oe.set(we,J)}}function Fe(se){let oe=[],we=!1;for(let ge of G){let J=se.get(ge);rn(J,`Expected fetcher: ${ge}`),J.state==="loading"&&(G.delete(ge),oe.push(ge),we=!0)}return cn(oe,se),we}function pt(se,oe){let we=[];for(let[ge,J]of U)if(J<se){let Oe=oe.get(ge);rn(Oe,`Expected fetcher: ${ge}`),Oe.state==="loading"&&(Nt(ge),U.delete(ge),we.push(ge))}return cn(we,oe),we.length>0}function it(se,oe){let we=C.blockers.get(se)||Od;return Se.get(se)!==oe&&Se.set(se,oe),we}function St(se){C.blockers.delete(se),Se.delete(se)}function xt(se,oe){let we=C.blockers.get(se)||Od;rn(we.state==="unblocked"&&oe.state==="blocked"||we.state==="blocked"&&oe.state==="blocked"||we.state==="blocked"&&oe.state==="proceeding"||we.state==="blocked"&&oe.state==="unblocked"||we.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${we.state} -> ${oe.state}`);let ge=new Map(C.blockers);ge.set(se,oe),_({blockers:ge})}function At({currentLocation:se,nextLocation:oe,historyAction:we}){if(Se.size===0)return;Se.size>1&&qn(!1,"A router only supports one blocker at a time");let ge=Array.from(Se.entries()),[J,Oe]=ge[ge.length-1],Be=C.blockers.get(J);if(!(Be&&Be.state==="proceeding")&&Oe({currentLocation:se,nextLocation:oe,historyAction:we}))return J}function Kt(se){let oe=aa(404,{pathname:se}),we=u.activeRoutes,{matches:ge,route:J}=N1(we);return{notFoundMatches:ge,route:J,error:oe}}function et(se,oe,we){if(y=se,k=oe,x=we||null,!S&&C.navigation===rg){S=!0;let ge=kn(C.location,C.matches);ge!=null&&_({restoreScrollPosition:ge})}return()=>{y=null,k=null,x=null}}function mt(se,oe){return x&&x(se,oe.map(ge=>aS(ge,C.loaderData)))||se.key}function ot(se,oe){if(y&&k){let we=mt(se,oe);y[we]=k()}}function kn(se,oe){if(y){let we=mt(se,oe),ge=y[we];if(typeof ge=="number")return ge}return null}function ut(se,oe,we){if(e.patchRoutesOnNavigation){let ge=u.branches;if(se){if(Object.keys(se[0].params).length>0)return{active:!0,matches:Na(oe,we,f,!0,ge)}}else return{active:!0,matches:Na(oe,we,f,!0,ge)||[]}}return{active:!1,matches:null}}async function Gt(se,oe,we,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:se};let J=se;for(;;){let Oe=l;try{await e.patchRoutesOnNavigation({signal:we,path:oe,matches:J,fetcherKey:ge,patch:(me,_e)=>{we.aborted||e3(me,_e,u,Oe,i,!1)}})}catch(me){return{type:"error",error:me,partialMatches:J}}if(we.aborted)return{type:"aborted"};let Be=u.branches,Ve=Na(u.activeRoutes,oe,f,!1,Be),Ge=null;if(Ve){if(Object.keys(Ve[0].params).length===0)return{type:"success",matches:Ve};if(Ge=Na(u.activeRoutes,oe,f,!0,Be),!(Ge&&J.length<Ge.length&&Ft(J,Ge.slice(0,J.length))))return{type:"success",matches:Ve}}if(Ge||(Ge=Na(u.activeRoutes,oe,f,!0,Be)),!Ge||Ft(J,Ge))return{type:"success",matches:null};J=Ge}}function Ft(se,oe){return se.length===oe.length&&se.every((we,ge)=>we.route.id===oe[ge].route.id)}function en(se){l={},u.setHmrRoutes(y0(se,i,void 0,l))}function Jt(se,oe,we=!1){e3(se,oe,u,l,i,we),u.hasHMRRoutes||_({})}return M={get basename(){return f},get future(){return p},get state(){return C},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return t},initialize:ee,subscribe:re,enableScrollRestoration:et,navigate:We,fetch:de,revalidate:Xe,createHref:se=>e.history.createHref(se),createURL:se=>e.history.createURL(se),encodeLocation:se=>e.history.encodeLocation(se),getFetcher:nt,resetFetcher:gt,deleteFetcher:Ut,dispose:ae,getBlocker:it,deleteBlocker:St,patchRoutes:Jt,_internalFetchControllers:X,_internalSetRoutes:en,_internalSetStateDoNotUseOrYouWillBreakYourApp(se){_(se)}},e.instrumentations&&(M=nT(M,e.instrumentations.map(se=>se.router).filter(Boolean))),M}function gT(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function x8(e,t,n,r,a,i){let l,u;if(a){l=[];for(let h of t)if(l.push(h),h.route.id===a){u=h;break}}else l=t,u=t[t.length-1];let f=z0(r||".",lp(l),zs(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=e4(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let p=new URLSearchParams(f.search),g=p.getAll("index");p.delete("index"),g.filter(w=>w).forEach(w=>p.append("index",w));let v=p.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=YL({basename:n,pathname:f.pathname})),ls(f)}function Qb(e,t,n){if(!n||!gT(n))return{path:t};if(n.formMethod&&!HT(n.formMethod))return{path:t,error:aa(405,{method:n.formMethod})};let r=()=>({path:t,error:aa(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=jS(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Yr(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[w,y])=>`${v}${w}=${y}
50
- `,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Yr(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}rn(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=E8(n.formData),f=n.formData;else if(n.body instanceof FormData)u=E8(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=a3(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=a3(u)}catch{return r()}let h={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Yr(h.formMethod))return{path:t,submission:h};let p=yo(t);return e&&p.search&&e4(p.search)&&u.append("index",""),p.search=`?${u}`,{path:ls(p),submission:h}}function Jb(e,t,n,r,a,i,l,u,f,h,p,g,v,w,y,x,k,S,E,j,N,P){var te;let $=N?Is(N[1])?N[1].error:N[1].data:void 0,M=a.createURL(i.location),C=a.createURL(f),R;if(p&&i.errors){let B=Object.keys(i.errors)[0];R=l.findIndex(F=>F.route.id===B)}else if(N&&Is(N[1])){let B=N[0];R=l.findIndex(F=>F.route.id===B)-1}let T=N?N[1].statusCode:void 0,H=T&&T>=400,D={currentUrl:M,currentParams:((te=i.matches[0])==null?void 0:te.params)||{},nextUrl:C,nextParams:l[0].params,...u,actionResult:$,actionStatus:T},K=U0(l),O=l.map((B,F)=>{let{route:X}=B,z=null;if(R!=null&&F>R)z=!1;else if(X.lazy)z=!0;else if(!Q6(X))z=!1;else if(p){let{shouldLoad:ne}=yS(X,i.loaderData,i.errors);z=ne}else vT(i.loaderData,i.matches[F],B)&&(z=!0);if(z!==null)return k8(n,r,e,f,K,B,h,t,z);let I=!1;typeof P=="boolean"?I=P:H?I=!1:(g||M.pathname+M.search===C.pathname+C.search||M.search!==C.search||wT(i.matches[F],B))&&(I=!0);let U={...D,defaultShouldRevalidate:I},G=c0(B,U);return k8(n,r,e,f,K,B,h,t,G,U,P)}),Z=[];return y.forEach((B,F)=>{if(p||!l.some(le=>le.route.id===B.routeId)||w.has(F))return;let X=i.fetchers.get(F),z=X&&X.state!=="idle"&&X.data===void 0,I=Na(k,B.path,S??"/",!1,j);if(!I){if(E&&z)return;Z.push({key:F,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(x.has(F))return;let U=ah(I,B.path),G=new AbortController,ne=cu(a,B.path,G.signal),q=null;if(v.has(F))v.delete(F),q=xu(n,r,ne,B.path,I,U,h,t);else if(z)g&&(q=xu(n,r,ne,B.path,I,U,h,t));else{let le;typeof P=="boolean"?le=P:H?le=!1:le=g;let Se={...D,defaultShouldRevalidate:le};c0(U,Se)&&(q=xu(n,r,ne,B.path,I,U,h,t,Se))}q&&Z.push({key:F,routeId:B.routeId,path:B.path,matches:q,match:U,request:ne,controller:G})}),{dsMatches:O,revalidatingFetchers:Z}}function Q6(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function yS(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Q6(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;if(!r&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let i=!r&&!a;return{shouldLoad:i,renderFallback:i}}function vT(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function wT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function c0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function e3(e,t,n,r,a,i){let l;if(e){let h=r[e];rn(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),l=h.children}else l=n.activeRoutes;let u=[],f=[];if(t.forEach(h=>{let p=l.find(g=>bS(h,g));p?f.push({existingRoute:p,newRoute:h}):u.push(h)}),u.length>0){let h=y0(u,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...h)}if(i&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:p,newRoute:g}=f[h],v=p,[w]=y0([g],a,[],{},!0);Object.assign(v,{element:w.element?w.element:v.element,errorElement:w.errorElement?w.errorElement:v.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:v.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function bS(e,t){var n;return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:((n=e.children)==null?void 0:n.every((r,a)=>{var i;return(i=t.children)==null?void 0:i.some(l=>bS(r,l))}))??!1:!1}var t3=new WeakMap,xS=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(rn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let l=t3.get(a);l||(l={},t3.set(a,l));let u=l[e];if(u)return u;let f=(async()=>{let h=DL(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(h)qn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)qn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await i();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},n3=new WeakMap;function yT(e,t,n,r,a){let i=n[e.id];if(rn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=n3.get(i);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{rn(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),w={};for(let y in v){let x=v[y];if(x===void 0)continue;let k=OL(y),E=i[y]!==void 0&&y!=="hasErrorBoundary";k?qn(!k,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?qn(!E,`Route "${i.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):w[y]=x}Object.assign(i,w),Object.assign(i,{...r(i),lazy:void 0})})();return n3.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(e.lazy),u=[],f;for(let p of l){if(a&&a.includes(p))continue;let g=xS({key:p,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),p===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function r3(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,i)=>{n[t[i].route.id]=a}),n}async function bT(e){return e.matches.some(t=>t.route.middleware)?kS(e,()=>r3(e)):r3(e)}function kS(e,t){return xT(e,t,r=>{if(DT(r))throw r;return r},PT,n);function n(r,a,i){if(i)return Promise.resolve(Object.assign(i.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,u=Math.min(Math.max(l.findIndex(h=>h.route.id===a),0),Math.max(l.findIndex(h=>h.shouldCallHandler()),0)),f=Ti(l,l[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function xT(e,t,n,r,a){let{matches:i,...l}=e,u=i.flatMap(h=>h.route.middleware?h.route.middleware.map(p=>[h.route.id,p]):[]);return await SS(l,u,t,n,r,a)}async function SS(e,t,n,r,a,i,l=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[l];if(!f)return await n();let[h,p]=f,g,v=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await SS(e,t,n,r,a,i,l+1)},g.value}catch(w){return g={value:await i(w,h,g)},g.value}};try{let w=await p(e,v),y=w!=null?r(w):void 0;return a(y)?y:g?y??g.value:(g={value:await v()},g.value)}catch(w){return await i(w,h,g)}}function ES(e,t,n,r,a){let i=xS({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=yT(r.route,Yr(n.method)?"action":"loader",t,e,a);return{middleware:i,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function k8(e,t,n,r,a,i,l,u,f,h=null,p){let g=!1,v=ES(e,t,n,i,l);return{...i,_lazyPromises:v,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(w){return g=!0,h?typeof p=="boolean"?c0(i,{...h,defaultShouldRevalidate:p}):typeof w=="boolean"?c0(i,{...h,defaultShouldRevalidate:w}):c0(i,h):f},resolve(w){let{lazy:y,loader:x,middleware:k}=i.route,S=g||f||w&&!Yr(n.method)&&(y||x),E=k&&k.length>0&&!x&&!y;return S&&(Yr(n.method)||!E)?ST({request:n,path:r,pattern:a,match:i,lazyHandlerPromise:v==null?void 0:v.handler,lazyRoutePromise:v==null?void 0:v.route,handlerOverride:w,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function xu(e,t,n,r,a,i,l,u,f=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:ES(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:k8(e,t,n,r,U0(a),h,l,u,!0,f))}async function kT(e,t,n,r,a,i,l){r.some(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(r.map(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware}));let u={request:t,url:CS(t,n),pattern:U0(r),params:r[0].params,context:i,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let g=u;return kS(g,()=>p({...g,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>{var g,v;return[(g=p._lazyPromises)==null?void 0:g.handler,(v=p._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function ST({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,h,p=Yr(e.method),g=p?"action":"loader",v=w=>{let y,x=new Promise((E,j)=>y=j);h=()=>y(),e.signal.addEventListener("abort",h);let k=E=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${r.route.id}]`)):w({request:e,url:CS(e,t),pattern:n,params:r.params,context:u},...E!==void 0?[E]:[]),S=(async()=>{try{return{type:"data",result:await(l?l(j=>k(j)):k())}}catch(E){return{type:"error",result:E}}})();return Promise.race([S,x])};try{let w=p?r.route.action:r.route.loader;if(a||i)if(w){let y,[x]=await Promise.all([v(w).catch(k=>{y=k}),a,i]);if(y!==void 0)throw y;f=x}else{await a;let y=p?r.route.action:r.route.loader;if(y)[f]=await Promise.all([v(y),i]);else if(g==="action"){let x=new URL(e.url),k=x.pathname+x.search;throw aa(405,{method:e.method,pathname:k,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)f=await v(w);else{let y=new URL(e.url),x=y.pathname+y.search;throw aa(404,{pathname:x})}}catch(w){return{type:"error",result:w}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function ET(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function CT(e){var r,a,i,l,u;let{result:t,type:n}=e;if(J6(t)){let f;try{f=await ET(t)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new B0(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?c3(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:RT(t),statusCode:b0(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:b0(t)?t.status:void 0}:c3(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function jT(e,t,n,r,a){let i=e.headers.get("Location");if(rn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Y6(i)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=x8(new URL(t.url),l,a,i),e.headers.set("Location",i)}return e}var AT=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function S8(e){try{return AT.includes(new URL(e).protocol)}catch{return!1}}function s3(e,t,n,r){if(Y6(e)){let a=e,i=ip.test(a)?new URL(nS(a,t.protocol)):new URL(a);if(S8(i.toString()))throw new Error("Invalid redirect location");let l=zs(i.pathname,n)!=null;if(i.origin===t.origin&&l)return q6(i.pathname)+i.search+i.hash}try{let a=r.createURL(e);if(S8(a.toString()))throw new Error("Invalid redirect location")}catch{}return e}function cu(e,t,n,r){let a=e.createURL(jS(t)).toString(),i={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:l,formEncType:u}=r;i.method=l.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=E8(r.formData):i.body=r.formData}return new Request(a,i)}function CS(e,t){let n=new URL(e.url),r=typeof t=="string"?yo(t):t;if(n.pathname=r.pathname||"/",r.search){let a=new URLSearchParams(r.search),i=a.getAll("index");a.delete("index");for(let l of i.filter(Boolean))a.append("index",l);n.search=a.size?`?${a.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function E8(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function a3(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function NT(e,t,n,r=!1,a=!1){let i={},l=null,u,f=!1,h={},p=n&&Is(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,w=t[v];if(rn(!Zl(w),"Cannot handle redirect results in processLoaderData"),Is(w)){let y=w.error;if(p!==void 0&&(y=p,p=void 0),l=l||{},a)l[v]=y;else{let x=Ti(e,v);l[x.route.id]==null&&(l[x.route.id]=y)}r||(i[v]=wS),f||(f=!0,u=b0(w.error)?w.error.status:500),w.headers&&(h[v]=w.headers)}else i[v]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[v]=w.headers)}),p!==void 0&&n&&(l={[n[0]]:p},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:l,statusCode:u||200,loaderHeaders:h}}function o3(e,t,n,r,a,i,l){let{loaderData:u,errors:f}=NT(t,n,r);return a.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:g,controller:v}=h;if(v&&v.signal.aborted)return;let w=i[p];if(rn(w,"Did not find corresponding fetcher result"),Is(w)){let y=Ti(e.matches,g==null?void 0:g.route.id);f&&f[y.route.id]||(f={...f,[y.route.id]:w.error}),l.delete(p)}else if(Zl(w))rn(!1,"Unhandled fetcher revalidation redirect");else{let y=eo(w.data);l.set(p,y)}}),{loaderData:u,errors:f}}function i3(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==wS).reduce((i,[l,u])=>(i[l]=u,i),{});for(let i of n){let l=i.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&i.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function l3(e){return e?Is(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ti(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function N1(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function aa(e,{pathname:t,routeId:n,method:r,type:a,message:i}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new B0(e||500,l,new Error(u),!0)}function M1(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Zl(a))return{key:r,result:a}}}function jS(e){let t=typeof e=="string"?yo(e):e;return ls({...t,hash:""})}function MT(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function RT(e){var t,n;return new B0(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function PT(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&LT(n))}function LT(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function TT(e){return J6(e.result)&&gS.has(e.result.status)}function Is(e){return e.type==="error"}function Zl(e){return(e&&e.type)==="redirect"}function c3(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function J6(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function $T(e){return gS.has(e)}function DT(e){return J6(e)&&$T(e.status)&&e.headers.has("Location")}function HT(e){return uT.has(e.toUpperCase())}function Yr(e){return lT.has(e.toUpperCase())}function e4(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ah(e,t){let n=typeof t=="string"?yo(t).search:t.search;if(e[e.length-1].route.index&&e4(n||""))return e[e.length-1];let r=dS(e);return r[r.length-1]}function u3(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:i,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function sg(e,t,n,r){return r?{state:"loading",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function OT(e,t,n,r){return{state:"submitting",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Id(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function IT(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function eo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function FT(e,t){try{let n=e.sessionStorage.getItem(vS);if(n){let r=JSON.parse(n);for(let[a,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function _T(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(vS,JSON.stringify(n))}catch(r){qn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function d3(){let e,t,n=new Promise((r,a)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{a(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var lc=s.createContext(null);lc.displayName="DataRouter";var Wu=s.createContext(null);Wu.displayName="DataRouterState";var AS=s.createContext(!1);function NS(){return s.useContext(AS)}var t4=s.createContext({isTransitioning:!1});t4.displayName="ViewTransition";var MS=s.createContext(new Map);MS.displayName="Fetchers";var ZT=s.createContext(null);ZT.displayName="Await";var fs=s.createContext(null);fs.displayName="Navigation";var cp=s.createContext(null);cp.displayName="Location";var pa=s.createContext({outlet:null,matches:[],isDataRoute:!1});pa.displayName="Route";var n4=s.createContext(null);n4.displayName="RouteError";var RS="REACT_ROUTER_ERROR",VT="REDIRECT",zT="ROUTE_ERROR_RESPONSE";function BT(e){if(e.startsWith(`${RS}:${VT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function UT(e){if(e.startsWith(`${RS}:${zT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new B0(t.status,t.statusText,t.data)}catch{}}function WT(e,{relative:t}={}){rn(cc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=s.useContext(fs),{hash:a,pathname:i,search:l}=W0(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:ua([n,i])),r.createHref({pathname:u,search:l,hash:a})}function cc(){return s.useContext(cp)!=null}function Zn(){return rn(cc(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(cp).location}function un(e){rn(cc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Zn();return s.useMemo(()=>Wi(e,uS(t)),[t,e])}var PS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LS(e){s.useContext(fs).static||s.useLayoutEffect(e)}function Dn(){let{isDataRoute:e}=s.useContext(pa);return e?o$():KT()}function KT(){rn(cc(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(lc),{basename:t,navigator:n}=s.useContext(fs),{matches:r}=s.useContext(pa),{pathname:a}=Zn(),i=JSON.stringify(lp(r)),l=s.useRef(!1);return LS(()=>{l.current=!0}),s.useCallback((f,h={})=>{if(qn(l.current,PS),!l.current)return;if(typeof f=="number"){n.go(f);return}let p=z0(f,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ua([t,p.pathname])),bu(typeof f=="string"?f:ls(f),n.createHref(p),X6(n),"reject"),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,i,a,e])}var TS=s.createContext(null);function GT(){return s.useContext(TS)}function YT(e){let t=s.useContext(pa).outlet;return s.useMemo(()=>t&&s.createElement(TS.Provider,{value:e},t),[t,e])}function Bs(){let{matches:e}=s.useContext(pa),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function W0(e,{relative:t}={}){let{matches:n}=s.useContext(pa),{pathname:r}=Zn(),a=JSON.stringify(lp(n));return s.useMemo(()=>z0(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function qT(e,t,n){rn(cc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=s.useContext(fs),{matches:a}=s.useContext(pa),i=a[a.length-1],l=i?i.params:{},u=i?i.pathname:"/",f=i?i.pathnameBase:"/",h=i&&i.route;{let k=h&&h.path||"";OS(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
51
-
52
- Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=Zn(),g;g=p;let v=g.pathname||"/",w=v;if(f!=="/"){let k=f.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(k=>Object.assign(k,{route:n.manifest[k.route.id]||k.route})):sS(e,{pathname:w});return qn(h||y!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),qn(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),t$(y&&y.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:ua([f,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:ua([f,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),a,n)}function XT(){let e=HS(),t=b0(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=s.createElement(s.Fragment,null,s.createElement("p",null,"💿 Hey developer 👋"),s.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",s.createElement("code",{style:i},"ErrorBoundary")," or"," ",s.createElement("code",{style:i},"errorElement")," prop on your route.")),s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),n?s.createElement("pre",{style:a},n):null,l)}var QT=s.createElement(XT,null),$S=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=UT(e.digest);n&&(e=n)}let t=e!==void 0?s.createElement(pa.Provider,{value:this.props.routeContext},s.createElement(n4.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?s.createElement(JT,{error:e},t):t}};$S.contextType=AS;var ag=new WeakMap;function JT({children:e,error:t}){let{basename:n,navigator:r}=s.useContext(fs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=BT(t.digest);if(a){let i=ag.get(t);if(i)throw i;let l=hS(a.location,n),u=l.absoluteURL||l.to;if(bu(a.location,u,X6(r),"allow-explicit"),S8(u))throw new Error("Invalid redirect location");if(fS&&!ag.get(t))if(l.isExternal||a.reloadDocument)window.location.href=u;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw ag.set(t,f),f}return s.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function e$({routeContext:e,match:t,children:n}){let r=s.useContext(lc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(pa.Provider,{value:e},n)}function t$(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let p=a.findIndex(g=>g.route.id&&(i==null?void 0:i[g.route.id])!==void 0);rn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<a.length;p++){let g=a[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=p),g.route.id){let{loaderData:v,errors:w}=r,y=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||y){n.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(p,g)=>{var v,w;f(p,{location:r.location,params:((w=(v=r.matches)==null?void 0:v[0])==null?void 0:w.params)??{},pattern:U0(r.matches),errorInfo:g})}:void 0;return a.reduceRight((p,g,v)=>{let w,y=!1,x=null,k=null;r&&(w=i&&g.route.id?i[g.route.id]:void 0,x=g.route.errorElement||QT,l&&(u<0&&v===0?(OS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,k=null):u===v&&(y=!0,k=g.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),E=()=>{let j;return w?j=x:y?j=k:g.route.Component?j=s.createElement(g.route.Component,null):g.route.element?j=g.route.element:j=p,s.createElement(e$,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:j})};return r&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?s.createElement($S,{location:r.location,revalidation:r.revalidation,component:x,error:w,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):E()},null)}function r4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function n$(e){let t=s.useContext(lc);return rn(t,r4(e)),t}function s4(e){let t=s.useContext(Wu);return rn(t,r4(e)),t}function r$(e){let t=s.useContext(pa);return rn(t,r4(e)),t}function a4(e){let t=r$(e),n=t.matches[t.matches.length-1];return rn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function s$(){return a4("useRouteId")}function a$(){let e=s4("useNavigation");return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function DS(){let{matches:e,loaderData:t}=s4("useMatches");return s.useMemo(()=>e.map(n=>aS(n,t)),[e,t])}function HS(){var r;let e=s.useContext(n4),t=s4("useRouteError"),n=a4("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function o$(){let{router:e}=n$("useNavigate"),t=a4("useNavigate"),n=s.useRef(!1);return LS(()=>{n.current=!0}),s.useCallback(async(a,i={})=>{qn(n.current,PS),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var f3={};function OS(e,t,n){!t&&!f3[e]&&(f3[e]=!0,qn(!1,n))}var h3={};function p3(e,t){!e&&!h3[t]&&(h3[t]=!0,console.warn(t))}var i$="useOptimistic",m3=ic[i$],l$=()=>{};function c$(e){return m3?m3(e):[e,l$]}function u$(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:s.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:s.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var d$=["HydrateFallback","hydrateFallbackElement"],f$=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function h$({router:e,flushSync:t,onError:n,useTransitions:r}){r=NS()||r;let[i,l]=s.useState(e.state),[u,f]=c$(i),[h,p]=s.useState(),[g,v]=s.useState({isTransitioning:!1}),[w,y]=s.useState(),[x,k]=s.useState(),[S,E]=s.useState(),j=s.useRef(new Map),N=s.useCallback((C,{deletedFetchers:R,newErrors:T,flushSync:H,viewTransitionOpts:D})=>{T&&n&&Object.values(T).forEach(O=>{var Z;return n(O,{location:C.location,params:((Z=C.matches[0])==null?void 0:Z.params)??{},pattern:U0(C.matches)})}),C.fetchers.forEach((O,Z)=>{O.data!==void 0&&j.current.set(Z,O.data)}),R.forEach(O=>j.current.delete(O)),p3(H===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let K=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(p3(D==null||K,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!K){t&&H?t(()=>l(C)):r===!1?l(C):s.startTransition(()=>{r===!0&&f(O=>g3(O,C)),l(C)});return}if(t&&H){t(()=>{x&&(w==null||w.resolve(),x.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let O=e.window.document.startViewTransition(()=>{t(()=>l(C))});O.finished.finally(()=>{t(()=>{y(void 0),k(void 0),p(void 0),v({isTransitioning:!1})})}),t(()=>k(O));return}x?(w==null||w.resolve(),x.skipTransition(),E({state:C,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(p(C),v({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,x,w,r,f,n]);s.useLayoutEffect(()=>e.subscribe(N),[e,N]),s.useEffect(()=>{g.isTransitioning&&!g.flushSync&&y(new f$)},[g]),s.useEffect(()=>{if(w&&h&&e.window){let C=h,R=w.promise,T=e.window.document.startViewTransition(async()=>{r===!1?l(C):s.startTransition(()=>{r===!0&&f(H=>g3(H,C)),l(C)}),await R});T.finished.finally(()=>{y(void 0),k(void 0),p(void 0),v({isTransitioning:!1})}),k(T)}},[h,w,e.window,r,f]),s.useEffect(()=>{w&&h&&u.location.key===h.location.key&&w.resolve()},[w,x,u.location,h]),s.useEffect(()=>{!g.isTransitioning&&S&&(p(S.state),v({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[g.isTransitioning,S]);let P=s.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:C=>e.navigate(C),push:(C,R,T)=>e.navigate(C,{state:R,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(C,R,T)=>e.navigate(C,{replace:!0,state:R,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[e]),$=e.basename||"/",M=s.useMemo(()=>({router:e,navigator:P,static:!1,basename:$,onError:n}),[e,P,$,n]);return s.createElement(s.Fragment,null,s.createElement(lc.Provider,{value:M},s.createElement(Wu.Provider,{value:u},s.createElement(MS.Provider,{value:j.current},s.createElement(t4.Provider,{value:g},s.createElement(g$,{basename:$,location:u.location,navigationType:u.historyAction,navigator:P,useTransitions:r},s.createElement(p$,{routes:e.routes,manifest:e.manifest,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function g3(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var p$=s.memo(m$);function m$({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return qT(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function uo({to:e,replace:t,state:n,relative:r}){rn(cc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:i}=s.useContext(fs);qn(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=s.useContext(pa),{pathname:u}=Zn(),f=Dn(),h=z0(e,lp(l),u,r==="path");bu(typeof e=="string"?e:ls(e),i.createHref(h),X6(i),"reject");let p=JSON.stringify(h);return s.useEffect(()=>{f(JSON.parse(p),{replace:t,state:n,relative:r})},[f,p,r,t,n]),null}function uc(e){return YT(e.context)}function g$({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:l}){rn(!cc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=s.useMemo(()=>({basename:u,navigator:a,static:i,useTransitions:l,future:{}}),[u,a,i,l]);typeof n=="string"&&(n=yo(n));let{pathname:h="/",search:p="",hash:g="",state:v=null,key:w="default",mask:y}=n,x=s.useMemo(()=>{let k=zs(h,u);return k==null?null:{location:{pathname:k,search:p,hash:g,state:v,key:w,mask:y},navigationType:r}},[u,h,p,g,v,w,r,y]);return qn(x!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:s.createElement(fs.Provider,{value:f},s.createElement(cp.Provider,{children:t,value:x}))}var oh="get",ih="application/x-www-form-urlencoded";function up(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function v$(e){return up(e)&&e.tagName.toLowerCase()==="button"}function w$(e){return up(e)&&e.tagName.toLowerCase()==="form"}function y$(e){return up(e)&&e.tagName.toLowerCase()==="input"}function b$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function x$(e,t){return e.button===0&&(!t||t==="_self")&&!b$(e)}function C8(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function k$(e,t){let n=C8(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var R1=null;function S$(){if(R1===null)try{new FormData(document.createElement("form"),0),R1=!1}catch{R1=!0}return R1}var E$=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function og(e){return e!=null&&!E$.has(e)?(qn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ih}"`),null):e}function C$(e,t){let n,r,a,i,l;if(w$(e)){let u=e.getAttribute("action");r=u?zs(u,t):null,n=e.getAttribute("method")||oh,a=og(e.getAttribute("enctype"))||ih,i=new FormData(e)}else if(v$(e)||y$(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?zs(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||oh,a=og(e.getAttribute("formenctype"))||og(u.getAttribute("enctype"))||ih,i=new FormData(u,e),!S$()){let{name:h,type:p,value:g}=e;if(p==="image"){let v=h?`${h}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else h&&i.append(h,g)}}else{if(up(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=oh,r=null,a=ih,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var j$={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},A$=/[&><\u2028\u2029]/g;function v3(e){return e.replace(A$,t=>j$[t])}function o4(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IS(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&zs(a.pathname,t)==="/"?a.pathname=`${Tu(t)}/_root.${r}`:a.pathname=`${Tu(a.pathname)}.${r}`,a}async function N$(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function M$(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function R$(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await N$(i,n);return l.links?l.links():[]}return[]}));return $$(r.flat(1).filter(M$).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function w3(e,t,n,r,a,i){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var p;return n[h].pathname!==f.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,h)=>l(f,h)||u(f,h)):i==="data"?t.filter((f,h)=>{var g;let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(l(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function P$(e,t,{includeHydrateFallback:n}={}){return L$(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function L$(e){return[...new Set(e)]}function T$(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $$(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(T$(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function i4(){let e=s.useContext(lc);return o4(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function D$(){let e=s.useContext(Wu);return o4(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var dp=s.createContext(void 0);dp.displayName="FrameworkContext";function fp(){let e=s.useContext(dp);return o4(e,"You must render this element inside a <HydratedRouter> element"),e}function H$(e,t){let n=s.useContext(dp),[r,a]=s.useState(!1),[i,l]=s.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,v=s.useRef(null);s.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let x=S=>{S.forEach(E=>{l(E.isIntersecting)})},k=new IntersectionObserver(x,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[e]),s.useEffect(()=>{if(r){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[r]);let w=()=>{a(!0)},y=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:Fd(u,w),onBlur:Fd(f,y),onMouseEnter:Fd(h,w),onMouseLeave:Fd(p,y),onTouchStart:Fd(g,w)}]:[!1,v,{}]}function Fd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function O$({page:e,...t}){let n=NS(),{nonce:r}=fp(),{router:a}=i4(),i=s.useMemo(()=>sS(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(F$,{page:e,matches:i,...t}):s.createElement(_$,{page:e,matches:i,...t})):null}function I$(e){let{manifest:t,routeModules:n}=fp(),[r,a]=s.useState([]);return s.useEffect(()=>{let i=!1;return R$(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function F$({page:e,matches:t,...n}){let r=Zn(),{future:a}=fp(),{basename:i}=i4(),l=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let u=IS(e,i,a.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?f=!0:h.push(p.route.id);return f&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[i,a.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,l.map(u=>s.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function _$({page:e,matches:t,...n}){let r=Zn(),{future:a,manifest:i,routeModules:l}=fp(),{basename:u}=i4(),{loaderData:f,matches:h}=D$(),p=s.useMemo(()=>w3(e,t,h,i,r,"data"),[e,t,h,i,r]),g=s.useMemo(()=>w3(e,t,h,i,r,"assets"),[e,t,h,i,r]),v=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,k=!1;if(t.forEach(E=>{var N;let j=i.routes[E.route.id];!j||!j.hasLoader||(!p.some(P=>P.route.id===E.route.id)&&E.route.id in f&&((N=l[E.route.id])!=null&&N.shouldRevalidate)||j.hasClientLoader?k=!0:x.add(E.route.id))}),x.size===0)return[];let S=IS(e,u,a.v8_trailingSlashAwareDataRequests,"data");return k&&x.size>0&&S.searchParams.set("_routes",t.filter(E=>x.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[u,a.v8_trailingSlashAwareDataRequests,f,r,i,p,t,e,l]),w=s.useMemo(()=>P$(g,i),[g,i]),y=I$(g);return s.createElement(s.Fragment,null,v.map(x=>s.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),w.map(x=>s.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),y.map(({key:x,link:k})=>s.createElement("link",{key:x,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function Z$(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var V$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{V$&&(window.__reactRouterVersion="7.18.3")}catch{}function z$(e,t){return mT({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:PL({window:t==null?void 0:t.window}),hydrationData:B$(),routes:e,mapRouteProperties:u$,hydrationRouteProperties:d$,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,instrumentations:t==null?void 0:t.instrumentations}).initialize()}function B$(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:U$(e.errors)}),e}function U$(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new B0(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(typeof a.__subType=="string"&&eT.includes(a.__subType)){let i=window[a.__subType];if(typeof i=="function")try{let l=new i(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(a.message);i.stack="",n[r]=i}}else n[r]=a;return n}var _n=s.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,mask:u,state:f,target:h,to:p,preventScrollReset:g,viewTransition:v,defaultShouldRevalidate:w,...y},x){let{basename:k,navigator:S,useTransitions:E}=s.useContext(fs),j=typeof p=="string"&&op.test(p),N=hS(p,k);p=N.to;let P=WT(p,{relative:a}),$=Zn(),M=null;if(u){let Z=z0(u,[],$.mask?$.mask.pathname:"/",!0);k!=="/"&&(Z.pathname=Z.pathname==="/"?k:ua([k,Z.pathname])),M=S.createHref(Z)}let[C,R,T]=H$(r,y),H=Y$(p,{replace:l,mask:u,state:f,target:h,preventScrollReset:g,relative:a,viewTransition:v,defaultShouldRevalidate:w,useTransitions:E});function D(Z){t&&t(Z),Z.defaultPrevented||H(Z)}let K=!(N.isExternal||i),O=s.createElement("a",{...y,...T,href:(K?M:void 0)||N.absoluteURL||P,onClick:K?D:t,ref:Z$(x,R),target:h,"data-discover":!j&&n==="render"?"true":void 0});return C&&!j?s.createElement(s.Fragment,null,O,s.createElement(O$,{page:P})):O});_n.displayName="Link";var W$=s.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:u,children:f,...h},p){let g=W0(l,{relative:h.relative}),v=Zn(),w=s.useContext(Wu),{navigator:y,basename:x}=s.useContext(fs),k=w!=null&&nD(g)&&u===!0,S=y.encodeLocation?y.encodeLocation(g).pathname:g.pathname,E=v.pathname,j=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(E=E.toLowerCase(),j=j?j.toLowerCase():null,S=S.toLowerCase()),j&&x&&(j=zs(j,x)||j);const N=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let P=E===S||!a&&E.startsWith(S)&&E.charAt(N)==="/",$=j!=null&&(j===S||!a&&j.startsWith(S)&&j.charAt(S.length)==="/"),M={isActive:P,isPending:$,isTransitioning:k},C=P?t:void 0,R;typeof r=="function"?R=r(M):R=[r,P?"active":null,$?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let T=typeof i=="function"?i(M):i;return s.createElement(_n,{...h,"aria-current":C,className:R,ref:p,style:T,to:l,viewTransition:u},typeof f=="function"?f(M):f)});W$.displayName="NavLink";var K$=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=oh,action:u,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...w},y)=>{let{useTransitions:x}=s.useContext(fs),k=Q$(),S=J$(u,{relative:h}),E=l.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&op.test(u),N=P=>{if(f&&f(P),P.defaultPrevented)return;P.preventDefault();let $=P.nativeEvent.submitter,M=($==null?void 0:$.getAttribute("formmethod"))||l,C=()=>k($||P.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:a,state:i,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v});x&&n!==!1?s.startTransition(()=>C()):C()};return s.createElement("form",{ref:y,method:E,action:S,onSubmit:r?f:N,...w,"data-discover":!j&&e==="render"?"true":void 0})});K$.displayName="Form";function FS({getKey:e,storageKey:t,...n}){let r=s.useContext(dp),{basename:a}=s.useContext(fs),i=Zn(),l=DS();eD({getKey:e,storageKey:t});let u=s.useMemo(()=>{if(!r||!e)return null;let h=A8(i,l,a,e);return h!==i.key?h:null},[]);if(!r||r.isSpaMode)return null;let f=((h,p)=>{if(!window.history.state||!window.history.state.key){let g=Math.random().toString(32).slice(2);window.history.replaceState({key:g},"")}try{let v=JSON.parse(sessionStorage.getItem(h)||"{}")[p||window.history.state.key];typeof v=="number"&&window.scrollTo(0,v)}catch(g){console.error(g),sessionStorage.removeItem(h)}}).toString();return n.nonce==null&&(r!=null&&r.nonce)&&(n.nonce=r.nonce),s.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${f})(${v3(JSON.stringify(t||j8))}, ${v3(JSON.stringify(u))})`}})}FS.displayName="ScrollRestoration";function _S(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l4(e){let t=s.useContext(lc);return rn(t,_S(e)),t}function G$(e){let t=s.useContext(Wu);return rn(t,_S(e)),t}function Y$(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f,useTransitions:h}={}){let p=Dn(),g=Zn(),v=W0(e,{relative:l});return s.useCallback(w=>{if(x$(w,t)){w.preventDefault();let y=n!==void 0?n:ls(g)===ls(v),x=()=>p(e,{replace:y,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f});h?s.startTransition(()=>x()):x()}},[g,p,v,n,r,a,t,e,i,l,u,f,h])}function el(e){qn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=s.useRef(C8(e)),n=s.useRef(!1),r=Zn(),a=s.useMemo(()=>k$(r.search,n.current?null:t.current),[r.search]),i=Dn(),l=s.useCallback((u,f)=>{const h=C8(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,i("?"+h,f)},[i,a]);return[a,l]}var q$=0,X$=()=>`__${String(++q$)}__`;function Q$(){let{router:e}=l4("useSubmit"),{basename:t}=s.useContext(fs),n=s$(),r=e.fetch,a=e.navigate;return s.useCallback(async(i,l={})=>{let{action:u,method:f,encType:h,formData:p,body:g}=C$(i,t);if(l.navigate===!1){let v=l.fetcherKey||X$();await r(v,n,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function J$(e,{relative:t}={}){let{basename:n}=s.useContext(fs),r=s.useContext(pa);rn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...W0(e||".",{relative:t})},l=Zn();if(e==null){i.search=l.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(p=>p==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ua([n,i.pathname])),ls(i)}var j8="react-router-scroll-positions",P1={};function A8(e,t,n,r){let a=null;return r&&(n!=="/"?a=r({...e,pathname:zs(e.pathname,n)||e.pathname},t):a=r(e,t)),a==null&&(a=e.key),a}function eD({getKey:e,storageKey:t}={}){let{router:n}=l4("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:a}=G$("useScrollRestoration"),{basename:i}=s.useContext(fs),l=Zn(),u=DS(),f=a$();s.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),tD(s.useCallback(()=>{if(f.state==="idle"){let h=A8(l,u,i,e);P1[h]=window.scrollY}try{sessionStorage.setItem(t||j8,JSON.stringify(P1))}catch(h){qn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${h}).`)}window.history.scrollRestoration="auto"},[f.state,e,i,l,u,t])),typeof document<"u"&&(s.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(t||j8);h&&(P1=JSON.parse(h))}catch{}},[t]),s.useLayoutEffect(()=>{let h=n==null?void 0:n.enableScrollRestoration(P1,()=>window.scrollY,e?(p,g)=>A8(p,g,i,e):void 0);return()=>h&&h()},[n,i,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}}catch{qn(!1,`"${l.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[l,r,a]))}function tD(e,t){let{capture:n}={};s.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function nD(e,{relative:t}={}){let n=s.useContext(t4);rn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=l4("useViewTransitionState"),a=W0(e,{relative:t});if(!n.isTransitioning)return!1;let i=zs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=zs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Wi(a.pathname,l)!=null||Wi(a.pathname,i)!=null}var Rr=J5(),rD=Object.defineProperty,c4=(e,t)=>rD(e,"name",{value:t,configurable:!0});function N8(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}c4(N8,"setRef");function ZS(...e){return t=>{let n=!1;const r=e.map(a=>{const i=N8(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():N8(e[a],null)}}}}c4(ZS,"composeRefs");function an(...e){return s.useCallback(ZS(...e),e)}c4(an,"useComposedRefs");var sD=Object.defineProperty,Oa=(e,t)=>sD(e,"name",{value:t,configurable:!0});function $a(e){const t=s.forwardRef((n,r)=>{let{children:a,...i}=n,l=null,u=!1;const f=[];M8(a)&&typeof L1=="function"&&(a=L1(a._payload)),s.Children.forEach(a,v=>{var w;if(US(v)){u=!0;const y=v;let x="child"in y.props?y.props.child:y.props.children;M8(x)&&typeof L1=="function"&&(x=L1(x._payload)),l=aD(y,x),f.push((w=l==null?void 0:l.props)==null?void 0:w.children)}else f.push(v)}),l?l=s.cloneElement(l,void 0,f):!u&&s.Children.count(a)===1&&s.isValidElement(a)&&(l=a);const h=l?BS(l):void 0,p=an(r,h);if(!l){if(a||a===0)throw new Error(u?lD(e):iD(e));return a}const g=zS(i,l.props??{});return l.type!==s.Fragment&&(g.ref=r?p:h),s.cloneElement(l,g)});return t.displayName=`${e}.Slot`,t}Oa($a,"createSlot");var dc=$a("Slot"),VS=Symbol.for("radix.slottable");function u4(e){const t=Oa(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=VS,t}Oa(u4,"createSlottable");var hp=u4("Slottable"),aD=Oa((e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function zS(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const f=i(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}Oa(zS,"mergeProps");function BS(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Oa(BS,"getElementRef");function US(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VS}Oa(US,"isSlottable");var oD=Symbol.for("react.lazy");function M8(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===oD&&"_payload"in e&&WS(e._payload)}Oa(M8,"isLazyComponent");function WS(e){return typeof e=="object"&&e!==null&&"then"in e}Oa(WS,"isPromiseLike");var iD=Oa(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),lD=Oa(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),L1=ic[" use ".trim().toString()],cD=Object.defineProperty,uD=(e,t)=>cD(e,"name",{value:t,configurable:!0}),dD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=dD.reduce((e,t)=>{const n=$a(`Primitive.${t}`),r=s.forwardRef((a,i)=>{const{asChild:l,...u}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function d4(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}uD(d4,"dispatchDiscreteCustomEvent");var fD=Object.defineProperty,hD=(e,t)=>fD(e,"name",{value:t,configurable:!0}),KS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),pD=s.forwardRef(hD(function(t,n){return o.jsx(ln.span,{...t,ref:n,style:{...KS,...t.style}})},"VisuallyHidden")),GS=pD,mD=Object.defineProperty,oa=(e,t)=>mD(e,"name",{value:t,configurable:!0});function gD(e,t){const n=s.createContext(t);n.displayName=e+"Context";const r=oa(i=>{const{children:l,...u}=i,f=s.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:f,children:l})},"Provider");r.displayName=e+"Provider";function a(i,l={}){const{optional:u=!1}=l,f=s.useContext(n);if(f)return f;if(t!==void 0)return t;if(!u)throw new Error(`\`${i}\` must be used within \`${e}\``)}return oa(a,"useContext"),[r,a]}oa(gD,"createContext");function Ms(e,t=[]){let n=[];function r(i,l){const u=s.createContext(l);u.displayName=i+"Context";const f=n.length;n=[...n,l];const h=oa(g=>{var S;const{scope:v,children:w,...y}=g,x=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useMemo(()=>y,Object.values(y));return o.jsx(x.Provider,{value:k,children:w})},"Provider");h.displayName=i+"Provider";function p(g,v,w={}){var S;const{optional:y=!1}=w,x=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useContext(x);if(k)return k;if(l!==void 0)return l;if(!y)throw new Error(`\`${g}\` must be used within \`${i}\``)}return oa(p,"useContext"),[h,p]}oa(r,"createContext");const a=oa(()=>{const i=n.map(l=>s.createContext(l));return oa(function(u){const f=(u==null?void 0:u[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])},"useScope")},"createScope");return a.scopeName=e,[r,YS(a,...t)]}oa(Ms,"createContextScope");function YS(...e){const t=e[0];if(e.length===1)return t;const n=oa(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return oa(function(i){const l=r.reduce((u,{useScope:f,scopeName:h})=>{const g=f(i)[`__scope${h}`];return{...u,...g}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}oa(YS,"composeContextScopes");var vD=Object.defineProperty,Nr=(e,t)=>vD(e,"name",{value:t,configurable:!0});function pp(e){const t=e+"CollectionProvider",[n,r]=Ms(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=Nr(x=>{const{scope:k,children:S}=x,E=s.useRef(null),j=s.useRef(new Map).current;return o.jsx(a,{scope:k,itemMap:j,collectionRef:E,children:S})},"CollectionProvider");l.displayName=t;const u=e+"CollectionSlot",f=$a(u),h=s.forwardRef((x,k)=>{const{scope:S,children:E}=x,j=i(u,S),N=an(k,j.collectionRef);return o.jsx(f,{ref:N,children:E})});h.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=$a(p),w=s.forwardRef((x,k)=>{const{scope:S,children:E,...j}=x,N=s.useRef(null),P=an(k,N),$=i(p,S);return s.useEffect(()=>($.itemMap.set(N,{ref:N,...j}),()=>void $.itemMap.delete(N))),o.jsx(v,{[g]:"",ref:P,children:E})});w.displayName=p;function y(x){const k=i(e+"CollectionConsumer",x);return s.useCallback(()=>{const E=k.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort(($,M)=>j.indexOf($.ref.current)-j.indexOf(M.ref.current))},[k.collectionRef,k.itemMap])}return Nr(y,"useCollection"),[{Provider:l,Slot:h,ItemSlot:w},y,r]}Nr(pp,"createCollection");var y3=new WeakMap,fr,Os,ig=(Os=class extends Map{constructor(n){super(n);Lb(this,fr);Y2(this,fr,[...super.keys()]),y3.set(this,!0)}set(n,r){return y3.get(this)&&(this.has(n)?Kr(this,fr)[Kr(this,fr).indexOf(n)]=n:Kr(this,fr).push(n)),super.set(n,r),this}insert(n,r,a){const i=this.has(r),l=Kr(this,fr).length,u=f4(n);let f=u>=0?u:l+u;const h=f<0||f>=l?-1:f;if(h===this.size||i&&h===this.size-1||h===-1)return this.set(r,a),this;const p=this.size+(i?0:1);u<0&&f++;const g=[...Kr(this,fr)];let v,w=!1;for(let y=f;y<p;y++)if(f===y){let x=g[y];g[y]===r&&(x=g[y+1]),i&&this.delete(r),v=this.get(x),this.set(r,a)}else{!w&&g[y-1]===r&&(w=!0);const x=g[w?y:y-1],k=v;v=this.get(x),this.delete(x),this.set(x,k)}return this}with(n,r,a){const i=new Os(this);return i.insert(n,r,a),i}before(n){const r=Kr(this,fr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,a){const i=Kr(this,fr).indexOf(n);return i===-1?this:this.insert(i,r,a)}after(n){let r=Kr(this,fr).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,a){const i=Kr(this,fr).indexOf(n);return i===-1?this:this.insert(i+1,r,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Y2(this,fr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Kr(this,fr).splice(Kr(this,fr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=lh(Kr(this,fr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=lh(Kr(this,fr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Kr(this,fr).indexOf(n)}keyAt(n){return lh(Kr(this,fr),n)}from(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return i;a++}}findIndex(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return a;a++}return-1}filter(n,r){const a=[];let i=0;for(const l of this)Reflect.apply(n,r,[l,i,this])&&a.push(l),i++;return new Os(a)}map(n,r){const a=[];let i=0;for(const l of this)a.push([l[0],Reflect.apply(n,r,[l,i,this])]),i++;return new Os(a)}reduce(...n){const[r,a]=n;let i=0,l=a??this.at(0);for(const u of this)i===0&&n.length===1?l=u:l=Reflect.apply(r,this,[l,u,i,this]),i++;return l}reduceRight(...n){const[r,a]=n;let i=a??this.at(-1);for(let l=this.size-1;l>=0;l--){const u=this.at(l);l===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,l,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Os(r)}toReversed(){const n=new Os;for(let r=this.size-1;r>=0;r--){const a=this.keyAt(r),i=this.get(a);n.set(a,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Os(r)}slice(n,r){const a=new Os;let i=this.size-1;if(n===void 0)return a;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let l=n;l<=i;l++){const u=this.keyAt(l),f=this.get(u);a.set(u,f)}return a}every(n,r){let a=0;for(const i of this){if(!Reflect.apply(n,r,[i,a,this]))return!1;a++}return!0}some(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return!0;a++}return!1}},fr=new WeakMap,Nr(Os,"OrderedDict"),Os);function lh(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=qS(e,t);return n===-1?void 0:e[n]}Nr(lh,"at");function qS(e,t){const n=e.length,r=f4(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}Nr(qS,"toSafeIndex");function f4(e){return e!==e||e===0?0:Math.trunc(e)}Nr(f4,"toSafeInteger");function wD(e){const t=e+"CollectionProvider",[n,r]=Ms(t),[a,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ig,setItemMap:Nr(()=>{},"setItemMap")}),l=Nr(({state:j,...N})=>j?o.jsx(f,{...N,state:j}):o.jsx(u,{...N}),"CollectionProvider");l.displayName=t;const u=Nr(j=>{const N=k();return o.jsx(f,{...j,state:N})},"CollectionInit");u.displayName=t+"Init";const f=Nr(j=>{const{scope:N,children:P,state:$}=j,M=s.useRef(null),[C,R]=s.useState(null),T=an(M,R),[H,D]=$;return s.useEffect(()=>{if(!C)return;const K=JS(()=>{});return K.observe(C,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[C]),o.jsx(a,{scope:N,itemMap:H,setItemMap:D,collectionRef:T,collectionRefObject:M,collectionElement:C,children:P})},"CollectionProviderImpl");f.displayName=t+"Impl";const h=e+"CollectionSlot",p=$a(h),g=s.forwardRef((j,N)=>{const{scope:P,children:$}=j,M=i(h,P),C=an(N,M.collectionRef);return o.jsx(p,{ref:C,children:$})});g.displayName=h;const v=e+"CollectionItemSlot",w="data-radix-collection-item",y=$a(v),x=s.forwardRef((j,N)=>{const{scope:P,children:$,...M}=j,C=s.useRef(null),[R,T]=s.useState(null),H=an(N,C,T),D=i(v,P),{setItemMap:K}=D,O=s.useRef(M);XS(O.current,M)||(O.current=M);const Z=O.current;return s.useEffect(()=>{const te=Z;return K(B=>R?B.has(R)?B.set(R,{...te,element:R}).toSorted(R8):(B.set(R,{...te,element:R}),B.toSorted(R8)):B),()=>{K(B=>!R||!B.has(R)?B:(B.delete(R),new ig(B)))}},[R,Z,K]),o.jsx(y,{[w]:"",ref:H,children:$})});x.displayName=v;function k(){return s.useState(new ig)}Nr(k,"useInitCollection");function S(j){const{itemMap:N}=i(e+"CollectionConsumer",j);return N}return Nr(S,"useCollection"),[{Provider:l,Slot:g,ItemSlot:x},{createCollectionScope:r,useCollection:S,useInitCollection:k}]}Nr(wD,"createCollection");function XS(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!Object.prototype.hasOwnProperty.call(t,a)||e[a]!==t[a])return!1;return!0}Nr(XS,"shallowEqual");function QS(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Nr(QS,"isElementPreceding");function R8(e,t){return!e[1].element||!t[1].element?0:QS(e[1].element,t[1].element)?-1:1}Nr(R8,"sortByDocumentPosition");function JS(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Nr(JS,"getChildListObserver");var yD=Object.defineProperty,Ku=(e,t)=>yD(e,"name",{value:t,configurable:!0}),e9=!!(typeof window<"u"&&window.document&&window.document.createElement);function yt(e,t,{checkForDefaultPrevented:n=!0}={}){return Ku(function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}Ku(yt,"composeEventHandlers");function bD(e){var t;if(!e9)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Ku(bD,"getOwnerWindow");function P8(e){if(!e9)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ku(P8,"getOwnerDocument");function t9(e,t=!1){const{activeElement:n}=P8(e);if(!(n!=null&&n.nodeName))return null;if(n9(n)&&n.contentDocument)return t9(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=P8(n).getElementById(r);if(a)return a}}return n}Ku(t9,"getActiveElement");function n9(e){return e.tagName==="IFRAME"}Ku(n9,"isFrame");var gr=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},xD=Object.defineProperty,kD=(e,t)=>xD(e,"name",{value:t,configurable:!0}),b3=ic[" useEffectEvent ".trim().toString()],x3=ic[" useInsertionEffect ".trim().toString()];function r9(e){if(typeof b3=="function")return b3(e);const t=s.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof x3=="function"?x3(()=>{t.current=e}):gr(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}kD(r9,"useEffectEvent");var SD=Object.defineProperty,K0=(e,t)=>SD(e,"name",{value:t,configurable:!0}),ED=ic[" useInsertionEffect ".trim().toString()]||gr;function Qo({prop:e,defaultProp:t,onChange:n=K0(()=>{},"onChange"),caller:r}){const[a,i,l]=s9({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a,h=s.useCallback(p=>{var g;if(u){const v=a9(p)?p(e):p;v!==e&&((g=l.current)==null||g.call(l,v))}else i(p)},[u,e,i,l]);return[f,h]}K0(Qo,"useControllableState");function s9({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),a=s.useRef(n),i=s.useRef(t);return ED(()=>{i.current=t},[t]),s.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}K0(s9,"useUncontrolledState");function a9(e){return typeof e=="function"}K0(a9,"isFunction");var k3=Symbol("RADIX:SYNC_STATE");function CD(e,t,n,r){const{prop:a,defaultProp:i,onChange:l,caller:u}=t,f=a!==void 0,h=r9(l),p=[{...n,state:i}];r&&p.push(r);const[g,v]=s.useReducer((k,S)=>{if(S.type===k3)return{...k,state:S.state};const E=e(k,S);return f&&!Object.is(E.state,k.state)&&h(E.state),E},...p),w=g.state,y=s.useRef(w);s.useEffect(()=>{y.current!==w&&(y.current=w,f||h(w))},[w,y,f]);const x=s.useMemo(()=>a!==void 0?{...g,state:a}:g,[g,a]);return s.useEffect(()=>{f&&!Object.is(a,g.state)&&v({type:k3,state:a})},[a,g.state,f]),[x,v]}K0(CD,"useControllableStateReducer");var jD=Object.defineProperty,Jo=(e,t)=>jD(e,"name",{value:t,configurable:!0});function o9(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}Jo(o9,"useStateMachine");var es=Jo(e=>{const{present:t,children:n}=e,r=i9(t),a=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=l9(r.ref,c9(a));return typeof n=="function"||r.isPresent?s.cloneElement(a,{ref:i}):null},"Presence");function i9(e){const[t,n]=s.useState(),r=s.useRef(null),a=s.useRef(e),i=s.useRef("none"),l=s.useRef(void 0),u=e?"mounted":"unmounted",[f,h]=o9(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{f==="mounted"?(i.current=l.current??uu(r.current),l.current=void 0):i.current="none"},[f]),gr(()=>{const p=r.current,g=a.current;if(g!==e){const w=i.current,y=uu(p);e?(l.current=y,h("MOUNT")):y==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(g&&w!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),gr(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,v=Jo(y=>{const k=uu(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&k&&(h("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),w=Jo(y=>{y.target===t&&(i.current=uu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:s.useCallback(p=>{if(p){const g=getComputedStyle(p);r.current=g,l.current=uu(g)}else r.current=null;n(p)},[])}}Jo(i9,"usePresence");function L8(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Jo(L8,"setRef");function l9(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(l=>{const u=L8(l,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():L8(r[l],null)}}},[])}Jo(l9,"useStableComposedRefs");function uu(e){return(e==null?void 0:e.animationName)||"none"}Jo(uu,"getAnimationName");function c9(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jo(c9,"getElementRef");var AD=Object.defineProperty,ND=(e,t)=>AD(e,"name",{value:t,configurable:!0}),MD=ic[" useId ".trim().toString()]||(()=>{}),RD=0;function da(e){const[t,n]=s.useState(MD());return gr(()=>{e||n(r=>r??String(RD++))},[e]),e||(t?`radix-${t}`:"")}ND(da,"useId");var PD=Object.defineProperty,u9=(e,t)=>PD(e,"name",{value:t,configurable:!0}),d9=s.createContext(void 0),LD=u9(e=>{const{dir:t,children:n}=e;return o.jsx(d9.Provider,{value:t,children:n})},"DirectionProvider");function G0(e){const t=s.useContext(d9);return e||t||"ltr"}u9(G0,"useDirection");var TD=LD,$D=Object.defineProperty,DD=(e,t)=>$D(e,"name",{value:t,configurable:!0});function pr(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}DD(pr,"useCallbackRef");var HD=Object.defineProperty,Ar=(e,t)=>HD(e,"name",{value:t,configurable:!0}),T8="dismissableLayer.update",OD="dismissableLayer.pointerDownOutside",ID="dismissableLayer.focusOutside",S3,f9=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Y0=s.forwardRef(Ar(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:h,...p}=t,g=s.useContext(f9),[v,w]=s.useState(null),y=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=s.useState({}),k=an(n,w),S=Array.from(g.layers),[E]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),j=E?S.indexOf(E):-1,N=v?S.indexOf(v):-1,P=g.layersWithOutsidePointerEventsDisabled.size>0,$=N>=j,M=s.useRef(!1),C=p9(D=>{l==null||l(D),f==null||f(D),D.defaultPrevented||h==null||h()},{ownerDocument:y,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(D=>{if(!(D instanceof Node))return!1;const K=[...g.branches].some(O=>O.contains(D));return $&&!K},[g.branches,$])}),R=m9(D=>{if(a&&M.current)return;const K=D.target;[...g.branches].some(Z=>Z.contains(K))||(u==null||u(D),f==null||f(D),D.defaultPrevented||h==null||h())},y),T=v?N===S.length-1:!1,H=pr(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&h&&(D.preventDefault(),h()))});return s.useEffect(()=>{if(T)return y.addEventListener("keydown",H,{capture:!0}),()=>y.removeEventListener("keydown",H,{capture:!0})},[y,T,H]),s.useEffect(()=>{if(v)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(S3=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),$8(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(v),g.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=S3))}},[v,y,r,g]),s.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),$8())},[v,g]),s.useEffect(()=>{const D=Ar(()=>x({}),"handleUpdate");return document.addEventListener(T8,D),()=>document.removeEventListener(T8,D)},[]),o.jsx(ln.div,{...p,ref:k,style:{pointerEvents:P?$?"auto":"none":void 0,...t.style},onFocusCapture:yt(t.onFocusCapture,R.onFocusCapture),onBlurCapture:yt(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:yt(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function h9(){const e=s.useContext(f9),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ar(h9,"useDismissableLayerSurface");var FD=Ar(()=>!0,"IS_TRUE");function p9(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:l=FD}=t,u=pr(e),f=s.useRef(!1),h=s.useRef(!1),p=s.useRef(new Map),g=s.useRef(()=>{});return s.useEffect(()=>{function v(){h.current=!1,a.current=!1,p.current.clear()}Ar(v,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}Ar(w,"isOutsideInteractionIntercepted");function y(j){if(!h.current)return;const N=j.target;N instanceof Node&&[...i].some($=>$.contains(N))||p.current.set(j.type,!0),j.type==="click"&&window.setTimeout(()=>{h.current&&g.current()},0)}Ar(y,"handleInteractionCapture");function x(j){h.current&&p.current.set(j.type,!1)}Ar(x,"handleInteractionBubble");const k=Ar(j=>{if(j.target&&!f.current){let N=function(){n.removeEventListener("click",g.current);const $=w();v(),$||h4(OD,u,P,{discrete:!0})};if(Ar(N,"handleAndDispatchPointerDownOutsideEvent"),!l(j.target)){n.removeEventListener("click",g.current),v(),f.current=!1;return}const P={originalEvent:j};h.current=!0,a.current=r&&j.button===0,p.current.clear(),!r||j.button!==0?N():(n.removeEventListener("click",g.current),g.current=N,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),v();f.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const j of S)n.addEventListener(j,y,!0),n.addEventListener(j,x);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",k),n.removeEventListener("click",g.current);for(const j of S)n.removeEventListener(j,y,!0),n.removeEventListener(j,x)}},[n,u,r,a,i,l]),{onPointerDownCapture:Ar(()=>f.current=!0,"onPointerDownCapture")}}Ar(p9,"usePointerDownOutside");function m9(e,t=globalThis==null?void 0:globalThis.document){const n=pr(e),r=s.useRef(!1);return s.useEffect(()=>{const a=Ar(i=>{i.target&&!r.current&&h4(ID,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:Ar(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ar(()=>r.current=!1,"onBlurCapture")}}Ar(m9,"useFocusOutside");function $8(){const e=new CustomEvent(T8);document.dispatchEvent(e)}Ar($8,"dispatchUpdate");function h4(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?d4(a,i):a.dispatchEvent(i)}Ar(h4,"handleAndDispatchCustomEvent");var _D=Object.defineProperty,os=(e,t)=>_D(e,"name",{value:t,configurable:!0}),lg="focusScope.autoFocusOnMount",cg="focusScope.autoFocusOnUnmount",E3={bubbles:!1,cancelable:!0},Gu=s.forwardRef(os(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=t,[f,h]=s.useState(null),p=pr(i),g=pr(l),v=s.useRef(null),w=an(n,h),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let k=function(N){if(y.paused||!f)return;const P=N.target;f.contains(P)?v.current=P:$o(v.current,{select:!0})},S=function(N){if(y.paused||!f)return;const P=N.relatedTarget;P!==null&&(f.contains(P)||$o(v.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const $ of N)$.removedNodes.length>0&&$o(f)};os(k,"handleFocusIn"),os(S,"handleFocusOut"),os(E,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",S);const j=new MutationObserver(E);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),j.disconnect()}}},[a,f,y.paused]),s.useEffect(()=>{if(f){C3.add(y);const k=document.activeElement;if(!f.contains(k)){const E=new CustomEvent(lg,E3);f.addEventListener(lg,p),f.dispatchEvent(E),E.defaultPrevented||(g9(x9(p4(f)),{select:!0}),document.activeElement===k&&$o(f))}return()=>{f.removeEventListener(lg,p),setTimeout(()=>{const E=new CustomEvent(cg,E3);f.addEventListener(cg,g),f.dispatchEvent(E),E.defaultPrevented||$o(k??document.body,{select:!0}),f.removeEventListener(cg,g),C3.remove(y)},0)}}},[f,p,g,y]);const x=s.useCallback(k=>{if(!r&&!a||y.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,E=document.activeElement;if(S&&E){const j=k.currentTarget,[N,P]=v9(j);N&&P?!k.shiftKey&&E===P?(k.preventDefault(),r&&$o(N,{select:!0})):k.shiftKey&&E===N&&(k.preventDefault(),r&&$o(P,{select:!0})):E===j&&k.preventDefault()}},[r,a,y.paused]);return o.jsx(ln.div,{tabIndex:-1,...u,ref:w,onKeyDown:x})},"FocusScope"));function g9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($o(r,{select:t}),document.activeElement!==n)return}os(g9,"focusFirst");function v9(e){const t=p4(e),n=D8(t,e),r=D8(t.reverse(),e);return[n,r]}os(v9,"getTabbableEdges");function p4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:os(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}os(p4,"getTabbableCandidates");function D8(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):w9(r,{upTo:t})))return r}os(D8,"findVisible");function w9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}os(w9,"isHidden");function y9(e){return e instanceof HTMLInputElement&&"select"in e}os(y9,"isSelectableInput");function $o(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y9(e)&&t&&e.select()}}os($o,"focus");var C3=b9();function b9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=H8(e,t),e.unshift(t)},remove(t){var n;e=H8(e,t),(n=e[0])==null||n.resume()}}}os(b9,"createFocusScopesStack");function H8(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}os(H8,"arrayRemove");function x9(e){return e.filter(t=>t.tagName!=="A")}os(x9,"removeLinks");var ZD=Object.defineProperty,VD=(e,t)=>ZD(e,"name",{value:t,configurable:!0}),q0=s.forwardRef(VD(function(t,n){var f;const{container:r,...a}=t,[i,l]=s.useState(!1);gr(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Rr.createPortal(o.jsx(ln.div,{...a,ref:n}),u):null},"Portal")),zD=Object.defineProperty,m4=(e,t)=>zD(e,"name",{value:t,configurable:!0}),T1=0,Xa=null;function BD(e){return Yu(),e.children}m4(BD,"FocusGuards");function Yu(){s.useEffect(()=>{Xa||(Xa={start:O8(),end:O8()});const{start:e,end:t}=Xa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),T1++,()=>{T1===1&&(Xa==null||Xa.start.remove(),Xa==null||Xa.end.remove(),Xa=null),T1=Math.max(0,T1-1)}},[])}m4(Yu,"useFocusGuards");function O8(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}m4(O8,"createFocusGuard");var to=function(){return to=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},to.apply(this,arguments)};function k9(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function UD(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ch="right-scroll-bar-position",uh="width-before-scroll-bar",WD="with-scroll-bars-hidden",KD="--removed-body-scroll-bar-size";function ug(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GD(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var YD=typeof window<"u"?s.useLayoutEffect:s.useEffect,j3=new WeakMap;function qD(e,t){var n=GD(null,function(r){return e.forEach(function(a){return ug(a,r)})});return YD(function(){var r=j3.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(u){i.has(u)||ug(u,null)}),i.forEach(function(u){a.has(u)||ug(u,l)})}j3.set(n,e)},[e]),n}function XD(e){return e}function QD(e,t){t===void 0&&(t=XD);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var f=function(){var p=l;l=[],p.forEach(i)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return a}function JD(e){e===void 0&&(e={});var t=QD(null);return t.options=to({async:!0,ssr:!1},e),t}var S9=function(e){var t=e.sideCar,n=k9(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,to({},n))};S9.isSideCarExport=!0;function eH(e,t){return e.useMedium(t),S9}var E9=JD(),dg=function(){},mp=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:dg,onWheelCapture:dg,onTouchMoveCapture:dg}),a=r[0],i=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,w=e.noRelative,y=e.noIsolation,x=e.inert,k=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,j=e.gapMode,N=k9(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=v,$=qD([n,t]),M=to(to({},N),a);return s.createElement(s.Fragment,null,p&&s.createElement(P,{sideCar:E9,removeScrollBar:h,shards:g,noRelative:w,noIsolation:y,inert:x,setCallbacks:i,allowPinchZoom:!!k,lockRef:n,gapMode:j}),l?s.cloneElement(s.Children.only(u),to(to({},M),{ref:$})):s.createElement(E,to({},M,{className:f,ref:$}),u))});mp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mp.classNames={fullWidth:uh,zeroRight:ch};var tH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tH();return t&&e.setAttribute("nonce",t),e}function rH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nH())&&(rH(t,n),sH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oH=function(){var e=aH();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},C9=function(){var e=oH(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},iH={left:0,top:0,right:0,gap:0},fg=function(e){return parseInt(e||"",10)||0},lH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[fg(n),fg(r),fg(a)]},cH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iH;var t=lH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uH=C9(),ku="data-scroll-locked",dH=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
53
- .`.concat(WD,` {
54
- overflow: hidden `).concat(r,`;
55
- padding-right: `).concat(u,"px ").concat(r,`;
56
- }
57
- body[`).concat(ku,`] {
58
- overflow: hidden `).concat(r,`;
59
- overscroll-behavior: contain;
60
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
61
- padding-left: `.concat(a,`px;
62
- padding-top: `).concat(i,`px;
63
- padding-right: `).concat(l,`px;
64
- margin-left:0;
65
- margin-top:0;
66
- margin-right: `).concat(u,"px ").concat(r,`;
67
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
68
- }
69
-
70
- .`).concat(ch,` {
71
- right: `).concat(u,"px ").concat(r,`;
72
- }
73
-
74
- .`).concat(uh,` {
75
- margin-right: `).concat(u,"px ").concat(r,`;
76
- }
77
-
78
- .`).concat(ch," .").concat(ch,` {
79
- right: 0 `).concat(r,`;
80
- }
81
-
82
- .`).concat(uh," .").concat(uh,` {
83
- margin-right: 0 `).concat(r,`;
84
- }
85
-
86
- body[`).concat(ku,`] {
87
- `).concat(KD,": ").concat(u,`px;
88
- }
89
- `)},A3=function(){var e=parseInt(document.body.getAttribute(ku)||"0",10);return isFinite(e)?e:0},fH=function(){s.useEffect(function(){return document.body.setAttribute(ku,(A3()+1).toString()),function(){var e=A3()-1;e<=0?document.body.removeAttribute(ku):document.body.setAttribute(ku,e.toString())}},[])},hH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;fH();var i=s.useMemo(function(){return cH(a)},[a]);return s.createElement(uH,{styles:dH(i,!t,a,n?"":"!important")})},I8=!1;if(typeof window<"u")try{var $1=Object.defineProperty({},"passive",{get:function(){return I8=!0,!0}});window.addEventListener("test",$1,$1),window.removeEventListener("test",$1,$1)}catch{I8=!1}var qc=I8?{passive:!1}:!1,pH=function(e){return e.tagName==="TEXTAREA"},j9=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pH(e)&&n[t]==="visible")},mH=function(e){return j9(e,"overflowY")},gH=function(e){return j9(e,"overflowX")},N3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=A9(e,r);if(a){var i=N9(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},A9=function(e,t){return e==="v"?mH(t):gH(t)},N9=function(e,t){return e==="v"?vH(t):wH(t)},yH=function(e,t){return e==="h"&&t==="rtl"?-1:1},bH=function(e,t,n,r,a){var i=yH(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,f=t.contains(u),h=!1,p=l>0,g=0,v=0;do{if(!u)break;var w=N9(e,u),y=w[0],x=w[1],k=w[2],S=x-k-i*y;(y||S)&&A9(e,u)&&(g+=S,v+=y);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},D1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},M3=function(e){return[e.deltaX,e.deltaY]},R3=function(e){return e&&"current"in e?e.current:e},xH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kH=function(e){return`
90
- .block-interactivity-`.concat(e,` {pointer-events: none;}
91
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
- `)},SH=0,Xc=[];function EH(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),a=s.useState(SH++)[0],i=s.useState(C9)[0],l=s.useRef(e);s.useEffect(function(){l.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var x=UD([e.lockRef.current],(e.shards||[]).map(R3),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var S=D1(x),E=n.current,j="deltaX"in x?x.deltaX:E[0]-S[0],N="deltaY"in x?x.deltaY:E[1]-S[1],P,$=x.target,M=Math.abs(j)>Math.abs(N)?"h":"v";if("touches"in x&&M==="h"&&$.type==="range")return!1;var C=window.getSelection(),R=C&&C.anchorNode,T=R?R===$||R.contains($):!1;if(T)return!1;var H=N3(M,$);if(!H)return!0;if(H?P=M:(P=M==="v"?"h":"v",H=N3(M,$)),!H)return!1;if(!r.current&&"changedTouches"in x&&(j||N)&&(r.current=P),!P)return!0;var D=r.current||P;return bH(D,k,x,D==="h"?j:N)},[]),f=s.useCallback(function(x){var k=x;if(!(!Xc.length||Xc[Xc.length-1]!==i)){var S="deltaY"in k?M3(k):D1(k),E=t.current.filter(function(P){return P.name===k.type&&(P.target===k.target||k.target===P.shadowParent)&&xH(P.delta,S)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var j=(l.current.shards||[]).map(R3).filter(Boolean).filter(function(P){return P.contains(k.target)}),N=j.length>0?u(k,j[0]):!l.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),h=s.useCallback(function(x,k,S,E){var j={name:x,delta:k,target:S,should:E,shadowParent:CH(S)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(N){return N!==j})},1)},[]),p=s.useCallback(function(x){n.current=D1(x),r.current=void 0},[]),g=s.useCallback(function(x){h(x.type,M3(x),x.target,u(x,e.lockRef.current))},[]),v=s.useCallback(function(x){h(x.type,D1(x),x.target,u(x,e.lockRef.current))},[]);s.useEffect(function(){return Xc.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,qc),document.addEventListener("touchmove",f,qc),document.addEventListener("touchstart",p,qc),function(){Xc=Xc.filter(function(x){return x!==i}),document.removeEventListener("wheel",f,qc),document.removeEventListener("touchmove",f,qc),document.removeEventListener("touchstart",p,qc)}},[]);var w=e.removeScrollBar,y=e.inert;return s.createElement(s.Fragment,null,y?s.createElement(i,{styles:kH(a)}):null,w?s.createElement(hH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function CH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jH=eH(E9,EH);var X0=s.forwardRef(function(e,t){return s.createElement(mp,to({},e,{ref:t,sideCar:jH}))});X0.classNames=mp.classNames;var AH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Qc=new WeakMap,H1=new WeakMap,O1={},hg=0,M9=function(e){return e&&(e.host||M9(e.parentNode))},NH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=M9(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},MH=function(e,t,n,r){var a=NH(t,Array.isArray(e)?e:[e]);O1[n]||(O1[n]=new WeakMap);var i=O1[n],l=[],u=new Set,f=new Set(a),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};a.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(u.has(v))p(v);else try{var w=v.getAttribute(r),y=w!==null&&w!=="false",x=(Qc.get(v)||0)+1,k=(i.get(v)||0)+1;Qc.set(v,x),i.set(v,k),l.push(v),x===1&&y&&H1.set(v,!0),k===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return p(t),u.clear(),hg++,function(){l.forEach(function(g){var v=Qc.get(g)-1,w=i.get(g)-1;Qc.set(g,v),i.set(g,w),v||(H1.has(g)||g.removeAttribute(r),H1.delete(g)),w||g.removeAttribute(n)}),hg--,hg||(Qc=new WeakMap,Qc=new WeakMap,H1=new WeakMap,O1={})}},gp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=AH(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),MH(r,a,n,"aria-hidden")):function(){return null}},RH=Object.defineProperty,Us=(e,t)=>RH(e,"name",{value:t,configurable:!0}),g4="Dialog",[R9,P9]=Ms(g4),[PH,Ia]=R9(g4),fc=Us(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=s.useRef(null),f=s.useRef(null),[h,p]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:g4}),[g,v]=s.useState(0),[w,y]=s.useState(0);return o.jsx(PH,{scope:t,triggerRef:u,contentRef:f,contentId:da(),titleId:da(),descriptionId:da(),titlePresent:g>0,descriptionPresent:w>0,setTitleCount:v,setDescriptionCount:y,open:h,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(x=>!x),[p]),modal:l,children:n})},"Dialog"),LH="DialogTrigger",v4=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Ia(LH,r),l=an(n,i.triggerRef);return o.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":wp(i.open),...a,ref:l,onClick:yt(t.onClick,i.onOpenToggle)})},"DialogTrigger")),L9="DialogPortal",[TH,T9]=R9(L9,{forceMount:void 0}),hc=Us(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ia(L9,t);return o.jsx(TH,{scope:t,forceMount:n,children:s.Children.map(r,l=>o.jsx(es,{present:n||i.open,children:o.jsx(q0,{asChild:!0,container:a,children:l})}))})},"DialogPortal"),F8="DialogOverlay",pc=s.forwardRef(Us(function(t,n){const r=T9(F8,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=Ia(F8,t.__scopeDialog);return l.modal?o.jsx(es,{present:a||l.open,children:o.jsx(DH,{...i,ref:n})}):null},"DialogOverlay")),$H=$a("DialogOverlay.RemoveScroll"),DH=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Ia(F8,r),l=h9(),u=an(n,l);return o.jsx(X0,{as:$H,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(ln.div,{"data-state":wp(i.open),...a,ref:u,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),x0="DialogContent",mc=s.forwardRef(Us(function(t,n){const r=T9(x0,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=Ia(x0,t.__scopeDialog);return o.jsx(es,{present:a||l.open,children:l.modal?o.jsx(HH,{...i,ref:n}):o.jsx(OH,{...i,ref:n})})},"DialogContent")),HH=s.forwardRef(Us(function(t,n){const r=Ia(x0,t.__scopeDialog),a=s.useRef(null),i=an(n,r.contentRef,a);return s.useEffect(()=>{const l=a.current;if(l)return gp(l)},[]),o.jsx($9,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:yt(t.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:yt(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),OH=s.forwardRef(Us(function(t,n){const r=Ia(x0,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return o.jsx($9,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"DialogContentNonModal")),$9=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=t,f=Ia(x0,r);return Yu(),o.jsx(o.Fragment,{children:o.jsx(Gu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(Y0,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":wp(f.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),IH="DialogTitle",gc=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Ia(IH,r),{setTitleCount:l}=i;return gr(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(ln.h2,{id:i.titleId,...a,ref:n})},"DialogTitle")),FH="DialogDescription",w4=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Ia(FH,r),{setDescriptionCount:l}=i;return gr(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(ln.p,{id:i.descriptionId,...a,ref:n})},"DialogDescription")),_H="DialogClose",vp=s.forwardRef(Us(function(t,n){const{__scopeDialog:r,...a}=t,i=Ia(_H,r);return o.jsx(ln.button,{type:"button",...a,ref:n,onClick:yt(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function wp(e){return e?"open":"closed"}Us(wp,"getState");var ZH=Object.defineProperty,si=(e,t)=>ZH(e,"name",{value:t,configurable:!0}),VH="AlertDialog",[zH,yle]=Ms(VH,[P9]),ai=P9(),BH=si(e=>{const{__scopeAlertDialog:t,...n}=e,r=ai(t);return o.jsx(fc,{...r,...n,modal:!0})},"AlertDialog"),UH=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ai(r);return o.jsx(v4,{...i,...a,ref:n})},"AlertDialogTrigger")),WH=si(e=>{const{__scopeAlertDialog:t,...n}=e,r=ai(t);return o.jsx(hc,{...r,...n})},"AlertDialogPortal"),KH=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ai(r);return o.jsx(pc,{...i,...a,ref:n})},"AlertDialogOverlay")),GH="AlertDialogContent",[YH,qH]=zH(GH),XH=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,children:a,...i}=t,l=ai(r),u=s.useRef(null),f=an(n,u),h=s.useRef(null);return o.jsx(YH,{scope:r,cancelRef:h,children:o.jsx(mc,{role:"alertdialog",...l,...i,ref:f,onOpenAutoFocus:yt(i.onOpenAutoFocus,p=>{var g;p.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:a})})},"AlertDialogContent")),QH=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ai(r);return o.jsx(gc,{...i,...a,ref:n})},"AlertDialogTitle")),JH=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ai(r);return o.jsx(w4,{...i,...a,ref:n})},"AlertDialogDescription")),eO=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=ai(r);return o.jsx(vp,{...i,...a,ref:n})},"AlertDialogAction")),tO="AlertDialogCancel",nO=s.forwardRef(si(function(t,n){const{__scopeAlertDialog:r,...a}=t,{cancelRef:i}=qH(tO,r),l=ai(r),u=an(n,i);return o.jsx(vp,{...l,...a,ref:u})},"AlertDialogCancel")),rO=BH,sO=UH,aO=WH,oO=KH,iO=XH,lO=eO,cO=nO,uO=QH,dO=JH,fO=Object.defineProperty,hO=(e,t)=>fO(e,"name",{value:t,configurable:!0});function D9(e){const[t,n]=s.useState(void 0);return gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const f=i.borderBoxSize,h=Array.isArray(f)?f[0]:f;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}hO(D9,"useSize");const pO=["top","right","bottom","left"],Ki=Math.min,zo=Math.max,kh=Math.round,I1=Math.floor,Bo=e=>({x:e,y:e}),mO={left:"right",right:"left",bottom:"top",top:"bottom"};function H9(e,t,n){return zo(e,Ki(t,n))}function ei(e,t){return typeof e=="function"?e(t):e}function Gi(e){return e.split("-")[0]}function qu(e){return e.split("-")[1]}function y4(e){return e==="x"?"y":"x"}function b4(e){return e==="y"?"height":"width"}function ro(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function x4(e){return y4(ro(e))}function gO(e,t,n){n===void 0&&(n=!1);const r=qu(e),a=x4(e),i=b4(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Sh(l)),[l,Sh(l)]}function vO(e){const t=Sh(e);return[_8(e),t,_8(t)]}function _8(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const P3=["left","right"],L3=["right","left"],wO=["top","bottom"],yO=["bottom","top"];function bO(e,t,n){switch(e){case"top":case"bottom":return n?t?L3:P3:t?P3:L3;case"left":case"right":return t?wO:yO;default:return[]}}function xO(e,t,n,r){const a=qu(e);let i=bO(Gi(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(_8)))),i}function Sh(e){const t=Gi(e);return mO[t]+e.slice(t.length)}function kO(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function O9(e){return typeof e!="number"?kO(e):{top:e,right:e,bottom:e,left:e}}function Eh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function T3(e,t,n){let{reference:r,floating:a}=e;const i=ro(t),l=x4(t),u=b4(l),f=Gi(t),h=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let w;switch(f){case"top":w={x:p,y:r.y-a.height};break;case"bottom":w={x:p,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:g};break;case"left":w={x:r.x-a.width,y:g};break;default:w={x:r.x,y:r.y}}const y=qu(t);return y&&(w[l]+=v*(y==="end"?1:-1)*(n&&h?-1:1)),w}async function SO(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:w=0}=ei(t,e),y=O9(w),k=u[v?g==="floating"?"reference":"floating":g],S=Eh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),E=g==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),N=await(i.isElement==null?void 0:i.isElement(j))&&await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1},P=Eh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:j,strategy:f}):E);return{top:(S.top-P.top+y.top)/N.y,bottom:(P.bottom-S.bottom+y.bottom)/N.y,left:(S.left-P.left+y.left)/N.x,right:(P.right-S.right+y.right)/N.x}}const EO=50,CO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:SO},f=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=T3(h,r,f),v=r,w=0;const y={};for(let x=0;x<i.length;x++){const k=i[x];if(!k)continue;const{name:S,fn:E}=k,{x:j,y:N,data:P,reset:$}=await E({x:p,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:y,rects:h,platform:u,elements:{reference:e,floating:t}});p=j??p,g=N??g,y[S]={...y[S],...P},$&&w<EO&&(w++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(h=$.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):$.rects),{x:p,y:g}=T3(h,v,f)),x=-1)}return{x:p,y:g,placement:v,strategy:a,middlewareData:y}},jO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:f}=t,{element:h,padding:p=0}=ei(e,t)||{};if(h==null)return{};const g=O9(p),v={x:n,y:r},w=x4(a),y=b4(w),x=await l.getDimensions(h),k=w==="y",S=k?"top":"left",E=k?"bottom":"right",j=k?"clientHeight":"clientWidth",N=i.reference[y]+i.reference[w]-v[w]-i.floating[y],P=v[w]-i.reference[w],$=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let M=$?$[j]:0;(!M||!await(l.isElement==null?void 0:l.isElement($)))&&(M=u.floating[j]||i.floating[y]);const C=N/2-P/2,R=M/2-x[y]/2-1,T=Ki(g[S],R),H=Ki(g[E],R),D=M-x[y]-H,K=M/2-x[y]/2+C,O=H9(T,K,D),Z=!f.arrow&&qu(a)!=null&&K!==O&&i.reference[y]/2-(K<T?T:H)-x[y]/2<0,te=Z?K<T?K-T:K-D:0;return{[w]:v[w]+te,data:{[w]:O,centerOffset:K-O-te,...Z&&{alignmentOffset:te}},reset:Z}}}),AO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...k}=ei(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Gi(a),E=ro(u),j=Gi(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(h.floating)),P=v||(j||!x?[Sh(u)]:vO(u)),$=y!=="none";!v&&$&&P.push(...xO(u,x,y,N));const M=[u,...P],C=await f.detectOverflow(t,k),R=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&R.push(C[S]),g){const O=gO(a,l,N);R.push(C[O[0]],C[O[1]])}if(T=[...T,{placement:a,overflows:R}],!R.every(O=>O<=0)){var H,D;const O=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=M[O];if(Z&&(!(g==="alignment"?E!==ro(Z):!1)||T.every(F=>ro(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:O,overflows:T},reset:{placement:Z}};let te=(D=T.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!te)switch(w){case"bestFit":{var K;const B=(K=T.filter(F=>{if($){const X=ro(F.placement);return X===E||X==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(X=>X>0).reduce((X,z)=>X+z,0)]).sort((F,X)=>F[1]-X[1])[0])==null?void 0:K[0];B&&(te=B);break}case"initialPlacement":te=u;break}if(a!==te)return{reset:{placement:te}}}return{}}}};function $3(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D3(e){return pO.some(t=>e[t]>=0)}const NO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ei(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),u=$3(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:D3(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),u=$3(l,n.floating);return{data:{escapedOffsets:u,escaped:D3(u)}}}default:return{}}}}},I9=new Set(["left","top"]);async function MO(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Gi(n),u=qu(n),f=ro(n)==="y",h=I9.has(l)?-1:1,p=i&&f?-1:1,g=ei(t,e);let{mainAxis:v,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof y=="number"&&(w=u==="end"?y*-1:y),f?{x:w*p,y:v*h}:{x:v*h,y:w*p}}const RO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,f=await MO(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},PO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:f={fn:E=>{let{x:j,y:N}=E;return{x:j,y:N}}},...h}=ei(e,t),p={x:n,y:r},g=await i.detectOverflow(t,h),v=ro(a),w=y4(v);let y=p[w],x=p[v];const k=(E,j)=>H9(j+g[E==="y"?"top":"left"],j,j-g[E==="y"?"bottom":"right"]);l&&(y=k(w,y)),u&&(x=k(v,x));const S=f.fn({...t,[w]:y,[v]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[w]:l,[v]:u}}}}}},LO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:i,placement:l,rects:u,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:g=!0}=ei(e,t),v={x:a,y:i},w=ro(l),y=y4(w);let x=v[y],k=v[w];const S=ei(h,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const P=y==="y"?"height":"width",$=u.reference[y]-u.floating[P]+E.mainAxis,M=u.reference[y]+u.reference[P]-E.mainAxis;x<$?x=$:x>M&&(x=M)}if(g){var j,N;const P=y==="y"?"width":"height",$=I9.has(Gi(l)),M=u.reference[w]-u.floating[P]+($&&((j=f.offset)==null?void 0:j[w])||0)+($?0:E.crossAxis),C=u.reference[w]+u.reference[P]+($?0:((N=f.offset)==null?void 0:N[w])||0)-($?E.crossAxis:0);k<M?k=M:k>C&&(k=C)}return{[y]:x,[w]:k}}}},TO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:i}=t,{apply:l=()=>{},...u}=ei(e,t),f=await a.detectOverflow(t,u),h=Gi(n),p=qu(n),g=ro(n)==="y",{width:v,height:w}=r.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=h,y=p==="end"?"top":"bottom");const k=w-f.top-f.bottom,S=v-f.left-f.right,E=Ki(w-f[y],k),j=Ki(v-f[x],S),N=t.middlewareData.shift,P=!N;let $=E,M=j;N!=null&&N.enabled.x&&(M=S),N!=null&&N.enabled.y&&($=k),P&&!p&&(g?M=v-2*zo(f.left,f.right):$=w-2*zo(f.top,f.bottom)),await l({...t,availableWidth:M,availableHeight:$});const C=await a.getDimensions(i.floating);return v!==C.width||w!==C.height?{reset:{rects:!0}}:{}}}};function yp(){return typeof window<"u"}function Xu(e){return F9(e)?(e.nodeName||"").toLowerCase():"#document"}function ks(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function oi(e){var t;return(t=(F9(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function F9(e){return yp()?e instanceof Node||e instanceof ks(e).Node:!1}function fo(e){return yp()?e instanceof Element||e instanceof ks(e).Element:!1}function tl(e){return yp()?e instanceof HTMLElement||e instanceof ks(e).HTMLElement:!1}function H3(e){return!yp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ks(e).ShadowRoot}function bp(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ho(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function $O(e){return/^(table|td|th)$/.test(Xu(e))}function xp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const DO=/transform|translate|scale|rotate|perspective|filter/,HO=/paint|layout|strict|content/,jl=e=>!!e&&e!=="none";let pg;function k4(e){const t=fo(e)?ho(e):e;return jl(t.transform)||jl(t.translate)||jl(t.scale)||jl(t.rotate)||jl(t.perspective)||!S4()&&(jl(t.backdropFilter)||jl(t.filter))||DO.test(t.willChange||"")||HO.test(t.contain||"")}function OO(e){let t=Gl(e);for(;tl(t)&&!k0(t);){if(k4(t))return t;if(xp(t))return null;t=Gl(t)}return null}function S4(){return pg==null&&(pg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pg}function k0(e){return/^(html|body|#document)$/.test(Xu(e))}function ho(e){return ks(e).getComputedStyle(e)}function kp(e){return fo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gl(e){if(Xu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||H3(e)&&e.host||oi(e);return H3(t)?t.host:t}function _9(e){const t=Gl(e);return k0(t)?(e.ownerDocument||e).body:tl(t)&&bp(t)?t:_9(t)}function S0(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=_9(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ks(a);if(i){const u=Z8(l);return t.concat(l,l.visualViewport||[],bp(a)?a:[],u&&n?S0(u):[])}else return t.concat(a,S0(a,[],n))}function Z8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Z9(e){const t=ho(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=tl(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=kh(n)!==i||kh(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function E4(e){return fo(e)?e:e.contextElement}function Su(e){const t=E4(e);if(!tl(t))return Bo(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Z9(t);let l=(i?kh(n.width):n.width)/r,u=(i?kh(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const IO=Bo(0);function V9(e){const t=ks(e);return!S4()||!t.visualViewport?IO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FO(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ks(e)}function Yl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=E4(e);let l=Bo(1);t&&(r?fo(r)&&(l=Su(r)):l=Su(e));const u=FO(i,n,r)?V9(i):Bo(0);let f=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i&&r){const v=ks(i),w=fo(r)?ks(r):r;let y=v,x=Z8(y);for(;x&&w!==y;){const k=Su(x),S=x.getBoundingClientRect(),E=ho(x),j=S.left+(x.clientLeft+parseFloat(E.paddingLeft))*k.x,N=S.top+(x.clientTop+parseFloat(E.paddingTop))*k.y;f*=k.x,h*=k.y,p*=k.x,g*=k.y,f+=j,h+=N,y=ks(x),x=Z8(y)}}return Eh({width:p,height:g,x:f,y:h})}function Sp(e,t){const n=kp(e).scrollLeft;return t?t.left+n:Yl(oi(e)).left+n}function z9(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Sp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function _O(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=oi(r),u=t?xp(t.floating):!1;if(r===l||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=Bo(1);const p=Bo(0),g=tl(r);if((g||!i)&&((Xu(r)!=="body"||bp(l))&&(f=kp(r)),g)){const w=Yl(r);h=Su(r),p.x=w.x+r.clientLeft,p.y=w.y+r.clientTop}const v=l&&!g&&!i?z9(l,f):Bo(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-f.scrollTop*h.y+p.y+v.y}}function ZO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function VO(e){const t=kp(e),n=e.ownerDocument.body,r=zo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=zo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Sp(e);const l=-t.scrollTop;return ho(n).direction==="rtl"&&(i+=zo(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:l}}const zO=25;function BO(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=ks(e),i=oi(e),l=a.visualViewport;let u=i.clientWidth,f=i.clientHeight,h=0,p=0;if(l){const v=!S4()||t==="fixed";r?v||(h=-l.offsetLeft,p=-l.offsetTop):(u=l.width,f=l.height,v&&(h=l.offsetLeft,p=l.offsetTop))}if(Sp(i)<=0){const v=i.ownerDocument,w=v.body,y=getComputedStyle(w),x=v.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(i.clientWidth-w.clientWidth-x),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?k/2:k;S<=zO&&(u-=S)}return{width:u,height:f,x:h,y:p}}function UO(e,t){const n=Yl(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Su(e),l=e.clientWidth*i.x,u=e.clientHeight*i.y,f=a*i.x,h=r*i.y;return{width:l,height:u,x:f,y:h}}function O3(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=BO(e,n,t);else if(t==="document")r=VO(oi(e));else if(fo(t))r=UO(t,n);else{const a=V9(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Eh(r)}function WO(e,t){const n=t.get(e);if(n)return n;let r=S0(e,[],!1).filter(u=>fo(u)&&Xu(u)!=="body"),a=null;const i=ho(e).position==="fixed";let l=i?Gl(e):e;for(;fo(l)&&!k0(l);){const u=ho(l),f=k4(l),h=a?a.position:i?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(g=>g!==l):a=u,l=Gl(l)}return t.set(e,r),r}function KO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?xp(t)?[]:WO(t,this._c):[].concat(n),r],u=O3(t,l[0],a);let f=u.top,h=u.right,p=u.bottom,g=u.left;for(let v=1;v<l.length;v++){const w=O3(t,l[v],a);f=zo(w.top,f),h=Ki(w.right,h),p=Ki(w.bottom,p),g=zo(w.left,g)}return{width:h-g,height:p-f,x:g,y:f}}function GO(e){const{width:t,height:n}=Z9(e);return{width:t,height:n}}function YO(e,t,n){const r=tl(t),a=oi(t),i=n==="fixed",l=Yl(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=Bo(0);if((r||!i)&&((Xu(t)!=="body"||bp(a))&&(u=kp(t)),r)){const v=Yl(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}!r&&a&&(f.x=Sp(a));const h=a&&!r&&!i?z9(a,u):Bo(0),p=l.left+u.scrollLeft-f.x-h.x,g=l.top+u.scrollTop-f.y-h.y;return{x:p,y:g,width:l.width,height:l.height}}function mg(e){return ho(e).position==="static"}function I3(e,t){if(!tl(e)||ho(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oi(e)===n&&(n=n.ownerDocument.body),n}function B9(e,t){const n=ks(e);if(xp(e))return n;if(!tl(e)){let a=Gl(e);for(;a&&!k0(a);){if(fo(a)&&!mg(a))return a;a=Gl(a)}return n}let r=I3(e,t);for(;r&&$O(r)&&mg(r);)r=I3(r,t);return r&&k0(r)&&mg(r)&&!k4(r)?n:r||OO(e)||n}const qO=async function(e){const t=this.getOffsetParent||B9,n=this.getDimensions,r=await n(e.floating);return{reference:YO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XO(e){return ho(e).direction==="rtl"}const QO={convertOffsetParentRelativeRectToViewportRelativeRect:_O,getDocumentElement:oi,getClippingRect:KO,getOffsetParent:B9,getElementRects:qO,getClientRects:ZO,getDimensions:GO,getScale:Su,isElement:fo,isRTL:XO};function U9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JO(e,t,n){let r=null,a;const i=oi(e);function l(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function u(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),l();const v=e.getBoundingClientRect(),{left:w,top:y,width:x,height:k}=v;if(p||t(),!x||!k)return;const S=I1(y),E=I1(i.clientWidth-(w+x)),j=I1(i.clientHeight-(y+k)),N=I1(w),$={rootMargin:-S+"px "+-E+"px "+-j+"px "+-N+"px",threshold:zo(0,Ki(1,g))||1};let M=!0;function C(R){const T=R[0].intersectionRatio;if(!U9(v,e.getBoundingClientRect()))return u();if(T!==g){if(!M)return u();T?u(!1,T):a=setTimeout(()=>{u(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(C,{...$,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,$)}r.observe(e)}const f=ks(e),h=()=>u(n);return f.addEventListener("resize",h),u(!0),()=>{f.removeEventListener("resize",h),l()}}function W9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=E4(e),p=a||i?[...h?S0(h):[],...t?S0(t):[]]:[];p.forEach(S=>{a&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const g=h&&u?JO(h,n,i):null;let v=-1,w=null;l&&(w=new ResizeObserver(S=>{let[E]=S;E&&E.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=w)==null||j.observe(t)})),n()}),h&&!f&&w.observe(h),t&&w.observe(t));let y,x=f?Yl(e):null;f&&k();function k(){const S=Yl(e);x&&!U9(x,S)&&n(),x=S,y=requestAnimationFrame(k)}return n(),()=>{var S;p.forEach(E=>{a&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),g==null||g(),(S=w)==null||S.disconnect(),w=null,f&&cancelAnimationFrame(y)}}const K9=RO,G9=PO,Y9=AO,eI=TO,tI=NO,V8=jO,nI=LO,q9=(e,t,n)=>{const r=new Map,a=n??{},i={...QO,...a.platform,_c:r};return CO(e,t,{...a,platform:i})};var rI=typeof document<"u",sI=function(){},dh=rI?s.useLayoutEffect:sI;function Ch(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ch(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Ch(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function X9(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F3(e,t){const n=X9(e);return Math.round(t*n)/n}function gg(e){const t=s.useRef(e);return dh(()=>{t.current=e}),t}function aI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[p,g]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,w]=s.useState(r);Ch(v,r)||w(r);const[y,x]=s.useState(null),[k,S]=s.useState(null),E=s.useCallback(F=>{F!==$.current&&($.current=F,x(F))},[]),j=s.useCallback(F=>{F!==M.current&&(M.current=F,S(F))},[]),N=i||y,P=l||k,$=s.useRef(null),M=s.useRef(null),C=s.useRef(p),R=f!=null,T=gg(f),H=gg(a),D=gg(h),K=s.useCallback(()=>{if(!$.current||!M.current)return;const F={placement:t,strategy:n,middleware:v};H.current&&(F.platform=H.current),q9($.current,M.current,F).then(X=>{const z={...X,isPositioned:D.current!==!1};O.current&&!Ch(C.current,z)&&(C.current=z,Rr.flushSync(()=>{g(z)}))})},[v,t,n,H,D]);dh(()=>{h===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[h]);const O=s.useRef(!1);dh(()=>(O.current=!0,()=>{O.current=!1}),[]),dh(()=>{if(N&&($.current=N),P&&(M.current=P),N&&P){if(T.current)return T.current(N,P,K);K()}},[N,P,K,T,R]);const Z=s.useMemo(()=>({reference:$,floating:M,setReference:E,setFloating:j}),[E,j]),te=s.useMemo(()=>({reference:N,floating:P}),[N,P]),B=s.useMemo(()=>{const F={position:n,left:0,top:0};if(!te.floating)return F;const X=F3(te.floating,p.x),z=F3(te.floating,p.y);return u?{...F,transform:"translate("+X+"px, "+z+"px)",...X9(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:z}},[n,u,te.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:K,refs:Z,elements:te,floatingStyles:B}),[p,K,Z,te,B])}const oI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?V8({element:r.current,padding:a}).fn(n):{}:r?V8({element:r,padding:a}).fn(n):{}}}},iI=(e,t)=>{const n=K9(e);return{name:n.name,fn:n.fn,options:[e,t]}},lI=(e,t)=>{const n=G9(e);return{name:n.name,fn:n.fn,options:[e,t]}},cI=(e,t)=>({fn:nI(e).fn,options:[e,t]}),uI=(e,t)=>{const n=Y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},dI=(e,t)=>{const n=eI(e);return{name:n.name,fn:n.fn,options:[e,t]}},fI=(e,t)=>{const n=tI(e);return{name:n.name,fn:n.fn,options:[e,t]}},hI=(e,t)=>{const n=oI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var pI=Object.defineProperty,mI=(e,t)=>pI(e,"name",{value:t,configurable:!0}),gI=s.forwardRef(mI(function(t,n){const{children:r,width:a=10,height:i=5,...l}=t;return o.jsx(ln.svg,{...l,ref:n,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),vI=gI,wI=Object.defineProperty,Uo=(e,t)=>wI(e,"name",{value:t,configurable:!0}),Q9="Popper",[J9,nl]=Ms(Q9),[yI,eE]=J9(Q9),bI=Uo(e=>{const{__scopePopper:t,children:n}=e,[r,a]=s.useState(null),[i,l]=s.useState(void 0);return o.jsx(yI,{scope:t,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:l,children:n})},"Popper"),xI="PopperAnchor",kI=s.forwardRef(Uo(function(t,n){const{__scopePopper:r,virtualRef:a,...i}=t,l=eE(xI,r),u=s.useRef(null),f=l.onAnchorChange,h=s.useCallback(x=>{u.current=x,x&&f(x)},[f]),p=an(n,h),g=s.useRef(null);s.useEffect(()=>{if(!a)return;const x=g.current;g.current=a.current,x!==g.current&&f(g.current)});const v=l.placementState&&Ep(l.placementState),w=v==null?void 0:v[0],y=v==null?void 0:v[1];return a?null:o.jsx(ln.div,{"data-radix-popper-side":w,"data-radix-popper-align":y,...i,ref:p})},"PopperAnchor")),tE="PopperContent",[SI,EI]=J9(tE),CI=s.forwardRef(Uo(function(t,n){var xe,ee,ae,re,_,ue,We;const{__scopePopper:r,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:x,...k}=t,S=eE(tE,r),[E,j]=s.useState(null),N=an(n,j),[P,$]=s.useState(null),M=D9(P),C=(M==null?void 0:M.width)??0,R=(M==null?void 0:M.height)??0,T=a+(l!=="center"?"-"+l:""),H=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},D=Array.isArray(p)?p:[p],K=D.length>0,O={padding:H,boundary:D.filter(nE),altBoundary:K},{refs:Z,floatingStyles:te,placement:B,isPositioned:F,middlewareData:X}=aI({strategy:"fixed",placement:T,whileElementsMounted:Uo((...Xe)=>W9(...Xe,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[iI({mainAxis:i+R,alignmentAxis:u}),h&&lI({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?cI():void 0,...O}),h&&uI({...O}),dI({...O,apply:Uo(({elements:Xe,rects:ze,availableWidth:tt,availableHeight:ce})=>{const{width:ve,height:Pe}=ze.reference,de=Xe.floating.style;de.setProperty("--radix-popper-available-width",`${tt}px`),de.setProperty("--radix-popper-available-height",`${ce}px`),de.setProperty("--radix-popper-anchor-width",`${ve}px`),de.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),P&&hI({element:P,padding:f}),MI({arrowWidth:C,arrowHeight:R}),w&&fI({strategy:"referenceHidden",...O,boundary:K?O.boundary:void 0})]}),z=S.setPlacementState;gr(()=>(z(B),()=>{z(void 0)}),[B,z]);const[I,U]=Ep(B),G=pr(x);gr(()=>{F&&(G==null||G())},[F,G]);const ne=(xe=X.arrow)==null?void 0:xe.x,q=(ee=X.arrow)==null?void 0:ee.y,le=((ae=X.arrow)==null?void 0:ae.centerOffset)!==0,[Se,Q]=s.useState();return gr(()=>{E&&Q(window.getComputedStyle(E).zIndex)},[E]),o.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:F?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(re=X.transformOrigin)==null?void 0:re.x,(_=X.transformOrigin)==null?void 0:_.y].join(" "),...((ue=X.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(SI,{scope:r,placedSide:I,placedAlign:U,onArrowChange:$,arrowX:ne,arrowY:q,shouldHideArrow:le,children:o.jsx(ln.div,{"data-side":I,"data-align":U,...k,ref:N,style:{...k.style,animation:F?(We=k.style)==null?void 0:We.animation:"none"}})})})},"PopperContent")),jI="PopperArrow",AI={top:"bottom",right:"left",bottom:"top",left:"right"},NI=s.forwardRef(Uo(function(t,n){const{__scopePopper:r,...a}=t,i=EI(jI,r),l=AI[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(vI,{...a,ref:n,style:{...a.style,display:"block"}})})},"PopperArrow"));function nE(e){return e!==null}Uo(nE,"isNotNull");var MI=Uo(e=>({name:"transformOrigin",options:e,fn(t){var k,S,E;const{placement:n,rects:r,middlewareData:a}=t,l=((k=a.arrow)==null?void 0:k.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[h,p]=Ep(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(((S=a.arrow)==null?void 0:S.x)??0)+u/2,w=(((E=a.arrow)==null?void 0:E.y)??0)+f/2;let y="",x="";return h==="bottom"?(y=l?g:`${v}px`,x=`${-f}px`):h==="top"?(y=l?g:`${v}px`,x=`${r.floating.height+f}px`):h==="right"?(y=`${-f}px`,x=l?g:`${w}px`):h==="left"&&(y=`${r.floating.width+f}px`,x=l?g:`${w}px`),{data:{x:y,y:x}}}}),"transformOrigin");function Ep(e){const[t,n="center"]=e.split("-");return[t,n]}Uo(Ep,"getSideAndAlignFromPlacement");var Cp=bI,Q0=kI,jp=CI,RI=NI,PI=Object.defineProperty,C4=(e,t)=>PI(e,"name",{value:t,configurable:!0}),vg=!1;function rE(){const[e,t]=s.useState(vg);return s.useEffect(()=>{vg||(vg=!0,t(!0))},[]),e}C4(rE,"useIsHydrated");var sE=ic[" useSyncExternalStore ".trim().toString()];function aE(){return()=>{}}C4(aE,"subscribe");function oE(){return sE(aE,()=>!0,()=>!1)}C4(oE,"useIsHydratedModern");var LI=typeof sE=="function"?oE:rE,TI=Object.defineProperty,vc=(e,t)=>TI(e,"name",{value:t,configurable:!0}),wg="rovingFocusGroup.onEntryFocus",$I={bubbles:!1,cancelable:!0},Ap="RovingFocusGroup",[z8,iE,DI]=pp(Ap),[HI,lE]=Ms(Ap,[DI]),[OI,II]=HI(Ap),FI=s.forwardRef(vc(function(t,n){return o.jsx(z8.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(z8.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(_I,{...t,ref:n})})})},"RovingFocusGroup")),_I=s.forwardRef(vc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=t,w=s.useRef(null),y=an(n,w),x=G0(l),[k,S]=Qo({prop:u,defaultProp:f??null,onChange:h,caller:Ap}),[E,j]=s.useState(!1),N=pr(p),P=iE(r),$=s.useRef(!1),[M,C]=s.useState(0);return s.useEffect(()=>{const R=w.current;if(R)return R.addEventListener(wg,N),()=>R.removeEventListener(wg,N)},[N]),o.jsx(OI,{scope:r,orientation:a,dir:x,loop:i,currentTabStopId:k,onItemFocus:s.useCallback(R=>S(R),[S]),onItemShiftTab:s.useCallback(()=>j(!0),[]),onFocusableItemAdd:s.useCallback(()=>C(R=>R+1),[]),onFocusableItemRemove:s.useCallback(()=>C(R=>R-1),[]),children:o.jsx(ln.div,{tabIndex:E||M===0?-1:0,"data-orientation":a,...v,ref:y,style:{outline:"none",...t.style},onMouseDown:yt(t.onMouseDown,()=>{$.current=!0}),onFocus:yt(t.onFocus,R=>{const T=!$.current;if(R.target===R.currentTarget&&T&&!E){const H=new CustomEvent(wg,$I);if(R.currentTarget.dispatchEvent(H),!H.defaultPrevented){const D=P().filter(B=>B.focusable),K=D.find(B=>B.active),O=D.find(B=>B.id===k),te=[K,O,...D].filter(Boolean).map(B=>B.ref.current);j4(te,g)}}$.current=!1}),onBlur:yt(t.onBlur,()=>j(!1))})})},"RovingFocusGroupImpl")),ZI="RovingFocusGroupItem",VI=s.forwardRef(vc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:l,children:u,...f}=t,h=da(),p=l||h,g=II(ZI,r),v=g.currentTabStopId===p,w=iE(r),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:k}=g,S=LI();return gr(()=>{if(!(!S||!a))return y(),()=>x()},[S,a,y,x]),s.useEffect(()=>{if(!(S||!a))return y(),()=>x()},[S,a,y,x]),o.jsx(z8.ItemSlot,{scope:r,id:p,focusable:a,active:i,children:o.jsx(ln.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:yt(t.onMouseDown,E=>{a?g.onItemFocus(p):E.preventDefault()}),onFocus:yt(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:yt(t.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const j=uE(E,g.orientation,g.dir);if(j!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let P=w().filter($=>$.focusable).map($=>$.ref.current);if(j==="last")P.reverse();else if(j==="prev"||j==="next"){j==="prev"&&P.reverse();const $=P.indexOf(E.currentTarget);P=g.loop?dE(P,$+1):P.slice($+1)}setTimeout(()=>j4(P))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:k!=null}):u})})},"RovingFocusGroupItem")),zI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}vc(cE,"getDirectionAwareKey");function uE(e,t,n){const r=cE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return zI[r]}vc(uE,"getFocusIntent");function j4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}vc(j4,"focusFirst");function dE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vc(dE,"wrapArray");var BI=FI,UI=VI,WI=Object.defineProperty,En=(e,t)=>WI(e,"name",{value:t,configurable:!0}),B8=["Enter"," "],KI=["ArrowDown","PageUp","Home"],fE=["ArrowUp","PageDown","End"],GI=[...KI,...fE],YI={ltr:[...B8,"ArrowRight"],rtl:[...B8,"ArrowLeft"]},qI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Np="Menu",[E0,XI,QI]=pp(Np),[wc,Mp]=Ms(Np,[QI,nl,lE]),A4=nl(),hE=lE(),[JI,yc]=wc(Np),[eF,J0]=wc(Np),tF=En(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=A4(t),[f,h]=s.useState(null),p=s.useRef(!1),g=pr(i),v=G0(a);return s.useEffect(()=>{const w=En(()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=En(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),s.useEffect(()=>{if(!n)return;const w=En(()=>g(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,g]),o.jsx(Cp,{...u,children:o.jsx(JI,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:h,children:o.jsx(eF,{scope:t,onClose:s.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:l,children:r})})})},"Menu"),pE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t,i=A4(r);return o.jsx(Q0,{...i,...a,ref:n})},"MenuAnchor")),mE="MenuPortal",[nF,gE]=wc(mE,{forceMount:void 0}),rF=En(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=yc(mE,t);return o.jsx(nF,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(q0,{asChild:!0,container:a,children:r})})})},"MenuPortal"),La="MenuContent",[sF,N4]=wc(La),aF=s.forwardRef(En(function(t,n){const r=gE(La,t.__scopeMenu),{forceMount:a=r.forceMount,...i}=t,l=yc(La,t.__scopeMenu),u=J0(La,t.__scopeMenu);return o.jsx(E0.Provider,{scope:t.__scopeMenu,children:o.jsx(es,{present:a||l.open,children:o.jsx(E0.Slot,{scope:t.__scopeMenu,children:u.modal?o.jsx(oF,{...i,ref:n}):o.jsx(iF,{...i,ref:n})})})})},"MenuContent")),oF=s.forwardRef(En(function(t,n){const r=yc(La,t.__scopeMenu),a=s.useRef(null),i=an(n,a);return s.useEffect(()=>{const l=a.current;if(l)return gp(l)},[]),o.jsx(M4,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:yt(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),iF=s.forwardRef(En(function(t,n){const r=yc(La,t.__scopeMenu);return o.jsx(M4,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),lF=$a("MenuContent.ScrollLock"),M4=s.forwardRef(En(function(t,n){const{__scopeMenu:r,loop:a=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:w,onDismiss:y,disableOutsideScroll:x,...k}=t,S=yc(La,r),E=J0(La,r),j=A4(r),N=hE(r),P=XI(r),[$,M]=s.useState(null),C=s.useRef(null),R=an(n,C,S.onContentChange),T=s.useRef(0),H=s.useRef(""),D=s.useRef(0),K=s.useRef(null),O=s.useRef("right"),Z=s.useRef(0),te=x?X0:s.Fragment,B=x?{as:lF,allowPinchZoom:!0}:void 0,F=En(z=>{var Q,xe;const I=H.current+z,U=P().filter(ee=>!ee.disabled),G=document.activeElement,ne=(Q=U.find(ee=>ee.ref.current===G))==null?void 0:Q.textValue,q=U.map(ee=>ee.textValue),le=EE(q,I,ne),Se=(xe=U.find(ee=>ee.textValue===le))==null?void 0:xe.ref.current;En((function ee(ae){H.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>ee(""),1e3))}),"updateSearch")(I),Se&&setTimeout(()=>Se.focus())},"handleTypeaheadSearch");s.useEffect(()=>()=>window.clearTimeout(T.current),[]),Yu();const X=s.useCallback(z=>{var U,G;return O.current===((U=K.current)==null?void 0:U.side)&&jE(z,(G=K.current)==null?void 0:G.area)},[]);return o.jsx(sF,{scope:r,searchRef:H,onItemEnter:s.useCallback(z=>{X(z)&&z.preventDefault()},[X]),onItemLeave:s.useCallback(z=>{var I;X(z)||((I=C.current)==null||I.focus(),M(null))},[X]),onTriggerLeave:s.useCallback(z=>{X(z)&&z.preventDefault()},[X]),pointerGraceTimerRef:D,onPointerGraceIntentChange:s.useCallback(z=>{K.current=z},[]),children:o.jsx(te,{...B,children:o.jsx(Gu,{asChild:!0,trapped:i,onMountAutoFocus:yt(l,z=>{var I;z.preventDefault(),(I=C.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:o.jsx(Y0,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:w,onDismiss:y,children:o.jsx(BI,{asChild:!0,...N,dir:E.dir,orientation:"vertical",loop:a,currentTabStopId:$,onCurrentTabStopIdChange:M,onEntryFocus:yt(h,z=>{E.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(jp,{role:"menu","aria-orientation":"vertical","data-state":P4(S.open),"data-radix-menu-content":"",dir:E.dir,...j,...k,ref:R,style:{outline:"none",...k.style},onKeyDown:yt(k.onKeyDown,z=>{const U=z.target.closest("[data-radix-menu-content]")===z.currentTarget,G=z.ctrlKey||z.altKey||z.metaKey,ne=z.key.length===1;U&&(z.key==="Tab"&&z.preventDefault(),!G&&ne&&F(z.key));const q=C.current;if(z.target!==q||!GI.includes(z.key))return;z.preventDefault();const Se=P().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);fE.includes(z.key)&&Se.reverse(),kE(Se)}),onBlur:yt(t.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(T.current),H.current="")}),onPointerMove:yt(t.onPointerMove,$u(z=>{const I=z.target,U=Z.current!==z.clientX;if(z.currentTarget.contains(I)&&U){const G=z.clientX>Z.current?"right":"left";O.current=G,Z.current=z.clientX}}))})})})})})})},"MenuContentImpl")),vE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{role:"group",...a,ref:n})},"MenuGroup")),cF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{...a,ref:n})},"MenuLabel")),U8="MenuItem",_3="menu.itemSelect",R4=s.forwardRef(En(function(t,n){const{disabled:r=!1,onSelect:a,...i}=t,l=s.useRef(null),u=J0(U8,t.__scopeMenu),f=N4(U8,t.__scopeMenu),h=an(n,l),p=s.useRef(!1),g=En(()=>{const v=l.current;if(!r&&v){const w=new CustomEvent(_3,{bubbles:!0,cancelable:!0});v.addEventListener(_3,y=>a==null?void 0:a(y),{once:!0}),d4(v,w),w.defaultPrevented?p.current=!1:u.onClose()}},"handleSelect");return o.jsx(wE,{...i,ref:h,disabled:r,onClick:yt(t.onClick,g),onPointerDown:v=>{var w;(w=t.onPointerDown)==null||w.call(t,v),p.current=!0},onPointerUp:yt(t.onPointerUp,v=>{var w;p.current||(w=v.currentTarget)==null||w.click()}),onKeyDown:yt(t.onKeyDown,v=>{r||v.target!==v.currentTarget||f.searchRef.current!==""&&v.key===" "||B8.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})},"MenuItem")),wE=s.forwardRef(En(function(t,n){const{__scopeMenu:r,disabled:a=!1,textValue:i,...l}=t,u=N4(U8,r),f=hE(r),h=s.useRef(null),p=an(n,h),[g,v]=s.useState(!1),[w,y]=s.useState("");return s.useEffect(()=>{const x=h.current;x&&y((x.textContent??"").trim())},[l.children]),o.jsx(E0.ItemSlot,{scope:r,disabled:a,textValue:i??w,children:o.jsx(UI,{asChild:!0,...f,focusable:!a,children:o.jsx(ln.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:p,onPointerMove:yt(t.onPointerMove,$u(x=>{a?u.onItemLeave(x):(u.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yt(t.onPointerLeave,$u(x=>u.onItemLeave(x))),onFocus:yt(t.onFocus,()=>v(!0)),onBlur:yt(t.onBlur,()=>v(!1))})})})},"MenuItemImpl")),uF=s.forwardRef(En(function(t,n){const{checked:r=!1,onCheckedChange:a,...i}=t;return o.jsx(bE,{scope:t.__scopeMenu,checked:r,children:o.jsx(R4,{role:"menuitemcheckbox","aria-checked":C0(r)?"mixed":r,...i,ref:n,"data-state":Rp(r),onSelect:yt(i.onSelect,()=>a==null?void 0:a(C0(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),dF="MenuRadioGroup",[fF,hF]=wc(dF,{value:void 0,onValueChange:En(()=>{},"onValueChange")}),pF=s.forwardRef(En(function(t,n){const{value:r,onValueChange:a,...i}=t,l=pr(a);return o.jsx(fF,{scope:t.__scopeMenu,value:r,onValueChange:l,children:o.jsx(vE,{...i,ref:n})})},"MenuRadioGroup")),mF="MenuRadioItem",gF=s.forwardRef(En(function(t,n){const{value:r,...a}=t,i=hF(mF,t.__scopeMenu),l=r===i.value;return o.jsx(bE,{scope:t.__scopeMenu,checked:l,children:o.jsx(R4,{role:"menuitemradio","aria-checked":l,...a,ref:n,"data-state":Rp(l),onSelect:yt(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),yE="MenuItemIndicator",[bE,vF]=wc(yE,{checked:!1}),wF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,forceMount:a,...i}=t,l=vF(yE,r);return o.jsx(es,{present:a||C0(l.checked)||l.checked===!0,children:o.jsx(ln.span,{...i,ref:n,"data-state":Rp(l.checked)})})},"MenuItemIndicator")),yF=s.forwardRef(En(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(ln.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),bF="MenuSub",[ble,xE]=wc(bF),F1="MenuSubTrigger",xF=s.forwardRef(En(function(t,n){const r=yc(F1,t.__scopeMenu),a=J0(F1,t.__scopeMenu),i=xE(F1,t.__scopeMenu),l=N4(F1,t.__scopeMenu),u=s.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=l,p={__scopeMenu:t.__scopeMenu},g=s.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);s.useEffect(()=>g,[g]),s.useEffect(()=>{const w=f.current;return()=>{window.clearTimeout(w),h(null)}},[f,h]);const v=an(n,i.onTriggerChange);return o.jsx(pE,{asChild:!0,...p,children:o.jsx(wE,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?i.contentId:void 0,"data-state":P4(r.open),...t,ref:v,onClick:w=>{var y;(y=t.onClick)==null||y.call(t,w),!(t.disabled||w.defaultPrevented)&&(w.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:yt(t.onPointerMove,$u(w=>{l.onItemEnter(w),!w.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:yt(t.onPointerLeave,$u(w=>{var x,k;g();const y=(x=r.content)==null?void 0:x.getBoundingClientRect();if(y){const S=(k=r.content)==null?void 0:k.dataset.side,E=S==="right",j=E?-5:5,N=y[E?"left":"right"],P=y[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:w.clientX+j,y:w.clientY},{x:N,y:y.top},{x:P,y:y.top},{x:P,y:y.bottom},{x:N,y:y.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(w),w.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:yt(t.onKeyDown,w=>{var x;t.disabled||w.target!==w.currentTarget||l.searchRef.current!==""&&w.key===" "||YI[a.dir].includes(w.key)&&(r.onOpenChange(!0),(x=r.content)==null||x.focus(),w.preventDefault())})})})},"MenuSubTrigger")),kF="MenuSubContent",SF=s.forwardRef(En(function(t,n){const r=gE(La,t.__scopeMenu),{forceMount:a=r.forceMount,align:i="start",...l}=t,u=yc(La,t.__scopeMenu),f=J0(La,t.__scopeMenu),h=xE(kF,t.__scopeMenu),p=s.useRef(null),g=an(n,p);return o.jsx(E0.Provider,{scope:t.__scopeMenu,children:o.jsx(es,{present:a||u.open,children:o.jsx(E0.Slot,{scope:t.__scopeMenu,children:o.jsx(M4,{id:h.contentId,"aria-labelledby":h.triggerId,...l,ref:g,align:i,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var w;f.isUsingKeyboardRef.current&&((w=p.current)==null||w.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:yt(t.onFocusOutside,v=>{v.target!==h.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:yt(t.onEscapeKeyDown,v=>{f.onClose(),v.preventDefault()}),onKeyDown:yt(t.onKeyDown,v=>{var x;const w=v.currentTarget.contains(v.target),y=qI[f.dir].includes(v.key);w&&y&&(u.onOpenChange(!1),(x=h.trigger)==null||x.focus(),v.preventDefault())})})})})})},"MenuSubContent"));function P4(e){return e?"open":"closed"}En(P4,"getOpenState");function C0(e){return e==="indeterminate"}En(C0,"isIndeterminate");function Rp(e){return C0(e)?"indeterminate":e?"checked":"unchecked"}En(Rp,"getCheckedState");function kE(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}En(kE,"focusFirst");function SE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}En(SE,"wrapArray");function EE(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=SE(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}En(EE,"getNextMatch");function CE(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,v=f.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(a=!a)}return a}En(CE,"isPointInPolygon");function jE(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return CE(n,t)}En(jE,"isPointerInGraceArea");function $u(e){return t=>t.pointerType==="mouse"?e(t):void 0}En($u,"whenMouse");var AE=tF,NE=pE,ME=rF,RE=aF,PE=vE,LE=cF,TE=R4,$E=uF,DE=pF,HE=gF,OE=wF,IE=yF,FE=xF,_E=SF,EF=Object.defineProperty,Ir=(e,t)=>EF(e,"name",{value:t,configurable:!0}),L4="ContextMenu",[CF,xle]=Ms(L4,[Mp]),Rs=Mp(),[jF,ZE]=CF(L4),AF=Ir(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,dir:i,modal:l=!0}=e,u=s.useRef(!1),[f,h]=Qo({prop:a,defaultProp:!1,onChange:r,caller:L4}),p=Rs(t);return o.jsx(jF,{scope:t,open:f,onOpenChange:h,modal:l,hasInteractedRef:u,children:o.jsx(AE,{...p,dir:i,open:f,onOpenChange:h,modal:l,children:n})})},"ContextMenu"),NF="ContextMenuTrigger",MF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,disabled:a=!1,...i}=t,l=ZE(NF,r),u=Rs(r),[f,h]=s.useState({x:0,y:0}),p=s.useMemo(()=>({current:{getBoundingClientRect:Ir(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=s.useRef(0),v=s.useCallback(()=>window.clearTimeout(g.current),[]),w=Ir(y=>{l.hasInteractedRef.current=!0,h({x:y.clientX,y:y.clientY}),l.onOpenChange(!0)},"handleOpen");return s.useEffect(()=>v,[v]),s.useEffect(()=>void(a&&v()),[a,v]),o.jsxs(o.Fragment,{children:[o.jsx(NE,{...u,virtualRef:p}),o.jsx(ln.span,{"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,...i,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:yt(t.onContextMenu,y=>{v(),w(y),y.preventDefault()}),onPointerDown:a?t.onPointerDown:yt(t.onPointerDown,e0(y=>{v(),l.open&&l.onOpenChange(!1),g.current=window.setTimeout(()=>w(y),700)})),onPointerMove:a?t.onPointerMove:yt(t.onPointerMove,e0(v)),onPointerCancel:a?t.onPointerCancel:yt(t.onPointerCancel,e0(v)),onPointerUp:a?t.onPointerUp:yt(t.onPointerUp,e0(v))})]})},"ContextMenuTrigger")),RF=Ir(e=>{const{__scopeContextMenu:t,...n}=e,r=Rs(t);return o.jsx(ME,{...r,...n})},"ContextMenuPortal"),PF="ContextMenuContent",LF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=ZE(PF,r),l=Rs(r),u=s.useRef(!1);return o.jsx(RE,{...l,...a,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{var h;(h=t.onCloseAutoFocus)==null||h.call(t,f),!f.defaultPrevented&&u.current&&f.preventDefault(),u.current=!1},onInteractOutside:f=>{var h;(h=t.onInteractOutside)==null||h.call(t,f),!f.defaultPrevented&&!i.modal&&(u.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),TF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(PE,{...i,...a,ref:n})},"ContextMenuGroup")),$F=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(LE,{...i,...a,ref:n})},"ContextMenuLabel")),DF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(TE,{...i,...a,ref:n})},"ContextMenuItem")),HF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx($E,{...i,...a,ref:n})},"ContextMenuCheckboxItem")),OF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(DE,{...i,...a,ref:n})},"ContextMenuRadioGroup")),IF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(HE,{...i,...a,ref:n})},"ContextMenuRadioItem")),FF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(OE,{...i,...a,ref:n})},"ContextMenuItemIndicator")),_F=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(IE,{...i,...a,ref:n})},"ContextMenuSeparator")),ZF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(FE,{...i,...a,ref:n})},"ContextMenuSubTrigger")),VF=s.forwardRef(Ir(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Rs(r);return o.jsx(_E,{...i,...a,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function e0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Ir(e0,"whenTouchOrPen");var zF=AF,BF=MF,VE=RF,UF=LF,WF=TF,KF=$F,GF=DF,YF=HF,qF=OF,XF=IF,zE=FF,QF=_F,JF=ZF,e_=VF,t_=Object.defineProperty,Ps=(e,t)=>t_(e,"name",{value:t,configurable:!0}),T4="DropdownMenu",[n_,kle]=Ms(T4,[Mp]),Ls=Mp(),[r_,BE]=n_(T4),s_=Ps(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=Ls(t),h=s.useRef(null),[p,g]=Qo({prop:a,defaultProp:i??!1,onChange:l,caller:T4});return o.jsx(r_,{scope:t,triggerId:da(),triggerRef:h,contentId:da(),open:p,onOpenChange:g,onOpenToggle:s.useCallback(()=>g(v=>!v),[g]),modal:u,children:o.jsx(AE,{...f,open:p,onOpenChange:g,dir:r,modal:u,children:n})})},"DropdownMenu"),a_="DropdownMenuTrigger",o_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,disabled:a=!1,...i}=t,l=BE(a_,r),u=Ls(r),f=an(n,l.triggerRef);return o.jsx(NE,{asChild:!0,...u,children:o.jsx(ln.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:f,onPointerDown:yt(t.onPointerDown,h=>{!a&&h.button===0&&h.ctrlKey===!1&&(l.onOpenToggle(),l.open||h.preventDefault())}),onKeyDown:yt(t.onKeyDown,h=>{a||(["Enter"," "].includes(h.key)&&l.onOpenToggle(),h.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})},"DropdownMenuTrigger")),i_=Ps(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ls(t);return o.jsx(ME,{...r,...n})},"DropdownMenuPortal"),l_="DropdownMenuContent",c_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=BE(l_,r),l=Ls(r),u=s.useRef(!1);return o.jsx(RE,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...a,ref:n,onCloseAutoFocus:yt(t.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:yt(t.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,g=h.button===2||p;(!i.modal||g)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),u_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(PE,{...i,...a,ref:n})},"DropdownMenuGroup")),d_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(LE,{...i,...a,ref:n})},"DropdownMenuLabel")),f_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(TE,{...i,...a,ref:n})},"DropdownMenuItem")),h_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx($E,{...i,...a,ref:n})},"DropdownMenuCheckboxItem")),p_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(DE,{...i,...a,ref:n})},"DropdownMenuRadioGroup")),m_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(HE,{...i,...a,ref:n})},"DropdownMenuRadioItem")),g_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(OE,{...i,...a,ref:n})},"DropdownMenuItemIndicator")),v_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(IE,{...i,...a,ref:n})},"DropdownMenuSeparator")),w_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(FE,{...i,...a,ref:n})},"DropdownMenuSubTrigger")),y_=s.forwardRef(Ps(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ls(r);return o.jsx(_E,{...i,...a,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),b_=s_,x_=o_,UE=i_,k_=c_,S_=u_,E_=d_,C_=f_,j_=h_,A_=p_,N_=m_,WE=g_,M_=v_,R_=w_,P_=y_,L_=Object.defineProperty,T_=(e,t)=>L_(e,"name",{value:t,configurable:!0});function KE(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}T_(KE,"usePrevious");var $_=Object.defineProperty,D_=(e,t)=>$_(e,"name",{value:t,configurable:!0});function jh(e,[t,n]){return Math.min(n,Math.max(t,e))}D_(jh,"clamp");var H_=Object.defineProperty,bo=(e,t)=>H_(e,"name",{value:t,configurable:!0}),$4="Popover",[GE,Sle]=Ms($4,[nl]),Pp=nl(),[O_,rl]=GE($4),I_=bo(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=Pp(t),f=s.useRef(null),[h,p]=s.useState(!1),[g,v]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:$4});return o.jsx(Cp,{...u,children:o.jsx(O_,{scope:t,contentId:da(),triggerRef:f,open:g,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(w=>!w),[v]),hasCustomAnchor:h,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})},"Popover"),F_="PopoverAnchor",__=s.forwardRef(bo(function(t,n){const{__scopePopover:r,...a}=t,i=rl(F_,r),l=Pp(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return s.useEffect(()=>(u(),()=>f()),[u,f]),o.jsx(Q0,{...l,...a,ref:n})},"PopoverAnchor")),Z_="PopoverTrigger",V_=s.forwardRef(bo(function(t,n){const{__scopePopover:r,...a}=t,i=rl(Z_,r),l=Pp(r),u=an(n,i.triggerRef),f=o.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":D4(i.open),...a,ref:u,onClick:yt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:o.jsx(Q0,{asChild:!0,...l,children:f})},"PopoverTrigger")),YE="PopoverPortal",[z_,B_]=GE(YE,{forceMount:void 0}),U_=bo(e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=rl(YE,t);return o.jsx(z_,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(q0,{asChild:!0,container:a,children:r})})})},"PopoverPortal"),j0="PopoverContent",W_=s.forwardRef(bo(function(t,n){const r=B_(j0,t.__scopePopover),{forceMount:a=r.forceMount,...i}=t,l=rl(j0,t.__scopePopover);return o.jsx(es,{present:a||l.open,children:l.modal?o.jsx(G_,{...i,ref:n}):o.jsx(Y_,{...i,ref:n})})},"PopoverContent")),K_=$a("PopoverContent.RemoveScroll"),G_=s.forwardRef(bo(function(t,n){const r=rl(j0,t.__scopePopover),a=s.useRef(null),i=an(n,a),l=s.useRef(!1);return s.useEffect(()=>{const u=a.current;if(u)return gp(u)},[]),o.jsx(X0,{as:K_,allowPinchZoom:!0,children:o.jsx(qE,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),l.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;l.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:yt(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Y_=s.forwardRef(bo(function(t,n){const r=rl(j0,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(qE,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"PopoverContentNonModal")),qE=s.forwardRef(bo(function(t,n){const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,...v}=t,w=rl(j0,r),y=Pp(r);return Yu(),o.jsx(Gu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(Y0,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(jp,{"data-state":D4(w.open),role:"dialog",id:w.contentId,...y,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),q_="PopoverClose",X_=s.forwardRef(bo(function(t,n){const{__scopePopover:r,...a}=t,i=rl(q_,r);return o.jsx(ln.button,{type:"button",...a,ref:n,onClick:yt(t.onClick,()=>i.onOpenChange(!1))})},"PopoverClose"));function D4(e){return e?"open":"closed"}bo(D4,"getState");var Q_=I_,J_=__,eZ=V_,tZ=U_,nZ=W_,rZ=X_,sZ=Object.defineProperty,vn=(e,t)=>sZ(e,"name",{value:t,configurable:!0});function XE(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}vn(XE,"useStateMachine");var QE="ScrollArea",[JE,Ele]=Ms(QE),[aZ,ma]=JE(QE),oZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,type:a="hover",dir:i,scrollHideDelay:l=600,...u}=t,[f,h]=s.useState(null),[p,g]=s.useState(null),[v,w]=s.useState(null),[y,x]=s.useState(null),[k,S]=s.useState(null),[E,j]=s.useState(0),[N,P]=s.useState(0),[$,M]=s.useState(!1),[C,R]=s.useState(!1),T=an(n,h),H=G0(i);return o.jsx(aZ,{scope:r,type:a,dir:H,scrollHideDelay:l,scrollArea:f,viewport:p,onViewportChange:g,content:v,onContentChange:w,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:$,onScrollbarXEnabledChange:M,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:C,onScrollbarYEnabledChange:R,onCornerWidthChange:j,onCornerHeightChange:P,children:o.jsx(ln.div,{dir:H,...u,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})},"ScrollArea")),iZ="ScrollAreaViewport",lZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,children:a,nonce:i,...l}=t,u=ma(iZ,r),f=s.useRef(null),h=an(n,f,u.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(cZ,{nonce:i}),o.jsx(ln.div,{"data-radix-scroll-area-viewport":"",...l,ref:h,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})},"ScrollAreaViewport")),cZ=s.memo(vn(function({nonce:t}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),ii="ScrollAreaScrollbar",uZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ii,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=t.orientation==="horizontal";return s.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type==="hover"?o.jsx(dZ,{...a,ref:n,forceMount:r}):i.type==="scroll"?o.jsx(fZ,{...a,ref:n,forceMount:r}):i.type==="auto"?o.jsx(e7,{...a,ref:n,forceMount:r}):i.type==="always"?o.jsx(H4,{...a,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),dZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ii,t.__scopeScrollArea),[l,u]=s.useState(!1);return s.useEffect(()=>{const f=i.scrollArea;let h=0;if(f){const p=vn(()=>{window.clearTimeout(h),u(!0)},"handlePointerEnter"),g=vn(()=>{h=window.setTimeout(()=>u(!1),i.scrollHideDelay)},"handlePointerLeave");return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[i.scrollArea,i.scrollHideDelay]),o.jsx(es,{present:r||l,children:o.jsx(e7,{"data-state":l?"visible":"hidden",...a,ref:n})})},"ScrollAreaScrollbarHover")),fZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=ma(ii,t.__scopeScrollArea),l=t.orientation==="horizontal",u=tf(()=>h("SCROLL_END"),100),[f,h]=XE("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,i.scrollHideDelay,h]),s.useEffect(()=>{const p=i.viewport,g=l?"scrollLeft":"scrollTop";if(p){let v=p[g];const w=vn(()=>{const y=p[g];v!==y&&(h("SCROLL"),u()),v=y},"handleScroll");return p.addEventListener("scroll",w),()=>p.removeEventListener("scroll",w)}},[i.viewport,l,h,u]),o.jsx(es,{present:r||f!=="hidden",children:o.jsx(H4,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:n,onPointerEnter:yt(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:yt(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),e7=s.forwardRef(vn(function(t,n){const r=ma(ii,t.__scopeScrollArea),{forceMount:a,...i}=t,[l,u]=s.useState(!1),f=t.orientation==="horizontal",h=tf(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?p:g)}},10);return ql(r.viewport,h),ql(r.content,h),o.jsx(es,{present:a||l,children:o.jsx(H4,{"data-state":l?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarAuto")),H4=s.forwardRef(vn(function(t,n){const{orientation:r="vertical",...a}=t,i=ma(ii,t.__scopeScrollArea),l=s.useRef(null),u=s.useRef(0),[f,h]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=O4(f.viewport,f.content),g={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:vn(w=>l.current=w,"onThumbChange"),onThumbPointerUp:vn(()=>u.current=0,"onThumbPointerUp"),onThumbPointerDown:vn(w=>u.current=w,"onThumbPointerDown")};function v(w,y){return s7(w,u.current,f,y)}return vn(v,"getScrollPosition"),r==="horizontal"?o.jsx(hZ,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollLeft,y=K8(w,f,i.dir);l.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollLeft=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollLeft=v(w,i.dir))}}):r==="vertical"?o.jsx(pZ,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollTop,y=K8(w,f);l.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollTop=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollTop=v(w))}}):null},"ScrollAreaScrollbarVisible")),hZ=s.forwardRef(vn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=ma(ii,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=an(n,h,l.onScrollbarXChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(n7,{"data-orientation":"horizontal",...i,ref:p,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ef(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.x),onDragScroll:g=>t.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(l.viewport){const w=l.viewport.scrollLeft+g.deltaX;t.onWheelScroll(w),F4(w,v)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:A0(u.paddingLeft),paddingEnd:A0(u.paddingRight)}})}})},"ScrollAreaScrollbarX")),pZ=s.forwardRef(vn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=ma(ii,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=an(n,h,l.onScrollbarYChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(n7,{"data-orientation":"vertical",...i,ref:p,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ef(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.y),onDragScroll:g=>t.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(l.viewport){const w=l.viewport.scrollTop+g.deltaY;t.onWheelScroll(w),F4(w,v)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:A0(u.paddingTop),paddingEnd:A0(u.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[mZ,t7]=JE(ii),n7=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,sizes:a,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:g,onResize:v,...w}=t,y=ma(ii,r),[x,k]=s.useState(null),S=an(n,k),E=s.useRef(null),j=s.useRef(""),N=y.viewport,P=a.content-a.viewport,$=pr(g),M=pr(h),C=tf(v,10);function R(T){if(E.current){const H=T.clientX-E.current.left,D=T.clientY-E.current.top;p({x:H,y:D})}}return vn(R,"handleDragScroll"),s.useEffect(()=>{const T=vn(H=>{const D=H.target;(x==null?void 0:x.contains(D))&&$(H,P)},"handleWheel");return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[N,x,P,$]),s.useEffect(M,[a,M]),ql(x,C),ql(y.content,C),o.jsx(mZ,{scope:r,scrollbar:x,hasThumb:i,onThumbChange:pr(l),onThumbPointerUp:pr(u),onThumbPositionChange:M,onThumbPointerDown:pr(f),children:o.jsx(ln.div,{...w,ref:S,style:{position:"absolute",...w.style},onPointerDown:yt(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),E.current=x.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),R(T))}),onPointerMove:yt(t.onPointerMove,R),onPointerUp:yt(t.onPointerUp,T=>{const H=T.target;H.hasPointerCapture(T.pointerId)&&H.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=j.current,y.viewport&&(y.viewport.style.scrollBehavior=""),E.current=null})})})},"ScrollAreaScrollbarImpl")),W8="ScrollAreaThumb",gZ=s.forwardRef(vn(function(t,n){const{forceMount:r,...a}=t,i=t7(W8,t.__scopeScrollArea);return o.jsx(es,{present:r||i.hasThumb,children:o.jsx(vZ,{ref:n,...a})})},"ScrollAreaThumb")),vZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,style:a,...i}=t,l=ma(W8,r),u=t7(W8,r),{onThumbPositionChange:f}=u,h=an(n,u.onThumbChange),p=s.useRef(void 0),g=tf(()=>{p.current&&(p.current(),p.current=void 0)},100);return s.useEffect(()=>{const v=l.viewport;if(v){const w=vn(()=>{if(g(),!p.current){const y=bZ(v,f);p.current=y,f()}},"handleScroll");return f(),v.addEventListener("scroll",w),()=>v.removeEventListener("scroll",w)}},[l.viewport,g,f]),o.jsx(ln.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:yt(t.onPointerDownCapture,v=>{const y=v.target.getBoundingClientRect(),x=v.clientX-y.left,k=v.clientY-y.top;u.onThumbPointerDown({x,y:k})}),onPointerUp:yt(t.onPointerUp,u.onThumbPointerUp)})},"ScrollAreaThumbImpl")),r7="ScrollAreaCorner",wZ=s.forwardRef(vn(function(t,n){const r=ma(r7,t.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?o.jsx(yZ,{...t,ref:n}):null},"ScrollAreaCorner")),yZ=s.forwardRef(vn(function(t,n){const{__scopeScrollArea:r,...a}=t,i=ma(r7,r),[l,u]=s.useState(0),[f,h]=s.useState(0),p=!!(l&&f),{onCornerWidthChange:g,onCornerHeightChange:v}=i;return ql(i.scrollbarX,()=>{var y;const w=((y=i.scrollbarX)==null?void 0:y.offsetHeight)||0;i.onCornerHeightChange(w),h(w)}),ql(i.scrollbarY,()=>{var y;const w=((y=i.scrollbarY)==null?void 0:y.offsetWidth)||0;i.onCornerWidthChange(w),u(w)}),s.useEffect(()=>()=>{g(0),v(0)},[g,v]),p?o.jsx(ln.div,{...a,ref:n,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function A0(e){return e?parseInt(e,10):0}vn(A0,"toInt");function O4(e,t){const n=e/t;return isNaN(n)?0:n}vn(O4,"getThumbRatio");function ef(e){const t=O4(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}vn(ef,"getThumbSize");function s7(e,t,n,r="ltr"){const a=ef(n),i=a/2,l=t||i,u=a-l,f=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return I4([f,h],g)(e)}vn(s7,"getScrollPositionFromPointer");function K8(e,t,n="ltr"){const r=ef(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,f=n==="ltr"?[0,l]:[l*-1,0],h=jh(e,f);return I4([0,l],[0,u])(h)}vn(K8,"getThumbOffsetFromScroll");function I4(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}vn(I4,"linearScale");function F4(e,t){return e>0&&e<t}vn(F4,"isScrollingWithinScrollbarBounds");var bZ=vn((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return vn((function a(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(a)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function tf(e,t){const n=pr(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}vn(tf,"useDebounceCallback");function ql(e,t){const n=pr(t);gr(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}vn(ql,"useResizeObserver");var a7=oZ,o7=lZ,G8=uZ,Y8=gZ,xZ=wZ,kZ=Object.defineProperty,Ln=(e,t)=>kZ(e,"name",{value:t,configurable:!0}),SZ=[" ","Enter","ArrowUp","ArrowDown"],EZ=[" ","Enter"],Du="Select",[Lp,_4,CZ]=pp(Du),[bc,Cle]=Ms(Du,[CZ,nl]),Z4=nl(),[jZ,sl]=bc(Du),[AZ,NZ]=bc(Du);function i7(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:f,dir:h,name:p,autoComplete:g,disabled:v,required:w,form:y,internal_do_not_use_render:x}=e,k=Z4(t),[S,E]=s.useState(null),[j,N]=s.useState(null),[P,$]=s.useState(!1),M=G0(h),[C,R]=Qo({prop:r,defaultProp:a??!1,onChange:i,caller:Du}),[T,H]=Qo({prop:l,defaultProp:u,onChange:f,caller:Du}),D=s.useRef(null),K=s.useRef(T);s.useEffect(()=>{const U=y?S==null?void 0:S.ownerDocument.getElementById(y):S==null?void 0:S.form;if(U instanceof HTMLFormElement){const G=Ln(()=>H(K.current),"reset");return U.addEventListener("reset",G),()=>U.removeEventListener("reset",G)}},[y,S,H]);const O=S?!!y||!!S.closest("form"):!0,[Z,te]=s.useState(new Set),B=da(),F=Array.from(Z).map(U=>U.props.value).join(";"),X=s.useCallback(U=>{te(G=>new Set(G).add(U))},[]),z=s.useCallback(U=>{te(G=>{const ne=new Set(G);return ne.delete(U),ne})},[]),I={required:w,trigger:S,onTriggerChange:E,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:$,contentId:B,value:T,onValueChange:H,open:C,onOpenChange:R,dir:M,triggerPointerDownPosRef:D,disabled:v,name:p,autoComplete:g,form:y,nativeOptions:Z,nativeSelectKey:F,isFormControl:O};return o.jsx(Cp,{...k,children:o.jsx(jZ,{scope:t,...I,children:o.jsx(Lp.Provider,{scope:t,children:o.jsx(AZ,{scope:t,onNativeOptionAdd:X,onNativeOptionRemove:z,children:u7(x)?x(I):n})})})})}Ln(i7,"SelectProvider");var MZ=Ln(e=>{const{__scopeSelect:t,children:n,...r}=e;return o.jsx(i7,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:a})=>o.jsxs(o.Fragment,{children:[n,a?o.jsx(oV,{__scopeSelect:t}):null]})})},"Select"),RZ="SelectTrigger",PZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,disabled:a=!1,...i}=t,l=Z4(r),u=sl(RZ,r),f=u.disabled||a,h=an(n,u.onTriggerChange),p=_4(r),g=s.useRef("touch"),[v,w,y]=V4(k=>{const S=p().filter(N=>!N.disabled),E=S.find(N=>N.value===u.value),j=z4(S,k,E);j!==void 0&&u.onValueChange(j.value)}),x=Ln(k=>{f||(u.onOpenChange(!0),y()),k&&(u.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return o.jsx(Q0,{asChild:!0,...l,children:o.jsx(ln.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":nf(u.value)?"":void 0,...i,ref:h,onClick:yt(i.onClick,k=>{k.currentTarget.focus(),g.current!=="mouse"&&x(k)}),onPointerDown:yt(i.onPointerDown,k=>{g.current=k.pointerType;const S=k.target;S.hasPointerCapture(k.pointerId)&&S.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(x(k),k.preventDefault())}),onKeyDown:yt(i.onKeyDown,k=>{const S=v.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&w(k.key),!(S&&k.key===" ")&&SZ.includes(k.key)&&(x(),k.preventDefault())})})})},"SelectTrigger")),LZ="SelectValue",TZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,className:a,style:i,children:l,placeholder:u="",...f}=t,h=sl(LZ,r),{onValueNodeHasChildrenChange:p}=h,g=l!==void 0,v=an(n,h.onValueNodeChange);gr(()=>{p(g)},[p,g]);const w=nf(h.value);return o.jsx(ln.span,{...f,asChild:w?!1:f.asChild,ref:v,style:{pointerEvents:"none"},children:o.jsx(s.Fragment,{children:w?u:l},w?"placeholder":"value")})},"SelectValue")),$Z=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,children:a,...i}=t;return o.jsx(ln.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})},"SelectIcon")),DZ="SelectPortal",[HZ,OZ]=bc(DZ,{forceMount:void 0}),IZ=Ln(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return o.jsx(HZ,{scope:e.__scopeSelect,forceMount:n,children:o.jsx(q0,{asChild:!0,...r})})},"SelectPortal"),Xl="SelectContent",FZ=s.forwardRef(Ln(function(t,n){const r=OZ(Xl,t.__scopeSelect),{forceMount:a=r.forceMount,...i}=t,l=sl(Xl,t.__scopeSelect),[u,f]=s.useState();return gr(()=>{f(new DocumentFragment)},[]),o.jsx(es,{present:a||l.open,children:({present:h})=>h?o.jsx(VZ,{...i,ref:n}):o.jsx(_Z,{...i,fragment:u})})},"SelectContent")),_Z=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,children:a,fragment:i}=t;return i?Rr.createPortal(o.jsx(l7,{scope:r,children:o.jsx(Lp.Slot,{scope:r,children:o.jsx("div",{ref:n,children:a})})}),i):null},"SelectContentFragment")),Ma=10,[l7,Tp]=bc(Xl),ZZ=$a("SelectContent.RemoveScroll"),VZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r}=t,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:k,avoidCollisions:S,...E}=t,j=sl(Xl,r),[N,P]=s.useState(null),[$,M]=s.useState(null),C=an(n,P),[R,T]=s.useState(null),[H,D]=s.useState(null),K=_4(r),[O,Z]=s.useState(!1),te=s.useRef(!1);s.useEffect(()=>{if(N)return gp(N)},[N]),Yu();const B=s.useCallback(Q=>{const[xe,...ee]=K().map(_=>_.ref.current),[ae]=ee.slice(-1),re=document.activeElement;for(const _ of Q)if(_===re||(_==null||_.scrollIntoView({block:"nearest"}),_===xe&&$&&($.scrollTop=0),_===ae&&$&&($.scrollTop=$.scrollHeight),_==null||_.focus(),document.activeElement!==re))return},[K,$]),F=s.useCallback(()=>B([R,N]),[B,R,N]);s.useEffect(()=>{O&&F()},[O,F]);const{onOpenChange:X,triggerPointerDownPosRef:z}=j;s.useEffect(()=>{if(N){let Q={x:0,y:0};const xe=Ln(ae=>{var re,_;Q={x:Math.abs(Math.round(ae.pageX)-(((re=z.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((_=z.current)==null?void 0:_.y)??0))}},"handlePointerMove"),ee=Ln(ae=>{Q.x<=10&&Q.y<=10?ae.preventDefault():ae.composedPath().includes(N)||X(!1),document.removeEventListener("pointermove",xe),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",ee,{capture:!0})}}},[N,X,z]),s.useEffect(()=>{const Q=Ln(()=>X(!1),"close");return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[X]);const[I,U]=V4(Q=>{const xe=K().filter(re=>!re.disabled),ee=xe.find(re=>re.ref.current===document.activeElement),ae=z4(xe,Q,ee);ae&&setTimeout(()=>{var re;return(re=ae.ref.current)==null?void 0:re.focus()})}),G=s.useCallback((Q,xe,ee)=>{const ae=!te.current&&!ee;(j.value!==void 0&&j.value===xe||ae)&&(T(Q),ae&&(te.current=!0))},[j.value]),ne=s.useCallback(()=>N==null?void 0:N.focus(),[N]),q=s.useCallback((Q,xe,ee)=>{const ae=!te.current&&!ee;(j.value!==void 0&&j.value===xe||ae)&&D(Q)},[j.value]),le=a==="popper"?Z3:zZ,Se=le===Z3?{side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:k,avoidCollisions:S}:{};return o.jsx(l7,{scope:r,content:N,viewport:$,onViewportChange:M,itemRefCallback:G,selectedItem:R,onItemLeave:ne,itemTextRefCallback:q,focusSelectedItem:F,selectedItemText:H,position:a,isPositioned:O,searchRef:I,children:o.jsx(X0,{as:ZZ,allowPinchZoom:!0,children:o.jsx(Gu,{asChild:!0,trapped:j.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:yt(i,Q=>{var xe;(xe=j.trigger)==null||xe.focus({preventScroll:!0}),Q.preventDefault()}),children:o.jsx(Y0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:o.jsx(le,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:Q=>Q.preventDefault(),...E,...Se,onPlaced:()=>Z(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:yt(E.onKeyDown,Q=>{const xe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!xe&&Q.key.length===1&&U(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ae=K().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const re=Q.target,_=ae.indexOf(re);ae=ae.slice(_+1)}setTimeout(()=>B(ae)),Q.preventDefault()}})})})})})})},"SelectContentImpl")),zZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,onPlaced:a,...i}=t,l=sl(Xl,r),u=Tp(Xl,r),[f,h]=s.useState(null),[p,g]=s.useState(null),v=an(n,g),w=_4(r),y=s.useRef(!1),x=s.useRef(!0),{viewport:k,selectedItem:S,selectedItemText:E,focusSelectedItem:j}=u,N=s.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&p&&k&&S&&E){const C=l.trigger.getBoundingClientRect(),R=p.getBoundingClientRect(),T=l.valueNode.getBoundingClientRect(),H=E.getBoundingClientRect();if(l.dir!=="rtl"){const re=H.left-R.left,_=T.left-re,ue=C.left-_,We=C.width+ue,Xe=Math.max(We,R.width),ze=window.innerWidth-Ma,tt=jh(_,[Ma,Math.max(Ma,ze-Xe)]);f.style.minWidth=We+"px",f.style.left=tt+"px"}else{const re=R.right-H.right,_=window.innerWidth-T.right-re,ue=window.innerWidth-C.right-_,We=C.width+ue,Xe=Math.max(We,R.width),ze=window.innerWidth-Ma,tt=jh(_,[Ma,Math.max(Ma,ze-Xe)]);f.style.minWidth=We+"px",f.style.right=tt+"px"}const D=w(),K=window.innerHeight-Ma*2,O=k.scrollHeight,Z=window.getComputedStyle(p),te=parseInt(Z.borderTopWidth,10),B=parseInt(Z.paddingTop,10),F=parseInt(Z.borderBottomWidth,10),X=parseInt(Z.paddingBottom,10),z=te+B+O+X+F,I=Math.min(S.offsetHeight*5,z),U=window.getComputedStyle(k),G=parseInt(U.paddingTop,10),ne=parseInt(U.paddingBottom,10),q=C.top+C.height/2-Ma,le=K-q,Se=S.offsetHeight/2,Q=S.offsetTop+Se,xe=te+B+Q,ee=z-xe;if(xe<=q){const re=D.length>0&&S===D[D.length-1].ref.current;f.style.bottom="0px";const _=p.clientHeight-k.offsetTop-k.offsetHeight,ue=Math.max(le,Se+(re?ne:0)+_+F),We=xe+ue;f.style.height=We+"px"}else{const re=D.length>0&&S===D[0].ref.current;f.style.top="0px";const ue=Math.max(q,te+k.offsetTop+(re?G:0)+Se)+ee;f.style.height=ue+"px",k.scrollTop=xe-q+k.offsetTop}f.style.margin=`${Ma}px 0`,f.style.minHeight=I+"px",f.style.maxHeight=K+"px",a==null||a(),requestAnimationFrame(()=>y.current=!0)}},[w,l.trigger,l.valueNode,f,p,k,S,E,l.dir,a]);gr(()=>N(),[N]);const[P,$]=s.useState();gr(()=>{p&&$(window.getComputedStyle(p).zIndex)},[p]);const M=s.useCallback(C=>{C&&x.current===!0&&(N(),j==null||j(),x.current=!1)},[N,j]);return o.jsx(BZ,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:M,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:o.jsx(ln.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),Z3=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,align:a="start",collisionPadding:i=Ma,...l}=t,u=Z4(r);return o.jsx(jp,{...u,...l,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[BZ,UZ]=bc(Xl,{}),V3="SelectViewport",WZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,nonce:a,...i}=t,l=Tp(V3,r),u=UZ(V3,r),f=an(n,l.onViewportChange),h=s.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Lp.Slot,{scope:r,children:o.jsx(ln.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:yt(i.onScroll,p=>{const g=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=u;if(w!=null&&w.current&&v){const y=Math.abs(h.current-g.scrollTop);if(y>0){const x=window.innerHeight-Ma*2,k=parseFloat(v.style.minHeight),S=parseFloat(v.style.height),E=Math.max(k,S);if(E<x){const j=E+y,N=Math.min(x,j),P=j-N;v.style.height=N+"px",v.style.bottom==="0px"&&(g.scrollTop=P>0?P:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})},"SelectViewport")),KZ="SelectGroup",[GZ,YZ]=bc(KZ),qZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t,i=da();return o.jsx(GZ,{scope:r,id:i,children:o.jsx(ln.div,{role:"group","aria-labelledby":i,...a,ref:n})})},"SelectGroup")),XZ="SelectLabel",QZ=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t,i=YZ(XZ,r);return o.jsx(ln.div,{id:i.id,...a,ref:n})},"SelectLabel")),q8="SelectItem",[JZ,c7]=bc(q8),eV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,value:a,disabled:i=!1,textValue:l,...u}=t,f=sl(q8,r),h=Tp(q8,r),p=f.value===a,[g,v]=s.useState(l??""),[w,y]=s.useState(!1),x=pr(N=>{var P;return(P=h.itemRefCallback)==null?void 0:P.call(h,N,a,i)}),k=an(n,x),S=da(),E=s.useRef("touch"),j=Ln(()=>{i||(f.onValueChange(a),f.onOpenChange(!1))},"handleSelect");return o.jsx(JZ,{scope:r,value:a,disabled:i,textId:S,isSelected:p,onItemTextChange:s.useCallback(N=>{v(P=>P||((N==null?void 0:N.textContent)??"").trim())},[]),children:o.jsx(Lp.ItemSlot,{scope:r,value:a,disabled:i,textValue:g,children:o.jsx(ln.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:k,onFocus:yt(u.onFocus,()=>y(!0)),onBlur:yt(u.onBlur,()=>y(!1)),onClick:yt(u.onClick,()=>{E.current!=="mouse"&&j()}),onPointerUp:yt(u.onPointerUp,()=>{E.current==="mouse"&&j()}),onPointerDown:yt(u.onPointerDown,N=>{E.current=N.pointerType}),onPointerMove:yt(u.onPointerMove,N=>{var P;E.current=N.pointerType,i?(P=h.onItemLeave)==null||P.call(h):E.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:yt(u.onPointerLeave,N=>{var P;N.currentTarget===document.activeElement&&((P=h.onItemLeave)==null||P.call(h))}),onKeyDown:yt(u.onKeyDown,N=>{var $;i||N.target!==N.currentTarget||(($=h.searchRef)==null?void 0:$.current)!==""&&N.key===" "||(EZ.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})},"SelectItem")),_1="SelectItemText",tV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,className:a,style:i,...l}=t,u=sl(_1,r),f=Tp(_1,r),h=c7(_1,r),p=NZ(_1,r),[g,v]=s.useState(null),w=pr(j=>{var N;return(N=f.itemTextRefCallback)==null?void 0:N.call(f,j,h.value,h.disabled)}),y=an(n,v,h.onItemTextChange,w),x=g==null?void 0:g.textContent,k=s.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:x},h.value),[h.disabled,h.value,x]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=p;return gr(()=>(S(k),()=>E(k)),[S,E,k]),o.jsxs(o.Fragment,{children:[o.jsx(ln.span,{id:h.textId,...l,ref:y}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!nf(u.value)?Rr.createPortal(l.children,u.valueNode):null]})},"SelectItemText")),nV="SelectItemIndicator",rV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t;return c7(nV,r).isSelected?o.jsx(ln.span,{"aria-hidden":!0,...a,ref:n}):null},"SelectItemIndicator")),sV=s.forwardRef(Ln(function(t,n){const{__scopeSelect:r,...a}=t;return o.jsx(ln.div,{"aria-hidden":!0,...a,ref:n})},"SelectSeparator")),aV="SelectBubbleInput",oV=s.forwardRef(Ln(function({__scopeSelect:t,...n},r){const a=sl(aV,t),{value:i,onValueChange:l,required:u,disabled:f,name:h,autoComplete:p,form:g}=a,{nativeOptions:v,nativeSelectKey:w}=a,y=s.useRef(null),x=an(r,y),k=i??"",S=KE(k),E=Array.from(v).some(j=>(j.props.value??"")==="");return s.useEffect(()=>{const j=y.current;if(!j)return;const N=window.HTMLSelectElement.prototype,$=Object.getOwnPropertyDescriptor(N,"value").set;if(S!==k&&$){const M=new Event("change",{bubbles:!0});$.call(j,k),j.dispatchEvent(M)}},[S,k]),o.jsxs(ln.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:h,autoComplete:p,disabled:f,form:g,onChange:j=>l(j.target.value),...n,style:{...KS,...n.style},ref:x,defaultValue:k,children:[nf(i)&&!E?o.jsx("option",{value:""}):null,Array.from(v)]},w)},"SelectBubbleInput"));function u7(e){return typeof e=="function"}Ln(u7,"isFunction");function nf(e){return e===""||e===void 0}Ln(nf,"shouldShowPlaceholder");function V4(e){const t=pr(e),n=s.useRef(""),r=s.useRef(0),a=s.useCallback(l=>{const u=n.current+l;t(u),Ln((function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(u)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}Ln(V4,"useTypeaheadSearch");function z4(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=d7(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}Ln(z4,"findNextItem");function d7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ln(d7,"wrapArray");var iV=Object.defineProperty,kr=(e,t)=>iV(e,"name",{value:t,configurable:!0}),[B4,jle]=Ms("Tooltip",[nl]),$p=nl(),lV="TooltipProvider",cV=700,X8="tooltip.open",[uV,U4]=B4(lV),dV=kr(e=>{const{__scopeTooltip:t,delayDuration:n=cV,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),u=s.useRef(!1),f=s.useRef(0);return s.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),o.jsx(uV,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),l.current=!1)},[r]),onClose:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:s.useCallback(h=>{u.current=h},[]),disableHoverableContent:a,children:i})},"TooltipProvider"),Q8="Tooltip",[fV,rf]=B4(Q8),hV=kr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,f=U4(Q8,e.__scopeTooltip),h=$p(t),[p,g]=s.useState(null),[v,w]=s.useState(void 0),y=da(),x=s.useRef(0),k=l??f.disableHoverableContent,S=u??f.delayDuration,E=s.useRef(!1),[j,N]=Qo({prop:r,defaultProp:a??!1,onChange:kr(T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(X8))):f.onClose(),i==null||i(T)},"onChange"),caller:Q8}),P=s.useMemo(()=>j?E.current?"delayed-open":"instant-open":"closed",[j]),$=s.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E.current=!1,N(!0)},[N]),M=s.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),C=s.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.current=!0,N(!0),x.current=0},S)},[S,N]);s.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]);const R=v??y;return o.jsx(Cp,{...h,children:o.jsx(fV,{scope:t,contentId:R,setContentId:w,open:j,stateAttribute:P,trigger:p,onTriggerChange:g,onTriggerEnter:s.useCallback(()=>{f.isOpenDelayedRef.current?C():$()},[f.isOpenDelayedRef,C,$]),onTriggerLeave:s.useCallback(()=>{k?M():(window.clearTimeout(x.current),x.current=0)},[M,k]),onOpen:$,onClose:M,disableHoverableContent:k,children:n})})},"Tooltip"),z3="TooltipTrigger",pV=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,...a}=t,i=rf(z3,r),l=U4(z3,r),u=$p(r),f=s.useRef(null),h=an(n,f,i.onTriggerChange),p=s.useRef(!1),g=s.useRef(!1),v=s.useCallback(()=>p.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(Q0,{asChild:!0,...u,children:o.jsx(ln.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:h,onPointerMove:yt(t.onPointerMove,w=>{w.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),g.current=!0)}),onPointerLeave:yt(t.onPointerLeave,()=>{i.onTriggerLeave(),g.current=!1}),onPointerDown:yt(t.onPointerDown,()=>{i.open&&i.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:yt(t.onFocus,()=>{p.current||i.onOpen()}),onBlur:yt(t.onBlur,i.onClose),onClick:yt(t.onClick,i.onClose)})})},"TooltipTrigger")),f7="TooltipPortal",[mV,gV]=B4(f7,{forceMount:void 0}),vV=kr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=rf(f7,t);return o.jsx(mV,{scope:t,forceMount:n,children:o.jsx(es,{present:n||i.open,children:o.jsx(q0,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),N0="TooltipContent",wV=s.forwardRef(kr(function(t,n){const r=gV(N0,t.__scopeTooltip),{forceMount:a=r.forceMount,side:i="top",...l}=t,u=rf(N0,t.__scopeTooltip);return o.jsx(es,{present:a||u.open,children:u.disableHoverableContent?o.jsx(h7,{side:i,...l,ref:n}):o.jsx(yV,{side:i,...l,ref:n})})},"TooltipContent")),yV=s.forwardRef(kr(function(t,n){const r=rf(N0,t.__scopeTooltip),a=U4(N0,t.__scopeTooltip),i=s.useRef(null),l=an(n,i),[u,f]=s.useState(null),{trigger:h,onClose:p}=r,g=i.current,{onPointerInTransitChange:v}=a,w=s.useCallback(()=>{f(null),v(!1)},[v]),y=s.useCallback((x,k)=>{const S=x.currentTarget,E={x:x.clientX,y:x.clientY},j=p7(E,S.getBoundingClientRect()),N=m7(E,j),P=g7(k.getBoundingClientRect()),$=w7([...N,...P]);f($),v(!0)},[v]);return s.useEffect(()=>()=>w(),[w]),s.useEffect(()=>{if(h&&g){const x=kr(S=>y(S,g),"handleTriggerLeave"),k=kr(S=>y(S,h),"handleContentLeave");return h.addEventListener("pointerleave",x),g.addEventListener("pointerleave",k),()=>{h.removeEventListener("pointerleave",x),g.removeEventListener("pointerleave",k)}}},[h,g,y,w]),s.useEffect(()=>{if(u){const x=kr(k=>{const S=k.target,E={x:k.clientX,y:k.clientY},j=(h==null?void 0:h.contains(S))||(g==null?void 0:g.contains(S)),N=!v7(E,u);j?w():N&&(w(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[h,g,u,p,w]),o.jsx(h7,{...t,ref:l})},"TooltipContentHoverable")),bV=u4("TooltipContent"),h7=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":i,id:l,onEscapeKeyDown:u,onPointerDownOutside:f,...h}=t,p=rf(N0,r),g=$p(r),{onClose:v}=p;s.useEffect(()=>(document.addEventListener(X8,v),()=>document.removeEventListener(X8,v)),[v]),s.useEffect(()=>{if(p.trigger){const y=kr(x=>{x.target instanceof Node&&x.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[p.trigger,v]);const{setContentId:w}=p;return gr(()=>(w(l),()=>{w(void 0)}),[l,w]),o.jsx(Y0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:y=>y.preventDefault(),onDismiss:v,children:o.jsxs(jp,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(bV,{children:a}),i?o.jsx(GS,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),xV=s.forwardRef(kr(function(t,n){const{__scopeTooltip:r,...a}=t,i=$p(r);return o.jsx(RI,{...i,...a,ref:n})},"TooltipArrow"));function p7(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}kr(p7,"getExitSideFromRect");function m7(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}kr(m7,"getPaddedExitPoints");function g7(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}kr(g7,"getPointsFromRect");function v7(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,v=f.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(a=!a)}return a}kr(v7,"isPointInPolygon");function w7(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),y7(t)}kr(w7,"getHull");function y7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}kr(y7,"getHullPresorted");var kV=dV,SV=hV,EV=pV,CV=vV,jV=wV,AV=xV,yg={exports:{}};/*!
93
- Copyright (c) 2018 Jed Watson.
94
- Licensed under the MIT License (MIT), see
95
- http://jedwatson.github.io/classnames
96
- */var B3;function NV(){return B3||(B3=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(i=a(i,r(u)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var l="";for(var u in i)t.call(i,u)&&i[u]&&(l=a(l,u));return l}function a(i,l){return l?i?i+" "+l:i+l:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(yg)),yg.exports}var MV=NV();const _t=Q5(MV),Fa={asChild:{type:"boolean"}},io={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}},W4={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}},RV=["1","2","3","4"],b7={...Fa,align:{type:"enum",className:"rt-r-align",values:["start","center"],default:"center"},size:{type:"enum",className:"rt-r-size",values:RV,default:"3",responsive:!0},width:io.width,minWidth:io.minWidth,maxWidth:{...io.maxWidth,default:"600px"},...W4},x7=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],al={color:{type:"enum",values:x7,default:void 0}},K4={color:{type:"enum",values:x7,default:""}},xc={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}},PV=["normal","start","end","both"],k7={trim:{type:"enum",className:"rt-r-lt",values:PV,responsive:!0}},LV=["left","center","right"],S7={align:{type:"enum",className:"rt-r-ta",values:LV,responsive:!0}},TV=["wrap","nowrap","pretty","balance"],E7={wrap:{type:"enum",className:"rt-r-tw",values:TV,responsive:!0}},C7={truncate:{type:"boolean",className:"rt-truncate"}},$V=["light","regular","medium","bold"],j7={weight:{type:"enum",className:"rt-r-weight",values:$V,responsive:!0}},DV=["h1","h2","h3","h4","h5","h6"],HV=["1","2","3","4","5","6","7","8","9"],OV={as:{type:"enum",values:DV,default:"h1"},...Fa,size:{type:"enum",className:"rt-r-size",values:HV,default:"6",responsive:!0},...j7,...S7,...k7,...C7,...E7,...al,...xc},IV=["initial","xs","sm","md","lg","xl"],G4=new Set(IV);function A7(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u0(e){return typeof e=="object"&&e!==null&&Object.keys(e).some(t=>G4.has(t))}function Mi({className:e,customProperties:t,...n}){const r=Ah({allowArbitraryValues:!0,className:e,...n}),a=FV({customProperties:t,...n});return[r,a]}function Ah({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:a=i=>i}){const i=[];if(t){if(typeof t=="string"&&r.includes(t))return U3(n,t,a);if(u0(t)){const l=t;for(const u in l){if(!A7(l,u)||!G4.has(u))continue;const f=l[u];if(f!==void 0){if(r.includes(f)){const h=U3(n,f,a),p=u==="initial"?h:`${u}:${h}`;i.push(p)}else if(e){const h=u==="initial"?n:`${u}:${n}`;i.push(h)}}}return i.join(" ")}if(e)return n}}function U3(e,t,n){const r=e?"-":"",a=n(t),i=a==null?void 0:a.startsWith("-"),l=i?"-":"",u=i?a==null?void 0:a.substring(1):a;return`${l}${e}${r}${u}`}function FV({customProperties:e,value:t,propValues:n,parseValue:r=a=>a}){let a={};if(!(!t||typeof t=="string"&&n.includes(t))){if(typeof t=="string"&&(a=Object.fromEntries(e.map(i=>[i,t]))),u0(t)){const i=t;for(const l in i){if(!A7(i,l)||!G4.has(l))continue;const u=i[l];if(!n.includes(u))for(const f of e)a={[l==="initial"?f:`${f}-${l}`]:u,...a}}}for(const i in a){const l=a[i];l!==void 0&&(a[i]=r(l))}return a}}function Nh(...e){let t={};for(const n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}function _V(...e){return Object.assign({},...e)}function vr(e,...t){let n,r;const a={...e},i=_V(...t);for(const l in i){let u=a[l];const f=i[l];if(f.default!==void 0&&u===void 0&&(u=f.default),f.type==="enum"&&![f.default,...f.values].includes(u)&&!u0(u)&&(u=f.default),a[l]=u,"className"in f&&f.className){delete a[l];const h="responsive"in f;if(!u||u0(u)&&!h)continue;if(u0(u)&&(f.default!==void 0&&u.initial===void 0&&(u.initial=f.default),f.type==="enum"&&([f.default,...f.values].includes(u.initial)||(u.initial=f.default))),f.type==="enum"){const p=Ah({allowArbitraryValues:!1,value:u,className:f.className,propValues:f.values,parseValue:f.parseValue});n=_t(n,p);continue}if(f.type==="string"||f.type==="enum | string"){const p=f.type==="string"?[]:f.values,[g,v]=Mi({className:f.className,customProperties:f.customProperties,propValues:p,parseValue:f.parseValue,value:u});r=Nh(r,v),n=_t(n,g);continue}if(f.type==="boolean"&&u){n=_t(n,f.className);continue}}}return a.className=_t(n,e.className),a.style=Nh(r,e.style),a}const Al=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],xo={m:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:Al,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}},Y4=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="h1",color:l,...u}=vr(e,OV,xo);return s.createElement(dc,{"data-accent-color":l,...u,ref:t,className:_t("rt-Heading",r)},a?n:s.createElement(i,null,n))});Y4.displayName="Heading";const ZV=["span","div","label","p"],VV=["1","2","3","4","5","6","7","8","9"],zV={as:{type:"enum",values:ZV,default:"span"},...Fa,size:{type:"enum",className:"rt-r-size",values:VV,responsive:!0},...j7,...S7,...k7,...C7,...E7,...al,...xc},Ql=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="span",color:l,...u}=vr(e,zV,xo);return s.createElement(dc,{"data-accent-color":l,...u,ref:t,className:_t("rt-Text",r)},a?n:s.createElement(i,null,n))});Ql.displayName="Text";function BV(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}const UV=["none","small","medium","large","full"],Dp={radius:{type:"enum",values:UV,default:void 0}},Fs={hasBackground:{default:!0},appearance:{default:"inherit"},accentColor:{default:"indigo"},grayColor:{default:"auto"},panelBackground:{default:"translucent"},radius:{default:"medium"},scaling:{default:"100%"}},Jc=()=>{},Mh=s.createContext(void 0);function q4(){const e=s.useContext(Mh);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const _a=s.forwardRef((e,t)=>s.useContext(Mh)===void 0?s.createElement(kV,{delayDuration:200},s.createElement(TD,{dir:"ltr"},s.createElement(N7,{...e,ref:t}))):s.createElement(X4,{...e,ref:t}));_a.displayName="Theme";const N7=s.forwardRef((e,t)=>{const{appearance:n=Fs.appearance.default,accentColor:r=Fs.accentColor.default,grayColor:a=Fs.grayColor.default,panelBackground:i=Fs.panelBackground.default,radius:l=Fs.radius.default,scaling:u=Fs.scaling.default,hasBackground:f=Fs.hasBackground.default,...h}=e,[p,g]=s.useState(n);s.useEffect(()=>g(n),[n]);const[v,w]=s.useState(r);s.useEffect(()=>w(r),[r]);const[y,x]=s.useState(a);s.useEffect(()=>x(a),[a]);const[k,S]=s.useState(i);s.useEffect(()=>S(i),[i]);const[E,j]=s.useState(l);s.useEffect(()=>j(l),[l]);const[N,P]=s.useState(u);return s.useEffect(()=>P(u),[u]),s.createElement(X4,{...h,ref:t,isRoot:!0,hasBackground:f,appearance:p,accentColor:v,grayColor:y,panelBackground:k,radius:E,scaling:N,onAppearanceChange:g,onAccentColorChange:w,onGrayColorChange:x,onPanelBackgroundChange:S,onRadiusChange:j,onScalingChange:P})});N7.displayName="ThemeRoot";const X4=s.forwardRef((e,t)=>{const n=s.useContext(Mh),{asChild:r,isRoot:a,hasBackground:i,appearance:l=(n==null?void 0:n.appearance)??Fs.appearance.default,accentColor:u=(n==null?void 0:n.accentColor)??Fs.accentColor.default,grayColor:f=(n==null?void 0:n.resolvedGrayColor)??Fs.grayColor.default,panelBackground:h=(n==null?void 0:n.panelBackground)??Fs.panelBackground.default,radius:p=(n==null?void 0:n.radius)??Fs.radius.default,scaling:g=(n==null?void 0:n.scaling)??Fs.scaling.default,onAppearanceChange:v=Jc,onAccentColorChange:w=Jc,onGrayColorChange:y=Jc,onPanelBackgroundChange:x=Jc,onRadiusChange:k=Jc,onScalingChange:S=Jc,...E}=e,j=r?dc:"div",N=f==="auto"?BV(u):f,P=e.appearance==="light"||e.appearance==="dark",$=i===void 0?a||P:i;return s.createElement(Mh.Provider,{value:s.useMemo(()=>({appearance:l,accentColor:u,grayColor:f,resolvedGrayColor:N,panelBackground:h,radius:p,scaling:g,onAppearanceChange:v,onAccentColorChange:w,onGrayColorChange:y,onPanelBackgroundChange:x,onRadiusChange:k,onScalingChange:S}),[l,u,f,N,h,p,g,v,w,y,x,k,S])},s.createElement(j,{"data-is-root-theme":a?"true":"false","data-accent-color":u,"data-gray-color":N,"data-has-background":$?"true":"false","data-panel-background":h,"data-radius":p,"data-scaling":g,ref:t,...E,className:_t("radix-themes",{light:l==="light",dark:l==="dark"},E.className)}))});X4.displayName="ThemeImpl";const li=e=>{if(!s.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${s.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e},sf=e=>s.createElement(rO,{...e});sf.displayName="AlertDialog.Root";const M7=s.forwardRef(({children:e,...t},n)=>s.createElement(sO,{...t,ref:n,asChild:!0},li(e)));M7.displayName="AlertDialog.Trigger";const af=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=b7,{className:i}=vr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=vr(t,a);return s.createElement(aO,{container:f,forceMount:u},s.createElement(_a,{asChild:!0},s.createElement(oO,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${i}`},s.createElement(iO,{...h,ref:n,className:_t("rt-BaseDialogContent","rt-AlertDialogContent",l)}))))))});af.displayName="AlertDialog.Content";const of=s.forwardRef((e,t)=>s.createElement(uO,{asChild:!0},s.createElement(Y4,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));of.displayName="AlertDialog.Title";const lf=s.forwardRef((e,t)=>s.createElement(dO,{asChild:!0},s.createElement(Ql,{as:"p",size:"3",...e,asChild:!1,ref:t})));lf.displayName="AlertDialog.Description";const cf=s.forwardRef(({children:e,...t},n)=>s.createElement(lO,{...t,ref:n,asChild:!0},li(e)));cf.displayName="AlertDialog.Action";const uf=s.forwardRef(({children:e,...t},n)=>s.createElement(cO,{...t,ref:n,asChild:!0},li(e)));uf.displayName="AlertDialog.Cancel";function WV(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const a=s.Children.only(r);return s.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}const KV=["1","2","3"],GV=["solid","soft","surface","outline"],YV={...Fa,size:{type:"enum",className:"rt-r-size",values:KV,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:GV,default:"soft"},...K4,...xc,...Dp},R7=s.forwardRef((e,t)=>{const{asChild:n,className:r,color:a,radius:i,...l}=vr(e,YV,xo),u=n?dc:"span";return s.createElement(u,{"data-accent-color":a,"data-radius":i,...l,ref:t,className:_t("rt-reset","rt-Badge",r)})});R7.displayName="Badge";const P7=dc,qV=["div","span"],XV=["none","inline","inline-block","block","contents"],QV={as:{type:"enum",values:qV,default:"div"},...Fa,display:{type:"enum",className:"rt-r-display",values:XV,responsive:!0}},Nl=["0","1","2","3","4","5","6","7","8","9"],JV={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Nl,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Nl,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Nl,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Nl,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Nl,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Nl,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Nl,responsive:!0}},bg=["visible","hidden","clip","scroll","auto"],ez=["static","relative","absolute","fixed","sticky"],_d=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],tz=["0","1"],nz=["0","1"],rz=["start","center","end","baseline","stretch"],sz=["start","center","end","baseline","stretch"],L7={...JV,...io,...W4,position:{type:"enum",className:"rt-r-position",values:ez,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:_d,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:_d,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:_d,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:_d,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:_d,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:bg,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:bg,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:bg,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:tz,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:nz,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:rz,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:sz,responsive:!0}},d0=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=vr(e,QV,L7,xo);return s.createElement(r?P7:a,{...i,ref:t,className:_t("rt-Box",n)})});d0.displayName="Box";const az=["1","2","3","4"],oz=["classic","solid","soft","surface","outline","ghost"],W3={...Fa,size:{type:"enum",className:"rt-r-size",values:az,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:oz,default:"solid"},...K4,...xc,...Dp,loading:{type:"boolean",className:"rt-loading",default:!1}},xg=["0","1","2","3","4","5","6","7","8","9"],iz={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:xg,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:xg,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:xg,responsive:!0}},lz=["div","span"],cz=["none","inline-flex","flex"],uz=["row","column","row-reverse","column-reverse"],dz=["start","center","end","baseline","stretch"],fz=["start","center","end","between"],hz=["nowrap","wrap","wrap-reverse"],pz={as:{type:"enum",values:lz,default:"div"},...Fa,display:{type:"enum",className:"rt-r-display",values:cz,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:uz,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:dz,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:fz,parseValue:mz,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:hz,responsive:!0},...iz};function mz(e){return e==="between"?"space-between":e}const js=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=vr(e,pz,L7,xo);return s.createElement(r?P7:a,{...i,ref:t,className:_t("rt-Flex",n)})});js.displayName="Flex";const gz=["1","2","3"],vz={size:{type:"enum",className:"rt-r-size",values:gz,default:"2",responsive:!0},loading:{type:"boolean",default:!0}},xr=s.forwardRef((e,t)=>{const{className:n,children:r,loading:a,...i}=vr(e,vz,xo);if(!a)return r;const l=s.createElement("span",{...i,ref:t,className:_t("rt-Spinner",n)},s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}));return r===void 0?l:s.createElement(js,{asChild:!0,position:"relative",align:"center",justify:"center"},s.createElement("span",null,s.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},r),s.createElement(js,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,l))))});xr.displayName="Spinner";const wz=GS;function T7(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r)]))}function yz(e){return e==="3"?"3":"2"}function bz(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}const $7=s.forwardRef((e,t)=>{const{size:n=W3.size.default}=e,{className:r,children:a,asChild:i,color:l,radius:u,disabled:f=e.loading,...h}=vr(e,W3,xo),p=i?dc:"button";return s.createElement(p,{"data-disabled":f||void 0,"data-accent-color":l,"data-radius":u,...h,ref:t,className:_t("rt-reset","rt-BaseButton",r),disabled:f},e.loading?s.createElement(s.Fragment,null,s.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},a),s.createElement(wz,null,a),s.createElement(js,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,s.createElement(xr,{size:T7(n,bz)})))):a)});$7.displayName="BaseButton";const ia=s.forwardRef(({className:e,...t},n)=>s.createElement($7,{...t,ref:n,className:_t("rt-Button",e)}));ia.displayName="Button";const xz=["1","2","3"],kz=["soft","surface","outline"],K3={...Fa,size:{type:"enum",className:"rt-r-size",values:xz,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:kz,default:"soft"},...K4,...xc},D7=s.createContext({}),J8=s.forwardRef((e,t)=>{const{size:n=K3.size.default}=e,{asChild:r,children:a,className:i,color:l,...u}=vr(e,K3,xo),f=r?dc:"div";return s.createElement(f,{"data-accent-color":l,...u,className:_t("rt-CalloutRoot",i),ref:t},s.createElement(D7.Provider,{value:s.useMemo(()=>({size:n}),[n])},a))});J8.displayName="Callout.Root";const Sz=s.forwardRef(({className:e,...t},n)=>s.createElement("div",{...t,className:_t("rt-CalloutIcon",e),ref:n}));Sz.displayName="Callout.Icon";const e6=s.forwardRef(({className:e,...t},n)=>{const{size:r}=s.useContext(D7);return s.createElement(Ql,{as:"p",size:T7(r,yz),...t,asChild:!1,ref:n,className:_t("rt-CalloutText",e)})});e6.displayName="Callout.Text";const Ez=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));Ez.displayName="ThickDividerHorizontalIcon";const Qu=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Qu.displayName="ThickCheckIcon";const H7=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));H7.displayName="ChevronDownIcon";const Q4=$n.forwardRef((e,t)=>$n.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},$n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Q4.displayName="ThickChevronRightIcon";const Cz=["1","2","3"],Zd={...Fa,size:{values:Cz,default:"1"},...Dp,scrollbars:{default:"both"}};function jz(e){const{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,...f}=e;return{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,rest:f}}const Ml=xo.m.values;function Az(e){const[t,n]=Mi({className:"rt-r-m",customProperties:["--margin"],propValues:Ml,value:e.m}),[r,a]=Mi({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:Ml,value:e.mx}),[i,l]=Mi({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:Ml,value:e.my}),[u,f]=Mi({className:"rt-r-mt",customProperties:["--margin-top"],propValues:Ml,value:e.mt}),[h,p]=Mi({className:"rt-r-mr",customProperties:["--margin-right"],propValues:Ml,value:e.mr}),[g,v]=Mi({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:Ml,value:e.mb}),[w,y]=Mi({className:"rt-r-ml",customProperties:["--margin-left"],propValues:Ml,value:e.ml});return[_t(t,r,i,u,h,g,w),Nh(n,a,l,f,p,v,y)]}const df=s.forwardRef((e,t)=>{const{rest:n,...r}=jz(e),[a,i]=Az(r),{asChild:l,children:u,className:f,style:h,type:p,scrollHideDelay:g=p!=="scroll"?0:void 0,dir:v,size:w=Zd.size.default,radius:y=Zd.radius.default,scrollbars:x=Zd.scrollbars.default,...k}=n;return s.createElement(a7,{type:p,scrollHideDelay:g,className:_t("rt-ScrollAreaRoot",a,f),style:Nh(i,h),asChild:l},WV({asChild:l,children:u},S=>s.createElement(s.Fragment,null,s.createElement(o7,{...k,ref:t,className:"rt-ScrollAreaViewport"},S),s.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),x!=="vertical"?s.createElement(G8,{"data-radius":y,orientation:"horizontal",className:_t("rt-ScrollAreaScrollbar",Ah({className:"rt-r-size",value:w,propValues:Zd.size.values}))},s.createElement(Y8,{className:"rt-ScrollAreaThumb"})):null,x!=="horizontal"?s.createElement(G8,{"data-radius":y,orientation:"vertical",className:_t("rt-ScrollAreaScrollbar",Ah({className:"rt-r-size",value:w,propValues:Zd.size.values}))},s.createElement(Y8,{className:"rt-ScrollAreaThumb"})):null,x==="both"?s.createElement(xZ,{className:"rt-ScrollAreaCorner"}):null)))});df.displayName="ScrollArea";const Nz=["1","2"],Mz=["solid","soft"],so={size:{type:"enum",className:"rt-r-size",values:Nz,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:Mz,default:"solid"},...al,...xc},O7={...Fa,...al},I7={...al},F7={...al},ff=e=>s.createElement(zF,{...e});ff.displayName="ContextMenu.Root";const hf=s.forwardRef(({children:e,...t},n)=>s.createElement(BF,{...t,ref:n,asChild:!0},li(e)));hf.displayName="ContextMenu.Trigger";const _7=s.createContext({}),pf=s.forwardRef((e,t)=>{const n=q4(),{size:r=so.size.default,variant:a=so.variant.default,highContrast:i=so.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=vr(e,so),v=f||n.accentColor;return s.createElement(VE,{container:h,forceMount:p},s.createElement(_a,{asChild:!0},s.createElement(UF,{"data-accent-color":v,alignOffset:-Number(r)*4,collisionPadding:10,...g,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",l)},s.createElement(df,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-ContextMenuViewport")},s.createElement(_7.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});pf.displayName="ContextMenu.Content";const Rz=s.forwardRef(({className:e,...t},n)=>s.createElement(KF,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuLabel","rt-ContextMenuLabel",e)}));Rz.displayName="ContextMenu.Label";const mf=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=O7.color.default,shortcut:i,...l}=e;return s.createElement(GF,{"data-accent-color":a,...l,ref:t,className:_t("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",n)},s.createElement(hp,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},i))});mf.displayName="ContextMenu.Item";const Pz=s.forwardRef(({className:e,...t},n)=>s.createElement(WF,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuGroup","rt-ContextMenuGroup",e)}));Pz.displayName="ContextMenu.Group";const Lz=s.forwardRef(({className:e,...t},n)=>s.createElement(qF,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",e)}));Lz.displayName="ContextMenu.RadioGroup";const Tz=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=F7.color.default,...i}=e;return s.createElement(XF,{...i,asChild:!1,ref:t,"data-accent-color":a,className:_t("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",r)},s.createElement(hp,null,n),s.createElement(zE,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Qu,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});Tz.displayName="ContextMenu.RadioItem";const $z=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=I7.color.default,...l}=e;return s.createElement(YF,{...l,asChild:!1,ref:t,"data-accent-color":i,className:_t("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",r)},s.createElement(hp,null,n),s.createElement(zE,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Qu,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},a))});$z.displayName="ContextMenu.CheckboxItem";const Dz=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(JF,{...a,asChild:!1,ref:t,className:_t("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},s.createElement(Q4,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});Dz.displayName="ContextMenu.SubTrigger";const Hz=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(_7),{className:l,children:u,container:f,forceMount:h,...p}=vr({size:n,variant:r,color:a,highContrast:i,...e},so);return s.createElement(VE,{container:f,forceMount:h},s.createElement(_a,{asChild:!0},s.createElement(e_,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",l)},s.createElement(df,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-ContextMenuViewport")},u)))))});Hz.displayName="ContextMenu.SubContent";const Hp=s.forwardRef(({className:e,...t},n)=>s.createElement(QF,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuSeparator","rt-ContextMenuSeparator",e)}));Hp.displayName="ContextMenu.Separator";const J4=e=>s.createElement(fc,{...e,modal:!0});J4.displayName="Dialog.Root";const Oz=s.forwardRef(({children:e,...t},n)=>s.createElement(v4,{...t,ref:n,asChild:!0},li(e)));Oz.displayName="Dialog.Trigger";const ev=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=b7,{className:i}=vr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=vr(t,a);return s.createElement(hc,{container:f,forceMount:u},s.createElement(_a,{asChild:!0},s.createElement(pc,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${i}`},s.createElement(mc,{...h,ref:n,className:_t("rt-BaseDialogContent","rt-DialogContent",l)}))))))});ev.displayName="Dialog.Content";const tv=s.forwardRef((e,t)=>s.createElement(gc,{asChild:!0},s.createElement(Y4,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));tv.displayName="Dialog.Title";const Iz=s.forwardRef((e,t)=>s.createElement(w4,{asChild:!0},s.createElement(Ql,{as:"p",size:"3",...e,asChild:!1,ref:t})));Iz.displayName="Dialog.Description";const Fz=s.forwardRef(({children:e,...t},n)=>s.createElement(vp,{...t,ref:n,asChild:!0},li(e)));Fz.displayName="Dialog.Close";const Ss=e=>s.createElement(b_,{...e});Ss.displayName="DropdownMenu.Root";const Es=s.forwardRef(({children:e,...t},n)=>s.createElement(x_,{...t,ref:n,asChild:!0},li(e)));Es.displayName="DropdownMenu.Trigger";const Z7=s.createContext({}),Cs=s.forwardRef((e,t)=>{const n=q4(),{size:r=so.size.default,variant:a=so.variant.default,highContrast:i=so.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=vr(e,so),v=f||n.accentColor;return s.createElement(UE,{container:h,forceMount:p},s.createElement(_a,{asChild:!0},s.createElement(k_,{"data-accent-color":v,align:"start",sideOffset:4,collisionPadding:10,...g,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",l)},s.createElement(df,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-DropdownMenuViewport")},s.createElement(Z7.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});Cs.displayName="DropdownMenu.Content";const t6=s.forwardRef(({className:e,...t},n)=>s.createElement(E_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));t6.displayName="DropdownMenu.Label";const tr=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=O7.color.default,shortcut:i,...l}=e;return s.createElement(C_,{"data-accent-color":a,...l,ref:t,className:_t("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},s.createElement(hp,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});tr.displayName="DropdownMenu.Item";const _z=s.forwardRef(({className:e,...t},n)=>s.createElement(S_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));_z.displayName="DropdownMenu.Group";const Rh=s.forwardRef(({className:e,...t},n)=>s.createElement(A_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));Rh.displayName="DropdownMenu.RadioGroup";const gu=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=F7.color.default,...i}=e;return s.createElement(N_,{...i,asChild:!1,ref:t,"data-accent-color":a,className:_t("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",r)},n,s.createElement(WE,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Qu,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});gu.displayName="DropdownMenu.RadioItem";const Zz=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=I7.color.default,...l}=e;return s.createElement(j_,{...l,asChild:!1,ref:t,"data-accent-color":i,className:_t("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",r)},n,s.createElement(WE,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Qu,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},a))});Zz.displayName="DropdownMenu.CheckboxItem";const Vz=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(R_,{...a,asChild:!1,ref:t,className:_t("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s.createElement(Q4,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});Vz.displayName="DropdownMenu.SubTrigger";const zz=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(Z7),{className:l,children:u,container:f,forceMount:h,...p}=vr({size:n,variant:r,color:a,highContrast:i,...e},so);return s.createElement(UE,{container:f,forceMount:h},s.createElement(_a,{asChild:!0},s.createElement(P_,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:_t("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},s.createElement(df,{type:"auto"},s.createElement("div",{className:_t("rt-BaseMenuViewport","rt-DropdownMenuViewport")},u)))))});zz.displayName="DropdownMenu.SubContent";const Bl=s.forwardRef(({className:e,...t},n)=>s.createElement(M_,{...t,asChild:!1,ref:n,className:_t("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));Bl.displayName="DropdownMenu.Separator";const Bz=["1","2","3","4"],Uz={...Fa,size:{type:"enum",className:"rt-r-size",values:Bz,default:"2",responsive:!0},width:io.width,minWidth:io.minWidth,maxWidth:{...io.maxWidth,default:"480px"},...W4},Hu=e=>s.createElement(Q_,{...e});Hu.displayName="Popover.Root";const Ou=s.forwardRef(({children:e,...t},n)=>s.createElement(eZ,{...t,ref:n,asChild:!0},li(e)));Ou.displayName="Popover.Trigger";const Iu=s.forwardRef((e,t)=>{const{className:n,forceMount:r,container:a,...i}=vr(e,Uz);return s.createElement(tZ,{container:a,forceMount:r},s.createElement(_a,{asChild:!0},s.createElement(nZ,{align:"start",sideOffset:8,collisionPadding:10,...i,ref:t,className:_t("rt-PopperContent","rt-PopoverContent",n)})))});Iu.displayName="Popover.Content";const Wz=s.forwardRef(({children:e,...t},n)=>s.createElement(rZ,{...t,ref:n,asChild:!0},li(e)));Wz.displayName="Popover.Close";const Kz=s.forwardRef(({children:e,...t},n)=>s.createElement(J_,{...t,ref:n}));Kz.displayName="Popover.Anchor";const Gz=["1","2","3"],nv={size:{type:"enum",className:"rt-r-size",values:Gz,default:"2",responsive:!0}},Yz=["classic","surface","soft","ghost"],qz={variant:{type:"enum",className:"rt-variant",values:Yz,default:"surface"},...al,...Dp,placeholder:{type:"string"}},Xz=["solid","soft"],Qz={variant:{type:"enum",className:"rt-variant",values:Xz,default:"solid"},...al,...xc},rv=s.createContext({}),V7=e=>{const{children:t,size:n=nv.size.default,...r}=e;return s.createElement(MZ,{...r},s.createElement(rv.Provider,{value:s.useMemo(()=>({size:n}),[n])},t))};V7.displayName="Select.Root";const z7=s.forwardRef((e,t)=>{const n=s.useContext(rv),{children:r,className:a,color:i,radius:l,placeholder:u,...f}=vr({size:n==null?void 0:n.size,...e},{size:nv.size},qz,xo);return s.createElement(PZ,{asChild:!0},s.createElement("button",{"data-accent-color":i,"data-radius":l,...f,ref:t,className:_t("rt-reset","rt-SelectTrigger",a)},s.createElement("span",{className:"rt-SelectTriggerInner"},s.createElement(TZ,{placeholder:u},r)),s.createElement($Z,{asChild:!0},s.createElement(H7,{className:"rt-SelectIcon"}))))});z7.displayName="Select.Trigger";const B7=s.forwardRef((e,t)=>{const n=s.useContext(rv),{className:r,children:a,color:i,container:l,...u}=vr({size:n==null?void 0:n.size,...e},{size:nv.size},Qz),f=q4(),h=i||f.accentColor;return s.createElement(IZ,{container:l},s.createElement(_a,{asChild:!0},s.createElement(FZ,{"data-accent-color":h,sideOffset:4,...u,asChild:!1,ref:t,className:_t({"rt-PopperContent":u.position==="popper"},"rt-SelectContent",r)},s.createElement(a7,{type:"auto",className:"rt-ScrollAreaRoot"},s.createElement(WZ,{asChild:!0,className:"rt-SelectViewport"},s.createElement(o7,{className:"rt-ScrollAreaViewport",style:{overflowY:void 0}},a)),s.createElement(G8,{className:"rt-ScrollAreaScrollbar rt-r-size-1",orientation:"vertical"},s.createElement(Y8,{className:"rt-ScrollAreaThumb"}))))))});B7.displayName="Select.Content";const U7=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(eV,{...a,asChild:!1,ref:t,className:_t("rt-SelectItem",n)},s.createElement(rV,{className:"rt-SelectItemIndicator"},s.createElement(Qu,{className:"rt-SelectItemIndicatorIcon"})),s.createElement(tV,null,r))});U7.displayName="Select.Item";const Jz=s.forwardRef(({className:e,...t},n)=>s.createElement(qZ,{...t,asChild:!1,ref:n,className:_t("rt-SelectGroup",e)}));Jz.displayName="Select.Group";const eB=s.forwardRef(({className:e,...t},n)=>s.createElement(QZ,{...t,asChild:!1,ref:n,className:_t("rt-SelectLabel",e)}));eB.displayName="Select.Label";const tB=s.forwardRef(({className:e,...t},n)=>s.createElement(sV,{...t,asChild:!1,ref:n,className:_t("rt-SelectSeparator",e)}));tB.displayName="Select.Separator";const nB={content:{type:"ReactNode",required:!0},width:io.width,minWidth:io.minWidth,maxWidth:{...io.maxWidth,default:"360px"}},sv=s.forwardRef((e,t)=>{const{children:n,className:r,open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f,content:h,container:p,forceMount:g,...v}=vr(e,nB),w={open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f};return s.createElement(SV,{...w},s.createElement(EV,{asChild:!0},n),s.createElement(CV,{container:p,forceMount:g},s.createElement(_a,{asChild:!0},s.createElement(jV,{sideOffset:4,collisionPadding:10,...v,asChild:!1,ref:t,className:_t("rt-TooltipContent",r)},s.createElement(Ql,{as:"p",className:"rt-TooltipText",size:"1"},h),s.createElement(AV,{className:"rt-TooltipArrow"})))))});sv.displayName="Tooltip";const Dr={lastBrand:"scenri:last-brand",engine:"scenri:engine",quality:"scenri:quality",count:"scenri:count",format:"scenri:format",assetsOpen:"scenri:assets-open",ovlPanelW:"scenri:ovl-panel-w",pstudioRailW:"scenri:pstudio-rail-w",assetsExpanded:"scenri:assets-expanded",tileSize:"scenri:tile-size",wallDensity:"scenri:wall-density",feedSort:"scenri:feed-sort",feedCounts:"scenri:feed-counts"};function W7(e,t){try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}const n6="scenri:pref-changed";function K7(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}try{window.dispatchEvent(new CustomEvent(n6,{detail:{key:e,value:t}}))}catch{}}function r6(e,t){try{const n=localStorage.getItem(e);return n===null?null:(localStorage.setItem(t,n),localStorage.removeItem(e),n)}catch{return null}}function fa(e,t){const[n,r]=s.useState(()=>W7(e,t)),a=s.useRef(n);return s.useEffect(()=>{Object.is(a.current,n)||(a.current=n,K7(e,n))},[e,n]),s.useEffect(()=>{const i=l=>{const u=l.detail;(u==null?void 0:u.key)===e&&r(f=>Object.is(f,u.value)?f:u.value)};return window.addEventListener(n6,i),()=>window.removeEventListener(n6,i)},[e]),[n,r]}function rB(e,t){const[n,r]=s.useState(()=>{try{const a=sessionStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});return s.useEffect(()=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}function kg(e,t){const[n,r]=fa(e,t),[a,i]=s.useState(null);return[a??n,u=>{i(null),r(u)},i]}const sB=()=>W7(Dr.lastBrand,null),aB=e=>K7(Dr.lastBrand,e),s6="sc-theme",oB="bt-theme",iB=()=>window.matchMedia("(prefers-color-scheme: light)").matches,G7=s.createContext({choice:"system",mode:"dark",setChoice:()=>{},toggle:()=>{}}),lB=()=>s.useContext(G7);function cB(){const e=localStorage.getItem(s6)??r6(oB,s6);return e==="light"||e==="dark"||e==="system"?e:"system"}function uB({children:e}){const[t,n]=s.useState(cB),[r,a]=s.useState(()=>iB()?"light":"dark");s.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: light)"),f=()=>a(u.matches?"light":"dark");return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);const i=t==="system"?r:t;s.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem(s6,t)},[i,t]);const l=s.useMemo(()=>({choice:t,mode:i,setChoice:n,toggle:()=>n(i==="dark"?"light":"dark")}),[t,i]);return o.jsx(G7.Provider,{value:l,children:o.jsx(_a,{appearance:i,accentColor:"gray",grayColor:"gray",radius:"large",scaling:"100%",children:e})})}const dB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.41,51.63a108,108,0,1,0,0,152.74A107.38,107.38,0,0,0,204.41,51.63Zm-17,17A83.85,83.85,0,0,1,196.26,79L169,111.09l-23.3-65.21A83.52,83.52,0,0,1,187.43,68.6Zm-118.85,0a83.44,83.44,0,0,1,51.11-24.2l14.16,39.65L65.71,71.61C66.64,70.59,67.59,69.59,68.58,68.6ZM48,153.7a84.48,84.48,0,0,1,3.4-60.3L92.84,101Zm20.55,33.7A83.94,83.94,0,0,1,59.74,177L87,144.91l23.3,65.21A83.53,83.53,0,0,1,68.58,187.4Zm36.36-63.61,15.18-17.85,23.06,4.21,7.88,22.06-15.17,17.85-23.06-4.21Zm82.49,63.61a83.49,83.49,0,0,1-51.11,24.2L122.15,172l68.14,12.44C189.36,185.41,188.41,186.41,187.43,187.4ZM163.16,155,208,102.3a84.43,84.43,0,0,1-3.41,60.3Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M195.88,60.12a96,96,0,1,0,0,135.76A96,96,0,0,0,195.88,60.12Zm-55.34,103h0l-36.68-6.69h0L91.32,121.3l24.14-28.41h0l36.68,6.69,12.54,35.12Z",opacity:"0.2"}),s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,0,0,54.46,54.46,104,104,0,0,0,128,232h.09A104,104,0,0,0,232,128ZM49.18,88.92l51.21,9.35L46.65,161.53A88.39,88.39,0,0,1,49.18,88.92Zm160.17,5.54a88.41,88.41,0,0,1-2.53,72.62l-51.21-9.35Zm-8.08-15.2L167.55,119,139.63,40.78a87.38,87.38,0,0,1,50.6,25A88.74,88.74,0,0,1,201.27,79.26ZM122.43,40.19l17.51,49L58.3,74.32a89.28,89.28,0,0,1,7.47-8.55A87.37,87.37,0,0,1,122.43,40.19ZM54.73,176.74,88.45,137l27.92,78.18a88,88,0,0,1-61.64-38.48Zm78.84,39.06-17.51-49L139.14,171h0l58.52,10.69a87.5,87.5,0,0,1-64.13,34.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.12,55.88A102,102,0,0,0,55.87,200.12,102,102,0,1,0,200.12,55.88Zm-102,66.67,19.65-23.14,29.86,5.46,10.21,28.58-19.65,23.14-29.86-5.46ZM209.93,90.69a90.24,90.24,0,0,1-2,78.63l-56.14-10.24Zm-6.16-11.28-36.94,43.48L136.66,38.42a89.31,89.31,0,0,1,55,25.94A91.33,91.33,0,0,1,203.77,79.41Zm-139.41-15A89.37,89.37,0,0,1,123.81,38.1L143,91.82,54.75,75.71A91.2,91.2,0,0,1,64.36,64.36ZM48,86.68l56.14,10.24L46.07,165.31a90.24,90.24,0,0,1,2-78.63Zm4.21,89.91,36.94-43.48,30.17,84.47a89.31,89.31,0,0,1-55-25.94A91.33,91.33,0,0,1,52.23,176.59Zm139.41,15a89.32,89.32,0,0,1-59.45,26.26L113,164.18l88.24,16.11A91.2,91.2,0,0,1,191.64,191.64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198.71,57.29A100,100,0,1,0,57.29,198.71,100,100,0,1,0,198.71,57.29Zm10.37,114.27-61-11.14L210.4,87a92.26,92.26,0,0,1-1.32,84.52ZM95.87,122.13,117,97.24l32.14,5.86,11,30.77L139,158.76l-32.14-5.86ZM206.24,79.58l-40.13,47.25L133.75,36.2a92.09,92.09,0,0,1,72.49,43.38ZM63,63a91.31,91.31,0,0,1,62.26-26.88L146,94.41,51.32,77.11A92.94,92.94,0,0,1,63,63Zm-16,21.49,61,11.14L45.6,169a92.26,92.26,0,0,1,1.32-84.52Zm2.84,92,40.13-47.25,32.36,90.63a92.09,92.09,0,0,1-72.49-43.38Zm143.29,16.63a91.31,91.31,0,0,1-62.26,26.88L110,161.59l94.72,17.3A92.94,92.94,0,0,1,193.05,193.05Z"}))]]),fB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V88a20,20,0,0,0,16,19.6V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V107.6A20,20,0,0,0,244,88V64A20,20,0,0,0,224,44ZM36,68H220V84H36ZM52,188V108H204v80Zm112-52a12,12,0,0,1-12,12H104a12,12,0,0,1,0-24h48A12,12,0,0,1,164,136Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,96v96a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm-72,96H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm72-56H32V64H224V88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V88a14,14,0,0,0,14,14h2v90a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V102h2a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM210,192a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V102H210ZM226,88a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2ZM98,136a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,136Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V88a12,12,0,0,0,12,12h4v92a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V100h4a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM212,192a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V100H212ZM228,88a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4ZM100,136a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,136Z"}))]]),hB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40.49-100.49a12,12,0,0,1-17,17L140,117v51a12,12,0,0,1-24,0V117l-11.51,11.52a12,12,0,0,1-17-17l32-32a12,12,0,0,1,17,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,101.66a8,8,0,0,1-11.32,0L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,165.66,125.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm36.24-102.24a6,6,0,1,1-8.48,8.48L134,102.49V168a6,6,0,0,1-12,0V102.49l-21.76,21.75a6,6,0,0,1-8.48-8.48l32-32a6,6,0,0,1,8.48,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-102.83a4,4,0,0,1-5.66,5.66L132,97.66V168a4,4,0,0,1-8,0V97.66L98.83,122.83a4,4,0,0,1-5.66-5.66l32-32a4,4,0,0,1,5.66,0Z"}))]]),pB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),mB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),gB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),vB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,143.51a12,12,0,0,1-17,17L140,109V224a12,12,0,0,1-24,0V109L64.49,160.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0ZM216,28H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,144H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M133.66,66.34a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,152h64v72a8,8,0,0,0,16,0V152h64a8,8,0,0,0,5.66-13.66ZM75.31,136,128,83.31,180.69,136ZM224,40a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34A8,8,0,0,1,200,152H136v72a8,8,0,0,1-16,0V152H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,139.76a6,6,0,1,1-8.48,8.48L134,86.49V224a6,6,0,0,1-12,0V86.49L60.24,148.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0ZM216,34H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34a8,8,0,0,1-11.32,11.32L136,91.31V224a8,8,0,0,1-16,0V91.31L61.66,149.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,141.17a4,4,0,0,1-5.66,5.66L132,81.66V224a4,4,0,0,1-8,0V81.66L58.83,146.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0ZM216,36H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"}))]]),wB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),s.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),yB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),bB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),xB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),kB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120.49,167.51a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L68,179V48a12,12,0,0,1,24,0V179l11.51-11.52A12,12,0,0,1,120.49,167.51Zm96-96-32-32a12,12,0,0,0-17,0l-32,32a12,12,0,0,0,17,17L164,77V208a12,12,0,0,0,24,0V77l11.51,11.52a12,12,0,0,0,17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,48V208H80V48Z",opacity:"0.2"}),s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M119.39,172.94a8,8,0,0,1-1.73,8.72l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,48,168H72V48a8,8,0,0,1,16,0V168h24A8,8,0,0,1,119.39,172.94Zm94.27-98.6-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,144,88h24V208a8,8,0,0,0,16,0V88h24a8,8,0,0,0,5.66-13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L74,193.51V48a6,6,0,0,1,12,0V193.51l21.76-21.75A6,6,0,0,1,116.24,171.76Zm96-96-32-32a6,6,0,0,0-8.48,0l-32,32a6,6,0,0,0,8.48,8.48L170,62.49V208a6,6,0,0,0,12,0V62.49l21.76,21.75a6,6,0,0,0,8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M114.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L76,198.34V48a4,4,0,0,1,8,0V198.34l25.17-25.17A4,4,0,0,1,114.83,173.17Zm96-96-32-32a4,4,0,0,0-5.66,0l-32,32a4,4,0,0,0,5.66,5.66L172,57.66V208a4,4,0,0,0,8,0V57.66l25.17,25.17a4,4,0,1,0,5.66-5.66Z"}))]]),SB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z",opacity:"0.2"}),s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z"}))]]),EB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),s.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),CB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),s.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]),jB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),s.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),AB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),s.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),NB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40V208H152V40Z",opacity:"0.2"}),s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z"}))]]),MB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),RB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"}))]]),PB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]),LB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),TB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,72V216H40V72Z",opacity:"0.2"}),s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,72V216a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H184A8,8,0,0,1,192,72Zm24-40H72a8,8,0,0,0,0,16H208V184a8,8,0,0,0,16,0V40A8,8,0,0,0,216,32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,66H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H184a6,6,0,0,0,6-6V72A6,6,0,0,0,184,66Zm-6,144H46V78H178ZM222,40V184a6,6,0,0,1-12,0V46H72a6,6,0,0,1,0-12H216A6,6,0,0,1,222,40Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,68H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H184a4,4,0,0,0,4-4V72A4,4,0,0,0,184,68Zm-4,144H44V76H180ZM220,40V184a4,4,0,0,1-8,0V44H72a4,4,0,0,1,0-8H216A4,4,0,0,1,220,40Z"}))]]),$B=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,12H80A28,28,0,0,0,52,40V216a28,28,0,0,0,28,28h96a28,28,0,0,0,28-28V40A28,28,0,0,0,176,12ZM76,76H180V180H76Zm4-40h96a4,4,0,0,1,4,4V52H76V40A4,4,0,0,1,80,36Zm96,184H80a4,4,0,0,1-4-4V204H180v12A4,4,0,0,1,176,220Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,56V200H64V56Z",opacity:"0.2"}),s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM80,32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,18H80A22,22,0,0,0,58,40V216a22,22,0,0,0,22,22h96a22,22,0,0,0,22-22V40A22,22,0,0,0,176,18ZM70,62H186V194H70ZM80,30h96a10,10,0,0,1,10,10V50H70V40A10,10,0,0,1,80,30Zm96,196H80a10,10,0,0,1-10-10V206H186v10A10,10,0,0,1,176,226Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,20H80A20,20,0,0,0,60,40V216a20,20,0,0,0,20,20h96a20,20,0,0,0,20-20V40A20,20,0,0,0,176,20ZM68,60H188V196H68ZM80,28h96a12,12,0,0,1,12,12V52H68V40A12,12,0,0,1,80,28Zm96,200H80a12,12,0,0,1-12-12V204H188v12A12,12,0,0,1,176,228Z"}))]]),DB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),HB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,32V224a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16V32A16,16,0,0,1,96,16h64A16,16,0,0,1,176,32Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,16H96A16,16,0,0,0,80,32V224a16,16,0,0,0,16,16h64a16,16,0,0,0,16-16V32A16,16,0,0,0,160,16ZM128,208a12,12,0,1,1,12-12A12,12,0,0,1,128,208Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,72Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M118,60a10,10,0,1,1,10,10A10,10,0,0,1,118,60Zm10,58a10,10,0,1,0,10,10A10,10,0,0,0,128,118Zm0,68a10,10,0,1,0,10,10A10,10,0,0,0,128,186Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,60a8,8,0,1,1,8,8A8,8,0,0,1,120,60Zm8,60a8,8,0,1,0,8,8A8,8,0,0,0,128,120Zm0,68a8,8,0,1,0,8,8A8,8,0,0,0,128,188Z"}))]]),OB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]),IB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,100H132.92l78.14-20.63a12,12,0,0,0,8.52-14.75l-8.16-30a19.94,19.94,0,0,0-24.3-13.95L34.79,60.87a19.74,19.74,0,0,0-12.14,9.27,19.48,19.48,0,0,0-1.95,15L28,112v88a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V112A12,12,0,0,0,216,100ZM124.89,61.91l18.29,10.56-25.95,6.85L98.94,68.76Zm64.45-17,3.91,14.35-17.13,4.52L157.83,53.21ZM66,77.46,84.29,88l-35.4,9.35L45,83ZM204,196H52V124H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M67.71,64.59l47.79,27.6L40.43,112,32.27,82a7.76,7.76,0,0,1,5.58-9.52ZM199.84,37.76a7.9,7.9,0,0,0-9.66-5.49L126.61,49.05,174.4,76.64,208,67.77Z",opacity:"0.2"}),s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07L164.57,71,136.44,54.72ZM77.55,70.27l28.12,16.24-59.6,15.73-6-22.08Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,106H86.68L209.53,73.57a6,6,0,0,0,4.26-7.38l-8.16-30a13.94,13.94,0,0,0-17-9.72L36.32,66.67a13.77,13.77,0,0,0-8.48,6.47,13.57,13.57,0,0,0-1.36,10.42L34,111.34c0,.22,0,.44,0,.66v88a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V112A6,6,0,0,0,216,106ZM125.75,55.48l33,19.07-42.43,11.2-33-19.07Zm66-17.41a1.92,1.92,0,0,1,2.34,1.26l6.57,24.18L175.26,70.2l-33-19.07ZM38.23,79.14a1.85,1.85,0,0,1,1.15-.87L66.86,71l33,19.08L44.66,104.68l-6.6-24.27A1.63,1.63,0,0,1,38.23,79.14ZM210,200a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V118H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,108H71.26L209,71.64a4,4,0,0,0,2.84-4.92l-8.16-30a11.92,11.92,0,0,0-14.54-8.31L36.83,68.61a11.78,11.78,0,0,0-7.26,5.53A11.59,11.59,0,0,0,28.41,83l7.67,28.19A3.87,3.87,0,0,0,36,112v88a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V112A4,4,0,0,0,216,108ZM126,53.33l38,21.92L116.08,87.9,78.12,66Zm65.16-17.2a4,4,0,0,1,1-.13A3.88,3.88,0,0,1,196,38.81l7.1,26.12L175,72.35,137,50.43Zm-154.7,42a3.86,3.86,0,0,1,2.37-1.8l28.27-7.46,38,21.91L43.25,107.12,36.13,80.94A3.66,3.66,0,0,1,36.5,78.14ZM212,200a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V116H212Z"}))]]),FB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),_B=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84ZM104,132h48a12,12,0,0,1,0,24H104a12,12,0,0,1,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H104a6,6,0,0,1,0-12h48A6,6,0,0,1,158,144Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H104a4,4,0,0,1,0-8h48A4,4,0,0,1,156,144Z"}))]]),ZB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,88a12,12,0,0,1,12-12h32a12,12,0,0,1,12,12v32a12,12,0,0,1-24,0V100H152A12,12,0,0,1,140,88ZM72,180h32a12,12,0,0,0,0-24H84V136a12,12,0,0,0-24,0v32A12,12,0,0,0,72,180ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM88,192H56a8,8,0,0,1-8-8V152a8,8,0,0,1,16,0v24H88a8,8,0,0,1,0,16Zm120-88a8,8,0,0,1-16,0V80H168a8,8,0,0,1,0-16h32a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,80v32a6,6,0,0,1-12,0V86H160a6,6,0,0,1,0-12h32A6,6,0,0,1,198,80ZM96,170H70V144a6,6,0,0,0-12,0v32a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12ZM230,56V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,80v32a4,4,0,0,1-8,0V84H160a4,4,0,0,1,0-8h32A4,4,0,0,1,196,80ZM96,172H68V144a4,4,0,0,0-8,0v32a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8ZM228,56V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),VB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"}))]]),zB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H190.06A33.82,33.82,0,0,0,196,49.69,36.62,36.62,0,0,0,158.31,12,33.44,33.44,0,0,0,134,23.25a54.65,54.65,0,0,0-6,8.3,54.65,54.65,0,0,0-6-8.3A33.44,33.44,0,0,0,97.69,12,36.62,36.62,0,0,0,60,49.69,33.82,33.82,0,0,0,65.94,68H40A20,20,0,0,0,20,88v32a20,20,0,0,0,16,19.6V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V139.6A20,20,0,0,0,236,120V88A20,20,0,0,0,216,68Zm-4,48H140V92h72ZM152,39.17A9.59,9.59,0,0,1,159,36h.35A12.62,12.62,0,0,1,172,49,9.59,9.59,0,0,1,168.83,56c-6.9,6.12-18.25,9.26-27.63,10.76C142.7,57.42,145.84,46.07,152,39.17ZM87.7,39.7A12.8,12.8,0,0,1,96.61,36H97A9.59,9.59,0,0,1,104,39.17c6.12,6.9,9.26,18.24,10.75,27.61C105.45,65.27,94,62.13,87.17,56A9.59,9.59,0,0,1,84,49,12.72,12.72,0,0,1,87.7,39.7ZM44,92h72v24H44Zm16,48h56v56H60Zm80,56V140h56v56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,128v72a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V120H40V88h80v32h16V88h80v32H136v92a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM84.51,59a13.69,13.69,0,0,1-4.5-10A16.62,16.62,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92C109.71,70.39,94,67.43,84.51,59Zm87,0c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08,13.69,13.69,0,0,1,171.49,59Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H174.74a46.41,46.41,0,0,0,6-4.48,27.56,27.56,0,0,0,9.22-20A30.63,30.63,0,0,0,158.5,18a27.56,27.56,0,0,0-20,9.22A57.1,57.1,0,0,0,128,45.76a57.1,57.1,0,0,0-10.48-18.53A27.56,27.56,0,0,0,97.5,18,30.63,30.63,0,0,0,66,49.51a27.56,27.56,0,0,0,9.22,20,45.74,45.74,0,0,0,6,4.48H40A14,14,0,0,0,26,88v32a14,14,0,0,0,14,14h2v66a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V134h2a14,14,0,0,0,14-14V88A14,14,0,0,0,216,74ZM135.77,63c2.25-12.12,6.29-21.75,11.69-27.85A15.68,15.68,0,0,1,158.86,30h.55A18.6,18.6,0,0,1,178,49.14a15.68,15.68,0,0,1-5.18,11.4C162.1,70,143.92,72.83,134.34,73.65,134.59,70.76,135,67.08,135.77,63ZM83.45,35.45A18.69,18.69,0,0,1,96.59,30h.55a15.68,15.68,0,0,1,11.4,5.18C118,45.9,120.83,64.08,121.65,73.66c-2.89-.25-6.57-.68-10.61-1.43C98.92,70,89.29,65.94,83.19,60.53A15.64,15.64,0,0,1,78,49.14,18.65,18.65,0,0,1,83.45,35.45ZM38,120V88a2,2,0,0,1,2-2h82v36H40A2,2,0,0,1,38,120Zm16,80V134h68v68H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V134h68Zm16-80a2,2,0,0,1-2,2H134V86h82a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H166.81a50.54,50.54,0,0,0,12.63-8A25.53,25.53,0,0,0,188,49.44,28.62,28.62,0,0,0,158.56,20,25.53,25.53,0,0,0,140,28.56c-5.91,6.67-9.63,15.36-12,23.69-2.35-8.33-6.07-17-12-23.69A25.53,25.53,0,0,0,97.44,20,28.62,28.62,0,0,0,68,49.44,25.53,25.53,0,0,0,76.56,68a50.54,50.54,0,0,0,12.63,8H40A12,12,0,0,0,28,88v32a12,12,0,0,0,12,12h4v68a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V132h4a12,12,0,0,0,12-12V88A12,12,0,0,0,216,76ZM146,33.86A17.59,17.59,0,0,1,158.8,28h.61A20.62,20.62,0,0,1,180,49.2,17.6,17.6,0,0,1,174.14,62c-12.09,10.7-33.07,13.21-42,13.79C132.76,66.93,135.26,46,146,33.86ZM76,49.2A20.62,20.62,0,0,1,96.59,28h.61A17.59,17.59,0,0,1,110,33.86c10.71,12.09,13.21,33.07,13.79,42-8.89-.58-29.87-3.09-42-13.79A17.6,17.6,0,0,1,76,49.2ZM36,120V88a4,4,0,0,1,4-4h84v40H40A4,4,0,0,1,36,120Zm16,80V132h72v72H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V132h72Zm16-80a4,4,0,0,1-4,4H132V84h84a4,4,0,0,1,4,4Z"}))]]),BB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z",opacity:"0.2"}),s.createElement("path",{d:"M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z"}))]]),UB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.8,85.49l-116-64a12,12,0,0,0-11.6,0l-116,64a12,12,0,0,0,0,21l21.8,12v47.76a19.89,19.89,0,0,0,5.09,13.32C46.63,194.7,77,220,128,220a136.88,136.88,0,0,0,40-5.75V240a12,12,0,0,0,24,0V204.12a119.53,119.53,0,0,0,30.91-24.51A19.89,19.89,0,0,0,228,166.29V118.53l21.8-12a12,12,0,0,0,0-21ZM128,45.71,219.16,96,186,114.3a1.88,1.88,0,0,1-.18-.12l-52-28.69a12,12,0,0,0-11.6,21l39,21.49L128,146.3,36.84,96ZM128,196c-40.42,0-64.65-19.07-76-31.27v-33l70.2,38.74a12,12,0,0,0,11.6,0L168,151.64v37.23A110.46,110.46,0,0,1,128,196Zm76-31.27a93.21,93.21,0,0,1-12,10.81V138.39l12-6.62Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,113.07v53.22a8,8,0,0,1-2,5.31c-11.3,12.59-38.9,36.4-86,36.4s-74.68-23.81-86-36.4a8,8,0,0,1-2-5.31V113.07L128,160Z",opacity:"0.2"}),s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,207.24a119,119,0,0,0,16-7.73V240a8,8,0,0,1-16,0Zm11.76-88.43-56-29.87a8,8,0,0,0-7.52,14.12L171,128l17-9.06Zm64-29.87-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V130.67L171,128l-43,22.93L43.83,106l0,0L25,96,128,41.07,231,96l-18.78,10-.06,0L188,118.94a8,8,0,0,1,4,6.93v73.64a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M250.82,90.71l-120-64a5.94,5.94,0,0,0-5.64,0l-120,64a6,6,0,0,0,0,10.58L34,116.67v49.62a14,14,0,0,0,3.55,9.32C50.42,189.94,79.29,214,128,214a127.21,127.21,0,0,0,50-9.73V240a6,6,0,0,0,12,0V198.35a113.18,113.18,0,0,0,28.45-22.75,13.91,13.91,0,0,0,3.55-9.31V116.67l28.82-15.38a6,6,0,0,0,0-10.58ZM128,202c-44,0-70-21.56-81.52-34.41a2,2,0,0,1-.48-1.3V123.07l79.18,42.22a6,6,0,0,0,5.64,0L178,140.13v51C165,197.35,148.45,202,128,202Zm82-35.71a2,2,0,0,1-.48,1.3A100.25,100.25,0,0,1,190,184.3V133.73l20-10.66Zm-22.15-45a6.27,6.27,0,0,0-1-.71l-56-29.86a6,6,0,0,0-5.64,10.58L175.25,128,128,153.2,20.75,96,128,38.8,235.25,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.88,92.47l-120-64a4,4,0,0,0-3.76,0l-120,64a4,4,0,0,0,0,7.06L36,115.47v50.82a11.92,11.92,0,0,0,3,8c12.65,14.09,41,37.73,89,37.73,21,0,38.2-4.52,52-10.79V240a4,4,0,0,0,8,0V197.18a111.64,111.64,0,0,0,29-22.91,11.94,11.94,0,0,0,3-8V115.47l29.88-15.94a4,4,0,0,0,0-7.06ZM128,204c-44.83,0-71.25-22-83-35.08a3.92,3.92,0,0,1-1-2.63V119.73l82.12,43.8a4,4,0,0,0,3.76,0L180,136.8v55.53C166.58,199,149.39,204,128,204Zm84-37.71a4,4,0,0,1-1,2.64,103.32,103.32,0,0,1-23,19v-55.4l24-12.8Zm-24.59-42.51a4,4,0,0,0-1.53-1.44l-56-29.87a4,4,0,0,0-3.76,7.06L179.5,128,128,155.47,16.5,96,128,36.53,239.5,96Z"}))]]),WB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.63,23.14a12,12,0,0,1,15-8A72.34,72.34,0,0,1,228.4,32a12,12,0,0,1-16.58,17.35,48.31,48.31,0,0,0-19.2-11.2A12,12,0,0,1,184.63,23.14ZM232.85,167.8A92,92,0,0,1,64.31,190l-40-69.32A32,32,0,0,1,36,77a31.72,31.72,0,0,1,7.54-3.14A32,32,0,0,1,88.65,32.45a32,32,0,0,1,53,3.55l14.53,25.17A32,32,0,0,1,206.35,68l17.31,30A91.38,91.38,0,0,1,232.85,167.8Zm-30-57.81L185.57,80a8,8,0,0,0-13.86,8h0l6.68,11.57a12,12,0,0,1-3.18,15.59,28,28,0,0,0-6.41,38.1,12,12,0,1,1-19.86,13.46,52.05,52.05,0,0,1,3.9-63.4L120.9,48A8,8,0,0,0,107,56l24.25,42a12,12,0,1,1-20.78,12L79.33,56a8,8,0,0,0-13.85,8L99,122a12,12,0,0,1-20.78,12L58.93,100.67a8,8,0,1,0-13.85,8L85.1,178a68,68,0,0,0,117.78-68ZM50.46,198a12,12,0,1,0-20.78,12,132.79,132.79,0,0,0,20,26.38,12,12,0,1,0,17.17-16.76A109.2,109.2,0,0,1,50.46,198Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,213.27A80,80,0,0,1,74.7,184l-40-69.32a20,20,0,0,1,34.64-20L55.08,70A20,20,0,0,1,89.73,50l6.92,12h0a20,20,0,0,1,34.64-20l30,52A20,20,0,0,1,196,74l17.31,30A80,80,0,0,1,184,213.27Z",opacity:"0.2"}),s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,98.46A88,88,0,1,1,67.08,186.77h0L26.15,115.88a16,16,0,0,1,27.69-16L72.4,132a8,8,0,0,0,13.86-8L47,56A16,16,0,0,1,74.69,40L114,108a8,8,0,1,0,13.85-8l-30-52a16,16,0,0,1,27.71-16L166,102.12A48.25,48.25,0,0,0,152,136a47.59,47.59,0,0,0,9.6,28.8,8,8,0,1,0,12.79-9.61A32,32,0,0,1,181,110.26a8,8,0,0,0,2.17-10.43L171.71,80a16,16,0,0,1,27.71-16l19.89,34.46Zm-29.37-57A43.74,43.74,0,0,1,216.74,62l.33.57a8,8,0,0,0,13.86-8L230.6,54a59.64,59.64,0,0,0-36.54-28,8,8,0,0,0-4.12,15.46ZM79.58,225.72A103.58,103.58,0,0,1,53.93,196a8,8,0,0,0-13.86,8,119.56,119.56,0,0,0,29.6,34.28,8,8,0,0,0,9.91-12.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.44,101,201.13,71a26,26,0,0,0-45.58,1L136.47,39a26,26,0,0,0-46.14,2.19A26,26,0,0,0,49.88,73l3.29,5.7a26,26,0,0,0-23.69,39L69.5,187a85.44,85.44,0,0,0,52.21,40.08,86.71,86.71,0,0,0,22.4,3,86,86,0,0,0,74.33-129Zm-3,62.16A74,74,0,0,1,79.89,181l-40-69.32a14,14,0,0,1,24.25-14L83.36,131a6,6,0,0,0,10.39-6L60.27,67A14,14,0,1,1,84.52,53l31.17,54a6,6,0,0,0,5.2,3,5.9,5.9,0,0,0,3-.81,6,6,0,0,0,2.2-8.2L101.83,59a14,14,0,0,1,24.25-14l34.2,59.23a46,46,0,0,0-6.4,59.13,6,6,0,0,0,9.94-6.73,34,34,0,0,1,7.76-46.26,6,6,0,0,0,1.6-7.8L166.49,91a14,14,0,1,1,24.25-14l17.31,30A73.53,73.53,0,0,1,215.44,163.14ZM186.18,32.22A6,6,0,0,1,193.52,28a57.59,57.59,0,0,1,35.32,27l.33.57a6,6,0,1,1-10.39,6l-.33-.57a45.69,45.69,0,0,0-28-21.43A6,6,0,0,1,186.18,32.22ZM79.32,235.71a6,6,0,0,1-8.42,1A117.79,117.79,0,0,1,41.79,203a6,6,0,0,1,10.4-6,105.48,105.48,0,0,0,26.14,30.29A6,6,0,0,1,79.32,235.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.71,102,199.4,72a24,24,0,0,0-43.57,4.52L134.74,40a24,24,0,0,0-43.69,4.9A24,24,0,0,0,51.61,72l5.31,9.19a24,24,0,0,0-25.71,35.47l40,69.32a83.4,83.4,0,0,0,51,39.14,84.45,84.45,0,0,0,21.88,2.9,84,84,0,0,0,72.6-126Zm.67,61.67A76,76,0,0,1,78.16,182l-40-69.32a16,16,0,0,1,27.71-16L85.09,130A4,4,0,0,0,92,126L58.54,68A16,16,0,1,1,86.25,52l31.17,54a4,4,0,1,0,6.93-4L100.1,60a16,16,0,0,1,27.72-16l35,60.63a44,44,0,0,0-7.28,57.61,4,4,0,1,0,6.62-4.49,36,36,0,0,1,8.22-49,4,4,0,0,0,1.07-5.2L164.76,92a16,16,0,1,1,27.71-16l17.31,30A75.52,75.52,0,0,1,217.38,163.65ZM188.12,32.74A4,4,0,0,1,193,29.9,55.65,55.65,0,0,1,227.11,56l.33.58A4,4,0,0,1,226,62a4,4,0,0,1-5.47-1.46l-.33-.57A47.62,47.62,0,0,0,191,37.63,4,4,0,0,1,188.12,32.74ZM77.75,234.48A4,4,0,0,1,74.61,236a4,4,0,0,1-2.47-.86A115.55,115.55,0,0,1,43.53,202a4,4,0,1,1,6.92-4,107.72,107.72,0,0,0,26.64,30.86A4,4,0,0,1,77.75,234.48Z"}))]]),KB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z",opacity:"0.2"}),s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z"}))]]),GB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V40A20,20,0,0,0,200,20Zm-4,192H60V44H196ZM84,68A12,12,0,0,1,96,56h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,68Zm8.8,127.37a48,48,0,0,1,70.4,0,12,12,0,0,0,17.6-16.32,72,72,0,0,0-19.21-14.68,44,44,0,1,0-67.19,0,72.12,72.12,0,0,0-19.2,14.68,12,12,0,0,0,17.6,16.32ZM128,116a20,20,0,1,1-20,20A20,20,0,0,1,128,116Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,32H56a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H200a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32ZM128,168a32,32,0,1,1,32-32A32,32,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24ZM96,48h64a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16Zm84.81,150.4a8,8,0,0,1-11.21-1.6,52,52,0,0,0-83.2,0,8,8,0,1,1-12.8-9.6A67.88,67.88,0,0,1,101,165.51a40,40,0,1,1,53.94,0A67.88,67.88,0,0,1,182.4,187.2,8,8,0,0,1,180.81,198.4ZM152,136a24,24,0,1,1-24-24A24,24,0,0,1,152,136Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M151.11,166.13a38,38,0,1,0-46.22,0A65.75,65.75,0,0,0,75.2,188.4a6,6,0,0,0,9.6,7.2,54,54,0,0,1,86.4,0,6,6,0,0,0,9.6-7.2A65.75,65.75,0,0,0,151.11,166.13ZM128,110a26,26,0,1,1-26,26A26,26,0,0,1,128,110Zm72-84H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V40A14,14,0,0,0,200,26Zm2,190a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2ZM90,64a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H96A6,6,0,0,1,90,64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M146.7,166.75a36,36,0,1,0-37.4,0A63.61,63.61,0,0,0,76.8,189.6a4,4,0,0,0,6.4,4.8,56,56,0,0,1,89.6,0,4,4,0,0,0,6.4-4.8A63.65,63.65,0,0,0,146.7,166.75ZM100,136a28,28,0,1,1,28,28A28,28,0,0,1,100,136ZM200,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Zm4,188a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4ZM92,64a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Z"}))]]),YB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v63.72L186.14,97.86a20,20,0,0,0-28.28,0L52,203.72V52ZM85.66,204,172,117.66l32,32V204ZM76,96a20,20,0,1,1,20,20A20,20,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40H48a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h8.69L166.34,106.34a8,8,0,0,1,11.32,0L216,144.69V48A8,8,0,0,0,208,40ZM96,112a16,16,0,1,1,16-16A16,16,0,0,1,96,112Z",opacity:"0.2"}),s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM80,96a16,16,0,1,1,16,16A16,16,0,0,1,80,96Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2v82.2l-28.1-28.1a14,14,0,0,0-19.8,0L54.2,210H48A2,2,0,0,1,46,208Zm162,2H71.17l99.41-99.41a2,2,0,0,1,2.83,0L210,147.17V208A2,2,0,0,1,208,210ZM96,118A22,22,0,1,0,74,96,22,22,0,0,0,96,118Zm0-32A10,10,0,1,1,86,96,10,10,0,0,1,96,86Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4v87l-31.51-31.52a12,12,0,0,0-17,0L55,212H48A4,4,0,0,1,44,208Zm164,4H66.34L169.17,109.17a4,4,0,0,1,5.66,0L212,146.34V208A4,4,0,0,1,208,212ZM96,116A20,20,0,1,0,76,96,20,20,0,0,0,96,116Zm0-32A12,12,0,1,1,84,96,12,12,0,0,1,96,84Z"}))]]),qB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,128a60,60,0,0,1-102.43,42.43l-.49-.53L89.22,102.31a36,36,0,1,0,0,51.38l3.08-3.48a12,12,0,1,1,18,15.91l-3.35,3.78-.49.53a60,60,0,1,1,0-84.86l.49.53,59.86,67.59a36,36,0,1,0,0-51.38l-3.08,3.48a12,12,0,1,1-18-15.91l3.35-3.78.49-.53A60,60,0,0,1,252,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.94,161.94a48,48,0,0,1-67.88,0L128,128l30.06-33.94a48,48,0,0,1,67.88,67.88ZM30.06,94.06a48,48,0,0,0,67.88,67.88L128,128,97.94,94.06A48,48,0,0,0,30.06,94.06Z",opacity:"0.2"}),s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM204.28,156.28a40,40,0,0,1-56.4.17L97.29,111.34,97,111A24,24,0,1,0,97,145c.36-.36.71-.73,1-1.1a8,8,0,1,1,12,10.6c-.55.62-1.13,1.23-1.71,1.81a40,40,0,1,1-.17-56.73l50.58,45.11.33.31A24,24,0,1,0,159,111c-.36.36-.7.72-1,1.1a8,8,0,0,1-12-10.59c.54-.62,1.12-1.24,1.71-1.82a40,40,0,0,1,56.57,56.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,128a54,54,0,0,1-92.18,38.18,3.07,3.07,0,0,1-.25-.26l-60-67.74a42,42,0,1,0,0,59.64l8.57-9.67a6,6,0,1,1,9,8l-8.69,9.81a3.07,3.07,0,0,1-.25.26,54,54,0,1,1,0-76.36,3.07,3.07,0,0,1,.25.26l60,67.74a42,42,0,1,0,0-59.64l-8.57,9.67a6,6,0,1,1-9-8l8.69-9.81a3.07,3.07,0,0,1,.25-.26A54,54,0,0,1,246,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,128a52,52,0,0,1-88.77,36.77l-.17-.18L95,96.8a44,44,0,1,0,0,62.4l8.6-9.72a4,4,0,0,1,6,5.3l-8.68,9.81-.17.18a52,52,0,1,1,0-73.54l.17.18,60,67.79a44,44,0,1,0,0-62.4l-8.6,9.72a4,4,0,0,1-6-5.3l8.68-9.81.17-.18A52,52,0,0,1,244,128Z"}))]]),XB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),QB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z",opacity:"0.2"}),s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z"}))]]),JB=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z"}))]]),eU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),tU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),s.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),nU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,120a52.06,52.06,0,0,0-52-52H160.32c-3.44-.21-52.6-4-99.46-43.3A20,20,0,0,0,28,40V200a19.8,19.8,0,0,0,11.54,18.12,19.86,19.86,0,0,0,21.32-2.81A192.92,192.92,0,0,1,144,174.47v26.2a20,20,0,0,0,8.9,16.64,11.35,11.35,0,0,0,1.39.8l14.44,7.06A20,20,0,0,0,198.37,213l11.09-41.82A52.07,52.07,0,0,0,252,120ZM52,191.63V48.4c36.17,28.07,72.17,38.1,92,41.66V150C124.17,153.52,88.17,163.55,52,191.63ZM176.39,202.2,168,198.1V172h16.4ZM200,148H168V92h32a28,28,0,1,1,0,56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,120a40,40,0,0,1-40,40H160V80h40A40,40,0,0,1,240,120Z",opacity:"0.2"}),s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,72H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48,48,0,0,0,200,72ZM179,207.89l0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,120a46.05,46.05,0,0,0-46-46H160.15c-2.58-.15-54.1-3.57-103.15-44.71A14,14,0,0,0,34,40V200a13.85,13.85,0,0,0,8.07,12.68A14.16,14.16,0,0,0,48,214a13.9,13.9,0,0,0,9-3.3c40-33.52,81.57-42,97-44.07v34a14,14,0,0,0,6.23,11.65l11,7.33a14,14,0,0,0,21.32-8.17l12.13-45.71A46.07,46.07,0,0,0,246,120ZM49.29,201.52A2,2,0,0,1,46,200V40a1.9,1.9,0,0,1,1.15-1.8A2.08,2.08,0,0,1,48,38a1.91,1.91,0,0,1,1.26.48c44,36.92,89,45.19,104.71,47v69C138.29,156.33,93.3,164.61,49.29,201.52Zm131.64,7a2,2,0,0,1-3.05,1.18l-11-7.33a2,2,0,0,1-.89-1.67V166h26.2ZM200,154H166V86h34a34,34,0,1,1,0,68Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,76H160.1c-2.19-.11-54.55-3.38-104.38-45.17A12,12,0,0,0,36,40V200a11.88,11.88,0,0,0,6.92,10.87A12.18,12.18,0,0,0,48,212a11.93,11.93,0,0,0,7.69-2.83c42.46-35.62,86.76-43.25,100.28-44.8v36.29a12,12,0,0,0,5.34,10l11,7.33a12,12,0,0,0,18.28-7l12.49-47.09A44,44,0,0,0,200,76Zm-44,80.3c-13.53,1.35-60,8.62-105.42,46.75A4,4,0,0,1,44,200V40a4,4,0,0,1,2.3-3.62A4.32,4.32,0,0,1,48.05,36a3.88,3.88,0,0,1,2.53,1C96,75.09,142.47,82.36,156,83.71ZM182.87,209a4,4,0,0,1-6.1,2.36l-11-7.33a4,4,0,0,1-1.78-3.33V164h30.8ZM200,156H164V84h36a36,36,0,0,1,0,72Z"}))]]),rU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),sU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,80a32,32,0,1,0-32-32A32,32,0,0,0,160,80Zm0-40a8,8,0,1,1-8,8A8,8,0,0,1,160,40Zm94.32,153.88L199.76,101.8A19.85,19.85,0,0,0,182.55,92h0a19.83,19.83,0,0,0-17.2,9.8l-18.7,31.55-37.42-63.5a20,20,0,0,0-34.46,0L1.66,193.91A12,12,0,0,0,12,212H244a12,12,0,0,0,10.32-18.12ZM92,87.87,108.57,116H75.43ZM33,188l28.28-48h61.44L151,188Zm145.86,0L160.56,157l22-37.1L222.94,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,52a20,20,0,1,1,20,20A20,20,0,0,1,144,52Zm49.44,55.92a8,8,0,0,0-13.77,0l-33,55.75-21-35.67H50.35L8,200H248Z",opacity:"0.2"}),s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l33,56Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254.88,195.92l-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84l-15.64,26.39a4,4,0,0,0,0,4.07l26.8,45.47a8.13,8.13,0,0,1-1.89,10.55,8,8,0,0,1-11.8-2.26L101.79,71.88a16,16,0,0,0-27.58,0L1.11,195.94a8,8,0,0,0,1,9.52A8.23,8.23,0,0,0,8.23,208H247.77a8.29,8.29,0,0,0,6.09-2.55A8,8,0,0,0,254.88,195.92ZM64.43,120,88,80l23.57,40ZM140,52a24,24,0,1,1,24,24A24,24,0,0,1,140,52Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,78a26,26,0,1,0-26-26A26,26,0,0,0,164,78Zm0-40a14,14,0,1,1-14,14A14,14,0,0,1,164,38Zm89.16,158.94L198.6,104.86a13.9,13.9,0,0,0-12-6.86h0a13.88,13.88,0,0,0-12,6.86l-27.88,47.05-46.56-79a14,14,0,0,0-24.13,0L2.83,197A6,6,0,0,0,8,206H248a6,6,0,0,0,5.16-9.06ZM86.27,79a2,2,0,0,1,3.46,0l25.34,43H60.93ZM18.5,194l35.36-60h68.29l19.3,32.77,0,0,16,27.2Zm152.93,0-17.85-30.29L184.83,111a2,2,0,0,1,1.72-1,1.93,1.93,0,0,1,1.72,1l49.2,83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l18.74,31.8,0,0L154,192Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,76a24,24,0,1,0-24-24A24,24,0,0,0,164,76Zm0-40a16,16,0,1,1-16,16A16,16,0,0,1,164,36Zm87.44,162-54.56-92.08A11.91,11.91,0,0,0,186.55,100h0a11.89,11.89,0,0,0-10.32,5.88l-29.61,50L98.34,73.91a12,12,0,0,0-20.68,0L4.55,198A4,4,0,0,0,8,204H248a4,4,0,0,0,3.44-6ZM84.55,78a4,4,0,0,1,6.9,0l27.12,46H57.43ZM15,196l37.71-64h70.58L161,196Zm155.29,0-19-32.29L183.11,110a4,4,0,0,1,6.88,0l51,86Z"}))]]),aU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,178.57,87.73l-72-39.42Zm0,78.83L56,76,81.56,62l72,39.41ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l24-13.13V152a12,12,0,0,0,24,0V109.92l24-13.13v76.65Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,.7-3.25Z",opacity:"0.2"}),s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,178.57,94.57,94.05,48.31ZM122,223,39,177.57a2,2,0,0,1-1-1.75V86.66l84,46ZM43.49,76,81.56,55.15l84.51,46.26L128,122.24ZM218,175.82a2,2,0,0,1-1,1.75h0L134,223V132.64l36-19.71V152a6,6,0,0,0,12,0V106.37l36-19.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,178.5,96.89a4,4,0,0,0-.58-.4l-88-48.18Zm1.92,96L39.33,76,81.56,52.87l88.67,48.54Zm-89.92,54.8a4,4,0,0,1-2.08-3.5V83.29l88,48.16v94.91Zm179.84,0h0l-85.92,47V131.45l40-21.89V152a4,4,0,0,0,8,0V105.18l40-21.89v92.53A4,4,0,0,1,217.92,179.32Z"}))]]),oU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),iU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]),lU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),cU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),uU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),dU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z"}))]]),fU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116,128V48a12,12,0,0,1,24,0v80a12,12,0,0,1-24,0Zm66.55-82a12,12,0,0,0-13.1,20.1C191.41,80.37,204,103,204,128a76,76,0,0,1-152,0c0-25,12.59-47.63,34.55-61.95A12,12,0,0,0,73.45,46C44.56,64.78,28,94.69,28,128a100,100,0,0,0,200,0C228,94.69,211.44,64.78,182.55,46Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm-8,40a8,8,0,0,1,16,0v64a8,8,0,0,1-16,0Zm8,144A80,80,0,0,1,83.55,61.48a8,8,0,1,1,8.9,13.29,64,64,0,1,0,71.1,0,8,8,0,1,1,8.9-13.29A80,80,0,0,1,128,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M122,128V48a6,6,0,0,1,12,0v80a6,6,0,0,1-12,0Zm57.28-77A6,6,0,0,0,172.72,61C196.41,76.47,210,100.88,210,128a82,82,0,0,1-164,0c0-27.12,13.59-51.53,37.28-67A6,6,0,0,0,76.72,51C49.57,68.68,34,96.75,34,128a94,94,0,0,0,188,0C222,96.75,206.43,68.68,179.28,51Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M124,128V48a4,4,0,0,1,8,0v80a4,4,0,0,1-8,0Zm54.18-75.35a4,4,0,1,0-4.36,6.7C198.08,75.17,212,100.2,212,128a84,84,0,0,1-168,0c0-27.8,13.92-52.83,38.18-68.65a4,4,0,0,0-4.36-6.7C51.24,70,36,97.44,36,128a92,92,0,0,0,184,0C220,97.44,204.76,70,178.18,52.65Z"}))]]),hU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),pU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),mU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z",opacity:"0.2"}),s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z"}))]]),gU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),s.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),s.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),vU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z"}))]]),wU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,96a12,12,0,0,0-.44-3.3L221.2,42.51A20.08,20.08,0,0,0,202,28H54A20.08,20.08,0,0,0,34.8,42.51L20.46,92.7A12,12,0,0,0,20,96h0v16a43.94,43.94,0,0,0,16,33.92V216a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V145.92A43.94,43.94,0,0,0,236,112V96ZM57.05,52H199l9.14,32H47.91Zm91,56v4a20,20,0,0,1-40,0v-4ZM53,128.71A20,20,0,0,1,44,112v-4H84v4a20,20,0,0,1-20,20,19.76,19.76,0,0,1-9.07-2.2A11.54,11.54,0,0,0,53,128.71ZM196,204H60V155.81c1.32.12,2.65.19,4,.19a43.86,43.86,0,0,0,32-13.85,43.89,43.89,0,0,0,64,0A43.86,43.86,0,0,0,192,156c1.35,0,2.68-.07,4-.19Zm16-92a20,20,0,0,1-9,16.71,11.66,11.66,0,0,0-1.88,1.09A20,20,0,0,1,172,112v-4h40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,96v16a32,32,0,0,1-64,0V96H96v16a32,32,0,0,1-64,0V96L46.34,45.8A8,8,0,0,1,54,40H202a8,8,0,0,1,7.69,5.8Z",opacity:"0.2"}),s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM54,48H202l11.42,40H42.61Zm98,56v8a24,24,0,0,1-48,0v-8ZM51.06,132.2A24,24,0,0,1,40,112v-8H88v8a24,24,0,0,1-35.12,21.26A7.88,7.88,0,0,0,51.06,132.2ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm16-96a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM88,112a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8H88Zm64,0a24,24,0,0,1-48,0v-8h48Zm64,0a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M26.22,94.41A6,6,0,0,0,26,96v16A38,38,0,0,0,42,143V216a6,6,0,0,0,6,6H208a6,6,0,0,0,6-6V143A38,38,0,0,0,230,112V96a5.91,5.91,0,0,0-.23-1.64L215.43,44.15A14.07,14.07,0,0,0,202,34H54A14.07,14.07,0,0,0,40.57,44.15Zm25.89-47A2,2,0,0,1,54,46H202a2,2,0,0,1,1.92,1.45L216.05,90H40ZM102,102h52v10a26,26,0,0,1-52,0Zm-64,0H90v10a26,26,0,0,1-38.18,23,6,6,0,0,0-1.65-1A26,26,0,0,1,38,112ZM202,210H54V148.66a38,38,0,0,0,42-16.21,37.95,37.95,0,0,0,64,0,38,38,0,0,0,42,16.21Zm3.83-76a6,6,0,0,0-1.65,1A26,26,0,0,1,166,112V102h52v10A26,26,0,0,1,205.83,134Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,96a7.89,7.89,0,0,0-.3-2.2L217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.8A7.89,7.89,0,0,0,24,96h0v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96ZM54,48H202l11.42,40H42.61Zm50,56h48v8a24,24,0,0,1-48,0Zm-16,0v8a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm4.93-75.8a8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48v8A24,24,0,0,1,204.93,132.2Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M28.15,95A3.81,3.81,0,0,0,28,96v16a36,36,0,0,0,16,29.92V216a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V141.92A36,36,0,0,0,228,112V96a3.81,3.81,0,0,0-.17-1.08L213.5,44.7A12,12,0,0,0,202,36H54A12,12,0,0,0,42.5,44.7Zm22-48.08A4,4,0,0,1,54,44H202a4,4,0,0,1,3.84,2.9L218.7,92H37.3ZM100,100h56v12a28,28,0,0,1-56,0ZM36,112V100H92v12a28,28,0,0,1-41.37,24.59,4,4,0,0,0-1.31-.76A28,28,0,0,1,36,112ZM204,212H52V145.94a36,36,0,0,0,44-17.48,36,36,0,0,0,64,0,36,36,0,0,0,44,17.48Zm2.68-76.17a3.94,3.94,0,0,0-1.3.76A28,28,0,0,1,164,112V100h56v12A28,28,0,0,1,206.68,135.83Z"}))]]),yU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,148H203.89c.07-1.33.11-2.66.11-4a76,76,0,0,0-152,0c0,1.34,0,2.67.11,4H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM76,144a52,52,0,0,1,104,0c0,1.34-.07,2.67-.17,4H76.17C76.07,146.67,76,145.34,76,144Zm144,56a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24H208A12,12,0,0,1,220,200ZM12.62,92.21a12,12,0,0,1,15.17-7.59l12,4a12,12,0,1,1-7.58,22.77l-12-4A12,12,0,0,1,12.62,92.21Zm56-48.41a12,12,0,1,1,22.76-7.59l4,12A12,12,0,1,1,72.62,55.8Zm140,60a12,12,0,0,1,7.59-15.18l12-4a12,12,0,0,1,7.58,22.77l-12,4a12,12,0,0,1-15.17-7.59Zm-48-55.59,4-12a12,12,0,1,1,22.76,7.59l-4,12a12,12,0,1,1-22.76-7.59Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,144a64.33,64.33,0,0,1-2,16H66a64,64,0,1,1,126-16Z",opacity:"0.2"}),s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,160a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H56.45a73.54,73.54,0,0,1-.45-8,72,72,0,0,1,144,0,73.54,73.54,0,0,1-.45,8H240A8,8,0,0,1,248,160Zm-40,32H48a8,8,0,0,0,0,16H208a8,8,0,0,0,0-16ZM80.84,59.58a8,8,0,0,0,14.32-7.16l-8-16a8,8,0,0,0-14.32,7.16ZM20.42,103.16l16,8a8,8,0,1,0,7.16-14.31l-16-8a8,8,0,1,0-7.16,14.31ZM216,112a8,8,0,0,0,3.57-.84l16-8a8,8,0,1,0-7.16-14.31l-16,8A8,8,0,0,0,216,112ZM164.42,63.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.32-7.16l-8,16A8,8,0,0,0,164.42,63.16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,154H197.28a70.91,70.91,0,0,0,.72-10,70,70,0,0,0-140,0,70.91,70.91,0,0,0,.72,10H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM70,144a58,58,0,1,1,115.13,10H70.87A58.63,58.63,0,0,1,70,144Zm144,56a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12H208A6,6,0,0,1,214,200ZM74.63,42.69a6,6,0,0,1,10.74-5.37l8,16a6,6,0,0,1-10.74,5.36Zm-56,50.63a6,6,0,0,1,8.05-2.69l16,8a6,6,0,0,1-5.36,10.74l-16-8A6,6,0,0,1,18.63,93.32Zm192,13.36a6,6,0,0,1,2.69-8.05l16-8a6,6,0,1,1,5.36,10.74l-16,8a6,6,0,0,1-8.05-2.69Zm-48-53.36,8-16a6,6,0,0,1,10.74,5.37l-8,16a6,6,0,1,1-10.74-5.36Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,156H194.94A68,68,0,1,0,60,144a68.73,68.73,0,0,0,1.06,12H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM68,144a60,60,0,1,1,118.79,12H69.21A60.16,60.16,0,0,1,68,144Zm144,56a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8H208A4,4,0,0,1,212,200ZM76.42,41.79a4,4,0,0,1,7.16-3.58l8,16a4,4,0,0,1-7.16,3.58Zm-56,52.42a4,4,0,0,1,5.37-1.79l16,8a4,4,0,0,1-3.58,7.16l-16-8A4,4,0,0,1,20.42,94.21Zm192,11.58a4,4,0,0,1,1.79-5.37l16-8a4,4,0,1,1,3.58,7.16l-16,8a4,4,0,0,1-5.37-1.79Zm-48-51.58,8-16a4,4,0,1,1,7.16,3.58l-8,16a4,4,0,0,1-7.16-3.58Z"}))]]),bU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),xU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),kU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0ZM96.49,80.49,116,61v83a12,12,0,0,0,24,0V61l19.51,19.52a12,12,0,1,0,17-17l-40-40a12,12,0,0,0-17,0l-40,40a12,12,0,1,0,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM88,80h32v64a8,8,0,0,0,16,0V80h32a8,8,0,0,0,5.66-13.66l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,88,80Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0ZM92.24,76.24,122,46.49V144a6,6,0,0,0,12,0V46.49l29.76,29.75a6,6,0,0,0,8.48-8.48l-40-40a6,6,0,0,0-8.48,0l-40,40a6,6,0,0,0,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0ZM90.83,74.83,124,41.66V144a4,4,0,0,0,8,0V41.66l33.17,33.17a4,4,0,1,0,5.66-5.66l-40-40a4,4,0,0,0-5.66,0l-40,40a4,4,0,0,0,5.66,5.66Z"}))]]),SU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),EU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20ZM79.57,196.57a60,60,0,0,1,96.86,0,83.72,83.72,0,0,1-96.86,0ZM100,120a28,28,0,1,1,28,28A28,28,0,0,1,100,120ZM194,179.94a83.48,83.48,0,0,0-29-23.42,52,52,0,1,0-74,0,83.48,83.48,0,0,0-29,23.42,84,84,0,1,1,131.9,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26ZM71.44,198a66,66,0,0,1,113.12,0,89.8,89.8,0,0,1-113.12,0ZM94,120a34,34,0,1,1,34,34A34,34,0,0,1,94,120Zm99.51,69.64a77.53,77.53,0,0,0-40-31.38,46,46,0,1,0-51,0,77.53,77.53,0,0,0-40,31.38,90,90,0,1,1,131,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28ZM68.87,198.42a68,68,0,0,1,118.26,0,91.8,91.8,0,0,1-118.26,0Zm124.3-5.55a75.61,75.61,0,0,0-44.51-34,44,44,0,1,0-41.32,0,75.61,75.61,0,0,0-44.51,34,92,92,0,1,1,130.34,0ZM128,156a36,36,0,1,1,36-36A36,36,0,0,1,128,156Z"}))]]),CU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z",opacity:"0.2"}),s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z"}))]]),jU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),AU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),NU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),MU=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),RU=s.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),kt=s.forwardRef((e,t)=>{const{alt:n,color:r,size:a,weight:i,mirrored:l,children:u,weights:f,...h}=e,{color:p="currentColor",size:g,weight:v="regular",mirrored:w=!1,...y}=s.useContext(RU);return s.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a??g,height:a??g,fill:r??p,viewBox:"0 0 256 256",transform:l||w?"scale(-1, 1)":void 0,...y,...h},!!n&&s.createElement("title",null,n),u,f.get(i??v))});kt.displayName="IconBase";const Y7=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:dB}));Y7.displayName="ApertureIcon";const q7=Y7,X7=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:fB}));X7.displayName="ArchiveIcon";const Op=X7,Q7=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:hB}));Q7.displayName="ArrowCircleUpIcon";const J7=Q7,eC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:pB}));eC.displayName="ArrowClockwiseIcon";const tC=eC,nC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:mB}));nC.displayName="ArrowCounterClockwiseIcon";const M0=nC,rC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:gB}));rC.displayName="ArrowLeftIcon";const av=rC,sC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:vB}));sC.displayName="ArrowLineUpIcon";const PU=sC,aC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:wB}));aC.displayName="ArrowRightIcon";const Pa=aC,oC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:yB}));oC.displayName="ArrowSquareOutIcon";const gf=oC,iC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:bB}));iC.displayName="ArrowUpIcon";const lC=iC,cC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:xB}));cC.displayName="ArrowsClockwiseIcon";const Ph=cC,uC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:kB}));uC.displayName="ArrowsDownUpIcon";const LU=uC,dC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:SB}));dC.displayName="BellIcon";const Sg=dC,fC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:EB}));fC.displayName="CaretDownIcon";const Yi=fC,hC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:CB}));hC.displayName="CaretLeftIcon";const ga=hC,pC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:jB}));pC.displayName="CaretRightIcon";const ol=pC,mC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:AB}));mC.displayName="CaretUpIcon";const TU=mC,gC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:NB}));gC.displayName="ChartBarIcon";const $U=gC,vC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:MB}));vC.displayName="CheckIcon";const Kn=vC,wC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:RB}));wC.displayName="CircleIcon";const DU=wC,yC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:PB}));yC.displayName="CircleHalfIcon";const HU=yC,bC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:LB}));bC.displayName="CopyIcon";const Lh=bC,xC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:TB}));xC.displayName="CopySimpleIcon";const G3=xC,kC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:$B}));kC.displayName="DeviceMobileIcon";const OU=kC,SC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:DB}));SC.displayName="DotsThreeIcon";const EC=SC,CC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:HB}));CC.displayName="DotsThreeVerticalIcon";const jC=CC,AC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:OB}));AC.displayName="DownloadSimpleIcon";const NC=AC,MC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:IB}));MC.displayName="FilmSlateIcon";const Ip=MC,RC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:FB}));RC.displayName="FolderSimpleIcon";const ov=RC,PC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:_B}));PC.displayName="FolderSimpleMinusIcon";const LC=PC,TC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:ZB}));TC.displayName="FrameCornersIcon";const $C=TC,DC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:VB}));DC.displayName="GearSixIcon";const IU=DC,HC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:zB}));HC.displayName="GiftIcon";const FU=HC,OC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:BB}));OC.displayName="GithubLogoIcon";const _U=OC,IC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:UB}));IC.displayName="GraduationCapIcon";const ZU=IC,FC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:WB}));FC.displayName="HandWavingIcon";const VU=FC,_C=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:KB}));_C.displayName="HouseIcon";const zU=_C,ZC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:GB}));ZC.displayName="IdentificationBadgeIcon";const Fp=ZC,VC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:YB}));VC.displayName="ImageSquareIcon";const Ws=VC,zC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:qB}));zC.displayName="InfinityIcon";const BC=zC,UC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:XB}));UC.displayName="InfoIcon";const _p=UC,WC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:QB}));WC.displayName="KeyIcon";const KC=WC,GC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:JB}));GC.displayName="KeyboardIcon";const BU=GC,YC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:eU}));YC.displayName="LightningIcon";const R0=YC,qC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:tU}));qC.displayName="MagnifyingGlassIcon";const Fu=qC,XC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:nU}));XC.displayName="MegaphoneIcon";const UU=XC,QC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:rU}));QC.displayName="MinusIcon";const WU=QC,JC=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:sU}));JC.displayName="MountainsIcon";const KU=JC,ej=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:aU}));ej.displayName="PackageIcon";const Zp=ej,tj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:oU}));tj.displayName="PaletteIcon";const GU=tj,nj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:iU}));nj.displayName="PaperclipIcon";const YU=nj,rj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:lU}));rj.displayName="PencilSimpleIcon";const Ju=rj,sj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:cU}));sj.displayName="PencilSimpleLineIcon";const qU=sj,aj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:uU}));aj.displayName="PlusIcon";const cr=aj,oj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:dU}));oj.displayName="PlusCircleIcon";const XU=oj,ij=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:fU}));ij.displayName="PowerIcon";const QU=ij,lj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:hU}));lj.displayName="QuestionIcon";const JU=lj,cj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:pU}));cj.displayName="SidebarSimpleIcon";const eW=cj,uj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:mU}));uj.displayName="SlidersHorizontalIcon";const iv=uj,dj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:gU}));dj.displayName="StackIcon";const fj=dj,hj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:vU}));hj.displayName="StarIcon";const po=hj,pj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:wU}));pj.displayName="StorefrontIcon";const mj=pj,gj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:yU}));gj.displayName="SunHorizonIcon";const vj=gj,wj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:bU}));wj.displayName="TrashIcon";const il=wj,yj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:xU}));yj.displayName="TrashSimpleIcon";const Vp=yj,bj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:kU}));bj.displayName="UploadSimpleIcon";const lv=bj,xj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:SU}));xj.displayName="UserIcon";const tW=xj,kj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:EU}));kj.displayName="UserCircleIcon";const nW=kj,Sj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:CU}));Sj.displayName="UserPlusIcon";const rW=Sj,Ej=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:jU}));Ej.displayName="WarningIcon";const zp=Ej,Cj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:AU}));Cj.displayName="WarningCircleIcon";const kc=Cj,jj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:NU}));jj.displayName="XIcon";const jn=jj,Aj=s.forwardRef((e,t)=>s.createElement(kt,{ref:t,...e,weights:MU}));Aj.displayName="XCircleIcon";const sW=Aj,Nj=s.createContext({push:()=>{}}),or=()=>s.useContext(Nj),aW=3,oW=140,f0=e=>{var t;return!!(e.action||(t=e.actions)!=null&&t.length)},iW=e=>{var t;return((t=e.actions)!=null&&t.length?e.actions:e.action?[e.action]:[]).slice(0,2)};function Eg(e){var a;if(e.kind==="error")return 1/0;const t=e.title.length+(((a=e.detail)==null?void 0:a.length)??0),n=f0(e)?9e3:4e3,r=f0(e)?14e3:8e3;return Math.min(n+Math.max(0,t-40)*45,r)}function lW(e,t,n){const r=n>1?` (${n} times)`:"";return`${e}${r}${t?` ${t}`:""}`}const cW=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function uW({kind:e}){if(e==="info")return null;const t=e==="success"?Kn:e==="warning"?zp:kc;return o.jsx(t,{className:"sc-toast-ic",size:16,weight:"regular","aria-hidden":"true"})}function dW({children:e}){const[t,n]=s.useState([]),r=s.useRef(1),a=s.useRef([]),i=s.useRef(new Map),l=s.useRef(null),u=s.useRef(null),f=s.useRef(null),h=s.useRef(new Map),p=s.useCallback(E=>{a.current=E,n(E)},[]),g=s.useCallback(E=>{const j=E.kind==="error"?u.current:l.current;if(!j)return;const N=lW(E.title,E.detail,E.count);j.textContent=N,window.setTimeout(()=>{j.textContent===N&&(j.textContent="")},1e3)},[]),v=s.useCallback(E=>{const j=i.current.get(E);(j==null?void 0:j.handle)!=null&&window.clearTimeout(j.handle),i.current.delete(E),p(a.current.map(N=>N.id===E&&!N.leaving?{...N,leaving:!0}:N)),window.setTimeout(()=>p(a.current.filter(N=>N.id!==E)),oW+40)},[p]),w=s.useCallback((E,j)=>{if(!Number.isFinite(j))return;const N=i.current.get(E)??{remaining:j,since:0,handle:null};N.handle!=null&&window.clearTimeout(N.handle),N.remaining=j,N.since=Date.now(),N.handle=window.setTimeout(()=>v(E),j),i.current.set(E,N)},[v]),y=s.useCallback(E=>{const j=i.current.get(E);!j||j.handle==null||(window.clearTimeout(j.handle),j.handle=null,j.remaining=Math.max(0,j.remaining-(Date.now()-j.since)))},[]),x=s.useCallback(E=>{const j=i.current.get(E);!j||j.handle!=null||w(E,j.remaining)},[w]);s.useEffect(()=>{const E=()=>{const j=[...i.current.keys()];document.hidden?j.forEach(y):j.forEach(x)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[y,x]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const j=new Map,N=!cW();for(const P of E.querySelectorAll("[data-toast-id]")){const $=Number(P.dataset.toastId),M=P.getBoundingClientRect().top;j.set($,M);const C=h.current.get($);if(!N||C===void 0||P.hasAttribute("data-leaving"))continue;const R=C-M;R&&(P.style.transition="none",P.style.transform=`translateY(${R}px)`,P.getBoundingClientRect(),P.style.transition="transform 160ms cubic-bezier(.2, .7, .3, 1)",P.style.transform="")}h.current=j},[t]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const j=()=>{const $=document.querySelector(".sc-canvas-dock");if(!$||!t.length){delete E.dataset.overDock;return}const M=E.getBoundingClientRect(),C=$.getBoundingClientRect();M.left<C.right&&C.left<M.right?(E.style.setProperty("--sc-toasts-over-dock",`${Math.round(window.innerHeight-C.top+10)}px`),E.dataset.overDock=""):delete E.dataset.overDock};j(),window.addEventListener("resize",j);const N=document.querySelector(".sc-canvas-dock"),P=typeof ResizeObserver>"u"||!N?null:new ResizeObserver(j);return P==null||P.observe(N),()=>{window.removeEventListener("resize",j),P==null||P.disconnect()}},[t]);const k=s.useCallback(E=>{const j=a.current.filter(C=>!C.leaving),N=f0(E)?void 0:j.find(C=>C.kind===E.kind&&C.title===E.title&&C.detail===E.detail&&!f0(C));if(N){const C={...N,count:N.count+1};p(a.current.map(T=>T.id===N.id?C:T));const R=i.current.get(N.id);R&&R.handle==null?R.remaining=Eg(C):w(N.id,Eg(C)),C.quiet||g(C);return}const P={...E,id:r.current++,count:1},$=[...a.current,P],M=C=>!C.leaving;for(;$.filter(M).length>aW;){let C=$.findIndex(H=>M(H)&&H.kind!=="error"&&!f0(H));C===-1&&(C=$.findIndex(H=>M(H)&&H.kind!=="error")),C===-1&&(C=$.findIndex(M));const R=$.splice(C,1)[0],T=i.current.get(R.id);(T==null?void 0:T.handle)!=null&&window.clearTimeout(T.handle),i.current.delete(R.id)}p($),w(P.id,Eg(P)),P.quiet||g(P)},[g,w,p]),S=s.useMemo(()=>({push:k}),[k]);return s.useEffect(()=>{if(typeof localStorage<"u"&&localStorage.getItem("scenri:toast-probe"))return window.__scenriToast=k,()=>{delete window.__scenriToast}},[k]),o.jsxs(Nj.Provider,{value:S,children:[e,Rr.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:l,className:"sc-vh",role:"status","aria-live":"polite"}),o.jsx("div",{ref:u,className:"sc-vh","aria-live":"assertive","aria-atomic":"true"}),o.jsx("section",{className:"sc-toasts","aria-label":"Alerts",ref:f,onPointerDown:Y3,onMouseDown:Y3,children:t.map(E=>{const j=iW(E);return o.jsx("div",{className:"sc-toast-wrap","data-toast-id":E.id,"data-leaving":E.leaving||void 0,children:o.jsxs("article",{className:"sc-toast","data-kind":E.kind,onPointerEnter:()=>y(E.id),onPointerLeave:()=>x(E.id),onFocus:()=>y(E.id),onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||x(E.id)},children:[o.jsx(uW,{kind:E.kind}),o.jsxs("div",{className:"sc-toast-body",children:[o.jsxs("div",{className:"sc-toast-top",children:[o.jsxs("div",{className:"sc-toast-txt",children:[o.jsxs("b",{children:[E.title,E.count>1?o.jsxs("span",{className:"sc-toast-n",children:["×",E.count]}):null]}),E.detail?o.jsx("small",{children:E.detail.slice(0,160)}):null]}),o.jsx("button",{type:"button",className:"sc-toast-x",onClick:()=>v(E.id),"aria-label":"Dismiss",children:o.jsx(jn,{size:14,weight:"regular"})})]}),j.length?o.jsx("div",{className:"sc-toast-acts",children:j.map(N=>o.jsx("button",{type:"button",className:"sc-toast-act",onClick:()=>{N.onClick(),v(E.id)},children:N.label},N.label))}):null]})]})},E.id)})})]}),document.body)]})}function Y3(e){e.stopPropagation(),e.type==="mousedown"&&e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()}async function qe(e,t,n,r,a){const i=await fetch(t,{method:e,signal:r,keepalive:a==null?void 0:a.keepalive,headers:n!==void 0?{"content-type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){let l=`HTTP ${i.status}`;try{const u=await i.json();l=u.error??l,u.details&&(l+=`: ${u.details.join("; ")}`)}catch{}throw Object.assign(new Error(l),{status:i.status,method:e,url:t})}return i.json()}const fW=(e,t,n)=>qe("DELETE",`/api/brands/${e}/${t}/${n}`),a6=(e,t)=>fW(e,"products",t);async function Mj(e,t,n={}){const r=new FormData;n.role&&r.append("role",n.role),n.background&&r.append("background",n.background),r.append("file",t);const a=await fetch(`/api/brands/${e}/logos`,{method:"POST",body:r});if(!a.ok)throw new Error((await a.json().catch(()=>({}))).error??`HTTP ${a.status}`);return a.json()}const hW=e=>`/api/brands/${e}/export`;async function pW(e,t,n,r){const a=new FormData;a.append("file",n);const i=await fetch(`/api/brands/${e}/products/${t}/shots`,{method:"POST",body:a});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`HTTP ${i.status}`);return i.json()}async function P0(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/images",{method:"POST",body:t});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??`HTTP ${n.status}`);return(await n.json()).hash}function mW(e,t){try{return fetch(`/api/brands/${e}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({brand:t,keepAssets:!0}),keepalive:!0}).then(n=>n.ok?n.json():null).catch(()=>null)}catch{return Promise.resolve(null)}}const Mr=e=>`/api/images/${e}`,Fr=e=>e!=null&&e.startsWith("asset:")?Mr(e.slice(6)):null,Rj={tile:640,small:320,micro:160},dn=(e,t)=>`${Mr(e)}/thumb?w=${Rj[t]}`,Bp=(e,t)=>e!=null&&e.startsWith("asset:")?dn(e.slice(6),t):null,gW=/^\/api\/images\/([a-f0-9]{32})(?:\/thumb\?w=\d+)?$/,vW=/^(\/api\/(?:presenter-avatars|presenter-thumbnails|scene-thumbnails|demo-product-thumbnails|showcase-previews)\/[a-z0-9-]+\.jpg)(?:\?v=(\d+))?(?:[?&]w=\d+)?$/;function sr(e,t){if(!e)return e;const n=gW.exec(e);if(n)return t==="full"?Mr(n[1]):dn(n[1],t);const r=vW.exec(e);if(!r)return e;const a=r[2]?`${r[1]}?v=${r[2]}`:r[1];return t==="full"?a:`${a}${r[2]?"&":"?"}w=${Rj[t]}`}function q3(e){return e.every(t=>t.kind==="root")}let Pj=new Map;function wW(e){const t=new Map;for(const n of e)for(const r of n.legacyNames??[])r!==n.name&&t.set(r,n.name);Pj=t}function yW(e){var r;const t=e.promptHead??"",n=(r=/^\[([^\]]+)\]/.exec(t))==null?void 0:r[1];if(n)return Pj.get(n)??n;if(t.startsWith("Remove all overlaid marketing text")||t.startsWith("Remove ALL text"))return"Text lift"}function Sr(e){const t=yW(e);return t||(e.promptHead??"").trim().split(/\s+/).slice(0,6).join(" ")||(e.kind==="edit"?"Edit":"Generation")}const Lj=[{id:"newest",label:"Newest first"},{id:"oldest",label:"Oldest first"},{id:"cost",label:"Highest cost"},{id:"keepers",label:"Keepers first"}];function bW(e){return Lj.some(t=>t.id===e)}const Tj=[{id:"all",label:"All"},{id:"keepers",label:"Keepers"},{id:"archived",label:"Archived"}];function xW(e){return Tj.some(t=>t.id===e)}function kW(e){var r;const t=new URLSearchParams;e.lens&&e.lens!=="all"&&t.set("lens",e.lens),e.set&&t.set("set",e.set),e.ungrouped&&t.set("ungrouped","1"),e.lineage&&t.set("lineage",e.lineage),e.token&&t.set("token",e.token),(r=e.q)!=null&&r.trim()&&t.set("q",e.q.trim()),e.sort&&e.sort!=="newest"&&t.set("sort",e.sort),e.limit&&t.set("limit",String(e.limit)),e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return n?`?${n}`:""}function o6(e,t){const n=e.findIndex(r=>r.id===t);return n<0?{at:n,prev:null,next:null}:{at:n,prev:e[n-1]??null,next:e[n+1]??null}}const vu=(e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id),Re={brands:()=>qe("GET","/api/brands"),createBrand:e=>qe("POST","/api/brands",{brand:e}),brandFromUrl:e=>qe("POST","/api/brands/from-url",{url:e}),updateBrand:(e,t)=>qe("PUT",`/api/brands/${e}`,{brand:t,keepAssets:!0}),deleteBrand:e=>qe("DELETE",`/api/brands/${e}`),guide:()=>qe("GET","/api/guide"),guideIntent:e=>qe("POST","/api/guide",e,void 0,{keepalive:!0}),refreshBrandFromUrl:(e,t)=>qe("POST",`/api/brands/${e}/refresh-from-url`,t?{url:t}:{}),updateLogo:(e,t,n)=>qe("PATCH",`/api/brands/${e}/logos/${t}`,n),deleteLogo:(e,t)=>qe("DELETE",`/api/brands/${e}/logos/${t}`),projects:e=>qe("GET",`/api/projects?brandId=${encodeURIComponent(e)}`),createProject:(e,t)=>qe("POST","/api/projects",{brandId:e,name:t}),tree:e=>qe("GET",`/api/projects/${e}/tree`),activity:e=>qe("GET",`/api/brands/${e}/activity`),workspace:e=>qe("GET",`/api/brands/${e}/workspace`),feed:(e,t,n)=>qe("GET",`/api/brands/${e}/feed${kW(t)}`,void 0,n),node:e=>qe("GET",`/api/nodes/${e}`),lineage:e=>qe("GET",`/api/nodes/${e}/lineage`),usage:e=>qe("GET",`/api/brands/${e}/usage`),sets:e=>qe("GET",`/api/brands/${e}/sets`),createSet:(e,t)=>qe("POST",`/api/brands/${e}/sets`,{name:t}),renameSet:(e,t)=>qe("PATCH",`/api/sets/${e}`,{name:t}),deleteSet:e=>qe("DELETE",`/api/sets/${e}`),addToSet:(e,t)=>qe("POST",`/api/sets/${e}/nodes`,{nodeIds:t}),removeFromSet:(e,t)=>qe("POST",`/api/sets/${e}/nodes/remove`,{nodeIds:t}),engines:()=>qe("GET","/api/engines"),codexStatus:(e={})=>qe("GET",`/api/engines/codex/status${e.force?"?force=1":""}`),repairCodexEnv:e=>qe("POST","/api/engines/codex/repair-env",{keys:e}),restoreCodexEnv:()=>qe("POST","/api/engines/codex/restore-env"),installCodex:()=>qe("POST","/api/engines/codex/install"),loginCodex:()=>qe("POST","/api/engines/codex/login"),setCap:(e,t)=>qe("PUT","/api/caps",{engineId:e,capUsd:t}),addNode:e=>qe("POST","/api/nodes",e),cancelNode:e=>qe("POST",`/api/nodes/${e}/cancel`),retryNode:e=>qe("POST",`/api/nodes/${e}/retry`),scenes:()=>qe("GET","/api/scenes"),presenters:()=>qe("GET","/api/presenters"),presenterFrames:e=>qe("GET",`/api/presenter-previews/${e}`),demoProducts:()=>qe("GET","/api/demo-products"),demoProductFrames:e=>qe("GET",`/api/demo-product-previews/${e}`),showcase:()=>qe("GET","/api/showcase"),previewBrief:(e,t,n,r)=>qe("POST","/api/brief/preview",{brief:e,engineId:t,brandId:n,...r?{parentId:r}:{}}),keep:(e,t)=>qe("POST",`/api/nodes/${e}/keep`,{kept:t}),archiveNode:(e,t)=>qe("POST",`/api/nodes/${e}/archive`,{archived:t}),deleteNode:e=>qe("DELETE",`/api/nodes/${e}`),deleteNodesBatch:e=>qe("POST","/api/nodes/delete-batch",{nodeIds:e}),settings:()=>qe("GET","/api/settings"),saveSettings:e=>qe("PUT","/api/settings",e),costs:()=>qe("GET","/api/costs/summary"),home:()=>qe("GET","/api/home"),reveal:()=>qe("POST","/api/system/reveal"),version:()=>qe("GET","/api/version"),updateStatus:()=>qe("GET","/api/update/status"),updateCheck:()=>qe("POST","/api/update/check"),updateApply:()=>qe("POST","/api/update/apply"),updateRestart:()=>qe("POST","/api/update/restart"),desktop:()=>qe("GET","/api/desktop"),phone:(e=!1)=>qe("GET",e?"/api/phone?fresh=1":"/api/phone"),phoneNewCode:()=>qe("POST","/api/phone/code"),phoneHelp:()=>qe("GET","/api/phone/help"),phoneAllow:()=>qe("POST","/api/phone/allow"),desktopInstall:()=>qe("POST","/api/desktop/install"),quit:()=>qe("POST","/api/system/quit"),releaseNotes:()=>qe("GET","/api/release/notes"),releaseSeen:e=>qe("POST","/api/release/seen",{version:e}),sceneFrames:e=>qe("GET",`/api/scene-previews/${e}`),deleteData:e=>qe("DELETE",`/api/data?scope=${e}`),libraryProduct:(e,t)=>qe("GET",`/api/brands/${e}/products-library/${encodeURIComponent(t)}`),productsLibrary:e=>qe("GET",`/api/brands/${e}/products-library`),catalogImport:(e,t,n)=>qe("POST",`/api/brands/${e}/catalog/import`,n?{url:t,urls:n}:{url:t}),catalogScan:(e,t)=>qe("POST",`/api/brands/${e}/catalog/scan`,t?{url:t}:{}),catalogDetails:(e,t)=>qe("POST",`/api/brands/${e}/catalog/details`,{urls:t}),catalogScanState:(e,t,n)=>qe("GET",`/api/brands/${e}/catalog/scans/${t}`,void 0,n),cancelCatalogScan:(e,t)=>qe("POST",`/api/brands/${e}/catalog/scans/${t}/cancel`),catalogJob:(e,t)=>qe("GET",`/api/brands/${e}/catalog/jobs/${t}`),catalogJobs:e=>qe("GET",`/api/brands/${e}/catalog/jobs`),cancelCatalogJob:(e,t)=>qe("POST",`/api/brands/${e}/catalog/jobs/${t}/cancel`),deleteCatalogProduct:(e,t)=>qe("DELETE",`/api/brands/${e}/catalog/products/${t}`),updateProduct:(e,t,n)=>qe("PATCH",`/api/brands/${e}/products/${t}`,n),updateCatalogProduct:(e,t,n)=>qe("PATCH",`/api/brands/${e}/catalog/products/${t}`,n),productSize:(e,t)=>qe("GET",`/api/brands/${e}/products/${t}/size`),setProductSize:(e,t,n)=>qe("PUT",`/api/brands/${e}/products/${t}/size`,{size:n}),setProductShots:(e,t,n)=>qe("PUT",`/api/brands/${e}/products/${t}/shots`,{files:n}),assetBuildCapabilities:()=>qe("GET","/api/asset-builds/capabilities"),startAssetBuild:(e,t)=>qe("POST",`/api/brands/${e}/asset-builds`,t),assetBuild:(e,t)=>qe("GET",`/api/brands/${e}/asset-builds/${t}`),assetBuilds:e=>qe("GET",`/api/brands/${e}/asset-builds`),cancelAssetBuild:(e,t)=>qe("POST",`/api/brands/${e}/asset-builds/${t}/cancel`),deleteAssetBuild:(e,t)=>qe("DELETE",`/api/brands/${e}/asset-builds/${t}`),createProduct:(e,t)=>qe("POST",`/api/brands/${e}/products`,t),createPresenterDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts`,t),presenterDrafts:e=>qe("GET",`/api/brands/${e}/presenter-drafts`),presenterDraft:(e,t)=>qe("GET",`/api/brands/${e}/presenter-drafts/${t}`),updatePresenterDraft:(e,t,n)=>qe("PATCH",`/api/brands/${e}/presenter-drafts/${t}`,n),generateDraftView:(e,t,n,r={})=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/generate`,r),approveDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/approve`),redoDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/redo`),revertDraftView:(e,t,n)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/revert`),stopDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/stop`),restoreDraftView:(e,t,n,r)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/restore`,{hash:r}),placeDraftPhoto:(e,t,n,r)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/use-photo`,{hash:r}),savePresenterDraft:(e,t)=>qe("POST",`/api/brands/${e}/presenter-drafts/${t}/save`),deletePresenterDraft:(e,t)=>qe("DELETE",`/api/brands/${e}/presenter-drafts/${t}`),createPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters`,t),updatePresenter:(e,t,n)=>qe("PATCH",`/api/brands/${e}/presenters/${t}`,n),deletePresenter:(e,t)=>qe("DELETE",`/api/brands/${e}/presenters/${t}`),duplicatePresenter:(e,t,n)=>qe("POST",`/api/brands/${e}/presenters/${t}/duplicate`,{name:n}),editPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters/${t}/edit`),revertPresenter:(e,t)=>qe("POST",`/api/brands/${e}/presenters/${t}/revert`),createScene:(e,t)=>qe("POST",`/api/brands/${e}/scenes`,t),updateScene:(e,t,n)=>qe("PATCH",`/api/brands/${e}/scenes/${t}`,n),deleteScene:(e,t)=>qe("DELETE",`/api/brands/${e}/scenes/${t}`),sceneExamples:(e,t)=>qe("GET",`/api/brands/${e}/scenes/${t}/examples`),drawSceneExamples:(e,t,n)=>qe("POST",`/api/brands/${e}/scenes/${t}/examples`,n),stopSceneExamples:(e,t)=>qe("POST",`/api/brands/${e}/scenes/${t}/examples/stop`),removeSceneExample:(e,t,n)=>qe("DELETE",`/api/brands/${e}/scenes/${t}/examples/${n}`),generateScenePreview:(e,t)=>qe("POST",`/api/brands/${e}/scenes/${t}/preview`),rereadScene:(e,t,n)=>qe("POST",`/api/brands/${e}/scenes/${t}/reread`,{correction:n}),startSceneStudioJob:(e,t)=>qe("POST",`/api/brands/${e}/scene-studio/jobs`,t),sceneStudioJob:(e,t)=>qe("GET",`/api/brands/${e}/scene-studio/jobs/${t}`),cancelSceneStudioJob:(e,t)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/cancel`),labelSceneStudioJob:(e,t,n)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/label`,{label:n}),attachSceneStudioJob:(e,t,n)=>qe("POST",`/api/brands/${e}/scene-studio/jobs/${t}/attach`,{sceneId:n})},i6="scenri:guide-heading",SW=["first-shot","refine","product","presenter","scene","reuse"],EW=e=>SW.includes(e);function CW(){try{const e=typeof window>"u"?null:window.sessionStorage.getItem(i6);if(!e)return null;if(e.startsWith("{")){const t=JSON.parse(e);return typeof t.brandId=="string"&&EW(t.task)?{brandId:t.brandId,task:t.task}:null}return{brandId:e,task:"first-shot"}}catch{return null}}function $j(e){try{e?window.sessionStorage.setItem(i6,JSON.stringify(e)):window.sessionStorage.removeItem(i6)}catch{}}const jW={loaded:!1,heading:null,eligible:!1,welcome:null,hidden:!0,done:{},lessons:{},progress:{},dismissed:[],active:null,activeNodes:[],activeDraftId:null,counts:null};let Da={...jW,heading:CW()},X3=null,Cg=null,Q3=!1;const l6=new Set;function Ul(e){Da=e;for(const t of l6)t()}function Dj(e){const t=e;return{...t,lessons:t.lessons??{},progress:t.progress??{},loaded:!0,heading:Da.heading}}function Th(){return Cg??(Cg=Re.guide().then(e=>Ul(Dj(e))).catch(()=>{Da.loaded||Ul({...Da,loaded:!0})}).finally(()=>{Cg=null})),Cg}function AW(){return!Q3&&typeof document<"u"&&(Q3=!0,document.addEventListener("visibilitychange",()=>{!document.hidden&&Da.loaded&&Th()})),X3??(X3=Th()),X3}function jg(){return Th()}function NW(e,t){var n,r;return"welcome"in t?{...e,welcome:t.welcome}:"hidden"in t?{...e,hidden:t.hidden}:"finish"in t?{...e,lessons:e.lessons[t.finish]?e.lessons:{...e.lessons,[t.finish]:new Date().toISOString()},...((n=e.active)==null?void 0:n.task)===t.finish?{active:null,activeNodes:[],activeDraftId:null}:{}}:"dismiss"in t?{...e,dismissed:e.dismissed.includes(t.dismiss)?e.dismissed:[...e.dismissed,t.dismiss],...((r=e.active)==null?void 0:r.task)===t.dismiss?{active:{...e.active,paused:!0}}:{}}:e}function Tl(e){const t=Da;return Ul(NW(Da,e)),Re.guideIntent(e).then(n=>Ul(Dj(n))).catch(()=>{Ul(t),Th()})}function MW(e){return l6.add(e),()=>l6.delete(e)}const Hj=e=>`scenri:guide-via-bar:${e}`,c6=(e,t)=>t==="first-shot"||t==="reuse"?Hj(e):`scenri:guide-via:${e}:${t}`;function Oj(e,t){const n={brandId:e,task:t};$j(n),Ul({...Da,heading:n})}function u6(){$j(null),Da.heading&&Ul({...Da,heading:null})}function fh(){return Da}function cv(){return s.useSyncExternalStore(MW,fh)}const ct={root:"/",setup:"/setup",brand:"/:brandSlug",kit:"/:brandSlug/kit",products:"/:brandSlug/products",product:"/:brandSlug/products/:productId",scenes:"/:brandSlug/scenes",sceneStudio:"/:brandSlug/scenes/new/:convoId?",scene:"/:brandSlug/scenes/:sceneId",sceneEdit:"/:brandSlug/scenes/:sceneId/edit/:convoId?",presenters:"/:brandSlug/presenters",presenterStudio:"/:brandSlug/presenters/new/:draftId?",presenter:"/:brandSlug/presenters/:presenterId",presenterEdit:"/:brandSlug/presenters/:presenterId/edit",hub:"/:brandSlug/create",hubShot:"/:brandSlug/create/shots/:shotId",set:"/:brandSlug/sets/:setSlug",setShot:"/:brandSlug/sets/:setSlug/shots/:shotId",legacy:"/b/*",notFound:"*"},mo=e=>us(ct.brand,{brandSlug:e.slug}),Eu=e=>us(ct.products,{brandSlug:e.slug}),la=(e,t)=>us(ct.product,{brandSlug:e.slug,productId:t}),_u=e=>us(ct.scenes,{brandSlug:e.slug}),_r=(e,t)=>us(ct.scene,{brandSlug:e.slug,sceneId:t}),Vi=(e,t)=>us(ct.sceneStudio,{brandSlug:e.slug,convoId:t??void 0}),uv=(e,t,n)=>us(ct.sceneEdit,{brandSlug:e.slug,sceneId:t,convoId:n??void 0}),qi=e=>us(ct.presenters,{brandSlug:e.slug}),ha=(e,t)=>us(ct.presenter,{brandSlug:e.slug,presenterId:t}),zi=(e,t)=>us(ct.presenterStudio,{brandSlug:e.slug,draftId:t??void 0}),Up=(e,t)=>us(ct.presenterEdit,{brandSlug:e.slug,presenterId:t}),mr=e=>us(ct.hub,{brandSlug:e.slug}),t0=(e,t)=>us(ct.set,{brandSlug:e.slug,setSlug:t.slug}),Wp=(e,t,n)=>t?us(ct.setShot,{brandSlug:e.slug,setSlug:t.slug,shotId:n}):us(ct.hubShot,{brandSlug:e.slug,shotId:n});function RW(e,t=""){const[,,n,...r]=e.split("/");if(!n)return ct.root;const a=`/${n}${PW(r)}`;return t?a+t:a}function PW(e){const[t,n,r,a]=e;return t==="create"?r&&n==="n"?`/create/shots/${r}`:"/create":t==="s"&&n?a&&r==="n"?`/sets/${n}/shots/${a}`:`/sets/${n}`:t==="brand"?"/kit":t==="p"?"/create":t==="n"&&n?`/create/shots/${n}`:e.length?`/${e.join("/")}`:""}const Ag="Scenri",J3=" - ",ex=40,LW=[["whatsnew","What's new"],["setup","Providers"],["settings","Settings"]],TW=[[ct.setup,"Set up",!1],[ct.hubShot,"Shot",!1],[ct.setShot,"Shot",!1],[ct.hub,"Create",!1],[ct.set,"Create",!0],[ct.kit,"Brand kit",!1],[ct.product,"Products",!0],[ct.products,"Products",!1],[ct.scene,"Scenes",!0],[ct.scenes,"Scenes",!1],[ct.presenter,"Presenters",!0],[ct.presenters,"Presenters",!1],[ct.brand,"Home",!1]];function $W(e){if(!e)return null;const t=e.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").replace(/\s+/g," ").trim();return t?t.length>ex?`${t.slice(0,ex-1).trimEnd()}…`:t:null}function DW(e,t="",n=null){const r=new URLSearchParams(t);for(const[a,i]of LW)if(r.has(a))return i+J3+Ag;for(const[a,i,l]of TW)if(Wi(a,e))return((l?$W(n):null)??i)+J3+Ag;return Ag}const Ij=s.createContext(null);function HW(){const{pathname:e,search:t}=Zn(),[n,r]=s.useState(null);return s.useEffect(()=>{document.title=DW(e,t,n)},[e,t,n]),r}function Sc(e){const t=s.useContext(Ij);s.useEffect(()=>{if(t)return t(e??null),()=>t(null)},[t,e])}const OW={scenes:[],collections:[],verticals:[],loaded:!1,error:!1};function IW(){const[e,t]=s.useState(OW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Re.scenes().then(l=>{wW(l.scenes),i&&t({scenes:l.scenes,collections:l.collections,verticals:l.verticals,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const FW={presenters:[],categories:[],styles:[],loaded:!1,error:!1};function _W(){const[e,t]=s.useState(FW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Re.presenters().then(l=>{i&&t({presenters:l.presenters,categories:l.categories,styles:l.styles,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const ZW={demoProducts:[],categories:[],loaded:!1,error:!1};function VW(){const[e,t]=s.useState(ZW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Re.demoProducts().then(l=>{i&&t({demoProducts:l.demoProducts,categories:l.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const zW={showcase:[],categories:[],loaded:!1,error:!1};function BW(){const[e,t]=s.useState(zW),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return Re.showcase().then(l=>{i&&t({showcase:l.showcase,categories:l.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const Z1=[{id:"brand",label:"Brand kit",Icon:GU,scope:"brand",sub:e=>`What every shot for ${e} can draw on.`},{id:"usage",label:"Usage",Icon:$U,scope:"brand",sub:e=>`What ${e} has made, one square per day.`},{id:"engines",label:"Providers",Icon:R0,scope:"studio",sub:()=>"Where your images are made, and what each may spend."},{id:"appearance",label:"Appearance",Icon:HU,scope:"studio",sub:()=>"How Scenri looks on this device."},{id:"library",label:"Library",Icon:ov,scope:"studio",sub:()=>"Your work, as plain files on this computer. Back them up like anything else."},{id:"phone",label:"Local access",Icon:OU,scope:"studio",sub:()=>"Open Scenri on your phone, tablet or another computer, or from your desktop."},{id:"updates",label:"Updates",Icon:Ph,scope:"studio",sub:()=>"How this copy of Scenri stays current."},{id:"about",label:"About",Icon:_p,scope:"studio",sub:()=>"The copy of Scenri you are running."},{id:"danger",label:"Danger zone",Icon:Vp,scope:"apart",sub:()=>"These do not come back. Export from Library first if you are not certain."}],Fj={brand:"brand",usage:"usage",engines:"engines",budget:"engines",general:"appearance",appearance:"appearance",library:"library",phone:"phone",updates:"updates",about:"about",danger:"danger"},UW="index",_j=e=>e!==null&&Object.prototype.hasOwnProperty.call(Fj,e),WW=e=>_j(e)?Fj[e]:"brand",KW=e=>!_j(e);function vf(){const{open:e}=Ns("settings");return s.useCallback(t=>e(t??UW),[e])}function GW(){const{open:e}=Ns("welcome");return s.useCallback(()=>e("1"),[e])}const d6={current:null};function Zj(){const{open:e}=Ns("learn");return s.useCallback((t="lessons")=>e(t),[e])}const tx="codex-cli";function Ec(){const{open:e}=Ns("setup");return s.useCallback((t=tx)=>{e(typeof t=="string"?t:tx)},[e])}function YW(e){var t;e.preventDefault(),(t=e.currentTarget)==null||t.focus({preventScroll:!0})}function Vj({failure:e,density:t,onRetry:n,dismiss:r}){const a=vf(),i=Ec(),{remedy:l}=e,u=t==="tile",f=()=>{l&&(l.opens==="setup"?i("codex-cli"):a(l.opens))},h=n&&e.retryable,p=w=>u?`sc-s${w?" sc-s-primary":""}`:`sc-btn ${w?"sc-btn-primary":"sc-btn-ghost"}`,g=!u&&!!e.fix,v=!u&&!!e.raw;return o.jsxs("div",{className:"sc-fail","data-density":t,"data-kind":e.kind,"data-long":e.title.length>90||void 0,role:"alert",children:[o.jsx("span",{className:"sc-fail-ic","aria-hidden":!0,children:o.jsx(kc,{size:u?15:21,weight:"fill"})}),o.jsxs("div",{className:"sc-fail-txt",children:[o.jsx("b",{children:e.title}),g&&o.jsx("small",{children:e.fix})]}),(l||h||r)&&o.jsxs("div",{className:"sc-fail-acts",children:[l&&o.jsx("button",{type:"button",className:p(!0),onClick:f,children:l.label}),h&&o.jsxs("button",{type:"button",className:p(!l),onClick:n,children:[o.jsx(M0,{size:u?12:14})," Try again"]}),r&&o.jsx("button",{type:"button",className:"sc-fail-alt",onClick:r.onClick,children:r.label})]}),v&&o.jsxs("details",{className:"sc-fail-raw",children:[o.jsx("summary",{children:"Details"}),o.jsx("pre",{children:e.raw})]})]})}function dv({failure:e,action:t,tone:n="error"}){return o.jsx("div",{className:"sc-failrow","data-tone":n,role:n==="error"?"alert":"status",children:o.jsxs("div",{className:"sc-banner","data-tone":n==="error"?"error":void 0,children:[o.jsx("span",{className:"sc-banner-ic",children:n==="error"?o.jsx(kc,{size:16,weight:"fill"}):o.jsx(_p,{size:16,weight:"fill"})}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:e.title}),e.fix&&o.jsx("small",{children:e.fix})]}),t]})})}function zj(e){return{get(t){try{return e().getItem(t)}catch{return null}},set(t,n){try{e().setItem(t,n)}catch{}},del(t){try{e().removeItem(t)}catch{}},keys(t){try{const n=e(),r=[];for(let a=0;a<n.length;a++){const i=n.key(a);i!=null&&i.startsWith(t)&&r.push(i)}return r}catch{return[]}}}}const cs=zj(()=>localStorage),wf=zj(()=>sessionStorage),Bj=720*60*60*1e3;function Uj(e){return e?e.phase==="ready"?e.blockReason!=="dev"&&e.blockReason!=="unsupervised"&&e.blockReason!=="launcher-too-old":e.canApply:!1}function qW(e){return!!(e!=null&&e.available)&&e.blockReason!=="dev"}function XW(e){return e.phase==="staging"?{kind:"downloading"}:e.phase==="ready"?{kind:"ready",version:e.stagedVersion??e.latest??e.current}:e.phase==="error"&&e.available?{kind:"stage-error"}:{kind:"announce",oneClick:Uj(e)}}const QW=1800*1e3,nx=300*1e3,Ng=e=>new Promise(t=>setTimeout(t,e)),Wj="scenri:update-dismissed",JW=()=>wf.get(Wj),eK=e=>wf.set(Wj,e),Kj=s.createContext(null);function Kp(){const e=s.useContext(Kj);if(!e)throw new Error("useUpdateCenter must be used inside UpdateCenterProvider");return e}function tK({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(JW),u=s.useRef(void 0);s.useEffect(()=>{let M=!0;const C=async()=>{if(M){if(!document.hidden)try{const T=await Re.updateStatus();M&&n(T)}catch{}M&&(u.current=window.setTimeout(C,QW))}};C();const R=()=>{document.hidden||!M||(window.clearTimeout(u.current),C())};return document.addEventListener("visibilitychange",R),window.addEventListener("focus",R),()=>{M=!1,window.clearTimeout(u.current),document.removeEventListener("visibilitychange",R),window.removeEventListener("focus",R)}},[]);const[f,h]=s.useState(null),p=s.useCallback(async()=>{a(!0);try{n(await Re.updateCheck()),h(null)}catch(M){h(String((M==null?void 0:M.message)??M))}finally{a(!1)}},[]),g=s.useCallback(()=>{const M=t==null?void 0:t.latest;M&&(eK(M),l(M))},[t]),v=(t==null?void 0:t.latest)!=null&&t.latest===i,[w,y]=s.useState("idle"),[x,k]=s.useState(null),S=s.useCallback(async M=>{y("restarting");try{await Re.updateRestart()}catch(R){if(typeof R.status=="number"){y("idle"),k(String((R==null?void 0:R.message)??R));return}}const C=Date.now()+3e4;for(;Date.now()<C;){await Ng(800);try{if((await Re.version()).version!==M){location.reload();return}}catch{}}y("idle"),k("The restart did not complete. Check the terminal Scenri runs in.")},[]),E=s.useCallback(async()=>{if(w!=="idle")return null;try{await Re.quit()}catch(M){if(typeof M.status=="number")return String((M==null?void 0:M.message)??M)}return window.close(),setTimeout(()=>{window.closed||location.replace("about:blank")},300),null},[w]),j=s.useCallback(async()=>{if(w!=="idle")return;k(null);const M=t==null?void 0:t.current;try{if((t==null?void 0:t.phase)!=="ready"){y("applying"),await Re.updateApply();const C=Date.now()+nx;let R=!1;for(;Date.now()<C;){await Ng(1500);const T=await Re.updateStatus();if(n(T),T.phase==="ready"){R=!0;break}if(T.phase==="error"){k(T.error??"The update could not be staged."),y("idle");return}}if(!R){k("Couldn't download the update. Try again."),y("idle");return}}await S(M)}catch(C){k(String((C==null?void 0:C.message)??C)),y("idle")}},[w,t,S]),N=s.useRef(!1);s.useEffect(()=>{if((t==null?void 0:t.phase)!=="staging"||w!=="idle"||N.current)return;N.current=!0;let M=!0;const C=Date.now()+nx;return(async()=>{for(;M&&Date.now()<C;){if(await Ng(1500),!M)return;try{const T=await Re.updateStatus();if(!M||(n(T),T.phase!=="staging"))return}catch{}}})().finally(()=>{N.current=!1}),()=>{M=!1}},[t==null?void 0:t.phase,w]);const{pathname:P}=Zn(),$=P===ct.setup;return o.jsxs(Kj.Provider,{value:{status:t,checking:r,checkNow:p,checkError:f,dismissed:v,dismiss:g,apply:j,quit:E,busy:w,applyError:x},children:[e,w!=="restarting"&&qW(t)&&!v&&!$&&o.jsx(sK,{}),w==="restarting"&&o.jsx(nK,{version:(t==null?void 0:t.stagedVersion)??(t==null?void 0:t.latest)??null})]})}function nK({version:e}){return o.jsxs(rK,{children:[o.jsx(J7,{size:22}),o.jsx("b",{children:e?`Updating to Scenri ${e}`:"Updating Scenri"}),o.jsx("small",{children:"Restarting. This page reconnects by itself."})]})}function rK({children:e,className:t}){return Rr.createPortal(o.jsx("div",{className:t?`sc-upd-overlay ${t}`:"sc-upd-overlay",role:"status","aria-live":"polite",children:o.jsx("div",{className:"sc-upd-overlay-card",children:e})}),document.body)}function sK(){const{status:e,dismiss:t,apply:n,busy:r,applyError:a}=Kp(),i=vf();if(!e)return null;const l=XW(e),u=l.kind==="downloading"?"Downloading update…":l.kind==="ready"?`Scenri ${l.version} is ready`:l.kind==="stage-error"?"Couldn't download the update":"A new update is available",f=r==="applying"?"Updating…":l.kind==="stage-error"?"Try again":"Update",h=l.kind!=="announce"||l.oneClick;return o.jsxs("div",{className:"sc-upd-float",role:"status",children:[o.jsx(FU,{className:"sc-upd-float-dot",size:16,weight:"fill","aria-hidden":"true"}),o.jsxs("span",{className:"sc-upd-float-txt",children:[u,a&&l.kind!=="downloading"&&o.jsx("small",{children:a})]}),o.jsx("button",{type:"button",className:"sc-upd-float-later",onClick:t,children:l.kind==="ready"?"Later":"Not now"}),l.kind!=="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:r!=="idle",onClick:()=>h?void n():i("updates"),children:f})]})}function aK(e,t){return!e||t.updatedAt>=e.updatedAt}function oK(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0||e[n]===t||!aK(e[n],t))return e;const r=e.slice();return r[n]=t,r}function iK(e,t,n){if(!e)return t;const r=new Map(e.map(l=>[l.id,l]));let a=e.length===t.length;const i=t.map((l,u)=>{const f=r.get(l.id),h=f&&n.has(l.id)&&!(l.updatedAt>f.updatedAt)?f:l;return h!==e[u]&&(a=!1),h});return a?e:i}const fv=(e,t)=>`scenri:new-${e}-${t}`,lK=e=>wf.get(e),cK=(e,t)=>wf.set(e,t);function n0(e){wf.del(e),cs.del(e)}function Mg(e){var t,n,r;return!!((t=e.name)!=null&&t.trim())||!!((n=e.instruction)!=null&&n.trim())||!!((r=e.importUrl)!=null&&r.trim())||(e.facets??[]).length>0||(e.imageHashes??[]).length>0}const rx=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function Gj(e,t){const n=fv(e,t),r=lK(n);if(!r)return null;let a;try{a=JSON.parse(r)}catch{return n0(n),null}if(typeof a!="object"||a===null)return n0(n),null;const i=a;if(i.v!==1||i.brandId!==e||i.kind!==t)return n0(n),null;const l=Date.now()-Date.parse(i.updatedAt??"");return!Number.isFinite(l)||l>Bj?(n0(n),null):{v:1,brandId:e,kind:t,updatedAt:i.updatedAt,name:typeof i.name=="string"?i.name:"",instruction:typeof i.instruction=="string"?i.instruction:"",facets:rx(i.facets),imageHashes:rx(i.imageHashes),importUrl:typeof i.importUrl=="string"?i.importUrl:"",pending:typeof i.pending=="string"?i.pending:null}}function Rg(e,t,n){const r={v:1,brandId:e,kind:t,updatedAt:new Date().toISOString(),name:n.name??"",instruction:n.instruction??"",facets:n.facets??[],imageHashes:n.imageHashes??[],importUrl:n.importUrl??"",pending:n.pending??null};cK(fv(e,t),JSON.stringify(r))}function du(e,t){n0(fv(e,t))}function uK(e,t,n){const r=Gj(e,t);(r==null?void 0:r.pending)===n&&du(e,t)}function dK(e,t){if(!e)return!1;if(e.pending===null)return!0;const n=t??"unknown";return n==="failed"||n==="cancelled"||n==="unknown"}const Gp=[{id:"portrait",tier:"core",gate:!0,from:[],strip:"Face",name:"face"},{id:"front",tier:"core",gate:!0,from:["portrait"],strip:"Full body",name:"full body"},{id:"three-quarter",tier:"core",from:["portrait","front"],strip:"Three-quarter",name:"three-quarter view"},{id:"back",tier:"supplementary",from:["portrait","front"],strip:"Back",name:"back view"},{id:"left",tier:"supplementary",from:["portrait","front"],strip:"Left",name:"left view"},{id:"right",tier:"supplementary",from:["portrait","front"],strip:"Right",name:"right view"}],yf=e=>Gp.filter(e).map(t=>t.id),Yj=yf(()=>!0),fK=yf(e=>e.tier==="core"),hK=yf(e=>e.tier==="supplementary"),Jl=Object.fromEntries(Gp.map(e=>[e.id,e.strip])),bn=Object.fromEntries(Gp.map(e=>[e.id,e.name])),Wl=e=>bn[e],qj=Object.fromEntries(Gp.map(e=>[e.id,e.from])),f6=new Set(yf(e=>e.gate===!0)),Ho=e=>f6.has(e)?void 0:"auto",h0=4,sx=25*1024*1024,Wo=e=>yf(t=>{var n;return t.tier==="core"||!!e.extras||((n=e.views[t.id])==null?void 0:n.status)!=="empty"});function hv(e){return Wo(e).find(t=>e.views[t].status!=="approved")??null}const pK=e=>hv(e)===null,Ko=e=>e.views.portrait.status==="approved"||!!e.views.portrait.prior,ec=e=>e.stage!=="idle"||!!e.activeView;function Xj(e){if(ec(e))return null;const t=hv(e);if(!t)return null;const n=e.views[t];return n.status!=="empty"&&n.status!=="stale"||n.error?null:qj[t].every(r=>e.views[r].status==="approved")?t:null}function Qj(e,t){return t??(ec(e)?e.activeView:null)??hv(e)??"portrait"}function Jj(e,t){return Wo(e).map(n=>{const r=e.views[n],a=n===t?"current":r.status==="approved"?"approved":r.status==="stale"?"stale":"todo";return{view:n,label:Jl[n],state:a,hash:r.hash,photo:r.origin==="photo",drawing:e.activeView===n,approved:r.status==="approved",error:!!r.error}})}const mK={woman:"a woman",man:"a man",androgynous:"an androgynous person"},gK={woman:"her",man:"his",androgynous:"their"},$h=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|she|he|her|his)\b/i,vK=/^(my|a|an|the|this|that|is|it|its|their|there|hey|hi|hello|yo|ok|okay|please|thanks|thank|you|your|dear|bro|bruh|dude|mate|sir|maam|madam|just|like|some)$/i;function wK(e){const t=e.trim().split(/[^\p{L}\p{N}']+/u).filter(Boolean);return t.some(n=>$h.test(n))?t.every(n=>vK.test(n)||$h.test(n)):!1}const pv=/\b(\d0s|\d{2}\s*(years|yo)|teen|twenties|thirties|forties|fifties|sixties|seventies|elderly|young|old(er)?|middle-aged|adult)\b/i,yK=120,bK=18;function xK(e){const t=e.match(/\d+/g);return t!=null&&t.length?t.every(n=>{const r=Number(n);return r>=bK&&r<=yK}):!1}const kK=/\b(hair|bald|shaved|buzz|blonde?|brunette|redhead|ginger|greying|silver|auburn|platinum)\b/i,SK=/\b(skin|complexion|fair|pale|light|olive|tan|tanned|brown|deep|dark|ebony|black|white|freckled|golden)\b/i,EK=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|guys|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|person|people|someone|somebody|model|teen|teenager|kid|child|adult|senior)\b/i,CK=/\b(hair|haired|curly|wavy|straight|braids?|bob|ponytail|bun|fringe|bangs|beard|beardless|moustache|mustache|stubble|goatee|clean-shaven|freckles?|glasses|spectacles|tattoos?|piercings?|eyes?|eyebrows?|brows|jaw|jawline|cheekbones|nose|lips|mouth|smile|smiling|face|features|forehead|dimples|scar|wrinkles|build|figure|frame|body|tall|short|slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size|height|weight|presence|vibe|energy|look|looks|looking|calm|warm|confident|elegant|composed|friendly|serious|intense|soft|gentle|bright|energetic|quiet|poised|relaxed|playful|stern|kind|charming|handsome|beautiful|pretty|striking|rugged|graceful|sporty|nerdy|bookish|professional|corporate|casual|older|younger|taller|shorter|longer|slimmer|leaner|heavier|broader|bigger|smaller|thinner|thicker|softer|sharper|lighter|darker|natural|makeup|make-up|lipstick|jewelry|earrings)\b/i,jK=/\b(mediterranean|asian|indian|chinese|japanese|korean|african|nordic|scandinavian|latin[ao]?|hispanic|arab|arabic|middle eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipin[ao]|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|mixed|biracial)\b/i,ra=e=>EK.test(e)||pv.test(e)||kK.test(e)||SK.test(e)||CK.test(e)||jK.test(e);function AK(e,t){const n=t.trim();if(!n)return"";const r=[],a=e.steer&&!$h.test(n)?mK[e.steer]:"";if(a&&r.push(a),e.age&&!pv.test(n)){const l=e.steer?gK[e.steer]:"their",u=e.age==="60+"?`in ${l} 60s or older`:`in ${l} ${e.age}`;r.push(a?u:`someone ${u}`)}const i=[];return i.length&&r.push(`with ${i.join(" and ")}`),r.length?`${r.join(" ")}, ${n}`:n}function NK(e,t){var r;const n=((r=e.analysis)==null?void 0:r.suitableCategories)??[];return!n.length||t.length?null:n}function eA(e){return Yj.some(t=>{const n=e.views[t];return!!n.hash&&n.origin!=="photo"&&n.status!=="empty"})}function MK(e,t,n=!0){if(ec(e))return"Still drawing";const r=!n&&e.source==="photos"?["portrait"]:Wo(e);for(const a of r){const i=e.views[a];if(i.status==="candidate")return`Decide on the ${Wl(a)} first`;if(i.status==="stale")return`Redo the ${Wl(a)} first`;if(i.status!=="approved")return`Use the ${Wl(a)} first`}return t.trim()?null:"Give them a name"}const tA=/\b(hair|bald|fringe|bangs|beard|moustache|mustache|stubble|skin|freckles?|complexion|age|older|younger|\d0s|face|facial|jaw|chin|cheek(bone)?s?|nose|eyes?|brows?|eyebrows?|lips?|mouth|teeth|wrinkles?|build|weight|heavier|slimmer|thinner|leaner|broader|muscular|athletic|curvier|taller|shorter|height|gender|woman|man|feminine|masculine|glasses|tattoo|scar)\b/i;function nA(e,t,n){if(!e.trim())return{blocked:"Say what should change."};if(!Ko(n))return n.views.portrait.status!=="candidate"?{blocked:"Nothing to adjust yet."}:{view:"portrait",scope:"identity"};if(t==="portrait"||tA.test(e))return n.source==="photos"?{blocked:"Their photos define who they are. Change a drawn view instead."}:{view:"portrait",scope:"identity"};const a=n.views[t];return a.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:a.status!=="approved"&&a.status!=="candidate"?{blocked:`Nothing drawn for the ${Wl(t)} yet.`}:{view:t,scope:"view"}}function ax(e,t){return Ko(t)?t.source==="photos"?"Changes this view only. Their photos define who they are.":e==="portrait"?"Changes the person. The other views are redrawn after you use it.":"Changes this view only. Hair, skin, age or build change the person.":"An adjustment keeps this person. Try again rolls a new one."}function RK(e,t,n){const r=e.trim(),a=nA(r||"this",t,n);if("blocked"in a)return r?{chip:null,hint:a.blocked,tone:"alert"}:{chip:null,hint:ax(t,n)};const i=Ko(n)?a.scope==="identity"?"Changing the person":`Refining the ${bn[a.view]}`:"Adjusting the face";return{chip:{view:a.view,label:i},hint:ax(t,n)}}const ox=e=>e.charAt(0).toUpperCase()+e.slice(1);function PK(e,t){var g,v,w,y;if(e.source!=="photos"||e.stage==="analyzing")return null;const n=(g=e.readError)==null?void 0:g.trim();if(n)return{text:`The photos could not be read: ${/[.!?]$/.test(n)?n:`${n}.`} Their face is drawn from them anyway.`,tone:"warn"};const r=(w=(v=e.analysis)==null?void 0:v.conflict)==null?void 0:w.trim();if(r)return{text:`These photos may show more than one person: ${r}`,tone:"warn"};const a=((y=e.analysis)==null?void 0:y.photos)??[];if(a.length&&a.every(x=>x.usable===!1))return null;const i=Wo(e),l=i.filter(x=>e.views[x].origin==="photo"),u=i.filter(x=>e.views[x].origin!=="photo"),f=x=>x.length<=2?x.map(Wl).join(" and "):`${x.slice(0,-1).map(Wl).join(", ")} and ${Wl(x[x.length-1])}`,h=l.length?`${ox(f(l))} from your ${l.length===1?"photo":"photos"}.`:"";if(!u.length)return{text:h};if(!t)return{text:[h||"The face is kept from your photo as it is.","The other views need an engine that can draw."].filter(Boolean).join(" ")};const p=u.length>=3&&l.length?"The rest are drawn from them.":`${ox(f(u))} ${u.length===1?"is":"are"} drawn from them.`;return{text:[h,p].filter(Boolean).join(" ")}}const rA=e=>{var t;return(e.activeView?(t=e.views[e.activeView])==null?void 0:t.startedAt:void 0)??e.updatedAt};function sA(e){var r;if(e.stage==="analyzing")return`Reading ${e.source==="photos"?"the photos":"the face"}`;const t=e.activeView;if(!t)return;const n=!!((r=e.views[t])!=null&&r.hash);return t==="portrait"?n?"Adjusting the face":"Drawing the face":`${n?"Redrawing":"Drawing"} the ${bn[t]}`}function mv(e,t){return aA(t).some(n=>!!e.views[n].hash)}function aA(e){const t=new Set;for(let n=!0;n;){n=!1;for(const r of Yj)r===e||t.has(r)||qj[r].some(a=>a===e||t.has(a))&&(t.add(r),n=!0)}return[...t]}function LK(e,t){const n=e.views[t].hash;return n?aA(t).some(r=>{const a=e.views[r];return!!a.hash&&!(a.conditionedOn??[]).includes(n)}):!1}function oA(e,t){const n=new Set,r=[];for(const a of e.results??[])a.view!==t||a.how==="restored"||n.has(a.hash)||(n.add(a.hash),r.push({n:r.length+1,hash:a.hash,current:e.views[t].hash===a.hash}));return r.length>1?r:[]}const TK=["hero","close","hands","angle","bold"],tc={hero:"Hero",close:"Close-up",hands:"Hands",angle:"Another angle",bold:"A bold one"},ix={hero:"hero",close:"close-up",hands:"hands",angle:"other angle",bold:"bold one"},iA=(e,t)=>!!e&&e.status==="running"&&e.roles.includes(t)&&!e.done.includes(t)&&!e.failed.some(n=>n.role===t);function lA(e=[],t){const n=[];for(const r of TK){const a=e.find(l=>l.role===r);if(iA(t,r)||(t==null?void 0:t.status)==="running"&&t.done.includes(r)&&!a){n.push({role:r,state:"drawing",...a?{url:a.url,hash:a.hash}:{}});continue}if(a){n.push({role:r,state:"shown",url:a.url,hash:a.hash,earlier:a.earlier,...a.setup?{setup:a.setup}:{}});continue}const i=t==null?void 0:t.failed.find(l=>l.role===r);i&&n.push({role:r,state:"failed",error:i.error})}return n}function $K(e,t=[],n){return e.filter(r=>!t.some(a=>a.role===r)&&!iA(n,r))}function DK(e=[]){return e.filter(t=>t.earlier).map(t=>t.role)}function gv(e){if(e.status==="failed")return e.error??"The examples did not draw";if(e.status==="cancelled")return"Stopped";const t=e.total?` · ${e.done??0} of ${e.total}`:"";if(e.status==="running"){const n=e.step&&e.step in ix?ix[e.step]:null;return`${n?`Drawing the ${n}`:"Drawing examples"}${t}`}return e.done===1?"One example drawn":`${e.done??0} examples drawn`}const cA=50;function Fo(e){return Date.parse(e.includes("T")?e:`${e.replace(" ","T")}Z`)}function Oi(e){return e.startedAt||e.createdAt}function nc(e,t=Date.now()){const n=Fo(e);return Number.isNaN(n)?0:Math.max(0,Math.round((t-n)/1e3))}function vv(e,t=Date.now()){const n=nc(e,t);return n<20?"generating":n<60?"still generating":"taking longer than usual"}function rc(e,t=Date.now()){const n=nc(e,t),r=u=>String(u).padStart(2,"0"),a=Math.floor(n/3600),i=Math.floor(n%3600/60),l=n%60;return a>0?`${a}:${r(i)}:${r(l)}`:`${i}:${r(l)}`}function uA(e,t=Date.now()){const n=nc(e,t);if(n<45)return"just now";if(n<3600)return`${Math.round(n/60)}m ago`;if(n<86400)return`${Math.floor(n/3600)}h ago`;const r=Math.floor(n/86400);return r===1?"Yesterday":`${r}d ago`}function dA(e){if(!e)return 0;if(e.stage==="discovering")return e.discovered?15:8;if(e.stage==="fetching_products"){const t=Math.max(e.discovered,e.fetched,1);return 15+Math.min(45,Math.round(e.fetched/t*45))}if(e.stage==="processing_assets"){const t=Math.max(e.imagesTotal,1);return 60+Math.min(35,Math.round(e.imagesDone/t*35))}return e.stage==="completed"||e.stage==="no_catalog"?100:e.stage==="partial"?95:5}const fA=e=>e.setNames.length>0?`${e.setNames.join(", ")} · `:"";function h6(e,t,n=Date.now(),r=1){const a=fA(e),i=r>1?`${r} shots`:"ready",l=e.status==="running"?`${a}${vv(Oi(e),n)}`:e.status==="error"?`${a}${e.error??"failed"}`:e.status==="cancelled"?`${a}cancelled`:`${a}${i}`;return{id:`node:${e.id}`,kind:e.kind==="edit"?"edit":"generation",state:e.status,title:e.kind==="edit"?`Edit · ${Sr(e)}`:Sr(e),subtitle:l,thumb:e.images[0]??null,percent:null,startedAt:e.status==="running"?Oi(e):e.createdAt,href:Wp(t,null,e.id)}}function HK(e,t,n=Date.now()){var f,h;const r=[...e].sort((p,g)=>(p.batchIndex??0)-(g.batchIndex??0)),a=r[0];if(r.length===1)return h6(a,t,n);const i=r.filter(p=>p.status==="done"&&p.images.length>0),l=r.some(p=>p.status==="running")?"running":i.length?"done":r.some(p=>p.status==="error")?"error":"cancelled",u=h6({...a,status:l,images:((f=i[0])==null?void 0:f.images)??[],error:l==="error"?((h=r.find(p=>p.status==="error"))==null?void 0:h.error)??null:a.error},t,n,r.length);return l==="done"&&i.length<r.length?{...u,subtitle:`${fA(a)}${i.length} of ${r.length} shots`}:u}function OK(e){var t,n;return e.stage==="no_catalog"||e.stage==="failed"&&((n=(t=e.errors)==null?void 0:t[0])==null?void 0:n.code)==="empty_catalog"}function IK(e,t){const n=OK(e),r=n||e.stage==="completed"?"done":e.stage==="partial"?"partial":e.stage==="cancelled"?"cancelled":e.stage==="failed"?"error":"running";let a=e.url;try{a=new URL(e.url).hostname.replace(/^www\./,"")}catch{}const i=e.stage==="discovering"?e.discovered?`Found ${e.discovered.toLocaleString()} products`:"Looking for products":e.stage==="processing_assets"&&e.imagesTotal?`${e.imagesDone.toLocaleString()} of ${e.imagesTotal.toLocaleString()} pictures`:e.stage==="fetching_products"&&e.fetched>e.upserted&&e.discovered?`Reading ${e.fetched.toLocaleString()} of ${e.discovered.toLocaleString()} products`:e.discovered?`${e.upserted.toLocaleString()} of ${e.discovered.toLocaleString()} products`:`${e.upserted.toLocaleString()} products`;return{id:`catalog:${e.id}`,kind:"catalog",state:r,title:a,subtitle:n?"No shop on this site":r==="error"||r==="cancelled"||r==="partial"?e.message??"Import failed":i,thumb:null,percent:n?100:dA(e),startedAt:e.createdAt,href:Eu(t)}}function FK(e,t){const n=e.stage==="done"?"done":e.stage==="failed"?"error":e.stage==="cancelled"?"cancelled":"running",r=n==="error"?e.error??"failed":n==="cancelled"?"stopped":n==="done"?e.warnings[0]??e.coverage[0]??(e.kind==="presenter"?"Ready to cast":"Ready to use"):e.message??(e.kind==="presenter"?"Building the studio views":"Reading the references");return{id:`build:${e.id}`,kind:e.kind,state:n,title:e.name,subtitle:r,thumb:e.previewHash,percent:e.steps>0?Math.min(100,Math.round(e.step/e.steps*100)):null,startedAt:e.startedAt,href:e.assetId?e.kind==="presenter"?ha(t,e.assetId):_r(t,e.assetId):null}}function _K(e){if(e.kind==="examples")return gv(e);if(e.status==="failed")return e.error??"It did not finish";if(e.status==="cancelled")return"Stopped";if(e.kind==="scene")return e.status==="running"?e.step==="reading"?"Reading the place":e.step==="changing"?"Changing the words":"Drawing the picture":e.attachTo?"On its scene now":"The picture is drawn";const t=e.step&&e.step in bn?bn[e.step]:null;return e.status==="running"?t?`Drawing the ${t}`:"Reading the photos":e.awaiting&&t?`The ${t} is ready to look at`:e.total&&e.done===e.total?"Every view is drawn":e.total?`${e.done??0} of ${e.total} views`:"Drawn"}function ZK(e,t){const n=e.status==="failed"?"error":e.status,r=e.kind==="examples"?e.sceneId?_r(t,e.sceneId):null:e.kind==="scene"?e.conversation?e.sceneId?uv(t,e.sceneId,e.conversation):Vi(t,e.conversation):e.attachTo?_r(t,e.attachTo):null:e.presenterId?Up(t,e.presenterId):e.draftId?zi(t,e.draftId):null;return{id:e.id,kind:e.kind==="examples"?"scene":e.kind,state:n,title:e.name.trim()||(e.kind==="presenter"?"New presenter":"New scene"),subtitle:_K(e),thumb:e.thumb,percent:e.kind!=="scene"&&e.total?Math.round((e.done??0)/e.total*100):null,startedAt:e.startedAt,href:r}}const lx=e=>e.startsWith("scene:")||e.startsWith("presenter:")||e.startsWith("examples:");function cx(e,t){return e?e.split("?")[0].replace(/\/$/,"")===t.replace(/\/$/,""):!1}function VK(e,t=12){const n=e.filter(a=>a.state==="running"),r=e.filter(a=>a.state!=="running").sort((a,i)=>Fo(i.startedAt)-Fo(a.startedAt)).slice(0,t);return n.sort((a,i)=>Fo(a.startedAt)-Fo(i.startedAt)),[...n,...r]}function zK(e,t,n=new Date){if(!e)return[];const r=[];for(const a of t){if(a.state==="running")continue;const i=e.get(a.id);i&&i.state!=="running"||r.push({id:a.id,kind:a.kind,state:a.state,title:a.title,subtitle:a.subtitle,thumb:a.thumb,at:n.toISOString(),href:a.href})}return r}function BK(e,t,n=cA){if(t.length===0)return e;const r=new Set(t.map(a=>a.id));return[...t,...e.filter(a=>!r.has(a.id))].sort((a,i)=>Fo(i.at)-Fo(a.at)).slice(0,n)}function UK(e,t){const n=e.filter(a=>!a.watched);if(!t)return n.length;const r=Fo(t);return n.filter(a=>Fo(a.at)>r).length}const hA=e=>`scenri:notifications-${e}`,pA=e=>`scenri:notifications-seen-${e}`,mA=e=>cs.get(e),gA=(e,t)=>cs.set(e,t);function ux(e){const t=mA(hA(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}const dx=(e,t)=>gA(hA(e),JSON.stringify(t.slice(0,cA))),fx=e=>mA(pA(e)),WK=(e,t)=>gA(pA(e),t);function Pg(e,t){return e===t?!0:e.length!==t.length?!1:JSON.stringify(e)===JSON.stringify(t)}const KK=1500,GK=5e3,vA=s.createContext(null);function Za(){const e=s.useContext(vA);if(!e)throw new Error("useTaskCenter must be used inside TaskCenterProvider");return e}function YK({brand:e,onActivity:t,children:n}){const r=Dn(),{push:a}=or(),{refreshBrands:i}=Rn(),l=e.id,[u,f]=s.useState([]),[h,p]=s.useState([]),[g,v]=s.useState([]),w=s.useRef(e);w.current=e;const y=s.useRef([]);y.current=h;const[x,k]=s.useState(()=>ux(l)),[S,E]=s.useState(()=>fx(l)),[j,N]=s.useState(!1),P=s.useRef(null),$=s.useRef(new Set),M=s.useRef(0),C=s.useRef(new Set),R=s.useRef(i);R.current=i;const T=s.useRef(null),H=s.useRef(j);H.current=j;const D=s.useRef(r);D.current=r;const{pathname:K}=Zn(),O=s.useRef(!1);O.current=/\/(create|sets)(\/|$)/.test(K);const Z=s.useRef(a);Z.current=a;const te=s.useRef(t);te.current=t,s.useEffect(()=>{P.current=null,$.current=new Set,M.current=0,C.current=new Set,f([]),p([]),v([]),k(ux(l)),E(fx(l))},[l]);const B=s.useCallback(async()=>{var re,_;let U,G,ne;try{const[{nodes:ue,jobs:We,studio:Xe=[]},{builds:ze}]=await Promise.all([Re.activity(l),Re.assetBuilds(l)]);G=ze,ne=Xe,(re=te.current)==null||re.call(te,l,ue);const tt=new Map,ce=[];for(const Pe of ue)Pe.batchId?tt.set(Pe.batchId,[...tt.get(Pe.batchId)??[],Pe]):ce.push(Pe);const ve=Date.now();U=[...ce.map(Pe=>h6(Pe,w.current,ve)),...[...tt.values()].map(Pe=>HK(Pe,w.current,ve)),...We.map(Pe=>IK(Pe,w.current)),...ze.map(Pe=>FK(Pe,w.current)),...Xe.map(Pe=>ZK(Pe,w.current))]}catch{return}const q=G.filter(ue=>ue.finished&&ue.assetId&&!C.current.has(ue.id)),le=new Set(G.map(ue=>ue.id)),Se=y.current.some(ue=>!ue.finished&&!le.has(ue.id)),Q=ne.filter(ue=>ue.kind==="scene"&&ue.status==="done"&&!!ue.attachTo&&!C.current.has(ue.id));for(const ue of Q)C.current.add(ue.id);const xe=ne.filter(ue=>ue.kind==="examples"&&(ue.done??0)>0).map(ue=>`${ue.id}:${ue.done}`).filter(ue=>!C.current.has(ue));for(const ue of xe)C.current.add(ue);if(q.length||Se||Q.length||xe.length){for(const ue of q)C.current.add(ue.id),uK(l,ue.kind,ue.id);await R.current()}p(ue=>Pg(ue,G)?ue:G),v(ue=>Pg(ue,ne)?ue:ne);const ee=zK(P.current,U);P.current=new Map(U.map(ue=>[ue.id,ue])),M.current=U.filter(ue=>ue.state==="running").length;const ae=VK(U);if(f(ue=>Pg(ue,ae)?ue:ae),ee.length!==0&&(k(ue=>{const We=window.location.pathname,Xe=ee.map(tt=>lx(tt.id)&&cx(tt.href,We)?{...tt,watched:!0}:O.current&&tt.state!=="error"?{...tt,watched:!0}:tt),ze=BK(ue,Xe);return dx(l,ze),ze}),!H.current))for(const ue of ee){if($.current.has(ue.id)||($.current.add(ue.id),ue.state==="cancelled"))continue;if(lx(ue.id)){if(cx(ue.href,window.location.pathname))continue;const ze=ue.href,tt=ze?[{label:"Open",onClick:()=>D.current(ze)}]:void 0;if(ue.state==="error"){Z.current({kind:"error",title:`${ue.title} did not finish`,detail:ue.subtitle,actions:tt});continue}Z.current({kind:"success",title:ue.id.startsWith("examples:")?`${ue.title} examples are ready`:`${ue.title} is drawn`,detail:ue.kind==="presenter"?ue.subtitle:void 0,actions:tt});continue}if(ue.state!=="error"&&O.current&&ue.kind!=="presenter"&&ue.kind!=="scene")continue;const We=ue.href,Xe=We?{label:"View",onClick:()=>D.current(We)}:void 0;if(ue.state==="error"){const ze=O.current&&(ue.kind==="generation"||ue.kind==="edit");Z.current({kind:"error",title:`${ue.title} failed`,detail:ue.subtitle,action:Xe,quiet:ze});continue}if(ue.kind==="presenter"||ue.kind==="scene"){const ze=ue.id.startsWith("build:")?((_=G.find(tt=>`build:${tt.id}`===ue.id))==null?void 0:_.assetId)??null:null;Z.current({kind:"success",title:`${ue.title} is ready`,detail:ue.subtitle,actions:We?[{label:ue.kind==="presenter"?"View presenter":"View scene",onClick:()=>D.current(We)},{label:"Use in a shot",onClick:()=>D.current(`${mr(w.current)}?${ue.kind==="presenter"?"presenter":"scene"}=${ze}&compose=1`)}]:void 0});continue}if(ue.kind==="catalog"&&ue.state==="partial"){Z.current({kind:"warning",title:"Some products did not import",detail:ue.subtitle,action:Xe});continue}Z.current({kind:"success",title:ue.kind==="catalog"?"Import finished":"Generation finished",detail:ue.kind==="catalog"?ue.title:void 0,action:Xe})}},[l]);s.useEffect(()=>{let U=null,G=!0;const ne=async()=>{if(!G||(document.hidden||await B(),!G))return;const le=!document.hidden&&M.current>0;U=setTimeout(ne,le?KK:GK)},q=()=>{U&&clearTimeout(U),U=null,document.hidden||ne()};return T.current=q,ne(),document.addEventListener("visibilitychange",q),window.addEventListener("focus",q),()=>{G=!1,T.current=null,U&&clearTimeout(U),document.removeEventListener("visibilitychange",q),window.removeEventListener("focus",q)}},[B]);const F=s.useCallback(()=>{var U;return(U=T.current)==null?void 0:U.call(T)},[]),X=s.useCallback(()=>{const U=new Date().toISOString();E(U),WK(l,U)},[l]),z=s.useCallback(()=>{k([]),dx(l,[]),X()},[l,X]),I=s.useMemo(()=>({tasks:u,running:u.filter(U=>U.state==="running").length,builds:h,studio:g,feed:x,unread:UK(x,S),markSeen:X,clearFeed:z,panelOpen:j,setPanelOpen:N,poke:F}),[u,h,g,x,S,X,z,j,F]);return o.jsx(vA.Provider,{value:I,children:n})}const wA=["primary","mark","wordmark","monochrome","alternate"],wv=["light","dark","any"],V1={primary:"Primary logo",mark:"Mark",wordmark:"Wordmark",monochrome:"Monochrome",alternate:"Alternate"},qK=/^[a-f0-9]{32}$/,XK=e=>{const t=String(e??"");if(!t.startsWith("asset:"))return null;const n=t.slice(6);return qK.test(n)?n:null},QK=e=>wA.includes(e)?e:"primary",JK=e=>wv.includes(e)?e:"any";function bf(e){return(Array.isArray(e==null?void 0:e.logos)?e.logos:[]).filter(n=>n&&String(n.file??"").trim()).map(n=>{const r=XK(n.file),a=String(n.clearSpace??"").trim();return{hash:r,file:String(n.file),role:QK(n.role),background:JK(n.background),...a?{clearSpace:a}:{},attachable:r!==null}})}function xf(e){return bf(e).filter(t=>t.attachable)}function Yp(e){return e.find(t=>t.role==="primary")??e[0]??null}function eG(e){return Yp(bf(e))}function tG(e){const t=bf(e);return t.find(n=>n.role==="mark")??Yp(t)}function nG(e){const t=bf(e).filter(a=>a.hash),n=t.find(a=>a.role==="mark");if(n)return{mark:n,square:!0};const r=Yp(t);return!r||r.role==="wordmark"?null:{mark:r,square:!1}}const rG=1.6,sG=(e,t)=>t>0&&e/t<=rG;function aG(e,t){const n=(i,l)=>Math.min(l-1,Math.max(0,Math.round(i*(l-1))));return[[n(.5,e),n(.03,t)],[n(.5,e),n(1-.03,t)],[n(.03,e),n(.5,t)],[n(1-.03,e),n(.5,t)],[n(.12,e),n(.12,t)],[n(1-.12,e),n(.12,t)],[n(.12,e),n(1-.12,t)],[n(1-.12,e),n(1-.12,t)]]}const oG=e=>e.length>0&&e.every(t=>t>=200);function qp(e,t){var a;const n={primary:"logo",mark:"mark",wordmark:"wordmark",monochrome:"monochrome logo",alternate:"alternate logo"},r=String(((a=e==null?void 0:e.meta)==null?void 0:a.name)??"").trim();return r?`${r} ${n[t.role]}`:`Brand ${n[t.role]}`}function yv(e){const{brand:t}=on(),{pathname:n}=Zn(),r=!!un(ct.brand),a=!!un({path:ct.hub,end:!1}),i=!!un({path:ct.set,end:!1}),l=a||i,u=!!un({path:ct.products,end:!1}),f=!!un({path:ct.scenes,end:!1}),h=!!un({path:ct.presenters,end:!1}),p=g=>g?"fill":"regular";return[{key:"home",label:"Home",icon:o.jsx(zU,{size:e,weight:p(r)}),active:r,to:mo(t)},{key:"create",label:"Create",icon:o.jsx(XU,{size:e,weight:p(l)}),active:l,to:l?`${n}?compose=1`:`${mr(t)}?compose=1`},{key:"products",label:"Products",icon:o.jsx(Zp,{size:e,weight:p(u)}),active:u,to:Eu(t)},{key:"presenters",label:"Presenters",icon:o.jsx(Fp,{size:e,weight:p(h)}),active:h,to:qi(t)},{key:"scenes",label:"Scenes",icon:o.jsx(Ip,{size:e,weight:p(f)}),active:f,to:_u(t)}]}const ca=e=>{var t,n;return((n=(t=e.json)==null?void 0:t.meta)==null?void 0:n.name)??e.slug};function iG(e){return([...e.trim()].find(n=>new RegExp("\\p{L}|\\p{N}","u").test(n))??"?").toUpperCase()}function lG(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"#ffffff";const[n,r,a]=[0,2,4].map(l=>Number.parseInt(t[1].slice(l,l+2),16)/255),i=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(a)>.42?"#0a0a0a":"#ffffff"}const hx=new Map;function cG(e,t){const n=e.naturalWidth,r=e.naturalHeight,a=t||sG(n,r);let i=!1;try{const l=document.createElement("canvas");l.width=n,l.height=r;const u=l.getContext("2d",{willReadFrequently:!0});u&&(u.drawImage(e,0,0),i=oG(aG(n,r).map(([f,h])=>u.getImageData(f,h,1,1).data[3])))}catch{}return{fits:a,bleed:i}}function yA({brand:e,size:t=20,round:n=!1}){var h,p,g;const[,r]=s.useReducer(v=>v+1,0),a=nG(e.json),i=a?Bp(a.mark.file,"micro"):null,l=i?hx.get(i):void 0,u=i&&(l!=null&&l.fits)?i:null,f=((g=(p=(h=e.json)==null?void 0:h.palette)==null?void 0:p.primary)==null?void 0:g.hex)??"#6b6b6b";return o.jsxs("span",{className:"sc-brand-av","data-logo":u?"":void 0,"data-bleed":u&&(l!=null&&l.bleed)?"":void 0,"data-round":n||void 0,style:{width:t,height:t,fontSize:Math.round(t*.5),...u?{}:{background:f,color:lG(f)}},"aria-hidden":!0,children:[u?o.jsx("img",{src:u,alt:""}):iG(ca(e)),i&&!l&&o.jsx("img",{src:i,alt:"",hidden:!0,onLoad:v=>{hx.set(i,cG(v.currentTarget,!!(a!=null&&a.square))),r()}})]})}function uG(){const e=yv(22);return o.jsx("nav",{className:"sc-tabbar","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsxs(_n,{to:t.to,"data-on":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:[o.jsx("span",{className:"sc-tab-ic",children:t.icon}),o.jsx("span",{className:"sc-tab-lb",children:t.label})]})},t.key))})})}function dG({value:e,size:t,stroke:n=1.5,indeterminate:r=!1}){const a=(t-n)/2,i=2*Math.PI*a,l=Math.max(0,Math.min(1,e)),u=f=>o.jsx("circle",{className:"sc-ring-arc",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n,strokeLinecap:"round",strokeDasharray:f,strokeDashoffset:r?0:i*(1-l),transform:`rotate(-90 ${t/2} ${t/2})`});return o.jsxs("svg",{className:"sc-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[!r&&o.jsx("circle",{className:"sc-ring-track",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n}),r?o.jsx("g",{className:"sc-ring-spin",children:u(`${i*.28} ${i}`)}):null,!r&&l>0?u(String(i)):null]})}function fG({mode:e,lead:t,running:n,unread:r,animate:a}){const i=hG(a);if(e==="busy"&&t){const l=t.percent!==null;return o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-ring","data-bare":t.thumb?void 0:"",children:[o.jsx(dG,{value:l?(t.percent??0)/100:0,indeterminate:!l,size:32}),t.thumb?o.jsx("img",{src:dn(t.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):o.jsx(Sg,{size:16}),n>1&&o.jsx("span",{className:"sc-act-n",children:n})]})})}return e==="new"?o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-bell",children:[o.jsx(Sg,{size:18}),o.jsx("span",{className:"sc-act-n",children:r>9?"9+":r})]})}):o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsx(Sg,{size:18})})}function hG(e){return s.useRef(e).current}const bA="the engine",pG=[{re:/Codex plan's usage limit is used up/i,kind:"credit",title:()=>"",remedy:{label:"Use a provider key instead",opens:"engines"},retryable:!1},{re:/environment is overriding that sign-in/i,kind:"auth",title:()=>"An API key on this computer is overriding your Codex sign-in.",fix:"Tell Scenri to ignore it, then run this again.",remedy:{label:"Fix this",opens:"setup"},retryable:!0},{re:/codex.*(not logged in|login required|\b401\b|unauthorized|token.*expired)/i,kind:"auth",title:()=>"Codex is signed out on this machine.",fix:"Sign in with your ChatGPT account, then run this again.",remedy:{label:"Sign in",opens:"setup"},retryable:!1},{re:/HTTP 401\b|missing authentication|no auth credentials|invalid api key|unauthorized/i,kind:"auth",title:e=>`${Qa(e)} did not accept your API key.`,fix:"Add or replace the key, then run this again.",remedy:{label:"Add key",opens:"engines"},retryable:!1},{re:/HTTP 403\b|forbidden/i,kind:"auth",title:e=>`${Qa(e)} refused this key.`,fix:"It may not cover the model this shot asked for.",remedy:{label:"Check key",opens:"engines"},retryable:!1},{re:/spend cap for .*would exceed it|spend cap for/i,kind:"budget",title:e=>`This would go past your monthly cap for ${e}.`,fix:"Raise the cap, or wait for the month to roll over.",remedy:{label:"Open budget",opens:"budget"},retryable:!1},{re:/HTTP 402\b|insufficient (credit|funds|balance)|out of credit|billing|payment required/i,kind:"credit",title:e=>`${Qa(e)} is out of credit.`,fix:"Top up with the provider, then run this again.",retryable:!0},{re:/HTTP 429\b|rate.?limit|too many requests/i,kind:"rate",title:e=>`${Qa(e)} is rate limiting this key.`,fix:"Give it a minute, then try again.",retryable:!0},{re:/moderation|content policy|safety system|flagged|violat(es|ion)|blocked by/i,kind:"policy",title:e=>`${Qa(e)} declined this brief.`,fix:"Reword what you asked for and run it again.",retryable:!1},{re:/cannot carry enough reference images/i,kind:"references",title:()=>"",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/no usable photo/i,kind:"references",title:()=>"",retryable:!1},{re:/cannot produce the requested aspect ratio|engine returned \d+x\d+ for a \d+x\d+ request/i,kind:"format",title:e=>`${Qa(e)} cannot make this shape.`,fix:"Pick another format, or an engine that can.",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/HTTP 404\b|model not found|no endpoints found|no allowed providers/i,kind:"model",title:e=>`${Qa(e)} has no model for this shot.`,fix:"Pick another engine in the composer, or connect one in Providers.",remedy:{label:"Providers",opens:"engines"},retryable:!1},{re:/failed to spawn codex|codex.*enoent|command not found/i,kind:"setup",title:()=>"Codex is not installed on this machine.",fix:"Run setup once and this works from then on.",remedy:{label:"Set up Codex",opens:"setup"},retryable:!1},{re:/code-mode host/i,kind:"setup",title:()=>"Codex could not start its tool host.",fix:"A Windows setting is blocking it. Set SafeDllSearchMode to 1 and restart Windows.",retryable:!1},{re:/could not verify codex/i,kind:"setup",title:()=>"Scenri could not verify Codex.",fix:"Open setup and check again. If Codex was just installed, restart Scenri.",remedy:{label:"Check Codex",opens:"setup"},retryable:!0},{re:/codex cli .* is too old|Scenri needs \d+\.\d+\.\d+ or newer/i,kind:"setup",title:()=>"Codex CLI needs an update.",fix:"Update Codex, then run this again.",remedy:{label:"Update Codex",opens:"setup"},retryable:!1},{re:/\brun aborted\b/i,kind:"cancelled",title:()=>"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",retryable:!0},{re:/produced no output for \d+s/i,kind:"timeout",title:()=>"Codex never started answering.",fix:"Try again. If it keeps happening, run Codex once in a terminal to check it still works.",retryable:!0},{re:/Codex CLI timed out after/i,kind:"timeout",title:()=>"Codex ran out of time on this shot.",fix:"Try again. Fewer variants or fewer reference photos finish faster.",retryable:!0},{re:/generation timed out after \d+ minutes?/i,kind:"timeout",title:()=>"This run hit the overall time limit.",fix:"Try again, with fewer variants if it repeats.",retryable:!0},{re:/timed out|ETIMEDOUT/i,kind:"timeout",title:e=>`${Qa(e)} took too long to answer.`,fix:"Try again.",retryable:!0},{re:/ENOTFOUND|ECONNREFUSED|ECONNRESET|EAI_AGAIN|fetch failed|network error/i,kind:"network",title:e=>`Could not reach ${e}.`,fix:"Check your connection, then try again.",retryable:!0},{re:/interrupted\W+server restarted/i,kind:"restarted",title:()=>"Scenri restarted while this was rendering.",fix:"The shot was lost, not the brief. Run it again.",retryable:!0},{re:/HTTP 5\d\d\b|internal server error|bad gateway|service unavailable|overloaded|upstream/i,kind:"server",title:e=>`${Qa(e)} had a problem on its end.`,fix:"Nothing wrong with your brief. Try again shortly.",retryable:!0},{re:/produced no images|returned no image|no images returned|finished but produced no/i,kind:"empty",title:e=>`${Qa(e)} finished without making a picture.`,fix:"Run it again. This usually clears on a second try.",retryable:!0}];function Qa(e){return e===bA?"The engine":e}function kf(e,t){const n=(e??"").trim(),r=(t??"").replace(/\s*\(BYOK\)\s*$/i,"").trim()||bA;if(!n)return{kind:"unknown",title:"This shot did not finish.",raw:"",retryable:!0};for(const a of pG){if(!a.re.test(n))continue;const i=a.title(r)||mG(n);return{kind:a.kind,title:i,fix:a.fix,raw:n,remedy:a.remedy,retryable:a.retryable}}return{kind:"unknown",title:"This shot did not finish.",raw:n,retryable:!0}}function xA(){return{kind:"cancelled",title:"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",raw:"",retryable:!0}}function nn(e,t,n){const r=e instanceof Error?e.message:typeof e=="string"?e:String((e==null?void 0:e.message)??e),a=kf(r,n),i=a.kind==="unknown"?a.raw||void 0:[a.title,a.fix].filter(Boolean).join(" ");return{kind:"error",title:t,detail:i}}function mG(e){const t=e.trim();if(!t)return t;const n=t[0].toUpperCase()+t.slice(1);return/[.!?]$/.test(n)?n:`${n}.`}function px({onClose:e,onSeen:t,onOpenDetail:n}){const{tasks:r,feed:a,unread:i,clearFeed:l}=Za(),u=r.filter(S=>S.state==="running"),{brand:f}=on(),{push:h}=or(),p=wG(1e3),g=s.useRef(null),v=s.useRef(null),w=s.useRef(!1);s.useEffect(()=>{var S;!w.current||a.length>0||(w.current=!1,(S=g.current)==null||S.focus({preventScroll:!0}))},[a.length]);const y=()=>{w.current=!0,l()},x=S=>{var E;S.detail===0&&((E=v.current)==null||E.focus({preventScroll:!0})),t()},k=S=>{if(S.startsWith("node:")){Re.cancelNode(S.slice(5)).catch(E=>h(nn(E,"Could not cancel this shot")));return}if(S.startsWith("build:")){Re.cancelAssetBuild(f.id,S.slice(6)).catch(E=>h(nn(E,"Could not stop this build")));return}if(S.startsWith("scene:")){Re.cancelSceneStudioJob(f.id,S.slice(6)).catch(E=>h(nn(E,"Could not stop this scene")));return}if(S.startsWith("presenter:")){const E=S.split(":")[1]??"";Re.stopDraft(f.id,E).catch(j=>h(nn(j,"Could not stop this presenter")));return}S.startsWith("catalog:")&&Re.cancelCatalogJob(f.id,S.slice(8)).catch(E=>h(nn(E,"Could not stop this import")))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-head",children:"Activity"}),o.jsxs("div",{className:"sc-notif-scroll",children:[u.length>0&&o.jsxs("section",{"aria-label":"In progress",children:[o.jsx("h3",{className:"sc-notif-label",children:"In progress"}),u.map(S=>o.jsx(gG,{task:S,now:p,onNavigate:e,onCancel:k,onOpenDetail:n},S.id))]}),o.jsxs("section",{"aria-label":"Notifications",children:[o.jsxs("div",{className:"sc-notif-label",children:[o.jsx("h3",{children:"Notifications"}),a.length>0&&o.jsxs("span",{className:"sc-notif-acts",children:[i>0&&o.jsx("button",{type:"button",className:"sc-notif-seen",onClick:x,children:"Mark all read"}),o.jsx("button",{ref:v,type:"button",className:"sc-notif-clear",onClick:y,children:"Clear all"})]})]}),a.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"You have no notifications yet."}):a.map(S=>o.jsx(vG,{item:S,now:p,onNavigate:e,onSeen:t},S.id))]})]})]})}function kA({task:e}){return e.thumb?o.jsx("img",{src:dn(e.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):e.state==="running"?o.jsx("span",{className:"sc-shimmer"}):e.state==="error"?o.jsx(kc,{size:17,weight:"fill"}):e.state==="cancelled"?o.jsx(sW,{size:17,color:"var(--sc-fg3)"}):e.kind==="catalog"?o.jsx(mj,{size:17}):e.kind==="presenter"?o.jsx(Fp,{size:17}):e.kind==="scene"?o.jsx(Ip,{size:17}):o.jsx(Ws,{size:17})}function gG({task:e,now:t,onNavigate:n,onCancel:r,onOpenDetail:a}){const i=e.state==="running",l=e.id.startsWith("node:")||e.id.startsWith("build:")||e.id.startsWith("catalog:"),u=i&&nc(e.startedAt,t)>=60,f=i&&e.id.startsWith("catalog:")?e.id.slice(8):null,h=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(kA,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle}),i&&e.percent!==null?o.jsx("span",{className:"sc-notif-meter",children:o.jsx("div",{style:{width:`${e.percent}%`}})}):null]}),o.jsx("span",{className:"sc-notif-time",children:i?rc(e.startedAt,t):uA(e.startedAt,t)})]});return o.jsxs("div",{className:"sc-notif-row-wrap",children:[f?o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,onClick:()=>a(f),children:h}):e.href?o.jsx(_n,{className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,to:e.href,onClick:n,children:h}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,disabled:!0,children:h}),i&&l&&o.jsx("button",{type:"button",className:"sc-notif-row-cancel","data-urgent":u||void 0,onClick:p=>{p.stopPropagation(),r(e.id)},children:"Cancel"})]})}function vG({item:e,now:t,onNavigate:n,onSeen:r}){const a=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(kA,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle})]}),o.jsx("span",{className:"sc-notif-time",children:uA(e.at,t)})]});return e.href?o.jsx(_n,{className:"sc-notif-row","data-state":e.state,to:e.href,onClick:()=>{r(),n()},children:a}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,disabled:!0,children:a})}function wG(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function ed(e){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(0),a=u=>{u.pointerType==="mouse"&&u.button!==0||(n.current={y:u.clientY,t:u.timeStamp},r.current=0,t.current&&(t.current.style.transition="none"),u.currentTarget.setPointerCapture(u.pointerId))},i=u=>{!n.current||!t.current||(r.current=Math.max(0,u.clientY-n.current.y),t.current.style.transform=`translateY(${r.current}px)`)},l=u=>{const f=n.current;if(n.current=null,!f||!t.current)return;t.current.style.transition="";const h=r.current/Math.max(1,u.timeStamp-f.t);if(r.current>96||h>.45){e();return}t.current.style.transform=""};return{sheet:t,grip:{onPointerDown:a,onPointerMove:i,onPointerUp:l,onPointerCancel:l}}}function SA({label:e,onClose:t,children:n}){const{sheet:r,grip:a}=ed(t);return s.useEffect(()=>{const i=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),Rr.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-notif-scrim",onClick:t,"aria-hidden":!0}),o.jsxs("div",{ref:r,className:"sc-notif-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[o.jsx("div",{className:"sc-shotsheet-grip",...a,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),n]})]}),document.body)}function EA(e,t){const{pathname:n}=Zn(),r=s.useRef(t);r.current=t,s.useEffect(()=>{r.current()},[n]),s.useEffect(()=>{if(!e)return;const a=()=>r.current();return window.addEventListener("scenri:modal-open",a),()=>window.removeEventListener("scenri:modal-open",a)},[e])}const yG=new Set(["Shift","Control","Alt","AltGraph","Meta","CapsLock","Fn","FnLock","Hyper","Super","OS"]);let Dh=null;function mx(e){Dh!==e&&(Dh=e,document.documentElement.dataset.input=e)}function bG(){const e=n=>{n.isComposing||n.key==="Unidentified"||yG.has(n.key)||mx("keyboard")},t=()=>mx("pointer");return window.addEventListener("keydown",e,!0),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("keydown",e,!0),window.removeEventListener("pointerdown",t,!0)}}function xG(){return Dh}function Xp(e){return Dh!=="pointer"&&e.matches(":focus-visible")}function lr({label:e,open:t,children:n}){return o.jsx(sv,{content:e,className:"sc-tip",maxWidth:"220px",...t?{open:!0}:{},children:jA(n)})}function CA(e,t,n){return n?t:o.jsx(lr,{label:e,children:t})}function jA(e){const t=e.props.onFocus;return s.cloneElement(e,{onFocus:n=>{t==null||t(n),xG()==="pointer"&&n.preventDefault()}})}function Ts({open:e=!0,className:t,maxWidth:n,described:r,children:a,onDismiss:i,onOpenAutoFocus:l,onCloseAutoFocus:u,onPaste:f,tone:h}){const{sheet:p,grip:g}=ed(i);s.useEffect(()=>{e&&window.dispatchEvent(new CustomEvent("scenri:modal-open"))},[e]);const v=l??YW,w=u;return o.jsx(fc,{open:e,onOpenChange:y=>!y&&i(),children:o.jsxs(hc,{children:[o.jsx(pc,{className:"sc-newdlg-scrim","data-tone":h}),o.jsx(mc,{className:"sc-newdlg-layer",...r?{}:{"aria-describedby":void 0},onOpenAutoFocus:v,onCloseAutoFocus:w,onPaste:f,onPointerDown:y=>{y.target===y.currentTarget&&i()},children:o.jsxs("div",{ref:p,className:["sc-newdlg",t].filter(Boolean).join(" "),style:n?{"--sc-newdlg-max":n}:void 0,children:[o.jsx("div",{className:"sc-shotsheet-grip",...g,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),a]})})]})})}function ds({className:e,children:t}){return o.jsx(gc,{className:e,children:t})}const As=s.forwardRef(function({children:t,...n},r){return o.jsx(vp,{asChild:!0,ref:r,...n,children:t})});function td({className:e,children:t}){return o.jsx(w4,{className:e,children:t})}const gx=300,kG={queued:"Waiting to start",discovering:"Looking through the site",fetching_products:"Reading products",processing_assets:"Saving pictures",completed:"Finished",partial:"Finished, with some gaps",no_catalog:"No shop on this site",cancelled:"Stopped",failed:"Could not finish"};function p6({brandId:e,jobId:t,onDismiss:n}){const[r,a]=s.useState(null),[i,l]=s.useState(!1);s.useEffect(()=>{let g=!1,v;const w=async()=>{try{const y=await Re.catalogJob(e,t);if(g)return;a(y),y.finishedAt||(v=setTimeout(w,gx))}catch{g||(v=setTimeout(w,gx*3))}};return w(),()=>{g=!0,v&&clearTimeout(v)}},[e,t]);const u=!!r&&!r.finishedAt,f=r?dA(r):0,h=(r==null?void 0:r.errors)??[],p=async()=>{l(!0);try{await Re.cancelCatalogJob(e,t)}catch{l(!1)}};return o.jsxs(Ts,{open:!0,className:"sc-imp",maxWidth:"440px",described:!0,onDismiss:n,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Importing products"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(td,{className:"sc-imp-sub",children:o.jsxs("span",{role:"status",children:[r?kG[r.stage]??"Working":"Getting the details",r!=null&&r.message?` · ${r.message}`:""]})}),u&&o.jsx("span",{className:"sc-imp-meter",role:"progressbar","aria-label":"Import progress","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${f}%`}})}),o.jsxs("ul",{className:"sc-imp-lines",children:[o.jsxs("li",{children:[o.jsx("span",{children:"Found on the site"}),o.jsx("b",{children:((r==null?void 0:r.discovered)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Read"}),o.jsx("b",{children:((r==null?void 0:r.fetched)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Saved"}),o.jsx("b",{children:((r==null?void 0:r.upserted)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Pictures"}),o.jsxs("b",{children:[((r==null?void 0:r.imagesDone)??0).toLocaleString(),r!=null&&r.imagesTotal?` of ${r.imagesTotal.toLocaleString()}`:""]})]})]}),h.length>0&&o.jsxs("details",{className:"sc-imp-errs",children:[o.jsx("summary",{children:h.length===1?"1 thing went wrong":`${h.length} things went wrong`}),o.jsx("ul",{children:h.slice(0,8).map((g,v)=>o.jsx("li",{children:g.message},v))})]}),o.jsxs("div",{className:"sc-imp-foot",children:[u?o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void p(),disabled:i,children:i?"Stopping":"Stop importing"}):o.jsx("span",{className:"sc-imp-done",children:(r==null?void 0:r.stage)==="cancelled"?"Stopped. What was already imported is kept.":"Nothing left to do."}),o.jsx("button",{type:"button",className:"sc-wiz-cta",onClick:n,children:u?"Leave it running":"Close"})]})]})}const Ks="(max-width: 767px)";function wr(e){const[t,n]=s.useState(()=>window.matchMedia(e).matches);return s.useEffect(()=>{const r=window.matchMedia(e),a=()=>n(r.matches);return a(),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[e]),t}const vx=new Map;function SG(e){let t=vx.get(e);if(!t){const n=window.matchMedia(e);t={mq:n,subscribe:r=>(n.addEventListener("change",r),()=>n.removeEventListener("change",r))},vx.set(e,t)}return t}function bv(){const e=SG("(hover: none)");return s.useSyncExternalStore(e.subscribe,()=>e.mq.matches,()=>!1)}function EG(){const{tasks:e,running:t,unread:n,panelOpen:r,setPanelOpen:a,markSeen:i}=Za(),{brand:l}=on(),u=wr(Ks),f=CG(),[h,p]=s.useState(null);s.useEffect(()=>p(null),[l.id]),EA(r,()=>a(!1));const g=e.find(k=>k.state==="running")??null,v=t>0?"busy":n>0?"new":"quiet",w="Activity"+(n?`, ${n} unread`:"")+(t?`, ${t} task${t===1?"":"s"} running`:""),y=v==="busy"&&g?`Rendering, ${rc(g.startedAt,Date.now())}`:"Activity",x=o.jsx(fG,{mode:v,lead:g,running:t,unread:n,animate:f});return u?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"data-on":r||void 0,"aria-label":w,"aria-expanded":r,onClick:()=>a(!r),children:x}),r?o.jsx(SA,{label:"Activity",onClose:()=>a(!1),children:o.jsx(px,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})}):null,h?o.jsx(p6,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]}):o.jsxs(o.Fragment,{children:[o.jsxs(Hu,{open:r,onOpenChange:a,children:[o.jsx(lr,{label:y,children:o.jsx(Ou,{children:o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"aria-label":w,children:x})})}),o.jsx(Iu,{align:"end",sideOffset:20,className:"sc-notif-pop","aria-label":"Activity",children:o.jsx(px,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})})]}),h?o.jsx(p6,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]})}function CG(){const[e,t]=s.useState(!1),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,t(!0))},[]),e}function jG(){const e=yv(16);return o.jsx("nav",{className:"sc-nav sc-desktop-only","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsx(_n,{to:t.to,"data-active":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:t.label})},t.key))})})}const m6=s.createContext(null);function AA({label:e,className:t,offset:n=22,trigger:r,children:a}){const i=wr(Ks),[l,u]=s.useState(!1),f=s.useRef(null),h=()=>u(!1),p=s.useCallback(()=>{var g;return(g=f.current)==null?void 0:g.focus({preventScroll:!0})},[]);return EA(l,h),i?o.jsxs(o.Fragment,{children:[s.cloneElement(r,{ref:f,onClick:()=>u(!l),"aria-haspopup":"dialog","aria-expanded":l,"data-on":l||void 0}),l&&o.jsx(SA,{label:e,onClose:h,children:o.jsxs("div",{className:"sc-menu-sheet",children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(m6.Provider,{value:{close:h,focusTrigger:p},children:a})]})})]}):o.jsxs(Ss,{open:l,onOpenChange:u,modal:!1,children:[o.jsx(Es,{children:s.cloneElement(r,{ref:f})}),o.jsxs(Cs,{align:"end",sideOffset:n,className:`sc-menu ${t??""}`,onPointerDownOutside:g=>{var v;(v=f.current)!=null&&v.contains(g.target)&&g.preventDefault()},onCloseAutoFocus:g=>{g.preventDefault();const v=document.activeElement;(!v||v===document.body)&&p()},children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(m6.Provider,{value:{close:null,focusTrigger:p},children:a})]})]})}function Cu({className:e="sc-menu-item",to:t,onSelect:n,disabled:r,children:a,...i}){const l=s.useContext(m6),u=l==null?void 0:l.close,f=n?()=>{l==null||l.focusTrigger(),setTimeout(()=>{l==null||l.focusTrigger(),n()},0)}:void 0;if(u){const h=()=>{u(),f==null||f()};return t?o.jsx(_n,{className:e,to:t,onClick:u,...i,children:a}):o.jsx("button",{type:"button",className:e,onClick:h,disabled:r,...i,children:a})}return t?o.jsx(tr,{asChild:!0,className:e,...i,children:o.jsx(_n,{to:t,children:a})}):o.jsx(tr,{className:e,onSelect:f,disabled:r,...i,children:a})}function NA(e,t){return[...e].sort((n,r)=>t(n).localeCompare(t(r),void 0,{sensitivity:"base"})||n.slug.localeCompare(r.slug))}function AG(e,t,n){const r=t.trim().toLowerCase(),a=r?e.filter(i=>n(i).toLowerCase().includes(r)||i.slug.toLowerCase().includes(r)):e;return NA(a,n)}function Wn({label:e,title:t,body:n,busy:r,onConfirm:a,fullWidth:i,open:l,onOpenChange:u,tone:f="red"}){const h=s.useRef(!1);s.useEffect(()=>{h.current=!1},[l]);const p=()=>{h.current||(h.current=!0,a())},g=s.useRef(null),v=l!==void 0;return o.jsxs(sf,{open:l,onOpenChange:w=>{w&&(h.current=!1),u==null||u(w)},children:[l===void 0&&o.jsx(M7,{children:o.jsx("button",{type:"button",className:f==="red"?"sc-btn sc-btn-ghost sc-btn-red":"sc-btn sc-btn-ghost",disabled:r,style:i?{width:"100%"}:void 0,children:e})}),o.jsxs(af,{maxWidth:"420px",onOpenAutoFocus:()=>{v&&(g.current=document.activeElement)},onCloseAutoFocus:w=>{var y;!v||!((y=g.current)!=null&&y.isConnected)||(w.preventDefault(),g.current.focus())},children:[o.jsx(of,{children:t}),o.jsx(lf,{size:"2",children:n}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(uf,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(cf,{children:o.jsx(ia,{color:"red",onClick:p,disabled:r,children:e})})]})]})]})}function NG(){const{brand:e}=on(),t=vf(),n=Dn(),r=Kp(),{push:a}=or(),[i,l]=s.useState(!1),u=async()=>{const f=await r.quit();f&&a({kind:"warning",title:"Scenri is still working",detail:f})};return o.jsxs(o.Fragment,{children:[o.jsxs(AA,{label:"Brands",className:"sc-menu-brand",trigger:o.jsx("button",{type:"button",className:"sc-org-btn","aria-label":`${ca(e)}, brand and settings`,children:o.jsx(yA,{brand:e,size:32,round:!0})}),children:[o.jsx(RG,{}),o.jsx("div",{className:"sc-menu-rule"}),o.jsxs(Cu,{onSelect:()=>n("/setup"),children:[o.jsx(cr,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up a brand"})]}),o.jsxs(Cu,{onSelect:()=>t(),children:[o.jsx(IU,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Settings"})]}),o.jsxs(Cu,{"data-quit":"",onSelect:()=>l(!0),children:[o.jsx(QU,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Shut down Scenri"})]})]}),o.jsx(Wn,{open:i,onOpenChange:l,label:"Shut down Scenri",title:"Shut down Scenri?",body:"This stops the Scenri server on this machine. Every open tab loses the studio until you start it again, from your desktop icon or with npx scenri.",busy:r.busy!=="idle",onConfirm:()=>void u()})]})}const MG=7;function RG(){const{brands:e}=Rn(),{brand:t}=on(),n=Dn(),[r,a]=s.useState(""),i=v=>ca(v).trim().toLowerCase(),l=new Map;for(const v of e)l.set(i(v),(l.get(i(v))??0)+1);const u=e.length>=MG,f=r.trim(),h=u&&f?AG(e,f,ca):[],p=v=>{const w=v.id===t.id,y=(l.get(i(v))??0)>1;return o.jsxs(Cu,{"data-current":w||void 0,"data-two-line":y||void 0,onSelect:w?void 0:()=>n(mo(v)),children:[o.jsx(yA,{brand:v,size:20,round:!0}),o.jsxs("span",{className:"sc-menu-brand-lb",children:[o.jsx("span",{dir:"auto",children:ca(v)}),y&&o.jsxs("span",{className:"sc-menu-brand-sub",children:["/",v.slug]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Kn,{size:14,className:"sc-menu-check","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", current brand"})]})]},v.id)},g=NA(e.filter(v=>v.id!==t.id),ca);return u?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"sc-menu-find",children:[o.jsx(Fu,{size:16,"aria-hidden":"true"}),o.jsx("input",{type:"search",value:r,placeholder:"Find a brand","aria-label":"Find a brand",onChange:v=>a(v.target.value),onKeyDown:v=>{const w=h.find(y=>y.id!==t.id);v.key!=="Enter"||!w||(v.preventDefault(),n(mo(w)))}})]}),o.jsx("div",{className:"sc-menu-brands",children:f?h.length>0?h.map(p):o.jsx("p",{className:"sc-menu-none",children:"No brand by that name."}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})})]}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})}function PG(){const e=wr("(min-width: 1024px)"),t=Zj(),[n]=el();return e?o.jsx("button",{type:"button",className:"sc-learn-btn","aria-haspopup":"dialog","data-on":n.has("learn")||void 0,onClick:()=>t(),children:"Learn"}):null}function ti(e){var n;if(e.avatarUrl)return{src:e.avatarUrl};const t=e.previewUrl??((n=e.shots)==null?void 0:n[0])??null;return t?{src:t,crop:"top"}:{src:null}}function xv(e){const t=Fr(e.avatar);if(t)return{src:t};const n=a=>{var i;return Array.isArray(a)?Fr((i=a[0])==null?void 0:i.file):null},r=Fr(e.preview)??n(e.shots)??n(e.sourceRefs);return r?{src:r,crop:"top"}:{src:null}}const LG=["hero","close","hands","angle","bold"],g6=e=>Array.isArray(e)?e.map(t=>Fr(t==null?void 0:t.file)).filter(t=>!!t):[],kv=e=>{var t;return(((t=e==null?void 0:e.json)==null?void 0:t.characters)??[]).filter(n=>(n==null?void 0:n.origin)==="custom")};function L0(e){return e.length<2?[...e]:e.slice().reverse()}function MA(e){const t=e.filter(n=>n.origin!=="catalog");return t.length===e.length?L0(e):[...L0(t),...e.filter(n=>n.origin==="catalog")]}function Sf(e){return L0(kv(e).filter(t=>!t.supersededBy).map(RA))}function TG(e,t){const n=kv(e).find(r=>r.id===t);return n?RA(n):void 0}function Sv(e,t){var i;const n=kv(e),r=new Set([t]);let a=t;for(;;){const l=(i=n.find(u=>u.id===a))==null?void 0:i.supersededBy;if(typeof l!="string"||!l||r.has(l)||!n.some(u=>u.id===l))return a;r.add(l),a=l}}function RA(e){var a;const t=g6(e.shots),n=g6(e.sourceRefs),r=Fr(e.preview)??t[0]??n[0]??null;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,presentation:e.presentation==="man"?"man":"woman",descriptor:String(e.descriptor??""),ageRange:String(e.ageRange??""),hair:String(e.hair??""),identityNotes:String(e.identityNotes??""),negativeConstraints:Array.isArray(e.negativeConstraints)?e.negativeConstraints.map(String):[],facial:String(e.facial??""),skin:String(e.skin??""),build:String(e.build??""),wardrobeDefault:"",suitableCategories:Array.isArray(e.suitableCategories)?e.suitableCategories.map(String):[],suitableStyles:[],width:1024,height:1280,previewUrl:r,avatarUrl:Fr(e.avatar),custom:!0,shots:t,sourceRefs:n,identityEdits:Array.isArray(e.identityEdits)?e.identityEdits.map(String):[],...e.revisionOf?{revisionOf:String(e.revisionOf)}:{},...e.supersededBy?{supersededBy:String(e.supersededBy)}:{},...e.source==="synthetic"||e.source==="photos"?{source:e.source}:{},...(a=e.likeness)!=null&&a.attestedAt?{likeness:{attestedAt:String(e.likeness.attestedAt),version:String(e.likeness.version??"v1")}}:{}}}function Cc(e){var n;const t=((n=e==null?void 0:e.json)==null?void 0:n.scenes)??[];return L0(t.map($G))}function Hh(e,t){return Cc(e).find(n=>n.id===t)}function $G(e){const t=g6(e.refs);return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,description:String(e.description??""),lighting:String(e.lighting??""),subject:e.subject==="product"||e.subject==="person"?e.subject:"either",collections:Array.isArray(e.collections)?e.collections.map(String):[],verticals:Array.isArray(e.verticals)?e.verticals.map(String):[],keywords:Array.isArray(e.keywords)?e.keywords.map(String):void 0,prompt:String(e.prompt??""),width:Number(e.width)||1024,height:Number(e.height)||1280,previewUrl:Fr(e.preview)??t[0]??null,previewColor:null,custom:!0,refs:t,instruction:e.instruction?String(e.instruction):void 0,camera:e.camera?String(e.camera):void 0,figure:e.figure?String(e.figure):void 0,figureTreatment:e.figureTreatment?String(e.figureTreatment):void 0,setups:Array.isArray(e.setups)?e.setups.filter(n=>(n==null?void 0:n.id)&&(n==null?void 0:n.label)&&(n==null?void 0:n.camera)).map(n=>({id:String(n.id),label:String(n.label),camera:String(n.camera)})):void 0,examples:Array.isArray(e.examples)?e.examples.filter(n=>LG.includes(n==null?void 0:n.role)&&Fr(n==null?void 0:n.file)).map(n=>({role:n.role,url:Fr(n.file),hash:String(n.file).slice(6),earlier:n.from!==e.preview,with:n.presenter?"presenter":"product",...n.setup?{setup:String(n.setup)}:{}})):void 0}}function Oh(e,t){const n=new Set(e.map(r=>r.id));return[...e,...t.filter(r=>!n.has(r.id))]}function v6(e,t){return t.map(n=>n.t==="character"&&n.id?{...n,id:Sv(e,n.id)}:n)}function PA(){const{brand:e,products:t}=on(),{scenes:n,presenters:r,demoProducts:a,showcase:i}=Rn();return s.useMemo(()=>{const l={presenters:Sf(e),scenes:Cc(e)},u=new Set,f=y=>!y||u.has(y)?null:(u.add(y),y),h=(y,x)=>{for(const k of y){const S=f(x(k));if(S)return sr(S,"tile")}return null},p=y=>h(i.filter(x=>{var k;return(((k=x.brief)==null?void 0:k.tokens)??[]).some(S=>(S==null?void 0:S.t)===y)}),x=>x.previewUrl),g=h([...t].reverse(),y=>{var x,k;return Fr((k=(x=y==null?void 0:y.shots)==null?void 0:x[0])==null?void 0:k.file)}),v=h(l.presenters,y=>y.previewUrl??ti(y).src),w=h(l.scenes,y=>y.previewUrl);return{product:{url:g??p("product")??h(a,y=>y.previewUrl)??null,count:t.length,own:!!g},presenter:{url:v??p("character")??h(r,y=>y.previewUrl??ti(y).src)??null,count:l.presenters.length,own:!!v},scene:{url:w??h(n,y=>y.previewUrl)??p("template")??null,count:l.scenes.length,own:!!w}}},[e,t,n,r,a,i])}const DG=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Zp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Fp},{kind:"scene",label:"Scene",line:"Where it takes place",noun:"scene",icon:Ip}],wx=(e,t)=>e===0?"None yet":`${e} ${t}${e===1?"":"s"}`;function HG({suggest:e,onPick:t}){const n=s.useRef(null),{close:r}=Ns("new"),a=PA(),i=()=>{var l,u;(u=(l=n.current)==null?void 0:l.querySelector(e?`[data-kind="${e}"]`:"[data-kind]"))==null||u.focus()};return s.useEffect(i,[e]),o.jsxs(Ts,{className:"sc-newpick",maxWidth:"620px",onDismiss:r,onOpenAutoFocus:l=>{l.preventDefault(),i()},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Add to this brand"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx("p",{className:"sc-newdlg-sub",children:"The three things every shot is made from."}),o.jsx("div",{className:"sc-newdlg-body",children:o.jsx("div",{className:"sc-pickgrid",ref:n,children:DG.map(({kind:l,label:u,line:f,noun:h,icon:p})=>{const{url:g,count:v,own:w}=a[l];return o.jsxs("button",{type:"button",className:"sc-pick","data-kind":l,onClick:()=>t(l),"aria-label":`${u}. ${f}. ${wx(v,h)}.`,children:[o.jsxs("span",{className:"sc-pick-media",children:[g?o.jsx("img",{src:g,alt:"",loading:"lazy"}):o.jsx("span",{className:"sc-pick-blank",children:o.jsx(p,{size:22})}),w&&o.jsx("span",{className:"sc-pick-mine",children:"Yours"})]}),o.jsxs("span",{className:"sc-pick-cap",children:[o.jsx("b",{children:u}),o.jsx("small",{children:f})]}),o.jsx("span",{className:"sc-pick-count",children:wx(v,h)})]},l)})})})]})}function Ev({name:e}){const t={size:14,"aria-hidden":!0};switch(e){case"open":return o.jsx($C,{...t});case"continue":return o.jsx(Pa,{...t});case"open-tab":return o.jsx(gf,{...t});case"refine":return o.jsx(BC,{...t});case"select":return o.jsx(Kn,{...t,weight:"bold"});case"keep":return o.jsx(po,{...t});case"kept":return o.jsx(po,{...t,weight:"fill"});case"unset":return o.jsx(LC,{...t});case"versions":return o.jsx(fj,{...t});case"archive":return o.jsx(Op,{...t});case"restore":return o.jsx(M0,{...t});case"delete":case"discard":return o.jsx(il,{...t});case"use":return o.jsx(cr,{...t});case"duplicate":return o.jsx(Lh,{...t});case"rename":return o.jsx(qU,{...t});case"edit":return o.jsx(Ju,{...t})}}function yx(e,t,n){return e.map(r=>o.jsxs("span",{style:{display:"contents"},children:[r.separated&&o.jsx(n,{}),o.jsxs(t,{color:r.danger?"red":void 0,onSelect:r.onSelect,children:[o.jsx(Ev,{name:r.icon}),r.label]})]},r.key))}function OG({id:e,previewUrl:t,pending:n,title:r,primary:a,secondary:i,useLabel:l,variant:u,onOpen:f,onUse:h,href:p,selected:g,onToggle:v,bookmarked:w,onBookmark:y,menu:x,fresh:k,size:S="grid",chosen:E,batching:j,onPick:N}){const[P,$]=s.useState(!1),[M,C]=s.useState(!1),R=s.useRef(null),T=bv(),H=(q,le)=>CA(q,le,T),D=u==="use"&&!!f&&!!h&&!j,K=x??[],O=K.find(q=>q.key==="delete"),Z=K.length>0,te=q=>{q.preventDefault(),q.stopPropagation(),N==null||N(e)};s.useEffect(()=>{if(!M)return;const q=le=>{var Se;(Se=R.current)!=null&&Se.contains(le.target)||C(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[M]);const B=t&&!P?o.jsx("img",{src:sr(t,"tile"),alt:"",loading:"lazy",onError:()=>$(!0)}):n?o.jsx("span",{className:"sc-shimmer"}):o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Ws,{size:20})}),F=q=>{q.preventDefault(),q.stopPropagation()},X=Z?o.jsxs(Ss,{children:[H("More",o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${a}`,onClick:q=>q.stopPropagation(),onContextMenu:q=>q.stopPropagation(),children:[o.jsx(jC,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(EC,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})),o.jsx(Cs,{side:"top",align:"end",sideOffset:4,collisionPadding:12,children:yx(K,tr,Bl)})]}):null,z=X||O||y?o.jsxs("div",{className:"sc-corner",children:[X,O&&H(O.label,o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-remove","aria-label":O.label,onClick:q=>{F(q),O.onSelect()},children:o.jsx(il,{size:15})})),y&&H(w?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-keep","data-on":w||void 0,"aria-pressed":!!w,"aria-label":w?`Remove ${a} from Keepers`:`Add ${a} to Keepers`,onClick:q=>{F(q),y(e)},children:o.jsx(po,{size:15,weight:w?"fill":"regular"})}))]}):null,I=o.jsx("span",{className:"sc-lookcard-cap",title:r,children:o.jsxs("span",{className:"sc-lookcard-copy",children:[o.jsx("b",{dir:"auto",children:a}),i&&o.jsx("span",{children:i})]})});if(u==="select")return o.jsxs("button",{type:"button",className:"sc-lookcard","data-fb-id":e,"data-variant":"select","data-size":S,"data-on":g||void 0,"data-just-added":k||void 0,"aria-pressed":!!g,"aria-label":r,onClick:()=>v==null?void 0:v(e),children:[o.jsxs("span",{className:"sc-lookcard-media",children:[B,o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0}),o.jsx("span",{className:"sc-lookcard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]}),I]});const U=()=>{if(j&&N){N(e);return}if(D&&T){if(!M){C(!0);return}C(!1)}f?f(e):h==null||h(e)},G=()=>{C(!1),h==null||h(e)},ne=o.jsxs("div",{ref:R,className:"sc-lookcard","data-fb":"catalog-card","data-fb-id":e,"data-variant":u,"data-size":S,"data-armed":M||void 0,"data-just-added":k||void 0,"data-picked":E||void 0,"data-batching":j||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[p?o.jsxs(_n,{className:"sc-lookcard-open",to:p,"aria-label":j?`${E?"Deselect":"Select"} ${a}`:r,onClick:q=>{if(j&&N){te(q);return}if(D&&T){if(!M){q.preventDefault(),C(!0);return}C(!1)}},children:[B,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}):o.jsxs("button",{type:"button",className:"sc-lookcard-open",onClick:U,"aria-label":j?`${E?"Deselect":"Select"} ${a}`:r,children:[B,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}),D&&o.jsx("button",{type:"button",className:"sc-lookcard-use",onClick:G,children:l}),N&&H(E?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":E||void 0,"aria-pressed":!!E,"aria-label":E?`Deselect ${a}`:`Select ${a}`,onClick:te,children:o.jsx(Kn,{size:13,weight:"bold"})}))]}),z,I]});return K.length===0||T?ne:o.jsxs(ff,{children:[o.jsx(hf,{children:ne}),o.jsx(pf,{children:yx(K,mf,Hp)})]})}function Qp({size:e="grid",count:t=4,caption:n=!0}){return o.jsx(o.Fragment,{children:Array.from({length:t},(r,a)=>o.jsx("div",{className:"sc-lookcard","data-variant":"skeleton","data-size":e,"data-caption":n?void 0:"photo","aria-hidden":!0},a))})}const nd=s.memo(OG),IG=/^(p|product|products|item|items|dp|sku)$/i;function FG(e){let t="";try{const r=new URL(e).pathname.split("/").filter(Boolean);t=[...r].reverse().find(a=>!IG.test(a)&&!/^\d+$/.test(a))??r.at(-1)??""}catch{t=e}const n=decodeURIComponent(t).replace(/\.(html?|php|aspx?)$/i,"").replace(/[-_+]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function _G(e,t){if(!t)return!0;const n=a=>a.toLowerCase().replace(/[^a-z0-9]+/g," "),r=n(e);return n(t).split(" ").filter(Boolean).every(a=>r.includes(a))}const Lg=24,ZG=12;function LA({brandId:e,scan:t,busy:n,error:r,onImport:a,onImportAll:i,onDismiss:l}){const u=s.useMemo(()=>t.candidateUrls.length?t.candidateUrls:(t.cards??[]).map(G=>G.url).filter(Boolean),[t.candidateUrls,t.cards]),[f,h]=s.useState(""),[p,g]=s.useState(()=>new Set(u)),[v,w]=s.useState(Lg),[y,x]=s.useState(()=>{const G=new Map;for(const ne of t.cards??[])ne.url&&G.set(ne.url,{externalKey:ne.externalKey,title:ne.title,url:ne.url,images:ne.image?[{url:ne.image}]:[]});for(const ne of t.candidates)ne.url&&G.set(ne.url,ne);return G}),k=s.useRef(new Set),S=s.useRef(y),E=s.useRef(!0),[j,N]=s.useState(0);s.useEffect(()=>(E.current=!0,()=>{E.current=!1}),[]);const[P,$]=s.useState(null),M=s.useRef(null),C=s.useMemo(()=>u.map(G=>({url:G,name:FG(G)})),[u]),R=s.useMemo(()=>C.filter(G=>_G(G.name,f)),[C,f]),T=s.useMemo(()=>R.slice(0,v),[R,v]);s.useEffect(()=>w(Lg),[f]);const H=s.useRef([]),D=s.useRef(0),K=s.useRef(()=>{}),O=2,Z=120,te=s.useCallback(()=>{for(;D.current<O&&H.current.length;){const G=H.current.splice(Math.max(0,H.current.length-ZG));if(!G.length)return;D.current++,N(D.current),Re.catalogDetails(e,G).then(({products:ne})=>{if(!E.current)return;const q=new Map(S.current);for(const le of ne)le.url&&q.set(le.url,le);for(let le=0;le<ne.length&&le<G.length;le++)q.has(G[le])||q.set(G[le],ne[le]);S.current=q,x(q)}).catch(()=>{for(const ne of G)k.current.delete(ne)}).finally(()=>{D.current=Math.max(0,D.current-1),E.current&&(N(D.current),K.current())})}},[e]);K.current=te,s.useEffect(()=>{const G=M.current;if(!G)return;const ne=new IntersectionObserver(q=>{let le=!1;for(const Se of q){if(!Se.isIntersecting)continue;const Q=Se.target.dataset.fbId;if(ne.unobserve(Se.target),!(!Q||S.current.has(Q)||k.current.has(Q))){for(k.current.add(Q),H.current.push(Q);H.current.length>Z;){const xe=H.current.shift();xe&&k.current.delete(xe)}le=!0}}le&&K.current()},{root:G,rootMargin:"250% 0px"});for(const q of G.querySelectorAll("[data-fb-id]"))ne.observe(q);return()=>ne.disconnect()},[v,f]),s.useEffect(()=>{if(!P||v>=R.length)return;const G=P.closest(".sc-wizpick-grid"),ne=new IntersectionObserver(q=>{q.some(le=>le.isIntersecting)&&w(le=>le+Lg)},{root:G,rootMargin:"0px 0px 300% 0px"});return ne.observe(P),()=>ne.disconnect()},[P,v,R.length]);const B=s.useCallback(G=>{g(ne=>{const q=new Set(ne);return q.delete(G)||q.add(G),q})},[]),F=R.length>0&&R.every(G=>p.has(G.url)),X=p.size===u.length,z=()=>{g(G=>{const ne=new Set(G);for(const q of R)F?ne.delete(q.url):ne.add(q.url);return ne})},I=p.size,U=I===1?"1 product":`${I.toLocaleString()} products`;return o.jsxs(Ts,{open:!0,className:"sc-wizpick",maxWidth:"760px",described:!0,onDismiss:l,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Products on your site"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(td,{className:"sc-wizpick-sub",children:`${u.length.toLocaleString()} found. Everything is selected; untick what you do not want, or search for what you do.`}),o.jsxs("div",{className:"sc-wizpick-tools",children:[o.jsxs("span",{className:"sc-wizpick-search",children:[o.jsx(Fu,{size:13}),o.jsx("input",{type:"search",value:f,onChange:G=>h(G.target.value),placeholder:`Search ${u.length.toLocaleString()} products`,"aria-label":"Search products"})]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:z,disabled:!R.length,children:F?"Select none":f?`Select these ${R.length.toLocaleString()}`:"Select all"}),o.jsxs("span",{className:"sc-wizpick-count",children:[I.toLocaleString()," selected"]})]}),o.jsxs("div",{className:"sc-wizpick-grid",ref:M,children:[T.map(G=>{var q,le;const ne=y.get(G.url);return o.jsx(nd,{id:G.url,previewUrl:((le=(q=ne==null?void 0:ne.images)==null?void 0:q[0])==null?void 0:le.url)??null,pending:!ne,title:(ne==null?void 0:ne.title)??G.name,primary:(ne==null?void 0:ne.title)??G.name,secondary:(ne==null?void 0:ne.price)!=null?`${ne.currency??""} ${ne.price}`.trim():(ne==null?void 0:ne.category)??"",useLabel:"Import",variant:"select",selected:p.has(G.url),onToggle:B,size:"grid"},G.url)}),v<R.length&&o.jsx("div",{className:"sc-wizpick-end",ref:$,"aria-hidden":!0}),!R.length&&o.jsxs("p",{className:"sc-wizpick-empty",children:["Nothing here matches “",f,"”."]})]}),o.jsxs("div",{className:"sc-wizpick-foot",children:[o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:l,children:"Not now"}),r?o.jsx("span",{className:"sc-wizpick-error",role:"alert",children:r}):j>0&&o.jsx("span",{className:"sc-wizpick-loading",children:"Loading products"}),o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!I||n||y.size===0&&j>0,onClick:()=>X?i():a([...p]),children:n?"Importing":`Import ${U}`})]})]})}const Tg=700,VG=45e3,zG=3e3;function TA(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),[f,h]=s.useState(null),[p,g]=s.useState(0),v=s.useRef(!0);s.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),s.useEffect(()=>{if(!e)return;let x=!1,k,S=null;i(!0),u(!1),r(null),h(null);const E=(N,P)=>{r(N),h(P),i(!1),u(!0)};return(async()=>{try{const{scanId:N}=await Re.catalogScan(e,t);if(S=N,x||!v.current){Re.cancelCatalogScan(e,N).catch(()=>{});return}const P=Date.now()+VG,$=async()=>{if(!(x||!v.current)){if(Date.now()>P){E(null,{kind:"timeout"});return}try{const M=await Re.catalogScanState(e,N,AbortSignal.timeout(zG));if(x||!v.current)return;if(M.status==="running"){k=setTimeout($,Tg);return}M.result?E(M.result,null):E(null,{kind:"error",reason:M.error??"The look for a shop did not finish."})}catch(M){if(x||!v.current)return;if((M==null?void 0:M.status)===404){E(null,{kind:"error",reason:"The look for a shop was interrupted."});return}k=setTimeout($,Tg)}}};k=setTimeout($,Tg)}catch{x||E(null,{kind:"error",reason:"The look for a shop could not start."})}})(),()=>{x=!0,k&&clearTimeout(k),S&&Re.cancelCatalogScan(e,S).catch(()=>{})}},[e,t,p]);const w=s.useCallback(()=>g(x=>x+1),[]);return{scan:n,scanning:a,settled:l,outcome:a?{kind:"scanning"}:f||(n?{kind:"result",scan:n}:{kind:"idle"}),retry:w}}const T0=[{key:"fragrance",label:"Fragrance",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"footwear",label:"Footwear",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"lateral-side",label:"Lateral side"},{key:"medial-side",label:"Medial side"}]},{key:"apparel",label:"Apparel",angles:[{key:"front",label:"Front"},{key:"back",label:"Back"},{key:"detail-fabric",label:"Detail / fabric"}]},{key:"furniture",label:"Furniture",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beauty",label:"Beauty / skincare",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"label",label:"Label"}]},{key:"electronics",label:"Electronics",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"back",label:"Back"}]},{key:"jewelry",label:"Jewelry",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"clasp-detail",label:"Clasp detail"}]},{key:"accessories",label:"Accessories",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"detail",label:"Detail"}]},{key:"beverage",label:"Beverage",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"label",label:"Label"}]},{key:"food",label:"Food",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"packaging-label",label:"Packaging label"}]},{key:"other",label:"Other",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]}],Cv=new Map(T0.map(e=>[e.key,e]));Cv.get("other");function $0(e){var t;return e?((t=Cv.get(e))==null?void 0:t.label)??e:null}function BG(e,t){const n=[e??"",...t??[]].join(" ").toLowerCase();if(!n.trim())return;const r=[["fragrance",["fragrance","perfume","eau de","cologne"]],["footwear",["shoe","sneaker","boot","sandal","footwear"]],["apparel",["shirt","dress","jacket","pant","apparel","clothing","hoodie"]],["furniture",["chair","table","sofa","furniture","shelf","desk"]],["beauty",["skincare","serum","cream","lotion","cosmetic","makeup","beauty"]],["electronics",["electronic","headphone","speaker","charger","device","gadget"]],["jewelry",["jewelry","jewellery","necklace","bracelet","earring","ring"]],["accessories",["bag","handbag","wallet","watch","accessory","accessories"]],["beverage",["drink","beverage","soda","juice","coffee","tea"]],["food",["food","snack","grocery","sauce","spice","pantry"]]];for(const[a,i]of r)if(i.some(l=>n.includes(l)))return a}function jv(e){return e.category&&Cv.has(e.category)?e.category:BG(e.productType,e.tags)??null}function UG({title:e,sub:t,error:n,footnote:r,primaryLabel:a,ready:i,blocked:l,busy:u,width:f="440px",onBack:h,onPrimary:p,onPasteFiles:g,children:v}){const{close:w}=Ns("new");return o.jsxs(Ts,{maxWidth:f,onDismiss:w,onPaste:y=>{var k;if(!g)return;const x=Array.from(((k=y.clipboardData)==null?void 0:k.files)??[]).filter(S=>S.type.startsWith("image/"));x.length&&(y.preventDefault(),g(x))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[h&&o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:h,"aria-label":"Back",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:e}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),t&&o.jsx("p",{className:"sc-newdlg-sub",children:t}),o.jsx("div",{className:"sc-newdlg-body",children:v}),o.jsxs("div",{className:"sc-newdlg-foot",children:[n&&o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-dlg-go","aria-disabled":!i||u||void 0,title:l,onClick:()=>{i&&!u&&p()},children:[u?o.jsx(xr,{size:"1"}):null,a]}),r&&o.jsx("p",{className:"sc-dlg-foot",children:r})]})]})}function $A({onFiles:e,onReject:t,disabled:n}){const r=s.useRef(0),[a,i]=s.useState(!1),l=s.useCallback(()=>{r.current=0,i(!1)},[]);return{dragOver:a,dropProps:{"data-drag-over":a||void 0,onDragEnter:f=>{n||!Array.from(f.dataTransfer.types).includes("Files")||(f.preventDefault(),r.current++,i(!0))},onDragOver:f=>{n||f.preventDefault()},onDragLeave:()=>{r.current=Math.max(0,r.current-1),r.current===0&&i(!1)},onDrop:f=>{if(n)return;f.preventDefault(),l();const h=Array.from(f.dataTransfer.files).filter(p=>p.type.startsWith("image/"));h.length?e(h):t==null||t()}}}}function bx({label:e,hint:t,busy:n,disabled:r,multiple:a=!0,accept:i="image/*",onFiles:l,onReject:u,children:f}){const h=s.useRef(null),{dropProps:p}=$A({onFiles:l,onReject:u,disabled:r||n});return o.jsxs("button",{type:"button",className:"sc-dropzone",disabled:r||n,onClick:()=>{var g;return(g=h.current)==null?void 0:g.click()},...p,children:[o.jsx("input",{ref:h,type:"file",accept:i,multiple:a,hidden:!0,onChange:g=>{const v=Array.from(g.target.files??[]);g.target.value="",v.length&&l(v)}}),n?o.jsx(xr,{}):f,o.jsx("span",{className:"sc-dropzone-label",children:e}),t&&o.jsx("small",{children:t})]})}function DA({hashes:e,max:t,label:n,hint:r,busy:a,onAdd:i,onRemove:l,onReject:u}){if(e.length===0)return o.jsx("div",{className:"sc-assetwell",children:o.jsx(bx,{label:n,hint:r,busy:a,onFiles:i,onReject:u,children:o.jsx(cr,{size:18})})});const f=t-e.length;return o.jsxs("div",{className:"sc-assetform-refs",children:[e.map((h,p)=>o.jsxs("span",{className:"sc-assetform-ref",children:[o.jsx("img",{src:dn(h,"micro"),alt:`Reference ${p+1}`,loading:"lazy",decoding:"async"}),o.jsx("button",{type:"button",className:"sc-assetform-drop","aria-label":`Remove reference ${p+1}`,onClick:()=>l(h),children:o.jsx(jn,{size:11,weight:"bold"})})]},h)),f>0&&o.jsx(bx,{label:`${f} more`,busy:a,onFiles:i,onReject:u,children:o.jsx(cr,{size:15})})]})}let r0=null;const HA=(e,t)=>`${e}:${t}`;function WG(e,t,n){r0={key:HA(e,t),fields:n}}function KG(e,t){if(!r0||r0.key!==HA(e,t))return null;const{fields:n}=r0;return r0=null,n}const xx={name:"",instruction:"",facets:[],imageHashes:[],importUrl:""};function GG(e,t,n){const r=n.restore??!1,[a,i]=s.useState(xx),[l,u]=s.useState(!1),[f,h]=s.useState(null),p=s.useRef(null),g=s.useRef(null),v=s.useRef(n.pendingState);v.current=n.pendingState;const w=s.useRef(n.exists);w.current=n.exists;const y=s.useRef(n.onDiscarded);y.current=n.onDiscarded;const x=s.useRef(a);x.current=a,s.useEffect(()=>{var R;if(r){const T=KG(e,t);if(T){i(T);return}}const M=Gj(e,t),C=M!=null&&M.pending?v.current(M.pending):null;if(M!=null&&M.pending&&C==="unknown"&&((R=w.current)!=null&&R.call(w,M.name))){du(e,t);return}if(M&&!M.pending){du(e,t);return}M&&dK(M,C)&&(g.current=M.pending,i({name:M.name,instruction:M.instruction,facets:M.facets,imageHashes:M.imageHashes,importUrl:M.importUrl}))},[e,t,r]);const k=s.useCallback(M=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{g.current&&Mg(M)?Rg(e,t,{...M,pending:g.current}):du(e,t)},400)},[e,t]),S=s.useCallback(M=>{i(C=>{const R={...C,...typeof M=="function"?M(C):M};return k(R),R})},[k]),E=s.useCallback(()=>{var C;p.current&&clearTimeout(p.current);const M=x.current;if(g.current&&Mg(M)){Rg(e,t,{...M,pending:g.current});return}du(e,t),Mg(M)&&(WG(e,t,M),(C=y.current)==null||C.call(y))},[e,t]);s.useEffect(()=>(window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E),E()}),[E]);const j=s.useCallback(async M=>{u(!0),h(null);try{const C=n.max-x.current.imageHashes.length,R=[];for(const T of M.slice(0,C))R.push(await P0(T));S(T=>({imageHashes:[...new Set([...T.imageHashes,...R])].slice(0,n.max)}))}catch(C){h(String(C.message??C))}finally{u(!1)}},[n.max,S]),N=s.useCallback(M=>S(C=>({imageHashes:C.imageHashes.filter(R=>R!==M)})),[S]),P=s.useCallback(M=>S(C=>({facets:C.facets.includes(M)?C.facets.filter(R=>R!==M):[...C.facets,M]})),[S]),$=s.useCallback(M=>{if(p.current&&clearTimeout(p.current),!M){du(e,t),g.current=null,i(xx);return}g.current=M,i(C=>(Rg(e,t,{...C,pending:M}),C))},[e,t]);return{fields:a,set:S,uploading:l,err:f,setErr:h,addFiles:j,removeHash:N,toggleFacet:P,submitted:$}}const kx=6,YG=3;function qG({onBack:e,onStarted:t,restore:n,onDiscarded:r}){var C,R;const{brand:a}=on(),{applyBrand:i}=Rn(),[l,u]=s.useState(!1),[f,h]=s.useState(!1),[p,g]=s.useState(!1),v=GG(a.id,"product",{max:kx,pendingState:()=>"unknown",restore:n,onDiscarded:r}),w=v.fields.imageHashes.length>0,y=w?void 0:"Add at least one photo",x=async()=>{u(!0),v.setErr(null);try{const{productId:T,...H}=await Re.createProduct(a.id,{name:v.fields.name.trim(),imageHashes:v.fields.imageHashes,category:v.fields.facets[0]});i(H);const D=v.fields.name.trim()||"Product";v.submitted(null),t({kind:"product",id:T,name:D})}catch(T){v.setErr(String(T.message??T))}finally{u(!1)}},[k,S]=s.useState(null),{scan:E,scanning:j,settled:N}=TA(k?a.id:null,k??void 0),P=async T=>{const H=k??v.fields.importUrl.trim()??"";h(!0),v.setErr(null);try{await Re.catalogImport(a.id,H,T),v.set({importUrl:""}),S(null),t({kind:"product",id:"",name:H})}catch(D){v.setErr(String(D.message??D))}finally{h(!1)}},$=()=>{var H,D;const T=v.fields.importUrl.trim()||(((D=(H=a.json)==null?void 0:H.meta)==null?void 0:D.website)??"");T&&(v.setErr(null),S(T))};s.useEffect(()=>{!k||!N||E&&E.verdict==="found"&&E.candidates.length||P()},[E,N,k]);const M=T=>{T.key==="Enter"&&(T.preventDefault(),w&&!l&&x())};return o.jsxs(UG,{title:"New product",error:v.err,footnote:"Added to this brand. No preview.",primaryLabel:"Add product",ready:w,blocked:y,busy:l,onBack:e,onPrimary:()=>void x(),onPasteFiles:T=>void v.addFiles(T),children:[o.jsxs("div",{className:"sc-assetform",children:[o.jsx(DA,{hashes:v.fields.imageHashes,max:kx,label:"Add packshots",hint:`Straight, well-lit packshots. The first ${YG} are the ones a shot attaches.`,busy:v.uploading,onAdd:T=>void v.addFiles(T),onRemove:v.removeHash,onReject:()=>v.setErr("Drop an image file.")}),o.jsx("div",{className:"sc-assetform-fields",children:o.jsxs("div",{className:"sc-assetform-field",children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-product-name",children:"Name"}),o.jsx("input",{id:"sc-product-name",className:"sc-in",type:"text",placeholder:"Name this product",value:v.fields.name,onChange:T=>v.set({name:T.target.value}),onKeyDown:M})]})}),o.jsxs("fieldset",{className:"sc-assetform-facets",children:[o.jsx("legend",{children:"Category"}),o.jsx("div",{className:"sc-assetform-facets-chips",children:T0.map(T=>o.jsx("button",{type:"button",className:"sc-chip","data-on":v.fields.facets[0]===T.key||void 0,"aria-pressed":v.fields.facets[0]===T.key,onClick:()=>v.set({facets:v.fields.facets[0]===T.key?[]:[T.key]}),children:T.label},T.key))})]})]}),o.jsx("div",{className:"sc-newdlg-secondary",children:p?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-import-url",children:"Your store's address"}),o.jsxs("div",{className:"sc-newdlg-secrow",children:[o.jsx("input",{id:"sc-import-url",className:"sc-in",type:"url",placeholder:((R=(C=a.json)==null?void 0:C.meta)==null?void 0:R.website)??"https://yourstore.com",value:v.fields.importUrl,onChange:T=>v.set({importUrl:T.target.value}),onKeyDown:T=>{T.key==="Enter"&&$()}}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:f||j,onClick:$,children:j?"Looking…":f?"Starting…":"Import"})]})]}):o.jsx("button",{type:"button",className:"sc-newdlg-secmore",onClick:()=>g(!0),children:"Import a catalog from a store URL"})}),E&&E.verdict==="found"&&E.candidates.length>0&&o.jsx(LA,{brandId:a.id,scan:E,busy:f,onImport:T=>void P(T),onImportAll:()=>void P(),onDismiss:()=>S(null)})]})}const $g="1",XG={product:"Product",presenter:"Presenter",scene:"Scene"},QG=["product","presenter","scene"],JG=e=>!!e&&QG.includes(e),OA=s.createContext(null);function IA(){const e=s.useContext(OA);if(!e)throw new Error("useCreateAsset must be used inside AssetCreateHost");return e}function ll(){return IA().open}function FA(){const e=!!un({path:ct.products,end:!1}),t=!!un({path:ct.presenters,end:!1}),n=!!un({path:ct.scenes,end:!1});return e?"product":t?"presenter":n?"scene":null}function Av(){const{announce:e,caps:t}=IA();return{announce:e,caps:t}}function eY({children:e}){const{brand:t}=on(),n=Dn(),r=Zn(),{push:a}=or(),{refreshBrands:i}=Rn(),{builds:l,poke:u}=Za(),f=Ns("new"),h=f.value,p=FA(),g=!!un({path:ct.presenterStudio}),v=!!un({path:ct.presenterEdit}),w=!!un({path:ct.sceneStudio}),y=!!un({path:ct.sceneEdit}),[x,k]=s.useState(null),[S,E]=s.useState(!1),[j,N]=s.useState(!1),P=s.useRef(null),$=s.useRef(null),M=f.open,C=f.set,R=f.close,T=s.useCallback((z,I)=>{if(P.current=z==="choose"||!(I!=null&&I.onCreated)?null:{kind:z,fn:I.onCreated},z==="presenter"){n(zi(t));return}if(z==="scene"){n(Vi(t),{state:{from:r.pathname+r.search}});return}$.current=document.activeElement instanceof HTMLElement?document.activeElement:null,E(z==="choose"),N(!1),M(z==="choose"?$g:z)},[M,n,t,r.pathname,r.search]);s.useEffect(()=>{h==="presenter"&&n(zi(t),{replace:!0}),h==="scene"&&n(Vi(t),{replace:!0})},[h,n,t]);const H=s.useCallback(()=>{P.current=null,E(!1),R()},[R]),D=s.useCallback(z=>{a({kind:"success",title:`${XG[z]} discarded`,detail:"Nothing was saved.",action:{label:"Undo",onClick:()=>{N(!0),E(!1),M(z)}}})},[M,a]);s.useEffect(()=>{h===null&&N(!1)},[h]),s.useEffect(()=>{if(h!==null)return;const z=$.current;$.current=null,z!=null&&z.isConnected&&z.focus()},[h]);const K=h!==null||g||v||w||y;s.useEffect(()=>{if(!K)return;let z=!0,I=null;const U=G=>Re.assetBuildCapabilities().then(ne=>z&&k(ne)).catch(()=>{z&&G&&(I=setTimeout(()=>U(!1),600))});return U(!0),()=>{z=!1,I&&clearTimeout(I)}},[K]);const O=s.useCallback(z=>{const I=l.find(U=>U.id===z);return I?I.stage==="failed"?"failed":I.stage==="cancelled"?"cancelled":I.stage==="done"?"done":"running":"unknown"},[l]),Z=s.useCallback(z=>{var G;const I=P.current;if(P.current=null,u(),z.kind==="product"){if(!z.id){a({kind:"info",title:"Importing your catalog",detail:z.name});return}(I==null?void 0:I.kind)==="product"&&I.fn(z),a({kind:"success",title:`${z.name} added`,actions:[{label:"Add details",onClick:()=>n(la(t,z.id))},{label:"Use in a shot",onClick:()=>n(`${mr(t)}?product=${z.id}&compose=1`)}]});return}if(z.kind==="presenter"){(I==null?void 0:I.kind)==="presenter"&&I.fn(z),a({kind:"success",title:`${z.name} added`,actions:[{label:"Use in a shot",onClick:()=>n(`${mr(t)}?presenter=${z.id}&compose=1`)}]});return}i(),(I==null?void 0:I.kind)==="scene"&&I.fn(z);const U=(G=z.verticals)!=null&&G.length?`Filed under ${z.verticals.join(" and ")}.`:void 0;a({kind:"success",title:z.how==="updated"?`${z.name} changed`:`${z.name} saved`,detail:U,actions:[{label:"Open",onClick:()=>n(_r(t,z.id))},{label:"Use in a shot",onClick:()=>n(`${mr(t)}?scene=${z.id}&compose=1`)}]})},[t,n,u,a,i]),te=s.useCallback(z=>{Z(z),H()},[H,Z]),B=s.useMemo(()=>({open:T,announce:Z,caps:x}),[T,Z,x]),F=JG(h)?h:null,X={onBack:S?()=>C($g):void 0,onStarted:te,caps:x,pendingState:O,restore:j,onDiscarded:()=>F&&D(F)};return o.jsxs(OA.Provider,{value:B,children:[e,h===$g&&o.jsx(HG,{suggest:p,onPick:z=>{if(z==="presenter"){n(zi(t),{replace:!0});return}if(z==="scene"){n(Vi(t),{replace:!0});return}E(!0),C(z)}}),F==="product"&&o.jsx(qG,{...X},"product")]})}const tY=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Zp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Fp},{kind:"scene",label:"Scene",line:"The place and its light",noun:"scene",icon:Ip}],nY={product:"New product",presenter:"New presenter",scene:"New scene"};function rY(){var f;const e=ll(),t=FA(),n=PA(),{showcase:r}=Rn(),a=((f=r.find(h=>h.previewUrl))==null?void 0:f.previewUrl)??null,i=yv(16).find(h=>h.key==="create"),l=i?`${i.to}&attach=all`:"",u=t?nY[t]:"New";return o.jsxs("div",{className:"sc-new",children:[t?o.jsxs("button",{type:"button",className:"sc-new-go","aria-label":u,"data-guide":"library.new",onClick:()=>e(t),children:[o.jsx(cr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsxs("span",{className:"sc-new-lb",children:[o.jsx("span",{className:"sc-new-verb",children:"New "}),o.jsx("span",{className:"sc-new-kind",children:t})]})]}):o.jsxs(_n,{className:"sc-new-go",to:l,"aria-label":"New shot","data-attach-opener":"",children:[o.jsx(cr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsx("span",{className:"sc-new-lb",children:"New"})]}),o.jsx("span",{className:"sc-new-split","aria-hidden":"true"}),o.jsxs(AA,{label:"New",className:"sc-menu-start",trigger:o.jsx("button",{type:"button",className:"sc-new-more","aria-label":"Other ways to start",children:o.jsx(Yi,{size:12,weight:"bold",className:"sc-new-caret","aria-hidden":"true"})}),children:[o.jsxs(Cu,{className:"sc-menu-item sc-start-row","data-lead":"",to:l,children:[o.jsx("span",{className:"sc-start-pic",children:a?o.jsx("img",{src:sr(a,"tile"),alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(q7,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:"New shot"}),o.jsx("small",{children:"Write a brief, get a shot"})]})]}),o.jsx("div",{className:"sc-menu-label",children:"Add to this brand"}),tY.map(h=>{const{url:p,count:g}=n[h.kind];return o.jsxs(Cu,{className:"sc-menu-item sc-start-row",onSelect:()=>e(h.kind),children:[o.jsx("span",{className:"sc-start-pic",children:p?o.jsx("img",{src:p,alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(h.icon,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:h.label}),o.jsx("small",{children:h.line})]}),o.jsxs("span",{className:"sc-start-n",children:[g===0?"None yet":g,o.jsx("span",{className:"sc-vh",children:` ${h.noun}${g===1?"":"s"} so far`})]})]},h.kind)})]})]})}const sY=24,aY=8;function oY(){const e=wr(Ks),{pathname:t}=Zn();s.useEffect(()=>{const n=document.querySelector(".sc-shell");if(!n||(delete n.dataset.condensed,e))return;let r=0;const a=i=>{const l=i.target;!(l!=null&&l.dataset)||!("pageScroll"in l.dataset)||r||(r=requestAnimationFrame(()=>{r=0;const u=n.dataset.condensed!==void 0,f=l.scrollTop;(u?f<=aY:f>sY)&&(u?delete n.dataset.condensed:n.dataset.condensed="")}))};return n.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>{r&&cancelAnimationFrame(r),n.removeEventListener("scroll",a,{capture:!0}),delete n.dataset.condensed}},[e,t])}const _A=["M64 18.71V38.8L51.38 51.39V12.62H57.9C61.27 12.62 64 15.35 64 18.72V18.71Z","M12.62 12.62V51.39H6.1C2.73 51.39 0 48.66 0 45.29V25.2L12.62 12.61V12.62Z","M51.38 51.38L38.79 64H18.7C15.33 64 12.6 61.27 12.6 57.9V51.38H51.37H51.38Z","M12.62 12.62L25.2 0H45.29C48.66 0 51.39 2.73 51.39 6.1V12.62H12.62Z"],iY=["M100.99 28.93L91.76 27.8C88.5 27.41 87.19 26.58 87.19 25.1C87.19 23.45 89.98 22.49 94.29 22.49C99.38 22.49 102.43 23.36 104.17 26.58L111.61 24.27C108.65 17.87 102.08 16 94.98 16C85.1 16 78.7 19.31 78.7 25.97C78.7 31.02 82.49 33.81 90.28 34.76L98.68 35.8C102.29 36.24 103.3 37.19 103.3 38.5C103.3 40.24 100.64 41.46 95.59 41.46C89.41 41.46 87.01 40.2 85.31 37.02L77.52 39.33C80.31 45.77 86.92 47.95 95.07 47.95C105.17 47.95 111.88 44.55 111.88 37.72C111.88 32.84 108.53 29.84 101 28.93H100.99Z","M132.73 22.66C137 22.66 140.87 24.01 142.7 28.54L150.49 26.67C148.79 20.66 142.3 16.05 132.6 16.05C121.41 16.05 113.44 22.23 113.44 31.98C113.44 41.73 121.41 48 132.6 48C142.31 48 148.8 43.3 150.49 37.29L142.7 35.42C140.87 39.95 137 41.3 132.73 41.3C126.94 41.3 122.24 38.38 122.24 32.42V31.55C122.24 25.59 126.94 22.67 132.73 22.67V22.66Z","M161.51 34.89H179.58V28.71H161.51V22.97H181.54V16.52H152.8V47.43H181.84V40.99H161.51V34.89Z","M208.71 33.85H208.67L193.86 16.52H184.94V47.43H193.04V27.49H193.08L210.15 47.43H216.81V16.52H208.71V33.85Z","M252.25 26.8C252.25 20.14 248.07 16.52 239.84 16.52H220.77V47.43H229.48V37.5H236.62L242.63 47.43H252.56L245.55 36.37C249.9 34.8 252.25 31.62 252.25 26.79V26.8ZM243.54 27.32C243.54 29.98 242.06 31.28 239.06 31.28H229.48V22.96H239.06C242.06 22.96 243.54 24.27 243.54 26.88V27.32Z","M263.79 16.52H255.08V47.43H263.79V16.52Z"];function lY(e){return o.jsx("svg",{viewBox:"0 0 263.79 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:[..._A,...iY].map(t=>o.jsx("path",{d:t},t))})}function cY(e){return o.jsx("svg",{viewBox:"0 0 64 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:_A.map(t=>o.jsx("path",{d:t},t))})}function uY(){const{brand:e}=on();return oY(),o.jsxs("header",{className:"sc-topbar",children:[o.jsx("a",{className:"sc-skip",href:"#main",children:"Skip to content"}),o.jsx("div",{className:"sc-topbar-lead",children:o.jsx(_n,{className:"sc-wordmark","aria-label":"Scenri home",to:mo(e),children:o.jsx(lY,{"aria-hidden":"true"})})}),o.jsx(jG,{}),o.jsxs("div",{className:"sc-topbar-end",children:[o.jsx(PG,{}),o.jsx(EG,{}),o.jsx(rY,{}),o.jsx(NG,{})]})]})}const dY=60;function fY(){s.useEffect(()=>{const e=window.visualViewport;if(!e)return;const t=document.documentElement,n=()=>{const r=window.innerHeight-e.height-e.offsetTop;t.style.setProperty("--sc-kb",r>dY?`${Math.round(r)}px`:"0px")};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),t.style.removeProperty("--sc-kb")}},[])}const ZA=s.createContext(null);function VA(){return s.useContext(ZA)}function hY({brand:e,children:t}){const n=e.id,[r,a]=s.useState({products:[],loaded:!1}),i=s.useRef(null),{tasks:l}=Za(),u=l.filter(w=>w.kind==="catalog").map(w=>`${w.id}:${w.state}`).join("|"),f=l.some(w=>w.kind==="catalog"&&w.state==="running"),h=s.useRef(0),p=s.useRef(n);p.current=n;const g=s.useCallback(async()=>{const w=++h.current;try{const y=await Re.productsLibrary(n);if(w!==h.current||p.current!==n)return;const x=JSON.stringify(y.products);if(i.current===x)return;i.current=x,a({products:y.products,loaded:!0})}catch{if(w!==h.current||p.current!==n)return;a(y=>({products:y.products,loaded:!0}))}},[n]);s.useEffect(()=>{i.current=null,a({products:[],loaded:!1})},[n]),s.useEffect(()=>{g()},[g,e.updatedAt,u]),s.useEffect(()=>{if(!f)return;const w=setInterval(()=>void g(),2e3);return()=>clearInterval(w)},[f,g]);const v=s.useMemo(()=>({products:r.products,productsLoaded:r.loaded,importing:f,refreshProducts:g}),[r.products,r.loaded,f,g]);return o.jsx(ZA.Provider,{value:v,children:t})}function Qr({title:e,sub:t,children:n}){return o.jsxs("section",{className:"sc-set-sec",children:[(e||t)&&o.jsxs("div",{className:"sc-set-sech",children:[e&&o.jsx("h3",{children:e}),t&&o.jsx("p",{children:t})]}),o.jsx("div",{className:"sc-set-card",children:n})]})}const pY={npx:"run with npx",global:"installed with npm",managed:"managed install",dev:"running from source",unknown:"local studio"};function mY({version:e}){return o.jsxs(Qr,{children:[o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Scenri"}),o.jsxs("small",{children:[e?`v${e.version}`:""," · ",pY[(e==null?void 0:e.installKind)??"unknown"]]})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"License"}),o.jsx("small",{children:"AGPL-3.0 for the app · Apache-2.0 for the .brand format"})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open source"}),o.jsxs("small",{children:["Built by Tony Gorb ·"," ",o.jsx("a",{href:"https://github.com/tonygorb/scenri",target:"_blank",rel:"noreferrer",children:"GitHub"})]})]})})]})}function w6({w:e,h:t,slot:n,box:r}){const a=r/Math.max(e,t);return o.jsx("span",{className:"sc-ratio-slot",style:{width:n,height:n},"aria-hidden":!0,children:o.jsx("span",{className:"sc-ratio",style:{width:Math.round(e*a),height:Math.round(t*a)}})})}const Sx=()=>o.jsx("span",{className:"sc-setpop-tick","aria-hidden":!0,children:o.jsx(Kn,{size:12,weight:"bold"})});function _o({label:e,value:t,ids:n,unavailable:r=[],onChange:a,className:i,children:l}){const u=s.useRef(null),f=n.filter(p=>!r.includes(p)),h=p=>{var y,x;const g=p.key==="ArrowDown"||p.key==="ArrowRight"?1:p.key==="ArrowUp"||p.key==="ArrowLeft"?-1:p.key==="Home"?"first":p.key==="End"?"last":null;if(g===null||!f.length)return;p.preventDefault();const v=f.indexOf(t),w=g==="first"?f[0]:g==="last"?f[f.length-1]:g===1?f[v<0||v===f.length-1?0:v+1]:f[v<=0?f.length-1:v-1];a(w),(x=(y=u.current)==null?void 0:y.querySelector(`[data-id="${w}"]`))==null||x.focus()};return o.jsx("div",{className:i,role:"radiogroup","aria-label":e,ref:u,tabIndex:-1,onKeyDown:h,children:l})}const Zo=s.forwardRef(function({id:t,on:n,unavailable:r,label:a,onPick:i,className:l,children:u,...f},h){return o.jsx("button",{...f,ref:h,type:"button",role:"radio","data-id":t,className:l,"aria-checked":n,"aria-label":a,"aria-disabled":r||void 0,"data-on":n||void 0,tabIndex:n?0:-1,onClick:p=>{var g;(g=f.onClick)==null||g.call(f,p),r||i()},children:u})}),gY=({children:e})=>o.jsx("p",{className:"sc-setpop-foot",children:e}),Ex=[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}];function vY(){const{choice:e,setChoice:t}=lB();return o.jsx(Qr,{children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Theme"}),o.jsx("small",{children:"Follows your system unless you pick a side."})]}),o.jsx(_o,{label:"Theme",className:"sc-seg",value:e,ids:Ex.map(n=>n.id),onChange:n=>t(n),children:Ex.map(n=>o.jsx(Zo,{id:n.id,className:"sc-seg-o",on:e===n.id,label:n.label,onPick:()=>t(n.id),children:n.label},n.id))})]})})}function wY({value:e,onChange:t,placeholder:n,label:r,suggestions:a,max:i=24,maxLength:l=200}){const[u,f]=s.useState(""),h=e.length>=i,p=v=>{const w=v.trim().slice(0,l);f(""),!(!w||h)&&(e.some(y=>y.toLowerCase()===w.toLowerCase())||t([...e,w]))},g=!h&&a&&a.length>0?o.jsx("div",{className:"sc-chips-sugg",children:a.map(v=>o.jsx("button",{type:"button",className:"sc-chip",onClick:()=>p(v),"aria-label":`Never show ${v}`,children:v},v))}):null;return o.jsxs(o.Fragment,{children:[e.length===0&&g,o.jsxs("div",{className:"sc-chips",children:[e.map((v,w)=>o.jsxs("span",{className:"sc-chips-item",children:[o.jsx("span",{dir:"auto",children:v}),o.jsx("button",{type:"button",onClick:()=>t(e.filter((y,x)=>x!==w)),"aria-label":`Remove ${v}`,children:o.jsx(jn,{size:10,weight:"bold"})})]},v)),o.jsx("input",{className:"sc-chips-in",value:u,"aria-label":r,placeholder:h?void 0:e.length?"Add another…":n??"Add one…",disabled:h,dir:"auto",onChange:v=>{const w=v.target.value;if(w.includes(",")){const y=w.split(",");for(const x of y.slice(0,-1))p(x);f(y[y.length-1]);return}f(w.slice(0,l))},onKeyDown:v=>{v.key==="Enter"?(v.preventDefault(),p(u)):v.key==="Backspace"&&!u&&e.length&&t(e.slice(0,-1))},onBlur:()=>p(u)})]}),e.length>0&&g]})}const yY=["competitor logos in frame","visible text or wordmarks on clothing","alcohol","children","visible clutter or mess","heavy skin retouching","neon or harsh colour","pure white studio backgrounds"],Cx=e=>e.trim().toLowerCase();function bY(e){const t=new Set((e??[]).map(Cx));return yY.filter(n=>!t.has(Cx(n)))}function xY({doc:e}){var a;const t=((a=e.json)==null?void 0:a.rules)??{},n=t.never??[],r=i=>{const l={...t};i.length?l.never=i:delete l.never,e.patch({rules:l})};return o.jsx("div",{className:"sc-nv",children:o.jsx(wY,{label:"Things this brand never shows",value:n,placeholder:"Or type your own",suggestions:bY(n),max:24,onChange:r})})}function kY({brand:e,doc:t}){const{push:n}=or(),[r,a]=s.useState(!1),i=t.json??{},l=i.meta??{},u=l.name??e.slug,f=bf(i),h=Yp(f)??void 0,p=f.filter(x=>x!==h),g=x=>{const k={...l};for(const[S,E]of Object.entries(x)){const j=E.trim();j?k[S]=j:delete k[S]}k.name||(k.name=l.name),t.patch({meta:k})},v=async(x,k)=>{a(!0);try{await t.flush(),t.applyRow(await k())}catch(S){n(nn(S,x))}finally{a(!1)}},w=x=>void v("Could not upload that mark",async()=>{const k=await Mj(e.id,x[0]),S=k.logoEdge;return S&&S<512&&n({kind:"warning",title:"Logo added, but it is small",detail:`Only ${S}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`}),k}),{dropProps:y}=$A({onFiles:w,onReject:()=>n({kind:"warning",title:"That is not an image",detail:"Drop a PNG, SVG or JPG."}),disabled:r});return o.jsxs("div",{className:"sc-ident",...y,children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Logo"}),o.jsx("small",{children:"Drop an image, or tap to add."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx(SY,{mark:h,name:u,busy:r,onUpload:w}),(h==null?void 0:h.attachable)&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:r,onClick:()=>void v("Could not remove that mark",()=>Re.deleteLogo(e.id,h.hash??"")),children:"Remove"})]})]}),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Sits on"}),o.jsx("small",{children:"So a dark mark is not shown on a dark ground."})]}),o.jsx("select",{className:"sc-in",value:h.background,disabled:r||!h.attachable,onChange:x=>void v("Could not update that mark",()=>Re.updateLogo(e.id,h.hash??"",{background:x.target.value})),"aria-label":"Sits on",children:wv.map(x=>o.jsx("option",{value:x,children:x==="any"?"Any background":`On ${x}`},x))})]}),o.jsx(jx,{label:"Name",value:l.name??"",placeholder:e.slug,maxLength:120,onCommit:x=>g({name:x})}),o.jsx(jx,{label:"Tagline",value:l.tagline??"",placeholder:"Add a tagline",maxLength:200,onCommit:x=>g({tagline:x})}),p.map(x=>o.jsx(EY,{mark:x,busy:r,onRole:k=>void v("Could not retag that mark",()=>Re.updateLogo(e.id,x.hash??"",{role:k})),onBackground:k=>void v("Could not update that mark",()=>Re.updateLogo(e.id,x.hash??"",{background:k})),onRemove:()=>void v("Could not remove that mark",()=>Re.deleteLogo(e.id,x.hash??""))},x.hash??x.file)),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Variant"}),o.jsx("small",{children:"A second mark for dark or light grounds."})]}),o.jsxs("label",{className:"sc-btn sc-btn-ghost",children:[o.jsx(cr,{size:12}),"Add",o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:r,onChange:x=>{const k=Array.from(x.target.files??[]);x.target.value="",k.length&&w(k)}})]})]})]})}function jx({label:e,value:t,placeholder:n,maxLength:r,onCommit:a}){const[i,l]=s.useState(t);return s.useEffect(()=>l(t),[t]),o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:e})}),o.jsx("input",{className:"sc-in",value:i,placeholder:n,"aria-label":e,maxLength:r,dir:"auto",onChange:u=>l(u.target.value),onBlur:()=>{const u=i.trim();u!==t&&a(u),l(u)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur()),u.key==="Escape"&&(l(t),u.currentTarget.blur())}})]})}function SY({mark:e,name:t,busy:n,onUpload:r}){const[a,i]=s.useState(null);if(e){const l=e.hash?Mr(e.hash):e.file;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:l,alt:`${t} logo`,onLoad:u=>{const f=u.currentTarget,h=Math.max(f.naturalWidth,f.naturalHeight);i(h>0&&h<512?h:null)}})}),a!==null&&o.jsxs("small",{className:"sc-mark-small",children:["Only ",a,"px across. Fine lettering may not survive generation."]})]})}return o.jsxs("label",{className:"sc-well","data-empty":"","aria-label":"Add logo",children:[o.jsx(lv,{size:16}),o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:n,onChange:l=>{const u=Array.from(l.target.files??[]);l.target.value="",u.length&&r(u)}})]})}function EY({mark:e,busy:t,onRole:n,onBackground:r,onRemove:a}){const i=e.hash?Mr(e.hash):e.file;return o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:V1[e.role]})}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:i,alt:V1[e.role]})}),o.jsx("select",{className:"sc-in",value:e.role,disabled:t||!e.attachable,onChange:l=>n(l.target.value),"aria-label":"Mark role",children:wA.map(l=>o.jsx("option",{value:l,children:V1[l]},l))}),o.jsx("select",{className:"sc-in",value:e.background,disabled:t||!e.attachable,onChange:l=>r(l.target.value),"aria-label":"Sits on",children:wv.map(l=>o.jsx("option",{value:l,children:l==="any"?"Any background":`On ${l}`},l))}),e.attachable&&o.jsx("button",{type:"button",disabled:t,onClick:a,"aria-label":`Remove ${V1[e.role]}`,children:o.jsx(Vp,{size:13})})]})]})}const Ax={primary:"Primary",secondary:"Secondary",accent:"Accent",neutral:"Neutral"},CY=(e,t)=>t<=1?Ax[e]:`${Ax[e]} ${t}`;function jY(e){return/^(Primary|Secondary|Accent|Neutral)( [2-9]\d*)?$/.test(String(e??"").trim())}const AY=/^#[0-9A-F]{6}$/;function nr(e){const t=String(e??"").trim(),n=(t.startsWith("#")?t.slice(1):t).toUpperCase();if(/^[0-9A-F]{3}$/.test(n)){const[a,i,l]=n;return`#${a}${a}${i}${i}${l}${l}`}const r=`#${n}`;return AY.test(r)?r:null}const NY=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;function MY(e){const t=String(e??"").trim();return NY.test(t)?nr(t):null}function Zs(e){const t=[],n={primary:0,secondary:0,accent:0,neutral:0},r=(a,i)=>{const l=nr(String((a==null?void 0:a.hex)??""));if(!l)return;n[i]+=1;const u=String((a==null?void 0:a.name)??"").trim();t.push({hex:l,name:u||CY(i,n[i]),slot:i})};r(e==null?void 0:e.primary,"primary"),r(e==null?void 0:e.secondary,"secondary");for(const a of Array.isArray(e==null?void 0:e.accent)?e.accent:[])r(a,"accent");for(const a of Array.isArray(e==null?void 0:e.neutrals)?e.neutrals:[])r(a,"neutral");return t}function Nv(e,t){const n={},r=[],a=[],i=p=>{const g=p.name.trim();return g&&!jY(g)?{hex:p.hex,name:g}:{hex:p.hex}};for(const p of e){const g=nr(p.hex);if(!g)continue;const v=i({...p,hex:g});p.slot==="neutral"?a.push(v):r.push(v)}const[l,u,...f]=r;l&&(n.primary=l),u&&(n.secondary=u),f.length&&(n.accent=f),a.length&&(n.neutrals=a);const h=String((t==null?void 0:t.usage)??"").trim();return h&&(n.usage=h),n}const Nx=e=>e.slot!=="neutral";function Jp(e){var l;const t=(l=e[e.length-1])==null?void 0:l.hex;if(!t)return"#808080";const n=Number.parseInt(t.slice(1),16),[r,a,i]=[n>>16&255,n>>8&255,n&255];return`#${[i,r,a].map(u=>u.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function zA(e,t){const n=nr(t);if(!n)return{palette:e,added:!1,swatch:null};const r=Zs(e),a=r.find(f=>f.hex===n);if(a)return{palette:e,added:!1,swatch:a};const i=[...r,{hex:n,name:"",slot:r.length?"accent":"primary"}],l=Nv(i,e),u=Zs(l).find(f=>f.hex===n)??null;return{palette:l,added:!0,swatch:u}}function RY(e,t){const n=nr(t);if(!n)return{palette:e,removed:!1};const r=Zs(e),a=r.filter(i=>i.hex!==n);return a.length===r.length?{palette:e,removed:!1}:{palette:Nv(a,e),removed:!0}}function em(){return(em=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function BA(e,t){if(e==null)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function p0(e){var t=s.useRef(e),n=s.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var D0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},m0=function(e){return"touches"in e},y6=function(e){return e&&e.ownerDocument.defaultView||self},Mx=function(e,t,n){var r=e.getBoundingClientRect(),a=m0(t)?(function(i,l){for(var u=0;u<i.length;u++)if(i[u].identifier===l)return i[u];return i[0]})(t.touches,n):t;return{left:D0((a.pageX-(r.left+y6(e).pageXOffset))/r.width),top:D0((a.pageY-(r.top+y6(e).pageYOffset))/r.height)}},Rx=function(e){!m0(e)&&e.preventDefault()},UA=$n.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,a=BA(e,["onMove","onKey","onEnd"]),i=s.useRef(null),l=p0(t),u=p0(n),f=p0(r),h=s.useRef(null),p=s.useRef(!1),g=s.useMemo(function(){var k=function(j){Rx(j),(m0(j)?j.touches.length>0:j.buttons>0)&&i.current?l(Mx(i.current,j,h.current)):(E(!1),f())},S=function(){E(!1),f()};function E(j){var N=p.current,P=y6(i.current),$=j?P.addEventListener:P.removeEventListener;$(N?"touchmove":"mousemove",k),$(N?"touchend":"mouseup",S)}return[function(j){var N=j.nativeEvent,P=i.current;if(P&&(Rx(N),!(function(M,C){return C&&!m0(M)})(N,p.current)&&P)){if(m0(N)){p.current=!0;var $=N.changedTouches||[];$.length&&(h.current=$[0].identifier)}P.focus(),l(Mx(P,N,h.current)),E(!0)}},function(j){var N=j.which||j.keyCode;N<37||N>40||(j.preventDefault(),u({left:N===39?.05:N===37?-.05:0,top:N===40?.05:N===38?-.05:0}))},function(j){var N=j.which||j.keyCode;N>=37&&N<=40&&f()},E]},[u,l,f]),v=g[0],w=g[1],y=g[2],x=g[3];return s.useEffect(function(){return x},[x]),$n.createElement("div",em({},a,{onTouchStart:v,onMouseDown:v,className:"react-colorful__interactive",ref:i,onKeyDown:w,onKeyUp:y,tabIndex:0,role:"slider"}))}),Mv=function(e){return e.filter(Boolean).join(" ")},WA=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,i=Mv(["react-colorful__pointer",e.className]);return $n.createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},$n.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Hr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},PY=function(e){return HY(b6(e))},b6=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Hr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Hr(parseInt(e.substring(6,8),16)/255,2):1}},LY=function(e){return DY($Y(e))},TY=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:Hr(e.h),s:Hr(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Hr(a/2),a:Hr(r,2)}},x6=function(e){var t=TY(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},$Y=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),l=r*(1-n),u=r*(1-(t-i)*n),f=r*(1-(1-t+i)*n),h=i%6;return{r:Hr(255*[r,u,l,l,f,r][h]),g:Hr(255*[f,r,r,u,l,l][h]),b:Hr(255*[l,l,f,r,r,u][h]),a:Hr(a,2)}},z1=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},DY=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=a<1?z1(Hr(255*a)):"";return"#"+z1(t)+z1(n)+z1(r)+i},HY=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=Math.max(t,n,r),l=i-Math.min(t,n,r),u=l?i===t?(n-r)/l:i===n?2+(r-t)/l:4+(t-n)/l:0;return{h:Hr(60*(u<0?u+6:u)),s:Hr(i?l/i*100:0),v:Hr(i/255*100),a}},OY=$n.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,a=Mv(["react-colorful__hue",e.className]);return $n.createElement("div",{className:a},$n.createElement(UA,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:D0(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":Hr(t),"aria-valuemax":"360","aria-valuemin":"0"},$n.createElement(WA,{className:"react-colorful__hue-pointer",left:t/360,color:x6({h:t,s:100,v:100,a:1})})))}),IY=$n.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,a={backgroundColor:x6({h:t.h,s:100,v:100,a:1})};return $n.createElement("div",{className:"react-colorful__saturation",style:a},$n.createElement(UA,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:D0(t.s+100*i.left,0,100),v:D0(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+Hr(t.s)+"%, Brightness "+Hr(t.v)+"%"},$n.createElement(WA,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:x6(t)})))}),KA=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},FY=function(e,t){return e.toLowerCase()===t.toLowerCase()||KA(b6(e),b6(t))};function _Y(e,t,n,r){var a=p0(n),i=p0(r),l=s.useState(function(){return e.toHsva(t)}),u=l[0],f=l[1],h=s.useRef({color:t,hsva:u}),p=s.useRef(!1);s.useEffect(function(){if(!e.equal(t,h.current.color)){var w=e.toHsva(t);h.current={hsva:w,color:t},f(w),p.current=!1}},[t,e]),s.useEffect(function(){var w;KA(u,h.current.hsva)||e.equal(w=e.fromHsva(u),h.current.color)||(h.current={hsva:u,color:w},a(w),p.current=!0)},[u,e,a]);var g=s.useCallback(function(w){f(function(y){return Object.assign({},y,w)})},[]),v=s.useCallback(function(){p.current&&(p.current=!1,i(h.current.color))},[i]);return[u,g,v]}var ZY=typeof window<"u"?s.useLayoutEffect:s.useEffect,VY=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Px=new WeakMap,zY=function(e){ZY(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!Px.has(r)){var a="head"in r?r.head:r,i=(a.ownerDocument||document).createElement("style");i.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var l=VY();l&&i.setAttribute("nonce",l),Px.set(r,i),a.appendChild(i)}}},[])},BY=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,i=e.onChange,l=e.onChangeEnd,u=BA(e,["className","colorModel","color","onChange","onChangeEnd"]),f=s.useRef(null);zY(f);var h=_Y(n,a,i,l),p=h[0],g=h[1],v=h[2],w=Mv(["react-colorful",t]);return $n.createElement("div",em({},u,{ref:f,className:w}),$n.createElement(IY,{hsva:p,onChange:g,onChangeEnd:v}),$n.createElement(OY,{hue:p.h,onChange:g,onChangeEnd:v,className:"react-colorful__last-control"}))},UY={defaultColor:"000",toHsva:PY,fromHsva:function(e){return LY({h:e.h,s:e.s,v:e.v,a:1})},equal:FY},WY=function(e){return $n.createElement(BY,em({},e,{colorModel:UY}))};function Zu({value:e,onChange:t,label:n,presets:r,className:a,triggerStyle:i,triggerProps:l,tip:u,commitMode:f="live",align:h="start",children:p}){const g=nr(e)??"#000000",[v,w]=s.useState(g),[y,x]=s.useState(!1);s.useEffect(()=>{y||w(g)},[g,y]);const k=P=>{const $=nr(P);$&&(w($),f==="live"&&t($))},S=P=>{const $=nr(P);$&&(w($),t($),f==="close"&&x(!1))},E=P=>{if(x(P),P||f!=="close")return;const $=nr(v);$&&$!==g&&t($)},j=[...new Set((r??[]).map(P=>nr(P)).filter(P=>!!P))],N=o.jsx(Ou,{children:o.jsx("button",{type:"button",className:a??"sc-cp-trigger",style:{background:g,...i},"aria-label":n,...l,children:p})});return o.jsxs(Hu,{open:y,onOpenChange:E,children:[u?o.jsx(lr,{label:n,children:N}):N,o.jsxs(Iu,{className:"sc-cp",align:h,sideOffset:6,width:"232px",children:[o.jsx(WY,{color:v,onChange:k}),o.jsxs("div",{className:"sc-cp-foot",children:[o.jsx("span",{className:"sc-cp-preview",style:{background:v},"aria-hidden":!0}),o.jsx("input",{className:"sc-cp-hex",value:v,spellCheck:!1,maxLength:7,"aria-label":"Hex value",onChange:P=>{w(P.target.value);const $=nr(P.target.value);$&&f==="live"&&t($)},onBlur:()=>w(nr(v)??g),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),f==="close"?S(v):x(!1))}})]}),j.length>0&&o.jsx("div",{className:"sc-cp-presets",children:j.map(P=>o.jsx("button",{type:"button",style:{background:P},"data-on":P===v||void 0,title:P,"aria-label":P,onClick:()=>f==="close"?S(P):k(P)},P))})]})]})}function KY({doc:e,suggestions:t}){var w;const n=(w=e.json)==null?void 0:w.palette,[r,a]=s.useState(()=>Zs(n)),i=JSON.stringify(n??{});s.useEffect(()=>{a(Zs(n))},[i]);const l=(y,x=0)=>{a(y),e.patch({palette:Nv(y,n)},{debounce:x})},u=(y,x,k=0)=>l(r.map((S,E)=>E===y?{...S,...x}:S),k),f=()=>l([...r,{hex:Jp(r),name:"",slot:r.length?"accent":"primary"}]),h=(t??[]).filter(y=>{const x=nr(y.hex);return x&&!r.some(k=>k.hex===x)}),p=(y,x)=>o.jsx(GY,{swatch:y,presets:r.map(k=>k.hex),onHex:k=>u(x,{hex:k},300),onRemove:()=>l(r.filter((k,S)=>S!==x))},`${y.slot}-${x}`),g=r.map((y,x)=>[y,x]),v=g.filter(([y])=>!Nx(y));return o.jsxs("div",{className:"sc-pal",children:[r.length===0&&o.jsx("p",{className:"sc-pal-empty",children:"No colours yet. Add one and it becomes a chip you can drop into any shot."}),g.filter(([y])=>Nx(y)).map(([y,x])=>p(y,x)),v.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sc-pal-group",children:"Neutrals"}),v.map(([y,x])=>p(y,x))]}),o.jsxs("div",{className:"sc-pal-foot",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:f,children:[o.jsx(cr,{size:12}),"Add colour"]}),h.length>0&&o.jsxs("span",{className:"sc-pal-sugg",children:[o.jsx("small",{children:"From the website"}),h.map(y=>{const x=nr(y.hex);return o.jsx("button",{type:"button",className:"sc-pal-sugg-chip",style:{background:x},title:`Add ${x}`,"aria-label":`Add ${x}`,onClick:()=>l([...r,{hex:x,name:"",slot:"accent"}])},x)})]})]})]})}function GY({swatch:e,presets:t,onHex:n,onRemove:r}){const[a,i]=s.useState(e.hex);s.useEffect(()=>i(e.hex),[e.hex]);const l=()=>{const u=nr(a);u&&n(u),i(u??e.hex)};return o.jsxs("div",{className:"sc-pal-row",children:[o.jsx(Zu,{value:e.hex,onChange:n,label:`${e.name} color`,presets:t,className:"sc-pal-chip"}),o.jsx("span",{className:"sc-pal-name",children:e.name}),o.jsx("input",{className:"sc-in sc-pal-hex",value:a,spellCheck:!1,maxLength:7,"aria-label":`${e.name} hex`,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur())}}),o.jsx("button",{type:"button",className:"sc-pal-act","data-danger":"",onClick:r,"aria-label":`Remove ${e.name}`,title:"Remove",children:o.jsx(Vp,{size:13})})]})}function YY(){const{brand:e}=on(),{applyBrand:t}=Rn(),{push:n}=or(),[r,a]=s.useState({}),[i,l]=s.useState("idle"),u=s.useRef(r);u.current=r;const f=s.useRef(e);f.current=e;const h=s.useRef(null),p=s.useRef(!1),g=s.useRef(!1),v=s.useCallback(()=>({...f.current.json??{},...u.current}),[]),w=s.useCallback(async()=>{if(!Object.keys(u.current).length)return;if(p.current){g.current=!0;return}p.current=!0,l("saving");const E=u.current;try{const j=await Re.updateBrand(f.current.id,v());t(j),a(N=>{const P={...N};for(const $ of Object.keys(E))N[$]===E[$]&&delete P[$];return P}),l(g.current?"pending":"idle")}catch(j){l("error"),n({...nn(j,"Could not save the brand"),action:{label:"Retry",onClick:()=>void w()}})}finally{p.current=!1,g.current&&(g.current=!1,w())}},[t,v,n]),y=s.useCallback((E,j)=>{h.current&&(clearTimeout(h.current),h.current=null);const N={...u.current,...E};u.current=N,a(N),l("pending");const P=(j==null?void 0:j.debounce)??0;P>0?h.current=setTimeout(()=>void w(),P):w()},[w]),x=s.useCallback(async()=>{h.current&&(clearTimeout(h.current),h.current=null),await w()},[w]),k=s.useCallback(E=>{a({}),u.current={},t(E),l("idle")},[t]),S=e.id;return s.useEffect(()=>{a({}),u.current={},l("idle")},[S]),s.useEffect(()=>{const E=()=>{Object.keys(u.current).length&&mW(f.current.id,v()).then(j=>{j&&t(j)})};return window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E),h.current&&clearTimeout(h.current),E()}},[v,t]),{json:v(),state:i,patch:y,flush:x,applyRow:k}}function qY(e){return e==="saving"?"Saving…":e==="pending"?"Unsaved changes":e==="error"?"Not saved":"Saved"}function XY({onSaveState:e}){var w,y;const{brand:t}=on(),{push:n}=or(),r=YY();s.useEffect(()=>e(r.state),[r.state,e]);const[a,i]=s.useState(!1),[l,u]=s.useState([]),f=((y=(w=r.json)==null?void 0:w.meta)==null?void 0:y.website)??"",[h,p]=s.useState(f);s.useEffect(()=>p(f),[f]);const g=()=>{var E;const x=h.trim(),k=x&&!/^https?:\/\//i.test(x)?`https://${x}`:x;p(k);const S={...((E=r.json)==null?void 0:E.meta)??{}};k?S.website=k:delete S.website,r.patch({meta:S})},v=async()=>{var x,k,S;i(!0);try{await r.flush();const E=await Re.refreshBrandFromUrl(t.id);r.applyRow(E),u(((x=E.suggestions)==null?void 0:x.palette)??[]),n({kind:(k=E.warnings)!=null&&k.length?"warning":"success",title:"Read the website again",detail:(S=E.warnings)!=null&&S.length?E.warnings.join(" "):"Your edits were kept."})}catch(E){n(nn(E,"Could not read that website"))}finally{i(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(Qr,{title:"Identity",sub:"The name and the mark.",children:o.jsx(kY,{brand:t,doc:r})}),o.jsx(Qr,{title:"Palette",sub:"Favoured on a shot that asks for the kit.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(KY,{doc:r,suggestions:l})})}),o.jsx(Qr,{title:"We never",sub:"Held on every shot, whether the kit is asked for or not.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(xY,{doc:r})})}),o.jsxs(Qr,{title:"Website and file",sub:"The kit is a file, not a lock-in.",children:[o.jsxs("div",{className:"sc-set-row","data-stack":"",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Website"}),o.jsx("small",{children:"Reads colours and marks from the site again. Edits are kept; new colours are offered, not applied."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("input",{className:"sc-in",value:h,type:"url",inputMode:"url",placeholder:"acme.coffee","aria-label":"Brand website",onChange:x=>p(x.target.value),onBlur:g,onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),x.currentTarget.blur())}}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:!f||a,onClick:()=>void v(),children:[a?o.jsx(xr,{size:"1"}):o.jsx(tC,{size:13})," Refresh"]})]})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export .brand"}),o.jsx("small",{"data-prose":"",children:"A zip holding brand.json and every image it references: the form any tool can read."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:hW(t.id),download:!0,onClick:()=>void r.flush(),children:"Export"})]})]})]})}const Bi=e=>e.replace(/\s*\(BYOK\)\s*$/i,""),H0="codex-cli";function QY(e,t){var n;return e.some(r=>r.id===t)?t:((n=e[0])==null?void 0:n.id)??H0}const JY=e=>e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");function eq(e){return e.free?e.localOnly?"Runs on your ChatGPT plan":"No cost per image":`$${JY(e.perGeneration)} / image`}function tq(e,t){if(t)return e.available?"Manage":"Connect";if(e.available)return e.id===H0?"Manage":null;switch(e.code){case"update-needed":return"Update";case"env-conflict":return"Fix";case"not-installed":case"not-authenticated":case"unverified":return"Set up";default:return null}}function nq({engines:e,onSaved:t}){const n=e.filter(l=>!l.free),[r,a]=s.useState({});s.useEffect(()=>{a(Object.fromEntries(n.map(l=>[l.id,l.cap===null?"":String(l.cap)])))},[e]);const i=async l=>{const u=(r[l]??"").trim(),f=u===""?null:Number(u);f!==null&&(Number.isNaN(f)||f<0)||(await Re.setCap(l,f),t())};return n.length?o.jsx(Qr,{title:"Monthly caps",sub:"Your own API budget. Generation stops before a cap is crossed, so a runaway loop cannot spend your month.",children:n.map(l=>{const u=l.generationsLeft,f=l.generationsTotal,h=f&&f>0?Math.min(100,Math.round((f-(u??0))/f*100)):0,p=`$${l.monthlySpend.toFixed(2)} this month`;return o.jsxs("div",{className:"sc-cap",children:[o.jsxs("div",{className:"sc-cap-top",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:Bi(l.displayName)}),o.jsx("small",{children:u===null?p:`${p} · ${u} left`})]}),o.jsxs("div",{className:"sc-cap-in",children:[o.jsx("span",{className:"sc-cap-dollar",children:"$"}),o.jsx("input",{className:"sc-in",inputMode:"decimal",placeholder:"None",value:r[l.id]??"",onChange:g=>a(v=>({...v,[l.id]:g.target.value})),onBlur:()=>void i(l.id),"aria-label":`${Bi(l.displayName)} monthly cap in dollars`})]})]}),f!==null&&o.jsx("div",{className:"sc-meter",children:o.jsx("i",{style:{width:`${h}%`}})})]},l.id)})}):o.jsx(Qr,{title:"Monthly caps",sub:"Nothing to cap yet. Caps apply to engines you pay for per image. Codex usage counts against your ChatGPT plan, which OpenAI meters, not Scenri.",children:o.jsx("p",{className:"sc-set-empty",children:"Add a paid engine key and its cap appears here."})})}function rq({onDone:e}){const{brand:t,resetShots:n}=on(),{refresh:r}=Rn(),a=Dn(),[i,l]=s.useState(!1),u=s.useCallback(async f=>{l(!0);try{await Re.deleteData(f),e(),f==="shots"&&n(),f==="all"&&window.location.replace("/")}finally{l(!1)}},[e,n]);return o.jsxs(o.Fragment,{children:[o.jsx(Qr,{title:"This brand",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete this brand"}),o.jsxs("small",{"data-prose":"",children:["Removes ",ca(t),", its sets and every shot. Other brands stay."]})]}),o.jsx(Wn,{label:"Delete brand",title:`Delete ${ca(t)}?`,body:"The kit, its sets and every shot go with it. Exports you already downloaded stay yours.",busy:i,onConfirm:()=>{l(!0),Re.deleteBrand(t.id).then(()=>r()).then(()=>a("/",{replace:!0})).finally(()=>l(!1))}})]})}),o.jsxs(Qr,{title:"Every brand",children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete generated shots"}),o.jsx("small",{"data-prose":"",children:"Removes every set and every generated shot, in every brand. Brands, cast and scenes stay."})]}),o.jsx(Wn,{label:"Delete shots",title:"Delete every generated shot?",body:"Brands, cast and scenes stay. Every set and every generated shot goes.",busy:i,onConfirm:()=>void u("shots")})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete all local data"}),o.jsx("small",{"data-prose":"",children:"Brands, cast, sets, shots and saved keys, in one go."})]}),o.jsx(Wn,{label:"Delete everything",title:"Delete everything on this machine?",body:"The whole library folder is removed: brands, cast, sets, shots and your saved keys. There is no undo.",busy:i,onConfirm:()=>void u("all")})]})]})]})}function sq(e,t){return t?{body:t,action:"retry"}:e?e.installKind==="dev"?{body:"Running from source; nothing to put on a desktop.",action:null}:e.supported?e.installed?{body:"Scenri is on your desktop.",action:"recreate"}:{body:"Open Scenri without a terminal.",action:"add"}:{body:"Desktop shortcuts are not available on this system yet.",action:null}:{body:"Checking this machine.",action:null}}function aq({status:e,onStatus:t}){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),f=s.useRef(null);s.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=async()=>{if(!a){i(!0),r(null);try{await Re.desktopInstall(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1600),t(await Re.desktop())}catch(g){r(String((g==null?void 0:g.message)??g))}finally{i(!1)}}},p=sq(e,n);return o.jsx(Qr,{title:"This computer",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Desktop shortcut"}),o.jsx("small",{"data-prose":"",children:p.body})]}),p.action&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a,onClick:()=>void h(),children:l?"Added":a?"Adding…":p.action==="add"?"Add to desktop":p.action==="recreate"?"Recreate":"Try again"})]})})}function GA(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z"})})}function oq(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})})}function iq(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M24 10.262v2.712h-9.518V24h-3.034V10.262zm0-5.131v2.717H8.755V24H5.722V5.131zM24 0v2.717H3.034V24H0V0z"})})}const lq=[{engineId:"openrouter",settingKey:"openrouter_api_key",hint:"sk-or-...",keysUrl:"https://openrouter.ai/keys"},{engineId:"replicate",settingKey:"replicate_api_token",hint:"r8_...",keysUrl:"https://replicate.com/account/api-tokens"},{engineId:"fal",settingKey:"fal_key",hint:"fal_...",keysUrl:"https://fal.ai/dashboard/keys"}],YA=e=>lq.find(t=>t.engineId===e),qA={"codex-cli":{Mark:GA,size:16,plate:"#FFFFFF",ink:"#000000"},openrouter:{Mark:oq,size:18,plate:"#FFFFFF",ink:"#7624F4"},replicate:{Mark:iq,size:15,plate:"#E42022",ink:"#FFFFFF"}},XA=e=>{const t=qA[e];return t?{plate:t.plate,ink:t.ink}:void 0},cq={demo:DU};function QA({engineId:e,scale:t=1}){const n=qA[e];if(n){const a=Math.round(n.size*t);return o.jsx(n.Mark,{width:a,height:a})}const r=cq[e]??R0;return o.jsx(r,{size:Math.round(15*t)})}const uq=e=>[...e].sort((t,n)=>+(n.id===H0)-+(t.id===H0));function dq({engines:e}){const t=Ec(),r=e.filter(a=>a.available).length===0;return o.jsx(Qr,{children:uq(e).map(a=>{const i=YA(a.id),l=Bi(a.displayName),u=tq(a,!!i),f=a.available?"Connected":null,h=!f&&a.reason&&(!u||a.code==="unverified"),p=XA(a.id);return o.jsxs("div",{className:"sc-eng","data-connected":a.available?"":void 0,children:[o.jsx("span",{className:"sc-eng-ic","data-brand":p?"":void 0,style:p?{"--sc-plate":p.plate,"--sc-ink":p.ink}:void 0,children:o.jsx(QA,{engineId:a.id})}),o.jsxs("span",{className:"sc-eng-name",children:[o.jsx("b",{children:l}),o.jsx("small",{children:eq(a)})]}),f&&o.jsxs("span",{className:"sc-stat",children:[o.jsx("span",{className:"d"}),f]}),h&&o.jsx("span",{className:"sc-stat sc-stat-why",children:a.reason}),u&&o.jsx("button",{type:"button",className:`sc-btn ${r&&!i?"sc-btn-primary":"sc-btn-ghost"} sc-eng-act`,onClick:()=>t(a.id),"aria-label":`${u} ${l}`,children:u})]},a.id)})})}const fq=e=>e>1e9?`${(e/1e9).toFixed(1)} GB`:e>1e6?`${Math.round(e/1e6)} MB`:`${Math.round(e/1e3)} KB`,Dg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function hq(e){return e===0?0:e<3?1:e<6?2:e<12?3:4}function Lx(e,t){const n=t*7,r=new Date,a=new Date(r);a.setDate(r.getDate()-(n-1)-r.getDay());const i=[],l=[];let u=-1,f=0;for(let h=0;h<n;h++){const p=new Date(a);p.setDate(a.getDate()+h);const g=p.toISOString().slice(0,10),v=e.get(g)??0;if(f+=v,i.push({key:g,level:hq(v),title:v?`${v} run${v===1?"":"s"} on ${p.getDate()} ${Dg[p.getMonth()]}`:`nothing on ${p.getDate()} ${Dg[p.getMonth()]}`}),p.getDay()===0){const w=p.getMonth()!==u&&p.getDate()<=7;w&&(u=p.getMonth()),l.push({key:g,label:w?Dg[p.getMonth()]:""})}}return{cells:i,months:l,sum:f}}function pq({info:e,thisComputer:t}){return o.jsxs(Qr,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Library folder"}),o.jsx("small",{children:e?`${e.dir} · ${fq(e.bytes)} across ${e.images} images`:"…"})]}),t&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void Re.reveal(),children:"Reveal"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export everything"}),o.jsx("small",{children:"One zip: brands, cast, prompts, shots. Never keys."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:"/api/export/all",download:!0,children:"Export"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Telemetry"}),o.jsx("small",{children:"There is none. This row exists to say so."})]}),o.jsx("span",{className:"sc-tag",children:"off, permanently"})]})]})}async function mq(e,t){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.activeElement,r=document.createElement("textarea");r.value=e,r.readOnly=!0,r.setAttribute("aria-hidden","true"),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;",(t??document.body).appendChild(r);try{return r.focus(),r.select(),r.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{r.remove(),n==null||n.focus()}}const rd=function(e,t){let a=e;const i=s0[t];let l=null,u=0,f=null;const h=[],p={},g=function(M,C){u=a*4+17,l=(function(R){const T=new Array(R);for(let H=0;H<R;H+=1){T[H]=new Array(R);for(let D=0;D<R;D+=1)T[H][D]=null}return T})(u),v(0,0),v(u-7,0),v(0,u-7),x(),y(),S(M,C),a>=7&&k(M),f==null&&(f=N(a,i,h)),E(f,C)},v=function(M,C){for(let R=-1;R<=7;R+=1)if(!(M+R<=-1||u<=M+R))for(let T=-1;T<=7;T+=1)C+T<=-1||u<=C+T||(0<=R&&R<=6&&(T==0||T==6)||0<=T&&T<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=T&&T<=4?l[M+R][C+T]=!0:l[M+R][C+T]=!1)},w=function(){let M=0,C=0;for(let R=0;R<8;R+=1){g(!0,R);const T=Ai.getLostPoint(p);(R==0||M>T)&&(M=T,C=R)}return C},y=function(){for(let M=8;M<u-8;M+=1)l[M][6]==null&&(l[M][6]=M%2==0);for(let M=8;M<u-8;M+=1)l[6][M]==null&&(l[6][M]=M%2==0)},x=function(){const M=Ai.getPatternPosition(a);for(let C=0;C<M.length;C+=1)for(let R=0;R<M.length;R+=1){const T=M[C],H=M[R];if(l[T][H]==null)for(let D=-2;D<=2;D+=1)for(let K=-2;K<=2;K+=1)D==-2||D==2||K==-2||K==2||D==0&&K==0?l[T+D][H+K]=!0:l[T+D][H+K]=!1}},k=function(M){const C=Ai.getBCHTypeNumber(a);for(let R=0;R<18;R+=1){const T=!M&&(C>>R&1)==1;l[Math.floor(R/3)][R%3+u-8-3]=T}for(let R=0;R<18;R+=1){const T=!M&&(C>>R&1)==1;l[R%3+u-8-3][Math.floor(R/3)]=T}},S=function(M,C){const R=i<<3|C,T=Ai.getBCHTypeInfo(R);for(let H=0;H<15;H+=1){const D=!M&&(T>>H&1)==1;H<6?l[H][8]=D:H<8?l[H+1][8]=D:l[u-15+H][8]=D}for(let H=0;H<15;H+=1){const D=!M&&(T>>H&1)==1;H<8?l[8][u-H-1]=D:H<9?l[8][15-H-1+1]=D:l[8][15-H-1]=D}l[u-8][8]=!M},E=function(M,C){let R=-1,T=u-1,H=7,D=0;const K=Ai.getMaskFunction(C);for(let O=u-1;O>0;O-=2)for(O==6&&(O-=1);;){for(let Z=0;Z<2;Z+=1)if(l[T][O-Z]==null){let te=!1;D<M.length&&(te=(M[D]>>>H&1)==1),K(T,O-Z)&&(te=!te),l[T][O-Z]=te,H-=1,H==-1&&(D+=1,H=7)}if(T+=R,T<0||u<=T){T-=R,R=-R;break}}},j=function(M,C){let R=0,T=0,H=0;const D=new Array(C.length),K=new Array(C.length);for(let B=0;B<C.length;B+=1){const F=C[B].dataCount,X=C[B].totalCount-F;T=Math.max(T,F),H=Math.max(H,X),D[B]=new Array(F);for(let G=0;G<D[B].length;G+=1)D[B][G]=255&M.getBuffer()[G+R];R+=F;const z=Ai.getErrorCorrectPolynomial(X),U=O0(D[B],z.getLength()-1).mod(z);K[B]=new Array(z.getLength()-1);for(let G=0;G<K[B].length;G+=1){const ne=G+U.getLength()-K[B].length;K[B][G]=ne>=0?U.getAt(ne):0}}let O=0;for(let B=0;B<C.length;B+=1)O+=C[B].totalCount;const Z=new Array(O);let te=0;for(let B=0;B<T;B+=1)for(let F=0;F<C.length;F+=1)B<D[F].length&&(Z[te]=D[F][B],te+=1);for(let B=0;B<H;B+=1)for(let F=0;F<C.length;F+=1)B<K[F].length&&(Z[te]=K[F][B],te+=1);return Z},N=function(M,C,R){const T=Tx.getRSBlocks(M,C),H=$x();for(let K=0;K<R.length;K+=1){const O=R[K];H.put(O.getMode(),4),H.put(O.getLength(),Ai.getLengthInBits(O.getMode(),M)),O.write(H)}let D=0;for(let K=0;K<T.length;K+=1)D+=T[K].dataCount;if(H.getLengthInBits()>D*8)throw"code length overflow. ("+H.getLengthInBits()+">"+D*8+")";for(H.getLengthInBits()+4<=D*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=D*8||(H.put(236,8),H.getLengthInBits()>=D*8));)H.put(17,8);return j(H,T)};p.addData=function(M,C){C=C||"Byte";let R=null;switch(C){case"Numeric":R=gq(M);break;case"Alphanumeric":R=vq(M);break;case"Byte":R=wq(M);break;case"Kanji":R=yq(M);break;default:throw"mode:"+C}h.push(R),f=null},p.isDark=function(M,C){if(M<0||u<=M||C<0||u<=C)throw M+","+C;return l[M][C]},p.getModuleCount=function(){return u},p.make=function(){if(a<1){let M=1;for(;M<40;M++){const C=Tx.getRSBlocks(M,i),R=$x();for(let H=0;H<h.length;H++){const D=h[H];R.put(D.getMode(),4),R.put(D.getLength(),Ai.getLengthInBits(D.getMode(),M)),D.write(R)}let T=0;for(let H=0;H<C.length;H++)T+=C[H].dataCount;if(R.getLengthInBits()<=T*8)break}a=M}g(!1,w())},p.createTableTag=function(M,C){M=M||2,C=typeof C>"u"?M*4:C;let R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+C+"px;",R+='">',R+="<tbody>";for(let T=0;T<p.getModuleCount();T+=1){R+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+M+"px;",R+=" height: "+M+"px;",R+=" background-color: ",R+=p.isDark(T,H)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},p.createSvgTag=function(M,C,R,T){let H={};typeof arguments[0]=="object"&&(H=arguments[0],M=H.cellSize,C=H.margin,R=H.alt,T=H.title),M=M||2,C=typeof C>"u"?M*4:C,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-description":null,T=typeof T=="string"?{text:T}:T||{},T.text=T.text||null,T.id=T.text?T.id||"qrcode-title":null;const D=p.getModuleCount()*M+C*2;let K,O,Z,te,B="",F;for(F="l"+M+",0 0,"+M+" -"+M+",0 0,-"+M+"z ",B+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',B+=H.scalable?"":' width="'+D+'px" height="'+D+'px"',B+=' viewBox="0 0 '+D+" "+D+'" ',B+=' preserveAspectRatio="xMinYMin meet"',B+=T.text||R.text?' role="img" aria-labelledby="'+P([T.id,R.id].join(" ").trim())+'"':"",B+=">",B+=T.text?'<title id="'+P(T.id)+'">'+P(T.text)+"</title>":"",B+=R.text?'<description id="'+P(R.id)+'">'+P(R.text)+"</description>":"",B+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',B+='<path d="',Z=0;Z<p.getModuleCount();Z+=1)for(te=Z*M+C,K=0;K<p.getModuleCount();K+=1)p.isDark(Z,K)&&(O=K*M+C,B+="M"+O+","+te+F);return B+='" stroke="transparent" fill="black"/>',B+="</svg>",B},p.createDataURL=function(M,C){M=M||2,C=typeof C>"u"?M*4:C;const R=p.getModuleCount()*M+C*2,T=C,H=R-C;return Sq(R,R,function(D,K){if(T<=D&&D<H&&T<=K&&K<H){const O=Math.floor((D-T)/M),Z=Math.floor((K-T)/M);return p.isDark(Z,O)?0:1}else return 1})},p.createImgTag=function(M,C,R){M=M||2,C=typeof C>"u"?M*4:C;const T=p.getModuleCount()*M+C*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(M,C),H+='"',H+=' width="',H+=T,H+='"',H+=' height="',H+=T,H+='"',R&&(H+=' alt="',H+=P(R),H+='"'),H+="/>",H};const P=function(M){let C="";for(let R=0;R<M.length;R+=1){const T=M.charAt(R);switch(T){case"<":C+="&lt;";break;case">":C+="&gt;";break;case"&":C+="&amp;";break;case'"':C+="&quot;";break;default:C+=T;break}}return C},$=function(M){M=typeof M>"u"?2:M;const R=p.getModuleCount()*1+M*2,T=M,H=R-M;let D,K,O,Z,te;const B={"██":"█","█ ":"▀"," █":"▄"," ":" "},F={"██":"▀","█ ":"▀"," █":" "," ":" "};let X="";for(D=0;D<R;D+=2){for(O=Math.floor((D-T)/1),Z=Math.floor((D+1-T)/1),K=0;K<R;K+=1)te="█",T<=K&&K<H&&T<=D&&D<H&&p.isDark(O,Math.floor((K-T)/1))&&(te=" "),T<=K&&K<H&&T<=D+1&&D+1<H&&p.isDark(Z,Math.floor((K-T)/1))?te+=" ":te+="█",X+=M<1&&D+1>=H?F[te]:B[te];X+=`
97
- `}return R%2&&M>0?X.substring(0,X.length-R-1)+Array(R+1).join("▀"):X.substring(0,X.length-1)};return p.createASCII=function(M,C){if(M=M||1,M<2)return $(C);M-=1,C=typeof C>"u"?M*2:C;const R=p.getModuleCount()*M+C*2,T=C,H=R-C;let D,K,O,Z;const te=Array(M+1).join("██"),B=Array(M+1).join(" ");let F="",X="";for(D=0;D<R;D+=1){for(O=Math.floor((D-T)/M),X="",K=0;K<R;K+=1)Z=1,T<=K&&K<H&&T<=D&&D<H&&p.isDark(O,Math.floor((K-T)/M))&&(Z=0),X+=Z?te:B;for(O=0;O<M;O+=1)F+=X+`
98
- `}return F.substring(0,F.length-1)},p.renderTo2dContext=function(M,C){C=C||2;const R=p.getModuleCount();for(let T=0;T<R;T++)for(let H=0;H<R;H++)M.fillStyle=p.isDark(T,H)?"black":"white",M.fillRect(H*C,T*C,C,C)},p};rd.stringToBytes=function(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t.push(r&255)}return t};rd.createStringToBytes=function(e,t){const n=(function(){const a=xq(e),i=function(){const f=a.read();if(f==-1)throw"eof";return f};let l=0;const u={};for(;;){const f=a.read();if(f==-1)break;const h=i(),p=i(),g=i(),v=String.fromCharCode(f<<8|h),w=p<<8|g;u[v]=w,l+=1}if(l!=t)throw l+" != "+t;return u})(),r=63;return function(a){const i=[];for(let l=0;l<a.length;l+=1){const u=a.charCodeAt(l);if(u<128)i.push(u);else{const f=n[a.charAt(l)];typeof f=="number"?(f&255)==f?i.push(f):(i.push(f>>>8),i.push(f&255)):i.push(r)}}return i}};const Gr={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},s0={L:1,M:0,Q:3,H:2},ji={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ai=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r=21522,a={},i=function(l){let u=0;for(;l!=0;)u+=1,l>>>=1;return u};return a.getBCHTypeInfo=function(l){let u=l<<10;for(;i(u)-i(t)>=0;)u^=t<<i(u)-i(t);return(l<<10|u)^r},a.getBCHTypeNumber=function(l){let u=l<<12;for(;i(u)-i(n)>=0;)u^=n<<i(u)-i(n);return l<<12|u},a.getPatternPosition=function(l){return e[l-1]},a.getMaskFunction=function(l){switch(l){case ji.PATTERN000:return function(u,f){return(u+f)%2==0};case ji.PATTERN001:return function(u,f){return u%2==0};case ji.PATTERN010:return function(u,f){return f%3==0};case ji.PATTERN011:return function(u,f){return(u+f)%3==0};case ji.PATTERN100:return function(u,f){return(Math.floor(u/2)+Math.floor(f/3))%2==0};case ji.PATTERN101:return function(u,f){return u*f%2+u*f%3==0};case ji.PATTERN110:return function(u,f){return(u*f%2+u*f%3)%2==0};case ji.PATTERN111:return function(u,f){return(u*f%3+(u+f)%2)%2==0};default:throw"bad maskPattern:"+l}},a.getErrorCorrectPolynomial=function(l){let u=O0([1],0);for(let f=0;f<l;f+=1)u=u.multiply(O0([1,Ri.gexp(f)],0));return u},a.getLengthInBits=function(l,u){if(1<=u&&u<10)switch(l){case Gr.MODE_NUMBER:return 10;case Gr.MODE_ALPHA_NUM:return 9;case Gr.MODE_8BIT_BYTE:return 8;case Gr.MODE_KANJI:return 8;default:throw"mode:"+l}else if(u<27)switch(l){case Gr.MODE_NUMBER:return 12;case Gr.MODE_ALPHA_NUM:return 11;case Gr.MODE_8BIT_BYTE:return 16;case Gr.MODE_KANJI:return 10;default:throw"mode:"+l}else if(u<41)switch(l){case Gr.MODE_NUMBER:return 14;case Gr.MODE_ALPHA_NUM:return 13;case Gr.MODE_8BIT_BYTE:return 16;case Gr.MODE_KANJI:return 12;default:throw"mode:"+l}else throw"type:"+u},a.getLostPoint=function(l){const u=l.getModuleCount();let f=0;for(let g=0;g<u;g+=1)for(let v=0;v<u;v+=1){let w=0;const y=l.isDark(g,v);for(let x=-1;x<=1;x+=1)if(!(g+x<0||u<=g+x))for(let k=-1;k<=1;k+=1)v+k<0||u<=v+k||x==0&&k==0||y==l.isDark(g+x,v+k)&&(w+=1);w>5&&(f+=3+w-5)}for(let g=0;g<u-1;g+=1)for(let v=0;v<u-1;v+=1){let w=0;l.isDark(g,v)&&(w+=1),l.isDark(g+1,v)&&(w+=1),l.isDark(g,v+1)&&(w+=1),l.isDark(g+1,v+1)&&(w+=1),(w==0||w==4)&&(f+=3)}for(let g=0;g<u;g+=1)for(let v=0;v<u-6;v+=1)l.isDark(g,v)&&!l.isDark(g,v+1)&&l.isDark(g,v+2)&&l.isDark(g,v+3)&&l.isDark(g,v+4)&&!l.isDark(g,v+5)&&l.isDark(g,v+6)&&(f+=40);for(let g=0;g<u;g+=1)for(let v=0;v<u-6;v+=1)l.isDark(v,g)&&!l.isDark(v+1,g)&&l.isDark(v+2,g)&&l.isDark(v+3,g)&&l.isDark(v+4,g)&&!l.isDark(v+5,g)&&l.isDark(v+6,g)&&(f+=40);let h=0;for(let g=0;g<u;g+=1)for(let v=0;v<u;v+=1)l.isDark(v,g)&&(h+=1);const p=Math.abs(100*h/u/u-50)/5;return f+=p*10,f},a})(),Ri=(function(){const e=new Array(256),t=new Array(256);for(let r=0;r<8;r+=1)e[r]=1<<r;for(let r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(let r=0;r<255;r+=1)t[e[r]]=r;const n={};return n.glog=function(r){if(r<1)throw"glog("+r+")";return t[r]},n.gexp=function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return e[r]},n})(),O0=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const n=(function(){let a=0;for(;a<e.length&&e[a]==0;)a+=1;const i=new Array(e.length-a+t);for(let l=0;l<e.length-a;l+=1)i[l]=e[l+a];return i})(),r={};return r.getAt=function(a){return n[a]},r.getLength=function(){return n.length},r.multiply=function(a){const i=new Array(r.getLength()+a.getLength()-1);for(let l=0;l<r.getLength();l+=1)for(let u=0;u<a.getLength();u+=1)i[l+u]^=Ri.gexp(Ri.glog(r.getAt(l))+Ri.glog(a.getAt(u)));return O0(i,0)},r.mod=function(a){if(r.getLength()-a.getLength()<0)return r;const i=Ri.glog(r.getAt(0))-Ri.glog(a.getAt(0)),l=new Array(r.getLength());for(let u=0;u<r.getLength();u+=1)l[u]=r.getAt(u);for(let u=0;u<a.getLength();u+=1)l[u]^=Ri.gexp(Ri.glog(a.getAt(u))+i);return O0(l,0).mod(a)},r},Tx=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(a,i){const l={};return l.totalCount=a,l.dataCount=i,l},n={},r=function(a,i){switch(i){case s0.L:return e[(a-1)*4+0];case s0.M:return e[(a-1)*4+1];case s0.Q:return e[(a-1)*4+2];case s0.H:return e[(a-1)*4+3];default:return}};return n.getRSBlocks=function(a,i){const l=r(a,i);if(typeof l>"u")throw"bad rs block @ typeNumber:"+a+"/errorCorrectionLevel:"+i;const u=l.length/3,f=[];for(let h=0;h<u;h+=1){const p=l[h*3+0],g=l[h*3+1],v=l[h*3+2];for(let w=0;w<p;w+=1)f.push(t(g,v))}return f},n})(),$x=function(){const e=[];let t=0;const n={};return n.getBuffer=function(){return e},n.getAt=function(r){const a=Math.floor(r/8);return(e[a]>>>7-r%8&1)==1},n.put=function(r,a){for(let i=0;i<a;i+=1)n.putBit((r>>>a-i-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(r){const a=Math.floor(t/8);e.length<=a&&e.push(0),r&&(e[a]|=128>>>t%8),t+=1},n},gq=function(e){const t=Gr.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(l){return n.length},r.write=function(l){const u=n;let f=0;for(;f+2<u.length;)l.put(a(u.substring(f,f+3)),10),f+=3;f<u.length&&(u.length-f==1?l.put(a(u.substring(f,f+1)),4):u.length-f==2&&l.put(a(u.substring(f,f+2)),7))};const a=function(l){let u=0;for(let f=0;f<l.length;f+=1)u=u*10+i(l.charAt(f));return u},i=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;throw"illegal char :"+l};return r},vq=function(e){const t=Gr.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(i){return n.length},r.write=function(i){const l=n;let u=0;for(;u+1<l.length;)i.put(a(l.charAt(u))*45+a(l.charAt(u+1)),11),u+=2;u<l.length&&i.put(a(l.charAt(u)),6)};const a=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;if("A"<=i&&i<="Z")return i.charCodeAt(0)-65+10;switch(i){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+i}};return r},wq=function(e){const t=Gr.MODE_8BIT_BYTE,n=rd.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(a){return n.length},r.write=function(a){for(let i=0;i<n.length;i+=1)a.put(n[i],8)},r},yq=function(e){const t=Gr.MODE_KANJI,n=rd.stringToBytes;(function(i,l){const u=n(i);if(u.length!=2||(u[0]<<8|u[1])!=l)throw"sjis not supported."})("友",38726);const r=n(e),a={};return a.getMode=function(){return t},a.getLength=function(i){return~~(r.length/2)},a.write=function(i){const l=r;let u=0;for(;u+1<l.length;){let f=(255&l[u])<<8|255&l[u+1];if(33088<=f&&f<=40956)f-=33088;else if(57408<=f&&f<=60351)f-=49472;else throw"illegal char at "+(u+1)+"/"+f;f=(f>>>8&255)*192+(f&255),i.put(f,13),u+=2}if(u<l.length)throw"illegal char at "+(u+1)},a},JA=function(){const e=[],t={};return t.writeByte=function(n){e.push(n&255)},t.writeShort=function(n){t.writeByte(n),t.writeByte(n>>>8)},t.writeBytes=function(n,r,a){r=r||0,a=a||n.length;for(let i=0;i<a;i+=1)t.writeByte(n[i+r])},t.writeString=function(n){for(let r=0;r<n.length;r+=1)t.writeByte(n.charCodeAt(r))},t.toByteArray=function(){return e},t.toString=function(){let n="";n+="[";for(let r=0;r<e.length;r+=1)r>0&&(n+=","),n+=e[r];return n+="]",n},t},bq=function(){let e=0,t=0,n=0,r="";const a={},i=function(u){r+=String.fromCharCode(l(u&63))},l=function(u){if(u<0)throw"n:"+u;if(u<26)return 65+u;if(u<52)return 97+(u-26);if(u<62)return 48+(u-52);if(u==62)return 43;if(u==63)return 47;throw"n:"+u};return a.writeByte=function(u){for(e=e<<8|u&255,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},a.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0){const u=3-n%3;for(let f=0;f<u;f+=1)r+="="}},a.toString=function(){return r},a},xq=function(e){const t=e;let n=0,r=0,a=0;const i={};i.read=function(){for(;a<8;){if(n>=t.length){if(a==0)return-1;throw"unexpected end of file./"+a}const f=t.charAt(n);if(n+=1,f=="=")return a=0,-1;if(f.match(/^\s$/))continue;r=r<<6|l(f.charCodeAt(0)),a+=6}const u=r>>>a-8&255;return a-=8,u};const l=function(u){if(65<=u&&u<=90)return u-65;if(97<=u&&u<=122)return u-97+26;if(48<=u&&u<=57)return u-48+52;if(u==43)return 62;if(u==47)return 63;throw"c:"+u};return i},kq=function(e,t){const n=e,r=t,a=new Array(e*t),i={};i.setPixel=function(h,p,g){a[p*n+h]=g},i.write=function(h){h.writeString("GIF87a"),h.writeShort(n),h.writeShort(r),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(n),h.writeShort(r),h.writeByte(0);const p=2,g=u(p);h.writeByte(p);let v=0;for(;g.length-v>255;)h.writeByte(255),h.writeBytes(g,v,255),v+=255;h.writeByte(g.length-v),h.writeBytes(g,v,g.length-v),h.writeByte(0),h.writeString(";")};const l=function(h){const p=h;let g=0,v=0;const w={};return w.write=function(y,x){if(y>>>x)throw"length over";for(;g+x>=8;)p.writeByte(255&(y<<g|v)),x-=8-g,y>>>=8-g,v=0,g=0;v=y<<g|v,g=g+x},w.flush=function(){g>0&&p.writeByte(v)},w},u=function(h){const p=1<<h,g=(1<<h)+1;let v=h+1;const w=f();for(let E=0;E<p;E+=1)w.add(String.fromCharCode(E));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(g));const y=JA(),x=l(y);x.write(p,v);let k=0,S=String.fromCharCode(a[k]);for(k+=1;k<a.length;){const E=String.fromCharCode(a[k]);k+=1,w.contains(S+E)?S=S+E:(x.write(w.indexOf(S),v),w.size()<4095&&(w.size()==1<<v&&(v+=1),w.add(S+E)),S=E)}return x.write(w.indexOf(S),v),x.write(g,v),x.flush(),y.toByteArray()},f=function(){const h={};let p=0;const g={};return g.add=function(v){if(g.contains(v))throw"dup key:"+v;h[v]=p,p+=1},g.size=function(){return p},g.indexOf=function(v){return h[v]},g.contains=function(v){return typeof h[v]<"u"},g};return i},Sq=function(e,t,n){const r=kq(e,t);for(let u=0;u<t;u+=1)for(let f=0;f<e;f+=1)r.setPixel(f,u,n(f,u));const a=JA();r.write(a);const i=bq(),l=a.toByteArray();for(let u=0;u<l.length;u+=1)i.writeByte(l[u]);return i.flush(),"data:image/gif;base64,"+i};rd.stringToBytes;const Hg=4;function Eq({value:e,label:t,size:n=200}){const{side:r,path:a}=s.useMemo(()=>{const i=rd(0,"M");i.addData(e),i.make();const l=i.getModuleCount();let u="";for(let f=0;f<l;f++)for(let h=0;h<l;h++)i.isDark(f,h)&&(u+=`M${h+Hg} ${f+Hg}h1v1h-1z`);return{side:l+Hg*2,path:u}},[e]);return o.jsxs("svg",{className:"sc-qr",viewBox:`0 0 ${r} ${r}`,width:n,height:n,role:"img","aria-label":t,shapeRendering:"crispEdges",children:[o.jsx("rect",{className:"sc-qr-plate",width:r,height:r}),o.jsx("path",{className:"sc-qr-ink",d:a})]})}const Cq=3e4,jq=5*6e4;function Aq(e,t=!1){return t?{sentence:"Could not read this computer's network.",action:"check"}:e?e.reach==="this-computer"?{sentence:"Scenri was started for this computer only. Start it without SCENRI_HOST to open it on your phone.",action:null}:e.problem==="no-network"?{sentence:"Connect this computer to Wi-Fi, then check again.",action:"check"}:e.problem==="blocked"||!e.url?{sentence:"Another app is holding this address, so phones cannot open Scenri yet.",action:"check"}:{sentence:"Point your phone's camera at the code, or copy the link for another computer.",action:"copy"}:{sentence:"Checking this computer's network.",action:null}}const Nq=e=>e.url,Mq=e=>`${e.slice(0,3)} ${e.slice(3)}`;function Rq(e,t,n){return e.lastVisit&&e.lastVisit.at>=t-jq?"connected":n-t>=Cq?"stuck":"waiting"}function Pq(e,t){var n;return e==="connected"?`Connected. Scenri opened on your ${((n=t.lastVisit)==null?void 0:n.device)??"device"}.`:e==="stuck"?"No phone has opened it yet.":"Waiting for your phone…"}function Lq(e,t){return e==="blocked"&&t==="darwin"?{text:"Your Mac's firewall is blocking Scenri, so your phone cannot open it yet.",canAllow:!0}:e==="blocked"&&t==="win32"?{text:"Windows Firewall is blocking Scenri on this network, so your phone cannot open it yet.",canAllow:!0}:e==="blocks-all"?{text:"Your Mac's firewall blocks every incoming connection. To open Scenri on your phone, turn off Block all incoming connections in System Settings, Network, Firewall, Options.",canAllow:!1}:null}function Tq(e,t){const n=t==="darwin";switch(e){case"asking":return n?"Enter your Mac password to allow Scenri.":"Choose Yes when Windows asks to allow Scenri.";case"done":return"Allowed. Scan the code again.";case"cancelled":return"Nothing changed. Press Allow Scenri to try again.";case"failed":case"unsupported":return n?"Could not change the firewall. Open System Settings, Network, Firewall, Options, and set node to allow incoming connections.":"Could not change the firewall. Open Windows Security, Firewall and network protection, Allow an app through firewall, and tick Node.js for Private and Public.";default:return null}}function $q(e,t){const n=["Your phone has to be on the same Wi-Fi as this computer. Guest networks keep devices apart."];return e!=="blocked"&&e!=="blocks-all"&&e!=="ok"&&n.push("If this computer asks whether node may accept incoming connections, allow it."),n.push("If your phone's browser asks to find devices on your local network, allow it."),t.others.length&&n.push(`Or try ${t.others.join(" or ")}.`),n}const Dq=2e3;function Hq(){const[e,t]=s.useState(null),[n,r]=s.useState(!1),[a,i]=s.useState(null),[l,u]=s.useState(()=>Date.now()),[f,h]=s.useState(!1),[p,g]=s.useState(null),[v,w]=s.useState("idle"),[y,x]=s.useState(!1),k=s.useRef(null),S=s.useRef(null),{push:E}=or(),j=s.useCallback(async(Z=!1)=>{try{t(await Re.phone(Z)),r(!1)}catch{r(!0)}},[]),[N,P]=s.useState(!1),$=async()=>{P(!0);try{t(await Re.phoneNewCode()),i(Date.now())}catch{E({kind:"warning",title:"Could not make a new code"})}finally{P(!1)}};s.useEffect(()=>{j();const Z=setInterval(()=>{u(Date.now()),j()},Dq);return()=>{clearInterval(Z),k.current&&clearTimeout(k.current)}},[j]);const M=e?Nq(e):null;s.useEffect(()=>{M&&a===null&&i(Date.now())},[M,a]);const C=e&&M&&a!==null?Rq(e,a,l):null;s.useEffect(()=>{C==="stuck"&&h(!0)},[C]);const R=!!M&&!!(e!=null&&e.thisComputer);s.useEffect(()=>{if(!R)return;let Z=!0;return Re.phoneHelp().then(te=>Z&&g(te.firewall)).catch(()=>Z&&g("unknown")),()=>{Z=!1}},[R]);const T=Aq(e,n),H=e?Lq(p,e.platform):null,D=e?Tq(v,e.platform):null,K=async()=>{M&&(await mq(M,S.current)?(x(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(!1),1600)):E({kind:"warning",title:"Could not copy the link",detail:M}))},O=async()=>{w("asking");try{const Z=await Re.phoneAllow();g(Z.firewall),w(Z.result)}catch{w("failed")}};return o.jsxs(Qr,{title:"Other devices",children:[o.jsxs("div",{className:"sc-set-row",ref:S,children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open on your phone"}),o.jsx("small",{"data-prose":"",children:T.sentence})]}),T.action==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void K(),children:o.jsx("span",{"aria-live":"polite",children:y?"Copied":"Copy link"})}),T.action==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void j(!0),children:"Check again"})]}),e&&M&&o.jsxs("div",{className:"sc-phone",children:[o.jsx(Eq,{value:M,label:`QR code for ${e.address}`}),o.jsxs("div",{className:"sc-phone-how",children:[o.jsxs("p",{children:["No camera? Go to ",o.jsx("b",{className:"sc-phone-key",children:e.address})," in any browser on the same Wi-Fi, then enter ",o.jsx("b",{className:"sc-phone-key",children:Mq(e.code)}),"."]}),e.thisComputer&&H&&o.jsxs("div",{className:"sc-phone-fw",role:"status",children:[o.jsx("p",{children:H.text}),H.canAllow&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:v==="asking",onClick:()=>void O(),children:v==="asking"?"Waiting for your permission…":"Allow Scenri"})]}),e.thisComputer&&D&&o.jsx("p",{className:"sc-phone-allow","data-state":v,"aria-live":"polite",children:D}),e.thisComputer&&C&&o.jsx("p",{className:"sc-phone-arrival","data-state":C,"aria-live":"polite",children:Pq(C,e)}),e.thisComputer&&o.jsxs("details",{className:"sc-phone-help",open:f,onToggle:Z=>h(Z.currentTarget.open),children:[o.jsx("summary",{children:"Not opening?"}),o.jsx("ul",{children:$q(p,e).map(Z=>o.jsx("li",{children:Z},Z))})]})]})]}),(e==null?void 0:e.thisComputer)&&M&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"New code"}),o.jsx("small",{"data-prose":"",children:"Signs out every phone and tablet. They scan the new code to open Scenri again."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:N,onClick:()=>void $(),children:N?"Making…":"New code"})]})]})}function Oq(e){switch(e){case"npx":return"npx scenri update";case"global":case"managed":return"scenri update";default:return"npx scenri@latest"}}function Iq({version:e}){var x;const t=Kp(),n=om(),r=t.status,[a,i]=s.useState(null),[l,u]=s.useState(!1);s.useEffect(()=>{Re.settings().then(k=>i(!!k.updateCheck)).catch(()=>{})},[]);const f=async()=>{if(a===null)return;const k=!a;i(k);try{await Re.saveSettings({updateCheck:k})}catch{i(!k)}},h=s.useRef(null);s.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=Oq(e==null?void 0:e.installKind),g=async()=>{try{await navigator.clipboard.writeText(p),u(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>u(!1),1600)}catch{}},v=t.checking?o.jsx("span",{className:"sc-tag",children:"checking…"}):r!=null&&r.available?o.jsxs("span",{className:"sc-tag sc-tag-gold",children:[r.latest," available"]}):t.checkError||r!=null&&r.error?o.jsx("span",{className:"sc-tag",children:"couldn't check for updates"}):r!=null&&r.checkedAt?o.jsx("span",{className:"sc-tag",children:"up to date"}):null;let w,y;return r!=null&&r.available?(e==null?void 0:e.installKind)==="dev"?(w="Running from source. Pull and rebuild when you're ready; nothing here touches your checkout.",y=null):Uj(r)?r.phase==="ready"?(w=t.applyError??`${r.stagedVersion} is downloaded and verified. Restarting finishes it.`,y="restart"):r.phase==="staging"?(w="Downloading in the background. Nothing interrupts your work.",y="downloading"):r.phase==="error"?(w=t.applyError??r.error??"Couldn't download the update. Try again.",y="update"):(w=`You are on ${r.current}.`,y="update"):(w=o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{children:p})," in a terminal, then start Scenri again. Your library is not part of the app and stays put."]}),y="copy"):(w=r&&!r.enabled?"Automatic checks are off. Checking here still works.":"New versions announce themselves here.",y="check"),o.jsxs(Qr,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Updates"}),o.jsxs("small",{"data-prose":"",children:[w,(r==null?void 0:r.available)&&r.phase!=="ready"&&r.notesUrl&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:r.notesUrl,target:"_blank",rel:"noreferrer",children:["See what's in ",r.latest]})]})]})]}),v,y==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:t.checking,onClick:()=>void t.checkNow(),children:"Check for updates"}),(y==="update"||y==="restart")&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:t.busy!=="idle",onClick:()=>void t.apply(),children:t.busy!=="idle"?"Updating…":(r==null?void 0:r.phase)==="error"?"Try again":"Update"}),y==="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!0,children:"Downloading…"}),y==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void g(),children:l?"Copied":"Copy command"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Automatic updates"}),o.jsx("small",{"data-prose":"",children:"A version check every six hours; new versions download in the background, and restarting is always your call. Off means Scenri never calls anywhere by itself."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a===null,onClick:()=>void f(),children:a===null?"…":a?"Turn off":"Turn on"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"What's new"}),o.jsx("small",{children:((x=n.entry)==null?void 0:x.title)??`What changed in ${n.version?`v${n.version}`:"this version"}.`})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>n.open(),children:"Show"})]})]})}function Dx({weeks:e,months:t,cells:n}){return o.jsxs("div",{className:"sc-heat-range","data-weeks":e,children:[o.jsx("div",{className:"sc-heat-months",children:t.map(r=>o.jsx("span",{children:r.label},r.key))}),o.jsx("div",{className:"sc-heat-grid",children:n.map(r=>o.jsx("i",{"data-l":r.level||void 0,title:r.title},r.key))})]})}function Fq({brandId:e}){const[t,n]=s.useState(null);s.useEffect(()=>{let u=!0;return n(null),Re.usage(e).then(f=>u&&n(f.days)).catch(()=>u&&n([])),()=>{u=!1}},[e]);const{year:r,quarter:a,total:i,byKind:l}=s.useMemo(()=>{const u=new Map,f={generation:0,edit:0};for(const g of t??[])u.set(g.day,(u.get(g.day)??0)+g.generations+g.edits),f.generation+=g.generations,f.edit+=g.edits;const h=Lx(u,53),p=Lx(u,13);return{year:h,quarter:p,total:h.sum,byKind:f}},[t]);return o.jsx(Qr,{sub:t===null?"Counting your runs…":i?`${i.toLocaleString()} runs in the last year: ${l.generation.toLocaleString()} generations, ${l.edit.toLocaleString()} edits.`:"Nothing made yet this year. The first shot lands here.",children:o.jsxs("div",{className:"sc-heat",children:[o.jsx(Dx,{weeks:53,months:r.months,cells:r.cells}),o.jsx(Dx,{weeks:13,months:a.months,cells:a.cells})]})})}function _q({engines:e,brandId:t,onSaved:n}){const r=Ns("settings"),a=r.value!==null,[i,l]=s.useState(null);s.useEffect(()=>{if(!a||i)return;let y=!0;return Re.version().then(x=>y&&l(x)).catch(()=>{}),()=>{y=!1}},[a,i]);const[u,f]=s.useState(null);s.useEffect(()=>{if(!a)return;let y=!0;return Re.home().then(x=>y&&f(x)).catch(()=>{}),()=>{y=!1}},[a]);const[h,p]=s.useState(null),g=(i==null?void 0:i.thisComputer)===!0;s.useEffect(()=>{if(!a||!g)return;let y=!0;return Re.desktop().then(x=>y&&p(x)).catch(()=>{}),()=>{y=!1}},[a,g]);const[v,w]=s.useState("idle");return o.jsx(Ts,{open:a,className:"sc-set",maxWidth:"880px",onDismiss:r.close,children:o.jsx(Zq,{value:r.value,onPick:r.set,saved:o.jsx(Vq,{state:v}),page:y=>o.jsx(zq,{page:y,engines:e,brandId:t,onSaved:n,onKitState:w,version:i,home:u,desktop:h,onDesktop:p})})})}function Zq({value:e,onPick:t,saved:n,page:r}){const a=wr(Ks),{brand:i}=on(),l=WW(e),[u,f]=s.useState(()=>KW(e)),h=s.useRef(new Map),p=s.useRef(!1);s.useEffect(()=>{var y;!a||!u||!p.current||(p.current=!1,(y=h.current.get(l))==null||y.focus({preventScroll:!0}))},[a,u,l]);const g=y=>{t(y),f(!1)},v=Z1.find(y=>y.id===l);if(a&&!u)return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>{p.current=!0,f(!0)},"aria-label":"Settings",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:v.label}),l==="brand"&&n,o.jsx(Hx,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-set-body",children:o.jsxs("div",{className:"sc-set-scroll",children:[o.jsx("p",{className:"sc-set-lede",children:v.sub(ca(i))}),r(l)]})})]},`page-${l}`);const w=y=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-set-item","data-danger":y.scope==="apart"?"":void 0,"aria-current":!a&&l===y.id?"page":void 0,ref:x=>{x?h.current.set(y.id,x):h.current.delete(y.id)},onClick:()=>g(y.id),children:[o.jsx(y.Icon,{size:16,className:"sc-set-item-ic"}),o.jsx("span",{className:"sc-set-item-lb",children:y.label}),a&&o.jsx(ol,{size:14,className:"sc-set-item-go"})]})},y.id);return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Settings"}),o.jsx(Hx,{})]}),o.jsxs("div",{className:"sc-newdlg-body sc-set-body",children:[o.jsxs("nav",{className:"sc-set-rail","aria-label":"Settings",children:[o.jsx("p",{className:"sc-set-group",children:"This brand"}),o.jsx("ul",{children:Z1.filter(y=>y.scope==="brand").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Studio"}),o.jsx("ul",{children:Z1.filter(y=>y.scope==="studio").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Delete"}),o.jsx("ul",{className:"sc-set-apart",children:Z1.filter(y=>y.scope==="apart").map(w)})]}),!a&&o.jsxs("div",{className:"sc-set-scroll",children:[o.jsxs("header",{className:"sc-set-head",children:[o.jsxs("span",{className:"sc-set-head-say",children:[o.jsx("h2",{children:v.label}),o.jsx("p",{children:v.sub(ca(i))})]}),l==="brand"&&n]}),r(l)]},l)]})]},"index")}function Vq({state:e}){const[t,n]=s.useState(!1),r=s.useRef(e);return s.useEffect(()=>{const a=r.current;if(r.current=e,e!=="idle"){n(!0);return}if(a==="idle")return;const i=setTimeout(()=>n(!1),1600);return()=>clearTimeout(i)},[e]),o.jsxs("span",{className:"sc-set-saved","data-on":t?"":void 0,"data-state":e,"aria-live":"polite",children:[e==="idle"&&o.jsx(Kn,{size:12,weight:"bold"}),qY(e)]})}function zq({page:e,engines:t,brandId:n,onSaved:r,onKitState:a,version:i,home:l,desktop:u,onDesktop:f}){const h=(i==null?void 0:i.thisComputer)===!0;switch(e){case"brand":return o.jsx(XY,{onSaveState:a});case"usage":return o.jsx(Fq,{brandId:n});case"engines":return o.jsxs(o.Fragment,{children:[o.jsx(dq,{engines:t}),o.jsx(nq,{engines:t,onSaved:r})]});case"appearance":return o.jsx(vY,{});case"library":return o.jsx(pq,{info:l,thisComputer:h});case"phone":return o.jsxs(o.Fragment,{children:[o.jsx(Hq,{}),h&&o.jsx(aq,{status:u,onStatus:f})]});case"updates":return o.jsx(Iq,{version:i});case"about":return o.jsx(mY,{version:i});case"danger":return o.jsx(rq,{onDone:r})}}function Hx(){return o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const Bq=["January","February","March","April","May","June","July","August","September","October","November","December"];function Uq(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const n=Bq[Number(t[2])-1];return n?`${Number(t[3])} ${n} ${t[1]}`:e}function Wq(){const e=Ns("whatsnew"),{status:t,version:n,entry:r,changelogUrl:a,releasesUrl:i,markSeen:l}=om(),u=e.value!==null,f=()=>{l(),e.close()},h=s.useRef(u);s.useEffect(()=>{h.current&&!u&&l(),h.current=u},[u,l]);const p=t==="ready"&&!r&&!a,g=r!==null&&r.sections.length>1,v=t==="loading"?"Reading the release notes.":t==="failed"?"Scenri could not read its release notes. If you are running a development server, it may predate this feature; restart it and try again.":p?"You are running a development build. What changed in a version appears here once that version is published.":r?"Maintenance only. Nothing here changes how Scenri works for you.":"This version went out without a written summary.",w=r?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:r.version}),o.jsx("span",{"aria-hidden":"true",children:" · "}),Uq(r.date)]}):t==="failed"?"Release notes unavailable":t==="loading"?"Loading":p?"Development build":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:n})]});return o.jsxs(Ts,{open:u,className:"sc-wn",maxWidth:"420px",described:!0,onDismiss:f,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"What's new"}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(td,{className:"sc-wn-sub",children:w}),o.jsxs("div",{className:"sc-newdlg-body",children:[(r==null?void 0:r.title)&&o.jsx("p",{className:"sc-wn-lede sc-accent",children:r.title}),r&&r.sections.length>0?r.sections.map(y=>o.jsxs("section",{className:"sc-wn-sec",children:[g&&o.jsx("h3",{className:"sc-wn-head",children:y.heading}),o.jsx("p",{className:"sc-wn-txt",children:y.body})]},y.heading)):o.jsx("p",{className:"sc-wn-txt",children:v})]}),o.jsxs("div",{className:"sc-newdlg-foot sc-wn-foot",children:[i&&o.jsxs("a",{className:"sc-wn-link",href:i,target:"_blank",rel:"noreferrer",children:["All releases",o.jsx(gf,{size:13})]}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",children:"Got it"})})]})]})}function Kq(e){return{installed:e==="not-authenticated"||e==="signing-in"||e==="update-needed"||e==="env-conflict"||e==="repairing"||e==="ready",signedIn:e==="env-conflict"||e==="repairing"||e==="ready",connected:e==="ready",now:e==="not-installed"||e==="installing"?"install":e==="not-authenticated"||e==="signing-in"?"signin":e==="env-conflict"||e==="repairing"?"connect":null}}function eN(e){return e.length===0?"that key":e.length===1?`the ${e[0]} variable`:`the ${e.slice(0,-1).join(", ")} and ${e[e.length-1]} variables`}function Gq(e){return`Scenri will start Codex without ${eN(e)}. Nothing on your computer changes, and you can undo this here later.`}function Yq(e){return`Scenri is starting Codex without ${eN(e)} on this computer.`}const qq=2e3,Xq=5*6e4;function Qq({engines:e,onSaved:t}){const n=Ns("setup"),r=n.close,a=n.value,i=a?YA(a):void 0,u=!!i||a==="codex-cli",f=e.find(h=>h.id===a);return o.jsx(Ts,{open:u,className:"sc-setup",maxWidth:"520px",onDismiss:r,onOpenAutoFocus:i?h=>{var p;h.preventDefault(),(p=h.target.querySelector(".sc-setup-key input"))==null||p.focus()}:void 0,children:i?o.jsx(Jq,{provider:i,name:f?Bi(f.displayName):i.engineId,connected:!!(f!=null&&f.available),onSaved:t,onDone:r}):o.jsx(eX,{engines:e,onSaved:t,onDone:r})})}function tN({title:e}){return o.jsxs("div",{className:"sc-newdlg-head sc-setup-head",children:[o.jsx(ds,{className:"sc-newdlg-title sc-setup-title",children:e}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]})}function Jq({provider:e,name:t,connected:n,onSaved:r,onDone:a}){const[i,l]=s.useState(""),[u,f]=s.useState(!1),[h,p]=s.useState(null),[g,v]=s.useState(!1),w=async()=>{const x=i.trim();if(x){f(!0),p(null);try{await Re.saveSettings({[e.settingKey]:x}),l(""),r(),a()}catch(k){p(k.message)}finally{f(!1)}}},y=async()=>{f(!0),p(null);try{await Re.saveSettings({[e.settingKey]:""});const x=await Re.settings();if(r(),x[e.settingKey]){v(!0);return}a()}catch(x){p(x.message)}finally{f(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(tN,{title:n?`${t} key`:`Connect ${t}`}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(nN,{engineId:e.engineId,name:t,state:n?"Connected":"Not connected",ready:n}),o.jsx("p",{className:"sc-setup-lead",children:n?`A key is saved for ${t}. Paste a new one to replace it, or disconnect to remove it from this computer.`:`Paste a key from ${t}. It is stored in your library folder on this computer, sent only to ${t}, and never shown again.`})]}),o.jsxs("form",{className:"sc-setup-key",onSubmit:x=>{x.preventDefault(),w()},children:[o.jsx("input",{className:"sc-in",type:"password",placeholder:e.hint,value:i,onChange:x=>l(x.target.value),autoComplete:"off",name:e.settingKey,"aria-label":`${t} key`}),o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:u||!i.trim(),children:[u?o.jsx(xr,{size:"1"}):o.jsx(KC,{size:15}),n?"Replace key":"Connect"]}),o.jsxs("a",{className:"sc-setup-alt",href:e.keysUrl,target:"_blank",rel:"noreferrer",children:["Get a key ",o.jsx(gf,{size:13})]})]})]}),n&&o.jsx("div",{className:"sc-setup-cut",children:o.jsx(Wn,{label:"Disconnect",title:`Disconnect ${t}?`,body:"The key is deleted from this computer. Nothing you have already generated changes, and you can paste a new key at any time.",busy:u,onConfirm:()=>void y()})}),g&&o.jsxs("p",{className:"sc-setup-note",children:["The stored key is gone, but ",t," is still connected through the ",e.settingKey.toUpperCase()," ","environment variable on this computer. Remove it from your shell to disconnect fully."]}),h&&o.jsx("div",{className:"sc-setup-problem",children:o.jsxs("p",{"data-detail":"",children:[o.jsx(zp,{size:15})," ",h]})})]})]})}function eX({engines:e,onSaved:t,onDone:n}){const r=Ec(),[a,i]=s.useState("checking"),[l,u]=s.useState(null),[f,h]=s.useState(!1),[p,g]=s.useState("mac"),[v,w]=s.useState(null),[y,x]=s.useState([]),[k,S]=s.useState([]),E=s.useRef(null),j=s.useCallback(()=>{E.current!==null&&(window.clearInterval(E.current),E.current=null)},[]),N=s.useCallback(async(te=!1)=>{const{state:B,reason:F,platform:X,conflictKeys:z,ignoredKeys:I}=await Re.codexStatus({force:te});return X&&g(X),w(F??null),x(z??[]),S(I??[]),i(B),B},[]);s.useEffect(()=>(u(null),i("checking"),N().catch(()=>i("unverified")),j),[N,j]);const P=s.useCallback(()=>{u(null),i("checking"),N(!0).catch(()=>i("unverified"))},[N]),$=async()=>{u(null),i("repairing");try{const{state:te,conflictKeys:B,ignoredKeys:F,reason:X}=await Re.repairCodexEnv(y);x(B??[]),S(F??[]),w(X??null),i(te)}catch(te){u({detail:te.message}),i("env-conflict")}},M=async()=>{u(null),i("checking");try{const{state:te,conflictKeys:B,ignoredKeys:F}=await Re.restoreCodexEnv();x(B??[]),S(F??[]),i(te)}catch{N().catch(()=>i("unverified"))}};s.useEffect(()=>{a==="ready"&&t()},[a,t]);const C=async()=>{u(null),i("installing");try{const te=await Re.installCodex();if(te.ok||te.state!=="not-installed"){i(te.state);return}u({detail:te.detail,command:te.fallbackCommand,docsUrl:te.docsUrl}),i(te.state)}catch(te){u({detail:te.message,command:"npm install -g @openai/codex"}),i("not-installed")}},R=async()=>{u(null),i("signing-in");const te=Date.now();j(),E.current=window.setInterval(()=>{if(Date.now()-te>Xq){j(),i("not-authenticated"),u({detail:"Sign-in did not finish. Try again, or use the command below.",command:"codex login"});return}Re.codexStatus().then(({state:B})=>{B==="ready"&&(j(),i("ready"))}).catch(()=>{})},qq);try{const B=await Re.loginCodex();if(j(),B.ok||B.state==="ready"){i(B.state);return}u({detail:B.detail,command:B.fallbackCommand}),i(B.state)}catch(B){j(),u({detail:B.message,command:"codex login --device-auth"}),i("not-authenticated")}},T=s.useRef(null);s.useEffect(()=>()=>{T.current&&window.clearTimeout(T.current)},[]);const H=te=>{var B;(B=navigator.clipboard)==null||B.writeText(te).then(()=>{h(!0),T.current&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>h(!1),1600)})},D=e.filter(te=>te.available&&te.id!=="codex-cli"&&!te.localOnly),K=a==="checking"||a==="installing"||a==="signing-in"||a==="repairing",O=a==="not-installed"||a==="installing"?{step:0,label:"Install Codex CLI",verb:a==="installing"?"Installing":"Install",busy:a==="installing",run:C}:a==="not-authenticated"||a==="signing-in"?{step:1,label:"Sign in with ChatGPT",verb:a==="signing-in"?"Waiting for your browser":"Sign in",busy:a==="signing-in",run:R}:a==="env-conflict"||a==="repairing"?{step:2,label:"Ignore that key",verb:a==="repairing"?"Ignoring":"Ignore that key",busy:a==="repairing",run:$}:null,Z=a==="not-installed"||a==="installing"||a==="not-authenticated"||a==="signing-in";return o.jsxs(o.Fragment,{children:[o.jsx(tN,{title:"Set up image generation"}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(nN,{engineId:"codex-cli",name:"Codex CLI",state:tX[a],ready:a==="ready",busy:K}),o.jsx("p",{className:"sc-setup-lead",children:nX[a](v)}),a==="no-plan"&&o.jsx("p",{className:"sc-setup-lead",children:"You can use your own key from an image provider instead. You pay that provider directly, per image, and the key stays in your library folder on this computer."})]}),a!=="no-plan"&&o.jsx(rX,{phase:a,act:O}),a==="signing-in"&&o.jsx("p",{className:"sc-setup-note",children:"Finish in the browser tab that just opened. This screen updates itself."}),(a==="env-conflict"||a==="repairing")&&o.jsx("p",{className:"sc-setup-note",children:Gq(y)}),a==="ready"&&k.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[Yq(k)," ",o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:M,children:"Use it again"})]}),a==="unverified"&&o.jsx("p",{className:"sc-setup-note",children:"If you just installed Codex, quit and reopen Scenri so it can see the new command."}),a==="update-needed"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:"npm install -g @openai/codex@latest"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H("npm install -g @openai/codex@latest"),children:[f?o.jsx(Kn,{size:14}):o.jsx(Lh,{size:14}),f?"Copied":"Copy"]})]}),p==="windows"&&o.jsxs("p",{className:"sc-setup-note",children:["Installed with the standalone installer instead? Update it in PowerShell:"," ",o.jsx("code",{children:"irm https://chatgpt.com/codex/install.ps1 | iex"})]})]}),a==="no-plan"&&D.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[D.map(te=>Bi(te.displayName)).join(", ")," is already connected, so you can generate now."]}),l&&o.jsxs("div",{className:"sc-setup-problem",children:[o.jsxs("p",{"data-detail":"",children:[o.jsx(zp,{size:15})," ",l.detail??"That did not work."]}),l.command&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-setup-note",children:["Run this in ",p==="windows"?"PowerShell":"Terminal",", then reopen this window:"]}),o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:l.command}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H(l.command),children:[f?o.jsx(Kn,{size:14}):o.jsx(Lh,{size:14}),f?"Copied":"Copy"]})]})]}),l.docsUrl&&o.jsxs("a",{className:"sc-setup-alt",href:l.docsUrl,target:"_blank",rel:"noreferrer",children:["Installation help ",o.jsx(gf,{size:13})]})]}),a==="ready"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Start creating"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:P,children:[o.jsx(Ph,{size:14})," Check again"]})]}),(a==="unverified"||a==="update-needed")&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:P,children:[o.jsx(Ph,{size:15})," Check again"]}),a==="unverified"&&o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})]}),a==="no-plan"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>r("openrouter"),children:[o.jsx(KC,{size:15})," Add a provider key"]}),o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>void N(),children:"Back to Codex setup"})]}),Z&&o.jsx("div",{className:"sc-setup-acts",children:o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})})]})]})}const tX={checking:"Checking","not-installed":"Not installed",installing:"Installing","not-authenticated":"Not signed in","signing-in":"Waiting for your browser",ready:"Ready","env-conflict":"An old key is in the way",repairing:"Setting that key aside",unverified:"Could not verify","update-needed":"Needs an update","no-plan":"Needs a ChatGPT plan"},nX={checking:()=>"Checking that Codex can actually reach OpenAI from this computer.","not-installed":()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.",installing:()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.","not-authenticated":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.","signing-in":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.",ready:()=>"Codex CLI is ready. Your images run on your own ChatGPT plan, and Scenri adds nothing to the bill.","env-conflict":()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",repairing:()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",unverified:()=>"Scenri could not verify Codex on this computer. Something answered too slowly or not at all, so nothing is assumed to work.","update-needed":e=>`${e??"Codex CLI on this computer is too old for Scenri."} Update it once, then check again.`,"no-plan":()=>"Codex CLI draws on a ChatGPT plan, so without one there is nothing behind it to generate your images."};function nN({engineId:e,name:t,state:n,ready:r,busy:a}){const i=XA(e);return o.jsxs("div",{className:"sc-setup-subject",children:[o.jsx("span",{className:"sc-eng-ic","data-brand":i?"":void 0,style:i?{"--sc-plate":i.plate,"--sc-ink":i.ink}:void 0,children:o.jsx(QA,{engineId:e})}),o.jsxs("span",{className:"sc-setup-say",children:[o.jsx("b",{className:"sc-setup-name",children:t}),o.jsxs("span",{className:"sc-setup-state",children:[a?o.jsx(xr,{size:"1"}):r?o.jsx("span",{className:"d"}):null,n]})]})]})}function rX({phase:e,act:t}){const{installed:n,signedIn:r,connected:a}=Kq(e),i=[n,r,a],l=["Install Codex CLI","Sign in with ChatGPT","Connect to Scenri"];return o.jsx("ol",{className:"sc-learn-steps sc-setup-steps",children:l.map((u,f)=>{const h=(t==null?void 0:t.step)===f,p=i[f]?"done":h?"active":"todo",g=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:i[f]?o.jsx(Kn,{size:14,weight:"bold"}):f+1}),v=h&&t.busy;return o.jsx("li",{"data-on":i[f]?"":void 0,"data-now":h?"":void 0,children:h?o.jsxs("button",{type:"button",className:"sc-learn-step","data-state":p,"aria-label":t.label,disabled:v,onClick:t.run,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[v?o.jsx(xr,{size:"1"}):null,t.verb,v?null:o.jsx(Pa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":p,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),i[f]&&o.jsx("span",{className:"sc-vh",children:", done"})]})},u)})})}function sX(){const{brands:e}=Rn(),t=rN(e);return t?o.jsx(uo,{to:mo(t),replace:!0}):o.jsx(uo,{to:"/setup",replace:!0})}function rN(e){const t=sB();return e.find(n=>n.id===t)??e[0]??null}const aX=48;function oX(e,t,n=aX){let r=null;for(const a of t){if(a.kind==="root")continue;const i=(r??e).findIndex(h=>h.id===a.id),l=a.status==="done"&&a.images.length>0&&!a.archived;if(i>=0){if((r??e)[i]===a)continue;r??(r=[...e]),l?r[i]=a:r.splice(i,1);continue}if(!l)continue;const u=r??e;if(u.length>=n&&vu(u[u.length-1],a)<0)continue;r??(r=[...e]);let f=0;for(;f<r.length&&vu(r[f],a)<=0;)f++;r.splice(f,0,a),r.length>n&&(r.length=n)}return r??e}const sN='[data-guide="library.new"]',sd=(e,t)=>({id:"go",voice:"ask",point:`[data-guide="nav.${e}"]`,side:"bottom",soft:!0,...t}),iX='[data-guide="compose"] .sc-attachpanel',lX='[data-guide="compose"] .sc-attachpanel .sc-ap-body',Ih='[data-guide="compose"] .sc-promptcard',cX='[data-guide="compose.add"]',aN='[data-guide="compose"] .sc-brief-line',Fh='[data-guide="compose.send"]',oN='[data-guide="compose.engine"]',ju=".sc-pstudio",k6=`${ju} .sc-convo-card`,uX=".sc-newdlg-layer",Au=".sc-ovl",gn={go:{title:"Shots are made in Create",body:"A shot is built from what you sell, who shows it and where. Open Create, and we'll make your first one together."},intro:{title:"This is Create, where shots are made",body:"A shot is built from three things Scenri keeps for you: what you sell, who shows it, and where it happens. Add them, say how to shoot it, and Scenri makes the picture in about a minute."},engine:{title:"Connect image generation",body:"Scenri needs an image engine before it can make anything. Setting one up takes about a minute."},product:{title:"Choose a product",body:"A product is the thing you are selling. Scenri keeps its real photos, so it looks the same in every shot you make."},presenter:{title:"Choose a presenter",body:"A presenter is a person Scenri keeps. Pick one and the same face shows your product in every shot."},scene:{title:"Choose a scene",body:"A scene is a place and its light. It decides where the shot happens and how it feels."},make:{title:"Say how to shoot it, then make it",body:"A few words about the moment, the light or the framing. Generate then puts your ingredients and your words together into a picture."},waiting:{title:"Scenri is making it",body:"This takes a moment. Your ingredients are kept, so you can change one thing later without starting over."},result:{title:"Your first shot",body:"The product, the presenter and the scene you chose are kept, so your next shot starts from them. Open it to change one thing."},failed:{title:"That one didn't work",body:"The tile says why. Put the shot together again and Scenri will try it again."},reuseProduct:{title:"Add the product you saved",body:"Yours sits in the shelf with ours. Putting it in again costs nothing: it is the same product, in a new shot."},reuseScene:{title:"Put it somewhere else",body:"A different place and light, so the two shots share the product and little else."},reuseResult:{title:"The same product, twice",body:"Two shots, one thing you added once. Anything Scenri keeps works this way: products, presenters and scenes."},refineAsk:{title:"Change one thing",body:"Say what to change, like warmer light or a closer crop. The rest of the shot stays."},refineResult:{title:"Here is the change",body:"The original stays one step back in the history, so nothing is lost."},refineFailed:{title:"That change didn't work",body:"Say the change again and Scenri will try it once more."},refineChoose:{title:"Choose a shot to change",body:"Open one from what you have made. You can also use Refine on its card."},refineGo:{title:"Your shots live in Create",body:"Refining starts from a picture you already have. Open Create to find one."},productGo:{title:"Your products live here",body:"Each one you add is kept, so it looks the same in every shot. Open Products to add yours."},productNew:{title:"Start a new product",body:"Add its real photos, or bring in your catalog from your store. Either way it is yours to reuse."},sceneGo:{title:"Your scenes live here",body:"A scene is a place and its light, saved to shoot in again. Open Scenes to make one."},sceneNew:{title:"Start a new scene",body:"Describe the place in a sentence, start from pictures of it, or let it guide you."},presenterGo:{title:"Your presenters live here",body:"A presenter is a person Scenri keeps, the same face in every shot. Open Presenters to make one."},presenterNew:{title:"Start a new presenter",body:"Describe someone, or add photos of a real person. The studio takes it from there."},presenterEngine:{title:"Set up image generation",body:"Drawing a face needs an engine. Setting one up takes about a minute, and the answers so far are kept."},presenterStart:{title:"Describe someone, or start from photos",body:"Photos keep a real face. Describing invents one, question by question."},presenterFace:{title:"Decide the face",body:"Every shot with this presenter uses this face, so take the one you want."},presenterSave:{title:"Save your presenter",body:"Once saved they are in your ingredients, ready for every shot."},sceneStart:{title:"Describe the place, or start from pictures",body:"A scene is the place and its light around your shot. Pictures are read for you; guided, it asks one thing at a time."},sceneWords:{title:"These words are the scene",body:"Every shot made in this scene is told exactly this. Draw it to see it, or say what to add."},productMake:{title:"Add your product",body:"Its real photos keep it the same in every shot. Add a few, or bring in your catalog from your store."}},Ui=e=>`.sc-feed .sc-cell[data-fb-node="${e}"]`,Rv=e=>e.status==="done"&&e.images>0,Pv=e=>e.status==="error"||e.status==="cancelled"||e.status==="done"&&e.images===0,S6=e=>e.products+e.presenters+(e.scene?1:0)+e.others,Ox={product:"Products",presenter:"Presenters",scene:"Scenes"};function iN(e){if(!e.here)return e.heading?sd("create",gn.go):null;const t=e.composer,n=e.nodes.find(Rv);if(n)return{id:"result",voice:"note",point:Ui(n.id),side:"bottom",...gn.result,done:!0};const r=e.nodes.find(u=>u.status==="running");if(r)return{id:"waiting",voice:"note",point:Ui(r.id),side:"bottom",...gn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||S6(t)>0||t.words,i=e.nodes.find(Pv);if(i&&!a)return{id:"failed",voice:"note",point:Ui(i.id),side:"bottom",...gn.failed};if(t.engine!=="ready")return{id:"engine",voice:"ask",point:oN,side:"top",...gn.engine};if(!e.begun&&S6(t)===0&&!t.words)return{id:"intro",voice:"ask",live:[],start:!0,...gn.intro};const l=cN(t);return l?E6(l,t.pickerOpen):{id:"make",voice:"ask",point:Fh,live:[aN,Fh],side:"top",...gn.make}}function lN(e){if(!e.here)return e.heading?sd("create",gn.go):null;const t=e.composer,n=e.nodes.find(Rv);if(n)return{id:"again",voice:"note",point:Ui(n.id),side:"bottom",...gn.reuseResult,done:!0};const r=e.nodes.find(l=>l.status==="running");if(r)return{id:"waiting",voice:"note",point:Ui(r.id),side:"bottom",...gn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||S6(t)>0||t.words,i=e.nodes.find(Pv);return i&&!a?{id:"failed",voice:"note",point:Ui(i.id),side:"bottom",...gn.failed}:t.engine!=="ready"?{id:"engine",voice:"ask",point:oN,side:"top",...gn.engine}:t.products===0?E6("product",t.pickerOpen,gn.reuseProduct):t.scene?{id:"make",voice:"ask",point:Fh,live:[aN,Fh],side:"top",...gn.make}:E6("scene",t.pickerOpen,gn.reuseScene)}function cN(e){return e.products===0?"product":e.presenters===0?"presenter":e.scene?null:"scene"}function E6(e,t,n){const r=n??gn[e];return t?{id:e,voice:"ask",point:iX,live:[lX],lit:[Ih],beside:!0,side:"right",...r}:{id:e,voice:"ask",point:cX,side:"top",...r}}const uN=`${Au} .sc-promptcard`,dX=`${Au} .sc-stage-img`,Ix=`${Au} .sc-trail`,Fx=".sc-feed";function fX(e){if(e.heading)return sd("create",gn.refineGo);if(!e.here)return null;if(!e.open&&!e.armed)return{id:"choose",voice:"ask",point:Fx,live:[Fx],beside:!0,side:"left",...gn.refineChoose};const t=e.nodes.find(Rv);if(t)return e.open?{id:"refined",voice:"note",shell:Au,point:Ix,side:"top",...gn.refineResult,done:!0}:{id:"refined",voice:"note",point:Ui(t.id),side:"bottom",...gn.refineResult,done:!0};if(e.nodes.some(r=>r.status==="running"))return{id:"refining",voice:"quiet"};const n=e.nodes.find(Pv);return n&&!e.asking?e.open?{id:"refine-failed",voice:"note",shell:Au,point:Ix,side:"top",...gn.refineFailed}:{id:"refine-failed",voice:"note",point:Ui(n.id),side:"bottom",...gn.refineFailed}:e.open?{id:"ask",voice:"ask",shell:Au,point:uN,also:[dX],beside:!0,side:"left",...gn.refineAsk}:{id:"ask",voice:"ask",point:Ih,live:[Ih],beside:!0,side:"top",...gn.refineAsk}}function dN(e){if(e.heading)return sd("presenters",gn.presenterGo);const t=e.studio;if(t){const n=`${ju} [data-turn="q:${t.open}"]`,r=(a,i,l=[],u)=>({id:a,voice:"ask",shell:ju,point:`${n} .sc-convo-ask`,live:[n],also:l,...u?{lit:u}:{},beside:!0,side:"left",...i});switch(t.open){case"source":return r("start",gn.presenterStart,[k6]);case"noengine":return r("engine",gn.presenterEngine);case"identity":case"revision":return r("face",gn.presenterFace,[".sc-pstudio-well",k6],[`${ju} [data-turn]:has(+ [data-turn="q:${t.open}"])`]);case"save":case"blind":return r("save",gn.presenterSave);default:return{id:"studio",voice:"quiet"}}}return e.onPage?{id:"new",voice:"ask",point:sN,side:"bottom",...gn.presenterNew}:null}function hX(e,t){return{id:e,voice:"ask",shell:uX,point:".sc-newdlg",beside:!0,side:"left",...t}}function fN(e){return{id:"new",voice:"ask",point:sN,side:"bottom",...e}}function pX(e){var n,r;if(e.heading)return sd("scenes",gn.sceneGo);const t=e.studio;if(t){const a=`${ju} [data-turn="q:${t.open}"]`,i=(l,u)=>({id:l,voice:"ask",shell:ju,point:`${a} .sc-convo-ask`,live:[a],also:[k6],beside:!0,side:"left",...u});return t.open==="source"?i("start",gn.sceneStart):(n=t.open)!=null&&n.startsWith("agree-")?i("words",gn.sceneWords):(r=t.open)!=null&&r.startsWith("decide-")?{id:"use",voice:"quiet"}:{id:"studio",voice:"quiet"}}return e.onPage?fN(gn.sceneNew):null}function mX(e){return e.heading?sd("products",gn.productGo):e.dialogOpen?hX("product",gn.productMake):e.onPage?fN(gn.productNew):null}function hN(e,t){if(e==="first-shot"){if(t==="presenter")return"product";if(t==="scene")return"presenter";if(t==="make")return"scene"}if(e==="reuse"){if(t==="scene")return"product";if(t==="make")return"scene"}return null}function gX(e,t,n){return e?hN(e,t)||n&&(t==="new"||t==="choose"||(e==="first-shot"||e==="reuse")&&t==="product")||e==="presenter"&&(t==="start"||t==="face"||t==="save")||(e==="product"||e==="scene")&&t===e?!0:e==="refine"&&t==="ask":!1}function vX(e,t){const n=e.active;return n?n.task==="presenter"?t.presenters>n.baseline.presenters:n.task==="scene"?t.scenes>n.baseline.scenes:n.task==="product"?t.products>n.baseline.products:!1:!1}const wX={"first-shot":"shot",reuse:"shot",refine:"refine",product:"product",presenter:"presenter",scene:"scene"};function B1(e,t){return!(!t.eligible||t.hidden||t.active&&(t.active.task===e||t.active.task==="first-shot")||t.done[wX[e]]||t.dismissed.includes(e)||e==="refine"&&!t.done.shot)}function yX(e){return e.onMainPage&&e.eligible&&e.welcome===null&&e.ready&&e.visible&&!e.blocked&&!e.busy}const wu={lede:"Scenri makes product shots for your brand. You choose the product, who shows it and where, and it makes the picture.",take:"Make your first shot",notNow:"Not now",again:"Welcome to Scenri",note:e=>e.engineReady?e.ownsProducts?"We'll make your first one together, a step at a time, with one of your products.":"We'll make your first one together, a step at a time. You can start with one of our products.":"First a short setup for image generation, then your first shot together, a step at a time."};function bX(e){const t=e.filter(a=>a.previewUrl),n=(a,i)=>{var l,u;return(u=(((l=a.brief)==null?void 0:l.tokens)??[]).find(f=>(f==null?void 0:f.t)===i))==null?void 0:u.id},r=new Map;for(const a of t){const i=n(a,"product");i&&r.set(i,[...r.get(i)??[],a])}for(const a of r.values()){const i=new Map;for(const l of a){const u=n(l,"template");u&&!i.has(u)&&i.set(u,l)}if(i.size>=3)return[...i.values()].slice(0,3)}for(const a of r.values())if(a.length>=3)return a.slice(0,3);return t.slice(0,3)}function xX(e,t,n,r){const a=new Map(e.map(l=>[l.id,l]));let i=!1;for(const l of t){if(l.kind!==r||l.createdAt<n)continue;const u={id:l.id,kind:l.kind,status:l.status,images:Array.isArray(l.images)?l.images.length:0,createdAt:l.createdAt},f=a.get(l.id);f&&f.status===u.status&&f.images===u.images||(a.set(l.id,u),i=!0)}return i?[...a.values()].sort((l,u)=>l.createdAt<u.createdAt?1:l.createdAt>u.createdAt?-1:0):e}const kX="https://github.com/tonygorb/scenri";function SX(){var w,y;const e=un(ct.hub),t=un(ct.set),n=!!e||!!t,r=om(),a=Kp(),i=!!((w=a.status)!=null&&w.available),l=i&&!a.dismissed||r.unread,u=vf(),f=Ec(),h=Zj(),p=GW(),{engines:g}=Rn(),v=!g.some(x=>x.available);return o.jsx("div",{className:"sc-help-float",children:o.jsxs(Ss,{children:[o.jsx(lr,{label:"Help",children:o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-icon-btn sc-help-btn","aria-label":"Help",children:[o.jsx(JU,{size:16}),l&&o.jsx("span",{className:"sc-upd-dot","aria-hidden":"true"})]})})}),o.jsxs(Cs,{align:"end",side:"top",sideOffset:8,className:"sc-menu sc-help-menu",children:[i&&o.jsxs(tr,{className:"sc-menu-item","data-update":"",onSelect:()=>u("updates"),children:[o.jsx(J7,{size:18,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:["Update available · ",(y=a.status)==null?void 0:y.latest]})]}),o.jsxs(o.Fragment,{children:[o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>{d6.current="help",h()},children:[o.jsx(ZU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Learn"})]}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>p(),children:[o.jsx(VU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:wu.again})]})]}),n&&o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>window.dispatchEvent(new Event("scenri:shortcuts")),children:[o.jsx(BU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Keyboard shortcuts"})]}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>r.open(),children:[o.jsx(UU,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"What's new"}),r.unread&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-menu-new","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", not read yet"})]})]}),v&&o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>f(),children:[o.jsx(R0,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up image generation"})]}),o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(tr,{className:"sc-menu-item",onSelect:()=>u("about"),children:[o.jsx(_p,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"About Scenri"})]}),o.jsx(tr,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:kX,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(_U,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Scenri on GitHub"})]})})]})]})})}function EX(){return o.jsx(SX,{})}const CX={composer:null,overlay:null,studio:null,showing:!1};let Ha=CX;const C6=new Set;function tm(e){Ha=e;for(const t of C6)t()}const Lv=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function _x(e){Lv(Ha.composer,e)||tm({...Ha,composer:e})}function Zx(e){Lv(Ha.overlay,e)||tm({...Ha,overlay:e})}function _h(e){Lv(Ha.studio,e)||tm({...Ha,studio:e})}function Vx(e){Ha.showing!==e&&tm({...Ha,showing:e})}function pN(e){return C6.add(e),()=>C6.delete(e)}function jX(){return Ha}function mN(){return s.useSyncExternalStore(pN,jX)}function AX(){return s.useSyncExternalStore(pN,()=>Ha.showing)}function gN(e){return e.milestones.map(t=>t.label)}const $i=[{id:"first-shot",title:"Make your first shot",summary:"A shot is three things Scenri keeps for you, put together and directed: what you sell, who shows it, and where it happens. Start with ours to see the shape of it, then swap in your own.",milestones:[{label:"Open Create",moments:["go"]},{label:"Choose a product",moments:["product"]},{label:"Choose a presenter",moments:["presenter"]},{label:"Choose a scene",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"Open your shot",moments:["result"]}]},{id:"product",title:"Add your product",summary:"Your own product, added once from its packshots or straight from your store, and exact in every shot you make from then on. Nothing is drawn here and nothing is spent.",milestones:[{label:"Find where your products live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Add its photos, or bring in your store",moments:["product"]}]},{id:"reuse",title:"Use it again",summary:"The same saved product in a different world. This is the whole point of keeping ingredients: one thing you added once, shot again and again without describing it twice.",milestones:[{label:"Open Create",moments:["go"]},{label:"Add the product you saved",moments:["product"]},{label:"Put it somewhere else",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"See the same product in both",moments:["again"]}],needs:"product"},{id:"presenter",title:"Create a presenter",summary:"One person Scenri keeps, invented question by question or built from photos of someone real, who stays the same face across every shot you put them in.",milestones:[{label:"Find where your presenters live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe someone, or add photos",moments:["start"]},{label:"Decide the face",moments:["face"]},{label:"Save them to the brand",moments:["save"]}]},{id:"scene",title:"Build a scene",summary:"A place and its light, saved to shoot in again, from pictures of it or a few questions.",milestones:[{label:"Find where your scenes live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe the place, or add pictures",moments:["start"]},{label:"Read what your shots are told",moments:["words"]},{label:"Use it",moments:["use"]}]},{id:"refine",title:"Refine a shot",summary:"Change one thing about a shot you already have and keep everything else, including the original. This is how a shot gets good: one change at a time, never a fresh start.",milestones:[{label:"Find the shots you have made",moments:["go"]},{label:"Choose a shot to change",moments:["choose"]},{label:"Say the one thing to change",moments:["ask","refine-failed"]},{label:"See the change on the trail",moments:["refining","refined"]}],needs:"shot"}],j6={shot:{note:"Refining starts from a shot you have made.",action:"Make a shot first",status:"Needs a shot"},product:{note:"Using one again starts with a product of your own.",action:"Add a product first",status:"Needs a product"}};function NX(e){return $i.find(t=>t.id===e)??null}function MX(e,t,n,r){var a,i,l;return((i=(a=t.progress)==null?void 0:a[e])==null?void 0:i.brandId)===n&&r>0?"active":(l=t.lessons)!=null&&l[e]?"done":"new"}function RX(e,t){return e.find(n=>t(n)!=="done")??null}const Tv=Object.fromEntries($i.map(e=>[e.id,Object.fromEntries(e.milestones.flatMap((t,n)=>t.moments.map(r=>[r,n])))]));function vN(e,t){let n=0;for(const r of t){const a=Tv[e][r];a!==void 0&&a>n&&(n=a)}return n}function PX(e,t){return vN(e,t)>0}function LX(e,t){var a;const n=Tv[e][t],r=((a=$i.find(i=>i.id===e))==null?void 0:a.milestones.length)??0;return n===void 0||!r?null:{at:n+1,of:r}}const Og=e=>e.status==="done"&&e.images>0;function zx(e,t,n){const r=vN(e,t);return n?Math.max(TX(e,n),r):r}function TX(e,t){const n=t.moment?Tv[e][t.moment]:void 0;if(n!==void 0)return n;switch(e){case"first-shot":return t.nodes.some(Og)?5:t.nodes.length>0?4:0;case"reuse":return t.nodes.some(Og)?4:t.nodes.length>0?3:0;case"presenter":return t.draft?3:0;case"refine":return t.nodes.some(Og)||t.nodes.some(r=>r.status==="running")?3:0;default:return 0}}const A6={"first-shot":{square:new URL("/assets/first-shot-square-hTczF9bl.webp",import.meta.url).href,wide:new URL("/assets/first-shot-wide-BSpJwjNx.webp",import.meta.url).href},product:{square:new URL("/assets/product-square-DPR77tr0.webp",import.meta.url).href,wide:new URL("/assets/product-wide-DLSsO8IK.webp",import.meta.url).href},reuse:{square:new URL("/assets/reuse-square-CMLhjEwt.webp",import.meta.url).href,wide:new URL("/assets/reuse-wide-DbbTeKsL.webp",import.meta.url).href},presenter:{square:new URL("/assets/presenter-square-BpqHv8Aq.webp",import.meta.url).href,wide:new URL("/assets/presenter-wide-ecc4y7eJ.webp",import.meta.url).href},scene:{square:new URL("/assets/scene-square-CQBwEfXy.webp",import.meta.url).href,wide:new URL("/assets/scene-wide-CJ9ENIrh.webp",import.meta.url).href},refine:{square:new URL("/assets/refine-square-CietHTPe.webp",import.meta.url).href,wide:new URL("/assets/refine-wide-BM5sVq6w.webp",import.meta.url).href}};function $X({open:e,pictures:t,note:n,onTake:r,onDecline:a}){return o.jsxs(Ts,{open:e,className:"sc-welcome",maxWidth:"440px",described:!0,tone:"guide",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsxs(ds,{className:"sc-newdlg-title",children:["Welcome to ",o.jsx("span",{className:"sc-accent",children:"Scenri"})]}),o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":wu.notNow,children:o.jsx(jn,{size:16})})})]}),o.jsx(td,{className:"sc-welcome-lede",children:wu.lede}),t.length>0&&o.jsx("div",{className:"sc-welcome-pics","aria-hidden":"true",children:t.map((i,l)=>o.jsx("img",{src:i,alt:"",style:{animationDelay:`${120+l*60}ms`}},i))}),o.jsxs("div",{className:"sc-newdlg-foot sc-welcome-foot",children:[o.jsx("p",{className:"sc-welcome-note",children:n}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:wu.notNow}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:r,children:wu.take})]})]})}const Bx=e=>e.t!=="format",Oo=()=>[{t:"text",v:""}],Ta=e=>e.t==="product"?`p:${e.id}`:e.t==="template"?`t:${e.id}`:e.t==="ref"?`r:${e.imageHash}`:nm(e);function DX(e,t){const n=new Set,r=l=>{const u=Ta(l);return u?n.has(u)?!1:(n.add(u),!0):!0},a=e.filter(Bx).filter(r),i=t.filter(Bx).filter(r);return{own:a,carried:i}}function $v(e){const{own:t,carried:n}=DX(e.tokens??[],e.inherited??[]),r=[...t,...n],a=r.length?r:Oo(),i=a.some(l=>l.t==="template");return e.templateId&&!i?[{t:"template",id:e.templateId},...a]:a}const Hl="sc-token",Ef=`.${Hl}`,nm=e=>e.t==="template"?`t:${e.id}${e.setup?`|${e.setup}`:""}`:e.t==="product"?`p:${e.id}${e.angle?`|${e.angle}`:""}`:e.t==="character"?`h:${e.id}`:e.t==="color"?`c:${e.hex}|${e.name??""}`:e.t==="ref"?`r:${e.imageHash}${e.label?`|${e.label}`:""}`:e.t==="mark"?`m:${e.imageHash}`:"",as=e=>{const t=e.slice(0,1),n=e.slice(2);if(t==="t"){const[r,a]=n.split("|");return r?{t:"template",id:r,...a?{setup:a}:{}}:null}if(t==="p"){const[r,a]=n.split("|");return r?{t:"product",id:r,...a?{angle:a}:{}}:null}if(t==="h")return n?{t:"character",id:n}:null;if(t==="r"){const r=n.indexOf("|"),a=r<0?n:n.slice(0,r),i=r<0?"":n.slice(r+1);return a?{t:"ref",imageHash:a,...i?{label:i}:{}}:null}if(t==="m")return n?{t:"mark",imageHash:n}:null;if(t==="c"){const[r,a]=n.split("|");return r?{t:"color",hex:r,name:a||void 0}:null}return null},Go="\uFEFF",cl=//g,Kl=e=>!!e&&e.nodeType===Node.TEXT_NODE&&e.textContent===Go,wN=e=>{var t;return e.length-(((t=e.match(cl))==null?void 0:t.length)??0)};function Do(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return e.contains(n.startContainer)?Vh(e,n.startContainer,n.startOffset):null}function Ra(e,t){if(!e)return;let n=0;for(const r of Array.from(e.childNodes)){const a=Vu(r);if(r.nodeType===Node.TEXT_NODE){if(t<=n+a){lo(e,r,Zh(r,t-n));return}}else if(t<=n+a){const i=r.nextSibling;if((i==null?void 0:i.nodeType)===Node.TEXT_NODE){lo(e,i,Zh(i,0));return}break}n+=a}Ol(e)}function Zh(e,t){const n=e.textContent??"";if(n===Go)return 1;let r=0,a=0;for(;a<n.length&&r<t;)n[a]!==Go&&(r+=1),a+=1;return a}function Ol(e){if(!e)return;e.focus({preventScroll:!0});const t=e.lastChild;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE){lo(e,t,t.length);return}const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),r.collapse(!1),n==null||n.removeAllRanges(),n==null||n.addRange(r)}function HX(e){if(!e)return!1;const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return!1;const n=t.getRangeAt(0);return e.contains(n.startContainer)&&e.contains(n.endContainer)}function lo(e,t,n){const r=window.getSelection(),a=document.createRange();a.setStart(t,Math.max(0,Math.min(n,t.length))),a.collapse(!0),r==null||r.removeAllRanges(),r==null||r.addRange(a)}const Vu=e=>e.nodeType===Node.TEXT_NODE?wN(e.textContent??""):1;function Vh(e,t,n){if(t===e){let a=0;for(let i=0;i<n&&i<e.childNodes.length;i++)a+=Vu(e.childNodes[i]);return a}let r=0;for(const a of Array.from(e.childNodes)){if(a===t)return r+wN((a.textContent??"").slice(0,n));if(a.contains(t))return r+1;r+=Vu(a)}return r}function no(e){var n,r;if(!e)return;const t=Do(e);e.normalize();for(const a of Array.from(e.childNodes)){if(a.nodeType!==Node.TEXT_NODE)continue;const i=a.textContent??"",l=i.replace(cl,""),u=l.length?l:i.length?Go:"";u!==i&&(a.textContent=u),u||a.remove()}for(const a of Array.from(e.childNodes))Kl(a)&&!Vs(a.previousSibling)&&!Vs(a.nextSibling)&&a.remove();for(const a of Array.from(e.childNodes))Vs(a)&&(((n=a.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(Go),a),((r=a.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(Go),a.nextSibling));a0(e)||t!==null&&Ra(e,t)}function OX(e){var n,r,a;if(!e)return!0;const t=e.childNodes;for(let i=0;i<t.length;i++){const l=t[i];if(Vs(l)){if(((n=l.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE||((r=l.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE)return!1;continue}if(l.nodeType!==Node.TEXT_NODE)continue;const u=l.textContent??"";if(!u||((a=t[i+1])==null?void 0:a.nodeType)===Node.TEXT_NODE||u.includes(Go)&&(u!==Go||!Vs(l.previousSibling)&&!Vs(l.nextSibling)))return!1}return!0}function IX(e){return e.querySelector(Ef)?!1:!(e.textContent??"").replace(/[​ ]/g,"").trim()}function a0(e){if(!e)return!1;const t=IX(e);return t&&e.firstChild&&e.replaceChildren(),e.toggleAttribute("data-empty",t),t}const Vs=e=>!!e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(Hl);function Dv(e){if(!e)return null;const t=typeof window>"u"?null:window.getSelection();if(!t||t.rangeCount===0||!t.getRangeAt(0).collapsed)return null;const n=t.getRangeAt(0),r=n.startContainer;return r.nodeType!==Node.TEXT_NODE||r.parentNode!==e?null:{text:r,at:n.startOffset}}function Ux(e){var a;if(!e)return Oo();const t=[];let n="";const r=()=>{n&&(t.push({t:"text",v:n}),n="")};for(const i of Array.from(e.childNodes)){if(i.nodeType===Node.TEXT_NODE){n+=(i.textContent??"").replace(cl,"");continue}const l=i,u=(a=l.dataset)==null?void 0:a.tok;if(u){const f=as(u);if(f){r(),t.push(f);continue}}if(l.tagName==="BR"){n+=`
99
- `;continue}n+=l.textContent??""}return r(),t.some(i=>i.t==="text")||t.push({t:"text",v:""}),t}function Wx(e,t,n){if(e){e.textContent="";for(const r of FX(t)){if(r.t==="text"){r.v&&e.appendChild(document.createTextNode(r.v));continue}e.appendChild(n(r))}no(e)}}function FX(e){const t=n=>n>=0&&n<e.length&&e[n].t!=="text";return e.filter((n,r)=>{if(n.t!=="text"||!/^\s+$/.test(n.v))return!0;const a=r===0||t(r-1),i=r===e.length-1||t(r+1);return!(a&&i)})}function _X(e,t){var u,f;const n=Dv(e);if(!n||!e)return!1;const{text:r,at:a}=n,i=Kl(r);if(t==="right"){if(!Vs(r.nextSibling)||!i&&a!==r.length)return!1;const h=(u=r.nextSibling)==null?void 0:u.nextSibling;return(h==null?void 0:h.nodeType)!==Node.TEXT_NODE?!1:(lo(e,h,Kl(h)?1:0),!0)}if(!Vs(r.previousSibling)||!i&&a!==0)return!1;const l=(f=r.previousSibling)==null?void 0:f.previousSibling;return(l==null?void 0:l.nodeType)!==Node.TEXT_NODE?!1:(lo(e,l,Kl(l)?1:l.length),!0)}function Kx(e,t){const n=Dv(e);if(!n)return null;const{text:r,at:a}=n,i=Kl(r);return t==="Backspace"?Vs(r.previousSibling)&&(i||a===0)?r.previousSibling:null:Vs(r.nextSibling)&&(i||a===r.length)?r.nextSibling:null}function Gx(e,t){const n=Dv(e);return!n||!Kl(n.text)?!1:t==="Backspace"?!n.text.previousSibling:!n.text.nextSibling}function Ig(e,t){for(const n of Array.from(e.querySelectorAll(Ef))){const r=as(n.dataset.tok??"");if(r&&Ta(r)===t)return n}return null}function yN(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return"";const n=t.getRangeAt(0);if(n.startContainer.nodeType!==Node.TEXT_NODE||!e.contains(n.startContainer))return"";let r=(n.startContainer.textContent??"").slice(0,n.startOffset);for(let a=n.startContainer.previousSibling;a&&a.nodeType===Node.TEXT_NODE;a=a.previousSibling)r=(a.textContent??"")+r;return r}function bN(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).cloneRange(),n=t.getBoundingClientRect();if(n.width||n.height)return n;const r=document.createElement("span");r.textContent="​",t.insertNode(r);const a=r.getBoundingClientRect(),i=r.parentNode;return r.remove(),i==null||i.normalize(),a}function Vl(e,t,n){if(!e||!t)return;const r=n==="after"?t.nextSibling:t.previousSibling;if((r==null?void 0:r.nodeType)!==Node.TEXT_NODE)return;const a=r;lo(e,a,Kl(a)?1:n==="after"?0:a.length)}const zh=9;function xN(e){if(!e.firstChild)return[];const t=document.createRange();return t.selectNodeContents(e),Array.from(t.getClientRects()).filter(n=>n.height>0)}function kN(e,t){let n=null,r=1/0;for(const a of e){const i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=a)}return n}function Yx(e,t,n){if(!e)return!1;const r=xN(e),a=kN(r,n);if(!a)return!1;const i=a.top+a.height/2;for(const u of Array.from(e.querySelectorAll(Ef))){const f=u.getBoundingClientRect();if(!(f.bottom<a.top||f.top>a.bottom)&&!(t<f.left-zh||t>f.right+zh))return Vl(e,u,t<f.left+f.width/2?"before":"after"),!0}if(n>=a.top&&n<=a.bottom)return!1;const l=SN(t,i);return!l||!e.contains(l.node)||l.node.nodeType!==Node.TEXT_NODE?!1:(lo(e,l.node,l.offset),!0)}function ZX(e,t,n){if(!e)return null;const r=kN(xN(e),n);if(!r)return null;const a=r.top+r.height/2;for(const l of Array.from(e.querySelectorAll(Ef))){const u=l.getBoundingClientRect();if(!(u.bottom<r.top||u.top>r.bottom)&&!(t<u.left-zh||t>u.right+zh))return{beside:l,side:t<u.left+u.width/2?"before":"after"}}const i=SN(t,a);return!i||!e.contains(i.node)?null:{node:i.node,offset:i.offset}}function SN(e,t){var i,l;const n=document,r=(i=n.caretRangeFromPoint)==null?void 0:i.call(n,e,t);if(r)return{node:r.startContainer,offset:r.startOffset};const a=(l=n.caretPositionFromPoint)==null?void 0:l.call(n,e,t);return a?{node:a.offsetNode,offset:a.offset}:null}function VX(e,t,n={}){if(!e)return;const r=window.getSelection();let a=null;if(r&&r.rangeCount>0&&e.contains(r.getRangeAt(0).startContainer))a=r.getRangeAt(0);else if(n.fallbackUnits!=null){Ra(e,n.fallbackUnits);const l=window.getSelection();l&&l.rangeCount>0&&e.contains(l.getRangeAt(0).startContainer)&&(a=l.getRangeAt(0))}a||(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),a.deleteContents();const i=a.startContainer;if(i.nodeType===Node.TEXT_NODE&&i.parentNode===e){const l=i,u=l.textContent??"";let f=u.slice(0,a.startOffset);const h=u.slice(a.startOffset);n.eatQuery&&(f=WX(l,f)),l.textContent=f,e.insertBefore(t,l.nextSibling),h&&e.insertBefore(document.createTextNode(h),t.nextSibling)}else{const l=i===e?a.startOffset:e.childNodes.length;e.insertBefore(t,e.childNodes[l]??null)}no(e),Ra(e,ni(e,t)+1)}const zX=["$","/","@","#"],BX=e=>zX.includes(e),Bh=e=>e===" "||e===`
100
- `||e===" "||e===Go;function UX(e){const t=yN(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(Bh(r))return null;if(BX(r))return n===0||Bh(t[n-1])?{sigil:r,query:t.slice(n+1)}:null}return null}function WX(e,t){const n=i=>Math.max(i.lastIndexOf("$"),i.lastIndexOf("/"),i.lastIndexOf("@"),i.lastIndexOf("#")),r=n(t);if(r>=0)return t.slice(0,r);const a=[];for(let i=e.previousSibling;i&&i.nodeType===Node.TEXT_NODE;i=i.previousSibling){const l=i.textContent??"",u=n(l);if(u>=0){i.textContent=l.slice(0,u);for(const f of a)f.remove();return""}a.push(i)}return t}function Fg(e,t){if(!e||!t)return;e.normalize();const n=ni(e,t);t.remove(),no(e),Ra(e,n)}function ni(e,t){let n=0;for(const r of Array.from(e.childNodes)){if(r===t)break;n+=Vu(r)}return n}const Nu=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function KX(e){let t="",n="",r=!1;const a=i=>{var f;if(i.nodeType===Node.TEXT_NODE){const h=(i.textContent??"").replace(cl,"");if(!h)return;t+=h,n+=Nu(h),r=!1;return}const l=i,u=(f=l.dataset)==null?void 0:f.tok;if(u){const h=Io(l);t+=(r?" ":"")+h,r=!0,n+=`<span data-sc-tok="${Nu(u)}">${Nu(h)}</span>`;return}i.childNodes.forEach(a)};return e.cloneContents().childNodes.forEach(a),{text:t,html:`<span data-sc-brief="1">${n}</span>`}}function GX(e,t){const n=[],r=[];for(const a of e){if(a.t==="text"){const l=a.v.trim();if(!l)continue;n.push(l),r.push(Nu(l));continue}const i=t(a);n.push(i),r.push(`<span data-sc-tok="${Nu(nm(a))}">${Nu(i)}</span>`)}return{text:n.join(" "),html:`<span data-sc-brief="1">${r.join(" ")}</span>`}}function Io(e){var t;return(((t=e.querySelector(".sc-token-label"))==null?void 0:t.textContent)??"").trim()}function YX(e){if(!e.includes("data-sc-brief")&&!e.includes("data-bt-brief"))return null;const n=new DOMParser().parseFromString(e,"text/html").querySelector("[data-sc-brief], [data-bt-brief]");if(!n)return null;const r=[],a=i=>{var h,p;if(i.nodeType===Node.TEXT_NODE){const g=(i.textContent??"").replace(cl,"");g&&r.push(g);return}const l=i,u=((h=l.dataset)==null?void 0:h.scTok)??((p=l.dataset)==null?void 0:p.btTok);if(u===void 0){i.childNodes.forEach(a);return}const f=as(u);r.push(f??l.textContent??"")};return n.childNodes.forEach(a),r.length?r:null}function EN(e){const t=new Set([0]);let n=0;for(const i of e){if(i.t!=="text"){t.add(n),n+=1,t.add(n);continue}for(let l=0;l<i.v.length;l++)(i.v[l]===" "||i.v[l]===`
101
- `)&&t.add(n+l+1);n+=i.v.length}t.add(n);const r=[...t].sort((i,l)=>i-l),a=Cf(e);return r.filter((i,l)=>l===r.length-1||!/^[ \n]*$/.test(a.slice(i,r[l+1])))}const Cf=e=>e.map(t=>t.t==="text"?t.v:"").join(""),Hv=(e,t,n)=>{const r=n<=t?e.slice(n,t):e.slice(t+1,n);return/^[ \n]*$/.test(r)};function qX(e,t){const n=Cf(e);return EN(e).filter(r=>!Hv(n,t,r))}function XX(e,t){return e.find(n=>n>=t)??(e.length?e[e.length-1]:null)}function QX(e,t){let n=null,r=1/0;for(const a of e){const i=Math.abs(a-t);i<r&&(r=i,n=a)}return n}function CN(e,t,n){if(!e||!t.parentNode)return!1;const r=ni(e,t);if(Hv(Cf(rm(e)),r,n))return!1;let a=null,i=0;for(const l of Array.from(e.childNodes)){const u=Vu(l);if(n<=i+u){if(l.nodeType===Node.TEXT_NODE){const f=n-i;f<=0?a=l:f>=u?a=l.nextSibling:a=l.splitText(Zh(l,f))}else a=n===i?l:l.nextSibling;break}i+=u}return a===t?!1:(t.remove(),e.insertBefore(t,a),no(e),!0)}function qx(e,t,n){if(!e)return!1;const r=ni(e,t),a=qX(rm(e),r),i=n===-1?[...a].reverse().find(l=>l<r):a.find(l=>l>r+1);return i===void 0?!1:CN(e,t,i)}function JX(e,t){if(!e)return t;const n=Cf(rm(e));let r=t;for(;r>0&&(n[r-1]===" "||n[r-1]===`
102
- `);)r-=1;return r}function Xx(e,t,n,r){if(!e)return null;const a=ZX(e,n,r);if(!a)return null;const i=rm(e),l=ni(e,t),u=EN(i),f="beside"in a?ni(e,a.beside)+(a.side==="before"?0:1):a.node.nodeType===Node.TEXT_NODE||a.node===e?Vh(e,a.node,a.offset):null;if(f===null)return null;const h="beside"in a&&a.side==="after"?XX(u,f):QX(u,f);return h===null?null:{units:h,noop:Hv(Cf(i),l,h)}}function N6(e,t){const n=Io(t)||"the chip",r=eQ(t);if(r)return`Moved ${n} before ${r}.`;const a=tQ(t);return a?`Moved ${n} after ${a}.`:ni(e,t)===0?`Moved ${n} to the start of the brief.`:`Moved ${n} to the end of the brief.`}const jN=3;function eQ(e){for(let t=e.nextSibling;t;t=t.nextSibling){if(Vs(t))return Io(t)||null;const n=(t.textContent??"").replace(cl,"").trim();if(n)return`"${n.split(/\s+/).slice(0,jN).join(" ")}"`}return null}function tQ(e){for(let t=e.previousSibling;t;t=t.previousSibling){if(Vs(t))return Io(t)||null;const n=(t.textContent??"").replace(cl,"").trim();if(n)return`"${n.split(/\s+/).slice(-jN).join(" ")}"`}return null}function rm(e){const t=[];let n="";for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.TEXT_NODE){n+=(r.textContent??"").replace(cl,"");continue}n&&(t.push({t:"text",v:n}),n=""),t.push({t:"ref",imageHash:""})}return n&&t.push({t:"text",v:n}),t}function M6(e){var n;const t=e.target;(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable=""], [contenteditable="true"]')||e.preventDefault()}const Vd=e=>(e==null?void 0:e.querySelector('[data-kind="template"]'))??null,Pi=e=>{var t;return((t=e==null?void 0:e.closest)==null?void 0:t.call(e,Ef))??null};function _g(e,t,n={}){var a;if(!e)return!1;let r=!1;for(let i=0;i<32;i++){const l=rQ(e,!!n.commit);if(!l)break;const u={t:"color",hex:l.hex,name:(a=n.nameFor)==null?void 0:a.call(n,l.hex)};oQ(e,l.node,l.start,l.end,t(u)),r=!0}return r&&no(e),r}function nQ(e,t){var i;e.dataset.kind="color",e.dataset.tok=nm(t);const n=t.name??t.hex,r=e.querySelector(".sc-token-swatch");r&&(r.style.background=t.hex);const a=e.querySelector(".sc-token-label");a&&(a.textContent=n),e.getAttribute("role")==="button"&&e.setAttribute("aria-label",`colour: ${n}. Change or remove.`),(i=e.querySelector('[data-role="remove"]'))==null||i.setAttribute("aria-label",`Remove ${n}`)}function rQ(e,t){for(let n=e.childNodes.length-1;n>=0;n--){const r=e.childNodes[n];if(r.nodeType!==Node.TEXT_NODE)continue;const a=r,i=aQ(a.textContent??"",t,(u,f)=>sQ(a,f,u)),l=i[i.length-1];if(l)return{node:a,...l}}return null}function sQ(e,t,n){if(n>0)return Bh(t[n-1]);const r=e.previousSibling;if(!r||Vs(r))return!0;if(r.nodeType===Node.TEXT_NODE){const a=r.textContent??"";return!a.length||Bh(a[a.length-1]??"")}return!0}function aQ(e,t,n){const r=[];for(let a=0;a<e.length;a++){if(e[a]!=="#"||!n(a,e))continue;let i=a+1;for(;i<e.length&&/[0-9A-Fa-f]/.test(e[i]??"");)i++;const l=e.slice(a,i),u=MY(l);if(!u)continue;if(i-a-1===3){const h=e[i];if(h===void 0?!t:/[0-9A-Za-z]/.test(h))continue}r.push({start:a,end:i,hex:u})}return r}function oQ(e,t,n,r,a){const i=t.textContent??"",l=i.slice(0,n),u=i.slice(r),f=typeof window>"u"?null:window.getSelection();let h=null;f&&f.rangeCount>0&&f.getRangeAt(0).startContainer===t&&(h=f.getRangeAt(0).startOffset);const p=t.parentNode;if(p&&(t.textContent=u.length?u:" ",p.insertBefore(a,t),l&&p.insertBefore(document.createTextNode(l),a),h!=null)){if(h<=n){const g=a.previousSibling;(g==null?void 0:g.nodeType)===Node.TEXT_NODE&&lo(e,g,Math.min(h,(g.textContent??"").length));return}if(h<=r||!u.length){lo(e,t,t.length);return}lo(e,t,Math.min(h-r,t.length))}}function Mu(e){if(!e||!/^#[0-9a-f]{6}$/i.test(e))return;const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,a=Math.max(t,n,r),i=Math.min(t,n,r),l=a-i;if(l<.02)return;let u;return a===t?u=((n-r)/l+(n<r?6:0))*60%360:a===n?u=((r-t)/l+2)*60:u=((t-n)/l+4)*60,`hsl(${Math.round(u)} 55% 55%)`}function iQ(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","9"),t.setAttribute("height","9"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2.4");const n=document.createElementNS(e,"path");return n.setAttribute("d","m6 6 12 12M18 6 6 18"),t.appendChild(n),t}const zd="data-sc-coach-inert",lQ=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function cQ(e=document.body){let t=new Set;const n=a=>{a.hasAttribute("inert")&&!a.hasAttribute(zd)||(a.setAttribute(zd,""),a.setAttribute("inert",""))},r=a=>{a.hasAttribute(zd)&&(a.removeAttribute(zd),a.removeAttribute("inert"))};return{set(a){const i=new Set(a.filter(h=>h.isConnected&&e.contains(h)&&h!==e)),l=new Set;for(const h of i)for(let p=h.parentElement;p&&p!==e;p=p.parentElement)l.add(p);const u=new Set,f=h=>{for(const p of Array.from(h.children))i.has(p)||lQ.has(p.tagName)||(l.has(p)?f(p):u.add(p))};f(e);for(const h of t)u.has(h)||r(h);for(const h of u)t.has(h)||n(h);t=new Set([...u].filter(h=>h.hasAttribute(zd)))},release(){for(const a of t)r(a);t=new Set}}}const hh=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),Yo=e=>e.right-e.left,ao=e=>e.bottom-e.top;function AN(e,t){return{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top),right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)}}function Bd(e,t){return{left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}}function Qx(e,t=0,n=4,r=14,a=0,i=0,l=0){if(e>=4)return e+n;const u=i===0||a===0||a<=i+16;return t>=4&&u&&l<=1?t+n:r}function NN(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function Jx(e,t){let n=e;for(const r of t)n={left:Math.max(n.left,r.left),top:Math.max(n.top,r.top),right:Math.min(n.right,r.right),bottom:Math.min(n.bottom,r.bottom)};return Yo(n)>0&&ao(n)>0?n:null}function ek(e,t){let{top:n,bottom:r}=e;const a=(e.top+e.bottom)/2;for(const i of t)NN(i,e)&&(i.bottom<=a?n=Math.max(n,i.bottom):r=Math.min(r,i.top));return r>n?{...e,top:n,bottom:r}:null}const uQ=e=>e==="top"||e==="bottom";function dQ(e,t,n){return t?uQ(n)?{left:e.left,right:e.right,top:t.top,bottom:t.bottom}:{left:t.left,right:t.right,top:e.top,bottom:e.bottom}:e}const tk=e=>e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left",xs=e=>Math.round(e*2)/2;function fQ(e,t,n){const r=xs(t),a=xs(n),i=e.map(u=>{const f=Math.max(0,xs(Yo(u))),h=Math.max(0,xs(ao(u))),p=xs(Math.max(0,Math.min(u.radius,f/2,h/2)));return`<rect x='${xs(u.left)}' y='${xs(u.top)}' width='${f}' height='${h}' rx='${p}' fill='black'/>`}).join(""),l=`<svg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${a}'><defs><mask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='${r}' height='${a}'><rect width='${r}' height='${a}' fill='white'/>${i}</mask></defs><rect width='${r}' height='${a}' fill='black' mask='url(#m)'/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(l)}")`}function hQ(e,t,n,r){const a=xs(t),i=xs(n),l=e.map(p=>{const g=Math.max(0,xs(Yo(p))),v=Math.max(0,xs(ao(p))),w=xs(Math.max(0,Math.min(p.radius,g/2,v/2)));return{x:xs(p.left),y:xs(p.top),ww:g,hh:v,k:w}}),u=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='black'/>`),f=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='none' stroke='${r}' stroke-width='2'/>`),h=`<svg xmlns='http://www.w3.org/2000/svg' width='${a}' height='${i}'><defs><mask id='o' maskUnits='userSpaceOnUse' x='0' y='0' width='${a}' height='${i}'><rect width='${a}' height='${i}' fill='white'/>${u.join("")}</mask></defs><g mask='url(#o)'>${f.join("")}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(h)}")`}function pQ(e,t,n){const r={left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(n,e.bottom)};return[{left:0,top:0,right:t,bottom:r.top},{left:0,top:r.bottom,right:t,bottom:n},{left:0,top:r.top,right:r.left,bottom:r.bottom},{left:r.right,top:r.top,right:t,bottom:r.bottom}].filter(a=>Yo(a)>0&&ao(a)>0)}const nk=0,mQ=10,Zg=14,Ud=4,Vg="data-guide-stage",gQ="rgba(255,255,255,0.05)",R6="[data-guide-shape]",rk=[],vQ="[data-radix-popper-content-wrapper], .sc-setpop, .sc-morepop, .sc-shotsheet, .sc-note-pop",sk='input, textarea, [contenteditable]:not([contenteditable="false"])',wQ=17,U1=12,yQ=20,bQ=450,xQ=768,ak=90,kQ=8,ok=12,SQ=2e3,EQ=".sc-topbar, .sc-tabbar, .sc-filterbar, .sc-canvas-dock, .sc-help-float, .sc-pstudio-head, .sc-newdlg-head",CQ=120,jQ="[aria-live], .sc-toasts, .sc-upd-float, .sc-upd-overlay, [data-radix-popper-content-wrapper], .sc-chip-preview, .sc-swap, .sc-shotsheet, .sc-shotsheet-scrim, .sc-cmd",zg=e=>({id:e.id,title:e.title,body:e.body,canBack:e.canBack,action:e.action,count:e.at&&e.of?`${e.at} of ${e.of}`:void 0});function AQ(e){const{id:t,voice:n,target:r,live:a,side:i,container:l,onShown:u}=e,f=e.lit??rk,h=e.also??rk,p=n==="ask",g=!r,v=!!(e.title||e.body),w=s.useId(),y=s.useId(),x=s.useRef(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),j=s.useRef(null),N=s.useRef(null),P=s.useRef(null),$=s.useRef(null),M=s.useRef(null),C=s.useRef(null),[R,T]=s.useState("moving"),[H]=s.useState(TQ),[D,K]=s.useState(()=>zg(e)),O=s.useRef(e);O.current=e;const Z=s.useRef(!1),te=s.useRef(null),B=s.useRef([]),F=R==="shown"&&D.id===t?zg(e):D,X=Bg(a),z=Bg(h),I=Bg(f);s.useEffect(()=>{if(p)return C.current=cQ(l),()=>{var G;(G=C.current)==null||G.release(),C.current=null;for(const ne of B.current)ne.removeAttribute(Vg);B.current=[]}},[p,l]),s.useLayoutEffect(()=>{var cn,Fe,pt;const G=x.current,ne=k.current,q=S.current,le=E.current,Se=j.current,Q=N.current;if(p&&(!q||!le||!Se||!Q)||v&&(!G||!ne))return;let xe=!0,ee=0,ae=0,re=!1,_=!1,ue="",We=0,Xe=0,ze=0,tt=null,ce=null,ve=null;const Pe=window.matchMedia("(prefers-reduced-motion: reduce)").matches,de=a[0]??r??l;let je="",Ue=r?W1(r):null;T("moving");const ye=()=>{var it;return(it=C.current)==null?void 0:it.set([...G?[G]:[],...q?[q]:[],...le?[le]:[],...Se?[Se]:[],...Q?[Q]:[],...a,...h,...[...document.querySelectorAll(jQ)].filter(St=>![...a,...h].some(xt=>St.contains(xt)))])},Ee=()=>{var it,St;(it=C.current)==null||it.release(),_=!1,T("away"),(St=r??a[0])!=null&&St.isConnected&&Qe()};if(p&&C.current&&Z.current){ye(),_=!0;const it=a.find(xt=>xt.matches(sk)),St=document.activeElement;it&&!a.some(xt=>xt.contains(St))&&ik(it)}const be=async()=>{const it=++ee;if(r&&!r.isConnected||a.some(se=>!se.isConnected))return Ee(),O.current.onLost();const St=window.innerWidth,xt=window.innerHeight,At=window.visualViewport,Kt=[{left:0,top:0,right:St,bottom:xt},...At?[{left:At.offsetLeft,top:At.offsetTop,right:At.offsetLeft+At.width,bottom:At.offsetTop+At.height}]:[]],et=se=>{const oe=se===r?Ue:W1(se);return oe?[...Kt,hh(oe.getBoundingClientRect())]:Kt},mt=NQ(de,l),ot=mt.filter(se=>Yo(se)>St/3),kn=r?Jx(hh(r.getBoundingClientRect()),et(r)):null,ut=kn&&ek(kn,ot);if(r&&!ut)return!re&&ze<ok&&(ze++,Ue=W1(r),Ug(r,Ue,Pe).then(()=>xe&&Ke())),Ee();const Gt=[],Ft=[];for(const se of[...r?[r]:[],...a,...h,...f,...lk()]){const oe=ck(se);Ft.includes(oe)||Ft.push(oe)}const en=new Set([...r?[r]:[],...a,...f,...lk()].map(ck));let Jt=null;for(const se of Ft){const oe=Jx(hh(se.getBoundingClientRect()),et(se)),we=oe&&ek(oe,ot);if(!we)continue;const ge=ph(se);Gt.push(ge>=4||se.matches("img, video, canvas")?{...Bd(we,nk),radius:ge+nk}:{...Bd(we,mQ),radius:Zg}),en.has(se)&&(Jt=Jt?AN(Jt,we):we)}if(!g&&!ut&&!Jt)return Ee();if(_&&(a.some(se=>se.closest("[inert]"))||G!=null&&G.closest("[inert]"))&&(_=!1),p&&q&&le&&Se&&Q){if(!Gt.length&&ut){const we=r,ge=uk(we);Gt.push({...Bd(ut,Ud),radius:Qx(ph(we),ge.radius,Ud,Zg,ao(ut),ge.height,ge.count)})}for(const we of B.current)Ft.includes(we)||we.removeAttribute(Vg);for(const we of Ft)we.setAttribute(Vg,"");B.current=Ft;const oe=`${Gt.map(we=>[we.left,we.top,we.right,we.bottom,we.radius].map(Math.round).join(",")).join("|")}@${St}x${xt}`;if(oe!==je&&(je=oe,LQ(q,le,Q,Gt,H)),r&&ut){const we=OQ(r),ge=uk(r),J=we??Bd(ut,Ud);Object.assign(Se.style,{left:`${J.left}px`,top:`${J.top}px`,width:`${Yo(J)}px`,height:`${ao(J)}px`,borderRadius:`${we?HQ:Qx(ph(r),ge.radius,Ud,Zg,ao(ut),ge.height,ge.count)}px`}),Se.hidden=!1}else Se.hidden=!0}if(G&&document.documentElement.style.setProperty("--sc-coach-h",`${Math.round(G.offsetHeight)}px`),G&&g&&(G.style.right="",G.style.left=`${Math.round((St-G.offsetWidth)/2)}px`,G.style.top=`${Math.round((xt-G.offsetHeight)/2)}px`,G.dataset.side="centre",ne&&(ne.hidden=!0)),G&&ne&&r&&ut){G.style.right="";const se={top:U1+MQ(mt,xt),bottom:U1+RQ(mt,xt),left:U1,right:U1},oe=St>=xQ;ce!==oe&&(ce!==null&&r&&(Ue=W1(r),Ug(r,Ue,Pe)),tt=null,ce=oe);const we=i==="left"||i==="right"?"top":i,ge=!oe&&Yo(ut)>St*.6,J=oe?i:ge?`${we}-start`:we,Oe=(Ct,st)=>q9(PQ(Ct,r),G,{strategy:"fixed",placement:tt??J,middleware:[K9(wQ),Y9({padding:se,fallbackPlacements:st}),G9({padding:se}),V8({element:ne,padding:yQ})]}),Be=!oe&&Jt?{...ut,top:Jt.top,bottom:Jt.bottom}:ut,Ve=(Ct,st)=>NN({left:Ct,top:st,right:Ct+G.offsetWidth,bottom:st+G.offsetHeight},Bd(Be,Ud)),_e=oe&&(i==="left"||i==="right")?[tk(i),"top","bottom"]:oe?void 0:ge?["bottom-start","top-start"]:["bottom","top"],W=!p&&ao(ut)>xt*.6,pe=oe&&(e.beside||a.length>1),Ie=W?{...ut,top:ut.bottom-1}:pe?dQ(ut,Jt,i):Be;let Te=await Oe(Ie,W?["top"]:_e);if(!xe||it!==ee||!W&&Ve(Te.x,Te.y)&&(Te=await Oe(Be,void 0),!xe||it!==ee))return;if(!W&&Ve(Te.x,Te.y))return T("stowed");tt=Te.placement;const bt=Te.placement.split("-")[0];G.style.left=`${Math.round(Te.x)}px`,G.style.top=`${Math.round(Te.y)}px`,G.dataset.side=bt;const vt=Te.middlewareData.arrow;ne.dataset.edge=tk(bt),ne.style.left=(vt==null?void 0:vt.x)!=null?`${vt.x}px`:"",ne.style.top=(vt==null?void 0:vt.y)!=null?`${vt.y}px`:"",ne.hidden=!vt||Math.abs(vt.centerOffset)>1}if(p&&!_&&(ye(),_=!0),!re){if(IQ([...r?[r]:[],...a])&&++Xe<ok){window.setTimeout(Ke,ak);return}const se=[...r?[r]:[],...a,...h,...f].map(oe=>{const we=oe.getBoundingClientRect();return[we.left,we.top,we.right,we.bottom].map(Math.round).join(",")}).join("|");if(se!==ue&&(ue=se,We=0),++We<2&&We<kQ){window.setTimeout(Ke,ak);return}}T("shown"),re||(re=!0,nt(),Qe())};let Le=0;const Qe=()=>{const it=r??a[0];if(!it)return;cancelAnimationFrame(Le);let St=it.getBoundingClientRect();const xt=performance.now()+SQ,At=()=>{if(!xe)return;const Kt=it.getBoundingClientRect();(Kt.top!==St.top||Kt.left!==St.left||Kt.height!==St.height)&&(St=Kt,Ke()),performance.now()<xt&&(Le=requestAnimationFrame(At))};Le=requestAnimationFrame(At)},Ke=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(()=>void be())},nt=()=>{Z.current=!0;let it=!1;if(p&&G){const St=Kt=>!!Kt&&a.some(et=>et.contains(Kt)),xt=document.activeElement,At=a.find(Kt=>Kt.matches(sk))??null;M.current&&St(xt)?M.current=null:M.current?(((M.current==="back"?P.current:null)??$.current??G).focus({preventScroll:!0}),M.current=null):At&&!St(xt)?ik(At):(!xt||xt===document.body||xt.closest("[inert]"))&&(G.focus({preventScroll:!0}),it=!0)}u(t,it)},gt=Z.current&&!Pe&&v&&te.current!==t?CQ:0;te.current=t,$Q(gt).then(()=>{if(xe)return Rr.flushSync(()=>K(zg(O.current))),r?Ug(r,Ue,Pe):void 0}).then(()=>{xe&&(ve=W9(de,G??q??de,Ke))});const Pt=new ResizeObserver(Ke);for(const it of a)Pt.observe(it);r&&Pt.observe(r),G&&Pt.observe(G);for(const it of[...r?[r]:[],...a]){const St=(cn=it==null?void 0:it.closest)==null?void 0:cn.call(it,R6);St&&Pt.observe(St)}(Fe=window.visualViewport)==null||Fe.addEventListener("resize",Ke),(pt=window.visualViewport)==null||pt.addEventListener("scroll",Ke);let Ut=0;const Nt=p?new MutationObserver(()=>{_&&(cancelAnimationFrame(Ut),Ut=requestAnimationFrame(ye))}):null;return Nt==null||Nt.observe(l,{childList:!0,subtree:!0}),()=>{var it,St;xe=!1,document.documentElement.style.removeProperty("--sc-coach-h"),cancelAnimationFrame(ae),cancelAnimationFrame(Le),cancelAnimationFrame(Ut),Nt==null||Nt.disconnect(),ve==null||ve(),Pt.disconnect(),(it=window.visualViewport)==null||it.removeEventListener("resize",Ke),(St=window.visualViewport)==null||St.removeEventListener("scroll",Ke)}},[t,p,v,r,X,z,I,i,l,u,H]),s.useEffect(()=>{if(!v||!r||!DQ(r))return;const G=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);if(!G.includes(y))return r.setAttribute("aria-describedby",[...G,y].join(" ")),()=>{const ne=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(q=>q&&q!==y);ne.length?r.setAttribute("aria-describedby",ne.join(" ")):r.removeAttribute("aria-describedby")}},[v,r,y]);const{onEscape:U}=e;return s.useEffect(()=>{if(!p)return;const G=xe=>!!xe&&a.some(ee=>ee.contains(xe)),ne=xe=>{var ue;const ee=x.current,ae=xe.target instanceof Node?xe.target:null,re=G(ae),_=document.activeElement;if(xe.key==="Escape"){if(xe.defaultPrevented||_!=null&&_.closest('[role="dialog"]:not(.sc-coach):not(.sc-attachpanel)')||re&&(_!=null&&_.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="listbox"]')))return;xe.preventDefault(),xe.stopPropagation(),U(t);return}re||(!ae||ae===document.body||ae===document.documentElement||ee!=null&&ee.contains(ae)||(ue=E.current)!=null&&ue.contains(ae))&&xe.stopPropagation()};let q=0,le=!1;const Se=xe=>{le=xe.target instanceof Node&&G(xe.target)},Q=xe=>{xe.relatedTarget||le||!x.current||(cancelAnimationFrame(q),q=requestAnimationFrame(()=>{var ae;if(!document.hasFocus())return;const ee=document.activeElement;(!ee||ee===document.body||ee.closest("[inert]"))&&((ae=x.current)==null||ae.focus({preventScroll:!0}))}))};return window.addEventListener("keydown",ne,!0),window.addEventListener("pointerdown",Se,!0),document.addEventListener("focusout",Q,!0),()=>{cancelAnimationFrame(q),window.removeEventListener("keydown",ne,!0),window.removeEventListener("pointerdown",Se,!0),document.removeEventListener("focusout",Q,!0)}},[t,p,X,U]),Rr.createPortal(o.jsxs(o.Fragment,{children:[p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:S,className:"sc-coach-veil","data-veil":H?"mask":"panels","data-soft":e.soft||void 0,"data-state":R,"aria-hidden":"true",children:fk.map(G=>o.jsx("div",{className:"sc-coach-panel"},G))}),o.jsx("div",{ref:E,className:"sc-coach-catch","data-guide":"catch","data-state":R,"aria-hidden":"true",onMouseDown:G=>G.preventDefault(),children:fk.map(G=>o.jsx("div",{className:"sc-coach-catch-part"},G))}),o.jsx("div",{ref:N,className:"sc-coach-rim","data-state":R,"aria-hidden":"true"}),o.jsx("div",{ref:j,className:"sc-coach-ring","data-state":R,"aria-hidden":"true",hidden:!0})]}),v&&o.jsxs("div",{ref:x,className:"sc-coach","data-guide":"card","data-voice":p?"coach":"card","data-beside":e.beside||void 0,...p?{role:"dialog","aria-labelledby":F.title?w:void 0}:{role:"note"},"aria-describedby":y,tabIndex:-1,"data-state":R,children:[o.jsx("div",{ref:k,className:"sc-coach-arrow","aria-hidden":"true",hidden:!0}),o.jsxs("div",{className:"sc-coach-head",children:[F.title?o.jsx("h2",{id:w,className:"sc-coach-title",children:F.title}):o.jsx("p",{id:y,className:"sc-coach-body","data-lead":"",children:F.body}),F.count&&o.jsxs("p",{className:"sc-coach-count",children:[o.jsx("span",{className:"sc-vh",children:"Step "}),F.count]}),o.jsx(lr,{label:e.closeLabel,children:o.jsx("button",{type:"button",className:"sc-coach-x","aria-label":e.closeLabel,onClick:()=>e.onClose(t),children:o.jsx(jn,{size:16})})})]}),F.title&&F.body&&o.jsx("p",{id:y,className:"sc-coach-body",children:F.body}),(F.canBack||F.action)&&o.jsxs("div",{className:"sc-coach-foot",children:[F.canBack&&o.jsx("button",{ref:P,type:"button",className:"sc-coach-back",onClick:()=>{M.current="back",e.onBack(t)},children:"Back"}),F.action&&o.jsx("button",{ref:$,type:"button",className:"sc-btn sc-btn-primary sc-coach-next",onClick:()=>{M.current="action",e.onAction(t)},children:F.action.label})]})]})]}),l)}function ik(e){var t,n;if(e.focus({preventScroll:!0}),!e.isContentEditable){const r=e,a=((t=r.value)==null?void 0:t.length)??0;(n=r.setSelectionRange)==null||n.call(r,a,a);return}Ol(e)}function lk(){return[...document.querySelectorAll(vQ)].filter(e=>e.getClientRects().length>0)}function Bg(e){const t=s.useRef(e);return(t.current.length!==e.length||t.current.some((n,r)=>n!==e[r]))&&(t.current=e),t.current}function NQ(e,t){const n=[];for(const r of document.querySelectorAll(EQ))t.contains(r)&&(r.contains(e)||e.contains(r)||r.getClientRects().length===0||n.push(hh(r.getBoundingClientRect())));return n}function MQ(e,t){return Math.max(0,...e.filter(n=>n.top<=0&&n.bottom<t/3).map(n=>n.bottom))}function RQ(e,t){return Math.max(0,...e.filter(n=>n.bottom>=t&&n.top>t*2/3).map(n=>t-n.top))}function PQ(e,t){const n={x:e.left,y:e.top,left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:Yo(e),height:ao(e)};return{getBoundingClientRect:()=>n,contextElement:t}}function LQ(e,t,n,r,a){const i=window.innerWidth,l=window.innerHeight,u=r.reduce((h,p)=>h?AN(h,p):p,null),f=u?pQ(u,i,l):[];if(a){const h=fQ(r,i,l),p=e.style;p.maskImage=h,p.webkitMaskImage=h,n.style.backgroundImage=hQ(r,i,l,gQ)}else dk(e,f);dk(t,f)}function ph(e){return Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||0}function ck(e){return e.closest(R6)??e.querySelector(R6)??e}function uk(e){let t=0,n=0,r=0;for(const a of e.querySelectorAll("button, a[href], .sc-chip, .sc-btn"))a.getClientRects().length&&(r+=1,t=Math.max(t,ph(a)),n=Math.max(n,a.getBoundingClientRect().height));return{radius:t,height:n,count:r}}function dk(e,t){Array.from(e.children).forEach((n,r)=>{const a=t[r],i=n.style;if(!a){i.display="none";return}Object.assign(i,{display:"block",left:`${a.left}px`,top:`${a.top}px`,width:`${Yo(a)}px`,height:`${ao(a)}px`})})}const fk=[0,1,2,3];function TQ(){return typeof CSS>"u"?!1:CSS.supports("mask-image",'url("x.svg")')||CSS.supports("-webkit-mask-image",'url("x.svg")')}function W1(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const n=getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function Ug(e,t,n){if(!t)return Promise.resolve();const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();if(Math.max(0,Math.min(r.bottom,a.bottom,window.innerHeight)-Math.max(r.top,a.top,0))>=Math.min(120,r.height*.4))return Promise.resolve();const u=r.height>a.height*.8?r.top-a.top-16:(r.top+r.bottom)/2-(a.top+a.bottom)/2;return t.scrollBy({top:u,behavior:n?"auto":"smooth"}),n?Promise.resolve():new Promise(f=>{let h=!1;const p=()=>{h||(h=!0,t.removeEventListener("scrollend",p),f())};t.addEventListener("scrollend",p),window.setTimeout(p,bQ)})}function $Q(e){return e>0?new Promise(t=>window.setTimeout(t,e)):Promise.resolve()}function DQ(e){return e.matches('button, a[href], input, select, textarea, [tabindex], [contenteditable="true"]')}const HQ=10;function OQ(e){if(!e.matches("a[href], button")||e.getBoundingClientRect().height<=48)return null;const t=document.createRange();t.selectNodeContents(e);const n=t.getBoundingClientRect();return n.width?{left:n.left-12,top:n.top-7,right:n.right+12,bottom:n.bottom+7}:null}function IQ(e){return document.getAnimations().some(t=>{var r,a;const n=(r=t.effect)==null?void 0:r.target;return!(n instanceof Element)||t.playState!=="running"||((a=t.effect)==null?void 0:a.getTiming().iterations)===Number.POSITIVE_INFINITY?!1:e.some(i=>n.contains(i))})}const er=e=>e.kind==="question"?`q:${e.question.id}`:`${e.kind}:${e.id}`,jf=320,Ov=180,FQ=28,_Q=700;function sm(e){const t=e.split(/(\s+)/).filter(a=>a.length>0),n=t.filter(a=>!/^\s+$/.test(a)).length,r=Math.min(FQ,Math.floor(_Q/Math.max(1,n)));return{words:t,step:r,total:jf+Ov+r*n+160}}function Wg(e,t){return e.every(n=>!!t[n.id])}function ZQ(e,t,n={}){const r=e.trim().toLowerCase();if(!r||r.split(/\s+/).length>6)return null;for(const i of t){const l=i.label.toLowerCase();if(r===l||r===i.id.toLowerCase())return i.id}for(const i of t){const l=n[i.id];if(l!=null&&l.test(r))return i.id}return null}function VQ(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const zQ=/^(hi|hello|hey|heya|hiya|yo|hola|shalom|sup|good (morning|afternoon|evening)|thanks|thank you|thx|cheers)\b/i,BQ=/^(ok|okay|k|kk|sure|fine|yes|yeah|yep|yup|no|nope|nah|cool|nice|great|alright|right|hmm+|hm+|uh+|um+|oh|ah|wow|haha+|hehe+|lol|lmao|omg|meh|really|seriously|interesting|whatever)[\s!.,?]*$/i,UQ=/^(how|what|what's|whats|who|who's|whos|why|where|when|which|can|could|do|does|did|are|is|will|would|should|may|have|has|am|isn't|aren't|don't|doesn't)\b/i,WQ=/^(start over|start again|restart|reset|cancel|stop|quit|exit|go back|back|undo|never ?mind|forget it|close)\b/i,KQ=/^(skip|next|continue|go|go on|proceed|generate|draw|render|build|show me|show|try|do it|let'?s go|begin|start)\b/i,hk=/^(help|help me|how does this work|what do i do|what should i (write|say|type)|instructions|\?+)[\s!.,?]*$/i,GQ=/\b(presenters?|avatars?|characters?|Scenri|create|creating|generate|generating|images?|pictures?|shoot|campaign|brand|product)\b/i,YQ=/^(test|testing|blah|lorem|ipsum|foo|bar|baz|dummy|sample|placeholder|xxx+|abc|asdf\w*|qwer\w*|zxcv\w*|hjkl|jkl|sdfg?|dfgh?|fghj?|bull\w*|shit\w*|crap|fuck\w*|damn|wtf|stfu|bs|rofl|lol+|lmao+|haha\w*|hehe\w*|meh|idk|nvm)$/i,qQ=/^[b-df-hj-np-tv-xz]{3,}$/i,XQ=/(.)\1{3,}/,QQ=/\b(like|as|resembling|resembles|similar to|looks? like|looking like)\s+([A-Z][a-z]+)(?:\s+[A-Z][a-z]+)*\b/,JQ=/^(mediterranean|asian|east|south|southeast|indian|chinese|japanese|korean|african|black|white|nordic|scandinavian|latin|latina|latino|hispanic|arab|arabic|middle|eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipino|filipina|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|west|north|central)$/i;function Vo(e,t){const n=e.trim();if(!n)return null;const r=QQ.exec(n);if(r&&!JQ.test(r[2]))return"likeness";if(t(n))return null;if(!new RegExp("\\p{L}","u").test(n))return hk.test(n)?"help":"nonsense";const a=n.split(/\s+/).filter(Boolean),i=a.length;if(hk.test(n))return"help";if(zQ.test(n)&&i<=4)return"greeting";if(BQ.test(n))return"ack";const l=u=>u.replace(/[^a-z]/gi,"");return i<=8&&a.some(u=>YQ.test(l(u))||qQ.test(l(u))||XQ.test(l(u)||u))?"nonsense":UQ.test(n)||/\?\s*$/.test(n)?"question":WQ.test(n)&&i<=4?"nav":GQ.test(n)&&i<=10?"intent":KQ.test(n)&&i<=4?"go":i===1&&/^[A-Z][a-z]+$/.test(n)?null:i<=2?"vague":null}const eJ=e=>`aside-said-${e}`,pk=e=>e.startsWith("aside-said-")?e.slice(11):null,ri=(e,t=!1,n=!1)=>[...n?[]:[{kind:"you",id:eJ(e.at),text:e.said,editable:!0,editing:t||void 0}],{kind:"scenri",id:`aside-reply-${e.at}${e.rev?`-${e.rev}`:""}`,text:e.reply}],Uh=e=>(e.kind==="you"||e.kind==="scenri")&&e.id.startsWith("aside-");function MN(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question.id;if(!Uh(n))return null}return null}const Wh=()=>new Date().toISOString();function tJ({options:e,picked:t,onPick:n}){return o.jsx("div",{className:"sc-convo-grid",children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}function nJ({step:e,children:t}){const n=s.useRef(null),[r,a]=s.useState({back:!1,on:!0}),i=s.useCallback(()=>{const h=n.current;if(!h)return;const p=h.scrollWidth-h.clientWidth;a({back:h.scrollLeft>2,on:h.scrollLeft<p-2})},[]);s.useEffect(()=>{const h=n.current;if(!h)return;i(),h.addEventListener("scroll",i,{passive:!0});const p=new ResizeObserver(i);return p.observe(h),()=>{h.removeEventListener("scroll",i),p.disconnect()}},[i]);const l=h=>{const p=n.current;if(!p)return;const g=p.firstElementChild,v=Number.parseFloat(getComputedStyle(p).columnGap)||0,w=g?g.offsetWidth+v:e,y=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;p.scrollBy({left:h*w,behavior:y?"smooth":"auto"})},u=r.back&&r.on?"both":r.back?"back":r.on?"on":void 0,f=r.back||r.on;return o.jsxs("div",{className:"sc-convo-strip","data-fade":u,children:[f&&o.jsx(mk,{dir:-1,live:r.back,onGo:l}),o.jsx("div",{className:"sc-convo-plates",ref:n,children:t}),f&&o.jsx(mk,{dir:1,live:r.on,onGo:l})]})}function mk({dir:e,live:t,onGo:n}){const r=e<0;return o.jsx("button",{type:"button",className:"sc-convo-strip-go","data-dir":r?"back":"on","data-spent":!t||void 0,"aria-label":r?"Show earlier":"Show more","aria-disabled":!t||void 0,tabIndex:-1,onClick:a=>{a.currentTarget.blur(),t&&n(e)},children:r?o.jsx(ga,{size:14,weight:"bold"}):o.jsx(ol,{size:14,weight:"bold"})})}const rJ=106;function gk({options:e,picked:t,onPick:n}){return o.jsx(nJ,{step:rJ,children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}const RN=6e4,sJ=60*RN,Kg=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),aJ=e=>e.toLocaleDateString([],{day:"numeric",month:"short"});function oJ(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((r-n)/864e5)}function iJ(e,t=Date.now()){const n=Math.max(0,t-e);if(n<45e3)return"just now";if(n<sJ)return`${Math.max(1,Math.round(n/RN))} min ago`;const r=new Date(e),a=oJ(r,new Date(t));return a===0?Kg(r):a===1?`Yesterday ${Kg(r)}`:`${aJ(r)} ${Kg(r)}`}const lJ=e=>new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"});function cJ({text:e,tone:t,at:n,now:r,reveal:a,eyebrow:i=!0,delay:l=0,leave:u,turnId:f,dim:h,thumb:p,label:g,view:v,current:w,restore:y,onRestore:x,retry:k,onRetry:S,onShow:E}){const[j]=s.useState(l),N=Fv(u,j),{playing:P,thinking:$}=DN(a,e,j,N==="true");return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"scenri","data-arrive":P||void 0,"data-leave":N,"data-turn":f,"data-dim":h||void 0,style:P?{...PN(j),"--sc-convo-after":`${sm(e).total}ms`}:void 0,children:[i&&o.jsx(Iv,{thinking:$,at:n,now:r}),o.jsxs("p",{className:"sc-convo-say","data-tone":t,"data-reveal":P||void 0,children:[$&&o.jsx(TN,{}),o.jsx($N,{text:e,playing:P})]}),p&&o.jsxs("span",{className:"sc-convo-shot","data-reveal":P||void 0,"data-current":w||void 0,children:[v&&E?o.jsx("button",{type:"button",className:"sc-convo-shot-pick","aria-label":g?`Show ${g} on the stage`:"Show this on the stage",onClick:()=>E(v),children:o.jsx(vk,{thumb:p,label:g,current:w})}):o.jsx(vk,{thumb:p,label:g,current:w}),y&&x?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>x(y.view,y.hash),children:"Put back"}):k&&S?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>S(k),children:"Try again"}):w&&o.jsx("span",{className:"sc-convo-shot-do",children:"Active"})]})]})}const PN=e=>({"--sc-convo-start":`${e}ms`,"--sc-convo-think":`${jf}ms`});function Iv({thinking:e,at:t,now:n}){return o.jsxs("span",{className:"sc-convo-who","data-thinking":e||void 0,children:[o.jsx(cY,{className:"sc-convo-mark"}),"Scenri",t?o.jsx(LN,{at:t,now:n}):null]})}function LN({at:e,now:t}){return o.jsx("time",{className:"sc-convo-time",dateTime:new Date(e).toISOString(),title:lJ(e),children:iJ(e,t)})}function uJ({what:e="Thinking"}){return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-working":"true",children:[o.jsx(Iv,{thinking:!0}),o.jsx("p",{className:"sc-convo-say",role:"status",children:o.jsxs("span",{className:"sc-convo-work",children:[e,o.jsx(dJ,{})]})})]})}function dJ(){return o.jsxs("span",{className:"sc-convo-ell","aria-hidden":"true",children:[o.jsx("i",{children:"."}),o.jsx("i",{children:"."}),o.jsx("i",{children:"."})]})}function TN(){return o.jsxs("span",{className:"sc-convo-dots","aria-hidden":"true",children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]})}function $N({text:e,playing:t}){if(!t)return o.jsx(o.Fragment,{children:e});const{words:n,step:r}=sm(e);let a=0,i=0;return o.jsx(o.Fragment,{children:n.map(l=>{const u=i;if(i+=l.length,/^\s+$/.test(l))return l;const f=a++;return o.jsx("span",{className:"sc-convo-w",style:{"--sc-convo-word-delay":`${f*r}ms`},children:l},`${u}:${l}`)})})}function DN(e,t,n=0,r=!1){const[a,i]=s.useState(!!e),[l,u]=s.useState(!!e),f=s.useRef(!!e);return s.useEffect(()=>{e&&!f.current&&(i(!0),u(!0)),f.current=!!e},[e]),s.useEffect(()=>{if(!a)return;const h=setTimeout(()=>{u(!1),i(!1)},n+sm(t).total),p=setTimeout(()=>u(!1),n+jf);return()=>{clearTimeout(h),clearTimeout(p)}},[a,t,n]),{playing:a&&!r,thinking:a&&l&&!r}}function Fv(e,t,n=jf+Ov){const r=s.useRef(performance.now());if(e)return performance.now()-r.current<t+n?"early":"true"}function vk({thumb:e,label:t,current:n}){return o.jsx("img",{src:dn(e,"micro"),srcSet:`${dn(e,"micro")} 160w, ${dn(e,"small")} 320w, ${dn(e,"tile")} 640w`,sizes:"(max-width: 767px) 248px, 128px",alt:n&&t?`${t}, active`:t??""})}const fJ=300,hJ=e=>typeof e=="string"?e:null,pJ=e=>Array.isArray(e)?e:[],mJ=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};function gJ({question:e,reveal:t,busy:n,eyebrow:r=!0,delay:a=0,leave:i,spent:l,turnId:u,dim:f,at:h,now:p,onAnswer:g,onPick:v,onStarter:w,onDescribe:y,onAttachFiles:x,onCancel:k}){var Q,xe,ee,ae,re;const[S]=s.useState(a),E=Fv(i,S),{playing:j,thinking:N}=DN(t,e.prompt,S,E==="true"),P="given"in e?e.given:void 0,[$,M]=s.useState(()=>mJ(P)),[C,R]=s.useState(null),[T,H]=s.useState(()=>new Set(pJ(P))),D=!!l||!!n,K=s.useRef(!1);s.useEffect(()=>{K.current&&!D&&R(null),K.current=D},[D]);const O=(_,ue)=>{C||(R(_),v==null||v(e.id,{picked:_,picks:$}),g(ue))},Z=C??hJ(P),te=s.useRef(null),B=s.useRef(null),F=s.useRef(()=>{});F.current=()=>{e.kind==="pick"&&e.more&&!e.loading&&g({kind:"pick",action:{type:"more"}})};const X=e.kind==="pick"?e.items.length:0,z=e.kind==="pick"&&!!e.more;s.useEffect(()=>{const _=B.current,ue=te.current;if(!_||!ue||!z||typeof IntersectionObserver>"u")return;const We=new IntersectionObserver(Xe=>Xe.some(ze=>ze.isIntersecting)&&F.current(),{root:ue,rootMargin:"0px 0px 240px 0px"});return We.observe(_),()=>We.disconnect()},[X,z]);const I=X>0;s.useLayoutEffect(()=>{const _=te.current;if(!_||!I||typeof ResizeObserver>"u")return;const ue=()=>{const Xe=_.querySelector(".sc-convo-plate");Xe&&_.style.setProperty("--sc-pick-row",`${Xe.getBoundingClientRect().height}px`)};ue();const We=new ResizeObserver(ue);return We.observe(_),()=>We.disconnect()},[I]);const U=e.kind==="pick"?(Q=e.search)==null?void 0:Q.value:void 0;s.useEffect(()=>{te.current&&(te.current.scrollTop=0)},[U]);const G=sm(e.prompt),ne=`sc-convo-q-${e.id}`,q=s.useRef(null),le=e.reopened&&k&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost sc-convo-cancel",onClick:k,children:"Cancel"}),Se="attach"in e&&e.attach&&x&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass",onClick:()=>{var _;return(_=q.current)==null?void 0:_.click()},children:[o.jsx(YU,{size:14,weight:"bold"}),e.attach]}),o.jsx("input",{ref:q,type:"file",accept:"image/*",hidden:!0,"aria-label":e.attach,onChange:_=>{const ue=Array.from(_.target.files??[]).filter(We=>We.type.startsWith("image/"));_.target.value="",ue.length&&x(ue)}})]});return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-arrive":j||void 0,"data-leave":E,"data-turn":u,"data-dim":f||void 0,"data-reopened":e.reopened||void 0,style:j?{...PN(S),"--sc-convo-after":`${G.total}ms`}:void 0,children:[!e.reopened&&r&&o.jsx(Iv,{thinking:N,at:h,now:p}),!e.reopened&&o.jsxs("p",{className:"sc-convo-say",id:ne,"data-tone":e.tone,"data-reveal":j||void 0,children:[N&&o.jsx(TN,{}),o.jsx($N,{text:e.prompt,playing:j})]}),e.reopened&&o.jsx("span",{id:ne,hidden:!0,children:e.prompt}),!e.reopened&&e.hint&&o.jsx("p",{className:"sc-convo-hint","data-reveal":j||void 0,children:e.hint}),o.jsxs("fieldset",{className:"sc-convo-q","aria-labelledby":ne,hidden:e.kind==="text"&&!((xe=e.starters)!=null&&xe.length)&&!e.cost&&!e.note?!0:void 0,tabIndex:-1,"data-kind":e.kind,"data-reveal":j||void 0,"data-picked":!!C||void 0,disabled:n||void 0,children:[e.starters&&e.starters.length>0&&o.jsx("div",{className:"sc-convo-starters",children:e.starters.map(_=>o.jsx(lr,{label:_.text,children:o.jsx("button",{type:"button",className:"sc-convo-starter",onClick:()=>w==null?void 0:w(_.text),children:_.label})},_.text))}),e.kind==="choice"&&((ee=e.options)==null?void 0:ee.some(_=>_.card))&&o.jsx(gk,{options:e.options,picked:Z,onPick:_=>O(_,{kind:"choice",id:_})}),e.kind==="choice"&&e.options&&!e.groups&&!e.options.some(_=>_.card)&&o.jsx("div",{className:"sc-convo-choices sc-convo-ask","data-guide-shape":"",children:e.options.map(_=>o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice","aria-pressed":e.multi?T.has(_.id):void 0,"data-on":(e.multi?T.has(_.id):Z===_.id)||void 0,onClick:()=>e.multi?H(ue=>{const We=new Set(ue);return We.delete(_.id)||We.add(_.id),We}):O(_.id,{kind:"choice",id:_.id}),children:_.label},_.id))}),e.kind==="choice"&&(e.describe||e.attach||e.skip)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&!e.multi&&!e.groups&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),Se,!e.multi&&le]}),e.kind==="choice"&&!e.groups&&!e.multi&&!e.describe&&!e.attach&&le&&o.jsx("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:le}),e.kind==="choice"&&e.multi&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-on":C==="submit"||void 0,onClick:()=>O("submit",{kind:"choices",picks:Object.fromEntries([...T].map(_=>[_,"on"]))}),children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),le]}),e.kind==="choice"&&e.groups&&o.jsxs("div",{className:"sc-convo-groups",children:[e.groups.map(_=>o.jsxs("div",{className:"sc-convo-group",children:[o.jsx("span",{className:"sc-convo-group-lb",id:`sc-convo-g-${e.id}-${_.id}`,children:_.label}),o.jsx(_o,{label:_.label,value:$[_.id]??"",ids:_.options.map(ue=>ue.id),onChange:ue=>M(We=>({...We,[_.id]:ue})),className:"sc-convo-choices",children:_.options.map(ue=>o.jsx(Zo,{id:ue.id,on:$[_.id]===ue.id,label:ue.label,className:"sc-chip sc-convo-choice",onPick:()=>M(We=>({...We,[_.id]:ue.id})),children:ue.label},ue.id))})]},_.id)),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!Wg(e.groups,$)||void 0,title:Wg(e.groups,$)?void 0:"Pick one in each row, or skip.","data-on":C==="submit"||void 0,onClick:()=>{Wg(e.groups??[],$)&&O("submit",{kind:"choices",picks:$})},children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),le]})]}),e.kind==="swatches"&&o.jsxs("div",{className:"sc-convo-look",children:[e.row.options.some(_=>_.card)?e.layout==="grid"?o.jsx(tJ,{options:e.row.options,picked:Z,onPick:_=>O(_,{kind:"swatches",picks:{[e.row.id]:_}})}):o.jsx(gk,{options:e.row.options,picked:Z,onPick:_=>O(_,{kind:"swatches",picks:{[e.row.id]:_}})}):o.jsx("div",{className:"sc-convo-swatches",children:e.row.options.map(_=>o.jsx(lr,{label:_.label,children:o.jsx("button",{type:"button",className:_.color?"sc-convo-swatch":"sc-chip sc-convo-choice",style:_.color?{"--sc-swatch":_.color}:void 0,"aria-label":_.label,"aria-pressed":Z===_.id,"data-on":Z===_.id||void 0,onClick:()=>O(_.id,{kind:"swatches",picks:{[e.row.id]:_.id}}),children:_.color?null:_.label})},_.id))}),(e.skip||e.describe||le)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":C==="skip"||!C&&e.skipped,"data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>O("skip",{kind:"skip"}),children:e.skip}),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),le]})]}),e.kind==="photos"&&o.jsxs("div",{className:"sc-convo-photos-q",children:[o.jsx(DA,{hashes:e.hashes,max:e.max,label:((ae=e.drop)==null?void 0:ae.label)??"Add a photo of their face",hint:((re=e.drop)==null?void 0:re.hint)??"Drop it here, or choose a file",busy:e.busy,onAdd:_=>g({kind:"photos",action:{type:"add",files:_}}),onRemove:_=>g({kind:"photos",action:{type:"remove",hash:_}}),onReject:()=>g({kind:"photos",action:{type:"reject"}})}),e.instead&&o.jsx("button",{type:"button",className:"sc-convo-other","data-on":C==="instead"||void 0,"data-waiting":e.insteadWaiting||void 0,"aria-hidden":e.insteadWaiting||void 0,tabIndex:e.insteadWaiting?-1:void 0,disabled:e.insteadWaiting||void 0,onClick:()=>O("instead",{kind:"photos",action:{type:"instead"}}),children:e.instead}),e.attest&&o.jsxs("label",{className:"sc-convo-attest",children:[o.jsx("input",{type:"checkbox",checked:e.attest.checked,onChange:_=>g({kind:"photos",action:{type:"attest",checked:_.target.checked}})}),o.jsx("span",{children:e.attest.text})]}),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!!Gg(e)||void 0,title:Gg(e)??void 0,"data-on":C==="submit"||void 0,onClick:()=>{Gg(e)||O("submit",{kind:"photos",action:{type:"submit"}})},children:e.submit}),e.back&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="back"||void 0,onClick:()=>O("back",{kind:"photos",action:{type:"back"}}),children:e.back}),le]})]}),e.kind==="pick"&&o.jsxs("div",{className:"sc-convo-pick",children:[e.search&&o.jsx("input",{type:"search",className:"sc-convo-pick-q",value:e.search.value,placeholder:e.search.label,"aria-label":e.search.label,onChange:_=>g({kind:"pick",action:{type:"query",text:_.target.value}}),onKeyDown:_=>{var ue;_.key!=="Escape"||!((ue=e.search)!=null&&ue.value)||(_.preventDefault(),g({kind:"pick",action:{type:"query",text:""}}))}}),o.jsxs("fieldset",{ref:te,className:"sc-convo-pick-scroll","aria-labelledby":ne,"aria-busy":e.loading||void 0,children:[e.items.length===0&&e.loading&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid","aria-hidden":!0,children:Array.from({length:8},(_,ue)=>o.jsx("span",{className:"sc-convo-plate sc-convo-pick-wait",children:o.jsx("span",{className:"sc-convo-plate-in"})},ue))}),e.items.length>0&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid",children:e.items.map(_=>o.jsx("button",{type:"button",className:"sc-convo-plate","aria-label":_.alt,"aria-pressed":Z===_.id,"data-on":Z===_.id||void 0,onClick:()=>O(_.id,{kind:"pick",action:{type:"pick",id:_.id}}),children:o.jsx("span",{className:"sc-convo-plate-in",style:{backgroundImage:`url("${dn(_.hash,"small")}")`}})},_.id))}),e.items.length===0&&!e.loading&&e.empty&&o.jsx("p",{className:"sc-convo-pick-empty",children:e.empty}),e.more&&o.jsx("div",{ref:B,className:"sc-convo-pick-end","aria-hidden":!0})]}),o.jsx("p",{className:"sc-vh",role:"status",children:e.loading?"":e.status??""}),(e.back||le)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.back&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":C==="back"||void 0,onClick:()=>O("back",{kind:"pick",action:{type:"back"}}),children:e.back}),le]})]}),e.kind==="confirm"&&e.quote&&o.jsx(vJ,{text:e.quote,label:e.quoteLabel}),e.kind==="confirm"&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[e.options.map((_,ue)=>o.jsx("button",{type:"button",className:`sc-btn ${ue===0&&!e.quiet?"sc-btn-primary":"sc-btn-ghost"}`,"data-on":C===_.id||void 0,onClick:()=>O(_.id,{kind:"confirm",id:_.id}),children:_.label},_.id)),e.describe&&y&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:y,children:e.describe}),Se,le]}),e.cost&&o.jsx("p",{className:"sc-convo-note","data-cost":!0,children:e.cost}),e.note&&o.jsx("p",{className:"sc-convo-note",children:e.note})]})]})}function vJ({text:e,label:t="The brief"}){const[n,r]=s.useState(!1);return s.useEffect(()=>{if(!n)return;const a=setTimeout(()=>r(!1),1600);return()=>clearTimeout(a)},[n]),o.jsxs("figure",{className:"sc-convo-brief",children:[o.jsxs("figcaption",{className:"sc-convo-brief-head",children:[o.jsx("span",{className:"sc-convo-brief-lb",children:t}),o.jsxs("button",{type:"button",className:"sc-convo-brief-copy","data-took":n||void 0,onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e).then(()=>r(!0),()=>{})},children:[n?o.jsx(Kn,{size:13,weight:"bold"}):o.jsx(Lh,{size:13,weight:"bold"}),n?"Copied":"Copy"]})]}),o.jsx("p",{className:"sc-convo-brief-text",children:e})]})}function Gg(e){return e.busy?"Still uploading.":e.hashes.length===0?"Add at least one photo.":e.attest&&!e.attest.checked?"Confirm you have permission to use their likeness.":null}function wJ({text:e,photos:t,at:n,now:r,editable:a,editing:i,arrive:l,leave:u,delay:f=0,turnId:h,dim:p,onEdit:g,onSave:v,onCancel:w}){const[y]=s.useState(!!l),[x]=s.useState(f),k=Fv(u,y?x:0,y?240:0);return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"you","data-arrive":y||void 0,"data-leave":k,"data-turn":h,"data-dim":p||void 0,style:y?{"--sc-convo-start":`${x}ms`}:void 0,children:[n?o.jsx(LN,{at:n,now:r}):null,i&&v&&w?o.jsx(yJ,{text:e,onSave:v,onCancel:w}):o.jsxs("div",{className:"sc-convo-bubble",children:[a&&g&&o.jsx(lr,{label:"Change this answer",children:o.jsx("button",{type:"button",className:"sc-convo-edit","aria-label":"Change this answer",onClick:g,children:o.jsx(Ju,{size:13})})}),o.jsx("p",{children:e}),t&&t.length>0&&o.jsx("div",{className:"sc-convo-photos",children:t.map((S,E)=>o.jsx("img",{src:dn(S,"micro"),alt:`Yours, ${E+1} of ${t.length}`},S))})]})]})}function yJ({text:e,onSave:t,onCancel:n}){const[r,a]=s.useState(e),i=s.useRef(null);s.useEffect(()=>{const u=i.current;u&&(u.focus(),u.setSelectionRange(u.value.length,u.value.length))},[]);const l=()=>{const u=r.trim();u&&t(u)};return o.jsxs("div",{className:"sc-convo-bubble","data-editing":"true",children:[o.jsx("textarea",{ref:i,className:"sc-convo-rewrite","aria-label":"Your answer",rows:Math.min(6,Math.max(1,r.split(`
103
- `).length)),value:r,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),n()),u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l())}}),o.jsxs("div",{className:"sc-convo-rewrite-do",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!r.trim()||void 0,onClick:l,children:"Save"})]})]})}const bJ=180,wk=3e3,HN=460,xJ="cubic-bezier(0.22, 1, 0.36, 1)",kJ=220,SJ=450,EJ=48;function CJ({turns:e,busy:t,working:n,memoryKey:r,resumed:a,onAnswer:i,onEdit:l,onSaveEdit:u,onCancelEdit:f,onStarter:h,onDescribe:p,onAttachFiles:g,onRestore:v,onRetry:w,onShow:y}){var Pe;const x=s.useRef(null),k=s.useRef(!0),S=s.useRef(!!a),E=s.useRef(performance.now());S.current&&performance.now()-E.current>wk&&(S.current=!1),s.useEffect(()=>{if(!S.current)return;const de=()=>{S.current=!1},je=window.setTimeout(de,wk);return window.addEventListener("pointerdown",de,{capture:!0}),window.addEventListener("keydown",de,{capture:!0}),()=>{window.clearTimeout(je),window.removeEventListener("pointerdown",de,{capture:!0}),window.removeEventListener("keydown",de,{capture:!0})}},[]);const j=VQ(),N=s.useRef(e),P=s.useRef(null),$=s.useRef(null),M=s.useRef(null),C=s.useRef(null),R=s.useRef(null),T=s.useRef([]),[,H]=s.useState(0),D=s.useRef(new Map),K=s.useRef(0),O=performance.now(),Z=s.useRef(!1),te=NJ(e);if(te!==P.current){P.current=te,Z.current=!0;const de=C.current&&O<C.current.until?C.current:null,je=de?yk(N.current,de):N.current,Ue=new Set(e.map(er)),ye=xk(e),Ee=xk(je),be=Le=>Le.startsWith("you:")&&ye.has(K1(Le))||Le.startsWith("q:")&&Ee.has(Le)&&Ue.has(K1(Le));if(T.current=je.map(er).filter(Le=>!Ue.has(Le)&&!be(Le)),ye.size&&!Ee.size){const Le=K1([...ye][0]),Qe=je.find(Ke=>er(Ke)===Le);M.current=(Qe==null?void 0:Qe.kind)==="you"?{key:Le,text:Qe.text}:null}if(Ee.size>0&&ye.size===0){const Le=M.current;M.current=null;const Qe=Le?e.find(gt=>er(gt)===Le.key):void 0,Ke=!!Le&&((Qe==null?void 0:Qe.kind)!=="you"||Qe.text!==Le.text),nt=e[e.length-1];$.current=Ke&&(nt==null?void 0:nt.kind)==="question"?er(nt):null}if(!j&&T.current.length){const Le=T.current.some(nt=>!(de!=null&&de.gone.has(nt))),Qe=de!=null&&de.look&&T.current.includes(`q:${de.look.qid}`)?de.look:null,Ke=R.current??Qe;C.current={from:je,gone:new Set(T.current),look:Ke,until:Le?O+(R.current?fJ:bJ):(de==null?void 0:de.until)??O}}else C.current=null;R.current=null,N.current=e}const B=C.current&&O<C.current.until?C.current:null;B||(C.current=null),s.useEffect(()=>{if(!B)return;const de=window.setTimeout(()=>H(je=>je+1),Math.max(0,B.until-performance.now()));return()=>window.clearTimeout(de)},[B]);const F=(de,je)=>{R.current={qid:de,look:je}},X=B?yk(e,B):e,z=s.useRef(null);if(z.current===null){const de=r?PJ(r):null;z.current=de??new Set(a||e.length>2?e.map(er):[])}const I=s.useRef(null);I.current===null&&(I.current=(r?MJ(r):null)??new Map);const[U,G]=s.useState(()=>Date.now()),ne=Math.max(0,...I.current.values()),q=U-ne<36e5;s.useEffect(()=>{if(!q)return;const de=window.setInterval(()=>G(Date.now()),3e4);return()=>window.clearInterval(de)},[q]),$.current&&(z.current.delete($.current),$.current=null);const le=new Set;for(const de of X){const je=er(de);de.kind==="question"&&de.question.reopened||z.current.has(je)||le.add(je)}if(a&&S.current&&le.size){for(const de of le)z.current.add(de);le.clear()}const Se=[];let Q=Number.POSITIVE_INFINITY;{const de=new Set(X.map(er));for(const je of[...D.current.keys()])de.has(je)||D.current.delete(je);for(const je of X){const Ue=er(je);if(!le.has(Ue)){Se.push(je);continue}let ye=D.current.get(Ue);if(ye===void 0){const Ee=je.kind==="you"||je.kind==="scenri"&&!!je.quiet;ye=Math.max(O,Ee?0:K.current,(B==null?void 0:B.until)??0),D.current.set(Ue,ye),K.current=Math.max(K.current,ye+(Ee?kJ:jf+Ov))}ye<=O?Se.push(je):Q=Math.min(Q,ye-O)}}s.useEffect(()=>{if(Q===Number.POSITIVE_INFINITY)return;const de=window.setTimeout(()=>H(je=>je+1),Q);return()=>window.clearTimeout(de)},[Q]),s.useEffect(()=>{const de=z.current;if(de){for(const je of T.current)de.delete(je);for(const je of Se){if(je.kind==="question"&&je.question.reopened)continue;const Ue=er(je);B!=null&&B.gone.has(Ue)||de.add(Ue)}r&&LJ(r,de),r&&I.current&&RJ(r,I.current)}});const xe=s.useRef(null),ee=s.useCallback(()=>{const de=x.current;if(!de)return null;const je=xe.current;return je!=null&&je.isConnected&&je.scrollHeight>je.clientHeight?je:(xe.current=P6(de),xe.current)},[]);s.useEffect(()=>{const de=()=>{const je=ee();je&&(k.current=je.scrollHeight-je.scrollTop-je.clientHeight<24)};return document.addEventListener("scroll",de,{passive:!0,capture:!0}),()=>document.removeEventListener("scroll",de,{capture:!0})},[ee]);const ae=(()=>{const de=e.find(Ue=>Ue.kind==="question"&&Ue.question.reopened);if(de)return er(de);const je=e.find(Ue=>Ue.kind==="you"&&Ue.editing);return je?er(je):null})();s.useLayoutEffect(()=>{var Ue;if(!k.current||ae)return;const de=document.activeElement;if(de instanceof HTMLInputElement&&de.type==="search"&&((Ue=x.current)!=null&&Ue.contains(de)))return;const je=ee();je&&(je.scrollTop=je.scrollHeight)});const re=s.useRef(null);s.useLayoutEffect(()=>{var be,Le,Qe,Ke;if(ae===re.current)return;const de=re.current;re.current=ae;const je=x.current;if(!je)return;const Ue=document.activeElement;if(!(!Ue||Ue===document.body||je.contains(Ue)))return;if(ae){if(k.current=!1,ae.startsWith("you:"))return;(Le=(be=Wd(je,ae))==null?void 0:be.querySelector(".sc-convo-q"))==null||Le.focus({preventScroll:!0});return}if(!de)return;const Ee=de.startsWith("q:")?K1(de):de;(Ke=(Qe=Wd(je,Ee))==null?void 0:Qe.querySelector(".sc-convo-edit"))==null||Ke.focus({preventScroll:!0})}),s.useEffect(()=>{if(!ae)return;const de=window.setTimeout(()=>{const je=Wd(x.current,ae),Ue=x.current&&P6(x.current);if(!je||!Ue)return;const ye=je.getBoundingClientRect(),Ee=Ue.getBoundingClientRect();ye.bottom-Ee.bottom>EJ&&bk(je,j)},HN);return()=>window.clearTimeout(de)},[ae,j]);const _=e.length&&e[e.length-1].kind==="question"?er(e[e.length-1]):null,ue=s.useRef(_);s.useLayoutEffect(()=>{var be,Le;const de=x.current;if(ae||!de||_===ue.current)return;const je=document.activeElement,Ue=(be=je==null?void 0:je.closest(".sc-convo-turn"))==null?void 0:be.getAttribute("data-turn"),ye=!je||je===document.body||je!==de&&je.contains(de)||!!Ue&&Ue.startsWith("q:")&&Ue!==_;if(!_||!ye){ue.current=_;return}const Ee=(Le=Wd(de,_))==null?void 0:Le.querySelector(".sc-convo-q:not([hidden])");Ee&&(ue.current=_,Ee.focus({preventScroll:!0}))});const We=s.useRef(_),Xe=s.useRef(null);s.useEffect(()=>{if(_===We.current)return;if(!_){ae&&(Xe.current=We.current),We.current=null;return}const de=Wd(x.current,_);if(!de)return;We.current=_;const je=Xe.current!==null,Ue=Xe.current===_;if(Xe.current=null,k.current||je&&Ue)return;const ye=()=>{AJ(de,x.current)||bk(de,j)};if(!je){ye();return}const Ee=window.setTimeout(ye,SJ);return()=>window.clearTimeout(Ee)},[_,ae,j]);const ze=s.useRef(new Map);s.useLayoutEffect(()=>{const de=x.current;if(!de)return;const je=new Map,Ue=Z.current;Z.current=!1;for(const ye of de.querySelectorAll(".sc-convo-turn")){const Ee=ye.dataset.turn??"",be=ye.offsetTop;je.set(Ee,be);const Le=ze.current.get(Ee);!Ue||j||Le===void 0||Math.abs(Le-be)<1||jJ(ye,Le-be)}ze.current=je});const tt=new Set;if(ae){tt.add(ae);const de=ae.slice(ae.indexOf(":")+1);tt.add(`scenri:asked-${de}`);const je=Se.findIndex(Ue=>er(Ue)===ae);if(je>=0){for(let Ue=je+1;Ue<Se.length&&Uh(Se[Ue]);Ue++)tt.add(er(Se[Ue]));for(let Ue=je-1;Ue>=0&&Uh(Se[Ue]);Ue--)tt.add(er(Se[Ue]))}}for(const de of Se){const je=er(de);I.current.has(je)||I.current.set(je,Date.now())}let ce=!1;const ve=[];for(const de of Se){const je=er(de),Ue=!!ae&&!tt.has(je),ye=I.current.get(je),Ee=!!(B!=null&&B.gone.has(je)),be=Ee&&de.kind==="question"&&((Pe=B==null?void 0:B.look)==null?void 0:Pe.qid)===de.question.id,Le=de.kind==="scenri"&&!!de.quiet,Qe=!j&&!Ee&&le.has(je)&&!Le,Ke=0,nt=ce;Ee||(ce=de.kind==="scenri"||de.kind==="question"&&!de.question.reopened),de.kind==="you"?ve.push(o.jsx(wJ,{text:de.text,photos:de.photos,editable:de.editable,editing:de.editing,arrive:Qe,leave:Ee,delay:Ke,turnId:je,dim:Ue,at:ye,now:U,onEdit:de.editable&&l?()=>l(de.id):void 0,onSave:u?gt=>u(de.id,gt):void 0,onCancel:f},je)):de.kind==="scenri"?ve.push(o.jsx(cJ,{text:de.text,tone:de.tone,reveal:Qe,leave:Ee,eyebrow:!nt,delay:Ke,turnId:je,dim:Ue,at:ye,now:U,thumb:de.thumb,label:de.label,current:de.current,restore:de.restore,onRestore:v,retry:de.retry,onRetry:w,onShow:y},je)):ve.push(o.jsx(gJ,{question:de.question,reveal:Qe,leave:Ee&&!be,spent:Ee,delay:Ke,turnId:je,dim:Ue,busy:t||Ue,eyebrow:!nt,at:ye,now:U,onAnswer:gt=>i(de.question.id,gt),onPick:F,onStarter:h,onDescribe:p,onAttachFiles:g,onCancel:f},je))}return o.jsx("div",{ref:x,className:"sc-convo-log",role:"log","aria-live":"polite","aria-relevant":"additions","data-changing":ae?"true":void 0,children:o.jsxs("div",{className:"sc-convo-turns",children:[ve,n&&o.jsx(uJ,{what:n===!0?void 0:n})]})})}function yk(e,t){const n=[],r=new Set(e.map(er));let a=0;for(const i of t.from){const l=er(i);if(t.gone.has(l)){r.has(l)||n.push(i);continue}for(;a<e.length&&er(e[a])!==l;)n.push(e[a++]);a<e.length&&n.push(e[a++])}for(;a<e.length;)n.push(e[a++]);return n}function jJ(e,t){for(const a of e.getAnimations())a.id==="slide"&&a.cancel();const n=`translateY(${t}px)`;e.style.transform=n;const r=e.animate([{transform:n},{transform:"translateY(0)"}],{duration:HN,easing:xJ,fill:"both"});r.id="slide",r.onfinish=()=>{e.style.transform="",r.cancel()}}function AJ(e,t){if(!t)return!1;const n=P6(t),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();return r.top>=a.top&&r.top<=a.bottom-24}function bk(e,t){var n;(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest",behavior:t?"auto":"smooth"})}function Wd(e,t){if(!e)return null;for(const n of e.querySelectorAll(".sc-convo-turn"))if(n.dataset.turn===t)return n;return null}function NJ(e){const t=[];for(const n of e){const r=er(n);if(n.kind==="question"){const u=n.question,f="options"in u&&Array.isArray(u.options)?u.options.map(h=>h.id).join(","):"";t.push(`${r}~${u.reopened?1:0}~${u.prompt}~${u.hint??""}~${f}`);continue}const a="photos"in n&&Array.isArray(n.photos)?n.photos.length:0,i="thumb"in n?n.thumb??"":"",l="editing"in n&&n.editing?1:0;t.push(`${r}~${n.text??""}~${i}~${a}~${l}`)}return t.join("")}function xk(e){const t=new Set;for(const n of e)n.kind==="question"&&n.question.reopened&&t.add(er(n));return t}function K1(e){return e.startsWith("you:")?`q:${e.slice(4)}`:e.startsWith("q:")?`you:${e.slice(2)}`:""}function P6(e){let t=e;for(;t;){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return e}const _v=e=>`scenri:convo-said:${e}`;function Ii(e){try{sessionStorage.removeItem(_v(e)),sessionStorage.removeItem(Zv(e))}catch{}}const Zv=e=>`scenri:convo-at:${e}`;function MJ(e){try{const t=sessionStorage.getItem(Zv(e));return t?new Map(Object.entries(JSON.parse(t))):null}catch{return null}}function RJ(e,t){try{sessionStorage.setItem(Zv(e),JSON.stringify(Object.fromEntries(t)))}catch{}}function PJ(e){try{const t=sessionStorage.getItem(_v(e));return t?new Set(JSON.parse(t)):null}catch{return null}}function LJ(e,t){try{sessionStorage.setItem(_v(e),JSON.stringify([...t]))}catch{}}function kk(e){return`${["No","One","Two","Three","Four","Five"][e]??String(e)} picture${e===1?"":"s"}`}function Sk(e){const[t,...n]=e,r=[t,...n.map(a=>a.toLowerCase())];return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]??""}const Ne={title:"Create scene",editTitle:"Edit scene",intent:"Create a scene",source:"Where are we shooting? Describe the place, or start from pictures of one.",addPictures:"Add pictures",guideMe:"Guide me",photos:"Add one to four pictures of the place. The more they share, the better it reads.",photosDrop:{label:"Add pictures of the place",hint:"Drop them here, or choose files"},fromShot:"Or start from one of your shots",fromShotAnswer:"Start from one of my shots",shot:"Which shot? I'll read the place in it and leave the product and people out.",shotSearch:"Find a shot",shotNone:"No shots to start from yet.",shotNotFound:e=>`No shot matches "${e}".`,shotsFailed:"The shots could not be read just now. Try the search again.",shotCount:(e,t)=>t?`${e} shots so far, more as you scroll`:`${e} ${e===1?"shot":"shots"}`,shotAnswer:"This shot",backToPictures:"Back to pictures",shotOff:"Choose a shot above.",madeIn:e=>`This shot was made in ${e}.`,takeScene:e=>`Use ${e}`,readNew:"Read a new scene from it",reuseOff:"Choose above.",anotherShot:"Choose another shot",stopped:"That was stopped. Nothing here was changed.",stoppedRead:"Stopped before the place was read. Read it again, or say it differently.",stoppedDraw:"Stopped. Nothing was drawn.",stoppedChange:"Stopped before the picture changed. The new words are kept: draw them, or put back the last picture.",readThem:"Read them",guideInstead:"Guide me instead",skip:"Skip",describeInstead:"Describe instead",worldHint:"Choose a starting world. You'll personalise it next.",worldLightPrompt:e=>`This world is already lit ${e}. Keep it, or choose another.`,keepWorldLight:"Keep it",keepWorldSurface:"Keep the world's own",suggestOne:"Suggest one",followWorld:"You have the feel of it. What kind of place is it?",followLight:"You have the place. What light is it in?",leaveToReading:"Leave it to the reading",worldIsAStart:"Treat this as a starting direction, not a picture to reproduce: keep the material language and the character of the light, and invent a specific original arrangement.",emptyLead:"The place appears here",emptyHint:"Describe it, or add pictures of it",sourcePlaceholder:"Describe the place, or choose above",nothingSaidPlaceholder:"Tell me where we are, in your own words",rowPlaceholder:e=>`Tap one above, or describe the ${e} in your own words`,photosOff:"Add the pictures above, then read them.",addPlaceholder:"Anything to add or leave out?",keepPlaceholder:"Anything to keep or ignore in them?",keepShotPlaceholder:"Anything to keep or ignore in it?",changePlaceholder:"Say what to change. The rest stays.",namePlaceholder:"Its name",nameIt:"Name this scene",attachLabel:"Add pictures of the place",send:"Send",lineLabel:"Your answer",change:"Change",reading:"Writing what your shots are told",readingPhotos:"Reading your pictures",changing:"Changing the words",drawing:"Drawing the scene",stillReading:"Still writing what your shots are told",readingHead:"What your shots are told",placeLabel:"The place",lightLabel:"Light",cameraLabel:"Camera",figureLabel:"Built around",agree:"Here is the place, in full. Ready to draw?",agreePhotos:"Here is the place I read in your pictures. Ready to draw?",agreeShot:"Here is the place I read in your shot. Ready to draw?",agreeChanged:"Here it is with that. Ready to draw?",agreeBlind:"Here is the place, in full. Nothing here can draw yet, so it is saved as words.",readAgain:"I read the place again.",draw:"Draw the scene",saveWords:"Save scene",here:"Here is the scene.",again:"Here it is again.",changed:"Here it is, changed.",decide:e=>`Here is ${e}. Use it, or change something.`,decideEdit:e=>`Here is ${e}. Save it, or change something.`,use:"Use this scene",saveChanges:"Save changes",tryAgain:"Try again",changeSomething:"Change something",name:"While it draws: what should we call it?",editOpen:e=>`Here is ${e}, as it is saved. Change something, or draw it again.`,failed:"That did not work. Nothing standing was touched.",failedFirst:e=>`That did not go through: ${e}. Nothing was drawn.`,lost:"That work is gone: the server restarted while it ran. Try it again.",offline:"Lost touch with Scenri. Still trying.",retry:"Try again",version:e=>`Version ${e}`,saved:"Saved.",savedQuiet:"Saved. Nothing is drawn until you ask.",showInUse:(e,t)=>`Show it in use? ${kk(t.length)} with a Scenri demo ${e} in the place: ${Sk(t.map(n=>n.toLowerCase()))}.`,staleSet:e=>`${kk(e)} here show${e===1?"s":""} the place as it was before. Draw ${e===1?"it":"them"} again?`,drawThem:"Draw them",drawThemAgain:"Draw them again",inUse:e=>`Saved. Now it is shown in use, with a Scenri demo ${e}. Shots are told the words, never handed these pictures.`,noLibrary:"Saved. Scenri's library has not downloaded yet, so it cannot be shown in use for now.",exampleHere:{hero:"Here is the hero.",close:"Here is a close-up.",hands:"Here it is in hands.",angle:"Here is another angle.",bold:"Here is a bold one."},exampleFailed:(e,t)=>`The ${e.toLowerCase()} did not draw: ${t.replace(/[.\s]+$/,"")}.`,more:e=>`Add ${["no","one","two","three"][e.length]??e.length} more? ${Sk(e)}.`,addThem:"Add them",notNow:"Not now",ready:e=>`${e} is ready.`,readyUndrawn:e=>`${e} is ready. It can be shown in use any time, from its page.`,readyMissing:e=>`${e} is ready. Some did not draw.`,openScene:"Open scene",useInAShot:"Use in a shot",notAPlace:"That did not read as a place. Try a few words about it, like 'a quiet concrete gallery at dusk'.",greet:"Hello. Describe the place, or choose above.",greetRow:"Tap one above, or say it in a few words.",askHelp:"Describe the place in a few words, or tap one above. Everything can be changed later.",goFirst:"Choose above, or describe the place first.",startOverIsUp:"Start over is at the top of this panel.",notInAScene:"A scene holds the place and its light. Add presenters and products in Create.",usePutBack:"Step back through the versions on the picture, and Put back the one you want.",sayAChange:"Say what to change about the place, and the rest stays as it is.",renamed:e=>`Called it ${e}.`,changeIt:"Change it",changeTitle:"Change this answer?",changeBody:"The picture was drawn from the answers as they are. Changing one asks again from there, and the pictures so far go. To keep the picture and change one thing, say it in the line instead.",onlyPictures:"Only pictures can show a place.",fourPictures:"Four pictures is the most a scene is read from.",leaveTitle:"Leave this scene?",leaveBody:"Nothing has been read yet, so the answers here go.",leave:"Leave",discardTitle:"Discard the changes?",discardBody:"The scene stays as it was saved. What was drawn here is let go.",discard:"Discard changes",startOver:"Start over",startOverTitle:"Start over?",startOverBody:"This conversation begins again from the first question. Nothing here is saved yet."},TJ="part of the place itself, never a separate object that competes with the subject, and leaving the subject a clear place to stand",ON={water:{surface:[{key:"basalt",label:"Wet basalt",words:"a ledge of wet black basalt, glossy where the sea has just left it"},{key:"sand",label:"White sand",words:"rippled white sand under a few centimetres of clear water"},{key:"pebbles",label:"Sea pebbles",words:"a bed of smooth sea-worn pebbles, wet and gleaming"},{key:"awash",label:"Rock awash",words:"a flat rock just awash, a thin sheet of clear water sliding over it"}],light:[{key:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface"},{key:"sunset",label:"Low sun on water",words:"low sun skimming the water, long glittering reflections"},{key:"silver",label:"Silver overcast",words:"soft silver overcast light, the sea flat and pale"},{key:"backlit",label:"Backlit spray",words:"the sun behind the surf, the spray lit up like glass"}],signature:[{key:"wave",label:"Frozen wave",words:"a wave frozen mid-break behind the rock, its crest in glassy detail"},{key:"foam",label:"Foam lace",words:"a lace of sea foam drawn across the wet rock"},{key:"kelp",label:"Kelp ribbons",words:"glossy olive-gold ribbons of kelp draped over the rocks"},{key:"pool",label:"Mirror pool",words:"a still rock pool mirroring the sky"}]},stone:{surface:[{key:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable"},{key:"limestone",label:"Rough limestone",words:"a rough-cut block of warm limestone, chisel marks in its face"},{key:"terracotta",label:"Terracotta tile",words:"sun-baked terracotta floor tiles, worn at the edges"},{key:"marble",label:"Weathered marble",words:"weathered pale marble, its polish worn soft by years of sun"}],light:[{key:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the stone"},{key:"olive",label:"Olive-leaf dapple",words:"sun broken into moving dapples through olive leaves"},{key:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across the stone, long warm shadows"},{key:"shade",label:"Cool shade",words:"the niche in open shade, cool bounced light and a bright sunlit world beyond"}],signature:[{key:"vines",label:"Vines taking over",words:"a vine growing down the stone, claiming its edges"},{key:"basin",label:"Water in the stone",words:"water trickling into a basin carved in the stone, glinting"},{key:"dust",label:"Dust in the sun",words:"fine dust hanging in one bright shaft of sun"},{key:"sphere",label:"A giant stone sphere",words:"one oversized stone sphere resting in the space, impossible in scale"}]},colour:{surface:[{key:"lacquer",label:"Glossy lacquer",words:"a glossy lacquered floor the same colour as the sweep, mirroring it"},{key:"paper",label:"Matte paper",words:"matte coloured paper, its fibres and one soft crease readable"},{key:"acrylic",label:"Frosted acrylic",words:"a sheet of frosted acrylic glowing softly with the colour behind it"},{key:"velvet",label:"Flocked velvet",words:"flocked velvet in the same colour, soaking up the light"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the colour"},{key:"split",label:"Two-colour gels",words:"two coloured gels splitting the light, one warm and one cool edge"},{key:"wrap",label:"Soft studio wrap",words:"soft wrapping studio light, a gentle gradient across the sweep"},{key:"rim",label:"Neon rim",words:"one neon rim tracing the edges, the rest of the colour dimmed"}],signature:[{key:"shapes",label:"Floating shapes",words:"a few simple geometric shapes floating in the colour, frozen in place"},{key:"planes",label:"Cut-paper planes",words:"sharp-angled planes of cut paper converging in the colour"},{key:"block",label:"Colour-block shadow",words:"a hard shadow cut into a block of a second colour"},{key:"giant",label:"Surreal scale",words:"one oversized sphere or arch in the colour, impossible in scale"}]},citrus:{surface:[{key:"halves",label:"Cut citrus",words:"a bed of halved citrus, the flesh glistening with juice"},{key:"tile",label:"Glazed tile",words:"sun-bleached glazed tiles in white and cobalt"},{key:"ice",label:"Crushed ice",words:"crushed ice melting over the fruit"},{key:"cloth",label:"Crisp linen",words:"a crisp white linen cloth spread under the fruit"}],light:[{key:"glow",label:"Sun through fruit",words:"the sun behind the fruit, the flesh glowing like stained glass"},{key:"leaves",label:"Leaf shade",words:"sun broken into dapples through citrus leaves"},{key:"golden",label:"Late golden sun",words:"late golden sun, the sky deepening, long warm shadows"},{key:"flash",label:"Hard flash",words:"hard direct flash against the blue sky, crisp and saturated"}],signature:[{key:"blossom",label:"Blossom and leaves",words:"citrus blossom and glossy leaves threaded through the fruit"},{key:"melting",label:"Ice melting",words:"ice melting over the fruit, beads of water running down"},{key:"peel",label:"Peel spirals",words:"long spirals of peel curling across the mound"},{key:"giant",label:"Giant fruit",words:"one citrus fruit at an impossible, monumental scale on the horizon"}]},volcanic:{surface:[{key:"crust",label:"Lava crust",words:"a crust of cooled black lava, ropey and cracked"},{key:"sand",label:"Black sand",words:"fine black volcanic sand, wind-rippled"},{key:"pumice",label:"Pumice",words:"porous grey pumice, sharp and light"},{key:"obsidian",label:"Obsidian",words:"a slab of glassy black obsidian with conchoidal edges"}],light:[{key:"fissures",label:"Glow from below",words:"incandescent orange fissures lighting the rock from below"},{key:"raking",label:"Sun through haze",words:"a hard low sun raking through the orange haze"},{key:"ember",label:"Ember glow",words:"a deep ember glow, everything else falling into dark"},{key:"moon",label:"Blue moonlight",words:"cold blue moonlight on the black rock, the haze gone silver"}],signature:[{key:"lava",label:"Lava still moving",words:"lava still glowing in the cracks of the crust, cooling as it goes"},{key:"ash",label:"Ash in the air",words:"fine ash drifting through the haze"},{key:"steam",label:"Steam vents",words:"white steam rising from vents in the rock"},{key:"floating",label:"Floating rocks",words:"a few rocks hanging weightless in the haze, impossible and still"}]},dark:{surface:[{key:"mirror",label:"Black mirror",words:"black mirror glass, every reflection crisp"},{key:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain"},{key:"marble",label:"Black marble",words:"polished black marble with thin white veins"},{key:"water",label:"Black water",words:"still black water, one faint ripple"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the dark"},{key:"pool",label:"Pool of light",words:"one pool of light from above, the rest falling to true black"},{key:"neon",label:"Neon edge",words:"one line of coloured neon reflected in the black surface"},{key:"rim",label:"Thin rim",words:"a thin bright rim of light along every edge, nothing else lit"}],signature:[{key:"wax",label:"Wax cascading",words:"dark wax cascading down a wall into the mirror, glossy and still setting"},{key:"ripples",label:"Ripples",words:"slow concentric ripples crossing the black surface"},{key:"smoke",label:"Smoke curl",words:"one curl of smoke drifting through the light"},{key:"sphere",label:"Floating sphere",words:"a perfect sphere floating above the mirror, impossible and still"}]},plaster:{surface:[{key:"limewash",label:"Limewash floor",words:"a limewashed plaster floor, soft and chalky"},{key:"oak",label:"Pale oak",words:"pale oak boards, their grain soft in the light"},{key:"terrazzo",label:"Terrazzo",words:"pale terrazzo with small flecks of stone"},{key:"silk",label:"Silk drape",words:"a length of silk pooling on the floor in soft folds"}],light:[{key:"shadow",label:"Window shadow",words:"hard sun through the tall window, its shape laid long across the room"},{key:"leaves",label:"Leaf shadows",words:"soft moving leaf shadows thrown across the plaster"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the plaster, long warm shadows"},{key:"dusk",label:"Blue dusk",words:"cool blue dusk in the window, the room dim and quiet"}],signature:[{key:"curtain",label:"Curtain in the wind",words:"a sheer curtain lifted into the room by the wind"},{key:"plants",label:"Plants growing in",words:"green plants growing up the plaster walls, claiming the corners"},{key:"arch",label:"Arch shadow",words:"the hard shadow of an arch cut across the wall"},{key:"stair",label:"Surreal stair",words:"a plaster stair rising into the wall and going nowhere"}]},linen:{surface:[{key:"linen",label:"Raw linen",words:"raw undyed linen, its slub weave readable"},{key:"satin",label:"Silk satin",words:"heavy silk satin in deep folds, its sheen catching the light"},{key:"boucle",label:"Wool bouclé",words:"nubbly wool bouclé, soft and textured"},{key:"paper",label:"Crumpled paper",words:"large sheets of crumpled paper folded like cloth"}],light:[{key:"leaves",label:"Leaf dapple",words:"sun broken into soft dapples through leaves"},{key:"slice",label:"Slice of sun",words:"one hard slice of sun across the folds"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the folds, deep warm shadows"},{key:"through",label:"Light through cloth",words:"light glowing through the cloth from behind"}],signature:[{key:"wind",label:"Lifted by wind",words:"the cloth lifted by a gust and frozen mid-billow"},{key:"dried",label:"Dried flowers",words:"a few dried flowers and grasses caught in the folds"},{key:"thread",label:"One red thread",words:"a single red thread running through the folds"},{key:"landscape",label:"Folds as dunes",words:"the folds made vast, like a landscape of dunes"}]}};function Vv(e,t){const n=e?ON[e]:void 0;return n?n[t].map((r,a)=>({id:`${e}-${r.key}`,label:r.label,words:r.words,card:`scene-${e}-${t}-${a+1}`})):null}function $J(e){return Object.keys(ON).flatMap(t=>Vv(t,e)??[])}const DJ=["water","stone","colour","citrus","volcanic","dark","plaster","linen"],Af=["world","surface","light","signature"],na=(e,t)=>`scene-${e}-${t}`,Xi={world:{prompt:"What world?",options:[{id:"water",label:"Rock and water",words:"a shoreline of wet dark rock and shallow turquoise water",light:"in hard midday sun",card:na("world",1),cues:["water","sea","ocean","shore","shoreline","beach","wet","pool","underwater"]},{id:"stone",label:"Sunlit stone",words:"a niche of warm limestone and rough plaster",light:"in hard afternoon sun",card:na("world",2),cues:["stone","limestone","wall","niche","arch","terracotta","mediterranean","sunlit"]},{id:"colour",label:"Colour field",words:"a seamless studio sweep in one saturated colour",light:"in flat hard poster light",card:na("world",3),cues:["studio","sweep","seamless","backdrop","colour","color","paper","poster","graphic","flat"]},{id:"citrus",label:"Fruit and sky",words:"a mound of cut citrus under an open blue sky",light:"in bright direct sun",card:na("world",4),cues:["fruit","citrus","orange","lemon","sky","outdoors","outdoor","summer","juice"]},{id:"volcanic",label:"Volcanic haze",words:"dark volcanic rock in a deep orange haze",light:"with one hard low light raking across it",card:na("world",5),cues:["volcanic","lava","rock","ash","dust","haze","smoke","desert","mars"]},{id:"dark",label:"Dark mirror",words:"a near-black polished surface like a still pool",light:"in low-key light, with one bright edge",card:na("world",6),cues:["mirror","reflection","polished","still pool"]},{id:"plaster",label:"Soft plaster",words:"a bare plaster room with one tall soft window",light:"in soft overcast daylight",card:na("world",7),cues:["plaster","concrete","microcement","minimal","interior","room","window","raw","architectural","overcast"]},{id:"linen",label:"Linen fold",words:"a length of raw undyed linen folded in soft loose drapes",light:"in soft window light",card:na("world",8),cues:["linen","fabric","textile","cloth","drape","fold","woven","cotton","soft fabric"]}]},surface:{prompt:"What is it made of, up close?",options:[{id:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable",cues:["travertine"]},{id:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain",cues:["steel","stainless","brushed metal","aluminium","aluminum"]},{id:"clay",label:"Cracked clay",words:"sun-dried terracotta clay cracked into deep fissures",cues:["clay","terracotta","cracked earth"]},{id:"silk",label:"Silk folds",words:"heavy silk gathered into deep sculptural folds",cues:["silk","satin"]},{id:"sand",label:"Wet sand",words:"rippled wet sand, glossy where the water has just drawn back",cues:["sand","wet sand"]},{id:"moss",label:"Moss and roots",words:"damp moss over exposed roots, dense and living",cues:["moss","mossy","roots"]},{id:"ice",label:"Ice",words:"clear ice with trapped bubbles and a cold blue depth",cues:["ice","icy","glacial"]},{id:"concrete",label:"Raw concrete",words:"raw board-formed concrete with timber grain printed into it",cues:["board-formed","cement"]}]},light:{prompt:"What does the light do?",options:[{id:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the place",cues:["long shadow","skylight","shaft of light","single shadow"]},{id:"dapple",label:"Dappled leaves",words:"sun broken into soft moving dapples through leaves",cues:["dappled","dapple","through leaves","leaf shadows","canopy"]},{id:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface",cues:["caustics","caustic","rippling light","underwater light"]},{id:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the set",cues:["gobo","spotlight","cut light","shaped light"]},{id:"window",label:"Soft window",words:"soft daylight from one large window, falling open and shadowless on the far side",card:na("light",7),cues:["window light","side light","from a window","sidelit","window","soft","daylight","overcast","diffused"]},{id:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across it, long warm shadows",card:na("light",2),cues:["golden","golden hour","sunset","sunrise","dusk","warm"]},{id:"neon",label:"Neon glow",words:"coloured neon streaking its light across glossy surfaces at night",card:na("light",4),cues:["neon","night","nocturnal","after dark"]},{id:"lowkey",label:"Pool of light",words:"one pool of light with a bright edge, the rest falling to true black",card:na("light",6),cues:["low key","lowkey","dramatic","shadowy","chiaroscuro","rim light"]}]},signature:{prompt:"What makes it unforgettable?",options:[{id:"air",label:"Mist, snow or wind",words:"the air of the place alive, such as mist lying low, snow drifting down or wind moving through fabric or grass: one, chosen for this place",cues:["mist","misty","fog","foggy","snow","snowing","wind","windswept","haze"]},{id:"change",label:"Caught mid-change",words:"the place's own material caught mid-change, such as wax cascading down a wall, sugar pulled glassy across the surface or ice melting at its edge: one, chosen for this place",cues:["melting","molten","dripping","wax","resin","mid-change"]},{id:"graphic",label:"Graphic light and shadow",words:"one bold graphic device of light and shadow shaping the set, such as a cut shadow or a hard slice of colour",cues:["graphic","geometric","cut shadow","colour block","color block"]},{id:"nature",label:"Nature taking over",words:"nature growing through the set, such as moss, blooms or roots claiming its edges: one, chosen for this place",cues:["overgrown","blooms","flowers","vines","growing"]},{id:"water",label:"Glass and water",words:"water and reflection in the place, such as a still reflecting pool or rain-beaded glass: one, chosen for this place",cues:["reflection","reflecting","rain","puddle","rain glass"]},{id:"scale",label:"Surreal scale",words:"one surreal touch of scale, an oversized natural or architectural form that makes the place feel impossible",cues:["surreal","giant","oversized","impossible","dreamlike"]}]}},HJ=new Set([...Xi.world.options.map(e=>e.card),...Xi.light.options.filter(e=>e.card).map(e=>e.card),...DJ.flatMap(e=>["surface","light","signature"].flatMap(t=>(Vv(e,t)??[]).map(n=>n.card)))]);function OJ(e,t){return e==="world"?Xi.world.options:Vv(t,e)??Xi[e].options}function IJ(e,t){const n=OJ(e,t),r=n.every(a=>!!a.card&&HJ.has(a.card));return{id:e,label:Xi[e].prompt,options:n.map(a=>({id:a.id,label:a.label,...r?{card:a.card}:{}}))}}const FJ={world:"place",surface:"surface",light:"light",signature:"idea"},Ek=e=>FJ[e],co=(e,t)=>{if(!t)return;const n=Xi[e].options.find(r=>r.id===t);return n||e==="world"?n:$J(e).find(r=>r.id===t)},_J="one signature idea that makes this place unforgettable, invented for it and never generic";function ZJ(e){const t=` ${e.toLowerCase().replace(/[^a-z0-9]+/g," ")} `,n={};for(const r of Af){let a=null;for(const i of Xi[r].options)for(const l of i.cues??[]){const u=` ${l.replace(/[^a-z0-9]+/g," ")} `;t.includes(u)&&(!a||l.length>a.len)&&(a={id:i.id,len:l.length})}a&&(n[r]=a.id)}return n}const VJ=["studio","cyclorama","cyc","seamless","sweep","backdrop","set","room","interior","exterior","beach","shore","shoreline","coast","sea","ocean","lake","river","water","pool","forest","woods","woodland","jungle","garden","park","field","meadow","desert","dune","dunes","mountain","mountains","cliff","cave","canyon","street","city","urban","rooftop","loft","warehouse","gallery","museum","hotel","lobby","kitchen","bathroom","bedroom","living room","cafe","café","bar","restaurant","shop","store","boutique","market","library","courtyard","terrace","balcony","corridor","hallway","tunnel","bridge","station","greenhouse","spa","chapel","ruin","ruins","architecture","landscape","outdoors","indoors","sky"],L6=["stone","rock","rocks","marble","travertine","limestone","granite","basalt","concrete","plaster","terrazzo","tile","tiles","wood","wooden","oak","walnut","linen","fabric","velvet","silk","satin","glass","metal","steel","chrome","brass","mirror","sand","moss","ferns","foliage","flowers","paper","colour field","color field","colour block","color block","pastel","brutalist","minimal","wall","walls","clay","terracotta","ice","aluminium","aluminum","stainless","leather","felt","slate","onyx","salt"],IN=["splash","splashing","mid air","frozen","falling","petals","confetti","smoke","mist","fog","steam","dust","drifting","bubbles","melting","molten","dripping","wax","resin","pouring","overgrown","blooms","flowers","vines","reflection","reflections","reflecting","rain","puddle","ripples","surreal","giant","oversized","levitating","impossible","dreamlike","cut shadow","gobo"],FN=["light","lit","lighting","flash","strobe","strobes","sun","sunny","sunlight","sunlit","sunshine","daylight","golden hour","sunset","sunrise","dusk","dawn","twilight","blue hour","night","neon","moonlight","moonlit","candle","candlelight","candlelit","lamp","lamplight","spotlight","spotlit","softbox","overcast","shadow","shadows","shadowless","backlit","backlight","rim light","glow","glowing","noon","midday","low key","high key","chiaroscuro","hard sun","window light"],_N=["plinth","pedestal","podium","platform","block","cube","table","tabletop","counter","countertop","shelf","ledge","tray","on the floor","on the ground","in hand","in hands","hand","hands","held","holding","resting","rests","floating","floats","suspended","hanging","leaning","propped","nestled","nested","half buried","emerging","balanced","stacked","scattered"],ZN=["top down","overhead","flat lay","flatlay","birds eye","bird s eye","aerial","from above","from below","low angle","high angle","eye level","worms eye","close up","closeup","macro","wide angle","wide shot","wide","telephoto","35mm","50mm","85mm","lens","shot from","framed","framing","straight on","profile"],VN={world:[...VJ,...L6],surface:L6,light:FN,signature:IN,stage:_N,camera:ZN},zJ=e=>` ${e.toLowerCase().replace(/[^a-z0-9é]+/g," ").trim()} `,BJ=(e,t)=>e.includes(` ${t.replace(/[^a-z0-9é]+/g," ")} `);function zN(e){const t=zJ(e),n=r=>r.some(a=>BJ(t,a));return{world:n(VN.world),surface:n(L6),light:n(FN),signature:n(IN),stage:n(_N),camera:n(ZN)}}const UJ=e=>Object.keys(VN).filter(t=>e[t]);function WJ(e){const t=["world","surface","light"].filter(r=>!e[r]),n=UJ(e).length>=3?t.filter(r=>r==="world"):t.slice(0,2);return e.signature?n:[...n,"signature"]}const qo="__passed",o0=e=>{var t;return(t=e.source)==null?void 0:t.door},KJ=e=>{var t;return o0(e)==="words"?WJ(zN(((t=e.source)==null?void 0:t.text)??"")):[]},am=[{id:"source",applies:()=>!0},{id:"photos",applies:e=>o0(e)==="photos"},{id:"shot",applies:e=>o0(e)==="shot"},{id:"reuse",applies:e=>{var t;return o0(e)==="shot"&&!!((t=e.shot)!=null&&t.scene)}},...Af.map(e=>({id:e,applies:t=>o0(t)==="guided"||KJ(t).includes(e)}))],mh=am.map(e=>e.id),Kh=e=>Af.includes(e),Ck=e=>mh.includes(e),GJ=e=>{var t;return!!e&&(!!e.pick||!!((t=e.words)!=null&&t.trim()))};function zv(e,t){var n;return e==="source"?!!t.source:e==="photos"?!!((n=t.photos)!=null&&n.done)&&t.photos.hashes.length>0:e==="shot"?!!t.shot:e==="reuse"?t.reuse==="read":GJ(t[e])}const YJ=e=>am.filter(t=>t.applies(e)&&zv(t.id,e)).map(t=>t.id);function BN(e){var t;return((t=am.find(n=>n.applies(e)&&!zv(n.id,e)))==null?void 0:t.id)??null}const UN=e=>{var t,n,r,a,i;return((t=e.source)==null?void 0:t.door)==="words"?!!((n=e.source.text)!=null&&n.trim()):((r=e.source)==null?void 0:r.door)==="photos"?(((a=e.photos)==null?void 0:a.hashes.length)??0)>0:((i=e.source)==null?void 0:i.door)==="shot"?!!e.shot:Af.some(l=>Li(l,e[l])!==null)},jk=e=>!!e.source&&BN(e)===null&&UN(e),T6=(e,t)=>JSON.stringify(e)!==JSON.stringify(t);function Bv(e,t){const n={...e},r=[];for(const[a,i]of Object.entries(t))T6(e[a],i)&&(i===void 0?delete n[a]:n[a]=i,r.push(a));if(r.length){const a=Math.min(...r.map(i=>mh.indexOf(i)));for(const i of mh)mh.indexOf(i)<=a||i in t||delete n[i]}for(const a of am)n[a.id]!==void 0&&!a.applies(n)&&delete n[a.id];return n}function qJ(e,t,n){var r,a;if(e==="source")return t.kind!=="choice"?null:t.id==="photos"?{source:{door:"photos"},photos:{hashes:((r=n.photos)==null?void 0:r.hashes)??[],done:!1}}:t.id==="guided"?{source:{door:"guided"}}:null;if(e==="reuse")return t.kind==="choice"&&t.id==="read"?{reuse:"read"}:null;if(Kh(e)){const i=(a=n[e])==null?void 0:a.words,l=t.kind==="swatches"?t.picks[e]??Object.values(t.picks)[0]:t.kind==="choice"?t.id:void 0;if(l)return{[e]:{pick:l,...i?{words:i}:{}}};if(t.kind==="skip")return{[e]:{pick:qo,...i?{words:i}:{}}}}return null}function Ak(e){var t;return(e==null?void 0:e.pick)===qo?[_J,(t=e.words)==null?void 0:t.trim()].filter(Boolean).join(", "):Li("signature",e)}function Li(e,t){var a,i;if(!t)return null;const n=t.pick&&t.pick!==qo?(a=co(e,t.pick))==null?void 0:a.words:void 0,r=(i=t.words)==null?void 0:i.trim();return n&&r?`${n}, ${r}`:n??r??null}const Nk=e=>e?`, ${TJ}`:"";function XJ(e){var l,u,f,h,p,g,v;if(((l=e.source)==null?void 0:l.door)==="words"){const w=(e.source.text??"").trim(),y=Li("world",e.world),x=Li("light",e.light)??(zN(w).light?null:((f=co("world",(u=e.world)==null?void 0:u.pick))==null?void 0:f.light)??null),k=Ak(e.signature),S=[y,Li("surface",e.surface),x,k].filter(Boolean);return S.length?`${w.replace(/[.\s]+$/,"")}, ${S.join(", ")}${Nk(k)}.`:w}if(((h=e.source)==null?void 0:h.door)!=="guided")return"";const t=Li("world",e.world),n=Li("light",e.light)??((g=co("world",(p=e.world)==null?void 0:p.pick))==null?void 0:g.light)??null,r=Ak(e.signature),i=`${[t??"a place",Li("surface",e.surface),n,r].filter(Boolean).join(", ").replace(/^./,w=>w.toUpperCase())}${Nk(r)}.`;return(v=e.world)!=null&&v.pick?`${i.slice(0,-1)}. ${Ne.worldIsAStart}`:i}function QJ(e){var t,n,r;return((t=e.source)==null?void 0:t.door)==="shot"?e.shot?[e.shot.hash]:[]:((n=e.source)==null?void 0:n.door)==="photos"&&((r=e.photos)!=null&&r.done)?e.photos.hashes:[]}const JJ={answers:{},revision:0,editing:null,held:null,asides:[]};function eee(e,t){var n;switch(t.type){case"answer":{const r=Bv(e.answers,t.patch);return T6(r,e.answers)?{...e,answers:r,revision:e.revision+1,editing:null,held:null}:{...e,editing:null,held:null}}case"photos":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const r=[...new Set(t.hashes)].slice(0,4),a=e.editing==="photos";return{...e,answers:{...e.answers,photos:{hashes:r,done:a}},revision:e.revision+1}}case"edit":return zv(t.id,e.answers)?{...e,editing:t.id,held:e.answers}:e;case"cancel-edit":return!e.held||!T6(e.held,e.answers)?{...e,editing:null,held:null}:{...e,answers:e.held,revision:e.revision+1,editing:null,held:null};case"aside":return{...e,asides:[...e.asides,t.aside].slice(-40)}}}const tee=e=>({answers:e.answers,revision:e.revision,asides:e.asides}),nee=/^[a-f0-9]{32}$/,Mk=/^[\w.:-]{1,80}$/;function ree(e){const t=e;if(!t||typeof t!="object"||typeof t.answers!="object"||!t.answers)return null;const n={},r=t.answers.source;r&&["photos","shot","guided","words"].includes(r.door)&&(n.source={door:r.door,...typeof r.text=="string"?{text:r.text.slice(0,400)}:{}});const a=t.answers.photos;a&&Array.isArray(a.hashes)&&(n.photos={hashes:a.hashes.filter(u=>typeof u=="string").slice(0,4),done:!!a.done});const i=t.answers.shot;if(i&&typeof i.id=="string"&&Mk.test(i.id)&&typeof i.hash=="string"&&nee.test(i.hash)){const u=i.scene,f=u&&typeof u.id=="string"&&Mk.test(u.id)&&typeof u.name=="string"?{id:u.id,name:u.name.slice(0,120)}:void 0;n.shot={id:i.id,hash:i.hash,...f?{scene:f}:{}}}t.answers.reuse==="read"&&(n.reuse="read");for(const u of Af){const f=t.answers[u];if(!f||typeof f!="object")continue;const h=typeof f.pick=="string"&&(f.pick===qo||co(u,f.pick))?f.pick:void 0,p=typeof f.words=="string"?f.words.slice(0,200):void 0;(h||p)&&(n[u]={...h?{pick:h}:{},...p?{words:p}:{}})}const l=Array.isArray(t.asides)?t.asides.filter(u=>u&&typeof u.said=="string"&&typeof u.reply=="string"&&typeof u.at=="string").map(u=>({said:u.said,reply:u.reply,at:u.at,q:typeof u.q=="string"?u.q:null})):[];return{answers:Bv({},n),revision:Number(t.revision)||0,editing:null,held:null,asides:l}}const WN=4,KN=800,Uv=60,GN={place:"",pictures:[],inputsRev:0,readRev:null,readTried:null,versions:[],current:-1,name:"",named:!1,job:null,error:null,saved:null,moreDeclined:!1,moreAsked:!1,setDrawn:!1,setDeclined:!1};function see(e){return{...GN,place:e.place,pictures:e.pictures,readRev:0,versions:[{reading:e.reading,hash:e.hash,coverage:[],how:"read"}],current:0,name:e.name,named:!0}}const Or=e=>e.versions[e.current]??null,Rk=e=>e.versions.some(t=>!!t.hash);function aee(e,t){return!t||e.job||e.inputsRev===0||e.readRev!==null&&e.readRev===e.inputsRev||e.readTried===e.inputsRev?null:e.inputsRev}const YN=e=>e.readRev!==null&&e.readRev!==e.inputsRev;function oee(e,t){var n,r,a;switch(t.type){case"inputs":{const i=t.place.slice(0,KN),l=[...new Set(t.pictures)].slice(0,WN);return i===e.place&&l.join()===e.pictures.join()?e:{...e,place:i,pictures:l,inputsRev:e.inputsRev+1}}case"name":return{...e,name:t.text.slice(0,Uv),named:!0};case"started":return e.job?e:{...e,job:{id:t.id,kind:t.kind,ask:t.ask,inputsRev:e.inputsRev,pending:null,coverage:[],phase:t.kind==="again"?"drawing":t.kind==="change"?"changing":"reading",since:t.since},readTried:t.kind==="make"?e.inputsRev:e.readTried,error:null};case"stopping":return!e.job||e.job.id!==t.id||e.job.stopping?e:{...e,job:{...e.job,stopping:!0}};case"progress":{if(!e.job||e.job.id!==t.job.id)return e;const i={...e.job,pending:t.job.reading??e.job.pending,coverage:t.job.coverage??e.job.coverage,phase:t.job.phase,since:t.job.phaseAt??e.job.since};return Pk({...e,job:i},i.pending)}case"finished":{if(!e.job||e.job.id!==t.job.id)return e;const i=e.job,l=t.job,u={...e,job:null};if(i.kind==="make"&&i.inputsRev!==e.inputsRev)return u;const f=l.reading??(i.kind==="again"?((n=Or(e))==null?void 0:n.reading)??null:null),h=l.status==="failed"?l.error??Ne.failed:null;if(l.status==="cancelled"){if(!f)return{...u,error:i.kind==="make"?Ne.stoppedRead:Ne.stopped};if(i.kind==="again"&&!l.hash)return{...u,error:Ne.stoppedDraw}}const p=l.status==="cancelled"&&i.kind==="change"&&!l.hash;if(!f||i.kind==="again"&&!l.hash)return{...u,error:h};const g=i.kind==="make"?"read":i.kind==="change"?"change":e.versions.some(S=>S.hash)?"again":"draw",v={reading:f,hash:l.hash,ask:i.kind==="change"?i.ask:void 0,coverage:(r=l.coverage)!=null&&r.length?l.coverage:i.kind==="again"?((a=Or(e))==null?void 0:a.coverage)??[]:[],how:g},w=Or(e),y=i.kind==="make"&&!l.hash&&w&&!w.hash&&w.how==="read",x=y?e.versions.map((S,E)=>E===e.current?v:S):[...e.versions,v],k={...u,versions:x,current:y?e.current:x.length-1,readRev:i.kind==="make"?i.inputsRev:e.readRev,error:p?Ne.stoppedChange:h};return Pk(k,f)}case"lost":return!e.job||e.job.id!==t.id?e:{...e,job:null,error:t.error};case"put-back":return e.job||!e.versions[t.index]?e:{...e,current:t.index};case"forget-record":return e.job||!e.versions.length?e:{...e,versions:[],current:-1,error:null};case"edit-words":{const i=Or(e);if(e.job||!i||!t.reading.prompt.trim()||JSON.stringify(t.reading)===JSON.stringify(i.reading))return e;const l=[...e.versions,{reading:t.reading,hash:i.hash,coverage:i.coverage,how:"edit"}];return{...e,versions:l,current:l.length-1}}case"error":return{...e,error:t.text};case"saved":return{...e,saved:t.id,error:null};case"decline-more":return{...e,moreDeclined:!0};case"ask-more":return{...e,moreAsked:!0};case"set-drawn":return{...e,setDrawn:!0,setDeclined:!1};case"set-declined":return{...e,setDeclined:!0}}}function Pk(e,t){return e.named||!(t!=null&&t.name)?e:{...e,name:t.name.slice(0,Uv)}}function iee(e){var n;const t=e.job?e.job.phase==="drawing"?e.job.pending:null:((n=Or(e))==null?void 0:n.reading)??null;return t?!e.job&&YN(e)?{can:!1,why:Ne.stillReading,words:t}:e.name.trim()?{can:!0,why:null,words:t}:{can:!1,why:Ne.nameIt,words:t}:{can:!1,why:e.job?Ne.stillReading:null,words:null}}const Yg=e=>e.job?e.job.phase==="changing"?Ne.changing:e.job.phase==="drawing"?Ne.drawing:e.pictures.length?Ne.readingPhotos:Ne.reading:void 0;function lee(e){var r;const t=new Map;e.versions.forEach((a,i)=>{a.hash&&t.set(a.hash,i)});const n=((r=Or(e))==null?void 0:r.hash)??null;return[...t.entries()].sort((a,i)=>a[1]-i[1]).map(([a],i)=>({n:i+1,hash:a,current:a===n}))}const cee=(e,t)=>e.versions.slice(0,t+1).filter(n=>!!n.hash).length,uee=(e,t)=>e.versions.map(n=>n.hash).lastIndexOf(t);function dee(e){const t=[{label:Ne.placeLabel,text:e.prompt}];return e.lighting&&t.push({label:Ne.lightLabel,text:e.lighting}),e.camera&&t.push({label:Ne.cameraLabel,text:e.camera}),e.figure&&t.push({label:Ne.figureLabel,text:e.figureTreatment?`${Lk(e.figure)}, ${Lk(e.figureTreatment)}.`:e.figure}),t}const Lk=e=>e.replace(/[.\s]+$/,""),fee=/\b(presenters?|models?|influencers?|celebrit(y|ies)|actors?|actress(es)?)\b/i,hee=/\b(my|our|the|a|an)\s+(\w+\s+)?(products?|bottles?|serum|perfume|shoes?|bag|jar|packaging|package|logos?|brand|brand name|wordmark)\b/i,pee=/\b(add|put|place|include|show|feature|with|holding|wearing|sitting|standing)\b/i,mee=/\b(no|without|remove|removing|empty|nobody|none|take out|get rid of|less)\b/i,gee=/^\s*(undo|go back|revert|back to|previous|the (first|last|previous|old|earlier) (one|version))\b/i,vee=/^\s*(hi|hello|hey|thanks|thank you|ok|okay|cool|nice|great|good|wow|yes|no)\b[\s!.]*$/i,wee=/^(?:please\s+)?(?:(?:call|name)\s+(?:it|this|the\s+scene)|rename(?:\s+(?:it|this|the\s+scene))?)\s+(?:to\s+|as\s+)?["'\u201c\u2018]?(.+?)["'\u201d\u2019]?[.!]?$/i,qN=e=>{var t,n;return((n=(t=wee.exec(e.trim()))==null?void 0:t[1])==null?void 0:n.trim())||null};function yee(e){const t=e.trim(),n=qN(t);return n?{kind:"rename",name:n}:gee.test(t)?{kind:"navigate",say:Ne.usePutBack}:vee.test(t)||/\?\s*$/.test(t)&&!/\b(make|can you|could you|try)\b/i.test(t)?{kind:"chatter",say:Ne.sayAChange}:(fee.test(t)||hee.test(t))&&pee.test(t)&&!mee.test(t)?{kind:"refuse",say:Ne.notInAScene}:{kind:"change"}}const bee=(e,t)=>{var n;return!!((n=Or(e))!=null&&n.ask)&&Or(e).ask.trim().toLowerCase()===t.trim().toLowerCase()},XN=e=>!e.saved&&(e.versions.length>0||!!e.job||!!e.error),xee=(e,t)=>e.saved?!1:t?e.versions.length>t.versions.length||e.current!==t.current||e.place!==t.place||e.pictures.join()!==t.pictures.join()||e.name!==t.name||!!e.job:!!(e.place.trim()||e.pictures.length||e.versions.length||e.job),QN=1;function kee(e){return JSON.stringify({v:QN,...e})}function See(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||t.v!==QN)return null;const n=u=>Array.isArray(u)?u.filter(f=>typeof f=="string"):[],r=u=>!!u&&typeof u.prompt=="string"&&typeof u.name=="string",a=Array.isArray(t.versions)?t.versions.filter(u=>u&&r(u.reading)).map(u=>({reading:u.reading,hash:typeof u.hash=="string"?u.hash:null,ask:typeof u.ask=="string"?u.ask:void 0,coverage:n(u.coverage),how:["read","draw","again","change","edit"].includes(u.how)?u.how:u.hash?"draw":"read"})):[],i=t.job&&typeof t.job.id=="string"&&["make","again","change"].includes(t.job.kind)?{id:t.job.id,kind:t.job.kind,ask:typeof t.job.ask=="string"?t.job.ask:void 0,inputsRev:Number(t.job.inputsRev)||0,pending:r(t.job.pending)?t.job.pending:null,coverage:n(t.job.coverage),phase:["reading","changing","drawing"].includes(t.job.phase)?t.job.phase:null,since:typeof t.job.since=="string"?t.job.since:null,...t.job.stopping===!0?{stopping:!0}:{}}:null,l=Number.isInteger(t.current)&&t.current>=-1&&t.current<a.length?t.current:a.length-1;return{place:typeof t.place=="string"?t.place.slice(0,KN):"",pictures:n(t.pictures).slice(0,WN),inputsRev:Number(t.inputsRev)||0,readRev:t.readRev===null||t.readRev===void 0?null:Number(t.readRev),readTried:t.readTried===null||t.readTried===void 0?null:Number(t.readTried),versions:a,current:l,name:typeof t.name=="string"?t.name.slice(0,Uv):"",named:!!t.named,job:i,error:typeof t.error=="string"?t.error:null,saved:typeof t.saved=="string"&&t.saved?t.saved:null,moreDeclined:t.moreDeclined===!0,moreAsked:t.moreAsked===!0,setDrawn:t.setDrawn===!0,setDeclined:t.setDeclined===!0}}function Eee(e){if(!e||e.loading)return"";const t=e.items.length;return t?Ne.shotCount(t,e.more):e.error?Ne.shotsFailed:e.query.trim()?Ne.shotNotFound(e.query.trim()):Ne.shotNone}function Tk(e){var n;const t=(n=e==null?void 0:e.tokens)==null?void 0:n.find(r=>(r==null?void 0:r.t)==="template");return typeof(t==null?void 0:t.id)=="string"&&t.id?t.id:typeof(e==null?void 0:e.templateId)=="string"&&e.templateId?e.templateId:null}function Cee(e){return dee(e).map(t=>t.label===Ne.placeLabel?t.text:`${t.label}: ${t.text.replace(/[.\s]+$/,"")}.`).join(" ")}const jee=new Set([Ne.stopped,Ne.stoppedRead,Ne.stoppedDraw,Ne.stoppedChange,Ne.lost]),$k=e=>jee.has(e)?e:Ne.failedFirst(e.replace(/[.\s]+$/,""));function Dk(e,t,n,r,a){var y,x,k,S,E,j,N,P,$,M,C,R,T,H;const i=t.answers,l=n?{reopened:!0}:{};if(e==="source")return{id:e,kind:"choice",prompt:Ne.source,options:[{id:"photos",label:Ne.addPictures},{id:"guided",label:Ne.guideMe}],given:((y=i.source)==null?void 0:y.door)==="words"?void 0:((x=i.source)==null?void 0:x.door)==="shot"?"photos":(k=i.source)==null?void 0:k.door,note:((S=i.source)==null?void 0:S.door)==="words"?i.source.text:void 0,...l};if(e==="photos")return{id:e,kind:"photos",prompt:Ne.photos,hashes:((E=i.photos)==null?void 0:E.hashes)??[],max:4,busy:r>0,submit:Ne.readThem,back:Ne.guideInstead,drop:Ne.photosDrop,...l,...a&&a.any!==!1&&!((j=i.photos)!=null&&j.hashes.length)&&r===0&&!n?{instead:Ne.fromShot,...a.any===null?{insteadWaiting:!0}:{}}:{}};if(e==="shot"){const D=(a==null?void 0:a.query.trim())??"";return{id:e,kind:"pick",prompt:Ne.shot,items:(a==null?void 0:a.items)??[],given:(N=i.shot)==null?void 0:N.id,search:{label:Ne.shotSearch,value:(a==null?void 0:a.query)??""},more:(a==null?void 0:a.more)??!1,loading:(a==null?void 0:a.loading)??!1,empty:a!=null&&a.error?Ne.shotsFailed:D?Ne.shotNotFound(D):Ne.shotNone,status:Eee(a),back:n?void 0:Ne.backToPictures,...l}}if(e==="reuse"){const D=(($=(P=i.shot)==null?void 0:P.scene)==null?void 0:$.name)??"";return{id:e,kind:"choice",prompt:Ne.madeIn(D),options:[{id:"use",label:Ne.takeScene(D)},{id:"read",label:Ne.readNew}],given:i.reuse,...l}}const u=i[e],f=e==="light"?(C=co("world",(M=i.world)==null?void 0:M.pick))==null?void 0:C.light:void 0,h=e==="surface"&&!!co("world",(R=i.world)==null?void 0:R.pick),p=(u==null?void 0:u.pick)===qo||u==null?void 0:u.pick,g=(u==null?void 0:u.pick)===qo,v=u==null?void 0:u.words,w=((T=i.source)==null?void 0:T.door)==="words";return{id:e,kind:"swatches",prompt:JN(e,i),row:IJ(e,(H=i.world)==null?void 0:H.pick),layout:e==="world"?"grid":void 0,hint:e==="world"&&!w?Ne.worldHint:void 0,skip:f?Ne.keepWorldLight:h?Ne.keepWorldSurface:e==="signature"&&!w?Ne.suggestOne:w?Ne.leaveToReading:Ne.skip,describe:Ne.describeInstead,given:p,skipped:g,note:v,...l}}function JN(e,t){var r,a,i;const n=e==="light"?(a=co("world",(r=t.world)==null?void 0:r.pick))==null?void 0:a.light:void 0;if(n)return Ne.worldLightPrompt(n);if(((i=t.source)==null?void 0:i.door)==="words"){if(e==="world")return Ne.followWorld;if(e==="light")return Ne.followLight}return Xi[e].prompt}function Aee(e,t){var n,r;return e==="source"?Ne.source:e==="photos"?Ne.photos:e==="shot"?Ne.shot:e==="reuse"?Ne.madeIn(((r=(n=t.shot)==null?void 0:n.scene)==null?void 0:r.name)??""):JN(e,t)}function Nee(e,t){var f,h,p,g,v,w,y,x,k,S,E;if(e==="source")return((f=t.source)==null?void 0:f.door)==="words"?{text:t.source.text??""}:((h=t.source)==null?void 0:h.door)==="shot"?{text:Ne.fromShotAnswer}:{text:((p=t.source)==null?void 0:p.door)==="photos"?Ne.addPictures:Ne.guideMe};if(e==="shot")return{text:Ne.shotAnswer,photos:t.shot?[t.shot.hash]:[]};if(e==="reuse")return{text:Ne.readNew};if(e==="photos"){const j=((g=t.photos)==null?void 0:g.hashes.length)??0;return{text:`${j} ${j===1?"picture":"pictures"}`,photos:(v=t.photos)==null?void 0:v.hashes}}const n=t[e],r=e==="light"&&(n==null?void 0:n.pick)===qo&&((y=co("world",(w=t.world)==null?void 0:w.pick))==null?void 0:y.light),a=e==="surface"&&(n==null?void 0:n.pick)===qo&&!!co("world",(x=t.world)==null?void 0:x.pick),i=r?Ne.keepWorldLight:a?Ne.keepWorldSurface:((k=t.source)==null?void 0:k.door)==="words"?Ne.leaveToReading:e==="signature"?Ne.suggestOne:Ne.skip,l=(n==null?void 0:n.pick)===qo?i:(S=co(e,n==null?void 0:n.pick))==null?void 0:S.label,u=(E=n==null?void 0:n.words)==null?void 0:E.trim();return{text:l&&u?`${l}, ${u}`:u??l??""}}const Hk=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,Mee=e=>{const t=Or(e);return t?`${t.hash?"decide":"agree"}-${e.current}`:null};function Ree(e){var v,w,y,x;const{setup:t,studio:n,edit:r}=e,a=t.answers,i=[],l=new Set,u=k=>{for(const S of t.asides.filter(E=>E.q===k&&!l.has(E)).sort(Hk))l.add(S),i.push(...ri(S))};r?i.push({kind:"scenri",id:"edit-open",text:Ne.editOpen(r.name)}):i.push({kind:"you",id:"intent",text:Ne.intent});const f=r?null:BN(a);if(!r)for(const k of YJ(a)){if(i.push({kind:"scenri",id:`asked-${k}`,text:Aee(k,a),quiet:!0}),u(k),t.editing===k){i.push({kind:"question",question:Dk(k,t,!0,e.uploading,e.shots)});continue}const S=Nee(k,a);i.push({kind:"you",id:k,text:S.text,photos:S.photos,editable:!n.job&&!n.saved})}const h=n.versions.findIndex(k=>!!k.hash);n.versions.forEach((k,S)=>{if(k.how==="read"&&S>0&&i.push({kind:"scenri",id:`reread-${S}`,text:Ne.readAgain}),k.how==="change"&&i.push({kind:"you",id:`ask-${S}`,text:k.ask??""}),k.hash&&(k.how==="draw"&&i.push({kind:"you",id:`draw-${S}`,text:Ne.draw}),k.how==="again"&&i.push({kind:"you",id:`again-${S}`,text:Ne.tryAgain}),S===h&&!r&&Ok(i,e),i.push({kind:"scenri",id:`pic-${S}`,text:k.how==="change"?Ne.changed:k.how==="again"?Ne.again:Ne.here,thumb:k.hash,label:Ne.version(cee(n,S)),view:"scene",current:S===n.current,restore:S===n.current||n.saved?void 0:{view:"scene",hash:k.hash}})),S===n.current)for(const[E,j]of k.coverage.entries())i.push({kind:"scenri",id:`cover-${S}-${E}`,text:j});u(`agree-${S}`),u(`decide-${S}`)});const p=n.job;(p==null?void 0:p.kind)==="again"&&i.push({kind:"you",id:`pending-${p.id}`,text:h<0?Ne.draw:Ne.tryAgain}),(p==null?void 0:p.kind)==="change"&&i.push({kind:"you",id:`pending-${p.id}`,text:p.ask??""}),(p==null?void 0:p.kind)==="again"&&h<0&&!r&&Ok(i,e),n.saved&&Pee(i,e);let g=null;if(f)g=Dk(f,t,!1,e.uploading,e.shots);else if(p){if(p.kind==="again"&&h<0&&!n.named&&!e.editingName){const k=((w=p.pending??((v=Or(n))==null?void 0:v.reading))==null?void 0:w.name)??n.name;g={id:"name",kind:"text",prompt:Ne.name,starters:k?[{label:k,text:k}]:void 0}}}else if(n.saved)g=Lee(e);else{const k=Or(n);if(e.stale&&!r)n.error&&(g={id:"retry",kind:"confirm",tone:"alert",prompt:$k(n.error),options:[{id:"retry",label:Ne.retry}]});else if(!k&&n.error)g={id:"retry",kind:"confirm",tone:"alert",prompt:$k(n.error),options:[{id:"retry",label:Ne.retry}]};else if(k){n.error&&i.push({kind:"scenri",id:`error-${n.versions.length}`,text:n.error,tone:"alert"});const S=Cee(k.reading);if(k.hash)g={id:`decide-${n.current}`,kind:"confirm",prompt:(r?Ne.decideEdit:Ne.decide)(n.name.trim()||k.reading.name),quote:S,quoteLabel:Ne.readingHead,options:[{id:"use",label:r?Ne.saveChanges:Ne.use},...e.canDraw?[{id:"again",label:Ne.tryAgain}]:[]],describe:Ne.changeSomething};else{const E=!r&&((y=a.source)==null?void 0:y.door)==="photos",j=!r&&((x=a.source)==null?void 0:x.door)==="shot",N=j?[{id:"another-shot",label:Ne.anotherShot}]:[];g={id:`agree-${n.current}`,kind:"confirm",prompt:e.canDraw?k.how==="change"?Ne.agreeChanged:E?Ne.agreePhotos:j?Ne.agreeShot:Ne.agree:Ne.agreeBlind,quote:S,quoteLabel:Ne.readingHead,options:[...e.canDraw?[{id:"draw",label:Ne.draw}]:[{id:"use",label:r?Ne.saveChanges:Ne.saveWords}],...N]}}}}for(const k of t.asides.filter(S=>!l.has(S)).sort(Hk))i.push(...ri(k));return e.note&&i.push({kind:"scenri",id:`note-${e.note.length}-${e.note.slice(0,12)}`,text:e.note}),g&&i.push({kind:"question",question:g}),i}function Pee(e,t){const{studio:n,edit:r,set:a,canDraw:i}=t;if(e.push({kind:"you",id:"use",text:r?Ne.saveChanges:i?Ne.use:Ne.saveWords}),!a)return;const l=a.tiles.length>0||a.running;e.push({kind:"scenri",id:"saved",text:l?Ne.inUse(a.who):a.read&&a.noSubject&&i?Ne.noLibrary:a.read&&i&&a.first.length?Ne.savedQuiet:Ne.saved}),(n.setDrawn||n.setDeclined)&&e.push({kind:"you",id:"set-start",text:n.setDrawn?a.stale?Ne.drawThemAgain:Ne.drawThem:Ne.notNow});const u=n.moreAsked?Ne.addThem:n.moreDeclined?Ne.notNow:null;let f=!1;const h=()=>{!u||f||(f=!0,e.push({kind:"you",id:"more",text:u}))};for(const p of a.tiles)p.role!=="hero"&&p.role!=="close"&&h(),p.state==="shown"&&p.hash?e.push({kind:"scenri",id:`ex-${p.role}-${p.hash}`,text:Ne.exampleHere[p.role],thumb:p.hash,label:tc[p.role],view:p.role,...a.running||n.job?{}:{retry:p.role}}):p.state==="failed"&&e.push({kind:"scenri",id:`ex-failed-${p.role}`,text:Ne.exampleFailed(tc[p.role],p.error??Ne.failed),tone:"alert"});h()}function Lee(e){var l;const{set:t,studio:n}=e,r=n.name.trim()||((l=Or(n))==null?void 0:l.reading.name)||"The scene";if(!t||t.running||!t.read)return null;if(e.canDraw&&t.first.length&&!n.setDrawn&&!n.setDeclined)return{id:"set-start",kind:"confirm",prompt:t.stale?Ne.staleSet(t.first.length):Ne.showInUse(t.who,t.first.map(u=>tc[u])),options:[{id:"draw-set",label:t.stale?Ne.drawThemAgain:Ne.drawThem},{id:"not-now",label:Ne.notNow}]};const a=t.tiles.some(u=>u.role==="hero"&&u.state==="shown");if(e.canDraw&&a&&t.missing.length&&!n.moreDeclined&&!n.moreAsked)return{id:"set-more",kind:"confirm",prompt:Ne.more(t.missing.map(u=>tc[u])),options:[{id:"more",label:Ne.addThem},{id:"not-now",label:Ne.notNow}]};const i=t.tiles.filter(u=>u.state==="failed");return{id:"set-done",kind:"confirm",prompt:i.length?Ne.readyMissing(r):t.tiles.length?Ne.ready(r):Ne.readyUndrawn(r),options:[...i.length&&e.canDraw?[{id:"retry-failed",label:Ne.tryAgain}]:[],{id:"done",label:t.finish}]}}function Ok(e,t){if(!t.studio.named&&!t.editingName)return;e.push({kind:"scenri",id:"asked-name",text:Ne.name,quiet:!0});const n=!t.studio.saved;e.push({kind:"you",id:"name",text:t.studio.name,editable:n,editing:t.editingName||void 0})}function Tee(e,t){var l,u,f;const{setup:n,studio:r}=e,a=(h,p=!1)=>({target:{kind:"off",why:h},placeholder:"",label:Ne.lineLabel,action:Ne.send,working:p,attach:!1});if(r.saved)return a("",!!r.job||!!((l=e.set)!=null&&l.running));const i=n.editing;return i==="source"?To({kind:"source"},Ne.sourcePlaceholder,!0):i&&Kh(i)?To({kind:"row",id:i},Ne.rowPlaceholder(Ek(i))):i==="photos"?a(Ne.photosOff):i==="shot"?a(Ne.shotOff):i==="reuse"?a(Ne.reuseOff):!t&&!r.job&&n.answers.source&&!UN(n.answers)?To({kind:"source"},Ne.nothingSaidPlaceholder,!0):t?t.id==="source"?To({kind:"source"},Ne.sourcePlaceholder,!0):t.id==="photos"?{...a(Ne.photosOff),attach:!0}:t.id==="shot"?a(Ne.shotOff):t.id==="reuse"?a(Ne.reuseOff):Kh(t.id)?To({kind:"row",id:t.id},Ne.rowPlaceholder(Ek(t.id))):t.id==="name"?To({kind:"name"},Ne.namePlaceholder):t.id==="retry"?To({kind:"source"},Ne.nothingSaidPlaceholder,!0):t.id.startsWith("agree-")?e.canDraw?To({kind:"add"},e.edit?Ne.addPlaceholder:((u=n.answers.source)==null?void 0:u.door)==="photos"?Ne.keepPlaceholder:((f=n.answers.source)==null?void 0:f.door)==="shot"?Ne.keepShotPlaceholder:Ne.addPlaceholder):a(""):t.id.startsWith("decide-")?{...To({kind:"change"},Ne.changePlaceholder),action:Ne.change}:a(""):r.job?a("",!0):a("")}function To(e,t,n=!1){return{target:e,placeholder:t,label:t,action:Ne.send,working:!1,attach:n}}const $ee=/\b(studio|room|lobby|hall|beach|forest|desert|street|city|kitchen|bathroom|bedroom|office|garden|park|field|mountain|shore|sea|ocean|lake|river|cave|rooftop|roof|terrace|warehouse|loft|gallery|museum|church|hotel|restaurant|caf[eé]|bar|shop|store|market|set|stage|backdrop|wall|floor|marble|concrete|wood|stone|light|dusk|dawn|night|sun|neon|fog|rain|snow|sand|water|glass|metal|plaster|fabric|interior|outdoors?|indoors?|landscape|pool|library|station|tunnel|bridge|corridor|courtyard|balcony|window|sky|cyclorama|cyc|seamless|brutalist|minimal)\b/i,eM=e=>$ee.test(e)||e.trim().split(/\s+/).length>=5&&!/\?\s*$/.test(e);function Ik(e,t){switch(e){case"greeting":case"ack":return t==="source"?Ne.greet:Ne.greetRow;case"question":case"help":return Ne.askHelp;case"nav":return Ne.startOverIsUp;case"go":return t==="source"?Ne.goFirst:Ne.greetRow;default:return Ne.notAPlace}}function Fk(e,t){if(t==="source"){const r=Vo(e,eM);return r==="vague"?null:r}const n=Vo(e,()=>!1);return n==="vague"||n==="intent"||n==="likeness"?null:n}const tM=2;function Dee(e,t){return JSON.stringify({v:tM,setup:tee(e),studio:kee(t)})}function nM(e){if(!e)return null;try{const t=JSON.parse(e);return(t==null?void 0:t.v)!==tM?null:{setup:ree(t.setup),studio:See(typeof t.studio=="string"?t.studio:null)}}catch{return null}}const rM=e=>`scenri:scene-studio:${e}:`;function Hee(e,t){var f,h,p;if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(n!=null&&n.sceneId)return null;const r=nM(typeof(n==null?void 0:n.session)=="string"?n.session:null),a=r==null?void 0:r.studio;if(!a||!XN(a))return null;const i=[a.versions[a.current],...[...a.versions].reverse()].find(g=>g==null?void 0:g.hash),l=Or(a),u=a.place.trim().split(/\s+/).slice(0,5).join(" ");return{convo:e,name:a.name.trim()||(l==null?void 0:l.reading.name)||((h=(f=a.job)==null?void 0:f.pending)==null?void 0:h.name)||u,hash:(i==null?void 0:i.hash)??null,drawing:!!a.job,failed:!a.job&&!!a.error,read:a.versions.length>0,jobId:((p=a.job)==null?void 0:p.id)??null,at:Number(n.at)||0}}function Oee(e,t){const n=new Map(t.filter(i=>i.kind==="scene").map(i=>[i.id.slice(6),i])),r=e.map(i=>{const l=i.jobId?n.get(i.jobId):void 0;return l?i.drawing?{...i,name:i.name||l.name,hash:l.status==="done"&&l.thumb?l.thumb:i.hash,drawing:l.status==="running",failed:l.status==="failed"}:i:{...i,drawing:!1}}),a=new Set(e.map(i=>i.convo));for(const i of t)i.kind!=="scene"||i.status!=="running"||!i.conversation||i.sceneId||a.has(i.conversation)||(a.add(i.conversation),r.push({convo:i.conversation,name:i.name,hash:null,drawing:!0,failed:!1,read:!1,jobId:i.id.slice(6),at:Date.parse(i.startedAt)||0}));return r.filter(i=>i.drawing||i.hash||i.failed||i.read).sort((i,l)=>l.at-i.at)}function Iee(e){return e.drawing?"Drawing":e.failed?"Did not finish":e.hash?"Drawn, not used yet":"Not drawn yet"}function gh(e){const t=rM(e);return cs.keys(t).map(n=>Hee(n.slice(t.length),cs.get(n))).filter(n=>!!n)}function Fee(e,t){const n=`${rM(e)}${t}`;cs.del(n),Ii(n)}function _ee(e,t,n,r){const a=PX(e,n)||e==="presenter"&&!!r;switch(e){case"first-shot":case"reuse":return t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"refine":return t.onShot||t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"presenter":return r||n.some(i=>i==="start"||i==="face"||i==="save")?t.onStudio?{kind:"stay"}:{kind:"studio"}:t.onStudio||t.onPresenters?{kind:"stay"}:a?{kind:"presenters"}:{kind:"head"};case"product":return a&&n.includes("product")?{kind:"dialog",asset:"product"}:t.onProducts?{kind:"stay"}:a?{kind:"products"}:{kind:"head"};case"scene":return a&&n.some(i=>i==="start"||i==="words"||i==="use")?t.onSceneStudio?{kind:"stay"}:{kind:"sceneStudio"}:t.onSceneStudio||t.onScenes?{kind:"stay"}:a?{kind:"scenes"}:{kind:"head"}}}function sM(){const{brand:e,recent:t,products:n}=on(),r=Dn(),a=ll(),i=!!un(ct.hub),l=!!un(ct.hubShot),u=!!un(ct.products),f=!!un(ct.scenes),h=!!un(ct.presenters),p=!!un(ct.presenterStudio),g=!!un(ct.sceneStudio);return s.useCallback(async v=>{var j,N;const w=t.find(P=>P.kind!=="root"&&P.status==="done"&&P.images.length>0),y=v==="refine"&&!w?"first-shot":v==="reuse"&&n.length===0?"product":v,x=fh().active;(x==null?void 0:x.task)===y&&x.brandId===e.id&&!x.paused||await Tl({start:{task:y,brandId:e.id}});const k=((N=(j=fh().progress)==null?void 0:j[y])==null?void 0:N.reached)??[],S=fh().activeDraftId,E=_ee(y,{onHub:i,onShot:l,onProducts:u,onScenes:f,onPresenters:h,onStudio:p,onSceneStudio:g},k,S);switch(E.kind!=="head"&&u6(),E.kind){case"stay":try{window.localStorage.removeItem(c6(e.id,y)),(y==="first-shot"||y==="reuse")&&window.localStorage.removeItem(Hj(e.id))}catch{}return(y==="first-shot"||y==="reuse")&&i?r(mr(e)):void 0;case"head":return Oj(e.id,y);case"hub":return r(mr(e));case"products":return r(Eu(e));case"scenes":return r(_u(e));case"presenters":return r(qi(e));case"studio":return r(zi(e,S));case"sceneStudio":{const P=gh(e.id).sort(($,M)=>M.at-$.at)[0];return r(Vi(e,(P==null?void 0:P.convo)??null))}case"dialog":return a(E.asset)}},[e,t,n,r,a,i,l,u,f,h,p,g])}const Zee=Number(window.localStorage.getItem("scenri:welcome-settle-ms")??900),Vee='[role="dialog"]:not(.sc-coach):not(.sc-attachpanel):not(.sc-swap), [role="alertdialog"], .sc-lightbox',zee=["settings","setup","new","whatsnew","learn","welcome"],Bee='[data-guide="compose"] .sc-attachpanel';function Uee(){var J,Oe,Be,Ve,Ge,me,_e;const e=cv(),t=mN(),n=Rn(),{brand:r,recent:a,subscribeActivity:i,products:l,importing:u}=on(),{tasks:f,builds:h}=Za(),{push:p}=or(),g=sM(),v=Dn(),[w]=el(),y=Ns("new"),x=!!un(ct.brand),k=!!un(ct.hub),S=((J=un(ct.hubShot))==null?void 0:J.params.shotId)??null,E=!!un(ct.presenterStudio),j=!!un(ct.sceneStudio),N=!!un(ct.products),P=!!un(ct.scenes),$=!!un(ct.presenters),M=e.active,C=M&&M.brandId===r.id?M.task:null,R=C&&!(M!=null&&M.paused)?C:null,T=R==="first-shot"||R==="reuse"?"generation":R==="refine"?"edit":null,H=e.loaded&&e.eligible&&e.welcome===null,[D,K]=s.useState(e.activeNodes);s.useEffect(()=>K(e.activeNodes),[e.activeNodes]),s.useEffect(()=>{if(!(!T||!M))return i(W=>K(pe=>xX(pe,W,M.since,T)))},[T,M,i]);const O=!!((Oe=t.composer)!=null&&Oe.busy),Z=s.useRef(!1),[te,B]=s.useState(!1);s.useEffect(()=>{Z.current&&!O&&T&&(B(!0),jg().finally(()=>B(!1))),Z.current=O},[O,T]);const[,F]=s.useState(0),X=s.useRef(0),z=s.useCallback(()=>{cancelAnimationFrame(X.current),X.current=requestAnimationFrame(()=>F(W=>W+1))},[]);s.useEffect(()=>{if(!R&&!H)return;const W=new MutationObserver(z);return W.observe(document.body,{childList:!0,subtree:H}),window.addEventListener("resize",z),()=>{cancelAnimationFrame(X.current),W.disconnect(),window.removeEventListener("resize",z)}},[R,H,z]);const[I,U]=s.useState(()=>!document.hidden);s.useEffect(()=>{const W=()=>U(!document.hidden);return document.addEventListener("visibilitychange",W),()=>document.removeEventListener("visibilitychange",W)},[]);const G=!!R||H,ne=zee.some(W=>w.has(W)),q=G&&(ne||[...document.querySelectorAll(Vee)].some(W=>!W.closest("[data-radix-popper-content-wrapper], .sc-shotsheet"))),le=w.get("new"),Se=R?`scenri:guide-begun:${r.id}:${R}`:null,[Q,xe]=s.useState(!1);s.useEffect(()=>{xe(!!Se&&window.localStorage.getItem(Se)==="1")},[Se]);const ee=s.useCallback(()=>{if(Se)try{window.localStorage.setItem(Se,"1")}catch{}xe(!0)},[Se]),ae=e.heading,re=W=>!!W&&(ae==null?void 0:ae.brandId)===r.id&&ae.task===W&&!q,_=W=>W==="first-shot"||W==="reuse"||W==="refine"?k:W==="product"?N:W==="scene"?P:W==="presenter"?$||E:!1,[ue,We]=s.useState(!1);s.useEffect(()=>{let W=!1;try{W=!!R&&window.localStorage.getItem(c6(r.id,R))==="1"}catch{}We(W)},[R,r.id,ae]),s.useEffect(()=>{if(!(!ae||ae.brandId!==r.id)&&_(ae.task)){try{window.localStorage.setItem(c6(r.id,ae.task),"1")}catch{}We(!0),(ae.task==="first-shot"||ae.task==="reuse")&&ee(),u6()}},[ae,k,N,P,$,E,r.id,ee]);const Xe=s.useRef(null);s.useEffect(()=>{const W=Xe.current;!W||_(W)||(Xe.current=null,Oj(r.id,W))},[k,N,P,$,E,r.id]),s.useEffect(()=>{e.loaded&&!C&&ae&&u6()},[e.loaded,C,ae]);let ze=null;if(R==="first-shot"||R==="reuse"){const W=((Be=t.composer)==null?void 0:Be.brandId)===r.id?t.composer:null,pe=k&&re(R),Ie={here:k&&!q,heading:re(R)&&!k,composer:W&&te?{...W,busy:!0}:W,nodes:D,begun:Q||pe||D.length>0};ze=R==="reuse"?lN(Ie):iN(Ie)}else if(R==="refine"){const W=((Ve=t.composer)==null?void 0:Ve.brandId)===r.id?t.composer:null,pe=!!S;ze=fX({here:pe||k&&!q,heading:re(R)&&!k&&!pe,open:pe,armed:k&&!!(W!=null&&W.refining),nodes:D,asking:pe?!!Rl(uN):!!Rl(Ih)})}else R==="presenter"?ze=dN({heading:re(R)&&!$&&!E,onPage:$&&!E&&!q,studio:E?t.studio:null}):R==="scene"?ze=pX({heading:re(R)&&!P&&!j,onPage:P&&!j&&!q,studio:j?t.studio:null}):R==="product"&&(ze=mX({heading:re(R)&&!N,onPage:N&&!q&&le!=="product",dialogOpen:le==="product"}));const tt=((Ge=t.composer)==null?void 0:Ge.brandId)===r.id?t.composer:null,ce=R==="first-shot"&&tt?cN(tt):R==="reuse"&&tt?tt.products===0?"product":tt.scene?null:"scene":null,ve=!!((me=t.composer)!=null&&me.pickerOpen);s.useEffect(()=>{ve&&(R==="first-shot"&&!ce?window.dispatchEvent(new Event("scenri:guide-close-picker")):ce&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Ox[ce]}})))},[R,ve,ce]),s.useEffect(()=>{R==="first-shot"&&!ce&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:null}}))},[R,ce]),s.useEffect(()=>{if(R)return document.documentElement.dataset.guideTask=R,()=>{delete document.documentElement.dataset.guideTask}},[R]);const Pe=(ze==null?void 0:ze.point)===Bee&&window.innerWidth<1024;if(s.useEffect(()=>{if(Pe)return document.documentElement.dataset.guidePicker="",()=>{delete document.documentElement.dataset.guidePicker}},[Pe]),R&&ze&&ze.voice!=="quiet"){const W=LX(R,ze.id);W&&(ze={...ze,...W})}const de=R&&ze&&ze.voice!=="quiet"?ze.id:null,je=s.useRef("");s.useEffect(()=>{var pe,Ie;if(!R||!de)return;const W=`${R}:${de}`;je.current!==W&&(je.current=W,!((Ie=(pe=e.progress)==null?void 0:pe[R])!=null&&Ie.reached.includes(de))&&Tl({reached:{task:R,moment:de}}))},[R,de,e.progress]);const Ue=ze,ye=s.useRef(new Set),Ee=s.useCallback(W=>{ye.current.add(W),Tl({finish:W})},[]),be=s.useCallback(W=>{Tl({dismiss:W}),p({kind:"info",title:"Guide closed",detail:"Continue it any time from Learn."})},[p]);s.useEffect(()=>{R==="first-shot"&&S&&D.some(W=>W.id===S&&W.status==="done"&&W.images>0)&&Ee("first-shot")},[R,S,D,Ee]),s.useEffect(()=>{R==="refine"&&S&&jg()},[R,S]);const Le=s.useRef(!1);s.useEffect(()=>{if(R!=="refine"){Le.current=!1;return}S?Le.current=!0:Le.current&&(Le.current=!1,Ee("refine"))},[R,S,Ee]);const Qe=C==="presenter"||C==="scene"||C==="product",Ke=h.filter(W=>!W.finished).length;s.useEffect(()=>{Qe&&jg()},[Qe,r,l.length,Ke,u]),s.useEffect(()=>{Qe&&e.counts&&vX(e,e.counts)&&Ee(M==null?void 0:M.task)},[Qe,e,M,Ee]);const nt=!!((_e=t.overlay)!=null&&_e.engaged);s.useEffect(()=>{if(!e.loaded||!e.eligible)return;const W={eligible:e.eligible,hidden:e.hidden,done:e.done,dismissed:e.dismissed,active:M},Ie=!!S&&nt&&a.some(Te=>Te.id===S&&Te.status==="done")&&B1("refine",W)?"refine":j&&B1("scene",W)?"scene":le==="product"&&B1("product",W)?"product":E&&B1("presenter",W)?"presenter":null;!Ie||ye.current.has(Ie)||(ye.current.add(Ie),Tl({start:{task:Ie,brandId:r.id}}))},[e,M,S,nt,a,le,E,j,r.id]);const[gt,Pt]=s.useState(""),Ut=s.useRef(Ue);Ut.current=Ue;const Nt=s.useCallback((W,pe)=>{if(Pt(""),pe)return;const Ie=Ut.current,Te=Ie?[Ie.title,Ie.body].filter(Boolean).join(". "):"";Te&&requestAnimationFrame(()=>Pt(Te))},[]),[cn,Fe]=s.useState(!1),pt=Ns("welcome"),it=pt.value!==null,St=x&&n.showcaseLoaded||k,xt=h.some(W=>!W.finished)||f.some(W=>W.state==="running"&&W.kind!=="catalog"),At=yX({onMainPage:x||k,eligible:e.eligible,welcome:e.welcome,ready:St&&!document.querySelector('[data-variant="skeleton"]'),visible:I,blocked:q,busy:xt});s.useEffect(()=>{if(!At)return;const W=window.setTimeout(()=>Fe(!0),Zee);return()=>window.clearTimeout(W)},[At]);const Kt=s.useMemo(()=>bX(n.showcase).map(W=>Wee(W.previewUrl)),[n.showcase]),et=n.engines.some(W=>W.available),mt=l.length>0,ot=Ue&&(Ue.voice==="ask"||Ue.voice==="note")?Ue:null,kn=ot!=null&&ot.shell?Rl(ot.shell):document.body,ut=ot!=null&&ot.point?Rl(ot.point):null,Gt=(ot==null?void 0:ot.live)??(ot!=null&&ot.point?[ot.point]:[]),Ft=Gt.map(W=>Rl(W)).filter(W=>!!W),en=((ot==null?void 0:ot.also)??[]).map(W=>Rl(W)).filter(W=>!!W),Jt=((ot==null?void 0:ot.lit)??[]).map(W=>Rl(W)).filter(W=>!!W),se=!!ot&&!!kn&&(!ot.point||!!ut)&&Ft.length===Gt.length,oe=ot&&!se?ot:null,we=cn||se;s.useEffect(()=>Vx(we),[we]),s.useEffect(()=>()=>Vx(!1),[]),s.useEffect(()=>{if(!oe)return;const W=(oe.shell?document.querySelector(oe.shell):null)??document.querySelector(".sc-feed")??document.body,pe=new MutationObserver(z);return pe.observe(W,{childList:!0,subtree:!0}),()=>pe.disconnect()},[oe==null?void 0:oe.id,oe==null?void 0:oe.shell,z]);const ge=W=>{R&&(W.done?Ee(R):be(R))};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:gt}),ot&&se&&o.jsx(AQ,{id:ot.id,voice:ot.voice,target:ut,live:Ft,also:en,lit:Jt,side:ot.side??"top",beside:ot.beside,soft:ot.soft,container:kn,title:ot.title,body:ot.body,at:ot.at,of:ot.of,canBack:gX(R,ot.id,ue||!!(k&&re(R))),action:ot.start?{label:"Start"}:ot.done?{label:"Done"}:null,closeLabel:ot.done?"Close":"Close guide",onBack:()=>{const W=R?hN(R,ot.id):null;if(W){window.dispatchEvent(new CustomEvent("scenri:guide-take-back",{detail:{kind:W}})),window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Ox[W]}}));return}if(R==="presenter"&&(ot.id==="start"||ot.id==="face"||ot.id==="save"))return v(qi(r),{replace:!0});if((R==="product"||R==="scene")&&ot.id===R)return y.close();if(R==="refine"&&ot.id==="ask"){if(S)return v(mr(r),{replace:!0});window.dispatchEvent(new Event("scenri:guide-clear-refine"));return}if(ue&&R&&(ot.id==="new"||ot.id==="choose"||ot.id==="product"))return window.dispatchEvent(new Event("scenri:guide-close-picker")),Xe.current=R,v(mo(r))},onAction:()=>{if(ot.start)return ee();ot.done&&R&&Ee(R)},onClose:()=>ge(ot),onEscape:()=>ge(ot),onShown:Nt,onLost:z}),o.jsx($X,{open:cn||it,pictures:Kt,note:wu.note({engineReady:et,ownsProducts:mt}),onTake:()=>{const W=cn;Fe(!1),it&&pt.close(),W?Tl({welcome:"taken"}).then(()=>g("first-shot")):window.setTimeout(()=>void g("first-shot"),0)},onDecline:()=>{const W=cn;Fe(!1),it&&pt.close(),W&&Tl({welcome:"declined"})}})]})}function Rl(e){for(const t of document.querySelectorAll(e))if(t.getClientRects().length>0)return t;return null}function Wee(e){return`${e}${e.includes("?")?"&":"?"}w=320`}const Kee="lessons";function Gee(){var B;const e=Ns("learn"),t=e.value!==null,n=NX(e.value),r=wr(Ks),a=cv(),i=mN(),{brand:l,recent:u,products:f}=on(),h=sM(),[p,g]=s.useState(null);s.useEffect(()=>{t||!p||(g(null),h(p))},[t,p,h]);const v=s.useRef(!1),w=F=>{v.current=!0,g(F),e.close()},y=s.useRef(null);s.useEffect(()=>{t&&(y.current=d6.current,d6.current=null)},[t]);const x=()=>{const F=v.current;if(v.current=!1,F)return;const X=y.current==="help";requestAnimationFrame(()=>{var U;if(document.activeElement!==document.body)return;const z=X?".sc-help-btn":".sc-learn-btn",I=X?".sc-learn-btn":".sc-help-btn";(U=document.querySelector(z)??document.querySelector(I))==null||U.focus()})},k=!!un(ct.hub),S=!!un(ct.presenterStudio),E=!!un(ct.presenters),j=F=>{var X;return((X=a.heading)==null?void 0:X.brandId)===l.id&&a.heading.task===F},N=((B=a.active)==null?void 0:B.brandId)===l.id&&!a.active.paused?a.active.task:null,P=u.some(F=>F.kind!=="root"&&F.status==="done"&&F.images.length>0),$=F=>F.needs==="shot"&&!P||F.needs==="product"&&f.length===0?F.needs??null:null,M=F=>{var G,ne,q,le,Se,Q;const X=((ne=(G=a.progress)==null?void 0:G[F.id])==null?void 0:ne.reached)??[];if(N!==F.id)return zx(F.id,X,null);const z=((q=i.composer)==null?void 0:q.brandId)===l.id?i.composer:null,I={here:k,heading:j(F.id),composer:k?z:null,nodes:a.activeNodes,begun:!0},U=F.id==="first-shot"?((le=iN(I))==null?void 0:le.id)??null:F.id==="reuse"?((Se=lN(I))==null?void 0:Se.id)??null:F.id==="presenter"?((Q=dN({heading:j("presenter"),onPage:E&&!S,studio:S?i.studio:null}))==null?void 0:Q.id)??null:null;return zx(F.id,X,{moment:U,nodes:a.activeNodes,draft:!!a.activeDraftId})},C=F=>MX(F.id,a,l.id,M(F)),R=RX($i,C),T=n??R??$i[0],H=$i.filter(F=>C(F)==="done").length;s.useEffect(()=>{if(t)for(const F of Object.values(A6))new Image().src=F.wide},[t]);const D=s.useRef(null),K=s.useRef(new Map),O=s.useRef(null),Z=s.useRef(!1);s.useEffect(()=>{var z;const F=t&&!Z.current;if(Z.current=t,!t)return;const X=()=>{var I,U;(I=D.current)==null||I.focus({preventScroll:!0}),(U=D.current)==null||U.scrollIntoView({block:"nearest"})};r&&n?(O.current=n.id,X()):r&&O.current?(z=K.current.get(O.current))==null||z.focus({preventScroll:!0}):F&&X()},[t,r,n]);const te=(F,X)=>o.jsx(Yee,{lesson:F,state:C(F),at:M(F),blocked:$(F),describe:X,actionRef:D,onBegin:()=>w(F.id)});return o.jsx(Ts,{open:t,className:"sc-learn",maxWidth:"880px",described:!0,onDismiss:e.close,onCloseAutoFocus:x,children:r&&n?o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>e.set(Kee),"aria-label":"All lessons",children:o.jsx(ga,{size:15})}),o.jsx(ds,{className:"sc-newdlg-title",children:n.title}),o.jsx(_k,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-learn-body",children:te(n,!0)})]},`one-${n.id}`):o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Learn"}),o.jsxs("span",{className:"sc-learn-count",children:[H," of ",$i.length," done"]}),o.jsx(_k,{})]}),o.jsx(td,{className:"sc-vh",children:"Each one walks you through one real thing, a step at a time."}),o.jsxs("div",{className:"sc-newdlg-body sc-learn-body",children:[o.jsx("ul",{className:"sc-learn-list",children:$i.map(F=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-learn-row","data-state":C(F),"aria-current":!r&&T.id===F.id?"true":void 0,ref:X=>{X?K.current.set(F.id,X):K.current.delete(F.id)},onClick:()=>e.set(F.id),children:[o.jsx("span",{className:"sc-learn-thumb",children:o.jsx("img",{src:A6[F.id].square,alt:"",decoding:"async"})}),o.jsxs("span",{className:"sc-learn-say",children:[o.jsx("span",{className:"sc-learn-name",children:F.title}),o.jsx(aM,{lesson:F,state:C(F),at:M(F),blocked:$(F)})]}),(R==null?void 0:R.id)===F.id&&o.jsx("span",{className:"sc-learn-next",children:"Next"})]})},F.id))}),!r&&te(T,!1)]})]},"all")})}function Yee({lesson:e,state:t,at:n,blocked:r,describe:a,actionRef:i,onBegin:l}){const u=r?j6[r].action:t==="active"?"Continue":t==="done"?"Start again":"Start",f=t==="active"?n:0,h=g=>t==="done"?"done":t==="active"?g<n?"done":g===n?"active":"todo":g===0?"active":"todo",p=a?o.jsx(td,{className:"sc-learn-summary",children:e.summary}):o.jsx("p",{className:"sc-learn-summary",children:e.summary});return o.jsxs("section",{className:"sc-learn-lesson","aria-label":e.title,children:[o.jsx("span",{className:"sc-learn-hero",children:o.jsx("img",{src:A6[e.id].wide,alt:"",decoding:"async"})}),o.jsxs("div",{className:"sc-learn-copy",children:[o.jsx("div",{className:"sc-learn-kicker",children:o.jsx(aM,{lesson:e,state:t,at:n,blocked:r})}),o.jsx("h3",{className:"sc-learn-title",children:e.title}),p,o.jsxs("div",{className:"sc-learn-do",children:[o.jsx("ol",{className:"sc-learn-steps",children:gN(e).map((g,v)=>{const w=h(v),y=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:w==="done"?o.jsx(Kn,{size:14,weight:"bold"}):v+1}),x=t==="active"&&v===n?"step":void 0,k=o.jsx("span",{className:"sc-learn-step-name",children:g});return o.jsx("li",{children:v===f?o.jsxs("button",{ref:i,type:"button",className:"sc-learn-step","data-state":w,"data-here":"","aria-current":x,"aria-label":`${u}: ${g}`,onClick:l,children:[y,k,o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[u," ",o.jsx(Pa,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":w,"aria-current":x,children:[y,k,w==="done"&&o.jsx("span",{className:"sc-vh",children:", done"})]})},g)})}),r&&o.jsx("p",{className:"sc-learn-note",children:j6[r].note})]})]})]})}function aM({lesson:e,state:t,at:n,blocked:r}){const a=gN(e).length;return t==="done"?o.jsxs("span",{className:"sc-learn-status","data-state":"done",children:[o.jsx("span",{className:"sc-learn-tick","aria-hidden":"true",children:o.jsx(Kn,{size:9,weight:"bold"})}),"Done"]}):t==="active"?o.jsxs("span",{className:"sc-learn-status","data-state":"active",children:["Step ",Math.min(n+1,a)," of ",a]}):r?o.jsx("span",{className:"sc-learn-status",children:j6[r].status}):o.jsxs("span",{className:"sc-learn-status",children:[a," step",a===1?"":"s"]})}function _k(){return o.jsx(As,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const oM=s.createContext(null),qee={products:[],productsLoaded:!1,importing:!1,refreshProducts:async()=>{}};function on(){const e=s.useContext(oM),t=VA()??qee;if(!e)throw new Error("useBrand must be used inside BrandLayout");return s.useMemo(()=>({...e,...t}),[e,t])}const iM=s.createContext(null);function Xee(){const e=s.useContext(iM);if(!e)throw new Error("useAssetsPanel must be used inside BrandLayout");return e}function Qee(){const{brandSlug:e}=Bs(),{pathname:t,search:n}=Zn(),r=un({path:ct.brand,end:!1}),{brands:a,engines:i,refresh:l}=Rn(),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,v]=s.useState([]),[w,y]=s.useState([]),[x,k]=s.useState({}),[S,E]=s.useState(!1),[j,N]=s.useState(0),P=s.useCallback(()=>N(Q=>Q+1),[]),$=Dn(),[M,C]=fa(Dr.assetsOpen,window.innerWidth>=1280),R=s.useCallback(()=>C(Q=>!Q),[]),T=s.useMemo(()=>({open:M,toggle:R,setOpen:C}),[M,R]);fY();const H=s.useRef(null),D=a.find(Q=>Q.slug===e)??a.find(Q=>Q.id===e)??a.find(Q=>Q.id===H.current)??null;D&&(H.current=D.id);const K=s.useRef(D==null?void 0:D.id);K.current=D==null?void 0:D.id;const O=s.useCallback(async()=>{if(!D)return;const Q=D.id,xe=await Re.workspace(Q);K.current===Q&&(f(xe.project),p(xe.root),v(xe.recent),y(xe.sets),k(xe.membership),E(!0))},[D==null?void 0:D.id]),Z=s.useRef(new Set),te=s.useCallback(Q=>(Z.current.add(Q),()=>{Z.current.delete(Q)}),[]),B=s.useCallback(Q=>{if(Q.length){v(xe=>oX(xe,Q));for(const xe of Z.current)xe(Q)}},[]),F=s.useCallback((Q,xe)=>{!D||Q!==D.id||B(xe)},[D==null?void 0:D.id,B]),X=s.useCallback(Q=>y(xe=>xe.map(ee=>ee.id===Q.id?Q:ee)),[]),z=s.useCallback(Q=>y(xe=>xe.filter(ee=>ee.id!==Q)),[]),I=s.useCallback(Q=>y(xe=>xe.some(ee=>ee.id===Q.id)?xe:[Q,...xe]),[]),U=s.useCallback((Q,xe)=>k(ee=>({...ee,[Q]:xe})),[]),G=s.useMemo(()=>D?{brand:D,workspace:u,root:h,recent:g,sets:w,membership:x,loaded:S,refresh:O,applySet:X,dropSet:z,insertSet:I,applyMembership:U,applyNodes:B,subscribeActivity:te,shotsEpoch:j,resetShots:P}:null,[D,u,h,g,w,x,S,O,X,z,I,U,B,te,j,P]);s.useEffect(()=>{E(!1),v([]),p(null)},[D==null?void 0:D.id]),s.useEffect(()=>{D&&aB(D.id)},[D==null?void 0:D.id]),s.useEffect(()=>{O()},[O]);const ne=s.useCallback(()=>{l(),O()},[l,O]),q=r?t.slice(r.pathnameBase.length):"",le=!!D&&e!==D.slug,Se=D?mo(D)+q+n:"";if(s.useEffect(()=>{le&&$(Se,{replace:!0})},[le,Se,$]),!D){const Q=rN(a),xe=!!H.current&&!a.some(re=>re.id===H.current),ee=new URLSearchParams(n);xe&&(ee.delete("settings"),ee.delete("new"));const ae=ee.toString();return o.jsx(uo,{to:Q?mo(Q)+q+(ae?`?${ae}`:""):ct.root,replace:!0})}return o.jsxs(oM.Provider,{value:G,children:[o.jsx(_q,{engines:i,brandId:D.id,onSaved:ne}),o.jsx(Qq,{engines:i,onSaved:l}),o.jsx(Wq,{}),o.jsx(YK,{brand:D,onActivity:F,children:o.jsxs(hY,{brand:D,children:[o.jsx(nte,{}),o.jsx(eY,{children:o.jsxs(iM.Provider,{value:T,children:[o.jsxs("div",{className:"sc-shell",children:[o.jsx(uY,{}),o.jsx(uc,{}),o.jsx(uG,{})]}),o.jsx(Uee,{}),o.jsx(Gee,{}),o.jsx(EX,{})]})})]})})]})}function Jee(e){return!e.unread||e.spent||e.firstUse||!e.loaded||!e.visible||e.dialogOpen?!1:e.running===0&&e.builds===0}const ete=Number(window.localStorage.getItem("scenri:whatsnew-settle-ms")??2500)||2500,lM=s.createContext(null);function om(){const e=s.useContext(lM);if(!e)throw new Error("useWhatsNew must be used inside WhatsNewProvider");return e}function tte({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(null),[i,l]=s.useState(null),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,v]=s.useState("loading"),[w,y]=s.useState(!1),x=Ns("whatsnew");s.useEffect(()=>{let $=!0;return Re.releaseNotes().then(M=>{$&&(n(M.version),a(M.entry),l(M.changelogUrl),f(M.releasesUrl??null),p(M.seen),v("ready"))}).catch(()=>{$&&v("failed")}),()=>{$=!1}},[]);const k=x.open,S=s.useCallback(()=>k(t??"latest"),[k,t]),E=s.useCallback(()=>{y(!0),S()},[S]),j=s.useCallback(()=>{!t||h===t||(p(t),Re.releaseSeen(t).catch(()=>{}))},[t,h]),N=t!==null&&h!==t&&r!==null&&r.sections.length>0,P=s.useMemo(()=>({status:g,version:t,entry:r,changelogUrl:i,releasesUrl:u,unread:N,open:S,autoOpenSpent:w,autoOpen:E,markSeen:j}),[g,t,r,i,u,N,S,w,E,j]);return o.jsx(lM.Provider,{value:P,children:e})}function nte(){var k;const e=om(),{running:t,builds:n}=Za(),{loaded:r}=on(),[a]=el(),[i,l]=s.useState(()=>!document.hidden),u=s.useRef(!1),f=cv(),h=AX(),p=f.eligible&&f.welcome===null,g=p||h||((k=f.active)==null?void 0:k.task)==="first-shot"&&!f.active.paused,v=!f.loaded||g;g&&(u.current=!0);const w=s.useRef(!1),{markSeen:y}=e;s.useEffect(()=>{p?w.current=!0:w.current&&(w.current=!1,y())},[p,y]),s.useEffect(()=>{const S=()=>l(!document.hidden);return document.addEventListener("visibilitychange",S),()=>document.removeEventListener("visibilitychange",S)},[]);const x=a.has("settings")||a.has("setup")||a.has("new")||a.has("whatsnew");return s.useEffect(()=>{if(!Jee({unread:e.unread,spent:u.current||e.autoOpenSpent,loaded:r,visible:i,dialogOpen:x,running:t,builds:n.length,firstUse:v}))return;const E=window.setTimeout(()=>{u.current=!0,e.autoOpen()},ete);return()=>window.clearTimeout(E)},[e,r,i,x,t,n.length,v]),null}const cM=s.createContext(null);function Rn(){const e=s.useContext(cM);if(!e)throw new Error("useAppData must be used inside AppShell");return e}function rte(){const e=HW(),[t,n]=s.useState(null),[r,a]=s.useState([]),[i,l]=s.useState(null),u=IW(),f=_W(),h=VW(),p=BW(),g=s.useRef(0),v=s.useRef(new Map),w=s.useRef(0),y=s.useRef(!1),x=s.useCallback(N=>{v.current.set(N.id,++g.current),n(P=>P&&oK(P,N))},[]),k=s.useCallback(async()=>{const N=++g.current;w.current=N;const P=await Re.brands();if(w.current!==N)return;const $=new Set;for(const[M,C]of v.current)C>N&&$.add(M);n(M=>iK(M,P,$))},[]),S=s.useCallback(()=>k().catch(()=>{}),[k]),E=s.useCallback(async()=>{try{await Promise.all([k(),Re.engines().then(a)]),y.current=!0}catch(N){y.current||l(String(N.message??N))}},[k]);s.useEffect(()=>{E(),AW()},[E]);const j=s.useMemo(()=>t===null?null:{brands:t,engines:r,scenes:u.scenes,collections:u.collections,verticals:u.verticals,loaded:u.loaded,error:u.error,refetch:u.refetch,presenters:f.presenters,presenterCategories:f.categories,presenterStyles:f.styles,presentersLoaded:f.loaded,presentersError:f.error,refetchPresenters:f.refetch,demoProducts:h.demoProducts,demoProductCategories:h.categories,demoProductsLoaded:h.loaded,demoProductsError:h.error,showcase:p.showcase,showcaseCategories:p.categories,showcaseLoaded:p.loaded,showcaseError:p.error,refetchShowcase:p.refetch,refresh:E,refreshBrands:S,applyBrand:x},[t,r,u.scenes,u.collections,u.verticals,u.loaded,u.error,u.refetch,f.presenters,f.categories,f.styles,f.loaded,f.error,f.refetch,h.demoProducts,h.categories,h.loaded,h.error,p.showcase,p.categories,p.loaded,p.error,p.refetch,E,S,x]);return i?o.jsx(js,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(dv,{failure:{kind:"unknown",title:"Scenri could not read your library.",fix:"Check that it is still running, then reload.",raw:i,retryable:!0}})}):t===null?o.jsx(js,{align:"center",justify:"center",height:"100vh",children:o.jsx(xr,{size:"3"})}):o.jsx(cM.Provider,{value:j,children:o.jsx(Ij.Provider,{value:e,children:o.jsx(tK,{children:o.jsxs(tte,{children:[o.jsx(FS,{}),o.jsx(uc,{})]})})})})}function Ns(e){const[t,n]=el(),r=t.get(e),a=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!1})},[e,n]),i=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!0})},[e,n]),l=s.useCallback(()=>{n(u=>{const f=new URLSearchParams(u);return f.delete(e),f},{replace:!0})},[e,n]);return{value:r,open:a,set:i,close:l}}function G1(e,t=""){const[n,r]=el(),a=n.get(e)??t,i=s.useCallback(l=>{r(u=>{const f=new URLSearchParams(u);return l===null||l===t?f.delete(e):f.set(e,l),f},{replace:!0})},[e,t,r]);return[a,i]}function Zk(e,t){const n=Vk(t.name),r=zk(t.url);return!n&&!r?null:e.find(a=>{var i,l,u,f;return!!(r&&zk((l=(i=a.json)==null?void 0:i.meta)==null?void 0:l.website)===r||n&&Vk(((f=(u=a.json)==null?void 0:u.meta)==null?void 0:f.name)??a.slug)===n)})??null}const Vk=e=>String(e??"").trim().replace(/\s+/g," ").toLowerCase()||null,zk=e=>{const t=String(e??"").trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).hostname.toLowerCase().replace(/^www\./,"")||null}catch{return null}};function ste(e){const t=e.name.source==="hostname"?{key:"name",found:!1,label:"Name",value:`taken from the address (${e.host})`}:{key:"name",found:!0,label:"Name",value:e.name.value},n=e.logo.status==="primary"?{key:"logo",found:!0,label:"Logo",value:"found on the site"}:e.logo.status==="alternate"?{key:"logo",found:!0,label:"Logo",value:"only a small mark, saved as an alternate"}:{key:"logo",found:!1,label:"Logo",value:"none found"},r=e.colors.count>0?{key:"colors",found:!0,label:"Colours",value:`${e.colors.count} taken from the site`}:{key:"colors",found:!1,label:"Colours",value:"none we could trust"};return[t,n,r]}function ate(e){return e.logo.status!=="primary"||e.colors.count===0||e.name.source==="hostname"}const Kd=(e,t=!1)=>({key:"products",found:t,label:"Products",value:e});function ote(e){switch(e.kind){case"idle":return null;case"scanning":return Kd("looking for a shop");case"timeout":return Kd("this site took too long to search");case"error":return Kd("the search did not finish");case"result":{const{scan:t}=e;if(t.verdict==="none")return null;if(t.verdict==="found"){const n=t.countSource==="sitemap"&&t.count>20;return Kd(`${n?"about ":""}${t.count.toLocaleString()} found`,!0)}return Kd("we could not load the catalogue")}}}function ite(e){return e.kind==="timeout"||e.kind==="error"?!0:e.kind==="result"&&(e.scan.verdict==="blocked"||e.scan.verdict==="likely")}function lte(e){var t;return!e||e.verdict!=="found"?!1:e.candidates.length>0||(((t=e.cards)==null?void 0:t.length)??0)>0}function cte(e,t){const n=e.trim();if(n.length<=t)return n;const r=n.slice(0,t),a=r.lastIndexOf(" ");return`${(a>t*.6?r.slice(0,a):r).replace(/[\s,;:.]+$/,"")}...`}function ute(){var Se,Q,xe,ee,ae,re;const{brands:e,refresh:t}=Rn(),n=Dn(),r=e.length>0,[a,i]=s.useState(""),[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(!1),[v,w]=s.useState(null),[y,x]=s.useState(null),[k,S]=s.useState(!1),[E,j]=s.useState(!1),[N,P]=s.useState(null),[$,M]=s.useState(null),[C,R]=s.useState(null),[T,H]=s.useState(null),D=s.useRef(!1),K=s.useRef(null),O=async(_,ue)=>{D.current=!0,K.current=null,x(_),await t(),n(`${mo(_)}${ue?`?settings=${ue}`:""}`,{replace:!0})};s.useEffect(()=>{const _=()=>{const ue=K.current;!ue||D.current||(K.current=null,fetch(`/api/brands/${ue}`,{method:"DELETE",keepalive:!0}).catch(()=>{}))};return window.addEventListener("pagehide",_),()=>{window.removeEventListener("pagehide",_),_()}},[]);const Z=async(_=!1)=>{var ue,We;if(!_){const Xe=Zk(e,{url:a.trim()});if(Xe){H(Xe);return}}g(!0),w(null);try{const Xe=await Re.brandFromUrl(a);x(Xe),K.current=Xe.id,P(Xe.report),M(((ue=Xe.report)==null?void 0:ue.read)===!1&&((We=Xe.warnings)==null?void 0:We.slice(0,2).join(" "))||null),g(!1)}catch(Xe){w(String(Xe.message??Xe)),g(!1)}},te=async(_=!1)=>{if(!_){const ue=Zk(e,{name:l});if(ue){H(ue);return}}g(!0),w(null);try{await O(await Re.createBrand({specVersion:"0.1",meta:{name:l.trim()||"Untitled brand"}}))}catch(ue){w(String(ue.message??ue)),g(!1)}},B=()=>n("/",{replace:!0}),{scan:F,scanning:X,outcome:z,retry:I}=TA((y==null?void 0:y.id)??null),U=ote(z),G=z.kind==="timeout"||z.kind==="error",ne=async _=>{var ue,We;if(y){R(null),j(!0);try{await Re.catalogImport(y.id,String(((We=(ue=y.json)==null?void 0:ue.meta)==null?void 0:We.website)??a),_)}catch{R("That did not start. Check your connection and try again."),j(!1);return}j(!1),S(!1),await O(y)}},q=y?Zs((Se=y.json)==null?void 0:Se.palette):[],le=y?Fr((Q=eG(y.json))==null?void 0:Q.file):null;return o.jsxs("div",{className:"sc-wiz",children:[o.jsxs("div",{className:"sc-wiz-form",children:[o.jsxs("div",{className:"sc-wiz-head",children:[o.jsxs("button",{type:"button",className:"sc-wiz-back",onClick:B,style:r?void 0:{visibility:"hidden"},children:[o.jsx(ga,{size:11})," Back"]}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("h1",{children:["Your ",o.jsx("em",{children:"brand"})]}),o.jsx("p",{className:"sc-wiz-sub",children:y&&N?o.jsxs(o.Fragment,{children:["Built from ",N.host,". Everything here can be changed later, from Settings."]}):o.jsx(o.Fragment,{children:"Paste a website and the kit builds itself: name, logo, palette. You can also start from nothing and fill it in later from Settings."})}),o.jsxs("div",{className:"sc-wiz-fields",children:[y?o.jsx("div",{style:{textAlign:"center"},children:X?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",disabled:!0,children:[o.jsx(xr,{size:"1"})," Looking for products"]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Skip and add the brand only"})})]}):G?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:I,children:["Look for products again ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Continue without products"})})]}):lte(F)?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>S(!0),children:["Add brand and products ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y),children:"Just the brand"})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>void O(y),children:["Looks right ",o.jsx(Pa,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void O(y,"brand"),children:N&&ate(N)?"Finish the kit first":"Edit the kit first"})})]})}):f?o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-name",children:"Brand name"}),o.jsx("input",{id:"sc-wiz-name",className:"sc-in",placeholder:"Brand name",value:l,onChange:_=>{u(_.target.value),H(null)},onKeyDown:_=>_.key==="Enter"&&l.trim()&&!p&&void te()}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!l.trim()||p,onClick:()=>void te(),children:p?o.jsx(xr,{size:"1"}):o.jsxs(o.Fragment,{children:["Create it ",o.jsx(Pa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!1),H(null)},children:"Build from a website instead"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-url",children:"Website"}),o.jsx("input",{id:"sc-wiz-url",className:"sc-in",placeholder:"acme.com",value:a,onChange:_=>{i(_.target.value),H(null)},onKeyDown:_=>_.key==="Enter"&&a.trim()&&!p&&void Z()}),o.jsx("p",{className:"sc-wiz-hint",children:"We only read public pages. Nothing leaves this machine."}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!a.trim()||p,onClick:()=>void Z(),children:p?o.jsx(xr,{size:"1"}):o.jsxs(o.Fragment,{children:["Build the kit ",o.jsx(Pa,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!0),H(null)},children:"Start from scratch instead"})})]})]}),T&&o.jsxs(J8,{color:"amber",mt:"3",size:"1",children:[o.jsxs(e6,{children:["You already have ",ca(T),". Creating another makes a second workspace with its own address."]}),o.jsxs("div",{style:{display:"flex",gap:10,marginTop:4,flexWrap:"wrap"},children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>n(mo(T)),children:["Open ",ca(T)," instead"]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{H(null),f?te(!0):Z(!0)},children:"Create anyway"})]})]}),v&&o.jsx(J8,{color:"red",mt:"3",size:"1",children:o.jsx(e6,{children:v})})]})]}),o.jsx("div",{className:"sc-wiz-preview",children:o.jsxs("div",{className:"sc-wiz-card",children:[o.jsx("div",{className:"sc-wiz-cap",children:y?"Your kit":p?`Reading ${a||"the site"}`:"Live kit preview"}),o.jsxs("div",{className:"sc-wiz-body",children:[p&&!y&&o.jsxs("div",{className:"sc-scrape-row",children:[o.jsx(xr,{size:"1"})," Reading the site and building the kit"]}),!p&&!y&&o.jsx("p",{style:{color:"var(--sc-fg3)",fontSize:12.5,margin:0},children:"The kit appears here as it is found."}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:q.length?16:0},children:[o.jsx("span",{className:"sc-kit-logo",style:{width:44,height:44,padding:7,borderRadius:12},children:le?o.jsx("img",{src:le,alt:""}):o.jsx(Ws,{size:16,color:"var(--sc-fg3)"})}),o.jsxs("span",{children:[o.jsx("b",{dir:"auto",style:{fontFamily:"var(--sc-font-display)",fontSize:16},children:(ee=(xe=y.json)==null?void 0:xe.meta)==null?void 0:ee.name}),((re=(ae=y.json)==null?void 0:ae.meta)==null?void 0:re.tagline)&&o.jsx("small",{dir:"auto",style:{display:"block",color:"var(--sc-fg3)",fontSize:11.5},children:cte(String(y.json.meta.tagline),72)})]})]}),q.length>0&&o.jsx("div",{style:{display:"flex",gap:8},children:q.slice(0,5).map(_=>o.jsx("span",{style:{flex:1,height:44,borderRadius:9,border:"1px solid var(--sc-line)",background:_.hex}},_.hex))}),N&&o.jsx("ul",{className:"sc-kit-lines",role:"status",children:[...ste(N),...U?[U]:[]].map(_=>o.jsxs("li",{"data-found":_.found?"":void 0,children:[_.key==="products"&&X?o.jsx(xr,{size:"1"}):_.found?o.jsx(Kn,{size:12,weight:"bold"}):o.jsx(WU,{size:12}),o.jsx("span",{className:"sc-kit-line-label",children:_.label}),o.jsx("span",{className:"sc-kit-line-value",children:_.value})]},_.key))}),$&&o.jsx("p",{className:"sc-kit-note",role:"status",children:$}),!X&&!G&&ite(z)&&o.jsx("button",{type:"button",className:"sc-wizpick-open",onClick:I,children:"Try the catalogue again"})]})]})]})}),k&&F&&y&&o.jsx(LA,{brandId:y.id,scan:F,busy:E,error:C,onImport:_=>void ne(_),onImportAll:()=>void ne(),onDismiss:()=>S(!1)})]})}const fu=e=>{const t=(e??"").trim();return t||null};function dte(e){const t=e;return{name:e.name,brand:fu(t.brand)??fu(t.vendor),qualifier:fu(t.format)??fu(t.subcategory)??fu(t.variant)}}function fte(e){return!e.brand||e.name.toLowerCase().startsWith(e.brand.toLowerCase())?e.name:`${e.brand} ${e.name}`}function go(e,t){const n=dte(e);if(t==="chip")return n.name;const r=fte(n);return t==="tooltip"?[r,n.qualifier].filter(Boolean).join(" · "):r}function Qi(e,t){return t==="tooltip"?[e.name,fu(e.lighting)].filter(Boolean).join(" · "):e.name}function Gh(e){return[e.name,...e.legacyNames??[],...e.keywords??[],e.description,e.lighting,e.subject].concat(e.collections??[],e.verticals??[]).filter(Boolean).join(" ")}function Wv(e){const t=e;return[e.name,...t.legacyNames??[],...t.keywords??[],t.brand,t.vendor,t.format,t.subcategory,t.variant,t.productType,...t.tags??[]].filter(Boolean).join(" ")}function Yh(e){return[e.name,e.descriptor,e.presentation,e.ageRange,e.facial,e.skin,e.hair,e.build,e.wardrobeDefault,...e.suitableCategories,...e.suitableStyles].filter(Boolean).join(" ")}function hte(e,t,n){return[e.title,e.category,n,t.product?Wv(t.product):null,t.presenter?Yh(t.presenter):null,t.scene?Gh(t.scene):null].filter(Boolean).join(" ")}function Kv(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?presenter=${encodeURIComponent(r)}&compose=1`)},[n,t])}function im(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback((r,a)=>{const i=a?`&setup=${encodeURIComponent(a)}`:"";t(`${n}?scene=${encodeURIComponent(r)}${i}&compose=1`)},[n,t])}function $6(e){return{...e.brief,...e.variants?{variants:e.variants}:{},...e.quality?{quality:e.quality}:{},_at:Date.now()}}function pte(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?showcase=${encodeURIComponent(r)}`)},[n,t])}const vh=e=>`sc-favscenes-${e}`,mte=e=>`sc-favlooks-${e}`,gte=e=>`bt-favlooks-${e}`;function uM(e,t){return e==="presenter"?`sc-favpresenters-${t}`:e==="product"?`sc-favproducts-${t}`:vh(t)}function dM(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function vo(e){try{const t=localStorage.getItem(vh(e))??r6(mte(e),vh(e))??r6(gte(e),vh(e));return dM(t)}catch{return[]}}function lm(e,t){try{return e==="scene"?vo(t):dM(localStorage.getItem(uM(e,t)))}catch{return[]}}function fM(e,t,n){try{localStorage.setItem(uM(e,t),JSON.stringify(n))}catch{}}function cm(e,t,n){const r=lm(e,t),a=r.includes(n)?r.filter(i=>i!==n):[...r,n];return fM(e,t,a),a}function Gv(e,t,n,r){const a=lm(e,t),i=r?[...a,...n.filter(l=>!a.includes(l))]:a.filter(l=>!n.includes(l));return fM(e,t,i),i}const hM=[{key:"campaign",label:"Product campaign"},{key:"lifestyle",label:"Lifestyle"},{key:"editorial",label:"Fashion & editorial"},{key:"beauty",label:"Beauty"},{key:"food-drink",label:"Food & drink"},{key:"launch",label:"Tech launch"},{key:"social",label:"Social"},{key:"cinematic",label:"Cinematic"},{key:"catalog",label:"Catalog"},{key:"seasonal",label:"Seasonal"}],vte=new Map(hM.map(e=>[e.key,e]));function qg(e){var t;return e?((t=vte.get(e))==null?void 0:t.label)??e:null}function wte(e){const t=new Map(hM.map((n,r)=>[n.key,r]));return[...e].sort((n,r)=>(t.get(n)??99)-(t.get(r)??99)||n.localeCompare(r))}const Ru=14,yte=768,sc=[{px:190,label:"Compact",cells:3,cols:6,min:200},{px:320,label:"Large",cells:2,cols:5,min:280}];function bte(e){let t=sc[0];for(const n of sc)Math.abs(n.px-e)<Math.abs(t.px-e)&&(t=n);return t}const pM=320;function mM(e){const t=typeof e=="number"&&Number.isFinite(e)?e:pM;let n=sc[0].px;for(const r of sc)Math.abs(r.px-t)<Math.abs(n-t)&&(n=r.px);return n}const zu=5;function jc(e){const t=typeof e=="number"?e:zu;return t===7||t===5?t:t===6?5:zu}function xte(e){const[t,n]=s.useState(0);return s.useLayoutEffect(()=>{if(!e)return;const r=e.clientWidth;n(a=>a===r?a:r)}),s.useLayoutEffect(()=>{if(!e)return;const r=()=>{const i=e.clientWidth;n(l=>l===i?l:i)};r();const a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}function kte(){const[e,t]=s.useState(()=>window.innerWidth);return s.useEffect(()=>{let n=0;const r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>t(window.innerWidth))};return window.addEventListener("resize",r),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r)}},[]),e}function Xg(e,t){return Math.max(1,Math.floor((e-Ru*(t-1))/t))}function Ste(e,t,n){if(e<=0)return{tile:t,cols:1};if(n)return{tile:Math.floor((e-Ru)/2),cols:2};const r=sc[1],a=sc[0],i=Math.min(r.cols,Math.max(1,Math.floor((e+Ru)/(r.min+Ru))));if(bte(t).px===r.px)return{tile:Xg(e,i),cols:i};let l=Math.min(a.cols,i+1);return l>1&&Xg(e,l)<a.min&&(l=i),{tile:Xg(e,l),cols:l}}function Bk(e){return Math.max(1,e)}function um(e){return jc(e)===5?"large":"compact"}const Nf=s.createContext("large");function Ete(){return s.useContext(Nf)}const Cte=[{value:7,label:"Compact",hint:"More cards per row",cells:3},{value:5,label:"Large",hint:"Fewer, larger cards",cells:2}],jte=sc.map(e=>({value:e.px,label:e.label,hint:e.label==="Compact"?"More shots per row":"Fewer, larger shots",cells:e.cells}));function dm({value:e,onChange:t}){return o.jsx(gM,{label:"Grid size",value:jc(e),options:Cte,onChange:n=>t(n)})}function Ate({value:e,onChange:t}){return o.jsx(gM,{label:"Shot size",value:mM(e),options:jte,onChange:t})}function gM({label:e,value:t,options:n,onChange:r}){const a=s.useRef(null);return s.useLayoutEffect(()=>{const i=a.current;if(!i)return;const l=()=>{const f=i.querySelector(":scope > button[data-on]");if(!f){i.style.setProperty("--sc-density-x","0px"),i.style.setProperty("--sc-density-w","0px");return}i.style.setProperty("--sc-density-x",`${f.offsetLeft}px`),i.style.setProperty("--sc-density-w",`${f.offsetWidth}px`)};l(),i.dataset.inkReady||requestAnimationFrame(()=>{i.dataset.inkReady=""});const u=new ResizeObserver(l);return u.observe(i),()=>u.disconnect()},[t]),o.jsxs("div",{ref:a,className:"sc-density",role:"radiogroup","aria-label":e,children:[o.jsx("span",{className:"sc-density-ink","aria-hidden":!0}),n.map(i=>{const l=t===i.value;return o.jsx("button",{type:"button",role:"radio",className:"sc-density-opt","aria-checked":l,"aria-label":i.label,title:i.hint,"data-on":l||void 0,onClick:()=>{l||r(i.value)},children:o.jsx(Nte,{cells:i.cells})},i.value)})]})}function Nte({cells:e}){const t=e,n=16,r=1.5,a=1.5,l=(n-r*2-a*(t-1))/t,u=Math.max(.6,l*.22),f=[];for(let h=0;h<t;h++)for(let p=0;p<t;p++)f.push({x:r+p*(l+a),y:r+h*(l+a)});return o.jsx("svg",{className:"sc-density-icon",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:f.map(h=>o.jsx("rect",{x:h.x,y:h.y,width:l,height:l,rx:u,ry:u,fill:"currentColor"},`${h.x}-${h.y}`))})}function fm(e){return{"--sc-wall-cols":String(jc(e))}}function Mte(e,t){let r=null,a=null,i=null,l=null,u=null,f=null,h=null,p={dx:0,dy:0},g={w:0,h:0},v=0;const w=R=>{R.style.position="fixed",R.style.left="0",R.style.top="0",R.style.margin="0",R.style.zIndex="var(--sc-z-popover)",R.style.pointerEvents="none"},y=()=>{const R=T=>{var H,D;window.removeEventListener("click",R,!0),!((D=(H=T.target).closest)!=null&&D.call(H,'[data-role="remove"]'))&&(T.stopPropagation(),T.preventDefault())};window.addEventListener("click",R,!0),setTimeout(()=>window.removeEventListener("click",R,!0),250)},x=()=>{if(h!==null){try{e.releasePointerCapture(h)}catch{}h=null}i==null||i.remove(),l==null||l.remove(),i=null,l=null,u=null,a==null||a.removeAttribute("data-drag-src"),a=null,r=null,e.removeAttribute("data-chip-drag"),document.documentElement.style.cursor="",cancelAnimationFrame(v)},k=R=>{!e.isConnected||!e.contains(document.activeElement)||(f!==null?Ra(e,f):Vl(e,R,"after"))},S=()=>{if(!a)return;const R=a;x(),y(),k(R),t.onCancelled()},E=R=>{if(R.button!==0||R.pointerType==="touch")return;const T=R.target;if(T.closest('[data-role="remove"]'))return;const H=Pi(T);H&&(r={chip:H,x:R.clientX,y:R.clientY})},j=R=>{var H,D;if(!r)return;f=Do(e),a=r.chip,t.onDragStart(),(H=window.getSelection())==null||H.removeAllRanges(),e.setAttribute("data-chip-drag","");const T=a.getBoundingClientRect();p={dx:r.x-T.left,dy:r.y-T.top},r=null;try{e.setPointerCapture(R.pointerId),h=R.pointerId}catch{}document.documentElement.style.cursor="grabbing",i=a.cloneNode(!0),(D=i.querySelector('[data-role="remove"]'))==null||D.remove(),i.className=`${a.className} sc-chip-ghost`,i.removeAttribute("data-drag-src"),i.removeAttribute("title"),w(i),i.style.width=`${T.width}px`,i.style.height=`${T.height}px`,i.style.fontSize=getComputedStyle(a).fontSize,g={w:T.width,h:T.height},document.body.appendChild(i),a.setAttribute("data-drag-src",""),l=document.createElement("div"),l.className="sc-drop-caret",w(l),l.style.display="none",document.body.appendChild(l),N(R)},N=R=>{if(!i||!a)return;const T=Math.min(Math.max(4,R.clientX-p.dx),window.innerWidth-g.w-4),H=Math.min(Math.max(4,R.clientY-p.dy),window.innerHeight-g.h-4);i.style.transform=`translate3d(${T}px, ${H}px, 0)`;const D=Xx(e,a,R.clientX,R.clientY);if(u=D,!l)return;const K=D&&!D.noop?Uk(e,D.units):null;if(!K||!D){l.style.display="none";return}const O=JX(e,D.units),Z=O<D.units?Uk(e,O):null,te=!!Z&&Math.abs(Z.top+Z.height/2-(K.top+K.height/2))<K.height/2,B=Z&&te?(Z.left+K.left)/2:K.left;l.style.display="",l.style.transform=`translate3d(${B-1.5}px, ${K.top-2}px, 0)`,l.style.height=`${K.height+4}px`},P=R=>{if(r){if(Math.hypot(R.clientX-r.x,R.clientY-r.y)<5)return;R.preventDefault(),j(R);return}if(!a)return;R.preventDefault(),cancelAnimationFrame(v);const{clientX:T,clientY:H}=R;v=requestAnimationFrame(()=>N({clientX:T,clientY:H}))},$=R=>{if(r){r=null;return}if(!a)return;const T=a;let H;try{H=Xx(e,T,R.clientX,R.clientY)??u}catch{H=u}finally{x()}if(y(),H&&!H.noop&&CN(e,T,H.units)){Vl(e,T,"after"),t.onMoved(T,N6(e,T));return}k(T),t.onCancelled()},M=R=>{R.key==="Escape"&&a&&(R.stopPropagation(),S())},C=R=>{Pi(R.target)&&R.preventDefault()};return e.addEventListener("pointerdown",E),e.addEventListener("dragstart",C),e.addEventListener("lostpointercapture",S),window.addEventListener("pointermove",P),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",S),window.addEventListener("blur",S),window.addEventListener("keydown",M,!0),()=>{x(),e.removeEventListener("pointerdown",E),e.removeEventListener("dragstart",C),e.removeEventListener("lostpointercapture",S),window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",S),window.removeEventListener("blur",S),window.removeEventListener("keydown",M,!0)}}function Uk(e,t){let n=0;const r=Array.from(e.childNodes);for(let l=0;l<r.length;l++){const u=r[l],f=Vu(u),h=u.nodeType===Node.TEXT_NODE&&t===n+f&&l<r.length-1;if(t<=n+f&&!h){if(u.nodeType!==Node.TEXT_NODE){const v=u.getBoundingClientRect();return new DOMRect(t===n?v.left:v.right,v.top,0,v.height)}const p=document.createRange();p.setStart(u,Zh(u,Math.max(0,Math.min(t-n,f)))),p.collapse(!0);const g=p.getBoundingClientRect();return g.height?g:null}n+=f}const i=(e.lastElementChild??e).getBoundingClientRect();return new DOMRect(i.right,i.top,0,i.height||18)}function Rte({kind:e,label:t,thumb:n,onInspect:r,onMove:a,onRemove:i,onClose:l}){const{sheet:u,grip:f}=ed(()=>l("dismiss")),h=e==="mark"?"brand mark":"reference image";return o.jsx(fc,{open:!0,onOpenChange:p=>!p&&l("dismiss"),children:o.jsxs(hc,{children:[o.jsx(pc,{className:"sc-shotsheet-scrim"}),o.jsxs(mc,{ref:u,className:"sc-shotsheet sc-swapsheet","data-kind":e,"aria-describedby":void 0,onOpenAutoFocus:p=>{var g;p.preventDefault(),(g=u.current)==null||g.focus({preventScroll:!0})},onCloseAutoFocus:p=>p.preventDefault(),onEscapeKeyDown:p=>{p.preventDefault(),l("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...f,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(gc,{className:"sc-vh",children:["Move or remove ",h]})]}),o.jsxs("div",{className:"sc-movesheet-head",children:[n&&o.jsx("button",{type:"button",className:"sc-movesheet-face",onClick:r,"aria-label":`Open ${h}`,children:o.jsx("img",{src:n,alt:"",onError:p=>p.currentTarget.remove()})}),o.jsxs("span",{className:"sc-movesheet-txt",children:[o.jsx("b",{dir:"auto",children:t||h}),o.jsx("span",{children:h})]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(-1),children:[o.jsx(av,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),i&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:i,children:[o.jsx(il,{size:13}),"Remove ",e==="mark"?"mark":"reference"]})]})]})]})})}const Pte=440,Lte=460,Wk=156,vM=8,wh=14,Qg=20,hr=12,wM=200,Tte=240,yM=204;function $te(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min(n==null?void 0:n.width,t.width-hr*2),i=e.right+wh+r+hr<=t.width?e.right+wh:Math.max(hr,e.left-wh-r),l=Math.max(hr,Math.min(e.top,t.height-hr-yM));return{left:i,top:l,width:r,maxHeight:Math.max(wM,t.height-l-hr),side:"beside"}}function Dte(e,t){const n=(r,a)=>Math.min(Math.max(r,Qg),Math.max(Qg,a-Qg));return t.side==="beside"?{edge:t.left>=e.right?"left":"right",x:0,y:n((e.top+e.bottom)/2-t.top,yM)}:{edge:t.side==="above"?"bottom":"top",x:n((e.left+e.right)/2-t.left,t.width),y:0}}function Hte(e,t,n,r){if(e.bottom<0||e.top>t.height)return null;const a=vM,i=Math.min(n.width,t.width-hr*2),l=n.height,u=Math.min(Math.max(e.left+(e.right-e.left)/2-i/2,hr),Math.max(hr,t.width-i-hr)),h=e.top-a-hr>=l?e.top-a-l:Math.min(e.bottom+a,Math.max(hr,t.height-l-hr));return{left:u,top:h}}function Yv(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min((n==null?void 0:n.width)??Pte,t.width-hr*2),a=(n==null?void 0:n.gap)??vM,i=e.top-a-hr,l=t.height-e.bottom-a-hr,u=i>=Tte||i>=l?"above":"below",h=Math.max(wM,Math.min(Lte,u==="above"?i:l)),p=Math.min(Math.max(e.left,hr),Math.max(hr,t.width-r-hr)),g=u==="above"?Math.max(hr,e.top-a-h):e.bottom+a;return u==="above"?{left:p,top:g,width:r,maxHeight:h,side:u,bottomEdge:e.top-a}:{left:p,top:g,width:r,maxHeight:h,side:u}}function bM(e){return e.side==="above"&&e.bottomEdge!==void 0?{left:e.left,width:e.width,maxHeight:e.maxHeight,top:"auto",bottom:window.innerHeight-e.bottomEdge}:{left:e.left,width:e.width,maxHeight:e.maxHeight,top:e.top}}const Ote=["ref","mark","product","presenter","scene","shot"],yh=e=>Ote.includes(e),xM={ref:"Reference image",mark:"Brand mark",product:"Product",presenter:"Presenter",scene:"Scene",shot:"Shot"};function Ite(e){return e.side==="below"||e.side==="beside"?{top:Math.round(e.top)}:{bottom:Math.round(window.innerHeight-(e.top+e.maxHeight))}}function ad({anchor:e,kind:t,src:n,label:r,warning:a,note:i,noun:l,side:u="auto",onOpen:f,onHoverIn:h,onHoverOut:p,onClose:g}){const[v,w]=s.useState(null),[y,x]=s.useState(!1);if(s.useEffect(()=>x(!1),[n]),s.useLayoutEffect(()=>{var E,j;const S=()=>{const N=window.visualViewport,P=e.getBoundingClientRect(),$={width:(N==null?void 0:N.width)??window.innerWidth,height:(N==null?void 0:N.height)??window.innerHeight},M=u==="beside"?$te(P,$,{width:Wk}):Yv(P,$,{width:Wk,gap:wh});if(!M){g();return}w({...M,tail:Dte(P,M)})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),(E=window.visualViewport)==null||E.addEventListener("resize",S),(j=window.visualViewport)==null||j.addEventListener("scroll",S),()=>{var N,P;window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0),(N=window.visualViewport)==null||N.removeEventListener("resize",S),(P=window.visualViewport)==null||P.removeEventListener("scroll",S)}},[e,u,g]),s.useEffect(()=>{const S=E=>{E.key==="Escape"&&g()};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[g]),!v)return null;const k=l??xM[t];return Rr.createPortal(o.jsxs("div",{className:"sc-chip-preview","data-kind":t,"data-side":v.side,"aria-hidden":"true",style:{left:Math.round(v.left),...Ite(v),maxWidth:v.width,maxHeight:v.maxHeight},onPointerEnter:h,onPointerLeave:p,children:[o.jsx("span",{className:"sc-chip-preview-tail","data-edge":v.tail.edge,style:v.tail.edge==="left"||v.tail.edge==="right"?{top:Math.round(v.tail.y)}:{left:Math.round(v.tail.x)}}),o.jsxs("button",{type:"button",className:"sc-chip-preview-hit",tabIndex:-1,onClick:f,children:[y?o.jsxs("span",{className:"sc-chip-preview-plate sc-chip-preview-blank",children:[o.jsx(Ws,{size:20}),"Image unavailable"]}):o.jsx("img",{className:"sc-chip-preview-plate",src:n,alt:"",decoding:"async",onError:()=>x(!0)}),r&&o.jsx("b",{dir:"auto",children:r}),k&&o.jsx("span",{children:k})]}),i&&o.jsx("p",{className:"sc-chip-preview-note",children:i}),a&&o.jsx("p",{className:"sc-swap-warn",children:a})]}),document.body)}const Fte=160,_te=120;function od(){const[e,t]=s.useState(null),n=s.useRef(null),r=s.useRef(!1);r.current=e!==null;const a=s.useCallback(()=>{n.current&&clearTimeout(n.current),n.current=null},[]),i=s.useCallback(f=>{if(a(),r.current){t(f);return}n.current=setTimeout(()=>t(f),Fte)},[a]),l=s.useCallback(()=>{a(),n.current=setTimeout(()=>t(null),_te)},[a]),u=s.useCallback(()=>{a(),t(null)},[a]);return s.useEffect(()=>a,[a]),{shown:e,open:i,keep:a,close:l,closeNow:u}}const i0="sc-insert-menu";function Zte(e){var t;return!!(((t=e.nativeEvent)==null?void 0:t.isComposing)??e.isComposing)||e.keyCode===229}function Vte(e){return e==="/"?"Scenes":e==="@"?"Presenters":e==="#"?"Colors":"Products"}function zte(e){return e==="/"?"No matching scenes":e==="#"?"No matching colours":e==="@"?"No matching presenters":"No matching products"}function Bte({menuOpen:e,handled:t}){return!e&&!t}function Ute(e,t){return t||!e?{open:!1}:{open:!0,sigil:e.sigil,query:e.query}}function Wte(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return[{text:e,hit:!1}];const r=e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase());if(r<0)return[{text:e,hit:!1}];const a=r+n.length;return[...r>0?[{text:e.slice(0,r),hit:!1}]:[],{text:e.slice(r,a),hit:!0},...a<e.length?[{text:e.slice(a),hit:!1}]:[]]}function Kte(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.right-e.left,h:e.bottom-e.top}}function Gte(e,t){return{left:e.left+t.x,top:e.top+t.y,right:e.left+t.x+t.w,bottom:e.top+t.y+t.h}}function Yte(e,t,n){return n?t:e||t}function qte(e,t){return!t||e==null?!0:e===t?!1:!t.contains(e)}function Jg(e,t){return e===t?!0:!e||!t?!1:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.maxHeight===t.maxHeight&&e.side===t.side&&e.shell===t.shell}function Xte(e,t,n){return Math.min(n,Math.max(0,e)+Math.max(0,t))}function Qte(e,t,n){return n>0&&t>0&&e!==t}function Jte(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.bottom>r.bottom?e.scrollTop+=n.bottom-r.bottom:n.top<r.top&&(e.scrollTop-=r.top-n.top)}const kM=320,qh=320,ene=280,Il=8,$l=12,tne=8,Kk=80,nne=120,SM=48;function EM(e,t){return!(!e||e.top===0&&e.left===0&&e.right===0&&e.bottom===0||e.bottom<0||e.top>t.height||e.right-e.left>SM)}function rne(e){return{top:e.top,bottom:Math.min(e.bottom,e.top+22),left:e.left,right:e.left+2}}function CM(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n.width-t-r))}function D6(e,t,n,r){const a=n?tne:$l,i=n?Math.max(0,e.right-e.left):Math.min(kM,t.width-a*2),l=n?e.left:CM(e.left,i,t,a),u=n?Math.min(ene,Math.floor(t.height*.4)):qh,f=Math.min(u,r??u),h=e.top-Il-a,p=Math.max(0,Math.min(f,h)),g=Math.max(a,e.top-Il-p);return{left:l,top:g,width:i,maxHeight:p,side:"above",shell:"dock"}}function Gk(e,t,n,r){const a=Math.min(kM,n.width-$l*2),i=CM(e.left,a,n,$l),l=e.top-Il-$l,u=n.height-e.bottom-Il-$l,f=l>=nne||l>=u?"above":"below",h=Math.min(qh,r??qh),p=f==="above"?l:u,g=Math.min(h,r==null?Math.max(Kk,p):p);if(f==="above"){const w=Math.max($l,e.top-Il-Math.min(h,l)),y=Math.min(h,e.top-Il-w);return r==null&&y<Kk?D6(t,n,!1):{left:i,top:w,width:a,maxHeight:y,side:f,shell:"caret"}}const v=e.bottom+Il;return v+Math.min(g,u)>n.height-$l?D6(t,n,!1,r):{left:i,top:v,width:a,maxHeight:Math.min(h,u),side:f,shell:"caret"}}function sne(e,t,n,r={}){if(r.phone)return D6(t,n,!0,r.height);const a=r.line??t;if(EM(e,n)&&e)return Gk(e,t,n,r.height);const i=e&&e.right-e.left>SM?e:a;return Gk(rne(i),t,n,r.height)}function ane({anchor:e,composer:t,line:n,query:r,options:a,remaining:i=0,total:l=0,sigil:u,onMore:f,onActiveId:h,onClose:p}){const g=wr(Ks),[v,w]=s.useState(0),[y,x]=s.useState(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),j=s.useRef(null),N=`${u??""}\0${r}`,P=s.useRef({}),$=s.useRef(f);$.current=f;const M=s.useRef(i);M.current=i;const C=s.useRef(0),R=s.useCallback(()=>{var O;Qte(C.current,a.length,M.current)&&(C.current=a.length,(O=$.current)==null||O.call($))},[a.length]);s.useEffect(()=>{w(0),C.current=0},[r]),s.useEffect(()=>{w(O=>Math.min(O,Math.max(0,a.length-1)))},[a.length]),s.useEffect(()=>{j.current=null,P.current={}},[u]);const T=s.useCallback(O=>{var ne;const Z=t==null?void 0:t.getBoundingClientRect();if(!Z)return null;const te=(n==null?void 0:n.getBoundingClientRect())??Z,B=window.visualViewport,F={width:(B==null?void 0:B.width)??window.innerWidth,height:(B==null?void 0:B.height)??window.innerHeight},X=!!((ne=k.current)!=null&&ne.contains(document.activeElement)),z=X?null:bN(),I=z&&EM(z,F)?z:null;I&&(j.current=Kte(I,te));const U=j.current?Gte(te,j.current):null,G=Yte(I,U,X)??(X?null:(e==null?void 0:e.getBoundingClientRect())??null);return sne(G,Z,F,{phone:g,line:te,height:O})},[e,t,n,g]);s.useLayoutEffect(()=>{var B,F;P.current.sigil!==u&&(P.current={sigil:u});const O=()=>{const X=M.current>0?void 0:P.current.height,z=T(X);x(I=>Jg(I,z)?I:z)},Z=X=>{qte(X.target,k.current)&&O()};O();const te=requestAnimationFrame(O);return window.addEventListener("resize",O),window.addEventListener("scroll",Z,!0),(B=window.visualViewport)==null||B.addEventListener("resize",O),(F=window.visualViewport)==null||F.addEventListener("scroll",O),()=>{var X,z;cancelAnimationFrame(te),window.removeEventListener("resize",O),window.removeEventListener("scroll",Z,!0),(X=window.visualViewport)==null||X.removeEventListener("resize",O),(z=window.visualViewport)==null||z.removeEventListener("scroll",O)}},[e,t,n,g,u,T]),s.useLayoutEffect(()=>{if(!y||!k.current)return;if(i>0){if(P.current.height==null&&P.current.sigil===(u??""))return;P.current={sigil:u??""};const X=T();X&&!Jg(y,X)&&x(X);return}const O=k.current,Z=S.current,te=Z?O.offsetHeight-Z.clientHeight:O.offsetHeight,B=Xte(te,(Z==null?void 0:Z.scrollHeight)??0,qh);if(!(B>0)||P.current.height===B&&P.current.sigil===(u??""))return;P.current={sigil:u??"",height:B};const F=T(B);!F||Jg(y,F)||x(F)},[y,N,T,i,a.length,u]),s.useLayoutEffect(()=>{const O=Z=>{Z.isComposing||Z.keyCode===229||(Z.key==="ArrowDown"?(Z.preventDefault(),v>=a.length-1?R():w(te=>te+1)):Z.key==="ArrowUp"?(Z.preventDefault(),w(te=>Math.max(0,te-1))):(Z.key==="Enter"||Z.key==="Tab")&&a[v]?(Z.preventDefault(),a[v].run()):Z.key==="Escape"&&(Z.preventDefault(),p()))};return window.addEventListener("keydown",O,!0),()=>window.removeEventListener("keydown",O,!0)},[a,v,p,R]),s.useEffect(()=>{const O=S.current,Z=O==null?void 0:O.querySelector('[data-active="true"]');O&&Z&&Jte(O,Z)},[v]),s.useEffect(()=>{const O=E.current,Z=S.current;if(!O||!Z)return;const te=new IntersectionObserver(B=>{Z.scrollTop<=0||B.some(F=>F.isIntersecting)&&R()},{root:Z,rootMargin:"0px 0px 8px 0px"});return te.observe(O),()=>te.disconnect()},[y,N,R]);const H=a[v]?`${i0}-opt-${v}`:null;if(s.useEffect(()=>(h==null||h(H),()=>h==null?void 0:h(null)),[H,h]),s.useEffect(()=>{const O=Z=>{Z.target.closest(".sc-cmd")||(M6(Z),p())};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[p]),!y)return null;const D=`${i0}-list`,K=Vte(u);return Rr.createPortal(o.jsx("div",{className:"sc-cmd",id:i0,"data-shell":y.shell,style:{left:y.left,top:y.top,width:y.width,maxHeight:y.maxHeight,height:y.side==="above"&&i>0?y.maxHeight:void 0},ref:k,children:o.jsxs("div",{className:"sc-cmd-list",ref:S,role:"listbox","aria-label":K,id:D,children:[a.length?a.map((O,Z)=>{var B;const te=Z===0||O.group!==((B=a[Z-1])==null?void 0:B.group);return o.jsxs("div",{children:[te&&o.jsx(Yk,{name:O.group,total:l}),o.jsxs("button",{type:"button",id:`${i0}-opt-${Z}`,className:"sc-cmd-row",role:"option","aria-selected":Z===v,"data-active":Z===v,onMouseEnter:()=>w(Z),onMouseDown:F=>M6(F),onClick:()=>O.run(),children:[O.thumb?o.jsx("img",{src:O.thumb,alt:"","data-crop":O.crop}):O.swatch?o.jsx("span",{className:"sc-cmd-swatch",style:{background:O.swatch}}):null,o.jsx(one,{text:O.label,query:r}),O.hint&&o.jsx("span",{className:"sc-cmd-hint",children:O.hint})]})]},O.key)}):o.jsxs(o.Fragment,{children:[o.jsx(Yk,{name:K,total:l}),o.jsx("div",{className:"sc-cmd-empty",children:zte(u)})]}),i>0&&a.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-cmd-count","aria-live":"polite",children:[a.length," of ",l]}),o.jsx("div",{ref:E,className:"sc-cmd-sentinel","aria-hidden":!0})]})]})}),document.body)}function Yk({name:e,total:t}){return o.jsxs("div",{className:"sc-cmd-group",children:[e," ",o.jsx("span",{className:"sc-cmd-n",children:t})]})}function one({text:e,query:t}){return o.jsx("span",{className:"sc-cmd-label",children:Wte(e,t).map(n=>n.hit?o.jsx("b",{children:n.text},`h:${n.text}`):o.jsx("span",{children:n.text},`t:${n.text}`))})}const ine={fragrance:["Fragrance"],footwear:["Footwear"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]},lne={fragrance:["Fragrance"],footwear:["Footwear","Apparel"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]};function cne(e,t){if(!t)return!1;const n=ine[t];return!!n&&n.some(r=>e.verticals.includes(r))}function une(e,t){if(!t)return!1;const n=lne[t];return!!n&&n.some(r=>e.suitableCategories.includes(r))}function qk(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[\u200e\u200f\u061c\u202a-\u202e\u2066-\u2069]/g,"").toLowerCase()}const dne=4;function wo(e,t){const n=qk(t).trim().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=qk(e);return n.every(a=>r.includes(a)||a.length>=dne&&a.endsWith("s")&&r.includes(a.slice(0,-1)))}function qv(e,t){return{visible:e.slice(0,t),remaining:Math.max(0,e.length-t)}}function jM(e,t){return[...e].sort((n,r)=>Number(t(r))-Number(t(n)))}function AM(e,t){if(e.t==="product"){const n=t.products.find(a=>a.id===e.id)??null,r=n?null:t.demoProducts.find(a=>a.id===e.id)??null;return{kind:"product",product:n,demo:r}}if(e.t==="character"){const n=t.cast.find(a=>a.id===e.id)??null,r=n?null:t.presenters.find(a=>a.id===e.id)??null;return{kind:"presenter",character:n,presenter:r}}if(e.t==="template"){const n=t.scenes.find(r=>r.id===e.id)??null;return{kind:"scene",scene:n,custom:!!n&&"custom"in n&&!!n.custom}}return null}const Mf={product:"product",presenter:"presenter",scene:"scene"},Fi=48;function fne(e){return e?e.t==="product"?"product":e.t==="character"?"presenter":e.t==="template"?"scene":null:null}function hu(e){const t=fne(e);return t||((e==null?void 0:e.t)==="color"?"color":null)}function hne(e){const t=hu(e);return t||((e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.t:null)}function e8(e){return(e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.imageHash:null}const g0=e=>{const t=(e??"").trim();return t||void 0},Xk=e=>(e==null?void 0:e.custom)===!0;function _i(e,t){return e==="product"?[...(t.libraryProducts.length?t.libraryProducts:t.brandProducts).map(r=>{var a,i;return Qk(r,"brand",Bp((i=(a=r.shots)==null?void 0:a[0])==null?void 0:i.file,"tile"))}),...t.demoProducts.map(r=>Qk(r,"catalog",r.previewUrl??null))]:e==="presenter"?[...t.presenters.map(n=>{const r=ti(n);return{kind:"presenter",id:n.id,label:n.name,full:[n.name,g0(n.descriptor)].filter(Boolean).join(" · "),sub:g0(n.descriptor),search:Yh(n),thumb:sr(r.src,"tile"),crop:r.crop,source:Xk(n)?"brand":"catalog",recommended:une(n,t.productCategory),token:{t:"character",id:n.id}}}),...t.cast.map(n=>{const r=xv(n);return{kind:"presenter",id:n.id,label:n.name,full:n.name,search:n.name,thumb:sr(r.src,"tile"),crop:r.crop,source:"brand",token:{t:"character",id:n.id}}})]:t.scenes.map(n=>({kind:"scene",id:n.id,label:Qi(n,"card"),full:Qi(n,"tooltip"),sub:g0(n.lighting),search:Gh(n),thumb:sr(n.previewUrl??null,"tile"),tint:Mu(n.previewColor),source:Xk(n)?"brand":"catalog",recommended:cne(n,t.productCategory),token:{t:"template",id:n.id}}))}function Qk(e,t,n){return{kind:"product",id:e.id,label:go(e,"chip"),full:go(e,"tooltip"),sub:pne(e),search:Wv(e),thumb:n,source:t,token:{t:"product",id:e.id}}}function pne(e){const t=e;return g0(t.brand)??g0(t.vendor)}function Pu(e,t){const n=t.trim();return n?e.filter(r=>wo(r.search,n)):e}function Jk(e,t,n){return t.source==="brand"?0:e==="scene"?n.has(t.id)?1:t.recommended?2:3:e==="presenter"?t.recommended?1:2:1}function hm(e,t,n){const r=n.currentId?t.find(h=>h.id===n.currentId)??null:null,a=r?t.filter(h=>h.id!==r.id):t,l=[...Pu(a,n.query)].sort((h,p)=>Jk(e,h,n.bookmarked)-Jk(e,p,n.bookmarked)).map(h=>n.bookmarked.has(h.id)?{...h,bookmarked:!0}:h),{visible:u,remaining:f}=qv(l,n.shown??Fi);return{current:r,items:u,remaining:f,total:l.length}}const mne={$:"product","/":"scene","@":"presenter"},NM={Products:8,Presenters:8,Colors:16,Scenes:8},MM={$:"Products","/":"Scenes","@":"Presenters","#":"Colors"};function Gd(e){return NM[MM[e??"$"]]}function RM(e){return{key:`${e.kind}:${e.id}`,group:e.kind==="presenter"?"Presenters":e.kind==="scene"?"Scenes":"Products",label:e.label,hint:e.sub,search:e.search,thumb:e.thumb??void 0,crop:e.crop,token:e.token}}function gne(e,t,n){return hm(e,t,{currentId:null,query:"",bookmarked:n,shown:t.length}).items.map(RM)}function e5(e,t){const{visible:n,remaining:r}=qv(e,t);return{items:n,remaining:r,total:e.length}}function vne(e,t,n={query:""}){const r=n.query.trim(),a=n.bookmarked??new Set,i=n.shown??NM[MM[e]];if(e==="#"){const h=(t.colors??[]).map(wne),p=r?h.filter(g=>wo(g.search??g.label,r)):h;return e5(p,i)}const l=mne[e],u=l==="product"?t.products:l==="presenter"?t.presenters:t.scenes??[],f=r?Pu(u,r).map(RM):gne(l,u,a);return e5(f,i)}function wne(e){return{key:`color:${e.hex}`,group:"Colors",label:e.name,hint:e.hex,search:`${e.name} ${e.hex}`,swatch:e.hex,token:{t:"color",hex:e.hex,name:e.name||void 0}}}const yne="(pointer: coarse)";function bne(e){return wr(Ks)?o.jsx(Cne,{...e}):o.jsx(Ene,{...e,onMove:void 0})}function xne(){return!wr(yne)}const kne=e=>`Remove ${Mf[e]}`;function Sne(e,t,n){const r={slug:t};return e==="product"?la(r,n):e==="presenter"?ha(r,n):_r(r,n)}function PM({kind:e,currentId:t,candidates:n,brandId:r,brandSlug:a,warning:i,note:l,onPick:u,onRemove:f,onClose:h,onAttachRequest:p,onMove:g,autoFocusSearch:v}){const[w,y]=s.useState(""),[x,k]=s.useState(Fi),S=s.useRef(null),E=s.useRef(null),[j,N]=s.useState(0),P=s.useMemo(()=>e==="scene"?new Set(vo(r)):new Set,[e,r]);s.useEffect(()=>{k(Fi),N(0)},[w]);const $=s.useMemo(()=>hm(e,n,{currentId:t,query:w,bookmarked:P,shown:x}),[e,n,t,w,P,x]);s.useLayoutEffect(()=>{var D;v&&((D=S.current)==null||D.focus({preventScroll:!0}))},[v]),s.useEffect(()=>{N(D=>Math.max(0,Math.min(D,$.items.length-1)))},[$.items.length]);const M=s.useCallback(D=>{var O;const K=(O=E.current)==null?void 0:O.querySelectorAll("[data-nav]")[D];K&&(N(D),K.focus({preventScroll:!0}),K.scrollIntoView({block:"nearest"}))},[]),C=s.useCallback(()=>{const D=E.current;return D?Math.max(1,getComputedStyle(D).gridTemplateColumns.split(" ").filter(Boolean).length):1},[]),R=D=>{var te;if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),h("escape");return}const K=D.target===S.current;if(K&&D.key==="ArrowDown"){D.preventDefault(),M(0);return}if(K&&D.key==="Enter"){D.preventDefault(),$.items[0]&&u($.items[0]);return}if(K)return;const O=C(),Z=D.key==="ArrowRight"?1:D.key==="ArrowLeft"?-1:D.key==="ArrowDown"?O:D.key==="ArrowUp"?-O:0;if(Z){D.preventDefault();const B=j+Z;B<0&&Z===-O?(te=S.current)==null||te.focus():B>=0&&B<$.items.length&&M(B);return}D.key==="Home"?(D.preventDefault(),M(0)):D.key==="End"&&(D.preventDefault(),M($.items.length-1))},T=Mf[e],H=e==="product";return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:R,children:[o.jsx("div",{className:"sc-swap-head",children:o.jsxs("span",{className:"sc-swap-search",children:[o.jsx(Fu,{size:13}),o.jsx("input",{ref:S,type:"text",value:w,onChange:D=>y(D.target.value),placeholder:`Search ${T}s`,"aria-label":`Search ${T}s`,autoComplete:"off",spellCheck:!1})]})}),$.current&&o.jsxs("div",{className:"sc-swap-cur",title:$.current.full,children:[o.jsx(t5,{src:$.current.thumb,tinted:!!$.current.tint,crop:$.current.crop}),o.jsxs("span",{className:"sc-swap-curtext",children:[o.jsx("b",{dir:"auto",children:$.current.label}),$.current.sub&&o.jsx("span",{dir:"auto",children:$.current.sub})]}),o.jsx("a",{className:"sc-swap-open",href:Sne(e,a,$.current.id),target:"_blank",rel:"noreferrer",title:`Open this ${T} in a new tab`,"aria-label":`Open ${$.current.label} in a new tab`,children:o.jsx(gf,{size:14})}),o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]}),o.jsxs("div",{className:"sc-swap-body",children:[$.items.length===0&&o.jsx("p",{className:"sc-swap-empty",children:w.trim()?`Nothing matches “${w.trim()}”.`:`No other ${T}s.`}),o.jsx("div",{className:"sc-swap-grid",ref:E,role:"listbox","aria-label":`Choose a ${T}`,children:$.items.map((D,K)=>o.jsxs("div",{className:"sc-swap-card",role:"option","aria-selected":!1,"data-nav":K,tabIndex:K===j?0:-1,title:D.full,style:D.tint?{"--tint":D.tint}:void 0,onFocus:()=>N(K),onClick:()=>u(D),onKeyDown:O=>{O.key!=="Enter"&&O.key!==" "||(O.preventDefault(),u(D))},children:[o.jsx(t5,{src:D.thumb,tinted:!!D.tint,crop:D.crop}),o.jsxs("b",{dir:"auto",children:[D.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(po,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),D.label]}),H&&D.sub&&o.jsx("span",{dir:"auto",children:D.sub})]},D.id))}),$.remaining>0&&o.jsxs("button",{type:"button",className:"sc-swap-more",onClick:()=>k(D=>D+Fi),children:["Show ",Math.min(Fi,$.remaining)," more of ",$.total]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[t&&!$.current&&o.jsxs("p",{className:"sc-swap-warn",children:["This ",T," is no longer available."]}),l&&o.jsx("p",{className:"sc-chip-preview-note",children:l}),i&&o.jsx("p",{className:"sc-swap-warn",children:i}),i&&p&&e==="scene"&&o.jsxs("div",{className:"sc-swap-attach",children:[i.includes("product")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Products"),children:"Attach a product"}),i.includes("person")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Presenters"),children:"Attach a presenter"})]}),g&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(-1),children:[o.jsx(av,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),f&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:f,children:[o.jsx(il,{size:13}),kne(e)]})]})]})}function t5({src:e,tinted:t,crop:n}){const[r,a]=s.useState(!1);return s.useEffect(()=>a(!1),[e]),!e||r?o.jsx("span",{className:"sc-swap-thumb sc-swap-thumb-empty",children:o.jsx(Ws,{size:18})}):o.jsx("img",{className:"sc-swap-thumb","data-tinted":t||void 0,"data-crop":n,src:e,alt:"",loading:"lazy",onError:()=>a(!0)})}function Ene(e){const{anchor:t,kind:n,onClose:r}=e,a=xne(),[i,l]=s.useState(null),u=s.useRef(null);return s.useLayoutEffect(()=>{var h,p;const f=()=>{const g=window.visualViewport,v=Yv(t.getBoundingClientRect(),{width:(g==null?void 0:g.width)??window.innerWidth,height:(g==null?void 0:g.height)??window.innerHeight});if(!v){r("outside");return}l(v)};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),(h=window.visualViewport)==null||h.addEventListener("resize",f),(p=window.visualViewport)==null||p.addEventListener("scroll",f),()=>{var g,v;window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),(g=window.visualViewport)==null||g.removeEventListener("resize",f),(v=window.visualViewport)==null||v.removeEventListener("scroll",f)}},[t,r]),s.useEffect(()=>{const f=h=>{var g;const p=h.target;(g=u.current)!=null&&g.contains(p)||t.contains(p)||r("outside")};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r,t]),i?Rr.createPortal(o.jsx("div",{ref:u,className:"sc-swap","data-kind":n,"data-side":i.side,role:"dialog","aria-label":`Change ${Mf[n]}`,style:bM(i),children:o.jsx(PM,{...e,autoFocusSearch:a})}),document.body):null}function Cne(e){const{kind:t,onClose:n}=e,{sheet:r,grip:a}=ed(()=>n("dismiss"));return o.jsx(fc,{open:!0,onOpenChange:i=>!i&&n("dismiss"),children:o.jsxs(hc,{children:[o.jsx(pc,{className:"sc-shotsheet-scrim"}),o.jsxs(mc,{ref:r,className:"sc-shotsheet sc-swapsheet","data-kind":t,"aria-describedby":void 0,onOpenAutoFocus:i=>{var l;i.preventDefault(),(l=r.current)==null||l.focus({preventScroll:!0})},onCloseAutoFocus:i=>i.preventDefault(),onEscapeKeyDown:i=>{i.preventDefault(),n("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...a,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(gc,{className:"sc-vh",children:["Change ",Mf[t]]})]}),o.jsx(PM,{...e,autoFocusSearch:!1})]})]})})}const jne=260;function Ane(e){return wr(Ks)?o.jsx(Mne,{...e}):o.jsx(Nne,{...e,onMove:void 0})}function eu(e,t){const n=e?nr(e):null,r=t?nr(t):null;return!!n&&n===r}function LM({currentHex:e,currentName:t,palette:n,onPick:r,onRemove:a,onClose:i,onMove:l}){const u=s.useMemo(()=>{const S=new Set,E=[],j=P=>{const $=nr(P.hex);!$||S.has($)||(S.add($),E.push({...P,hex:$}))},N=e?nr(e):null;N&&!n.some(P=>eu(P.hex,N))&&j({hex:N,name:t||N,slot:"accent"});for(const P of n)j(P);return E},[n,e,t]),f=s.useRef(null),[h,p]=s.useState(()=>Math.max(0,u.findIndex(S=>eu(S.hex,e))));s.useEffect(()=>{p(S=>Math.max(0,Math.min(S,Math.max(0,u.length-1))))},[u.length]),s.useLayoutEffect(()=>{var E,j;const S=Math.max(0,u.findIndex(N=>eu(N.hex,e)));(j=(E=f.current)==null?void 0:E.querySelectorAll("[data-nav]")[S])==null||j.focus({preventScroll:!0})},[]);const g=s.useCallback(S=>{var j;const E=(j=f.current)==null?void 0:j.querySelectorAll("[data-nav]")[S];E&&(p(S),E.focus({preventScroll:!0}))},[]),v=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),i("escape");return}if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const E=h+(S.key==="ArrowDown"?1:-1);E>=0&&E<u.length&&g(E)}},w=S=>r({t:"color",hex:S.hex,name:S.name||void 0}),y=(S,E)=>{const j=u.find(N=>eu(N.hex,S));r({t:"color",hex:S,name:(j==null?void 0:j.name)||void 0},{live:!0})},x=e?nr(e):null,k=!!x&&!n.some(S=>eu(S.hex,x));return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:v,children:[o.jsx("div",{className:"sc-swap-body",children:u.length===0?o.jsx("p",{className:"sc-swap-empty",children:"No brand colours yet."}):o.jsx("div",{className:"sc-swap-swatches",ref:f,role:"listbox","aria-label":"Choose a colour",children:u.map((S,E)=>{const j=eu(S.hex,e),N=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-swap-dot",style:{background:S.hex},"aria-hidden":!0}),o.jsx("b",{dir:"auto",children:S.name}),o.jsx("span",{children:S.hex}),j&&o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})})]});return k&&j?o.jsx(Zu,{className:"sc-swap-swatch",triggerStyle:{background:"none"},value:S.hex,presets:n.map(P=>P.hex),commitMode:"live",align:"start",label:`Edit ${S.name}`,triggerProps:{role:"option","aria-selected":!0,"data-on":"","data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E)},onChange:P=>y(P),children:N},"current-custom"):o.jsx("div",{className:"sc-swap-swatch",role:"option","aria-selected":j,"data-on":j||void 0,"data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E),onClick:()=>w(S),onKeyDown:P=>{P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),w(S))},children:N},S.hex)})})}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs(Zu,{className:"sc-swap-swatch sc-swap-custom",triggerStyle:{background:"none"},value:e??Jp(n),presets:n.map(S=>S.hex),commitMode:"live",align:"start",label:"Custom colour",onChange:S=>y(S),children:[o.jsx(cr,{size:12}),o.jsx("b",{children:"Custom colour"})]}),l&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(-1),children:[o.jsx(av,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(1),children:["Move later ",o.jsx(Pa,{size:13})]})]}),a&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:a,children:[o.jsx(il,{size:13}),"Remove colour"]})]})]})}function Nne(e){const{anchor:t,onClose:n}=e,[r,a]=s.useState(null),i=s.useRef(null);return s.useLayoutEffect(()=>{var u,f;const l=()=>{const h=window.visualViewport,p=Yv(t.getBoundingClientRect(),{width:(h==null?void 0:h.width)??window.innerWidth,height:(h==null?void 0:h.height)??window.innerHeight},{width:jne});if(!p){n("outside");return}a(p)};return l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),(u=window.visualViewport)==null||u.addEventListener("resize",l),(f=window.visualViewport)==null||f.addEventListener("scroll",l),()=>{var h,p;window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),(h=window.visualViewport)==null||h.removeEventListener("resize",l),(p=window.visualViewport)==null||p.removeEventListener("scroll",l)}},[t,n]),s.useEffect(()=>{const l=u=>{var h,p;const f=u.target;(h=i.current)!=null&&h.contains(f)||t.contains(f)||(p=f.closest)!=null&&p.call(f,".sc-cp")||n("outside")};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n,t]),r?Rr.createPortal(o.jsx("div",{ref:i,className:"sc-swap","data-kind":"color","data-side":r.side,role:"dialog","aria-label":"Change colour",style:bM(r),children:o.jsx(LM,{...e})}),document.body):null}function Mne(e){const{onClose:t}=e,{sheet:n,grip:r}=ed(()=>t("dismiss"));return o.jsx(fc,{open:!0,onOpenChange:a=>!a&&t("dismiss"),children:o.jsxs(hc,{children:[o.jsx(pc,{className:"sc-shotsheet-scrim"}),o.jsxs(mc,{ref:n,className:"sc-shotsheet sc-swapsheet","data-kind":"color","aria-describedby":void 0,onOpenAutoFocus:a=>{var i;a.preventDefault(),(i=n.current)==null||i.focus({preventScroll:!0})},onCloseAutoFocus:a=>a.preventDefault(),onEscapeKeyDown:a=>{a.preventDefault(),t("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...r,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(gc,{className:"sc-vh",children:"Change colour"})]}),o.jsx(LM,{...e})]})]})})}function Rf(e){const{brand:t,products:n}=on(),{scenes:r,presenters:a,demoProducts:i}=Rn(),l=s.useMemo(()=>Oh(Cc(t),r),[t,r]),u=s.useMemo(()=>Oh(Sf(t),a),[t,a]),f=s.useMemo(()=>{var p;return(((p=t==null?void 0:t.json)==null?void 0:p.characters)??[]).filter(g=>(g==null?void 0:g.origin)!=="custom")},[t]),h=s.useMemo(()=>{var p;return L0(((p=t==null?void 0:t.json)==null?void 0:p.products)??[])},[t]);return s.useMemo(()=>({libraryProducts:MA(n),brandProducts:h,demoProducts:i,presenters:u,cast:f,scenes:l,productCategory:e??null}),[n,h,i,u,f,l,e])}const Yd=new Map,Rne=64;function TM(e){let t=Yd.get(e);if(!t)for(t=Lne(e).then(n=>n?Tne(n.data,4):null).catch(()=>null),Yd.set(e,t);Yd.size>Rne;)Yd.delete(Yd.keys().next().value);return t}function Pne(e,t){TM(t).then(n=>{const r=Mu(n??void 0);!r||!e.isConnected||(e.dataset.tinted="true",e.style.setProperty("--tint",r))})}async function Lne(e){const t=new Image;t.decoding="async",t.src=e;try{await t.decode()}catch{return null}const n=Math.min(1,48/Math.max(t.naturalWidth,t.naturalHeight,1)),r=Math.max(1,Math.round(t.naturalWidth*n)),a=Math.max(1,Math.round(t.naturalHeight*n)),i=document.createElement("canvas");i.width=r,i.height=a;const l=i.getContext("2d",{willReadFrequently:!0});if(!l)return null;l.drawImage(t,0,0,r,a);try{return l.getImageData(0,0,r,a)}catch{return null}}function Tne(e,t){const n=Array.from({length:24},()=>({score:0,r:0,g:0,b:0}));for(let a=0;a+t-1<e.length;a+=t){if(e[a+3]<128)continue;const i=e[a],l=e[a+1],u=e[a+2],{h:f,s:h,l:p}=$ne(i,l,u);if(h<.18||p<.12||p>.92)continue;const g=h*(1-Math.abs(p-.5)*1.2),v=n[Math.min(23,Math.floor(f/360*24))];v.score+=g,v.r+=i*g,v.g+=l*g,v.b+=u*g}const r=n.reduce((a,i)=>i.score>a.score?i:a,n[0]);return r.score<=0?null:Dne(r.r/r.score,r.g/r.score,r.b/r.score)}function $ne(e,t,n){const r=e/255,a=t/255,i=n/255,l=Math.max(r,a,i),u=Math.min(r,a,i),f=(l+u)/2;if(l===u)return{h:0,s:0,l:f};const h=l-u,p=f>.5?h/(2-l-u):h/(l+u);let g;return l===r?g=((a-i)/h+(a<i?6:0))*60:l===a?g=((i-r)/h+2)*60:g=((r-a)/h+4)*60,{h:g,s:p,l:f}}function Dne(e,t,n){const r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Hne(e){return!e||e.cap==null||e.cap<=0?null:e.cap}function One(e){const t=new Set;if(!e||e.cap==null||e.cap<=0)return t;const n=new Set(e.attachments.map(r=>Fl(r.role,r.id??r.hash)));for(const r of e.dropped){const a=Fl(r.role,r.id??r.hash);r.reason!=="missing"&&!n.has(a)&&t.add(a)}return t}const Fl=(e,t)=>`${e}:${t}`,l0=new Set(["product","character","ref","mark","template"]),Xh=12,H6=`Shot is full: ${Xh} identities. Remove one to add another.`,Xr=[{id:"square",label:"Square",hint:"1:1",w:1024,h:1024},{id:"portrait",label:"Portrait",hint:"4:5",w:1024,h:1280},{id:"story",label:"Story",hint:"9:16",w:1080,h:1920},{id:"landscape",label:"Landscape",hint:"16:9",w:1600,h:900}];function Bu(e){const t=Xr.find(n=>n.id===e);return t?t.w/t.h:1}function Ine(e,t=0){var i,l;const n=Xr.find(u=>u.id===(e==null?void 0:e.format));if(n)return n.id;const r=(l=(i=e==null?void 0:e.rendered)==null?void 0:i.sizes)==null?void 0:l[t];if(!r||!(r[0]>0)||!(r[1]>0))return;const a=Math.log(r[0]/r[1]);return Xr.reduce((u,f)=>Math.abs(Math.log(f.w/f.h)-a)<Math.abs(Math.log(u.w/u.h)-a)?f:u).id}const Y1=6,Fne=s.forwardRef(function({initialTokens:t,onChange:n,brand:r,templates:a,presenters:i,demoProducts:l,onTemplatePick:u,scenesSitOut:f,placeholder:h,placeholderSm:p,label:g="Brief",flag:v,described:w,describedNote:y,onInspect:x,activeProductCategory:k,onAttachRequest:S,onSubmit:E,onDropFiles:j},N){var bt,vt,Ct,st,$t,An;const P=s.useRef(null),$=s.useRef(null),M=s.useId(),[C,R]=s.useState(""),T=s.useCallback(Y=>{R(""),requestAnimationFrame(()=>R(Y))},[]),H=s.useRef(null),[D,K]=s.useState(null),[O,Z]=s.useState(null),te=od(),{shown:B,closeNow:F}=te,X=s.useRef(O);s.useEffect(()=>{X.current=O},[O]);const z=s.useRef(v);s.useEffect(()=>{z.current=v},[v]);const[I,U]=s.useState(""),[G,ne]=s.useState(Gd("$")),[q,le]=s.useState(null),Se=s.useRef(!1),Q=s.useRef(0),[xe,ee]=s.useState(!1),ae=s.useRef(0),{products:re}=on(),_=re.length?re:((bt=r.json)==null?void 0:bt.products)??[],ue=((vt=r.json)==null?void 0:vt.characters)??[],We=s.useMemo(()=>xf(r.json),[r]),Xe=s.useCallback((Y,he)=>{var In,Dt,On;const Me=document.createElement("span");Me.className=Hl,Me.contentEditable="false",Me.dir="ltr",Me.dataset.kind=Y.t,Me.dataset.tok=nm(Y),Me.dataset.uid=he??`u${Q.current++}`;let Ye="",dt=null,wt,Zt=null;const Ht=AM(Y,{products:_,demoProducts:l,cast:ue,presenters:i,scenes:a});if((Ht==null?void 0:Ht.kind)==="scene"){const Et=Ht.scene;Ye=Et?Qi(Et,"chip"):"missing template",dt=(Et==null?void 0:Et.previewUrl)??null;const Hn=Mu(Et==null?void 0:Et.previewColor);Hn&&(Me.dataset.tinted="true",Me.style.setProperty("--tint",Hn)),!Hn&&dt&&Ht.custom&&Pne(Me,dt)}else if((Ht==null?void 0:Ht.kind)==="product"){const Et=Ht.product??Ht.demo;Ye=Et?go(Et,"chip"):"missing product",dt=Ht.product?Bp((Dt=(In=Ht.product.shots)==null?void 0:In[0])==null?void 0:Dt.file,"micro"):((On=Ht.demo)==null?void 0:On.previewUrl)??null}else if((Ht==null?void 0:Ht.kind)==="presenter"){const{character:Et,presenter:Hn}=Ht;Ye=(Et==null?void 0:Et.name)??(Hn==null?void 0:Hn.name)??"missing person";const Ot=Et?xv(Et):Hn?ti(Hn):{src:null};dt=sr(Ot.src,"micro"),wt=Ot.crop}else if(Y.t==="color")Ye=Y.name??Y.hex,Zt=Y.hex;else if(Y.t==="ref")Ye=Y.label??"Image",dt=dn(Y.imageHash,"micro");else if(Y.t==="mark"){const Et=We.find(Hn=>Hn.hash===Y.imageHash);Ye=Et?qp(r.json,Et):"missing mark",dt=dn(Y.imageHash,"micro")}if(Ye.startsWith("missing ")&&(Me.dataset.missing=""),dt){const Et=document.createElement("img");Et.src=dt,Et.alt="",wt&&(Et.dataset.crop=wt),Et.onerror=()=>Et.remove(),Me.appendChild(Et)}else if(Zt){const Et=document.createElement("span");Et.className="sc-token-swatch",Et.style.background=Zt,Me.appendChild(Et)}const pn=document.createElement("span");pn.className="sc-token-label",pn.dir="auto",pn.textContent=Ye,Me.appendChild(pn);const Wt=(v==null?void 0:v(Y))??null;Wt&&(Me.title=Wt,Me.dataset.warn="1"),w!=null&&w(Y)&&(Me.dataset.described="1");const wn=hu(Y);if(wn){const Et=wn==="color"?"colour":Mf[wn];Me.tabIndex=0,Me.setAttribute("role","button"),Me.setAttribute("aria-haspopup","dialog"),Me.setAttribute("aria-expanded","false"),Me.setAttribute("aria-label",`${Et}: ${Ye}. Change or remove.`)}else Me.tabIndex=0,Me.setAttribute("role","button"),Me.setAttribute("aria-haspopup","dialog"),Me.setAttribute("aria-expanded","false"),Me.setAttribute("aria-label",`${Y.t==="mark"?"brand mark":"reference image"}: ${Ye}. Open, remove or move.`);Me.setAttribute("aria-keyshortcuts","Alt+ArrowLeft Alt+ArrowRight"),Me.setAttribute("aria-describedby",M),Me.setAttribute("draggable","false");const sn=document.createElement("button");return sn.type="button",sn.tabIndex=-1,sn.setAttribute("aria-hidden","true"),sn.dataset.role="remove",sn.appendChild(iQ()),Me.appendChild(sn),Me},[a,_,ue,i,l,We,r,v,w,M]),ze=s.useCallback(()=>{const Y=P.current;Y&&n(Ux(Y))},[n]);s.useEffect(()=>{const Y=P.current;Y&&(Wx(Y,t!=null&&t.length?t:Oo(),he=>Xe(he)),a0(Y))},[]);const tt=s.useCallback((Y,he)=>{var dt;const Me=P.current,Ye=Me==null?void 0:Me.querySelector(`[data-uid="${CSS.escape(Y)}"]`);if(Me&&Ye&&qx(Me,Ye,he)){Vl(Me,Ye,"after");const wt=Do(Me);wt!==null&&(H.current=wt,((dt=X.current)==null?void 0:dt.uid)===Y&&(X.current={...X.current,caret:wt}),Z(Zt=>Zt&&Zt.uid===Y?{...Zt,caret:wt}:Zt)),ze(),T(N6(Me,Ye))}},[ze,T]);s.useEffect(()=>{const Y=P.current;if(Y)return Mte(Y,{onDragStart:()=>{K(null),U(""),F()},onMoved:(he,Me)=>{ze(),T(Me)},onCancelled:()=>T("Reorder cancelled.")})},[ze,T,F]),s.useEffect(()=>{const Y=P.current;if(Y)for(const he of Y.querySelectorAll(`.${Hl}`)){const Me=as(he.dataset.tok??"");if(!Me)continue;const Ye=(v==null?void 0:v(Me))??null;Ye?he.dataset.warn="1":delete he.dataset.warn,w!=null&&w(Me)?he.dataset.described="1":delete he.dataset.described,Ye&&!("open"in he.dataset)?he.title=Ye:he.removeAttribute("title")}},[v,w]),s.useEffect(()=>{const Y=()=>{const he=Do(P.current);he!==null&&(H.current=he)};return document.addEventListener("selectionchange",Y),()=>document.removeEventListener("selectionchange",Y)},[]);const ce=s.useCallback(Y=>{const he=P.current;if(!he)return;if(Y.t==="template"){const wt=Vd(he);if(wt){wt.replaceWith(Xe(Y,wt.dataset.uid)),no(he),ze(),K(null),U("");return}}const Me=Ta(Y);if(Me){const wt=Ig(he,Me);if(wt){K(null),U(""),T(`${Io(wt)||"That"} is already in the brief.`);return}}if(l0.has(Y.t)&&!(Y.t==="template"&&Vd(he))&&Array.from(he.querySelectorAll(`.${Hl}`)).filter(Zt=>l0.has(Zt.dataset.kind??"")).length>=Xh){K(null),U(""),T(H6);return}VX(he,Xe(Y),{eatQuery:!!D,fallbackUnits:H.current});const dt=Do(he);dt!==null&&(H.current=dt),ze(),K(null),U("")},[D,Xe,ze,T]),ve=s.useRef(ce);s.useEffect(()=>{ve.current=ce},[ce]);const Pe=s.useCallback((Y,he)=>{const Me=P.current,Ye=Me==null?void 0:Me.querySelector(`[data-uid="${CSS.escape(Y)}"]`);return!Me||!Ye?!1:(Ye.replaceWith(Xe(he,Y)),no(Me),ze(),!0)},[Xe,ze]),de=s.useCallback(Y=>{const he=P.current,Me=he==null?void 0:he.querySelector(`[data-uid="${CSS.escape(Y)}"]`);if(!he||!Me)return null;const Ye=ni(he,Me);return Fg(he,Me),ze(),Ye},[ze]),je=()=>{var Y;return document.documentElement.dataset.guideTask==="first-shot"&&!!((Y=P.current)!=null&&Y.closest('[data-guide="compose"]'))},Ue=(Y,he)=>{var wt;const Me=[...Y.querySelectorAll(".sc-token")];if(!Me.length)return!1;const[Ye]=((wt=he.getTargetRanges)==null?void 0:wt.call(he))??[];if(!Ye)return!1;const dt=document.createRange();return dt.setStart(Ye.startContainer,Ye.startOffset),dt.setEnd(Ye.endContainer,Ye.endOffset),Me.some(Zt=>dt.intersectsNode(Zt))},ye=s.useRef(de);s.useEffect(()=>{ye.current=de},[de]),s.useEffect(()=>{const Y=P.current;if(!Y)return;const he=Me=>{if(Me.inputType.startsWith("delete")&&je()&&Ue(Y,Me))return Me.preventDefault();const Ye=Me.inputType==="deleteContentBackward"?"Backspace":Me.inputType==="deleteContentForward"?"Delete":null;if(!Ye)return;const dt=Kx(Y,Ye);if(!(dt!=null&&dt.dataset.uid)){Gx(Y,Ye)&&Me.preventDefault();return}Me.preventDefault();const wt=ye.current(dt.dataset.uid);wt!=null&&Ra(Y,wt)};return Y.addEventListener("beforeinput",he),()=>Y.removeEventListener("beforeinput",he)},[]);const Ee=s.useCallback(Y=>{const he=as(Y.dataset.tok??"");if(!he||he.t!=="ref"&&he.t!=="mark")return!1;const Me=P.current,Ye=Me?Do(Me):null;return Ye!=null&&(H.current=Ye),F(),x==null||x({src:Mr(he.imageHash),kind:he.t,label:he.t==="mark"?Io(Y):null}),!0},[x,F]),be=s.useCallback((Y,he,Me,Ye)=>{const dt=Y.dataset.uid;dt&&(F(),Y.dataset.open="",Y.hasAttribute("aria-haspopup")&&Y.setAttribute("aria-expanded","true"),Y.removeAttribute("title"),K(null),U(""),Z({uid:dt,kind:he,anchor:Y,caret:Me,touch:Ye}))},[F]),Le=s.useCallback((Y,he)=>{var Zt;const Me=X.current;if(X.current=null,Z(null),!Me)return;const Ye=P.current,dt=Ye==null?void 0:Ye.querySelector(`[data-uid="${CSS.escape(Me.uid)}"]`);if(dt){delete dt.dataset.open,dt.hasAttribute("aria-haspopup")&&dt.setAttribute("aria-expanded","false");const Ht=as(dt.dataset.tok??""),pn=Ht?((Zt=z.current)==null?void 0:Zt.call(z,Ht))??null:null;pn&&(dt.title=pn)}const wt=he!==void 0?he:Me.caret;if(Me.touch){wt!=null&&(H.current=wt);return}Ye&&(Ye.focus({preventScroll:!0}),wt!=null?Ra(Ye,wt):Ol(Ye))},[]);s.useEffect(()=>{if(!O)return;const Y=P.current;Y!=null&&Y.querySelector(`[data-uid="${CSS.escape(O.uid)}"]`)||Le("outside")},[O,Le]),s.useEffect(()=>{var Y;B&&((Y=P.current)!=null&&Y.contains(B.anchor)||F())},[B,F]),s.useEffect(()=>{const Y=B==null?void 0:B.anchor;if(!Y)return;Y.dataset.open="";const he=Y.getAttribute("title");return he&&Y.removeAttribute("title"),()=>{delete Y.dataset.open,he&&Y.setAttribute("title",he)}},[B]),s.useImperativeHandle(N,()=>({insert:Y=>ve.current(Y),setTokens:Y=>{const he=P.current;he&&(Wx(he,Y.length?Y:Oo(),Me=>Xe(Me)),a0(he),n(Ux(he)))},removeTemplate:()=>{const Y=P.current,he=Y?Vd(Y):null;!Y||!he||(Fg(Y,he),ze())},remove:Y=>{const he=P.current;if(!he)return;const Me=Ig(he,Ta(Y));Me&&(Fg(he,Me),ze())},openMenu:Y=>{U(""),ne(Gd("$")),K({anchor:Y})},focus:()=>Ol(P.current),restoreCaret:()=>{const Y=P.current;if(!Y)return;Y.focus({preventScroll:!0});const he=H.current;he!=null?Ra(Y,he):Ol(Y)}}));const Qe=Rf(k),Ke=s.useCallback(Y=>_i(Y,Qe),[Qe]),nt=s.useMemo(()=>new Set(vo(r.id)),[r.id]),gt=s.useMemo(()=>{var Y;return D?vne(D.sigil??"$",{products:_i("product",Qe),presenters:_i("presenter",Qe),scenes:f?[]:_i("scene",Qe),colors:Zs((Y=r.json)==null?void 0:Y.palette)},{query:I,bookmarked:nt,shown:G}):{items:[],remaining:0,total:0}},[D,Qe,I,nt,G,f,(Ct=r.json)==null?void 0:Ct.palette]),Pt=s.useMemo(()=>gt.items.map(Y=>({...Y,run:()=>Y.token.t==="template"?u(Y.token.id):ve.current(Y.token)})),[gt.items,u]),Ut=s.useCallback(()=>{gt.remaining<=0||ne(Y=>Y+Gd(D==null?void 0:D.sigil))},[gt.remaining,D==null?void 0:D.sigil]),Nt=Y=>{const he=P.current,Me=Y.target;if(Me.closest('[data-role="remove"]')){if(Y.preventDefault(),je())return;const pn=Pi(Me);O&&(pn==null?void 0:pn.dataset.uid)===O.uid&&Le("remove"),pn!=null&&pn.dataset.uid&&de(pn.dataset.uid),K(null);return}const Ye=Pi(Me),dt=Ye==null?void 0:Ye.getBoundingClientRect();if(!(!!Ye&&!!dt&&Y.clientX-dt.left>Y1&&dt.right-Y.clientX>Y1)){if(HX(he))return;Yx(he,Y.clientX,Y.clientY);return}Yx(he,Y.clientX,Y.clientY);const Zt=Ye.dataset.uid??null;if(Zt&&(O==null?void 0:O.uid)===Zt){Y.detail!==0&&Le("outside");return}const Ht=hu(as(Ye.dataset.tok??""));if(!Ht){Ee(Ye);return}be(Ye,Ht,Do(he),!1)},cn=Y=>{if(Y.pointerType!=="mouse")return;const he=P.current;if(O||D||he&&"chipDrag"in he.dataset)return;const Me=Pi(Y.target),Ye=Me==null?void 0:Me.dataset.uid;if(!Me||!Ye||!Fe(Me)){te.close();return}if((B==null?void 0:B.uid)===Ye){te.keep();return}te.open({uid:Ye,anchor:Me})},Fe=Y=>{const he=as(Y.dataset.tok??"");if(e8(he))return!0;const Me=hu(he);return!!(Me&&Me!=="color"&&yh(Me)&&Y.querySelector("img"))},pt=Y=>{const he=Pi(Y.target),Me=he==null?void 0:he.dataset.uid;!he||!Me||O||D||Fe(he)&&Xp(he)&&te.open({uid:Me,anchor:he})},it=Y=>{if(Y.pointerType==="mouse")return;const he=Y.target;if(he.closest('[data-role="remove"]'))return;const Me=Pi(he);if(!Me)return;const Ye=Me.getBoundingClientRect();if(Y.clientX-Ye.left<=Y1||Ye.right-Y.clientX<=Y1)return;const dt=hne(as(Me.dataset.tok??""));if(!dt||Me.dataset.uid&&(O==null?void 0:O.uid)===Me.dataset.uid)return;Y.preventDefault();const wt=P.current,Zt=document.activeElement===wt,Ht=Zt?Do(wt):H.current;Zt&&(wt==null||wt.blur()),be(Me,dt,Ht,!0)},St=Y=>{const he=P.current,Me=Pi(Y.target);if(Me&&!O){const Ye=()=>{Vl(he,Me,"after"),he==null||he.focus({preventScroll:!0})};if(Y.altKey&&(Y.key==="ArrowLeft"||Y.key==="ArrowRight")){Y.preventDefault(),he&&qx(he,Me,Y.key==="ArrowLeft"?-1:1)&&(Me.focus({preventScroll:!0}),ze(),T(N6(he,Me)));return}if(Y.key==="ArrowLeft"||Y.key==="ArrowRight"){Y.preventDefault(),Vl(he,Me,Y.key==="ArrowLeft"?"before":"after"),he==null||he.focus({preventScroll:!0});return}if(Y.key==="Tab"){Y.preventDefault(),Vl(he,Me,Y.shiftKey?"before":"after"),he==null||he.focus({preventScroll:!0});return}if(Y.key==="Enter"||Y.key===" "){Y.preventDefault();const dt=hu(as(Me.dataset.tok??""));dt&&he?be(Me,dt,ni(he,Me)+1,!1):Ee(Me);return}if(Y.key==="Backspace"||Y.key==="Delete"){if(Y.preventDefault(),je())return;const dt=Me.dataset.uid?de(Me.dataset.uid):null;he==null||he.focus({preventScroll:!0}),dt!=null&&Ra(he,dt);return}if(Y.key==="Escape"){Y.preventDefault(),Ye();return}}if(Y.key==="Escape"&&D){Y.preventDefault(),K(null),U("");return}if(Y.key==="Enter"&&!Y.shiftKey){const Ye=Y.defaultPrevented;Y.preventDefault(),Bte({menuOpen:!!D,handled:Ye})&&E();return}if(!(D||O)&&!Zte(Y)){if(!Y.shiftKey&&!Y.altKey&&!Y.metaKey&&!Y.ctrlKey){if(Y.key==="ArrowLeft"||Y.key==="ArrowRight"){_X(he,Y.key==="ArrowLeft"?"left":"right")&&Y.preventDefault();return}if(Y.key==="Backspace"||Y.key==="Delete"){const Ye=Kx(he,Y.key);if(Ye!=null&&Ye.dataset.uid){if(Y.preventDefault(),je())return;const dt=de(Ye.dataset.uid);dt!=null&&Ra(he,dt);return}if(Gx(he,Y.key)){Y.preventDefault();return}}}if((Y.key==="$"||Y.key==="/"||Y.key==="@"||Y.key==="#")&&!je()){const Ye=P.current,dt=yN(Ye),wt=dt.slice(-1);if(dt.length&&!/[\s\u00a0]/.test(wt))return;U(""),ne(Gd(Y.key)),K({anchor:{getBoundingClientRect:()=>bN()??(Ye==null?void 0:Ye.getBoundingClientRect())??new DOMRect},sigil:Y.key})}}},xt=s.useCallback(Y=>{var he,Me;return(Me=Zs((he=r.json)==null?void 0:he.palette).find(Ye=>Ye.hex===Y))==null?void 0:Me.name},[(st=r.json)==null?void 0:st.palette]),At=s.useCallback(()=>{requestAnimationFrame(()=>{const Y=$.current;if(!Y)return;Y.scrollHeight-Y.scrollTop-Y.clientHeight>1?Y.dataset.more="":delete Y.dataset.more})},[]);s.useEffect(()=>{const Y=$.current;if(!Y)return;At();const he=new ResizeObserver(At);he.observe(Y);for(const Me of Y.children)he.observe(Me);return()=>he.disconnect()},[At]);const Kt=Y=>{At();const he=P.current,Me=Y==null?void 0:Y.nativeEvent;if(Me!=null&&Me.isComposing)return;OX(he)||no(he),a0(he)&&Ol(he);const Ye=Se.current;Se.current=!1;const dt=_g(he,Zt=>Xe(Zt),{commit:Ye,nameFor:xt});dt&&(K(null),U(""));const wt=dt?{open:!1}:Ute(UX(he),Ye);wt.open?D&&(wt.query!==I&&ne(Gd(wt.sigil)),U(wt.query)):D&&(K(null),U("")),ze()},et=Y=>{const he=window.getSelection();if(!he||he.rangeCount===0||he.isCollapsed)return null;const Me=he.getRangeAt(0),{text:Ye,html:dt}=KX(Me);return Ye?(Y.clipboardData.setData("text/plain",Ye),Y.clipboardData.setData("text/html",dt),Y.preventDefault(),Me):null},mt=Y=>{et(Y)},ot=Y=>{const he=et(Y);he&&(he.deleteContents(),no(P.current),ze())},kn=s.useCallback(Y=>Y.t==="template"?a.some(he=>he.id===Y.id):Y.t==="product"?_.some(he=>he.id===Y.id)||l.some(he=>he.id===Y.id):Y.t==="character"?ue.some(he=>he.id===Y.id)||i.some(he=>he.id===Y.id):Y.t==="mark"?We.some(he=>he.hash===Y.imageHash):!0,[a,_,ue,i,l,We]);s.useEffect(()=>{const Y=P.current;if(Y)for(const he of Y.querySelectorAll(`.${Hl}[data-missing]`)){const Me=as(he.dataset.tok??"");Me&&kn(Me)&&he.replaceWith(Xe(Me,he.dataset.uid))}},[kn,Xe]);const ut=Y=>{Array.from(Y.dataTransfer.types).includes("Files")&&(Y.preventDefault(),ae.current++,ee(!0))},Gt=Y=>Y.preventDefault(),Ft=()=>{ae.current=Math.max(0,ae.current-1),ae.current===0&&ee(!1)},en=Y=>{Y.preventDefault(),ae.current=0,ee(!1),Y.dataTransfer.files.length&&(j==null||j(Y.dataTransfer.files))},Jt=Y=>{Y.preventDefault();const he=Y.clipboardData.files;if(he.length&&Array.from(he).some(dt=>dt.type.startsWith("image/"))){j==null||j(he);return}Se.current=!0;const Me=YX(Y.clipboardData.getData("text/html"));if(Me&&se(Me)){const dt=P.current;_g(dt,wt=>Xe(wt),{commit:!0,nameFor:xt})&&ze();return}const Ye=Y.clipboardData.getData("text/plain");Ye&&document.execCommand("insertText",!1,Ye)},se=Y=>{const he=P.current,Me=window.getSelection();if(!he||!Me||Me.rangeCount===0||!he.contains(Me.getRangeAt(0).startContainer))return!1;const Ye=Me.getRangeAt(0);Ye.deleteContents();let dt=!1,wt=Array.from(he.querySelectorAll(`.${Hl}`)).filter(Dt=>l0.has(Dt.dataset.kind??"")).length,Zt=!1;const Ht=new Set,pn=[];for(const Dt of Y){if(typeof Dt=="string"){pn.push(Dt);continue}if(!kn(Dt)){pn.push(Vne(Dt,a,_));continue}if(Dt.t==="template"){if(dt)continue;dt=!0}const On=Ta(Dt);if(On){if(Ht.has(On)||Ig(he,On))continue;Ht.add(On)}if(l0.has(Dt.t)&&!(Dt.t==="template"&&Vd(he))){if(wt>=Xh){Zt=!0;continue}wt+=1}pn.push(Dt)}Zt&&T(H6);const Wt=dt?Vd(he):null,wn=document.createDocumentFragment();for(const Dt of pn)wn.appendChild(typeof Dt=="string"?document.createTextNode(Dt):Xe(Dt));const sn=wn.lastChild;Ye.insertNode(wn),Wt&&Wt.remove();const In=sn?sn.nodeType===Node.TEXT_NODE?Vh(he,sn,sn.length):Vh(he,he,Array.from(he.childNodes).indexOf(sn)+1):Do(he)??0;return no(he),Ra(he,In),ze(),!0},oe=s.useCallback(()=>{requestAnimationFrame(()=>{const Y=P.current;Y&&document.activeElement===Y&&a0(Y)&&Ol(Y)})},[]),we=O?as(O.anchor.dataset.tok??""):null,ge=e8(we),J=we?(v==null?void 0:v(we))??null:null,Oe=we&&(w!=null&&w(we))?y??null:null,Be=B?as(B.anchor.dataset.tok??""):null,Ve=e8(Be),Ge=(($t=B==null?void 0:B.anchor.querySelector("img"))==null?void 0:$t.getAttribute("src"))??null,me=Ve?dn(Ve,"tile"):sr(Ge,"tile"),_e=hu(Be),W=Be&&yh(Be.t)?Be.t:_e&&_e!=="color"&&yh(_e)?_e:null,pe=Be?(v==null?void 0:v(Be))??null:null,Ie=Be&&(w!=null&&w(Be))?y??null:null,Te=je()?void 0:()=>{if(!O)return;const Y=de(O.uid);Le("remove",Y)};return o.jsxs("div",{className:"sc-brief",ref:$,onScroll:At,"data-drag-over":xe||void 0,children:[o.jsx("span",{id:M,className:"sc-vh",children:"Press Enter to open, Delete to remove, Alt plus arrow keys to move."}),o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:C}),o.jsx("div",{ref:P,className:"sc-brief-line",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-autocomplete":"list","aria-expanded":D?!0:void 0,"aria-controls":D?i0:void 0,"aria-activedescendant":D?q??void 0:void 0,"aria-label":g,"aria-placeholder":h,tabIndex:0,dir:"auto","data-ph":h,...p?{"data-ph-sm":p}:{},onClick:Nt,onPointerDown:it,onPointerOver:cn,onPointerLeave:Y=>Y.pointerType==="mouse"&&te.close(),onFocusCapture:pt,onKeyDown:St,onInput:Kt,onCopy:mt,onCut:ot,onPaste:Jt,onDragEnter:ut,onDragOver:Gt,onDragLeave:Ft,onDrop:en,onFocus:oe,onBlur:()=>{const Y=P.current;_g(Y,he=>Xe(he),{commit:!0,nameFor:xt})&&(K(null),U("")),ze()}}),D&&o.jsx(ane,{anchor:D.anchor,composer:{getBoundingClientRect:()=>{var Y,he,Me;return((he=(Y=P.current)==null?void 0:Y.closest(".sc-promptcard"))==null?void 0:he.getBoundingClientRect())??((Me=P.current)==null?void 0:Me.getBoundingClientRect())??new DOMRect}},line:{getBoundingClientRect:()=>{var Y;return((Y=P.current)==null?void 0:Y.getBoundingClientRect())??new DOMRect}},query:I,options:Pt,remaining:gt.remaining,total:gt.total,sigil:D.sigil,onMore:Ut,onActiveId:le,onClose:()=>{K(null),U("")}}),B&&me&&W&&o.jsx(ad,{anchor:B.anchor,kind:W,src:me,label:Io(B.anchor),warning:pe,note:Ie,onOpen:()=>{const Y=B.anchor;if(Ve){Ee(Y);return}F(),x==null||x({src:me,kind:W,label:Io(Y)})},onHoverIn:te.keep,onHoverOut:te.close,onClose:F},B.uid),(O==null?void 0:O.kind)==="ref"||(O==null?void 0:O.kind)==="mark"?o.jsx(Rte,{kind:O.kind,label:Io(O.anchor),thumb:ge?dn(ge,"micro"):null,onInspect:()=>Ee(O.anchor),onMove:Y=>tt(O.uid,Y),onRemove:Te,onClose:Le},O.uid):(O==null?void 0:O.kind)==="color"?o.jsx(Ane,{anchor:O.anchor,currentHex:q1(O.anchor),currentName:_ne(O.anchor),palette:Zs((An=r.json)==null?void 0:An.palette),onPick:(Y,he)=>{var Ye;const Me=O.uid;if(he!=null&&he.live){const dt=(Ye=P.current)==null?void 0:Ye.querySelector(`[data-uid="${CSS.escape(Me)}"]`);dt&&nQ(dt,Y),ze();return}if(Zne(Y.hex,q1(O.anchor))){Le("pick");return}Pe(Me,Y),Le("pick")},onRemove:Te,onMove:Y=>tt(O.uid,Y),onClose:Le},O.uid):O?o.jsx(bne,{kind:O.kind,anchor:O.anchor,currentId:q1(O.anchor),candidates:Ke(O.kind),brandId:r.id,brandSlug:r.slug,warning:J,note:Oe,onAttachRequest:S?Y=>{Le("outside"),S(Y)}:void 0,onPick:Y=>{const he=O.uid;if(Y.id===q1(O.anchor)){Le("pick");return}Y.kind==="scene"?u(Y.id):Pe(he,Y.token),Le("pick")},onRemove:Te,onMove:Y=>tt(O.uid,Y),onClose:Le},O.uid):null]})});function q1(e){const t=as(e.dataset.tok??"");return t?t.t==="color"?t.hex:"id"in t?t.id:null:null}function _ne(e){const t=as(e.dataset.tok??"");return(t==null?void 0:t.t)==="color"?t.name:void 0}function Zne(e,t){const n=e?nr(e):null,r=t?nr(t):null;return!!n&&n===r}function Vne(e,t,n){var r,a;return e.t==="template"?((r=t.find(i=>i.id===e.id))==null?void 0:r.name)??"template":e.t==="product"?((a=n.find(i=>i.id===e.id))==null?void 0:a.name)??"product":e.t==="character"?"someone":e.t==="color"?e.name??e.hex:e.t==="mark"?"brand mark":e.t==="ref"?e.label??"Image":"reference"}function X1(e,t){return t===null?e===null:e===t}function zne(e){const t=e.closest(".sc-filterbar, .sc-toolbar"),n=t==null?void 0:t.closest("[data-page-scroll]");if(!t||!n)return;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().height===0;)r=r.nextElementSibling;if(!r)return;const i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-Number.parseFloat(getComputedStyle(t).marginBottom)-t.offsetHeight;if(n.scrollTop<=i+1)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;n.scrollTo({top:i,behavior:l?"auto":"smooth"})}function Xv({"aria-label":e,activeKey:t,items:n,onSelect:r}){const a=s.useRef(null),i=s.useRef(null),l=n.map(p=>`${p.value??""}:${p.count??""}`).join("|");s.useLayoutEffect(()=>{const p=a.current,g=i.current;if(!p||!g)return;let v=0;const w=()=>{const N=g.querySelector(":scope > button[data-on]");if(!N)return g.style.setProperty("--sc-ink-x","0px"),g.style.setProperty("--sc-ink-w","0px"),null;const P=N.querySelector(".sc-vlabel")??N;return g.style.setProperty("--sc-ink-x",`${N.offsetLeft+P.offsetLeft}px`),g.style.setProperty("--sc-ink-w",`${P.offsetWidth}px`),N},y=()=>{const N=g.scrollWidth-g.clientWidth;if(N<=1){delete p.dataset.overflowLeft,delete p.dataset.overflowRight;return}g.scrollLeft>2?p.dataset.overflowLeft="":delete p.dataset.overflowLeft,g.scrollLeft<N-2?p.dataset.overflowRight="":delete p.dataset.overflowRight},x=N=>{const P=g.scrollWidth-g.clientWidth;if(P<=0)return;const $=[...g.querySelectorAll(":scope > button")],M=$.indexOf(N);if(M<0)return;const C=72,R=g.scrollLeft,T=R+g.clientWidth,H=$[M-1],D=$[M+1],K=D?D.offsetLeft+Math.min(C,D.offsetWidth):N.offsetLeft+N.offsetWidth+8,O=H?Math.max(0,H.offsetLeft+H.offsetWidth-C):Math.max(0,N.offsetLeft-8);let Z=R;if(K>T)Z=Math.min(P,K-g.clientWidth);else if(O<R)Z=O;else return;if(Math.abs(Z-R)<1)return;const te=window.matchMedia("(prefers-reduced-motion: reduce)").matches;g.scrollTo({left:Z,behavior:te?"auto":"smooth"})},k=w();k&&x(k),y(),g.dataset.inkReady||requestAnimationFrame(()=>{g.dataset.inkReady=""});const S=()=>{v||(v=requestAnimationFrame(()=>{v=0,y()}))},E=N=>{if(g.scrollWidth<=g.clientWidth+1||Math.abs(N.deltaX)>Math.abs(N.deltaY)||N.deltaY===0)return;const P=g.scrollWidth-g.clientWidth,$=Math.max(0,Math.min(P,g.scrollLeft+N.deltaY));$!==g.scrollLeft&&(N.preventDefault(),g.scrollLeft=$,y())},j=new ResizeObserver(()=>{w(),y()});j.observe(g);for(const N of g.querySelectorAll(":scope > button"))j.observe(N);return g.addEventListener("scroll",S,{passive:!0}),g.addEventListener("wheel",E,{passive:!1}),()=>{v&&cancelAnimationFrame(v),j.disconnect(),g.removeEventListener("scroll",S),g.removeEventListener("wheel",E)}},[t,l]);const u=p=>{X1(t,p)||(a.current&&zne(a.current),r(p))},f=p=>{var y;if(p.key!=="ArrowLeft"&&p.key!=="ArrowRight"&&p.key!=="Home"&&p.key!=="End"||n.length===0)return;p.preventDefault();const g=Math.max(0,n.findIndex(x=>X1(t,x.value)));let v=g;if(p.key==="ArrowRight"?v=Math.min(n.length-1,g+1):p.key==="ArrowLeft"?v=Math.max(0,g-1):p.key==="Home"?v=0:p.key==="End"&&(v=n.length-1),v===g)return;u(n[v].value);const w=(y=i.current)==null?void 0:y.querySelectorAll(":scope > button")[v];w==null||w.focus()},h=n.findIndex(p=>X1(t,p.value));return o.jsx("div",{ref:a,className:"sc-verticals-shell",children:o.jsxs("div",{ref:i,className:"sc-verticals",role:"tablist","aria-label":e,onKeyDown:f,children:[o.jsx("span",{className:"sc-verticals-ink","aria-hidden":!0}),n.map((p,g)=>{const v=X1(t,p.value);return o.jsxs("button",{type:"button",role:"tab","aria-selected":v,"data-on":v?"":void 0,tabIndex:v||h<0&&g===0?0:-1,onClick:()=>u(p.value),children:[o.jsx("span",{className:"sc-vlabel",children:p.label}),p.count!==void 0&&o.jsx("span",{className:"sc-vcount",children:p.count})]},p.value??"__all__")})]})})}function id({value:e,onChange:t,noun:n,total:r,shortcut:a=!0}){const i=s.useRef(null),[l,u]=s.useState(e.trim().length>0),f=s.useCallback(()=>{var p;Rr.flushSync(()=>u(!0)),(p=i.current)==null||p.focus()},[]);s.useEffect(()=>{e.trim().length>0&&u(!0)},[e]),s.useEffect(()=>{if(!a)return;const p=g=>{if(g.key!=="/"||g.metaKey||g.ctrlKey||g.altKey)return;const v=g.target;v!=null&&v.isContentEditable||v&&/^(input|textarea|select)$/i.test(v.tagName)||(g.preventDefault(),f())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[f,a]);const h=p=>{var g;p.key==="Escape"&&(p.stopPropagation(),e?t(""):(u(!1),(g=i.current)==null||g.blur()))};return o.jsxs("div",{className:"sc-libsearch","data-open":l?"":void 0,children:[o.jsx("button",{type:"button",className:"sc-libsearch-toggle","aria-label":`Search ${n}`,"aria-expanded":l,tabIndex:l?-1:0,onClick:f,children:o.jsx(Fu,{size:16})}),o.jsxs("div",{className:"sc-libsearch-field",children:[o.jsx(Fu,{size:15,"aria-hidden":!0}),o.jsx("input",{ref:i,type:"search",value:e,placeholder:r==null?`Search ${n}`:`Search ${r} ${n}`,"aria-label":`Search ${n}`,autoComplete:"off",autoCorrect:"off",spellCheck:!1,tabIndex:l?0:-1,onChange:p=>t(p.target.value),onKeyDown:h,onBlur:()=>{e.trim()||u(!1)}}),o.jsx("button",{type:"button",className:"sc-libsearch-clear","aria-label":"Clear search",hidden:!e,tabIndex:e?0:-1,onMouseDown:p=>p.preventDefault(),onClick:()=>{var p;t(""),(p=i.current)==null||p.focus()},children:o.jsx(jn,{size:12,weight:"bold"})})]})]})}function $M({why:e,children:t}){return e?o.jsx(sv,{content:e,className:"sc-tip",maxWidth:"220px",children:jA(t)}):t}const Bne=["All","Products","Presenters","Scenes","Colors","Brand","Shots"],Qh=Bne.filter(e=>e!=="All"),n5={Products:"Products",Presenters:"Presenters",Scenes:"Scenes",Colors:"Brand colors",Brand:"Brand marks",Shots:"Shots"},Une={Products:"Product",Presenters:"Presenter",Scenes:"Scene",Colors:"Brand color",Brand:"Brand mark",Shots:"Reference shot"},O6={Products:"products",Presenters:"presenters",Scenes:"scenes",Colors:"brand colors",Brand:"brand marks",Shots:"shots"},Wne={Products:"square",Presenters:"square",Scenes:"square",Colors:"swatch",Brand:"square",Shots:"square"},DM={Products:132,Presenters:132,Scenes:132,Colors:132,Brand:132,Shots:132},I6={Products:96,Presenters:96,Scenes:96,Colors:96,Brand:96,Shots:96},r5=10;function Kne(e,t,n){const r=(n?I6:DM)[e];return r<=0||t<=0?1:Math.max(1,Math.floor((t+r5)/(r+r5)))}const Gne={product:"Products",presenter:"Presenters",scene:"Scenes"};function Yne(e){const t=Gne[e.kind];return{key:Ta(e.token),group:t,shape:Wne[t],label:e.label,sub:e.kind==="product"?e.sub:void 0,full:e.recommended?`${e.full} · Recommended`:e.full,search:e.search,thumb:sr(e.thumb??null,"small"),crop:e.crop,recommended:e.recommended,bookmarked:e.bookmarked,token:e.token}}function qne(e){const t=xf(e).map(r=>{const a=r.hash,i=qp(e,r);return{key:`m:${a}`,group:"Brand",shape:"square",label:i,full:`${i} · the mark itself`,search:i,thumb:dn(a,"micro"),token:{t:"mark",imageHash:a}}}),n=Zs(e==null?void 0:e.palette).map(r=>{const a={t:"color",hex:r.hex,name:r.name};return{key:Ta(a),group:"Colors",shape:"swatch",label:r.name,full:`${r.name} · ${r.hex}`,search:`${r.name} ${r.hex}`,swatch:r.hex,token:a}});return[...t,...n]}function Xne(e,t){return e.map((n,r)=>{const a=`Shot ${Math.max(1,t-r)}`;return{key:`r:${n.images[0]}`,group:"Shots",shape:"square",label:a,full:`${a} · joins the shot as a reference image`,search:a,thumb:dn(n.images[0],"micro"),token:{t:"ref",imageHash:n.images[0],label:"Shot"}}})}const s5=(e,t)=>wo(`${e.label} ${e.sub??""} ${e.search}`,t),HM=`
104
- `;function Qne(e){return e.map(Ta).filter(t=>t.length>0).join(HM)}function Jne(e){return new Set(e?e.split(HM):[])}const ere=new Set(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"]);function tre(e,t,n,r){const a=r.length?r[r.length-1].end+1:0;if(a===0)return t==="ArrowUp"?"search":null;const i=Math.max(1,n),l=r.findIndex(p=>e>=p.start&&e<=p.end),u=r[l]??{start:0,end:a-1},f=(e-u.start)%i,h=p=>p.start+Math.floor((p.end-p.start)/i)*i;switch(t){case"ArrowRight":return e+1<a?e+1:null;case"ArrowLeft":return e>0?e-1:null;case"Home":return 0;case"End":return a-1;case"ArrowDown":{if(e+i<=u.end)return e+i;if(e<h(u))return u.end;const p=r[l+1];return p?p.start+Math.min(f,p.end-p.start):null}case"ArrowUp":{if(e-i>=u.start)return e-i;const p=r[l-1];return p?Math.min(p.end,h(p)+f):"search"}}}function nre(e,t){const n=t.trim();return e==="All"?n?`Nothing matches “${n}”.`:"Nothing to add yet.":n?`No matching ${O6[e]}.`:e==="Shots"?"No finished shots yet.":`No ${O6[e]} yet.`}function rre(e){return[{value:null,label:"All",count:Qh.reduce((n,r)=>n+e[r],0)},...Qh.map(n=>({value:n,label:n,count:e[n]}))]}const sre=s.memo(function({card:t,index:n,active:r,ticked:a,why:i,onPick:l,onFocus:u}){const f=g=>{(g.key==="Enter"||g.key===" ")&&g.stopPropagation()},h=i&&!a?i:null,p=o.jsxs("button",{type:"button",className:"sc-ap-card","data-shape":t.shape,"data-group":t.group,"data-nav":n,"data-on":a?"":void 0,tabIndex:r?0:-1,"aria-disabled":h?!0:void 0,"aria-pressed":a,title:h??(a?`${t.label} is in the shot. Press to remove it.`:t.full),onClick:h?void 0:()=>l(n),onFocus:()=>u(n),onKeyDown:f,children:[t.shape==="swatch"?o.jsx("span",{className:"sc-ap-thumb sc-ap-swatch",style:{background:t.swatch},"aria-hidden":!0}):o.jsx(are,{src:t.thumb,crop:t.crop}),o.jsxs("span",{className:"sc-ap-cap",children:[o.jsxs("span",{className:"sc-vh",children:[Une[t.group],": "]}),o.jsx("b",{dir:"auto",children:t.label}),t.sub&&o.jsx("span",{dir:"auto",children:t.sub})]}),(a||!i)&&o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(cr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Kn,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(jn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]}),a&&o.jsx("span",{className:"sc-vh",children:" In the shot."})]});return o.jsx($M,{why:h,children:p})});function are({src:e,crop:t}){const[n,r]=s.useState(!1);return s.useEffect(()=>r(!1),[e]),o.jsx("span",{className:"sc-ap-thumb","data-empty":!e||n?"":void 0,children:!e||n?o.jsx(Ws,{size:16}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async","data-crop":t,onError:()=>r(!0)})})}function a5({onClick:e}){return o.jsxs("button",{type:"button",className:"sc-ap-card sc-ap-add sc-ap-upload-tile",title:"Add an image from your phone. It joins the shot as a reference.",onClick:e,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx(lv,{size:22,"aria-hidden":!0})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Upload image"})})]})}const ore=48,ire={items:[],total:0,hasMore:!1,loading:!1,settled:!1,error:null,loadMore:()=>{}};function Qv(e,t,n=!0){const r=t.trim(),{shotsEpoch:a,subscribeActivity:i}=on(),l=`${e}|${r}|${a}`,[u,f]=s.useState({key:"",items:[],next:null,total:0}),[h,p]=s.useState(!1),[g,v]=s.useState(null),w=s.useRef(null),y=s.useCallback(async S=>{var j;(j=w.current)==null||j.abort();const E=new AbortController;w.current=E,p(!0),v(null);try{const N=await Re.feed(e,{lens:"all",sort:"newest",q:r,limit:ore,cursor:S??void 0},E.signal);if(E.signal.aborted)return;f(P=>{var M;const $=S===null||P.key!==l;return{key:l,items:$?N.items:[...P.items,...N.items],next:N.next,total:((M=N.counts)==null?void 0:M.all)??($?N.items.length:P.total)}})}catch(N){if(E.signal.aborted)return;v(String(N.message??N))}finally{E.signal.aborted||p(!1)}},[e,r,l]);s.useEffect(()=>{if(!n)return;const S=u.key===""?0:150,E=setTimeout(()=>void y(null),S);return()=>clearTimeout(E)},[y,n]),s.useEffect(()=>()=>{var S;return(S=w.current)==null?void 0:S.abort()},[]),s.useEffect(()=>i(S=>{const E=new Map(S.map(j=>[j.id,j]));f(j=>{if(!j.items.some(P=>E.has(P.id)))return j;const N=j.items.flatMap(P=>{const $=E.get(P.id);return $?$.archived?[]:[{...P,...$}]:[P]});return{...j,items:N,total:Math.max(0,j.total-(j.items.length-N.length))}})}),[i]);const x=u.key===l?u:null,k=s.useCallback(()=>{x!=null&&x.next&&y(x.next)},[x==null?void 0:x.next,y]);return x?{items:x.items.filter(S=>S.status==="done"&&S.images.length>0),total:x.total,hasMore:x.next!==null,loading:h,settled:!0,error:g,loadMore:k}:{...ire,loading:h,error:g,loadMore:k}}const t8={Products:"product",Presenters:"presenter",Scenes:"scene"};function lre({brand:e,tab:t,onTab:n,only:r,activeProductCategory:a,refining:i,full:l,attached:u,phone:f,touch:h,onPick:p,onRemove:g,onUpload:v,onFiles:w,onClose:y}){const x=s.useRef(a).current,k=Rf(x),S=s.useMemo(()=>new Set(vo(e.id)),[e.id]),E=ll(),{applyBrand:j}=Rn(),{push:N}=or(),[P,$]=s.useState(!1),[M,C]=s.useState(""),R=s.useDeferredValue(M),[T,H]=s.useState(Fi),[D,K]=s.useState(0),[O,Z]=s.useState(f?347:696),te=s.useRef(null),B=s.useRef(null);s.useEffect(()=>{H(Fi),K(0)},[t,R]),s.useLayoutEffect(()=>{const ce=B.current;if(!ce)return;const ve=()=>Z(ce.clientWidth-2*ure(ce));ve();const Pe=new ResizeObserver(ve);return Pe.observe(ce),()=>Pe.disconnect()},[]);const F=s.useMemo(()=>({product:_i("product",k),presenter:_i("presenter",k),scene:_i("scene",k)}),[k]),X=s.useMemo(()=>qne(e.json),[e.json]),z=Qv(e.id,R),I=s.useMemo(()=>Xne(z.items,z.total),[z.items,z.total]),U=s.useMemo(()=>{const ce={};for(const ve of Qh){const Pe=t8[ve];ce[ve]=ve==="Shots"?z.total:Pe?Pu(F[Pe],R).length:X.filter(de=>de.group===ve&&s5(de,R)).length}return ce},[F,X,R,z.total]),G=s.useCallback((ce,ve)=>{const Pe=t8[ce];if(Pe){const je=hm(Pe,F[Pe],{currentId:null,query:R,bookmarked:S,shown:ve});return{group:ce,items:je.items.map(Yne),total:je.total,remaining:je.remaining}}if(ce==="Shots"){const je=I.slice(0,ve),Ue=z.hasMore?Math.max(1,z.total-I.length):Math.max(0,I.length-ve);return{group:ce,items:je,total:z.total,remaining:Ue}}const de=X.filter(je=>je.group===ce&&s5(je,R));return{group:ce,items:de.slice(0,ve),total:de.length,remaining:Math.max(0,de.length-ve)}},[F,X,R,S,I,z.hasMore,z.total]),ne=s.useMemo(()=>{if(t==="All"){const ce=[];for(const ve of Qh){const Pe=Kne(ve,O,f),de=G(ve,f&&ce.length===0?Math.max(1,Pe-1):Pe);de.items.length>0&&ce.push(de)}return ce}return[G(t,t==="Shots"?Number.MAX_SAFE_INTEGER:T)]},[t,G,T,O,f]),{flat:q,navGroups:le}=s.useMemo(()=>{const ce=[],ve=[];for(const Pe of ne)Pe.items.length&&(ve.push({start:ce.length,end:ce.length+Pe.items.length-1}),ce.push(...Pe.items));return{flat:ce,navGroups:ve}},[ne]);s.useEffect(()=>{K(ce=>Math.max(0,Math.min(ce,q.length-1)))},[q.length]);const Se=s.useCallback(ce=>{var Pe;const ve=(Pe=B.current)==null?void 0:Pe.querySelector(`[data-nav="${ce}"]`);ve&&(K(ce),ve.focus({preventScroll:!0}),ve.scrollIntoView({block:"nearest"}))},[]),Q=s.useRef(null),xe=s.useRef(()=>{});xe.current=()=>{const ce=ne[0];!ce||t==="All"||ce.remaining<=0||(ce.group==="Shots"?z.loading||z.loadMore():H(ve=>ve+Fi))},s.useEffect(()=>{const ce=Q.current,ve=B.current;if(!ce||!ve)return;const Pe=new IntersectionObserver(de=>{de.some(je=>je.isIntersecting)&&xe.current()},{root:ve,rootMargin:"0px 0px 240px 0px"});return Pe.observe(ce),()=>Pe.disconnect()},[t,ne]);const ee=s.useCallback(ce=>{var Pe,de;const ve=q[ce];ve&&(u.has(ve.key)?g(ve):p(ve),h&&((de=(Pe=document.activeElement)==null?void 0:Pe.blur)==null||de.call(Pe)))},[q,u,h,p,g]),ae=ce=>{const ve=ce.clipboardData.files;!ve.length||!Array.from(ve).some(Pe=>Pe.type.startsWith("image/"))||(ce.preventDefault(),w(ve))},re=ce=>{var Ue,ye;const ve=ce.target,Pe=ve instanceof HTMLInputElement&&!!((Ue=te.current)!=null&&Ue.contains(ve));if(ce.key==="Escape"){if(Pe)return;ce.preventDefault(),ce.stopPropagation(),y();return}if(Pe){ce.key==="ArrowDown"?(ce.preventDefault(),ce.stopPropagation(),Se(0)):ce.key==="Enter"&&(ce.preventDefault(),ce.stopPropagation(),ee(0));return}if(!ere.has(ce.key)||(ce.stopPropagation(),ve.closest('[role="tablist"]')))return;const de=ve.closest("[data-nav]");if(!de)return;ce.preventDefault();const je=tre(D,ce.key,cre(de.closest(".sc-ap-grid")),le);if(je==="search"){const Ee=te.current;(ye=(Ee==null?void 0:Ee.querySelector(".sc-libsearch[data-open] input"))??(Ee==null?void 0:Ee.querySelector(".sc-libsearch-toggle")))==null||ye.focus()}else je!=null&&Se(je)},_=async ce=>{$(!0);try{const ve=await Mj(e.id,ce);j(ve);const Pe=ve.logoHash;Pe&&p({key:`m:${Pe}`,group:"Brand",shape:"square",label:"Logo",full:"Logo",search:"",token:{t:"mark",imageHash:Pe}});const de=ve.logoEdge;de&&de<512&&N({kind:"warning",title:"Logo added, but it is small",detail:`Only ${de}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`})}catch(ve){N(nn(ve,"Could not upload that logo"))}finally{$(!1)}},ue=ce=>E(ce,{onCreated:ve=>{if(ve.kind===ce){if(ve.kind==="product"){const Pe={t:"product",id:ve.id};p({key:Ta(Pe),group:"Products",shape:"square",label:"Product",full:"",search:"",token:Pe});return}if(ve.kind==="presenter"){const Pe={t:"character",id:ve.id};p({key:Ta(Pe),group:"Presenters",shape:"square",label:"Presenter",full:ve.name,search:ve.name,token:Pe});return}n("Scenes")}}}),We=async ce=>{var de;const ve=zA((de=e.json)==null?void 0:de.palette,ce);if(!ve.swatch)return;if(ve.added)try{const je=await Re.updateBrand(e.id,{...e.json??{},palette:ve.palette});j(je)}catch(je){N(nn(je,"Could not save the brand"));return}const Pe={t:"color",hex:ve.swatch.hex,name:ve.swatch.name};p({key:Ta(Pe),group:"Colors",shape:"swatch",label:ve.swatch.name,full:"",search:"",swatch:ve.swatch.hex,token:Pe})},Xe=ce=>i&&ce==="Scenes"?"Scenes set up a new shot. Press X on Refining to use one.":l&&ce!=="Colors"?l:null,ze=q.length===0;let tt=0;return o.jsxs("div",{className:"sc-ap-inner",onKeyDown:re,onPaste:ae,children:[o.jsxs("div",{className:"sc-ap-head",ref:te,children:[o.jsx("div",{className:"sc-ap-tabs",children:o.jsx(Xv,{"aria-label":"What to add",activeKey:t==="All"?null:t,items:rre(U),onSelect:ce=>n(ce??"All")})}),o.jsxs("div",{className:"sc-ap-actions",children:[o.jsxs("div",{className:"sc-ap-actions-add",children:[o.jsx(id,{value:M,onChange:C,noun:t==="All"?"everything":O6[t],total:t==="All"?void 0:U[t],shortcut:!1}),!f&&o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-ap-upload",onClick:v,title:"Add an image from your computer. It joins the shot as a reference.",children:[o.jsx(lv,{size:14,"aria-hidden":!0}),o.jsx("span",{children:"Upload image"})]})]}),!f&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-ap-close",onClick:y,"aria-label":"Close",children:o.jsx(jn,{size:14})})]})]}),o.jsxs("div",{className:"sc-ap-body",ref:B,children:[i&&t==="Scenes"&&o.jsx("p",{className:"sc-ap-hint",children:"Scenes set up a new shot, so they sit out while you are refining. Press X on Refining to use one."}),ne.map((ce,ve)=>{var Ee,be,Le;const Pe=Xe(ce.group),de=tt;tt+=ce.items.length;const je=t8[ce.group],ye={"--ap-min":`${(f?I6:DM)[ce.group]}px`,"--ap-lines":je==="product"?2:1};return o.jsxs("section",{className:"sc-ap-group","aria-label":n5[ce.group],children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsxs("span",{className:"sc-ap-sec-title",children:[n5[ce.group],o.jsx("span",{className:"sc-ap-sec-n",children:ce.total})]}),t==="All"&&ce.total>ce.items.length&&o.jsxs("button",{type:"button",className:"sc-ap-sec-act",onClick:()=>n(ce.group),children:["Show all ",ce.total]}),t==="Products"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ue("product"),children:"Add product"}),t==="Presenters"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ue("presenter"),children:"Create presenter"}),t==="Scenes"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>ue("scene"),children:"Create scene"}),t==="Colors"&&o.jsx(Zu,{className:"sc-ap-sec-act sc-ap-add",triggerStyle:{background:"none"},value:Jp(Zs((Ee=e.json)==null?void 0:Ee.palette)),presets:Zs((be=e.json)==null?void 0:be.palette).map(Qe=>Qe.hex),commitMode:"close",align:"end",label:"Add color",onChange:Qe=>void We(Qe),children:"Add color"}),t==="Brand"&&o.jsxs("label",{className:"sc-ap-sec-act sc-ap-add",title:"Add your logo to the brand kit","data-busy":P||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",className:"sc-vh",disabled:P,onChange:Qe=>{var nt;const Ke=(nt=Qe.target.files)==null?void 0:nt[0];Qe.target.value="",Ke&&_(Ke)}}),"Add logo"]})]}),o.jsxs("div",{className:"sc-ap-grid","data-shape":((Le=ce.items[0])==null?void 0:Le.shape)??"square",style:ye,children:[f&&ve===0&&!r&&o.jsx(a5,{onClick:v}),ce.items.map((Qe,Ke)=>o.jsx(sre,{card:Qe,index:de+Ke,active:de+Ke===D,ticked:u.has(Qe.key),why:Pe,onPick:ee,onFocus:K},Qe.key))]}),t!=="All"&&ce.remaining>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:Q,className:"sc-ap-sentinel","aria-hidden":!0}),o.jsxs("p",{className:"sc-ap-foot","aria-live":"polite",children:[ce.items.length," of ",ce.total]})]})]},ce.group)}),t==="Shots"&&z.error&&o.jsxs("p",{className:"sc-ap-empty",children:["Could not load the shots. ",z.error]}),ze&&f&&o.jsx("div",{className:"sc-ap-grid",style:{"--ap-min":`${I6.Products}px`},children:o.jsx(a5,{onClick:v})}),ze&&!(t==="Shots"&&(!z.settled||z.loading||z.error))&&o.jsx("p",{className:"sc-ap-empty",children:nre(t,M)})]})]})}function cre(e){return e?Math.max(1,getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length):1}function ure(e){return Number.parseFloat(getComputedStyle(e).paddingLeft)||0}const dre="(pointer: coarse)";function fre(e){const t=wr(Ks),n=wr(dre),[r,a]=s.useState(e.initialTab??"All");s.useEffect(()=>{a(e.initialTab??"All")},[e.initialTab,e.tabNonce]);const[i]=el(),l=i.get("new")!==null;return o.jsx(hre,{id:e.id,phone:t,touch:n,creating:l,onClose:e.onClose,children:o.jsx(lre,{brand:e.brand,tab:e.only??r,onTab:a,only:e.only,activeProductCategory:e.activeProductCategory,refining:e.refining,full:e.full,attached:e.attached,phone:t,touch:n,onPick:e.onPick,onRemove:e.onRemove,onUpload:e.onUpload,onFiles:e.onFiles,onClose:()=>e.onClose({restore:!n})})})}function hre({id:e,phone:t,touch:n,creating:r,onClose:a,children:i}){const l=s.useRef(null),u=()=>{var p;return a({restore:!n&&!!((p=l.current)!=null&&p.contains(document.activeElement))})},f=s.useRef(u);f.current=u,s.useEffect(()=>{var p,g;n&&((g=(p=document.activeElement)==null?void 0:p.blur)==null||g.call(p))},[n]),s.useLayoutEffect(()=>{var y,x;const p=l.current,g=p==null?void 0:p.parentElement;if(!t||!p||!g)return;const v=()=>{const k=p.closest(".sc-shell")??document.documentElement,S=Number.parseFloat(getComputedStyle(k).getPropertyValue("--sc-topbar-h"))||0,E=g.getBoundingClientRect().top-S-16;p.style.setProperty("--ap-avail",`${Math.max(160,Math.round(E))}px`)};v();const w=new ResizeObserver(v);return w.observe(g),window.addEventListener("resize",v),(y=window.visualViewport)==null||y.addEventListener("resize",v),(x=window.visualViewport)==null||x.addEventListener("scroll",v),()=>{var k,S;w.disconnect(),window.removeEventListener("resize",v),(k=window.visualViewport)==null||k.removeEventListener("resize",v),(S=window.visualViewport)==null||S.removeEventListener("scroll",v)}},[t]),s.useEffect(()=>{const p=g=>{var w;if(g.key!=="Escape"||r)return;const v=document.activeElement;v instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(v))||(g.preventDefault(),g.stopPropagation(),f.current())};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[r]);const h=p=>{var w;const g=document.activeElement,v=p.target;g instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(g))&&!v.closest("input")&&g.blur(),M6(p)};return s.useEffect(()=>{const p=g=>{if(r)return;const v=g.target;v.closest('[data-guide="catch"], [data-guide="card"], [data-guide="inline"]')||document.querySelector('[data-guide="catch"]')||v.closest(".sc-attachpanel, .sc-attach-toggle, [data-attach-opener]")||f.current()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]),o.jsx("div",{ref:l,className:"sc-attachpanel","data-guide-shape":"",role:"dialog",id:e,"aria-label":"Add to shot",onMouseDownCapture:h,children:i})}function pre({target:e,onOpenImage:t,onClear:n}){var f;const r=od(),a=e.images[0],l=(((f=e.brief)==null?void 0:f.tokens)??[]).filter(h=>h.t==="text"&&typeof h.v=="string").map(h=>h.v.trim()).join(" ").trim()||Sr(e),u=s.useCallback(()=>{a&&(r.closeNow(),t())},[a,r.closeNow,t]);return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"sc-token sc-target-chip",role:"button",tabIndex:0,"aria-haspopup":"dialog","aria-label":n?`Version being refined: ${l}. Open the image, or remove to make a new shot.`:`Version being refined: ${l}. Open the image.`,onPointerEnter:h=>{h.pointerType==="mouse"&&a&&r.open({anchor:h.currentTarget})},onPointerLeave:h=>h.pointerType==="mouse"&&r.close(),onClick:u,onKeyDown:h=>{h.target===h.currentTarget&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())},children:[a?o.jsx("img",{src:dn(a,"micro"),alt:""}):o.jsx("span",{className:"sc-target-thumb sc-shimmer"}),"Refining",n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),r.closeNow(),n()},"aria-label":"Make a new shot instead",children:o.jsx(jn,{size:12})})]}),r.shown&&a&&o.jsx(ad,{anchor:r.shown.anchor,kind:"shot",src:dn(a,"tile"),label:l,noun:"Refining this shot",onOpen:u,onHoverIn:r.keep,onHoverOut:r.close,onClose:r.closeNow})]})}function Uu({src:e,kind:t,label:n,noun:r,actions:a,onRestoreFocus:i,onClose:l}){const[u,f]=s.useState(!1),h=r??xM[t],p=s.useRef(null);return o.jsxs(Ts,{className:"sc-lightbox",maxWidth:"min(880px, 92vw)",onOpenAutoFocus:()=>{p.current=document.activeElement},onCloseAutoFocus:g=>{var v;if(g.preventDefault(),i)return i();(v=p.current)!=null&&v.isConnected&&p.current.focus()},onDismiss:l,children:[o.jsx("div",{className:"sc-lightbox-frame","data-kind":t,children:u?o.jsxs("span",{className:"sc-lightbox-blank",children:[o.jsx(Ws,{size:28}),"Image unavailable"]}):o.jsx("img",{src:e,alt:n?`${n}, ${h.toLowerCase()}`:h,onError:()=>f(!0)})}),o.jsxs("p",{className:"sc-lightbox-cap",children:[n&&o.jsx("b",{dir:"auto",children:n}),o.jsx("span",{children:h})]}),a&&o.jsx("div",{className:"sc-lightbox-acts",children:a})]})}const mre={"codex-cli":{sizing:"advisory"},openrouter:{sizing:"ratio"},replicate:{sizing:"ratio",formats:["square","story","landscape"]},fal:{sizing:"exact"},demo:{sizing:"exact"}},gre={sizing:"exact"},OM=e=>mre[e]??gre;function vre(e,t){const n=OM(e).formats;return!n||n.includes(t)}const Jv=e=>OM(e).sizing,Zi=[{id:"draft",label:"Draft",edge:768,note:"quick checks"},{id:"standard",label:"Standard",edge:1024,note:"everyday shots"},{id:"high",label:"High",edge:1536,note:"hero and print"}],Jh=[1,2,3,4],IM=e=>Xr.filter(t=>!vre(e,t.id)).map(t=>t.id),F6=(e,t)=>t.length===0?void 0:`${e} cannot make ${Xr.filter(n=>t.includes(n.id)).map(n=>n.hint).join(" or ")}.`,ew=e=>{var n;e.preventDefault();const t=e.currentTarget??e.target;(n=t==null?void 0:t.querySelector('[role="radiogroup"]'))==null||n.focus()};function n8({aria:e,width:t,trigger:n,open:r,onOpenChange:a,children:i,onCloseAutoFocus:l,guide:u}){const f=s.useRef(null);return s.useEffect(()=>{var p;const h=(p=f.current)==null?void 0:p.parentElement;h&&(h.style.pointerEvents=r?"":"none")},[r]),o.jsxs(Hu,{open:r,onOpenChange:a,children:[o.jsx(Ou,{children:o.jsx("button",{type:"button",className:"sc-var","aria-label":e,"data-guide":u,children:n})}),o.jsx(Iu,{ref:f,className:"sc-setpop",align:"end",sideOffset:8,width:t,onOpenAutoFocus:ew,onCloseAutoFocus:l,onInteractOutside:h=>{var p;(p=h.target)!=null&&p.closest(".sc-prompt-pills")&&h.preventDefault()},children:i(()=>a(!1))})]})}function wre({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,onCloseAutoFocus:h,guided:p=!1,onSettle:g}){const v=Xr.find($=>$.id===r)??Xr[0],w=Zi.find($=>$.id===u)??Zi[1],y=IM(t),x=Jv(t),[k,S]=s.useState(null),E=s.useRef(null);E.current=k;const j=$=>{$.preventDefault(),E.current===null&&(h==null||h($))},N={aspect:"shape",variants:"count",resolution:"quality"},P=$=>({open:k===$,onCloseAutoFocus:j,guide:p?`compose.${N[$]}`:void 0,onOpenChange:M=>{!M&&E.current===$&&(g==null||g(N[$])),S(C=>M?$:C===$?null:C)}});return o.jsxs("div",{className:"sc-prompt-pills","data-guide":p?"compose.settings-row":void 0,children:[o.jsx(n8,{...P("aspect"),aria:`Aspect ${v.label}, ${v.hint}`,width:"178px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(w6,{w:v.w,h:v.h,slot:15,box:13}),v.label]}),children:$=>o.jsxs(o.Fragment,{children:[o.jsx(_o,{label:"Aspect ratio",className:"sc-setpop-list",value:r,ids:Xr.map(M=>M.id),unavailable:y,onChange:a,children:Xr.map(M=>o.jsxs(Zo,{id:M.id,className:"sc-setrow",on:M.id===r,unavailable:y.includes(M.id),label:`${M.label}, ${M.hint}`,onPick:()=>{a(M.id),$()},children:[o.jsx(w6,{w:M.w,h:M.h,slot:20,box:17}),o.jsx("span",{className:"sc-setrow-n",children:M.label}),o.jsx("span",{className:"sc-setrow-v",children:M.hint}),o.jsx(Sx,{})]},M.id))}),F6(n,y)&&o.jsx(gY,{children:F6(n,y)})]})}),e==="generation"&&o.jsx(n8,{...P("variants"),aria:`${i} shot${i===1?"":"s"}`,width:"156px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(fj,{size:14}),i]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(_o,{label:"Shots",className:"sc-seg",value:String(i),ids:Jh.map(String),onChange:M=>l(Number(M)),children:Jh.map(M=>o.jsx(Zo,{id:String(M),className:"sc-seg-o",on:M===i,label:`${M} shot${M===1?"":"s"}`,onPick:()=>{l(M),$()},children:M},M))})})}),e==="generation"&&x!=="ratio"&&o.jsx(n8,{...P("resolution"),aria:`Resolution ${w.label}, ${w.edge} px`,width:"192px",trigger:o.jsxs(o.Fragment,{children:[o.jsx($C,{size:14}),w.label]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(_o,{label:"Resolution",className:"sc-setpop-list",value:u,ids:Zi.map(M=>M.id),onChange:M=>f(M),children:Zi.map(M=>o.jsxs(Zo,{id:M.id,className:"sc-setrow",on:M.id===u,label:`${M.label}, ${M.edge} px, ${M.note}`,onPick:()=>{f(M.id),$()},children:[o.jsx("span",{className:"sc-setrow-n",children:M.label}),o.jsxs("span",{className:"sc-setrow-v",children:[M.edge," px"]}),o.jsx(Sx,{})]},M.id))})})})]})}function FM({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,engineChoices:h,onEngine:p}){const g=IM(t),v=Jv(t);return o.jsxs(o.Fragment,{children:[h&&p&&h.length>1&&o.jsx(Q1,{label:"Engine",children:o.jsx(_o,{label:"Engine",className:"sc-seg",value:t,ids:h.map(w=>w.id),onChange:p,children:h.map(w=>o.jsx(Zo,{id:w.id,className:"sc-seg-o",on:w.id===t,label:w.displayName,onPick:()=>p(w.id),children:w.displayName},w.id))})}),o.jsx(Q1,{label:"Aspect ratio",note:F6(n,g),children:o.jsx(_o,{label:"Aspect ratio",className:"sc-seg",value:r,ids:Xr.map(w=>w.id),unavailable:g,onChange:a,children:Xr.map(w=>o.jsxs(Zo,{id:w.id,className:"sc-seg-o sc-seg-ratio",on:w.id===r,unavailable:g.includes(w.id),label:`${w.label}, ${w.hint}`,onPick:()=>a(w.id),children:[o.jsx(w6,{w:w.w,h:w.h,slot:17,box:14}),w.hint]},w.id))})}),e==="generation"&&o.jsx(Q1,{label:"Shots",children:o.jsx(_o,{label:"Shots",className:"sc-seg",value:String(i),ids:Jh.map(String),onChange:w=>l(Number(w)),children:Jh.map(w=>o.jsx(Zo,{id:String(w),className:"sc-seg-o",on:w===i,label:`${w} shot${w===1?"":"s"}`,onPick:()=>l(w),children:w},w))})}),e==="generation"&&v!=="ratio"&&o.jsx(Q1,{label:"Resolution",note:v==="advisory"?"This engine renders at its own size, so this is a request rather than a guarantee.":void 0,children:o.jsx(_o,{label:"Resolution",className:"sc-seg",value:u,ids:Zi.map(w=>w.id),onChange:w=>f(w),children:Zi.map(w=>o.jsx(Zo,{id:w.id,className:"sc-seg-o",on:w.id===u,label:v==="advisory"?`${w.label}, asks for ${w.edge} px, ${w.note}`:`${w.label}, ${w.edge} px, ${w.note}`,onPick:()=>f(w.id),children:w.label},w.id))})})]})}function Q1({label:e,note:t,children:n}){return o.jsxs("div",{className:"sc-shotfield",children:[o.jsx("span",{className:"sc-shotfield-lb",children:e}),n,t&&o.jsx("p",{className:"sc-shotfield-note",children:t})]})}function yre({guide:e,onSettle:t,...n}){const[r,a]=s.useState(!1),i=f=>{!f&&r&&(t==null||t()),a(f)},{sheet:l,grip:u}=ed(()=>i(!1));return o.jsxs(fc,{open:r,onOpenChange:i,children:[o.jsx(v4,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-var sc-shotset","aria-label":"Shot settings",title:"Shot settings","data-guide":e,children:o.jsx(iv,{size:16})})}),o.jsxs(hc,{children:[o.jsx(pc,{className:"sc-shotsheet-scrim"}),o.jsxs(mc,{ref:l,className:"sc-shotsheet","aria-describedby":void 0,onOpenAutoFocus:ew,onCloseAutoFocus:f=>f.preventDefault(),children:[o.jsxs("div",{className:"sc-shotsheet-grip",...u,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(gc,{className:"sc-vh",children:"Shot settings"})]}),o.jsx(FM,{...n})]})]})]})}const yu=e=>`scenri:draft-${e}`,bre=e=>cs.get(e),xre=(e,t)=>cs.set(e,t),bh=e=>cs.del(e);function o5(e,t){return e.some(n=>n.t==="text"?!!n.v.trim():n.t!=="template")||Object.values(t).some(n=>!!n.trim())}function kre(e){const t=bre(yu(e));if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!="object"||n===null)return null;const r=n;if(r.v!==1||r.brandId!==e||!Array.isArray(r.tokens)||typeof r.tplFields!="object"||!r.tplFields||r.branchId)return bh(yu(e)),null;const a=Date.now()-Date.parse(r.updatedAt??"");return!Number.isFinite(a)||a>Bj?(bh(yu(e)),null):{v:1,brandId:e,updatedAt:r.updatedAt,tokens:r.tokens,tplFields:r.tplFields,setSlug:r.setSlug??null}}function _M(e,t){const n={v:1,brandId:e,updatedAt:new Date().toISOString(),tokens:t.tokens,tplFields:t.tplFields,setSlug:t.setSlug??null};xre(yu(e),JSON.stringify(n))}function i5(e){bh(yu(e))}function l5(e,t,n,r,a){if(e===t)return{changed:!1,toast:null};const i=!!r;return e===null&&!i?{changed:!0,toast:null}:{changed:!0,toast:{title:i?`Switched to ${n}. This starts a new shot instead of refining ${a??"that shot"}.`:`Switched to ${n}.`,prevSceneId:e,branchWasCleared:i}}}function Sre(e,t){return e>0&&t>0&&Math.abs(Math.log(t))<Math.abs(Math.log(e))-.01?"crop":"extend"}const r8=2,Ere=.15;function Cre(e,t){if(Sre(e,t)==="crop")return"crop";if(!(e>0&&t>0))return"extend";const n=t>e?t/e:e/t;return(n>r8?Math.max(r8,n*(1-Ere)):n)>r8+1e-9?"crop":"extend"}const _6=4,ep=24,v0=24,ZM={product:[],presenter:[],scene:null,ref:[],color:[]};function jre(e){const t=[],n=[],r=[],a=[];let i=null;const l=(u,f)=>{u.includes(f)||u.push(f)};for(const u of e)u.t==="product"?l(t,u.id):u.t==="character"?l(n,u.id):u.t==="template"?i=u.id:u.t==="ref"?l(r,u.imageHash):u.t==="color"&&l(a,u.hex.toLowerCase());return{product:t,presenter:n,scene:i,ref:r,color:a}}function Are(e){return`${e.product.join(",")}|${e.presenter.join(",")}|${e.scene??""}|${e.ref.join(",")}|${e.color.join(",")}`}function Nre(e,t,n){const r=e.slice(0,n);return{visible:r,more:Math.max(0,e.length-r.length)}}const tw=s.forwardRef(function({projectId:t,brand:n,engines:r,parentId:a,initialBrief:i,suppressDraftRestore:l,startScene:u,startSetup:f,startPresenter:h,startProduct:p,onSeedsSpent:g,openAttachTab:v,onQueued:w,onSending:y,onAttached:x,onCeiling:k,target:S,onClearTarget:E,sourceImage:j,onRestoreBranchId:N,setSlug:P,persistDraft:$=!0,variant:M="dock",guided:C=!1},R){var dd,hl;const{products:T,productsLoaded:H}=on(),{demoProducts:D,demoProductsLoaded:K,loaded:O}=Rn(),Z=Rf(),te=Z.scenes,B=Z.presenters,F=vf(),X=Ec(),{push:z}=or(),I=r.filter(Ce=>Ce.available),[U,G]=fa(Dr.engine,H0);s.useEffect(()=>{const Ce=QY(I,U);Ce!==U&&G(Ce)},[I,U,G]);const ne=I.length===0&&r.some(Ce=>Ce.code==="not-installed"||Ce.code==="not-authenticated"),q=I.length===0,le=q?ne?{icon:o.jsx(GA,{}),title:"Image generation is not set up yet",detail:"About a minute, using the ChatGPT account you already have.",action:"Set up",onAct:()=>X(),info:!0}:{icon:o.jsx(R0,{size:15}),title:"No image provider connected",detail:"Add a provider key and this prompt is ready to run.",action:"Open settings",onAct:()=>F("engines"),info:!1}:null,[Se,Q]=s.useState(Oo()),[xe,ee]=s.useState(void 0),[ae,re,_]=kg(Dr.format,"square"),[ue,We]=s.useState({}),Xe=S&&S.kind!=="root"?S:null,ze=Xe?Ine(Xe.brief):void 0,tt=Xe?ue[Xe.id]??ze??ae:ae,ce=Ce=>{Xe?We(ht=>({...ht,[Xe.id]:Ce})):re(Ce)},[ve,Pe]=s.useState({}),[de,je,Ue]=kg(Dr.count,2),[ye,Ee]=s.useState(!1),[be,Le]=s.useState(null),[Qe,Ke]=s.useState(null),[nt,gt]=s.useState(!1),[Pt,Ut]=s.useState("All"),[Nt,cn]=s.useState(0),[Fe,pt]=s.useState(null),[it,St,xt]=kg(Dr.quality,"standard"),[At,Kt]=s.useState(!1),[et,mt]=s.useState(!1),ot=Ce=>mt(Ce);wr("(hover: hover) and (min-width: 1024px)");const kn=wr("(max-width: 767px)"),ut=s.useRef(null),Gt=s.useRef(null),Ft=s.useRef(null),en=s.useId(),Jt=s.useRef({tokens:Se,tplFields:ve,branchId:(S==null?void 0:S.id)??null});Jt.current={tokens:Se,tplFields:ve,branchId:(S==null?void 0:S.id)??null};const se=s.useRef(null),oe=s.useRef(null),we=s.useRef(void 0),ge=s.useRef(void 0),J=s.useRef(void 0),Oe=s.useCallback(Ce=>{if(oe.current&&(clearTimeout(oe.current),oe.current=null),!$)return;const ht=Jt.current;ht.branchId||(o5(ht.tokens,ht.tplFields)?_M(Ce,{tokens:ht.tokens,tplFields:ht.tplFields,setSlug:P}):i5(Ce))},[P,$]);s.useEffect(()=>{v&&(Ut(v),gt(!0))},[v]),s.useEffect(()=>{if(!i)return;const Ce=(i.tokens??[]).find(ht=>ht.t==="format");Ce&&_(Ce.id),i.variants&&Ue(i.variants),i.quality&&xt(i.quality),ee($v(i)),Pe(i.templateFields??{})},[i]),s.useEffect(()=>{var ps;const Ce=se.current;Ce&&Ce!==n.id&&Oe(Ce);const ht=!!i||!!l||!$,It=Ce!==n.id;let qt=null,fn=null;if(!ht&&It){const Xt=kre(n.id);Xt&&o5(Xt.tokens,Xt.tplFields)&&(qt=v6(n,Xt.tokens),fn=Xt.tplFields)}let mn=!1;if(u&&u!==we.current){we.current=u,mn=!0;const Xt=qt??Oo(),Fn=Xt.find(xa=>xa.t==="template"),Tn=(Fn==null?void 0:Fn.id)??null,Ua=((ps=te.find(xa=>xa.id===u))==null?void 0:ps.name)??"this scene",Mc=l5(Tn,u,Ua,null,null);if(Mc.changed&&(qt=[{t:"template",id:u,...f?{setup:f}:{}},...Xt.filter(xa=>xa.t!=="template")],Mc.toast)){const xa=Mc.toast;z({kind:"info",title:xa.title,action:{label:"Undo",onClick:()=>{var Tf,$f;xa.prevSceneId?(Tf=ut.current)==null||Tf.insert({t:"template",id:xa.prevSceneId}):($f=ut.current)==null||$f.removeTemplate()}}})}}if(h&&h!==ge.current){ge.current=h,mn=!0;const Xt=qt??Oo();Xt.some(Tn=>Tn.t==="character"&&Tn.id===h)||(qt=[...Xt,{t:"character",id:h}])}if(p&&p!==J.current){J.current=p,mn=!0;const Xt=qt??Oo();Xt.some(Tn=>Tn.t==="product"&&Tn.id===p)||(qt=[...Xt,{t:"product",id:p}])}qt&&(ee(qt),Pe(fn??{})),mn&&(g==null||g()),se.current=n.id},[n.id,u,h,p]),s.useEffect(()=>{var Ce;xe&&((Ce=ut.current)==null||Ce.setTokens(xe),ee(void 0))},[xe]);const Be=s.useMemo(()=>{var fn;const Ce=Xr.find(mn=>mn.id===tt)??Xr[0],It=(((fn=Zi.find(mn=>mn.id===it))==null?void 0:fn.edge)??1024)/Math.max(Ce.w,Ce.h),qt=mn=>Math.max(256,Math.round(mn*It/8)*8);return{t:"format",id:Ce.id,w:qt(Ce.w),h:qt(Ce.h)}},[tt,it]),Ve=s.useMemo(()=>[Be,...Se],[Be,Se]),Ge=s.useMemo(()=>({tokens:Ve,templateFields:ve,variants:de,quality:it,format:tt}),[Ve,ve,de,it,tt]),me=Se.some(Ce=>Ce.t==="text"?!!Ce.v.trim():!0),_e=s.useMemo(()=>{const Ce=Se.find(ht=>ht.t==="template");return Ce?te.find(ht=>ht.id===Ce.id)??null:null},[Se,te]),W=s.useMemo(()=>{const Ce=Se.find(ht=>ht.t==="template");return(Ce==null?void 0:Ce.id)??null},[Se]),pe=s.useCallback(Ce=>{var mn,ps;const ht=(_e==null?void 0:_e.id)??null,It=(S==null?void 0:S.id)??null,qt=((mn=te.find(Xt=>Xt.id===Ce))==null?void 0:mn.name)??"this scene",fn=l5(ht,Ce,qt,It,S?Sr(S):null);if(fn.changed&&((ps=ut.current)==null||ps.insert({t:"template",id:Ce}),fn.toast)){const Xt=fn.toast;z({kind:"info",title:Xt.title,action:{label:"Undo",onClick:()=>{var Fn,Tn;Xt.prevSceneId?(Fn=ut.current)==null||Fn.insert({t:"template",id:Xt.prevSceneId}):(Tn=ut.current)==null||Tn.removeTemplate(),Xt.branchWasCleared&&It&&(N==null||N(It))}}})}},[_e,S,te,z,N]);s.useImperativeHandle(R,()=>({insertToken:Ce=>{var ht;return(ht=ut.current)==null?void 0:ht.insert(Ce)},removeToken:Ce=>{var ht;return(ht=ut.current)==null?void 0:ht.remove(Ce)},applyScene:Ce=>pe(Ce),removeTemplate:()=>{var Ce;return(Ce=ut.current)==null?void 0:Ce.removeTemplate()},openAttach:Ce=>wa(Ce),showAttach:()=>{Eo.current||wa("All")},focus:()=>{var Ce;return(Ce=ut.current)==null?void 0:Ce.focus()},submit:()=>{ui()}}));const Ie=s.useMemo(()=>jre(Se),[Se]),Te=Are(Ie),bt=Qne(Se),vt=s.useMemo(()=>Jne(bt),[bt]),Ct=s.useRef(Ie);Ct.current=Ie,s.useEffect(()=>{x==null||x(Ct.current)},[Te,x]),s.useEffect(()=>{var Ce;!O||!W||_e||((Ce=ut.current)==null||Ce.removeTemplate(),z({kind:"warning",title:"That scene is no longer available",detail:"Removed from the brief."}))},[O,W,_e,z]);const st=s.useRef(null);s.useEffect(()=>(oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>Oe(se.current??n.id),500),()=>{oe.current&&clearTimeout(oe.current)}),[Se,ve,S==null?void 0:S.id,n.id,Oe]),s.useEffect(()=>()=>Oe(se.current??n.id),[Oe]),s.useEffect(()=>{const Ce=()=>Oe(se.current??n.id);return window.addEventListener("beforeunload",Ce),()=>window.removeEventListener("beforeunload",Ce)},[Oe,n.id]);const $t=r.find(Ce=>Ce.id===U),An=$t?Bi($t.displayName):"This engine",Y=!!S&&S.kind!=="root"&&S.status==="running",he=S&&S.kind!=="root"&&S.status==="done"&&S.images.length>0||Y,Me=!!($t!=null&&$t.supportsEdit),dt=!!Xe&&!!ze&&ze!==tt&&he&&!_e,wt=dt?Cre(Bu(ze),Bu(tt)):null,Zt=wt==="crop",Ht=wt==="extend"&&Me,pn=Xr.find(Ce=>Ce.id===tt),Wt=pn?`${pn.label} ${pn.hint}`:tt,[wn,sn]=s.useState(null),In=()=>{S!=null&&S.images[0]&&sn({src:Mr(S.images[0]),kind:"shot",label:Sr(S),noun:"Refining this shot"})},Dt=he&&!_e&&(Me||Zt||Ht)?"edit":"generation",On=Dt==="edit"&&!!S&&M!=="overlay",Et=he?_e?"A scene starts a new shot.":Zt||Ht||Me?null:`${($t==null?void 0:$t.displayName)??"This engine"} cannot edit. This makes a new shot.`:null,Hn=s.useMemo(()=>{const Ce=Xr.find(mn=>mn.id===tt)??Xr[0],ht=`Aspect ${Ce.label} ${Ce.hint}`;if(Dt==="edit")return ht;const It=Zi.find(mn=>mn.id===it),qt=Jv(U),fn=qt==="ratio"||!It?null:qt==="advisory"?`${It.label}, asking for ${It.edge} px`:`${It.label} ${It.edge} px`;return[ht,`${de} shot${de===1?"":"s"}`,fn&&`resolution ${fn}`].filter(Boolean).join(", ")},[Dt,tt,de,it,U]),Ot=s.useRef(void 0),tn=s.useRef(void 0);s.useEffect(()=>{var qt;const Ce=he?(S==null?void 0:S.id)??null:null,ht=Ce!==Ot.current&&Ot.current!==void 0;Ot.current=Ce;const It=W!==tn.current;tn.current=W,!(!_e||!he)&&(ht&&!It&&Ce?(qt=ut.current)==null||qt.removeTemplate():E==null||E())},[_e,W,he,S,E]);const Vn=(Qe==null?void 0:Qe.warnings.filter(Ce=>Ce.includes("built around a product")))??[],ur=dt&&!me,Zr=Zt&&me,zn=!ye&&(me||ur)&&!Zr&&!!t&&!Y&&(Zt||!q),yn=q&&!Zt?"Image generation is not set up yet":ye?"Working on the last one":t?Y?"Wait for this version to finish, or press X to start a new shot":Zr?"This shape is reached by cropping, and a crop uses no words. Clear the prompt, or keep the current shape.":!me&&!ur?"Write a prompt first":null:"Still opening this brand";s.useEffect(()=>{const Ce=Dt==="edit"&&!!S;if(Zt||!me&&!Ce){Ke(null);return}st.current&&clearTimeout(st.current);const ht=Ge;return st.current=setTimeout(()=>{Re.previewBrief(Ge,U,n.id,Ce?S.id:void 0).then(It=>Ke({...It,forBrief:ht})).catch(()=>Ke(null))},280),()=>{st.current&&clearTimeout(st.current)}},[Ge,U,n.id,me,Dt,S,Zt]);const Va=Ce=>{var ht;ce(Ce),(ht=ut.current)==null||ht.focus()},ko=Ce=>{var ht;St(Ce),(ht=ut.current)==null||ht.focus()},So=Ce=>{var ht;je(Ce),(ht=ut.current)==null||ht.focus()},ul=Ce=>{var ht;Ce.preventDefault(),(ht=ut.current)==null||ht.focus()},wa=Ce=>{Ut(Ce),cn(ht=>ht+1),gt(!0)},Eo=s.useRef(!1);Eo.current=nt;const ya=s.useRef(wa);ya.current=wa;const ba=s.useCallback(({restore:Ce})=>{var ht;Eo.current&&(Eo.current=!1,gt(!1),Ce&&((ht=ut.current)==null||ht.restoreCaret()))},[]),Vr=s.useRef(pe);Vr.current=pe;const ts=s.useRef(Se);ts.current=Se;const Gs=s.useCallback(Ce=>{var It;const ht=Ce.token;ht.t==="template"?Vr.current(ht.id):(It=ut.current)==null||It.insert(ht)},[]),za=s.useCallback(Ce=>{var It,qt;const ht=Ce.token;ht.t==="template"?(It=ut.current)==null||It.removeTemplate():(qt=ut.current)==null||qt.remove(ht)},[]),Pr=async Ce=>{var It;if(!(Ce!=null&&Ce.length))return;const ht=Array.from(Ce).filter(qt=>qt.type.startsWith("image/"));if(!ht.length){z({kind:"warning",title:"Only images can be attached here"});return}Kt(!0),Le(null);try{for(const qt of ht.slice(0,4)){const fn=await P0(qt);(It=ut.current)==null||It.insert({t:"ref",imageHash:fn,label:Mre(qt.name)})}ht.length>4&&z({kind:"warning",title:"Only the first 4 images were attached",detail:`${ht.length-4} more ${ht.length-4===1?"was":"were"} skipped. Attach ${ht.length-4===1?"it":"them"} in another pick.`})}catch(qt){Le(String(qt.message??qt)),z(nn(qt,"Could not attach that image"))}finally{Kt(!1),Ft.current&&(Ft.current.value="")}},Lr=Qe&&Qe.forBrief===Ge?Qe:null,Ba=s.useMemo(()=>Se.filter(Ce=>l0.has(Ce.t)).length,[Se]),ci=s.useRef(null),ie=s.useMemo(()=>Ba===0?(ci.current=null,null):(Lr&&(ci.current={cap:Hne(Lr),described:One(Lr),preview:Lr}),ci.current),[Lr,Ba]),De=(ie==null?void 0:ie.cap)??null,Je=(ie==null?void 0:ie.preview)??null,Vt=($t==null?void 0:$t.displayName)??"This engine",Yt=Ba>=Xh?H6:null;s.useEffect(()=>{k==null||k(Yt)},[Yt,k]);const Bn=Ce=>{const ht=ie==null?void 0:ie.described;return!ht||ht.size===0?!1:Ce.t==="product"?ht.has(Fl("product",Ce.id)):Ce.t==="character"?ht.has(Fl("character",Ce.id)):Ce.t==="template"?ht.has(Fl("scene",Ce.id)):Ce.t==="ref"?ht.has(Fl("reference",Ce.imageHash)):Ce.t==="mark"?ht.has(Fl("brand",Ce.imageHash)):!1},Nn=De!=null?`Described in words: ${Vt} pictures ${De} per shot, products and presenters first. Drag it earlier to picture it.`:null,xn=_e?Vn.length>0?"This scene builds around a product. Attach one.":(Je==null?void 0:Je.warnings.some(Ce=>Ce.includes("built around a person")))??!1?"This scene builds around a person. Without a presenter, only the set renders.":null:null,Sn=Ce=>{var mn,ps;if(Ce.t==="template")return xn;if(Ce.t==="product"&&H&&K&&!((T.length?T:((mn=n.json)==null?void 0:mn.products)??[]).some(Tn=>Tn.id===Ce.id)||D.some(Tn=>Tn.id===Ce.id)))return"This product is no longer in your library. Remove it from the brief.";if(Ce.t==="mark"&&!xf(n.json).some(Xt=>Xt.hash===Ce.imageHash))return"This mark is no longer in your brand kit. Remove it from the brief.";if(!Je)return null;const ht=($t==null?void 0:$t.displayName)??"this engine",It=Je.cap,qt=Xt=>`${Xt} won't reach ${ht} this time.`,fn=(Xt,Fn)=>{var Tn;return((Tn=Je.dropped)==null?void 0:Tn.some(Ua=>Ua.role===Xt&&Ua.id===Fn&&Ua.reason==="missing"))??!1};if(Ce.t==="ref"&&!Je.attachments.some(Xt=>Xt.hash===Ce.imageHash))return It===0?`This reference won't reach ${ht}. Choose an engine that reads images, or remove it.`:It==null?qt("This reference"):null;if(Ce.t==="mark"&&!Je.attachments.some(Xt=>Xt.role==="brand"&&Xt.hash===Ce.imageHash))return It===0?`The brand mark won't reach ${ht}, so the logo can't be drawn from it. Choose an engine that reads images.`:It==null?`${qt("The brand mark")} The logo can't be drawn from it.`:null;if(Ce.t==="mark"){const Xt=Je.warnings.find(Fn=>Fn.includes("px across"));if(Xt)return Xt}if(Ce.t==="product"){const Fn=(T.length?T:((ps=n.json)==null?void 0:ps.products)??[]).find(Tn=>Tn.id===Ce.id)??D.find(Tn=>Tn.id===Ce.id);if(Fn&&!Je.attachments.some(Tn=>Tn.role==="product"&&Tn.id===Fn.id))return fn("product",Fn.id)?`${Fn.name} has no usable photo. Re-add one, or remove this.`:null}if(Ce.t==="character"){const Xt=B.find(Fn=>Fn.id===Ce.id);if(!Xt&&B.length>0)return"This presenter is no longer in your roster. Remove them from the brief.";if(Xt&&!Je.attachments.some(Fn=>Fn.role==="character"&&Fn.id===Xt.id))return fn("character",Xt.id)?`${Xt.name} has no usable photo. Re-add one, or remove this.`:null}return null},hs=s.useCallback(Sn,[Je,$t==null?void 0:$t.displayName,xn,T,H,n.json,D,K,B]),cd=s.useCallback(Bn,[ie]),ui=async()=>{var ht,It,qt;if(!zn)return;Ee(!0),Le(null);const Ce=Se.flatMap(fn=>fn.t==="text"?[fn.v]:[]).join(" ").replace(/\s+/g," ").trim();y==null||y({said:Ce||"Your shot",count:Dt==="generation"?de:1});try{if(!t)throw new Error("the workspace is still loading");const fn=await Re.addNode({projectId:t,parentId:Dt==="edit"&&S?S.id:a,kind:Dt,engineId:U,count:de,brief:{...Ge,tokens:v6(n,Ge.tokens)},...Dt==="edit"&&j?{sourceImage:j}:{},...Dt==="edit"&&wt?{reshape:wt}:{}}),mn=fn.warnings??[];mn.length===1?z({kind:"warning",title:"Sent, with one thing to know",detail:mn[0]}):mn.length>1&&z({kind:"warning",title:`Sent, with ${mn.length} things to know`,detail:mn.join(" ")}),(ht=ut.current)==null||ht.setTokens(Oo()),Pe({}),_(null),We({}),Ue(null),xt(null),$&&i5(n.id),w(fn.id,Dt,(It=fn.siblings)==null?void 0:It.map(ps=>ps.id),(qt=fn.siblings)!=null&&qt.length?fn.siblings:[fn])}catch(fn){const mn=String(fn.message??fn);Le(mn),z(nn(fn,"That did not send",$t==null?void 0:$t.displayName)),y==null||y(null)}finally{Ee(!1)}},di=(dd=Se.find(Ce=>Ce.t==="product"))==null?void 0:dd.id,dl=di?T.find(Ce=>Ce.id===di)??(((hl=n.json)==null?void 0:hl.products)??[]).find(Ce=>Ce.id===di)??D.find(Ce=>Ce.id===di)??null:null,Ac=dl?jv(dl):null,ud=C?{brandId:n.id,products:Se.filter(Ce=>Ce.t==="product").length,presenters:Se.filter(Ce=>Ce.t==="character").length,scene:!!_e,others:Se.filter(Ce=>Ce.t==="color"||Ce.t==="ref"||Ce.t==="mark").length,words:Se.some(Ce=>Ce.t==="text"&&!!Ce.v.trim()),busy:ye,pickerOpen:nt,refining:Dt==="edit"&&!!S,engine:q?ne?"setup":"settings":"ready"}:null;s.useEffect(()=>{ud&&_x(ud)}),s.useEffect(()=>{if(C)return()=>_x(null)},[C]),s.useEffect(()=>{if(!C||!nt)return;const Ce=()=>ba({restore:!0});return window.addEventListener("scenri:guide-close-picker",Ce),()=>window.removeEventListener("scenri:guide-close-picker",Ce)},[C,nt,ba]),s.useEffect(()=>{if(!C)return;const Ce=ht=>{var mn;const{kind:It}=ht.detail,qt=It==="presenter"?"character":It==="scene"?"template":"product",fn=[...ts.current].reverse().find(ps=>ps.t===qt);fn&&((mn=ut.current)==null||mn.remove(fn))};return window.addEventListener("scenri:guide-take-back",Ce),()=>window.removeEventListener("scenri:guide-take-back",Ce)},[C]),s.useEffect(()=>{if(!E)return;const Ce=()=>E();return window.addEventListener("scenri:guide-clear-refine",Ce),()=>window.removeEventListener("scenri:guide-clear-refine",Ce)},[E]),s.useEffect(()=>{if(!C)return;const Ce=ht=>{const{tab:It}=ht.detail;pt(It??null),It&&ya.current(It)};return window.addEventListener("scenri:guide-picker",Ce),()=>{window.removeEventListener("scenri:guide-picker",Ce),pt(null)}},[C]);const[Ys,Nc]=s.useState(!1),fl=M==="overlay"&&(Ys||Se.some(Ce=>Ce.t==="text"&&!!Ce.v.trim()));return s.useEffect(()=>{M==="overlay"&&Zx({engaged:fl})},[M,fl]),s.useEffect(()=>{if(M==="overlay")return()=>Zx(null)},[M]),o.jsxs("div",{className:"sc-composer","data-guide":C?"compose":void 0,onPointerDownCapture:M==="overlay"&&!Ys?()=>Nc(!0):void 0,onKeyDownCapture:M==="overlay"&&!Ys?()=>Nc(!0):void 0,children:[o.jsx("input",{ref:Ft,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Ce=>void Pr(Ce.target.files)}),wn&&o.jsx(Uu,{src:wn.src,kind:wn.kind,label:wn.label,noun:wn.noun,onRestoreFocus:()=>{var Ce;return(Ce=ut.current)==null?void 0:Ce.restoreCaret()},onClose:()=>sn(null)}),nt&&o.jsx(fre,{brand:n,activeProductCategory:Ac,refining:On,full:Yt,initialTab:Pt,tabNonce:Nt,only:Fe,id:en,attached:vt,onUpload:()=>{var Ce;return(Ce=Ft.current)==null?void 0:Ce.click()},onFiles:Ce=>void Pr(Ce),onPick:Gs,onRemove:za,onClose:ba}),le&&o.jsx("div",{className:"sc-notes","data-guide-shape":C?"":void 0,children:le&&o.jsxs("div",{className:"sc-banner","data-tone":"action",children:[o.jsx("span",{className:"sc-banner-ic",children:le.icon}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:le.title}),o.jsxs("small",{children:[le.detail,le.info&&o.jsxs(Hu,{children:[o.jsx(Ou,{children:o.jsx("button",{type:"button",className:"sc-note-info","aria-label":"What a ChatGPT account has to do with this",children:o.jsx(_p,{size:13})})}),o.jsxs(Iu,{className:"sc-note-pop",align:"start",sideOffset:8,width:"300px",children:[o.jsx("p",{children:"Codex CLI signs in with your ChatGPT account and makes the images there. Every plan includes some Codex usage, so how many images you get depends on the plan you are on."}),o.jsx("p",{children:"No ChatGPT account, or run out for now? Use your own key from an image provider instead."}),o.jsx("p",{className:"sc-note-pop-fine",children:"Scenri never sees your password or token. The sign-in happens in your browser and stays with Codex."}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>F("engines"),children:"Use a provider key instead"})]})]})]})]}),o.jsx("button",{type:"button",className:"sc-banner-act","data-primary":"","data-guide":C?"compose.engine":void 0,onClick:le.onAct,children:le.action})]})}),o.jsxs("div",{className:"sc-promptcard","data-guide-shape":C?"":void 0,children:[he&&(E||M==="overlay"&&Dt==="edit")&&o.jsxs("div",{className:"sc-target","data-note":Et?"":void 0,children:[o.jsx(pre,{target:S,onOpenImage:In,onClear:E}),Et&&o.jsx("small",{className:"sc-target-note",children:Et})]}),he&&!E&&Et&&!(M==="overlay"&&Dt==="edit")&&o.jsx("small",{className:"sc-target-note sc-target-note-alone",children:Et}),dt&&(Zt||Ht)&&o.jsxs("small",{className:"sc-reshape-hint","aria-live":"polite",children:[Zt?"Will crop to":"Will extend to"," ",Wt]}),o.jsx(Fne,{ref:ut,onChange:Q,brand:n,templates:te,presenters:B,demoProducts:D,onTemplatePick:pe,scenesSitOut:On,flag:hs,described:cd,describedNote:Nn,onInspect:Ce=>sn(Ce),onAttachRequest:Ce=>wa(Ce),activeProductCategory:Ac,placeholder:_e?"Add art direction, or run it as written":Dt==="edit"?"Say what to change about this shot":"What should we shoot? (use $ / @ #)",placeholderSm:_e||Dt==="edit"?void 0:"What should we shoot? ($ / @ #)",label:_e?"Art direction":Dt==="edit"?"What to change":"Shot brief",onSubmit:()=>void ui(),onDropFiles:Ce=>void Pr(Ce)}),o.jsxs("div",{className:"sc-prompt-row",children:[o.jsxs("div",{className:"sc-prompt-left",children:[o.jsx("button",{type:"button",ref:Gt,className:"sc-icon-btn sc-attach-toggle","data-guide":C?"compose.add":void 0,"aria-expanded":nt,"aria-controls":nt?en:void 0,"aria-label":"Add to shot",title:"Add a product, a presenter, a scene, a colour or an image",onClick:()=>nt?ba({restore:!1}):wa("All"),children:At?o.jsx(xr,{size:"1"}):o.jsx(cr,{size:16})}),I.length>1&&o.jsxs(V7,{value:U,onValueChange:G,children:[o.jsxs(z7,{variant:"ghost",className:"sc-mini-sel",children:[o.jsx(R0,{size:14}),o.jsx("span",{className:"sc-mini-sel-t",children:$t?Bi($t.displayName):"Demo"})]}),o.jsx(B7,{children:I.map(Ce=>o.jsx(U7,{value:Ce.id,children:Bi(Ce.displayName)},Ce.id))})]})]}),o.jsxs("div",{className:"sc-prompt-right",children:[o.jsx(wre,{mode:Dt,engineId:U,engineName:An,formatId:tt,onFormat:Va,count:de,onCount:So,quality:it,onQuality:ko,onCloseAutoFocus:ul,guided:C}),o.jsxs(Hu,{open:et,onOpenChange:ot,children:[o.jsx(Ou,{children:o.jsxs("button",{type:"button",className:"sc-var sc-more","aria-label":`Shot settings. ${Hn}`,"data-guide":C&&!kn?"compose.settings":void 0,children:[o.jsx(iv,{size:14}),"More"]})}),o.jsx(Iu,{className:"sc-morepop",align:"end",sideOffset:8,width:"300px",onOpenAutoFocus:ew,onCloseAutoFocus:ul,children:o.jsx(FM,{mode:Dt,engineId:U,engineName:An,formatId:tt,onFormat:Va,count:de,onCount:So,quality:it,onQuality:ko})})]}),o.jsx(yre,{guide:C&&kn?"compose.settings":void 0,mode:Dt,engineId:U,engineName:An,formatId:tt,onFormat:Va,count:de,onCount:So,quality:it,onQuality:ko}),o.jsxs("button",{type:"button",className:"sc-send","data-guide":C?"compose.send":void 0,"aria-disabled":!zn||void 0,onClick:()=>void ui(),"aria-label":Dt==="edit"?"Refine":"Generate",title:be??xn??yn??`${Dt==="edit"?"Refine":"Generate"} (enter)`,children:[o.jsx("span",{className:"sc-send-ico",children:ye?o.jsx(xr,{size:"1"}):o.jsx(lC,{size:17,weight:"bold"})}),o.jsx("span",{className:"sc-send-lb",children:Dt==="edit"?"Refine":"Generate"})]})]})]})]})]})});function Mre(e){return e.replace(/\.[a-z0-9]{2,5}$/i,"").trim()||"Image"}function nw(e,t){s.useLayoutEffect(()=>{if(!e||typeof ResizeObserver>"u")return;const n=document.documentElement,r=()=>n.style.setProperty(t,`${Math.round(e.offsetHeight)}px`);r();const a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect(),n.style.removeProperty(t)}},[e,t])}function VM({full:e=!0,children:t}){const[n,r]=s.useState(null);return nw(n,"--sc-dock-h"),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-dock-fade","data-full":e,"aria-hidden":!0}),o.jsx("div",{className:"sc-canvas-dock","data-full":e,ref:r,children:t})]})}function rw(){const{brand:e}=on(),{tasks:t}=Za(),[n,r]=s.useState(null),[a,i]=s.useState(null),[l,u]=s.useState(()=>Date.now()),f=s.useRef({id:"",pct:0}),h=t.find(y=>y.kind==="catalog"&&y.state==="running");if(s.useEffect(()=>{if(!h)return;const y=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(y)},[h]),!h&&!a)return null;const p=h!=null&&h.id.startsWith("catalog:")?h.id.slice(8):null,g=h!=null&&n===h.id,v=tG(e.json),w=Fr(v==null?void 0:v.file);return h&&(f.current.id!==h.id&&(f.current={id:h.id,pct:0}),f.current.pct=Math.max(f.current.pct,h.percent??0)),o.jsxs(o.Fragment,{children:[h&&o.jsxs("div",{className:"sc-impbar",role:"status",style:{"--sc-impbar-p":`${f.current.pct}%`},children:[o.jsx("span",{className:"sc-impbar-fill","aria-hidden":!0}),o.jsxs("button",{type:"button",className:"sc-impbar-open",onClick:()=>p&&i(p),disabled:!p,"aria-label":"Show import details",children:[o.jsx("span",{className:"sc-impbar-mark","aria-hidden":!0,children:w?o.jsx("img",{src:w,alt:"",className:(v==null?void 0:v.role)==="mark"?"sc-impbar-badge":void 0}):o.jsx(mj,{size:13,weight:"regular"})}),o.jsx("span",{className:"sc-impbar-count",children:h.subtitle}),o.jsx("span",{className:"sc-impbar-clock",children:rc(h.startedAt,l)})]}),p&&o.jsxs("button",{type:"button",className:"sc-impbar-stop",disabled:g,"aria-label":"Stop importing",onClick:()=>{r(h.id),Re.cancelCatalogJob(e.id,p).catch(()=>r(null))},children:[o.jsx(jn,{size:12,weight:"bold"}),g?"Stopping":"Stop"]})]}),a&&o.jsx(p6,{brandId:e.id,jobId:a,onDismiss:()=>i(null)})]})}const Rre={presenter:"Presenter",product:"Product",scene:"Scene"};function zM({entry:e,productName:t,productPreviewUrl:n,productId:r,presenterName:a,presenterPreviewUrl:i,presenterId:l,sceneName:u,scenePreviewUrl:f,sceneId:h,onOpen:p,productHref:g,presenterHref:v,sceneHref:w,active:y,hideRecipe:x,decorative:k,size:S="grid"}){const E=[t,a,u].filter(Boolean).join(" · "),j=a?{key:"presenter",name:a,previewUrl:i,linked:!!(v&&l),href:v&&l?v(l):void 0}:null,N=n&&t?{key:"product",name:t,previewUrl:n,linked:!!(g&&r),href:g&&r?g(r):void 0}:null,P=f&&u?{key:"scene",name:u,previewUrl:f,linked:!!(w&&h),href:w&&h?w(h):void 0}:null;return o.jsxs("div",{className:"sc-showcase-tile","data-active":y||void 0,"aria-hidden":k||void 0,...k?{inert:""}:{},children:[o.jsx(nd,{id:e.id,previewUrl:e.previewUrl,title:e.title,primary:e.title,secondary:x?"":E,useLabel:"Recreate this",variant:"use",onOpen:p,onUse:p,size:S}),(j||N||P)&&o.jsx(Lre,{presenter:j,product:N,scene:P})]})}function Pre(e){return o.jsx(Qp,{...e,caption:!1})}function Lre({presenter:e,product:t,scene:n}){const[r,a]=s.useState(null),i=[t,n].filter(Boolean),l=i.length+(e?1:0)+Math.max(0,i.length-1);let u=0;const f=()=>({"--i":u++});return o.jsxs("div",{className:"sc-showcase-chips",onMouseLeave:()=>a(null),children:[e&&o.jsx(c5,{credit:e,open:r==="presenter",onEnter:()=>a("presenter"),children:$re(e)}),i.length>0&&o.jsxs("div",{className:"sc-showcase-recipe",style:{"--n":l},children:[e&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),i.map((h,p)=>o.jsxs(s.Fragment,{children:[p>0&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),o.jsx(c5,{credit:h,open:r===h.key,onEnter:()=>a(h.key),style:f(),children:Tre({credit:h,step:p===0?1:2})})]},h.key))]})]})}function c5({credit:e,open:t,onEnter:n,children:r,style:a}){const i=s.useRef(null),l=s.useRef(null),[u,f]=s.useState(null),h=Ete(),p=h==="large"?144:88,g=h==="large"?168:112;if(s.useLayoutEffect(()=>{var S,E;if(!t||!e.previewUrl){f(null);return}const w=()=>{const j=i.current;if(!j)return;const N=j.getBoundingClientRect(),P=l.current,$=(P==null?void 0:P.offsetWidth)||p,M=(P==null?void 0:P.offsetHeight)||g,C=window.visualViewport,R=Hte(N,{width:(C==null?void 0:C.width)??window.innerWidth,height:(C==null?void 0:C.height)??window.innerHeight},{width:$,height:M});if(!R){f(null);return}f({left:Math.round(R.left),top:Math.round(R.top)})};w();const y=requestAnimationFrame(w),x=i.current,k=x?new ResizeObserver(w):null;return x&&k&&k.observe(x),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),(S=window.visualViewport)==null||S.addEventListener("resize",w),(E=window.visualViewport)==null||E.addEventListener("scroll",w),()=>{var j,N;cancelAnimationFrame(y),k==null||k.disconnect(),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),(j=window.visualViewport)==null||j.removeEventListener("resize",w),(N=window.visualViewport)==null||N.removeEventListener("scroll",w)}},[t,e.previewUrl,e.key,p,g]),!e.previewUrl)return o.jsx("span",{ref:i,className:"sc-credit-tip",onPointerEnter:n,style:a,children:r});const v=Rre[e.key];return o.jsxs("span",{ref:i,className:"sc-credit-tip","data-open":t||void 0,onPointerEnter:n,style:a,children:[r,t&&Rr.createPortal(o.jsx("span",{ref:l,className:"sc-credit-tip-pop","data-size":h,style:u?{left:u.left,top:u.top}:{left:-9999,top:0},role:"tooltip","aria-label":`${v}: ${e.name}`,children:o.jsxs("span",{className:"sc-credit-tip-card",children:[o.jsx("img",{src:e.previewUrl,alt:""}),o.jsx("span",{className:"sc-credit-tip-name",children:e.name}),o.jsx("span",{className:"sc-credit-tip-role",children:v})]})}),document.body)]})}function Tre({credit:e,step:t}){const{name:n,previewUrl:r,linked:a,href:i}=e;return a&&i?o.jsx(_n,{className:"sc-showcase-chip",to:i,"data-link":!0,"data-step":t,"aria-label":`See ${n}`,onClick:l=>l.stopPropagation(),children:r?o.jsx("img",{src:r,alt:""}):null}):o.jsx("span",{className:"sc-showcase-chip","data-step":t,children:r?o.jsx("img",{src:r,alt:n}):o.jsx("span",{className:"sc-vh",children:n})})}function $re(e){const{name:t,previewUrl:n,linked:r,href:a}=e;return r&&a?o.jsxs(_n,{className:"sc-showcase-badge",to:a,"data-link":!0,"aria-label":`See ${t}`,onClick:i=>i.stopPropagation(),children:[n?o.jsx("img",{src:n,alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]}):o.jsxs("span",{className:"sc-showcase-badge","aria-hidden":!0,children:[n?o.jsx("img",{src:n,alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]})}function u5(e){return{key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(e,"_blank")}}function d5(e){return{key:"select",icon:"select",label:"Select",onSelect:e}}function Ji(e){if(e.only)return[{key:"only",icon:"use",label:e.only.label,onSelect:e.only.run}];if(e.draft){const n=[{key:"continue",icon:"continue",label:"Continue",onSelect:e.draft.onContinue}];return e.draft.href&&n.push(u5(e.draft.href)),e.select&&n.push(d5(e.select.run)),n.push({key:"discard",icon:"discard",label:"Discard",onSelect:e.draft.onDiscard,danger:!0,separated:!0}),n}const t=[];return e.onOpen&&t.push({key:"open",icon:"open",label:"Open",onSelect:e.onOpen}),e.href&&t.push(u5(e.href)),e.use&&t.push({key:"use",icon:"use",label:e.use.label,onSelect:e.use.run}),e.select&&t.push(d5(e.select.run)),e.keep&&t.push({key:"keep",icon:e.keep.on?"kept":"keep",label:e.keep.on?"Remove from Keepers":"Add to Keepers",onSelect:e.keep.run}),e.onRename&&t.push({key:"rename",icon:"rename",label:"Rename",onSelect:e.onRename}),e.onDuplicate&&t.push({key:"duplicate",icon:"duplicate",label:"Duplicate presenter",onSelect:e.onDuplicate}),e.onEdit&&t.push({key:"edit",icon:"edit",label:"Edit presenter",onSelect:e.onEdit}),e.remove&&t.push({key:"delete",icon:"delete",label:e.remove.label,onSelect:e.remove.run,danger:!0,separated:!0}),t}function qr(e,t){if(e==="draft")return{tool:"Discard",menu:t>1?`Discard ${t} drafts`:"Discard",icon:"discard",danger:!0};const n=e==="presenter"?"Delete presenter":e==="product"?"Delete product":"Delete scene",r=e==="presenter"?"presenters":e==="product"?"products":"scenes";return{tool:"Delete",menu:t>1?`Delete ${t} ${r}`:n,icon:"delete",danger:!0}}function pm(e,t,n){return{tool:t?"Remove from keepers":"Keep",menu:e>1?t?`Remove ${e} ${n} from Keepers`:`Add ${e} ${n} to Keepers`:t?"Remove from Keepers":"Add to Keepers",icon:t?"kept":"keep"}}function mm({kind:e,count:t,openLabel:n,onOpen:r,href:a,onDeselect:i,onAct:l,onKeep:u,allKept:f}){const h=qr(e,t),p=[{key:"open",icon:n==="Continue"?"continue":"open",label:n,onSelect:r}];if(a&&p.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(a,"_blank")}),p.push({key:"deselect",icon:"select",label:t>1?"Deselect this":"Deselect",onSelect:i}),u&&e!=="draft"){const v=pm(t,!!f,e==="presenter"?"presenters":e==="product"?"products":"scenes");p.push({key:"keep",icon:v.icon,label:v.menu,onSelect:u})}return p.push({key:e==="draft"?"discard":"delete",icon:h.icon,label:h.menu,onSelect:l,danger:h.danger||void 0,separated:!0}),p}async function tp(e,t){const n=[];let r;for(const a of e)try{await t(a)}catch(i){if((i==null?void 0:i.status)===404)continue;n.push(a),r??(r=i)}return{failed:n,error:r}}function Z6({presenter:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDuplicate:u,onEdit:f,onDelete:h,onRename:p,bookmarked:g,onBookmark:v,fresh:w,chosen:y,batching:x,onPick:k,batch:S,size:E="grid"}){const N=S?mm({kind:"presenter",count:S.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>k==null?void 0:k(e.id),onAct:S.onAct,onKeep:S.onKeep,allKept:S.allKept}):Ji(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:k?{run:()=>k(e.id)}:void 0,keep:v?{on:!!g,run:()=>v(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,onDuplicate:u?()=>u(e.id):void 0,onEdit:f?()=>f(e.id):void 0,remove:h?{label:"Delete presenter",run:()=>h(e.id)}:void 0});return o.jsx(nd,{id:e.id,previewUrl:e.previewUrl,title:e.descriptor||e.name,primary:e.name,secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:N,bookmarked:g,onBookmark:v,fresh:w,chosen:y,batching:x,onPick:k,size:E})}function BM(e){return o.jsx(Qp,{...e})}function I0({scene:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,onDelete:h,onRename:p,chosen:g,batching:v,onPick:w,batch:y,size:x="grid"}){const S=y&&h?mm({kind:"owned-scene",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):Ji(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,remove:h?{label:"Delete scene",run:()=>h(e.id)}:void 0});return o.jsx(nd,{id:e.id,previewUrl:e.previewUrl,title:e.description||Qi(e,"tooltip"),primary:Qi(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,menu:S,chosen:g,batching:v,onPick:w,size:x})}function UM(e){return o.jsx(Qp,{...e})}const pu=new Map,Dre=50;function Hre(e,t){for(pu.delete(e),pu.set(e,t);pu.size>Dre;)pu.delete(pu.keys().next().value)}function Ore(e){return pu.get(e)}const Ire=1e3;function is({className:e="sc-home",children:t}){const n=s.useRef(null),{key:r}=Zn(),a=s.useRef(!1);return s.useLayoutEffect(()=>{const i=n.current,l=Ore(r);if(!i||!l)return;let u=!1;const f=()=>{u||(u=!0,a.current=!1,p.disconnect(),clearTimeout(g),i.removeEventListener("wheel",f),i.removeEventListener("touchstart",f))},h=()=>{u||(i.scrollTop=l,Math.abs(i.scrollTop-l)<1&&f())};a.current=!0;const p=new ResizeObserver(h),g=setTimeout(f,Ire);return i.addEventListener("wheel",f,{passive:!0}),i.addEventListener("touchstart",f,{passive:!0}),h(),p.observe(i),i.firstElementChild&&p.observe(i.firstElementChild),f},[r]),s.useEffect(()=>{const i=n.current;if(!i)return;const l=()=>{a.current||Hre(r,i.scrollTop)};return i.addEventListener("scroll",l,{passive:!0}),()=>i.removeEventListener("scroll",l)},[r]),o.jsx("div",{ref:n,className:e,"data-page-scroll":"",children:t})}function gm({title:e,filters:t,active:n,summary:r,onClear:a,density:i,search:l,action:u}){return o.jsxs("div",{className:"sc-filterbar",children:[e?o.jsx("h1",{className:"sc-vh",children:e}):null,t,o.jsxs("div",{className:"sc-filterbar-actions",children:[n&&o.jsxs("span",{className:"sc-lib-count",children:[r,a&&o.jsx("button",{type:"button",className:"sc-lib-clear",onClick:a,children:"Clear"})]}),l,i,u?o.jsx("span",{className:"sc-filterbar-cta",children:u}):null]})]})}function vm({mode:e,group:t}){if(e==="none"||!t)return null;const n=[{value:null,label:t.everyLabel,count:t.everyCount},...t.options.map(r=>({value:r.value,label:r.label,count:r.count}))];return o.jsx(Xv,{"aria-label":t.label,activeKey:t.selected,items:n,onSelect:t.onSelect})}function oo({shape:e,title:t,body:n,action:r,onRetry:a}){return e==="error"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:t??"Couldn't load this library"}),o.jsx("p",{className:"sc-lookpage-lede",children:n}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:a,children:"Retry"})})]}):e==="cold"?o.jsxs("div",{className:"sc-canvas-empty",children:[t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r&&o.jsx("div",{className:"sc-lookpage-acts",children:r})]}):o.jsxs("div",{className:"sc-lib-zero",children:[o.jsx("p",{children:n}),r]})}function wm({noun:e,q:t,facet:n,onClearSearch:r,onClearAll:a}){const i=t.trim(),l=i?o.jsxs(o.Fragment,{children:["No ",e," found for ",o.jsxs("em",{children:["“",i,"”"]}),n?` in ${n}`:""]}):o.jsxs(o.Fragment,{children:["No ",e," in ",n]});return o.jsx(oo,{shape:"zero",body:l,action:o.jsxs("span",{className:"sc-lib-zero-acts",children:[i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:r,children:"Clear search"}),i&&n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear all"}),!i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear filter"})]})})}const Fre=150;function Pf(e){const[t,n]=el(),r=t.get("q")??"",a=e.join(","),i=s.useMemo(()=>{const E={};for(const j of a.split(",").filter(Boolean))E[j]=t.get(j)||null;return E},[t,a]),l=s.useCallback(E=>{n(j=>{const N=new URLSearchParams(j);for(const[P,$]of Object.entries(E))$===null||$===""?N.delete(P):N.set(P,$);return N},{replace:!0})},[n]),[u,f]=s.useState(r),h=s.useRef(r),p=s.useRef(null),g=s.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]);s.useEffect(()=>{r!==h.current&&(h.current=r,g(),f(r))},[r,g]),s.useEffect(()=>g,[g]);const v=s.useCallback(E=>{f(E),g(),p.current=setTimeout(()=>{p.current=null,h.current=E,l({q:E||null})},Fre)},[l,g]),w=s.useCallback((E,j)=>l({[E]:j}),[l]),y=l,x=u.trim().length>0||Object.values(i).some(Boolean),k=s.useCallback(()=>{g(),f(""),h.current="",l({q:null})},[l,g]),S=s.useCallback(()=>{g(),f(""),h.current="";const E={q:null};for(const j of a.split(",").filter(Boolean))E[j]=null;l(E)},[l,g,a]);return{q:u,setQ:v,facets:i,setFacet:w,setFacets:y,active:x,clearSearch:k,clear:S}}const _re=8;function Zre(){var tt;const{engines:e,scenes:t,loaded:n,presenters:r,presentersLoaded:a,demoProducts:i,showcase:l,showcaseCategories:u,showcaseLoaded:f,showcaseError:h,refetchShowcase:p}=Rn(),{brand:g,workspace:v,root:w,products:y,applyNodes:x}=on(),{poke:k}=Za(),S=ll(),E=Dn(),{push:j}=or(),N=Kv(),P=im(),$=pte(),M=wr(Ks),{q:C,setQ:R,facets:T,setFacet:H,clearSearch:D,clear:K}=Pf(["category"]),O=T.category,Z=ce=>H("category",ce),te=C.trim().length>0,[B,F]=fa(Dr.wallDensity,zu),X=jc(B),z=ce=>F(ce),I=fm(X),U=um(X),G=ce=>{const ve=new URLSearchParams(ce??{}).toString();E(`${mr(g)}${ve?`?${ve}`:""}`)},ne=y.length?y:((tt=g.json)==null?void 0:tt.products)??[],q=ce=>{var je,Ue,ye;const ve=(je=ce.brief.tokens.find(Ee=>Ee.t==="product"))==null?void 0:je.id,Pe=(Ue=ce.brief.tokens.find(Ee=>Ee.t==="character"))==null?void 0:Ue.id,de=(ye=ce.brief.tokens.find(Ee=>Ee.t==="template"))==null?void 0:ye.id;return{product:ve?i.find(Ee=>Ee.id===ve):void 0,presenter:Pe?r.find(Ee=>Ee.id===Pe):void 0,scene:de?t.find(Ee=>Ee.id===de):void 0}},le=s.useMemo(()=>{const ce=new Map;for(const ve of l){const{product:Pe,presenter:de,scene:je}=q(ve);ce.set(ve.id,hte(ve,{product:Pe,presenter:de,scene:je},qg(ve.category)))}return ce},[l,i,r,t]),Se=s.useMemo(()=>(O?l.filter(ve=>ve.category===O):l).filter(ve=>wo(le.get(ve.id)??ve.title,C)),[l,O,C,le]),Q=s.useMemo(()=>{const ce=wte(u);return{key:"category",label:"Categories",everyLabel:"All examples",everyCount:l.length,selected:O,onSelect:Z,options:ce.map(ve=>({value:ve,label:qg(ve)??ve,count:l.filter(Pe=>Pe.category===ve).length}))}},[l,u,O,Z]),xe=ce=>{const{product:ve,presenter:Pe,scene:de}=q(ce);return{productName:ve?go(ve,"chip"):null,productPreviewUrl:(ve==null?void 0:ve.previewUrl)??null,productId:(ve==null?void 0:ve.id)??null,presenterName:(Pe==null?void 0:Pe.name)??null,presenterPreviewUrl:Pe?ti(Pe).src:null,presenterId:(Pe==null?void 0:Pe.id)??null,sceneName:de?Qi(de,"chip"):null,scenePreviewUrl:(de==null?void 0:de.previewUrl)??null,sceneId:(de==null?void 0:de.id)??null}},[ee,ae]=s.useState(null),_=M?$:ce=>{const ve=l.find(Pe=>Pe.id===ce);ve&&(ae($6(ve)),j({kind:"info",title:`Starting from "${ve.title}"`}))},ue=()=>{const ve=[...vo(g.id)].reverse().find(Pe=>t.some(de=>de.id===Pe));G(ve?{scene:ve,attach:"products",compose:"1"}:{attach:"products",compose:"1"})},We=s.useMemo(()=>Oh(Sf(g),r).slice(0,8),[g,r]),Xe=s.useMemo(()=>{const ce=vo(g.id);return Oh(Cc(g),jM(t,ve=>ce.includes(ve.id))).slice(0,8)},[t,g]),ze=s.useMemo(()=>{var ye,Ee,be,Le,Qe;const ce=new Set,ve=Ke=>!Ke||ce.has(Ke)?null:(ce.add(Ke),sr(Ke,"tile")),Pe=Ke=>{for(const nt of Ke){const gt=l.find(Ut=>Ut.id===nt&&Ut.previewUrl),Pt=ve(gt==null?void 0:gt.previewUrl);if(Pt)return Pt}return null},de=Ke=>{for(const nt of Ke){const gt=t.find(Ut=>Ut.id===nt&&Ut.previewUrl),Pt=ve(gt==null?void 0:gt.previewUrl);if(Pt)return Pt}return null},je=Ke=>{for(const nt of l)if(!(!nt.previewUrl||ce.has(nt.previewUrl))&&!(Ke&&!nt.brief.tokens.some(gt=>gt.t===Ke)))return ve(nt.previewUrl);return null},Ue=ne.find(Ke=>{var nt,gt;return Fr((gt=(nt=Ke==null?void 0:Ke.shots)==null?void 0:nt[0])==null?void 0:gt.file)});return{compose:ve(Ue?Fr((Ee=(ye=Ue.shots)==null?void 0:ye[0])==null?void 0:Ee.file):null)??Pe(["aurelia-serum-succulent-dew","verity-pearls-suspended-silk","solstice-aviators-screen-print"])??ve((be=i.find(Ke=>Ke.id==="aurelia-amber-serum"))==null?void 0:be.previewUrl)??ve((Le=i.find(Ke=>Ke.previewUrl))==null?void 0:Le.previewUrl)??je("product"),product:Pe(["voss-rowe-runner-volcanic-ash","birchwood-salt-flat","voss-rowe-dune-slip-face"])??ve((Qe=i.find(Ke=>Ke.id==="voss-rowe-trail-runner"))==null?void 0:Qe.previewUrl)??je("product"),presenter:ve(ti(r.find(Ke=>Ke.id==="maren")??r.find(Ke=>Ke.avatarUrl)??r[0]??{}).src)??je("character"),scene:de(["furniture-travertine-atrium","wide-establishing-environment","studio-soft-horizon","studio-volcanic-ash-field","furniture-lamplight-hours"])??Pe(["moss-larkin-chair-travertine-atrium","calder-snow-loft","basalt-snells-window"])??je("template")}},[t,r,ne,i,l]);return o.jsx(Nf.Provider,{value:U,children:o.jsxs(is,{children:[o.jsxs("main",{className:"sc-main",id:"main","data-no-dock":M||void 0,children:[o.jsxs("h1",{className:"sc-greet",children:["Compose a shot ",o.jsx("em",{children:"on brand"})]}),o.jsxs("div",{className:"sc-create-grid",children:[o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":"compose","data-main":"",onClick:ue,children:[o.jsx(WM,{thumbUrl:ze.compose,fallback:o.jsx(q7,{size:22,weight:"fill"})}),o.jsx("b",{children:"Create an image"})]}),o.jsx(s8,{tone:"product",title:"Add a product",count:ne.length,thumbUrl:ze.product,icon:o.jsx(Zp,{size:22,weight:"fill"}),onClick:()=>S("product")}),o.jsx(s8,{tone:"presenter",title:"Create a presenter",thumbUrl:ze.presenter,icon:o.jsx(tW,{size:22,weight:"fill"}),onClick:()=>S("presenter")}),o.jsx(s8,{tone:"scene",title:"Create a scene",thumbUrl:ze.scene,icon:o.jsx(KU,{size:22,weight:"fill"}),onClick:()=>S("scene")})]}),!f&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":U,style:I,"aria-hidden":!0,children:o.jsx(Pre,{size:"grid",count:8})}),f&&h&&o.jsxs("p",{className:"sc-feed-empty",children:["Couldn't load the showcase gallery."," ",o.jsx("button",{type:"button",className:"sc-sec-more",onClick:()=>p(),children:"Retry"})]}),f&&!h&&l.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gm,{filters:o.jsx(vm,{mode:"tabs",group:Q}),search:l.length>=_re&&o.jsx(id,{value:C,onChange:R,noun:"examples",total:l.length}),density:o.jsx(dm,{value:X,onChange:z})}),Se.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":U,style:I,children:Se.map(ce=>o.jsx(zM,{entry:ce,size:"grid",hideRecipe:!0,onOpen:_,productHref:ve=>la(g,ve),presenterHref:ve=>ha(g,ve),sceneHref:ve=>_r(g,ve),...xe(ce)},ce.id))}),Se.length===0&&(te?o.jsx(wm,{noun:"examples",q:C,facet:O?qg(O):null,onClearSearch:D,onClearAll:K}):o.jsx("p",{className:"sc-looks-empty",children:"No example carries that category yet."}))]}),!a&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(BM,{size:"grid",count:8})}),a&&We.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Presenters"}),o.jsx(_n,{className:"sc-sec-more",to:qi(g),children:"Browse presenters"})]}),o.jsx("div",{className:"sc-masonry",children:We.map(ce=>o.jsx(Z6,{presenter:ce,variant:"navigate",size:"grid",onOpen:N},ce.id))})]}),!n&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(UM,{size:"grid",count:8})}),n&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Scenes"}),o.jsx(_n,{className:"sc-sec-more",to:_u(g),children:"Browse scenes"})]}),o.jsx("div",{className:"sc-masonry",children:Xe.map(ce=>o.jsx(I0,{scene:ce,variant:"navigate",size:"grid",onOpen:P},ce.id))})]})]}),!M&&o.jsxs(VM,{children:[o.jsx(rw,{}),o.jsx(tw,{projectId:(v==null?void 0:v.id)||null,brand:g,engines:e,parentId:w,initialBrief:ee,onQueued:(ce,ve,Pe,de)=>{de!=null&&de.length&&x(de),k(),E(mr(g))}})]})]})})}function s8({tone:e,title:t,icon:n,count:r,thumbUrl:a,onClick:i}){return o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":e,onClick:i,children:[o.jsx(WM,{thumbUrl:a,fallback:n}),o.jsxs("b",{children:[t,r?o.jsx(R7,{variant:"soft",radius:"full",size:"1",children:r}):null]})]})}function WM({thumbUrl:e,fallback:t}){return o.jsx("span",{className:"sc-glyph","data-photo":e?"":void 0,"aria-hidden":!0,children:e?o.jsx("span",{className:"sc-glyph-shot",children:o.jsx("img",{src:e,alt:"",loading:"lazy"})}):t})}function KM({id:e,name:t,hash:n,drawing:r,state:a,href:i,blank:l,onDiscard:u,chosen:f,batching:h,onPick:p,batch:g}){const v=Dn(),w=bv(),y=g?mm({kind:"draft",count:g.count,openLabel:"Continue",onOpen:()=>v(i),href:i,onDeselect:()=>p==null?void 0:p(e),onAct:g.onAct}):Ji(u?{draft:{onContinue:()=>v(i),href:i,onDiscard:()=>u(e)},select:p?{run:()=>p(e)}:void 0}:{onOpen:()=>v(i),href:i}),x=o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":!0,"data-building":r||void 0,"data-picked":f||void 0,"data-batching":h||void 0,children:[o.jsxs(_n,{className:"sc-lookcard-media",to:i,"aria-label":h?`${f?"Deselect":"Select"} ${t}`:`Continue ${t}`,onClick:k=>{h&&p&&(k.preventDefault(),p(e))},children:[n?o.jsx("img",{src:dn(n,"tile"),alt:""}):o.jsx("span",{className:"sc-lookcard-blank",children:l}),r&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),o.jsx("span",{className:"sc-draftmark",children:"Draft"})]}),p&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":f||void 0,"aria-pressed":!!f,"aria-label":f?`Deselect ${t}`:`Select ${t}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),p(e)},children:o.jsx(Kn,{size:13,weight:"bold"})}),u&&!h&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Discard ${t}`,onClick:()=>u(e),children:o.jsx(jn,{size:13})}),o.jsxs("span",{className:"sc-lookcard-cap",children:[o.jsx("b",{dir:"auto",children:t}),o.jsx("span",{children:a})]})]});return w?x:o.jsxs(ff,{children:[o.jsx(hf,{children:x}),o.jsx(pf,{children:y.map(k=>o.jsxs("span",{style:{display:"contents"},children:[k.separated&&o.jsx(Hp,{}),o.jsxs(mf,{color:k.danger?"red":void 0,onSelect:k.onSelect,children:[o.jsx(Ev,{name:k.icon}),k.label]})]},k.key))})]})}function sw({title:e,name:t,maxLength:n,busy:r,error:a,onConfirm:i,onDismiss:l}){const[u,f]=s.useState(t),h=s.useRef(null),p=s.useRef(!1),g=u.trim(),v=g.length>0,w=x=>{x&&(x.style.height="auto",x.style.height=`${x.scrollHeight}px`)};s.useEffect(()=>{p.current=!1,w(h.current)},[t]),s.useEffect(()=>{r||(p.current=!1)},[r]);const y=()=>{if(!(!v||r||p.current)){if(g===t.trim())return l();p.current=!0,i(g)}};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:l,onOpenAutoFocus:x=>{x.preventDefault();const k=h.current;k&&(k.focus(),k.select(),w(k))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:e}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("textarea",{ref:h,className:"sc-pdetails-field",value:u,dir:"auto",rows:1,maxLength:n,"aria-label":"Name",onChange:x=>{f(x.target.value),w(x.currentTarget)},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),y())}})]}),a&&o.jsx("p",{className:"sc-assetform-err",children:a})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:l,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!v||r,"data-busy":r||void 0,onClick:y,children:r?"Saving":"Save"})]})]})}function GM({since:e}){const[t,n]=s.useState(Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[]),o.jsx("span",{className:"sc-cell-tag",role:"status","aria-label":`${vv(e,t)}, ${rc(e,t)}`,children:rc(e,t)})}function Vre({build:e,onCancel:t,onRetry:n,onDismiss:r}){const a=e.stage==="failed",i=a?kf(e.error):null;return o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":a||void 0,"data-building":!a||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[o.jsx("span",{className:"sc-lookcard-blank"}),!a&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(GM,{since:e.startedAt})]}),!a&&t&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Stop building ${e.name}`,onClick:()=>t(e.id),children:o.jsx(jn,{size:13})}),a&&r&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Dismiss ${e.name}`,onClick:()=>r(e.id),children:o.jsx(jn,{size:13})}),a&&n&&o.jsxs("button",{type:"button",className:"sc-lookcard-use",onClick:()=>n(e),children:[o.jsx(tC,{size:12})," Try again"]})]}),i?o.jsxs("span",{className:"sc-lookcard-cap",title:i.raw,children:[o.jsx("b",{dir:"auto",children:e.name}),o.jsx("span",{children:i.title})]}):null]})}function aw({count:e,loaded:t,tool:n,icon:r,danger:a,onAct:i,keep:l,onClear:u,onSelectAll:f}){return o.jsxs("div",{className:"sc-picked",role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),t>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<t?f:u,children:e<t?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsxs("span",{className:"sc-picked-tools",children:[l&&o.jsx(a8,{label:l.label,onClick:l.onAct,children:o.jsx(po,{size:17,weight:l.filled?"fill":"regular"})}),o.jsx(a8,{label:n,tone:a?"danger":void 0,onClick:i,children:o.jsx(zre,{name:r})})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(a8,{label:"Done",onClick:u,children:o.jsx(jn,{size:16,weight:"bold"})})})]})}function zre(e){return o.jsx(il,{size:17})}function a8({label:e,tone:t,onClick:n,children:r}){return o.jsx(lr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}const qd=()=>({kind:null,ids:new Set});function ow(e){const[t,n]=s.useState(qd),r=s.useCallback(()=>n(qd()),[]);s.useEffect(()=>{r()},[e,r]),s.useEffect(()=>{if(t.ids.size===0)return;const p=g=>{g.defaultPrevented||g.key!=="Escape"||r()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t.ids.size,r]);const a=s.useCallback((p,g)=>{n(v=>{if(v.kind&&v.kind!==p)return v;const w=new Set(v.ids);return w.has(g)?w.delete(g):w.add(g),w.size?{kind:v.kind??p,ids:w}:qd()})},[]),i=s.useCallback((p,g)=>{n({kind:p,ids:new Set(g)})},[]),l=s.useCallback(p=>{const g=new Set(p);n(v=>{const w=new Set([...v.ids].filter(y=>g.has(y)));return w.size?{kind:v.kind,ids:w}:qd()})},[]),u=s.useCallback(p=>{n(g=>{if(!g.ids.has(p))return g;const v=new Set(g.ids);return v.delete(p),v.size?{kind:g.kind,ids:v}:qd()})},[]),f=s.useCallback(p=>{t.ids.size===0||p.target.closest(".sc-lookcard, .sc-picked, button, a, input, select, textarea, label, [role], [contenteditable]")||r()},[t.ids.size,r]),h=s.useCallback(p=>t.kind===null||t.kind===p,[t.kind]);return{kind:t.kind,ids:t.ids,toggle:a,selectAll:i,clear:r,retain:l,forget:u,onBlank:f,picking:h,batching:t.kind}}function iw({label:e}){return o.jsx("div",{className:"sc-starter-rule",children:o.jsx("span",{children:e})})}const o8=60;function lw(e,t){const[n,r]=s.useState(o8);s.useEffect(()=>{r(o8)},[t]);const{visible:a,remaining:i}=qv(e,n),l=s.useCallback(()=>r(u=>u+o8),[]);return{visible:a,remaining:i,showMore:l}}const Bre=24,Ure=8,i8="__bookmarked";function Wre(){const{scenes:e,collections:t,verticals:n,loaded:r,error:a,refetch:i,applyBrand:l,refreshBrands:u}=Rn(),{brand:f}=on(),{push:h}=or(),p=Dn(),[g,v]=s.useState(()=>vo(f.id)),w=J=>v(cm("scene",f.id,J)),y=im(),{builds:x,poke:k,studio:S}=Za(),E=ll(),j=s.useMemo(()=>Cc(f),[f]),N=x.filter(J=>J.kind==="scene"&&(!J.finished||J.stage==="failed")),P=!!un({path:ct.sceneStudio}),[$,M]=s.useState(()=>gh(f.id)),C=S.filter(J=>J.kind==="scene").map(J=>`${J.id}:${J.status}`).join("|");s.useEffect(()=>{P||M(gh(f.id))},[P,f.id,C]);const R=s.useMemo(()=>Oee($,S),[$,S]),[T,H]=s.useState(null),D=J=>{J.drawing&&J.jobId&&Re.cancelSceneStudioJob(f.id,J.jobId).catch(()=>{}),Fee(f.id,J.convo),M(gh(f.id))},K=J=>{const Oe=R.find(Be=>Be.convo===J);Oe&&(Oe.hash||Oe.drawing?H(Oe):D(Oe))},{q:O,setQ:Z,facets:te,setFacets:B,clearSearch:F,clear:X}=Pf(["vertical","bookmarked"]),z=te.vertical,I=te.bookmarked==="1",U=ow(`${f.id}|${O}|${z??""}|${I?"1":""}`),G=O.trim().length>0,[ne,q]=fa(Dr.wallDensity,zu),le=jc(ne),Se=J=>q(J),Q=fm(le),xe=um(le),ee=J=>p(_r(f,J)),[ae,re]=s.useState(null),[_,ue]=s.useState(!1),[We,Xe]=s.useState(null),[ze,tt]=s.useState(!1),[ce,ve]=s.useState(null),[Pe,de]=s.useState(!1),je=s.useCallback(J=>{const Oe=j.find(Be=>Be.id===J);Oe&&re(Oe)},[j]),Ue=s.useCallback(J=>{const Oe=j.find(Be=>Be.id===J);Oe&&(ve(null),Xe(Oe))},[j]),ye=async J=>{if(!(!We||ze)){tt(!0),ve(null);try{l((await Re.updateScene(f.id,We.id,{name:J})).brand),Xe(null)}catch(Oe){const Be=nn(Oe,"Could not rename this scene");ve([Be.title,Be.detail].filter(Boolean).join(" "))}finally{tt(!1)}}},Ee=async()=>{if(!(!ae||_)){ue(!0);try{l((await Re.deleteScene(f.id,ae.id)).brand),U.forget(ae.id),re(null)}catch(J){(J==null?void 0:J.status)===404?(await u(),U.forget(ae.id),re(null)):h(nn(J,"Could not delete this scene"))}finally{ue(!1)}}},be=s.useMemo(()=>I?e.filter(J=>g.includes(J.id)):z?e.filter(J=>J.verticals.includes(z)):e,[e,z,I,g]),Qe=!(j.length>0||N.length>0||R.length>0),Ke=[...e,...j].reduce((J,Oe)=>J+(g.includes(Oe.id)?1:0),0),nt=I&&Ke===0,gt=nt&&Qe,Pt=nt&&!Qe,Ut=G||I&&!gt,Nt=s.useMemo(()=>gt?e:be,[gt,e,be]),cn=s.useMemo(()=>Nt.filter(J=>wo(Gh(J),O)),[Nt,O]),[Fe,pt]=s.useState(()=>new Set),{visible:it,remaining:St,showMore:xt}=lw(cn,`${z??""}|${I?"bookmarked":""}|${gt?"browse":""}|${O}`),At=J=>[...j,...e].filter(Oe=>!Oe.verticals.length||Oe.verticals.includes(J)).length,Kt=[{value:i8,label:"Keepers",count:Ke},...n.map(J=>({value:J,label:J,count:At(J)}))],et=e.length>0?"tabs":"none",mt={key:"vertical",label:"Vertical",everyLabel:"All scenes",everyCount:e.length+j.length,selected:I?i8:z,onSelect:J=>B(J===i8?{bookmarked:"1",vertical:null}:{bookmarked:null,vertical:J}),options:Kt},ot=s.useMemo(()=>j.filter(J=>z?!J.verticals.length||J.verticals.includes(z):!0).filter(J=>wo(Gh(J),O)).filter(J=>I?g.includes(J.id):!0),[j,z,O,I,g]),kn=I?ot.length>0:R.length>0||N.length>0||ot.length>0,ut=()=>{U.ids.size===1?je([...U.ids][0]):de(!0)},Gt=[...U.ids],Ft=Gt.length>0&&Gt.every(J=>g.includes(J)),en=()=>v(Gv("scene",f.id,Gt,!Ft)),Jt=pm(U.ids.size,Ft,"scenes"),se=async()=>{if(_)return;const J=[...U.ids];ue(!0);try{const{failed:Oe,error:Be}=await tp(J,Ve=>Re.deleteScene(f.id,Ve));await u(),U.retain(Oe),de(!1),Be&&h(nn(Be,"Could not delete these scenes"))}finally{ue(!1)}},oe=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>E("scene"),children:[o.jsx(cr,{size:12})," Create scene"]}),we=(J,Oe=!1)=>o.jsx("div",{className:"sc-masonry","data-wall":Oe||void 0,"data-density":!0,"data-density-size":xe,style:Q,children:J.map(Be=>o.jsx(I0,{scene:Be,variant:"use",size:"grid",onOpen:ee,href:_r(f,Be.id),onUse:y,bookmarked:g.includes(Be.id),onBookmark:w},Be.id))}),ge=o.jsx(gm,{title:"Scenes",filters:o.jsx(vm,{mode:et,group:mt}),density:o.jsx(dm,{value:le,onChange:Se}),search:e.length>=Ure&&o.jsx(id,{value:O,onChange:Z,noun:"scenes",total:e.length})});return o.jsxs(Nf.Provider,{value:xe,children:[o.jsx(is,{children:o.jsxs("main",{className:"sc-looks sc-scenes",id:"main","data-hero":Qe||void 0,onClick:U.onBlank,children:[!Qe&&ge,kn&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your scenes"})}),o.jsxs("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":xe,style:Q,children:[!I&&R.map(J=>o.jsx(KM,{id:J.convo,name:J.name||"Untitled scene",hash:J.hash,drawing:J.drawing,state:Iee(J),href:Vi(f,J.convo),blank:o.jsx(vj,{size:44,weight:"thin"}),onDiscard:K},J.convo)),T&&o.jsx(Wn,{label:"Discard",title:`Discard ${T.name||"this unfinished scene"}?`,body:T.drawing?"The picture being drawn is stopped, and what was drawn here is thrown away. Nothing was saved to the library.":"What was drawn here is thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:J=>{J||H(null)},onConfirm:()=>{D(T),H(null)}}),!I&&N.map(J=>o.jsx(Vre,{build:J,onCancel:Oe=>void Re.cancelAssetBuild(f.id,Oe).then(k),onDismiss:Oe=>void Re.deleteAssetBuild(f.id,Oe).then(k),onRetry:()=>E("scene")},J.id)),ot.map(J=>o.jsx(I0,{scene:J,variant:"use",size:"grid",onOpen:ee,href:_r(f,J.id),onUse:y,bookmarked:g.includes(J.id),onBookmark:w,onDelete:je,onRename:Ue,chosen:U.ids.has(J.id),batching:U.batching==="owned-scene",onPick:U.picking("owned-scene")?Oe=>U.toggle("owned-scene",Oe):void 0,batch:U.kind==="owned-scene"&&U.ids.has(J.id)?{count:U.ids.size,onAct:ut,onKeep:en,allKept:Ft}:null},J.id))]}),We&&o.jsx(sw,{title:"Rename scene",name:We.name,maxLength:60,busy:ze,error:ce,onConfirm:J=>void ye(J),onDismiss:()=>{ze||Xe(null)}}),ae&&o.jsx(Wn,{label:"Delete scene",title:`Delete ${ae.name}?`,body:"Shots already made here keep their images and their recipe. Only future shots lose it.",open:!0,busy:_,onOpenChange:J=>{!J&&!_&&re(null)},onConfirm:()=>void Ee()}),Pe&&o.jsx(Wn,{label:qr("owned-scene",U.ids.size).menu,title:`${qr("owned-scene",U.ids.size).menu}?`,body:"Shots already made here keep their images and their recipe. Only future shots lose it.",open:!0,busy:_,onOpenChange:J=>{!J&&!_&&de(!1)},onConfirm:()=>void se()})]}),Qe&&r&&!a&&e.length>0&&o.jsx(oo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Build your own ",o.jsx("em",{children:"scene"})]}),body:"Upload a few references of a place, or describe it, and its light and materials carry into every image you make.",action:oe}),kn&&r&&!a&&be.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri scenes"})}),Qe&&r&&!a&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{label:"Or start from one of ours"}),ge]}),!r&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":xe,style:Q,"aria-hidden":!0,children:o.jsx(UM,{size:"grid",count:8})}),r&&a&&o.jsx(oo,{shape:"error",title:"Couldn't load this library",body:"Something went wrong reaching the catalog.",onRetry:()=>i()}),r&&!a&&!Ut&&t.map(J=>{const Oe=Nt.filter(Ge=>Ge.collections.includes(J));if(!Oe.length)return null;const Ve=Fe.has(J)?Oe:Oe.slice(0,Bre);return o.jsxs("section",{className:"sc-coll",children:[o.jsx("h2",{children:J}),we(Ve),Ve.length<Oe.length&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>pt(Ge=>new Set(Ge).add(J)),children:["Show all ",Oe.length]})})]},J)}),r&&!a&&Ut&&it.length>0&&we(it,!0),r&&!a&&Pt&&o.jsx(oo,{shape:"zero",body:"Nothing in Keepers yet. Add a scene to Keepers from its card and it stays here.",action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>B({bookmarked:null}),children:"Browse every scene"})}),r&&!a&&e.length>0&&!Pt&&cn.length===0&&ot.length===0&&o.jsx(wm,{noun:"scenes",q:O,facet:gt?null:I?"Keepers":z,onClearSearch:F,onClearAll:X}),Ut&&St>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:xt,children:["Show ",Math.min(St,60)," more"]})})]})}),o.jsx(uc,{}),U.kind==="owned-scene"&&U.ids.size>0&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(aw,{count:U.ids.size,loaded:ot.length,tool:qr("owned-scene",U.ids.size).tool,icon:qr("owned-scene",U.ids.size).icon,danger:!0,onAct:ut,keep:{label:Jt.tool,filled:Ft,onAct:en},onClear:U.clear,onSelectAll:()=>U.selectAll("owned-scene",ot.map(J=>J.id))})})]})}function cw(e,t,n=12){const r=t.filter(Boolean).join(","),[a,i]=s.useState({key:"",items:[]});return s.useEffect(()=>{if(!r)return;const l=new AbortController;return Re.feed(e,{token:r,limit:n},l.signal).then(u=>{l.signal.aborted||i({key:r,items:u.items.filter(f=>f.status==="done"&&f.images.length>0)})}).catch(()=>{}),()=>l.abort()},[e,r,n]),a.key===r?a.items:[]}const V6=[{id:"top-down",label:"Top down",camera:"Directly overhead, looking straight down, the subject centred, deep focus"},{id:"eye-level",label:"Eye level",camera:"Eye level, the subject at a natural three-quarter angle, medium depth"},{id:"ground",label:"Ground level",camera:"Ground level, camera low, the subject close and large in frame, the place rising behind it"},{id:"wide",label:"Wide",camera:"A wide view, the subject small in the frame, the place around it doing the talking"},{id:"close",label:"Close",camera:"Close in on the subject, its surface, edge and material filling the frame"}],YM=4;function Kre(e,t=""){var u,f;const n=[],r=((u=e.refs)==null?void 0:u.length)??0;r>0&&n.push(`read from ${r} ${r===1?"photograph":"photographs"}`);const a=((f=e.setups)==null?void 0:f.length)??0;a>0&&n.push(`${a} ${a===1?"way":"ways"} to shoot it`);const i=n.join(" · "),l=i?`${i.charAt(0).toUpperCase()}${i.slice(1)}.`:"";return[t.trim(),l].filter(Boolean).join(" ")}function Gre({items:e,placeholder:t,open:n,hit:r,onRemove:a,onOpen:i}){return o.jsxs("div",{className:"sc-chipfield","data-state":n?"open":void 0,children:[r,o.jsxs("span",{className:"sc-chipfield-row",children:[e.length===0&&t?o.jsx("span",{className:"sc-chipfield-ph",children:t}):null,e.map(l=>o.jsxs("span",{className:"sc-chipfield-chip",onClick:()=>i==null?void 0:i(),children:[l,a&&o.jsx("button",{type:"button","data-role":"remove","aria-label":`Remove ${l}`,onPointerDown:u=>u.stopPropagation(),onClick:u=>{u.preventDefault(),u.stopPropagation(),a(l)},children:o.jsx(jn,{size:10,weight:"bold"})})]},l))]}),o.jsx(Yi,{size:13,className:"sc-chipfield-caret","aria-hidden":!0})]})}function Yre({value:e,onChange:t,options:n,label:r,placeholder:a="Any",findPlaceholder:i="Find or add",emptyNote:l="Nothing by that name.",max:u=12,maxLength:f=40}){const[h,p]=s.useState(!1),[g,v]=s.useState(""),w=s.useRef(null),y=[...n,...e.filter(P=>!n.some($=>tu($,P)))],x=g.trim(),k=x?y.filter(P=>P.toLowerCase().includes(x.toLowerCase())):y,S=e.length>=u,E=x.length>0&&!y.some(P=>tu(P,x))&&!S,j=P=>{const $=e.some(M=>tu(M,P));!$&&S||t($?e.filter(M=>!tu(M,P)):[...e,P])},N=()=>{var P;E&&(t([...e,x.slice(0,f)]),v(""),(P=w.current)==null||P.focus())};return s.useEffect(()=>{if(!h)return;const P=setTimeout(()=>{var $;return($=w.current)==null?void 0:$.focus()},0);return()=>clearTimeout(P)},[h]),o.jsxs(Ss,{open:h,onOpenChange:P=>{p(P),P||v("")},children:[o.jsx(Gre,{items:e,placeholder:a,open:h,onOpen:()=>p(!0),onRemove:P=>t(e.filter($=>!tu($,P))),hit:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-chipfield-hit","aria-label":r})})}),o.jsxs(Cs,{align:"start",sideOffset:6,className:"sc-menu sc-chippick-menu",children:[o.jsx("input",{ref:w,className:"sc-chippick-find",type:"text",value:g,maxLength:f,placeholder:i,"aria-label":i,onChange:P=>v(P.target.value),onKeyDown:P=>{P.stopPropagation(),P.key==="Enter"?(P.preventDefault(),E?N():k.length===1&&j(k[0])):P.key==="Escape"&&p(!1)}}),o.jsxs("div",{className:"sc-chippick-list",children:[k.map(P=>{const $=e.some(M=>tu(M,P));return o.jsxs(tr,{className:"sc-menu-item","data-on":$||void 0,"data-off":!$&&S?"":void 0,onSelect:M=>{M.preventDefault(),j(P)},children:[o.jsx("span",{className:"sc-menu-lb",children:P}),$&&o.jsx(Kn,{size:14,className:"sc-menu-check","aria-hidden":"true"})]},P)}),!k.length&&!E&&o.jsx("p",{className:"sc-chippick-none",children:l})]}),E&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(tr,{className:"sc-menu-item",onSelect:P=>{P.preventDefault(),N()},children:[o.jsx(cr,{size:16,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:['Add "',x,'"']})]})]}),S&&o.jsx("p",{className:"sc-chippick-none",children:"That is as many as this holds."})]})]})}const tu=(e,t)=>e.trim().toLowerCase()===t.trim().toLowerCase();function qM({name:e,categories:t,known:n,hint:r,ways:a,wayChoices:i,wayMax:l,busy:u,error:f,onSave:h,onDismiss:p}){const[g,v]=s.useState(e),[w,y]=s.useState(t),[x,k]=s.useState(()=>[...a??[]]),S=g.trim(),E=S.length>0,j=M=>M.map(C=>C.id).join(" "),N=S!==e.trim()||w.join(" ")!==t.join(" ")||!!a&&j(x)!==j(a),P=x.length>=(l??Number.POSITIVE_INFINITY)?[]:(i??[]).filter(M=>!x.some(C=>C.id===M.id)),$=()=>{if(!(!E||u)){if(!N)return p();h({name:S,categories:w,...a?{ways:x}:{}})}};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:p,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Details"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{className:"sc-pdetails-field",value:g,dir:"auto",onChange:M=>v(M.target.value),onKeyDown:M=>M.key==="Enter"&&$()})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Categories"}),o.jsx(Yre,{value:w,onChange:y,options:n,label:"Categories",placeholder:"Any",findPlaceholder:"Find or add a category",emptyNote:"Nothing by that name.",maxLength:30}),o.jsx("span",{className:"sc-pdetails-hint",children:r})]}),a&&o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Ways to shoot it"}),o.jsxs("div",{className:"sc-pdetails-ways",children:[x.map(M=>o.jsxs("div",{className:"sc-pdetails-way",children:[o.jsx("span",{className:"sc-pdetails-way-lb",children:M.label}),o.jsx("span",{className:"sc-pdetails-way-sub",children:M.camera}),o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":`Remove ${M.label}`,onClick:()=>k(x.filter(C=>C.id!==M.id)),children:o.jsx(jn,{size:13,weight:"bold","aria-hidden":!0})})]},M.id)),P.length>0&&o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-label":"Add a way to shoot it",children:[o.jsx(cr,{size:12,weight:"bold","aria-hidden":!0}),o.jsx("span",{children:"Add a way"})]})}),o.jsx(Cs,{children:P.map(M=>o.jsx(tr,{onSelect:()=>k([...x,M]),children:M.label},M.id))})]})]}),o.jsxs("span",{className:"sc-pdetails-hint",children:["A way moves the camera and leaves the world alone.",l?` ${l} at most.`:""]})]}),f&&o.jsx("p",{className:"sc-assetform-err",children:f})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:p,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!E,"data-busy":u||void 0,onClick:$,children:u?"Saving":"Save"})]})]})}function zl({src:e,crop:t}){const[n,r]=s.useState(!1);return n?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",...t?{"data-crop":t}:{},onError:()=>r(!0)})}function uw(){return o.jsx("div",{className:"sc-lookpage-refs",children:o.jsx("div",{className:"sc-lookpage-ref",children:o.jsx("span",{className:"sc-lookpage-ref-blank",children:o.jsx(Ws,{size:20})})})})}function dw({node:e,to:t}){const[n,r]=s.useState(!1);return o.jsx(_n,{className:"sc-lookcard","aria-label":`Open ${Sr(e)}`,to:t,children:n?o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:dn(e.images[0],"tile"),alt:"",loading:"lazy",onError:()=>r(!0)})})}function Lu({label:e,children:t}){const n=s.useRef(null),r=s.useRef(null),a=s.useRef(!1),i=s.useRef(()=>{});s.useLayoutEffect(()=>{const u=n.current,f=r.current;if(!u||!f)return;let h=0;const p=()=>{const w=f.scrollWidth-f.clientWidth;if(w<=1){delete u.dataset.overflowLeft,delete u.dataset.overflowRight;return}f.scrollLeft>2?u.dataset.overflowLeft="":delete u.dataset.overflowLeft,f.scrollLeft<w-2?u.dataset.overflowRight="":delete u.dataset.overflowRight};i.current=p,p();const g=()=>{h||(h=requestAnimationFrame(()=>{h=0,p()}))},v=new ResizeObserver(()=>p());return v.observe(f),f.addEventListener("scroll",g,{passive:!0}),()=>{h&&cancelAnimationFrame(h),i.current=()=>{},v.disconnect(),f.removeEventListener("scroll",g)}},[]);const l=u=>{const f=r.current;if(!(f!=null&&f.firstElementChild)||a.current)return;const h=f.firstElementChild.getBoundingClientRect().width+16,p=f.scrollWidth/2;u<0&&f.scrollLeft<h&&(f.scrollLeft+=p);const g=f.scrollLeft,v=u*h,w=performance.now();a.current=!0;const y=x=>{const k=Math.min(1,(x-w)/420);f.scrollLeft=g+v*(1-(1-k)**3),i.current(),k<1?requestAnimationFrame(y):(a.current=!1,f.scrollLeft>=p&&(f.scrollLeft-=p),i.current())};requestAnimationFrame(y)};return o.jsxs("section",{className:"sc-lookpage-band",children:[o.jsx("p",{className:"sc-bandhead",children:e}),o.jsxs("div",{className:"sc-slider",ref:n,children:[o.jsx("button",{type:"button",className:"sc-slider-arrow prev","aria-label":"Previous",onClick:()=>l(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-slider-arrow next","aria-label":"Next",onClick:()=>l(1),children:o.jsx(ol,{size:13,weight:"bold"})}),o.jsxs("div",{className:"sc-slider-track",ref:r,children:[t,t]})]})]})}function XM(e){const t=s.useRef(null),n=s.useRef(null);s.useLayoutEffect(()=>{const a=t.current,i=n.current;if(!a||!i)return;let l=0;const u=()=>{const p=i.scrollWidth-i.clientWidth;if(p<=1){delete a.dataset.overflowLeft,delete a.dataset.overflowRight;return}i.scrollLeft>2?a.dataset.overflowLeft="":delete a.dataset.overflowLeft,i.scrollLeft<p-2?a.dataset.overflowRight="":delete a.dataset.overflowRight},f=()=>{l||(l=requestAnimationFrame(()=>{l=0,u()}))};u();const h=new ResizeObserver(()=>u());h.observe(i);for(const p of i.children)h.observe(p);return i.addEventListener("scroll",f,{passive:!0}),()=>{l&&cancelAnimationFrame(l),h.disconnect(),i.removeEventListener("scroll",f)}},[e]);const r=s.useCallback(a=>{const i=n.current;if(!(i!=null&&i.firstElementChild))return;const l=i.firstElementChild.getBoundingClientRect().width,u=Number.parseFloat(getComputedStyle(i).columnGap)||0,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;i.scrollBy({left:a*(l+u),behavior:f?"auto":"smooth"})},[]);return{shellRef:t,railRef:n,page:r}}function fw({count:e,label:t,className:n,trackClassName:r,style:a,children:i}){const{shellRef:l,railRef:u,page:f}=XM(e);return o.jsxs("div",{className:n?`sc-rail ${n}`:"sc-rail",ref:l,style:{"--sc-rail-count":e},children:[o.jsx("button",{type:"button",className:"sc-rail-arrow prev","aria-label":`${t}, earlier`,onClick:()=>f(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-rail-arrow next","aria-label":`${t}, later`,onClick:()=>f(1),children:o.jsx(ol,{size:13,weight:"bold"})}),o.jsx("ol",{className:r?`sc-rail-track ${r}`:"sc-rail-track","aria-label":t,ref:u,style:a,children:i})]})}function ym(){const e=s.useRef(!1);return s.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),s.useCallback(()=>{const t=window.location.pathname;return()=>e.current&&window.location.pathname===t},[])}const qre=1500;function QM(e,t,n){const{refreshBrands:r}=Rn(),[a,i]=s.useState(null),[l,u]=s.useState([]),[f,h]=s.useState([]),[p,g]=s.useState(!1),[v,w]=s.useState(0),y=s.useRef(void 0),x=s.useRef(r);x.current=r,s.useEffect(()=>{if(!t)return;let S=!0,E=null;const j=async()=>{var N;try{const P=await Re.sceneExamples(e,t);if(!S)return;const $=P.job?`${P.job.id}:${P.job.done.length}:${P.job.status}`:null;if($&&y.current!==void 0&&$!==y.current&&await x.current(),!S)return;y.current=$,i(P.job),u(P.first),h(P.more),g(!0),((N=P.job)==null?void 0:N.status)==="running"&&(E=setTimeout(j,qre))}catch{}};return j(),()=>{S=!1,E&&clearTimeout(E)}},[e,t,n,v]);const k=s.useCallback(()=>w(S=>S+1),[]);return{job:a,first:l,more:f,read:p,again:k}}const Xre=["no","one","two","three","four","five"];function Qre({brandId:e,scene:t,onError:n}){const{applyBrand:r}=Rn(),a=im(),i=ym(),{job:l,first:u,again:f}=QM(e,t.id,t.previewUrl??null),[h,p]=s.useState(!1),[g,v]=s.useState(!1),[w,y]=s.useState(null),x=lA(t.examples,l),k=(l==null?void 0:l.status)==="running",S=DK(t.examples),E=async()=>{if(g||!u.length)return;const T=i();v(!0),n(null);try{await Re.drawSceneExamples(e,t.id,{first:!0}),f()}catch(H){T()&&n(String((H==null?void 0:H.message)??H))}finally{T()&&v(!1)}},j=u.length&&(l==null?void 0:l.status)!=="running"?o.jsx("p",{className:"sc-scenepage-examples-ask",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:g,onClick:()=>void E(),children:[S.length?"Draw them again":"Draw it in use",`, ${Xre[u.length]??u.length} picture${u.length===1?"":"s"}`]})}):null,N=async T=>{const H=V6.find(K=>K.id===T);if(!H||h)return;const D=i();p(!0),n(null);try{const K=t.setups??[];if(!K.some(O=>O.id===H.id)){const O=await Re.updateScene(e,t.id,{setups:[...K,H]});r(O.brand)}a(t.id,H.id)}catch(K){D()&&n(String((K==null?void 0:K.message)??K))}finally{D()&&p(!1)}},P=t.previewUrl?{src:t.previewUrl,label:"The place"}:null;if(!x.length&&!P)return o.jsx(uw,{});if(!x.length&&P)return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button","aria-label":`${P.label}, open`,onClick:()=>y(P),children:o.jsx(zl,{src:sr(P.src,"tile")})})}),j,w&&o.jsx(Uu,{src:w.src,kind:"scene",label:w.label,noun:t.name,onClose:()=>y(null)})]});const $=w==null?void 0:w.tile,M=$!=null&&$.setup?V6.find(T=>T.id===$.setup):void 0,C=!!M&&((t.setups??[]).some(T=>T.id===M.id)||(t.setups??[]).length<YM),R=k&&l?gv({status:l.status,step:l.current,done:l.done.length,total:l.roles.length,error:l.error}):S.length>0?`${S.length===1?`The ${tc[S[0]].toLowerCase()} shows`:"These show"} an earlier picture of this place.`:null;return o.jsxs(o.Fragment,{children:[o.jsxs(fw,{count:x.length+(P?1:0),label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:[P&&o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":"The place, open",onClick:()=>y(P),children:o.jsx(zl,{src:sr(P.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:"The place"})]}),x.map(T=>{const H=tc[T.role];return o.jsxs("li",{children:[T.state==="drawing"?o.jsxs("span",{className:"sc-refset-tile","data-state":"drawing",role:"img","aria-label":`${H}, drawing`,children:[T.url&&o.jsx(zl,{src:sr(T.url,"small")}),o.jsx("span",{className:"sc-shimmer","aria-hidden":!0})]}):T.state==="failed"?o.jsxs("span",{className:"sc-refset-tile","data-state":"failed",role:"img","aria-label":`${H} did not draw`,title:T.error,children:[o.jsx(kc,{size:20,"aria-hidden":!0}),o.jsx("span",{children:"Did not draw"})]}):o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${H}, open`,onClick:()=>y({src:T.url,label:H,tile:T}),children:o.jsx(zl,{src:sr(T.url,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:H})]},T.role)})]}),R&&o.jsx("p",{className:"sc-scenepage-examples-state","aria-live":"polite",children:R}),j,w&&o.jsx(Uu,{src:w.src,kind:"scene",label:w.label,noun:t.name,onClose:()=>y(null),actions:M&&C?o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:h,onClick:()=>void N(M.id),children:"Shoot it this way"}):void 0})]})}function Jre(){var xe,ee,ae,re;const{sceneId:e}=Bs(),{scenes:t,loaded:n,error:r,refetch:a,applyBrand:i,refreshBrands:l}=Rn(),{brand:u}=on(),f=Dn(),h=im(),p=u.id,[g,v]=s.useState([]),[w,y]=s.useState(()=>vo(p)),[x,k]=s.useState(null),S=_=>f(_r(u,_)),E=Hh(u,e??""),j=E??t.find(_=>_.id===e);Sc(j==null?void 0:j.name);const N=!!E;s.useEffect(()=>{let _=!0;if(v([]),!N)return Re.sceneFrames(e??"").then(ue=>{_&&v(ue.frames)}).catch(()=>{_&&v([])}),()=>{_=!1}},[e,N]);const P=cw(u.id,[e??""]),$=s.useMemo(()=>{if(!j||N)return[];return t.filter(We=>We.id!==j.id).sort((We,Xe)=>ue(Xe)-ue(We)).slice(0,8);function ue(We){const Xe=We.lighting.split(/[ ,]+/).some(tt=>tt.length>3&&j.lighting.toLowerCase().includes(tt.toLowerCase())),ze=We.collections.some(tt=>j.collections.includes(tt));return(Xe?2:0)+(ze?1:0)}},[t,j,N]),M=s.useMemo(()=>{if(j||!n||r)return[];const _=vo(p);return jM(t,ue=>_.includes(ue.id)).slice(0,6)},[j,n,r,t,p]),[C,R]=s.useState(null),[T,H]=s.useState(!1),[D,K]=s.useState(!1),[O,Z]=s.useState(!1),te=s.useRef(!1),B=ym(),F=s.useMemo(()=>[...new Set([...t.flatMap(_=>_.verticals),...Cc(u).flatMap(_=>_.verticals)])].sort((_,ue)=>_.localeCompare(ue)),[t,u]),X=async _=>{if(E){K(!0),R(null);try{const ue=await Re.updateScene(u.id,E.id,{name:_.name,verticals:_.categories,..._.ways?{setups:_.ways}:{}});i(ue.brand),Z(!1)}catch(ue){R(String(ue.message??ue))}finally{K(!1)}}},z=async()=>{if(!E||te.current)return;te.current=!0;const _=B(),ue=_u(u);H(!0);try{const We=await Re.deleteScene(u.id,E.id);i(We.brand)}catch(We){if((We==null?void 0:We.status)!==404){te.current=!1,_()&&(R(String(We.message??We)),H(!1));return}await l()}_()&&f(ue,{replace:!0})};if(!n&&!E)return o.jsx(is,{children:o.jsx("main",{className:"sc-lookpage sc-scenepage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!E)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this scene"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!j)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"This scene isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed from the catalog, or the link is out of date."}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx(_n,{className:"sc-btn sc-btn-primary",to:`${mr(u)}?compose=1`,children:"Start from scratch"}),o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:_u(u),children:"Browse all scenes"})]}),M.length>0&&o.jsx(Lu,{label:"You might like",children:M.map(_=>o.jsx(I0,{scene:_,variant:"navigate",size:"slider",onOpen:S,href:_r(u,_.id)},_.id))})]})});const I=g.length?g.map((_,ue)=>({src:_,label:`Example ${ue+1}`})):j.previewUrl?[{src:j.previewUrl,label:"The place"}]:[],U=j.subject!=="person"&&I.length>0?"Shown with a demo product for reference. Yours replaces it.":"",G=!E&&w.includes(j.id),ne=(E==null?void 0:E.setups)??[],q=((E==null?void 0:E.refs)??[]).filter(_=>_!==(E==null?void 0:E.previewUrl)),le=((ee=(xe=E==null?void 0:E.examples)==null?void 0:xe.find(_=>!_.earlier))==null?void 0:ee.with)??((re=(ae=E==null?void 0:E.examples)==null?void 0:ae[0])==null?void 0:re.with),Se=E?E.figure?"The person in it is a stand-in: with a presenter attached, the picture goes with the shot and they take the role.":le?`Shown in use with a Scenri demo ${le}. Shots are told the words, never handed these pictures.`:E.previewUrl?"Shots are told the words, never handed this picture.":"":"",Q=E?Kre({refs:q,setups:E.setups},Se):"";return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:j.name}),j.verticals.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:j.verticals.map(_=>o.jsx("li",{className:"sc-chip","data-static":!0,children:_},_))}),o.jsx("p",{className:"sc-lookpage-lede",children:j.description}),o.jsxs("div",{className:"sc-lookpage-acts",children:[ne.length>0?o.jsxs("span",{className:"sc-splitbtn",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-go",onClick:()=>void h(j.id),children:"Use in a shot"}),o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-more","aria-label":"Use it a way",children:o.jsx(Yi,{size:12,weight:"bold","aria-hidden":!0})})}),o.jsx(Cs,{children:ne.map(_=>o.jsx(tr,{onSelect:()=>void h(j.id,_.id),children:_.label},_.id))})]})]}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void h(j.id),children:"Use in a shot"}),E?o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:uv(u,E.id),children:"Edit scene"}):o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-pressed":G,onClick:()=>y(cm("scene",p,j.id)),children:[o.jsx(po,{size:13,weight:G?"fill":"regular"}),o.jsx("span",{children:G?"Remove from Keepers":"Add to Keepers"})]}),E&&o.jsx(lr,{label:"Edit name, filing and ways",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name, filing and ways","aria-haspopup":"dialog",onClick:()=>Z(!0),children:o.jsx(Ju,{size:17})})})]}),C&&o.jsx("p",{className:"sc-assetform-err",children:C}),E?o.jsx(Qre,{brandId:u.id,scene:E,onError:R},E.id):I.length>1?o.jsx(fw,{count:I.length,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:I.map(_=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${_.label}, open`,onClick:()=>k(_),children:o.jsx(zl,{src:sr(_.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:_.label})]},_.src))}):I.length===1?o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button","aria-label":`${I[0].label}, open`,onClick:()=>k(I[0]),children:o.jsx(zl,{src:sr(I[0].src,"tile")})})}):o.jsx(uw,{}),!E&&U&&o.jsx("p",{className:"sc-lookpage-note",children:U}),E&&o.jsxs("section",{className:"sc-scenepage-told",children:[o.jsxs("dl",{className:"sc-lookpage-told",children:[o.jsxs("div",{children:[o.jsx("dt",{children:Ne.lightLabel}),o.jsx("dd",{dir:"auto",children:E.lighting})]}),E.camera&&o.jsxs("div",{children:[o.jsx("dt",{children:Ne.cameraLabel}),o.jsx("dd",{dir:"auto",children:E.camera})]}),E.figure&&o.jsxs("div",{children:[o.jsx("dt",{children:Ne.figureLabel}),o.jsx("dd",{dir:"auto",children:E.figure})]})]}),o.jsx("p",{className:"sc-lookpage-note",children:"Every shot made here is told this. Anything you write in the shot wins."})]}),q.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"What it was read from"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:q.map((_,ue)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${ue+1}, open`,onClick:()=>k({src:_,label:`Source photo ${ue+1}`}),children:o.jsx(zl,{src:sr(_,"micro")})},_))})]}),E&&o.jsxs("div",{className:"sc-prec",children:[Q&&o.jsx("p",{className:"sc-prec-note",children:Q}),o.jsx(Wn,{label:"Delete scene",title:`Delete ${E.name}?`,body:"Shots already made here keep their images. Their recipe will say this scene is gone, and building from one again will miss it.",busy:T,onConfirm:()=>void z()})]}),P.length>0&&o.jsx(Lu,{label:`Shots made in ${j.name}`,children:P.map(_=>o.jsx(dw,{node:_,to:Wp(u,null,_.id)},_.id))}),$.length>0&&o.jsx(Lu,{label:"Other scenes, similar light",children:$.map(_=>o.jsx(I0,{scene:_,variant:"navigate",size:"slider",onOpen:S,href:_r(u,_.id)},_.id))}),O&&E&&o.jsx(qM,{name:E.name,categories:E.verticals,known:F,hint:"The verticals this place suits, so it surfaces where you work.",ways:ne,wayChoices:V6,wayMax:YM,busy:D,error:C,onSave:_=>void X(_),onDismiss:()=>Z(!1)}),x&&o.jsx(Uu,{src:x.src,kind:"scene",label:x.label,noun:j.name,onClose:()=>k(null)})]})})}function ese({draft:e,href:t,onDiscard:n,chosen:r,batching:a,onPick:i,batch:l}){return o.jsx(KM,{id:e.id,name:e.name.trim()||"Untitled presenter",hash:e.hash,drawing:!!e.drawing,state:tse(e),href:t,blank:o.jsx(nW,{size:44,weight:"thin"}),onDiscard:n,chosen:r,batching:a,onPick:i,batch:l})}function tse(e){return e.drawing?"Drawing":e.approved?e.approved===1?"Face ready":e.approved>=e.of?"Ready to save":`${e.approved} of ${e.of} views ready`:e.hash?"A face to decide":e.source==="photos"?"Photos added":"Not drawn yet"}function nse({suggested:e,busy:t,error:n,onConfirm:r,onDismiss:a}){const[i,l]=s.useState(e),u=s.useRef(null),f=s.useRef(!1),h=i.trim(),p=h.length>0;s.useEffect(()=>{f.current=!1},[e]),s.useEffect(()=>{t||(f.current=!1)},[t]);const g=()=>{!p||t||f.current||(f.current=!0,r(h))};return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:a,onOpenAutoFocus:v=>{v.preventDefault();const w=u.current;w&&(w.focus(),w.select())},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Duplicate presenter"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{ref:u,className:"sc-pdetails-field",value:i,dir:"auto",maxLength:60,onChange:v=>l(v.target.value),onKeyDown:v=>v.key==="Enter"&&g()})]}),n&&o.jsx("p",{className:"sc-assetform-err",children:n})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!p||t,"data-busy":t||void 0,onClick:g,children:t?"Duplicating":"Duplicate"})]})]})}const rse=60;function sse(e,t,n=rse){var l;const r=e.trim(),a=(((l=r.match(/^(.*?)(?: copy(?: \d+)?)?$/i))==null?void 0:l[1])??r).trim()||r,i=new Set(t.map(u=>u.trim().toLowerCase()).filter(Boolean));for(let u=1;u<1e4;u++){const f=u===1?" copy":` copy ${u}`,h=Math.max(1,n-f.length),p=`${a.slice(0,h).trimEnd()}${f}`;if(!i.has(p.toLowerCase()))return p}return`${a.slice(0,Math.max(1,n-5)).trimEnd()} copy`}const ase=8,l8="__bookmarked";function ose(){const{presenters:e,presenterCategories:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l}=Rn(),{brand:u}=on(),f=Dn(),h=Kv(),{push:p}=or(),{q:g,setQ:v,facets:w,setFacets:y,clearSearch:x,clear:k}=Pf(["category","bookmarked"]),S=w.category,E=w.bookmarked==="1",[j,N]=s.useState(()=>lm("presenter",u.id)),P=me=>N(cm("presenter",u.id,me)),$=ow(`${u.id}|${g}|${S??""}|${E?"1":""}`),M=ll(),C=s.useMemo(()=>Sf(u),[u]),[R,T]=fa(Dr.wallDensity,zu),H=jc(R),D=me=>T(me),K=fm(H),O=um(H),Z=me=>f(ha(u,me)),te=me=>f(Up(u,me)),B=s.useMemo(()=>S?e.filter(me=>me.suitableCategories.includes(S)):e,[e,S]),F=s.useMemo(()=>B.filter(me=>wo(Yh(me),g)),[B,g]),X=s.useRef(null),z=s.useRef(null),I=o.jsxs("button",{ref:z,type:"button",className:"sc-btn sc-btn-primary",onClick:()=>M("presenter"),children:[o.jsx(cr,{size:12})," Create presenter"]}),[U,G]=s.useState([]),ne=s.useRef(0),q=s.useCallback(()=>{const me=++ne.current;return Re.presenterDrafts(u.id).then(_e=>{me===ne.current&&G(_e.drafts.filter(W=>!W.presenterId))}).catch(()=>{}),()=>{me===ne.current&&ne.current++}},[u.id]),le=!!un({path:ct.presenterStudio}),{tasks:Se}=Za(),Q=Se.filter(me=>me.id.startsWith("presenter:")).map(me=>`${me.id}:${me.state}:${me.percent??""}`).join("|");s.useEffect(()=>{if(!le)return q()},[le,q,Q]);const xe=s.useCallback(me=>{const _e=Math.max(0,U.findIndex(W=>W.id===me));ee.current=_e,$.forget(me),G(W=>W.filter(pe=>pe.id!==me)),Re.deletePresenterDraft(u.id,me).finally(()=>q())},[u.id,U,q,$.forget]),ee=s.useRef(null);s.useEffect(()=>{var pe;const me=ee.current;if(me===null)return;ee.current=null;const _e=(pe=X.current)==null?void 0:pe.querySelectorAll("[data-build] .sc-cardpuck"),W=_e!=null&&_e.length?_e[Math.min(me,_e.length-1)]:z.current??document.querySelector(".sc-new-go");W==null||W.focus()},[U]);const[ae,re]=s.useState(null),[_,ue]=s.useState(!1),[We,Xe]=s.useState(!1),ze=s.useCallback(me=>{const _e=U.find(W=>W.id===me);_e!=null&&_e.drawn?re(_e):xe(me)},[U,xe]),[tt,ce]=s.useState(null),[ve,Pe]=s.useState(null),[de,je]=s.useState(null),[Ue,ye]=s.useState(!1),[Ee,be]=s.useState(null),[Le,Qe]=s.useState(null),Ke=s.useCallback(me=>{const _e=C.find(W=>W.id===me);_e&&(be(null),ce(_e))},[C]),nt=s.useCallback(me=>{const _e=C.find(W=>W.id===me);_e&&(be(null),Pe(_e))},[C]),gt=async me=>{if(!(!ve||Ue)){ye(!0),be(null);try{i((await Re.updatePresenter(u.id,ve.id,{name:me})).brand),Pe(null)}catch(_e){const W=nn(_e,"Could not rename this presenter");be([W.title,W.detail].filter(Boolean).join(" "))}finally{ye(!1)}}},Pt=s.useCallback(me=>{const _e=C.find(W=>W.id===me);_e&&je(_e)},[C]),Ut=s.useRef(null);s.useEffect(()=>{var pe;const me=Ut.current;if(me===null)return;Ut.current=null;const _e=(pe=X.current)==null?void 0:pe.querySelectorAll(".sc-lookcard:not([data-build]) .sc-lookcard-more"),W=_e!=null&&_e.length?_e[Math.min(me,_e.length-1)]:z.current??document.querySelector(".sc-new-go");W==null||W.focus()},[e,u]);const Nt=async me=>{if(!(!tt||Ue)){ye(!0),be(null);try{const _e=await Re.duplicatePresenter(u.id,tt.id,me);i(_e.brand),ce(null),Qe(_e.presenter.id)}catch(_e){const W=nn(_e,"Could not duplicate this presenter");be([W.title,W.detail].filter(Boolean).join(" "))}finally{ye(!1)}}},cn=async()=>{if(!(!de||Ue)){Ut.current=Math.max(0,Fe.findIndex(me=>me.id===de.id)),ye(!0);try{const me=await Re.deletePresenter(u.id,de.id);i(me.brand),$.forget(de.id),je(null)}catch(me){(me==null?void 0:me.status)===404?(await l(),$.forget(de.id),je(null)):p(nn(me,"Could not delete this presenter"))}finally{ye(!1)}}};s.useEffect(()=>{var _e,W;if(!Le)return;(W=(_e=X.current)==null?void 0:_e.querySelector(".sc-lookcard[data-just-added]"))==null||W.scrollIntoView({block:"nearest"});const me=window.setTimeout(()=>Qe(null),1800);return()=>window.clearTimeout(me)},[Le]);const Fe=s.useMemo(()=>C.filter(me=>S?!me.suitableCategories.length||me.suitableCategories.includes(S):!0).filter(me=>wo(Yh(me),g)).filter(me=>E?j.includes(me.id):!0),[C,S,g,E,j]),it=!(C.length>0||U.length>0),St=[...C,...e].reduce((me,_e)=>me+(j.includes(_e.id)?1:0),0),xt=E&&St===0,At=xt&&it,Kt=xt&&!it,et=!E||At,mt=Fe.filter(me=>!E||At||j.includes(me.id)),ot=et&&U.length>0||mt.length>0,kn=s.useMemo(()=>!E||At?F:F.filter(me=>j.includes(me.id)),[F,E,At,j]),{visible:ut,remaining:Gt,showMore:Ft}=lw(kn,`${S??""}|${E?"keepers":""}|${At?"browse":""}|${g}`),en=e.length+C.length>0?"tabs":"none",Jt=s.useCallback(async me=>{const{failed:_e,error:W}=await tp(me,pe=>Re.deletePresenterDraft(u.id,pe));G(pe=>pe.filter(Ie=>_e.includes(Ie.id)||!me.includes(Ie.id))),$.retain(_e),q(),W&&p(nn(W,"Could not discard these drafts"))},[u.id,q,$.retain,p]),se=()=>{const me=U.filter(_e=>$.ids.has(_e.id));me.some(_e=>_e.drawn)?me.length===1?re(me[0]):ue(!0):Jt(me.map(_e=>_e.id))},oe=()=>{const me=[...$.ids];me.length===1?Pt(me[0]):Xe(!0)},we=[...$.ids],ge=$.kind==="presenter"&&we.length>0&&we.every(me=>j.includes(me)),J=()=>N(Gv("presenter",u.id,we,!ge)),Oe=pm($.ids.size,ge,"presenters"),Be=async()=>{if(Ue)return;const me=[...$.ids];ye(!0);try{const{failed:_e,error:W}=await tp(me,pe=>Re.deletePresenter(u.id,pe));await l(),$.retain(_e),Xe(!1),W&&p(nn(W,"Could not delete these presenters"))}finally{ye(!1)}},Ve={key:"category",label:"Category",everyLabel:"All presenters",everyCount:e.length+C.length,selected:E?l8:S,onSelect:me=>y(me===l8?{bookmarked:"1",category:null}:{bookmarked:null,category:me}),options:[{value:l8,label:"Keepers",count:St},...t.map(me=>({value:me,label:me,count:[...C,...e].filter(_e=>!_e.suitableCategories.length||_e.suitableCategories.includes(me)).length}))]},Ge=o.jsx(gm,{title:"Presenters",filters:o.jsx(vm,{mode:en,group:Ve}),density:o.jsx(dm,{value:H,onChange:D}),search:e.length>=ase&&o.jsx(id,{value:g,onChange:v,noun:"presenters",total:e.length})});return o.jsxs(Nf.Provider,{value:O,children:[o.jsx(is,{children:o.jsxs("main",{className:"sc-looks sc-presenters",id:"main","data-hero":it||void 0,onClick:$.onBlank,children:[!it&&Ge,ot&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your presenters"})}),o.jsxs("div",{ref:X,className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:[et&&U.map(me=>o.jsx(ese,{draft:me,href:zi(u,me.id),onDiscard:ze,chosen:$.ids.has(me.id),batching:$.batching==="draft",onPick:$.picking("draft")?_e=>$.toggle("draft",_e):void 0,batch:$.kind==="draft"&&$.ids.has(me.id)?{count:$.ids.size,onAct:se}:null},me.id)),ae&&o.jsx(Wn,{label:"Discard",title:`Discard ${ae.name.trim()||"this unfinished presenter"}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:me=>{me||re(null)},onConfirm:()=>{xe(ae.id),re(null)}}),mt.map(me=>o.jsx(Z6,{presenter:me,variant:"use",size:"grid",onOpen:Z,href:ha(u,me.id),onUse:h,onDuplicate:Ke,onEdit:te,onDelete:Pt,onRename:nt,bookmarked:j.includes(me.id),onBookmark:P,fresh:me.id===Le,chosen:$.ids.has(me.id),batching:$.batching==="presenter",onPick:$.picking("presenter")?_e=>$.toggle("presenter",_e):void 0,batch:$.kind==="presenter"&&$.ids.has(me.id)?{count:$.ids.size,onAct:oe,onKeep:J,allKept:ge}:null},me.id)),ve&&o.jsx(sw,{title:"Rename presenter",name:ve.name,maxLength:60,busy:Ue,error:Ee,onConfirm:me=>void gt(me),onDismiss:()=>{Ue||Pe(null)}}),tt&&o.jsx(nse,{suggested:sse(tt.name,C.map(me=>me.name)),busy:Ue,error:Ee,onConfirm:me=>void Nt(me),onDismiss:()=>{Ue||ce(null)}}),de&&o.jsx(Wn,{label:"Delete presenter",title:`Delete ${de.name}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",open:!0,busy:Ue,onOpenChange:me=>{!me&&!Ue&&je(null)},onConfirm:()=>void cn()}),We&&o.jsx(Wn,{label:qr("presenter",$.ids.size).menu,title:`${qr("presenter",$.ids.size).menu}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",open:!0,busy:Ue,onOpenChange:me=>{!me&&!Ue&&Xe(!1)},onConfirm:()=>void Be()}),_&&o.jsx(Wn,{label:qr("draft",$.ids.size).menu,title:`${qr("draft",$.ids.size).menu}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:me=>{me||ue(!1)},onConfirm:()=>{const me=[...$.ids];ue(!1),Jt(me)}})]})]}),it&&n&&!r&&e.length>0&&o.jsx(oo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Cast your own ",o.jsx("em",{children:"presenter"})]}),body:"Describe someone new, or add photos of a real person. They stay the same person in every image you make.",action:I}),ot&&n&&!r&&ut.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri presenters"})}),!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":O,style:K,"aria-hidden":!0,children:o.jsx(BM,{size:"grid",count:8})}),n&&r&&o.jsx(oo,{shape:"error",title:"Couldn't load the presenter library",body:"Something went wrong reaching the catalog.",onRetry:()=>a()}),it&&n&&!r&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{label:"Or cast someone from ours"}),Ge]}),n&&!r&&ut.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:ut.map(me=>o.jsx(Z6,{presenter:me,variant:"use",size:"grid",onOpen:Z,href:ha(u,me.id),onUse:h,bookmarked:j.includes(me.id),onBookmark:P},me.id))}),n&&!r&&Kt&&o.jsx(oo,{shape:"zero",body:"Nothing in Keepers yet. Add a presenter to Keepers from its card and it stays here.",action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>y({bookmarked:null}),children:"Browse every presenter"})}),n&&!r&&!Kt&&!kn.length&&e.length>0&&o.jsx(wm,{noun:"presenters",q:g,facet:E?"Keepers":S,onClearSearch:x,onClearAll:k}),n&&!r&&!e.length&&o.jsx(oo,{shape:"zero",body:"The presenter library is still being cast. Check back soon."}),Gt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Ft,children:["Show ",Math.min(Gt,60)," more"]})})]})}),$.ids.size>0&&($.kind==="draft"||$.kind==="presenter")&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(aw,{count:$.ids.size,loaded:$.kind==="draft"?U.length:mt.length,tool:qr($.kind,$.ids.size).tool,icon:qr($.kind,$.ids.size).icon,danger:qr($.kind,$.ids.size).danger,onAct:$.kind==="draft"?se:oe,keep:$.kind==="presenter"?{label:Oe.tool,filled:ge,onAct:J}:null,onClear:$.clear,onSelectAll:()=>$.selectAll($.kind==="draft"?"draft":"presenter",($.kind==="draft"?U:mt).map(me=>me.id))})}),o.jsx(uc,{})]})}const ise={portrait:"Face",identity:"Face",front:"Full body","three-quarter":"Three-quarter",back:"Back",left:"Left",right:"Right","left-profile":"Left","right-profile":"Right"},lse=["Front","Left","Right","Back"];function cse(){var ne;const{presenterId:e=""}=Bs(),{presenters:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l,presenterCategories:u}=Rn(),{brand:f}=on(),h=Dn(),p=ym(),g=s.useRef(!1),v=Kv(),[w,y]=s.useState([]),[x,k]=s.useState(null),[S,E]=s.useState(null),j=TG(f,e),N=j??t.find(q=>q.id===e);Sc(N==null?void 0:N.name);const P=!!j;s.useEffect(()=>{let q=!0;if(y([]),!P)return Re.presenterFrames(e).then(le=>{q&&y(le.frames)}).catch(()=>{q&&y([])}),()=>{q=!1}},[e,P]);const $=!!un({path:ct.presenterEdit});s.useEffect(()=>{let q=!0;if(E(null),!(!P||$))return Re.presenterDrafts(f.id).then(le=>{if(!q)return;const Se=le.drafts.find(Q=>Q.presenterId===e);E((Se==null?void 0:Se.id)??null)}).catch(()=>{}),()=>{q=!1}},[f.id,e,P,$]);const M=((ne=f.json)==null?void 0:ne.characters)??[],C=M.find(q=>q.presenterId===e),R=M.find(q=>q.id===e),T=cw(f.id,[e??"",(C==null?void 0:C.id)??""]),[H,D]=s.useState(null),[K,O]=s.useState(!1),[Z,te]=s.useState(!1),B=async q=>{if(j){O(!0),D(null);try{const le=await Re.updatePresenter(f.id,j.id,q);i(le.brand),te(!1)}catch(le){D(String(le.message??le))}finally{O(!1)}}},F=async()=>{if(!j||g.current)return;g.current=!0;const q=p(),le=qi(f);O(!0);try{const Se=await Re.deletePresenter(f.id,j.id);i(Se.brand)}catch(Se){if((Se==null?void 0:Se.status)!==404){g.current=!1,q()&&(D(String(Se.message??Se)),O(!1));return}await l()}q()&&h(le,{replace:!0})},X=Sv(f,e);if(X!==e)return o.jsx(uo,{to:ha(f,X),replace:!0});if(!n&&!j)return o.jsx(is,{children:o.jsx("main",{className:"sc-lookpage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!j)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this presenter"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!N)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This presenter isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"They may have been removed from the catalog, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(_n,{className:"sc-btn sc-btn-primary",to:qi(f),children:"Browse presenters"})})]})});const z=j?(Array.isArray(R==null?void 0:R.shots)?R.shots:[]).map((q,le)=>({src:Fr(q==null?void 0:q.file),label:ise[(q==null?void 0:q.angle)??""]??`Reference ${le+1}`,angle:typeof(q==null?void 0:q.angle)=="string"?q.angle:void 0})).filter(q=>!!q.src):w.length?w.map((q,le)=>({src:q,label:lse[le]??`Reference ${le+1}`})):N.previewUrl?[{src:N.previewUrl,label:"Preview"}]:[],I=Up(f,e),U=ti(j??N),G=[...new Set([...u,...Sf(f).flatMap(q=>q.suitableCategories??[])])].sort((q,le)=>q.localeCompare(le));return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-presenterpage",id:"main",children:[U.src&&o.jsx("div",{className:"sc-presenterpage-avatar",children:o.jsx(c8,{src:sr(U.src,"small"),crop:U.crop})}),o.jsx("h1",{children:N.name}),N.suitableCategories.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:N.suitableCategories.map(q=>o.jsx("li",{className:"sc-chip","data-static":!0,children:q},q))}),N.descriptor&&o.jsx("p",{className:"sc-lookpage-lede",children:N.descriptor}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v(e),children:"Use in a shot"}),j&&o.jsx(_n,{className:"sc-btn sc-btn-ghost",to:I,children:S?"Continue editing":"Edit presenter"}),j&&o.jsx(lr,{label:"Edit name and details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name and details","aria-haspopup":"dialog",onClick:()=>te(!0),children:o.jsx(Ju,{size:17})})})]}),H&&o.jsx("p",{className:"sc-assetform-err",children:H}),z.length>0?o.jsx(fw,{count:z.length,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:z.map(q=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","data-role":q.angle,"aria-label":`${q.label}, open`,onClick:()=>k(q),children:o.jsx(c8,{src:sr(q.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:q.label})]},q.label))}):o.jsx(uw,{}),j&&j.sourceRefs.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"From your photos"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:j.sourceRefs.map((q,le)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${le+1}, open`,onClick:()=>k({src:q,label:`Source photo ${le+1}`}),children:o.jsx(c8,{src:sr(q,"micro")})},q))})]}),j&&o.jsxs("div",{className:"sc-prec",children:[o.jsxs("p",{className:"sc-prec-note",children:[N.ageRange?`${N.ageRange} · `:"",j.source==="synthetic"?"Created in Scenri. Not a real person.":j.source==="photos"?"Built from your photographs.":"Saved in Scenri.",j.likeness?` Likeness confirmed ${new Date(j.likeness.attestedAt).toLocaleDateString()}.`:""]}),o.jsx(Wn,{label:"Delete presenter",title:`Delete ${j.name}?`,body:"Shots already made with them keep their images and their recipe. Only future shots lose them.",busy:K,onConfirm:()=>void F()})]}),T.length>0&&o.jsx(Lu,{label:`Shots featuring ${N.name}`,children:T.map(q=>o.jsx(dw,{node:q,to:Wp(f,null,q.id)},q.id))}),Z&&j&&o.jsx(qM,{name:j.name,categories:N.suitableCategories,known:G,hint:"The verticals they suit, so they surface where you work.",busy:K,error:H,onSave:q=>void B({name:q.name,suitableCategories:q.categories}),onDismiss:()=>te(!1)}),x&&o.jsx(Uu,{src:x.src,kind:"presenter",label:x.label,noun:N.name,onClose:()=>k(null)})]})})}function c8({src:e,crop:t}){const[n,r]=s.useState(!1);return n?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Ws,{size:20})}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",...t?{"data-crop":t}:{},onError:()=>r(!0)})}function use({placeholder:e,label:t,action:n="Send",scope:r,hint:a,value:i,onValue:l,allowEmpty:u,disabled:f,why:h,quiet:p,working:g,error:v,focusKey:w,onStop:y,stopping:x,onAttach:k,onAttachFiles:S,attachLabel:E,colour:j,refs:N,onSend:P}){const $=s.useRef(null),M=s.useRef(null),[C,R]=s.useState(void 0);s.useLayoutEffect(()=>{const I=$.current;if(!I)return;I.style.height="auto";const U=Number.parseFloat(getComputedStyle(I).maxHeight)||Number.POSITIVE_INFINITY;I.style.height=`${Math.min(I.scrollHeight,U)}px`,I.style.overflowY=I.scrollHeight>U?"auto":"hidden"},[i]);const[T,H]=s.useState(!1),D=wr(Ks);s.useEffect(()=>{if(!w||w===C||f||(R(w),D))return;const I=$.current;if(I==null||I.focus({preventScroll:!0}),I!=null&&I.value){I.select(),H(!0);const U=setTimeout(()=>H(!1),700);return()=>clearTimeout(U)}},[w,C,f,D]);const K=f||g,O=!!(j!=null&&j.hex)||!!(N!=null&&N.some(I=>!I.busy)),Z=!i.trim()&&!u&&!O,te=()=>{K||Z||P(i)},B=v?{text:v,tone:"alert"}:{text:(r==null?void 0:r.hint)??a??"",tone:r==null?void 0:r.tone},F=!!y&&(g||!i.trim()&&!O),X=g||F?null:f&&h?h:Z&&!f?"Nothing typed yet.":null,z=o.jsxs("button",{type:"button",className:"sc-convo-send","aria-disabled":(F?!!x:g||K||Z)||void 0,"aria-busy":g||F||void 0,"data-stop":F||void 0,onClick:F?x?void 0:y:g?void 0:te,children:[o.jsx("span",{className:"sc-convo-send-ico",children:g||F?o.jsx("span",{className:"sc-convo-spin","aria-hidden":"true"}):o.jsx(lC,{size:17,weight:"bold"})}),F?x?"Stopping":"Stop":g?"Working":n]});return o.jsxs("div",{className:"sc-convo-composer",children:[o.jsxs("div",{className:"sc-convo-card","data-quiet":p||void 0,"data-flash":T||void 0,children:[(r==null?void 0:r.chip)&&o.jsx("div",{className:"sc-convo-scope-row",children:o.jsxs("span",{className:"sc-convo-scope",children:[r.chip.thumb?o.jsx("img",{src:r.chip.thumb,alt:""}):null,r.chip.label]})}),o.jsxs("div",{className:"sc-convo-field",children:[N==null?void 0:N.map(I=>o.jsxs("span",{className:"sc-token","data-kind":"image","data-busy":I.busy||void 0,dir:"ltr",children:[o.jsx("img",{src:I.src,alt:""}),o.jsx("span",{className:"sc-token-label",children:I.label}),o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":`Remove ${I.label}`,onClick:I.onRemove,children:o.jsx(jn,{size:11,weight:"bold"})})]},I.key)),j&&o.jsxs("span",{className:"sc-token","data-kind":"color","data-empty":j.hex?void 0:"",dir:"ltr",children:[o.jsxs(Zu,{className:"sc-convo-chip",triggerStyle:{background:"none"},value:j.hex??j.seed??"#808080",commitMode:"live",align:"start",label:j.hex?`${j.label}. Change the colour.`:"Pick a colour",onChange:j.onPick,children:[o.jsx("span",{className:"sc-token-swatch",style:j.hex?{background:j.hex}:void 0}),o.jsx("span",{className:"sc-token-label",children:j.label})]}),j.hex&&o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":"Remove colour",onClick:j.onClear,children:o.jsx(jn,{size:11,weight:"bold"})})]}),o.jsx("textarea",{ref:$,className:"sc-in",rows:1,maxLength:400,"aria-label":t,placeholder:j!=null&&j.hex&&!i?"":f&&h?h:e,value:i,disabled:f,onChange:I=>l(I.target.value),onKeyDown:I=>{I.key!=="Enter"||I.shiftKey||(I.preventDefault(),te())}})]}),o.jsxs("div",{className:"sc-convo-row",children:[(k||S)&&o.jsxs(o.Fragment,{children:[o.jsx(lr,{label:K&&h?h:E??"Add photos",children:o.jsx("button",{type:"button",className:"sc-convo-attach","aria-label":E??"Add photos","aria-disabled":K||void 0,onClick:K?void 0:S?()=>{var I;return(I=M.current)==null?void 0:I.click()}:k,children:o.jsx(cr,{size:16,weight:"bold"})})}),S&&o.jsx("input",{ref:M,type:"file",accept:"image/*",hidden:!0,"aria-label":E??"Add a picture",onChange:I=>{const U=Array.from(I.target.files??[]).filter(G=>G.type.startsWith("image/"));I.target.value="",U.length&&S(U)}})]}),X?o.jsx(lr,{label:X,children:z}):z]})]}),B.text?o.jsx("small",{className:"sc-convo-line",role:B.tone==="alert"?"alert":void 0,"data-tone":B.tone,children:B.text}):null]})}function JM({glyph:e,lead:t,hint:n}){return o.jsxs("div",{className:"sc-pstudio-empty",children:[o.jsxs("span",{className:"sc-pstudio-empty-mark","aria-hidden":!0,children:[o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"far"}),o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"near"}),e]}),t&&o.jsxs("span",{className:"sc-pstudio-empty-say",children:[o.jsx("span",{children:t}),n&&o.jsx("span",{children:n})]})]})}const f5=500,eR=400,tR=760,nu=e=>Math.min(tR,Math.max(eR,Math.round(e)));function dse({title:e,headAction:t,stage:n,body:r,bodyProps:a,foot:i,overlay:l,kind:u,resizeLabel:f,onPaste:h,onDropFiles:p,onClose:g}){const v=s.useRef(null),[w,y]=s.useState(null);nw(w,"--sc-pstudio-dock-h"),s.useEffect(()=>{const j=N=>{N.key!=="Escape"||N.defaultPrevented||(N.preventDefault(),g())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[g]);const[x,k]=fa(Dr.pstudioRailW,f5),S=s.useRef(0),E=s.useRef(0);return Rr.createPortal(o.jsx(Gu,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:j=>{var N;j.preventDefault(),(N=v.current)==null||N.focus({preventScroll:!0})},children:o.jsxs("div",{ref:v,tabIndex:-1,className:"sc-pstudio","data-kind":u,style:{"--sc-pstudio-rail-set":`${nu(x)}px`},role:"dialog","aria-modal":"true","aria-labelledby":"sc-pstudio-title",onDragOver:j=>{p&&Array.from(j.dataTransfer.types).includes("Files")&&j.preventDefault()},onDrop:j=>{var P;if(!p||j.defaultPrevented)return;const N=Array.from(((P=j.dataTransfer)==null?void 0:P.files)??[]);N.length&&(j.preventDefault(),p(N))},onPaste:j=>{var P;if(!h)return;const N=Array.from(((P=j.clipboardData)==null?void 0:P.files)??[]).filter($=>$.type.startsWith("image/"));N.length&&(j.preventDefault(),h(N))},children:[o.jsxs("div",{className:"sc-pstudio-grid",children:[o.jsx("div",{className:"sc-pstudio-resize",role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuemin":eR,"aria-valuemax":tR,"aria-valuenow":nu(x),tabIndex:0,onPointerDown:j=>{j.button===0&&(j.preventDefault(),j.stopPropagation(),j.currentTarget.setPointerCapture(j.pointerId))},onPointerMove:j=>{if(!j.currentTarget.hasPointerCapture(j.pointerId))return;const N=j.currentTarget.closest(".sc-pstudio");S.current=j.clientX,!E.current&&(E.current=requestAnimationFrame(()=>{E.current=0,N==null||N.style.setProperty("--sc-pstudio-rail-set",`${nu(window.innerWidth-S.current)}px`)}))},onPointerUp:j=>{j.currentTarget.releasePointerCapture(j.pointerId),E.current&&(cancelAnimationFrame(E.current),E.current=0),k(nu(window.innerWidth-j.clientX))},onDoubleClick:()=>k(f5),onKeyDown:j=>{if(j.key==="ArrowLeft")k(N=>nu(N+16));else if(j.key==="ArrowRight")k(N=>nu(N-16));else return;j.preventDefault()}}),o.jsx(lr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-pstudio-close",onClick:g,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),o.jsxs("div",{className:"sc-pstudio-head sc-newdlg-head",children:[o.jsx("h2",{id:"sc-pstudio-title",className:"sc-newdlg-title",children:e}),t,o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close",onClick:g,"aria-label":"Close",children:o.jsx(jn,{size:16})})]}),o.jsxs("div",{className:"sc-pstudio-scroll",children:[n,o.jsx("div",{className:"sc-pstudio-body",...a,children:r})]}),o.jsx("div",{className:"sc-pstudio-foot sc-dock",ref:y,children:i})]}),l]})}),document.body)}function fse({hash:e,alt:t,drawing:n,since:r,items:a,onPick:i,compare:l,doing:u,takes:f,onTake:h,empty:p,glyph:g}){const v=hse(n),[w,y]=s.useState(null),x=f??[],k=Math.max(0,x.findIndex(R=>w?R.hash===w:R.current)),S=x[k];s.useEffect(()=>y(null),[e]);const E=pse(w&&x.some(R=>R.hash===w)?w:e),[j,N]=s.useState(void 0);s.useEffect(()=>N(void 0),[e]);const P=R=>{const T=x[k+R];T&&y(T.hash)},$=s.useRef(null),[M,C]=s.useState(!1);return s.useLayoutEffect(()=>{const R=$.current;C(!(R!=null&&R.complete&&R.naturalWidth))},[E]),o.jsxs("div",{className:"sc-pstudio-stage",children:[o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsxs("div",{className:"sc-pstudio-well","data-drawing":n||void 0,"data-empty":!e||void 0,style:j?{"--sc-well-ar":j}:void 0,children:[e&&E?o.jsx("img",{ref:$,src:Mr(E),srcSet:`${dn(E,"tile")} 640w, ${Mr(E)} 1024w`,sizes:"(max-width: 767px) 92vw, 44vw",alt:t,decoding:"async","data-waiting":M||void 0,onLoad:R=>{const T=R.currentTarget;C(!1),T.naturalWidth&&T.naturalHeight&&N(T.naturalWidth/T.naturalHeight)}}):o.jsx("span",{className:"sc-pstudio-well-blank",children:!n&&o.jsx(JM,{glyph:g,lead:p==null?void 0:p.lead,hint:p==null?void 0:p.hint})}),n&&!e&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),n&&e&&o.jsx("span",{className:"sc-pstudio-veil","aria-hidden":!0}),n&&o.jsxs("span",{className:"sc-pstudio-doing",role:"status",children:[o.jsx("span",{className:"sc-pstudio-ring","aria-hidden":!0}),o.jsx("span",{children:u??"Drawing"}),r&&o.jsx("time",{children:rc(r,v)})]}),x.length>1&&!n&&!(l!=null&&l.on)&&o.jsxs("div",{className:"sc-pstudio-vers",children:[o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version before","aria-disabled":k===0||void 0,onClick:()=>k>0&&P(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsxs("span",{className:"sc-pstudio-vers-n","aria-live":"polite",children:["Version ",(S==null?void 0:S.n)??1," of ",x.length]}),o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version after","aria-disabled":k===x.length-1||void 0,onClick:()=>k<x.length-1&&P(1),children:o.jsx(ol,{size:13,weight:"bold"})}),S&&!S.current&&h&&o.jsx("button",{type:"button",className:"sc-pstudio-vers-put",onClick:()=>h(S.hash),children:"Put back"}),(S==null?void 0:S.current)&&o.jsx("span",{className:"sc-pstudio-vers-on",children:"Active"})]}),l&&!n&&o.jsx("button",{type:"button",className:"sc-pstudio-compare","aria-pressed":l.on,onClick:l.toggle,children:l.on?"Showing current":"Compare"})]})}),a.length>0&&o.jsx("ol",{className:"sc-pstudio-strip","aria-label":"Views",children:a.map(R=>{const T=R.label+(R.approved?", used":R.state==="stale"?", to be drawn again":"")+(R.photo?", your photo":"")+(R.drawing?", drawing":"")+(R.error?", failed":"");return o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-pstudio-slot","data-state":R.state,"data-view":R.view,"aria-current":R.state==="current"?"step":void 0,"aria-label":T,disabled:!i,onClick:()=>i==null?void 0:i(R.view),children:o.jsxs("span",{className:"sc-pstudio-slot-inner",children:[R.hash?o.jsx("img",{src:dn(R.hash,"micro"),alt:""}):null,R.drawing&&!R.hash?o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}):null,R.drawing&&R.hash?o.jsx("span",{className:"sc-pstudio-slot-work sc-pstudio-ring","aria-hidden":!0}):null,R.approved&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","aria-hidden":!0,children:o.jsx(Kn,{size:11,weight:"bold"})}):null,R.error&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","data-tone":"alert","aria-hidden":!0,children:o.jsx(zp,{size:11,weight:"bold"})}):null]})}),o.jsx("span",{className:"sc-pstudio-slot-lb","data-on":R.state==="current"||void 0,"aria-hidden":!0,children:R.label})]},R.view)})})]})}function hse(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}function pse(e){const[t,n]=s.useState(e);return s.useEffect(()=>{if(!e||e===t){e||n(void 0);return}let r=!0;const a=()=>{r&&n(e)},i=new Image;i.srcset=`${dn(e,"tile")} 640w, ${Mr(e)} 1024w`,i.sizes="(max-width: 767px) 92vw, 44vw",i.src=Mr(e),i.decode?i.decode().then(a,a):(i.onload=a,i.onerror=a);const l=window.setTimeout(a,3e3);return()=>{r=!1,window.clearTimeout(l)}},[e,t]),t}function hw({surface:e,onClose:t}){var p,g,v;const n=wr(Ks),r=e,a=(p=r.stage)==null?void 0:p.onPick,i=a?w=>a(w):void 0,l=r.turns[r.turns.length-1],u=(l==null?void 0:l.kind)==="question"&&l.question.kind==="confirm"&&!l.question.quiet?l.question:null;s.useEffect(()=>{if(!u||r.busy)return;let w=!1;const y=x=>{if(x.key!=="Enter"||x.shiftKey||x.defaultPrevented||w)return;const k=x.target;k&&(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.tagName==="BUTTON"||k.isContentEditable)||(x.preventDefault(),w=!0,r.onAnswer(u.id,{kind:"confirm",id:u.options[0].id}))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[u,r.busy,r.onAnswer]);const f=r.glyph??o.jsx(rW,{size:32}),h=n?null:r.stage?o.jsx(fse,{hash:r.stage.hash,alt:r.stage.alt,drawing:r.stage.drawing,since:r.stage.since,doing:r.stage.doing,takes:r.stage.takes,onTake:r.stage.onTake,items:r.stage.items,onPick:r.stage.onPick,compare:r.stage.compare,empty:r.stageEmpty,glyph:f}):o.jsx("div",{className:"sc-pstudio-stage","data-reserve":!0,children:o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsx("div",{className:"sc-pstudio-well","data-empty":!0,children:o.jsx("span",{className:"sc-pstudio-well-blank",children:o.jsx(JM,{glyph:f,lead:(g=r.stageEmpty)==null?void 0:g.lead,hint:(v=r.stageEmpty)==null?void 0:v.hint})})})})});return o.jsx(dse,{kind:r.kind??"presenter",title:r.title,headAction:r.headAction,resizeLabel:"Resize the conversation",onPaste:r.onPaste,onClose:t,overlay:r.overlay,stage:h,bodyProps:{"data-convo":!0},body:o.jsx(CJ,{turns:r.turns,busy:r.busy,working:r.working,memoryKey:r.memoryKey,resumed:r.resumed,onAnswer:r.onAnswer,onEdit:r.onEdit,onSaveEdit:r.onSaveEdit,onCancelEdit:r.onCancelEdit,onRestore:r.onRestore,onRetry:r.onRetry,onShow:i,onStarter:w=>(r.onStarter??r.onText)(w),onDescribe:r.onDescribe,onAttachFiles:r.onAttachRef}),foot:o.jsxs(o.Fragment,{children:[r.dock,r.composer&&o.jsx(use,{quiet:!!r.composer.disabled&&!r.composer.working,placeholder:r.composer.placeholder,label:r.composer.label,action:r.composer.action,scope:r.composer.scope,hint:r.composer.hint,value:r.text,onValue:r.onText,allowEmpty:r.composer.allowEmpty,disabled:r.composer.disabled,why:r.composer.why,working:r.composer.working,error:r.composer.error,focusKey:r.composer.focusKey,onAttach:r.composer.onAttach,onAttachFiles:r.composer.onAttachFiles,attachLabel:r.composer.attachLabel,colour:r.composer.colour,refs:r.composer.refs,onStop:r.composer.onStop,stopping:r.composer.stopping,onSend:r.onSend})]})})}const ld=[{id:"glasses",label:"Glasses",ask:"What glasses do they wear?",options:[{id:"thin black rectangular metal frames",label:"Thin black",card:"glasses-1"},{id:"round thin gold metal frames",label:"Round metal",card:"glasses-2"},{id:"clear transparent acetate frames",label:"Clear acetate",card:"glasses-3"},{id:"bold thick black rectangular acetate frames",label:"Bold rectangular",card:"glasses-4"},{id:"tortoiseshell acetate frames",label:"Tortoiseshell",card:"glasses-5"},{id:"rimless frames with thin temples",label:"Rimless",card:"glasses-6"}],saying:"Describe the glasses",refHint:"A clear front or three-quarter view of the frames."},{id:"freckles",label:"Freckles or marks",ask:"What marks their skin?",options:[{id:"light freckles across the nose and cheeks",label:"Light freckles",card:"freckles-1"},{id:"dense freckles across the whole face",label:"Dense freckles",card:"freckles-2"},{id:"freckles across the face and shoulders",label:"Face and shoulders",card:"freckles-3"},{id:"a small birthmark on one cheek",label:"Birthmark",card:"freckles-4"},{id:"a beauty mark above the lip",label:"Beauty mark",card:"freckles-5"}],saying:"Describe it",refHint:"A clear, close photograph of it."},{id:"makeup",label:"Makeup",ask:"What makeup do they wear?",options:[{id:"natural, barely-there makeup",label:"Natural",card:"makeup-1"},{id:"black winged eyeliner",label:"Winged liner",card:"makeup-2"},{id:"a soft smoky eye",label:"Smoky eye",card:"makeup-3"},{id:"a bold red lip",label:"Bold red lip",card:"makeup-4"},{id:"soft glamorous makeup with a warm shimmer",label:"Soft glam",card:"makeup-5"},{id:"strong defined brows and a nude lip",label:"Strong brows",card:"makeup-6"}],saying:"Describe the makeup",refHint:"A clear face photograph showing the look."},{id:"scar",label:"Scar",ask:"What scar do they have?",options:[{id:"a thin pale scar through one eyebrow",label:"Through an eyebrow",card:"scar-1"},{id:"a small pale scar on one cheek",label:"On a cheek",card:"scar-2"},{id:"a small scar on the chin",label:"On the chin",card:"scar-3"},{id:"a fine scar along the jaw",label:"Along the jaw",card:"scar-4"},{id:"a small scar beside one eye",label:"Beside an eye",card:"scar-5"},{id:"a faded scar across the bridge of the nose",label:"Across the nose",card:"scar-6"}],saying:"Describe the scar",refHint:"A clear, close photograph of it."},{id:"piercing",label:"Piercing",ask:"What piercing do they wear?",options:[{id:"a small silver nose stud",label:"Nose stud",card:"piercing-1"},{id:"a silver septum ring",label:"Septum ring",card:"piercing-2"},{id:"a small silver hoop through one eyebrow",label:"Eyebrow hoop",card:"piercing-3"},{id:"several small silver hoops in one ear",label:"Ear hoops",card:"piercing-4"},{id:"a small silver lip ring",label:"Lip ring",card:"piercing-5"},{id:"a row of small silver studs up one ear",label:"Ear studs",card:"piercing-6"}],saying:"Describe the piercing",refHint:"A clear photograph of the jewellery."},{id:"tattoo",label:"Tattoo",ask:"What is their tattoo?",options:[{id:"a fine-line botanical tattoo",label:"Fine line",card:"tattoo-1"},{id:"a small geometric line tattoo",label:"Geometric",card:"tattoo-2"},{id:"a floral tattoo in soft grey shading",label:"Floral",card:"tattoo-3"},{id:"a bold traditional red rose tattoo with heavy black linework",label:"Traditional",card:"tattoo-4"},{id:"a solid blackwork snake tattoo in heavy black ink",label:"Blackwork",card:"tattoo-5"},{id:"a small script tattoo in thin lettering",label:"Script",card:"tattoo-6"}],saying:"Describe the tattoo",refHint:"A clear photograph of the design itself.",where:{ask:"And where is it?",options:[{id:"on their right forearm",label:"Right forearm"},{id:"on their left forearm",label:"Left forearm"},{id:"on their right upper arm",label:"Right upper arm"},{id:"on their left upper arm",label:"Left upper arm"},{id:"on one shoulder",label:"Shoulder"},{id:"on the side of their neck",label:"Neck"},{id:"on their hand",label:"Hand"},{id:"on their back",label:"Back"}]}},{id:"prosthetic",label:"Prosthetic limb",ask:"What does their limb look like?",options:[{id:"a matte black mechanical prosthetic limb with dark articulated joints",label:"Matte black",card:"prosthetic-1"},{id:"a brushed steel mechanical prosthetic limb with dark articulated joints",label:"Brushed steel",card:"prosthetic-2"},{id:"a woven carbon fibre mechanical prosthetic limb with dark articulated joints",label:"Carbon fibre",card:"prosthetic-3"},{id:"a skin-tone mechanical prosthetic limb with dark articulated joints",label:"Skin tone",card:"prosthetic-4"},{id:"a glossy bright red mechanical prosthetic limb with dark articulated joints",label:"Red",card:"prosthetic-5"},{id:"a matte white mechanical prosthetic limb with dark articulated joints",label:"Matte white",card:"prosthetic-6"}],saying:"Describe it",refHint:"A clear photograph showing its shape and finish.",where:{ask:"And which limb?",options:[{id:"in place of their left arm",label:"Left arm"},{id:"in place of their right arm",label:"Right arm"},{id:"in place of their left leg",label:"Left leg"},{id:"in place of their right leg",label:"Right leg"},{id:"in place of their left hand",label:"Left hand"},{id:"in place of their right hand",label:"Right hand"}]}}],va=e=>ld.find(t=>t.id===e),mse=/\b(forearm|upper arm|arm|shoulder|neck|throat|hand|wrist|back|chest|ribs|thigh|leg|calf|ankle|foot|cheek|eyebrow|brow|chin|lip|nose|ear|temple|jaw|collarbone)\b/i;function nR(e){return mse.test(e??"")}function gse(e,t){var a,i,l;const n=((a=t.words)==null?void 0:a.trim())??"",r=((i=t.where)==null?void 0:i.trim())??"";return n?r&&!nR(n)?`${n} ${r}`:n:r?`${((l=va(e))==null?void 0:l.label.toLowerCase())??e} ${r}`:""}function h5(e,t){const n=(t??[]).filter(r=>/\b(left|right)\b/i.test(r.words)&&(e==="front"||!vse.has(r.id)));if(n.length)return`Check the side: ${n.map(r=>r.words).join("; ")}. Facing you, their right is on your left.`}const vse=new Set(["tattoo","prosthetic"]),bm=["who","age","heritage","skin","hair","length","facial","eyes","build","height"],ac="either",oc=e=>{var t,n;return[(e==null?void 0:e.pick)===ac?"":(t=e==null?void 0:e.pick)==null?void 0:t.trim(),(n=e==null?void 0:e.words)==null?void 0:n.trim()].filter(Boolean).join(", ")},rR=e=>{var t;return!!(e!=null&&e.pick||(t=e==null?void 0:e.words)!=null&&t.trim())},xm=e=>{var t;return((t=e.source)==null?void 0:t.door)==="scratch"},z6=e=>{var t;return xm(e)&&((t=e.source)==null?void 0:t.via)==="taps"},km=e=>{var t;return xm(e)&&((t=e.source)==null?void 0:t.via)!=="taps"},Sm=e=>{var t;return((t=e.source)==null?void 0:t.door)==="photos"},wse=/\b(slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size)\b/i;function pw(e){const t=e.trim(),n=t.split(/\s+/).filter(Boolean).length,r=[];return $h.test(t)||r.push("who"),pv.test(t)||r.push("age"),r.length&&!wse.test(t)&&n<8&&r.push("build"),r}const yse=(e,t)=>bm.every(n=>!uR(`look-${n}`,e,t)||e[`look-${n}`]!==void 0),sR=e=>km(e)&&e.describe!==void 0&&pw(e.describe).length>0,bse=e=>km(e)&&e.describe!==void 0&&(!sR(e)||e.gaps!==void 0),xse=(e,t)=>{var n;return Sm(e)&&!!t.draft&&t.draft.source==="photos"&&t.canGenerate&&t.draft.stage!=="analyzing"&&(e.traits!==void 0||!((n=t.draft.keep)!=null&&n.trim()))},aR=(e,t)=>z6(e)?yse(e,t):km(e)?bse(e):xse(e,t),kse=(e,t)=>xm(e)||Sm(e)&&!!t.draft,oR=e=>t=>{var n;return!!((n=t.traits)!=null&&n.includes(e))},iR=e=>t=>rR(t[`trait-${e}`]),lR=e=>t=>{var n;return oR(e)(t)&&iR(e)(t)&&!!((n=va(e))!=null&&n.where)&&!nR(oc(t[`trait-${e}`]))},J1=(e,t)=>Array.isArray(e)&&e.includes(t),Sse=(e,t)=>{var n;return aR(e,t)&&(((n=e.traits)==null?void 0:n.every(r=>iR(r)(e)&&(!lR(r)(e)||e[`trait-${r}-where`]!==void 0)))??!1)},Ese=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),Cse=(e,t)=>{var r;if(!Sm(e)||!t.draft||t.draft.stage==="analyzing"||t.draft.views.portrait.status!=="empty")return!1;const n=((r=t.draft.analysis)==null?void 0:r.photos)??[];return n.length>0&&n.every(a=>a.usable===!1)},Xo=[{id:"source",applies:()=>!0},{id:"photos",applies:Sm},{id:"weakphotos",applies:Cse},...bm.map(e=>({id:`look-${e}`,applies:e==="facial"?t=>{var n;return z6(t)&&((n=t["look-who"])==null?void 0:n.pick)!=="woman"}:z6})),{id:"describe",applies:km},{id:"gaps",applies:sR,dependsOn:[{on:"describe"}]},{id:"traits",applies:kse,ready:aR},...ld.flatMap(e=>[{id:`trait-${e.id}`,applies:oR(e.id),dependsOn:[{on:"traits",changed:(t,n)=>J1(t,e.id)!==J1(n,e.id)}]},{id:`trait-${e.id}-where`,applies:lR(e.id),dependsOn:[{on:`trait-${e.id}`,changed:(t,n)=>oc(t)!==oc(n)},{on:"traits",changed:(t,n)=>J1(t,e.id)!==J1(n,e.id)}]}]),{id:"keep",applies:xm,ready:Sse,optional:!0,sticky:!0}],cR=new Map(Xo.map(e=>[e.id,e])),jse=Xo.map(e=>e.id),F0=e=>{const t=Xo.findIndex(n=>n.id===e);return t<0?Xo.length:t},Ase=e=>cR.get(e);function uR(e,t,n){return Ase(e).applies(t,n)}function dR(e,t,n){if(e==="photos")return!!n.draft&&n.draft.source==="photos";const r=t[e];return r===void 0?!1:rr(e)||Mse(e)?rR(r):!0}function fR(e,t){return Xo.filter(n=>n.applies(e,t)&&dR(n.id,e,t)).map(n=>n.id)}function Em(e,t){var n;return((n=Xo.find(r=>{var a;return!r.optional&&r.applies(e,t)&&(((a=r.ready)==null?void 0:a.call(r,e,t))??!0)&&!dR(r.id,e,t)}))==null?void 0:n.id)??null}function p5(e,t,n){const r={...e},a=new Set,i=new Set(Object.keys(t));for(const[u,f]of Object.entries(t))Ese(e[u],f)&&(f===void 0?delete r[u]:r[u]=f,a.add(u));if(a.size){const u=Xo.map(g=>g.id),f=Math.min(...[...a].map(g=>u.indexOf(g))),h=new Set(a),p=g=>(g.dependsOn??[]).some(v=>h.has(v.on));for(const g of Xo)u.indexOf(g.id)<=f||i.has(g.id)||r[g.id]===void 0||g.sticky||p(g)||(delete r[g.id],a.add(g.id))}let l=!0;for(;l;){l=!1;for(const u of Xo){if(r[u.id]===void 0)continue;(!i.has(u.id)&&(u.dependsOn??[]).some(h=>a.has(h.on)&&(h.changed?h.changed(e[h.on],r[h.on]):!0))||!u.applies(r,n))&&(delete r[u.id],a.add(u.id),l=!0)}}return r}function Nse(e){const t={};for(const n of e.traits??[]){const r=e[`trait-${n}`];r&&(t[n]={words:oc(r)||void 0,where:oc(e[`trait-${n}-where`])||void 0,refs:r.refs.length?r.refs:void 0})}return t}function hR(e){const t={};for(const n of bm){const r=e[`look-${n}`];r!==void 0&&(t[n]=r)}return t}const pR=e=>ld.map(t=>t.id).filter(t=>e.includes(t)),rr=e=>e.startsWith("look-"),Mse=e=>e.startsWith("trait-"),_s=e=>cR.has(e);function Jr(e){if(!e.startsWith("trait-"))return null;const t=e.endsWith("-where"),n=t?e.slice(6,-6):e.slice(6);return va(n)?{id:n,part:t?"where":"what"}:null}const Rse=[{to:8,name:"red"},{to:16,name:"scarlet"},{to:30,name:"orange"},{to:36,name:"amber"},{to:46,name:"gold"},{to:64,name:"yellow"},{to:80,name:"lime"},{to:95,name:"yellow-green"},{to:158,name:"green"},{to:172,name:"sea green"},{to:183,name:"teal"},{to:196,name:"cyan"},{to:205,name:"sky blue"},{to:215,name:"azure"},{to:240,name:"blue"},{to:252,name:"indigo"},{to:268,name:"violet"},{to:285,name:"purple"},{to:300,name:"orchid"},{to:318,name:"magenta"},{to:330,name:"fuchsia"},{to:342,name:"pink"},{to:352,name:"rose"},{to:360,name:"red"}],Pse=[{to:.05,name:"black"},{to:.16,name:"charcoal"},{to:.32,name:"dark grey"},{to:.62,name:"grey"},{to:.76,name:"light grey"},{to:.88,name:"silver"},{to:.96,name:"off-white"},{to:1.01,name:"white"}],Lse=new Set(["black","charcoal","dark grey","grey","light grey","silver","off-white","white","dark brown","brown","chestnut","auburn","copper","tan","beige","cream","amber","gold","blonde"]),Tse=e=>{const t=String(e??"").replace("#","").trim();return(t.length===3?t.split("").map(r=>r+r):[t.slice(0,2),t.slice(2,4),t.slice(4,6)]).map(r=>{const a=Number.parseInt(r,16);return Number.isFinite(a)?a:0})};function $se(e){const[t,n,r]=Tse(e),a=t/255,i=n/255,l=r/255,u=Math.max(a,i,l),f=Math.min(a,i,l),h=(u+f)/2,p=u-f;if(p===0)return{h:0,s:0,l:h};const g=p/(1-Math.abs(2*h-1));return{h:((u===a?60*((i-l)/p%6):u===i?60*((l-a)/p+2):60*((a-i)/p+4))+360)%360,s:g,l:h}}const Dse=e=>{var t;return((t=Rse.find(n=>e<n.to))==null?void 0:t.name)??"red"};function Hse(e,t,n){return e==="orange"||e==="amber"||e==="scarlet"?n<.2?"dark brown":n<.32?e==="scarlet"?"chestnut":"brown":n>=.86&&t<.6?"cream":n>=.72&&t<.6?"beige":n<.44&&t<.7?"brown":n<.62&&t<.55?"tan":null:(e==="gold"||e==="yellow")&&n<.42?"olive":(e==="indigo"||e==="violet"||e==="purple")&&n>=.72&&t<.7?"lavender":(e==="blue"||e==="azure"||e==="indigo")&&n<.22?"navy":e==="red"&&n<.34?t<.55?"burgundy":"maroon":e==="rose"&&n<.34?"burgundy":null}function Ose(e){return e<.18?"deep":e<.34?"dark":e>=.88?"pale":e>=.74?"light":""}function mR(e){var u;const{h:t,s:n,l:r}=$se(e);if(n<.09){const f=((u=Pse.find(h=>r<h.to))==null?void 0:u.name)??"grey";return{name:f,family:f,h:t,s:n,l:r}}const a=Dse(t),i=Hse(a,n,r);if(i){const f=r<.12?"deep":r>=.93?"pale":"";return{name:f?`${f} ${i}`:i,family:i,h:t,s:n,l:r}}const l=Ose(r);return l?{name:`${l} ${a}`,family:a,h:t,s:n,l:r}:n<.22?{name:`muted ${a}`,family:a,h:t,s:n,l:r}:n>.85&&r>.4&&r<.65?{name:`vivid ${a}`,family:a,h:t,s:n,l:r}:{name:a,family:a,h:t,s:n,l:r}}function Ise(e){const{family:t,h:n,s:r,l:a}=mR(e);return Lse.has(t)?!0:n>=16&&n<=60&&a>=.7&&r<.7||r<.09}const mw=[{id:"black",label:"Black",color:"#15120f"},{id:"dark brown",label:"Dark brown",color:"#3b2418"},{id:"brown",label:"Brown",color:"#6b4630"},{id:"auburn",label:"Auburn",color:"#8c3b26"},{id:"ginger",label:"Ginger",color:"#c2622a"},{id:"blonde",label:"Blonde",color:"#d8ac63"},{id:"platinum blonde",label:"Platinum",color:"#e9e1d0"},{id:"grey",label:"Grey",color:"#9b9b99"},{id:"white",label:"White",color:"#f0efed"}],gR=[{id:"buzzed",label:"Buzzed",card:"length-1"},{id:"cropped",label:"Cropped",card:"length-2"},{id:"short",label:"Short",card:"length-3"},{id:"chin-length",label:"Chin",card:"length-4"},{id:"shoulder-length",label:"Shoulder",card:"length-5"},{id:"long",label:"Long",card:"length-6"}],gw=[{id:"porcelain",label:"Porcelain",color:"#f4e0d4"},{id:"fair",label:"Fair",color:"#edcdb6"},{id:"light olive",label:"Light olive",color:"#ddb894"},{id:"olive",label:"Olive",color:"#c2935f"},{id:"tan",label:"Tan",color:"#a9713f"},{id:"brown",label:"Brown",color:"#7c4f2c"},{id:"deep brown",label:"Deep brown",color:"#57351d"},{id:"deep",label:"Deep",color:"#3a2114"}],vR=[{id:"slight",label:"Slight",card:"build-1"},{id:"lean",label:"Lean",card:"build-2"},{id:"average",label:"Average",card:"build-3"},{id:"solid",label:"Solid",card:"build-4"},{id:"full",label:"Full",card:"build-5"}],Fse=[{id:"East Asian",label:"East Asian"},{id:"South Asian",label:"South Asian"},{id:"Southeast Asian",label:"Southeast Asian"},{id:"Middle Eastern",label:"Middle Eastern"},{id:"Mediterranean",label:"Mediterranean"},{id:"North African",label:"North African"},{id:"West African",label:"West African"},{id:"East African",label:"East African"},{id:"Northern European",label:"Northern European"},{id:"Eastern European",label:"Eastern European"},{id:"Latin American",label:"Latin American"},{id:"Caribbean",label:"Caribbean"},{id:"mixed heritage",label:"Mixed"}],vw=[{id:"dark brown",label:"Dark brown",color:"#3b2a1d"},{id:"brown",label:"Brown",color:"#6b4423"},{id:"hazel",label:"Hazel",color:"#8a7340"},{id:"amber",label:"Amber",color:"#b07d1a"},{id:"green",label:"Green",color:"#5b7a4b"},{id:"blue",label:"Blue",color:"#4a7ba7"},{id:"grey",label:"Grey",color:"#8b949c"}],wR=[{id:"clean-shaven",label:"Clean shaven",card:"facial-1"},{id:"light stubble",label:"Stubble",card:"facial-2"},{id:"a moustache",label:"Moustache",card:"facial-3"},{id:"a goatee",label:"Goatee",card:"facial-4"},{id:"a short beard",label:"Short beard",card:"facial-5"},{id:"a full beard",label:"Full beard",card:"facial-6"}],yR=[{id:"very short",label:"Very short",card:"height-1"},{id:"short",label:"Short",card:"height-2"},{id:"average height",label:"Average",card:"height-3"},{id:"tall",label:"Tall",card:"height-4"},{id:"very tall",label:"Very tall",card:"height-5"}],_se={},bR=[{id:"woman",label:"Woman"},{id:"man",label:"Man"},{id:"androgynous",label:"Androgynous"}],xR=["20s","30s","40s","50s","60+"].map(e=>({id:e,label:e})),Lf={who:{row:{id:"who",label:"Who",options:bR},prompt:"Who are they?"},age:{row:{id:"age",label:"Age",options:xR},prompt:"Roughly how old?"},heritage:{row:{id:"heritage",label:"Heritage",options:Fse},prompt:"Where are they from?"},skin:{row:{id:"skin",label:"Skin",options:gw},prompt:"And their skin?"},eyes:{row:{id:"eyes",label:"Eyes",options:vw},prompt:"What colour are their eyes?"},facial:{row:{id:"facial",label:"Facial hair",options:wR},prompt:"Any facial hair?"},hair:{row:{id:"hair",label:"Hair",options:mw},prompt:"What colour is their hair?"},length:{row:{id:"length",label:"Length",options:gR},prompt:"And the length?"},build:{row:{id:"build",label:"Build",options:vR},prompt:"And their build?"},height:{row:{id:"height",label:"Height",options:yR},prompt:"And how tall?"}};bm.map(e=>Lf[e]);const m5=new Set(["hair","skin","eyes"]),Zse={who:"Who they are, in your words",age:"Their age, in words or a number",heritage:"Where they are from, in your words",hair:"Their hair colour, in words or a swatch",length:"Their cut, in your words",facial:"Their facial hair, in your words",eyes:"Their eye colour, in words or a swatch",skin:"Their skin, in words or a swatch",build:"Their build, in your words",height:"How tall they are, in your words"},Vse=e=>e==="man"?"man":e==="woman"?"woman":"androgynous",zse=new Set(["length","height","build"]),Bse=900;function ww(e,t,n){const r=Use(e,t);if(r.far<Bse)return r.id;const a=mR(e).name;return n==="hair"&&!Ise(e)?`dyed ${a}`:a}function Use(e,t,n){const r=h=>{const p=h.replace("#","");return(p.length===3?p.split("").map(v=>v+v):[p.slice(0,2),p.slice(2,4),p.slice(4,6)]).map(v=>Number.parseInt(v,16)||0)},[a,i,l]=r(e);let u=t[0],f=Number.POSITIVE_INFINITY;for(const h of t){if(!h.color)continue;const[p,g,v]=r(h.color),w=(a-p)**2+(i-g)**2+(l-v)**2;w<f&&(f=w,u=h)}return{id:u.id,far:f}}const g5=e=>e==="skin"?gw:e==="eyes"?vw:mw,xh=e=>e.charAt(0).toUpperCase()+e.slice(1);function kR(e){const t=H=>H!=null&&H.pick&&H.pick!==ac?H.pick:"",n=(H,D,K)=>{var Z;const O=t(H);return O?O.startsWith("#")?ww(O,D,K):O:((Z=H==null?void 0:H.words)==null?void 0:Z.trim())??""},r=H=>{var D;return t(H)?((D=H==null?void 0:H.words)==null?void 0:D.trim())??"":""},a=(H,...D)=>[H,...D.filter(Boolean)].join(" "),i=(H,D,K)=>n(H,D,K).toLowerCase(),l={androgynous:"androgynous person",man:"man",woman:"woman"},u=i(e.who,[]),f=l[u]??u,p=[n(e.heritage,[]),f].filter(Boolean).join(" "),v=[p?/^(a|an|the)\s/i.test(p)?p:`${/^[aeiou]/i.test(p)?"an":"a"} ${p}`:"a person"],w=i(e.age,[]),y=w==="60+"?"in their 60s or older":/^\d{1,3}$/.test(w)?`aged ${w}`:`in their ${w}`;w&&v.push(a(y,r(e.age)));const x=[],k=i(e.length,gR),S=i(e.hair,mw,"hair"),E=[k,S].filter(Boolean).join(" ");E&&x.push(a(`${E} hair`,r(e.length),r(e.hair)));const j=i(e.facial,wR);j&&x.push(a(j,r(e.facial)));const N=i(e.eyes,vw);N&&x.push(a(`${N} eyes`,r(e.eyes)));const P=i(e.skin,gw,"skin");P&&x.push(a(`${P} skin`,r(e.skin)));const $=i(e.height,yR),M=i(e.build,vR),C=$?a(_se[$]??$,r(e.height)):"",R=M?a(`${/^[aeiou]/.test(M)?"an":"a"} ${M} build`,r(e.build)):"",T=[C,R&&(C?`with ${R}`:R)].filter(Boolean).join(" ");return T&&x.push(T),x.length&&v.push(`with ${x.join(", ")}`),a(v.join(" "),r(e.who))}function Wse(e,t){var i,l;const n=t.pick,r=n===ac?"Either way":n!=null&&n.startsWith("#")?xh(ww(n,e.options,e.id)):n?((i=e.options.find(u=>u.id===n))==null?void 0:i.label)??xh(n):"",a=((l=t.words)==null?void 0:l.trim())??"";return r?a?`${r}, ${a}`:r:xh(a)}function Kse(e){return xh(kR(e))}const _0=e=>typeof e=="string"&&e.startsWith("aside:"),Gse=e=>e.slice(6),np={answers:{},revision:0,editing:null,saying:null,says:0,text:"",colour:null,composing:null,asides:[],unsure:null,extrasDeclined:!1,uploading:0},Yse="That did not read as a description of someone.",SR=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function qse(e){if(!e||e==="name")return null;if(e==="keep")return"keep";const t=Jr(e);return t&&t.part==="what"?`trait-${t.id}`:null}function v5(e,t){var r;const n=qse(t);return n?{id:n,refs:((r=e.answers[n])==null?void 0:r.refs)??[]}:null}function u8(e){const t=e.composing;if(!t)return e.answers;const n=e.answers[t.id];if(!n||SR(n.refs,t.refs))return e.answers;if(!oc(n)&&!t.refs.length){const r={...e.answers};return delete r[t.id],r}return{...e.answers,[t.id]:{...n,refs:t.refs}}}function Xse(e,t){var r;if(!rr(t)&&!Jr(t))return;const n=e.answers[t];if(n)return{saying:t,text:n.words??"",colour:(r=n.pick)!=null&&r.startsWith("#")?{step:t,hex:n.pick}:null}}function B6(e,t,n,r){return e.filter(a=>!a.q||!_s(a.q)?!0:!uR(a.q,t,n)||a.edit&&t[a.q]!==void 0?!1:r===void 0||F0(a.q)<=r)}function Qse(e){const t=Object.keys(e).filter(n=>_s(n));return t.length?Math.min(...t.map(F0)):void 0}function ER(e,t){if(!e.some(r=>r.at===t.at))return t;let n=1;for(;e.some(r=>r.at===`${t.at}#${n}`);)n+=1;return{...t,at:`${t.at}#${n}`}}function d8(e,t){const n=e.unsure;if(!n)return e;const r=Em(e.answers,t),a=u=>u&&(u===r||_s(u)&&e.answers[u]!==void 0)?u:null,i=e.asides.map(u=>u.q==="unsure"?{...u,q:a(n.q)}:u),l=ER(i,{said:n.said,reply:Yse,q:a(n.q),at:n.at});return{...e,unsure:null,asides:B6([...i,l],e.answers,t)}}function Jse(e,t){var n,r,a;switch(t.type){case"answer":{const i=p5(e.answers,t.patch,t.ctx),l=!SR(i,e.answers),u=d8(e,t.ctx);return{...u,answers:i,revision:l?e.revision+1:e.revision,asides:B6(u.asides,i,t.ctx,Qse(t.patch)),editing:null,saying:null,colour:null,composing:null,text:""}}case"edit":{const i=_0(t.id)||t.id==="name"?void 0:Xse(e,t.id);return{...e,answers:u8(e),composing:_0(t.id)?null:v5(e,t.id),editing:t.id,saying:(i==null?void 0:i.saying)??null,says:i?e.says+1:e.says,colour:(i==null?void 0:i.colour)??null,text:(i==null?void 0:i.text)??""}}case"amend-aside":{const i=e.asides.find(h=>h.at===t.at),l=i!=null&&i.q&&_s(i.q)?i.q:null,u=l&&e.answers[l]!==void 0?p5(e.answers,{[l]:void 0},t.ctx):e.answers,f=B6(e.asides.filter(h=>h.at<=t.at),u,t.ctx,l?F0(l):void 0);return{...e,answers:u,revision:u===e.answers?e.revision:e.revision+1,editing:null,asides:f.map(h=>h.at===t.at?{...h,said:t.said,reply:t.reply,kind:t.kind,rev:(h.rev??0)+1}:h)}}case"drop-aside":return{...e,editing:null,asides:e.asides.filter(i=>i.at<t.at)};case"cancel-edit":return{...e,answers:u8(e),composing:null,editing:null,saying:null,colour:null,text:""};case"say":{const i=e.saying===t.id?null:t.id;return{...e,answers:u8(e),composing:v5(e,i),saying:i,says:e.says+1,colour:null,text:""}}case"text":return e.text===t.text?e:{...e,text:t.text};case"colour":return t.hex?t.step&&t.step!=="keep"?{...e,colour:{step:t.step,hex:t.hex}}:e:{...e,colour:null};case"aside":{if(!t.aside.said.trim()||!t.aside.reply.trim())return{...e,text:""};const l=!!t.aside.q&&_s(t.aside.q)&&e.answers[t.aside.q]!==void 0?{...t.aside,after:!0}:t.aside;return{...e,asides:[...e.asides,ER(e.asides,l)],text:""}}case"unsure":return{...d8(e,t.ctx),unsure:t.unsure,text:""};case"settle-unsure":return d8(e,t.ctx);case"upload-begin":return{...e,uploading:e.uploading+1};case"upload-end":return{...e,uploading:Math.max(0,e.uploading-1)};case"uploaded":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.hashes.includes(t.hash)||i.hashes.length>=t.max?e:{...e,answers:{...e.answers,photos:{...i,hashes:[...i.hashes,t.hash]}},revision:e.revision+1}}case"remove-photo":{const i=e.answers.photos;if(!(i!=null&&i.hashes.includes(t.hash)))return e;const l=i.hashes.filter(u=>u!==t.hash);return{...e,answers:{...e.answers,photos:{hashes:l,attested:l.length?i.attested:!1}},revision:e.revision+1}}case"attest":{if(((r=e.answers.source)==null?void 0:r.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.attested===t.checked?e:{...e,answers:{...e.answers,photos:{...i,attested:t.checked}},revision:e.revision+1}}case"ref":{if(t.id!=="keep"){const u=t.id.slice(6);if(!((a=e.answers.traits)!=null&&a.includes(u)))return e}const i=e.answers[t.id]??{refs:[]},l=t.remove?i.refs.filter(u=>u!==t.hash):t.id==="keep"?[...i.refs.filter(u=>u!==t.hash),t.hash].slice(-4):[t.hash];return l.join()===i.refs.join()?e:{...e,answers:{...e.answers,[t.id]:{...i,refs:l}},revision:e.revision+1}}case"extras-declined":return{...e,extrasDeclined:!0};case"start-over":return{...np,revision:e.revision+1,text:t.text??""};case"restore":return{...np,answers:t.answers,revision:t.revision,asides:t.asides??[]}}}function U6(e,t){return Em(e.answers,t)===null&&!e.editing&&!e.saying}const CR=5,jR=40;function eae(e){return JSON.stringify({v:CR,answers:e.answers,revision:e.revision,asides:e.asides.slice(-jR)})}function tae(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.said!="string"||typeof t.reply!="string"||typeof t.at!="string"||!t.said.trim()||!t.reply.trim())return null;const n=typeof t.q=="string"?t.q:null,r=typeof t.rev=="number"&&t.rev>0?t.rev:void 0,a=typeof t.kind=="string"?t.kind:void 0,i=t.after===!0?!0:void 0,l=t.edit===!0?!0:void 0;return{said:t.said,reply:t.reply,q:n,at:t.at,...r?{rev:r}:{},...a?{kind:a}:{},...i?{after:i}:{},...l?{edit:l}:{}}}function nae(e){var r;if(rr(e))return Lf[e.slice(5)].row.options;const t=Jr(e),n=t&&va(t.id);return n?t.part==="where"?((r=n.where)==null?void 0:r.options)??[]:n.options:[]}function w5(e,t){return t===ac||/^#[0-9a-f]{6}$/i.test(t)?{pick:t}:nae(e).some(n=>n.id===t)?{pick:t}:{words:t}}function rae(e,t){if(e==="keep")return typeof t=="string"?{words:t,refs:[]}:t;if(typeof t=="string"&&(rr(e)||Jr(e)))return w5(e,t);const n=Jr(e);if((n==null?void 0:n.part)==="what"&&t&&typeof t=="object"){const r=t,a=Array.isArray(r.refs)?r.refs:[];return r.pick!==void 0||typeof r.words!="string"?{...r,refs:a}:{...w5(e,r.words),refs:a}}return t}function rp(e){if(!e)return null;try{const t=JSON.parse(e);if(t.v!==CR&&t.v!==4&&t.v!==3&&t.v!==2||!t.answers||typeof t.answers!="object")return null;const n={};for(const[a,i]of Object.entries(t.answers))_s(a)&&(n[a]=rae(a,i));const r=(Array.isArray(t.asides)?t.asides:[]).map(tae).filter(a=>a!==null).slice(-jR);return{answers:n,revision:typeof t.revision=="number"?t.revision:0,asides:r}}catch{return null}}const Pn={source:"Who are we making? Describe someone new, or add photos of a real person.",describe:"Describe them. Age, hair, build, skin and presence all help; one or two sentences is enough.",lookHint:"Skip anything you would rather leave to us.",photos:"Add one clear photo of their face. Up to three more angles hold the likeness better.",weakPhotos:"I cannot read a face in any of those photos, so anything I draw now would be a stranger rather than them.",name:"What should we call them?",nameWhileDrawing:"While it draws: what should we call them?",nameWhileReading:"While I read them: what should we call them?",traits:"Anything else that is always true of them?",traitsPhotos:"Anything in these photos that is always true of them?",keep:"Anything else about them?",agree:"Here is the presenter, in full. Ready to draw?",identity:e=>`Here is ${e==="them"?"the face":e}. Use this person, or change something.`,change:"What should change?",landed:e=>`Here is the ${e}. Use it, or try again.`,extras:"Add back and profile views? They help shots from behind or in profile."},AR=e=>e==="photos"?"the photos":"the face",NR=[{id:"photos",label:"Add photos"},{id:"scratch",label:"Describe someone"}],sae={photos:/\b(photos?|pictures?|pics?|upload|images?|selfies?)\b/,scratch:/\b(scratch|describe|description|invent|make (someone|one|them) up|imagine|new person)\b/},aae=[{label:"Late 30s, warm",text:"A woman in her late 30s, Mediterranean, olive skin, dark shoulder-length hair, slim build, warm and composed."},{label:"Early 20s, bright",text:"A man in his early 20s, fair skin with freckles, short blond hair, athletic build, bright and easygoing."},{label:"Mid 40s, quiet",text:"A man in his mid 40s, East Asian, close-cropped black hair, lean build, quietly confident."},{label:"Late 20s, easy",text:"A woman in her late 20s, deep brown skin, natural curls, tall and graceful, with an easy laugh."},{label:"Sixties, calm",text:"A woman in her early sixties, light skin, silver hair in a soft bob, broad build, calm and assured."}],oae="I have permission to use this person's likeness.";function iae(e){const t=[];return e.over>0&&t.push(e.over===1?`That is one more than ${e.max} photos, so the last one was not added.`:`That is ${e.over} more than ${e.max} photos, so the last ${e.over} were not added.`),e.same>0&&t.push(e.same===1?"One of those is already here.":`${e.same} of those are already here.`),e.failed.length&&t.push(e.failed.join(" ")),t.length?t.join(" "):null}const lae=(e,t)=>`${e} is larger than ${Math.round(t/1024/1024)}MB. Choose a smaller copy of it.`,cae=e=>`${e} could not be read as a photograph. JPEG, PNG, WebP and HEIC all work.`,uae="First portrait appears here",dae=(e,t)=>!e||e==="portrait"||!t?uae:`The ${t} appears here`;function fae(e){return e==="agree"?"Ready when you are":e==="photos"?"Add their photos":"Keep describing your presenter"}const MR=e=>e===1?"One thing I cannot tell yet.":e===2?"Two things I cannot tell yet.":"A few things I cannot tell yet.";function hae(e){return e===1?"One photo":`${e} photos`}function pae(e,t){return e===0?"The same person, face clear. Add the clearest one first.":e===1?"One photo works. Two to four, from different angles, hold the likeness better.":e<t?`${e} photos. More angles hold the likeness better.`:"Four angles. The reference set comes from these, the first one leading."}const mae="That does not read as a description yet. Draw from it anyway, or describe them: age, hair, build, skin, presence.",gae=e=>e===0?void 0:e===1?"Changing this asks the one after it again.":`Changing this asks the ${e} after it again.`,vae="Change this answer?",wae="The face is drawn again from the change, and the views built on it follow. Nothing already saved changes.",yae="The views drawn from the photos are drawn again with the change. The photos themselves stay as they are.",bae={source:"describe them in a sentence, or pick one",describe:"a few words about them is enough: age, hair, build, skin, presence",look:"tap one, or say it in your own words",name:"a name, so the rest of the conversation can use it",refine:"say what should change: hair, age or build change the person; anything else changes the view on the stage",detail:"tap one, or say what it looks like"},xae={who:{thing:"a person",how:"tap who they are"},age:{thing:"an age",how:"tap an age, or type one: Scenri draws adults"},hair:{thing:"a hair colour",how:"tap a colour, or say it: dark auburn, salt and pepper"},length:{thing:"a length",how:"tap a length, or say it: a chin-length bob"},skin:{thing:"a skin tone",how:"tap a tone, or say it: warm olive"},build:{thing:"a build",how:"tap a build, or say it: lean and tall"}},ss=e=>e.charAt(0).toUpperCase()+e.slice(1);function Pl(e,t,n,r="",a,i=!1){const l=t==="look"?xae[a??""]??null:null,u=(l==null?void 0:l.how)??bae[t],f=i?"":` ${ss(u)}.`;if(n>=2&&e!=="likeness"){const h=t==="look"||t==="detail"?"Or Skip it and we will choose.":"";return i?h||`${ss(u)}.`:`${ss(u)}.${h?` ${h}`:""}`}switch(e){case"likeness":return"Describe them by looks. Scenri does not draw a named person.";case"help":return l?`${ss(u)}.`:t==="refine"?"Select a view and say what is wrong with it, or say what should change about them: hair, age, build, skin.":t==="name"?"Any name will do; it can be changed later.":t==="detail"?`${ss(u)}.`:"Describe the person in a sentence: age, hair, build, skin, presence. Or add photos of a real person.";case"question":return l?`This step asks for ${l.thing}: ${u}.`:t==="refine"?`This is where the picture is changed: ${u}.`:t==="name"?`This is where they get a name: ${u}.`:t==="detail"?`This asks what the detail looks like: ${u}.`:`This is where the person is described: ${u}.`;case"nav":return"To begin again, use Start over at the top. Close keeps the draft where it is.";case"go":return t==="refine"?"Try again redraws it as it is; a sentence says what should change.":`Nothing to draw yet. ${ss(u)}.`;case"intent":return l?`${ss(u)}.`:t==="refine"?`Nothing changes until it is said what: ${u}.`:`That is what we are here for. Who are they? ${ss(u)}.`;case"nonsense":return l?`That is not ${l.thing}.${f}`:t==="name"?`That is not a name. ${ss(u)}.`:t==="refine"?`That does not say what should change. ${ss(u)}.`:t==="detail"?`That does not say what it looks like. ${ss(u)}.`:`That does not describe anyone. ${ss(u)}.`;case"greeting":return n?`Still here.${f}`:/^(hi|hello|hey|heya|hiya|yo|hola|shalom|good)\b/i.test(r.trim())?`Hi.${f}`:`${ss(u)}.`;case"ack":return n?`Still here.${f}`:i?"Go ahead.":`Go ahead: ${u}.`;case"vague":return n?`Still here. ${ss(u)}.`:`${ss(u)}.`}}const Z0=e=>e.trim().replace(/[.\s]+$/,"");function y5(e,t){const n=e==="portrait"?"face":bn[e];return t==="cancelled"?{id:"retry",kind:"confirm",quiet:!0,prompt:`Stopped drawing the ${n}. Nothing finished was touched.`,options:[{id:"retry",label:"Draw it again"}]}:{id:"retry",kind:"confirm",tone:"alert",prompt:`The ${n} could not be drawn: ${Z0(t)}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}}function kae(e){var r;const t=(((r=e.analysis)==null?void 0:r.suitableCategories)??[]).filter(Boolean);return t.length?` Filed under ${t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}; that can change on their page.`:""}function Sae(e){if(!e)return"";const t=[...e.asks??[],...e.results??[],...e.decisions??[]].map(n=>n.at);return t.length?t.reduce((n,r)=>r>n?r:n):""}const Eae=e=>e.charAt(0).toUpperCase()+e.slice(1);function Cae({draft:e,canGenerate:t,ui:n,afterCoverage:r,asides:a,openId:i,placed:l}){var Se;const u=[],f=(Q,xe,ee)=>u.push({kind:"scenri",id:Q,text:xe,tone:ee}),h=Q=>u.push({kind:"question",question:Q}),p=((Se=e.name)==null?void 0:Se.trim())??"",g=p||"them",v=()=>{p&&(u.push({kind:"scenri",id:"asked-name",text:Pn.name,quiet:!0}),u.push({kind:"you",id:"name",text:p,editable:!0,editing:n.editingName||void 0}))},w=Q=>h({id:"name",kind:"text",prompt:Q});if(e.stage==="analyzing")return f("reading",`Reading ${AR(e.source)}.`),p?v():w(Pn.nameWhileReading),u;const y=PK(e,t);if(y&&f("coverage",y.text,y.tone),u.push(...r),!t&&e.source==="photos")return p&&v(),p?(h({id:"blind",kind:"confirm",prompt:"No engine here can draw the other views. Save them from the photos as they are?",options:[{id:"save",label:"Save with photos"},{id:"setup",label:"Set up"}]}),u):(w(Pn.name),u);const x=e.views.portrait,k=e.activeView,S=e.asks??[],E=S[S.length-1],j=E?e.views[E.view]:null,N=!!E&&!!j&&(j.status==="generating"&&e.activeView===E.view||j.status==="candidate"&&j.adjustment===E.text||!!j.error),P=Q=>Q==="portrait"&&!Ko(e)?Pn.identity(g):Pn.change,$=(e.results??[]).filter(Q=>Q.how!=="restored"),M=e.decisions??[],C=!e.activeView&&e.stage==="idle",R=new Map,T=new Map,H=new Map;for(const Q of $){const xe=`${Q.view}:${Q.hash}`;if(H.set(xe,Q),R.has(xe))continue;const ee=(T.get(Q.view)??0)+1;T.set(Q.view,ee),R.set(xe,ee)}const D=Q=>R.get(`${Q.view}:${Q.hash}`)??1,K=(Q,xe)=>{const ee=D(Q),ae=e.views[Q.view].hash===Q.hash,re=(T.get(Q.view)??0)>1;return{kind:"scenri",id:xe,text:`Here is ${bn[Q.view]} ${ee}.`,thumb:Q.hash,view:Q.view,label:`${Jl[Q.view]} ${ee}`,current:re&&ae&&H.get(`${Q.view}:${Q.hash}`)===Q,restore:C&&!ae&&!mv(e,Q.view)?{view:Q.view,hash:Q.hash}:void 0}},O=new Set,Z=new Map(S.map(Q=>{const xe=$.find(ee=>!O.has(ee)&&ee.how==="drawn"&&ee.view===Q.view&&ee.ask===Q.text&&ee.at>=Q.at);return xe&&O.add(xe),[Q,xe]})),te=new Map;for(const Q of M)Q.what==="use"&&!te.has(Q.view)&&te.set(Q.view,Q);const B=Q=>Q==="portrait"?`Here is ${g} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${bn[Q]}. Use it, or keep the previous one.`,F=Q=>{const xe=Q===te.get(Q.view),ee=Q.view==="portrait"&&xe,ae=Q.what==="again"?"Try again":Q.what==="keep"?"Keep previous":ee?"Use this person":Q.view==="portrait"?"Use this":"Use it";return[{kind:"scenri",id:`asked-decided-${Q.at}`,text:ee?Pn.identity(g):xe?Pn.landed(bn[Q.view]):B(Q.view),quiet:!0},{kind:"you",id:`decided-${Q.at}`,text:ae,editable:!1}]},X=()=>{const Q=N?S.slice(0,-1):S,xe=Sae(e),ee=a.filter(_=>!l.has(_)&&(_.q!==i||_.at<=xe));for(const _ of ee)l.add(_);const ae=$.find(_=>hK.includes(_.view)),re=[...Q.map(_=>{const ue=Z.get(_);return{at:_.at,turns:[{kind:"scenri",id:`asked-ask-${_.at}`,text:P(_.view),quiet:!0},{kind:"you",id:`ask-${_.at}`,text:_.text,editable:!1},...ue?[K(ue,`redrew-${_.at}`)]:[]]}}),...$.filter(_=>!O.has(_)).map(_=>({at:_.at,turns:[K(_,`result-${_.at}`)]})),...M.map(_=>({at:_.at,turns:F(_)})),...ee.map(_=>({at:_.at,turns:ri(_)})),...Ko(e)&&(e.extras||n.extrasDeclined)?[{at:ae?ae.at.slice(0,-1):"~",turns:[{kind:"scenri",id:"asked-extras",text:Pn.extras,quiet:!0},{kind:"you",id:"extras",text:e.extras?"Add them":"Not now",editable:!1}]}]:[]];re.sort((_,ue)=>_.at<ue.at?-1:_.at>ue.at?1:0);for(const _ of re)u.push(..._.turns)},z=()=>{!N||!E||(u.push({kind:"scenri",id:`asked-ask-${E.at}`,text:P(E.view),quiet:!0}),u.push({kind:"you",id:`ask-${E.at}`,text:E.text,editable:!1}))};if(!Ko(e)){const Q=x.status==="generating"||k==="portrait"&&x.status!=="candidate";return Q&&!S.length?(f("drawing-face","Drawing their face."),p?v():w(Pn.nameWhileDrawing),u):(v(),X(),Q?(z(),f("drawing-face",N?"Adjusting the face. Everything else stays.":"Drawing their face."),p||w(Pn.nameWhileDrawing),u):n.failed?(h({id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${Z0(n.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}),u):x.error?(z(),h(y5("portrait",x.error)),u):(x.status==="candidate"&&(z(),h({id:"identity",kind:"confirm",prompt:N?"Adjusted. Use this person, or try again.":Pn.identity(g),hint:h5("portrait",e.keepItems),options:[{id:"use",label:"Use this person"},{id:"again",label:"Try again"},{id:"change",label:"Change something"}]})),u))}v(),X();const I=Object.keys(e.views),U=Wo(e),G=[...U].reverse().find(Q=>f6.has(Q)),ne=U.find(Q=>!f6.has(Q)),q=I.find(Q=>e.views[Q].status==="candidate"),le=I.find(Q=>!!e.views[Q].error);if(n.failed&&!k)return h({id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${Z0(n.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:"Retry"}]}),u;if(k)return z(),f(`drawing-${k}`,N&&(E==null?void 0:E.view)===k?`Redrawing the ${bn[k]}.`:k===G&&!e.views[k].hash?`Drawing the ${bn[k]} from this face.`:k===ne&&!e.views[k].hash&&G?`Building the rest of the set from the ${bn[G]}.`:`Drawing the ${bn[k]}.`),p||w(Pn.nameWhileDrawing),u;if(q){z();const Q=e.views[q],xe=!!Q.prior,ee=re=>re?R.get(`${q}:${re}`)??0:0,ae=!!Q.hash&&!!Q.prior&&ee(Q.hash)<ee(Q.prior);return Q.hash&&u.push({kind:"scenri",id:`candidate-${q}-${Q.hash}`,text:ae?`Here is ${bn[q]} ${ee(Q.hash)} again.`:xe?q==="portrait"?`Here is ${g} with the change.`:`Redrew the ${bn[q]}.`:`Here is the ${bn[q]}.`,thumb:Q.hash,label:Jl[q],view:q,current:!0}),h({id:q==="portrait"?"revision":"view-revision",kind:"confirm",prompt:xe?q==="portrait"?`Use this, or keep the previous one.${LK(e,q)?" Using it redraws the views built on the face.":""}`:"Use it, or keep the previous one.":"Use it, or try again.",hint:q==="portrait"||q==="front"?h5(q,e.keepItems):void 0,options:[{id:"use",label:q==="portrait"?"Use this":"Use it"},...xe?[{id:"keep",label:"Keep previous"}]:[],{id:"again",label:"Try again"}]}),u}return le?(z(),h(y5(le,e.views[le].error??"")),u):pK(e)?!e.extras&&!n.extrasDeclined?(f("set-ready","The set is ready. Select a view and say what is wrong to redraw it."),h({id:"extras",kind:"confirm",prompt:Pn.extras,options:[{id:"add",label:"Add them"},{id:"save",label:"Not now"}]}),u):p?(h({id:"save",kind:"confirm",prompt:`${Eae(g)} is ready.${kae(e)}`,options:[{id:"save",label:"Save presenter"}]}),u):(w(Pn.name),u):(p||w(Pn.nameWhileDrawing),u)}const jae={who:{label:"Who",options:bR},age:{label:"Age",options:xR},build:{label:"Build",options:["slender","average","athletic","fuller"].map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}},sp=e=>e.charAt(0).toUpperCase()+e.slice(1);function Aae(e){return!e||e==="skipped"?"Draw as is":Object.values(e).map(t=>sp(t)).join(", ")}function Nae(e){const t=e.map(n=>{var r;return((r=va(n))==null?void 0:r.label)??n});return t.length?t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`:"Nothing distinctive"}const Mae=e=>ZQ(e,NR,sae);function Cm(e){var a;if(((a=e.source)==null?void 0:a.via)==="taps"){const i=hR(e),l=oc(i.who);return kR(l&&!ra(l)?{...i,who:void 0}:i)}const t=(e.describe??"").trim(),n=e.gaps&&e.gaps!=="skipped"?e.gaps:{},r=n.build?`${t.replace(/[.\s]+$/,"")}, ${n.build} build`:t;return AK({steer:n.who??null,age:n.age??null},r)}function Rae(e){return jm(e).map(t=>t.words)}const Pae=200,Lae=12;function jm(e){var i,l;const t=Nse(e),n=(u,f,h)=>({id:u,words:f.slice(0,Pae),...h!=null&&h.length?{refs:h.slice(0,4)}:{}}),r=[];for(const u of pR(e.traits??[])){const f=t[u],h=f?gse(u,f):"";h&&r.push(n(u,h,f==null?void 0:f.refs))}const a=(((i=e.keep)==null?void 0:i.words)??"").trim();return a&&r.push(n("said",a,(l=e.keep)==null?void 0:l.refs)),r.slice(0,Lae)}function b5(e){const t=Rae(e);return t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Tae(e){const t=e.trim().replace(/[.\s]+$/,""),n=t.replace(/^(?:but|and|also|plus|though|although|however)\b[\s,]*/i,"");return n.replace(/^(?:he|she|they|it)\s+(?:has|have|had|has got|have got|is|are|wears?|carries)\s+/i,"")||n||t}function $ae(e,t,n,r){const a=r.toLowerCase().split(/[^a-z0-9]+/).filter(l=>l.length>2);if(!a.length)return!0;const i=Cm({...e,[t]:n}).toLowerCase();return a.every(l=>i.includes(l))}function Dae(e){const t=rp(e.setup??null);return t&&Object.keys(t.answers).length?{answers:t.answers,asides:t.asides}:{answers:Hae(e),asides:[]}}function Hae(e){const t=rp(e.setup??null);return t&&Object.keys(t.answers).length?t.answers:e.source==="photos"?{source:{door:"photos",via:"taps"},photos:{hashes:e.sources??[],attested:!0},...x5(e)}:{source:{door:"scratch",via:"typed"},describe:e.direction??"",gaps:"skipped",traits:[],...x5(e)}}function x5(e){const t=e.keepItems??[];if(!t.length)return{};const n={},r=[];let a;for(const i of t){const l=ld.find(u=>u.id===i.id);if(l){r.push(l.id),n[`trait-${l.id}`]={words:i.words,refs:i.refs??[]};continue}a={words:[a==null?void 0:a.words,i.words].filter(Boolean).join(", "),refs:[...(a==null?void 0:a.refs)??[],...i.refs??[]]}}return n.traits=r,a&&(n.keep=a),n}const RR=(e,t)=>({draft:e?{source:e.source,stage:e.stage,keep:e.keep,views:{portrait:{status:e.views.portrait.status}},analysis:e.analysis?{photos:e.analysis.photos}:void 0}:null,canGenerate:t});function Oae(e,t,n){var a,i;if(e==="source")return t.kind==="choice"?{source:{door:t.id,via:"taps"}}:null;if(rr(e)){const l=(a=n[e])==null?void 0:a.words,u=l?{words:l}:{};return t.kind==="swatches"?{[e]:{pick:t.picks[e.slice(5)]??Object.values(t.picks)[0],...u}}:t.kind==="skip"?{[e]:{pick:ac,...u}}:null}if(e==="gaps")return t.kind==="choices"?{gaps:t.picks}:t.kind==="skip"?{gaps:"skipped"}:null;if(e==="traits")return t.kind==="choices"?{traits:ld.map(l=>l.id).filter(l=>t.picks[l])}:t.kind==="skip"?{traits:[]}:null;const r=Jr(e);if(r&&t.kind==="choice"){if(r.part==="where"){const u=(i=n[e])==null?void 0:i.words;return{[e]:{pick:t.id,...u?{words:u}:{}}}}const l=n[`trait-${r.id}`];return{[e]:{pick:t.id,...l!=null&&l.words?{words:l.words}:{},refs:(l==null?void 0:l.refs)??[]}}}return null}function Iae(e,t){var r;return`the ${((r=va(e))==null?void 0:r.label.toLowerCase())??"detail"} in the attached ${t===1?"picture":"pictures"}`}const k5="A scar, a ring, anything we missed",Fae=new Set(["describe","keep"]),_ae=new Set(["likeness","help","question","greeting","ack","nav","intent","go","nonsense"]);function S5(e,t){const n=(t==null?void 0:t.trim())??"";return e?n?`${e}, ${n}`:e:sp(n)}const Zae=/^(?:but|and|though|although|only|just|except(?: that)?|with|without|plus)\s+/i,E5=e=>Zae.test(e.trim());function f8(e){return e.trim().replace(/[.\s]+$/,"").replace(/^(?:but|and|though|although|only|just|except(?: that)?)\s+/i,"").trim()}function V0(e,t){if(!e)return!1;if(Fae.has(e))return!0;if(!rr(e)&&!Jr(e))return!1;const n=t[e];return!!n&&!n.pick&&!!n.words}function eh(e,t,n){const r=t.trim();return r?e==="look-age"&&xK(r)?null:e!=="look-who"&&(rr(e)||e.startsWith("trait-"))&&wK(r)?"nonsense":rr(e)||e.startsWith("trait-")||e==="keep"?zae(r,n):e==="describe"||e==="source"?Vo(r,n):null:"vague"}function h8(e,t,n){if(e&&rr(e))return"look";if(e==="keep"||e!=null&&e.startsWith("trait-"))return"detail";const r=e??t;if(r&&rr(r))return"look";if(r!=null&&r.startsWith("trait-"))return"detail";switch(r){case"source":return"source";case"describe":case"gaps":return"describe";case"name":return"name";case"traits":return"detail";default:return n?"refine":"describe"}}const C5=new Set(["who","age","hair","colour","color","length","cut","skin","build","body","name","look","style","face","person","presenter","glasses","scar","scars","tattoo","piercing","makeup","freckles","prosthetic"]),Vae=/^[a-z]{1,10}\d+$/i,zae=(e,t)=>{const n=e.trim(),r=n.toLowerCase().replace(/[^a-z ]/g,"");if(C5.has(r)||C5.has(r.replace(/^(the|their|its|his|her)\s+/,"")))return"nonsense";const a=n.split(/\s+/).filter(Boolean);if(a.length<=2&&a.some(l=>Vae.test(l)))return"nonsense";const i=Vo(e,t);return i&&_ae.has(i)?i:null};function Bae(e,t){return e==="name"?"metadata":t?e==="source"||e==="photos"?"start-over":"redraw":"plain"}function j5(e,t,n,r){var f,h,p,g,v,w,y,x,k;const a=t.answers,i=r?{reopened:!0,cost:gae(fR(a,n).filter(S=>S!=="keep"&&F0(S)>F0(e)).length)}:{};switch(e){case"source":return{id:e,kind:"choice",prompt:Pn.source,options:NR,given:(f=a.source)==null?void 0:f.door,...i};case"weakphotos":return{id:e,kind:"confirm",prompt:Pn.weakPhotos,options:[{id:"again",label:"Use different photos"},{id:"anyway",label:"Draw from these anyway"}]};case"photos":{const S=a.photos??{hashes:[],attested:!1};return{id:e,kind:"photos",prompt:Pn.photos,hint:pae(S.hashes.length,h0),hashes:S.hashes,max:h0,busy:t.uploading>0,attest:{text:oae,checked:S.attested},submit:"Continue",back:"Describe someone instead"}}case"describe":return{id:e,kind:"text",prompt:Pn.describe,starters:aae};case"gaps":{const S=pw(a.describe??"");return{id:e,kind:"choice",prompt:MR(S.length),groups:S.map(E=>({id:E,...jae[E]})),submit:"Continue",skip:"Skip, draw as is",given:a.gaps&&a.gaps!=="skipped"?a.gaps:void 0,...i}}case"traits":{const S=((h=a.source)==null?void 0:h.door)==="photos";return{id:e,kind:"choice",prompt:S?Pn.traitsPhotos:Pn.traits,multi:!0,options:ld.map(E=>({id:E.id,label:E.label})),submit:"Continue",skip:S?"Nothing to add":"Nothing else",given:a.traits,...i}}case"keep":return{id:e,kind:"text",prompt:Pn.keep}}if(rr(e)){const S=e.slice(5),{row:E,prompt:j}=Lf[S],N=Vse((p=a["look-who"])==null?void 0:p.pick),P=zse.has(S)?{...E,options:E.options.map($=>$.card?{...$,card:`${$.card}-${N}`}:$)}:E;return{id:e,kind:"swatches",prompt:j,hint:S==="who"?Pn.lookHint:void 0,row:P,skip:"Skip",describe:S==="who"?"Describe them instead":void 0,saying:t.saying===e,given:((g=a[e])==null?void 0:g.pick)===ac||(v=a[e])==null?void 0:v.pick,skipped:((w=a[e])==null?void 0:w.pick)===ac,note:(y=a[e])==null?void 0:y.words,...i}}const l=Jr(e),u=l?va(l.id):void 0;if(l&&u&&l.part==="where"&&u.where)return{id:e,kind:"choice",prompt:u.where.ask,options:u.where.options.map(S=>({id:S.id,label:S.label})),saying:t.saying===e,given:(x=a[e])==null?void 0:x.pick,note:(k=a[e])==null?void 0:k.words,...i};if(l&&u){const S=a[`trait-${l.id}`];return{id:e,kind:"choice",prompt:u.ask,hint:u.hint,options:u.options.map(E=>({id:E.id,label:E.label,card:E.card})),attach:S!=null&&S.refs.length?"Replace the reference":"Add a reference",saying:t.saying===e,given:S==null?void 0:S.pick,note:S==null?void 0:S.words,...i}}return{id:e,kind:"text",prompt:""}}function A5(e,t){var a,i,l;switch(e){case"source":return Pn.source;case"photos":return Pn.photos;case"describe":return((a=t.source)==null?void 0:a.via)==="typed"?Pn.source:Pn.describe;case"gaps":return MR(pw(t.describe??"").length);case"traits":return((i=t.source)==null?void 0:i.door)==="photos"?Pn.traitsPhotos:Pn.traits;case"keep":return Pn.keep}if(rr(e))return Lf[e.slice(5)].prompt;const n=Jr(e),r=n?va(n.id):void 0;return!n||!r?"":n.part==="where"?((l=r.where)==null?void 0:l.ask)??"":r.ask}function Uae(e,t,n){var u,f,h,p,g,v,w;switch(e){case"source":return{text:((u=t.source)==null?void 0:u.door)==="photos"?"Add photos":"Describe someone"};case"photos":{const y=(n==null?void 0:n.sources)??((f=t.photos)==null?void 0:f.hashes)??[];return{text:hae(y.length),photos:y}}case"describe":return{text:(t.describe??"").trim()};case"gaps":return{text:Aae(t.gaps)};case"traits":return{text:Nae(pR(t.traits??[]))};case"keep":return{text:(((h=t.keep)==null?void 0:h.words)??"").trim(),photos:(p=t.keep)==null?void 0:p.refs}}if(rr(e)){const y=e.slice(5);return{text:Wse(Lf[y].row,t[e]??{})}}const r=Jr(e),a=r?va(r.id):void 0;if(!r||!a)return{text:""};if(r.part==="where"){const y=t[e]??{},x=y.pick?((v=(g=a.where)==null?void 0:g.options.find(k=>k.id===y.pick))==null?void 0:v.label)??sp(y.pick):"";return{text:S5(x,y.words)}}const i=t[`trait-${r.id}`],l=i!=null&&i.pick?((w=a.options.find(y=>y.id===i.pick))==null?void 0:w.label)??sp(i.pick):"";return{text:S5(l,i==null?void 0:i.words),photos:i!=null&&i.refs.length?i.refs:void 0}}function Wae(e){const t=e.state.asides,n=t.length?MN(N5(e,[],null)):null;return N5(e,t,n)}const PR=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,ap=(e,t)=>_0(e.editing)&&Gse(e.editing)===t.at;function N5(e,t,n){const r=new Set,a=Kae(e,t,n,r),i=a.length&&a[a.length-1].kind==="question"?a.pop():null,l=t.filter(f=>!r.has(f)).sort(PR),u=e.state.unsure;for(const f of l)(!u||f.at<u.at)&&a.push(...ri(f,ap(e.state,f)));if(i&&a.push(i),u){a.push({kind:"you",id:`unsure-${u.at}`,text:u.said,editable:!1}),a.push({kind:"question",question:{id:"unsure",kind:"confirm",quiet:!0,prompt:mae,options:[{id:"use",label:"Use it anyway"}]}});for(const f of l)f.at>=u.at&&a.push(...ri(f,ap(e.state,f)))}return a}function Kae({state:e,draft:t,canGenerate:n,failed:r,awaiting:a},i,l,u){var P,$,M,C,R;const f=RR(t,n),h=e.answers,p=[{kind:"you",id:"intent",text:"Create a presenter"}],g=[],v=((P=h.source)==null?void 0:P.door)==="photos",w=(T,H,D=!1)=>{const K=i.filter(O=>!u.has(O)&&!!O.q&&O.q!==l&&H.includes(O.q)&&!!O.after===D).sort(PR);for(const O of K)u.add(O),T.push(...ri(O,ap(e,O)))},y=T=>i.find(H=>H.edit&&H.q===T&&!u.has(H)),x=(T,H,D=!0)=>{var O;if(T.push({kind:"scenri",id:`asked-${H}`,text:A5(H,h),quiet:!0}),w(T,H==="describe"&&((O=h.source)==null?void 0:O.via)==="typed"?["source","describe"]:[H]),!D){const Z=y(H);Z&&(u.add(Z),T.push({kind:"you",id:H,text:Z.said}),T.push(...ri(Z,ap(e,Z),!0))),w(T,[H],!0);return}const K=Uae(H,h,t);T.push({kind:"you",id:H,text:K.text,photos:K.photos,editable:!0,editing:e.editing===H&&V0(H,h)||void 0}),w(T,[H],!0)},k=new Set(fR(h,f)),S=jse.filter(T=>k.has(T)||i.some(H=>H.edit&&H.q===T));for(const T of S){const H=v&&t&&T!=="source"&&T!=="photos"?g:p;if(e.editing===T&&!V0(T,h)){H.push({kind:"scenri",id:`asked-${T}`,text:A5(T,h),quiet:!0}),w(H,[T]),H.push({kind:"question",question:j5(T,e,f,!0)}),w(H,[T],!0);continue}T==="source"&&(($=h.source)==null?void 0:$.via)==="typed"||x(H,T,k.has(T))}let E=null;if(((M=h.source)==null?void 0:M.door)==="scratch"&&!n&&!t)E={id:"noengine",kind:"confirm",quiet:!0,prompt:"Describing someone needs image generation, which is not set up yet.",options:[{id:"setup",label:"Set up"},{id:"photos",label:"Add photos instead"}]};else{const T=Em(h,f);T?E=j5(T,e,f,!1):!t&&((C=h.source)==null?void 0:C.door)==="scratch"&&(h.source.via==="taps"?E={id:"agree",kind:"confirm",prompt:Pn.agree,quote:`${Kse(hR(h))}${b5(h)?`, and always ${b5(h)}`:""}.`,options:[{id:"draw",label:"Draw the presenter"}]}:r&&(E={id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${r}. Nothing was drawn.`,options:[{id:"retry",label:"Retry"}]}))}if(a&&(E=null),!t)return E&&p.push({kind:"question",question:E}),p;const j=Cae({draft:t,canGenerate:n,ui:{extrasDeclined:e.extrasDeclined,failed:r,editingName:e.editing==="name"},afterCoverage:g,asides:i,openId:l,placed:u}),N=[...p,...j];return E&&((R=N[N.length-1])==null?void 0:R.kind)==="question"&&N.pop(),E&&N.push({kind:"question",question:E}),N}function LR(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question;if(!Uh(n))return null}return null}const Ja={placeholder:"Nothing to type yet",label:"Message",action:"Send"},M5=(e,t)=>({placeholder:t?Zse[e]??"In your words":m5.has(e)?"Tap a swatch above, or say the colour":"Tap one above, or describe it",label:"Describe it",action:"Send",color:m5.has(e)});function R5(e,t){const n=Jr(e),r=n?va(n.id):void 0,a=(n==null?void 0:n.part)==="where"?"Where it is, in your words":(r==null?void 0:r.saying)??"What it looks like",i=(n==null?void 0:n.part)==="where"?"Tap one above, or say where it is":`Tap one above, or ${((r==null?void 0:r.saying)??"describe it").toLowerCase()}`;return{placeholder:t?a:i,label:(r==null?void 0:r.saying)??"Describe it",action:"Send"}}function Gae(e,t,n,r){if(t.editing!==null&&(t.editing==="name"||_0(t.editing)||V0(t.editing,t.answers)))return{...Ja,off:"Finish the change above."};if(t.saying==="keep")return{placeholder:k5,label:"What should stay the same about them",action:"Send"};if(t.saying&&rr(t.saying))return M5(t.saying.slice(5),!0);if(t.saying)return R5(t.saying,!0);if(t.editing!==null)return{...Ja,off:"Finish the change above."};if(e){if(rr(e.id))return M5(e.id.slice(5),!1);if(e.id.startsWith("trait-"))return R5(e.id,!1);switch(e.id){case"source":return{placeholder:"Describe them, or choose above",label:"Describe them",action:"Send"};case"describe":case"unsure":return{placeholder:"Describe them",label:"Describe them",action:"Send"};case"name":return{placeholder:"Their name",label:"Their name",action:"Send"};case"identity":return{placeholder:"What should change? Shorter hair, older",label:"What should change",action:"Refine"};case"agree":return{placeholder:k5,label:"Anything else that is always true of them",action:"Send"};case"traits":return{placeholder:"Tap any above, or say it in your own words",label:"Anything else that is always true of them",action:"Send"};case"gaps":return{placeholder:"Tap one above, or say it in your own words",label:"Fill in what is missing",action:"Send"};case"photos":return{...Ja,off:"Add their photos above."};case"noengine":return{...Ja,off:"Set up image generation, or add photos."};case"blind":return{...Ja,off:"Decide above."};case"retry":return{...Ja,off:"Retry above."}}}return n?n.stage==="analyzing"?{...Ja,off:`Reading ${n.source==="photos"?"the photos":"the face"}.`}:ec(n)?Ko(n)?{placeholder:P5(r,n),label:"What should change",action:"Refine",off:""}:{...Ja,off:""}:Ko(n)?{placeholder:P5(r,n),label:"What should change",action:"Refine"}:{...Ja,off:"The face comes first."}:{...Ja,off:"Starting the draft."}}function P5(e,t){var r;const n=((r=t.name)==null?void 0:r.trim())||"them";return e==="portrait"?`What should change about ${n}?`:`Change this view: ${bn[e]}`}function L5(e,t){return e.saying?e.saying:t&&_s(t.id)&&(t.id==="source"||t.id==="describe")||t&&_s(t.id)&&(rr(t.id)||t.id.startsWith("trait-"))?t.id:(t==null?void 0:t.id)==="agree"?"keep":(t==null?void 0:t.id)==="name"?"name":null}const Yae=/\b(here|in this (view|one|picture|image|frame)|this (view|one|picture|image|frame))\b/i,qae=/\b(looks? like|doesn'?t look|does not look|not (her|him|them)|drift(s|ed|ing)?|wrong|\boff\b|different person|someone else|regenerate|redraw|again)\b/i,Xae=/\b(dress|gown|outfit|wearing|wear|jacket|coat|suit|shirt|t-shirt|tee|hoodie|jeans|trousers|skirt|shoes|heels|sneakers|boots|hat|cap|sunglasses|jewell?ery|necklace|earrings|watch|holding|holds?|product|bottle|perfume|bag|handbag|phone|laptop|scene|beach|paris|london|tokyo|street|rooftop|office|kitchen|cafe|city|forest|desert|snow|rain|sunset|sunrise|golden hour|background|backdrop|lighting|campaign|shoot)\b/i,Qae=/\b(simpler|plainer|plain|neutral|cleaner|tidier)\b/i,Jae=/\b(outfit|clothes|clothing|top|wardrobe|wearing)\b/i;function TR(e,t,n){const r=e.trim();if(!r)return{blocked:"Say what should change."};if(Xae.test(r)&&!(Qae.test(r)&&Jae.test(r)))return{scope:"out-of-scope"};const a=tA.test(r),i=qae.test(r),l=Yae.test(r),u=n.source==="photos";if(t==="portrait")return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};if(a&&i&&!l)return u?{scope:"view",view:t}:{scope:"ambiguous"};if(a&&!l)return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};const f=n.views[t];return f.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:f.status!=="approved"&&f.status!=="candidate"?{blocked:`Nothing drawn for the ${bn[t]} yet.`}:{scope:"view",view:t}}const $R=e=>`Use Create for wardrobe, products and scenes. Edits here change who ${e} is.`;function eoe(e,t,n,r){const a=e.trim(),i=t==="portrait"?"Describe a change to who they are.":"Say what is wrong with this view, or describe a change to who they are.";if(!a){const u=n.views[t];return t!=="portrait"&&u.origin==="photo"?{chip:null,hint:"Your photo stands as it is. Pick a drawn view to change."}:{chip:null,hint:i}}const l=TR(a,t,n);return"blocked"in l?{chip:null,hint:l.blocked,tone:"alert"}:l.scope==="out-of-scope"?{chip:null,hint:$R(r),tone:"alert"}:l.scope==="ambiguous"?{chip:null,hint:"This reads as the view or the person. Send it and I will ask which."}:l.scope==="identity"?{chip:{view:"portrait",label:"Changing the person"},hint:"Changes the person. The other views are redrawn after you use it."}:{chip:{view:l.view,label:`Refining the ${bn[l.view]}`},hint:"Changes this view only. Hair, skin, age or build change the person."}}const toe=e=>e.replace(/^asset:/,"");function DR(e,t){if((e.identityEdits??[]).join(`
105
- `)!==(t.identityEdits??[]).join(`
106
- `))return!0;const r=t.shots.some(i=>i.angle==="portrait"&&i.file),a=new Map(t.shots.map((i,l)=>[!r&&l===0?"portrait":i.angle??"",toe(i.file)]));for(const i of Wo(e)){const l=e.views[i];if(l.status==="candidate"||l.status==="stale"||l.prior)return!0;const u=a.get(i);if(l.status==="approved"&&l.hash&&l.hash!==u||l.status==="empty"&&u)return!0}return!1}const noe=e=>fK.filter(t=>e.views[t].status==="empty"&&t!=="portrait"),roe=e=>e.length<=2?e.map(t=>bn[t]).join(" and "):`${e.slice(0,-1).map(t=>bn[t]).join(", ")} and ${bn[e[e.length-1]]}`,soe={building:!1,buildDeclined:!1,scopeAsk:null,failed:null,conflict:null},aoe="Say what should change: hair, age or build change the person; anything else changes the view on the stage.",ooe="Still here. Select a view and say what is wrong with it, or say what should change about them.";function ioe(e,t,n){const r=`select a view and say what is wrong with it, or say what should change about ${t}`;switch(e){case"likeness":return"Describe the change by looks. Scenri does not draw a named person.";case"help":case"question":return`This is where ${t} is changed: ${r}.`;case"nav":return"Discard changes is at the top, and Save changes keeps what you did.";case"go":case"intent":return`Nothing changes until it is said what: ${r}.`;case"nonsense":return`That does not say what should change. ${r.charAt(0).toUpperCase()}${r.slice(1)}.`;default:return n?ooe:aoe}}const Dl={opening:e=>`What would you like to change about ${e}? Select a view to work on it, or describe a change to who they are.`,scope:"Apply this to:",change:"What should change?",saved:"Save changes when you are done."};function loe(e){const t=e.ui.asides??[],n=t.length?MN(T5(e,[],null)):null;return T5(e,t,n)}function T5({draft:e,base:t,name:n,selected:r,canGenerate:a,ui:i},l,u){var xe;const f=[{kind:"scenri",id:"opening",text:Dl.opening(n)}],h=new Set,p=()=>{for(const ee of l)h.has(ee)||f.push(...ri(ee));return f},g=(ee,ae,re)=>{re&&f.push({kind:"scenri",id:`asked-${ee}`,text:re}),f.push({kind:"you",id:ee,text:ae,editable:!1})},v=(ee,ae,re)=>f.push({kind:"scenri",id:ee,text:ae,tone:re}),w=ee=>f.push({kind:"question",question:ee});if(!e)return p();const y=noe(e),x=e.source!=="synthetic"||!!((xe=e.direction)!=null&&xe.trim()),k=Wo(e).some(ee=>e.views[ee].status==="candidate");if(y.length&&x&&!k&&!i.building&&!i.buildDeclined&&!ec(e)&&a){const ee=Wo(e).filter(ae=>e.views[ae].status==="approved").length;return w({id:"legacy",kind:"confirm",prompt:`${n} has ${ee===1?"one reference":`${ee} references`}. Build the ${roe(y)} from it?`,options:[{id:"build",label:"Build them"},{id:"not",label:"Not now"}]}),p()}const S=Wo(e),E=e.activeView,j=S.find(ee=>e.views[ee].status==="candidate"),N=S.find(ee=>!!e.views[ee].error),P=(t==null?void 0:t.identityEdits)??[];(e.identityEdits??[]).filter(ee=>!P.includes(ee)).forEach((ee,ae)=>{g(`edit-${ae}`,ee,Dl.change),v(`changed-${ae}`,`Changed ${n}. The views built on the face were redrawn.`)});const M=e.asks??[],C=M[M.length-1],R=C?e.views[C.view]:null,T=!!C&&!!R&&(R.status==="generating"&&e.activeView===C.view||R.status==="candidate"&&R.adjustment===C.text||!!R.error),H=new Set((e.identityEdits??[]).map(ee=>ee.toLowerCase())),D=(T?M.slice(0,-1):M).filter(ee=>!(ee.view==="portrait"&&H.has(ee.text.replace(/\s+/g," ").toLowerCase()))),K=[...M,...e.results??[],...e.decisions??[]].map(ee=>ee.at).reduce((ee,ae)=>ae>ee?ae:ee,""),O=l.filter(ee=>!h.has(ee)&&(ee.q!==u||ee.at<=K));for(const ee of O)h.add(ee);const Z=(e.results??[]).filter(ee=>ee.how!=="restored"),te=!e.activeView&&e.stage==="idle",B=new Map,F=new Map,X=new Map;for(const ee of Z){const ae=`${ee.view}:${ee.hash}`;if(X.set(ae,ee),B.has(ae))continue;const re=(F.get(ee.view)??0)+1;F.set(ee.view,re),B.set(ae,re)}const z=ee=>B.get(`${ee.view}:${ee.hash}`)??1,I=(ee,ae)=>{const re=z(ee),_=e.views[ee.view].hash===ee.hash,ue=(F.get(ee.view)??0)>1;return{kind:"scenri",id:ae,text:`Here is ${bn[ee.view]} ${re}.`,thumb:ee.hash,view:ee.view,label:`${Jl[ee.view]} ${re}`,current:ue&&_&&X.get(`${ee.view}:${ee.hash}`)===ee,restore:te&&!_?{view:ee.view,hash:ee.hash}:void 0}},U=new Set,G=new Map(M.map(ee=>{const ae=Z.find(re=>!U.has(re)&&re.how==="drawn"&&re.view===ee.view&&re.ask===ee.text&&re.at>=ee.at);return ae&&U.add(ae),[ee,ae]})),ne=(e.decisions??[]).filter(ee=>!(ee.view==="portrait"&&ee.what==="use")),q=ee=>[{kind:"scenri",id:`asked-decided-${ee.at}`,text:ee.view==="portrait"?`Here is ${n} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${bn[ee.view]}. Use it, or keep the previous one.`},{kind:"you",id:`decided-${ee.at}`,text:ee.what==="again"?"Try again":ee.what==="keep"?"Keep previous":"Use it",editable:!1}],le=[...D.map(ee=>{const ae=G.get(ee);return{at:ee.at,turns:[{kind:"scenri",id:`asked-ask-${ee.at}`,text:Dl.change},{kind:"you",id:`ask-${ee.at}`,text:ee.text,editable:!1},...ae?[I(ae,`redrew-${ee.at}`)]:[]]}}),...Z.filter(ee=>!U.has(ee)).map(ee=>({at:ee.at,turns:[I(ee,`result-${ee.at}`)]})),...ne.map(ee=>({at:ee.at,turns:q(ee)})),...O.map(ee=>({at:ee.at,turns:ri(ee)}))];le.sort((ee,ae)=>ee.at<ae.at?-1:ee.at>ae.at?1:0);for(const ee of le)f.push(...ee.turns);if(i.scopeAsk)return g("scope-ask",i.scopeAsk.said),w({id:"scope",kind:"choice",prompt:Dl.scope,options:[{id:"view",label:`This view (the ${bn[r]})`},{id:"identity",label:"The presenter"}]}),p();const Se=()=>{T&&C&&g(`ask-${C.at}`,C.text,Dl.change)};if(E){const ee=e.views[E];return Se(),v(`drawing-${E}`,T&&(C==null?void 0:C.view)===E?E==="portrait"?`Changing ${n}. Everything else stays.`:`Redrawing the ${bn[E]}.`:ee.status==="stale"||S.some(ae=>e.views[ae].status==="stale")?`Redrawing the views built on the face. The ${bn[E]} first.`:`Drawing the ${bn[E]}.`),p()}if(j){Se();const ee=e.views[j];return ee.hash&&f.push({kind:"scenri",id:`candidate-${j}-${ee.hash}`,text:j==="portrait"?`Here is ${n} with the change.`:`Redrew the ${bn[j]}.`,thumb:ee.hash,label:Jl[j],view:j,current:!0}),w({id:j==="portrait"?"revision":"view-revision",kind:"confirm",prompt:j==="portrait"?"Use this, or keep the previous one. Using it redraws the views built on the face.":"Use it, or keep the previous one.",options:[{id:"use",label:j==="portrait"?"Use this":"Use it"},{id:"keep",label:"Keep previous"},{id:"again",label:"Try again"}]}),p()}if(i.failed||N){Se();const ee=!!N&&e.views[N].error==="cancelled";return w({id:"retry",kind:"confirm",...ee?{quiet:!0}:{tone:"alert"},prompt:ee?`Stopped drawing the ${bn[N]}. Nothing finished was touched.`:N?`The ${bn[N]} could not be drawn: ${Z0(e.views[N].error??"")}. Nothing finished was touched.`:`That did not go through: ${Z0(i.failed??"")}. Nothing finished was touched.`,options:[{id:"retry",label:ee?"Draw it again":"Retry"}]}),p()}if(i.conflict)return w({id:"conflict",kind:"confirm",tone:"alert",prompt:`${n} changed in another tab. Reload to continue.`,options:[{id:"reload",label:"Reload"}]}),p();const Q=S.find(ee=>e.views[ee].status==="stale");return Q?(v(`drawing-${Q}`,`Redrawing the views built on the face. The ${bn[Q]} first.`),p()):(t&&DR(e,t)&&w({id:"save",kind:"confirm",prompt:`The set is coherent. ${Dl.saved}`,options:[{id:"save",label:"Save changes"}]}),p())}function coe(e,t,n){return!(!n||t.id!==n||e&&e.id===t.id&&t.updatedAt<e.updatedAt)}function HR(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(null),[f,h]=s.useState(!1),p=s.useRef(!0);s.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=s.useRef(t);g.current=t;const v=s.useCallback(H=>{p.current&&r(D=>coe(D,H,g.current)?H:D)},[]);s.useEffect(()=>{r(null),i(!1),u(null),h(!1)},[t]);const w=s.useCallback(async()=>{if(!t)return;const H=t;try{v(await Re.presenterDraft(e,H))}catch(D){if(!p.current||g.current!==H)return;/HTTP 404|not found/i.test(String((D==null?void 0:D.message)??D))?i(!0):u(String((D==null?void 0:D.message)??D))}},[e,t,v]);s.useEffect(()=>{w()},[w]);const y=!!n&&(n.stage!=="idle"||!!n.activeView);s.useEffect(()=>{if(!y)return;const H=setInterval(()=>void w(),1500);return()=>clearInterval(H)},[y,w]);const x=s.useCallback(async H=>{const D=g.current;h(!0),u(null);try{return v(await H()),!0}catch(K){return!p.current||g.current!==D?!1:(K==null?void 0:K.status)===409?(w(),!1):(u(String((K==null?void 0:K.message)??K)),!1)}finally{p.current&&h(!1)}},[v,w]),k=s.useCallback((H,D,K)=>x(async()=>(await Re.generateDraftView(e,t??"",H,{...D?{adjustment:D}:{},...K?{decide:K}:{}})).draft),[x,e,t]),S=s.useCallback(H=>x(()=>Re.approveDraftView(e,t??"",H)),[x,e,t]),E=s.useCallback(H=>x(()=>Re.redoDraftView(e,t??"",H)),[x,e,t]),j=s.useCallback(H=>x(()=>Re.revertDraftView(e,t??"",H)),[x,e,t]),[N,P]=s.useState(!1),$=s.useCallback(async()=>{P(!0);try{return await x(()=>Re.stopDraft(e,t??""))}finally{p.current&&P(!1)}},[x,e,t]),M=s.useCallback((H,D)=>x(()=>Re.restoreDraftView(e,t??"",H,D)),[x,e,t]),C=s.useCallback((H,D)=>x(()=>Re.placeDraftPhoto(e,t??"",H,D)),[x,e,t]),R=s.useCallback(H=>x(()=>Re.updatePresenterDraft(e,t??"",H)),[x,e,t]),T=s.useCallback(()=>u(null),[]);return{draft:n,gone:a,err:l,busy:f,drawing:y,reload:w,generate:k,approve:S,redo:E,revert:j,stop:$,stopping:N,restore:M,placePhoto:C,update:R,clearErr:T}}function uoe({presenterId:e,onLeave:t,caps:n}){var ze,tt;const{brand:r}=on(),{applyBrand:a,refreshBrands:i}=Rn(),l=Ec(),u=!!(n!=null&&n.canGenerate),[f,h]=s.useState(null),[p,g]=s.useState(null),[v,w]=s.useState(soe),[y,x]=s.useState(""),[k,S]=s.useState(null),[E,j]=s.useState(!1),[N,P]=s.useState(null),[$,M]=s.useState(!1),[C,R]=s.useState(!1),T=s.useRef(new Set),H=(((ze=r.json)==null?void 0:ze.characters)??[]).find(ce=>ce.id===e),D=((tt=H==null?void 0:H.name)==null?void 0:tt.trim())||"them",K=H?{shots:H.shots??[],identityEdits:H.identityEdits??[]}:null;s.useEffect(()=>{let ce=!0;return h(null),g(null),Re.editPresenter(r.id,e).then(ve=>{ce&&h(ve.id)}).catch(ve=>{ce&&g(String((ve==null?void 0:ve.message)??ve))}),()=>{ce=!1}},[r.id,e]);const O=HR(r.id,f),Z=O.draft,te=Z?`presenter-edit:${r.id}:${e}:${Z.id}`:void 0,B=!0;s.useEffect(()=>{if(!Z||O.busy||!u||O.err)return;const ce=Xj(Z);if(!ce||Z.views[ce].status==="empty"&&!v.building)return;const ve=`${ce}:${Z.views[ce].attempts}:${Z.generations}:${Z.views[ce].status}`;T.current.has(ve)||(T.current.add(ve),O.generate(ce,void 0,Ho(ce)))},[Z,O.busy,O.generate,u,O.err,v.building]);const F=Z?Qj(Z,k):"portrait",X=Z?Z.views[F]:null,z=!!Z&&(Z.activeView===F||Z.stage==="analyzing"),I=!!Z&&!Z.activeView&&Z.stage==="idle",U=O.err&&Z&&!Z.activeView?O.err:null,G=s.useMemo(()=>loe({draft:Z,base:K,name:D,selected:F,canGenerate:u,ui:{...v,failed:U}}),[Z,K,D,F,u,v,U]),ne=LR(G),q=!!Z&&!!K&&DR(Z,K),le=s.useCallback(ce=>{te&&Ii(te),t(ce)},[te,t]),Se=s.useCallback(async()=>{if(!(!Z||$)){M(!0),P(null);try{const ce=await Re.savePresenterDraft(r.id,Z.id);le(ce.presenter.id),a(ce.brand)}catch(ce){M(!1);const ve=String((ce==null?void 0:ce.message)??ce);/changed elsewhere|HTTP 409/i.test(ve)?w(Pe=>({...Pe,conflict:ve})):P(ve)}}},[Z,$,r.id,a,le]),Q=s.useCallback(async()=>{R(!0);try{Z&&await Re.deletePresenterDraft(r.id,Z.id)}catch{}le(e)},[Z,r.id,e,le]),xe=s.useCallback(async()=>{R(!0);try{const ce=await Re.revertPresenter(r.id,e);Z&&await Re.deletePresenterDraft(r.id,Z.id).catch(()=>{}),le(ce.presenter.id),a(ce.brand)}catch(ce){R(!1),P(String((ce==null?void 0:ce.message)??ce))}},[r.id,e,Z,a,le]),ee=s.useCallback((ce,ve)=>{var Pe;if(P(null),!!Z)switch(ce){case"legacy":if(ve.kind!=="confirm")return;w(de=>({...de,building:ve.id==="build",buildDeclined:ve.id!=="build"}));return;case"scope":{if(ve.kind!=="choice")return;const de=((Pe=v.scopeAsk)==null?void 0:Pe.said)??"";w(je=>({...je,scopeAsk:null})),ve.id==="identity"?O.generate("portrait",de):O.generate(F,de,Ho(F)),S(ve.id==="identity"?"portrait":F);return}case"revision":case"view-revision":{if(ve.kind!=="confirm")return;const de=Object.keys(Z.views).find(je=>Z.views[je].status==="candidate")??F;ve.id==="use"&&O.approve(de),ve.id==="keep"&&O.revert(de),ve.id==="again"&&O.generate(de,Z.views[de].adjustment,Ho(de)),j(!1);return}case"retry":{if(O.err){O.clearErr(),T.current=new Set;return}const de=Object.keys(Z.views).find(je=>!!Z.views[je].error);de&&O.generate(de,Z.views[de].adjustment,Ho(de));return}case"conflict":w(de=>({...de,conflict:null})),R(!0),i().finally(()=>le(e));return;case"save":Se();return}},[Z,v.scopeAsk,O,F,Se,i,le,e]),ae=s.useCallback(ce=>{const ve=ce.trim();if(!ve||!Z)return!1;P(null);const Pe=(ne==null?void 0:ne.id)??null,de=Wh(),je=(be,Le)=>({...be,asides:[...be.asides??[],{said:ve,reply:Le,q:Pe,at:de}]}),Ue=be=>be.scopeAsk?{...be,scopeAsk:null,asides:[...be.asides??[],{said:be.scopeAsk.said,reply:Dl.scope,q:"scope",at:be.scopeAsk.at}]}:be,ye=Vo(ve,ra);if(ye&&ye!=="vague")return w(be=>je(be,ioe(ye,D,(be.asides??[]).some(Le=>Le.q===Pe)))),x(""),!0;if(!u)return P("Image generation is not set up, so nothing can be redrawn yet."),!1;const Ee=TR(ve,F,Z);return"blocked"in Ee?(P(Ee.blocked),!1):Ee.scope==="out-of-scope"?(w(be=>je(Ue(be),$R(D))),x(""),!0):Ee.scope==="ambiguous"?(w(be=>({...Ue(be),scopeAsk:{said:ve,at:de}})),x(""),!0):(w(be=>Ue(be)),S(Ee.view),j(!1),O.generate(Ee.view,ve,Ee.scope==="view"?Ho(Ee.view):void 0),x(""),!0)},[Z,u,F,O,ne==null?void 0:ne.id,D]),re=Z?eoe(y,F,Z,D):null,_=re?{chip:re.chip?{label:re.chip.label,thumb:Z!=null&&Z.views[re.chip.view].hash?dn(Z.views[re.chip.view].hash,"micro"):void 0}:null,hint:re.hint,tone:re.tone}:null,ue=E&&(X!=null&&X.prior)?X.prior:X==null?void 0:X.hash,We=Z?(ne==null?void 0:ne.id)==="legacy"?"Decide above.":(ne==null?void 0:ne.id)==="conflict"?"Reload to continue.":(ne==null?void 0:ne.id)==="scope"?"Pick above.":(ne==null?void 0:ne.id)==="retry"?"Retry above.":Z.stage==="analyzing"?"Reading the photos.":Z.activeView?"":null:null,Xe=!!Z;return{d:Z,record:H,name:D,view:F,slot:X,dirty:q,saving:$,leaving:C,openErr:p,canRevert:!!(H!=null&&H.revisionOf),discard:Q,revert:xe,keepPrevious:X&&X.status==="approved"&&X.prior&&!z&&!(Z!=null&&Z.activeView)&&(Z==null?void 0:Z.stage)==="idle"?()=>void O.revert(F):null,surface:{title:"Edit presenter",memoryKey:te,resumed:B,turns:G,busy:O.busy||$||C,stage:Z?{hash:ue,alt:`${Jl[F]}${(X==null?void 0:X.status)==="candidate"?", candidate":""}`,drawing:z,since:rA(Z),doing:sA(Z),takes:mv(Z,F)?[]:oA(Z,F),onTake:I?ce=>void O.restore(F,ce):void 0,items:Jj(Z,F),onPick:ce=>{S(ce),j(!1)},compare:X&&X.status==="candidate"&&X.prior?{on:E,toggle:()=>j(ce=>!ce)}:void 0}:null,composer:Xe?{placeholder:F==="portrait"?`What should change about ${D}?`:`Change this view: ${bn[F]}`,label:"What should change",action:"Refine",scope:We?null:_,hint:null,why:We??void 0,error:N,disabled:O.busy||$||C||!!We,working:!!(Z!=null&&Z.activeView),onStop:Z!=null&&Z.activeView?()=>void O.stop():void 0,stopping:O.stopping,focusKey:`${(ne==null?void 0:ne.id)??"open"}:${(Z==null?void 0:Z.id)??""}`}:null,text:y,onText:x,onSend:ae,onAnswer:ee,onRestore:(ce,ve)=>{S(ce),O.restore(ce,ve)}},setupNeeded:u?null:l}}function doe({onClose:e,...t}){const n=uoe(t),r=o.jsxs(o.Fragment,{children:[n.canRevert&&o.jsx(Wn,{label:"Revert last change",tone:"quiet",title:"Revert the last saved change?",body:`${n.name} goes back to the pictures and the person before the last save. Shots already made keep what they were made with.`,busy:n.leaving,onConfirm:()=>void n.revert()}),n.dirty&&o.jsx(Wn,{label:"Discard changes",tone:"quiet",title:"Discard the changes?",body:"The views redrawn in this session are thrown away. The saved presenter stays as it was.",busy:n.leaving,onConfirm:()=>void n.discard()})]}),a=n.keepPrevious?o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",bn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]}):n.openErr?o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n.openErr}):null;return o.jsx(hw,{surface:{...n.surface,headAction:r,dock:a},onClose:e})}function foe(){const{presenterId:e=""}=Bs(),{brand:t}=on(),n=Dn(),{caps:r}=Av();Sc("Edit presenter");const[a]=s.useState(()=>Sv(t,e)),i=s.useCallback(u=>n(ha(t,u),{replace:!0}),[n,t]),l=s.useCallback(()=>n(ha(t,e),{replace:!0}),[n,t,e]);return a!==e?o.jsx(uo,{to:Up(t,a),replace:!0}):o.jsx(doe,{presenterId:e,onLeave:i,onClose:l,caps:r})}function hoe(e,t){return(t.source!=="synthetic"||(t.direction??"")===Cm(e.answers))&&poe(t.keepItems,jm(e.answers))}function poe(e,t){const n=e??[];return n.length!==t.length?!1:t.every((r,a)=>{const i=n[a];return!i||i.id!==r.id||i.words!==r.words?!1:(i.refs??[]).every(l=>(r.refs??[]).includes(l))})}function moe(e,t){return{...t.source==="synthetic"?{direction:Cm(e.answers)}:{},keepItems:jm(e.answers)}}const goe=e=>e.source==="photos"?e.views.front.hash?"front":null:e.views.portrait.hash?"portrait":null;function OR(e){if(!e.draftId)return!1;const t=e.draft;return t?e.seededFor!==t.id&&(!e.state.answers.source||!U6(e.state,e.ctx)):!0}function voe(e){const{state:t,draft:n,ctx:r}=e;if(e.busy||e.err)return[];if(n){if(OR(e))return[{kind:"seed",...Dae(n)}];if(!U6(t,r))return[];const i=[];hoe(t,n)||i.push({kind:"sync",patch:moe(t,n),redo:goe(n)});const l=e.canDraw?Xj(n):null;return l&&i.push({kind:"draw",view:l,decide:Ho(l)}),i}if(e.draftId)return[];if(!e.canDraw||!U6(t,r))return[];const a=t.answers.source;return(a==null?void 0:a.door)==="scratch"&&a.via!=="taps"?[{kind:"start"}]:[]}function woe(e){for(const t of voe(e))if(!e.done.has(IR(t,e)))return t;return null}function IR(e,t){const n=t.draft;switch(e.kind){case"seed":return`seed:${n==null?void 0:n.id}`;case"start":return`start:${t.state.revision}`;case"sync":return`sync:${n==null?void 0:n.id}:${JSON.stringify(e.patch)}:${e.redo??""}`;case"draw":{const r=n==null?void 0:n.views[e.view];return`draw:${n==null?void 0:n.id}:${e.view}:${(r==null?void 0:r.attempts)??0}:${(n==null?void 0:n.generations)??0}:${(r==null?void 0:r.status)??""}`}}}const ru=(e,t)=>`scenri:presenter-setup:${e}:${t}`,su={read(e){try{return sessionStorage.getItem(e)}catch{return null}},write(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};function yoe(e,t){var r,a,i;const n=t==="keep"?"detail":((a=va(((r=Jr(t))==null?void 0:r.id)??"glasses"))==null?void 0:a.label.toLowerCase())??"detail";return`${(i=e.answers[t])!=null&&i.refs.length?"Replace":"Add"} the picture of the ${n}`}function $5(e,t,n){const r=e.editing&&e.editing!=="name"?e.editing:e.saying??Em(e.answers,t);if(r==="keep"||!r&&n==="agree")return"keep";if(!r)return null;const a=Jr(r);return a&&a.part==="what"?`trait-${a.id}`:null}function boe({draftId:e,convoKey:t,onOpenDraft:n,onLeaveDraft:r,onStarted:a,caps:i}){var me,_e;const{brand:l}=on(),{presenterCategories:u,applyBrand:f}=Rn(),h=Ec(),p=!!(i!=null&&i.canGenerate),[g,v]=s.useReducer(Jse,{brandId:l.id,convoKey:t},W=>{const pe=rp(su.read(ru(W.brandId,W.convoKey)));return pe?{...np,answers:pe.answers,revision:pe.revision,asides:pe.asides}:np}),w=s.useRef(g);w.current=g;const y=eae(g),x=Object.keys(g.answers).length>0||g.asides.length>0,k=s.useRef(t);s.useEffect(()=>{x?su.write(ru(l.id,t),y):su.remove(ru(l.id,t));const W=k.current;k.current=t,W!==t&&e&&t===e&&(su.remove(ru(l.id,W)),Ii(`presenter-create:${l.id}:${W}`))},[l.id,t,e,y,x]);const S=s.useRef(null);s.useEffect(()=>{if(!e||S.current===y)return;const W=setTimeout(()=>{S.current=y,Re.updatePresenterDraft(l.id,e,{setup:y}).catch(()=>{S.current=null})},800);return()=>clearTimeout(W)},[l.id,e,y]);const[E,j]=s.useState(null),[N,P]=s.useState(!1),[$,M]=s.useState(null),[C,R]=s.useState([]),[T,H]=s.useState(!1),[D,K]=s.useState(null),[O,Z]=s.useState(!1),[te,B]=s.useState(null),[F,X]=s.useState(null),[z,I]=s.useState(0),[U,G]=s.useState([]),ne=s.useRef(new Map),[q]=s.useState(()=>!!e||!!rp(su.read(ru(l.id,t))));s.useEffect(()=>()=>{for(const W of ne.current.values())URL.revokeObjectURL(W)},[]);const le=s.useRef(!1),Se=s.useRef(new Set),Q=s.useRef(!1),xe=s.useRef(null),ee=s.useRef(!1),ae=HR(l.id,e),re=ae.draft,_=s.useMemo(()=>RR(re,p),[re,p]);s.useEffect(()=>{Se.current=new Set,le.current=!1,R([]),S.current=null,e||(ee.current=!1)},[e]),s.useEffect(()=>{if(le.current||!re)return;const W=NK(re,C);W&&(le.current=!0,R(W))},[re,C]),s.useEffect(()=>{ae.gone&&r()},[ae.gone,r]);const ue=s.useCallback(()=>{su.remove(ru(l.id,t)),Ii(`presenter-create:${l.id}:${t}`)},[l.id,t]),We=s.useCallback(W=>n(W,!0),[n]),Xe=s.useCallback(async()=>{const W=w.current;if(!p||O)return;const pe=W.revision;Z(!0),M(null);try{const Ie=jm(W.answers),Te=await Re.createPresenterDraft(l.id,{source:"synthetic",direction:Cm(W.answers),...Ie.length?{keepItems:Ie}:{}});if(w.current.revision!==pe){Re.deletePresenterDraft(l.id,Te.id).catch(()=>{});return}We(Te.id)}catch(Ie){M(String((Ie==null?void 0:Ie.message)??Ie))}finally{Z(!1)}},[l.id,p,O,We]),ze=s.useCallback(async()=>{const W=w.current,pe=W.answers.photos;if(!(pe!=null&&pe.hashes.length)||!pe.attested||O)return;const Ie=W.revision;Z(!0),M(null);try{const Te=await Re.createPresenterDraft(l.id,{source:"photos",imageHashes:pe.hashes,attestation:!0});if(w.current.revision!==Ie){Re.deletePresenterDraft(l.id,Te.id).catch(()=>{});return}We(Te.id)}catch(Te){M(String((Te==null?void 0:Te.message)??Te))}finally{Z(!1)}},[l.id,O,We]),tt=s.useCallback(async W=>{M(null);const pe=()=>{var vt;return((vt=w.current.answers.photos)==null?void 0:vt.hashes)??[]},Ie=W.slice(0,Math.max(0,h0-pe().length)),Te=[];let bt=0;v({type:"upload-begin"});try{for(const vt of Ie){if(vt.size>sx){Te.push(lae(vt.name,sx));continue}try{const Ct=await P0(vt);pe().includes(Ct)&&(bt+=1),v({type:"uploaded",hash:Ct,max:h0})}catch{Te.push(cae(vt.name))}}}finally{v({type:"upload-end"})}M(iae({over:W.length-Ie.length,same:bt,failed:Te,max:h0}))},[]),ce=s.useCallback(W=>{v({type:"answer",patch:W,ctx:_})},[_]),ve=s.useCallback(async W=>{const pe=W??re;if(!pe||T)return;const Ie=MK(pe,pe.name,p);if(Ie){K(Ie);return}H(!0),K(null);try{await Re.updatePresenterDraft(l.id,pe.id,{facets:C});const Te=await Re.savePresenterDraft(l.id,pe.id);f(Te.brand),ue(),v({type:"start-over"}),a({kind:"presenter",id:Te.presenter.id,name:Te.presenter.name})}catch(Te){H(!1),K(String((Te==null?void 0:Te.message)??Te))}},[re,T,p,l.id,C,ue,a,f]),Pe=s.useCallback(async()=>{var pe;if(!re||T)return;const W=(pe=re.sources)==null?void 0:pe[0];if(!W||re.views.portrait.status==="approved"){ve();return}H(!0),K(null);try{const Ie=await Re.placeDraftPhoto(l.id,re.id,"portrait",W);H(!1),await ve(Ie)}catch(Ie){H(!1),K(String((Ie==null?void 0:Ie.message)??Ie))}},[re,T,l.id,ve]),de=s.useCallback(async()=>{const pe=w.current.answers.describe||(re==null?void 0:re.direction)||"";ee.current=!0,ue(),v({type:"start-over",text:pe}),M(null),B(null),X(null),Se.current=new Set,re&&!eA(re)&&await Re.deletePresenterDraft(l.id,re.id).catch(()=>{}),r()},[re,l.id,ue,r]),je=re?ae.err&&!ec(re)?ae.err:null:$,Ue=s.useMemo(()=>Wae({state:g,draft:re,canGenerate:p,failed:je,awaiting:OR({state:g,draft:re,ctx:_,draftId:e,seededFor:xe.current})}),[g,re,p,je,e,_]),ye=LR(Ue),Ee=s.useRef(null);Ee.current=(ye==null?void 0:ye.id)??null;const be=re?Qj(re,E):"portrait",Le=re?re.views[be]:null,Qe=!!re&&(re.activeView===be||re.stage==="analyzing"),Ke=!!re&&!re.activeView&&re.stage==="idle",nt={state:g,draft:re,ctx:_,canDraw:p,busy:ae.busy||O||Q.current||ee.current||(re?ec(re):!1),err:!!ae.err||!!$,draftId:e,seededFor:xe.current,done:Se.current},gt=woe(nt),Pt=s.useRef(gt);Pt.current=gt;const Ut=gt?IR(gt,nt):"";s.useEffect(()=>{var pe;re&&xe.current!==re.id&&!nt.busy&&!nt.err&&((pe=Pt.current)==null?void 0:pe.kind)!=="seed"&&(xe.current=re.id);const W=Pt.current;if(!(!W||Se.current.has(Ut)))switch(Se.current.add(Ut),W.kind){case"seed":xe.current=(re==null?void 0:re.id)??null,v({type:"restore",answers:W.answers,revision:w.current.revision+1,asides:W.asides});return;case"start":Xe();return;case"sync":Q.current=!0,(async()=>{await ae.update(W.patch),W.redo&&await ae.redo(W.redo)})().finally(()=>{Q.current=!1});return;case"draw":ae.generate(W.view,void 0,W.decide);return}},[Ut,re,Xe,ae.update,ae.redo,ae.generate]);const Nt=s.useCallback((W,pe,Ie,Te,bt=!1)=>{v({type:"aside",aside:{said:W,reply:pe,q:Ie,at:Wh(),kind:Te,...bt?{edit:!0}:{}}})},[]),cn=s.useCallback((W,pe)=>{M(null);const Ie=w.current;if(_s(W)){if(W==="weakphotos"&&pe.kind==="confirm"){pe.id==="again"&&de(),pe.id==="anyway"&&ce({weakphotos:{pick:"anyway"}});return}const Te=Oae(W,pe,Ie.answers);if(Te){const bt=Ie.text.trim(),vt=Te[W],Ct=(rr(W)||!!Jr(W))&&vt&&typeof vt=="object"&&!vt.words;ce(Ct&&bt?{...Te,[W]:{...vt,words:f8(bt)}}:Te);return}if(W==="photos"&&pe.kind==="photos"){const bt=pe.action;bt.type==="add"&&tt(bt.files),bt.type==="remove"&&v({type:"remove-photo",hash:bt.hash}),bt.type==="attest"&&v({type:"attest",checked:bt.checked}),bt.type==="reject"&&M("That was not an image. Drop a photo, or choose a file."),bt.type==="submit"&&ze(),bt.type==="back"&&ce({source:{door:"scratch",via:"taps"}})}return}switch(W){case"unsure":{if(pe.kind!=="confirm"||pe.id!=="use"||!Ie.unsure)return;const Te=Ie.unsure.said,bt=Ie.unsure.q==="describe"?"describe":"source";v({type:"settle-unsure",ctx:_}),ce(bt==="describe"?{describe:Te}:{source:{door:"scratch",via:"typed"},describe:Te});return}case"noengine":pe.kind==="confirm"&&pe.id==="setup"&&h(),pe.kind==="confirm"&&pe.id==="photos"&&ce({source:{door:"photos",via:"taps"}});return;case"agree":{if(pe.kind!=="confirm")return;pe.id==="draw"&&Xe();return}case"identity":if(pe.kind!=="confirm"||!re)return;pe.id==="use"&&(ae.approve("portrait"),j(null)),pe.id==="again"&&ae.generate("portrait"),pe.id==="change"&&I(Te=>Te+1);return;case"revision":case"view-revision":{if(pe.kind!=="confirm"||!re)return;const Te=W==="revision"?"portrait":Object.keys(re.views).find(bt=>re.views[bt].status==="candidate")??be;pe.id==="use"&&ae.approve(Te),pe.id==="keep"&&ae.revert(Te),pe.id==="again"&&ae.generate(Te,re.views[Te].adjustment,Ho(Te)),P(!1);return}case"retry":{if(!re){Se.current=new Set,M(null);return}if(ae.err){ae.clearErr(),Se.current=new Set;return}const Te=Object.keys(re.views).find(bt=>!!re.views[bt].error);Te&&ae.generate(Te,re.views[Te].adjustment,Ho(Te));return}case"extras":if(pe.kind!=="confirm")return;pe.id==="add"&&ae.update({extras:!0}),pe.id==="save"&&v({type:"extras-declined"});return;case"blind":if(pe.kind!=="confirm")return;pe.id==="save"&&Pe(),pe.id==="setup"&&h();return;case"save":ve();return}},[ce,tt,ze,Xe,h,re,ae,be,ve]),Fe=s.useCallback(W=>{var Ht,pn,Wt,wn,sn,In,Dt,On,Et,Hn;const pe=W.trim(),Ie=w.current,Te=L5(Ie,ye),bt=Te&&((Ht=Ie.colour)==null?void 0:Ht.step)===Te?Ie.colour.hex:null,vt=Te&&rr(Te)?Te.slice(5):null,Ct=Te==="keep"?(((pn=Ie.answers.keep)==null?void 0:pn.refs)??[]).length:Te!=null&&Te.startsWith("trait-")?(((Wt=Ie.answers[Te])==null?void 0:Wt.refs)??[]).length:0,st=pe||bt||"";if(!st&&!Ct)return!1;if(M(null),Te==="name"){const Ot=st.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||st;return re&&ae.update({name:Ot.slice(0,60)}),v({type:"text",text:""}),!0}const $t=(Ot,tn)=>Ie.asides.filter(Vn=>Vn.q===Ot&&Vn.kind===tn).length,An=(Ot,tn=null)=>h8(Ot,tn,!!(re!=null&&re.views.portrait.hash)),Y=(Ot,tn,Vn,ur)=>{const Zr=Vn!==null&&Ie.editing===Vn;Zr&&ce({[Vn]:void 0}),Nt(Ot,tn,Vn,ur,Zr)};if(Te&&Te!=="keep"&&Te.startsWith("trait-")){const Ot=Jr(Te);if(!Ot)return!1;const tn=Ot.part==="what"?((wn=Ie.answers[Te])==null?void 0:wn.refs)??[]:[];if(!pe&&tn.length)return ce({[Te]:{pick:(sn=Ie.answers[Te])==null?void 0:sn.pick,words:Iae(Ot.id,tn.length),refs:tn}}),!0;const Vn=eh(Te,pe,ra);if(!pe||Vn)return Y(pe,Pl(Vn??"vague",An(Te),$t(Te,Vn??"vague"),pe,void 0,!0),Te,Vn??"vague"),!0;const ur=E5(pe),Zr=ur?f8(pe):pe;if(Ot.part==="where"){const zn=Ie.answers[Te];ce({[Te]:{pick:ur?zn==null?void 0:zn.pick:void 0,words:Zr}})}else{const zn=Ie.answers[Te];ce({[Te]:{pick:ur?zn==null?void 0:zn.pick:void 0,words:Zr,refs:(zn==null?void 0:zn.refs)??[]}})}return!0}if(Te==="keep"){const Ot=Ie.answers.keep,tn=(Ot==null?void 0:Ot.refs)??[],Vn=pe||(tn.length&&!(Ot!=null&&Ot.words)?"the detail in the attached picture":"");return Vn?(ce({keep:{words:[(In=Ot==null?void 0:Ot.words)==null?void 0:In.trim(),Vn].filter(Boolean).join(", "),refs:tn}}),!0):!1}if(Te&&rr(Te)&&vt){const Ot=pe&&!/^#[0-9a-f]{6}$/i.test(pe)?eh(Te,pe,ra):null;if(Ot)return Y(pe,Pl(Ot,An(Te),$t(Te,Ot),pe,vt,!0),Te,Ot),!0;const tn=Ie.answers[Te],Vn=!pe||E5(pe),ur=bt??(Vn?tn==null?void 0:tn.pick:void 0),Zr={pick:ur,words:pe?Vn?f8(pe):pe:tn==null?void 0:tn.words};if(pe&&!ur&&!$ae(Ie.answers,Te,Zr,pe)){const zn=Ie.answers.keep;return ce({keep:{words:[(Dt=zn==null?void 0:zn.words)==null?void 0:Dt.trim(),Tae(pe)].filter(Boolean).join(", "),refs:(zn==null?void 0:zn.refs)??[]}}),!0}return ce({[Te]:Zr}),!0}const he=(ye==null?void 0:ye.id)??null,Me=he==="unsure"?((On=Ie.unsure)==null?void 0:On.q)??"source":he;if(he==="traits"){const Ot=Vo(st,ra);if(Ot)return Nt(st,Pl(Ot,An(null,he),$t(he,Ot),st),he,Ot),!0;const tn=Ie.answers.keep;return ce({traits:[],keep:{words:[(Et=tn==null?void 0:tn.words)==null?void 0:Et.trim(),st].filter(Boolean).join(", "),refs:(tn==null?void 0:tn.refs)??[]}}),!0}if(he==="gaps"){const Ot=Vo(st,ra);if(Ot)return Nt(st,Pl(Ot,An(null,he),$t(he,Ot),st),he,Ot),!0;const tn=(Ie.answers.describe??"").trim().replace(/[.\s]+$/,"");return ce({describe:tn?`${tn}, ${st}`:st}),!0}const Ye=An(null,Me),dt=Me==="source"?Mae(st):null,wt=dt?null:Vo(st,ra);if(wt&&(Ye==="source"||Ye==="describe"||wt!=="vague"))return Nt(st,Pl(wt,Ye,$t(he,wt),st),he,wt),!0;if((Me==="source"||Me==="describe")&&!dt&&!ra(st))return v({type:"unsure",unsure:{said:st,q:he,at:Wh()},ctx:_}),!0;if((Me==="source"||Me==="describe")&&v({type:"settle-unsure",ctx:_}),Me==="source")return dt?(ce({source:{door:dt,via:"taps"}}),!0):(ce({source:{door:"scratch",via:"typed"},describe:st}),!0);if(Me==="describe")return ce({describe:st}),!0;if(re&&!((Hn=re.name)!=null&&Hn.trim())&&Me!=="name"&&/^[A-Z][a-z]+(?:\s[A-Z][a-z]+)?$/.test(st)&&!ra(st))return ae.update({name:st.slice(0,60)}),v({type:"text",text:""}),!0;if(Me==="name"){const Ot=st.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||st;return re&&ae.update({name:Ot.slice(0,60)}),v({type:"text",text:""}),!0}if(!re)return!1;if(Me==="identity")return ae.generate("portrait",st),v({type:"text",text:""}),!0;const Zt=nA(st,be,re);return"blocked"in Zt?(M(Zt.blocked),!1):(j(Zt.view),P(!1),ae.generate(Zt.view,st,Zt.scope==="view"?Ho(Zt.view):void 0),v({type:"text",text:""}),!0)},[ye,ce,Nt,re,ae,be]),pt=s.useCallback(W=>{if(W==="name"){v({type:"edit",id:"name"});return}const pe=pk(W);if(pe){v({type:"edit",id:`aside:${pe}`});return}if(!_s(W))return;const Ie=Bae(W,re);if(Ie==="start-over"){B("start-over");return}if(Ie==="redraw"){X(W),B("redraw");return}v({type:"edit",id:W})},[re]),it=s.useCallback(()=>{B(null),F&&v({type:"edit",id:F}),X(null)},[F]),St=s.useCallback((W,pe)=>{const Ie=w.current.answers;if(W==="keep"||W.startsWith("trait-")&&!W.endsWith("-where")){const Te=Ie[W];ce({[W]:{pick:W==="keep"||Te==null?void 0:Te.pick,words:pe,refs:(Te==null?void 0:Te.refs)??[]}});return}if(rr(W)||W.startsWith("trait-")){const Te=Ie[W];ce({[W]:{pick:Te==null?void 0:Te.pick,words:pe}});return}ce({[W]:pe})},[ce]),xt=s.useCallback((W,pe)=>{const Ie=pe.trim();if(!Ie)return;if(W==="name"){v({type:"cancel-edit"}),re&&ae.update({name:Ie.slice(0,60)});return}const Te=pk(W);if(Te){const vt=w.current,Ct=vt.asides.find(Ye=>Ye.at===Te);if(!Ct)return;const st=Ct.q&&_s(Ct.q)?Ct.q:null,$t=st?eh(st,Ie,ra):Vo(Ie,ra);if(!$t&&st){v({type:"drop-aside",at:Te}),St(st,Ie);return}const An=h8(st,Ct.q,!!(re!=null&&re.views.portrait.hash)),Y=st&&rr(st)?st.slice(5):void 0,he=$t??"vague",Me=vt.asides.filter(Ye=>Ye.q===Ct.q&&Ye.at<Ct.at&&Ye.kind===he).length;v({type:"amend-aside",at:Te,said:Ie,reply:Pl(he,An,Me,Ie,Y),kind:he,ctx:_});return}if(!_s(W)||!V0(W,w.current.answers))return;const bt=eh(W,Ie,ra);if(bt){const vt=w.current,Ct=h8(W,W,!!(re!=null&&re.views.portrait.hash)),st=rr(W)?W.slice(5):void 0,$t=vt.asides.filter(An=>An.q===W&&An.kind===bt).length;ce({[W]:void 0}),Nt(Ie,Pl(bt,Ct,$t,Ie,st),W,bt);return}St(W,Ie)},[re,ae.update,ce,St,Fe,ye,_]),At=s.useCallback(()=>v({type:"cancel-edit"}),[]),Kt=s.useCallback(()=>{const W=w.current,pe=W.editing&&W.editing!=="name"&&!_0(W.editing)?W.editing:null,Ie=pe&&!V0(pe,W.answers)?pe:ye==null?void 0:ye.id;if(Ie==="agree"){v({type:"say",id:"keep"});return}if(!(!Ie||!_s(Ie))){if(Ie==="look-who"){ce({source:{door:"scratch",via:"words"}});return}v({type:"say",id:Ie})}},[ye==null?void 0:ye.id,ce]),et=s.useCallback(()=>$5(w.current,_,Ee.current),[_]),mt=s.useCallback(W=>{const pe=et();if(pe){M(null),w.current.saying!==pe&&v({type:"say",id:pe});for(const Ie of W.slice(0,1)){const Te=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,bt=URL.createObjectURL(Ie);G(vt=>[...vt,{key:Te,id:pe,url:bt}]),P0(Ie).then(vt=>{ne.current.set(vt,bt),v({type:"ref",id:pe,hash:vt}),G(Ct=>Ct.filter(st=>st.key!==Te))}).catch(vt=>{M(String((vt==null?void 0:vt.message)??vt)),G(Ct=>Ct.filter(st=>st.key!==Te)),URL.revokeObjectURL(bt)})}}},[et]),ot=(W,pe,Ie)=>{const Te=ww(W,pe,Ie);return Te.charAt(0).toUpperCase()+Te.slice(1)},kn=W=>g5(W).flatMap(pe=>{const Ie=pe.color?nr(pe.color):null;return Ie?[{hex:Ie,name:pe.label,slot:"accent"}]:[]}),ut=$5(g,_,(ye==null?void 0:ye.id)??null),Gt=(()=>{var $t,An,Y;if(!ut)return;const W=(($t=g.answers[ut])==null?void 0:$t.refs)??[],pe=ut==="keep"?W.slice(((An=g.composing)==null?void 0:An.id)==="keep"?g.composing.refs.length:W.length):W,Ie=U.filter(he=>he.id===ut);if(!pe.length&&!Ie.length)return;const Te=ut==="keep"?null:Jr(ut),bt=Te&&((Y=va(Te.id))==null?void 0:Y.label)||"Detail",vt=pe.length+Ie.length>1;let Ct=0;const st=()=>vt?`${bt} ${++Ct}`:bt;return[...pe.map(he=>({key:he,src:ne.current.get(he)??dn(he,"micro"),label:st(),onRemove:()=>v({type:"ref",id:ut,hash:he,remove:!0})})),...Ie.map(he=>({key:he.key,src:he.url,label:st(),busy:!0,onRemove:()=>G(Me=>Me.filter(Ye=>Ye.key!==he.key))}))]})(),Ft=Gae(ye,g,re,be),en=ae.busy||O||!!Ft.off,Jt=ut,se=L5(g,ye),oe=se==="name"?null:se,we=oe&&rr(oe)?oe.slice(5):null,ge=Ft.color&&we?kn(we):null,J=oe&&((me=g.colour)==null?void 0:me.step)===oe?g.colour.hex:null,Oe=re&&Ko(re)&&!Ft.off&&!(ye!=null&&ye.id.match(/^(name|describe)$/))?(()=>{const W=RK(g.text,be,re),pe=W.chip?re.views[W.chip.view].hash:void 0;return{chip:W.chip?{label:W.chip.label,thumb:pe?dn(pe,"micro"):void 0}:null,hint:W.hint,tone:W.tone}})():null,Be=re?Jj(re,be):[],Ve=(Le==null?void 0:Le.hash)??((re==null?void 0:re.stage)==="analyzing"?re.sources[0]:void 0),Ge=N&&(Le!=null&&Le.prior)?Le.prior:Ve;return{d:re,view:be,slot:Le,facets:C,setFacets:R,presenterCategories:u,saving:T,saveErr:D,confirming:te,setConfirming:B,confirmEdit:it,pendingEdit:F,startOver:de,begun:Object.keys(g.answers).length>0||!!re,unsaved:!re&&Object.keys(g.answers).length>0,leave:()=>{ue(),v({type:"start-over"})},revision:g.revision,open:(ye==null?void 0:ye.id)??null,keepPrevious:Le&&Le.status==="approved"&&Le.prior&&!Qe&&!(re!=null&&re.activeView)&&(re==null?void 0:re.stage)==="idle"?()=>void ae.revert(be):null,surface:{title:"Create presenter",memoryKey:`presenter-create:${l.id}:${t}`,resumed:q,turns:Ue,busy:ae.busy||O,working:(re==null?void 0:re.stage)==="analyzing"?`Reading ${AR(re.source)}`:re!=null&&re.activeView?"Drawing":O||ae.busy,stageEmpty:{lead:dae(re?be:void 0,bn[be]),hint:fae((ye==null?void 0:ye.id)??null)},stage:re?{hash:Ge,alt:`${Jl[be]}${(Le==null?void 0:Le.status)==="candidate"?", candidate":""}`,drawing:Qe,since:rA(re),doing:sA(re),takes:mv(re,be)?[]:oA(re,be),onTake:Ke?W=>void ae.restore(be,W):void 0,items:Be,onPick:W=>{j(W),P(!1)},compare:Le&&Le.status==="candidate"&&Le.prior?{on:N,toggle:()=>P(W=>!W)}:void 0}:null,composer:{placeholder:Ft.placeholder,label:Ft.label,action:Ft.action,scope:Oe,hint:null,why:Ft.off??void 0,error:$??D,disabled:en,working:!!re&&!!re.activeView&&(ye==null?void 0:ye.id)!=="name",onStop:re!=null&&re.activeView?()=>void ae.stop():void 0,stopping:ae.stopping,focusKey:ye&&!(ye.id==="agree"&&!g.saying)?`${ye.id}:${(re==null?void 0:re.id)??"setup"}:${z}:${g.saying??""}:${g.says}`:void 0,onAttach:!Jt&&!re&&(ye==null?void 0:ye.id)==="source"?()=>ce({source:{door:"photos",via:"taps"}}):void 0,onAttachFiles:Jt?mt:void 0,attachLabel:Jt?yoe(g,Jt):"Add photos",refs:Gt,colour:ge&&we?{hex:J,label:J?ot(J,g5(we),we):"Pick a colour",seed:(_e=ge[Math.floor(ge.length/2)])==null?void 0:_e.hex,onPick:W=>v({type:"colour",hex:W,step:oe}),onClear:()=>v({type:"colour",hex:null,step:oe})}:null},text:g.text,onText:W=>v({type:"text",text:W}),onSend:Fe,onAnswer:cn,onRestore:(W,pe)=>{j(W),ae.restore(W,pe)},onEdit:pt,onSaveEdit:xt,onCancelEdit:At,onDescribe:Kt,onAttachRef:mt,onStarter:W=>{(ye==null?void 0:ye.id)==="agree"&&v({type:"say",id:"keep"}),v({type:"text",text:W})},onPaste:re?void 0:W=>void tt(W)}}}function xoe({onClose:e,...t}){const n=boe(t),r=n.d;s.useEffect(()=>_h({open:n.open}),[n.open]),s.useEffect(()=>()=>_h(null),[]);const[a,i]=s.useState(!1),l=()=>{if(n.unsaved){i(!0);return}e()},u=n.begun?r?o.jsx(Wn,{label:"Start over",tone:"quiet",title:"Start over?",body:`This conversation begins again from the first question. ${eA(r)?"The views drawn so far are kept: the unfinished presenter stays on your wall.":"Nothing has been drawn yet, so nothing is kept."}`,open:n.confirming==="start-over"||void 0,busy:!1,onOpenChange:g=>{g||n.setConfirming(null)},onConfirm:()=>void n.startOver()}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void n.startOver(),children:"Start over"}):null,f=o.jsx(o.Fragment,{children:n.keepPrevious&&n.slot&&o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",bn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]})}),h=o.jsx(Wn,{label:"Change it",title:vae,body:(r==null?void 0:r.source)==="photos"?yae:wae,busy:!1,open:n.confirming==="redraw",onOpenChange:g=>{g||n.setConfirming(null)},onConfirm:n.confirmEdit}),p=o.jsxs(o.Fragment,{children:[h,o.jsx(Wn,{label:"Leave",title:"Leave without drawing them?",body:"Nothing has been drawn yet, so the answers are not kept. Starting again starts from the first question.",busy:!1,open:a,onOpenChange:g=>{g||i(!1)},onConfirm:()=>{i(!1),n.leave(),e()}})]});return o.jsx(hw,{surface:{...n.surface,headAction:u,dock:f,overlay:p},onClose:l})}function koe(){const{draftId:e=null}=Bs(),{key:t}=Zn(),{brand:n}=on(),r=Dn(),{announce:a,caps:i}=Av();Sc("Create presenter");const l=s.useRef(!1);s.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const u=s.useCallback((p,g=!1)=>r(zi(n,p),{replace:g}),[r,n]),f=s.useCallback(()=>r(zi(n),{replace:!0}),[r,n]),h=s.useCallback(()=>r(qi(n),{replace:!0}),[r,n]);return o.jsx(xoe,{draftId:e,convoKey:e??t,onOpenDraft:u,onLeaveDraft:f,onClose:h,onStarted:p=>{a(p),l.current&&r(p.kind==="presenter"?ha(n,p.id):qi(n),{replace:!0})},caps:i})}const D5=1e3,Soe=3;function Eoe(e,t,n){return{name:e.name.trim()||t.name,prompt:t.prompt,lighting:t.lighting,description:t.description,subject:t.subject,camera:t.camera??"",figure:t.figure??"",figureTreatment:t.figureTreatment??"",keywords:t.keywords??[],collections:t.collections??[],verticals:t.verticals??[],...t.promptName?{promptName:t.promptName}:{},instruction:e.place.trim(),refHashes:e.pictures,...n?{previewHash:n}:{}}}function Coe(e){var P,$;const{s:t,dispatch:n,brandId:r,sceneId:a,conversation:i,applyBrand:l}=e,[u,f]=s.useState(!1),[h,p]=s.useState(!1),g=s.useRef(t);g.current=t;const v=s.useRef(!1),w=s.useRef(e.onSaved);w.current=e.onSaved;const y=s.useCallback(async(M,C={})=>{if(!(v.current||g.current.job)){v.current=!0;try{const R=g.current,T=Or(R),H=M==="make"?{kind:M,instruction:R.place,imageHashes:R.pictures,draw:C.draw??!1,...C.shot?{shot:!0}:{}}:M==="again"?{kind:M,reading:T==null?void 0:T.reading,imageHashes:R.pictures}:{kind:M,reading:T==null?void 0:T.reading,ask:C.ask,from:(T==null?void 0:T.hash)??void 0,imageHashes:R.pictures,draw:C.draw},D=R.name.trim()||(T==null?void 0:T.reading.name)||void 0,{jobId:K,job:O}=await Re.startSceneStudioJob(r,{...H,conversation:i,...a?{sceneId:a}:{},...D?{label:D}:{}});n({type:"started",id:K,kind:O.kind,ask:O.kind===M?C.ask:void 0,since:O.phaseAt})}catch(R){n({type:"error",text:String((R==null?void 0:R.message)??R)})}finally{v.current=!1}}},[r,n]),x=t.named?t.name.trim():"",k=((P=t.job)==null?void 0:P.id)??null;s.useEffect(()=>{!k||!x||Re.labelSceneStudioJob(r,k,x).catch(()=>{})},[k,x,r]);const S=(($=t.job)==null?void 0:$.id)??null;s.useEffect(()=>{if(!S)return;let M=!0,C=0,R;const T=async()=>{try{const H=await Re.sceneStudioJob(r,S);if(!M)return;C=0,f(!1),H.status==="running"?(n({type:"progress",job:H}),R=setTimeout(T,D5)):n({type:"finished",job:H})}catch(H){if(!M)return;if((H==null?void 0:H.status)===404){n({type:"lost",id:S,error:Ne.lost});return}C++,C>=Soe&&f(!0),R=setTimeout(T,Math.min(D5*2**Math.min(C,3),8e3))}};return T(),()=>{M=!1,clearTimeout(R)}},[S,r,n]);const E=s.useCallback(()=>{const M=g.current.job;!M||M.stopping||(n({type:"stopping",id:M.id}),Re.cancelSceneStudioJob(r,M.id).catch(()=>{}))},[r,n]),j=s.useCallback(M=>{const C=uee(g.current,M);C>=0&&n({type:"put-back",index:C})},[n]),N=s.useCallback(async(M={})=>{var D,K,O,Z,te;const C=g.current,R=((D=Or(C))==null?void 0:D.reading.name)||((O=(K=C.job)==null?void 0:K.pending)==null?void 0:O.name)||"",T={...C,name:C.name.trim()||R},H=iee(T);if(!(!H.can||!H.words||v.current)){v.current=!0,p(!0);try{const B=((Z=C.job)==null?void 0:Z.phase)==="drawing"?C.job.id:null,F=B?null:((te=Or(C))==null?void 0:te.hash)??null,X=Eoe(T,H.words,F),z=a&&!M.asNew?await Re.updateScene(r,a,X):await Re.createScene(r,X);l(z.brand);const I=z.scene;if(B){const U=await Re.attachSceneStudioJob(r,B,I.id).catch(()=>null);(U==null?void 0:U.state)==="landed"&&l(U.brand)}n({type:"saved",id:I.id}),w.current({id:I.id,name:I.name,verticals:I.verticals??[]},!!M.asNew)}catch(B){n({type:"error",text:String((B==null?void 0:B.message)??B)})}finally{v.current=!1,p(!1)}}},[r,a,l,n]);return{offline:u,saving:h,start:y,stop:E,putBack:j,use:N}}const joe="scenri:scene-studio:",Aoe=10080*60*1e3;function Noe(e){const t=cs.get(e);if(!t)return null;try{const n=JSON.parse(t);return nM(typeof(n==null?void 0:n.session)=="string"?n.session:null)}catch{return null}}function Moe(e,t,n){cs.set(e,JSON.stringify({at:Date.now(),sceneId:n,session:t}))}function Roe(e){const t=e.trim();if(!t)return"A shot";if(t.length<=60)return t;const n=t.slice(0,60);return`${n.slice(0,Math.max(n.lastIndexOf(" "),40)).trim()}…`}function p8(e){cs.del(e)}function Poe(e=Date.now()){var t;for(const n of cs.keys(joe)){let r=0;try{r=Number((t=JSON.parse(cs.get(n)??"null"))==null?void 0:t.at)||0}catch{}e-r>Aoe&&cs.del(n)}}function Loe(e){var en,Jt,se,oe,we;const{brand:t,applyBrand:n,sceneId:r,seed:a,conversation:i,storageKey:l,caps:u}=e,f=r&&a?{name:a.name}:null,[h]=s.useState(()=>{Poe();const ge=Noe(l);return ge||Ii(l),ge}),[p,g]=s.useReducer(eee,null,()=>(h==null?void 0:h.setup)??JJ),[v,w]=s.useReducer(oee,null,()=>(h==null?void 0:h.studio)??a??GN),[y,x]=s.useState(0),[k,S]=s.useState(""),E=s.useRef(null),[j,N]=s.useState(!1),[P,$]=s.useState(void 0),[M,C]=s.useState(null),R=s.useRef(!1),T=s.useRef(p);T.current=p;const H=s.useRef(v);H.current=v;const[D,K]=s.useState(null),O=s.useRef(e.onSaved);O.current=e.onSaved;const Z=Coe({s:v,dispatch:w,brandId:t.id,sceneId:r,conversation:i,applyBrand:n,onSaved:(ge,J)=>O.current(ge,r&&!J?"updated":"created")});s.useEffect(()=>{R.current||Moe(l,Dee(p,v),r??v.saved)},[p,v,l,r]);const te=v.saved,B=te?Hh(t,te):void 0,F=QM(t.id,te,(B==null?void 0:B.previewUrl)??null),X=((en=F.job)==null?void 0:en.status)==="running",[z,I]=s.useState(!1);s.useEffect(()=>{X||I(!1)},[X]);const U=s.useMemo(()=>lA(B==null?void 0:B.examples,F.job),[B==null?void 0:B.examples,F.job]),G=s.useRef(e.onDone);G.current=e.onDone;const ne=s.useMemo(()=>{var J,Oe;if(!te)return;const ge=(B==null?void 0:B.examples)??[];return{tiles:U,running:X,read:F.read,who:((J=ge[0])==null?void 0:J.with)??((Oe=F.job)==null?void 0:Oe.subject.kind)??((B==null?void 0:B.subject)==="person"||B!=null&&B.figure?"presenter":"product"),noSubject:F.read&&!F.job&&!ge.length&&F.more.length===0,missing:$K(F.more,ge,F.job),first:F.first,stale:F.first.length>0&&ge.length>0,finish:e.finish}},[te,B,U,X,F.read,F.job,F.first,F.more,e.finish]),q=s.useCallback(ge=>{te&&(C(null),Re.drawSceneExamples(t.id,te,ge).then(()=>F.again()).catch(J=>C(String((J==null?void 0:J.message)??J))))},[t.id,te,F.again]),le=s.useCallback(()=>{te&&(R.current=!0,p8(l),Ii(l),G.current(te))},[te,l]),[Se,Q]=s.useState(null);s.useEffect(()=>{f||p.editing||!jk(p.answers)||w({type:"inputs",place:XJ(p.answers),pictures:QJ(p.answers)})},[p.answers,p.editing,f]);const xe=s.useRef(new Set),ee=aee(v,!f&&jk(p.answers));s.useEffect(()=>{var ge;ee===null||xe.current.has(ee)||(xe.current.add(ee),Z.start("make",{draw:!1,shot:((ge=T.current.answers.source)==null?void 0:ge.door)==="shot"}))},[ee,Z.start]);const[ae,re]=s.useState(""),_=Qv(t.id,ae,!f),ue=s.useRef(_);ue.current=_;const We=s.useRef([]);_.settled&&!_.error&&(We.current=_.items);const Xe=_.settled?_.items:We.current,ze=!_.error&&(!_.settled||_.loading),{recent:tt,loaded:ce}=on(),[ve,Pe]=s.useState(null);s.useEffect(()=>{!ae.trim()&&_.settled&&!_.error&&Pe(_.items.length>0)},[ae,_.settled,_.error,_.items.length]);const de=ve??(tt.length>0?!0:ce?!1:null),je=s.useMemo(()=>({any:de,items:Xe.map(ge=>({id:ge.id,hash:ge.images[0],alt:Roe(ge.promptHead)})),query:ae,more:_.settled&&_.hasMore,loading:ze,error:_.error}),[de,Xe,ae,_.settled,_.hasMore,ze,_.error]),Ue=Rn().scenes,ye=s.useCallback(async ge=>{var Ge,me,_e;const J=We.current.find(W=>W.id===ge)??_.items.find(W=>W.id===ge);if(!(J!=null&&J.images[0]))return;const Oe=T.current.revision;let Be=Tk(J.brief);if(!Be&&J.kind==="edit"){const W=await Re.lineage(J.id).catch(()=>null);if(Be=Tk((Ge=W==null?void 0:W.ancestors.find(pe=>pe.kind==="generation"))==null?void 0:Ge.brief),T.current.revision!==Oe)return}const Ve=Be?((me=Hh(t,Be))==null?void 0:me.name)??((_e=Ue.find(W=>W.id===Be))==null?void 0:_e.name):void 0;Nt({shot:{id:J.id,hash:J.images[0],...Be&&Ve?{scene:{id:Be,name:Ve}}:{}},reuse:void 0})},[t,Ue,_.items]),Ee=s.useCallback(()=>{var J;const ge=(J=T.current.answers.shot)==null?void 0:J.scene;ge&&(R.current=!0,p8(l),Ii(l),G.current(ge.id,{existing:!0}))},[l]),be=(u==null?void 0:u.canDraw)??!0,Le=Z.offline?Ne.offline:M,Qe={setup:p,studio:v,canDraw:be,uploading:y,edit:f,editingName:j,note:Le,stale:YN(v),shots:je,set:ne},Ke=s.useMemo(()=>Ree(Qe),[p,v,be,y,j,Le,f,je,ne]),nt=(()=>{const ge=Ke[Ke.length-1];return(ge==null?void 0:ge.kind)==="question"?ge.question:null})(),gt=Tee(Qe,nt),Pt=s.useCallback(async ge=>{var Ge,me,_e;const J=ge.filter(W=>W.type.startsWith("image/")||/\.(heic|heif)$/i.test(W.name));if(!J.length){C(Ne.onlyPictures);return}((Ge=T.current.answers.source)==null?void 0:Ge.door)!=="photos"&&g({type:"answer",patch:{source:{door:"photos"}}});const Ve=4-(((me=T.current.answers.photos)==null?void 0:me.hashes)??[]).length;if(Ve<=0){C(Ne.fourPictures);return}C(J.length>Ve?Ne.fourPictures:null),x(W=>W+1);try{for(const W of J.slice(0,Ve))try{const pe=await P0(W),Ie=((_e=T.current.answers.photos)==null?void 0:_e.hashes)??[];g({type:"photos",hashes:[...Ie,pe]})}catch(pe){C(`${W.name} could not be added: ${String((pe==null?void 0:pe.message)??pe)}`)}}finally{x(W=>W-1)}},[]),Ut=(ge,J,Oe)=>g({type:"aside",aside:{said:ge,reply:J,q:Oe,at:Wh()}}),Nt=s.useCallback(ge=>{const J=T.current,Oe=J.held??J.answers;J.editing&&Rk(H.current)&&JSON.stringify(Bv(Oe,ge))!==JSON.stringify(Oe)&&w({type:"forget-record"}),g({type:"answer",patch:ge})},[]),cn=s.useRef(U);cn.current=U;const Fe=s.useCallback((ge,J)=>{var Oe,Be;if(C(null),ge==="photos"&&J.kind==="photos"){const Ve=J.action,Ge=((Oe=T.current.answers.photos)==null?void 0:Oe.hashes)??[];Ve.type==="add"?Pt(Ve.files):Ve.type==="instead"?Nt({source:{door:"shot"}}):Ve.type==="remove"?g({type:"photos",hashes:Ge.filter(me=>me!==Ve.hash)}):Ve.type==="reject"?C(Ne.onlyPictures):Ve.type==="submit"&&Ge.length?Nt({photos:{hashes:Ge,done:!0}}):Ve.type==="back"&&Nt({source:{door:"guided"}});return}if(ge==="shot"&&J.kind==="pick"){const Ve=J.action;Ve.type==="pick"?ye(Ve.id):Ve.type==="query"?re(Ve.text):Ve.type==="more"?ue.current.loading||ue.current.loadMore():Ve.type==="back"&&(re(""),Nt({source:{door:"photos"},photos:{hashes:[],done:!1}}));return}if(ge==="reuse"&&J.kind==="choice"&&J.id==="use"){Ee();return}if(Ck(ge)){const Ve=qJ(ge,J,T.current.answers);Ve&&Nt(Ve);return}if(ge==="retry"){Z.start("make",{draw:!1,shot:((Be=T.current.answers.source)==null?void 0:Be.door)==="shot"});return}if(J.kind==="confirm"){if(ge==="set-start"){J.id==="draw-set"?(w({type:"set-drawn"}),q({first:!0})):w({type:"set-declined"});return}if(ge==="set-more"){J.id==="more"?(w({type:"ask-more"}),q({more:!0})):w({type:"decline-more"});return}if(ge==="set-done"){J.id==="retry-failed"?q({roles:cn.current.filter(Ve=>Ve.state==="failed").map(Ve=>Ve.role)}):le();return}J.id==="draw"||J.id==="again"?Z.start("again"):J.id==="use"?Z.use():J.id==="another-shot"&&At.current("shot")}},[Pt,Nt,Z.start,Z.use,q,le,ye,Ee]),pt=ge=>{ge.trim()?!E.current&&gt.target.kind!=="off"&&(E.current=gt.target):E.current=null,S(ge)},it=ge=>{const J=St(ge);return J&&(E.current=null,S("")),J};function St(ge){var J;{const Oe=ge.trim();if(!Oe)return!1;C(null);const Be=E.current??gt.target;if(Be.kind==="source"){if(eM(Oe))return Nt({source:{door:"words",text:Oe.slice(0,400)}}),!0;const Ve=ZJ(Oe),Ge=Object.keys(Ve);return Ge.length>0?(Nt({source:{door:"guided"},...Object.fromEntries(Ge.map(me=>[me,{pick:Ve[me]}]))}),!0):(Ut(Oe,Ik(Fk(Oe,"source")??"vague","source"),"source"),!0)}if(Be.kind==="row"&&Kh(Be.id)){const Ve=Fk(Oe,"row");if(Ve)return Ut(Oe,Ik(Ve,"row"),Be.id),!0;const Ge=(J=T.current.answers[Be.id])==null?void 0:J.pick;return Nt({[Be.id]:{...Ge?{pick:Ge}:{},words:Oe.slice(0,200)}}),!0}if(Be.kind==="name")return w({type:"name",text:qN(Oe)??Oe}),!0;if(Be.kind==="add"||Be.kind==="change"){if(v.job)return!1;const Ve=yee(Oe),Ge=Mee(v);return Ve.kind==="rename"?(w({type:"name",text:Ve.name}),Ut(Oe,Ne.renamed(Ve.name),Ge),!0):Ve.kind!=="change"?(Ut(Oe,Ve.say,Ge),Ve.kind!=="refuse"):(Be.kind==="add"?Z.start("change",{ask:Oe,draw:!1}):bee(v,Oe)?Z.start("again"):Z.start("change",{ask:Oe}),!0)}return!1}}const xt=s.useCallback(ge=>{v.job||(ge==="name"?N(!0):Ck(ge)&&(ge==="shot"&&re(""),Rk(v)?K(ge):g({type:"edit",id:ge})))},[v]),At=s.useRef(xt);At.current=xt;const Kt=s.useCallback((ge,J)=>{ge==="name"&&(J.trim()&&w({type:"name",text:J.trim()}),N(!1))},[]),et=s.useCallback(()=>{N(!1),g({type:"cancel-edit"})},[]),mt=Or(v),ot=X&&F.job?gv({status:F.job.status,step:F.job.current,done:F.job.done.length,total:F.job.roles.length,error:F.job.error}):void 0,kn=v.job?Yg(v):Z.saving?"Saving":ot,ut=[];let Gt=null;if(te){const ge=X?(Jt=F.job)==null?void 0:Jt.current:null,J=((se=[...U].reverse().find(Ve=>Ve.state==="shown"))==null?void 0:se.role)??null,Oe=Se??ge??J??"place";ut.push({view:"place",label:"The place",state:Oe==="place"?"current":"approved",hash:(mt==null?void 0:mt.hash)??void 0,photo:!1,drawing:!1,approved:!0,error:!1});for(const Ve of U)ut.push({view:Ve.role,label:tc[Ve.role],state:Oe===Ve.role?"current":Ve.state==="shown"?"approved":"todo",hash:Ve.hash,photo:!1,drawing:Ve.state==="drawing",approved:Ve.state==="shown",error:Ve.state==="failed"});const Be=ut.find(Ve=>Ve.view===Oe)??ut[0];Gt={hash:Be.hash,drawing:Be.drawing}}const Ft=!f&&(!!p.answers.source||v.versions.length>0);return{title:f?Ne.editTitle:Ne.title,turns:Ke,working:kn,busy:Z.saving,resumed:!!h,memoryKey:l,stage:Gt?{hash:Gt.hash,alt:`${v.name.trim()||(mt==null?void 0:mt.reading.name)||"The scene"}, in use`,drawing:Gt.drawing||!!v.job&&v.job.phase==="drawing",doing:ot??Yg(v),items:ut,onPick:ge=>Q(ge)}:{hash:(mt==null?void 0:mt.hash)??void 0,alt:`Preview of ${v.name.trim()||(mt==null?void 0:mt.reading.name)||"the scene"}`,drawing:!!v.job&&v.job.phase==="drawing",since:((oe=v.job)==null?void 0:oe.since)??void 0,doing:Yg(v),takes:v.job?void 0:lee(v),onTake:Z.putBack,items:[]},composer:{placeholder:gt.placeholder,label:gt.label,action:gt.action,disabled:gt.target.kind==="off",why:gt.target.kind==="off"&&gt.target.why||null,working:gt.working,onStop:v.job?Z.stop:X&&te?()=>{I(!0),Re.stopSceneExamples(t.id,te).then(()=>F.again()).catch(()=>{})}:void 0,stopping:!!((we=v.job)!=null&&we.stopping)||z,focusKey:P,onAttachFiles:gt.attach?ge=>void Pt(ge):void 0,attachLabel:Ne.attachLabel},text:k,onText:pt,onSend:it,onAnswer:Fe,onEdit:xt,onSaveEdit:Kt,onCancelEdit:et,confirmingEdit:D!==null,confirmEdit:()=>{D&&g({type:"edit",id:D}),K(null)},cancelConfirm:()=>K(null),onRestore:(ge,J)=>Z.putBack(J),onRetry:ge=>q({roles:[ge]}),onDescribe:()=>$(String(Date.now())),onStarter:ge=>{pt(ge),$(String(Date.now()))},onPaste:(nt==null?void 0:nt.id)==="source"||(nt==null?void 0:nt.id)==="photos"?ge=>void Pt(ge):void 0,canDraw:be,begun:Ft,unsaved:v.saved?!1:f?xee(v,a):Ft,running:!!v.job||X,saved:!!te,finish:le,keptAsDraft:!f&&XN(v),leave:()=>{Z.stop(),R.current=!0,p8(l),Ii(l)}}}function Toe({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onClose:u,onStartOver:f,onSaved:h,onDone:p,finish:g}){const v=Loe({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onSaved:h,onDone:p,finish:g}),[w,y]=s.useState(!1),x=v.turns[v.turns.length-1],k=(x==null?void 0:x.kind)==="question"?x.question.id:null;s.useEffect(()=>_h({open:k}),[k]),s.useEffect(()=>()=>_h(null),[]);const S=!!n,E=()=>{if(v.saved){v.finish();return}if(v.running||v.keptAsDraft){u();return}if(v.unsaved){y(!0);return}v.leave(),u()},j=!S&&v.begun&&!v.saved?o.jsx(Wn,{label:Ne.startOver,tone:"quiet",title:Ne.startOverTitle,body:Ne.startOverBody,busy:!1,onConfirm:()=>{v.leave(),f()}}):null;return o.jsx(hw,{onClose:E,surface:{kind:"scene",glyph:o.jsx(vj,{size:32}),title:v.title,turns:v.turns,busy:v.busy,working:v.working,memoryKey:v.memoryKey,resumed:v.resumed,stage:v.stage,stageEmpty:{lead:Ne.emptyLead,hint:Ne.emptyHint},composer:v.composer,text:v.text,onText:v.onText,onSend:v.onSend,onAnswer:v.onAnswer,onEdit:v.onEdit,onSaveEdit:v.onSaveEdit,onCancelEdit:v.onCancelEdit,onRestore:v.onRestore,onRetry:v.onRetry,onDescribe:v.onDescribe,onStarter:v.onStarter,onPaste:v.onPaste,headAction:j,overlay:o.jsxs(o.Fragment,{children:[o.jsx(Wn,{label:Ne.changeIt,title:Ne.changeTitle,body:Ne.changeBody,busy:!1,open:v.confirmingEdit,onOpenChange:N=>{N||v.cancelConfirm()},onConfirm:v.confirmEdit}),o.jsx(Wn,{label:S?Ne.discard:Ne.leave,title:S?Ne.discardTitle:Ne.leaveTitle,body:S?Ne.discardBody:Ne.leaveBody,busy:!1,open:w,onOpenChange:N=>{N||y(!1)},onConfirm:()=>{y(!1),v.leave(),u()}})]})}})}const H5=e=>{const t=/^asset:([a-f0-9]{32})$/.exec(String(e??""));return t?t[1]:null};function $oe(e,t){var l;const r=(((l=e.json)==null?void 0:l.scenes)??[]).find(u=>(u==null?void 0:u.id)===t);if(!r)return null;const a={name:String(r.name??""),prompt:String(r.prompt??""),lighting:String(r.lighting??""),subject:r.subject==="product"||r.subject==="person"?r.subject:"either",description:String(r.description??""),...r.promptName?{promptName:String(r.promptName)}:{},...r.camera?{camera:String(r.camera)}:{},...r.figure?{figure:String(r.figure)}:{},...r.figure&&r.figureTreatment?{figureTreatment:String(r.figureTreatment)}:{},...Array.isArray(r.keywords)?{keywords:r.keywords.map(String)}:{},...Array.isArray(r.collections)?{collections:r.collections.map(String)}:{},...Array.isArray(r.verticals)?{verticals:r.verticals.map(String)}:{}},i=(Array.isArray(r.refs)?r.refs:[]).map(u=>H5(u==null?void 0:u.file)).filter(Boolean);return see({place:String(r.instruction??""),pictures:i.slice(0,4),reading:a,hash:H5(r.preview)??null,name:a.name})}function Doe(){return[...crypto.getRandomValues(new Uint8Array(6))].map(t=>t.toString(16).padStart(2,"0")).join("")}function O5(){const{sceneId:e=null,convoId:t=null}=Bs(),{key:n,state:r}=Zn(),{brand:a}=on(),{applyBrand:i}=Rn(),l=Dn(),{announce:u,caps:f}=Av();Sc(e?"Edit scene":"Create scene");const[h]=s.useState(()=>e?$oe(a,e):null),p=typeof(r==null?void 0:r.from)=="string"?r.from:null,g=p&&(Wi(ct.hub,p.split("?")[0])||Wi(ct.set,p.split("?")[0])),v=s.useCallback(()=>l(p??(e?_r(a,e):_u(a)),{replace:!0}),[l,p,e,a]),w=s.useMemo(()=>t??Doe(),[t,n]);s.useEffect(()=>{t||e&&!h||l(e?uv(a,e,w):Vi(a,w),{replace:!0,state:r})},[t,w,e,h,a,l,r]);const y=s.useRef(null);return e&&!h?o.jsx(uo,{to:_r(a,e),replace:!0}):o.jsx(Toe,{brand:a,applyBrand:i,sceneId:e,seed:h,conversation:w,storageKey:`scenri:scene-studio:${a.id}:${w}`,caps:f?{canRead:f.canAnalyze,canDraw:f.canGenerate}:null,onClose:v,onStartOver:()=>l(Vi(a),{replace:!0,state:r}),onSaved:(x,k)=>{y.current={made:x,how:k}},finish:g?Ne.useInAShot:Ne.openScene,onDone:(x,k)=>{var S,E;if(!(k!=null&&k.existing)){const j=Hh(a,x),N=((S=y.current)==null?void 0:S.made.id)===x?y.current.made:null;u({kind:"scene",id:x,name:(N==null?void 0:N.name)??(j==null?void 0:j.name)??"",verticals:(N==null?void 0:N.verticals)??(j==null?void 0:j.verticals)??[],how:((E=y.current)==null?void 0:E.how)??(e===x?"updated":"created")})}g&&p?l(`${p.split("?")[0]}?scene=${encodeURIComponent(x)}&compose=1`,{replace:!0}):l(_r(a,x),{replace:!0})}},w)}function FR(){const{brand:e}=on(),t=Dn(),n=mr(e);return s.useCallback(r=>{t(`${n}?product=${encodeURIComponent(r)}&compose=1`)},[n,t])}function Hoe({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDelete:u,onRename:f,bookmarked:h,onBookmark:p,chosen:g,batching:v,onPick:w,batch:y,size:x="grid"}){var S,E;const k=s.useMemo(()=>y?mm({kind:"product",count:y.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:y.onAct,onKeep:y.onKeep,allKept:y.allKept}):Ji({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:p?{on:!!h,run:()=>p(e.id)}:void 0,onRename:f?()=>f(e.id):void 0,remove:u?{label:"Delete product",run:()=>u(e.id)}:void 0}),[n,r,u,f,w,p,h,a,e.id,y]);return o.jsx(nd,{id:e.id,previewUrl:Fr((E=(S=e.shots)==null?void 0:S[0])==null?void 0:E.file),title:go(e,"tooltip"),primary:go(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:k,bookmarked:h,onBookmark:p,chosen:g,batching:v,onPick:w,size:x})}function Ooe(e){return o.jsx(Qp,{...e})}const _R=s.memo(Hoe);function Ioe({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,size:h="grid"}){const p=$0(e.category)??e.category,g=s.useMemo(()=>Ji({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0}),[n,r,f,u,a,e.id]);return o.jsx(nd,{id:e.id,previewUrl:e.previewUrl,title:`${go(e,"tooltip")} · ${p}`,primary:go(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:g,bookmarked:u,onBookmark:f,size:h})}const ZR=s.memo(Ioe),Foe=8,m8="__bookmarked";function _oe(){var Kt;const{brand:e,products:t,productsLoaded:n,refreshProducts:r}=on(),a=((Kt=VA())==null?void 0:Kt.importing)??!1,{demoProducts:i,applyBrand:l,refreshBrands:u}=Rn(),{push:f}=or(),h=n&&t.length===0,p=Dn(),g=FR(),v=ll(),{q:w,setQ:y,facets:x,setFacets:k,clearSearch:S,clear:E}=Pf(["category","bookmarked"]),j=x.category,N=x.bookmarked==="1",[P,$]=s.useState(()=>lm("product",e.id)),M=et=>$(cm("product",e.id,et)),C=ow(`${e.id}|${w}|${j??""}|${N?"1":""}`),[R,T]=fa(Dr.wallDensity,zu),H=jc(R),D=s.useCallback(et=>T(et),[T]),K=s.useMemo(()=>fm(H),[H]),O=um(H),Z=s.useMemo(()=>{const et=a?t.filter(mt=>{var ot;return(((ot=mt.shots)==null?void 0:ot.length)??0)>0}):t;return MA(et).map(mt=>({product:mt,category:jv(mt),own:!0}))},[t,a]),te=s.useMemo(()=>i.map(et=>({product:et,category:et.category,own:!1})),[i]),B=s.useMemo(()=>[...Z,...te],[Z,te]),F=s.useMemo(()=>B.reduce((et,mt)=>et+(P.includes(mt.product.id)?1:0),0),[B,P]),X=N&&F===0,z=X&&h,I=X&&!h,U=s.useMemo(()=>{const et=new Map;for(const{category:mt}of B)mt&&et.set(mt,(et.get(mt)??0)+1);return et},[B]),G=s.useMemo(()=>T0.filter(et=>U.has(et.key)),[U]),ne=B.length>0?"tabs":"none",q=s.useCallback(et=>p(la(e,et)),[p,e]),[le,Se]=s.useState(null),[Q,xe]=s.useState(!1),[ee,ae]=s.useState(null),[re,_]=s.useState(!1),[ue,We]=s.useState(null),[Xe,ze]=s.useState(!1),tt=s.useCallback(et=>{const mt=t.find(ot=>ot.id===et);mt&&Se(mt)},[t]),ce=et=>et.origin==="catalog"||et.id.startsWith("cat-"),ve=s.useCallback(et=>{const mt=t.find(ot=>ot.id===et);!mt||ce(mt)||(We(null),ae(mt))},[t]),Pe=async et=>{if(!(!ee||re)){_(!0),We(null);try{l(await Re.updateProduct(e.id,ee.id,{name:et})),ae(null)}catch(mt){const ot=nn(mt,"Could not rename this product");We([ot.title,ot.detail].filter(Boolean).join(" "))}finally{_(!1)}}},de=async()=>{if(!le||Q)return;xe(!0);const et=le.origin==="catalog"||le.id.startsWith("cat-");try{et?(await Re.deleteCatalogProduct(e.id,le.id),await r()):l(await a6(e.id,le.id)),C.forget(le.id),Se(null)}catch(mt){(mt==null?void 0:mt.status)===404?(await Promise.all([u(),r()]),C.forget(le.id),Se(null)):f(nn(mt,"Could not delete this product"))}finally{xe(!1)}},je=s.useCallback(et=>et.filter(({product:mt})=>z||!N||P.includes(mt.id)).filter(({category:mt})=>!j||mt===j).filter(({product:mt,category:ot})=>wo([Wv(mt),$0(ot)].filter(Boolean).join(" "),w)).map(({product:mt})=>mt),[j,w,N,P,z]),Ue=s.useMemo(()=>je(Z),[je,Z]),ye=s.useMemo(()=>je(te),[je,te]),{visible:Ee,remaining:be,showMore:Le}=lw(Ue,`${j??""}|${N?"keepers":""}|${w}`),[Qe,Ke]=s.useState(null);s.useEffect(()=>{if(!Qe||be<=0)return;const et=Qe.closest(".sc-home"),mt=new IntersectionObserver(ot=>{ot.some(kn=>kn.isIntersecting)&&Le()},{root:et,rootMargin:"200% 0px"});return mt.observe(Qe),()=>mt.disconnect()},[Qe,be,Le]);const nt={key:"category",label:"Category",everyLabel:"All products",everyCount:B.length,selected:N?m8:j,onSelect:et=>k(et===m8?{bookmarked:"1",category:null}:{bookmarked:null,category:et}),options:[{value:m8,label:"Keepers",count:F},...G.map(et=>({value:et.key,label:et.label,count:U.get(et.key)??0}))]},gt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v("product"),children:[o.jsx(cr,{size:12})," Add product"]}),Pt=h,Ut=t.length>0,Nt=o.jsx(gm,{title:"Products",filters:o.jsx(vm,{mode:ne,group:nt}),density:o.jsx(dm,{value:H,onChange:D}),search:B.length>=Foe&&o.jsx(id,{value:w,onChange:y,noun:"products",total:B.length})}),cn=et=>{const mt=t.find(kn=>kn.id===et);return mt&&mt.origin==="catalog"||et.startsWith("cat-")?Re.deleteCatalogProduct(e.id,et):a6(e.id,et)},Fe=()=>{const et=[...C.ids];et.length===1?tt(et[0]):ze(!0)},pt=[...C.ids],it=pt.length>0&&pt.every(et=>P.includes(et)),St=()=>$(Gv("product",e.id,pt,!it)),xt=pm(C.ids.size,it,"products"),At=async()=>{if(Q)return;const et=[...C.ids];xe(!0);try{const{failed:mt,error:ot}=await tp(et,cn);await Promise.all([u(),r()]),C.retain(mt),ze(!1),ot&&f(nn(ot,"Could not delete these products"))}finally{xe(!1)}};return o.jsx(Nf.Provider,{value:O,children:o.jsxs(is,{children:[o.jsxs("main",{className:"sc-looks sc-products",id:"main","data-hero":Pt||void 0,onClick:C.onBlank,children:[!Pt&&Nt,!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":O,style:K,"aria-hidden":!0,children:o.jsx(Ooe,{size:"grid",count:8})}),Ut&&Ee.length>0&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your products"})}),o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:Ee.map(et=>o.jsx(_R,{product:et,variant:"use",size:"grid",onOpen:q,href:la(e,et.id),onUse:g,bookmarked:P.includes(et.id),onBookmark:M,onDelete:tt,onRename:ce(et)?void 0:ve,chosen:C.ids.has(et.id),batching:C.batching==="product",onPick:C.picking("product")?mt=>C.toggle("product",mt):void 0,batch:C.kind==="product"&&C.ids.has(et.id)?{count:C.ids.size,onAct:Fe,onKeep:St,allKept:it}:null},et.id))}),be>0&&o.jsx("div",{ref:Ke,"aria-hidden":!0}),be>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Le,children:["Show ",Math.min(be,60)," more"]})}),ee&&o.jsx(sw,{title:"Rename product",name:ee.name,maxLength:500,busy:re,error:ue,onConfirm:et=>void Pe(et),onDismiss:()=>{re||ae(null)}}),le&&o.jsx(Wn,{label:"Delete product",title:`Delete ${le.name}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",open:!0,busy:Q,onOpenChange:et=>{!et&&!Q&&Se(null)},onConfirm:()=>void de()}),Xe&&o.jsx(Wn,{label:qr("product",C.ids.size).menu,title:`${qr("product",C.ids.size).menu}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",open:!0,busy:Q,onOpenChange:et=>{!et&&!Q&&ze(!1)},onConfirm:()=>void At()})]}),Pt&&o.jsx(oo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Bring in a ",o.jsx("em",{children:"product"})]}),body:"Upload a few clean shots, or import your store, and it stays exact in every image you make.",action:gt}),Ut&&Ee.length>0&&ye.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri products"})}),Pt&&te.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{label:"Or borrow one of ours"}),Nt]}),ye.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":O,style:K,children:ye.map(et=>o.jsx(ZR,{product:et,variant:"use",size:"grid",onUse:g,onOpen:q,href:la(e,et.id),bookmarked:P.includes(et.id),onBookmark:M},et.id))}),n&&I&&o.jsx(oo,{shape:"zero",body:"Nothing in Keepers yet. Add a product to Keepers from its card and it stays here.",action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>k({bookmarked:null}),children:"Browse every product"})}),n&&!I&&Ue.length===0&&ye.length===0&&o.jsx(wm,{noun:"products",q:w,facet:N?"Keepers":j?$0(j):null,onClearSearch:S,onClearAll:E})]}),o.jsxs("div",{className:"sc-wall-dock",children:[C.kind==="product"&&C.ids.size>0&&o.jsx(aw,{count:C.ids.size,loaded:Ee.length,tool:qr("product",C.ids.size).tool,icon:qr("product",C.ids.size).icon,danger:!0,onAct:Fe,keep:{label:xt.tool,filled:it,onAct:St},onClear:C.clear,onSelectAll:()=>C.selectAll("product",Ee.map(et=>et.id))}),o.jsx(rw,{})]})]})})}function Zoe({value:e,onChange:t}){const n=$0(e)??"Other",r=e&&T0.some(a=>a.key===e)?e:"other";return o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost sc-catpick","aria-label":`Category: ${n}`,children:[n,o.jsx(Yi,{size:11,weight:"bold"})]})}),o.jsx(Cs,{align:"center",sideOffset:8,children:o.jsx(Rh,{value:r,children:T0.map(a=>o.jsx(gu,{value:a.key,onSelect:()=>t(a.key),children:a.label},a.key))})})]})}function Voe({refs:e,cap:t,note:n,addLabel:r,busy:a,onAdd:i,onPromote:l,onRemove:u}){const[f,h]=s.useState(null),p=s.useMemo(()=>e.find(N=>N.file===f)??e[0],[e,f]);s.useEffect(()=>{var N;e.length&&!e.some(P=>P.file===f)&&h(((N=e[0])==null?void 0:N.file)??null)},[e,f]);const g=p?e.findIndex(N=>N.file===p.file):-1,v=!!l&&g>0,w=!!u&&!!p&&e.length>1,y=!!(r&&i&&e.length>0),x=e.length>1||y,{shellRef:k,railRef:S,page:E}=XM(e.length),j=N=>{const P=N==null?void 0:N[0];P&&(i==null||i(P))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-refstage",children:p?o.jsx("div",{className:"sc-refstage-frame",children:o.jsx("img",{src:p.url,alt:""})}):i?o.jsxs("label",{className:"sc-refstage-blank sc-refstage-drop","data-busy":a||void 0,onDragOver:N=>{N.preventDefault(),N.dataTransfer.dropEffect="copy"},onDrop:N=>{N.preventDefault(),j(N.dataTransfer.files)},children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(xr,{size:"2"}):o.jsx(cr,{size:22,weight:"bold"}),o.jsx("span",{children:"Add a reference"})]}):o.jsx("span",{className:"sc-refstage-blank",children:o.jsx(Ws,{size:22})})}),x&&o.jsxs("div",{className:"sc-refrail-shell",ref:k,children:[o.jsxs("div",{className:"sc-refrail-track",children:[o.jsx("button",{type:"button",className:"sc-refrail-arrow prev","aria-label":"Previous references",onClick:()=>E(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-refrail-arrow next","aria-label":"Next references",onClick:()=>E(1),children:o.jsx(ol,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-refrail",ref:S,children:e.map((N,P)=>o.jsx("button",{type:"button",className:"sc-refrail-item","data-on":(p==null?void 0:p.file)===N.file?"":void 0,"data-spare":P>=t?"":void 0,"aria-label":`Reference ${P+1}`,"aria-pressed":(p==null?void 0:p.file)===N.file,onClick:()=>h(N.file),children:o.jsx("img",{src:N.url,alt:"",loading:"lazy"})},N.file))})]}),y&&o.jsxs("label",{className:"sc-refrail-item sc-refrail-add","data-busy":a||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(xr,{size:"1"}):o.jsx(cr,{size:16,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:r})]})]}),(v||w)&&o.jsx("div",{className:"sc-refacts",children:o.jsxs("span",{className:"sc-refacts-pair",children:[v&&o.jsxs("button",{type:"button",className:"sc-refact sc-refact-lead",onClick:()=>l==null?void 0:l(p.file),children:[o.jsx(PU,{size:14,weight:"bold"}),"Use first"]}),w&&o.jsx("button",{type:"button",className:"sc-refact sc-refact-aside",onClick:()=>u==null?void 0:u(p.file),children:"Remove"})]})}),o.jsx("p",{className:"sc-lookpage-note",children:n})]})}function zoe({value:e,onChange:t,onBlur:n,label:r,placeholder:a,className:i="sc-lookpage-titleedit"}){const l=s.useRef(null),u=f=>{f&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)};return s.useEffect(()=>u(l.current),[e]),o.jsx("textarea",{ref:l,className:i,rows:1,dir:"auto","aria-label":r,placeholder:a,value:e,onChange:f=>{u(f.currentTarget),t(f.target.value)},onBlur:n,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),f.currentTarget.blur())}})}function Boe({size:e,busy:t,error:n,onSave:r,onDismiss:a}){const i=(e==null?void 0:e.by)==="person"?e.text:"",[l,u]=s.useState(i),f=l.trim(),h=()=>{if(!t){if(f===i)return a();r(f)}},p=(e==null?void 0:e.by)==="person"?"Yours. Leave it empty to go back to the size read from its photo.":(e==null?void 0:e.by)==="record"?"From your store's listing. Write another to use yours instead.":e?"Read from its photo, so a shot keeps it at its real size. Correct it if it is off.":"Not read yet. Write it the way a shop lists it.";return o.jsxs(Ts,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ds,{className:"sc-newdlg-title",children:"Details"}),o.jsx(As,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Size"}),o.jsx("input",{className:"sc-pdetails-field",value:l,placeholder:e&&e.by!=="person"?e.text:"About 2 cm across, or 30 x 20 cm",onChange:g=>u(g.target.value),onKeyDown:g=>g.key==="Enter"&&h()}),o.jsx("span",{className:"sc-pdetails-hint",children:p})]}),n&&o.jsx("p",{className:"sc-assetform-err",children:n})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-busy":t||void 0,onClick:h,children:t?"Saving":"Save"})]})]})}const Uoe=3;function Woe(e){const t=e,n=(t.brand??t.vendor??"").trim();return!n||e.name.toLowerCase().startsWith(n.toLowerCase())?null:n}function Koe(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/\s+/g," ").trim()}function Goe(e,t){if(e.length<=t)return e;const n=e.slice(0,t+1).search(/[.!?](\s|$)/);if(n>40)return e.slice(0,n+1);const r=e.lastIndexOf(" ",t);return`${e.slice(0,r>40?r:t).trimEnd()}…`}function Yoe(){var Ee;const{productId:e=""}=Bs(),{brand:t,products:n,refreshProducts:r}=on(),{demoProducts:a,demoProductsLoaded:i,applyBrand:l,refreshBrands:u}=Rn(),f=Dn(),h=FR(),{push:p}=or(),[g,v]=s.useState(!1),[w,y]=s.useState(!1),[x,k]=s.useState(null),S=s.useRef(null),E=s.useRef({}),j=s.useRef(!1),N=ym(),P=n.find(be=>be.id===e),[$,M]=s.useState(null);s.useEffect(()=>{if((P==null?void 0:P.origin)!=="catalog"){M(null);return}let be=!0;return Re.libraryProduct(t.id,P.id).then(Le=>{be&&M(Le.product)}).catch(()=>{}),()=>{be=!1}},[t.id,P]);const C=$&&P&&$.id===P.id?{...$,...P,shots:$.shots}:P,R=s.useMemo(()=>C?void 0:a.find(be=>be.id===e),[C,a,e]);Sc((Ee=C??R)==null?void 0:Ee.name);const[T,H]=s.useState([]);s.useEffect(()=>{if(!R){H([]);return}let be=!0;return Re.demoProductFrames(R.id).then(Le=>{be&&H(Le.frames)}).catch(()=>{be&&H([])}),()=>{be=!1}},[R==null?void 0:R.id]);const[D,K]=s.useState((C==null?void 0:C.name)??"");s.useEffect(()=>{K((C==null?void 0:C.name)??"")},[C==null?void 0:C.id]);const O=cw(t.id,[e??""]),[Z,te]=s.useState(null),[B,F]=s.useState(!1),[X,z]=s.useState(!1),[I,U]=s.useState(null),G=!!(C??R);s.useEffect(()=>{if(te(null),!G||!e)return;let be=!0;return Re.productSize(t.id,e).then(Le=>{be&&te(Le.size)}).catch(()=>{}),()=>{be=!1}},[t.id,e,G]);const ne=async be=>{if(!e)return;const Le=N();z(!0),U(null);try{const Qe=await Re.setProductSize(t.id,e,be);Le()&&(te(Qe.size),F(!1))}catch(Qe){U(String(Qe.message??Qe))}finally{z(!1)}},q=((C==null?void 0:C.origin)??"manual")==="manual",le=async(be,Le)=>{Le&&be&&typeof be=="object"&&"json"in be?l(be):await r()},Se=be=>{if(!C||j.current)return;E.current={...E.current,...be},S.current&&clearTimeout(S.current);const Le=t.id,Qe=C.id,Ke=q;S.current=setTimeout(()=>{S.current=null;const nt=E.current;E.current={},(Ke?Re.updateProduct(Le,Qe,nt):Re.updateCatalogProduct(Le,Qe,nt)).then(Pt=>le(Pt,Ke)).catch(Pt=>k(String(Pt.message??Pt)))},500)},Q=async be=>{const Le=q;v(!0),k(null);try{await le(await be,Le)}catch(Qe){k(String(Qe.message??Qe))}finally{v(!1)}},xe=async()=>{if(!C||j.current)return;j.current=!0,S.current&&clearTimeout(S.current),S.current=null,E.current={};const be=N(),Le=Eu(t),Qe=C.origin==="catalog"||C.id.startsWith("cat-");y(!0),k(null);try{Qe?(await Re.deleteCatalogProduct(t.id,C.id),await r()):l(await a6(t.id,C.id))}catch(Ke){if((Ke==null?void 0:Ke.status)!==404){j.current=!1,be()&&(k(String(Ke.message??Ke)),y(!1));return}await Promise.all([u(),r()])}be()&&f(Le,{replace:!0})};if(!C&&!R&&!i)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-refskeleton","aria-hidden":!0,children:[o.jsx("span",{className:"sc-refskeleton-title"}),o.jsx("span",{className:"sc-refskeleton-stage"}),o.jsxs("span",{className:"sc-refskeleton-rail",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]})]}),o.jsx("p",{className:"sc-vh",role:"status",children:"Loading this product"})]})});if(!C&&!R)return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This product isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(_n,{className:"sc-btn sc-btn-primary",to:Eu(t),children:"Browse products"})})]})});const ee=R?"none":q?"full":"fields",ae=C??R,re=(C==null?void 0:C.id)??R.id,_=C?jv(C):(R==null?void 0:R.category)??null,ue=Woe(ae),We=be=>{const Le=Fr(be.file);return Le?[{file:be.file,url:Le,angle:be.angle}]:[]},Xe=R?T.map(be=>({file:be.angle,url:be.url,angle:be.angle})):((C==null?void 0:C.shots)??[]).flatMap(We),ze=be=>{const Le=Xe.map(Ke=>Ke.file),Qe=Le.indexOf(be)+1;Q(Re.setProductShots(t.id,re,Le.filter(Ke=>Ke!==be))).then(()=>p({kind:"success",title:"Reference removed",detail:`Reference ${Qe} of ${Le.length}`,action:{label:"Undo",onClick:()=>void Q(Re.setProductShots(t.id,re,Le))}}))},tt=R?"Our reference set. Yours replaces it.":Xe.length===0?q?"No reference yet.":"No reference yet. Images from your store are still arriving.":Xe.length===1?"One angle. A shot has to guess at every side it can't see.":Xe.length===2?"Two angles. A third pins the shape.":"The first three build every shot. Remove any that show a different colour or version.",ce=ee==="none"?null:"Add image",ve=C!=null&&C.descriptionHtml?Goe(Koe(C.descriptionHtml),200):"",Pe=(R==null?void 0:R.description)||ve||null,de=Z?Z.text.charAt(0).toUpperCase()+Z.text.slice(1):null,je=R?[R.subcategory,de]:[C==null?void 0:C.variant,C==null?void 0:C.material,de??(C==null?void 0:C.dimensions)],Ue=[ee==="none"?$0(_):null,...je].filter(Boolean),ye=R?a.filter(be=>be.id!==re).slice(0,8):n.filter(be=>be.id!==re).slice(0,8);return o.jsx(is,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-lookpage-crumb",children:[o.jsx(_n,{to:Eu(t),children:"Products"}),o.jsx("span",{children:"/"}),o.jsx("span",{children:R?"Scenri library":q?"Yours":"From your store"})]}),ue&&o.jsx("p",{className:"sc-lookpage-house",children:o.jsx("em",{className:"sc-accent",children:ue})}),ee==="full"?o.jsx(zoe,{label:"Product name",value:D,onChange:be=>{K(be),Se({name:be})}}):o.jsx("h1",{dir:"auto",children:ae.name}),Pe&&o.jsx("p",{className:"sc-lookpage-lede",children:Pe}),Ue.length>0&&o.jsx("p",{className:"sc-lookpage-facts",children:Ue.join(" · ")}),o.jsxs("div",{className:"sc-lookpage-acts",children:[ee!=="none"&&o.jsx(Zoe,{value:_,onChange:be=>Se({category:be})}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>h(re),children:"Use in a shot"}),ee!=="none"&&o.jsx(lr,{label:"Edit details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit details","aria-haspopup":"dialog",onClick:()=>{U(null),F(!0)},children:o.jsx(Ju,{size:17})})})]}),x&&o.jsx("p",{className:"sc-assetform-err",children:x}),o.jsx(Voe,{refs:Xe,cap:Uoe,note:tt,addLabel:ce,busy:g,onAdd:ee==="none"?void 0:be=>void Q(pW(t.id,re,be)),onPromote:ee==="none"?void 0:be=>void Q(Re.setProductShots(t.id,re,[be,...Xe.map(Le=>Le.file).filter(Le=>Le!==be)])),onRemove:ee==="none"?void 0:ze}),O.length>0&&o.jsx(Lu,{label:`Shots featuring ${ae.name}`,children:O.map(be=>o.jsx(dw,{node:be,to:Wp(t,null,be.id)},be.id))}),ye.length>0&&o.jsx(Lu,{label:R?"Other products in the library":"Other products",children:ye.map(be=>R?o.jsx(ZR,{product:be,variant:"navigate",size:"slider",onOpen:Le=>f(la(t,Le)),href:la(t,be.id)},be.id):o.jsx(_R,{product:be,variant:"navigate",size:"slider",onOpen:Le=>f(la(t,Le)),href:la(t,be.id)},be.id))}),B&&o.jsx(Boe,{size:Z,busy:X,error:I,onSave:be=>void ne(be),onDismiss:()=>F(!1)}),C&&o.jsx("div",{className:"sc-ownedbits",children:o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Wn,{label:"Delete product",title:`Delete ${C.name}?`,body:"Shots already made with it keep their images and their recipe. Only future shots lose it.",busy:w,onConfirm:()=>void xe()})})})]})})}function qoe(e,t){const n=new Map,r=[];for(const a of t){n.set(a.id,a.status);const i=e.get(a.id);if(i!==a.status){if(i===void 0){a.status==="running"&&r.push("Generating shot.");continue}a.status==="done"?r.push("Shot ready."):a.status==="error"?r.push(`Shot failed${a.error?`: ${a.error}`:"."}`):a.status==="cancelled"&&r.push("Shot cancelled.")}}return{messages:r,next:n}}const Xoe=[{label:"Generate",keys:["cmd","enter"]},{label:"Jump to the prompt",keys:["/"]},{label:"Product menu",keys:["$"]},{label:"Scene menu",keys:["/"]},{label:"Presenter menu",keys:["@"]},{label:"Colour menu",keys:["#"]},{label:"Previous or next shot",keys:["←","→"]},{label:"Previous or next in the history",keys:["↑","↓"]},{label:"Refine this shot",keys:["b"]},{label:"Keep or unkeep",keys:["k"]},{label:"Open the shot",keys:["enter"]},{label:"Close, or stop refining",keys:["esc"]},{label:"Assets panel",keys:["."]},{label:"This list",keys:["?"]}];function Qoe({open:e,onOpenChange:t}){return o.jsx(J4,{open:e,onOpenChange:t,children:o.jsxs(ev,{maxWidth:"360px","aria-describedby":void 0,children:[o.jsx(tv,{children:"Shortcuts"}),o.jsx("div",{className:"sc-keys",children:Xoe.map(n=>o.jsxs("div",{className:"sc-krow",children:[o.jsx("span",{children:n.label}),o.jsx("span",{className:"sc-ksp"}),n.keys.map(r=>o.jsx("kbd",{children:r},r))]},n.label))})]})})}const VR=new Set;function Joe(e){return VR.has(e)}function eie(e){e&&VR.add(e)}function tie({src:e,fallback:t,alt:n="",aspect:r,guess:a=!0}){const[i,l]=s.useState(!1),u=i&&t?t:e,[f,h]=s.useState(!1),[p,g]=s.useState(u);u!==p&&(g(u),h(!1));const v=s.useRef(null),w=s.useCallback(()=>{eie(u),h(!0)},[u]),y=s.useCallback(k=>{v.current=k,k!=null&&k.complete&&k.naturalWidth&&w()},[w]);s.useLayoutEffect(()=>{const k=v.current;k!=null&&k.complete&&k.naturalWidth&&w()},[w]);const x=Joe(u);return o.jsxs("span",{className:"sc-cellimg","data-loaded":f||void 0,"data-cached":x||void 0,"data-guess":a||void 0,style:r?{"--sc-cell-ar":r}:void 0,children:[!f&&!x&&o.jsx("span",{className:"sc-shimmer"}),o.jsx("img",{ref:y,src:u,alt:n,loading:x?"eager":"lazy",decoding:x?"sync":"async",onLoad:()=>w(),onError:()=>{t&&!i?l(!0):w()}})]})}function zR({name:e}){return o.jsx(Ev,{name:e})}function nie({node:e,chosen:t,picking:n,batching:r,armed:a,menu:i,onPick:l,onBranch:u,onToggleKeep:f,onArchive:h,onDelete:p}){const g=Sr(e),v=bv(),w=(x,k)=>CA(x,k,v),y=()=>{const x=e.images[0];if(!x)return;const k=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",S=document.createElement("a");S.href=Mr(x),S.download=`${k}.png`,S.click()};return o.jsxs(o.Fragment,{children:[!r&&o.jsx("span",{className:"sc-cell-veil","aria-hidden":!0}),n&&w(t?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-pick","data-on":t||void 0,"aria-pressed":t,"aria-label":t?"Deselect shot":"Select shot",onClick:()=>l==null?void 0:l(e.id),children:o.jsx(Kn,{size:13,weight:"bold"})})),a&&!n&&o.jsxs("span",{className:"sc-cell-ctl sc-cell-pick","data-on":!0,title:"Being refined",children:[o.jsx(Kn,{size:13,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:"Being refined"})]}),o.jsx("div",{className:"sc-shot-tools",children:f&&o.jsxs("div",{className:"sc-corner",children:[i.length>0&&o.jsxs(Ss,{children:[w("More",o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-more","aria-label":`More for ${g}`,children:o.jsx(jC,{size:16,weight:"bold"})})})),o.jsx(Cs,{align:"end",sideOffset:4,collisionPadding:12,children:i.map(x=>o.jsxs("span",{style:{display:"contents"},children:[x.separated&&o.jsx(Bl,{}),o.jsxs(tr,{color:x.danger?"red":void 0,onSelect:x.onSelect,children:[o.jsx(zR,{name:x.icon}),x.label]})]},x.key))})]}),u&&!r&&w("Refine",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-branch","data-on":a||void 0,"aria-label":`Refine ${g}`,onClick:()=>u(e.id),children:o.jsx(BC,{size:15,weight:"bold"})})),e.archived?p&&w("Delete permanently",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Delete ${g} permanently`,onClick:()=>p(e),children:o.jsx(il,{size:15})})):h&&w("Archive",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Archive ${g}`,onClick:()=>h(e),children:o.jsx(Op,{size:15})})),e.images[0]&&w("Download",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Download ${g}`,onClick:y,children:o.jsx(NC,{size:15})})),w(e.kept?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:`sc-cell-ctl sc-cell-keep${e.kept?" sc-cell-star":""}`,"data-on":e.kept||void 0,"aria-pressed":e.kept,"aria-label":e.kept?`Remove ${g} from Keepers`:`Add ${g} to Keepers`,onClick:()=>f(e),children:o.jsx(po,{size:15,weight:e.kept?"fill":"regular"})}))]})})]})}function BR(e,t){return e>1?`Remove ${e} shots from ${t}`:`Remove from ${t}`}function th(e,t,n){return e>1?n(e):t}function rie(e,{chosen:t,batching:n,versions:r,onOpen:a,onBranch:i,onPick:l,onVersions:u,onToggleKeep:f,onArchive:h,onDeletePermanently:p,shotHref:g,inSet:v,filedIn:w,onRemoveFromSet:y,batch:x}){const k=[{key:"open",icon:"open",label:"Open",onSelect:()=>a(e.id)}];g&&k.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(g(e.id),"_blank")}),i&&!n&&k.push({key:"branch",icon:"refine",label:"Refine",onSelect:()=>i(e.id)});const S=!!(n&&t&&x&&x.count>0),E=!!(S&&x&&x.count>1);l&&k.push({key:"pick",icon:"select",label:t?E?"Deselect this shot":"Deselect":"Select",onSelect:()=>l(e.id)});const j=M=>M?"Remove from Keepers":"Add to Keepers",N=(M,C)=>M?`Remove ${C} shots from Keepers`:`Add ${C} shots to Keepers`;S&&x?k.push({key:"keep",icon:x.allKept?"kept":"keep",label:th(x.count,j(x.allKept),M=>N(x.allKept,M)),onSelect:x.onKeep,separated:E}):f&&k.push({key:"keep",icon:e.kept?"kept":"keep",label:j(e.kept),onSelect:()=>f(e)});const P=S?x==null?void 0:x.onRemoveFromSet:y,$=S?v?[v]:[]:v?[v]:w??[];if(P)for(const M of $)k.push({key:`unset-${M.id}`,icon:"unset",label:BR(S&&x?x.count:1,M.name),onSelect:()=>P(M)});return r>0&&u&&!n&&k.push({key:"versions",icon:"versions",label:`Show ${r} version${r===1?"":"s"}`,onSelect:()=>u(e.id)}),S&&x?(k.push({key:"archive",icon:x.archived?"restore":"archive",label:x.archived?th(x.count,"Restore",M=>`Restore ${M} shots`):th(x.count,"Archive",M=>`Archive ${M} shots`),onSelect:x.archived?x.onRestore:x.onArchive,danger:!x.archived,separated:!0}),x.archived&&k.push({key:"delete",icon:"delete",label:th(x.count,"Delete permanently",M=>`Delete ${M} shots permanently`),onSelect:x.onDelete,danger:!0,separated:!0})):(h&&k.push({key:"archive",icon:e.archived?"restore":"archive",label:e.archived?"Restore":"Archive",onSelect:()=>h(e),danger:!e.archived,separated:!0}),p&&e.archived&&k.push({key:"delete",icon:"delete",label:"Delete permanently",onSelect:()=>p(e),danger:!0,separated:!0})),k}function UR(e,t){var r,a,i,l;const n=(i=(a=(r=e.brief)==null?void 0:r.rendered)==null?void 0:a.sizes)==null?void 0:i[t];return n&&n[0]>0&&n[1]>0?{aspect:n[0]/n[1],guess:!1}:{aspect:Bu((l=e.brief)==null?void 0:l.format),guess:!0}}const sie=s.memo(function({node:t,selected:n,armed:r,chosen:a,picking:i,batching:l,versions:u,handlers:f,inSet:h,filedIn:p,pickedMeta:g}){const v=rie(t,{chosen:a,batching:l,versions:u,onOpen:f.onOpen,shotHref:f.shotHref,onBranch:f.onBranch,onPick:f.onPick,onVersions:f.onVersions,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDeletePermanently:f.onDeleteAsk,inSet:h,filedIn:p,onRemoveFromSet:f.onRemoveFromSet?w=>{var y;return(y=f.onRemoveFromSet)==null?void 0:y.call(f,t,w)}:void 0,batch:l&&a&&g&&f.onKeepPicked?{...g,onKeep:f.onKeepPicked,onArchive:f.onArchivePicked??(()=>{}),onRestore:f.onRestorePicked??(()=>{}),onDelete:f.onDeletePickedAsk??(()=>{}),onRemoveFromSet:f.onRemovePickedFromSet}:null});return o.jsxs(ff,{children:[o.jsx(hf,{children:o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-selected":n,"data-armed":r||void 0,"data-batching":l||void 0,"data-picked":a||void 0,children:[o.jsx(_n,{className:"sc-cell-open",to:f.shotHref(t.id),"aria-label":l?`${a?"Deselect":"Select"} ${Sr(t)}`:`Open ${Sr(t)}`,onClick:w=>{var y;l&&(w.preventDefault(),(y=f.onPick)==null||y.call(f,t.id))},children:o.jsx(tie,{src:dn(t.images[0],"tile"),fallback:Mr(t.images[0]),...UR(t,0)})}),o.jsx(nie,{node:t,chosen:a,picking:i,batching:l,armed:r,menu:v,onPick:f.onPick,onBranch:f.onBranch,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDelete:f.onDeleteAsk})]})}),o.jsx(pf,{children:v.map(w=>o.jsxs("span",{style:{display:"contents"},children:[w.separated&&o.jsx(Hp,{}),o.jsxs(mf,{color:w.danger?"red":void 0,onSelect:w.onSelect,children:[o.jsx(zR,{name:w.icon}),w.label]})]},w.key))})]})}),aie=s.memo(function({node:t,selected:n,shotHref:r,onCancel:a}){var i;return o.jsxs("div",{className:"sc-cell","data-running":"true","data-fb-node":t.id,"data-selected":n,style:{"--sc-cell-ar":Bu((i=t.brief)==null?void 0:i.format)},children:[o.jsxs(_n,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Sr(t)}, still rendering`,children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(GM,{since:Oi(t)})]}),a&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-cancel","data-urgent":nc(Oi(t))>=60||void 0,onClick:()=>a(t),children:"Cancel"})]})}),oie=s.memo(function({node:t,selected:n,shotHref:r,engineName:a,onRetry:i,onArchive:l}){const u=t.status==="cancelled",f=u?xA():kf(t.error,a==null?void 0:a(t.engineId));return o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-cancelled":u||void 0,"data-failed":!u||void 0,"data-selected":n,children:[o.jsx(_n,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Sr(t)}`}),o.jsx("span",{className:"sc-cell-failed",children:o.jsx(Vj,{failure:f,density:"tile",onRetry:()=>i(t),dismiss:l?{label:t.archived?"Restore":"Dismiss",onClick:()=>l(t)}:void 0})})]})}),iie=40,lie=1,I5=64,cie=e=>e>iie,uie=e=>Math.floor(e/I5)*I5;function nh(e,t,n){const r=Math.max(0,n-2),a=e!=="failed"&&t&&t>0?t:4/5;return Math.round(r/a)+2+Ru}function F5(e){const t=new Array(e.length+1);let n=0;for(let r=0;r<e.length;r++)t[r]=n,n+=e[r];return t[e.length]=n,t}function die(e,t,n){const r=e.length-1;if(r<=0||n<=t)return[0,0];let a=0,i=r;for(;a<i;){const u=a+i>>1;e[u+1]<=t?a=u+1:i=u}const l=a;for(a=l,i=r;a<i;){const u=a+i>>1;e[u]<n?a=u+1:i=u}return[l,a]}function _5(e,t){const n=Array.from({length:Math.max(1,t)},()=>[]);for(let r=0;r<e;r++)n[r%n.length].push(r);return n}function fie(e,t){const n=t*lie;return[e-n,e+t+n]}function yw(e){const t=e.getBoundingClientRect().top,n=e.querySelector(".sc-toolbar");return n?Math.max(t,n.getBoundingClientRect().bottom):t}function hie(e,t){const[n,r]=s.useState(()=>({top:0,height:typeof window>"u"?0:window.innerHeight})),a=s.useRef(null),i=s.useRef(null),l=s.useRef((h,p=0)=>{i.current=h?{anchor:h,until:p}:null}).current,u=s.useRef(()=>{}),f=s.useRef(()=>u.current()).current;return s.useLayoutEffect(()=>{if(!e)return;const h=e.closest(".sc-canvas");if(!h)return;let p=0,g=0;const v=()=>{var S;const k=i.current;if(k&&performance.now()<k.until){a.current=k.anchor;return}i.current=null,a.current=h.scrollTop>0?pie(e,yw(h),(S=a.current)==null?void 0:S.id):null},w=()=>{if(p=0,t){const k=e.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop,S={top:uie(h.scrollTop-k),height:h.clientHeight};r(E=>E.top===S.top&&E.height===S.height?E:S)}v(),cancelAnimationFrame(g),g=requestAnimationFrame(v)},y=()=>{p||(p=requestAnimationFrame(w))};u.current=w,w(),h.addEventListener("scroll",y,{passive:!0});const x=new ResizeObserver(y);return x.observe(h),x.observe(e),()=>{cancelAnimationFrame(p),cancelAnimationFrame(g),u.current=()=>{},h.removeEventListener("scroll",y),x.disconnect()}},[e,t]),{...n,anchor:a,resync:f,hold:l}}function pie(e,t,n){let r=null,a=null;for(const l of e.querySelectorAll(".sc-cell[data-fb-node]")){const u=l.getBoundingClientRect();if(u.bottom<=t||u.height===0)continue;const f=l.getAttribute("data-fb-node");if(!f)continue;const h={id:f,top:u.top,left:u.left};if(u.top>=t-1){const p=!!r&&Math.abs(u.top-r.top)<=1;(!r||u.top<r.top-1||p&&r.id!==n&&(f===n||u.left<r.left))&&(r=h)}else(!a||u.left<a.left)&&(a=h)}const i=r??a;return i?{id:i.id,offset:i.top-t}:null}function mie(e,t,n){const r=s.useRef(new Map),[,a]=s.useState(0),i=s.useRef(null),l=s.useRef(new Set);return s.useLayoutEffect(()=>{if(!t)return;let u=0;const f=new ResizeObserver(h=>{let p=!1;for(const g of h){const v=g.target.getAttribute("data-fb-node");if(!v)continue;const w=g.target;if(w.offsetHeight<=2||w.offsetWidth<=2)continue;const y=(w.offsetHeight-2)/(w.offsetWidth-2),x=r.current.get(v);(x===void 0||Math.abs(x-y)>.004)&&(r.current.set(v,y),p=!0)}p&&!u&&(u=requestAnimationFrame(()=>{u=0,a(g=>g+1)}))});return i.current=f,()=>{cancelAnimationFrame(u),f.disconnect(),i.current=null,l.current=new Set}},[t]),s.useLayoutEffect(()=>{const u=i.current;if(!(!t||!u||!e)){for(const f of l.current)f.isConnected||(u.unobserve(f),l.current.delete(f));for(const f of e.querySelectorAll(".sc-cell[data-fb-node]"))l.current.has(f)||(l.current.add(f),u.observe(f))}}),s.useCallback(u=>{const f=r.current.get(u);return f===void 0?void 0:Math.round(f*Math.max(0,n-2))+2+Ru},[n])}function gie({nodes:e,selectedId:t,onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onDeletePermanently:f,picked:h,onPick:p,empty:g,sending:v,onBranch:w,branchingFrom:y,onVersions:x,engineName:k,tile:S,pending:E,onNearEnd:j,inSet:N,setsFor:P,onRemoveFromSet:$,onKeepPicked:M,onArchivePicked:C,onRestorePicked:R,onDeletePicked:T,onRemovePickedFromSet:H}){const D=e.filter(ye=>ye.kind!=="root"),K=!!p,O=K&&((h==null?void 0:h.size)??0)>0,Z=s.useMemo(()=>{if(!h||h.size===0)return null;let ye=0,Ee=0,be=0;for(const Le of e)!h.has(Le.id)||Le.kind==="root"||(ye+=1,Le.kept&&(Ee+=1),Le.archived&&(be+=1));return{count:h.size,allKept:ye>0&&Ee===ye,archived:ye>0&&be===ye}},[e,h]),[te,B]=s.useState(null),[F,X]=s.useState(!1),[z,I]=s.useState(null),{tile:U,cols:G}=Ste(xte(z),S,kte()<yte),[ne,q]=s.useState(null);s.useEffect(()=>{if(!ne||!j)return;const ye=ne.closest(".sc-canvas"),Ee=new IntersectionObserver(be=>{be.some(Le=>Le.isIntersecting)&&j()},{root:ye,rootMargin:"200% 0px"});return Ee.observe(ne),()=>Ee.disconnect()},[ne,j]);const le=s.useRef({onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:x,engineName:k,onRemoveFromSet:$,onKeepPicked:M,onArchivePicked:C,onRestorePicked:R,onDeletePicked:T,onRemovePickedFromSet:H});le.current={onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:x,engineName:k,onRemoveFromSet:$,onKeepPicked:M,onArchivePicked:C,onRestorePicked:R,onDeletePicked:T,onRemovePickedFromSet:H};const Se=!!f,Q=!!T,xe=s.useMemo(()=>({onOpen:ye=>le.current.onOpen(ye),shotHref:ye=>le.current.shotHref(ye),onRetry:ye=>le.current.onRetry(ye),onCancel:i?ye=>{var Ee,be;return(be=(Ee=le.current).onCancel)==null?void 0:be.call(Ee,ye)}:void 0,onToggleKeep:l?ye=>{var Ee,be;return(be=(Ee=le.current).onToggleKeep)==null?void 0:be.call(Ee,ye)}:void 0,onArchive:u?ye=>{var Ee,be;return(be=(Ee=le.current).onArchive)==null?void 0:be.call(Ee,ye)}:void 0,onBranch:w?ye=>{var Ee,be;return(be=(Ee=le.current).onBranch)==null?void 0:be.call(Ee,ye)}:void 0,onPick:p?ye=>{var Ee,be;return(be=(Ee=le.current).onPick)==null?void 0:be.call(Ee,ye)}:void 0,onVersions:x?ye=>{var Ee,be;return(be=(Ee=le.current).onVersions)==null?void 0:be.call(Ee,ye)}:void 0,onDeleteAsk:Se?ye=>B(ye):void 0,engineName:k?ye=>{var Ee,be;return(be=(Ee=le.current).engineName)==null?void 0:be.call(Ee,ye)}:void 0,onRemoveFromSet:$?(ye,Ee)=>{var be,Le;return(Le=(be=le.current).onRemoveFromSet)==null?void 0:Le.call(be,ye,Ee)}:void 0,onKeepPicked:M?()=>{var ye,Ee;return(Ee=(ye=le.current).onKeepPicked)==null?void 0:Ee.call(ye)}:void 0,onArchivePicked:C?()=>{var ye,Ee;return(Ee=(ye=le.current).onArchivePicked)==null?void 0:Ee.call(ye)}:void 0,onRestorePicked:R?()=>{var ye,Ee;return(Ee=(ye=le.current).onRestorePicked)==null?void 0:Ee.call(ye)}:void 0,onDeletePickedAsk:Q?()=>X(!0):void 0,onRemovePickedFromSet:H?ye=>{var Ee,be;return(be=(Ee=le.current).onRemovePickedFromSet)==null?void 0:be.call(Ee,ye)}:void 0}),[!!i,!!l,!!u,!!w,!!p,!!x,Se,Q,!!k,!!$,!!M,!!C,!!R,!!H]),ee=[...v?Array.from({length:Math.max(1,v.count)},(ye,Ee)=>({key:`sending-${Ee}`,node:null,said:v.said})):[],...D.map(ye=>({key:ye.id,node:ye}))],ae=ye=>ye.status==="cancelled"||ye.status==="error"||ye.images.length===0,re=ye=>{const Ee=ye.node;return Ee?Ee.status==="running"?o.jsx(aie,{node:Ee,selected:Ee.id===t,shotHref:xe.shotHref,onCancel:xe.onCancel},Ee.id):ae(Ee)?o.jsx(oie,{node:Ee,selected:Ee.id===t,shotHref:xe.shotHref,engineName:xe.engineName,onRetry:xe.onRetry,onArchive:xe.onArchive},Ee.id):o.jsx(sie,{node:Ee,selected:Ee.id===t,armed:Ee.id===y,chosen:(h==null?void 0:h.has(Ee.id))??!1,picking:K,batching:O,versions:Ee.childCount,handlers:xe,inSet:N,filedIn:P==null?void 0:P(Ee.id),pickedMeta:Z},Ee.id):o.jsxs("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx("span",{className:"sc-cell-tag",children:"sending"}),o.jsx("span",{className:"sc-cell-said",dir:"auto",children:ye.said})]},ye.key)},_=ye=>{var be;const Ee=ye.node;return Ee?Ee.status==="running"?nh("running",Bu((be=Ee.brief)==null?void 0:be.format),U):ae(Ee)?nh("failed",void 0,U):nh("done",UR(Ee,0).aspect,U):nh("sending",void 0,U)},ue=cie(ee.length),We=hie(z,ue),Xe=mie(z,ue,U),ze=Bk(G),tt=`${ze}:${U}`,ce=s.useRef(tt),ve=s.useRef({items:ee,heightOf:Xe,estimate:_});ve.current={items:ee,heightOf:Xe,estimate:_};const Pe=s.useRef(null);if(s.useLayoutEffect(()=>{const ye=ce.current;ce.current=tt;const Ee=We.anchor.current,be=z==null?void 0:z.closest(".sc-canvas");if(!(ye===tt||!Ee||!z||!be)){if(Pe.current={anchor:Ee,until:performance.now()+vie},We.hold(Ee,Pe.current.until),!Z5(z,be,Ee)){const{items:Le,heightOf:Qe,estimate:Ke}=ve.current,nt=Le.findIndex(Nt=>{var cn;return((cn=Nt.node)==null?void 0:cn.id)===Ee.id});if(nt<0)return;const gt=_5(Le.length,ze)[nt%ze],Pt=F5(gt.map(Nt=>(Le[Nt].node&&Qe(Le[Nt].node.id))??Ke(Le[Nt]))),Ut=z.getBoundingClientRect().top+Pt[Math.floor(nt/ze)];be.scrollTop+=Ut-yw(be)-Ee.offset}We.resync()}},[tt,ze,z,We.anchor,We.resync,We.hold]),s.useLayoutEffect(()=>{const ye=Pe.current,Ee=z==null?void 0:z.closest(".sc-canvas");if(!(!ye||!z||!Ee)){if(performance.now()>ye.until){Pe.current=null;return}Z5(z,Ee,ye.anchor)}}),s.useEffect(()=>{const ye=z==null?void 0:z.closest(".sc-canvas");if(!ye)return;const Ee=()=>{Pe.current=null,We.hold(null)},be=["wheel","touchstart","keydown","pointerdown"];for(const Le of be)ye.addEventListener(Le,Ee,{passive:!0});return()=>{for(const Le of be)ye.removeEventListener(Le,Ee)}},[z,We.hold]),E&&q3(D)&&!v){const ye=Math.max(1,Math.min(G,8));return o.jsx("div",{className:"sc-feed",ref:I,style:{"--sc-tile":`${U}px`,"--sc-cols":ye},children:Array.from({length:ye},(Ee,be)=>o.jsx("div",{className:"sc-feed-col",children:Array.from({length:2},(Le,Qe)=>o.jsx("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:o.jsx("span",{className:"sc-shimmer"})},`pending-${be}-${Qe}`))},`col-${ye}-${be}`))})}if(q3(D)&&!v)return o.jsx(o.Fragment,{children:g??o.jsx("p",{className:"sc-feed-empty",children:"Nothing here yet."})});const de=Bk(G),je=_5(ee.length,de),Ue=ue?fie(We.top,We.height):null;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-feed",ref:I,style:{"--sc-tile":`${U}px`,"--sc-cols":de},children:je.map((ye,Ee)=>{const be=`col-${de}-${Ee}`;if(!Ue)return o.jsx("div",{className:"sc-feed-col",children:ye.map(gt=>re(ee[gt]))},be);const Le=ye.map(gt=>(ee[gt].node&&Xe(ee[gt].node.id))??_(ee[gt])),Qe=F5(Le),[Ke,nt]=die(Qe,Ue[0],Ue[1]);return o.jsxs("div",{className:"sc-feed-col",children:[Ke>0&&o.jsx("div",{className:"sc-feed-pad",style:{height:Qe[Ke]},"aria-hidden":!0}),ye.slice(Ke,nt).map(gt=>re(ee[gt])),nt<ye.length&&o.jsx("div",{className:"sc-feed-pad",style:{height:Qe[ye.length]-Qe[nt]},"aria-hidden":!0})]},be)})}),j&&o.jsx("div",{className:"sc-feed-end",ref:q,"aria-hidden":!0}),o.jsx(sf,{open:!!te||F,onOpenChange:ye=>{ye||(B(null),X(!1))},children:o.jsxs(af,{maxWidth:"420px",children:[o.jsx(of,{children:F?`Delete ${(Z==null?void 0:Z.count)??0} shot${((Z==null?void 0:Z.count)??0)===1?"":"s"} permanently?`:"Delete this shot permanently?"}),o.jsx(lf,{size:"2",children:"This cannot be undone."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(uf,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(cf,{children:o.jsx(ia,{color:"red",onClick:()=>{F?T==null||T():te&&(f==null||f(te)),B(null),X(!1)},children:"Delete permanently"})})]})]})})]})}const vie=800;function Z5(e,t,n){const r=e.querySelector(`.sc-cell[data-fb-node="${CSS.escape(n.id)}"]`);if(!r)return!1;const a=r.getBoundingClientRect().top-yw(t)-n.offset;return Math.abs(a)>=1&&(t.scrollTop+=a),!0}function wie(e){return e==="open"||e==="result"?"open":"compact"}function W6({name:e,kind:t,count:n,mode:r,onToggle:a,action:i,children:l}){const u=wie(r);return o.jsxs("div",{className:"sc-agroup","data-mode":r,"data-kind":t,children:[o.jsxs("div",{className:"sc-agroup-h",children:[o.jsxs("button",{type:"button",className:"sc-agroup-t","aria-expanded":r==="open",onClick:a,children:[o.jsx("b",{children:e}),n!==void 0&&n>0&&o.jsx("span",{className:"sc-agroup-n",children:n}),o.jsx(Yi,{size:11,className:"sc-agroup-caret","aria-hidden":"true"})]}),i]}),o.jsx("div",{className:"sc-agroup-body",children:o.jsx("div",{className:"sc-agroup-content",children:o.jsx("div",{className:"sc-agroup-layer",children:l(u)},u)})})]})}function WR({candidate:e,on:t,named:n,disabled:r,title:a,onClick:i}){const l=o.jsxs("button",{type:"button",className:"sc-acard","data-on":t||void 0,"aria-label":e.full,"aria-pressed":t,"aria-disabled":r||void 0,title:r?void 0:e.full,onClick:r?void 0:i,children:[o.jsxs("span",{className:"sc-acard-thumb",children:[e.thumb?o.jsx("img",{src:e.thumb,alt:"",loading:"lazy","data-crop":e.crop}):o.jsx("span",{className:"sc-aswatch",style:{display:"grid",placeItems:"center"},children:o.jsx(Ws,{size:14})}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:10,weight:"bold"})})]}),n&&o.jsxs("span",{className:"sc-acard-label",children:[e.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(po,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),e.label]})]});return o.jsx($M,{why:r?a:null,children:l})}function g8({kind:e,title:t,items:n,attached:r,mode:a,onToggle:i,onPick:l,onUnpick:u,full:f,moreLabel:h,createLabel:p,onCreate:g}){const v=s.useMemo(()=>new Set(r),[r]),[w,y]=s.useState(ep);return s.useEffect(()=>{a!=="open"&&y(ep)},[a]),a==="result"&&n.length===0?null:o.jsx(W6,{name:t,kind:e,count:n.length,mode:a,onToggle:()=>i(e),action:o.jsx("button",{type:"button",className:"sc-aadd",title:p,"aria-label":p,onClick:g,children:o.jsx(cr,{size:10})}),children:x=>{const{visible:k,more:S}=Nre(n,v,x==="open"?w:_6);return o.jsxs("div",{className:x==="open"?"sc-acard-grid":"sc-arow",children:[k.map(E=>o.jsx(WR,{candidate:E,on:v.has(E.id),named:x==="open",disabled:!!f&&!v.has(E.id),title:f??void 0,onClick:()=>v.has(E.id)?u(E.id):l(E.id)},E.id)),x==="open"&&S>0&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:()=>y(E=>E+v0),"aria-label":`Show ${Math.min(S,v0)} more ${h}`,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",S]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})}})}const V5=220,z5="cubic-bezier(0.32, 0.72, 0, 1)";function v8(e){const t=[];for(const n of e.querySelectorAll(".sc-agroup")){const r=n.querySelector(":scope > .sc-agroup-body");r&&t.push({group:n,body:r,height:r.getBoundingClientRect().height,marginBottom:Number.parseFloat(getComputedStyle(n).marginBottom)||0})}return t}function yie(e,t){const n=s.useRef(null),r=()=>{const a=e.current;if(!(!a||window.matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of v8(a))for(const l of[...i.body.getAnimations(),...i.group.getAnimations()])l.finish();n.current=v8(a)}};return s.useLayoutEffect(()=>{const a=n.current;n.current=null;const i=e.current;if(!(!a||!i))for(const l of v8(i)){const u=a.find(f=>f.group===l.group);if(u){if(Math.abs(u.height-l.height)>.5){const{body:f}=l;f.style.overflow="hidden";const h=f.animate([{height:`${u.height}px`},{height:`${l.height}px`}],{duration:V5,easing:z5}),p=()=>{f.style.overflow=""};h.onfinish=p,h.oncancel=p}Math.abs(u.marginBottom-l.marginBottom)>.5&&l.group.animate([{marginBottom:`${u.marginBottom}px`},{marginBottom:`${l.marginBottom}px`}],{duration:V5,easing:z5})}}},[t]),r}function bie({brand:e,shots:t,shotsTotal:n,attached:r=ZM,full:a,onToken:i,offToken:l,onTemplate:u,offTemplate:f,onClose:h}){const p=Rf(),g=ll(),{applyBrand:v}=Rn(),{push:w}=or(),[y,x]=rB(Dr.assetsExpanded,null),k=s.useRef(null),S=yie(k,y),E=G=>{S(),x(ne=>ne===G?null:G)},[j,N]=s.useState(""),P=j.trim().length>0,$=G=>{S(),N(""),x(G)},M=G=>P?"result":y===null?"idle":y===G?"open":"collapsed",C=s.useMemo(()=>new Set(vo(e.id)),[e.id]),R=s.useMemo(()=>{const G=ne=>{const q=_i(ne,p);return hm(ne,q,{currentId:null,query:"",bookmarked:C,shown:q.length}).items};return{product:G("product"),presenter:G("presenter"),scene:G("scene")}},[p,C]),T=s.useMemo(()=>({product:Pu(R.product,j),presenter:Pu(R.presenter,j),scene:Pu(R.scene,j)}),[R,j]),H=s.useMemo(()=>{var G;return Zs((G=e.json)==null?void 0:G.palette)},[e]),D=s.useMemo(()=>P?H.filter(G=>wo(`${G.name} ${G.hex}`,j)):H,[H,j,P]),K=G=>{(async()=>{var q;const ne=zA((q=e.json)==null?void 0:q.palette,G);if(ne.swatch){if(ne.added)try{const le=await Re.updateBrand(e.id,{...e.json??{},palette:ne.palette});v(le)}catch(le){w(nn(le,"Could not save the brand"));return}$("colors")}})()},O=G=>{(async()=>{var q;const ne=RY((q=e.json)==null?void 0:q.palette,G);if(ne.removed)try{const le=await Re.updateBrand(e.id,{...e.json??{},palette:ne.palette});v(le)}catch(le){w(nn(le,"Could not save the brand"))}})()},Z=M("shots")==="open",te=Qv(e.id,"",Z),B=s.useMemo(()=>{const G=new Set,ne=[];for(const q of[...t,...te.items])q.status!=="done"||q.images.length===0||G.has(q.id)||(G.add(q.id),ne.push(q));return ne},[t,te.items]),F=Math.max(n??0,te.total,B.length),[X,z]=s.useState(ep);s.useEffect(()=>{Z||z(ep)},[Z]);const I=()=>{z(G=>G+v0),te.hasMore&&B.length<X+2*v0&&te.loadMore()},U=P&&!T.product.length&&!T.presenter.length&&!T.scene.length&&!D.length;return o.jsxs("aside",{ref:k,className:"sc-assets","aria-label":"Assets",children:[o.jsxs("div",{className:"sc-assets-head",children:[o.jsx("b",{children:"Assets"}),o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:h,"aria-label":"Close assets",style:{width:28,height:28},children:o.jsx(jn,{size:12})})]}),o.jsx("div",{className:"sc-assets-searchbar",children:o.jsxs("div",{className:"sc-assets-search",children:[o.jsx(Fu,{size:12}),o.jsx("input",{value:j,onChange:G=>N(G.target.value),onKeyDown:G=>{G.key==="Escape"&&j&&(G.stopPropagation(),N(""))},placeholder:"Search assets","aria-label":"Search assets in this panel"}),P&&o.jsx("button",{type:"button",className:"sc-assets-clear",onClick:()=>N(""),"aria-label":"Clear search",children:o.jsx(jn,{size:11})})]})}),U&&o.jsxs("p",{className:"sc-assets-zero",children:["Nothing here matches “",j.trim(),"”."]}),o.jsx(g8,{kind:"product",title:"Products",items:T.product,attached:r.product,mode:M("product"),onToggle:E,onPick:G=>i({t:"product",id:G}),onUnpick:G=>l({t:"product",id:G}),full:a,moreLabel:"products",createLabel:"Add product",onCreate:()=>g("product",{onCreated:G=>{G.kind==="product"&&($("product"),i({t:"product",id:G.id}))}})}),o.jsx(g8,{kind:"presenter",title:"Presenters",items:T.presenter,attached:r.presenter,mode:M("presenter"),onToggle:E,onPick:G=>i({t:"character",id:G}),onUnpick:G=>l({t:"character",id:G}),full:a,moreLabel:"presenters",createLabel:"Create presenter",onCreate:()=>g("presenter",{onCreated:()=>$("presenter")})}),o.jsx(g8,{kind:"scene",title:"Scenes",items:T.scene,attached:r.scene?[r.scene]:[],mode:M("scene"),onToggle:E,onPick:u,onUnpick:()=>f(),full:a,moreLabel:"scenes",createLabel:"Create scene",onCreate:()=>g("scene",{onCreated:G=>{G.kind==="scene"&&$("scene")}})}),!(P&&D.length===0)&&o.jsx(W6,{name:"Brand colors",count:D.length,mode:M("colors"),onToggle:()=>E("colors"),action:o.jsx(Zu,{className:"sc-aadd",triggerStyle:{background:"none"},value:Jp(H),presets:H.map(G=>G.hex),commitMode:"close",align:"end",label:"Add colour",onChange:K,children:o.jsx(cr,{size:10})}),children:G=>o.jsx("div",{className:"sc-arow",children:(G==="open"?D:D.slice(0,_6)).map(ne=>{const q=r.color.includes(ne.hex.toLowerCase());return o.jsxs("div",{className:"sc-aswatch-tile","data-on":q||void 0,children:[o.jsxs("button",{type:"button",title:`${ne.name} ${ne.hex}`,"aria-pressed":q,onClick:()=>q?l({t:"color",hex:ne.hex,name:ne.name}):i({t:"color",hex:ne.hex,name:ne.name}),children:[o.jsx("span",{className:"sc-aswatch",style:{background:ne.hex}}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Kn,{size:10,weight:"bold"})})]}),G==="open"&&o.jsx("button",{type:"button",className:"sc-aswatch-x","aria-label":`Remove ${ne.name}`,title:"Remove",onClick:()=>O(ne.hex),children:o.jsx(jn,{size:10,weight:"bold"})})]},ne.hex)})})}),B.length>0&&!P&&o.jsx(W6,{name:"Recent shots",count:F,mode:M("shots"),onToggle:()=>E("shots"),children:G=>o.jsxs("div",{className:G==="open"?"sc-acard-grid":"sc-arow",children:[B.slice(0,G==="open"?X:_6).map((ne,q)=>{const le=ne.images[0],Se=r.ref.includes(le);return o.jsx(WR,{candidate:{label:`Shot ${F-q}`,full:`Shot ${F-q} · as reference`,thumb:dn(le,"micro")},on:Se,named:G==="open",disabled:!!a&&!Se,title:a??void 0,onClick:()=>Se?l({t:"ref",imageHash:le}):i({t:"ref",imageHash:le,label:"Shot"})},ne.id)}),G==="open"&&(B.length>X||te.hasMore)&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:I,"aria-label":`Show ${v0} more shots`,"aria-busy":te.loading||void 0,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",Math.max(1,F-Math.min(B.length,X))]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})})]})}function xie({sets:e,active:t,ungrouped:n,ungroupedCount:r,onPlaceAll:a,onPlaceUngrouped:i,onOpenSet:l,onNewSet:u,onResetNewSet:f,onRenameSet:h,onDeleteSet:p,askCreate:g,lens:v,lensCounts:w,onLens:y,q:x,onQ:k,searchTotal:S,sort:E,onSort:j,tile:N,onTile:P,assets:$,onAssets:M,showAssets:C}){const R=t?t.id:n?"__ungrouped__":"__all__",T=t?t.name:n?"Not in a set":"All shots",H=!!t||n,D=wr(Ks),[K,O]=s.useState(!1),[Z,te]=s.useState(!1),[B,F]=s.useState(!1),[X,z]=s.useState(""),I=s.useRef(null),U=s.useRef(!1),G=()=>{U.current=!0,te(!0),z(""),O(!0)},ne=()=>{t&&(U.current=!1,te(!1),z(t.name),O(!0))};s.useEffect(()=>{g&&G()},[g]);const q=()=>{const ae=X.trim();if(!ae)return;const re=U.current;U.current=!1,te(!1),O(!1),re?u(ae):h==null||h(ae)},le=ae=>{if(ae){O(!0);return}const re=U.current;U.current=!1,te(!1),O(!1),re&&(f==null||f())},Se=Tj.map(ae=>({value:ae.id==="all"?null:ae.id,label:ae.label,count:w==null?void 0:w[ae.id]})),Q=o.jsxs(o.Fragment,{children:[o.jsxs(Rh,{value:R,children:[o.jsx(gu,{value:"__all__",onSelect:a,children:"All shots"}),o.jsxs(gu,{value:"__ungrouped__",onSelect:i,children:["Not in a set",r>0?` · ${r}`:""]}),e.length>0&&o.jsx(Bl,{}),e.map(ae=>o.jsx(gu,{value:ae.id,onSelect:()=>l(ae),children:ae.name},ae.id))]}),o.jsx(Bl,{}),o.jsx(tr,{onSelect:()=>{f==null||f(),G()},children:"New set"}),t&&h&&o.jsx(tr,{onSelect:ne,children:"Rename"}),t&&p&&o.jsx(tr,{color:"red",onSelect:()=>F(!0),children:"Delete set"})]}),xe=o.jsx(Rh,{value:E,onValueChange:ae=>j(ae),children:Lj.map(ae=>o.jsx(gu,{value:ae.id,children:ae.label},ae.id))}),ee=H||E!=="newest";return o.jsxs("div",{className:"sc-toolbar",children:[o.jsxs("div",{className:"sc-toolbar-scope",children:[!D&&o.jsxs("div",{className:"sc-toolbar-where",children:[H&&o.jsx("button",{type:"button",className:"sc-toolbar-back","aria-label":"All shots",onClick:a,children:o.jsx(ga,{size:16})}),o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-place","data-on":H||void 0,"aria-label":T,children:[o.jsx(ov,{className:"sc-toolbar-place-ic",size:16}),o.jsx("span",{className:"sc-toolbar-place-t",children:T}),o.jsx(Yi,{size:10,className:"sc-caret"})]})}),o.jsx(Cs,{align:"start",children:Q})]})]}),o.jsx(J4,{open:K,onOpenChange:le,children:o.jsxs(ev,{maxWidth:"360px","aria-describedby":void 0,onOpenAutoFocus:ae=>{ae.preventDefault();const re=I.current;re&&(re.focus(),re.select())},children:[o.jsx(tv,{children:Z?"Name this set":"Rename set"}),o.jsx("input",{ref:I,className:"sc-in",style:{width:"100%",marginTop:8},value:X,"aria-label":"Set name",onChange:ae=>z(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&q()}}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ia,{variant:"soft",color:"gray",onClick:()=>le(!1),children:"Cancel"}),o.jsx(ia,{onClick:q,disabled:!X.trim(),children:"Save"})]})]})}),o.jsx(sf,{open:B,onOpenChange:F,children:o.jsxs(af,{maxWidth:"420px",children:[o.jsx(of,{children:"Delete this set?"}),o.jsx(lf,{size:"2",children:"Shots stay in the library. Only the set goes."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(uf,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(cf,{children:o.jsx(ia,{color:"red",onClick:()=>{p==null||p(),F(!1)},children:"Delete set"})})]})]})}),o.jsx(Xv,{"aria-label":"Shot lenses",activeKey:v==="all"?null:v,items:Se,onSelect:ae=>y(ae??"all")})]}),o.jsxs("div",{className:"sc-toolbar-actions",children:[o.jsx(id,{value:x,onChange:k,noun:"shots",total:S}),D?o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn sc-toolbar-view","data-on":ee||void 0,"aria-label":`Set and sort: ${T}`,children:[o.jsx(iv,{size:15}),ee&&o.jsx("span",{className:"sc-toolbar-view-dot","aria-hidden":!0})]})}),o.jsxs(Cs,{align:"end",children:[o.jsx(t6,{children:"Set"}),Q,o.jsx(Bl,{}),o.jsx(t6,{children:"Sort"}),xe]})]}):o.jsxs(Ss,{children:[o.jsx(Es,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn","aria-label":"Sort shots",children:[o.jsx(LU,{size:14}),o.jsx("span",{className:"sc-toolbar-btn-t",children:"Sort"}),o.jsx(Yi,{size:10})]})}),o.jsx(Cs,{align:"end",children:xe})]}),o.jsx(Ate,{value:N,onChange:P}),C&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-toolbar-assets","data-on":$||void 0,onClick:M,"aria-label":"Assets panel","aria-pressed":$,title:"Assets panel (.)",children:o.jsx(eW,{size:15,mirrored:!0})})]})]})}function kie(e){const{push:t}=or(),n=s.useCallback(l=>Re.archiveNode(l.id,!0).then(u=>(e(u),t({kind:"success",title:"Archived",detail:Sr(l),action:{label:"Undo",onClick:()=>void Re.archiveNode(l.id,!1).then(e)}}),!0)).catch(u=>(t(nn(u,"Could not archive this shot")),!1)),[e,t]),r=s.useCallback(l=>Re.archiveNode(l.id,!1).then(u=>(e(u),!0)).catch(u=>(t(nn(u,"Could not restore this shot")),!1)),[e,t]),a=s.useCallback(l=>Promise.all(l.map(u=>Re.archiveNode(u,!0))).then(u=>{for(const f of u)e(f);return t({kind:"success",title:`Archived ${u.length} shot${u.length===1?"":"s"}`,action:{label:"Undo",onClick:()=>{Promise.all(u.map(f=>Re.archiveNode(f.id,!1))).then(f=>{for(const h of f)e(h)})}}}),!0}).catch(u=>(t(nn(u,"Could not archive these shots")),!1)),[e,t]),i=s.useCallback(l=>Promise.all(l.map(u=>Re.archiveNode(u,!1))).then(u=>{for(const f of u)e(f);return!0}).catch(u=>(t(nn(u,"Could not restore these shots")),!1)),[e,t]);return{archive:n,archiveBatch:a,unarchive:r,unarchiveBatch:i}}function Sie(e){const{push:t}=or(),n=s.useCallback(a=>Re.deleteNode(a.id).then(()=>e([a.id])).catch(i=>t(nn(i,"Could not delete this shot"))),[e,t]),r=s.useCallback(a=>Re.deleteNodesBatch(a).then(()=>e(a)).catch(i=>t(nn(i,"Could not delete these shots"))),[e,t]);return{remove:n,removeBatch:r}}function Eie(e,{demoProducts:t,presenters:n,scenes:r}){var f,h,p,g;const a=((f=e.brief)==null?void 0:f.tokens)??[],i=(h=a.find(v=>(v==null?void 0:v.t)==="product"))==null?void 0:h.id,l=(p=a.find(v=>(v==null?void 0:v.t)==="character"))==null?void 0:p.id,u=(g=a.find(v=>(v==null?void 0:v.t)==="template"))==null?void 0:g.id;return{product:i?t.find(v=>v.id===i):void 0,presenter:l?n.find(v=>v.id===l):void 0,scene:u?r.find(v=>v.id===u):void 0}}function Cie(e,t){const{product:n,presenter:r,scene:a}=Eie(e,t);return{productName:n?go(n,"chip"):null,productPreviewUrl:(n==null?void 0:n.previewUrl)??null,productId:(n==null?void 0:n.id)??null,presenterName:(r==null?void 0:r.name)??null,presenterPreviewUrl:r?ti(r).src:null,presenterId:(r==null?void 0:r.id)??null,sceneName:a?Qi(a,"chip"):null,scenePreviewUrl:(a==null?void 0:a.previewUrl)??null,sceneId:(a==null?void 0:a.id)??null}}function jie(e){const t=s.useRef(null),n=s.useRef(0),r=s.useRef(null),a=s.useRef(0),i=s.useCallback(()=>{const h=t.current;h&&(n.current=h.scrollWidth/3)},[]);s.useEffect(()=>{const h=t.current;if(!h||!e)return;i(),h.scrollLeft=n.current;const p=new ResizeObserver(()=>{const g=n.current;i(),g<=0&&n.current>0&&(h.scrollLeft=n.current)});p.observe(h);for(const g of h.children)p.observe(g);return()=>p.disconnect()},[e,i]);const l=s.useCallback(()=>{const h=t.current,p=n.current;!h||p<=0||(h.scrollLeft<p*.5?(h.scrollLeft+=p,r.current!==null&&(r.current+=p)):h.scrollLeft>p*1.5&&(h.scrollLeft-=p,r.current!==null&&(r.current-=p)))},[]),u=s.useCallback(()=>{r.current=null,cancelAnimationFrame(a.current)},[]);s.useEffect(()=>{const h=t.current;if(!h)return;let p=0;const g=()=>{p||(p=requestAnimationFrame(()=>{p=0,l()}))},v=y=>{Math.abs(y.deltaY)<=Math.abs(y.deltaX)||(y.preventDefault(),u(),h.scrollLeft+=y.deltaY)},w=y=>{y.target.closest(".sc-shelf-arrow")||u()};return h.addEventListener("scroll",g,{passive:!0}),h.addEventListener("wheel",v,{passive:!1}),h.addEventListener("pointerdown",w),()=>{p&&cancelAnimationFrame(p),u(),h.removeEventListener("scroll",g),h.removeEventListener("wheel",v),h.removeEventListener("pointerdown",w)}},[u,l]);const f=s.useCallback(h=>{const p=t.current,g=p==null?void 0:p.firstElementChild;if(!p||!g)return;const v=g.offsetWidth||232,w=Number.parseFloat(getComputedStyle(p).columnGap)||0,y=v+w,x=r.current??p.scrollLeft;r.current=x+y*h;const k=()=>{u()};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p.scrollLeft=r.current,k(),l();return}cancelAnimationFrame(a.current);let S=0;const E=()=>{const j=r.current;if(j===null)return;const N=j-p.scrollLeft;if(S+=1,Math.abs(N)<.5||S>45){p.scrollLeft=j,k(),l();return}p.scrollLeft+=N*.16,a.current=requestAnimationFrame(E)};a.current=requestAnimationFrame(E)},[u,l]);return{ref:t,page:f}}function Aie(e){const t=[...e];for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function Nie({entries:e,catalogs:t,stagedId:n,onUse:r,productHref:a,presenterHref:i,sceneHref:l}){const u=s.useMemo(()=>Aie(e).slice(0,10),[e]),{ref:f,page:h}=jie(u.length);return o.jsxs("div",{className:"sc-canvas-empty",children:[o.jsxs("h3",{children:["Your first ",o.jsx("em",{children:"shot"})]}),o.jsx("p",{children:"Describe what you want in the prompt below, or open one of these."}),u.length>0&&o.jsxs("div",{className:"sc-shelf",children:[o.jsx("button",{type:"button",className:"sc-shelf-arrow prev","aria-label":"Previous examples",onClick:()=>h(-1),children:o.jsx(ga,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-shelf-arrow next","aria-label":"More examples",onClick:()=>h(1),children:o.jsx(ol,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-shelf-row",ref:f,children:[0,1,2].map(p=>u.map(g=>o.jsx(zM,{entry:g,size:"grid",hideRecipe:!0,decorative:p!==1,active:n===g.id,onOpen:()=>r(g),productHref:a,presenterHref:i,sceneHref:l,...Cie(g,t)},`${p}-${g.id}`)))})]})]})}function Xd({text:e,onAll:t,actionLabel:n="Show all shots"}){return o.jsxs("div",{className:"sc-feed-empty",children:[o.jsx("p",{children:e}),t&&o.jsx("button",{type:"button",className:"sc-btn",onClick:t,children:n})]})}function Mie({count:e,sets:t,activeSet:n,onAdd:r,onRemove:a,onNew:i,onClear:l,onKeep:u,onArchiveBatch:f,allKept:h,archivedLens:p,pickedIds:g,onRestoreBatch:v,onDeleteBatch:w,loaded:y,onSelectAll:x}){const[k,S]=s.useState(!1);return o.jsxs("div",{className:"sc-picked","data-lens":p?"archived":void 0,role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),y>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<y?x:l,children:e<y?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-tools",children:p?o.jsxs(o.Fragment,{children:[o.jsx(au,{label:"Restore",onClick:()=>v(g),children:o.jsx(M0,{size:17})}),o.jsx(au,{label:`Delete ${e} permanently`,tone:"danger",onClick:()=>S(!0),children:o.jsx(il,{size:17})})]}):o.jsxs(o.Fragment,{children:[o.jsx(au,{label:h?"Remove from keepers":"Keep",onClick:u,children:o.jsx(po,{size:17,weight:h?"fill":"regular"})}),o.jsxs(Ss,{children:[o.jsx(lr,{label:"Add to set",children:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-picked-tool","aria-label":"Add to set",children:o.jsx(ov,{size:17})})})}),o.jsxs(Cs,{children:[t.filter(E=>E.id!==(n==null?void 0:n.id)).map(E=>o.jsx(tr,{onSelect:()=>r(E),children:E.name},E.id)),t.some(E=>E.id!==(n==null?void 0:n.id))&&o.jsx(Bl,{}),o.jsx(tr,{onSelect:i,children:"New set…"})]})]}),n&&a&&o.jsx(au,{label:BR(e,n.name),onClick:a,children:o.jsx(LC,{size:17})}),o.jsx(au,{label:"Archive",tone:"danger",onClick:()=>f(g),children:o.jsx(Op,{size:17})})]})}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(au,{label:"Done",onClick:l,children:o.jsx(jn,{size:16,weight:"bold"})})}),p&&o.jsx(Wn,{label:`Delete ${e} permanently`,title:`Delete ${e} shot${e===1?"":"s"} permanently?`,body:"This cannot be undone.",busy:!1,open:k,onOpenChange:S,onConfirm:()=>w(g)})]})}function au({label:e,tone:t,onClick:n,children:r}){return o.jsx(lr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}function Rie(e,t){return[e,t.lens??"all",t.set??"",t.ungrouped?"ungrouped":"",t.lineage??"",t.token??"",(t.q??"").trim(),t.sort??"newest",t.limit??""].join("|")}function Pie(e){switch(e){case"oldest":return(t,n)=>vu(n,t);case"cost":return(t,n)=>n.costUsd-t.costUsd||vu(t,n);case"keepers":return(t,n)=>Number(n.kept)-Number(t.kept)||vu(t,n);default:return vu}}function KR(e,t,n){return e.kind==="root"?!1:t.lineage?n.inLineage?n.inLineage(e):!1:t.set?n.inSet?n.inSet(e.id):!1:t.ungrouped?n.inAnySet?!n.inAnySet(e.id):!1:!0}function Lie(e,t){return t==="archived"?e.archived:t==="keepers"?!e.archived&&e.kept:!e.archived}function B5(e,t,n){var r;return(r=t.q)!=null&&r.trim()?null:KR(e,t,n)&&Lie(e,t.lens)}function U5(e){return!e||e.kind==="root"?{all:0,keepers:0,archived:0}:{all:e.archived?0:1,keepers:!e.archived&&e.kept?1:0,archived:e.archived?1:0}}function w8(e,t,n,r){if(!r)return e;const a=U5(t),i=U5(n),l={...e,all:e.all+i.all-a.all,keepers:e.keepers+i.keepers-a.keepers,archived:e.archived+i.archived-a.archived};return l.all===e.all&&l.keepers===e.keepers&&l.archived===e.archived?e:l}function K6(e,t){const n=e.findIndex(a=>a.id===t.id);if(n===-1||e[n]===t)return e;const r=[...e];return r[n]=t,r}function W5(e,t){const n=new Set(t);return e.some(r=>n.has(r.id))?e.filter(r=>!n.has(r.id)):e}function Tie(e,t,n,r){if(e.some(u=>u.id===t.id))return K6(e,t);const a=Pie(n);let i=0;for(;i<e.length&&a(e[i],t)<=0;)i++;if(i===e.length&&!r)return e;const l=[...e];return l.splice(i,0,t),l}function $ie(e,t){const n=new Set(e.map(a=>a.id)),r=t.filter(a=>!n.has(a.id));return r.length?[...e,...r]:e}function Die(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}const y8=60;function Hie(e,t,n){const{shotsEpoch:r}=on(),a=`${Rie(e,t)}#${r}`,[i,l]=s.useState({brandId:e,key:"",items:[],next:null,counts:null,error:null}),[u,f]=s.useState(!1),h=s.useRef(i);h.current=i;const p=s.useRef(t);p.current=t;const g=s.useRef(n);g.current=n;const v=s.useRef(!1);s.useEffect(()=>{const N=new AbortController;return f(!0),Re.feed(e,{...p.current,limit:y8},N.signal).then(P=>{N.signal.aborted||l({brandId:e,key:a,items:P.items,next:P.next,counts:P.counts??null,error:null})}).catch(P=>{if(N.signal.aborted)return;const $=String((P==null?void 0:P.message)??P);l(M=>({...M,brandId:e,key:a,error:$}))}).finally(()=>{N.signal.aborted||f(!1)}),()=>N.abort()},[e,a]);const w=s.useCallback(()=>{const N=h.current;if(N.key!==a||!N.next||v.current)return;v.current=!0,f(!0);const P=N.next;Re.feed(e,{...p.current,limit:y8,cursor:P}).then($=>{l(M=>M.key!==a?M:{...M,items:$ie(M.items,$.items),next:$.next,counts:$.counts??M.counts})}).catch(()=>{}).finally(()=>{v.current=!1,f(!1)})},[e,a]),y=s.useCallback(async()=>{const N=await Re.feed(e,{...p.current,limit:y8});l(P=>P.key!==a?P:{...P,items:Die(P.items,N.items),next:P.items.length?P.next:N.next,counts:N.counts??P.counts,error:null})},[e,a]),x=s.useCallback(N=>{l(P=>{const $=P.items.find(H=>H.id===N.id);if(!$)return P;const M=p.current,R=B5(N,M,g.current)===!1?W5(P.items,[N.id]):K6(P.items,N),T=P.counts?w8(P.counts,$,N,!0):P.counts;return R===P.items&&T===P.counts?P:{...P,items:R,counts:T}})},[]),k=s.useCallback((N,P)=>{let $=!1;l(M=>{let C=M.items,R=M.counts;const T=p.current;for(const H of N){if(C.some(Z=>Z.id===H.id)){C=K6(C,H);continue}const D=B5(H,T,g.current);if(D===null){$=!0;continue}const K=KR(H,T,g.current);D&&(C=Tie(C,H,T.sort,M.next===null));const O=(P==null?void 0:P.get(H.id))??null;R&&(R=w8(R,O,H,K))}return C===M.items&&R===M.counts?M:{...M,items:C,counts:R}}),$&&y().catch(()=>{})},[y]),S=s.useCallback(N=>{l(P=>{const $=P.items.filter(C=>N.includes(C.id));if(!$.length)return P;let M=P.counts;if(M)for(const C of $)M=w8(M,C,null,!0);return{...P,items:W5(P.items,N),counts:M}})},[]),E=i.brandId===e?i.items:[],j=s.useMemo(()=>new Map(E.map(N=>[N.id,N])),[E]);return{items:E,byId:j,counts:i.brandId===e?i.counts:null,ready:i.key===a&&!i.error,loading:u,complete:i.key===a&&i.next===null,error:i.key===a?i.error:null,loadMore:w,patch:x,insert:k,drop:S,refresh:y}}function Oie(){const e=un(ct.hubShot),t=un(ct.setShot);return(e==null?void 0:e.params.shotId)??(t==null?void 0:t.params.shotId)??null}function K5(e,t){const n=e?t.get(e)??null:null,[r,a]=s.useState(null);return s.useEffect(()=>{if(!e||n)return;let i=!0;return Re.node(e).then(l=>i&&a({id:e,node:l})).catch(()=>i&&a({id:e,node:null})),()=>{i=!1}},[e,n]),e?n?{node:n,missing:!1}:(r==null?void 0:r.id)===e?{node:r.node,missing:r.node===null}:{node:null,missing:!1}:{node:null,missing:!1}}function GR({set:e}){const{engines:t,scenes:n,presenters:r,demoProducts:a,showcase:i,showcaseLoaded:l}=Rn(),{brand:u,workspace:f,root:h,recent:p,sets:g,membership:v,loaded:w,refresh:y,applySet:x,dropSet:k,insertSet:S,applyMembership:E,applyNodes:j,subscribeActivity:N,products:P}=on(),$=Rf(),M=Dn(),[C,R]=el(),T=Oie(),[H,D]=s.useState(null),[K,O]=s.useState(!1);s.useEffect(()=>{const ie=()=>O(!0);return window.addEventListener("scenri:shortcuts",ie),()=>window.removeEventListener("scenri:shortcuts",ie)},[]);const{open:Z,toggle:te,setOpen:B}=Xee(),F=wr("(min-width: 1280px)"),X=F&&Z,[z,I]=s.useState(null),[U,G]=s.useState(ZM),[ne,q]=s.useState(null),[le,Se]=s.useState(null),Q=s.useRef(!1);s.useEffect(()=>{if(!Q.current||T)return;Q.current=!1;const ie=requestAnimationFrame(()=>{var De;return(De=Ke.current)==null?void 0:De.focus()});return()=>cancelAnimationFrame(ie)},[T,le]);const[xe,ee]=s.useState(null),[ae,re]=s.useState(new Set),[_,ue]=G1("tab","all"),[We,Xe]=G1("in",""),[ze,tt]=G1("branch",""),[ce,ve]=G1("lineage",""),[Pe,de]=fa(Dr.tileSize,pM),je=mM(Pe),{q:Ue,setQ:ye,clearSearch:Ee}=Pf([]),[be,Le]=fa(Dr.feedSort,"newest"),Qe=bW(be)?be:"newest",Ke=s.useRef(null),{push:nt}=or(),{poke:gt}=Za(),[Pt,Ut]=s.useState(null),Nt=(f==null?void 0:f.id)??"",cn=e?t0(u,e):mr(u),Fe=s.useCallback(ie=>{const De=C.toString();return`${cn}/shots/${ie}${De?`?${De}`:""}`},[cn,C]),pt=s.useCallback((ie,De=!1)=>M(Fe(ie),{replace:De}),[M,Fe]),it=s.useCallback(()=>{const ie=new URLSearchParams(C);ie.delete("panel");const De=ie.toString();M(`${cn}${De?`?${De}`:""}`,{replace:!0})},[cn,M,C]),St=xW(_)?_:"all",xt=!e&&We==="ungrouped";s.useEffect(()=>{_==="ungrouped"&&(ue(null),Xe("ungrouped"))},[_,ue,Xe]);const At=s.useMemo(()=>{const ie=new Map;for(const De of g)for(const Je of v[De.id]??[])ie.has(Je)||ie.set(Je,[]),ie.get(Je).push(De);return ie},[g,v]),Kt=s.useMemo(()=>({lens:St,set:e==null?void 0:e.id,ungrouped:xt||void 0,lineage:ce||void 0,q:Ue.trim()||void 0,sort:Qe}),[St,e==null?void 0:e.id,xt,ce,Ue,Qe]),et=s.useRef(v);et.current=v;const mt=s.useRef(At);mt.current=At;const ot=s.useRef(new Set),kn=s.useMemo(()=>({inSet:ie=>e?(et.current[e.id]??[]).includes(ie):!1,inAnySet:ie=>mt.current.has(ie),inLineage:ie=>ie.id===ce||ie.parentId!==null&&ot.current.has(ie.parentId)}),[e==null?void 0:e.id,ce]),ut=Hie(u.id,Kt,kn),{items:Gt,byId:Ft,counts:en}=ut,Jt=s.useRef(ut);Jt.current=ut,ot.current=s.useMemo(()=>new Set(Gt.map(ie=>ie.id)),[Gt]);const se=s.useRef(new Map);s.useEffect(()=>{for(const ie of Gt)se.current.set(ie.id,ie)},[Gt]);const oe=s.useRef(null),[we,ge]=s.useState("");s.useEffect(()=>N(ie=>{const{messages:De,next:Je}=qoe(oe.current??new Map,ie),Vt=oe.current===null;oe.current=Je,!Vt&&De.length&&ge(De.join(" "));const Yt=Jt.current;let Bn=!1;const Nn=[],xn=new Map;for(const Sn of ie){if(Yt.byId.has(Sn.id))Yt.patch(Sn);else if(se.current.has(Sn.id)){const hs=se.current.get(Sn.id);hs&&xn.set(Sn.id,hs),Nn.push(Sn)}else Sn.kind!=="root"&&(Bn=!0);se.current.set(Sn.id,Sn)}Nn.length&&Yt.insert(Nn,xn),Bn&&Yt.ready&&Yt.refresh().catch(()=>{})}),[N]);const J=w&&ut.ready,Oe=K5(ce||null,Ft);s.useEffect(()=>{!ce||!Oe.missing||(ve(null),nt({kind:"info",title:"That shot is no longer available",detail:"Showing everything instead."}))},[ce,Oe.missing,ve,nt]);const Be=s.useMemo(()=>{var Vt,Yt;const ie=P.length?P:((Vt=u.json)==null?void 0:Vt.products)??[],De=((Yt=u.json)==null?void 0:Yt.characters)??[],Je=$.scenes;return{product:Bn=>{const Nn=ie.find(xn=>xn.id===Bn)??a.find(xn=>xn.id===Bn);return Nn?go(Nn,"chip"):null},person:Bn=>{var Nn,xn;return((Nn=De.find(Sn=>Sn.id===Bn))==null?void 0:Nn.name)??((xn=r.find(Sn=>Sn.id===Bn))==null?void 0:xn.name)??null},scene:Bn=>{const Nn=Je.find(xn=>xn.id===Bn);return Nn?Qi(Nn,"chip"):null}}},[P,a,u,r,$.scenes]),Ve=s.useMemo(()=>{const ie=H?Ft.get(H):void 0;return ie||(Gt.find(De=>De.status!=="error")??Gt[0]??null)},[Ft,Gt,H]),Ge=K5(ze||null,Ft),me=s.useMemo(()=>{const ie=Ge.node;return!ie||ie.kind==="root"?null:ie.status==="running"||ie.status==="done"&&ie.images.length>0?ie:null},[Ge.node]),_e=(me==null?void 0:me.images[0])??null,W=s.useCallback(()=>tt(null),[tt]),pe=s.useRef(null),Ie=s.useCallback((...ie)=>{if(pe.current){for(const Je of ie)pe.current.add(Je);return}const De=new Set(ie);pe.current=De,queueMicrotask(()=>{pe.current=null,R(Je=>{const Vt=new URLSearchParams(Je);for(const Yt of De)Vt.delete(Yt);return Vt},{replace:!0})})},[R]),Te=s.useCallback(()=>Ie("scene","setup","presenter","product"),[Ie]);s.useEffect(()=>{!ze||!J||(Ge.node&&!me?(W(),nt({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})):Ge.missing&&(W(),nt({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})))},[ze,Ge.node,Ge.missing,me,J,W,nt]);const bt=s.useCallback(ie=>{var De;tt(ie),(De=Ke.current)==null||De.focus()},[tt]),vt=ie=>D(ie),Ct=ie=>T||/\/shots\//.test(window.location.pathname)?pt(ie,!0):vt(ie),st=s.useCallback(ie=>{for(const De of ie)se.current.set(De.id,De);Jt.current.insert(ie),j(ie),gt()},[j,gt]),$t=s.useCallback(async()=>{try{await y(),await Jt.current.refresh(),I(null)}catch(ie){I(String(ie.message??ie))}},[y]),An=s.useCallback(ie=>j([ie]),[j]),{archive:Y,archiveBatch:he,unarchive:Me,unarchiveBatch:Ye}=kie(An),dt=s.useCallback(ie=>Jt.current.drop(ie),[]),{remove:wt,removeBatch:Zt}=Sie(dt);s.useEffect(()=>{T&&D(T)},[T]);const Ht=s.useRef(new Set),pn=async ie=>{var De,Je;if(ie.status==="running"||Ht.current.has(ie.id))return ie.id;if(ie.status==="error"||ie.status==="cancelled"){Ht.current.add(ie.id);try{const Vt=await Re.retryNode(ie.id);return j([Vt]),gt(),Vt.id}catch(Vt){return nt(nn(Vt,"Could not run this again")),null}finally{Ht.current.delete(ie.id)}}try{const Vt=await Re.node(ie.id),Yt=await Re.addNode({projectId:Nt,parentId:ie.parentId,kind:ie.kind==="edit"?"edit":"generation",prompt:Vt.prompt,engineId:ie.engineId,count:1,brief:ie.brief,...ie.kind==="edit"&&((De=ie.brief)!=null&&De.sourceImage)?{sourceImage:ie.brief.sourceImage}:{}});return st((Je=Yt.siblings)!=null&&Je.length?Yt.siblings:[Yt]),(Yt==null?void 0:Yt.id)??null}catch(Vt){return nt(nn(Vt,"Could not run this again")),null}},Wt=async ie=>{try{await Re.cancelNode(ie.id),j([{...ie,status:"cancelled"}]),gt()}catch(De){nt(nn(De,"Could not cancel this shot"))}},wn=s.useCallback(ie=>{var De,Je,Vt;ie!=null&&ie.scene&&((De=Ke.current)==null||De.applyScene(ie.scene)),ie!=null&&ie.scenesPanel&&((Je=Ke.current)==null||Je.openAttach("Scenes")),(Vt=Ke.current)==null||Vt.focus()},[]);s.useEffect(()=>{var De;if(C.get("compose")===null)return;const ie=C.get("attach")==="all";wn(),ie&&((De=Ke.current)==null||De.showAttach()),Ie("compose",...ie?["attach"]:[])},[C,wn,Ie]);const sn=C.get("showcase"),In=s.useRef(null);s.useEffect(()=>{if(!sn||!l||In.current===sn)return;In.current=sn;const ie=i.find(De=>De.id===sn);ie?(Se($6(ie)),nt({kind:"info",title:`Starting from "${ie.title}"`})):nt({kind:"info",title:"That example is no longer available",detail:"Starting from scratch instead."}),R(De=>{const Je=new URLSearchParams(De);return Je.delete("showcase"),Je},{replace:!0})},[sn,l,i,R,nt]);const Dt=async(ie,De=!ie.kept)=>{j([{...ie,kept:De}]);try{j([await Re.keep(ie.id,De)])}catch(Je){j([ie]),nt(nn(Je,"Could not update keeper status"))}},On=s.useMemo(()=>[...ae].map(ie=>Ft.get(ie)).filter(ie=>!!ie),[Ft,ae]),Et=async()=>{const ie=!(On.length>0&&On.every(Je=>Je.kept)),De=On.filter(Je=>Je.kept!==ie);j(De.map(Je=>({...Je,kept:ie})));try{j(await Promise.all(De.map(Je=>Re.keep(Je.id,ie))))}catch(Je){j(De),nt(nn(Je,"Could not update keeper status"))}},Hn=ie=>{const De=ie.map(Je=>Ft.get(Je)).filter(Je=>!!Je&&!Je.archived);De.length&&j(De.map(Je=>({...Je,archived:!0}))),re(new Set),he(ie).then(Je=>{Je||j(De)})},Ot=ie=>{const De=ie.map(Je=>Ft.get(Je)).filter(Je=>!!Je&&Je.archived);De.length&&j(De.map(Je=>({...Je,archived:!1}))),re(new Set),Ye(ie).then(Je=>{Je||j(De)})},tn=s.useCallback((ie,De)=>{et.current={...et.current,[ie]:De},E(ie,De)},[E]),Vn=async ie=>{try{const De=await Re.addToSet(ie.id,[...ae]);tn(ie.id,De.nodeIds),re(new Set),(e||xt)&&Jt.current.refresh()}catch(De){nt(nn(De,"Could not add to the set"))}},ur=async(ie,De)=>{const Je=et.current[ie.id]??[],Vt=Je.filter(Yt=>!De.includes(Yt));tn(ie.id,Vt),re(Yt=>{if(!De.some(Nn=>Yt.has(Nn)))return Yt;const Bn=new Set(Yt);for(const Nn of De)Bn.delete(Nn);return Bn}),(e==null?void 0:e.id)===ie.id&&Jt.current.drop(De);try{const Yt=await Re.removeFromSet(ie.id,De);tn(ie.id,Yt.nodeIds),xt&&Jt.current.refresh()}catch(Yt){tn(ie.id,Je),((e==null?void 0:e.id)===ie.id||xt)&&Jt.current.refresh(),nt(nn(Yt,"Could not remove from the set"))}},Zr=ie=>ur(ie,[...ae]),zn=(ie,De)=>ur(De,[ie.id]),yn=s.useRef([]),[Va,ko]=s.useState(!1);s.useEffect(()=>{Va&&ko(!1)},[Va]);const So=async(ie,De)=>{const Je=De.trim();if(Je)try{const Vt=await Re.createSet(u.id,Je);if(S(Vt),ie.length>0){const Yt=await Re.addToSet(Vt.id,ie);tn(Vt.id,Yt.nodeIds)}re(new Set),M(t0(u,Vt))}catch(Vt){nt(nn(Vt,"Could not create the set"))}},ul=()=>{const ie=yn.current;return yn.current=[],ie},wa=async ie=>{if(!e)return;const De=ie.trim();if(!(!De||De===e.name))try{const Je=await Re.renameSet(e.id,De);x(Je),M(t0(u,Je),{replace:!0}),y()}catch(Je){nt(nn(Je,"Could not rename the set"))}},Eo=async()=>{if(e)try{await Re.deleteSet(e.id),k(e.id),M(mr(u),{replace:!0}),y()}catch(ie){nt(nn(ie,"Could not delete the set"))}},ya=async ie=>{var Sn;const De=((Sn=/\/shots\/([^/?#]+)/.exec(window.location.pathname))==null?void 0:Sn[1])??null,Je=De?Ft.get(De)??null:Ve;if(!Je)return;if(ie==="left"||ie==="right"){const{prev:hs,next:cd}=o6(Gt,Je.id),ui=ie==="left"?hs:cd;ui&&Ct(ui.id);return}const Vt=await Re.lineage(Je.id).catch(()=>null);if(!Vt)return;const Yt=Vt.history??[...Vt.ancestors,Je,...Vt.children.slice(0,1)],{prev:Bn,next:Nn}=o6(Yt.filter(hs=>hs.id===Je.id||hs.images[0]),Je.id),xn=ie==="up"?Bn:Nn;xn&&Ct(xn.id)};s.useEffect(()=>{const ie=De=>{var Nn,xn;if(De.defaultPrevented)return;const Je=document.activeElement,Vt=((Je==null?void 0:Je.tagName)??"").toUpperCase(),Yt=Vt==="INPUT"||Vt==="TEXTAREA"||Vt==="SELECT"||!!(Je!=null&&Je.closest('[contenteditable="true"]'))||!!(Je!=null&&Je.closest('[role="separator"]')),Bn=!!(Je!=null&&Je.closest('button, a[href], [role="button"], [role="tab"], [role="menuitem"]'));if(De.key==="Enter"&&(De.metaKey||De.ctrlKey)){(Nn=Ke.current)==null||Nn.submit(),De.preventDefault();return}if(!Yt){if(De.key==="?"){O(!0),De.preventDefault();return}if(De.key==="/"&&!T){(xn=Ke.current)==null||xn.focus(),De.preventDefault();return}if(De.key==="Escape"&&K){O(!1),De.preventDefault();return}if(De.key==="Escape"&&T){it(),De.preventDefault();return}if(De.key==="Escape"&&ae.size>0){re(new Set),De.preventDefault();return}if(De.key==="Escape"&&ze){W(),De.preventDefault();return}if(Ve){if(De.key==="b"&&Ve.kind!=="root"&&Ve.status==="done"&&Ve.images.length>0){bt(Ve.id),De.preventDefault();return}if(De.key==="k"&&Ve.kind!=="root"&&Ve.status==="done"){Dt(Ve),De.preventDefault();return}De.key==="ArrowLeft"?(ya("left"),De.preventDefault()):De.key==="ArrowRight"?(ya("right"),De.preventDefault()):De.key==="ArrowUp"?(ya("up"),De.preventDefault()):De.key==="ArrowDown"?(ya("down"),De.preventDefault()):De.key==="Enter"&&!T&&Ve.kind!=="root"&&!Bn?pt(Ve.id):De.key==="."&&!T&&F&&te()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[Ve,T,K,ae.size,ze,bt,tt,h,F]);const ba=ie=>re(De=>{const Je=new Set(De);return Je.delete(ie)||Je.add(ie),Je}),Vr=J&&en!==null&&en.total===0,ts=X||Vr&&F,Gs=Vr?o.jsx(Nie,{entries:i,catalogs:{demoProducts:a,presenters:r,scenes:n},stagedId:xe,productHref:ie=>la(u,ie),presenterHref:ie=>ha(u,ie),sceneHref:ie=>_r(u,ie),onUse:ie=>{ee(ie.id),Se($6(ie))}}):Ue.trim()?o.jsx(Xd,{text:`No shots match “${Ue.trim()}”.`,onAll:Ee,actionLabel:"Clear search"}):St==="keepers"?o.jsx(Xd,{text:"No keepers yet. Star a shot and it lands here.",onAll:()=>ue(null)}):St==="archived"?o.jsx(Xd,{text:"Nothing archived.",onAll:()=>ue(null)}):e?o.jsx(Xd,{text:"Nothing in this set yet. Pick shots on All, then add them here."}):xt?o.jsx(Xd,{text:"Every shot is already in a set.",onAll:()=>Xe(null)}):null,za=s.useRef(0);!Ue.trim()&&en&&(za.current=en[St]);const[Pr,Lr]=fa(Dr.feedCounts,null);s.useEffect(()=>{if(!en)return;const ie={brandId:u.id,all:en.all,keepers:en.keepers,archived:en.archived};Lr(De=>De&&De.brandId===ie.brandId&&De.all===ie.all&&De.keepers===ie.keepers&&De.archived===ie.archived?De:ie)},[u.id,en,Lr]);const Ba=s.useMemo(()=>en?{all:en.all,keepers:en.keepers,archived:en.archived}:(Pr==null?void 0:Pr.brandId)===u.id?{all:Pr.all,keepers:Pr.keepers,archived:Pr.archived}:null,[en,Pr,u.id]),ci={byId:Ft,items:Gt,loadMore:ut.loadMore,complete:ut.complete,rootId:h,recent:p,loaded:J,setsFor:ie=>At.get(ie)??[],brand:u,engines:t,projectId:Nt,close:it,select:Ct,retry:ie=>{pn(ie).then(De=>{De&&Ct(De)})},cancel:ie=>void Wt(ie),keep:ie=>void Dt(ie),reload:$t,remix:ie=>{var Bn;const De=(Bn=ie.brief)==null?void 0:Bn.tokens,Je=ie.prompt??ie.promptHead,Vt=De!=null&&De.length||!Je?ie.brief:{...ie.brief,tokens:[{t:"text",v:Je}]},Yt=Vt!=null&&Vt.tokens?{...Vt,tokens:v6(u,Vt.tokens)}:Vt;Se({...Yt,_at:Date.now()}),Yt&&_M(u.id,{tokens:$v(Yt),tplFields:Yt.templateFields??{}}),it(),nt({kind:"info",title:"Starting from this shot",detail:"Its prompt, chips and settings are in the composer. Change anything, then Generate."}),Q.current=!0},branch:ie=>{bt(ie.id),it()},archive:ie=>Y(ie).then(De=>{De&&it()}),unarchive:ie=>Me(ie).then(()=>{}),delete:ie=>void wt(ie).then(()=>it()),landed:st,refined:(ie,De)=>{De==="edit"&&tt(ie)},subscribeActivity:N,tokenNames:Be};return o.jsxs("div",{className:"sc-work","data-assets":ts,children:[o.jsxs("main",{className:"sc-canvas",id:"main","data-page-scroll":"","data-firstrun":Vr||void 0,onClick:ie=>{if(ae.size===0&&!H)return;const De=ie.target;De.closest(".sc-cell")||De.closest("button, a, input, select, textarea, label, [role], [contenteditable]")||(re(new Set),D(null))},children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:we}),(z||ut.error)&&o.jsx("div",{className:"sc-canvas-alert",children:o.jsx(dv,{failure:kf(z??ut.error??"")})}),(!Vr||e)&&o.jsx(xie,{sets:g,active:e,ungrouped:xt,ungroupedCount:(en==null?void 0:en.ungrouped)??0,onPlaceAll:()=>e?M(mr(u)):Xe(null),onPlaceUngrouped:()=>e?M(`${mr(u)}?in=ungrouped`):Xe("ungrouped"),onOpenSet:ie=>M(t0(u,ie)),onNewSet:ie=>void So(ul(),ie),onResetNewSet:()=>{yn.current=[]},onRenameSet:ie=>void wa(ie),onDeleteSet:()=>void Eo(),askCreate:Va,lens:St,lensCounts:Ba,onLens:ie=>ue(ie==="all"?null:ie),q:Ue,onQ:ye,searchTotal:Ue.trim()?za.current:(en==null?void 0:en[St])??0,sort:Qe,onSort:Le,tile:je,onTile:de,assets:X,onAssets:te,showAssets:F}),ce&&Oe.node&&o.jsxs("div",{className:"sc-lineage-bar",children:[o.jsx("button",{type:"button",className:"sc-crumb-back",onClick:()=>ve(null),children:"All shots"}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("b",{dir:"auto",children:Sr(Oe.node)}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("span",{className:"sc-crumb-here",children:"versions"})]}),o.jsx(gie,{nodes:Gt,selectedId:H,onOpen:pt,shotHref:Fe,onRetry:ie=>void pn(ie),onCancel:ie=>void Wt(ie),onToggleKeep:ie=>void Dt(ie),onArchive:ie=>ie.archived?Me(ie):Y(ie),onDeletePermanently:wt,engineName:ie=>{var De;return(De=t.find(Je=>Je.id===ie))==null?void 0:De.displayName},picked:ae,onPick:ba,sending:Pt,onBranch:bt,branchingFrom:(me==null?void 0:me.id)??null,onVersions:ve,tile:je,empty:J?Gs:null,pending:!J,onNearEnd:ut.complete?void 0:ut.loadMore,inSet:e,setsFor:ie=>At.get(ie)??[],onRemoveFromSet:(ie,De)=>void zn(ie,De),onKeepPicked:()=>void Et(),onArchivePicked:()=>Hn([...ae]),onRestorePicked:()=>Ot([...ae]),onDeletePicked:()=>void Zt([...ae]).then(()=>re(new Set)),onRemovePickedFromSet:ie=>void Zr(ie)})]}),ts&&o.jsx("div",{className:"sc-assets-backdrop",onClick:()=>B(!1),"aria-hidden":!0}),o.jsx(Qoe,{open:K,onOpenChange:O}),F&&o.jsx(bie,{brand:u,shots:p,shotsTotal:(Ba==null?void 0:Ba.all)??0,attached:U,full:ne,onToken:ie=>{var De;return(De=Ke.current)==null?void 0:De.insertToken(ie)},offToken:ie=>{var De;return(De=Ke.current)==null?void 0:De.removeToken(ie)},onTemplate:ie=>{var De;return(De=Ke.current)==null?void 0:De.applyScene(ie)},offTemplate:()=>{var ie;return(ie=Ke.current)==null?void 0:ie.removeTemplate()},onClose:()=>B(!1)}),o.jsxs(VM,{full:!ts,children:[o.jsx(rw,{}),ae.size>0&&o.jsx(Mie,{count:ae.size,sets:g,activeSet:e,onAdd:ie=>void Vn(ie),onRemove:e?()=>void Zr(e):void 0,onNew:()=>{yn.current=[...ae],ko(!0)},onClear:()=>re(new Set),onKeep:()=>void Et(),onArchiveBatch:ie=>Hn(ie),allKept:On.length>0&&On.every(ie=>ie.kept),archivedLens:St==="archived",pickedIds:[...ae],onRestoreBatch:ie=>Ot(ie),onDeleteBatch:ie=>void Zt(ie).then(()=>re(new Set)),loaded:Gt.length,onSelectAll:()=>re(new Set(Gt.map(ie=>ie.id)))}),o.jsx(tw,{ref:Ke,projectId:Nt||null,brand:u,engines:t,parentId:h,initialBrief:le,suppressDraftRestore:sn!==null,startScene:C.get("scene")??void 0,startSetup:C.get("setup")??void 0,startPresenter:C.get("presenter")??void 0,startProduct:C.get("product")??void 0,onSeedsSpent:Te,openAttachTab:C.get("attach")==="scenes"?"Scenes":C.get("attach")==="products"?"Products":void 0,target:me,onClearTarget:W,onRestoreBranchId:tt,guided:!0,setSlug:(e==null?void 0:e.slug)??null,onSending:Ut,onAttached:G,onCeiling:q,sourceImage:_e??void 0,onQueued:(ie,De,Je,Vt)=>{Se(null),R(xn=>{const Sn=new URLSearchParams(xn);return Sn.delete("scene"),Sn.delete("attach"),Sn.delete("presenter"),Sn.delete("product"),Sn},{replace:!0});const Yt=()=>Ut(null),Bn=()=>{De!=="edit"||!ie||R(xn=>{const Sn=new URLSearchParams(xn);return Sn.set("branch",ie),Sn},{replace:!0})},Nn=()=>{st(Vt??[]),Bn(),Yt()};e&&ie?Re.addToSet(e.id,Je!=null&&Je.length?Je:[ie]).then(xn=>tn(e.id,xn.nodeIds)).catch(xn=>nt(nn(xn,"Could not add to the set"))).finally(Nn):Nn()}})]}),o.jsx(uc,{context:ci})]})}function Iie(e){var t;return Bu((t=e.brief)==null?void 0:t.format)}function Fie(e){var n,r,a;const t=(a=(r=(n=e.brief)==null?void 0:n.rendered)==null?void 0:r.sizes)==null?void 0:a[0];return t&&t[0]>0&&t[1]>0?t:null}const _ie=e=>({"--sc-pic-ar":e[0]/e[1],"--sc-pic-w":`${e[0]}px`});function Zie({node:e,onRetry:t,onCancel:n,engineName:r,menu:a}){const[i,l]=s.useState(null),[,u]=s.useState(0);if(s.useEffect(()=>{if(e.status!=="running")return;const g=setInterval(()=>u(v=>v+1),1e3);return()=>clearInterval(g)},[e.status]),e.kind==="root")return o.jsx(d0,{className:"sc-frame",p:"8",children:o.jsxs(js,{direction:"column",align:"center",gap:"2",py:"6",children:[o.jsx(Ql,{className:"sc-display",size:"7",align:"center",children:"Blank canvas, full brand."}),o.jsx(Ql,{color:"gray",size:"2",align:"center",children:"Pick a Template below (engineered briefs, your product attached) or describe a visual."})]})});if(e.status==="running")return o.jsxs("div",{className:"sc-stage-wait",style:{"--sc-wait-ar":Iie(e)},children:[o.jsx("span",{className:"sc-shimmer"}),o.jsxs("div",{className:"sc-stage-wait-say",children:[o.jsx("span",{className:"sc-stage-wait-t",role:"status","aria-label":`${vv(Oi(e))}, ${nc(Oi(e))} seconds`,children:rc(Oi(e))}),n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-urgent":nc(Oi(e))>=60||void 0,onClick:n,children:"Cancel"})]})]});if(e.status==="cancelled"||e.status==="error"){const v=e.status==="cancelled"?xA():kf(e.error,r);return o.jsx(Vj,{failure:v,density:"stage",onRetry:t})}const f=e.status==="done"?e.images[0]:void 0,h=f?Fie(e)??(i==null?void 0:i.size)??null:null,p=f?o.jsx(d0,{className:h?"sc-frame sc-stage-pic":"sc-frame sc-stage-free",style:h?_ie(h):void 0,children:o.jsx(Vie,{hash:f,alt:e.promptHead,onPainted:(g,v,w)=>l({hash:g,size:[v,w]})})}):o.jsx(js,{justify:"center",children:o.jsx(d0,{className:"sc-frame",style:{display:"inline-block",maxWidth:"100%"}})});return a?o.jsxs(ff,{children:[o.jsx(hf,{children:p}),a]}):p}function Vie({hash:e,alt:t,onPainted:n}){const[r,a]=s.useState(null),i=s.useRef(null),l=r===e,u=h=>{!(h!=null&&h.complete)||!h.naturalWidth||h.src!==new URL(Mr(e),location.href).href||i.current!==e&&(i.current=e,a(e),n==null||n(e,h.naturalWidth,h.naturalHeight))},f=i.current&&i.current!==e?Mr(i.current):dn(e,"tile");return o.jsxs(d0,{position:"relative",style:{lineHeight:0},children:[!l&&o.jsx("img",{className:"sc-stage-under",src:f,alt:"","aria-hidden":!0,decoding:"async"}),o.jsx("img",{ref:u,src:Mr(e),alt:t,className:"sc-stage-img","data-ready":l||void 0,onLoad:h=>u(h.currentTarget)})]})}const zie=e=>((e==null?void 0:e.tokens)??[]).filter(t=>t&&typeof t.t=="string");function YR(e,t){return zie(e.brief).map(r=>{var a;switch(r.t){case"text":return typeof r.v=="string"?r.v:"";case"product":return t.product(String(r.id))??"a product";case"character":return t.person(String(r.id))??"a presenter";case"template":return t.scene(String(r.id))??"a scene";case"color":return String(r.name??r.hex??"");case"ref":return"the attached reference";case"mark":return((a=t.mark)==null?void 0:a.call(t,String(r.imageHash)))??"the brand mark";default:return""}}).join(" ").replace(/\s+/g," ").replace(/\s+([.,!?;:])/g,"$1").trim()||e.prompt||e.promptHead||""}const Bie=e=>e===0?"Original":`Refinement ${e}`,Uie=e=>e===0?"the original":`Refinement ${e}`,Wie=(e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id);function Kie(e,t,n){const r=new Set(e.map(g=>g.id)),a=n.filter(g=>!r.has(g.id)&&g.parentId!==null&&r.has(g.parentId)),i=a.length?[...e,...a].sort(Wie):e,u=(i.some(g=>g.id===t.id)?i:[...i,t]).map(g=>g.id===t.id?t:g).filter(g=>g.id===t.id||g.images[0]);let f=0;const h=u.map(g=>{const v=g.kind==="edit"?++f:0;return{node:g,index:v,label:Bie(v),from:null,state:g.images[0]?"ready":g.status==="running"?"pending":"failed"}}),p=new Map(h.map((g,v)=>[g.node.id,v]));return h.map((g,v)=>{if(v===0||!g.node.parentId||g.node.parentId===h[v-1].node.id)return g;const w=p.get(g.node.parentId);return w===void 0?g:{...g,from:Uie(h[w].index)}})}function qR(e,t){var a;const n=e.find(i=>i.node.id===t);if(!n)return"";const r=((a=e[e.length-1])==null?void 0:a.index)??0;return n.index===0?"Original":`Refinement ${n.index} of ${r}`}const rh=28;function Gie({trail:e,activeId:t,names:n,onSelect:r}){var w;const a=s.useRef(null),i=s.useMemo(()=>e.map(y=>YR(y.node,n)),[e,n]),l=od(),u=(y,x,k)=>l.open({key:y.node.id,src:dn(y.node.images[0],"tile"),label:y.label,said:i[x],from:y.from,el:k,id:y.node.id});s.useEffect(()=>{var y,x;(x=(y=a.current)==null?void 0:y.querySelector('[aria-pressed="true"]'))==null||x.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[t]);const[f,h]=s.useState(null);s.useEffect(()=>{const y=a.current;if(!y)return;const x=()=>{const E=y.scrollWidth-y.clientWidth;if(E<=1)return h(null);const j=y.scrollLeft;h(j<=1?"end":j>=E-1?"start":"both")},k=()=>{const E=y.querySelector('[aria-pressed="true"]');if(!E)return;const j=E.getBoundingClientRect(),N=y.getBoundingClientRect();j.left<N.left+rh?y.scrollLeft-=N.left+rh-j.left:j.right>N.right-rh&&(y.scrollLeft+=j.right-(N.right-rh))};x(),y.addEventListener("scroll",x,{passive:!0});const S=new ResizeObserver(()=>{k(),x()});return S.observe(y),()=>{y.removeEventListener("scroll",x),S.disconnect()}},[e.length]),s.useEffect(()=>{const y=a.current;if(!y)return;const x=k=>{y.scrollWidth<=y.clientWidth||Math.abs(k.deltaY)<=Math.abs(k.deltaX)||(k.preventDefault(),y.scrollLeft+=k.deltaY)};return y.addEventListener("wheel",x,{passive:!1}),()=>y.removeEventListener("wheel",x)},[]);const p=y=>{var E,j;const x=[...((E=a.current)==null?void 0:E.querySelectorAll(".sc-trail-tile:not([aria-disabled])"))??[]],k=x.indexOf(document.activeElement);let S=-1;if(y.key==="ArrowRight")S=Math.min(x.length-1,k+1);else if(y.key==="ArrowLeft")S=Math.max(0,k-1);else if(y.key==="Home")S=0;else if(y.key==="End")S=x.length-1;else return;y.preventDefault(),y.stopPropagation(),(j=x[S])==null||j.focus()},g=e.some(y=>y.node.id===t)?t:(w=e[0])==null?void 0:w.node.id,v=qR(e,t);return o.jsxs("div",{className:"sc-trail",children:[v&&o.jsx("span",{className:"sc-trail-say",children:v}),o.jsx("nav",{ref:a,className:"sc-thumbs","aria-label":"History of this shot","data-more":f??void 0,onKeyDown:p,children:e.map((y,x)=>{const k=y.node,S=k.id===t,E=y.state==="pending";return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-trail-tile","data-original":y.index===0&&e.length>1?"":void 0,"aria-label":i[x]?`${y.label}: ${i[x]}`:y.label,"aria-pressed":S,"aria-disabled":E||void 0,tabIndex:k.id===g?0:-1,onClick:()=>{E||(l.closeNow(),r(k.id))},onPointerEnter:j=>j.pointerType==="mouse"&&y.state==="ready"&&u(y,x,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&l.close(),onFocus:j=>Xp(j.currentTarget)&&y.state==="ready"&&u(y,x,j.currentTarget),children:y.state==="ready"?o.jsx("img",{src:dn(k.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":S,width:52,height:52}):E?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":S,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":S,children:o.jsx(kc,{size:14})})},k.id)})}),l.shown&&o.jsx(ad,{anchor:l.shown.el,kind:"shot",src:l.shown.src,label:l.shown.label,noun:l.shown.said,note:l.shown.from?`From ${l.shown.from}`:null,onOpen:()=>{var x;const y=(x=l.shown)==null?void 0:x.id;l.closeNow(),y&&r(y)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const Yie=200,G5=32;function qie({shots:e,activeId:t,onSelect:n,onEndReached:r,complete:a}){var y;const i=s.useRef(null),l=od(),u=(x,k)=>l.open({key:x.id,src:dn(x.images[0],"tile"),label:Sr(x),el:k,id:x.id}),f=s.useRef(!1);s.useLayoutEffect(()=>{var k;const x=(k=i.current)==null?void 0:k.querySelector('[aria-pressed="true"]');x&&(x.scrollIntoView({block:"center",behavior:f.current?"smooth":"auto"}),f.current=!0)},[t]);const h=s.useRef(null),p=()=>{const x=i.current,k=h.current;if(!x||!k)return;const S=x.scrollHeight-x.clientHeight,E=x.scrollTop;k.style.setProperty("--sc-shotrail-start",S>1?Math.min(1,E/G5).toFixed(3):"0"),k.style.setProperty("--sc-shotrail-end",S>1?Math.min(1,(S-E)/G5).toFixed(3):"0")};s.useLayoutEffect(()=>{const x=i.current;if(!x)return;p();const k=new ResizeObserver(p);return k.observe(x),()=>k.disconnect()},[e.length]);const g=()=>{p();const x=i.current;!x||a||x.scrollTop+x.clientHeight>=x.scrollHeight-Yie&&r()},v=x=>{var j,N;const k=[...((j=i.current)==null?void 0:j.querySelectorAll(".sc-shotrail-tile:not([aria-disabled])"))??[]],S=k.indexOf(document.activeElement);let E=-1;if(x.key==="ArrowDown")E=Math.min(k.length-1,S+1);else if(x.key==="ArrowUp")E=Math.max(0,S-1);else if(x.key==="Home")E=0;else if(x.key==="End")E=k.length-1;else return;x.preventDefault(),x.stopPropagation(),(N=k[E])==null||N.focus()},w=e.some(x=>x.id===t)?t:(y=e[0])==null?void 0:y.id;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:h,className:"sc-shotrail-shell",children:o.jsx("nav",{ref:i,className:"sc-shotrail","aria-label":"Shots in this view",onScroll:g,onKeyDown:v,children:e.map(x=>{const k=x.id===t,S=x.status==="running",E=x.status==="done"&&!!x.images[0];return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-shotrail-tile","aria-label":S?`${Sr(x)}, still rendering`:Sr(x),"aria-pressed":k,"aria-disabled":S||void 0,tabIndex:x.id===w?0:-1,onClick:()=>{S||(l.closeNow(),n(x.id))},onPointerEnter:j=>j.pointerType==="mouse"&&E&&u(x,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&l.close(),onFocus:j=>Xp(j.currentTarget)&&E&&u(x,j.currentTarget),children:E?o.jsx("img",{src:dn(x.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":k,width:52,height:52}):S?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":k,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":k,children:o.jsx(kc,{size:14})})},x.id)})})}),l.shown&&o.jsx(ad,{anchor:l.shown.el,kind:"shot",noun:"Shot",side:"beside",src:l.shown.src,label:l.shown.label,onOpen:()=>{var k;const x=(k=l.shown)==null?void 0:k.id;l.closeNow(),x&&n(x)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const Xie=60;function Qie({onLeft:e,onRight:t}){const n=s.useRef(null);return{onPointerDown:r=>{r.pointerType!=="mouse"&&(n.current={id:r.pointerId,x:r.clientX,y:r.clientY})},onPointerUp:r=>{const a=n.current;if(n.current=null,!a||a.id!==r.pointerId)return;const i=r.clientX-a.x,l=r.clientY-a.y;Math.abs(i)<Xie||Math.abs(i)<2*Math.abs(l)||(i<0?e():t())},onPointerCancel:()=>{n.current=null}}}function Jie(e){const t=Dn(),n=od(),{shown:r,closeNow:a}=n,[i,l]=s.useState(null),u=i??r,f=()=>{l(null),a()};s.useEffect(()=>{if(!i)return;const w=y=>{const x=y.target;x!=null&&x.closest(".sc-chip-preview")||x!=null&&x.closest(e)||l(null)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[i,e]);const[h,p]=s.useState(null),g=w=>({"data-open":(u==null?void 0:u.key)===w.key||void 0,"aria-haspopup":"dialog",onPointerEnter:y=>y.pointerType==="mouse"&&!i&&n.open({...w,el:y.currentTarget}),onPointerLeave:y=>y.pointerType==="mouse"&&n.close(),onFocus:y=>Xp(y.currentTarget)&&!i&&n.open({...w,el:y.currentTarget}),onClick:y=>{if((i==null?void 0:i.key)===w.key){f();return}a(),l({...w,el:y.currentTarget})}}),v=o.jsxs(o.Fragment,{children:[u&&o.jsx(ad,{anchor:u.el,kind:u.kind,src:sr(u.src,"tile"),label:u.label,onOpen:()=>{const w=u;f(),w.to?t(w.to):p({src:sr(w.src,"full"),kind:w.kind,label:w.label})},onHoverIn:n.keep,onHoverOut:()=>!i&&n.close(),onClose:f},u.key),h&&o.jsx(Uu,{src:h.src,kind:h.kind,label:h.label,onClose:()=>p(null)})]});return{bind:g,isOpen:w=>(u==null?void 0:u.key)===w,surface:v}}function ele({brief:e,prompt:t,brand:n,saidRef:r,expanded:a,clamped:i}){var $,M;const{scenes:l,presenters:u,demoProducts:f}=Rn(),h=Jie(".sc-ingredient"),p=(e==null?void 0:e.tokens)??[],g=(($=n==null?void 0:n.json)==null?void 0:$.products)??[],v=((M=n==null?void 0:n.json)==null?void 0:M.characters)??[],w=Cc(n),y=xf(n==null?void 0:n.json),[x,k]=s.useState({});s.useEffect(()=>{for(const C of p){if((C==null?void 0:C.t)!=="template")continue;const R=w.find(H=>H.id===C.id);if(!(R!=null&&R.previewUrl)||Mu(R.previewColor))continue;const T=`t${C.id}`;TM(R.previewUrl).then(H=>{const D=Mu(H??void 0);D&&k(K=>K[T]?K:{...K,[T]:D})})}});const S={products:g,demoProducts:f,cast:v,presenters:u,scenes:[...w,...l]},E=C=>{var T,H;const R=AM(C,S);if((R==null?void 0:R.kind)==="product"){const{product:D,demo:K}=R;return{key:`p${C.id}`,kind:"product",label:(D==null?void 0:D.name)??(K==null?void 0:K.name)??"product",thumb:D?Bp((H=(T=D==null?void 0:D.shots)==null?void 0:T[0])==null?void 0:H.file,"micro"):(K==null?void 0:K.previewUrl)??null,to:n&&(D||K)?la(n,C.id):void 0}}if((R==null?void 0:R.kind)==="presenter"){const{character:D,presenter:K}=R,O=(K==null?void 0:K.id)??(D==null?void 0:D.presenterId)??((D==null?void 0:D.origin)==="custom"?D.id:void 0),Z=D?xv(D):K?ti(K):{src:null};return{key:`h${C.id}`,kind:"presenter",label:D!=null&&D.supersededBy?`${D.name}, edited since`:(D==null?void 0:D.name)??(K==null?void 0:K.name)??"someone",thumb:Z.src,crop:Z.crop,to:n&&O?ha(n,O):void 0}}if((R==null?void 0:R.kind)==="scene"){const D=R.scene;return{key:`t${C.id}`,kind:"scene",label:(D==null?void 0:D.name)??"a scene no longer in the catalog",thumb:(D==null?void 0:D.previewUrl)??null,to:n&&D?_r(n,D.id):void 0,tint:Mu(D==null?void 0:D.previewColor),custom:R.custom}}if((C==null?void 0:C.t)==="color")return{key:`c${C.hex}`,kind:"color",label:C.name??C.hex,swatch:C.hex};if((C==null?void 0:C.t)==="ref")return{key:`r${C.imageHash}`,kind:"ref",label:C.label??"reference image",thumb:dn(C.imageHash,"micro"),previewHash:C.imageHash};if((C==null?void 0:C.t)==="mark"){const D=y.find(K=>K.hash===C.imageHash);return{key:`m${C.imageHash}`,kind:"mark",label:D?qp(n==null?void 0:n.json,D):"brand mark",thumb:dn(C.imageHash,"micro"),previewHash:C.imageHash}}return null},j=C=>{const R=o.jsxs(o.Fragment,{children:[C.thumb?o.jsx("img",{src:C.thumb,alt:"","data-crop":C.crop}):C.swatch?o.jsx("i",{style:{background:C.swatch}}):null,C.label]}),T=C.tint??(C.custom?x[C.key]:void 0),H=T?{"--tint":T}:void 0,D=(C.previewHash?dn(C.previewHash,"tile"):sr(C.thumb,"tile"))??(C.to?"":null);if(D!==null&&yh(C.kind)){const K=C.kind,O=h.isOpen(C.key),Z={key:C.key,src:D,kind:K,label:C.label,to:C.to};return o.jsx("button",{type:"button",className:"sc-ingredient","data-kind":C.kind,"data-tinted":T?"":void 0,style:H,title:O?void 0:`${C.label}. Preview.`,"aria-label":`${C.label}. Preview.`,...h.bind(Z),children:R},C.key)}return o.jsx("span",{className:"sc-ingredient","data-kind":C.kind,"data-tinted":T?"":void 0,style:H,title:`${C.kind}: ${C.label}`,children:R},C.key)},N=[];for(const C of p){if(C.t==="text"){const T=C.v.trim();T&&N.push(T);continue}const R=E(C);R&&N.push(j(R))}if(!N.length&&!t)return null;const P=N.flatMap((C,R)=>R?[" ",C]:[C]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:r,className:"sc-brief-said","data-expanded":a||void 0,"data-clamped":i||void 0,dir:"auto",children:P.length?P:t||""}),h.surface]})}const tle=256,_l=new Map;function Y5(e,t){for(_l.delete(e),_l.set(e,t);_l.size>tle;)_l.delete(_l.keys().next().value)}function nle(e,t){const n=new Map(e.map(a=>[a.id,a])),r=[];for(let a=t.parentId?n.get(t.parentId):void 0;a;a=a.parentId?n.get(a.parentId):void 0)r.unshift(a);return{ancestors:r,siblings:e.filter(a=>a.parentId===t.parentId),children:e.filter(a=>a.parentId===t.id),history:e}}function rle(e,t){Y5(e,t);for(const n of t.history??[])n.id!==e&&Y5(n.id,nle(t.history??[],n))}function sle(e){var i;const[t,n]=s.useState(()=>{const l=_l.get(e.id);return l?{id:e.id,lineage:l}:null});s.useEffect(()=>{let l=!0;return Re.lineage(e.id).then(u=>{l&&(rle(e.id,u),n({id:e.id,lineage:u}))}).catch(()=>{}),()=>{l=!1}},[e.id,e.childCount,e.status,e.parentId]);const r=(t==null?void 0:t.id)===e.id?t.lineage:_l.get(e.id)??null;if(!r)return{ancestors:[],children:[],siblings:[e],sibIndex:0,parentShot:null,history:null,rootId:e.id,loaded:!1};const a=r.siblings.some(l=>l.id===e.id)?r.siblings:[e,...r.siblings];return{ancestors:r.ancestors,children:r.children,siblings:a,sibIndex:a.findIndex(l=>l.id===e.id),parentShot:r.ancestors[r.ancestors.length-1]??null,history:r.history??null,rootId:((i=r.ancestors[0])==null?void 0:i.id)??e.id,loaded:!0}}const ale=32,Di=new Map;function ole(e){for(Di.delete(e.id),Di.set(e.id,e);Di.size>ale;)Di.delete(Di.keys().next().value)}function ile(e){const[t,n]=s.useState(()=>Di.get(e.id)??null);return s.useEffect(()=>{const r=Di.get(e.id);if(r){n(r);return}let a=!0;return Re.node(e.id).then(i=>{a&&(ole(i),n(i))}).catch(()=>{}),()=>{a=!1}},[e.id]),(t==null?void 0:t.id)===e.id?t:Di.get(e.id)??null}const lle="(max-width: 1023px)",XR=380,QR=480,q5=380,ou=e=>Math.min(QR,Math.max(XR,Math.round(e)));function cle({node:e,rootId:t,items:n,loadMore:r,complete:a,brand:i,engines:l,projectId:u,onClose:f,onSelect:h,onRetry:p,onCancel:g,onKeep:v,onLanded:w,onRemix:y,onArchive:x,onUnarchive:k,onDelete:S,onRefined:E,tokenNames:j}){const{ancestors:N,children:P,history:$}=sle(e),M=ile(e),C=s.useMemo(()=>l.find(Fe=>Fe.id===e.engineId),[l,e.engineId]),{push:R}=or(),[T,H]=fa(Dr.ovlPanelW,q5),D=s.useRef(0),K=s.useRef(0),O=s.useRef(null),Z=s.useMemo(()=>{var Fe;return(((Fe=e.brief)==null?void 0:Fe.tokens)??[]).some(pt=>(pt==null?void 0:pt.t)&&pt.t!=="text"&&pt.t!=="format")},[e.brief]),te=s.useMemo(()=>{const Fe=xf(i.json);return{...j,mark:pt=>{const it=Fe.find(St=>St.hash===pt);return it?qp(i.json,it):null}}},[j,i]),B=s.useMemo(()=>YR(M??e,te),[M,e,te]),[F,X]=s.useState(!1),[z,I]=s.useState(!1),[U,G]=s.useState(!1),[ne,q]=s.useState(!1),[le,Se]=s.useState(!1),[Q,xe]=s.useState(!1);s.useEffect(()=>{G(!1),xe(!1),q(!1)},[e.id]),s.useEffect(()=>{if(!U)return;const Fe=setTimeout(()=>G(!1),1400);return()=>clearTimeout(Fe)},[U]),s.useEffect(()=>{if(!Q)return;const Fe=setTimeout(()=>xe(!1),1400);return()=>clearTimeout(Fe)},[Q]);const[ee,ae]=s.useState(null);nw(ee,"--sc-ovl-dock-h");const re=s.useRef(null),[_,ue]=s.useState(!1),[We,Xe]=s.useState(!1);s.useEffect(()=>ue(!1),[e.id]),s.useLayoutEffect(()=>{const Fe=re.current;if(!Fe||_)return;const pt=()=>Xe(Fe.scrollHeight>Fe.clientHeight+1);pt();const it=new ResizeObserver(pt);return it.observe(Fe),()=>it.disconnect()},[B,_]);const ze=s.useMemo(()=>Kie($??[...N,e,...P.slice(0,6)],e,n),[$,N,e,P,n]),tt=s.useMemo(()=>ze.find(Fe=>Fe.node.id===e.id)??null,[ze,e.id]),ce=wr(lle),ve=ze.length>1&&ce?qR(ze,e.id):e.kind!=="edit"?"Shot":$&&tt?tt.label:"Refinement",Pe=s.useMemo(()=>o6(n,e.id),[n,e.id]);s.useEffect(()=>{Pe.at>=0&&!a&&n.length-Pe.at<=6&&r()},[Pe.at,n.length,a,r]);const de=Fe=>{const pt=Fe>0?Pe.next:Pe.prev;pt&&h(pt.id)},je=od(),Ue=(Fe,pt)=>Fe!=null&&Fe.images[0]?{onPointerEnter:it=>{it.pointerType==="mouse"&&je.open({key:Fe.id,src:dn(Fe.images[0],"tile"),label:Sr(Fe),noun:pt,el:it.currentTarget,id:Fe.id})},onPointerLeave:it=>{it.pointerType==="mouse"&&je.close()}}:{},ye=Qie({onLeft:()=>de(1),onRight:()=>de(-1)});s.useEffect(()=>{const Fe=je.shown;if(!Fe)return;const pt=Fe.noun==="Next shot"?Pe.next:Pe.prev;pt!=null&&pt.images[0]?je.open({key:pt.id,src:dn(pt.images[0],"tile"),label:Sr(pt),noun:Fe.noun,el:Fe.el,id:pt.id}):je.closeNow()},[e.id]),s.useEffect(()=>{var St,xt;const Fe=ze.findIndex(At=>At.node.id===e.id),it=[(St=ze[Fe-1])==null?void 0:St.node,(xt=ze[Fe+1])==null?void 0:xt.node,Pe.prev,Pe.next].filter(At=>!!(At!=null&&At.images[0])).map(At=>{var et;const Kt=new Image;return Kt.decoding="async",Kt.src=dn(At.images[0],"tile"),(et=Kt.decode)==null||et.call(Kt).catch(()=>{}),Kt});return()=>{for(const At of it)At.src=""}},[ze,e.id,Pe.prev,Pe.next]);const Ee=e.images[0],be=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",Le=async(Fe=!1)=>{if(!z){I(!0);try{const pt=fetch(Mr(Ee)).then(it=>{if(!it.ok)throw new Error(`HTTP ${it.status}`);return it.blob()});await navigator.clipboard.write([new ClipboardItem({"image/png":pt})]),Fe?R({kind:"success",title:"Copied to clipboard"}):G(!0)}catch(pt){R(nn(pt,"Copy failed"))}finally{I(!1)}}},Qe=async()=>{if(!ne){q(!0);try{await(e.archived?k(e):x(e))}finally{q(!1)}}},Ke=async()=>{if(!le){Se(!0);try{const Fe=e.brief?$v(e.brief):null;if(!Fe||Fe.every(pt=>pt.t==="text"&&!pt.v.trim()))await navigator.clipboard.writeText(B);else{const pt=xt=>{var At;switch(xt.t){case"text":return xt.v;case"product":return te.product(xt.id)??"a product";case"character":return te.person(xt.id)??"a presenter";case"template":return te.scene(xt.id)??"a scene";case"color":return xt.name??xt.hex;case"ref":return"reference image";case"mark":return((At=te.mark)==null?void 0:At.call(te,xt.imageHash))??"brand mark"}},{text:it,html:St}=GX(Fe,pt);await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([it],{type:"text/plain"}),"text/html":new Blob([St],{type:"text/html"})})])}xe(!0)}catch(Fe){R(nn(Fe,"Copy failed"))}finally{Se(!1)}}};s.useEffect(()=>{const Fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Fe}},[]);const nt=[{key:"download",label:"Download",icon:o.jsx(NC,{size:14}),onClick:()=>{const Fe=document.createElement("a");Fe.href=Mr(Ee),Fe.download=`${be}.png`,Fe.click()}},{key:"keep",label:e.kept?"Remove from keepers":"Keep",icon:o.jsx(po,{size:14,weight:e.kept?"fill":"regular"}),onClick:()=>v(e),tint:e.kept?"var(--sc-star)":void 0,on:e.kept},{key:"copy",label:"Copy image",icon:U?o.jsx(Kn,{size:14,weight:"bold"}):o.jsx(G3,{size:14}),onClick:()=>void Le(),onMenu:()=>void Le(!0),busy:z,said:U?"Copied":void 0}],gt=[{key:"archive",label:e.archived?"Restore":"Archive",icon:e.archived?o.jsx(M0,{size:14}):o.jsx(Op,{size:14}),onClick:()=>void Qe(),busy:ne},...e.archived?[{key:"delete",label:"Delete permanently",icon:o.jsx(Vp,{size:14}),onClick:()=>X(!0),tint:"var(--sc-red)",dialog:!0}]:[]],Pt=e.status==="done"&&e.images.length>0,Ut=!Pt&&e.kind!=="edit"&&!!e.brief,Nt=Pt?[...nt,...gt]:gt,cn=Pt?o.jsx(pf,{children:Nt.map(Fe=>o.jsxs(mf,{onSelect:Fe.onMenu??Fe.onClick,disabled:Fe.busy,color:Fe.tint?"red":void 0,children:[Fe.icon,Fe.label]},Fe.key))}):void 0;return Rr.createPortal(o.jsx(Gu,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:Fe=>{var pt;Fe.preventDefault(),(pt=O.current)==null||pt.focus({preventScroll:!0})},children:o.jsxs("div",{ref:O,tabIndex:-1,className:"sc-ovl","data-fb":"shot-overlay","data-fb-node":e.id,role:"dialog","aria-modal":"true","aria-label":Sr(e),"data-rail":n.length>1?"":void 0,style:{"--sc-ovl-panel-w":`${ou(T)}px`},children:[n.length>1&&o.jsx(qie,{shots:n,activeId:e.id,onSelect:h,onEndReached:r,complete:a}),o.jsxs("header",{className:"sc-ovl-bar",children:[o.jsxs("div",{className:"sc-ovl-bar-l",children:[o.jsx(lr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:f,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),Pe.at>=0&&n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Pe.prev,onClick:()=>Pe.prev&&h(Pe.prev.id),"aria-label":"Previous shot",...Ue(Pe.prev,"Previous shot"),children:o.jsx(ga,{size:13})}),o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!Pe.next,onClick:()=>Pe.next&&h(Pe.next.id),"aria-label":"Next shot",...Ue(Pe.next,"Next shot"),children:o.jsx(ol,{size:13})})]})]}),Nt.length>0&&o.jsxs("div",{className:"sc-ovl-bar-r",children:[o.jsx("div",{className:"sc-ovl-acts",children:Nt.map(Fe=>o.jsx(lr,{label:Fe.said??Fe.label,open:!!Fe.said,children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:Fe.onClick,"aria-label":Fe.label,"aria-pressed":Fe.on===void 0?void 0:Fe.on,"data-on":Fe.on||void 0,"aria-haspopup":Fe.dialog?"dialog":void 0,"aria-busy":Fe.busy||void 0,"data-busy":Fe.busy||void 0,style:Fe.tint?{color:Fe.tint}:void 0,children:Fe.icon})},Fe.key))}),o.jsxs(Ss,{children:[o.jsx(lr,{label:"More actions",children:o.jsx(Es,{children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-overflow","aria-label":"More actions",children:o.jsx(EC,{size:18,weight:"bold"})})})}),o.jsx(Cs,{align:"end",sideOffset:6,children:Nt.map(Fe=>o.jsxs(tr,{onSelect:Fe.onMenu??Fe.onClick,disabled:Fe.busy,color:Fe.tint?"red":void 0,children:[Fe.icon,Fe.label]},Fe.key))})]})]})]}),o.jsx(sf,{open:F,onOpenChange:X,children:o.jsxs(af,{maxWidth:"420px",children:[o.jsx(of,{children:"Delete this shot permanently?"}),o.jsx(lf,{size:"2",children:"This cannot be undone."}),o.jsxs(js,{gap:"3",mt:"4",justify:"end",children:[o.jsx(uf,{children:o.jsx(ia,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(cf,{children:o.jsx(ia,{color:"red",onClick:()=>S(e),children:"Delete permanently"})})]})]})}),je.shown&&o.jsx(ad,{anchor:je.shown.el,kind:"shot",noun:je.shown.noun,src:je.shown.src,label:je.shown.label,onOpen:()=>{var pt;const Fe=(pt=je.shown)==null?void 0:pt.id;je.closeNow(),Fe&&h(Fe)},onHoverIn:je.keep,onHoverOut:je.close,onClose:je.closeNow},je.shown.key),o.jsxs("div",{className:"sc-ovl-stage","data-takes":ze.length>1?"":void 0,...ye,children:[o.jsx(Zie,{node:e,onRetry:()=>p(e),onCancel:()=>g(e),engineName:C==null?void 0:C.displayName,menu:cn}),ze.length>1?o.jsx(Gie,{trail:ze,activeId:e.id,names:te,onSelect:h}):o.jsx("div",{className:"sc-trail sc-trail-empty","aria-hidden":!0})]}),o.jsx("div",{className:"sc-ovl-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize the details panel","aria-valuemin":XR,"aria-valuemax":QR,"aria-valuenow":ou(T),tabIndex:0,onPointerDown:Fe=>{Fe.button===0&&(Fe.preventDefault(),Fe.stopPropagation(),Fe.currentTarget.setPointerCapture(Fe.pointerId))},onPointerMove:Fe=>{if(!Fe.currentTarget.hasPointerCapture(Fe.pointerId))return;const pt=Fe.currentTarget.closest(".sc-ovl");D.current=Fe.clientX,!K.current&&(K.current=requestAnimationFrame(()=>{K.current=0,pt==null||pt.style.setProperty("--sc-ovl-panel-w",`${ou(window.innerWidth-D.current)}px`)}))},onPointerUp:Fe=>{Fe.currentTarget.hasPointerCapture(Fe.pointerId)&&(Fe.currentTarget.releasePointerCapture(Fe.pointerId),H(ou(window.innerWidth-Fe.clientX)))},onDoubleClick:Fe=>{Fe.stopPropagation(),H(q5)},onKeyDown:Fe=>{Fe.key==="ArrowLeft"?H(pt=>ou(pt+16)):Fe.key==="ArrowRight"&&H(pt=>ou(pt-16))}}),o.jsxs("aside",{className:"sc-ovl-meta",children:[o.jsxs("div",{className:"sc-ovl-scroll",children:[o.jsxs("div",{className:"sc-ovl-head",children:[o.jsx("b",{children:ve}),e.archived&&o.jsx("small",{className:"sc-ovl-flag",children:"archived"}),Pt&&e.costUsd>0&&o.jsxs("small",{className:"sc-ovl-spend",title:"Of your API budget",children:["$",e.costUsd.toFixed(2)]})]}),e.kind!=="root"&&(B||Z)&&o.jsxs("div",{className:"sc-ovl-sec sc-ovl-brief",children:[o.jsxs("div",{className:"sc-ovl-brief-head",children:[o.jsx("span",{className:"sc-eyebrow",children:"Prompt"}),o.jsx(lr,{label:Q?"Copied":"Copy the prompt",open:Q||void 0,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-copy","aria-label":"Copy the prompt","aria-busy":le||void 0,"data-busy":le?"":void 0,onClick:()=>void Ke(),children:Q?o.jsx(Kn,{size:14,weight:"bold"}):o.jsx(G3,{size:14})})})]}),o.jsx("div",{className:"sc-brief-record",children:o.jsx(ele,{brief:e.brief,prompt:(M==null?void 0:M.prompt)??e.promptHead,brand:i,saidRef:re,expanded:_,clamped:We&&!_})}),(We||_)&&o.jsx("button",{type:"button",className:"sc-s sc-ovl-more","aria-expanded":_,onClick:()=>ue(Fe=>!Fe),children:_?o.jsxs(o.Fragment,{children:[o.jsx(TU,{size:12})," Show less"]}):o.jsxs(o.Fragment,{children:[o.jsx(Yi,{size:12})," Show more"]})})]}),(Pt||Ut)&&o.jsxs("div",{className:"sc-sugg",children:[Ut&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Put this prompt back in the composer, to change and run again",children:[o.jsx(Ju,{size:12})," Edit the prompt"]}),Pt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>p(e),title:"Run the same setup again for a different take",children:[o.jsx(M0,{size:12})," Try again"]}),Pt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>y(e),title:"Start a new shot from this setup: same prompt, chips, shape and count, ready to change",children:[o.jsx(Ph,{size:12})," Reuse setup"]})]})]}),(Pt||e.status==="running")&&o.jsx("div",{className:"sc-ovl-edit sc-dock",ref:ae,children:o.jsx(tw,{variant:"overlay",projectId:u,brand:i,engines:l,parentId:t,target:e,sourceImage:Ee,persistDraft:!1,onQueued:(Fe,pt,it,St)=>{w(St??[]),Fe&&h(Fe),Fe&&(E==null||E(Fe,pt))}})})]})]})}),document.body)}function X5(){const{shotId:e}=Bs(),t=GT(),{push:n}=or(),r=e?t.byId.get(e)??null:null,[a,i]=s.useState(null);s.useEffect(()=>{if(!e||r)return;let f=!0;return Re.node(e).then(h=>f&&i({id:e,node:h.kind==="root"?null:h})).catch(()=>f&&i({id:e,node:null})),()=>{f=!1}},[e,r]),s.useEffect(()=>{if(!(!e||r))return t.subscribeActivity(f=>{const h=f.find(p=>p.id===e);h&&i({id:e,node:h})})},[e,r,t.subscribeActivity]);const l=r??(a!==null&&a.id===e?a.node:null),u=!r&&a!==null&&a.id===e&&a.node===null;return s.useEffect(()=>{u&&(n({kind:"info",title:"That shot is no longer available",detail:"Back to the feed."}),t.close())},[u,t.close,n]),l?o.jsx(cle,{node:l,rootId:t.rootId,items:t.items,loadMore:t.loadMore,complete:t.complete,brand:t.brand,engines:t.engines,projectId:t.projectId,onClose:t.close,onSelect:t.select,onRetry:t.retry,onCancel:t.cancel,onKeep:t.keep,onLanded:t.landed,onRefined:t.refined,tokenNames:t.tokenNames,onRemix:t.remix,onArchive:()=>t.archive(l),onUnarchive:()=>t.unarchive(l),onDelete:()=>t.delete(l)}):u?null:o.jsx("div",{className:"sc-ovl-wait",role:"status","aria-label":"Loading",children:o.jsx(xr,{size:"3"})})}function ule(){const e=HS();return o.jsx(js,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(dv,{failure:{kind:"unknown",title:"This page could not be shown.",fix:"Reloading usually brings it back.",raw:String((e==null?void 0:e.message)??e??""),retryable:!0},action:o.jsx(ia,{size:"1",variant:"soft",color:"gray",onClick:()=>window.location.reload(),children:"Reload"})})})}function dle(){const{setSlug:e=""}=Bs(),{pathname:t,search:n}=Zn(),{brand:r,sets:a,loaded:i,refresh:l}=on(),u=Dn(),f=un({path:ct.set,end:!1}),h=a.find(v=>v.slug===e)??a.find(v=>v.id===e)??null;Sc(h==null?void 0:h.name);const[p,g]=s.useState(null);if(s.useEffect(()=>{if(!i||h)return;if(p===e){u(mr(r),{replace:!0});return}let v=!0;return l().finally(()=>v&&g(e)),()=>{v=!1}},[i,h,e,p,r,u,l]),s.useEffect(()=>{h&&g(null)},[h]),!i||!h)return null;if(h.slug!==e){const v=f?t.slice(f.pathnameBase.length):"";return o.jsx(uo,{to:t0(r,h)+v+n,replace:!0})}return o.jsx(GR,{set:h},h.id)}function fle(){const{pathname:e,search:t}=Zn();return o.jsx(uo,{to:RW(e,t),replace:!0})}function hle(){const{brandSlug:e}=Bs();return o.jsx(uo,{to:`/${e}?settings=brand`,replace:!0})}function ple(){const{sceneId:e}=Bs();return o.jsxs(o.Fragment,{children:[o.jsx(Jre,{},e),o.jsx(uc,{})]})}function mle(){const{presenterId:e}=Bs();return o.jsxs(o.Fragment,{children:[o.jsx(cse,{},e),o.jsx(uc,{})]})}function gle(){const{productId:e}=Bs();return o.jsx(Yoe,{},e)}const vle=z$([{element:o.jsx(rte,{}),errorElement:o.jsx(ule,{}),children:[{index:!0,element:o.jsx(sX,{})},{path:ct.setup,element:o.jsx(ute,{})},{path:ct.legacy,element:o.jsx(fle,{})},{path:ct.brand,element:o.jsx(Qee,{}),children:[{index:!0,element:o.jsx(Zre,{})},{path:ct.hub,element:o.jsx(GR,{set:null}),children:[{path:ct.hubShot,element:o.jsx(X5,{})}]},{path:ct.set,element:o.jsx(dle,{}),children:[{path:ct.setShot,element:o.jsx(X5,{})}]},{path:ct.kit,element:o.jsx(hle,{})},{path:ct.products,element:o.jsx(_oe,{})},{path:ct.product,element:o.jsx(gle,{})},{path:ct.scenes,element:o.jsx(Wre,{}),children:[{path:ct.sceneStudio,element:o.jsx(O5,{})}]},{path:ct.scene,element:o.jsx(ple,{}),children:[{path:ct.sceneEdit,element:o.jsx(O5,{})}]},{path:ct.presenters,element:o.jsx(ose,{}),children:[{path:ct.presenterStudio,element:o.jsx(koe,{})}]},{path:ct.presenter,element:o.jsx(mle,{}),children:[{path:ct.presenterEdit,element:o.jsx(foe,{})}]}]},{path:ct.notFound,element:o.jsx(uo,{to:ct.root,replace:!0})}]}]),b8=localStorage.getItem("sc-theme")??localStorage.getItem("bt-theme");document.documentElement.dataset.theme=b8==="light"||b8==="dark"?b8:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";bG();RL.createRoot(document.getElementById("root")).render(o.jsx($n.StrictMode,{children:o.jsx(uB,{children:o.jsx(dW,{children:o.jsx(h$,{router:vle})})})}));