scenri 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/serve.js +14 -3
- package/launcher/starting.html +3 -3
- package/package.json +12 -12
- package/studio-dist/assets/index-DSSabkJ0.js +108 -0
- package/studio-dist/index.html +1 -1
- package/studio-dist/assets/index-BH6xQdzN.js +0 -108
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var vx=e=>{throw TypeError(e)};var wx=(e,t,n)=>t.has(e)||vx("Cannot "+n);var qr=(e,t,n)=>(wx(e,t,"read from private field"),n?n.call(e):t.get(e)),yx=(e,t,n)=>t.has(e)?vx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),a8=(e,t,n,r)=>(wx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function xD(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 xS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o8={exports:{}},v0={},i8={exports:{}},bn={};/**
|
|
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 bx;function kD(){if(bx)return bn;bx=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 m(Z){return Z===null||typeof Z!="object"?null:(Z=g&&Z[g]||Z["@@iterator"],typeof Z=="function"?Z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function S(Z,X,z){this.props=Z,this.context=X,this.refs=b,this.updater=z||w}S.prototype.isReactComponent={},S.prototype.setState=function(Z,X){if(typeof Z!="object"&&typeof Z!="function"&&Z!=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,Z,X,"setState")},S.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,"forceUpdate")};function k(){}k.prototype=S.prototype;function C(Z,X,z){this.props=Z,this.context=X,this.refs=b,this.updater=z||w}var E=C.prototype=new k;E.constructor=C,y(E,S.prototype),E.isPureReactComponent=!0;var A=Array.isArray,L=Object.prototype.hasOwnProperty,$={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function j(Z,X,z){var J,he={},te=null,me=null;if(X!=null)for(J in X.ref!==void 0&&(me=X.ref),X.key!==void 0&&(te=""+X.key),X)L.call(X,J)&&!N.hasOwnProperty(J)&&(he[J]=X[J]);var re=arguments.length-2;if(re===1)he.children=z;else if(1<re){for(var ee=Array(re),q=0;q<re;q++)ee[q]=arguments[q+2];he.children=ee}if(Z&&Z.defaultProps)for(J in re=Z.defaultProps,re)he[J]===void 0&&(he[J]=re[J]);return{$$typeof:e,type:Z,key:te,ref:me,props:he,_owner:$.current}}function P(Z,X){return{$$typeof:e,type:Z.type,key:X,ref:Z.ref,props:Z.props,_owner:Z._owner}}function R(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===e}function H(Z){var X={"=":"=0",":":"=2"};return"$"+Z.replace(/[=:]/g,function(z){return X[z]})}var D=/\/+/g;function U(Z,X){return typeof Z=="object"&&Z!==null&&Z.key!=null?H(""+Z.key):X.toString(36)}function _(Z,X,z,J,he){var te=typeof Z;(te==="undefined"||te==="boolean")&&(Z=null);var me=!1;if(Z===null)me=!0;else switch(te){case"string":case"number":me=!0;break;case"object":switch(Z.$$typeof){case e:case t:me=!0}}if(me)return me=Z,he=he(me),Z=J===""?"."+U(me,0):J,A(he)?(z="",Z!=null&&(z=Z.replace(D,"$&/")+"/"),_(he,X,z,"",function(q){return q})):he!=null&&(R(he)&&(he=P(he,z+(!he.key||me&&me.key===he.key?"":(""+he.key).replace(D,"$&/")+"/")+Z)),X.push(he)),1;if(me=0,J=J===""?".":J+":",A(Z))for(var re=0;re<Z.length;re++){te=Z[re];var ee=J+U(te,re);me+=_(te,X,z,ee,he)}else if(ee=m(Z),typeof ee=="function")for(Z=ee.call(Z),re=0;!(te=Z.next()).done;)te=te.value,ee=J+U(te,re++),me+=_(te,X,z,ee,he);else if(te==="object")throw X=String(Z),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(Z).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return me}function B(Z,X,z){if(Z==null)return Z;var J=[],he=0;return _(Z,J,"","",function(te){return X.call(z,te,he++)}),J}function K(Z){if(Z._status===-1){var X=Z._result;X=X(),X.then(function(z){(Z._status===0||Z._status===-1)&&(Z._status=1,Z._result=z)},function(z){(Z._status===0||Z._status===-1)&&(Z._status=2,Z._result=z)}),Z._status===-1&&(Z._status=0,Z._result=X)}if(Z._status===1)return Z._result.default;throw Z._result}var V={current:null},O={transition:null},I={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:O,ReactCurrentOwner:$};function Y(){throw Error("act(...) is not supported in production builds of React.")}return bn.Children={map:B,forEach:function(Z,X,z){B(Z,function(){X.apply(this,arguments)},z)},count:function(Z){var X=0;return B(Z,function(){X++}),X},toArray:function(Z){return B(Z,function(X){return X})||[]},only:function(Z){if(!R(Z))throw Error("React.Children.only expected to receive a single React element child.");return Z}},bn.Component=S,bn.Fragment=n,bn.Profiler=a,bn.PureComponent=C,bn.StrictMode=r,bn.Suspense=f,bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,bn.act=Y,bn.cloneElement=function(Z,X,z){if(Z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Z+".");var J=y({},Z.props),he=Z.key,te=Z.ref,me=Z._owner;if(X!=null){if(X.ref!==void 0&&(te=X.ref,me=$.current),X.key!==void 0&&(he=""+X.key),Z.type&&Z.type.defaultProps)var re=Z.type.defaultProps;for(ee in X)L.call(X,ee)&&!N.hasOwnProperty(ee)&&(J[ee]=X[ee]===void 0&&re!==void 0?re[ee]:X[ee])}var ee=arguments.length-2;if(ee===1)J.children=z;else if(1<ee){re=Array(ee);for(var q=0;q<ee;q++)re[q]=arguments[q+2];J.children=re}return{$$typeof:e,type:Z.type,key:he,ref:te,props:J,_owner:me}},bn.createContext=function(Z){return Z={$$typeof:l,_currentValue:Z,_currentValue2:Z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Z.Provider={$$typeof:i,_context:Z},Z.Consumer=Z},bn.createElement=j,bn.createFactory=function(Z){var X=j.bind(null,Z);return X.type=Z,X},bn.createRef=function(){return{current:null}},bn.forwardRef=function(Z){return{$$typeof:u,render:Z}},bn.isValidElement=R,bn.lazy=function(Z){return{$$typeof:p,_payload:{_status:-1,_result:Z},_init:K}},bn.memo=function(Z,X){return{$$typeof:h,type:Z,compare:X===void 0?null:X}},bn.startTransition=function(Z){var X=O.transition;O.transition={};try{Z()}finally{O.transition=X}},bn.unstable_act=Y,bn.useCallback=function(Z,X){return V.current.useCallback(Z,X)},bn.useContext=function(Z){return V.current.useContext(Z)},bn.useDebugValue=function(){},bn.useDeferredValue=function(Z){return V.current.useDeferredValue(Z)},bn.useEffect=function(Z,X){return V.current.useEffect(Z,X)},bn.useId=function(){return V.current.useId()},bn.useImperativeHandle=function(Z,X,z){return V.current.useImperativeHandle(Z,X,z)},bn.useInsertionEffect=function(Z,X){return V.current.useInsertionEffect(Z,X)},bn.useLayoutEffect=function(Z,X){return V.current.useLayoutEffect(Z,X)},bn.useMemo=function(Z,X){return V.current.useMemo(Z,X)},bn.useReducer=function(Z,X,z){return V.current.useReducer(Z,X,z)},bn.useRef=function(Z){return V.current.useRef(Z)},bn.useState=function(Z){return V.current.useState(Z)},bn.useSyncExternalStore=function(Z,X,z){return V.current.useSyncExternalStore(Z,X,z)},bn.useTransition=function(){return V.current.useTransition()},bn.version="18.3.1",bn}var xx;function Ev(){return xx||(xx=1,i8.exports=kD()),i8.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 kx;function SD(){if(kx)return v0;kx=1;var e=Ev(),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={},m=null,w=null;h!==void 0&&(m=""+h),f.key!==void 0&&(m=""+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:m,ref:w,props:g,_owner:a.current}}return v0.Fragment=n,v0.jsx=l,v0.jsxs=l,v0}var Sx;function ED(){return Sx||(Sx=1,o8.exports=SD()),o8.exports}var o=ED(),s=Ev();const zn=xS(s),Nl=xD({__proto__:null,default:zn},[s]);var bh={},l8={exports:{}},Hs={},c8={exports:{}},u8={};/**
|
|
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 Ex;function CD(){return Ex||(Ex=1,(function(e){function t(O,I){var Y=O.length;O.push(I);e:for(;0<Y;){var Z=Y-1>>>1,X=O[Z];if(0<a(X,I))O[Z]=I,O[Y]=X,Y=Z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var I=O[0],Y=O.pop();if(Y!==I){O[0]=Y;e:for(var Z=0,X=O.length,z=X>>>1;Z<z;){var J=2*(Z+1)-1,he=O[J],te=J+1,me=O[te];if(0>a(he,Y))te<X&&0>a(me,he)?(O[Z]=me,O[te]=Y,Z=te):(O[Z]=he,O[J]=Y,Z=J);else if(te<X&&0>a(me,Y))O[Z]=me,O[te]=Y,Z=te;else break e}}return I}function a(O,I){var Y=O.sortIndex-I.sortIndex;return Y!==0?Y:O.id-I.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,m=3,w=!1,y=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(O){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=O)r(h),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(h)}}function A(O){if(b=!1,E(O),!y)if(n(f)!==null)y=!0,K(L);else{var I=n(h);I!==null&&V(A,I.startTime-O)}}function L(O,I){y=!1,b&&(b=!1,k(j),j=-1),w=!0;var Y=m;try{for(E(I),g=n(f);g!==null&&(!(g.expirationTime>I)||O&&!H());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,m=g.priorityLevel;var X=Z(g.expirationTime<=I);I=e.unstable_now(),typeof X=="function"?g.callback=X:g===n(f)&&r(f),E(I)}else r(f);g=n(f)}if(g!==null)var z=!0;else{var J=n(h);J!==null&&V(A,J.startTime-I),z=!1}return z}finally{g=null,m=Y,w=!1}}var $=!1,N=null,j=-1,P=5,R=-1;function H(){return!(e.unstable_now()-R<P)}function D(){if(N!==null){var O=e.unstable_now();R=O;var I=!0;try{I=N(!0,O)}finally{I?U():($=!1,N=null)}}else $=!1}var U;if(typeof C=="function")U=function(){C(D)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,B=_.port2;_.port1.onmessage=D,U=function(){B.postMessage(null)}}else U=function(){S(D,0)};function K(O){N=O,$||($=!0,U())}function V(O,I){j=S(function(){O(e.unstable_now())},I)}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(O){O.callback=null},e.unstable_continueExecution=function(){y||w||(y=!0,K(L))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(O){switch(m){case 1:case 2:case 3:var I=3;break;default:I=m}var Y=m;m=I;try{return O()}finally{m=Y}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Y=m;m=O;try{return I()}finally{m=Y}},e.unstable_scheduleCallback=function(O,I,Y){var Z=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Z+Y:Z):Y=Z,O){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=Y+X,O={id:p++,callback:I,priorityLevel:O,startTime:Y,expirationTime:X,sortIndex:-1},Y>Z?(O.sortIndex=Y,t(h,O),n(f)===null&&O===n(h)&&(b?(k(j),j=-1):b=!0,V(A,Y-Z))):(O.sortIndex=X,t(f,O),y||w||(y=!0,K(L))),O},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(O){var I=m;return function(){var Y=m;m=I;try{return O.apply(this,arguments)}finally{m=Y}}}})(u8)),u8}var Cx;function jD(){return Cx||(Cx=1,c8.exports=CD()),c8.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 jx;function AD(){if(jx)return Hs;jx=1;var e=Ev(),t=jD();function n(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)d+="&args[]="+encodeURIComponent(arguments[v]);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 m(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,v,x){if(v!==null&&v.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function y(c,d,v,x){if(d===null||typeof d>"u"||w(c,d,v,x))return!0;if(x)return!1;if(v!==null)switch(v.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 b(c,d,v,x,M,T,W){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=x,this.attributeNamespace=M,this.mustUseProperty=v,this.propertyName=c,this.type=d,this.sanitizeURL=T,this.removeEmptyString=W}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){S[c]=new b(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var d=c[0];S[d]=new b(d,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){S[c]=new b(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){S[c]=new b(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){S[c]=new b(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){S[c]=new b(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){S[c]=new b(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){S[c]=new b(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){S[c]=new b(c,5,!1,c.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function C(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(k,C);S[d]=new b(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(k,C);S[d]=new b(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(k,C);S[d]=new b(d,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){S[c]=new b(c,1,!1,c.toLowerCase(),null,!1,!1)}),S.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){S[c]=new b(c,1,!1,c.toLowerCase(),null,!0,!0)});function E(c,d,v,x){var M=S.hasOwnProperty(d)?S[d]:null;(M!==null?M.type!==0:x||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,v,M,x)&&(v=null),x||M===null?m(d)&&(v===null?c.removeAttribute(d):c.setAttribute(d,""+v)):M.mustUseProperty?c[M.propertyName]=v===null?M.type===3?!1:"":v:(d=M.attributeName,x=M.attributeNamespace,v===null?c.removeAttribute(d):(M=M.type,v=M===3||M===4&&v===!0?"":""+v,x?c.setAttributeNS(x,d,v):c.setAttribute(d,v))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),$=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),O=Symbol.iterator;function I(c){return c===null||typeof c!="object"?null:(c=O&&c[O]||c["@@iterator"],typeof c=="function"?c:null)}var Y=Object.assign,Z;function X(c){if(Z===void 0)try{throw Error()}catch(v){var d=v.stack.trim().match(/\n( *(at )?)/);Z=d&&d[1]||""}return`
|
|
34
|
+
`+Z+c}var z=!1;function J(c,d){if(!c||z)return"";z=!0;var v=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(We){var x=We}Reflect.construct(c,[],d)}else{try{d.call()}catch(We){x=We}c.call(d.prototype)}else{try{throw Error()}catch(We){x=We}c()}}catch(We){if(We&&x&&typeof We.stack=="string"){for(var M=We.stack.split(`
|
|
35
|
+
`),T=x.stack.split(`
|
|
36
|
+
`),W=M.length-1,fe=T.length-1;1<=W&&0<=fe&&M[W]!==T[fe];)fe--;for(;1<=W&&0<=fe;W--,fe--)if(M[W]!==T[fe]){if(W!==1||fe!==1)do if(W--,fe--,0>fe||M[W]!==T[fe]){var be=`
|
|
37
|
+
`+M[W].replace(" at new "," at ");return c.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",c.displayName)),be}while(1<=W&&0<=fe);break}}}finally{z=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?X(c):""}function he(c){switch(c.tag){case 5:return X(c.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return c=J(c.type,!1),c;case 11:return c=J(c.type.render,!1),c;case 1:return c=J(c.type,!0),c;default:return""}}function te(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 N:return"Fragment";case $:return"Portal";case P:return"Profiler";case j:return"StrictMode";case U:return"Suspense";case _:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case H:return(c.displayName||"Context")+".Consumer";case R: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 B:return d=c.displayName||null,d!==null?d:te(c.type)||"Memo";case K:d=c._payload,c=c._init;try{return te(c(d))}catch{}}return null}function me(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 te(d);case 8:return d===j?"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 re(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ee(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function q(c){var d=ee(c)?"checked":"value",v=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),x=""+c[d];if(!c.hasOwnProperty(d)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var M=v.get,T=v.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return M.call(this)},set:function(W){x=""+W,T.call(this,W)}}),Object.defineProperty(c,d,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(W){x=""+W},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function ie(c){c._valueTracker||(c._valueTracker=q(c))}function Oe(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var v=d.getValue(),x="";return c&&(x=ee(c)?c.checked?"true":"false":c.value),c=x,c!==v?(d.setValue(c),!0):!1}function ae(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 pe(c,d){var v=d.checked;return Y({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??c._wrapperState.initialChecked})}function Te(c,d){var v=d.defaultValue==null?"":d.defaultValue,x=d.checked!=null?d.checked:d.defaultChecked;v=re(d.value!=null?d.value:v),c._wrapperState={initialChecked:x,initialValue:v,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function gt(c,d){d=d.checked,d!=null&&E(c,"checked",d,!1)}function Ze(c,d){gt(c,d);var v=re(d.value),x=d.type;if(v!=null)x==="number"?(v===0&&c.value===""||c.value!=v)&&(c.value=""+v):c.value!==""+v&&(c.value=""+v);else if(x==="submit"||x==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?De(c,d.type,v):d.hasOwnProperty("defaultValue")&&De(c,d.type,re(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function tt(c,d,v){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var x=d.type;if(!(x!=="submit"&&x!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,v||d===c.value||(c.value=d),c.defaultValue=d}v=c.name,v!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,v!==""&&(c.name=v)}function De(c,d,v){(d!=="number"||ae(c.ownerDocument)!==c)&&(v==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+v&&(c.defaultValue=""+v))}var Se=Array.isArray;function Q(c,d,v,x){if(c=c.options,d){d={};for(var M=0;M<v.length;M++)d["$"+v[M]]=!0;for(v=0;v<c.length;v++)M=d.hasOwnProperty("$"+c[v].value),c[v].selected!==M&&(c[v].selected=M),M&&x&&(c[v].defaultSelected=!0)}else{for(v=""+re(v),d=null,M=0;M<c.length;M++){if(c[M].value===v){c[M].selected=!0,x&&(c[M].defaultSelected=!0);return}d!==null||c[M].disabled||(d=c[M])}d!==null&&(d.selected=!0)}}function je(c,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return Y({},d,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Re(c,d){var v=d.value;if(v==null){if(v=d.children,d=d.defaultValue,v!=null){if(d!=null)throw Error(n(92));if(Se(v)){if(1<v.length)throw Error(n(93));v=v[0]}d=v}d==null&&(d=""),v=d}c._wrapperState={initialValue:re(v)}}function se(c,d){var v=re(d.value),x=re(d.defaultValue);v!=null&&(v=""+v,v!==c.value&&(c.value=v),d.defaultValue==null&&c.defaultValue!==v&&(c.defaultValue=v)),x!=null&&(c.defaultValue=""+x)}function G(c){var d=c.textContent;d===c._wrapperState.initialValue&&d!==""&&d!==null&&(c.value=d)}function oe(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 Ne(c,d){return c==null||c==="http://www.w3.org/1999/xhtml"?oe(d):c==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var Ue,st=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,v,x,M){MSApp.execUnsafeLocalFunction(function(){return c(d,v,x,M)})}:c})(function(c,d){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=d;else{for(Ue=Ue||document.createElement("div"),Ue.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Ue.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;d.firstChild;)c.appendChild(d.firstChild)}});function Pe(c,d){if(d){var v=c.firstChild;if(v&&v===c.lastChild&&v.nodeType===3){v.nodeValue=d;return}}c.textContent=d}var Ie={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},Ge=["Webkit","ms","Moz","O"];Object.keys(Ie).forEach(function(c){Ge.forEach(function(d){d=d+c.charAt(0).toUpperCase()+c.substring(1),Ie[d]=Ie[c]})});function ft(c,d,v){return d==null||typeof d=="boolean"||d===""?"":v||typeof d!="number"||d===0||Ie.hasOwnProperty(c)&&Ie[c]?(""+d).trim():d+"px"}function bt(c,d){c=c.style;for(var v in d)if(d.hasOwnProperty(v)){var x=v.indexOf("--")===0,M=ft(v,d[v],x);v==="float"&&(v="cssFloat"),x?c.setProperty(v,M):c[v]=M}}var at=Y({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 Zt(c,d){if(d){if(at[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 jt(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 Ft=null;function Pt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var $t=null,ke=null,Je=null;function Et(c){if(c=n0(c)){if(typeof $t!="function")throw Error(n(280));var d=c.stateNode;d&&(d=Df(d),$t(c.stateNode,c.type,d))}}function Xe(c){ke?Je?Je.push(c):Je=[c]:ke=c}function rt(){if(ke){var c=ke,d=Je;if(Je=ke=null,Et(c),d)for(c=0;c<d.length;c++)Et(d[c])}}function nt(c,d){return c(d)}function qt(){}var Yt=!1;function an(c,d,v){if(Yt)return c(d,v);Yt=!0;try{return nt(c,d,v)}finally{Yt=!1,(ke!==null||Je!==null)&&(qt(),rt())}}function Wt(c,d){var v=c.stateNode;if(v===null)return null;var x=Df(v);if(x===null)return null;v=x[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":(x=!x.disabled)||(c=c.type,x=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!x;break e;default:c=!1}if(c)return null;if(v&&typeof v!="function")throw Error(n(231,d,typeof v));return v}var Rn=!1;if(u)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){Rn=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch{Rn=!1}function ne(c,d,v,x,M,T,W,fe,be){var We=Array.prototype.slice.call(arguments,3);try{d.apply(v,We)}catch(dt){this.onError(dt)}}var ce=!1,ue=null,ze=!1,Ve=null,xt={onError:function(c){ce=!0,ue=c}};function yt(c,d,v,x,M,T,W,fe,be){ce=!1,ue=null,ne.apply(xt,arguments)}function kt(c,d,v,x,M,T,W,fe,be){if(yt.apply(this,arguments),ce){if(ce){var We=ue;ce=!1,ue=null}else throw Error(n(198));ze||(ze=!0,Ve=We)}}function ot(c){var d=c,v=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(v=d.return),c=d.return;while(c)}return d.tag===3?v:null}function ht(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 Ae(c){if(ot(c)!==c)throw Error(n(188))}function ve(c){var d=c.alternate;if(!d){if(d=ot(c),d===null)throw Error(n(188));return d!==c?null:c}for(var v=c,x=d;;){var M=v.return;if(M===null)break;var T=M.alternate;if(T===null){if(x=M.return,x!==null){v=x;continue}break}if(M.child===T.child){for(T=M.child;T;){if(T===v)return Ae(M),c;if(T===x)return Ae(M),d;T=T.sibling}throw Error(n(188))}if(v.return!==x.return)v=M,x=T;else{for(var W=!1,fe=M.child;fe;){if(fe===v){W=!0,v=M,x=T;break}if(fe===x){W=!0,x=M,v=T;break}fe=fe.sibling}if(!W){for(fe=T.child;fe;){if(fe===v){W=!0,v=T,x=M;break}if(fe===x){W=!0,x=T,v=M;break}fe=fe.sibling}if(!W)throw Error(n(189))}}if(v.alternate!==x)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?c:d}function et(c){return c=ve(c),c!==null?Ct(c):null}function Ct(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=Ct(c);if(d!==null)return d;c=c.sibling}return null}var xe=t.unstable_scheduleCallback,it=t.unstable_cancelCallback,wt=t.unstable_shouldYield,$e=t.unstable_requestPaint,qe=t.unstable_now,Lt=t.unstable_getCurrentPriorityLevel,Ut=t.unstable_ImmediatePriority,Nt=t.unstable_UserBlockingPriority,_t=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Qe=null,F=null;function de(c){if(F&&typeof F.onCommitFiberRoot=="function")try{F.onCommitFiberRoot(Qe,c,void 0,(c.current.flags&128)===128)}catch{}}var ye=Math.clz32?Math.clz32:ct,Ke=Math.log,Le=Math.LN2;function ct(c){return c>>>=0,c===0?32:31-(Ke(c)/Le|0)|0}var Ot=64,zt=4194304;function Rt(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 Sn(c,d){var v=c.pendingLanes;if(v===0)return 0;var x=0,M=c.suspendedLanes,T=c.pingedLanes,W=v&268435455;if(W!==0){var fe=W&~M;fe!==0?x=Rt(fe):(T&=W,T!==0&&(x=Rt(T)))}else W=v&~M,W!==0?x=Rt(W):T!==0&&(x=Rt(T));if(x===0)return 0;if(d!==0&&d!==x&&(d&M)===0&&(M=x&-x,T=d&-d,M>=T||M===16&&(T&4194240)!==0))return d;if((x&4)!==0&&(x|=v&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=x;0<d;)v=31-ye(d),M=1<<v,x|=c[v],d&=~M;return x}function Jt(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 En(c,d){for(var v=c.suspendedLanes,x=c.pingedLanes,M=c.expirationTimes,T=c.pendingLanes;0<T;){var W=31-ye(T),fe=1<<W,be=M[W];be===-1?((fe&v)===0||(fe&x)!==0)&&(M[W]=Jt(fe,d)):be<=d&&(c.expiredLanes|=fe),T&=~fe}}function Qn(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function dn(){var c=Ot;return Ot<<=1,(Ot&4194240)===0&&(Ot=64),c}function vr(c){for(var d=[],v=0;31>v;v++)d.push(c);return d}function Kt(c,d,v){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-ye(d),c[d]=v}function br(c,d){var v=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 x=c.eventTimes;for(c=c.expirationTimes;0<v;){var M=31-ye(v),T=1<<M;d[M]=0,x[M]=-1,c[M]=-1,v&=~T}}function Ir(c,d){var v=c.entangledLanes|=d;for(c=c.entanglements;v;){var x=31-ye(v),M=1<<x;M&d|c[x]&d&&(c[x]|=d),v&=~M}}var wn=0;function Vo(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var An,Ys,Rs,on,yn,Kn=!1,Wr=[],Jn=null,_n=null,ts=null,fa=new Map,Zo=new Map,ms=[],qs="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 zo(c,d){switch(c){case"focusin":case"focusout":Jn=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":fa.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(d.pointerId)}}function Xs(c,d,v,x,M,T){return c===null||c.nativeEvent!==T?(c={blockedOn:d,domEventName:v,eventSystemFlags:x,nativeEvent:T,targetContainers:[M]},d!==null&&(d=n0(d),d!==null&&Ys(d)),c):(c.eventSystemFlags|=x,d=c.targetContainers,M!==null&&d.indexOf(M)===-1&&d.push(M),c)}function fo(c,d,v,x,M){switch(d){case"focusin":return Jn=Xs(Jn,c,d,v,x,M),!0;case"dragenter":return _n=Xs(_n,c,d,v,x,M),!0;case"mouseover":return ts=Xs(ts,c,d,v,x,M),!0;case"pointerover":var T=M.pointerId;return fa.set(T,Xs(fa.get(T)||null,c,d,v,x,M)),!0;case"gotpointercapture":return T=M.pointerId,Zo.set(T,Xs(Zo.get(T)||null,c,d,v,x,M)),!0}return!1}function le(c){var d=Yl(c.target);if(d!==null){var v=ot(d);if(v!==null){if(d=v.tag,d===13){if(d=ht(v),d!==null){c.blockedOn=d,yn(c.priority,function(){Rs(v)});return}}else if(d===3&&v.stateNode.current.memoizedState.isDehydrated){c.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}c.blockedOn=null}function Fe(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var v=nu(c.domEventName,c.eventSystemFlags,d[0],c.nativeEvent);if(v===null){v=c.nativeEvent;var x=new v.constructor(v.type,v);Ft=x,v.target.dispatchEvent(x),Ft=null}else return d=n0(v),d!==null&&Ys(d),c.blockedOn=v,!1;d.shift()}return!0}function lt(c,d,v){Fe(c)&&v.delete(d)}function en(){Kn=!1,Jn!==null&&Fe(Jn)&&(Jn=null),_n!==null&&Fe(_n)&&(_n=null),ts!==null&&Fe(ts)&&(ts=null),fa.forEach(lt),Zo.forEach(lt)}function nn(c,d){c.blockedOn===d&&(c.blockedOn=null,Kn||(Kn=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,en)))}function Zn(c){function d(M){return nn(M,c)}if(0<Wr.length){nn(Wr[0],c);for(var v=1;v<Wr.length;v++){var x=Wr[v];x.blockedOn===c&&(x.blockedOn=null)}}for(Jn!==null&&nn(Jn,c),_n!==null&&nn(_n,c),ts!==null&&nn(ts,c),fa.forEach(d),Zo.forEach(d),v=0;v<ms.length;v++)x=ms[v],x.blockedOn===c&&(x.blockedOn=null);for(;0<ms.length&&(v=ms[0],v.blockedOn===null);)le(v),v.blockedOn===null&&ms.shift()}var $n=A.ReactCurrentBatchConfig,Pn=!0;function fn(c,d,v,x){var M=wn,T=$n.transition;$n.transition=null;try{wn=1,ha(c,d,v,x)}finally{wn=M,$n.transition=T}}function or(c,d,v,x){var M=wn,T=$n.transition;$n.transition=null;try{wn=4,ha(c,d,v,x)}finally{wn=M,$n.transition=T}}function ha(c,d,v,x){if(Pn){var M=nu(c,d,v,x);if(M===null)Y2(c,d,x,Fr,v),zo(c,x);else if(fo(M,c,d,v,x))x.stopPropagation();else if(zo(c,x),d&4&&-1<qs.indexOf(c)){for(;M!==null;){var T=n0(M);if(T!==null&&An(T),T=nu(c,d,v,x),T===null&&Y2(c,d,x,Fr,v),T===M)break;M=T}M!==null&&x.stopPropagation()}else Y2(c,d,x,null,v)}}var Fr=null;function nu(c,d,v,x){if(Fr=null,c=Pt(x),c=Yl(c),c!==null)if(d=ot(c),d===null)c=null;else if(v=d.tag,v===13){if(c=ht(d),c!==null)return c;c=null}else if(v===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null);return Fr=c,null}function gs(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(Lt()){case Ut:return 1;case Nt:return 4;case _t:case Me:return 16;case Be:return 536870912;default:return 16}default:return 16}}var ho=null,Wl=null,ru=null;function bf(){if(ru)return ru;var c,d=Wl,v=d.length,x,M="value"in ho?ho.value:ho.textContent,T=M.length;for(c=0;c<v&&d[c]===M[c];c++);var W=v-c;for(x=1;x<=W&&d[v-x]===M[T-x];x++);return ru=M.slice(c,1<x?1-x:void 0)}function Ti(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 su(){return!0}function xf(){return!1}function vs(c){function d(v,x,M,T,W){this._reactName=v,this._targetInst=M,this.type=x,this.nativeEvent=T,this.target=W,this.currentTarget=null;for(var fe in c)c.hasOwnProperty(fe)&&(v=c[fe],this[fe]=v?v(T):T[fe]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?su:xf,this.isPropagationStopped=xf,this}return Y(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=su)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=su)},persist:function(){},isPersistent:su}),d}var po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=vs(po),Di=Y({},po,{view:0,detail:0}),kf=vs(Di),au,Kl,Hi,Gl=Y({},Di,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ns,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!==Hi&&(Hi&&c.type==="mousemove"?(au=c.screenX-Hi.screenX,Kl=c.screenY-Hi.screenY):Kl=au=0,Hi=c),au)},movementY:function(c){return"movementY"in c?c.movementY:Kl}}),Ud=vs(Gl),Sf=Y({},Gl,{dataTransfer:0}),we=vs(Sf),mt=Y({},Di,{relatedTarget:0}),tn=vs(mt),mn=Y({},po,{animationName:0,elapsedTime:0,pseudoElement:0}),rn=vs(mn),Nn=Y({},po,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Kr=vs(Nn),On=Y({},po,{data:0}),sr=vs(On),ir={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fa={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"},Ef={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dn(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=Ef[c])?!!d[c]:!1}function ns(){return Dn}var ws=Y({},Di,{key:function(c){if(c.key){var d=ir[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=Ti(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Fa[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ns,charCode:function(c){return c.type==="keypress"?Ti(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Ti(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),I2=vs(ws),Wd=Y({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ou=vs(Wd),Cf=Y({},Di,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ns}),_a=vs(Cf),jf=Y({},po,{propertyName:0,elapsedTime:0,pseudoElement:0}),Af=vs(jf),p$=Y({},Gl,{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}),m$=vs(p$),g$=[9,13,27,32],F2=u&&"CompositionEvent"in window,Kd=null;u&&"documentMode"in document&&(Kd=document.documentMode);var v$=u&&"TextEvent"in window&&!Kd,cb=u&&(!F2||Kd&&8<Kd&&11>=Kd),ub=" ",db=!1;function fb(c,d){switch(c){case"keyup":return g$.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hb(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var iu=!1;function w$(c,d){switch(c){case"compositionend":return hb(d);case"keypress":return d.which!==32?null:(db=!0,ub);case"textInput":return c=d.data,c===ub&&db?null:c;default:return null}}function y$(c,d){if(iu)return c==="compositionend"||!F2&&fb(c,d)?(c=bf(),ru=Wl=ho=null,iu=!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 cb&&d.locale!=="ko"?null:d.data;default:return null}}var b$={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 pb(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!b$[c.type]:d==="textarea"}function mb(c,d,v,x){Xe(x),d=Lf(d,"onChange"),0<d.length&&(v=new $i("onChange","change",null,v,x),c.push({event:v,listeners:d}))}var Gd=null,Yd=null;function x$(c){Tb(c,0)}function Nf(c){var d=fu(c);if(Oe(d))return c}function k$(c,d){if(c==="change")return d}var gb=!1;if(u){var _2;if(u){var V2="oninput"in document;if(!V2){var vb=document.createElement("div");vb.setAttribute("oninput","return;"),V2=typeof vb.oninput=="function"}_2=V2}else _2=!1;gb=_2&&(!document.documentMode||9<document.documentMode)}function wb(){Gd&&(Gd.detachEvent("onpropertychange",yb),Yd=Gd=null)}function yb(c){if(c.propertyName==="value"&&Nf(Yd)){var d=[];mb(d,Yd,c,Pt(c)),an(x$,d)}}function S$(c,d,v){c==="focusin"?(wb(),Gd=d,Yd=v,Gd.attachEvent("onpropertychange",yb)):c==="focusout"&&wb()}function E$(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Nf(Yd)}function C$(c,d){if(c==="click")return Nf(d)}function j$(c,d){if(c==="input"||c==="change")return Nf(d)}function A$(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Va=typeof Object.is=="function"?Object.is:A$;function qd(c,d){if(Va(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var v=Object.keys(c),x=Object.keys(d);if(v.length!==x.length)return!1;for(x=0;x<v.length;x++){var M=v[x];if(!f.call(d,M)||!Va(c[M],d[M]))return!1}return!0}function bb(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function xb(c,d){var v=bb(c);c=0;for(var x;v;){if(v.nodeType===3){if(x=c+v.textContent.length,c<=d&&x>=d)return{node:v,offset:d-c};c=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=bb(v)}}function kb(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?kb(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function Sb(){for(var c=window,d=ae();d instanceof c.HTMLIFrameElement;){try{var v=typeof d.contentWindow.location.href=="string"}catch{v=!1}if(v)c=d.contentWindow;else break;d=ae(c.document)}return d}function Z2(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 N$(c){var d=Sb(),v=c.focusedElem,x=c.selectionRange;if(d!==v&&v&&v.ownerDocument&&kb(v.ownerDocument.documentElement,v)){if(x!==null&&Z2(v)){if(d=x.start,c=x.end,c===void 0&&(c=d),"selectionStart"in v)v.selectionStart=d,v.selectionEnd=Math.min(c,v.value.length);else if(c=(d=v.ownerDocument||document)&&d.defaultView||window,c.getSelection){c=c.getSelection();var M=v.textContent.length,T=Math.min(x.start,M);x=x.end===void 0?T:Math.min(x.end,M),!c.extend&&T>x&&(M=x,x=T,T=M),M=xb(v,T);var W=xb(v,x);M&&W&&(c.rangeCount!==1||c.anchorNode!==M.node||c.anchorOffset!==M.offset||c.focusNode!==W.node||c.focusOffset!==W.offset)&&(d=d.createRange(),d.setStart(M.node,M.offset),c.removeAllRanges(),T>x?(c.addRange(d),c.extend(W.node,W.offset)):(d.setEnd(W.node,W.offset),c.addRange(d)))}}for(d=[],c=v;c=c.parentNode;)c.nodeType===1&&d.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<d.length;v++)c=d[v],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var M$=u&&"documentMode"in document&&11>=document.documentMode,lu=null,z2=null,Xd=null,B2=!1;function Eb(c,d,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;B2||lu==null||lu!==ae(x)||(x=lu,"selectionStart"in x&&Z2(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Xd&&qd(Xd,x)||(Xd=x,x=Lf(z2,"onSelect"),0<x.length&&(d=new $i("onSelect","select",null,d,v),c.push({event:d,listeners:x}),d.target=lu)))}function Mf(c,d){var v={};return v[c.toLowerCase()]=d.toLowerCase(),v["Webkit"+c]="webkit"+d,v["Moz"+c]="moz"+d,v}var cu={animationend:Mf("Animation","AnimationEnd"),animationiteration:Mf("Animation","AnimationIteration"),animationstart:Mf("Animation","AnimationStart"),transitionend:Mf("Transition","TransitionEnd")},U2={},Cb={};u&&(Cb=document.createElement("div").style,"AnimationEvent"in window||(delete cu.animationend.animation,delete cu.animationiteration.animation,delete cu.animationstart.animation),"TransitionEvent"in window||delete cu.transitionend.transition);function Rf(c){if(U2[c])return U2[c];if(!cu[c])return c;var d=cu[c],v;for(v in d)if(d.hasOwnProperty(v)&&v in Cb)return U2[c]=d[v];return c}var jb=Rf("animationend"),Ab=Rf("animationiteration"),Nb=Rf("animationstart"),Mb=Rf("transitionend"),Rb=new Map,Pb="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 Oi(c,d){Rb.set(c,d),i(d,[c])}for(var W2=0;W2<Pb.length;W2++){var K2=Pb[W2],R$=K2.toLowerCase(),P$=K2[0].toUpperCase()+K2.slice(1);Oi(R$,"on"+P$)}Oi(jb,"onAnimationEnd"),Oi(Ab,"onAnimationIteration"),Oi(Nb,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(Mb,"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 Qd="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(" "),L$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qd));function Lb(c,d,v){var x=c.type||"unknown-event";c.currentTarget=v,kt(x,d,void 0,c),c.currentTarget=null}function Tb(c,d){d=(d&4)!==0;for(var v=0;v<c.length;v++){var x=c[v],M=x.event;x=x.listeners;e:{var T=void 0;if(d)for(var W=x.length-1;0<=W;W--){var fe=x[W],be=fe.instance,We=fe.currentTarget;if(fe=fe.listener,be!==T&&M.isPropagationStopped())break e;Lb(M,fe,We),T=be}else for(W=0;W<x.length;W++){if(fe=x[W],be=fe.instance,We=fe.currentTarget,fe=fe.listener,be!==T&&M.isPropagationStopped())break e;Lb(M,fe,We),T=be}}}if(ze)throw c=Ve,ze=!1,Ve=null,c}function er(c,d){var v=d[tg];v===void 0&&(v=d[tg]=new Set);var x=c+"__bubble";v.has(x)||($b(d,c,2,!1),v.add(x))}function G2(c,d,v){var x=0;d&&(x|=4),$b(v,c,x,d)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function Jd(c){if(!c[Pf]){c[Pf]=!0,r.forEach(function(v){v!=="selectionchange"&&(L$.has(v)||G2(v,!1,c),G2(v,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[Pf]||(d[Pf]=!0,G2("selectionchange",!1,d))}}function $b(c,d,v,x){switch(gs(d)){case 1:var M=fn;break;case 4:M=or;break;default:M=ha}v=M.bind(null,d,v,c),M=void 0,!Rn||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(M=!0),x?M!==void 0?c.addEventListener(d,v,{capture:!0,passive:M}):c.addEventListener(d,v,!0):M!==void 0?c.addEventListener(d,v,{passive:M}):c.addEventListener(d,v,!1)}function Y2(c,d,v,x,M){var T=x;if((d&1)===0&&(d&2)===0&&x!==null)e:for(;;){if(x===null)return;var W=x.tag;if(W===3||W===4){var fe=x.stateNode.containerInfo;if(fe===M||fe.nodeType===8&&fe.parentNode===M)break;if(W===4)for(W=x.return;W!==null;){var be=W.tag;if((be===3||be===4)&&(be=W.stateNode.containerInfo,be===M||be.nodeType===8&&be.parentNode===M))return;W=W.return}for(;fe!==null;){if(W=Yl(fe),W===null)return;if(be=W.tag,be===5||be===6){x=T=W;continue e}fe=fe.parentNode}}x=x.return}an(function(){var We=T,dt=Pt(v),vt=[];e:{var ut=Rb.get(c);if(ut!==void 0){var Tt=$i,Ht=c;switch(c){case"keypress":if(Ti(v)===0)break e;case"keydown":case"keyup":Tt=I2;break;case"focusin":Ht="focus",Tt=tn;break;case"focusout":Ht="blur",Tt=tn;break;case"beforeblur":case"afterblur":Tt=tn;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Tt=Ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Tt=we;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Tt=_a;break;case jb:case Ab:case Nb:Tt=rn;break;case Mb:Tt=Af;break;case"scroll":Tt=kf;break;case"wheel":Tt=m$;break;case"copy":case"cut":case"paste":Tt=Kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Tt=ou}var It=(d&4)!==0,wr=!It&&c==="scroll",He=It?ut!==null?ut+"Capture":null:ut;It=[];for(var Ce=We,_e;Ce!==null;){_e=Ce;var St=_e.stateNode;if(_e.tag===5&&St!==null&&(_e=St,He!==null&&(St=Wt(Ce,He),St!=null&&It.push(e0(Ce,St,_e)))),wr)break;Ce=Ce.return}0<It.length&&(ut=new Tt(ut,Ht,null,v,dt),vt.push({event:ut,listeners:It}))}}if((d&7)===0){e:{if(ut=c==="mouseover"||c==="pointerover",Tt=c==="mouseout"||c==="pointerout",ut&&v!==Ft&&(Ht=v.relatedTarget||v.fromElement)&&(Yl(Ht)||Ht[Bo]))break e;if((Tt||ut)&&(ut=dt.window===dt?dt:(ut=dt.ownerDocument)?ut.defaultView||ut.parentWindow:window,Tt?(Ht=v.relatedTarget||v.toElement,Tt=We,Ht=Ht?Yl(Ht):null,Ht!==null&&(wr=ot(Ht),Ht!==wr||Ht.tag!==5&&Ht.tag!==6)&&(Ht=null)):(Tt=null,Ht=We),Tt!==Ht)){if(It=Ud,St="onMouseLeave",He="onMouseEnter",Ce="mouse",(c==="pointerout"||c==="pointerover")&&(It=ou,St="onPointerLeave",He="onPointerEnter",Ce="pointer"),wr=Tt==null?ut:fu(Tt),_e=Ht==null?ut:fu(Ht),ut=new It(St,Ce+"leave",Tt,v,dt),ut.target=wr,ut.relatedTarget=_e,St=null,Yl(dt)===We&&(It=new It(He,Ce+"enter",Ht,v,dt),It.target=_e,It.relatedTarget=wr,St=It),wr=St,Tt&&Ht)t:{for(It=Tt,He=Ht,Ce=0,_e=It;_e;_e=uu(_e))Ce++;for(_e=0,St=He;St;St=uu(St))_e++;for(;0<Ce-_e;)It=uu(It),Ce--;for(;0<_e-Ce;)He=uu(He),_e--;for(;Ce--;){if(It===He||He!==null&&It===He.alternate)break t;It=uu(It),He=uu(He)}It=null}else It=null;Tt!==null&&Db(vt,ut,Tt,It,!1),Ht!==null&&wr!==null&&Db(vt,wr,Ht,It,!0)}}e:{if(ut=We?fu(We):window,Tt=ut.nodeName&&ut.nodeName.toLowerCase(),Tt==="select"||Tt==="input"&&ut.type==="file")var Vt=k$;else if(pb(ut))if(gb)Vt=j$;else{Vt=E$;var Xt=S$}else(Tt=ut.nodeName)&&Tt.toLowerCase()==="input"&&(ut.type==="checkbox"||ut.type==="radio")&&(Vt=C$);if(Vt&&(Vt=Vt(c,We))){mb(vt,Vt,v,dt);break e}Xt&&Xt(c,ut,We),c==="focusout"&&(Xt=ut._wrapperState)&&Xt.controlled&&ut.type==="number"&&De(ut,"number",ut.value)}switch(Xt=We?fu(We):window,c){case"focusin":(pb(Xt)||Xt.contentEditable==="true")&&(lu=Xt,z2=We,Xd=null);break;case"focusout":Xd=z2=lu=null;break;case"mousedown":B2=!0;break;case"contextmenu":case"mouseup":case"dragend":B2=!1,Eb(vt,v,dt);break;case"selectionchange":if(M$)break;case"keydown":case"keyup":Eb(vt,v,dt)}var Qt;if(F2)e:{switch(c){case"compositionstart":var sn="onCompositionStart";break e;case"compositionend":sn="onCompositionEnd";break e;case"compositionupdate":sn="onCompositionUpdate";break e}sn=void 0}else iu?fb(c,v)&&(sn="onCompositionEnd"):c==="keydown"&&v.keyCode===229&&(sn="onCompositionStart");sn&&(cb&&v.locale!=="ko"&&(iu||sn!=="onCompositionStart"?sn==="onCompositionEnd"&&iu&&(Qt=bf()):(ho=dt,Wl="value"in ho?ho.value:ho.textContent,iu=!0)),Xt=Lf(We,sn),0<Xt.length&&(sn=new sr(sn,c,null,v,dt),vt.push({event:sn,listeners:Xt}),Qt?sn.data=Qt:(Qt=hb(v),Qt!==null&&(sn.data=Qt)))),(Qt=v$?w$(c,v):y$(c,v))&&(We=Lf(We,"onBeforeInput"),0<We.length&&(dt=new sr("onBeforeInput","beforeinput",null,v,dt),vt.push({event:dt,listeners:We}),dt.data=Qt))}Tb(vt,d)})}function e0(c,d,v){return{instance:c,listener:d,currentTarget:v}}function Lf(c,d){for(var v=d+"Capture",x=[];c!==null;){var M=c,T=M.stateNode;M.tag===5&&T!==null&&(M=T,T=Wt(c,v),T!=null&&x.unshift(e0(c,T,M)),T=Wt(c,d),T!=null&&x.push(e0(c,T,M))),c=c.return}return x}function uu(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function Db(c,d,v,x,M){for(var T=d._reactName,W=[];v!==null&&v!==x;){var fe=v,be=fe.alternate,We=fe.stateNode;if(be!==null&&be===x)break;fe.tag===5&&We!==null&&(fe=We,M?(be=Wt(v,T),be!=null&&W.unshift(e0(v,be,fe))):M||(be=Wt(v,T),be!=null&&W.push(e0(v,be,fe)))),v=v.return}W.length!==0&&c.push({event:d,listeners:W})}var T$=/\r\n?/g,$$=/\u0000|\uFFFD/g;function Hb(c){return(typeof c=="string"?c:""+c).replace(T$,`
|
|
38
|
+
`).replace($$,"")}function Tf(c,d,v){if(d=Hb(d),Hb(c)!==d&&v)throw Error(n(425))}function $f(){}var q2=null,X2=null;function Q2(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 J2=typeof setTimeout=="function"?setTimeout:void 0,D$=typeof clearTimeout=="function"?clearTimeout:void 0,Ob=typeof Promise=="function"?Promise:void 0,H$=typeof queueMicrotask=="function"?queueMicrotask:typeof Ob<"u"?function(c){return Ob.resolve(null).then(c).catch(O$)}:J2;function O$(c){setTimeout(function(){throw c})}function eg(c,d){var v=d,x=0;do{var M=v.nextSibling;if(c.removeChild(v),M&&M.nodeType===8)if(v=M.data,v==="/$"){if(x===0){c.removeChild(M),Zn(d);return}x--}else v!=="$"&&v!=="$?"&&v!=="$!"||x++;v=M}while(v);Zn(d)}function Ii(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 Ib(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var v=c.data;if(v==="$"||v==="$!"||v==="$?"){if(d===0)return c;d--}else v==="/$"&&d++}c=c.previousSibling}return null}var du=Math.random().toString(36).slice(2),mo="__reactFiber$"+du,t0="__reactProps$"+du,Bo="__reactContainer$"+du,tg="__reactEvents$"+du,I$="__reactListeners$"+du,F$="__reactHandles$"+du;function Yl(c){var d=c[mo];if(d)return d;for(var v=c.parentNode;v;){if(d=v[Bo]||v[mo]){if(v=d.alternate,d.child!==null||v!==null&&v.child!==null)for(c=Ib(c);c!==null;){if(v=c[mo])return v;c=Ib(c)}return d}c=v,v=c.parentNode}return null}function n0(c){return c=c[mo]||c[Bo],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function fu(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function Df(c){return c[t0]||null}var ng=[],hu=-1;function Fi(c){return{current:c}}function tr(c){0>hu||(c.current=ng[hu],ng[hu]=null,hu--)}function Yn(c,d){hu++,ng[hu]=c.current,c.current=d}var _i={},rs=Fi(_i),Ps=Fi(!1),ql=_i;function pu(c,d){var v=c.type.contextTypes;if(!v)return _i;var x=c.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===d)return x.__reactInternalMemoizedMaskedChildContext;var M={},T;for(T in v)M[T]=d[T];return x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=M),M}function Ls(c){return c=c.childContextTypes,c!=null}function Hf(){tr(Ps),tr(rs)}function Fb(c,d,v){if(rs.current!==_i)throw Error(n(168));Yn(rs,d),Yn(Ps,v)}function _b(c,d,v){var x=c.stateNode;if(d=d.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var M in x)if(!(M in d))throw Error(n(108,me(c)||"Unknown",M));return Y({},v,x)}function Of(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||_i,ql=rs.current,Yn(rs,c),Yn(Ps,Ps.current),!0}function Vb(c,d,v){var x=c.stateNode;if(!x)throw Error(n(169));v?(c=_b(c,d,ql),x.__reactInternalMemoizedMergedChildContext=c,tr(Ps),tr(rs),Yn(rs,c)):tr(Ps),Yn(Ps,v)}var Uo=null,If=!1,rg=!1;function Zb(c){Uo===null?Uo=[c]:Uo.push(c)}function _$(c){If=!0,Zb(c)}function Vi(){if(!rg&&Uo!==null){rg=!0;var c=0,d=wn;try{var v=Uo;for(wn=1;c<v.length;c++){var x=v[c];do x=x(!0);while(x!==null)}Uo=null,If=!1}catch(M){throw Uo!==null&&(Uo=Uo.slice(c+1)),xe(Ut,Vi),M}finally{wn=d,rg=!1}}return null}var mu=[],gu=0,Ff=null,_f=0,pa=[],ma=0,Xl=null,Wo=1,Ko="";function Ql(c,d){mu[gu++]=_f,mu[gu++]=Ff,Ff=c,_f=d}function zb(c,d,v){pa[ma++]=Wo,pa[ma++]=Ko,pa[ma++]=Xl,Xl=c;var x=Wo;c=Ko;var M=32-ye(x)-1;x&=~(1<<M),v+=1;var T=32-ye(d)+M;if(30<T){var W=M-M%5;T=(x&(1<<W)-1).toString(32),x>>=W,M-=W,Wo=1<<32-ye(d)+M|v<<M|x,Ko=T+c}else Wo=1<<T|v<<M|x,Ko=c}function sg(c){c.return!==null&&(Ql(c,1),zb(c,1,0))}function ag(c){for(;c===Ff;)Ff=mu[--gu],mu[gu]=null,_f=mu[--gu],mu[gu]=null;for(;c===Xl;)Xl=pa[--ma],pa[ma]=null,Ko=pa[--ma],pa[ma]=null,Wo=pa[--ma],pa[ma]=null}var Qs=null,Js=null,ar=!1,Za=null;function Bb(c,d){var v=ya(5,null,null,0);v.elementType="DELETED",v.stateNode=d,v.return=c,d=c.deletions,d===null?(c.deletions=[v],c.flags|=16):d.push(v)}function Ub(c,d){switch(c.tag){case 5:var v=c.type;return d=d.nodeType!==1||v.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,Qs=c,Js=Ii(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,Qs=c,Js=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(v=Xl!==null?{id:Wo,overflow:Ko}:null,c.memoizedState={dehydrated:d,treeContext:v,retryLane:1073741824},v=ya(18,null,null,0),v.stateNode=d,v.return=c,c.child=v,Qs=c,Js=null,!0):!1;default:return!1}}function og(c){return(c.mode&1)!==0&&(c.flags&128)===0}function ig(c){if(ar){var d=Js;if(d){var v=d;if(!Ub(c,d)){if(og(c))throw Error(n(418));d=Ii(v.nextSibling);var x=Qs;d&&Ub(c,d)?Bb(x,v):(c.flags=c.flags&-4097|2,ar=!1,Qs=c)}}else{if(og(c))throw Error(n(418));c.flags=c.flags&-4097|2,ar=!1,Qs=c}}}function Wb(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Qs=c}function Vf(c){if(c!==Qs)return!1;if(!ar)return Wb(c),ar=!0,!1;var d;if((d=c.tag!==3)&&!(d=c.tag!==5)&&(d=c.type,d=d!=="head"&&d!=="body"&&!Q2(c.type,c.memoizedProps)),d&&(d=Js)){if(og(c))throw Kb(),Error(n(418));for(;d;)Bb(c,d),d=Ii(d.nextSibling)}if(Wb(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 v=c.data;if(v==="/$"){if(d===0){Js=Ii(c.nextSibling);break e}d--}else v!=="$"&&v!=="$!"&&v!=="$?"||d++}c=c.nextSibling}Js=null}}else Js=Qs?Ii(c.stateNode.nextSibling):null;return!0}function Kb(){for(var c=Js;c;)c=Ii(c.nextSibling)}function vu(){Js=Qs=null,ar=!1}function lg(c){Za===null?Za=[c]:Za.push(c)}var V$=A.ReactCurrentBatchConfig;function r0(c,d,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var x=v.stateNode}if(!x)throw Error(n(147,c));var M=x,T=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===T?d.ref:(d=function(W){var fe=M.refs;W===null?delete fe[T]:fe[T]=W},d._stringRef=T,d)}if(typeof c!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,c))}return c}function Zf(c,d){throw c=Object.prototype.toString.call(d),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function Gb(c){var d=c._init;return d(c._payload)}function Yb(c){function d(He,Ce){if(c){var _e=He.deletions;_e===null?(He.deletions=[Ce],He.flags|=16):_e.push(Ce)}}function v(He,Ce){if(!c)return null;for(;Ce!==null;)d(He,Ce),Ce=Ce.sibling;return null}function x(He,Ce){for(He=new Map;Ce!==null;)Ce.key!==null?He.set(Ce.key,Ce):He.set(Ce.index,Ce),Ce=Ce.sibling;return He}function M(He,Ce){return He=Yi(He,Ce),He.index=0,He.sibling=null,He}function T(He,Ce,_e){return He.index=_e,c?(_e=He.alternate,_e!==null?(_e=_e.index,_e<Ce?(He.flags|=2,Ce):_e):(He.flags|=2,Ce)):(He.flags|=1048576,Ce)}function W(He){return c&&He.alternate===null&&(He.flags|=2),He}function fe(He,Ce,_e,St){return Ce===null||Ce.tag!==6?(Ce=Jg(_e,He.mode,St),Ce.return=He,Ce):(Ce=M(Ce,_e),Ce.return=He,Ce)}function be(He,Ce,_e,St){var Vt=_e.type;return Vt===N?dt(He,Ce,_e.props.children,St,_e.key):Ce!==null&&(Ce.elementType===Vt||typeof Vt=="object"&&Vt!==null&&Vt.$$typeof===K&&Gb(Vt)===Ce.type)?(St=M(Ce,_e.props),St.ref=r0(He,Ce,_e),St.return=He,St):(St=fh(_e.type,_e.key,_e.props,null,He.mode,St),St.ref=r0(He,Ce,_e),St.return=He,St)}function We(He,Ce,_e,St){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==_e.containerInfo||Ce.stateNode.implementation!==_e.implementation?(Ce=e8(_e,He.mode,St),Ce.return=He,Ce):(Ce=M(Ce,_e.children||[]),Ce.return=He,Ce)}function dt(He,Ce,_e,St,Vt){return Ce===null||Ce.tag!==7?(Ce=oc(_e,He.mode,St,Vt),Ce.return=He,Ce):(Ce=M(Ce,_e),Ce.return=He,Ce)}function vt(He,Ce,_e){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return Ce=Jg(""+Ce,He.mode,_e),Ce.return=He,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case L:return _e=fh(Ce.type,Ce.key,Ce.props,null,He.mode,_e),_e.ref=r0(He,null,Ce),_e.return=He,_e;case $:return Ce=e8(Ce,He.mode,_e),Ce.return=He,Ce;case K:var St=Ce._init;return vt(He,St(Ce._payload),_e)}if(Se(Ce)||I(Ce))return Ce=oc(Ce,He.mode,_e,null),Ce.return=He,Ce;Zf(He,Ce)}return null}function ut(He,Ce,_e,St){var Vt=Ce!==null?Ce.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number")return Vt!==null?null:fe(He,Ce,""+_e,St);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case L:return _e.key===Vt?be(He,Ce,_e,St):null;case $:return _e.key===Vt?We(He,Ce,_e,St):null;case K:return Vt=_e._init,ut(He,Ce,Vt(_e._payload),St)}if(Se(_e)||I(_e))return Vt!==null?null:dt(He,Ce,_e,St,null);Zf(He,_e)}return null}function Tt(He,Ce,_e,St,Vt){if(typeof St=="string"&&St!==""||typeof St=="number")return He=He.get(_e)||null,fe(Ce,He,""+St,Vt);if(typeof St=="object"&&St!==null){switch(St.$$typeof){case L:return He=He.get(St.key===null?_e:St.key)||null,be(Ce,He,St,Vt);case $:return He=He.get(St.key===null?_e:St.key)||null,We(Ce,He,St,Vt);case K:var Xt=St._init;return Tt(He,Ce,_e,Xt(St._payload),Vt)}if(Se(St)||I(St))return He=He.get(_e)||null,dt(Ce,He,St,Vt,null);Zf(Ce,St)}return null}function Ht(He,Ce,_e,St){for(var Vt=null,Xt=null,Qt=Ce,sn=Ce=0,Zr=null;Qt!==null&&sn<_e.length;sn++){Qt.index>sn?(Zr=Qt,Qt=null):Zr=Qt.sibling;var In=ut(He,Qt,_e[sn],St);if(In===null){Qt===null&&(Qt=Zr);break}c&&Qt&&In.alternate===null&&d(He,Qt),Ce=T(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In,Qt=Zr}if(sn===_e.length)return v(He,Qt),ar&&Ql(He,sn),Vt;if(Qt===null){for(;sn<_e.length;sn++)Qt=vt(He,_e[sn],St),Qt!==null&&(Ce=T(Qt,Ce,sn),Xt===null?Vt=Qt:Xt.sibling=Qt,Xt=Qt);return ar&&Ql(He,sn),Vt}for(Qt=x(He,Qt);sn<_e.length;sn++)Zr=Tt(Qt,He,sn,_e[sn],St),Zr!==null&&(c&&Zr.alternate!==null&&Qt.delete(Zr.key===null?sn:Zr.key),Ce=T(Zr,Ce,sn),Xt===null?Vt=Zr:Xt.sibling=Zr,Xt=Zr);return c&&Qt.forEach(function(qi){return d(He,qi)}),ar&&Ql(He,sn),Vt}function It(He,Ce,_e,St){var Vt=I(_e);if(typeof Vt!="function")throw Error(n(150));if(_e=Vt.call(_e),_e==null)throw Error(n(151));for(var Xt=Vt=null,Qt=Ce,sn=Ce=0,Zr=null,In=_e.next();Qt!==null&&!In.done;sn++,In=_e.next()){Qt.index>sn?(Zr=Qt,Qt=null):Zr=Qt.sibling;var qi=ut(He,Qt,In.value,St);if(qi===null){Qt===null&&(Qt=Zr);break}c&&Qt&&qi.alternate===null&&d(He,Qt),Ce=T(qi,Ce,sn),Xt===null?Vt=qi:Xt.sibling=qi,Xt=qi,Qt=Zr}if(In.done)return v(He,Qt),ar&&Ql(He,sn),Vt;if(Qt===null){for(;!In.done;sn++,In=_e.next())In=vt(He,In.value,St),In!==null&&(Ce=T(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In);return ar&&Ql(He,sn),Vt}for(Qt=x(He,Qt);!In.done;sn++,In=_e.next())In=Tt(Qt,He,sn,In.value,St),In!==null&&(c&&In.alternate!==null&&Qt.delete(In.key===null?sn:In.key),Ce=T(In,Ce,sn),Xt===null?Vt=In:Xt.sibling=In,Xt=In);return c&&Qt.forEach(function(bD){return d(He,bD)}),ar&&Ql(He,sn),Vt}function wr(He,Ce,_e,St){if(typeof _e=="object"&&_e!==null&&_e.type===N&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case L:e:{for(var Vt=_e.key,Xt=Ce;Xt!==null;){if(Xt.key===Vt){if(Vt=_e.type,Vt===N){if(Xt.tag===7){v(He,Xt.sibling),Ce=M(Xt,_e.props.children),Ce.return=He,He=Ce;break e}}else if(Xt.elementType===Vt||typeof Vt=="object"&&Vt!==null&&Vt.$$typeof===K&&Gb(Vt)===Xt.type){v(He,Xt.sibling),Ce=M(Xt,_e.props),Ce.ref=r0(He,Xt,_e),Ce.return=He,He=Ce;break e}v(He,Xt);break}else d(He,Xt);Xt=Xt.sibling}_e.type===N?(Ce=oc(_e.props.children,He.mode,St,_e.key),Ce.return=He,He=Ce):(St=fh(_e.type,_e.key,_e.props,null,He.mode,St),St.ref=r0(He,Ce,_e),St.return=He,He=St)}return W(He);case $:e:{for(Xt=_e.key;Ce!==null;){if(Ce.key===Xt)if(Ce.tag===4&&Ce.stateNode.containerInfo===_e.containerInfo&&Ce.stateNode.implementation===_e.implementation){v(He,Ce.sibling),Ce=M(Ce,_e.children||[]),Ce.return=He,He=Ce;break e}else{v(He,Ce);break}else d(He,Ce);Ce=Ce.sibling}Ce=e8(_e,He.mode,St),Ce.return=He,He=Ce}return W(He);case K:return Xt=_e._init,wr(He,Ce,Xt(_e._payload),St)}if(Se(_e))return Ht(He,Ce,_e,St);if(I(_e))return It(He,Ce,_e,St);Zf(He,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"?(_e=""+_e,Ce!==null&&Ce.tag===6?(v(He,Ce.sibling),Ce=M(Ce,_e),Ce.return=He,He=Ce):(v(He,Ce),Ce=Jg(_e,He.mode,St),Ce.return=He,He=Ce),W(He)):v(He,Ce)}return wr}var wu=Yb(!0),qb=Yb(!1),zf=Fi(null),Bf=null,yu=null,cg=null;function ug(){cg=yu=Bf=null}function dg(c){var d=zf.current;tr(zf),c._currentValue=d}function fg(c,d,v){for(;c!==null;){var x=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,x!==null&&(x.childLanes|=d)):x!==null&&(x.childLanes&d)!==d&&(x.childLanes|=d),c===v)break;c=c.return}}function bu(c,d){Bf=c,cg=yu=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&d)!==0&&(Ts=!0),c.firstContext=null)}function ga(c){var d=c._currentValue;if(cg!==c)if(c={context:c,memoizedValue:d,next:null},yu===null){if(Bf===null)throw Error(n(308));yu=c,Bf.dependencies={lanes:0,firstContext:c}}else yu=yu.next=c;return d}var Jl=null;function hg(c){Jl===null?Jl=[c]:Jl.push(c)}function Xb(c,d,v,x){var M=d.interleaved;return M===null?(v.next=v,hg(d)):(v.next=M.next,M.next=v),d.interleaved=v,Go(c,x)}function Go(c,d){c.lanes|=d;var v=c.alternate;for(v!==null&&(v.lanes|=d),v=c,c=c.return;c!==null;)c.childLanes|=d,v=c.alternate,v!==null&&(v.childLanes|=d),v=c,c=c.return;return v.tag===3?v.stateNode:null}var Zi=!1;function pg(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qb(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 Yo(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function zi(c,d,v){var x=c.updateQueue;if(x===null)return null;if(x=x.shared,(Hn&2)!==0){var M=x.pending;return M===null?d.next=d:(d.next=M.next,M.next=d),x.pending=d,Go(c,v)}return M=x.interleaved,M===null?(d.next=d,hg(x)):(d.next=M.next,M.next=d),x.interleaved=d,Go(c,v)}function Uf(c,d,v){if(d=d.updateQueue,d!==null&&(d=d.shared,(v&4194240)!==0)){var x=d.lanes;x&=c.pendingLanes,v|=x,d.lanes=v,Ir(c,v)}}function Jb(c,d){var v=c.updateQueue,x=c.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var M=null,T=null;if(v=v.firstBaseUpdate,v!==null){do{var W={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};T===null?M=T=W:T=T.next=W,v=v.next}while(v!==null);T===null?M=T=d:T=T.next=d}else M=T=d;v={baseState:x.baseState,firstBaseUpdate:M,lastBaseUpdate:T,shared:x.shared,effects:x.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=d:c.next=d,v.lastBaseUpdate=d}function Wf(c,d,v,x){var M=c.updateQueue;Zi=!1;var T=M.firstBaseUpdate,W=M.lastBaseUpdate,fe=M.shared.pending;if(fe!==null){M.shared.pending=null;var be=fe,We=be.next;be.next=null,W===null?T=We:W.next=We,W=be;var dt=c.alternate;dt!==null&&(dt=dt.updateQueue,fe=dt.lastBaseUpdate,fe!==W&&(fe===null?dt.firstBaseUpdate=We:fe.next=We,dt.lastBaseUpdate=be))}if(T!==null){var vt=M.baseState;W=0,dt=We=be=null,fe=T;do{var ut=fe.lane,Tt=fe.eventTime;if((x&ut)===ut){dt!==null&&(dt=dt.next={eventTime:Tt,lane:0,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null});e:{var Ht=c,It=fe;switch(ut=d,Tt=v,It.tag){case 1:if(Ht=It.payload,typeof Ht=="function"){vt=Ht.call(Tt,vt,ut);break e}vt=Ht;break e;case 3:Ht.flags=Ht.flags&-65537|128;case 0:if(Ht=It.payload,ut=typeof Ht=="function"?Ht.call(Tt,vt,ut):Ht,ut==null)break e;vt=Y({},vt,ut);break e;case 2:Zi=!0}}fe.callback!==null&&fe.lane!==0&&(c.flags|=64,ut=M.effects,ut===null?M.effects=[fe]:ut.push(fe))}else Tt={eventTime:Tt,lane:ut,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null},dt===null?(We=dt=Tt,be=vt):dt=dt.next=Tt,W|=ut;if(fe=fe.next,fe===null){if(fe=M.shared.pending,fe===null)break;ut=fe,fe=ut.next,ut.next=null,M.lastBaseUpdate=ut,M.shared.pending=null}}while(!0);if(dt===null&&(be=vt),M.baseState=be,M.firstBaseUpdate=We,M.lastBaseUpdate=dt,d=M.shared.interleaved,d!==null){M=d;do W|=M.lane,M=M.next;while(M!==d)}else T===null&&(M.shared.lanes=0);nc|=W,c.lanes=W,c.memoizedState=vt}}function e3(c,d,v){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var x=c[d],M=x.callback;if(M!==null){if(x.callback=null,x=v,typeof M!="function")throw Error(n(191,M));M.call(x)}}}var s0={},go=Fi(s0),a0=Fi(s0),o0=Fi(s0);function ec(c){if(c===s0)throw Error(n(174));return c}function mg(c,d){switch(Yn(o0,d),Yn(a0,c),Yn(go,s0),c=d.nodeType,c){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:Ne(null,"");break;default:c=c===8?d.parentNode:d,d=c.namespaceURI||null,c=c.tagName,d=Ne(d,c)}tr(go),Yn(go,d)}function xu(){tr(go),tr(a0),tr(o0)}function t3(c){ec(o0.current);var d=ec(go.current),v=Ne(d,c.type);d!==v&&(Yn(a0,c),Yn(go,v))}function gg(c){a0.current===c&&(tr(go),tr(a0))}var lr=Fi(0);function Kf(c){for(var d=c;d!==null;){if(d.tag===13){var v=d.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.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 vg=[];function wg(){for(var c=0;c<vg.length;c++)vg[c]._workInProgressVersionPrimary=null;vg.length=0}var Gf=A.ReactCurrentDispatcher,yg=A.ReactCurrentBatchConfig,tc=0,cr=null,Rr=null,_r=null,Yf=!1,i0=!1,l0=0,Z$=0;function ss(){throw Error(n(321))}function bg(c,d){if(d===null)return!1;for(var v=0;v<d.length&&v<c.length;v++)if(!Va(c[v],d[v]))return!1;return!0}function xg(c,d,v,x,M,T){if(tc=T,cr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Gf.current=c===null||c.memoizedState===null?W$:K$,c=v(x,M),i0){T=0;do{if(i0=!1,l0=0,25<=T)throw Error(n(301));T+=1,_r=Rr=null,d.updateQueue=null,Gf.current=G$,c=v(x,M)}while(i0)}if(Gf.current=Qf,d=Rr!==null&&Rr.next!==null,tc=0,_r=Rr=cr=null,Yf=!1,d)throw Error(n(300));return c}function kg(){var c=l0!==0;return l0=0,c}function vo(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _r===null?cr.memoizedState=_r=c:_r=_r.next=c,_r}function va(){if(Rr===null){var c=cr.alternate;c=c!==null?c.memoizedState:null}else c=Rr.next;var d=_r===null?cr.memoizedState:_r.next;if(d!==null)_r=d,Rr=c;else{if(c===null)throw Error(n(310));Rr=c,c={memoizedState:Rr.memoizedState,baseState:Rr.baseState,baseQueue:Rr.baseQueue,queue:Rr.queue,next:null},_r===null?cr.memoizedState=_r=c:_r=_r.next=c}return _r}function c0(c,d){return typeof d=="function"?d(c):d}function Sg(c){var d=va(),v=d.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=c;var x=Rr,M=x.baseQueue,T=v.pending;if(T!==null){if(M!==null){var W=M.next;M.next=T.next,T.next=W}x.baseQueue=M=T,v.pending=null}if(M!==null){T=M.next,x=x.baseState;var fe=W=null,be=null,We=T;do{var dt=We.lane;if((tc&dt)===dt)be!==null&&(be=be.next={lane:0,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null}),x=We.hasEagerState?We.eagerState:c(x,We.action);else{var vt={lane:dt,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null};be===null?(fe=be=vt,W=x):be=be.next=vt,cr.lanes|=dt,nc|=dt}We=We.next}while(We!==null&&We!==T);be===null?W=x:be.next=fe,Va(x,d.memoizedState)||(Ts=!0),d.memoizedState=x,d.baseState=W,d.baseQueue=be,v.lastRenderedState=x}if(c=v.interleaved,c!==null){M=c;do T=M.lane,cr.lanes|=T,nc|=T,M=M.next;while(M!==c)}else M===null&&(v.lanes=0);return[d.memoizedState,v.dispatch]}function Eg(c){var d=va(),v=d.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=c;var x=v.dispatch,M=v.pending,T=d.memoizedState;if(M!==null){v.pending=null;var W=M=M.next;do T=c(T,W.action),W=W.next;while(W!==M);Va(T,d.memoizedState)||(Ts=!0),d.memoizedState=T,d.baseQueue===null&&(d.baseState=T),v.lastRenderedState=T}return[T,x]}function n3(){}function r3(c,d){var v=cr,x=va(),M=d(),T=!Va(x.memoizedState,M);if(T&&(x.memoizedState=M,Ts=!0),x=x.queue,Cg(o3.bind(null,v,x,c),[c]),x.getSnapshot!==d||T||_r!==null&&_r.memoizedState.tag&1){if(v.flags|=2048,u0(9,a3.bind(null,v,x,M,d),void 0,null),Vr===null)throw Error(n(349));(tc&30)!==0||s3(v,d,M)}return M}function s3(c,d,v){c.flags|=16384,c={getSnapshot:d,value:v},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.stores=[c]):(v=d.stores,v===null?d.stores=[c]:v.push(c))}function a3(c,d,v,x){d.value=v,d.getSnapshot=x,i3(d)&&l3(c)}function o3(c,d,v){return v(function(){i3(d)&&l3(c)})}function i3(c){var d=c.getSnapshot;c=c.value;try{var v=d();return!Va(c,v)}catch{return!0}}function l3(c){var d=Go(c,1);d!==null&&Wa(d,c,1,-1)}function c3(c){var d=vo();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c0,lastRenderedState:c},d.queue=c,c=c.dispatch=U$.bind(null,cr,c),[d.memoizedState,c]}function u0(c,d,v,x){return c={tag:c,create:d,destroy:v,deps:x,next:null},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.lastEffect=c.next=c):(v=d.lastEffect,v===null?d.lastEffect=c.next=c:(x=v.next,v.next=c,c.next=x,d.lastEffect=c)),c}function u3(){return va().memoizedState}function qf(c,d,v,x){var M=vo();cr.flags|=c,M.memoizedState=u0(1|d,v,void 0,x===void 0?null:x)}function Xf(c,d,v,x){var M=va();x=x===void 0?null:x;var T=void 0;if(Rr!==null){var W=Rr.memoizedState;if(T=W.destroy,x!==null&&bg(x,W.deps)){M.memoizedState=u0(d,v,T,x);return}}cr.flags|=c,M.memoizedState=u0(1|d,v,T,x)}function d3(c,d){return qf(8390656,8,c,d)}function Cg(c,d){return Xf(2048,8,c,d)}function f3(c,d){return Xf(4,2,c,d)}function h3(c,d){return Xf(4,4,c,d)}function p3(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 m3(c,d,v){return v=v!=null?v.concat([c]):null,Xf(4,4,p3.bind(null,d,c),v)}function jg(){}function g3(c,d){var v=va();d=d===void 0?null:d;var x=v.memoizedState;return x!==null&&d!==null&&bg(d,x[1])?x[0]:(v.memoizedState=[c,d],c)}function v3(c,d){var v=va();d=d===void 0?null:d;var x=v.memoizedState;return x!==null&&d!==null&&bg(d,x[1])?x[0]:(c=c(),v.memoizedState=[c,d],c)}function w3(c,d,v){return(tc&21)===0?(c.baseState&&(c.baseState=!1,Ts=!0),c.memoizedState=v):(Va(v,d)||(v=dn(),cr.lanes|=v,nc|=v,c.baseState=!0),d)}function z$(c,d){var v=wn;wn=v!==0&&4>v?v:4,c(!0);var x=yg.transition;yg.transition={};try{c(!1),d()}finally{wn=v,yg.transition=x}}function y3(){return va().memoizedState}function B$(c,d,v){var x=Ki(c);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},b3(c))x3(d,v);else if(v=Xb(c,d,v,x),v!==null){var M=bs();Wa(v,c,x,M),k3(v,d,x)}}function U$(c,d,v){var x=Ki(c),M={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(b3(c))x3(d,M);else{var T=c.alternate;if(c.lanes===0&&(T===null||T.lanes===0)&&(T=d.lastRenderedReducer,T!==null))try{var W=d.lastRenderedState,fe=T(W,v);if(M.hasEagerState=!0,M.eagerState=fe,Va(fe,W)){var be=d.interleaved;be===null?(M.next=M,hg(d)):(M.next=be.next,be.next=M),d.interleaved=M;return}}catch{}finally{}v=Xb(c,d,M,x),v!==null&&(M=bs(),Wa(v,c,x,M),k3(v,d,x))}}function b3(c){var d=c.alternate;return c===cr||d!==null&&d===cr}function x3(c,d){i0=Yf=!0;var v=c.pending;v===null?d.next=d:(d.next=v.next,v.next=d),c.pending=d}function k3(c,d,v){if((v&4194240)!==0){var x=d.lanes;x&=c.pendingLanes,v|=x,d.lanes=v,Ir(c,v)}}var Qf={readContext:ga,useCallback:ss,useContext:ss,useEffect:ss,useImperativeHandle:ss,useInsertionEffect:ss,useLayoutEffect:ss,useMemo:ss,useReducer:ss,useRef:ss,useState:ss,useDebugValue:ss,useDeferredValue:ss,useTransition:ss,useMutableSource:ss,useSyncExternalStore:ss,useId:ss,unstable_isNewReconciler:!1},W$={readContext:ga,useCallback:function(c,d){return vo().memoizedState=[c,d===void 0?null:d],c},useContext:ga,useEffect:d3,useImperativeHandle:function(c,d,v){return v=v!=null?v.concat([c]):null,qf(4194308,4,p3.bind(null,d,c),v)},useLayoutEffect:function(c,d){return qf(4194308,4,c,d)},useInsertionEffect:function(c,d){return qf(4,2,c,d)},useMemo:function(c,d){var v=vo();return d=d===void 0?null:d,c=c(),v.memoizedState=[c,d],c},useReducer:function(c,d,v){var x=vo();return d=v!==void 0?v(d):d,x.memoizedState=x.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},x.queue=c,c=c.dispatch=B$.bind(null,cr,c),[x.memoizedState,c]},useRef:function(c){var d=vo();return c={current:c},d.memoizedState=c},useState:c3,useDebugValue:jg,useDeferredValue:function(c){return vo().memoizedState=c},useTransition:function(){var c=c3(!1),d=c[0];return c=z$.bind(null,c[1]),vo().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,v){var x=cr,M=vo();if(ar){if(v===void 0)throw Error(n(407));v=v()}else{if(v=d(),Vr===null)throw Error(n(349));(tc&30)!==0||s3(x,d,v)}M.memoizedState=v;var T={value:v,getSnapshot:d};return M.queue=T,d3(o3.bind(null,x,T,c),[c]),x.flags|=2048,u0(9,a3.bind(null,x,T,v,d),void 0,null),v},useId:function(){var c=vo(),d=Vr.identifierPrefix;if(ar){var v=Ko,x=Wo;v=(x&~(1<<32-ye(x)-1)).toString(32)+v,d=":"+d+"R"+v,v=l0++,0<v&&(d+="H"+v.toString(32)),d+=":"}else v=Z$++,d=":"+d+"r"+v.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},K$={readContext:ga,useCallback:g3,useContext:ga,useEffect:Cg,useImperativeHandle:m3,useInsertionEffect:f3,useLayoutEffect:h3,useMemo:v3,useReducer:Sg,useRef:u3,useState:function(){return Sg(c0)},useDebugValue:jg,useDeferredValue:function(c){var d=va();return w3(d,Rr.memoizedState,c)},useTransition:function(){var c=Sg(c0)[0],d=va().memoizedState;return[c,d]},useMutableSource:n3,useSyncExternalStore:r3,useId:y3,unstable_isNewReconciler:!1},G$={readContext:ga,useCallback:g3,useContext:ga,useEffect:Cg,useImperativeHandle:m3,useInsertionEffect:f3,useLayoutEffect:h3,useMemo:v3,useReducer:Eg,useRef:u3,useState:function(){return Eg(c0)},useDebugValue:jg,useDeferredValue:function(c){var d=va();return Rr===null?d.memoizedState=c:w3(d,Rr.memoizedState,c)},useTransition:function(){var c=Eg(c0)[0],d=va().memoizedState;return[c,d]},useMutableSource:n3,useSyncExternalStore:r3,useId:y3,unstable_isNewReconciler:!1};function za(c,d){if(c&&c.defaultProps){d=Y({},d),c=c.defaultProps;for(var v in c)d[v]===void 0&&(d[v]=c[v]);return d}return d}function Ag(c,d,v,x){d=c.memoizedState,v=v(x,d),v=v==null?d:Y({},d,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var Jf={isMounted:function(c){return(c=c._reactInternals)?ot(c)===c:!1},enqueueSetState:function(c,d,v){c=c._reactInternals;var x=bs(),M=Ki(c),T=Yo(x,M);T.payload=d,v!=null&&(T.callback=v),d=zi(c,T,M),d!==null&&(Wa(d,c,M,x),Uf(d,c,M))},enqueueReplaceState:function(c,d,v){c=c._reactInternals;var x=bs(),M=Ki(c),T=Yo(x,M);T.tag=1,T.payload=d,v!=null&&(T.callback=v),d=zi(c,T,M),d!==null&&(Wa(d,c,M,x),Uf(d,c,M))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var v=bs(),x=Ki(c),M=Yo(v,x);M.tag=2,d!=null&&(M.callback=d),d=zi(c,M,x),d!==null&&(Wa(d,c,x,v),Uf(d,c,x))}};function S3(c,d,v,x,M,T,W){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(x,T,W):d.prototype&&d.prototype.isPureReactComponent?!qd(v,x)||!qd(M,T):!0}function E3(c,d,v){var x=!1,M=_i,T=d.contextType;return typeof T=="object"&&T!==null?T=ga(T):(M=Ls(d)?ql:rs.current,x=d.contextTypes,T=(x=x!=null)?pu(c,M):_i),d=new d(v,T),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Jf,c.stateNode=d,d._reactInternals=c,x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=M,c.__reactInternalMemoizedMaskedChildContext=T),d}function C3(c,d,v,x){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(v,x),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(v,x),d.state!==c&&Jf.enqueueReplaceState(d,d.state,null)}function Ng(c,d,v,x){var M=c.stateNode;M.props=v,M.state=c.memoizedState,M.refs={},pg(c);var T=d.contextType;typeof T=="object"&&T!==null?M.context=ga(T):(T=Ls(d)?ql:rs.current,M.context=pu(c,T)),M.state=c.memoizedState,T=d.getDerivedStateFromProps,typeof T=="function"&&(Ag(c,d,T,v),M.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(d=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),d!==M.state&&Jf.enqueueReplaceState(M,M.state,null),Wf(c,v,M,x),M.state=c.memoizedState),typeof M.componentDidMount=="function"&&(c.flags|=4194308)}function ku(c,d){try{var v="",x=d;do v+=he(x),x=x.return;while(x);var M=v}catch(T){M=`
|
|
39
|
+
Error generating stack: `+T.message+`
|
|
40
|
+
`+T.stack}return{value:c,source:d,stack:M,digest:null}}function Mg(c,d,v){return{value:c,source:null,stack:v??null,digest:d??null}}function Rg(c,d){try{console.error(d.value)}catch(v){setTimeout(function(){throw v})}}var Y$=typeof WeakMap=="function"?WeakMap:Map;function j3(c,d,v){v=Yo(-1,v),v.tag=3,v.payload={element:null};var x=d.value;return v.callback=function(){oh||(oh=!0,Ug=x),Rg(c,d)},v}function A3(c,d,v){v=Yo(-1,v),v.tag=3;var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var M=d.value;v.payload=function(){return x(M)},v.callback=function(){Rg(c,d)}}var T=c.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(v.callback=function(){Rg(c,d),typeof x!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var W=d.stack;this.componentDidCatch(d.value,{componentStack:W!==null?W:""})}),v}function N3(c,d,v){var x=c.pingCache;if(x===null){x=c.pingCache=new Y$;var M=new Set;x.set(d,M)}else M=x.get(d),M===void 0&&(M=new Set,x.set(d,M));M.has(v)||(M.add(v),c=cD.bind(null,c,d,v),d.then(c,c))}function M3(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 R3(c,d,v,x,M){return(c.mode&1)===0?(c===d?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(d=Yo(-1,1),d.tag=2,zi(v,d,1))),v.lanes|=1),c):(c.flags|=65536,c.lanes=M,c)}var q$=A.ReactCurrentOwner,Ts=!1;function ys(c,d,v,x){d.child=c===null?qb(d,null,v,x):wu(d,c.child,v,x)}function P3(c,d,v,x,M){v=v.render;var T=d.ref;return bu(d,M),x=xg(c,d,v,x,T,M),v=kg(),c!==null&&!Ts?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~M,qo(c,d,M)):(ar&&v&&sg(d),d.flags|=1,ys(c,d,x,M),d.child)}function L3(c,d,v,x,M){if(c===null){var T=v.type;return typeof T=="function"&&!Qg(T)&&T.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(d.tag=15,d.type=T,T3(c,d,T,x,M)):(c=fh(v.type,null,x,d,d.mode,M),c.ref=d.ref,c.return=d,d.child=c)}if(T=c.child,(c.lanes&M)===0){var W=T.memoizedProps;if(v=v.compare,v=v!==null?v:qd,v(W,x)&&c.ref===d.ref)return qo(c,d,M)}return d.flags|=1,c=Yi(T,x),c.ref=d.ref,c.return=d,d.child=c}function T3(c,d,v,x,M){if(c!==null){var T=c.memoizedProps;if(qd(T,x)&&c.ref===d.ref)if(Ts=!1,d.pendingProps=x=T,(c.lanes&M)!==0)(c.flags&131072)!==0&&(Ts=!0);else return d.lanes=c.lanes,qo(c,d,M)}return Pg(c,d,v,x,M)}function $3(c,d,v){var x=d.pendingProps,M=x.children,T=c!==null?c.memoizedState:null;if(x.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yn(Eu,ea),ea|=v;else{if((v&1073741824)===0)return c=T!==null?T.baseLanes|v:v,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,Yn(Eu,ea),ea|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=T!==null?T.baseLanes:v,Yn(Eu,ea),ea|=x}else T!==null?(x=T.baseLanes|v,d.memoizedState=null):x=v,Yn(Eu,ea),ea|=x;return ys(c,d,M,v),d.child}function D3(c,d){var v=d.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(d.flags|=512,d.flags|=2097152)}function Pg(c,d,v,x,M){var T=Ls(v)?ql:rs.current;return T=pu(d,T),bu(d,M),v=xg(c,d,v,x,T,M),x=kg(),c!==null&&!Ts?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~M,qo(c,d,M)):(ar&&x&&sg(d),d.flags|=1,ys(c,d,v,M),d.child)}function H3(c,d,v,x,M){if(Ls(v)){var T=!0;Of(d)}else T=!1;if(bu(d,M),d.stateNode===null)th(c,d),E3(d,v,x),Ng(d,v,x,M),x=!0;else if(c===null){var W=d.stateNode,fe=d.memoizedProps;W.props=fe;var be=W.context,We=v.contextType;typeof We=="object"&&We!==null?We=ga(We):(We=Ls(v)?ql:rs.current,We=pu(d,We));var dt=v.getDerivedStateFromProps,vt=typeof dt=="function"||typeof W.getSnapshotBeforeUpdate=="function";vt||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(fe!==x||be!==We)&&C3(d,W,x,We),Zi=!1;var ut=d.memoizedState;W.state=ut,Wf(d,x,W,M),be=d.memoizedState,fe!==x||ut!==be||Ps.current||Zi?(typeof dt=="function"&&(Ag(d,v,dt,x),be=d.memoizedState),(fe=Zi||S3(d,v,fe,x,ut,be,We))?(vt||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(d.flags|=4194308)):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=x,d.memoizedState=be),W.props=x,W.state=be,W.context=We,x=fe):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),x=!1)}else{W=d.stateNode,Qb(c,d),fe=d.memoizedProps,We=d.type===d.elementType?fe:za(d.type,fe),W.props=We,vt=d.pendingProps,ut=W.context,be=v.contextType,typeof be=="object"&&be!==null?be=ga(be):(be=Ls(v)?ql:rs.current,be=pu(d,be));var Tt=v.getDerivedStateFromProps;(dt=typeof Tt=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(fe!==vt||ut!==be)&&C3(d,W,x,be),Zi=!1,ut=d.memoizedState,W.state=ut,Wf(d,x,W,M);var Ht=d.memoizedState;fe!==vt||ut!==Ht||Ps.current||Zi?(typeof Tt=="function"&&(Ag(d,v,Tt,x),Ht=d.memoizedState),(We=Zi||S3(d,v,We,x,ut,Ht,be)||!1)?(dt||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate(x,Ht,be),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate(x,Ht,be)),typeof W.componentDidUpdate=="function"&&(d.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof W.componentDidUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=1024),d.memoizedProps=x,d.memoizedState=Ht),W.props=x,W.state=Ht,W.context=be,x=We):(typeof W.componentDidUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||fe===c.memoizedProps&&ut===c.memoizedState||(d.flags|=1024),x=!1)}return Lg(c,d,v,x,T,M)}function Lg(c,d,v,x,M,T){D3(c,d);var W=(d.flags&128)!==0;if(!x&&!W)return M&&Vb(d,v,!1),qo(c,d,T);x=d.stateNode,q$.current=d;var fe=W&&typeof v.getDerivedStateFromError!="function"?null:x.render();return d.flags|=1,c!==null&&W?(d.child=wu(d,c.child,null,T),d.child=wu(d,null,fe,T)):ys(c,d,fe,T),d.memoizedState=x.state,M&&Vb(d,v,!0),d.child}function O3(c){var d=c.stateNode;d.pendingContext?Fb(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Fb(c,d.context,!1),mg(c,d.containerInfo)}function I3(c,d,v,x,M){return vu(),lg(M),d.flags|=256,ys(c,d,v,x),d.child}var Tg={dehydrated:null,treeContext:null,retryLane:0};function $g(c){return{baseLanes:c,cachePool:null,transitions:null}}function F3(c,d,v){var x=d.pendingProps,M=lr.current,T=!1,W=(d.flags&128)!==0,fe;if((fe=W)||(fe=c!==null&&c.memoizedState===null?!1:(M&2)!==0),fe?(T=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(M|=1),Yn(lr,M&1),c===null)return ig(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):(W=x.children,c=x.fallback,T?(x=d.mode,T=d.child,W={mode:"hidden",children:W},(x&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=W):T=hh(W,x,0,null),c=oc(c,x,v,null),T.return=d,c.return=d,T.sibling=c,d.child=T,d.child.memoizedState=$g(v),d.memoizedState=Tg,c):Dg(d,W));if(M=c.memoizedState,M!==null&&(fe=M.dehydrated,fe!==null))return X$(c,d,W,x,fe,M,v);if(T){T=x.fallback,W=d.mode,M=c.child,fe=M.sibling;var be={mode:"hidden",children:x.children};return(W&1)===0&&d.child!==M?(x=d.child,x.childLanes=0,x.pendingProps=be,d.deletions=null):(x=Yi(M,be),x.subtreeFlags=M.subtreeFlags&14680064),fe!==null?T=Yi(fe,T):(T=oc(T,W,v,null),T.flags|=2),T.return=d,x.return=d,x.sibling=T,d.child=x,x=T,T=d.child,W=c.child.memoizedState,W=W===null?$g(v):{baseLanes:W.baseLanes|v,cachePool:null,transitions:W.transitions},T.memoizedState=W,T.childLanes=c.childLanes&~v,d.memoizedState=Tg,x}return T=c.child,c=T.sibling,x=Yi(T,{mode:"visible",children:x.children}),(d.mode&1)===0&&(x.lanes=v),x.return=d,x.sibling=null,c!==null&&(v=d.deletions,v===null?(d.deletions=[c],d.flags|=16):v.push(c)),d.child=x,d.memoizedState=null,x}function Dg(c,d){return d=hh({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function eh(c,d,v,x){return x!==null&&lg(x),wu(d,c.child,null,v),c=Dg(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function X$(c,d,v,x,M,T,W){if(v)return d.flags&256?(d.flags&=-257,x=Mg(Error(n(422))),eh(c,d,W,x)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(T=x.fallback,M=d.mode,x=hh({mode:"visible",children:x.children},M,0,null),T=oc(T,M,W,null),T.flags|=2,x.return=d,T.return=d,x.sibling=T,d.child=x,(d.mode&1)!==0&&wu(d,c.child,null,W),d.child.memoizedState=$g(W),d.memoizedState=Tg,T);if((d.mode&1)===0)return eh(c,d,W,null);if(M.data==="$!"){if(x=M.nextSibling&&M.nextSibling.dataset,x)var fe=x.dgst;return x=fe,T=Error(n(419)),x=Mg(T,x,void 0),eh(c,d,W,x)}if(fe=(W&c.childLanes)!==0,Ts||fe){if(x=Vr,x!==null){switch(W&-W){case 4:M=2;break;case 16:M=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:M=32;break;case 536870912:M=268435456;break;default:M=0}M=(M&(x.suspendedLanes|W))!==0?0:M,M!==0&&M!==T.retryLane&&(T.retryLane=M,Go(c,M),Wa(x,c,M,-1))}return Xg(),x=Mg(Error(n(421))),eh(c,d,W,x)}return M.data==="$?"?(d.flags|=128,d.child=c.child,d=uD.bind(null,c),M._reactRetry=d,null):(c=T.treeContext,Js=Ii(M.nextSibling),Qs=d,ar=!0,Za=null,c!==null&&(pa[ma++]=Wo,pa[ma++]=Ko,pa[ma++]=Xl,Wo=c.id,Ko=c.overflow,Xl=d),d=Dg(d,x.children),d.flags|=4096,d)}function _3(c,d,v){c.lanes|=d;var x=c.alternate;x!==null&&(x.lanes|=d),fg(c.return,d,v)}function Hg(c,d,v,x,M){var T=c.memoizedState;T===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:x,tail:v,tailMode:M}:(T.isBackwards=d,T.rendering=null,T.renderingStartTime=0,T.last=x,T.tail=v,T.tailMode=M)}function V3(c,d,v){var x=d.pendingProps,M=x.revealOrder,T=x.tail;if(ys(c,d,x.children,v),x=lr.current,(x&2)!==0)x=x&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&&_3(c,v,d);else if(c.tag===19)_3(c,v,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}x&=1}if(Yn(lr,x),(d.mode&1)===0)d.memoizedState=null;else switch(M){case"forwards":for(v=d.child,M=null;v!==null;)c=v.alternate,c!==null&&Kf(c)===null&&(M=v),v=v.sibling;v=M,v===null?(M=d.child,d.child=null):(M=v.sibling,v.sibling=null),Hg(d,!1,M,v,T);break;case"backwards":for(v=null,M=d.child,d.child=null;M!==null;){if(c=M.alternate,c!==null&&Kf(c)===null){d.child=M;break}c=M.sibling,M.sibling=v,v=M,M=c}Hg(d,!0,v,null,T);break;case"together":Hg(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function th(c,d){(d.mode&1)===0&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function qo(c,d,v){if(c!==null&&(d.dependencies=c.dependencies),nc|=d.lanes,(v&d.childLanes)===0)return null;if(c!==null&&d.child!==c.child)throw Error(n(153));if(d.child!==null){for(c=d.child,v=Yi(c,c.pendingProps),d.child=v,v.return=d;c.sibling!==null;)c=c.sibling,v=v.sibling=Yi(c,c.pendingProps),v.return=d;v.sibling=null}return d.child}function Q$(c,d,v){switch(d.tag){case 3:O3(d),vu();break;case 5:t3(d);break;case 1:Ls(d.type)&&Of(d);break;case 4:mg(d,d.stateNode.containerInfo);break;case 10:var x=d.type._context,M=d.memoizedProps.value;Yn(zf,x._currentValue),x._currentValue=M;break;case 13:if(x=d.memoizedState,x!==null)return x.dehydrated!==null?(Yn(lr,lr.current&1),d.flags|=128,null):(v&d.child.childLanes)!==0?F3(c,d,v):(Yn(lr,lr.current&1),c=qo(c,d,v),c!==null?c.sibling:null);Yn(lr,lr.current&1);break;case 19:if(x=(v&d.childLanes)!==0,(c.flags&128)!==0){if(x)return V3(c,d,v);d.flags|=128}if(M=d.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),Yn(lr,lr.current),x)break;return null;case 22:case 23:return d.lanes=0,$3(c,d,v)}return qo(c,d,v)}var Z3,Og,z3,B3;Z3=function(c,d){for(var v=d.child;v!==null;){if(v.tag===5||v.tag===6)c.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===d)break;for(;v.sibling===null;){if(v.return===null||v.return===d)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Og=function(){},z3=function(c,d,v,x){var M=c.memoizedProps;if(M!==x){c=d.stateNode,ec(go.current);var T=null;switch(v){case"input":M=pe(c,M),x=pe(c,x),T=[];break;case"select":M=Y({},M,{value:void 0}),x=Y({},x,{value:void 0}),T=[];break;case"textarea":M=je(c,M),x=je(c,x),T=[];break;default:typeof M.onClick!="function"&&typeof x.onClick=="function"&&(c.onclick=$f)}Zt(v,x);var W;v=null;for(We in M)if(!x.hasOwnProperty(We)&&M.hasOwnProperty(We)&&M[We]!=null)if(We==="style"){var fe=M[We];for(W in fe)fe.hasOwnProperty(W)&&(v||(v={}),v[W]="")}else We!=="dangerouslySetInnerHTML"&&We!=="children"&&We!=="suppressContentEditableWarning"&&We!=="suppressHydrationWarning"&&We!=="autoFocus"&&(a.hasOwnProperty(We)?T||(T=[]):(T=T||[]).push(We,null));for(We in x){var be=x[We];if(fe=M!=null?M[We]:void 0,x.hasOwnProperty(We)&&be!==fe&&(be!=null||fe!=null))if(We==="style")if(fe){for(W in fe)!fe.hasOwnProperty(W)||be&&be.hasOwnProperty(W)||(v||(v={}),v[W]="");for(W in be)be.hasOwnProperty(W)&&fe[W]!==be[W]&&(v||(v={}),v[W]=be[W])}else v||(T||(T=[]),T.push(We,v)),v=be;else We==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,fe=fe?fe.__html:void 0,be!=null&&fe!==be&&(T=T||[]).push(We,be)):We==="children"?typeof be!="string"&&typeof be!="number"||(T=T||[]).push(We,""+be):We!=="suppressContentEditableWarning"&&We!=="suppressHydrationWarning"&&(a.hasOwnProperty(We)?(be!=null&&We==="onScroll"&&er("scroll",c),T||fe===be||(T=[])):(T=T||[]).push(We,be))}v&&(T=T||[]).push("style",v);var We=T;(d.updateQueue=We)&&(d.flags|=4)}},B3=function(c,d,v,x){v!==x&&(d.flags|=4)};function d0(c,d){if(!ar)switch(c.tailMode){case"hidden":d=c.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var x=null;v!==null;)v.alternate!==null&&(x=v),v=v.sibling;x===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:x.sibling=null}}function as(c){var d=c.alternate!==null&&c.alternate.child===c.child,v=0,x=0;if(d)for(var M=c.child;M!==null;)v|=M.lanes|M.childLanes,x|=M.subtreeFlags&14680064,x|=M.flags&14680064,M.return=c,M=M.sibling;else for(M=c.child;M!==null;)v|=M.lanes|M.childLanes,x|=M.subtreeFlags,x|=M.flags,M.return=c,M=M.sibling;return c.subtreeFlags|=x,c.childLanes=v,d}function J$(c,d,v){var x=d.pendingProps;switch(ag(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return as(d),null;case 1:return Ls(d.type)&&Hf(),as(d),null;case 3:return x=d.stateNode,xu(),tr(Ps),tr(rs),wg(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(c===null||c.child===null)&&(Vf(d)?d.flags|=4:c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Za!==null&&(Gg(Za),Za=null))),Og(c,d),as(d),null;case 5:gg(d);var M=ec(o0.current);if(v=d.type,c!==null&&d.stateNode!=null)z3(c,d,v,x,M),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!x){if(d.stateNode===null)throw Error(n(166));return as(d),null}if(c=ec(go.current),Vf(d)){x=d.stateNode,v=d.type;var T=d.memoizedProps;switch(x[mo]=d,x[t0]=T,c=(d.mode&1)!==0,v){case"dialog":er("cancel",x),er("close",x);break;case"iframe":case"object":case"embed":er("load",x);break;case"video":case"audio":for(M=0;M<Qd.length;M++)er(Qd[M],x);break;case"source":er("error",x);break;case"img":case"image":case"link":er("error",x),er("load",x);break;case"details":er("toggle",x);break;case"input":Te(x,T),er("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!T.multiple},er("invalid",x);break;case"textarea":Re(x,T),er("invalid",x)}Zt(v,T),M=null;for(var W in T)if(T.hasOwnProperty(W)){var fe=T[W];W==="children"?typeof fe=="string"?x.textContent!==fe&&(T.suppressHydrationWarning!==!0&&Tf(x.textContent,fe,c),M=["children",fe]):typeof fe=="number"&&x.textContent!==""+fe&&(T.suppressHydrationWarning!==!0&&Tf(x.textContent,fe,c),M=["children",""+fe]):a.hasOwnProperty(W)&&fe!=null&&W==="onScroll"&&er("scroll",x)}switch(v){case"input":ie(x),tt(x,T,!0);break;case"textarea":ie(x),G(x);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(x.onclick=$f)}x=M,d.updateQueue=x,x!==null&&(d.flags|=4)}else{W=M.nodeType===9?M:M.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=oe(v)),c==="http://www.w3.org/1999/xhtml"?v==="script"?(c=W.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof x.is=="string"?c=W.createElement(v,{is:x.is}):(c=W.createElement(v),v==="select"&&(W=c,x.multiple?W.multiple=!0:x.size&&(W.size=x.size))):c=W.createElementNS(c,v),c[mo]=d,c[t0]=x,Z3(c,d,!1,!1),d.stateNode=c;e:{switch(W=jt(v,x),v){case"dialog":er("cancel",c),er("close",c),M=x;break;case"iframe":case"object":case"embed":er("load",c),M=x;break;case"video":case"audio":for(M=0;M<Qd.length;M++)er(Qd[M],c);M=x;break;case"source":er("error",c),M=x;break;case"img":case"image":case"link":er("error",c),er("load",c),M=x;break;case"details":er("toggle",c),M=x;break;case"input":Te(c,x),M=pe(c,x),er("invalid",c);break;case"option":M=x;break;case"select":c._wrapperState={wasMultiple:!!x.multiple},M=Y({},x,{value:void 0}),er("invalid",c);break;case"textarea":Re(c,x),M=je(c,x),er("invalid",c);break;default:M=x}Zt(v,M),fe=M;for(T in fe)if(fe.hasOwnProperty(T)){var be=fe[T];T==="style"?bt(c,be):T==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,be!=null&&st(c,be)):T==="children"?typeof be=="string"?(v!=="textarea"||be!=="")&&Pe(c,be):typeof be=="number"&&Pe(c,""+be):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(a.hasOwnProperty(T)?be!=null&&T==="onScroll"&&er("scroll",c):be!=null&&E(c,T,be,W))}switch(v){case"input":ie(c),tt(c,x,!1);break;case"textarea":ie(c),G(c);break;case"option":x.value!=null&&c.setAttribute("value",""+re(x.value));break;case"select":c.multiple=!!x.multiple,T=x.value,T!=null?Q(c,!!x.multiple,T,!1):x.defaultValue!=null&&Q(c,!!x.multiple,x.defaultValue,!0);break;default:typeof M.onClick=="function"&&(c.onclick=$f)}switch(v){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return as(d),null;case 6:if(c&&d.stateNode!=null)B3(c,d,c.memoizedProps,x);else{if(typeof x!="string"&&d.stateNode===null)throw Error(n(166));if(v=ec(o0.current),ec(go.current),Vf(d)){if(x=d.stateNode,v=d.memoizedProps,x[mo]=d,(T=x.nodeValue!==v)&&(c=Qs,c!==null))switch(c.tag){case 3:Tf(x.nodeValue,v,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Tf(x.nodeValue,v,(c.mode&1)!==0)}T&&(d.flags|=4)}else x=(v.nodeType===9?v:v.ownerDocument).createTextNode(x),x[mo]=d,d.stateNode=x}return as(d),null;case 13:if(tr(lr),x=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(ar&&Js!==null&&(d.mode&1)!==0&&(d.flags&128)===0)Kb(),vu(),d.flags|=98560,T=!1;else if(T=Vf(d),x!==null&&x.dehydrated!==null){if(c===null){if(!T)throw Error(n(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[mo]=d}else vu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;as(d),T=!1}else Za!==null&&(Gg(Za),Za=null),T=!0;if(!T)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=v,d):(x=x!==null,x!==(c!==null&&c.memoizedState!==null)&&x&&(d.child.flags|=8192,(d.mode&1)!==0&&(c===null||(lr.current&1)!==0?Pr===0&&(Pr=3):Xg())),d.updateQueue!==null&&(d.flags|=4),as(d),null);case 4:return xu(),Og(c,d),c===null&&Jd(d.stateNode.containerInfo),as(d),null;case 10:return dg(d.type._context),as(d),null;case 17:return Ls(d.type)&&Hf(),as(d),null;case 19:if(tr(lr),T=d.memoizedState,T===null)return as(d),null;if(x=(d.flags&128)!==0,W=T.rendering,W===null)if(x)d0(T,!1);else{if(Pr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(W=Kf(c),W!==null){for(d.flags|=128,d0(T,!1),x=W.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),d.subtreeFlags=0,x=v,v=d.child;v!==null;)T=v,c=x,T.flags&=14680066,W=T.alternate,W===null?(T.childLanes=0,T.lanes=c,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=W.childLanes,T.lanes=W.lanes,T.child=W.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=W.memoizedProps,T.memoizedState=W.memoizedState,T.updateQueue=W.updateQueue,T.type=W.type,c=W.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),v=v.sibling;return Yn(lr,lr.current&1|2),d.child}c=c.sibling}T.tail!==null&&qe()>Cu&&(d.flags|=128,x=!0,d0(T,!1),d.lanes=4194304)}else{if(!x)if(c=Kf(W),c!==null){if(d.flags|=128,x=!0,v=c.updateQueue,v!==null&&(d.updateQueue=v,d.flags|=4),d0(T,!0),T.tail===null&&T.tailMode==="hidden"&&!W.alternate&&!ar)return as(d),null}else 2*qe()-T.renderingStartTime>Cu&&v!==1073741824&&(d.flags|=128,x=!0,d0(T,!1),d.lanes=4194304);T.isBackwards?(W.sibling=d.child,d.child=W):(v=T.last,v!==null?v.sibling=W:d.child=W,T.last=W)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=qe(),d.sibling=null,v=lr.current,Yn(lr,x?v&1|2:v&1),d):(as(d),null);case 22:case 23:return qg(),x=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==x&&(d.flags|=8192),x&&(d.mode&1)!==0?(ea&1073741824)!==0&&(as(d),d.subtreeFlags&6&&(d.flags|=8192)):as(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function eD(c,d){switch(ag(d),d.tag){case 1:return Ls(d.type)&&Hf(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return xu(),tr(Ps),tr(rs),wg(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 5:return gg(d),null;case 13:if(tr(lr),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(n(340));vu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return tr(lr),null;case 4:return xu(),null;case 10:return dg(d.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var nh=!1,os=!1,tD=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function Su(c,d){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){pr(c,d,x)}else v.current=null}function Ig(c,d,v){try{v()}catch(x){pr(c,d,x)}}var U3=!1;function nD(c,d){if(q2=Pn,c=Sb(),Z2(c)){if("selectionStart"in c)var v={start:c.selectionStart,end:c.selectionEnd};else e:{v=(v=c.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var M=x.anchorOffset,T=x.focusNode;x=x.focusOffset;try{v.nodeType,T.nodeType}catch{v=null;break e}var W=0,fe=-1,be=-1,We=0,dt=0,vt=c,ut=null;t:for(;;){for(var Tt;vt!==v||M!==0&&vt.nodeType!==3||(fe=W+M),vt!==T||x!==0&&vt.nodeType!==3||(be=W+x),vt.nodeType===3&&(W+=vt.nodeValue.length),(Tt=vt.firstChild)!==null;)ut=vt,vt=Tt;for(;;){if(vt===c)break t;if(ut===v&&++We===M&&(fe=W),ut===T&&++dt===x&&(be=W),(Tt=vt.nextSibling)!==null)break;vt=ut,ut=vt.parentNode}vt=Tt}v=fe===-1||be===-1?null:{start:fe,end:be}}else v=null}v=v||{start:0,end:0}}else v=null;for(X2={focusedElem:c,selectionRange:v},Pn=!1,Dt=d;Dt!==null;)if(d=Dt,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Dt=c;else for(;Dt!==null;){d=Dt;try{var Ht=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Ht!==null){var It=Ht.memoizedProps,wr=Ht.memoizedState,He=d.stateNode,Ce=He.getSnapshotBeforeUpdate(d.elementType===d.type?It:za(d.type,It),wr);He.__reactInternalSnapshotBeforeUpdate=Ce}break;case 3:var _e=d.stateNode.containerInfo;_e.nodeType===1?_e.textContent="":_e.nodeType===9&&_e.documentElement&&_e.removeChild(_e.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(St){pr(d,d.return,St)}if(c=d.sibling,c!==null){c.return=d.return,Dt=c;break}Dt=d.return}return Ht=U3,U3=!1,Ht}function f0(c,d,v){var x=d.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var M=x=x.next;do{if((M.tag&c)===c){var T=M.destroy;M.destroy=void 0,T!==void 0&&Ig(d,v,T)}M=M.next}while(M!==x)}}function rh(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var v=d=d.next;do{if((v.tag&c)===c){var x=v.create;v.destroy=x()}v=v.next}while(v!==d)}}function Fg(c){var d=c.ref;if(d!==null){var v=c.stateNode;switch(c.tag){case 5:c=v;break;default:c=v}typeof d=="function"?d(c):d.current=c}}function W3(c){var d=c.alternate;d!==null&&(c.alternate=null,W3(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&(delete d[mo],delete d[t0],delete d[tg],delete d[I$],delete d[F$])),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 K3(c){return c.tag===5||c.tag===3||c.tag===4}function G3(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||K3(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 _g(c,d,v){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?v.nodeType===8?v.parentNode.insertBefore(c,d):v.insertBefore(c,d):(v.nodeType===8?(d=v.parentNode,d.insertBefore(c,v)):(d=v,d.appendChild(c)),v=v._reactRootContainer,v!=null||d.onclick!==null||(d.onclick=$f));else if(x!==4&&(c=c.child,c!==null))for(_g(c,d,v),c=c.sibling;c!==null;)_g(c,d,v),c=c.sibling}function Vg(c,d,v){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?v.insertBefore(c,d):v.appendChild(c);else if(x!==4&&(c=c.child,c!==null))for(Vg(c,d,v),c=c.sibling;c!==null;)Vg(c,d,v),c=c.sibling}var Gr=null,Ba=!1;function Bi(c,d,v){for(v=v.child;v!==null;)Y3(c,d,v),v=v.sibling}function Y3(c,d,v){if(F&&typeof F.onCommitFiberUnmount=="function")try{F.onCommitFiberUnmount(Qe,v)}catch{}switch(v.tag){case 5:os||Su(v,d);case 6:var x=Gr,M=Ba;Gr=null,Bi(c,d,v),Gr=x,Ba=M,Gr!==null&&(Ba?(c=Gr,v=v.stateNode,c.nodeType===8?c.parentNode.removeChild(v):c.removeChild(v)):Gr.removeChild(v.stateNode));break;case 18:Gr!==null&&(Ba?(c=Gr,v=v.stateNode,c.nodeType===8?eg(c.parentNode,v):c.nodeType===1&&eg(c,v),Zn(c)):eg(Gr,v.stateNode));break;case 4:x=Gr,M=Ba,Gr=v.stateNode.containerInfo,Ba=!0,Bi(c,d,v),Gr=x,Ba=M;break;case 0:case 11:case 14:case 15:if(!os&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){M=x=x.next;do{var T=M,W=T.destroy;T=T.tag,W!==void 0&&((T&2)!==0||(T&4)!==0)&&Ig(v,d,W),M=M.next}while(M!==x)}Bi(c,d,v);break;case 1:if(!os&&(Su(v,d),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(fe){pr(v,d,fe)}Bi(c,d,v);break;case 21:Bi(c,d,v);break;case 22:v.mode&1?(os=(x=os)||v.memoizedState!==null,Bi(c,d,v),os=x):Bi(c,d,v);break;default:Bi(c,d,v)}}function q3(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new tD),d.forEach(function(x){var M=dD.bind(null,c,x);v.has(x)||(v.add(x),x.then(M,M))})}}function Ua(c,d){var v=d.deletions;if(v!==null)for(var x=0;x<v.length;x++){var M=v[x];try{var T=c,W=d,fe=W;e:for(;fe!==null;){switch(fe.tag){case 5:Gr=fe.stateNode,Ba=!1;break e;case 3:Gr=fe.stateNode.containerInfo,Ba=!0;break e;case 4:Gr=fe.stateNode.containerInfo,Ba=!0;break e}fe=fe.return}if(Gr===null)throw Error(n(160));Y3(T,W,M),Gr=null,Ba=!1;var be=M.alternate;be!==null&&(be.return=null),M.return=null}catch(We){pr(M,d,We)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)X3(d,c),d=d.sibling}function X3(c,d){var v=c.alternate,x=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Ua(d,c),wo(c),x&4){try{f0(3,c,c.return),rh(3,c)}catch(It){pr(c,c.return,It)}try{f0(5,c,c.return)}catch(It){pr(c,c.return,It)}}break;case 1:Ua(d,c),wo(c),x&512&&v!==null&&Su(v,v.return);break;case 5:if(Ua(d,c),wo(c),x&512&&v!==null&&Su(v,v.return),c.flags&32){var M=c.stateNode;try{Pe(M,"")}catch(It){pr(c,c.return,It)}}if(x&4&&(M=c.stateNode,M!=null)){var T=c.memoizedProps,W=v!==null?v.memoizedProps:T,fe=c.type,be=c.updateQueue;if(c.updateQueue=null,be!==null)try{fe==="input"&&T.type==="radio"&&T.name!=null&>(M,T),jt(fe,W);var We=jt(fe,T);for(W=0;W<be.length;W+=2){var dt=be[W],vt=be[W+1];dt==="style"?bt(M,vt):dt==="dangerouslySetInnerHTML"?st(M,vt):dt==="children"?Pe(M,vt):E(M,dt,vt,We)}switch(fe){case"input":Ze(M,T);break;case"textarea":se(M,T);break;case"select":var ut=M._wrapperState.wasMultiple;M._wrapperState.wasMultiple=!!T.multiple;var Tt=T.value;Tt!=null?Q(M,!!T.multiple,Tt,!1):ut!==!!T.multiple&&(T.defaultValue!=null?Q(M,!!T.multiple,T.defaultValue,!0):Q(M,!!T.multiple,T.multiple?[]:"",!1))}M[t0]=T}catch(It){pr(c,c.return,It)}}break;case 6:if(Ua(d,c),wo(c),x&4){if(c.stateNode===null)throw Error(n(162));M=c.stateNode,T=c.memoizedProps;try{M.nodeValue=T}catch(It){pr(c,c.return,It)}}break;case 3:if(Ua(d,c),wo(c),x&4&&v!==null&&v.memoizedState.isDehydrated)try{Zn(d.containerInfo)}catch(It){pr(c,c.return,It)}break;case 4:Ua(d,c),wo(c);break;case 13:Ua(d,c),wo(c),M=c.child,M.flags&8192&&(T=M.memoizedState!==null,M.stateNode.isHidden=T,!T||M.alternate!==null&&M.alternate.memoizedState!==null||(Bg=qe())),x&4&&q3(c);break;case 22:if(dt=v!==null&&v.memoizedState!==null,c.mode&1?(os=(We=os)||dt,Ua(d,c),os=We):Ua(d,c),wo(c),x&8192){if(We=c.memoizedState!==null,(c.stateNode.isHidden=We)&&!dt&&(c.mode&1)!==0)for(Dt=c,dt=c.child;dt!==null;){for(vt=Dt=dt;Dt!==null;){switch(ut=Dt,Tt=ut.child,ut.tag){case 0:case 11:case 14:case 15:f0(4,ut,ut.return);break;case 1:Su(ut,ut.return);var Ht=ut.stateNode;if(typeof Ht.componentWillUnmount=="function"){x=ut,v=ut.return;try{d=x,Ht.props=d.memoizedProps,Ht.state=d.memoizedState,Ht.componentWillUnmount()}catch(It){pr(x,v,It)}}break;case 5:Su(ut,ut.return);break;case 22:if(ut.memoizedState!==null){ex(vt);continue}}Tt!==null?(Tt.return=ut,Dt=Tt):ex(vt)}dt=dt.sibling}e:for(dt=null,vt=c;;){if(vt.tag===5){if(dt===null){dt=vt;try{M=vt.stateNode,We?(T=M.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(fe=vt.stateNode,be=vt.memoizedProps.style,W=be!=null&&be.hasOwnProperty("display")?be.display:null,fe.style.display=ft("display",W))}catch(It){pr(c,c.return,It)}}}else if(vt.tag===6){if(dt===null)try{vt.stateNode.nodeValue=We?"":vt.memoizedProps}catch(It){pr(c,c.return,It)}}else if((vt.tag!==22&&vt.tag!==23||vt.memoizedState===null||vt===c)&&vt.child!==null){vt.child.return=vt,vt=vt.child;continue}if(vt===c)break e;for(;vt.sibling===null;){if(vt.return===null||vt.return===c)break e;dt===vt&&(dt=null),vt=vt.return}dt===vt&&(dt=null),vt.sibling.return=vt.return,vt=vt.sibling}}break;case 19:Ua(d,c),wo(c),x&4&&q3(c);break;case 21:break;default:Ua(d,c),wo(c)}}function wo(c){var d=c.flags;if(d&2){try{e:{for(var v=c.return;v!==null;){if(K3(v)){var x=v;break e}v=v.return}throw Error(n(160))}switch(x.tag){case 5:var M=x.stateNode;x.flags&32&&(Pe(M,""),x.flags&=-33);var T=G3(c);Vg(c,T,M);break;case 3:case 4:var W=x.stateNode.containerInfo,fe=G3(c);_g(c,fe,W);break;default:throw Error(n(161))}}catch(be){pr(c,c.return,be)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function rD(c,d,v){Dt=c,Q3(c)}function Q3(c,d,v){for(var x=(c.mode&1)!==0;Dt!==null;){var M=Dt,T=M.child;if(M.tag===22&&x){var W=M.memoizedState!==null||nh;if(!W){var fe=M.alternate,be=fe!==null&&fe.memoizedState!==null||os;fe=nh;var We=os;if(nh=W,(os=be)&&!We)for(Dt=M;Dt!==null;)W=Dt,be=W.child,W.tag===22&&W.memoizedState!==null?tx(M):be!==null?(be.return=W,Dt=be):tx(M);for(;T!==null;)Dt=T,Q3(T),T=T.sibling;Dt=M,nh=fe,os=We}J3(c)}else(M.subtreeFlags&8772)!==0&&T!==null?(T.return=M,Dt=T):J3(c)}}function J3(c){for(;Dt!==null;){var d=Dt;if((d.flags&8772)!==0){var v=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:os||rh(5,d);break;case 1:var x=d.stateNode;if(d.flags&4&&!os)if(v===null)x.componentDidMount();else{var M=d.elementType===d.type?v.memoizedProps:za(d.type,v.memoizedProps);x.componentDidUpdate(M,v.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var T=d.updateQueue;T!==null&&e3(d,T,x);break;case 3:var W=d.updateQueue;if(W!==null){if(v=null,d.child!==null)switch(d.child.tag){case 5:v=d.child.stateNode;break;case 1:v=d.child.stateNode}e3(d,W,v)}break;case 5:var fe=d.stateNode;if(v===null&&d.flags&4){v=fe;var be=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":be.autoFocus&&v.focus();break;case"img":be.src&&(v.src=be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var We=d.alternate;if(We!==null){var dt=We.memoizedState;if(dt!==null){var vt=dt.dehydrated;vt!==null&&Zn(vt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}os||d.flags&512&&Fg(d)}catch(ut){pr(d,d.return,ut)}}if(d===c){Dt=null;break}if(v=d.sibling,v!==null){v.return=d.return,Dt=v;break}Dt=d.return}}function ex(c){for(;Dt!==null;){var d=Dt;if(d===c){Dt=null;break}var v=d.sibling;if(v!==null){v.return=d.return,Dt=v;break}Dt=d.return}}function tx(c){for(;Dt!==null;){var d=Dt;try{switch(d.tag){case 0:case 11:case 15:var v=d.return;try{rh(4,d)}catch(be){pr(d,v,be)}break;case 1:var x=d.stateNode;if(typeof x.componentDidMount=="function"){var M=d.return;try{x.componentDidMount()}catch(be){pr(d,M,be)}}var T=d.return;try{Fg(d)}catch(be){pr(d,T,be)}break;case 5:var W=d.return;try{Fg(d)}catch(be){pr(d,W,be)}}}catch(be){pr(d,d.return,be)}if(d===c){Dt=null;break}var fe=d.sibling;if(fe!==null){fe.return=d.return,Dt=fe;break}Dt=d.return}}var sD=Math.ceil,sh=A.ReactCurrentDispatcher,Zg=A.ReactCurrentOwner,wa=A.ReactCurrentBatchConfig,Hn=0,Vr=null,xr=null,Yr=0,ea=0,Eu=Fi(0),Pr=0,h0=null,nc=0,ah=0,zg=0,p0=null,$s=null,Bg=0,Cu=1/0,Xo=null,oh=!1,Ug=null,Ui=null,ih=!1,Wi=null,lh=0,m0=0,Wg=null,ch=-1,uh=0;function bs(){return(Hn&6)!==0?qe():ch!==-1?ch:ch=qe()}function Ki(c){return(c.mode&1)===0?1:(Hn&2)!==0&&Yr!==0?Yr&-Yr:V$.transition!==null?(uh===0&&(uh=dn()),uh):(c=wn,c!==0||(c=window.event,c=c===void 0?16:gs(c.type)),c)}function Wa(c,d,v,x){if(50<m0)throw m0=0,Wg=null,Error(n(185));Kt(c,v,x),((Hn&2)===0||c!==Vr)&&(c===Vr&&((Hn&2)===0&&(ah|=v),Pr===4&&Gi(c,Yr)),Ds(c,x),v===1&&Hn===0&&(d.mode&1)===0&&(Cu=qe()+500,If&&Vi()))}function Ds(c,d){var v=c.callbackNode;En(c,d);var x=Sn(c,c===Vr?Yr:0);if(x===0)v!==null&&it(v),c.callbackNode=null,c.callbackPriority=0;else if(d=x&-x,c.callbackPriority!==d){if(v!=null&&it(v),d===1)c.tag===0?_$(rx.bind(null,c)):Zb(rx.bind(null,c)),H$(function(){(Hn&6)===0&&Vi()}),v=null;else{switch(Vo(x)){case 1:v=Ut;break;case 4:v=Nt;break;case 16:v=_t;break;case 536870912:v=Be;break;default:v=_t}v=dx(v,nx.bind(null,c))}c.callbackPriority=d,c.callbackNode=v}}function nx(c,d){if(ch=-1,uh=0,(Hn&6)!==0)throw Error(n(327));var v=c.callbackNode;if(ju()&&c.callbackNode!==v)return null;var x=Sn(c,c===Vr?Yr:0);if(x===0)return null;if((x&30)!==0||(x&c.expiredLanes)!==0||d)d=dh(c,x);else{d=x;var M=Hn;Hn|=2;var T=ax();(Vr!==c||Yr!==d)&&(Xo=null,Cu=qe()+500,sc(c,d));do try{iD();break}catch(fe){sx(c,fe)}while(!0);ug(),sh.current=T,Hn=M,xr!==null?d=0:(Vr=null,Yr=0,d=Pr)}if(d!==0){if(d===2&&(M=Qn(c),M!==0&&(x=M,d=Kg(c,M))),d===1)throw v=h0,sc(c,0),Gi(c,x),Ds(c,qe()),v;if(d===6)Gi(c,x);else{if(M=c.current.alternate,(x&30)===0&&!aD(M)&&(d=dh(c,x),d===2&&(T=Qn(c),T!==0&&(x=T,d=Kg(c,T))),d===1))throw v=h0,sc(c,0),Gi(c,x),Ds(c,qe()),v;switch(c.finishedWork=M,c.finishedLanes=x,d){case 0:case 1:throw Error(n(345));case 2:ac(c,$s,Xo);break;case 3:if(Gi(c,x),(x&130023424)===x&&(d=Bg+500-qe(),10<d)){if(Sn(c,0)!==0)break;if(M=c.suspendedLanes,(M&x)!==x){bs(),c.pingedLanes|=c.suspendedLanes&M;break}c.timeoutHandle=J2(ac.bind(null,c,$s,Xo),d);break}ac(c,$s,Xo);break;case 4:if(Gi(c,x),(x&4194240)===x)break;for(d=c.eventTimes,M=-1;0<x;){var W=31-ye(x);T=1<<W,W=d[W],W>M&&(M=W),x&=~T}if(x=M,x=qe()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*sD(x/1960))-x,10<x){c.timeoutHandle=J2(ac.bind(null,c,$s,Xo),x);break}ac(c,$s,Xo);break;case 5:ac(c,$s,Xo);break;default:throw Error(n(329))}}}return Ds(c,qe()),c.callbackNode===v?nx.bind(null,c):null}function Kg(c,d){var v=p0;return c.current.memoizedState.isDehydrated&&(sc(c,d).flags|=256),c=dh(c,d),c!==2&&(d=$s,$s=v,d!==null&&Gg(d)),c}function Gg(c){$s===null?$s=c:$s.push.apply($s,c)}function aD(c){for(var d=c;;){if(d.flags&16384){var v=d.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var x=0;x<v.length;x++){var M=v[x],T=M.getSnapshot;M=M.value;try{if(!Va(T(),M))return!1}catch{return!1}}}if(v=d.child,d.subtreeFlags&16384&&v!==null)v.return=d,d=v;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 Gi(c,d){for(d&=~zg,d&=~ah,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var v=31-ye(d),x=1<<v;c[v]=-1,d&=~x}}function rx(c){if((Hn&6)!==0)throw Error(n(327));ju();var d=Sn(c,0);if((d&1)===0)return Ds(c,qe()),null;var v=dh(c,d);if(c.tag!==0&&v===2){var x=Qn(c);x!==0&&(d=x,v=Kg(c,x))}if(v===1)throw v=h0,sc(c,0),Gi(c,d),Ds(c,qe()),v;if(v===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,ac(c,$s,Xo),Ds(c,qe()),null}function Yg(c,d){var v=Hn;Hn|=1;try{return c(d)}finally{Hn=v,Hn===0&&(Cu=qe()+500,If&&Vi())}}function rc(c){Wi!==null&&Wi.tag===0&&(Hn&6)===0&&ju();var d=Hn;Hn|=1;var v=wa.transition,x=wn;try{if(wa.transition=null,wn=1,c)return c()}finally{wn=x,wa.transition=v,Hn=d,(Hn&6)===0&&Vi()}}function qg(){ea=Eu.current,tr(Eu)}function sc(c,d){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==-1&&(c.timeoutHandle=-1,D$(v)),xr!==null)for(v=xr.return;v!==null;){var x=v;switch(ag(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Hf();break;case 3:xu(),tr(Ps),tr(rs),wg();break;case 5:gg(x);break;case 4:xu();break;case 13:tr(lr);break;case 19:tr(lr);break;case 10:dg(x.type._context);break;case 22:case 23:qg()}v=v.return}if(Vr=c,xr=c=Yi(c.current,null),Yr=ea=d,Pr=0,h0=null,zg=ah=nc=0,$s=p0=null,Jl!==null){for(d=0;d<Jl.length;d++)if(v=Jl[d],x=v.interleaved,x!==null){v.interleaved=null;var M=x.next,T=v.pending;if(T!==null){var W=T.next;T.next=M,x.next=W}v.pending=x}Jl=null}return c}function sx(c,d){do{var v=xr;try{if(ug(),Gf.current=Qf,Yf){for(var x=cr.memoizedState;x!==null;){var M=x.queue;M!==null&&(M.pending=null),x=x.next}Yf=!1}if(tc=0,_r=Rr=cr=null,i0=!1,l0=0,Zg.current=null,v===null||v.return===null){Pr=1,h0=d,xr=null;break}e:{var T=c,W=v.return,fe=v,be=d;if(d=Yr,fe.flags|=32768,be!==null&&typeof be=="object"&&typeof be.then=="function"){var We=be,dt=fe,vt=dt.tag;if((dt.mode&1)===0&&(vt===0||vt===11||vt===15)){var ut=dt.alternate;ut?(dt.updateQueue=ut.updateQueue,dt.memoizedState=ut.memoizedState,dt.lanes=ut.lanes):(dt.updateQueue=null,dt.memoizedState=null)}var Tt=M3(W);if(Tt!==null){Tt.flags&=-257,R3(Tt,W,fe,T,d),Tt.mode&1&&N3(T,We,d),d=Tt,be=We;var Ht=d.updateQueue;if(Ht===null){var It=new Set;It.add(be),d.updateQueue=It}else Ht.add(be);break e}else{if((d&1)===0){N3(T,We,d),Xg();break e}be=Error(n(426))}}else if(ar&&fe.mode&1){var wr=M3(W);if(wr!==null){(wr.flags&65536)===0&&(wr.flags|=256),R3(wr,W,fe,T,d),lg(ku(be,fe));break e}}T=be=ku(be,fe),Pr!==4&&(Pr=2),p0===null?p0=[T]:p0.push(T),T=W;do{switch(T.tag){case 3:T.flags|=65536,d&=-d,T.lanes|=d;var He=j3(T,be,d);Jb(T,He);break e;case 1:fe=be;var Ce=T.type,_e=T.stateNode;if((T.flags&128)===0&&(typeof Ce.getDerivedStateFromError=="function"||_e!==null&&typeof _e.componentDidCatch=="function"&&(Ui===null||!Ui.has(_e)))){T.flags|=65536,d&=-d,T.lanes|=d;var St=A3(T,fe,d);Jb(T,St);break e}}T=T.return}while(T!==null)}ix(v)}catch(Vt){d=Vt,xr===v&&v!==null&&(xr=v=v.return);continue}break}while(!0)}function ax(){var c=sh.current;return sh.current=Qf,c===null?Qf:c}function Xg(){(Pr===0||Pr===3||Pr===2)&&(Pr=4),Vr===null||(nc&268435455)===0&&(ah&268435455)===0||Gi(Vr,Yr)}function dh(c,d){var v=Hn;Hn|=2;var x=ax();(Vr!==c||Yr!==d)&&(Xo=null,sc(c,d));do try{oD();break}catch(M){sx(c,M)}while(!0);if(ug(),Hn=v,sh.current=x,xr!==null)throw Error(n(261));return Vr=null,Yr=0,Pr}function oD(){for(;xr!==null;)ox(xr)}function iD(){for(;xr!==null&&!wt();)ox(xr)}function ox(c){var d=ux(c.alternate,c,ea);c.memoizedProps=c.pendingProps,d===null?ix(c):xr=d,Zg.current=null}function ix(c){var d=c;do{var v=d.alternate;if(c=d.return,(d.flags&32768)===0){if(v=J$(v,d,ea),v!==null){xr=v;return}}else{if(v=eD(v,d),v!==null){v.flags&=32767,xr=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Pr=6,xr=null;return}}if(d=d.sibling,d!==null){xr=d;return}xr=d=c}while(d!==null);Pr===0&&(Pr=5)}function ac(c,d,v){var x=wn,M=wa.transition;try{wa.transition=null,wn=1,lD(c,d,v,x)}finally{wa.transition=M,wn=x}return null}function lD(c,d,v,x){do ju();while(Wi!==null);if((Hn&6)!==0)throw Error(n(327));v=c.finishedWork;var M=c.finishedLanes;if(v===null)return null;if(c.finishedWork=null,c.finishedLanes=0,v===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var T=v.lanes|v.childLanes;if(br(c,T),c===Vr&&(xr=Vr=null,Yr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||ih||(ih=!0,dx(_t,function(){return ju(),null})),T=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||T){T=wa.transition,wa.transition=null;var W=wn;wn=1;var fe=Hn;Hn|=4,Zg.current=null,nD(c,v),X3(v,c),N$(X2),Pn=!!q2,X2=q2=null,c.current=v,rD(v),$e(),Hn=fe,wn=W,wa.transition=T}else c.current=v;if(ih&&(ih=!1,Wi=c,lh=M),T=c.pendingLanes,T===0&&(Ui=null),de(v.stateNode),Ds(c,qe()),d!==null)for(x=c.onRecoverableError,v=0;v<d.length;v++)M=d[v],x(M.value,{componentStack:M.stack,digest:M.digest});if(oh)throw oh=!1,c=Ug,Ug=null,c;return(lh&1)!==0&&c.tag!==0&&ju(),T=c.pendingLanes,(T&1)!==0?c===Wg?m0++:(m0=0,Wg=c):m0=0,Vi(),null}function ju(){if(Wi!==null){var c=Vo(lh),d=wa.transition,v=wn;try{if(wa.transition=null,wn=16>c?16:c,Wi===null)var x=!1;else{if(c=Wi,Wi=null,lh=0,(Hn&6)!==0)throw Error(n(331));var M=Hn;for(Hn|=4,Dt=c.current;Dt!==null;){var T=Dt,W=T.child;if((Dt.flags&16)!==0){var fe=T.deletions;if(fe!==null){for(var be=0;be<fe.length;be++){var We=fe[be];for(Dt=We;Dt!==null;){var dt=Dt;switch(dt.tag){case 0:case 11:case 15:f0(8,dt,T)}var vt=dt.child;if(vt!==null)vt.return=dt,Dt=vt;else for(;Dt!==null;){dt=Dt;var ut=dt.sibling,Tt=dt.return;if(W3(dt),dt===We){Dt=null;break}if(ut!==null){ut.return=Tt,Dt=ut;break}Dt=Tt}}}var Ht=T.alternate;if(Ht!==null){var It=Ht.child;if(It!==null){Ht.child=null;do{var wr=It.sibling;It.sibling=null,It=wr}while(It!==null)}}Dt=T}}if((T.subtreeFlags&2064)!==0&&W!==null)W.return=T,Dt=W;else e:for(;Dt!==null;){if(T=Dt,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:f0(9,T,T.return)}var He=T.sibling;if(He!==null){He.return=T.return,Dt=He;break e}Dt=T.return}}var Ce=c.current;for(Dt=Ce;Dt!==null;){W=Dt;var _e=W.child;if((W.subtreeFlags&2064)!==0&&_e!==null)_e.return=W,Dt=_e;else e:for(W=Ce;Dt!==null;){if(fe=Dt,(fe.flags&2048)!==0)try{switch(fe.tag){case 0:case 11:case 15:rh(9,fe)}}catch(Vt){pr(fe,fe.return,Vt)}if(fe===W){Dt=null;break e}var St=fe.sibling;if(St!==null){St.return=fe.return,Dt=St;break e}Dt=fe.return}}if(Hn=M,Vi(),F&&typeof F.onPostCommitFiberRoot=="function")try{F.onPostCommitFiberRoot(Qe,c)}catch{}x=!0}return x}finally{wn=v,wa.transition=d}}return!1}function lx(c,d,v){d=ku(v,d),d=j3(c,d,1),c=zi(c,d,1),d=bs(),c!==null&&(Kt(c,1,d),Ds(c,d))}function pr(c,d,v){if(c.tag===3)lx(c,c,v);else for(;d!==null;){if(d.tag===3){lx(d,c,v);break}else if(d.tag===1){var x=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Ui===null||!Ui.has(x))){c=ku(v,c),c=A3(d,c,1),d=zi(d,c,1),c=bs(),d!==null&&(Kt(d,1,c),Ds(d,c));break}}d=d.return}}function cD(c,d,v){var x=c.pingCache;x!==null&&x.delete(d),d=bs(),c.pingedLanes|=c.suspendedLanes&v,Vr===c&&(Yr&v)===v&&(Pr===4||Pr===3&&(Yr&130023424)===Yr&&500>qe()-Bg?sc(c,0):zg|=v),Ds(c,d)}function cx(c,d){d===0&&((c.mode&1)===0?d=1:(d=zt,zt<<=1,(zt&130023424)===0&&(zt=4194304)));var v=bs();c=Go(c,d),c!==null&&(Kt(c,d,v),Ds(c,v))}function uD(c){var d=c.memoizedState,v=0;d!==null&&(v=d.retryLane),cx(c,v)}function dD(c,d){var v=0;switch(c.tag){case 13:var x=c.stateNode,M=c.memoizedState;M!==null&&(v=M.retryLane);break;case 19:x=c.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(d),cx(c,v)}var ux;ux=function(c,d,v){if(c!==null)if(c.memoizedProps!==d.pendingProps||Ps.current)Ts=!0;else{if((c.lanes&v)===0&&(d.flags&128)===0)return Ts=!1,Q$(c,d,v);Ts=(c.flags&131072)!==0}else Ts=!1,ar&&(d.flags&1048576)!==0&&zb(d,_f,d.index);switch(d.lanes=0,d.tag){case 2:var x=d.type;th(c,d),c=d.pendingProps;var M=pu(d,rs.current);bu(d,v),M=xg(null,d,x,c,M,v);var T=kg();return d.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Ls(x)?(T=!0,Of(d)):T=!1,d.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,pg(d),M.updater=Jf,d.stateNode=M,M._reactInternals=d,Ng(d,x,c,v),d=Lg(null,d,x,!0,T,v)):(d.tag=0,ar&&T&&sg(d),ys(null,d,M,v),d=d.child),d;case 16:x=d.elementType;e:{switch(th(c,d),c=d.pendingProps,M=x._init,x=M(x._payload),d.type=x,M=d.tag=hD(x),c=za(x,c),M){case 0:d=Pg(null,d,x,c,v);break e;case 1:d=H3(null,d,x,c,v);break e;case 11:d=P3(null,d,x,c,v);break e;case 14:d=L3(null,d,x,za(x.type,c),v);break e}throw Error(n(306,x,""))}return d;case 0:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:za(x,M),Pg(c,d,x,M,v);case 1:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:za(x,M),H3(c,d,x,M,v);case 3:e:{if(O3(d),c===null)throw Error(n(387));x=d.pendingProps,T=d.memoizedState,M=T.element,Qb(c,d),Wf(d,x,null,v);var W=d.memoizedState;if(x=W.element,T.isDehydrated)if(T={element:x,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},d.updateQueue.baseState=T,d.memoizedState=T,d.flags&256){M=ku(Error(n(423)),d),d=I3(c,d,x,v,M);break e}else if(x!==M){M=ku(Error(n(424)),d),d=I3(c,d,x,v,M);break e}else for(Js=Ii(d.stateNode.containerInfo.firstChild),Qs=d,ar=!0,Za=null,v=qb(d,null,x,v),d.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(vu(),x===M){d=qo(c,d,v);break e}ys(c,d,x,v)}d=d.child}return d;case 5:return t3(d),c===null&&ig(d),x=d.type,M=d.pendingProps,T=c!==null?c.memoizedProps:null,W=M.children,Q2(x,M)?W=null:T!==null&&Q2(x,T)&&(d.flags|=32),D3(c,d),ys(c,d,W,v),d.child;case 6:return c===null&&ig(d),null;case 13:return F3(c,d,v);case 4:return mg(d,d.stateNode.containerInfo),x=d.pendingProps,c===null?d.child=wu(d,null,x,v):ys(c,d,x,v),d.child;case 11:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:za(x,M),P3(c,d,x,M,v);case 7:return ys(c,d,d.pendingProps,v),d.child;case 8:return ys(c,d,d.pendingProps.children,v),d.child;case 12:return ys(c,d,d.pendingProps.children,v),d.child;case 10:e:{if(x=d.type._context,M=d.pendingProps,T=d.memoizedProps,W=M.value,Yn(zf,x._currentValue),x._currentValue=W,T!==null)if(Va(T.value,W)){if(T.children===M.children&&!Ps.current){d=qo(c,d,v);break e}}else for(T=d.child,T!==null&&(T.return=d);T!==null;){var fe=T.dependencies;if(fe!==null){W=T.child;for(var be=fe.firstContext;be!==null;){if(be.context===x){if(T.tag===1){be=Yo(-1,v&-v),be.tag=2;var We=T.updateQueue;if(We!==null){We=We.shared;var dt=We.pending;dt===null?be.next=be:(be.next=dt.next,dt.next=be),We.pending=be}}T.lanes|=v,be=T.alternate,be!==null&&(be.lanes|=v),fg(T.return,v,d),fe.lanes|=v;break}be=be.next}}else if(T.tag===10)W=T.type===d.type?null:T.child;else if(T.tag===18){if(W=T.return,W===null)throw Error(n(341));W.lanes|=v,fe=W.alternate,fe!==null&&(fe.lanes|=v),fg(W,v,d),W=T.sibling}else W=T.child;if(W!==null)W.return=T;else for(W=T;W!==null;){if(W===d){W=null;break}if(T=W.sibling,T!==null){T.return=W.return,W=T;break}W=W.return}T=W}ys(c,d,M.children,v),d=d.child}return d;case 9:return M=d.type,x=d.pendingProps.children,bu(d,v),M=ga(M),x=x(M),d.flags|=1,ys(c,d,x,v),d.child;case 14:return x=d.type,M=za(x,d.pendingProps),M=za(x.type,M),L3(c,d,x,M,v);case 15:return T3(c,d,d.type,d.pendingProps,v);case 17:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:za(x,M),th(c,d),d.tag=1,Ls(x)?(c=!0,Of(d)):c=!1,bu(d,v),E3(d,x,M),Ng(d,x,M,v),Lg(null,d,x,!0,c,v);case 19:return V3(c,d,v);case 22:return $3(c,d,v)}throw Error(n(156,d.tag))};function dx(c,d){return xe(c,d)}function fD(c,d,v,x){this.tag=c,this.key=v,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=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ya(c,d,v,x){return new fD(c,d,v,x)}function Qg(c){return c=c.prototype,!(!c||!c.isReactComponent)}function hD(c){if(typeof c=="function")return Qg(c)?1:0;if(c!=null){if(c=c.$$typeof,c===D)return 11;if(c===B)return 14}return 2}function Yi(c,d){var v=c.alternate;return v===null?(v=ya(c.tag,d,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=d,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,d=c.dependencies,v.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function fh(c,d,v,x,M,T){var W=2;if(x=c,typeof c=="function")Qg(c)&&(W=1);else if(typeof c=="string")W=5;else e:switch(c){case N:return oc(v.children,M,T,d);case j:W=8,M|=8;break;case P:return c=ya(12,v,d,M|2),c.elementType=P,c.lanes=T,c;case U:return c=ya(13,v,d,M),c.elementType=U,c.lanes=T,c;case _:return c=ya(19,v,d,M),c.elementType=_,c.lanes=T,c;case V:return hh(v,M,T,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case R:W=10;break e;case H:W=9;break e;case D:W=11;break e;case B:W=14;break e;case K:W=16,x=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return d=ya(W,v,d,M),d.elementType=c,d.type=x,d.lanes=T,d}function oc(c,d,v,x){return c=ya(7,c,x,d),c.lanes=v,c}function hh(c,d,v,x){return c=ya(22,c,x,d),c.elementType=V,c.lanes=v,c.stateNode={isHidden:!1},c}function Jg(c,d,v){return c=ya(6,c,null,d),c.lanes=v,c}function e8(c,d,v){return d=ya(4,c.children!==null?c.children:[],c.key,d),d.lanes=v,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function pD(c,d,v,x,M){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=vr(0),this.expirationTimes=vr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vr(0),this.identifierPrefix=x,this.onRecoverableError=M,this.mutableSourceEagerHydrationData=null}function t8(c,d,v,x,M,T,W,fe,be){return c=new pD(c,d,v,fe,be),d===1?(d=1,T===!0&&(d|=8)):d=0,T=ya(3,null,null,d),c.current=T,T.stateNode=c,T.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},pg(T),c}function mD(c,d,v){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:x==null?null:""+x,children:c,containerInfo:d,implementation:v}}function fx(c){if(!c)return _i;c=c._reactInternals;e:{if(ot(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(Ls(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(c.tag===1){var v=c.type;if(Ls(v))return _b(c,v,d)}return d}function hx(c,d,v,x,M,T,W,fe,be){return c=t8(v,x,!0,c,M,T,W,fe,be),c.context=fx(null),v=c.current,x=bs(),M=Ki(v),T=Yo(x,M),T.callback=d??null,zi(v,T,M),c.current.lanes=M,Kt(c,M,x),Ds(c,x),c}function ph(c,d,v,x){var M=d.current,T=bs(),W=Ki(M);return v=fx(v),d.context===null?d.context=v:d.pendingContext=v,d=Yo(T,W),d.payload={element:c},x=x===void 0?null:x,x!==null&&(d.callback=x),c=zi(M,d,W),c!==null&&(Wa(c,M,W,T),Uf(c,M,W)),W}function mh(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 px(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<d?v:d}}function n8(c,d){px(c,d),(c=c.alternate)&&px(c,d)}function gD(){return null}var mx=typeof reportError=="function"?reportError:function(c){console.error(c)};function r8(c){this._internalRoot=c}gh.prototype.render=r8.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(n(409));ph(c,d,null,null)},gh.prototype.unmount=r8.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;rc(function(){ph(null,c,null,null)}),d[Bo]=null}};function gh(c){this._internalRoot=c}gh.prototype.unstable_scheduleHydration=function(c){if(c){var d=on();c={blockedOn:null,target:c,priority:d};for(var v=0;v<ms.length&&d!==0&&d<ms[v].priority;v++);ms.splice(v,0,c),v===0&&le(c)}};function s8(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function vh(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function gx(){}function vD(c,d,v,x,M){if(M){if(typeof x=="function"){var T=x;x=function(){var We=mh(W);T.call(We)}}var W=hx(d,x,c,0,null,!1,!1,"",gx);return c._reactRootContainer=W,c[Bo]=W.current,Jd(c.nodeType===8?c.parentNode:c),rc(),W}for(;M=c.lastChild;)c.removeChild(M);if(typeof x=="function"){var fe=x;x=function(){var We=mh(be);fe.call(We)}}var be=t8(c,0,!1,null,null,!1,!1,"",gx);return c._reactRootContainer=be,c[Bo]=be.current,Jd(c.nodeType===8?c.parentNode:c),rc(function(){ph(d,be,v,x)}),be}function wh(c,d,v,x,M){var T=v._reactRootContainer;if(T){var W=T;if(typeof M=="function"){var fe=M;M=function(){var be=mh(W);fe.call(be)}}ph(d,W,c,M)}else W=vD(v,d,c,M,x);return mh(W)}An=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var v=Rt(d.pendingLanes);v!==0&&(Ir(d,v|1),Ds(d,qe()),(Hn&6)===0&&(Cu=qe()+500,Vi()))}break;case 13:rc(function(){var x=Go(c,1);if(x!==null){var M=bs();Wa(x,c,1,M)}}),n8(c,1)}},Ys=function(c){if(c.tag===13){var d=Go(c,134217728);if(d!==null){var v=bs();Wa(d,c,134217728,v)}n8(c,134217728)}},Rs=function(c){if(c.tag===13){var d=Ki(c),v=Go(c,d);if(v!==null){var x=bs();Wa(v,c,d,x)}n8(c,d)}},on=function(){return wn},yn=function(c,d){var v=wn;try{return wn=c,d()}finally{wn=v}},$t=function(c,d,v){switch(d){case"input":if(Ze(c,v),d=v.name,v.type==="radio"&&d!=null){for(v=c;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<v.length;d++){var x=v[d];if(x!==c&&x.form===c.form){var M=Df(x);if(!M)throw Error(n(90));Oe(x),Ze(x,M)}}}break;case"textarea":se(c,v);break;case"select":d=v.value,d!=null&&Q(c,!!v.multiple,d,!1)}},nt=Yg,qt=rc;var wD={usingClientEntryPoint:!1,Events:[n0,fu,Df,Xe,rt,Yg]},g0={findFiberByHostInstance:Yl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yD={bundleType:g0.bundleType,version:g0.version,rendererPackageName:g0.rendererPackageName,rendererConfig:g0.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=et(c),c===null?null:c.stateNode},findFiberByHostInstance:g0.findFiberByHostInstance||gD,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 yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yh.isDisabled&&yh.supportsFiber)try{Qe=yh.inject(yD),F=yh}catch{}}return Hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wD,Hs.createPortal=function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!s8(d))throw Error(n(200));return mD(c,d,null,v)},Hs.createRoot=function(c,d){if(!s8(c))throw Error(n(299));var v=!1,x="",M=mx;return d!=null&&(d.unstable_strictMode===!0&&(v=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onRecoverableError!==void 0&&(M=d.onRecoverableError)),d=t8(c,1,!1,null,null,v,!1,x,M),c[Bo]=d.current,Jd(c.nodeType===8?c.parentNode:c),new r8(d)},Hs.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=et(d),c=c===null?null:c.stateNode,c},Hs.flushSync=function(c){return rc(c)},Hs.hydrate=function(c,d,v){if(!vh(d))throw Error(n(200));return wh(null,c,d,!0,v)},Hs.hydrateRoot=function(c,d,v){if(!s8(c))throw Error(n(405));var x=v!=null&&v.hydratedSources||null,M=!1,T="",W=mx;if(v!=null&&(v.unstable_strictMode===!0&&(M=!0),v.identifierPrefix!==void 0&&(T=v.identifierPrefix),v.onRecoverableError!==void 0&&(W=v.onRecoverableError)),d=hx(d,null,c,1,v??null,M,!1,T,W),c[Bo]=d.current,Jd(c),x)for(c=0;c<x.length;c++)v=x[c],M=v._getVersion,M=M(v._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[v,M]:d.mutableSourceEagerHydrationData.push(v,M);return new gh(d)},Hs.render=function(c,d,v){if(!vh(d))throw Error(n(200));return wh(null,c,d,!1,v)},Hs.unmountComponentAtNode=function(c){if(!vh(c))throw Error(n(40));return c._reactRootContainer?(rc(function(){wh(null,null,c,!1,function(){c._reactRootContainer=null,c[Bo]=null})}),!0):!1},Hs.unstable_batchedUpdates=Yg,Hs.unstable_renderSubtreeIntoContainer=function(c,d,v,x){if(!vh(v))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return wh(c,d,v,!1,x)},Hs.version="18.3.1-next-f1338f8080-20240426",Hs}var Ax;function kS(){if(Ax)return l8.exports;Ax=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(),l8.exports=AD(),l8.exports}var Nx;function ND(){if(Nx)return bh;Nx=1;var e=kS();return bh.createRoot=e.createRoot,bh.hydrateRoot=e.hydrateRoot,bh}var MD=ND();/**
|
|
41
|
+
* react-router v7.18.5
|
|
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 SS=e=>{throw TypeError(e)},ES=(e,t,n)=>t.has(e)||SS("Cannot "+n),xa=(e,t,n)=>(ES(e,t,"read from private field"),n?n.call(e):t.get(e)),T0=(e,t,n)=>t.has(e)?SS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),yo=(e,t,n,r)=>(ES(e,t,"write to private field"),t.set(e,n),n),um=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dm=/^[\\/]{2}/;function CS(e,t){return t+e.replace(/\\/g,"/")}var Mx="popstate";function Rx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function RD(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 t1("",{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:Ss(a)}return LD(t,n,null,e)}function hn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PD(){return Math.random().toString(36).substring(2,10)}function Px(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 t1(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Fo(t):t,state:n,key:t&&t.key||r||PD(),mask:a}}function Ss({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 Fo(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 LD(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 S=p(),k=S==null?null:S-h;h=S,f&&f({action:u,location:b.location,delta:k})}function m(S,k){u="PUSH";let C=Rx(S)?S:t1(b.location,S,k);h=p()+1;let E=Px(C,h),A=b.createHref(C.mask||C);try{l.pushState(E,"",A)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(A)}i&&f&&f({action:u,location:b.location,delta:1})}function w(S,k){u="REPLACE";let C=Rx(S)?S:t1(b.location,S,k);h=p();let E=Px(C,h),A=b.createHref(C.mask||C);l.replaceState(E,"",A),i&&f&&f({action:u,location:b.location,delta:0})}function y(S){return jS(a,S)}let b={get action(){return u},get location(){return e(a,l)},listen(S){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Mx,g),f=S,()=>{a.removeEventListener(Mx,g),f=null}},createHref(S){return t(a,S)},createURL:y,encodeLocation(S){let k=y(S);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:m,replace:w,go(S){return l.go(S)}};return b}function jS(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),hn(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:Ss(t);return a=a.replace(/ $/,"%20"),!n&&dm.test(a)&&(a=r+a),new URL(a,r)}var $0,Lx=class{constructor(e){if(T0(this,$0,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(xa(this,$0).has(e))return xa(this,$0).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){xa(this,$0).set(e,t)}};$0=new WeakMap;var TD=new Set(["lazy","caseSensitive","path","id","index","children"]);function $D(e){return TD.has(e)}var DD=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function HD(e){return DD.has(e)}function OD(e){return e.index===!0}function n1(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(hn(i.index!==!0||!i.children,"Cannot specify children on an index route"),hn(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),OD(i)){let h={...i,id:f};return r[f]=Tx(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=Tx(h,t(h)),i.children&&(h.children=n1(i.children,t,u,r,a)),h}})}function Tx(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function AS(e,t,n="/"){return Ka(e,t,n,!1)}function Ka(e,t,n,r,a){let i=typeof t=="string"?Fo(t):t,l=oa(i.pathname||"/",n);if(l==null)return null;let u=a??Jh(e),f=null,h=TS(l);for(let p=0;f==null&&p<u.length;++p)f=KD(u[p],h,r);return f}function NS(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 Jh(e){let t=MS(e);return ID(t),t}function MS(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;hn(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=Ra([r,p.relativePath]),m=n.concat(p);l.children&&l.children.length>0&&(hn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),MS(l.children,t,m,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:UD(g,l.index),routesMeta:m.map((w,y)=>{let[b,S]=LS(w.relativePath,w.caseSensitive,y===m.length-1);return{...w,matcher:b,compiledParams:S}})})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let h of RS(l.path))i(l,u,!0,h)}),t}function RS(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=RS(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 ID(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:WD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var FD=/^:[\w-]+$/,_D=3,VD=2,ZD=1,zD=10,BD=-2,$x=e=>e==="*";function UD(e,t){let n=e.split("/"),r=n.length;return n.some($x)&&(r+=BD),t&&(r+=VD),n.filter(a=>!$x(a)).reduce((a,i)=>a+(FD.test(i)?_D:i===""?ZD:zD),r)}function WD(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 KD(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},m=f.matcher&&f.compiledParams?PS(g,p,f.matcher,f.compiledParams):xl(g,p),w=f.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=xl({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:Ra([i,m.pathname]),pathnameBase:qD(Ra([i,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(i=Ra([i,m.pathnameBase]))}return l}function hs(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(nr(!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,m,w]=p;let y=t[g];return hn(m==="?"||y!=null,`Missing ":${g}" param`),encodeURIComponent(a(y))+w}return l.replace(/\?$/g,"")}).filter(l=>!!l);return r+i.join("/")}function xl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=LS(e.path,e.caseSensitive,e.end);return PS(e,t,n,r)}function PS(e,t,n,r){let a=t.match(n);if(!a)return null;let i=a[0],l=md(i,1),u=a.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:g},m)=>{if(p==="*"){let y=u[m]||"";l=md(i.slice(0,i.length-y.length),1)}const w=u[m];return g&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:l,pattern:e}}function LS(e,t=!1,n=!0){nr(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 TS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nr(!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 oa(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 GD({basename:e,pathname:t}){return t==="/"?e:Ra([e,t])}var Cv=e=>um.test(e);function YD(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Fo(e):e,i;return n?(n=jv(n),n.startsWith("/")||n.startsWith("\\")?i=Dx(n.substring(1),"/"):i=Dx(n,t)):i=t,{pathname:i,search:XD(r),hash:QD(a)}}function Dx(e,t){let n=md(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function d8(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 $S(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fm(e){let t=$S(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function P1(e,t,n,r=!1){let a;typeof e=="string"?a=Fo(e):(a={...e},hn(!a.pathname||!a.pathname.includes("?"),d8("?","pathname","search",a)),hn(!a.pathname||!a.pathname.includes("#"),d8("#","pathname","hash",a)),hn(!a.search||!a.search.includes("#"),d8("#","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 m=l.split("/");for(;m[0]==="..";)m.shift(),g-=1;a.pathname=m.join("/")}u=g>=0?t[g]:"/"}let f=YD(a,u),h=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var jv=e=>e.replace(/[\\/]{2,}/g,"/"),Ra=e=>jv(e.join("/"));function md(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 qD=e=>md(e).replace(/^\/*/,"/"),XD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,JD=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],L1=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 r1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function T1(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ra(t)||"/"}var DS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function HS(e,t){let n=e;if(typeof n!="string"||!um.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(DS)try{let i=new URL(window.location.href),l=dm.test(n)?new URL(CS(n,i.protocol)):new URL(n),u=oa(l.pathname,t);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{nr(!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 dl=Symbol("Uninstrumented");function eH(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=Wu(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=Wu(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[dl]??i,u=Wu(n[a],l,(...f)=>Hx(f[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[dl]=l,r[a]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let i=a[dl]??a,l=Wu(n.middleware,i,(...u)=>Hx(u[0]));return l?(l[dl]=i,l):a})),r}function tH(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[dl]??e.navigate,a=Wu(n.navigate,r,(...i)=>{let[l,u]=i;return{to:typeof l=="number"||typeof l=="string"?l:l?Ss(l):".",...Ox(e,u??{})}});a&&(a[dl]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[dl]??e.fetch,a=Wu(n.fetch,r,(...i)=>{let[l,,u,f]=i;return{href:u??".",fetcherKey:l,...Ox(e,f??{})}});a&&(a[dl]=r,e.fetch=a)}return e}function Wu(e,t,n){return e.length===0?null:async(...r)=>{let a=await OS(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function OS(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=OS(e,t,n,r-1),i=await l,hn(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 Hx(e){let{request:t,context:n,params:r,pattern:a}=e;return{request:nH(t),params:{...r},pattern:a,context:rH(n)}}function Ox(e,t){return{currentUrl:Ss(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 nH(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function rH(e){if(aH(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var sH=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function aH(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")===sH}var Ix=new URL("http://localhost");function Av(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Ix)}catch{return Ix}}function f8(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function oH(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 Ju(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&&!f8(a,n),u=!f8(i,n);if(r==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!oH(e,a)||!f8(a,i)))throw new Error("External navigation is not allowed")}var IS=["POST","PUT","PATCH","DELETE"],iH=new Set(IS),lH=["GET",...IS],cH=new Set(lH),FS=new Set([301,302,303,307,308]),uH=new Set([307,308]),h8={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},dH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},w0={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fH=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),_S="remix-router-transitions",VS=Symbol("ResetLoaderData"),hc,Iu,el,Fu,hH=class{constructor(e){T0(this,hc),T0(this,Iu),T0(this,el),T0(this,Fu),yo(this,hc,e),yo(this,Iu,Jh(e))}get stableRoutes(){return xa(this,hc)}get activeRoutes(){return xa(this,el)??xa(this,hc)}get branches(){return xa(this,Fu)??xa(this,Iu)}get hasHMRRoutes(){return xa(this,el)!=null}setRoutes(e){yo(this,hc,e),yo(this,Iu,Jh(e))}setHmrRoutes(e){yo(this,el,e),yo(this,Fu,Jh(e))}commitHmrRoutes(){xa(this,el)&&(yo(this,hc,xa(this,el)),yo(this,Iu,xa(this,Fu)),yo(this,el,void 0),yo(this,Fu,void 0))}};hc=new WeakMap;Iu=new WeakMap;el=new WeakMap;Fu=new WeakMap;function pH(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";hn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||fH,i=a;if(e.instrumentations){let ne=e.instrumentations;i=ce=>({...a(ce),...eH(ne.map(ue=>ue.route).filter(Boolean),ce)})}let l={},u=new hH(n1(e.routes,i,void 0,l)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=e.dataStrategy||yH,p={...e.future},g=null,m=new Set,w=null,y=null,b=null,S=null,k=e.hydrationData!=null,C=Ka(u.activeRoutes,e.history.location,f,!1,u.branches),E=!1,A=null,L,$;if(C==null&&!e.patchRoutesOnNavigation){let ne=Sa(404,{pathname:e.history.location.pathname}),{matches:ce,route:ue}=xh(u.activeRoutes);L=!0,$=!L,C=ce,A={[ue.id]:ne}}else if(C&&!e.hydrationData&&Yt(C,u.activeRoutes,e.history.location.pathname).active&&(C=null),C)if(C.some(ne=>ne.route.lazy))L=!1,$=!L;else if(!C.some(ne=>Nv(ne.route)))L=!0,$=!L;else{let ne=e.hydrationData?e.hydrationData.loaderData:null,ce=e.hydrationData?e.hydrationData.errors:null,ue=C;if(ce){let ze=C.findIndex(Ve=>ce[Ve.route.id]!==void 0);ue=ue.slice(0,ze+1)}$=!1,L=!0,ue.forEach(ze=>{let Ve=ZS(ze.route,ne,ce);$=$||Ve.renderFallback,L=L&&!Ve.shouldLoad})}else{L=!1,$=!L,C=[];let ne=Yt(null,u.activeRoutes,e.history.location.pathname);ne.active&&ne.matches&&(E=!0,C=ne.matches)}let N,j={historyAction:e.history.action,location:e.history.location,matches:C,initialized:L,renderFallback:$,navigation:h8,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||A,fetchers:new Map,blockers:new Map},P="POP",R=null,H=!1,D,U=!1,_=new Map,B=null,K=!1,V=!1,O=new Set,I=new Map,Y=0,Z=-1,X=new Map,z=new Set,J=new Map,he=new Map,te=new Set,me=new Map,re,ee=null;function q(){if(g=e.history.listen(({action:ne,location:ce,delta:ue})=>{if(re){re(),re=void 0;return}nr(me.size===0||ue!=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 ze=Je({currentLocation:j.location,nextLocation:ce,historyAction:ne});if(ze&&ue!=null){let Ve=new Promise(xt=>{re=xt});e.history.go(ue*-1),ke(ze,{state:"blocked",location:ce,proceed(){ke(ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Ve.then(()=>e.history.go(ue))},reset(){let xt=new Map(j.blockers);xt.set(ze,w0),ae({blockers:xt})}}),R==null||R.resolve(),R=null;return}return Ze(ne,ce)}),n){IH(t,_);let ne=()=>FH(t,_);t.addEventListener("pagehide",ne),B=()=>t.removeEventListener("pagehide",ne)}return j.initialized||Ze("POP",j.location,{initialHydration:!0}),N}function ie(){g&&g(),B&&B(),m.clear(),D&&D.abort(),j.fetchers.forEach((ne,ce)=>ft(j.fetchers,ce)),j.blockers.forEach((ne,ce)=>$t(ce))}function Oe(ne){if(m.add(ne),w){let{newErrors:ce}=w;w=null,ne(j,{deletedFetchers:[],newErrors:ce,viewTransitionOpts:void 0,flushSync:!1})}return()=>m.delete(ne)}function ae(ne,ce={}){ne.matches&&(ne.matches=ne.matches.map(Ve=>{let xt=l[Ve.route.id],yt=Ve.route;return yt.element!==xt.element||yt.errorElement!==xt.errorElement||yt.hydrateFallbackElement!==xt.hydrateFallbackElement?{...Ve,route:xt}:Ve})),j={...j,...ne};let ue=[],ze=[];j.fetchers.forEach((Ve,xt)=>{Ve.state==="idle"&&(te.has(xt)?ue.push(xt):ze.push(xt))}),te.forEach(Ve=>{!j.fetchers.has(Ve)&&!I.has(Ve)&&ue.push(Ve)}),m.size===0&&(w={newErrors:ne.errors??null}),[...m].forEach(Ve=>Ve(j,{deletedFetchers:ue,newErrors:ne.errors??null,viewTransitionOpts:ce.viewTransitionOpts,flushSync:ce.flushSync===!0})),ue.forEach(Ve=>ft(j.fetchers,Ve)),ze.forEach(Ve=>j.fetchers.delete(Ve))}function pe(ne,ce,{flushSync:ue}={}){var Ae,ve;let ze=j.actionData!=null&&j.navigation.formMethod!=null&&ls(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Ae=ne.state)==null?void 0:Ae._isRedirect)!==!0,Ve;ce.actionData?Object.keys(ce.actionData).length>0?Ve=ce.actionData:Ve=null:ze?Ve=j.actionData:Ve=null;let xt=ce.loaderData?Gx(j.loaderData,ce.loaderData,ce.matches||[],ce.errors):j.loaderData,yt=j.blockers;yt.size>0&&(yt=new Map(yt),yt.forEach((et,Ct)=>yt.set(Ct,w0)));let kt=K?!1:qt(ne,ce.matches||j.matches),ot=H===!0||j.navigation.formMethod!=null&&ls(j.navigation.formMethod)&&((ve=ne.state)==null?void 0:ve._isRedirect)!==!0;u.commitHmrRoutes(),K||P==="POP"||(P==="PUSH"?e.history.push(ne,ne.state):P==="REPLACE"&&e.history.replace(ne,ne.state));let ht;if(P==="POP"&&!K&&ne!==j.location){let et=_.get(j.location.pathname);et&&et.has(ne.pathname)?ht={currentLocation:j.location,nextLocation:ne}:_.has(ne.pathname)&&(ht={currentLocation:ne,nextLocation:j.location})}else if(U){let et=_.get(j.location.pathname);et?et.add(ne.pathname):(et=new Set([ne.pathname]),_.set(j.location.pathname,et)),ht={currentLocation:j.location,nextLocation:ne}}ae({...ce,actionData:Ve,loaderData:xt,historyAction:P,location:ne,initialized:!0,renderFallback:!1,navigation:h8,revalidation:"idle",restoreScrollPosition:kt,preventScrollReset:ot,blockers:yt},{viewTransitionOpts:ht,flushSync:ue===!0}),P="POP",H=!1,U=!1,K=!1,V=!1,R==null||R.resolve(),R=null,ee==null||ee.resolve(),ee=null}async function Te(ne,ce){if(R==null||R.resolve(),R=null,typeof ne=="number"){R||(R=Qx());let xe=R.promise;return e.history.go(ne),xe}let ue=O6(j.location,j.matches,f,ne,ce==null?void 0:ce.fromRouteId,ce==null?void 0:ce.relative),{path:ze,submission:Ve,error:xt}=Fx(!1,ue,ce),yt;if(ce!=null&&ce.mask){let xe=typeof ce.mask=="string"?Fo(ce.mask):{...j.location.mask,...ce.mask};if(yt={pathname:xe.pathname??"",search:xe.search??"",hash:xe.hash??""},dm.test(yt.pathname))throw new Error("External navigation is not allowed");yt.pathname.startsWith("\\")&&(yt.pathname=yt.pathname.replace(/^\\+/,"/")),Ju(typeof ce.mask=="string"?ce.mask:Ss(ce.mask),Ss(yt),e.history.createURL("/"),"reject")}let kt=j.location,ot=t1(kt,ze,ce&&ce.state,void 0,yt);ot={...ot,...e.history.encodeLocation(ot)},Ju(ne==null?e.history.createHref(j.location):typeof ne=="string"?ne:Ss(ne),e.history.createHref(ot.mask||ot),e.history.createURL("/"),"reject");let ht=ce&&ce.replace!=null?ce.replace:void 0,Ae="PUSH";ht===!0?Ae="REPLACE":ht===!1||Ve!=null&&ls(Ve.formMethod)&&Ve.formAction===j.location.pathname+j.location.search&&(Ae="REPLACE");let ve=ce&&"preventScrollReset"in ce?ce.preventScrollReset===!0:void 0,et=(ce&&ce.flushSync)===!0,Ct=Je({currentLocation:kt,nextLocation:ot,historyAction:Ae});if(Ct){ke(Ct,{state:"blocked",location:ot,proceed(){ke(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:ot}),Te(ne,ce)},reset(){let xe=new Map(j.blockers);xe.set(Ct,w0),ae({blockers:xe})}});return}await Ze(Ae,ot,{submission:Ve,pendingError:xt,preventScrollReset:ve,replace:ce&&ce.replace,enableViewTransition:ce&&ce.viewTransition,flushSync:et,callSiteDefaultShouldRevalidate:ce&&ce.defaultShouldRevalidate})}function gt(){ee||(ee=Qx()),Ue(),ae({revalidation:"loading"});let ne=ee.promise;return j.navigation.state==="submitting"?ne:j.navigation.state==="idle"?(Ze(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),ne):(Ze(P||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:U===!0}),ne)}async function Ze(ne,ce,ue){D&&D.abort(),D=null,P=ne,K=(ue&&ue.startUninterruptedRevalidation)===!0,nt(j.location,j.matches),H=(ue&&ue.preventScrollReset)===!0,U=(ue&&ue.enableViewTransition)===!0;let ze=u.activeRoutes,Ve=ue!=null&&ue.initialHydration&&j.matches&&j.matches.length>0&&!E?j.matches:Ka(ze,ce,f,!1,u.branches),xt=(ue&&ue.flushSync)===!0;if(Ve&&j.initialized&&!V&&NH(j.location,ce)&&!(ue&&ue.submission&&ls(ue.submission.formMethod))){pe(ce,{matches:Ve},{flushSync:xt});return}let yt=Yt(Ve,ze,ce.pathname);if(yt.active&&yt.matches&&(Ve=yt.matches),!Ve){let{error:wt,notFoundMatches:$e,route:qe}=Et(ce.pathname);pe(ce,{matches:$e,loaderData:{},errors:{[qe.id]:wt}},{flushSync:xt});return}let kt=ue&&ue.overrideNavigation?{...ue.overrideNavigation,matches:Ve,historyAction:ne}:void 0;D=new AbortController;let ot=_u(e.history,ce,D.signal,ue&&ue.submission),ht=e.getContext?await e.getContext():new Lx,Ae;if(ue&&ue.pendingError)Ae=[ol(Ve).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&ls(ue.submission.formMethod)){let wt=await tt(ot,ce,ue.submission,Ve,ne,ht,yt.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:xt});if(wt.shortCircuited)return;if(wt.pendingActionResult){let[$e,qe]=wt.pendingActionResult;if(na(qe)&&r1(qe.error)&&qe.error.status===404){D=null,pe(ce,{matches:wt.matches,loaderData:{},errors:{[$e]:qe.error}});return}}Ve=wt.matches||Ve,Ae=wt.pendingActionResult,kt=p8(ce,Ve,ne,ue.submission),xt=!1,yt.active=!1,ot=_u(e.history,ot.url,ot.signal)}let{shortCircuited:ve,matches:et,loaderData:Ct,errors:xe,workingFetchers:it}=await De(ot,ce,Ve,ne,ht,yt.active,kt,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,xt,Ae,ue&&ue.callSiteDefaultShouldRevalidate);ve||(D=null,pe(ce,{matches:et||Ve,...Yx(Ae),loaderData:Ct,errors:xe,...it?{fetchers:it}:{}}))}async function tt(ne,ce,ue,ze,Ve,xt,yt,kt,ot={}){Ue();let ht=HH(ce,ze,Ve,ue);if(ae({navigation:ht},{flushSync:ot.flushSync===!0}),yt){let et=await an(ze,ce.pathname,ne.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:xe,route:it}=xh(u.activeRoutes);return{matches:xe,pendingActionResult:[it.id,{type:"error",error:et.error}]}}let Ct=ol(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[Ct,{type:"error",error:et.error}]}}else if(et.matches)ze=et.matches;else{let{notFoundMatches:Ct,error:xe,route:it}=Et(ce.pathname);return{matches:Ct,pendingActionResult:[it.id,{type:"error",error:xe}]}}}let Ae,ve=ep(ze,ce);if(!ve.route.action&&!ve.route.lazy)Ae={type:"error",error:Sa(405,{method:ne.method,pathname:ce.pathname,routeId:ve.route.id})};else{let et=ed(i,l,ne,ce,ze,ve,kt?[]:r,xt),Ct=await oe(ne,ce,et,xt,null);if(Ae=Ct[ve.route.id],!Ae){for(let xe of ze)if(Ct[xe.route.id]){Ae=Ct[xe.route.id];break}}if(ne.signal.aborted)return{shortCircuited:!0}}if(xc(Ae)){let et;return ot&&ot.replace!=null?et=ot.replace:et=Ux(Ae.response.headers.get("Location"),new URL(ne.url),f,e.history)===j.location.pathname+j.location.search,await G(ne,Ae,!0,{submission:ue,replace:et}),{shortCircuited:!0}}if(na(Ae)){let et=ol(ze,ve.route.id);return(ot&&ot.replace)!==!0&&(P="PUSH"),{matches:ze,pendingActionResult:[et.route.id,Ae,ve.route.id]}}return{matches:ze,pendingActionResult:[ve.route.id,Ae]}}async function De(ne,ce,ue,ze,Ve,xt,yt,kt,ot,ht,Ae,ve,et,Ct){let xe=yt||p8(ce,ue,ze,kt),it=kt||ot||Xx(xe),wt=!K&&!Ae;if(xt){if(wt){let ct=Se(et);ae({navigation:xe,...ct!==void 0?{actionData:ct}:{}},{flushSync:ve})}let Le=await an(ue,ce.pathname,ne.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:Ot,route:zt}=xh(u.activeRoutes);return{matches:Ot,loaderData:{},errors:{[zt.id]:Le.error}}}let ct=ol(Le.partialMatches).route.id;return{matches:Le.partialMatches,loaderData:{},errors:{[ct]:Le.error}}}else if(Le.matches)ue=Le.matches;else{let{error:ct,notFoundMatches:Ot,route:zt}=Et(ce.pathname);return{matches:Ot,loaderData:{},errors:{[zt.id]:ct}}}}let $e=u.activeRoutes,{dsMatches:qe,revalidatingFetchers:Lt}=_x(ne,Ve,i,l,e.history,j,ue,it,ce,Ae?[]:r,Ae===!0,V,O,te,J,z,$e,f,e.patchRoutesOnNavigation!=null,u.branches,et,Ct);if(Z=++Y,!e.dataStrategy&&!qe.some(Le=>Le.shouldLoad)&&!qe.some(Le=>Le.route.middleware&&Le.route.middleware.length>0)&&Lt.length===0){let Le=new Map(j.fetchers),ct=jt(Le);return pe(ce,{matches:ue,loaderData:{},errors:et&&na(et[1])?{[et[0]]:et[1].error}:null,...Yx(et),...ct?{fetchers:Le}:{}},{flushSync:ve}),{shortCircuited:!0}}if(wt){let Le={};if(!xt){Le.navigation=xe;let ct=Se(et);ct!==void 0&&(Le.actionData=ct)}Lt.length>0&&(Le.fetchers=Q(Lt)),ae(Le,{flushSync:ve})}Lt.forEach(Le=>{at(Le.key),Le.controller&&I.set(Le.key,Le.controller)});let Ut=()=>Lt.forEach(Le=>at(Le.key));D&&D.signal.addEventListener("abort",Ut);let{loaderResults:Nt,fetcherResults:_t}=await Ne(qe,Lt,ne,ce,Ve);if(ne.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Ut),Lt.forEach(Le=>I.delete(Le.key));let Me=kh(Nt);if(Me)return await G(ne,Me.result,!0,{replace:ht}),{shortCircuited:!0};if(Me=kh(_t),Me)return z.add(Me.key),await G(ne,Me.result,!0,{replace:ht}),{shortCircuited:!0};let Be=new Map(j.fetchers),{loaderData:Qe,errors:F}=Kx(j,ue,Nt,et,Lt,_t,Be);Ae&&j.errors&&(F={...j.errors,...F});let de=jt(Be),ye=Ft(Z,Be),Ke=de||ye||Lt.length>0;return{matches:ue,loaderData:Qe,errors:F,...Ke?{workingFetchers:Be}:{}}}function Se(ne){if(ne&&!na(ne[1]))return{[ne[0]]:ne[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function Q(ne){let ce=new Map(j.fetchers);return ne.forEach(ue=>{let ze=ce.get(ue.key),Ve=y0(void 0,ze?ze.data:void 0);ce.set(ue.key,Ve)}),ce}async function je(ne,ce,ue,ze){at(ne);let Ve=(ze&&ze.flushSync)===!0,xt=u.activeRoutes,yt=O6(j.location,j.matches,f,ue,ce,ze==null?void 0:ze.relative),kt=Ka(xt,yt,f,!1,u.branches),ot=Yt(kt,xt,yt);if(ot.active&&ot.matches&&(kt=ot.matches),!kt){Pe(ne,ce,Sa(404,{pathname:yt}),{flushSync:Ve});return}let{path:ht,submission:Ae,error:ve}=Fx(!0,yt,ze);if(ve){Pe(ne,ce,ve,{flushSync:Ve});return}let et=e.getContext?await e.getContext():new Lx,Ct=(ze&&ze.preventScrollReset)===!0;if(Ae&&ls(Ae.formMethod)){await Re(ne,ce,ht,kt,et,ot.active,Ve,Ct,Ae,ze&&ze.defaultShouldRevalidate);return}J.set(ne,{routeId:ce,path:ht}),await se(ne,ce,ht,kt,et,ot.active,Ve,Ct,Ae)}async function Re(ne,ce,ue,ze,Ve,xt,yt,kt,ot,ht){Ue(),J.delete(ne);let Ae=j.fetchers.get(ne);st(ne,OH(ot,Ae),{flushSync:yt});let ve=new AbortController,et=_u(e.history,ue,ve.signal,ot);if(xt){let Jt=await an(ze,new URL(et.url).pathname,et.signal,ne);if(Jt.type==="aborted")return;if(Jt.type==="error"){Pe(ne,ce,Jt.error,{flushSync:yt});return}else if(Jt.matches)ze=Jt.matches;else{Pe(ne,ce,Sa(404,{pathname:ue}),{flushSync:yt});return}}let Ct=ep(ze,ue);if(!Ct.route.action&&!Ct.route.lazy){let Jt=Sa(405,{method:ot.formMethod,pathname:ue,routeId:ce});Pe(ne,ce,Jt,{flushSync:yt});return}I.set(ne,ve);let xe=Y,it=ed(i,l,et,ue,ze,Ct,r,Ve),wt=await oe(et,ue,it,Ve,ne),$e=wt[Ct.route.id];if(!$e){for(let Jt of it)if(wt[Jt.route.id]){$e=wt[Jt.route.id];break}}if(et.signal.aborted){I.get(ne)===ve&&I.delete(ne);return}if(te.has(ne)){if(xc($e)||na($e)){st(ne,ko(void 0));return}}else{if(xc($e))if(I.delete(ne),Z>xe){st(ne,ko(void 0));return}else return z.add(ne),st(ne,y0(ot)),G(et,$e,!1,{fetcherSubmission:ot,preventScrollReset:kt});if(na($e)){Pe(ne,ce,$e.error);return}}let qe=j.navigation.location||j.location,Lt=_u(e.history,qe,ve.signal),Ut=u.activeRoutes,Nt=j.navigation.state!=="idle"?Ka(Ut,j.navigation.location,f,!1,u.branches):j.matches;hn(Nt,"Didn't find any matches after fetcher action");let _t=++Y;X.set(ne,_t);let{dsMatches:Me,revalidatingFetchers:Be}=_x(Lt,Ve,i,l,e.history,j,Nt,ot,qe,r,!1,V,O,te,J,z,Ut,f,e.patchRoutesOnNavigation!=null,u.branches,[Ct.route.id,$e],ht),Qe=y0(ot,$e.data),F=new Map(j.fetchers);F.set(ne,Qe),Be.filter(Jt=>Jt.key!==ne).forEach(Jt=>{let En=Jt.key,Qn=F.get(En),dn=y0(void 0,Qn?Qn.data:void 0);F.set(En,dn),at(En),Jt.controller&&I.set(En,Jt.controller)}),ae({fetchers:F});let de=()=>Be.forEach(Jt=>at(Jt.key));ve.signal.addEventListener("abort",de);let{loaderResults:ye,fetcherResults:Ke}=await Ne(Me,Be,Lt,qe,Ve);if(ve.signal.aborted)return;ve.signal.removeEventListener("abort",de),X.delete(ne),I.delete(ne),Be.forEach(Jt=>I.delete(Jt.key));let Le=j.fetchers.has(ne),ct=Jt=>{if(!Le)return Jt;let En=new Map(Jt.fetchers);return En.set(ne,ko($e.data)),{...Jt,fetchers:En}},Ot=kh(ye);if(Ot)return j=ct(j),G(Lt,Ot.result,!1,{preventScrollReset:kt});if(Ot=kh(Ke),Ot)return z.add(Ot.key),j=ct(j),G(Lt,Ot.result,!1,{preventScrollReset:kt});let zt=new Map(j.fetchers);Le&&zt.set(ne,ko($e.data));let{loaderData:Rt,errors:Sn}=Kx(j,Nt,ye,void 0,Be,Ke,zt);Ft(_t,zt),j.navigation.state==="loading"&&_t>Z?(hn(P,"Expected pending action"),D&&D.abort(),pe(j.navigation.location,{matches:Nt,loaderData:Rt,errors:Sn,fetchers:zt})):(ae({errors:Sn,loaderData:Gx(j.loaderData,Rt,Nt,Sn),fetchers:zt}),V=!1)}async function se(ne,ce,ue,ze,Ve,xt,yt,kt,ot){let ht=j.fetchers.get(ne);st(ne,y0(ot,ht?ht.data:void 0),{flushSync:yt});let Ae=new AbortController,ve=_u(e.history,ue,Ae.signal);if(xt){let $e=await an(ze,new URL(ve.url).pathname,ve.signal,ne);if($e.type==="aborted")return;if($e.type==="error"){Pe(ne,ce,$e.error,{flushSync:yt});return}else if($e.matches)ze=$e.matches;else{Pe(ne,ce,Sa(404,{pathname:ue}),{flushSync:yt});return}}let et=ep(ze,ue);I.set(ne,Ae);let Ct=Y,xe=ed(i,l,ve,ue,ze,et,r,Ve),it=await oe(ve,ue,xe,Ve,ne),wt=it[et.route.id];if(!wt){for(let $e of ze)if(it[$e.route.id]){wt=it[$e.route.id];break}}if(I.get(ne)===Ae&&I.delete(ne),!ve.signal.aborted){if(te.has(ne)){st(ne,ko(void 0));return}if(xc(wt))if(Z>Ct){st(ne,ko(void 0));return}else{z.add(ne),await G(ve,wt,!1,{preventScrollReset:kt});return}if(na(wt)){Pe(ne,ce,wt.error);return}st(ne,ko(wt.data))}}async function G(ne,ce,ue,{submission:ze,fetcherSubmission:Ve,preventScrollReset:xt,replace:yt}={}){ue||(R==null||R.resolve(),R=null),ce.response.headers.has("X-Remix-Revalidate")&&(V=!0);let kt=ce.response.headers.get("Location");hn(kt,"Expected a Location header on the redirect Response");let ot=kt,ht=new URL(ne.url);kt=Ux(kt,ht,f,e.history),Ju(ot,kt,ht,"allow-explicit");let Ae=t1(j.location,kt,{_isRedirect:!0});if(n){let wt=!1;if(ce.response.headers.has("X-Remix-Reload-Document"))wt=!0;else if(Cv(kt)){const $e=jS(t,kt,!0);wt=$e.origin!==t.location.origin||oa($e.pathname,f)==null}if(wt){yt?t.location.replace(kt):t.location.assign(kt);return}}D=null;let ve=yt===!0||ce.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:Ct,formEncType:xe}=j.navigation;!ze&&!Ve&&et&&Ct&&xe&&(ze=Xx(j.navigation));let it=ze||Ve;if(uH.has(ce.response.status)&&it&&ls(it.formMethod))await Ze(ve,Ae,{submission:{...it,formAction:kt},preventScrollReset:xt||H,enableViewTransition:ue?U:void 0});else{let wt=p8(Ae,[],ve,ze);await Ze(ve,Ae,{overrideNavigation:wt,fetcherSubmission:Ve,preventScrollReset:xt||H,enableViewTransition:ue?U:void 0})}}async function oe(ne,ce,ue,ze,Ve){var kt;let xt,yt={};try{xt=await xH(h,ne,ce,ue,Ve,ze,!1)}catch(ot){return ue.filter(ht=>ht.shouldLoad).forEach(ht=>{yt[ht.route.id]={type:"error",error:ot}}),yt}if(ne.signal.aborted)return yt;if(!ls(ne.method))for(let ot of ue){if(((kt=xt[ot.route.id])==null?void 0:kt.type)==="error")break;!xt.hasOwnProperty(ot.route.id)&&!j.loaderData.hasOwnProperty(ot.route.id)&&(!j.errors||!j.errors.hasOwnProperty(ot.route.id))&&ot.shouldCallHandler()&&(xt[ot.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ot.route.id}`)})}for(let[ot,ht]of Object.entries(xt))if(LH(ht)){let Ae=ht.result;yt[ot]={type:"redirect",response:CH(Ae,ne,ot,ue,f)}}else yt[ot]=await EH(ht);return yt}async function Ne(ne,ce,ue,ze,Ve){let xt=oe(ue,ze,ne,Ve,null),yt=Promise.all(ce.map(async ht=>{if(ht.matches&&ht.match&&ht.request&&ht.controller){let ve=(await oe(ht.request,ht.path,ht.matches,Ve,ht.key))[ht.match.route.id];return{[ht.key]:ve}}else return Promise.resolve({[ht.key]:{type:"error",error:Sa(404,{pathname:ht.path})}})})),kt=await xt,ot=(await yt).reduce((ht,Ae)=>Object.assign(ht,Ae),{});return{loaderResults:kt,fetcherResults:ot}}function Ue(){V=!0,J.forEach((ne,ce)=>{I.has(ce)&&O.add(ce),at(ce)})}function st(ne,ce,ue={}){let ze=new Map(j.fetchers);ze.set(ne,ce),ae({fetchers:ze},{flushSync:(ue&&ue.flushSync)===!0})}function Pe(ne,ce,ue,ze={}){let Ve=ol(j.matches,ce),xt=new Map(j.fetchers);ft(xt,ne),ae({errors:{[Ve.route.id]:ue},fetchers:xt},{flushSync:(ze&&ze.flushSync)===!0})}function Ie(ne){return he.set(ne,(he.get(ne)||0)+1),te.has(ne)&&te.delete(ne),j.fetchers.get(ne)||dH}function Ge(ne,ce){at(ne,ce==null?void 0:ce.reason),st(ne,ko(null))}function ft(ne,ce){let ue=j.fetchers.get(ce);I.has(ce)&&!(ue&&ue.state==="loading"&&X.has(ce))&&at(ce),J.delete(ce),X.delete(ce),z.delete(ce),te.delete(ce),O.delete(ce),ne.delete(ce)}function bt(ne){let ce=(he.get(ne)||0)-1;ce<=0?(he.delete(ne),te.add(ne)):he.set(ne,ce),ae({fetchers:new Map(j.fetchers)})}function at(ne,ce){let ue=I.get(ne);ue&&(ue.abort(ce),I.delete(ne))}function Zt(ne,ce){for(let ue of ne){let ze=ce.get(ue);hn(ze,`Expected fetcher: ${ue}`);let Ve=ko(ze.data);ce.set(ue,Ve)}}function jt(ne){let ce=[],ue=!1;for(let ze of z){let Ve=ne.get(ze);hn(Ve,`Expected fetcher: ${ze}`),Ve.state==="loading"&&(z.delete(ze),ce.push(ze),ue=!0)}return Zt(ce,ne),ue}function Ft(ne,ce){let ue=[];for(let[ze,Ve]of X)if(Ve<ne){let xt=ce.get(ze);hn(xt,`Expected fetcher: ${ze}`),xt.state==="loading"&&(at(ze),X.delete(ze),ue.push(ze))}return Zt(ue,ce),ue.length>0}function Pt(ne,ce){let ue=j.blockers.get(ne)||w0;return me.get(ne)!==ce&&me.set(ne,ce),ue}function $t(ne){j.blockers.delete(ne),me.delete(ne)}function ke(ne,ce){let ue=j.blockers.get(ne)||w0;hn(ue.state==="unblocked"&&ce.state==="blocked"||ue.state==="blocked"&&ce.state==="blocked"||ue.state==="blocked"&&ce.state==="proceeding"||ue.state==="blocked"&&ce.state==="unblocked"||ue.state==="proceeding"&&ce.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${ce.state}`);let ze=new Map(j.blockers);ze.set(ne,ce),ae({blockers:ze})}function Je({currentLocation:ne,nextLocation:ce,historyAction:ue}){if(me.size===0)return;me.size>1&&nr(!1,"A router only supports one blocker at a time");let ze=Array.from(me.entries()),[Ve,xt]=ze[ze.length-1],yt=j.blockers.get(Ve);if(!(yt&&yt.state==="proceeding")&&xt({currentLocation:ne,nextLocation:ce,historyAction:ue}))return Ve}function Et(ne){let ce=Sa(404,{pathname:ne}),ue=u.activeRoutes,{matches:ze,route:Ve}=xh(ue);return{notFoundMatches:ze,route:Ve,error:ce}}function Xe(ne,ce,ue){if(y=ne,S=ce,b=ue||null,!k&&j.navigation===h8){k=!0;let ze=qt(j.location,j.matches);ze!=null&&ae({restoreScrollPosition:ze})}return()=>{y=null,S=null,b=null}}function rt(ne,ce){return b&&b(ne,ce.map(ze=>NS(ze,j.loaderData)))||ne.key}function nt(ne,ce){if(y&&S){let ue=rt(ne,ce);y[ue]=S()}}function qt(ne,ce){if(y){let ue=rt(ne,ce),ze=y[ue];if(typeof ze=="number")return ze}return null}function Yt(ne,ce,ue){if(e.patchRoutesOnNavigation){let ze=u.branches;if(ne){if(Object.keys(ne[0].params).length>0)return{active:!0,matches:Ka(ce,ue,f,!0,ze)}}else return{active:!0,matches:Ka(ce,ue,f,!0,ze)||[]}}return{active:!1,matches:null}}async function an(ne,ce,ue,ze){if(!e.patchRoutesOnNavigation)return{type:"success",matches:ne};let Ve=ne;for(;;){let xt=l;try{await e.patchRoutesOnNavigation({signal:ue,path:ce,matches:Ve,fetcherKey:ze,patch:(ht,Ae)=>{ue.aborted||Vx(ht,Ae,u,xt,i,!1)}})}catch(ht){return{type:"error",error:ht,partialMatches:Ve}}if(ue.aborted)return{type:"aborted"};let yt=u.branches,kt=Ka(u.activeRoutes,ce,f,!1,yt),ot=null;if(kt){if(Object.keys(kt[0].params).length===0)return{type:"success",matches:kt};if(ot=Ka(u.activeRoutes,ce,f,!0,yt),!(ot&&Ve.length<ot.length&&Wt(Ve,ot.slice(0,Ve.length))))return{type:"success",matches:kt}}if(ot||(ot=Ka(u.activeRoutes,ce,f,!0,yt)),!ot||Wt(Ve,ot))return{type:"success",matches:null};Ve=ot}}function Wt(ne,ce){return ne.length===ce.length&&ne.every((ue,ze)=>ue.route.id===ce[ze].route.id)}function Rn(ne){l={},u.setHmrRoutes(n1(ne,i,void 0,l))}function Bt(ne,ce,ue=!1){Vx(ne,ce,u,l,i,ue),u.hasHMRRoutes||ae({})}return N={get basename(){return f},get future(){return p},get state(){return j},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return t},initialize:q,subscribe:Oe,enableScrollRestoration:Xe,navigate:Te,fetch:je,revalidate:gt,createHref:ne=>e.history.createHref(ne),createURL:ne=>e.history.createURL(ne),encodeLocation:ne=>e.history.encodeLocation(ne),getFetcher:Ie,resetFetcher:Ge,deleteFetcher:bt,dispose:ie,getBlocker:Pt,deleteBlocker:$t,patchRoutes:Bt,_internalFetchControllers:I,_internalSetRoutes:Rn,_internalSetStateDoNotUseOrYouWillBreakYourApp(ne){ae(ne)}},e.instrumentations&&(N=tH(N,e.instrumentations.map(ne=>ne.router).filter(Boolean))),N}function mH(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function O6(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=P1(r||".",fm(l),oa(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=Rv(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 m=p.toString();f.search=m?`?${m}`:""}}return n!=="/"&&(f.pathname=GD({basename:n,pathname:f.pathname})),Ss(f)}function Fx(e,t,n){if(!n||!mH(n))return{path:t};if(n.formMethod&&!DH(n.formMethod))return{path:t,error:Sa(405,{method:n.formMethod})};let r=()=>({path:t,error:Sa(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=YS(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ls(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((m,[w,y])=>`${m}${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(!ls(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()}}}hn(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=_6(n.formData),f=n.formData;else if(n.body instanceof FormData)u=_6(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Wx(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Wx(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(ls(h.formMethod))return{path:t,submission:h};let p=Fo(t);return e&&p.search&&Rv(p.search)&&u.append("index",""),p.search=`?${u}`,{path:Ss(p),submission:h}}function _x(e,t,n,r,a,i,l,u,f,h,p,g,m,w,y,b,S,k,C,E,A,L){var K;let $=A?na(A[1])?A[1].error:A[1].data:void 0,N=a.createURL(i.location),j=a.createURL(f),P;if(p&&i.errors){let V=Object.keys(i.errors)[0];P=l.findIndex(O=>O.route.id===V)}else if(A&&na(A[1])){let V=A[0];P=l.findIndex(O=>O.route.id===V)-1}let R=A?A[1].statusCode:void 0,H=R&&R>=400,D={currentUrl:N,currentParams:((K=i.matches[0])==null?void 0:K.params)||{},nextUrl:j,nextParams:l[0].params,...u,actionResult:$,actionStatus:R},U=T1(l),_=l.map((V,O)=>{let{route:I}=V,Y=null;if(P!=null&&O>P)Y=!1;else if(I.lazy)Y=!0;else if(!Nv(I))Y=!1;else if(p){let{shouldLoad:J}=ZS(I,i.loaderData,i.errors);Y=J}else gH(i.loaderData,i.matches[O],V)&&(Y=!0);if(Y!==null)return I6(n,r,e,f,U,V,h,t,Y);let Z=!1;typeof L=="boolean"?Z=L:H?Z=!1:(g||N.pathname+N.search===j.pathname+j.search||N.search!==j.search||vH(i.matches[O],V))&&(Z=!0);let X={...D,defaultShouldRevalidate:Z},z=B0(V,X);return I6(n,r,e,f,U,V,h,t,z,X,L)}),B=[];return y.forEach((V,O)=>{if(p||!l.some(te=>te.route.id===V.routeId)||w.has(O))return;let I=i.fetchers.get(O),Y=I&&I.state!=="idle"&&I.data===void 0,Z=Ka(S,V.path,k??"/",!1,E);if(!Z){if(C&&Y)return;B.push({key:O,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(b.has(O))return;let X=ep(Z,V.path),z=new AbortController,J=_u(a,V.path,z.signal),he=null;if(m.has(O))m.delete(O),he=ed(n,r,J,V.path,Z,X,h,t);else if(Y)g&&(he=ed(n,r,J,V.path,Z,X,h,t));else{let te;typeof L=="boolean"?te=L:H?te=!1:te=g;let me={...D,defaultShouldRevalidate:te};B0(X,me)&&(he=ed(n,r,J,V.path,Z,X,h,t,me))}he&&B.push({key:O,routeId:V.routeId,path:V.path,matches:he,match:X,request:J,controller:z})}),{dsMatches:_,revalidatingFetchers:B}}function Nv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ZS(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Nv(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 gH(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function vH(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function B0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Vx(e,t,n,r,a,i){let l;if(e){let h=r[e];hn(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=>zS(h,g));p?f.push({existingRoute:p,newRoute:h}):u.push(h)}),u.length>0){let h=n1(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],m=p,[w]=n1([g],a,[],{},!0);Object.assign(m,{element:w.element?w.element:m.element,errorElement:w.errorElement?w.errorElement:m.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:m.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function zS(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=>zS(r,l))}))??!1:!1}var Zx=new WeakMap,BS=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(hn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let l=Zx.get(a);l||(l={},Zx.set(a,l));let u=l[e];if(u)return u;let f=(async()=>{let h=$D(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(h)nr(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)nr(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await i();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},zx=new WeakMap;function wH(e,t,n,r,a){let i=n[e.id];if(hn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=zx.get(i);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{hn(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),w={};for(let y in m){let b=m[y];if(b===void 0)continue;let S=HD(y),C=i[y]!==void 0&&y!=="hasErrorBoundary";S?nr(!S,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?nr(!C,`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]=b}Object.assign(i,w),Object.assign(i,{...r(i),lazy:void 0})})();return zx.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=BS({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 Bx(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 yH(e){return e.matches.some(t=>t.route.middleware)?US(e,()=>Bx(e)):Bx(e)}function US(e,t){return bH(e,t,r=>{if($H(r))throw r;return r},RH,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=ol(l,l[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function bH(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 WS(l,u,t,n,r,a)}async function WS(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,m=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await WS(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,m),y=w!=null?r(w):void 0;return a(y)?y:g?y??g.value:(g={value:await m()},g.value)}catch(w){return await i(w,h,g)}}function KS(e,t,n,r,a){let i=BS({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=wH(r.route,ls(n.method)?"action":"loader",t,e,a);return{middleware:i,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function I6(e,t,n,r,a,i,l,u,f,h=null,p){let g=!1,m=KS(e,t,n,i,l);return{...i,_lazyPromises:m,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(w){return g=!0,h?typeof p=="boolean"?B0(i,{...h,defaultShouldRevalidate:p}):typeof w=="boolean"?B0(i,{...h,defaultShouldRevalidate:w}):B0(i,h):f},resolve(w){let{lazy:y,loader:b,middleware:S}=i.route,k=g||f||w&&!ls(n.method)&&(y||b),C=S&&S.length>0&&!b&&!y;return k&&(ls(n.method)||!C)?kH({request:n,path:r,pattern:a,match:i,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:w,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function ed(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:KS(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:I6(e,t,n,r,T1(a),h,l,u,!0,f))}async function xH(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:GS(t,n),pattern:T1(r),params:r[0].params,context:i,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let g=u;return US(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,m;return[(g=p._lazyPromises)==null?void 0:g.handler,(m=p._lazyPromises)==null?void 0:m.route]}))}catch{}return h}async function kH({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,h,p=ls(e.method),g=p?"action":"loader",m=w=>{let y,b=new Promise((C,E)=>y=E);h=()=>y(),e.signal.addEventListener("abort",h);let S=C=>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:GS(e,t),pattern:n,params:r.params,context:u},...C!==void 0?[C]:[]),k=(async()=>{try{return{type:"data",result:await(l?l(E=>S(E)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([k,b])};try{let w=p?r.route.action:r.route.loader;if(a||i)if(w){let y,[b]=await Promise.all([m(w).catch(S=>{y=S}),a,i]);if(y!==void 0)throw y;f=b}else{await a;let y=p?r.route.action:r.route.loader;if(y)[f]=await Promise.all([m(y),i]);else if(g==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw Sa(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)f=await m(w);else{let y=new URL(e.url),b=y.pathname+y.search;throw Sa(404,{pathname:b})}}catch(w){return{type:"error",result:w}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function SH(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 EH(e){var r,a,i,l,u;let{result:t,type:n}=e;if(Mv(t)){let f;try{f=await SH(t)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new L1(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?qx(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:MH(t),statusCode:r1(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:r1(t)?t.status:void 0}:qx(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 CH(e,t,n,r,a){let i=e.headers.get("Location");if(hn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Cv(i)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=O6(new URL(t.url),l,a,i),e.headers.set("Location",i)}return e}var jH=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function F6(e){try{return jH.includes(new URL(e).protocol)}catch{return!1}}function Ux(e,t,n,r){if(Cv(e)){let a=e,i=dm.test(a)?new URL(CS(a,t.protocol)):new URL(a);if(F6(i.toString()))throw new Error("Invalid redirect location");let l=oa(i.pathname,n)!=null;if(i.origin===t.origin&&l)return jv(i.pathname)+i.search+i.hash}try{let a=r.createURL(e);if(F6(a.toString()))throw new Error("Invalid redirect location")}catch{}return e}function _u(e,t,n,r){let a=e.createURL(YS(t)).toString(),i={signal:n};if(r&&ls(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=_6(r.formData):i.body=r.formData}return new Request(a,i)}function GS(e,t){let n=new URL(e.url),r=typeof t=="string"?Fo(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 _6(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Wx(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function AH(e,t,n,r=!1,a=!1){let i={},l=null,u,f=!1,h={},p=n&&na(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let m=g.route.id,w=t[m];if(hn(!xc(w),"Cannot handle redirect results in processLoaderData"),na(w)){let y=w.error;if(p!==void 0&&(y=p,p=void 0),l=l||{},a)l[m]=y;else{let b=ol(e,m);l[b.route.id]==null&&(l[b.route.id]=y)}r||(i[m]=VS),f||(f=!0,u=r1(w.error)?w.error.status:500),w.headers&&(h[m]=w.headers)}else i[m]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[m]=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 Kx(e,t,n,r,a,i,l){let{loaderData:u,errors:f}=AH(t,n,r);return a.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:g,controller:m}=h;if(m&&m.signal.aborted)return;let w=i[p];if(hn(w,"Did not find corresponding fetcher result"),na(w)){let y=ol(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(xc(w))hn(!1,"Unhandled fetcher revalidation redirect");else{let y=ko(w.data);l.set(p,y)}}),{loaderData:u,errors:f}}function Gx(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==VS).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 Yx(e){return e?na(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ol(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 xh(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 Sa(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 L1(e||500,l,new Error(u),!0)}function kh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(xc(a))return{key:r,result:a}}}function YS(e){let t=typeof e=="string"?Fo(e):e;return Ss({...t,hash:""})}function NH(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function MH(e){var t,n;return new L1(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function RH(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&PH(n))}function PH(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function LH(e){return Mv(e.result)&&FS.has(e.result.status)}function na(e){return e.type==="error"}function xc(e){return(e&&e.type)==="redirect"}function qx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Mv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TH(e){return FS.has(e)}function $H(e){return Mv(e)&&TH(e.status)&&e.headers.has("Location")}function DH(e){return cH.has(e.toUpperCase())}function ls(e){return iH.has(e.toUpperCase())}function Rv(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ep(e,t){let n=typeof t=="string"?Fo(t).search:t.search;if(e[e.length-1].route.index&&Rv(n||""))return e[e.length-1];let r=$S(e);return r[r.length-1]}function Xx(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 p8(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 HH(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 y0(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 OH(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 ko(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 IH(e,t){try{let n=e.sessionStorage.getItem(_S);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 FH(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(_S,JSON.stringify(n))}catch(r){nr(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Qx(){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 Vc=s.createContext(null);Vc.displayName="DataRouter";var Md=s.createContext(null);Md.displayName="DataRouterState";var qS=s.createContext(!1);function XS(){return s.useContext(qS)}var Pv=s.createContext({isTransitioning:!1});Pv.displayName="ViewTransition";var QS=s.createContext(new Map);QS.displayName="Fetchers";var _H=s.createContext(null);_H.displayName="Await";var Ms=s.createContext(null);Ms.displayName="Navigation";var hm=s.createContext(null);hm.displayName="Location";var Da=s.createContext({outlet:null,matches:[],isDataRoute:!1});Da.displayName="Route";var Lv=s.createContext(null);Lv.displayName="RouteError";var JS="REACT_ROUTER_ERROR",VH="REDIRECT",ZH="ROUTE_ERROR_RESPONSE";function zH(e){if(e.startsWith(`${JS}:${VH}:{`))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 BH(e){if(e.startsWith(`${JS}:${ZH}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new L1(t.status,t.statusText,t.data)}catch{}}function UH(e,{relative:t}={}){hn(Zc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=s.useContext(Ms),{hash:a,pathname:i,search:l}=$1(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:Ra([n,i])),r.createHref({pathname:u,search:l,hash:a})}function Zc(){return s.useContext(hm)!=null}function Bn(){return hn(Zc(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(hm).location}function gn(e){hn(Zc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Bn();return s.useMemo(()=>xl(e,TS(t)),[t,e])}var eE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tE(e){s.useContext(Ms).static||s.useLayoutEffect(e)}function Un(){let{isDataRoute:e}=s.useContext(Da);return e?aO():WH()}function WH(){hn(Zc(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(Vc),{basename:t,navigator:n}=s.useContext(Ms),{matches:r}=s.useContext(Da),{pathname:a}=Bn(),i=JSON.stringify(fm(r)),l=s.useRef(!1);return tE(()=>{l.current=!0}),s.useCallback((f,h={})=>{if(nr(l.current,eE),!l.current)return;if(typeof f=="number"){n.go(f);return}let p=P1(f,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),Ju(typeof f=="string"?f:Ss(f),n.createHref(p),Av(n),"reject"),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,i,a,e])}var nE=s.createContext(null);function KH(){return s.useContext(nE)}function GH(e){let t=s.useContext(Da).outlet;return s.useMemo(()=>t&&s.createElement(nE.Provider,{value:e},t),[t,e])}function ia(){let{matches:e}=s.useContext(Da),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function $1(e,{relative:t}={}){let{matches:n}=s.useContext(Da),{pathname:r}=Bn(),a=JSON.stringify(fm(n));return s.useMemo(()=>P1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function YH(e,t,n){hn(Zc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=s.useContext(Ms),{matches:a}=s.useContext(Da),i=a[a.length-1],l=i?i.params:{},u=i?i.pathname:"/",f=i?i.pathnameBase:"/",h=i&&i.route;{let S=h&&h.path||"";oE(u,!h||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=Bn(),g;g=p;let m=g.pathname||"/",w=m;if(f!=="/"){let S=f.replace(/^\//,"").split("/");w="/"+m.replace(/^\//,"").split("/").slice(S.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(S=>Object.assign(S,{route:n.manifest[S.route.id]||S.route})):AS(e,{pathname:w});return nr(h||y!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),nr(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.`),eO(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ra([f,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Ra([f,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n)}function qH(){let e=aE(),t=r1(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 XH=s.createElement(qH,null),rE=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=BH(e.digest);n&&(e=n)}let t=e!==void 0?s.createElement(Da.Provider,{value:this.props.routeContext},s.createElement(Lv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?s.createElement(QH,{error:e},t):t}};rE.contextType=qS;var m8=new WeakMap;function QH({children:e,error:t}){let{basename:n,navigator:r}=s.useContext(Ms);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=zH(t.digest);if(a){let i=m8.get(t);if(i)throw i;let l=HS(a.location,n),u=l.absoluteURL||l.to;if(Ju(a.location,u,Av(r),"allow-explicit"),F6(u))throw new Error("Invalid redirect location");if(DS&&!m8.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 m8.set(t,f),f}return s.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function JH({routeContext:e,match:t,children:n}){let r=s.useContext(Vc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(Da.Provider,{value:e},n)}function eO(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);hn(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:m,errors:w}=r,y=g.route.loader&&!m.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 m,w;f(p,{location:r.location,params:((w=(m=r.matches)==null?void 0:m[0])==null?void 0:w.params)??{},pattern:T1(r.matches),errorInfo:g})}:void 0;return a.reduceRight((p,g,m)=>{let w,y=!1,b=null,S=null;r&&(w=i&&g.route.id?i[g.route.id]:void 0,b=g.route.errorElement||XH,l&&(u<0&&m===0?(oE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):u===m&&(y=!0,S=g.route.hydrateFallbackElement||null)));let k=t.concat(a.slice(0,m+1)),C=()=>{let E;return w?E=b:y?E=S:g.route.Component?E=s.createElement(g.route.Component,null):g.route.element?E=g.route.element:E=p,s.createElement(JH,{match:g,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:E})};return r&&(g.route.ErrorBoundary||g.route.errorElement||m===0)?s.createElement(rE,{location:r.location,revalidation:r.revalidation,component:b,error:w,children:C(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):C()},null)}function Tv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tO(e){let t=s.useContext(Vc);return hn(t,Tv(e)),t}function $v(e){let t=s.useContext(Md);return hn(t,Tv(e)),t}function nO(e){let t=s.useContext(Da);return hn(t,Tv(e)),t}function Dv(e){let t=nO(e),n=t.matches[t.matches.length-1];return hn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function rO(){return Dv("useRouteId")}function sO(){let e=$v("useNavigation");return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function sE(){let{matches:e,loaderData:t}=$v("useMatches");return s.useMemo(()=>e.map(n=>NS(n,t)),[e,t])}function aE(){var r;let e=s.useContext(Lv),t=$v("useRouteError"),n=Dv("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function aO(){let{router:e}=tO("useNavigate"),t=Dv("useNavigate"),n=s.useRef(!1);return tE(()=>{n.current=!0}),s.useCallback(async(a,i={})=>{nr(n.current,eE),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Jx={};function oE(e,t,n){!t&&!Jx[e]&&(Jx[e]=!0,nr(!1,n))}var e5={};function t5(e,t){!e&&!e5[t]&&(e5[t]=!0,console.warn(t))}var oO="useOptimistic",n5=Nl[oO],iO=()=>{};function lO(e){return n5?n5(e):[e,iO]}function cO(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&nr(!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&&nr(!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&&nr(!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 uO=["HydrateFallback","hydrateFallbackElement"],dO=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 fO({router:e,flushSync:t,onError:n,useTransitions:r}){r=XS()||r;let[i,l]=s.useState(e.state),[u,f]=lO(i),[h,p]=s.useState(),[g,m]=s.useState({isTransitioning:!1}),[w,y]=s.useState(),[b,S]=s.useState(),[k,C]=s.useState(),E=s.useRef(new Map),A=s.useCallback((j,{deletedFetchers:P,newErrors:R,flushSync:H,viewTransitionOpts:D})=>{R&&n&&Object.values(R).forEach(_=>{var B;return n(_,{location:j.location,params:((B=j.matches[0])==null?void 0:B.params)??{},pattern:T1(j.matches)})}),j.fetchers.forEach((_,B)=>{_.data!==void 0&&E.current.set(B,_.data)}),P.forEach(_=>E.current.delete(_)),t5(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 U=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(t5(D==null||U,"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||!U){t&&H?t(()=>l(j)):r===!1?l(j):s.startTransition(()=>{r===!0&&f(_=>r5(_,j)),l(j)});return}if(t&&H){t(()=>{b&&(w==null||w.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let _=e.window.document.startViewTransition(()=>{t(()=>l(j))});_.finished.finally(()=>{t(()=>{y(void 0),S(void 0),p(void 0),m({isTransitioning:!1})})}),t(()=>S(_));return}b?(w==null||w.resolve(),b.skipTransition(),C({state:j,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(p(j),m({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,b,w,r,f,n]);s.useLayoutEffect(()=>e.subscribe(A),[e,A]),s.useEffect(()=>{g.isTransitioning&&!g.flushSync&&y(new dO)},[g]),s.useEffect(()=>{if(w&&h&&e.window){let j=h,P=w.promise,R=e.window.document.startViewTransition(async()=>{r===!1?l(j):s.startTransition(()=>{r===!0&&f(H=>r5(H,j)),l(j)}),await P});R.finished.finally(()=>{y(void 0),S(void 0),p(void 0),m({isTransitioning:!1})}),S(R)}},[h,w,e.window,r,f]),s.useEffect(()=>{w&&h&&u.location.key===h.location.key&&w.resolve()},[w,b,u.location,h]),s.useEffect(()=>{!g.isTransitioning&&k&&(p(k.state),m({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}),C(void 0))},[g.isTransitioning,k]);let L=s.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:j=>e.navigate(j),push:(j,P,R)=>e.navigate(j,{state:P,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(j,P,R)=>e.navigate(j,{replace:!0,state:P,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[e]),$=e.basename||"/",N=s.useMemo(()=>({router:e,navigator:L,static:!1,basename:$,onError:n}),[e,L,$,n]);return s.createElement(s.Fragment,null,s.createElement(Vc.Provider,{value:N},s.createElement(Md.Provider,{value:u},s.createElement(QS.Provider,{value:E.current},s.createElement(Pv.Provider,{value:g},s.createElement(mO,{basename:$,location:u.location,navigationType:u.historyAction,navigator:L,useTransitions:r},s.createElement(hO,{routes:e.routes,manifest:e.manifest,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function r5(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 hO=s.memo(pO);function pO({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return YH(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function Ta({to:e,replace:t,state:n,relative:r}){hn(Zc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:i}=s.useContext(Ms);nr(!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(Da),{pathname:u}=Bn(),f=Un(),h=P1(e,fm(l),u,r==="path");Ju(typeof e=="string"?e:Ss(e),i.createHref(h),Av(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 zc(e){return GH(e.context)}function mO({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:l}){hn(!Zc(),"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=Fo(n));let{pathname:h="/",search:p="",hash:g="",state:m=null,key:w="default",mask:y}=n,b=s.useMemo(()=>{let S=oa(h,u);return S==null?null:{location:{pathname:S,search:p,hash:g,state:m,key:w,mask:y},navigationType:r}},[u,h,p,g,m,w,r,y]);return nr(b!=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.`),b==null?null:s.createElement(Ms.Provider,{value:f},s.createElement(hm.Provider,{children:t,value:b}))}var tp="get",np="application/x-www-form-urlencoded";function pm(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function gO(e){return pm(e)&&e.tagName.toLowerCase()==="button"}function vO(e){return pm(e)&&e.tagName.toLowerCase()==="form"}function wO(e){return pm(e)&&e.tagName.toLowerCase()==="input"}function yO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bO(e,t){return e.button===0&&(!t||t==="_self")&&!yO(e)}function V6(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 xO(e,t){let n=V6(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var Sh=null;function kO(){if(Sh===null)try{new FormData(document.createElement("form"),0),Sh=!1}catch{Sh=!0}return Sh}var SO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function g8(e){return e!=null&&!SO.has(e)?(nr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${np}"`),null):e}function EO(e,t){let n,r,a,i,l;if(vO(e)){let u=e.getAttribute("action");r=u?oa(u,t):null,n=e.getAttribute("method")||tp,a=g8(e.getAttribute("enctype"))||np,i=new FormData(e)}else if(gO(e)||wO(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?oa(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||tp,a=g8(e.getAttribute("formenctype"))||g8(u.getAttribute("enctype"))||np,i=new FormData(u,e),!kO()){let{name:h,type:p,value:g}=e;if(p==="image"){let m=h?`${h}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else h&&i.append(h,g)}}else{if(pm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=tp,r=null,a=np,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 CO={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},jO=/[&><\u2028\u2029]/g;function s5(e){return e.replace(jO,t=>CO[t])}function Hv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function iE(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&&oa(a.pathname,t)==="/"?a.pathname=`${md(t)}/_root.${r}`:a.pathname=`${md(a.pathname)}.${r}`,a}async function AO(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 NO(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 MO(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await AO(i,n);return l.links?l.links():[]}return[]}));return TO(r.flat(1).filter(NO).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function a5(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 m=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 m=="boolean")return m}return!0}):[]}function RO(e,t,{includeHydrateFallback:n}={}){return PO(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 PO(e){return[...new Set(e)]}function LO(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function TO(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(LO(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function Ov(){let e=s.useContext(Vc);return Hv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $O(){let e=s.useContext(Md);return Hv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var mm=s.createContext(void 0);mm.displayName="FrameworkContext";function gm(){let e=s.useContext(mm);return Hv(e,"You must render this element inside a <HydratedRouter> element"),e}function DO(e,t){let n=s.useContext(mm),[r,a]=s.useState(!1),[i,l]=s.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,m=s.useRef(null);s.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=k=>{k.forEach(C=>{l(C.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[e]),s.useEffect(()=>{if(r){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[r]);let w=()=>{a(!0)},y=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:b0(u,w),onBlur:b0(f,y),onMouseEnter:b0(h,w),onMouseLeave:b0(p,y),onTouchStart:b0(g,w)}]:[!1,m,{}]}function b0(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function HO({page:e,...t}){let n=XS(),{nonce:r}=gm(),{router:a}=Ov(),i=s.useMemo(()=>AS(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(IO,{page:e,matches:i,...t}):s.createElement(FO,{page:e,matches:i,...t})):null}function OO(e){let{manifest:t,routeModules:n}=gm(),[r,a]=s.useState([]);return s.useEffect(()=>{let i=!1;return MO(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function IO({page:e,matches:t,...n}){let r=Bn(),{future:a}=gm(),{basename:i}=Ov(),l=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let u=iE(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 FO({page:e,matches:t,...n}){let r=Bn(),{future:a,manifest:i,routeModules:l}=gm(),{basename:u}=Ov(),{loaderData:f,matches:h}=$O(),p=s.useMemo(()=>a5(e,t,h,i,r,"data"),[e,t,h,i,r]),g=s.useMemo(()=>a5(e,t,h,i,r,"assets"),[e,t,h,i,r]),m=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,S=!1;if(t.forEach(C=>{var A;let E=i.routes[C.route.id];!E||!E.hasLoader||(!p.some(L=>L.route.id===C.route.id)&&C.route.id in f&&((A=l[C.route.id])!=null&&A.shouldRevalidate)||E.hasClientLoader?S=!0:b.add(C.route.id))}),b.size===0)return[];let k=iE(e,u,a.v8_trailingSlashAwareDataRequests,"data");return S&&b.size>0&&k.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[k.pathname+k.search]},[u,a.v8_trailingSlashAwareDataRequests,f,r,i,p,t,e,l]),w=s.useMemo(()=>RO(g,i),[g,i]),y=OO(g);return s.createElement(s.Fragment,null,m.map(b=>s.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),w.map(b=>s.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:S})=>s.createElement("link",{key:b,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function _O(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var VO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{VO&&(window.__reactRouterVersion="7.18.5")}catch{}function ZO(e,t){return pH({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:RD({window:t==null?void 0:t.window}),hydrationData:zO(),routes:e,mapRouteProperties:cO,hydrationRouteProperties:uO,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 zO(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:BO(e.errors)}),e}function BO(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 L1(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(typeof a.__subType=="string"&&JD.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 Vn=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:m,defaultShouldRevalidate:w,...y},b){let{basename:S,navigator:k,useTransitions:C}=s.useContext(Ms),E=typeof p=="string"&&um.test(p),A=HS(p,S);p=A.to;let L=UH(p,{relative:a}),$=Bn(),N=null;if(u){let B=P1(u,[],$.mask?$.mask.pathname:"/",!0);S!=="/"&&(B.pathname=B.pathname==="/"?S:Ra([S,B.pathname])),N=k.createHref(B)}let[j,P,R]=DO(r,y),H=GO(p,{replace:l,mask:u,state:f,target:h,preventScrollReset:g,relative:a,viewTransition:m,defaultShouldRevalidate:w,useTransitions:C});function D(B){t&&t(B),B.defaultPrevented||H(B)}let U=!(A.isExternal||i),_=s.createElement("a",{...y,...R,href:(U?N:void 0)||A.absoluteURL||L,onClick:U?D:t,ref:_O(b,P),target:h,"data-discover":!E&&n==="render"?"true":void 0});return j&&!E?s.createElement(s.Fragment,null,_,s.createElement(HO,{page:L})):_});Vn.displayName="Link";var UO=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=$1(l,{relative:h.relative}),m=Bn(),w=s.useContext(Md),{navigator:y,basename:b}=s.useContext(Ms),S=w!=null&&tI(g)&&u===!0,k=y.encodeLocation?y.encodeLocation(g).pathname:g.pathname,C=m.pathname,E=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,k=k.toLowerCase()),E&&b&&(E=oa(E,b)||E);const A=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=C===k||!a&&C.startsWith(k)&&C.charAt(A)==="/",$=E!=null&&(E===k||!a&&E.startsWith(k)&&E.charAt(k.length)==="/"),N={isActive:L,isPending:$,isTransitioning:S},j=L?t:void 0,P;typeof r=="function"?P=r(N):P=[r,L?"active":null,$?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let R=typeof i=="function"?i(N):i;return s.createElement(Vn,{...h,"aria-current":j,className:P,ref:p,style:R,to:l,viewTransition:u},typeof f=="function"?f(N):f)});UO.displayName="NavLink";var WO=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=tp,action:u,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:m,...w},y)=>{let{useTransitions:b}=s.useContext(Ms),S=XO(),k=QO(u,{relative:h}),C=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&um.test(u),A=L=>{if(f&&f(L),L.defaultPrevented)return;L.preventDefault();let $=L.nativeEvent.submitter,N=($==null?void 0:$.getAttribute("formmethod"))||l,j=()=>S($||L.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:a,state:i,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:m});b&&n!==!1?s.startTransition(()=>j()):j()};return s.createElement("form",{ref:y,method:C,action:k,onSubmit:r?f:A,...w,"data-discover":!E&&e==="render"?"true":void 0})});WO.displayName="Form";function lE({getKey:e,storageKey:t,...n}){let r=s.useContext(mm),{basename:a}=s.useContext(Ms),i=Bn(),l=sE();JO({getKey:e,storageKey:t});let u=s.useMemo(()=>{if(!r||!e)return null;let h=z6(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 m=JSON.parse(sessionStorage.getItem(h)||"{}")[p||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}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})(${s5(JSON.stringify(t||Z6))}, ${s5(JSON.stringify(u))})`}})}lE.displayName="ScrollRestoration";function cE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Iv(e){let t=s.useContext(Vc);return hn(t,cE(e)),t}function KO(e){let t=s.useContext(Md);return hn(t,cE(e)),t}function GO(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f,useTransitions:h}={}){let p=Un(),g=Bn(),m=$1(e,{relative:l});return s.useCallback(w=>{if(bO(w,t)){w.preventDefault();let y=n!==void 0?n:Ss(g)===Ss(m),b=()=>p(e,{replace:y,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f});h?s.startTransition(()=>b()):b()}},[g,p,m,n,r,a,t,e,i,l,u,f,h])}function Ml(e){nr(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(V6(e)),n=s.useRef(!1),r=Bn(),a=s.useMemo(()=>xO(r.search,n.current?null:t.current),[r.search]),i=Un(),l=s.useCallback((u,f)=>{const h=V6(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,i("?"+h,f)},[i,a]);return[a,l]}var YO=0,qO=()=>`__${String(++YO)}__`;function XO(){let{router:e}=Iv("useSubmit"),{basename:t}=s.useContext(Ms),n=rO(),r=e.fetch,a=e.navigate;return s.useCallback(async(i,l={})=>{let{action:u,method:f,encType:h,formData:p,body:g}=EO(i,t);if(l.navigate===!1){let m=l.fetcherKey||qO();await r(m,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 QO(e,{relative:t}={}){let{basename:n}=s.useContext(Ms),r=s.useContext(Da);hn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...$1(e||".",{relative:t})},l=Bn();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:Ra([n,i.pathname])),Ss(i)}var Z6="react-router-scroll-positions",Eh={};function z6(e,t,n,r){let a=null;return r&&(n!=="/"?a=r({...e,pathname:oa(e.pathname,n)||e.pathname},t):a=r(e,t)),a==null&&(a=e.key),a}function JO({getKey:e,storageKey:t}={}){let{router:n}=Iv("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:a}=KO("useScrollRestoration"),{basename:i}=s.useContext(Ms),l=Bn(),u=sE(),f=sO();s.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),eI(s.useCallback(()=>{if(f.state==="idle"){let h=z6(l,u,i,e);Eh[h]=window.scrollY}try{sessionStorage.setItem(t||Z6,JSON.stringify(Eh))}catch(h){nr(!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||Z6);h&&(Eh=JSON.parse(h))}catch{}},[t]),s.useLayoutEffect(()=>{let h=n==null?void 0:n.enableScrollRestoration(Eh,()=>window.scrollY,e?(p,g)=>z6(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{nr(!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 eI(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 tI(e,{relative:t}={}){let n=s.useContext(Pv);hn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Iv("useViewTransitionState"),a=$1(e,{relative:t});if(!n.isTransitioning)return!1;let i=oa(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=oa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xl(a.pathname,l)!=null||xl(a.pathname,i)!=null}const nI=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"}))]]),rI=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"}))]]),sI=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"}))]]),aI=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"}))]]),oI=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"}))]]),iI=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"}))]]),lI=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"}))]]),cI=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"}))]]),uI=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"}))]]),dI=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"}))]]),fI=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"}))]]),hI=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"}))]]),pI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]),mI=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"}))]]),gI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z",opacity:"0.2"}),s.createElement("path",{d:"M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z"}))]]),vI=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"}))]]),wI=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"}))]]),yI=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"}))]]),bI=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"}))]]),xI=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"}))]]),kI=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"}))]]),SI=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"}))]]),EI=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"}))]]),CI=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"}))]]),jI=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"}))]]),AI=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"}))]]),NI=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"}))]]),MI=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"}))]]),RI=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"}))]]),PI=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"}))]]),LI=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"}))]]),TI=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"}))]]),$I=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"}))]]),DI=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"}))]]),HI=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"}))]]),OI=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"}))]]),II=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,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["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,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["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,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]),FI=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"}))]]),_I=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"}))]]),VI=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"}))]]),ZI=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"}))]]),zI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",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,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["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,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["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,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["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,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["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,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),BI=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"}))]]),UI=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,88a16,16,0,1,1,16,16A16,16,0,0,1,160,88Zm76-32V160a20,20,0,0,1-20,20H204v20a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V88A20,20,0,0,1,40,68H60V56A20,20,0,0,1,80,36H216A20,20,0,0,1,236,56ZM180,180H80a20,20,0,0,1-20-20V92H44V196H180Zm-21.66-24L124,121.66,89.66,156ZM212,60H84v67.72l25.86-25.86a20,20,0,0,1,28.28,0L192.28,156H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56v82.06l-23.72-23.72a8,8,0,0,0-11.31,0L163.31,140,113.66,90.34a8,8,0,0,0-11.32,0L64,128.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,56H216v62.75l-10.07-10.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L72,109.37ZM184,200H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V132l36-36,49.66,49.66a8,8,0,0,0,11.31,0L194.63,120,216,141.38V168ZM160,84a12,12,0,1,1,12,12A12,12,0,0,1,160,84Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM172,72a12,12,0,1,1-12,12A12,12,0,0,1,172,72Zm12,128H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V120.69l30.34-30.35a8,8,0,0,1,11.32,0L163.31,140,189,114.34a8,8,0,0,1,11.31,0L216,130.07V168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H72A14,14,0,0,0,58,56V74H40A14,14,0,0,0,26,88V200a14,14,0,0,0,14,14H184a14,14,0,0,0,14-14V182h18a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM70,56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2v67.57L204.53,110.1a14,14,0,0,0-19.8,0l-21.42,21.41L117.9,86.1a14,14,0,0,0-19.8,0L70,114.2ZM186,200a2,2,0,0,1-2,2H40a2,2,0,0,1-2-2V88a2,2,0,0,1,2-2H58v82a14,14,0,0,0,14,14H186Zm30-30H72a2,2,0,0,1-2-2V131.17l36.58-36.58a2,2,0,0,1,2.83,0l49.66,49.66a6,6,0,0,0,8.49,0l25.65-25.66a2,2,0,0,1,2.83,0l22,22V168A2,2,0,0,1,216,170ZM162,84a10,10,0,1,1,10,10A10,10,0,0,1,162,84Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V184h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,56H216v62.75l-10.07-10.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L72,109.37ZM184,200H40V88H56v80a16,16,0,0,0,16,16H184Zm32-32H72V132l36-36,49.66,49.66a8,8,0,0,0,11.31,0L194.63,120,216,141.38V168ZM160,84a12,12,0,1,1,12,12A12,12,0,0,1,160,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H72A12,12,0,0,0,60,56V76H40A12,12,0,0,0,28,88V200a12,12,0,0,0,12,12H184a12,12,0,0,0,12-12V180h20a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM68,56a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4v72.4l-16.89-16.89a12,12,0,0,0-17,0l-22.83,22.83L116.49,87.51a12,12,0,0,0-17,0L68,119ZM188,200a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V88a4,4,0,0,1,4-4H60v84a12,12,0,0,0,12,12H188Zm28-28H72a4,4,0,0,1-4-4V130.34l37.17-37.17a4,4,0,0,1,5.66,0l49.66,49.66a4,4,0,0,0,5.65,0l25.66-25.66a4,4,0,0,1,5.66,0L220,139.71V168A4,4,0,0,1,216,172ZM164,84a8,8,0,1,1,8,8A8,8,0,0,1,164,84Z"}))]]),WI=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"}))]]),KI=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"}))]]),GI=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"}))]]),YI=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"}))]]),qI=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"}))]]),XI=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"}))]]),QI=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"}))]]),JI=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"}))]]),eF=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"}))]]),tF=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"}))]]),nF=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"}))]]),rF=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"}))]]),sF=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"}))]]),aF=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"}))]]),oF=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"}))]]),iF=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"}))]]),lF=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"}))]]),cF=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"}))]]),uF=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"}))]]),dF=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"}))]]),fF=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"}))]]),hF=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"}))]]),pF=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"}))]]),mF=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"}))]]),gF=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"}))]]),vF=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"}))]]),wF=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"}))]]),yF=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"}))]]),bF=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"}))]]),xF=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"}))]]),kF=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"}))]]),SF=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"}))]]),EF=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"}))]]),CF=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"}))]]),uE=s.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),At=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:m="regular",mirrored:w=!1,...y}=s.useContext(uE);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??m))});At.displayName="IconBase";const dE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:nI}));dE.displayName="ApertureIcon";const fE=dE,hE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:rI}));hE.displayName="ArchiveIcon";const vm=hE,pE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:sI}));pE.displayName="ArrowCircleUpIcon";const mE=pE,gE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:aI}));gE.displayName="ArrowClockwiseIcon";const vE=gE,wE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:oI}));wE.displayName="ArrowCounterClockwiseIcon";const s1=wE,yE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:iI}));yE.displayName="ArrowLeftIcon";const Fv=yE,bE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:lI}));bE.displayName="ArrowLineUpIcon";const jF=bE,xE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:cI}));xE.displayName="ArrowRightIcon";const Ea=xE,kE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:uI}));kE.displayName="ArrowSquareOutIcon";const Mc=kE,SE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:dI}));SE.displayName="ArrowUpIcon";const EE=SE,CE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:fI}));CE.displayName="ArrowsClockwiseIcon";const yp=CE,jE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:hI}));jE.displayName="ArrowsDownUpIcon";const AF=jE,AE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:pI}));AE.displayName="ArrowsOutSimpleIcon";const NF=AE,NE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:mI}));NE.displayName="BellIcon";const v8=NE,ME=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:gI}));ME.displayName="BookOpenIcon";const MF=ME,RE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:vI}));RE.displayName="CaretDownIcon";const kl=RE,PE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:wI}));PE.displayName="CaretLeftIcon";const Ha=PE,LE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:yI}));LE.displayName="CaretRightIcon";const Rl=LE,TE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:bI}));TE.displayName="CaretUpIcon";const RF=TE,$E=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:xI}));$E.displayName="ChartBarIcon";const PF=$E,DE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:kI}));DE.displayName="CheckIcon";const Gn=DE,HE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:SI}));HE.displayName="CircleIcon";const LF=HE,OE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:EI}));OE.displayName="CircleHalfIcon";const TF=OE,IE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:CI}));IE.displayName="CopyIcon";const bp=IE,FE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:jI}));FE.displayName="CopySimpleIcon";const o5=FE,_E=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:AI}));_E.displayName="DeviceMobileIcon";const $F=_E,VE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:NI}));VE.displayName="DotsThreeIcon";const _v=VE,ZE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:MI}));ZE.displayName="DotsThreeVerticalIcon";const Vv=ZE,zE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:RI}));zE.displayName="DownloadSimpleIcon";const BE=zE,UE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:PI}));UE.displayName="FilmSlateIcon";const wm=UE,WE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:LI}));WE.displayName="FolderSimpleIcon";const Zv=WE,KE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:TI}));KE.displayName="FolderSimpleMinusIcon";const GE=KE,YE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:$I}));YE.displayName="FrameCornersIcon";const qE=YE,XE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:DI}));XE.displayName="GearSixIcon";const DF=XE,QE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:HI}));QE.displayName="GiftIcon";const HF=QE,JE=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:OI}));JE.displayName="GithubLogoIcon";const OF=JE,eC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:II}));eC.displayName="GlobeIcon";const IF=eC,tC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:FI}));tC.displayName="GraduationCapIcon";const FF=tC,nC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:_I}));nC.displayName="HandWavingIcon";const _F=nC,rC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:VI}));rC.displayName="HouseIcon";const VF=rC,sC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:ZI}));sC.displayName="IdentificationBadgeIcon";const ym=sC,aC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:zI}));aC.displayName="ImageIcon";const ZF=aC,oC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:BI}));oC.displayName="ImageSquareIcon";const Oa=oC,iC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:UI}));iC.displayName="ImagesIcon";const zF=iC,lC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:WI}));lC.displayName="InfinityIcon";const cC=lC,uC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:KI}));uC.displayName="InfoIcon";const bm=uC,dC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:GI}));dC.displayName="KeyIcon";const fC=dC,hC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:YI}));hC.displayName="KeyboardIcon";const BF=hC,pC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:qI}));pC.displayName="LightningIcon";const a1=pC,mC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:XI}));mC.displayName="MagnifyingGlassIcon";const gd=mC,gC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:QI}));gC.displayName="MegaphoneIcon";const UF=gC,vC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:JI}));vC.displayName="MinusIcon";const WF=vC,wC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:eF}));wC.displayName="MountainsIcon";const KF=wC,yC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:tF}));yC.displayName="PackageIcon";const xm=yC,bC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:nF}));bC.displayName="PaletteIcon";const GF=bC,xC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:rF}));xC.displayName="PaperclipIcon";const YF=xC,kC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:sF}));kC.displayName="PencilSimpleIcon";const Rd=kC,SC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:aF}));SC.displayName="PencilSimpleLineIcon";const qF=SC,EC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:oF}));EC.displayName="PlusIcon";const gr=EC,CC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:iF}));CC.displayName="PlusCircleIcon";const XF=CC,jC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:lF}));jC.displayName="PowerIcon";const AC=jC,NC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:cF}));NC.displayName="QuestionIcon";const QF=NC,MC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:uF}));MC.displayName="SidebarSimpleIcon";const JF=MC,RC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:dF}));RC.displayName="SlidersHorizontalIcon";const zv=RC,PC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:fF}));PC.displayName="StackIcon";const LC=PC,TC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:hF}));TC.displayName="StarIcon";const to=TC,$C=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:pF}));$C.displayName="StorefrontIcon";const DC=$C,HC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:mF}));HC.displayName="SunHorizonIcon";const OC=HC,IC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:gF}));IC.displayName="TrashIcon";const Pl=IC,FC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:vF}));FC.displayName="TrashSimpleIcon";const km=FC,_C=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:wF}));_C.displayName="UploadSimpleIcon";const Bv=_C,VC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:yF}));VC.displayName="UserIcon";const e_=VC,ZC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:bF}));ZC.displayName="UserCircleIcon";const t_=ZC,zC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:xF}));zC.displayName="UserPlusIcon";const n_=zC,BC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:kF}));BC.displayName="WarningIcon";const Sm=BC,UC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:SF}));UC.displayName="WarningCircleIcon";const Bc=UC,WC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:EF}));WC.displayName="XIcon";const jn=WC,KC=s.forwardRef((e,t)=>s.createElement(At,{ref:t,...e,weights:CF}));KC.displayName="XCircleIcon";const r_=KC;var Ur=kS(),s_=Object.defineProperty,Uv=(e,t)=>s_(e,"name",{value:t,configurable:!0});function B6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Uv(B6,"setRef");function GC(...e){return t=>{let n=!1;const r=e.map(a=>{const i=B6(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():B6(e[a],null)}}}}Uv(GC,"composeRefs");function cn(...e){return s.useCallback(GC(...e),e)}Uv(cn,"useComposedRefs");var a_=Object.defineProperty,la=(e,t)=>a_(e,"name",{value:t,configurable:!0});function no(e){const t=s.forwardRef((n,r)=>{let{children:a,...i}=n,l=null,u=!1;const f=[];a=ej(a),s.Children.forEach(a,m=>{var w;if(QC(m)){u=!0;const y=m;let b="child"in y.props?y.props.child:y.props.children;for(;Wv(b)&&typeof xp=="function";)b=xp(b._payload);l=o_(y,b),f.push((w=l==null?void 0:l.props)==null?void 0:w.children)}else f.push(m)}),l?l=s.cloneElement(l,void 0,f):!u&&s.Children.count(a)===1&&s.isValidElement(a)&&(l=a);const h=l?XC(l):void 0,p=cn(r,h);if(!l){if(a||a===0)throw new Error(u?c_(e):l_(e));return a}const g=qC(i,l.props??{});return l.type!==s.Fragment&&(g.ref=r?p:h),s.cloneElement(l,g)});return t.displayName=`${e}.Slot`,t}la(no,"createSlot");var Uc=no("Slot"),YC=Symbol.for("radix.slottable");function Em(e){const t=la(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=YC,t}la(Em,"createSlottable");var Cm=Em("Slottable"),o_=la((e,t)=>"child"in e.props?s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null:s.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function qC(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(" "):r==="aria-describedby"&&(n[r]=tj(i,a))}return{...e,...n}}la(qC,"mergeProps");function XC(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)}la(XC,"getElementRef");function QC(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YC}la(QC,"isSlottable");var i_=Symbol.for("react.lazy");function Wv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===i_&&"_payload"in e&&JC(e._payload)}la(Wv,"isLazyComponent");function JC(e){return typeof e=="object"&&e!==null&&"then"in e}la(JC,"isPromiseLike");function ej(e){let t=e;for(;Wv(t)&&typeof xp=="function";)t=xp(t._payload);return t}la(ej,"useUnwrappedLazy");function tj(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}la(tj,"concatAriaDescribedby");var l_=la(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),c_=la(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),xp=Nl[" use ".trim().toString()],u_=Object.defineProperty,d_=(e,t)=>u_(e,"name",{value:t,configurable:!0}),f_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=f_.reduce((e,t)=>{const n=no(`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 Kv(e,t){e&&Ur.flushSync(()=>e.dispatchEvent(t))}d_(Kv,"dispatchDiscreteCustomEvent");var h_=Object.defineProperty,p_=(e,t)=>h_(e,"name",{value:t,configurable:!0}),nj=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"}),rj=s.forwardRef(p_(function(t,n){return o.jsx(pn.span,{...t,ref:n,style:{...nj,...t.style}})},"VisuallyHidden")),m_=Object.defineProperty,Ca=(e,t)=>m_(e,"name",{value:t,configurable:!0});function g_(e,t){const n=s.createContext(t);n.displayName=e+"Context";const r=Ca(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 Ca(a,"useContext"),[r,a]}Ca(g_,"createContext");function zs(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=Ca(g=>{var k;const{scope:m,children:w,...y}=g,b=((k=m==null?void 0:m[e])==null?void 0:k[f])||u,S=s.useMemo(()=>y,Object.values(y));return o.jsx(b.Provider,{value:S,children:w})},"Provider");h.displayName=i+"Provider";function p(g,m,w={}){var k;const{optional:y=!1}=w,b=((k=m==null?void 0:m[e])==null?void 0:k[f])||u,S=s.useContext(b);if(S)return S;if(l!==void 0)return l;if(!y)throw new Error(`\`${g}\` must be used within \`${i}\``)}return Ca(p,"useContext"),[h,p]}Ca(r,"createContext");const a=Ca(()=>{const i=n.map(l=>s.createContext(l));return Ca(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,sj(a,...t)]}Ca(zs,"createContextScope");function sj(...e){const t=e[0];if(e.length===1)return t;const n=Ca(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return Ca(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}Ca(sj,"composeContextScopes");var mr=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},v_=Object.defineProperty,Lr=(e,t)=>v_(e,"name",{value:t,configurable:!0});function jm(e){const t=e+"CollectionProvider",[n,r]=zs(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=Lr(b=>{const{scope:S,children:k}=b,C=s.useRef(null),E=s.useRef(new Map).current;return o.jsx(a,{scope:S,itemMap:E,collectionRef:C,children:k})},"CollectionProvider");l.displayName=t;const u=e+"CollectionSlot",f=no(u),h=s.forwardRef((b,S)=>{const{scope:k,children:C}=b,E=i(u,k),A=cn(S,E.collectionRef);return o.jsx(f,{ref:A,children:C})});h.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",m=no(p),w=s.forwardRef((b,S)=>{const{scope:k,children:C,...E}=b,A=s.useRef(null),L=cn(S,A),$=i(p,k);return s.useEffect(()=>($.itemMap.set(A,{ref:A,...E}),()=>void $.itemMap.delete(A))),o.jsx(m,{[g]:"",ref:L,children:C})});w.displayName=p;function y(b){const S=i(e+"CollectionConsumer",b);return s.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const E=Array.from(C.querySelectorAll(`[${g}]`));return Array.from(S.itemMap.values()).sort(($,N)=>E.indexOf($.ref.current)-E.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return Lr(y,"useCollection"),[{Provider:l,Slot:h,ItemSlot:w},y,r]}Lr(jm,"createCollection");var i5=new WeakMap,yr,ta,Ch=(ta=class extends Map{constructor(n){super(n);yx(this,yr);a8(this,yr,[...super.keys()]),i5.set(this,!0)}set(n,r){return i5.get(this)&&!this.has(n)&&qr(this,yr).push(n),super.set(n,r),this}insert(n,r,a){const i=this.has(r),l=i?this.size:this.size+1,u=Gv(n),f=u>=0?Math.min(u,l-1):Math.max(l+u,0);if(i?qr(this,yr).indexOf(r)===f:f===this.size)return this.set(r,a),this;const h=qr(this,yr).filter(g=>g!==r);h.splice(f,0,r);const p=h.map(g=>[g,g===r?a:this.get(g)]);this.clear();for(const[g,m]of p)this.set(g,m);return this}with(n,r,a){const i=new ta(this);return i.insert(n,r,a),i}before(n){const r=qr(this,yr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,a){const i=qr(this,yr).indexOf(n);if(i===-1)return this;const l=qr(this,yr).indexOf(r),u=l!==-1&&l<i?i-1:i;return this.insert(u,r,a)}after(n){let r=qr(this,yr).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=qr(this,yr).indexOf(n);if(i===-1)return this;const l=qr(this,yr).indexOf(r),u=l!==-1&&l<=i?i:i+1;return this.insert(u,r,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return a8(this,yr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&qr(this,yr).splice(qr(this,yr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=rp(qr(this,yr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=rp(qr(this,yr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return qr(this,yr).indexOf(n)}keyAt(n){return rp(qr(this,yr),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 ta(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 ta(a)}reduce(...n){const[r,a]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let l=0,u=a;for(const f of this)l===0&&!i?u=f:u=Reflect.apply(r,this,[u,f,l,this]),l++;return u}reduceRight(...n){const[r,a]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let l=a;for(let u=this.size-1;u>=0;u--){const f=this.entryAt(u);u===this.size-1&&!i?l=f:l=Reflect.apply(r,this,[l,f,u,this])}return l}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[a,i]of r)this.set(a,i);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new ta(r)}toReversed(){const n=new ta;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 ta(r)}slice(n,r){const a=new ta;for(const i of qr(this,yr).slice(n,r))a.set(i,this.get(i));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}},yr=new WeakMap,Lr(ta,"OrderedDict"),ta);function rp(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=aj(e,t);return n===-1?void 0:e[n]}Lr(rp,"at");function aj(e,t){const n=e.length,r=Gv(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}Lr(aj,"toSafeIndex");function Gv(e){return e!==e||e===0?0:Math.trunc(e)}Lr(Gv,"toSafeInteger");function w_(e){const t=e+"CollectionProvider",[n,r]=zs(t),[a,i]=n(t);a.displayName=e+"CollectionStableContextProvider";const[l,u]=n(t);l.displayName=e+"CollectionStatefulContextProvider";const f=Lr(({state:$,...N})=>$?o.jsx(p,{...N,state:$}):o.jsx(h,{...N}),"CollectionProvider");f.displayName=t;const h=Lr($=>{const N=C();return o.jsx(p,{...$,state:N})},"CollectionInit");h.displayName=e+"CollectionInit";const p=Lr($=>{const{scope:N,children:j,state:P}=$,R=s.useRef(null),[H,D]=s.useState(null),U=cn(R,D),[_,B]=P,K=s.useRef(new Ch),V=s.useCallback(()=>{const O=K.current;return lj(O)||O.sort(sp),O},[]);return s.useEffect(()=>{if(!H)return;const O=cj(()=>{B(I=>{const Y=I.toSorted(sp);return Y.some(([X],z)=>I.keyAt(z)!==X)?Y:I})});return O.observe(H,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[H,B]),o.jsx(a,{scope:N,collectionElementRef:U,collectionElementRefObject:R,getCollection:V,setCollection:B,registryRef:K,children:o.jsx(l,{scope:N,collectionElement:H,collection:_,children:j})})},"CollectionProviderImpl");p.displayName=e+"CollectionProviderImpl";const g=e+"CollectionSlot",m=no(g),w=s.forwardRef(($,N)=>{const{scope:j,children:P}=$,R=i(g,j),H=cn(N,R.collectionElementRef);return o.jsx(m,{ref:H,children:P})});w.displayName=g;const y=e+"CollectionItemSlot",b="data-radix-collection-item",S=no(y),k=s.forwardRef(($,N)=>{const{scope:j,children:P,...R}=$,H=s.useRef(null),D=i(y,j),{setCollection:U,registryRef:_}=D,B=s.useRef(R);oj(B.current,R)||(B.current=R);const K=B.current,V=s.useCallback(Y=>{const Z=_.current;Y?Z.set(Y,{...B.current,element:Y}):H.current&&Z.delete(H.current)},[_]),O=cn(N,V,H);mr(()=>{const Y=H.current,Z=_.current;Y&&Z.has(Y)&&Z.set(Y,{...K,element:Y})},[K,_]);const I=s.useRef(null);return s.useEffect(()=>{const Y=H.current,Z=I.current;((Z==null?void 0:Z.element)??null)===Y&&(!Y||(Z==null?void 0:Z.itemData)===K)||(I.current=Y?{element:Y,itemData:K}:null,U(X=>{const z=new Ch(X);return Z&&Z.element!==Y&&z.delete(Z.element),Y&&z.set(Y,{...K,element:Y}),z.sort(sp)}))}),s.useEffect(()=>()=>{const Y=I.current;I.current=null,Y&&U(Z=>{if(!Z.has(Y.element))return Z;const X=new Ch(Z);return X.delete(Y.element),X})},[U]),o.jsx(S,{[b]:"",ref:O,children:P})});k.displayName=y;function C(){return s.useState(new Ch)}Lr(C,"useInitCollection");function E($){const{collection:N}=u(e+"CollectionConsumer",$);return N}Lr(E,"useCollection");function A($){const{getCollection:N}=i(e+"CollectionConsumer",$);return N}return Lr(A,"useGetCollection"),[{Provider:f,Slot:w,ItemSlot:k},{createCollectionScope:r,useCollection:E,useGetCollection:A,useInitCollection:C}]}Lr(w_,"createCollection");function oj(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}Lr(oj,"shallowEqual");function ij(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Lr(ij,"isElementPreceding");function lj(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Lr(lj,"isInDocumentOrder");function sp(e,t){return!e[1].element||!t[1].element?0:ij(e[1].element,t[1].element)?-1:1}Lr(sp,"sortByDocumentPosition");function cj(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Lr(cj,"getChildListObserver");var y_=Object.defineProperty,Pd=(e,t)=>y_(e,"name",{value:t,configurable:!0}),uj=!!(typeof window<"u"&&window.document&&window.document.createElement);function Mt(e,t,{checkForDefaultPrevented:n=!0}={}){return Pd(function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}Pd(Mt,"composeEventHandlers");function b_(e){var t;if(!uj)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Pd(b_,"getOwnerWindow");function U6(e){if(!uj)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Pd(U6,"getOwnerDocument");function dj(e,t=!1){const{activeElement:n}=U6(e);if(!(n!=null&&n.nodeName))return null;if(fj(n)&&n.contentDocument)return dj(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=U6(n).getElementById(r);if(a)return a}}return n}Pd(dj,"getActiveElement");function fj(e){return e.tagName==="IFRAME"}Pd(fj,"isFrame");var x_=Object.defineProperty,k_=(e,t)=>x_(e,"name",{value:t,configurable:!0}),l5=Nl[" useEffectEvent ".trim().toString()],c5=Nl[" useInsertionEffect ".trim().toString()];function hj(e){if(typeof l5=="function")return l5(e);const t=s.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof c5=="function"?c5(()=>{t.current=e}):mr(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}k_(hj,"useEffectEvent");var S_=Object.defineProperty,D1=(e,t)=>S_(e,"name",{value:t,configurable:!0}),E_=Nl[" useInsertionEffect ".trim().toString()]||mr;function yi({prop:e,defaultProp:t,onChange:n=D1(()=>{},"onChange"),caller:r}){const[a,i,l]=pj({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a,h=s.useCallback(p=>{var g;if(u){const m=mj(p)?p(e):p;m!==e&&((g=l.current)==null||g.call(l,m))}else i(p)},[u,e,i,l]);return[f,h]}D1(yi,"useControllableState");function pj({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),a=s.useRef(n),i=s.useRef(t);return E_(()=>{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]}D1(pj,"useUncontrolledState");function mj(e){return typeof e=="function"}D1(mj,"isFunction");var u5=Symbol("RADIX:SYNC_STATE");function C_(e,t,n,r){const{prop:a,defaultProp:i,onChange:l,caller:u}=t,f=a!==void 0,h=hj(l),p=[{...n,state:i}];r&&p.push(r);const[g,m]=s.useReducer((S,k)=>{if(k.type===u5)return{...S,state:k.state};const C=e(S,k);return f&&!Object.is(C.state,S.state)&&h(C.state),C},...p),w=g.state,y=s.useRef(w);s.useEffect(()=>{y.current!==w&&(y.current=w,f||h(w))},[w,y,f]);const b=s.useMemo(()=>a!==void 0?{...g,state:a}:g,[g,a]);return s.useEffect(()=>{f&&!Object.is(a,g.state)&&m({type:u5,state:a})},[a,g.state,f]),[b,m]}D1(C_,"useControllableStateReducer");var j_=Object.defineProperty,bi=(e,t)=>j_(e,"name",{value:t,configurable:!0});function gj(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}bi(gj,"useStateMachine");var ps=bi(e=>{const{present:t,children:n}=e,r=vj(t),a=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=wj(r.ref,yj(a));return typeof n=="function"||r.isPresent?s.cloneElement(a,{ref:i}):null},"Presence");function vj(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]=gj(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??Vu(r.current),l.current=void 0):i.current="none"},[f]),mr(()=>{const p=r.current,g=a.current;if(g!==e){const w=i.current,y=Vu(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]),mr(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,m=bi(y=>{const S=Vu(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(h("ANIMATION_END"),!a.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},"handleAnimationEnd"),w=bi(y=>{y.target===t&&(i.current=Vu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}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=Vu(g)}else r.current=null;n(p)},[])}}bi(vj,"usePresence");function W6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}bi(W6,"setRef");function wj(...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=W6(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():W6(r[l],null)}}},[])}bi(wj,"useStableComposedRefs");function Vu(e){return(e==null?void 0:e.animationName)||"none"}bi(Vu,"getAnimationName");function yj(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)}bi(yj,"getElementRef");var A_=Object.defineProperty,N_=(e,t)=>A_(e,"name",{value:t,configurable:!0}),M_=Nl[" useId ".trim().toString()]||(()=>{}),R_=0;function Fs(e){const[t,n]=s.useState(M_());return mr(()=>{e||n(r=>r??String(R_++))},[e]),e||(t?`radix-${t}`:"")}N_(Fs,"useId");var P_=Object.defineProperty,bj=(e,t)=>P_(e,"name",{value:t,configurable:!0}),L_={LTR:"ltr"},xj=s.createContext(void 0),T_=bj(e=>{const{dir:t,children:n}=e;return o.jsx(xj.Provider,{value:t,children:n})},"DirectionProvider");function H1(e){const t=s.useContext(xj);return e||t||L_.LTR}bj(H1,"useDirection");var $_=Object.defineProperty,D_=(e,t)=>$_(e,"name",{value:t,configurable:!0}),d5=Nl[" useInsertionEffect ".trim().toString()];function Sr(e){const t=s.useRef(e);return typeof d5=="function"?d5(()=>{t.current=e}):mr(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}D_(Sr,"useCallbackRef");var H_=Object.defineProperty,zr=(e,t)=>H_(e,"name",{value:t,configurable:!0}),K6="dismissableLayer.update",O_="dismissableLayer.pointerDownOutside",I_="dismissableLayer.focusOutside",f5,kj=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),O1=s.forwardRef(zr(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(kj),[m,w]=s.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=s.useState({}),S=cn(n,w),k=Array.from(g.layers),[C]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),E=C?k.indexOf(C):-1,A=m?k.indexOf(m):-1,L=g.layersWithOutsidePointerEventsDisabled.size>0,$=A>=E,N=s.useRef(!1),j=Ej(D=>{l==null||l(D),f==null||f(D),D.defaultPrevented||h==null||h()},{ownerDocument:y,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(D=>{if(!(D instanceof Node))return!1;const U=[...g.branches].some(_=>_.contains(D));return $&&!U},[g.branches,$])}),P=Cj(D=>{if(a&&N.current)return;const U=D.target;[...g.branches].some(B=>B.contains(U))||(u==null||u(D),f==null||f(D),D.defaultPrevented||h==null||h())},y),R=m?A===k.length-1:!1,H=Sr(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&h&&(D.preventDefault(),h()))});return s.useEffect(()=>{if(R)return y.addEventListener("keydown",H,{capture:!0}),()=>y.removeEventListener("keydown",H,{capture:!0})},[y,R,H]),s.useEffect(()=>{if(m)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(f5=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(m)),g.layers.add(m),G6(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(m),g.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=f5))}},[m,y,r,g]),s.useEffect(()=>()=>{m&&(g.layers.delete(m),g.layersWithOutsidePointerEventsDisabled.delete(m),G6())},[m,g]),s.useEffect(()=>{const D=zr(()=>b({}),"handleUpdate");return document.addEventListener(K6,D),()=>document.removeEventListener(K6,D)},[]),o.jsx(pn.div,{...p,ref:S,style:{pointerEvents:L?$?"auto":"none":void 0,...t.style},onFocusCapture:Mt(t.onFocusCapture,P.onFocusCapture),onBlurCapture:Mt(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Mt(t.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Sj(){const e=s.useContext(kj),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}zr(Sj,"useDismissableLayerSurface");var F_=zr(()=>!0,"IS_TRUE");function Ej(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:l=F_}=t,u=Sr(e),f=s.useRef(!1),h=s.useRef(!1),p=s.useRef(new Map),g=s.useRef(()=>{});return s.useEffect(()=>{function m(){h.current=!1,a.current=!1,p.current.clear()}zr(m,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}zr(w,"isOutsideInteractionIntercepted");function y(E){if(!h.current)return;const A=E.target;A instanceof Node&&[...i].some($=>$.contains(A))||p.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{h.current&&g.current()},0)}zr(y,"handleInteractionCapture");function b(E){h.current&&p.current.set(E.type,!1)}zr(b,"handleInteractionBubble");const S=zr(E=>{if(E.target&&!f.current){let A=function(){n.removeEventListener("click",g.current);const $=w();m(),$||Yv(O_,u,L,{discrete:!0})};if(zr(A,"handleAndDispatchPointerDownOutsideEvent"),!l(E.target)){n.removeEventListener("click",g.current),m(),f.current=!1;return}const L={originalEvent:E};h.current=!0,a.current=r&&E.button===0,p.current.clear(),!r||E.button!==0?A():(n.removeEventListener("click",g.current),g.current=A,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),m();f.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of k)n.addEventListener(E,y,!0),n.addEventListener(E,b);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",S),n.removeEventListener("click",g.current);for(const E of k)n.removeEventListener(E,y,!0),n.removeEventListener(E,b)}},[n,u,r,a,i,l]),{onPointerDownCapture:zr(()=>f.current=!0,"onPointerDownCapture")}}zr(Ej,"usePointerDownOutside");function Cj(e,t=globalThis==null?void 0:globalThis.document){const n=Sr(e),r=s.useRef(!1);return s.useEffect(()=>{const a=zr(i=>{i.target&&!r.current&&Yv(I_,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:zr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:zr(()=>r.current=!1,"onBlurCapture")}}zr(Cj,"useFocusOutside");function G6(){const e=new CustomEvent(K6);document.dispatchEvent(e)}zr(G6,"dispatchUpdate");function Yv(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?Kv(a,i):a.dispatchEvent(i)}zr(Yv,"handleAndDispatchCustomEvent");var __=Object.defineProperty,Er=(e,t)=>__(e,"name",{value:t,configurable:!0}),w8="focusScope.autoFocusOnMount",y8="focusScope.autoFocusOnUnmount",h5={bubbles:!1,cancelable:!0},Ld=s.forwardRef(Er(function(t,n){const{loop:r=!1,trapped:a=!1,branches:i,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[h,p]=s.useState(null),g=Sr(l),m=Sr(u),w=s.useRef(null),y=cn(n,p),b=s.useRef(i);s.useEffect(()=>{b.current=i});const S=s.useCallback(E=>{var A;return E?h!=null&&h.contains(E)?!0:!!((A=b.current)!=null&&A.some(L=>L.contains(E))):!1},[h]),k=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let E=function(N){if(k.paused||!h)return;const j=N.target;S(j)?w.current=j:ei(w.current,{select:!0})},A=function(N){if(k.paused||!h)return;const j=N.relatedTarget;j!==null&&(S(j)||ei(w.current,{select:!0}))},L=function(N){if(document.activeElement===document.body)for(const P of N)P.removedNodes.length>0&&ei(h)};Er(E,"handleFocusIn"),Er(A,"handleFocusOut"),Er(L,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",A);const $=new MutationObserver(L);return h&&$.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",A),$.disconnect()}}},[a,h,k.paused,S]),s.useEffect(()=>{if(h){p5.add(k);const E=document.activeElement;if(!h.contains(E)){const L=new CustomEvent(w8,h5);h.addEventListener(w8,g),h.dispatchEvent(L),L.defaultPrevented||(Aj(Lj(qv(h)),{select:!0}),document.activeElement===E&&ei(h))}return()=>{h.removeEventListener(w8,g);const L=h.ownerDocument,$=CustomEvent;setTimeout(()=>{const N=new $(y8,h5);h.addEventListener(y8,m),h.dispatchEvent(N),N.defaultPrevented||ei(E??L.body,{select:!0}),h.removeEventListener(y8,m),p5.remove(k)},0)}}},[h,g,m,k]);const C=s.useCallback(E=>{if(!r&&!a||k.paused)return;const A=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,L=document.activeElement;if(A&&L){const $=E.currentTarget,[N,j]=Nj($);N&&j?!E.shiftKey&&L===j?(E.preventDefault(),r&&ei(N,{select:!0})):E.shiftKey&&L===N&&(E.preventDefault(),r&&ei(j,{select:!0})):L===$&&E.preventDefault()}},[r,a,k.paused]);return o.jsx(pn.div,{tabIndex:-1,...f,ref:y,onKeyDown:C})},"FocusScope")),jj=s.createContext(null);function Am({registry:e,children:t}){return e?o.jsx(jj.Provider,{value:e,children:t}):t}Er(Am,"FocusScopeBranchProvider");function Nm(){const[e,t]=s.useState([]),n=s.useMemo(()=>({add:Er(r=>t(a=>a.includes(r)?a:[...a,r]),"add"),remove:Er(r=>t(a=>a.filter(i=>i!==r)),"remove")}),[]);return{nodes:e,registry:n}}Er(Nm,"useFocusScopeBranchRegistry");function Mm(e){const t=s.useContext(jj);s.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}Er(Mm,"useFocusScopeBranch");function Aj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ei(r,{select:t}),document.activeElement!==n)return}Er(Aj,"focusFirst");function Nj(e){const t=qv(e),n=Y6(t,e),r=Y6(t.reverse(),e);return[n,r]}Er(Nj,"getTabbableEdges");function qv(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Er(a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}Er(qv,"getTabbableCandidates");function Y6(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Mj(r,{upTo:t})))return r}Er(Y6,"findVisible");function Mj(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}Er(Mj,"isHidden");function Rj(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Er(Rj,"isSelectableInput");function ei(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&Rj(e)&&t&&e.select()}}Er(ei,"focus");var p5=Pj();function Pj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=q6(e,t),e.unshift(t)},remove(t){var n;e=q6(e,t),(n=e[0])==null||n.resume()}}}Er(Pj,"createFocusScopesStack");function q6(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Er(q6,"arrayRemove");function Lj(e){return e.filter(t=>t.tagName!=="A")}Er(Lj,"removeLinks");var V_=Object.defineProperty,Z_=(e,t)=>V_(e,"name",{value:t,configurable:!0}),I1=s.forwardRef(Z_(function(t,n){var f;const{container:r,...a}=t,[i,l]=s.useState(!1);mr(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Ur.createPortal(o.jsx(pn.div,{...a,ref:n}),u):null},"Portal")),z_=Object.defineProperty,Xv=(e,t)=>z_(e,"name",{value:t,configurable:!0}),jh=0,bo=null;function B_(e){return Td(),e.children}Xv(B_,"FocusGuards");function Td(){s.useEffect(()=>{bo||(bo={start:X6(),end:X6()});const{start:e,end:t}=bo;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),jh++,()=>{jh===1&&(bo==null||bo.start.remove(),bo==null||bo.end.remove(),bo=null),jh=Math.max(0,jh-1)}},[])}Xv(Td,"useFocusGuards");function X6(){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}Xv(X6,"createFocusGuard");var Eo=function(){return Eo=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},Eo.apply(this,arguments)};function Tj(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 U_(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 ap="right-scroll-bar-position",op="width-before-scroll-bar",W_="with-scroll-bars-hidden",K_="--removed-body-scroll-bar-size";function b8(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function G_(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 Y_=typeof window<"u"?s.useLayoutEffect:s.useEffect,m5=new WeakMap;function q_(e,t){var n=G_(null,function(r){return e.forEach(function(a){return b8(a,r)})});return Y_(function(){var r=m5.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(u){i.has(u)||b8(u,null)}),i.forEach(function(u){a.has(u)||b8(u,l)})}m5.set(n,e)},[e]),n}function X_(e){return e}function Q_(e,t){t===void 0&&(t=X_);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 J_(e){e===void 0&&(e={});var t=Q_(null);return t.options=Eo({async:!0,ssr:!1},e),t}var $j=function(e){var t=e.sideCar,n=Tj(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,Eo({},n))};$j.isSideCarExport=!0;function eV(e,t){return e.useMedium(t),$j}var Dj=J_(),x8=function(){},Rm=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:x8,onWheelCapture:x8,onTouchMoveCapture:x8}),a=r[0],i=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,m=e.sideCar,w=e.noRelative,y=e.noIsolation,b=e.inert,S=e.allowPinchZoom,k=e.as,C=k===void 0?"div":k,E=e.gapMode,A=Tj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=m,$=q_([n,t]),N=Eo(Eo({},A),a);return s.createElement(s.Fragment,null,p&&s.createElement(L,{sideCar:Dj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:y,inert:b,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:E}),l?s.cloneElement(s.Children.only(u),Eo(Eo({},N),{ref:$})):s.createElement(C,Eo({},N,{className:f,ref:$}),u))});Rm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rm.classNames={fullWidth:op,zeroRight:ap};var tV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tV();return t&&e.setAttribute("nonce",t),e}function rV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nV())&&(rV(t,n),sV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oV=function(){var e=aV();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hj=function(){var e=oV(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},iV={left:0,top:0,right:0,gap:0},k8=function(e){return parseInt(e||"",10)||0},lV=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[k8(n),k8(r),k8(a)]},cV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iV;var t=lV(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])}},uV=Hj(),td="data-scroll-locked",dV=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(W_,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(td,`] {
|
|
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(ap,` {
|
|
71
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(op,` {
|
|
75
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(ap," .").concat(ap,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(op," .").concat(op,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(td,`] {
|
|
87
|
+
`).concat(K_,": ").concat(u,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},g5=function(){var e=parseInt(document.body.getAttribute(td)||"0",10);return isFinite(e)?e:0},fV=function(){s.useEffect(function(){return document.body.setAttribute(td,(g5()+1).toString()),function(){var e=g5()-1;e<=0?document.body.removeAttribute(td):document.body.setAttribute(td,e.toString())}},[])},hV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;fV();var i=s.useMemo(function(){return cV(a)},[a]);return s.createElement(uV,{styles:dV(i,!t,a,n?"":"!important")})},Q6=!1;if(typeof window<"u")try{var Ah=Object.defineProperty({},"passive",{get:function(){return Q6=!0,!0}});window.addEventListener("test",Ah,Ah),window.removeEventListener("test",Ah,Ah)}catch{Q6=!1}var Au=Q6?{passive:!1}:!1,pV=function(e){return e.tagName==="TEXTAREA"},Oj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pV(e)&&n[t]==="visible")},mV=function(e){return Oj(e,"overflowY")},gV=function(e){return Oj(e,"overflowX")},v5=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Ij(e,r);if(a){var i=Fj(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ij=function(e,t){return e==="v"?mV(t):gV(t)},Fj=function(e,t){return e==="v"?vV(t):wV(t)},yV=function(e,t){return e==="h"&&t==="rtl"?-1:1},bV=function(e,t,n,r,a){var i=yV(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,f=t.contains(u),h=!1,p=l>0,g=0,m=0;do{if(!u)break;var w=Fj(e,u),y=w[0],b=w[1],S=w[2],k=b-S-i*y;(y||k)&&Ij(e,u)&&(g+=k,m+=y);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(m)<1)&&(h=!0),h},Nh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},w5=function(e){return[e.deltaX,e.deltaY]},y5=function(e){return e&&"current"in e?e.current:e},xV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kV=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},SV=0,Nu=[];function EV(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),a=s.useState(SV++)[0],i=s.useState(Hj)[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 b=U_([e.lockRef.current],(e.shards||[]).map(y5),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(b,S){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Nh(b),C=n.current,E="deltaX"in b?b.deltaX:C[0]-k[0],A="deltaY"in b?b.deltaY:C[1]-k[1],L,$=b.target,N=Math.abs(E)>Math.abs(A)?"h":"v";if("touches"in b&&N==="h"&&$.type==="range")return!1;var j=window.getSelection(),P=j&&j.anchorNode,R=P?P===$||P.contains($):!1;if(R)return!1;var H=v5(N,$);if(!H)return!0;if(H?L=N:(L=N==="v"?"h":"v",H=v5(N,$)),!H)return!1;if(!r.current&&"changedTouches"in b&&(E||A)&&(r.current=L),!L)return!0;var D=r.current||L;return bV(D,S,b,D==="h"?E:A)},[]),f=s.useCallback(function(b){var S=b;if(!(!Nu.length||Nu[Nu.length-1]!==i)){var k="deltaY"in S?w5(S):Nh(S),C=t.current.filter(function(L){return L.name===S.type&&(L.target===S.target||S.target===L.shadowParent)&&xV(L.delta,k)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var E=(l.current.shards||[]).map(y5).filter(Boolean).filter(function(L){return L.contains(S.target)}),A=E.length>0?u(S,E[0]):!l.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),h=s.useCallback(function(b,S,k,C){var E={name:b,delta:S,target:k,should:C,shadowParent:CV(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(A){return A!==E})},1)},[]),p=s.useCallback(function(b){n.current=Nh(b),r.current=void 0},[]),g=s.useCallback(function(b){h(b.type,w5(b),b.target,u(b,e.lockRef.current))},[]),m=s.useCallback(function(b){h(b.type,Nh(b),b.target,u(b,e.lockRef.current))},[]);s.useEffect(function(){return Nu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Au),document.addEventListener("touchmove",f,Au),document.addEventListener("touchstart",p,Au),function(){Nu=Nu.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,Au),document.removeEventListener("touchmove",f,Au),document.removeEventListener("touchstart",p,Au)}},[]);var w=e.removeScrollBar,y=e.inert;return s.createElement(s.Fragment,null,y?s.createElement(i,{styles:kV(a)}):null,w?s.createElement(hV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function CV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jV=eV(Dj,EV);var F1=s.forwardRef(function(e,t){return s.createElement(Rm,Eo({},e,{ref:t,sideCar:jV}))});F1.classNames=Rm.classNames;var AV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mu=new WeakMap,Mh=new WeakMap,Rh={},S8=0,_j=function(e){return e&&(e.host||_j(e.parentNode))},NV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_j(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})},MV=function(e,t,n,r){var a=NV(t,Array.isArray(e)?e:[e]);Rh[n]||(Rh[n]=new WeakMap);var i=Rh[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(m){if(u.has(m))p(m);else try{var w=m.getAttribute(r),y=w!==null&&w!=="false",b=(Mu.get(m)||0)+1,S=(i.get(m)||0)+1;Mu.set(m,b),i.set(m,S),l.push(m),b===1&&y&&Mh.set(m,!0),S===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",m,k)}})};return p(t),u.clear(),S8++,function(){l.forEach(function(g){var m=Mu.get(g)-1,w=i.get(g)-1;Mu.set(g,m),i.set(g,w),m||(Mh.has(g)||g.removeAttribute(r),Mh.delete(g)),w||g.removeAttribute(n)}),S8--,S8||(Mu=new WeakMap,Mu=new WeakMap,Mh=new WeakMap,Rh={})}},Pm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=AV(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),MV(r,a,n,"aria-hidden")):function(){return null}},RV=Object.defineProperty,Bs=(e,t)=>RV(e,"name",{value:t,configurable:!0}),Qv="Dialog",[Vj,Zj]=zs(Qv),[PV,oo]=Vj(Qv),Ll=Bs(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=s.useRef(null),f=s.useRef(null),{nodes:h,registry:p}=Nm(),[g,m]=yi({prop:r,defaultProp:a??!1,onChange:i,caller:Qv}),[w,y]=s.useState(0),[b,S]=s.useState(0);return o.jsx(PV,{scope:t,triggerRef:u,contentRef:f,contentId:Fs(),titleId:Fs(),descriptionId:Fs(),titlePresent:w>0,descriptionPresent:b>0,setTitleCount:y,setDescriptionCount:S,open:g,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(k=>!k),[m]),modal:l,branchNodes:h,branchRegistry:p,children:n})},"Dialog"),LV="DialogTrigger",Jv=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(LV,r),l=cn(n,i.triggerRef);return o.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Lm(i.open),...a,ref:l,onClick:Mt(t.onClick,i.onOpenToggle)})},"DialogTrigger")),zj="DialogPortal",[TV,Bj]=Vj(zj,{forceMount:void 0}),Tl=Bs(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=oo(zj,t);return o.jsx(TV,{scope:t,forceMount:n,children:s.Children.map(r,l=>o.jsx(ps,{present:n||i.open,children:o.jsx(I1,{asChild:!0,container:a,children:l})}))})},"DialogPortal"),J6="DialogOverlay",$l=s.forwardRef(Bs(function(t,n){const r=Bj(J6,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=oo(J6,t.__scopeDialog);return l.modal?o.jsx(ps,{present:a||l.open,children:o.jsx(DV,{...i,ref:n})}):null},"DialogOverlay")),$V=no("DialogOverlay.RemoveScroll"),DV=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(J6,r),l=Sj(),u=cn(n,l);return o.jsx(F1,{as:$V,allowPinchZoom:!0,shards:s.useMemo(()=>[i.contentRef,...i.branchNodes.map(f=>({current:f}))],[i.contentRef,i.branchNodes]),children:o.jsx(pn.div,{"data-state":Lm(i.open),...a,ref:u,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),o1="DialogContent",Dl=s.forwardRef(Bs(function(t,n){const r=Bj(o1,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=oo(o1,t.__scopeDialog);return o.jsx(ps,{present:a||l.open,children:l.modal?o.jsx(HV,{...i,ref:n}):o.jsx(OV,{...i,ref:n})})},"DialogContent")),HV=s.forwardRef(Bs(function(t,n){const r=oo(o1,t.__scopeDialog),a=s.useRef(null),i=cn(n,r.contentRef,a);return s.useEffect(()=>{const l=a.current;if(l)return Pm(l)},[]),o.jsx(Uj,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Mt(t.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Mt(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:Mt(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),OV=s.forwardRef(Bs(function(t,n){const r=oo(o1,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(Uj,{...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")),Uj=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,"aria-describedby":u,children:f,...h}=t,p=oo(o1,r);return Td(),o.jsx(Am,{registry:p.branchRegistry,children:o.jsx(Ld,{asChild:!0,loop:!0,trapped:a,branches:p.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(O1,{role:"dialog",id:p.contentId,"aria-labelledby":p.titlePresent?p.titleId:void 0,"aria-describedby":p.descriptionPresent?Wj(u,p.descriptionId):u,"data-state":Lm(p.open),...h,ref:n,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1),children:f})})})},"DialogContentImpl")),Hl=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,...a}=t,i=oo("DialogTitle",r),{setTitleCount:l}=i;return mr(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(pn.h2,{id:i.titleId,...a,ref:n})},"DialogTitle")),ew=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,...a}=t,i=oo("DialogDescription",r),{setDescriptionCount:l}=i;return mr(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(pn.p,{id:i.descriptionId,...a,ref:n})},"DialogDescription")),IV="DialogClose",_1=s.forwardRef(Bs(function(t,n){const{__scopeDialog:r,...a}=t,i=oo(IV,r);return o.jsx(pn.button,{type:"button",...a,ref:n,onClick:Mt(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function Wj(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Bs(Wj,"concatAriaDescribedby");function Lm(e){return e?"open":"closed"}Bs(Lm,"getState");var FV=Object.defineProperty,Ni=(e,t)=>FV(e,"name",{value:t,configurable:!0}),_V="AlertDialog",[VV,Ide]=zs(_V,[Zj]),Mi=Zj(),ZV=Ni(e=>{const{__scopeAlertDialog:t,...n}=e,r=Mi(t);return o.jsx(Ll,{...r,...n,modal:!0})},"AlertDialog"),zV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Mi(r);return o.jsx(Jv,{...i,...a,ref:n})},"AlertDialogTrigger")),BV=Ni(e=>{const{__scopeAlertDialog:t,...n}=e,r=Mi(t);return o.jsx(Tl,{...r,...n})},"AlertDialogPortal"),UV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Mi(r);return o.jsx($l,{...i,...a,ref:n})},"AlertDialogOverlay")),WV="AlertDialogContent",[KV,GV]=VV(WV),YV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,children:a,...i}=t,l=Mi(r),u=s.useRef(null),f=cn(n,u),h=s.useRef(null);return o.jsx(KV,{scope:r,cancelRef:h,children:o.jsx(Dl,{role:"alertdialog",...l,...i,ref:f,onOpenAutoFocus:Mt(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")),qV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Mi(r);return o.jsx(Hl,{...i,...a,ref:n})},"AlertDialogTitle")),XV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Mi(r);return o.jsx(ew,{...i,...a,ref:n})},"AlertDialogDescription")),QV=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=Mi(r);return o.jsx(_1,{...i,...a,ref:n})},"AlertDialogAction")),JV="AlertDialogCancel",eZ=s.forwardRef(Ni(function(t,n){const{__scopeAlertDialog:r,...a}=t,{cancelRef:i}=GV(JV,r),l=Mi(r),u=cn(n,i);return o.jsx(_1,{...l,...a,ref:u})},"AlertDialogCancel")),tZ=Object.defineProperty,nZ=(e,t)=>tZ(e,"name",{value:t,configurable:!0});function Kj(e){const[t,n]=s.useState(void 0);return mr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let u,f;if("borderBoxSize"in l){const h=l.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,f=p.blockSize}else u=e.offsetWidth,f=e.offsetHeight;n({width:u,height:f})})});return a.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}else n(void 0)},[e]),t}nZ(Kj,"useSize");const rZ=["top","right","bottom","left"],Sl=Math.min,li=Math.max,kp=Math.round,Ph=Math.floor,ci=e=>({x:e,y:e}),sZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Gj(e,t,n){return li(e,Sl(t,n))}function xi(e,t){return typeof e=="function"?e(t):e}function El(e){return e.split("-")[0]}function $d(e){return e.split("-")[1]}function tw(e){return e==="x"?"y":"x"}function nw(e){return e==="y"?"height":"width"}function jo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function rw(e){return tw(jo(e))}function aZ(e,t,n){n===void 0&&(n=!1);const r=$d(e),a=rw(e),i=nw(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Sp(l)),[l,Sp(l)]}function oZ(e){const t=Sp(e);return[e4(e),t,e4(t)]}function e4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const b5=["left","right"],x5=["right","left"],iZ=["top","bottom"],lZ=["bottom","top"];function cZ(e,t,n){switch(e){case"top":case"bottom":return n?t?x5:b5:t?b5:x5;case"left":case"right":return t?iZ:lZ;default:return[]}}function uZ(e,t,n,r){const a=$d(e);let i=cZ(El(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(e4)))),i}function Sp(e){const t=El(e);return sZ[t]+e.slice(t.length)}function dZ(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 Yj(e){return typeof e!="number"?dZ(e):{top:e,right:e,bottom:e,left:e}}function Ep(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 k5(e,t,n){let{reference:r,floating:a}=e;const i=jo(t),l=rw(t),u=nw(l),f=El(t),h=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,m=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=$d(t);return y&&(w[l]+=m*(y==="end"?1:-1)*(n&&h?-1:1)),w}async function fZ(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:m=!1,padding:w=0}=xi(t,e),y=Yj(w),S=u[m?g==="floating"?"reference":"floating":g],k=Ep(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),C=g==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),A=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},L=Ep(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:E,strategy:f}):C);return{top:(k.top-L.top+y.top)/A.y,bottom:(L.bottom-k.bottom+y.bottom)/A.y,left:(k.left-L.left+y.left)/A.x,right:(L.right-k.right+y.right)/A.x}}const hZ=50,pZ=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:fZ},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}=k5(h,r,f),m=r,w=0;const y={};for(let b=0;b<i.length;b++){const S=i[b];if(!S)continue;const{name:k,fn:C}=S,{x:E,y:A,data:L,reset:$}=await C({x:p,y:g,initialPlacement:r,placement:m,strategy:a,middlewareData:y,rects:h,platform:u,elements:{reference:e,floating:t}});p=E??p,g=A??g,y[k]={...y[k],...L},$&&w<hZ&&(w++,typeof $=="object"&&($.placement&&(m=$.placement),$.rects&&(h=$.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):$.rects),{x:p,y:g}=k5(h,m,f)),b=-1)}return{x:p,y:g,placement:m,strategy:a,middlewareData:y}},mZ=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}=xi(e,t)||{};if(h==null)return{};const g=Yj(p),m={x:n,y:r},w=rw(a),y=nw(w),b=await l.getDimensions(h),S=w==="y",k=S?"top":"left",C=S?"bottom":"right",E=S?"clientHeight":"clientWidth",A=i.reference[y]+i.reference[w]-m[w]-i.floating[y],L=m[w]-i.reference[w],$=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let N=$?$[E]:0;(!N||!await(l.isElement==null?void 0:l.isElement($)))&&(N=u.floating[E]||i.floating[y]);const j=A/2-L/2,P=N/2-b[y]/2-1,R=Sl(g[k],P),H=Sl(g[C],P),D=N-b[y]-H,U=N/2-b[y]/2+j,_=Gj(R,U,D),B=!f.arrow&&$d(a)!=null&&U!==_&&i.reference[y]/2-(U<R?R:H)-b[y]/2<0,K=B?U<R?U-R:U-D:0;return{[w]:m[w]+K,data:{[w]:_,centerOffset:U-_-K,...B&&{alignmentOffset:K}},reset:B}}}),gZ=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:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...S}=xi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const k=El(a),C=jo(u),E=El(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(h.floating)),L=m||(E||!b?[Sp(u)]:oZ(u)),$=y!=="none";!m&&$&&L.push(...uZ(u,b,y,A));const N=[u,...L],j=await f.detectOverflow(t,S),P=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&P.push(j[k]),g){const _=aZ(a,l,A);P.push(j[_[0]],j[_[1]])}if(R=[...R,{placement:a,overflows:P}],!P.every(_=>_<=0)){var H,D;const _=(((H=i.flip)==null?void 0:H.index)||0)+1,B=N[_];if(B&&(!(g==="alignment"?C!==jo(B):!1)||R.every(O=>jo(O.placement)===C?O.overflows[0]>0:!0)))return{data:{index:_,overflows:R},reset:{placement:B}};let K=(D=R.filter(V=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!K)switch(w){case"bestFit":{var U;const V=(U=R.filter(O=>{if($){const I=jo(O.placement);return I===C||I==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(I=>I>0).reduce((I,Y)=>I+Y,0)]).sort((O,I)=>O[1]-I[1])[0])==null?void 0:U[0];V&&(K=V);break}case"initialPlacement":K=u;break}if(a!==K)return{reset:{placement:K}}}return{}}}};function S5(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function E5(e){return rZ.some(t=>e[t]>=0)}const vZ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=xi(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),u=S5(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:E5(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),u=S5(l,n.floating);return{data:{escapedOffsets:u,escaped:E5(u)}}}default:return{}}}}},qj=new Set(["left","top"]);async function wZ(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=El(n),u=$d(n),f=jo(n)==="y",h=qj.has(l)?-1:1,p=i&&f?-1:1,g=xi(t,e);let{mainAxis:m,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:m*h}:{x:m*h,y:w*p}}const yZ=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 wZ(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}}}}},bZ=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:C=>{let{x:E,y:A}=C;return{x:E,y:A}}},...h}=xi(e,t),p={x:n,y:r},g=await i.detectOverflow(t,h),m=jo(a),w=tw(m);let y=p[w],b=p[m];const S=(C,E)=>Gj(E+g[C==="y"?"top":"left"],E,E-g[C==="y"?"bottom":"right"]);l&&(y=S(w,y)),u&&(b=S(m,b));const k=f.fn({...t,[w]:y,[m]:b});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[w]:l,[m]:u}}}}}},xZ=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}=xi(e,t),m={x:a,y:i},w=jo(l),y=tw(w);let b=m[y],S=m[w];const k=xi(h,t),C=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(n=k.mainAxis)!=null?n:0,crossAxis:(r=k.crossAxis)!=null?r:0};if(p){const L=y==="y"?"height":"width",$=u.reference[y]-u.floating[L]+C.mainAxis,N=u.reference[y]+u.reference[L]-C.mainAxis;b<$?b=$:b>N&&(b=N)}if(g){var E,A;const L=y==="y"?"width":"height",$=qj.has(El(l)),N=u.reference[w]-u.floating[L]+($&&((E=f.offset)==null?void 0:E[w])||0)+($?0:C.crossAxis),j=u.reference[w]+u.reference[L]+($?0:((A=f.offset)==null?void 0:A[w])||0)-($?C.crossAxis:0);S<N?S=N:S>j&&(S=j)}return{[y]:b,[w]:S}}}},kZ=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}=xi(e,t),f=await a.detectOverflow(t,u),h=El(n),p=$d(n),g=jo(n)==="y",{width:m,height:w}=r.floating;let y,b;h==="top"||h==="bottom"?(y=h,b=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(b=h,y=p==="end"?"top":"bottom");const S=w-f.top-f.bottom,k=m-f.left-f.right,C=Sl(w-f[y],S),E=Sl(m-f[b],k),A=t.middlewareData.shift,L=!A;let $=C,N=E;A!=null&&A.enabled.x&&(N=k),A!=null&&A.enabled.y&&($=S),L&&!p&&(g?N=m-2*li(f.left,f.right):$=w-2*li(f.top,f.bottom)),await l({...t,availableWidth:N,availableHeight:$});const j=await a.getDimensions(i.floating);return m!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}};function Tm(){return typeof window<"u"}function Dd(e){return Xj(e)?(e.nodeName||"").toLowerCase():"#document"}function _s(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ri(e){var t;return(t=(Xj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xj(e){return Tm()?e instanceof Node||e instanceof _s(e).Node:!1}function To(e){return Tm()?e instanceof Element||e instanceof _s(e).Element:!1}function Ol(e){return Tm()?e instanceof HTMLElement||e instanceof _s(e).HTMLElement:!1}function C5(e){return!Tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _s(e).ShadowRoot}function $m(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function SZ(e){return/^(table|td|th)$/.test(Dd(e))}function Dm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const EZ=/transform|translate|scale|rotate|perspective|filter/,CZ=/paint|layout|strict|content/,ic=e=>!!e&&e!=="none";let E8;function sw(e){const t=To(e)?$o(e):e;return ic(t.transform)||ic(t.translate)||ic(t.scale)||ic(t.rotate)||ic(t.perspective)||!aw()&&(ic(t.backdropFilter)||ic(t.filter))||EZ.test(t.willChange||"")||CZ.test(t.contain||"")}function jZ(e){let t=Rc(e);for(;Ol(t)&&!i1(t);){if(sw(t))return t;if(Dm(t))return null;t=Rc(t)}return null}function aw(){return E8==null&&(E8=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),E8}function i1(e){return/^(html|body|#document)$/.test(Dd(e))}function $o(e){return _s(e).getComputedStyle(e)}function Hm(e){return To(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rc(e){if(Dd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||C5(e)&&e.host||Ri(e);return C5(t)?t.host:t}function Qj(e){const t=Rc(e);return i1(t)?(e.ownerDocument||e).body:Ol(t)&&$m(t)?t:Qj(t)}function l1(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Qj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=_s(a);if(i){const u=t4(l);return t.concat(l,l.visualViewport||[],$m(a)?a:[],u&&n?l1(u):[])}else return t.concat(a,l1(a,[],n))}function t4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jj(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ol(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=kp(n)!==i||kp(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function ow(e){return To(e)?e:e.contextElement}function nd(e){const t=ow(e);if(!Ol(t))return ci(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Jj(t);let l=(i?kp(n.width):n.width)/r,u=(i?kp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const AZ=ci(0);function eA(e){const t=_s(e);return!aw()||!t.visualViewport?AZ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NZ(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===_s(e)}function Pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=ow(e);let l=ci(1);t&&(r?To(r)&&(l=nd(r)):l=nd(e));const u=NZ(i,n,r)?eA(i):ci(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 m=_s(i),w=To(r)?_s(r):r;let y=m,b=t4(y);for(;b&&w!==y;){const S=nd(b),k=b.getBoundingClientRect(),C=$o(b),E=k.left+(b.clientLeft+parseFloat(C.paddingLeft))*S.x,A=k.top+(b.clientTop+parseFloat(C.paddingTop))*S.y;f*=S.x,h*=S.y,p*=S.x,g*=S.y,f+=E,h+=A,y=_s(b),b=t4(y)}}return Ep({width:p,height:g,x:f,y:h})}function Om(e,t){const n=Hm(e).scrollLeft;return t?t.left+n:Pc(Ri(e)).left+n}function tA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Om(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function MZ(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Ri(r),u=t?Dm(t.floating):!1;if(r===l||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=ci(1);const p=ci(0),g=Ol(r);if((g||!i)&&((Dd(r)!=="body"||$m(l))&&(f=Hm(r)),g)){const w=Pc(r);h=nd(r),p.x=w.x+r.clientLeft,p.y=w.y+r.clientTop}const m=l&&!g&&!i?tA(l,f):ci(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+m.x,y:n.y*h.y-f.scrollTop*h.y+p.y+m.y}}function RZ(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function PZ(e){const t=Hm(e),n=e.ownerDocument.body,r=li(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=li(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Om(e);const l=-t.scrollTop;return $o(n).direction==="rtl"&&(i+=li(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:l}}const LZ=25;function TZ(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=_s(e),i=Ri(e),l=a.visualViewport;let u=i.clientWidth,f=i.clientHeight,h=0,p=0;if(l){const m=!aw()||t==="fixed";r?m||(h=-l.offsetLeft,p=-l.offsetTop):(u=l.width,f=l.height,m&&(h=l.offsetLeft,p=l.offsetTop))}if(Om(i)<=0){const m=i.ownerDocument,w=m.body,y=getComputedStyle(w),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(i.clientWidth-w.clientWidth-b),k=getComputedStyle(i).scrollbarGutter==="stable both-edges"?S/2:S;k<=LZ&&(u-=k)}return{width:u,height:f,x:h,y:p}}function $Z(e,t){const n=Pc(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=nd(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 j5(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=TZ(e,n,t);else if(t==="document")r=PZ(Ri(e));else if(To(t))r=$Z(t,n);else{const a=eA(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ep(r)}function DZ(e,t){const n=t.get(e);if(n)return n;let r=l1(e,[],!1).filter(u=>To(u)&&Dd(u)!=="body"),a=null;const i=$o(e).position==="fixed";let l=i?Rc(e):e;for(;To(l)&&!i1(l);){const u=$o(l),f=sw(l),h=a?a.position:i?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(g=>g!==l):a=u,l=Rc(l)}return t.set(e,r),r}function HZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Dm(t)?[]:DZ(t,this._c):[].concat(n),r],u=j5(t,l[0],a);let f=u.top,h=u.right,p=u.bottom,g=u.left;for(let m=1;m<l.length;m++){const w=j5(t,l[m],a);f=li(w.top,f),h=Sl(w.right,h),p=Sl(w.bottom,p),g=li(w.left,g)}return{width:h-g,height:p-f,x:g,y:f}}function OZ(e){const{width:t,height:n}=Jj(e);return{width:t,height:n}}function IZ(e,t,n){const r=Ol(t),a=Ri(t),i=n==="fixed",l=Pc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=ci(0);if((r||!i)&&((Dd(t)!=="body"||$m(a))&&(u=Hm(t)),r)){const m=Pc(t,!0,i,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}!r&&a&&(f.x=Om(a));const h=a&&!r&&!i?tA(a,u):ci(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 C8(e){return $o(e).position==="static"}function A5(e,t){if(!Ol(e)||$o(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ri(e)===n&&(n=n.ownerDocument.body),n}function nA(e,t){const n=_s(e);if(Dm(e))return n;if(!Ol(e)){let a=Rc(e);for(;a&&!i1(a);){if(To(a)&&!C8(a))return a;a=Rc(a)}return n}let r=A5(e,t);for(;r&&SZ(r)&&C8(r);)r=A5(r,t);return r&&i1(r)&&C8(r)&&!sw(r)?n:r||jZ(e)||n}const FZ=async function(e){const t=this.getOffsetParent||nA,n=this.getDimensions,r=await n(e.floating);return{reference:IZ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _Z(e){return $o(e).direction==="rtl"}const VZ={convertOffsetParentRelativeRectToViewportRelativeRect:MZ,getDocumentElement:Ri,getClippingRect:HZ,getOffsetParent:nA,getElementRects:FZ,getClientRects:RZ,getDimensions:OZ,getScale:nd,isElement:To,isRTL:_Z};function rA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZZ(e,t,n){let r=null,a;const i=Ri(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 m=e.getBoundingClientRect(),{left:w,top:y,width:b,height:S}=m;if(p||t(),!b||!S)return;const k=Ph(y),C=Ph(i.clientWidth-(w+b)),E=Ph(i.clientHeight-(y+S)),A=Ph(w),$={rootMargin:-k+"px "+-C+"px "+-E+"px "+-A+"px",threshold:li(0,Sl(1,g))||1};let N=!0;function j(P){const R=P[0].intersectionRatio;if(!rA(m,e.getBoundingClientRect()))return u();if(R!==g){if(!N)return u();R?u(!1,R):a=setTimeout(()=>{u(!1,1e-7)},1e3)}N=!1}try{r=new IntersectionObserver(j,{...$,root:i.ownerDocument})}catch{r=new IntersectionObserver(j,$)}r.observe(e)}const f=_s(e),h=()=>u(n);return f.addEventListener("resize",h),u(!0),()=>{f.removeEventListener("resize",h),l()}}function sA(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=ow(e),p=a||i?[...h?l1(h):[],...t?l1(t):[]]:[];p.forEach(k=>{a&&k.addEventListener("scroll",n),i&&k.addEventListener("resize",n)});const g=h&&u?ZZ(h,n,i):null;let m=-1,w=null;l&&(w=new ResizeObserver(k=>{let[C]=k;C&&C.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=w)==null||E.observe(t)})),n()}),h&&!f&&w.observe(h),t&&w.observe(t));let y,b=f?Pc(e):null;f&&S();function S(){const k=Pc(e);b&&!rA(b,k)&&n(),b=k,y=requestAnimationFrame(S)}return n(),()=>{var k;p.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),g==null||g(),(k=w)==null||k.disconnect(),w=null,f&&cancelAnimationFrame(y)}}const aA=yZ,oA=bZ,iA=gZ,zZ=kZ,BZ=vZ,n4=mZ,UZ=xZ,lA=(e,t,n)=>{const r=new Map,a=n??{},i={...VZ,...a.platform,_c:r};return pZ(e,t,{...a,platform:i})};var WZ=typeof document<"u",KZ=function(){},ip=WZ?s.useLayoutEffect:KZ;function Cp(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(!Cp(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)&&!Cp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function cA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N5(e,t){const n=cA(e);return Math.round(t*n)/n}function j8(e){const t=s.useRef(e);return ip(()=>{t.current=e}),t}function GZ(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}),[m,w]=s.useState(r);Cp(m,r)||w(r);const[y,b]=s.useState(null),[S,k]=s.useState(null),C=s.useCallback(O=>{O!==$.current&&($.current=O,b(O))},[]),E=s.useCallback(O=>{O!==N.current&&(N.current=O,k(O))},[]),A=i||y,L=l||S,$=s.useRef(null),N=s.useRef(null),j=s.useRef(p),P=f!=null,R=j8(f),H=j8(a),D=j8(h),U=s.useCallback(()=>{if(!$.current||!N.current)return;const O={placement:t,strategy:n,middleware:m};H.current&&(O.platform=H.current),lA($.current,N.current,O).then(I=>{const Y={...I,isPositioned:D.current!==!1};_.current&&!Cp(j.current,Y)&&(j.current=Y,Ur.flushSync(()=>{g(Y)}))})},[m,t,n,H,D]);ip(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[h]);const _=s.useRef(!1);ip(()=>(_.current=!0,()=>{_.current=!1}),[]),ip(()=>{if(A&&($.current=A),L&&(N.current=L),A&&L){if(R.current)return R.current(A,L,U);U()}},[A,L,U,R,P]);const B=s.useMemo(()=>({reference:$,floating:N,setReference:C,setFloating:E}),[C,E]),K=s.useMemo(()=>({reference:A,floating:L}),[A,L]),V=s.useMemo(()=>{const O={position:n,left:0,top:0};if(!K.floating)return O;const I=N5(K.floating,p.x),Y=N5(K.floating,p.y);return u?{...O,transform:"translate("+I+"px, "+Y+"px)",...cA(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:Y}},[n,u,K.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:U,refs:B,elements:K,floatingStyles:V}),[p,U,B,K,V])}const YZ=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?n4({element:r.current,padding:a}).fn(n):{}:r?n4({element:r,padding:a}).fn(n):{}}}},qZ=(e,t)=>{const n=aA(e);return{name:n.name,fn:n.fn,options:[e,t]}},XZ=(e,t)=>{const n=oA(e);return{name:n.name,fn:n.fn,options:[e,t]}},QZ=(e,t)=>({fn:UZ(e).fn,options:[e,t]}),JZ=(e,t)=>{const n=iA(e);return{name:n.name,fn:n.fn,options:[e,t]}},ez=(e,t)=>{const n=zZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},tz=(e,t)=>{const n=BZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},nz=(e,t)=>{const n=YZ(e);return{name:n.name,fn:n.fn,options:[e,t]}};var rz=Object.defineProperty,sz=(e,t)=>rz(e,"name",{value:t,configurable:!0}),az=s.forwardRef(sz(function(t,n){const{children:r,width:a=10,height:i=5,...l}=t;return o.jsx(pn.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")),oz=Object.defineProperty,ui=(e,t)=>oz(e,"name",{value:t,configurable:!0}),M5={Partial:"partial"},R5={Optimized:"optimized",Always:"always"},uA="Popper",[dA,Il]=zs(uA),[iz,fA]=dA(uA),Im=ui(e=>{const{__scopePopper:t,children:n}=e,[r,a]=s.useState(null),[i,l]=s.useState(void 0);return o.jsx(iz,{scope:t,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:l,children:n})},"Popper"),lz="PopperAnchor",V1=s.forwardRef(ui(function(t,n){const{__scopePopper:r,virtualRef:a,...i}=t,l=fA(lz,r),u=s.useRef(null),f=l.onAnchorChange,h=s.useCallback(b=>{u.current=b,b&&f(b)},[f]),p=cn(n,h),g=s.useRef(null);s.useEffect(()=>{if(!a)return;const b=g.current;g.current=a.current,b!==g.current&&f(g.current)});const m=l.placementState&&_m(l.placementState),w=m==null?void 0:m[0],y=m==null?void 0:m[1];return a?null:o.jsx(pn.div,{"data-radix-popper-side":w,"data-radix-popper-align":y,...i,ref:p})},"PopperAnchor")),hA="PopperContent",[cz,uz]=dA(hA),Fm=s.forwardRef(ui(function(t,n){var ee,q,ie,Oe,ae,pe,Te;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:m=M5.Partial,hideWhenDetached:w=!1,updatePositionStrategy:y=R5.Optimized,onPlaced:b,...S}=t,k=fA(hA,r),[C,E]=s.useState(null),A=cn(n,E),[L,$]=s.useState(null),N=Kj(L),j=(N==null?void 0:N.width)??0,P=(N==null?void 0:N.height)??0,R=a+(l!=="center"?"-"+l:""),H=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},D=Array.isArray(p)?p:[p],U=D.length>0,_={padding:H,boundary:D.filter(pA),altBoundary:U},{refs:B,floatingStyles:K,placement:V,isPositioned:O,middlewareData:I}=GZ({strategy:"fixed",placement:R,whileElementsMounted:ui((...gt)=>sA(...gt,{animationFrame:y===R5.Always}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[qZ({mainAxis:i+P,alignmentAxis:u}),h&&XZ({mainAxis:!0,crossAxis:!1,...m===M5.Partial?{limiter:QZ()}:{},..._}),h&&JZ({..._}),ez({..._,apply:ui(({elements:gt,rects:Ze,availableWidth:tt,availableHeight:De})=>{const{width:Se,height:Q}=Ze.reference,je=gt.floating.style;je.setProperty("--radix-popper-available-width",`${tt}px`),je.setProperty("--radix-popper-available-height",`${De}px`),je.setProperty("--radix-popper-anchor-width",`${Se}px`),je.setProperty("--radix-popper-anchor-height",`${Q}px`)},"apply")}),L&&nz({element:L,padding:f}),pz({arrowWidth:j,arrowHeight:P}),w&&tz(U?{strategy:"referenceHidden",..._}:{strategy:"referenceHidden",padding:_.padding,altBoundary:_.altBoundary})]}),Y=k.setPlacementState;mr(()=>(Y(V),()=>{Y(void 0)}),[V,Y]);const[Z,X]=_m(V),z=Sr(b);mr(()=>{O&&(z==null||z())},[O,z]);const J=(ee=I.arrow)==null?void 0:ee.x,he=(q=I.arrow)==null?void 0:q.y,te=((ie=I.arrow)==null?void 0:ie.centerOffset)!==0,[me,re]=s.useState();return mr(()=>{C&&re(window.getComputedStyle(C).zIndex)},[C]),o.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:O?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(Oe=I.transformOrigin)==null?void 0:Oe.x,(ae=I.transformOrigin)==null?void 0:ae.y].join(" "),...((pe=I.hide)==null?void 0:pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(cz,{scope:r,placedSide:Z,placedAlign:X,onArrowChange:$,arrowX:J,arrowY:he,shouldHideArrow:te,children:o.jsx(pn.div,{"data-side":Z,"data-align":X,...S,ref:A,style:{...S.style,animation:O?(Te=S.style)==null?void 0:Te.animation:"none"}})})})},"PopperContent")),dz="PopperArrow",fz={top:"bottom",right:"left",bottom:"top",left:"right"},hz=s.forwardRef(ui(function(t,n){const{__scopePopper:r,...a}=t,i=uz(dz,r),l=fz[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(az,{...a,ref:n,style:{...a.style,display:"block"}})})},"PopperArrow"));function pA(e){return e!==null}ui(pA,"isNotNull");var pz=ui(e=>({name:"transformOrigin",options:e,fn(t){var S,k,C;const{placement:n,rects:r,middlewareData:a}=t,l=((S=a.arrow)==null?void 0:S.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[h,p]=_m(n),g={start:"0%",center:"50%",end:"100%"}[p],m=(((k=a.arrow)==null?void 0:k.x)??0)+u/2,w=(((C=a.arrow)==null?void 0:C.y)??0)+f/2;let y="",b="";return h==="bottom"?(y=l?g:`${m}px`,b=`${-f}px`):h==="top"?(y=l?g:`${m}px`,b=`${r.floating.height+f}px`):h==="right"?(y=`${-f}px`,b=l?g:`${w}px`):h==="left"&&(y=`${r.floating.width+f}px`,b=l?g:`${w}px`),{data:{x:y,y:b}}}}),"transformOrigin");function _m(e){const[t,n="center"]=e.split("-");return[t,n]}ui(_m,"getSideAndAlignFromPlacement");var mz=Object.defineProperty,iw=(e,t)=>mz(e,"name",{value:t,configurable:!0}),A8=!1;function mA(){const[e,t]=s.useState(A8);return s.useEffect(()=>{A8||(A8=!0,t(!0))},[]),e}iw(mA,"useIsHydrated");var gA=Nl[" useSyncExternalStore ".trim().toString()];function vA(){return()=>{}}iw(vA,"subscribe");function wA(){return gA(vA,()=>!0,()=>!1)}iw(wA,"useIsHydratedModern");var gz=typeof gA=="function"?wA:mA,vz=Object.defineProperty,Wc=(e,t)=>vz(e,"name",{value:t,configurable:!0}),N8="rovingFocusGroup.onEntryFocus",wz={bubbles:!1,cancelable:!0},Vm="RovingFocusGroup",[r4,yA,yz]=jm(Vm),[bz,bA]=zs(Vm,[yz]),P5={Vertical:"vertical",Horizontal:"horizontal"},xz={RTL:"rtl"},[kz,Sz]=bz(Vm),Ez=s.forwardRef(Wc(function(t,n){return o.jsx(r4.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(r4.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(Cz,{...t,ref:n})})})},"RovingFocusGroup")),Cz=s.forwardRef(Wc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...m}=t,w=s.useRef(null),y=cn(n,w),b=H1(l),[S,k]=yi({prop:u,defaultProp:f??null,onChange:h,caller:Vm}),[C,E]=s.useState(!1),A=Sr(p),L=yA(r),$=s.useRef(!1),[N,j]=s.useState(0);return s.useEffect(()=>{const P=w.current;if(P)return P.addEventListener(N8,A),()=>P.removeEventListener(N8,A)},[A]),o.jsx(kz,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:S,onItemFocus:s.useCallback(P=>k(P),[k]),onItemShiftTab:s.useCallback(()=>E(!0),[]),onFocusableItemAdd:s.useCallback(()=>j(P=>P+1),[]),onFocusableItemRemove:s.useCallback(()=>j(P=>P-1),[]),children:o.jsx(pn.div,{tabIndex:C||N===0?-1:0,"data-orientation":a,...m,ref:y,style:{outline:"none",...t.style},onMouseDown:Mt(t.onMouseDown,()=>{$.current=!0}),onFocus:Mt(t.onFocus,P=>{const R=!$.current;if(P.target===P.currentTarget&&R&&!C){const H=new CustomEvent(N8,wz);if(P.currentTarget.dispatchEvent(H),!H.defaultPrevented){const D=L().filter(V=>V.focusable),U=D.find(V=>V.active),_=D.find(V=>V.id===S),K=[U,_,...D].filter(Boolean).map(V=>V.ref.current);lw(K,g)}}$.current=!1}),onBlur:Mt(t.onBlur,()=>E(!1))})})},"RovingFocusGroupImpl")),jz="RovingFocusGroupItem",Az=s.forwardRef(Wc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:l,children:u,...f}=t,h=Fs(),p=l||h,g=Sz(jz,r),m=g.currentTabStopId===p,w=yA(r),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:S}=g,k=gz();return mr(()=>{if(!(!k||!a))return y(),()=>b()},[k,a,y,b]),s.useEffect(()=>{if(!(k||!a))return y(),()=>b()},[k,a,y,b]),o.jsx(r4.ItemSlot,{scope:r,id:p,focusable:a,active:i,children:o.jsx(pn.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:Mt(t.onMouseDown,C=>{a?g.onItemFocus(p):C.preventDefault()}),onFocus:Mt(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:Mt(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=kA(C,g.orientation,g.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let L=w().filter($=>$.focusable).map($=>$.ref.current);if(E==="last")L.reverse();else if(E==="prev"||E==="next"){E==="prev"&&L.reverse();const $=L.indexOf(C.currentTarget);L=g.loop?SA(L,$+1):L.slice($+1)}setTimeout(()=>lw(L))}}),children:typeof u=="function"?u({isCurrentTabStop:m,hasTabStop:S!=null}):u})})},"RovingFocusGroupItem")),Nz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xA(e,t){return t!==xz.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Wc(xA,"getDirectionAwareKey");function kA(e,t,n){const r=xA(e.key,n);if(!(t===P5.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===P5.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return Nz[r]}Wc(kA,"getFocusIntent");function lw(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Wc(lw,"focusFirst");function SA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Wc(SA,"wrapArray");var Mz=Object.defineProperty,Ln=(e,t)=>Mz(e,"name",{value:t,configurable:!0}),Rz={RTL:"rtl"},s4=["Enter"," "],Pz=["ArrowDown","PageUp","Home"],EA=["ArrowUp","PageDown","End"],Lz=[...Pz,...EA],Tz={ltr:[...s4,"ArrowRight"],rtl:[...s4,"ArrowLeft"]},$z={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zm="Menu",[c1,Dz,Hz]=jm(Zm),[Kc,zm]=zs(Zm,[Hz,Il,bA]),cw=Il(),CA=bA(),[Oz,Gc]=Kc(Zm),[Iz,Z1]=Kc(Zm),jA=Ln(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=cw(t),[f,h]=s.useState(null),p=s.useRef(!1),g=Sr(i),m=H1(a);return s.useEffect(()=>{const w=Ln(()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=Ln(()=>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=Ln(()=>g(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,g]),o.jsx(Im,{...u,children:o.jsx(Oz,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:h,children:o.jsx(Iz,{scope:t,onClose:s.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:m,modal:l,children:r})})})},"Menu"),uw=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t,i=cw(r);return o.jsx(V1,{...i,...a,ref:n})},"MenuAnchor")),AA="MenuPortal",[Fz,NA]=Kc(AA,{forceMount:void 0}),MA=Ln(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Gc(AA,t);return o.jsx(Fz,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(I1,{asChild:!0,container:a,children:r})})})},"MenuPortal"),Qa="MenuContent",[_z,dw]=Kc(Qa),RA=s.forwardRef(Ln(function(t,n){const r=NA(Qa,t.__scopeMenu),{forceMount:a=r.forceMount,...i}=t,l=Gc(Qa,t.__scopeMenu),u=Z1(Qa,t.__scopeMenu);return o.jsx(c1.Provider,{scope:t.__scopeMenu,children:o.jsx(ps,{present:a||l.open,children:o.jsx(c1.Slot,{scope:t.__scopeMenu,children:u.modal?o.jsx(Vz,{...i,ref:n}):o.jsx(Zz,{...i,ref:n})})})})},"MenuContent")),Vz=s.forwardRef(Ln(function(t,n){const r=Gc(Qa,t.__scopeMenu),a=s.useRef(null),i=cn(n,a);return s.useEffect(()=>{const l=a.current;if(l)return Pm(l)},[]),o.jsx(fw,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mt(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Zz=s.forwardRef(Ln(function(t,n){const r=Gc(Qa,t.__scopeMenu);return o.jsx(fw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),zz=no("MenuContent.ScrollLock"),fw=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,loop:a=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:w,onDismiss:y,disableOutsideScroll:b,...S}=t,k=Gc(Qa,r),C=Z1(Qa,r),E=cw(r),A=CA(r),L=Dz(r),[$,N]=s.useState(null),j=s.useRef(null),[P,R]=s.useState(null);Mm(P);const{nodes:H,registry:D}=Nm(),U=!!(i||b),_=cn(n,j,k.onContentChange,R),B=s.useRef(0),K=s.useRef(""),V=s.useRef(0),O=s.useRef(null),I=s.useRef("right"),Y=s.useRef(0),Z=s.useMemo(()=>b?[j,...H.map(te=>({current:te}))]:[],[j,H,b]),X=b?F1:s.Fragment,z=b?{as:zz,allowPinchZoom:!0,shards:Z}:void 0,J=Ln(te=>{var Te,gt;const me=K.current+te,re=L().filter(Ze=>!Ze.disabled),ee=document.activeElement,q=(Te=re.find(Ze=>Ze.ref.current===ee))==null?void 0:Te.textValue,ie=re.map(Ze=>Ze.textValue),Oe=UA(ie,me,q),ae=(gt=re.find(Ze=>Ze.textValue===Oe))==null?void 0:gt.ref.current;function pe(Ze){K.current=Ze,window.clearTimeout(B.current),Ze!==""&&(B.current=window.setTimeout(()=>pe(""),1e3))}Ln(pe,"updateSearch"),pe(me),ae&&setTimeout(()=>ae.focus())},"handleTypeaheadSearch");s.useEffect(()=>()=>window.clearTimeout(B.current),[]),Td();const he=s.useCallback(te=>{var re,ee;return I.current===((re=O.current)==null?void 0:re.side)&&KA(te,(ee=O.current)==null?void 0:ee.area)},[]);return o.jsx(_z,{scope:r,searchRef:K,onItemEnter:s.useCallback(te=>{he(te)&&te.preventDefault()},[he]),onItemLeave:s.useCallback(te=>{var me;he(te)||((me=j.current)==null||me.focus(),N(null))},[he]),onTriggerLeave:s.useCallback(te=>{he(te)&&te.preventDefault()},[he]),pointerGraceTimerRef:V,onPointerGraceIntentChange:s.useCallback(te=>{O.current=te},[]),children:o.jsx(Am,{registry:U?D:null,children:o.jsx(X,{...z,children:o.jsx(Ld,{asChild:!0,trapped:i,branches:H,onMountAutoFocus:Mt(l,te=>{var me;te.preventDefault(),(me=j.current)==null||me.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:o.jsx(O1,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:w,onDismiss:y,children:o.jsx(Ez,{asChild:!0,...A,dir:C.dir,orientation:"vertical",loop:a,currentTabStopId:$,onCurrentTabStopIdChange:N,onEntryFocus:Mt(h,te=>{C.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Fm,{role:"menu","aria-orientation":"vertical","data-state":pw(k.open),"data-radix-menu-content":"",dir:C.dir,...E,...S,ref:_,style:{outline:"none",...S.style},onKeyDown:Mt(S.onKeyDown,te=>{const re=te.target.closest("[data-radix-menu-content]")===te.currentTarget,ee=te.ctrlKey||te.altKey||te.metaKey,q=te.key.length===1;re&&(te.key==="Tab"&&te.preventDefault(),!ee&&q&&J(te.key));const ie=j.current;if(te.target!==ie||!Lz.includes(te.key))return;te.preventDefault();const ae=L().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);EA.includes(te.key)&&ae.reverse(),zA(ae)}),onBlur:Mt(t.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(B.current),K.current="")}),onPointerMove:Mt(t.onPointerMove,vd(te=>{const me=te.target,re=Y.current!==te.clientX;if(te.currentTarget.contains(me)&&re){const ee=te.clientX>Y.current?"right":"left";I.current=ee,Y.current=te.clientX}}))})})})})})})})},"MenuContentImpl")),hw=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{role:"group",...a,ref:n})},"MenuGroup")),PA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{...a,ref:n})},"MenuLabel")),a4="MenuItem",L5="menu.itemSelect",Bm=s.forwardRef(Ln(function(t,n){const{disabled:r=!1,onSelect:a,...i}=t,l=s.useRef(null),u=Z1(a4,t.__scopeMenu),f=dw(a4,t.__scopeMenu),h=cn(n,l),p=s.useRef(!1),g=Ln(()=>{const m=l.current;if(!r&&m){const w=new CustomEvent(L5,{bubbles:!0,cancelable:!0});m.addEventListener(L5,y=>a==null?void 0:a(y),{once:!0}),Kv(m,w),w.defaultPrevented?p.current=!1:u.onClose()}},"handleSelect");return o.jsx(LA,{...i,ref:h,disabled:r,onClick:Mt(t.onClick,g),onPointerDown:m=>{var w;(w=t.onPointerDown)==null||w.call(t,m),p.current=!0},onPointerUp:Mt(t.onPointerUp,m=>{var w;p.current||(w=m.currentTarget)==null||w.click()}),onKeyDown:Mt(t.onKeyDown,m=>{r||m.target!==m.currentTarget||f.searchRef.current!==""&&m.key===" "||s4.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})},"MenuItem")),LA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,disabled:a=!1,textValue:i,...l}=t,u=dw(a4,r),f=CA(r),h=s.useRef(null),p=cn(n,h),[g,m]=s.useState(!1),[w,y]=s.useState("");return s.useEffect(()=>{const b=h.current;b&&y((b.textContent??"").trim())},[l.children]),o.jsx(c1.ItemSlot,{scope:r,disabled:a,textValue:i??w,children:o.jsx(Az,{asChild:!0,...f,focusable:!a,children:o.jsx(pn.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:p,onPointerMove:Mt(t.onPointerMove,vd(b=>{a?u.onItemLeave(b):(u.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Mt(t.onPointerLeave,vd(b=>u.onItemLeave(b))),onFocus:Mt(t.onFocus,()=>m(!0)),onBlur:Mt(t.onBlur,()=>m(!1))})})})},"MenuItemImpl")),TA=s.forwardRef(Ln(function(t,n){const{checked:r=!1,onCheckedChange:a,...i}=t;return o.jsx(OA,{scope:t.__scopeMenu,checked:r,children:o.jsx(Bm,{role:"menuitemcheckbox","aria-checked":u1(r)?"mixed":r,...i,ref:n,"data-state":Um(r),onSelect:Mt(i.onSelect,()=>a==null?void 0:a(u1(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Bz="MenuRadioGroup",[Uz,Wz]=Kc(Bz,{value:void 0,onValueChange:Ln(()=>{},"onValueChange")}),$A=s.forwardRef(Ln(function(t,n){const{value:r,onValueChange:a,...i}=t,l=Sr(a);return o.jsx(Uz,{scope:t.__scopeMenu,value:r,onValueChange:l,children:o.jsx(hw,{...i,ref:n})})},"MenuRadioGroup")),Kz="MenuRadioItem",DA=s.forwardRef(Ln(function(t,n){const{value:r,...a}=t,i=Wz(Kz,t.__scopeMenu),l=r===i.value;return o.jsx(OA,{scope:t.__scopeMenu,checked:l,children:o.jsx(Bm,{role:"menuitemradio","aria-checked":l,...a,ref:n,"data-state":Um(l),onSelect:Mt(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),HA="MenuItemIndicator",[OA,Gz]=Kc(HA,{checked:!1}),IA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,forceMount:a,...i}=t,l=Gz(HA,r);return o.jsx(ps,{present:a||u1(l.checked)||l.checked===!0,children:o.jsx(pn.span,{...i,ref:n,"data-state":Um(l.checked)})})},"MenuItemIndicator")),FA=s.forwardRef(Ln(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),Yz="MenuSub",[Fde,_A]=Kc(Yz),Lh="MenuSubTrigger",VA=s.forwardRef(Ln(function(t,n){const r=Gc(Lh,t.__scopeMenu),a=Z1(Lh,t.__scopeMenu),i=_A(Lh,t.__scopeMenu),l=dw(Lh,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 m=cn(n,i.onTriggerChange);return o.jsx(uw,{asChild:!0,...p,children:o.jsx(LA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?i.contentId:void 0,"data-state":pw(r.open),...t,ref:m,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:Mt(t.onPointerMove,vd(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:Mt(t.onPointerLeave,vd(w=>{var b,S;g();const y=(b=r.content)==null?void 0:b.getBoundingClientRect();if(y){const k=(S=r.content)==null?void 0:S.dataset.side,C=k==="right",E=C?-5:5,A=y[C?"left":"right"],L=y[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:w.clientX+E,y:w.clientY},{x:A,y:y.top},{x:L,y:y.top},{x:L,y:y.bottom},{x:A,y:y.bottom}],side:k}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(w),w.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Mt(t.onKeyDown,w=>{var b;t.disabled||w.target!==w.currentTarget||l.searchRef.current!==""&&w.key===" "||Tz[a.dir].includes(w.key)&&(r.onOpenChange(!0),(b=r.content)==null||b.focus(),w.preventDefault())})})})},"MenuSubTrigger")),qz="MenuSubContent",ZA=s.forwardRef(Ln(function(t,n){const r=NA(Qa,t.__scopeMenu),{forceMount:a=r.forceMount,align:i="start",...l}=t,u=Gc(Qa,t.__scopeMenu),f=Z1(Qa,t.__scopeMenu),h=_A(qz,t.__scopeMenu),p=s.useRef(null),g=cn(n,p);return o.jsx(c1.Provider,{scope:t.__scopeMenu,children:o.jsx(ps,{present:a||u.open,children:o.jsx(c1.Slot,{scope:t.__scopeMenu,children:o.jsx(fw,{id:h.contentId,"aria-labelledby":h.triggerId,...l,ref:g,align:i,side:f.dir===Rz.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var w;f.isUsingKeyboardRef.current&&((w=p.current)==null||w.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Mt(t.onFocusOutside,m=>{m.target!==h.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Mt(t.onEscapeKeyDown,m=>{f.onClose(),m.preventDefault()}),onKeyDown:Mt(t.onKeyDown,m=>{var b;const w=m.currentTarget.contains(m.target),y=$z[f.dir].includes(m.key);w&&y&&(u.onOpenChange(!1),(b=h.trigger)==null||b.focus(),m.preventDefault())})})})})})},"MenuSubContent"));function pw(e){return e?"open":"closed"}Ln(pw,"getOpenState");function u1(e){return e==="indeterminate"}Ln(u1,"isIndeterminate");function Um(e){return u1(e)?"indeterminate":e?"checked":"unchecked"}Ln(Um,"getCheckedState");function zA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Ln(zA,"focusFirst");function BA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ln(BA,"wrapArray");function UA(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=BA(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}Ln(UA,"getNextMatch");function WA(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,m=f.y;p>r!=m>r&&n<(g-h)*(r-p)/(m-p)+h&&(a=!a)}return a}Ln(WA,"isPointInPolygon");function KA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return WA(n,t)}Ln(KA,"isPointerInGraceArea");function vd(e){return t=>t.pointerType==="mouse"?e(t):void 0}Ln(vd,"whenMouse");var Xz=Object.defineProperty,Jr=(e,t)=>Xz(e,"name",{value:t,configurable:!0}),mw="ContextMenu",[Qz,_de]=zs(mw,[zm]),Us=zm(),[Jz,GA]=Qz(mw),eB=Jr(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,dir:i,modal:l=!0}=e,u=s.useRef(!1),[f,h]=yi({prop:a,defaultProp:!1,onChange:r,caller:mw}),p=Us(t);return o.jsx(Jz,{scope:t,open:f,onOpenChange:h,modal:l,hasInteractedRef:u,children:o.jsx(jA,{...p,dir:i,open:f,onOpenChange:h,modal:l,children:n})})},"ContextMenu"),tB="ContextMenuTrigger",nB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,disabled:a=!1,...i}=t,l=GA(tB,r),u=Us(r),[f,h]=s.useState({x:0,y:0}),p=s.useMemo(()=>({current:{getBoundingClientRect:Jr(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=s.useRef(0),m=s.useCallback(()=>window.clearTimeout(g.current),[]),w=Jr(y=>{l.hasInteractedRef.current=!0,h({x:y.clientX,y:y.clientY}),l.onOpenChange(!0)},"handleOpen");return s.useEffect(()=>m,[m]),s.useEffect(()=>void(a&&m()),[a,m]),o.jsxs(o.Fragment,{children:[o.jsx(uw,{...u,virtualRef:p}),o.jsx(pn.span,{"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,...i,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:Mt(t.onContextMenu,y=>{m(),w(y),y.preventDefault()}),onPointerDown:a?t.onPointerDown:Mt(t.onPointerDown,D0(y=>{m(),l.open&&l.onOpenChange(!1),g.current=window.setTimeout(()=>w(y),700)})),onPointerMove:a?t.onPointerMove:Mt(t.onPointerMove,D0(m)),onPointerCancel:a?t.onPointerCancel:Mt(t.onPointerCancel,D0(m)),onPointerUp:a?t.onPointerUp:Mt(t.onPointerUp,D0(m))})]})},"ContextMenuTrigger")),YA=Jr(e=>{const{__scopeContextMenu:t,...n}=e,r=Us(t);return o.jsx(MA,{...r,...n})},"ContextMenuPortal"),rB="ContextMenuContent",sB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=GA(rB,r),l=Us(r),u=s.useRef(!1);return o.jsx(RA,{...l,side:"right",sideOffset:2,align:"start",...a,ref:n,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")),aB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(hw,{...i,...a,ref:n})},"ContextMenuGroup")),oB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(PA,{...i,...a,ref:n})},"ContextMenuLabel")),iB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(Bm,{...i,...a,ref:n})},"ContextMenuItem")),lB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(TA,{...i,...a,ref:n})},"ContextMenuCheckboxItem")),cB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx($A,{...i,...a,ref:n})},"ContextMenuRadioGroup")),uB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(DA,{...i,...a,ref:n})},"ContextMenuRadioItem")),qA=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(IA,{...i,...a,ref:n})},"ContextMenuItemIndicator")),dB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(FA,{...i,...a,ref:n})},"ContextMenuSeparator")),fB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(VA,{...i,...a,ref:n})},"ContextMenuSubTrigger")),hB=s.forwardRef(Jr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Us(r);return o.jsx(ZA,{...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 D0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Jr(D0,"whenTouchOrPen");var pB=Object.defineProperty,Ws=(e,t)=>pB(e,"name",{value:t,configurable:!0}),gw="DropdownMenu",[mB,Vde]=zs(gw,[zm]),Ks=zm(),[gB,XA]=mB(gw),vB=Ws(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=Ks(t),h=s.useRef(null),[p,g]=yi({prop:a,defaultProp:i??!1,onChange:l,caller:gw});return o.jsx(gB,{scope:t,triggerId:Fs(),triggerRef:h,contentId:Fs(),open:p,onOpenChange:g,onOpenToggle:s.useCallback(()=>g(m=>!m),[g]),modal:u,children:o.jsx(jA,{...f,open:p,onOpenChange:g,dir:r,modal:u,children:n})})},"DropdownMenu"),wB="DropdownMenuTrigger",yB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,disabled:a=!1,...i}=t,l=XA(wB,r),u=Ks(r),f=cn(n,l.triggerRef);return o.jsx(uw,{asChild:!0,...u,children:o.jsx(pn.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:Mt(t.onPointerDown,h=>{!a&&h.button===0&&h.ctrlKey===!1&&(l.onOpenToggle(),l.open||h.preventDefault())}),onKeyDown:Mt(t.onKeyDown,h=>{a||(["Enter"," "].includes(h.key)&&l.onOpenToggle(),h.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})},"DropdownMenuTrigger")),QA=Ws(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ks(t);return o.jsx(MA,{...r,...n})},"DropdownMenuPortal"),bB="DropdownMenuContent",xB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=XA(bB,r),l=Ks(r),u=s.useRef(!1);return o.jsx(RA,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...a,ref:n,onCloseAutoFocus:Mt(t.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:Mt(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")),kB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(hw,{...i,...a,ref:n})},"DropdownMenuGroup")),SB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(PA,{...i,...a,ref:n})},"DropdownMenuLabel")),EB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(Bm,{...i,...a,ref:n})},"DropdownMenuItem")),CB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(TA,{...i,...a,ref:n})},"DropdownMenuCheckboxItem")),jB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx($A,{...i,...a,ref:n})},"DropdownMenuRadioGroup")),AB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(DA,{...i,...a,ref:n})},"DropdownMenuRadioItem")),JA=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(IA,{...i,...a,ref:n})},"DropdownMenuItemIndicator")),NB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(FA,{...i,...a,ref:n})},"DropdownMenuSeparator")),MB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(VA,{...i,...a,ref:n})},"DropdownMenuSubTrigger")),RB=s.forwardRef(Ws(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Ks(r);return o.jsx(ZA,{...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")),PB=Object.defineProperty,LB=(e,t)=>PB(e,"name",{value:t,configurable:!0});function jp(e,[t,n]){return Math.min(n,Math.max(t,e))}LB(jp,"clamp");var TB=Object.defineProperty,io=(e,t)=>TB(e,"name",{value:t,configurable:!0}),vw="Popover",[eN,Zde]=zs(vw,[Il]),Wm=Il(),[$B,Fl]=eN(vw),DB=io(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=Wm(t),f=s.useRef(null),[h,p]=s.useState(!1),[g,m]=s.useState(0),[w,y]=s.useState(0),[b,S]=yi({prop:r,defaultProp:a??!1,onChange:i,caller:vw});return o.jsx(Im,{...u,children:o.jsx($B,{scope:t,contentId:Fs(),titleId:Fs(),descriptionId:Fs(),titlePresent:g>0,descriptionPresent:w>0,setTitleCount:m,setDescriptionCount:y,triggerRef:f,open:b,onOpenChange:S,onOpenToggle:s.useCallback(()=>S(k=>!k),[S]),hasCustomAnchor:h,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})},"Popover"),HB="PopoverAnchor",OB=s.forwardRef(io(function(t,n){const{__scopePopover:r,...a}=t,i=Fl(HB,r),l=Wm(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return s.useEffect(()=>(u(),()=>f()),[u,f]),o.jsx(V1,{...l,...a,ref:n})},"PopoverAnchor")),IB="PopoverTrigger",FB=s.forwardRef(io(function(t,n){const{__scopePopover:r,...a}=t,i=Fl(IB,r),l=Wm(r),u=cn(n,i.triggerRef),f=o.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ww(i.open),...a,ref:u,onClick:Mt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:o.jsx(V1,{asChild:!0,...l,children:f})},"PopoverTrigger")),tN="PopoverPortal",[_B,VB]=eN(tN,{forceMount:void 0}),ZB=io(e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Fl(tN,t);return o.jsx(_B,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(I1,{asChild:!0,container:a,children:r})})})},"PopoverPortal"),d1="PopoverContent",zB=s.forwardRef(io(function(t,n){const r=VB(d1,t.__scopePopover),{forceMount:a=r.forceMount,...i}=t,l=Fl(d1,t.__scopePopover);return o.jsx(ps,{present:a||l.open,children:l.modal?o.jsx(UB,{...i,ref:n}):o.jsx(WB,{...i,ref:n})})},"PopoverContent")),BB=no("PopoverContent.RemoveScroll"),UB=s.forwardRef(io(function(t,n){const r=Fl(d1,t.__scopePopover),a=s.useRef(null),i=cn(n,a),l=s.useRef(!1),{nodes:u,registry:f}=Nm();return s.useEffect(()=>{const h=a.current;if(h)return Pm(h)},[]),o.jsx(F1,{as:BB,allowPinchZoom:!0,shards:s.useMemo(()=>[a,...u.map(h=>({current:h}))],[a,u]),children:o.jsx(nN,{...t,ref:i,branchNodes:u,branchRegistry:f,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mt(t.onCloseAutoFocus,h=>{var p;h.preventDefault(),l.current||(p=r.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Mt(t.onPointerDownOutside,h=>{const p=h.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,m=p.button===2||g;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Mt(t.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),WB=s.forwardRef(io(function(t,n){const r=Fl(d1,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(nN,{...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")),nN=s.forwardRef(io(function(t,n){const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,"aria-describedby":m,branchNodes:w,branchRegistry:y,...b}=t,S=Fl(d1,r),k=Wm(r),[C,E]=s.useState(null),A=cn(n,E);return Mm(C),Td(),o.jsx(Am,{registry:y,children:o.jsx(Ld,{asChild:!0,loop:!0,trapped:a,branches:w,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(O1,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>S.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(Fm,{"data-state":ww(S.open),role:"dialog",id:S.contentId,"aria-labelledby":S.titlePresent?S.titleId:void 0,"aria-describedby":S.descriptionPresent?rN(m,S.descriptionId):m,...k,...b,ref:A,style:{...b.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")),KB="PopoverClose",GB=s.forwardRef(io(function(t,n){const{__scopePopover:r,...a}=t,i=Fl(KB,r);return o.jsx(pn.button,{type:"button",...a,ref:n,onClick:Mt(t.onClick,()=>i.onOpenChange(!1))})},"PopoverClose"));function ww(e){return e?"open":"closed"}io(ww,"getState");function rN(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}io(rN,"concatAriaDescribedby");var YB=Object.defineProperty,kn=(e,t)=>YB(e,"name",{value:t,configurable:!0});function sN(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}kn(sN,"useStateMachine");var Ku={Auto:"auto",Always:"always",Scroll:"scroll",Hover:"hover"},rd={Vertical:"vertical",Horizontal:"horizontal"},Do={LTR:"ltr",RTL:"rtl"},aN="ScrollArea",[oN,zde]=zs(aN),[qB,ca]=oN(aN),iN=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,type:a=Ku.Hover,dir:i,scrollHideDelay:l=600,...u}=t,[f,h]=s.useState(null),[p,g]=s.useState(null),[m,w]=s.useState(null),[y,b]=s.useState(null),[S,k]=s.useState(null),[C,E]=s.useState(0),[A,L]=s.useState(0),[$,N]=s.useState(!1),[j,P]=s.useState(!1),R=cn(n,h),H=H1(i);return o.jsx(qB,{scope:r,type:a,dir:H,scrollHideDelay:l,scrollArea:f,viewport:p,onViewportChange:g,content:m,onContentChange:w,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:$,onScrollbarXEnabledChange:N,scrollbarY:S,onScrollbarYChange:k,scrollbarYEnabled:j,onScrollbarYEnabledChange:P,onCornerWidthChange:E,onCornerHeightChange:L,children:o.jsx(pn.div,{dir:H,...u,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":A+"px",...t.style}})})},"ScrollArea")),lN="ScrollAreaViewport",T5=Em(lN),cN=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,children:a,nonce:i,disableImplicitContentElement:l,...u}=t,f=ca(lN,r),h=s.useRef(null),p=cn(n,h,f.onViewportChange),g=s.isValidElement(a);return o.jsxs(o.Fragment,{children:[o.jsx(XB,{nonce:i}),o.jsx(pn.div,{"data-radix-scroll-area-viewport":"",...u,ref:p,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...t.style},children:l?a:g?o.jsx(T5,{child:a,children:m=>o.jsx($5,{__scopeScrollArea:r,children:m})}):o.jsx(T5,{children:o.jsx($5,{__scopeScrollArea:r,children:a})})})]})},"ScrollAreaViewport")),XB=s.memo(kn(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),QB="ScrollAreaContent",$5=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,children:a,...i}=t,l=ca(QB,r),u=cn(n,l.onContentChange);return o.jsx(pn.div,{...i,ref:u,style:{minWidth:"100%",display:"table",...t.style},children:a})},"ScrollAreaContent")),Pi="ScrollAreaScrollbar",o4=s.forwardRef(kn(function(t,n){const{forceMount:r,...a}=t,i=ca(Pi,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=t.orientation===rd.Horizontal;return s.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type===Ku.Hover?o.jsx(JB,{...a,ref:n,forceMount:r}):i.type===Ku.Scroll?o.jsx(eU,{...a,ref:n,forceMount:r}):i.type===Ku.Auto?o.jsx(uN,{...a,ref:n,forceMount:r}):i.type===Ku.Always?o.jsx(yw,{...a,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),JB=s.forwardRef(kn(function(t,n){const{forceMount:r,...a}=t,i=ca(Pi,t.__scopeScrollArea),[l,u]=s.useState(!1);return s.useEffect(()=>{const f=i.scrollArea;let h=0;if(f){const p=kn(()=>{window.clearTimeout(h),u(!0)},"handlePointerEnter"),g=kn(()=>{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(ps,{present:r||l,children:o.jsx(uN,{"data-state":l?"visible":"hidden",...a,ref:n})})},"ScrollAreaScrollbarHover")),eU=s.forwardRef(kn(function(t,n){const{forceMount:r,...a}=t,i=ca(Pi,t.__scopeScrollArea),l=t.orientation===rd.Horizontal,u=B1(()=>h("SCROLL_END"),100),[f,h]=sN("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 m=p[g];const w=kn(()=>{const y=p[g];m!==y&&(h("SCROLL"),u()),m=y},"handleScroll");return p.addEventListener("scroll",w),()=>p.removeEventListener("scroll",w)}},[i.viewport,l,h,u]),o.jsx(ps,{present:r||f!=="hidden",children:o.jsx(yw,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:n,onPointerEnter:Mt(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Mt(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),uN=s.forwardRef(kn(function(t,n){const r=ca(Pi,t.__scopeScrollArea),{forceMount:a,...i}=t,[l,u]=s.useState(!1),f=t.orientation===rd.Horizontal,h=B1(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?p:g)}},10);return Lc(r.viewport,h),Lc(r.content,h),o.jsx(ps,{present:a||l,children:o.jsx(yw,{"data-state":l?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarAuto")),yw=s.forwardRef(kn(function(t,n){const{orientation:r=rd.Vertical,...a}=t,i=ca(Pi,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=bw(f.viewport,f.content),g={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:kn(w=>l.current=w,"onThumbChange"),onThumbPointerUp:kn(()=>u.current=0,"onThumbPointerUp"),onThumbPointerDown:kn(w=>u.current=w,"onThumbPointerDown")};function m(w,y){return pN(w,u.current,f,y)}return kn(m,"getScrollPosition"),r===rd.Horizontal?o.jsx(tU,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollLeft,y=c4(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=m(w,i.dir))}}):r===rd.Vertical?o.jsx(nU,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollTop,y=c4(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=m(w))}}):null},"ScrollAreaScrollbarVisible")),tU=s.forwardRef(kn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=ca(Pi,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=cn(n,h,l.onScrollbarXChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(fN,{"data-orientation":"horizontal",...i,ref:p,sizes:r,style:{bottom:0,left:l.dir===Do.RTL?"var(--radix-scroll-area-corner-width)":0,right:l.dir===Do.LTR?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":z1(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.x),onDragScroll:g=>t.onDragScroll(g.x),onWheelScroll:(g,m)=>{if(l.viewport){const w=l.viewport.scrollLeft+g.deltaX;t.onWheelScroll(w),kw(w,m)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:f1(u.paddingLeft),paddingEnd:f1(u.paddingRight)}})}})},"ScrollAreaScrollbarX")),nU=s.forwardRef(kn(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=ca(Pi,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=cn(n,h,l.onScrollbarYChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(fN,{"data-orientation":"vertical",...i,ref:p,sizes:r,style:{top:0,right:l.dir===Do.LTR?0:void 0,left:l.dir===Do.RTL?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":z1(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.y),onDragScroll:g=>t.onDragScroll(g.y),onWheelScroll:(g,m)=>{if(l.viewport){const w=l.viewport.scrollTop+g.deltaY;t.onWheelScroll(w),kw(w,m)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:f1(u.paddingTop),paddingEnd:f1(u.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[rU,dN]=oN(Pi),fN=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,sizes:a,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:g,onResize:m,...w}=t,y=ca(Pi,r),[b,S]=s.useState(null),k=cn(n,S),C=s.useRef(null),E=s.useRef(""),A=y.viewport,L=a.content-a.viewport,$=Sr(g),N=Sr(h),j=B1(m,10);function P(R){if(C.current){const H=R.clientX-C.current.left,D=R.clientY-C.current.top;p({x:H,y:D})}}return kn(P,"handleDragScroll"),s.useEffect(()=>{const R=kn(H=>{const D=H.target;(b==null?void 0:b.contains(D))&&$(H,L)},"handleWheel");return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[A,b,L,$]),s.useEffect(N,[a,N]),Lc(b,j),Lc(y.content,j),o.jsx(rU,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:Sr(l),onThumbPointerUp:Sr(u),onThumbPositionChange:N,onThumbPointerDown:Sr(f),children:o.jsx(pn.div,{...w,ref:k,style:{position:"absolute",...w.style},onPointerDown:Mt(t.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),C.current=b.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),P(R))}),onPointerMove:Mt(t.onPointerMove,P),onPointerUp:Mt(t.onPointerUp,R=>{const H=R.target;H.hasPointerCapture(R.pointerId)&&H.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=E.current,y.viewport&&(y.viewport.style.scrollBehavior=""),C.current=null})})})},"ScrollAreaScrollbarImpl")),i4="ScrollAreaThumb",l4=s.forwardRef(kn(function(t,n){const{forceMount:r,...a}=t,i=dN(i4,t.__scopeScrollArea);return o.jsx(ps,{present:r||i.hasThumb,children:o.jsx(sU,{ref:n,...a})})},"ScrollAreaThumb")),sU=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,style:a,...i}=t,l=ca(i4,r),u=dN(i4,r),{onThumbPositionChange:f}=u,h=cn(n,u.onThumbChange),p=s.useRef(void 0),g=B1(()=>{p.current&&(p.current(),p.current=void 0)},100);return s.useEffect(()=>{const m=l.viewport;if(m){const w=kn(()=>{if(g(),!p.current){const y=iU(m,f);p.current=y,f()}},"handleScroll");return f(),m.addEventListener("scroll",w),()=>m.removeEventListener("scroll",w)}},[l.viewport,g,f]),o.jsx(pn.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:Mt(t.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,S=m.clientY-y.top;u.onThumbPointerDown({x:b,y:S})}),onPointerUp:Mt(t.onPointerUp,u.onThumbPointerUp)})},"ScrollAreaThumbImpl")),hN="ScrollAreaCorner",aU=s.forwardRef(kn(function(t,n){const r=ca(hN,t.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!==Ku.Scroll&&a?o.jsx(oU,{...t,ref:n}):null},"ScrollAreaCorner")),oU=s.forwardRef(kn(function(t,n){const{__scopeScrollArea:r,...a}=t,i=ca(hN,r),[l,u]=s.useState(0),[f,h]=s.useState(0),p=!!(l&&f),{onCornerWidthChange:g,onCornerHeightChange:m}=i;return Lc(i.scrollbarX,()=>{var y;const w=((y=i.scrollbarX)==null?void 0:y.offsetHeight)||0;i.onCornerHeightChange(w),h(w)}),Lc(i.scrollbarY,()=>{var y;const w=((y=i.scrollbarY)==null?void 0:y.offsetWidth)||0;i.onCornerWidthChange(w),u(w)}),s.useEffect(()=>()=>{g(0),m(0)},[g,m]),p?o.jsx(pn.div,{...a,ref:n,style:{width:l,height:f,position:"absolute",right:i.dir===Do.LTR?0:void 0,left:i.dir===Do.RTL?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function f1(e){return e?parseInt(e,10):0}kn(f1,"toInt");function bw(e,t){const n=e/t;return isNaN(n)?0:n}kn(bw,"getThumbRatio");function z1(e){const t=bw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}kn(z1,"getThumbSize");function pN(e,t,n,r=Do.LTR){const a=z1(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===Do.LTR?[0,p]:[p*-1,0];return xw([f,h],g)(e)}kn(pN,"getScrollPositionFromPointer");function c4(e,t,n=Do.LTR){const r=z1(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,f=n===Do.LTR?[0,l]:[l*-1,0],h=jp(e,f);return xw([0,l],[0,u])(h)}kn(c4,"getThumbOffsetFromScroll");function xw(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])}}kn(xw,"linearScale");function kw(e,t){return e>0&&e<t}kn(kw,"isScrollingWithinScrollbarBounds");var iU=kn((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;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)}return kn(a,"loop"),a(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function B1(e,t){const n=Sr(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])}kn(B1,"useDebounceCallback");function Lc(e,t){const n=Sr(t);mr(()=>{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])}kn(Lc,"useResizeObserver");var lU=Object.defineProperty,Fn=(e,t)=>lU(e,"name",{value:t,configurable:!0}),D5={ItemAligned:"item-aligned",Popper:"popper"},cU={RTL:"rtl"},uU=[" ","Enter","ArrowUp","ArrowDown"],dU=[" ","Enter"],wd="Select",[Km,Sw,fU]=jm(wd),[Yc,Bde]=zs(wd,[fU,Il]),Ew=Il(),[hU,_l]=Yc(wd),[pU,mU]=Yc(wd);function mN(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:m,required:w,form:y,internal_do_not_use_render:b}=e,S=Ew(t),[k,C]=s.useState(null),[E,A]=s.useState(null),[L,$]=s.useState(!1),N=H1(h),[j,P]=yi({prop:r,defaultProp:a??!1,onChange:i,caller:wd}),[R,H]=yi({prop:l,defaultProp:u,onChange:f,caller:wd}),D=s.useRef(null),U=s.useRef(!1),[_,B]=s.useState(null),K=Fn(te=>{B({value:te,hasConsumerStoppedPropagation:U.current}),H(te)},"handleUserSelect"),V=s.useRef(R);s.useEffect(()=>{const te=y?k==null?void 0:k.ownerDocument.getElementById(y):k==null?void 0:k.form;if(te instanceof HTMLFormElement){const me=Fn(()=>H(V.current),"reset");return te.addEventListener("reset",me),()=>te.removeEventListener("reset",me)}},[y,k,H]);const O=k?!!y||!!k.closest("form"):!0,[I,Y]=s.useState(new Set),Z=Fs(),X=Array.from(I).map(te=>te.props.value).join(";"),z=s.useCallback(te=>{Y(me=>new Set(me).add(te))},[]),J=s.useCallback(te=>{Y(me=>{const re=new Set(me);return re.delete(te),re})},[]),he={required:w,trigger:k,onTriggerChange:C,valueNode:E,onValueNodeChange:A,valueNodeHasChildren:L,onValueNodeHasChildrenChange:$,contentId:Z,value:R,onValueChange:H,hasConsumerStoppedPropagationRef:U,userSelection:_,onUserSelect:K,open:j,onOpenChange:P,dir:N,triggerPointerDownPosRef:D,disabled:m,name:p,autoComplete:g,form:y,nativeOptions:I,nativeSelectKey:X,isFormControl:O};return o.jsx(Im,{...S,children:o.jsx(hU,{scope:t,...he,children:o.jsx(Km.Provider,{scope:t,children:o.jsx(pU,{scope:t,onNativeOptionAdd:z,onNativeOptionRemove:J,children:wN(b)?b(he):n})})})})}Fn(mN,"SelectProvider");var gU=Fn(e=>{const{__scopeSelect:t,children:n,...r}=e;return o.jsx(mN,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:a})=>o.jsxs(o.Fragment,{children:[n,a?o.jsx(KU,{__scopeSelect:t}):null]})})},"Select"),vU="SelectTrigger",wU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,disabled:a=!1,...i}=t,l=Ew(r),u=_l(vU,r),f=u.disabled||a,h=cn(n,u.onTriggerChange),p=Sw(r),g=s.useRef("touch"),[m,w,y]=Cw(S=>{const k=p().filter(A=>!A.disabled),C=k.find(A=>A.value===u.value),E=jw(k,S,C);E!==void 0&&u.onUserSelect(E.value)}),b=Fn(S=>{f||(u.onOpenChange(!0),y()),S&&(u.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})},"handleOpen");return o.jsx(V1,{asChild:!0,...l,children:o.jsx(pn.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":U1(u.value)?"":void 0,...i,ref:h,onClick:Mt(i.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&b(S)}),onPointerDown:Mt(i.onPointerDown,S=>{g.current=S.pointerType;const k=S.target;k.hasPointerCapture(S.pointerId)&&k.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(b(S),S.preventDefault())}),onKeyDown:Mt(i.onKeyDown,S=>{const k=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&(u.hasConsumerStoppedPropagationRef.current=S.isPropagationStopped(),w(S.key)),!(k&&S.key===" ")&&uU.includes(S.key)&&(b(),S.preventDefault())})})})},"SelectTrigger")),yU="SelectValue",bU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,className:a,style:i,children:l,placeholder:u="",...f}=t,h=_l(yU,r),{onValueNodeHasChildrenChange:p}=h,g=l!==void 0,m=cn(n,h.onValueNodeChange);mr(()=>{p(g)},[p,g]);const w=U1(h.value);return o.jsx(pn.span,{...f,asChild:w?!1:f.asChild,ref:m,style:{pointerEvents:"none"},children:o.jsx(s.Fragment,{children:w?u:l},w?"placeholder":"value")})},"SelectValue")),xU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,children:a,...i}=t;return o.jsx(pn.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})},"SelectIcon")),kU="SelectPortal",[SU,EU]=Yc(kU,{forceMount:void 0}),CU=Fn(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return o.jsx(SU,{scope:e.__scopeSelect,forceMount:n,children:o.jsx(I1,{asChild:!0,...r})})},"SelectPortal"),Tc="SelectContent",jU=s.forwardRef(Fn(function(t,n){const r=EU(Tc,t.__scopeSelect),{forceMount:a=r.forceMount,...i}=t,l=_l(Tc,t.__scopeSelect),[u,f]=s.useState();return mr(()=>{f(new DocumentFragment)},[]),o.jsx(ps,{present:a||l.open,children:({present:h})=>h?o.jsx(MU,{...i,ref:n}):o.jsx(AU,{...i,fragment:u})})},"SelectContent")),AU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,children:a,fragment:i}=t;return i?Ur.createPortal(o.jsx(gN,{scope:r,children:o.jsx(Km.Slot,{scope:r,children:o.jsx("div",{ref:n,children:a})})}),i):null},"SelectContentFragment")),Ga=10,[gN,Gm]=Yc(Tc),NU=no("SelectContent.RemoveScroll"),MU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r}=t,{position:a=D5.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:k,...C}=t,E=_l(Tc,r),[A,L]=s.useState(null),[$,N]=s.useState(null),j=cn(n,L),[P,R]=s.useState(null),[H,D]=s.useState(null),U=Sw(r),[_,B]=s.useState(!1),K=s.useRef(!1),V=s.useRef(!1),O=s.useRef(!1);s.useEffect(()=>{if(A)return Pm(A)},[A]),Td();const I=s.useCallback(q=>{const[ie,...Oe]=U().map(Te=>Te.ref.current),[ae]=Oe.slice(-1),pe=document.activeElement;for(const Te of q)if(Te===pe||(Te==null||Te.scrollIntoView({block:"nearest"}),Te===ie&&$&&($.scrollTop=0),Te===ae&&$&&($.scrollTop=$.scrollHeight),Te==null||Te.focus(),document.activeElement!==pe))return},[U,$]),Y=s.useCallback(()=>I([P,A]),[I,P,A]);s.useEffect(()=>{_&&Y()},[_,Y]);const{onOpenChange:Z,triggerPointerDownPosRef:X}=E;s.useEffect(()=>{if(A){let q={x:0,y:0};const ie=Fn(ae=>{var pe,Te;q={x:Math.abs(Math.round(ae.pageX)-(((pe=X.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((Te=X.current)==null?void 0:Te.y)??0))}},"handlePointerMove"),Oe=Fn(ae=>{q.x<=10&&q.y<=10?ae.preventDefault():ae.composedPath().includes(A)||Z(!1),document.removeEventListener("pointermove",ie),X.current=null},"handlePointerUp");return X.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",Oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",Oe,{capture:!0})}}},[A,Z,X]),s.useEffect(()=>{const q=Fn(()=>Z(!1),"close");return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[Z]);const[z,J]=Cw(q=>{const ie=U().filter(pe=>!pe.disabled),Oe=ie.find(pe=>pe.ref.current===document.activeElement),ae=jw(ie,q,Oe);ae&&setTimeout(()=>{var pe;return(pe=ae.ref.current)==null?void 0:pe.focus()})}),he=s.useCallback((q,ie,Oe)=>{const ae=!V.current;ae&&(V.current=!0);const pe=!K.current&&!Oe;E.value!==void 0&&E.value===ie||pe?(R(q),pe&&(K.current=!0)):ae&&R(q)},[E.value]),te=s.useCallback(()=>A==null?void 0:A.focus(),[A]),me=s.useCallback((q,ie,Oe)=>{if(!q)return;const ae=!O.current;ae&&(O.current=!0);const pe=!K.current&&!Oe;(E.value!==void 0&&E.value===ie||pe||ae)&&D(q)},[E.value]),re=a===D5.Popper?H5:RU,ee=re===H5?{side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:w,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:k}:{};return o.jsx(gN,{scope:r,content:A,viewport:$,onViewportChange:N,itemRefCallback:he,selectedItem:P,onItemLeave:te,itemTextRefCallback:me,focusSelectedItem:Y,selectedItemText:H,position:a,isPositioned:_,searchRef:z,children:o.jsx(F1,{as:NU,allowPinchZoom:!0,children:o.jsx(Ld,{asChild:!0,trapped:E.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Mt(i,q=>{var ie;(ie=E.trigger)==null||ie.focus({preventScroll:!0}),q.preventDefault()}),children:o.jsx(O1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:o.jsx(re,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:q=>q.preventDefault(),...C,...ee,onPlaced:()=>B(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Mt(C.onKeyDown,q=>{const ie=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ie&&q.key.length===1&&J(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ae=U().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const pe=q.target,Te=ae.indexOf(pe);ae=ae.slice(Te+1)}setTimeout(()=>I(ae)),q.preventDefault()}})})})})})})},"SelectContentImpl")),RU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,onPlaced:a,...i}=t,l=_l(Tc,r),u=Gm(Tc,r),[f,h]=s.useState(null),[p,g]=s.useState(null),m=cn(n,g),w=Sw(r),y=s.useRef(!1),b=s.useRef(!0),{viewport:S,selectedItem:k,selectedItemText:C,focusSelectedItem:E}=u,A=s.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&p&&S&&k&&C){const j=l.trigger.getBoundingClientRect(),P=p.getBoundingClientRect(),R=l.valueNode.getBoundingClientRect(),H=C.getBoundingClientRect();if(l.dir!==cU.RTL){const Oe=H.left-P.left,ae=R.left-Oe,pe=j.left-ae,Te=j.width+pe,gt=Math.max(Te,P.width),Ze=window.innerWidth-Ga,tt=jp(ae,[Ga,Math.max(Ga,Ze-gt)]);f.style.minWidth=Te+"px",f.style.left=tt+"px"}else{const Oe=P.right-H.right,ae=window.innerWidth-R.right-Oe,pe=window.innerWidth-j.right-ae,Te=j.width+pe,gt=Math.max(Te,P.width),Ze=window.innerWidth-Ga,tt=jp(ae,[Ga,Math.max(Ga,Ze-gt)]);f.style.minWidth=Te+"px",f.style.right=tt+"px"}const D=w(),U=window.innerHeight-Ga*2,_=S.scrollHeight,B=window.getComputedStyle(p),K=parseInt(B.borderTopWidth,10),V=parseInt(B.paddingTop,10),O=parseInt(B.borderBottomWidth,10),I=parseInt(B.paddingBottom,10),Y=K+V+_+I+O,Z=Math.min(k.offsetHeight*5,Y),X=window.getComputedStyle(S),z=parseInt(X.paddingTop,10),J=parseInt(X.paddingBottom,10),he=j.top+j.height/2-Ga,te=U-he,me=k.offsetHeight/2,re=k.offsetTop+me,ee=K+V+re,q=Y-ee;if(ee<=he){const Oe=D.length>0&&k===D[D.length-1].ref.current;f.style.bottom="0px";const ae=p.clientHeight-S.offsetTop-S.offsetHeight,pe=Math.max(te,me+(Oe?J:0)+ae+O),Te=ee+pe;f.style.height=Te+"px"}else{const Oe=D.length>0&&k===D[0].ref.current;f.style.top="0px";const pe=Math.max(he,K+S.offsetTop+(Oe?z:0)+me)+q;f.style.height=pe+"px",S.scrollTop=ee-he+S.offsetTop}f.style.margin=`${Ga}px 0`,f.style.minHeight=Z+"px",f.style.maxHeight=U+"px",a==null||a(),requestAnimationFrame(()=>y.current=!0)}},[w,l.trigger,l.valueNode,f,p,S,k,C,l.dir,a]);mr(()=>A(),[A]);const[L,$]=s.useState();mr(()=>{p&&$(window.getComputedStyle(p).zIndex)},[p]);const N=s.useCallback(j=>{j&&b.current===!0&&(A(),E==null||E(),b.current=!1)},[A,E]);return o.jsx(PU,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:y,onScrollButtonChange:N,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:o.jsx(pn.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),H5=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,align:a="start",collisionPadding:i=Ga,...l}=t,u=Ew(r);return o.jsx(Fm,{...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")),[PU,LU]=Yc(Tc,{}),O5="SelectViewport",TU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,nonce:a,...i}=t,l=Gm(O5,r),u=LU(O5,r),f=cn(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(Km.Slot,{scope:r,children:o.jsx(pn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Mt(i.onScroll,p=>{const g=p.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=u;if(w!=null&&w.current&&m){const y=Math.abs(h.current-g.scrollTop);if(y>0){const b=window.innerHeight-Ga*2,S=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(S,k);if(C<b){const E=C+y,A=Math.min(b,E),L=E-A;m.style.height=A+"px",m.style.bottom==="0px"&&(g.scrollTop=L>0?L:0,m.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})},"SelectViewport")),$U="SelectGroup",[DU,HU]=Yc($U),OU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,...a}=t,i=Fs();return o.jsx(DU,{scope:r,id:i,children:o.jsx(pn.div,{role:"group","aria-labelledby":i,...a,ref:n})})},"SelectGroup")),IU="SelectLabel",FU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,...a}=t,i=HU(IU,r);return o.jsx(pn.div,{id:i.id,...a,ref:n})},"SelectLabel")),u4="SelectItem",[_U,vN]=Yc(u4),VU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,value:a,disabled:i=!1,textValue:l,...u}=t,f=_l(u4,r),h=Gm(u4,r),p=f.value===a,[g,m]=s.useState(l??""),[w,y]=s.useState(!1),b=Sr(A=>{var L;return(L=h.itemRefCallback)==null?void 0:L.call(h,A,a,i)}),S=cn(n,b),k=Fs(),C=s.useRef("touch");function E(A){f.hasConsumerStoppedPropagationRef.current=A.isPropagationStopped(),f.onUserSelect(a),f.onOpenChange(!1)}return Fn(E,"handleSelect"),o.jsx(_U,{scope:r,value:a,disabled:i,textId:k,isSelected:p,onItemTextChange:s.useCallback(A=>{m(L=>L||((A==null?void 0:A.textContent)??"").trim())},[]),children:o.jsx(Km.ItemSlot,{scope:r,value:a,disabled:i,textValue:g,children:o.jsx(pn.div,{role:"option","aria-labelledby":k,"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:S,onFocus:Mt(u.onFocus,()=>y(!0)),onBlur:Mt(u.onBlur,()=>y(!1)),onClick:Mt(u.onClick,A=>{i||C.current!=="mouse"&&E(A)}),onPointerUp:Mt(u.onPointerUp,A=>{i||C.current==="mouse"&&E(A)}),onPointerDown:Mt(u.onPointerDown,A=>{C.current=A.pointerType}),onPointerMove:Mt(u.onPointerMove,A=>{var L;C.current=A.pointerType,i?(L=h.onItemLeave)==null||L.call(h):C.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Mt(u.onPointerLeave,A=>{var L;A.currentTarget===document.activeElement&&((L=h.onItemLeave)==null||L.call(h))}),onKeyDown:Mt(u.onKeyDown,A=>{var $;i||A.target!==A.currentTarget||(($=h.searchRef)==null?void 0:$.current)!==""&&A.key===" "||(dU.includes(A.key)&&E(A),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),Th="SelectItemText",ZU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,className:a,style:i,...l}=t,u=_l(Th,r),f=Gm(Th,r),h=vN(Th,r),p=mU(Th,r),[g,m]=s.useState(null),w=Sr(E=>{var A;return(A=f.itemTextRefCallback)==null?void 0:A.call(f,E,h.value,h.disabled)}),y=cn(n,m,h.onItemTextChange,w),b=g==null?void 0:g.textContent,S=s.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:k,onNativeOptionRemove:C}=p;return mr(()=>(k(S),()=>C(S)),[k,C,S]),o.jsxs(o.Fragment,{children:[o.jsx(pn.span,{id:h.textId,...l,ref:y}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!U1(u.value)?Ur.createPortal(l.children,u.valueNode):null]})},"SelectItemText")),zU="SelectItemIndicator",BU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,...a}=t;return vN(zU,r).isSelected?o.jsx(pn.span,{"aria-hidden":!0,...a,ref:n}):null},"SelectItemIndicator")),UU=s.forwardRef(Fn(function(t,n){const{__scopeSelect:r,...a}=t;return o.jsx(pn.div,{"aria-hidden":!0,...a,ref:n})},"SelectSeparator")),WU="SelectBubbleInput",KU=s.forwardRef(Fn(function({__scopeSelect:t,...n},r){const a=_l(WU,t),{value:i,onValueChange:l,required:u,disabled:f,name:h,autoComplete:p,form:g,userSelection:m}=a,{nativeOptions:w,nativeSelectKey:y}=a,b=s.useRef(null),S=cn(r,b),k=i??"",C=s.useRef(k),E=s.useRef(m),A=s.useRef(!1),L=Array.from(w).some($=>($.props.value??"")==="");return s.useEffect(()=>{const $=b.current;if(!$)return;const N=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(N,"value").set,R=m!==null&&m!==E.current;E.current=m;const H=C.current!==k;C.current=k;const D=R&&H;if(R&&!H&&m.value!==k&&!m.hasConsumerStoppedPropagation&&P){A.current=!0;try{P.call($,m.value),$.dispatchEvent(new Event("change",{bubbles:!0}))}finally{A.current=!1,P.call($,k)}return}const U=D&&!m.hasConsumerStoppedPropagation;if(H&&P){const _=new Event("change",{bubbles:U});P.call($,k),$.dispatchEvent(_)}},[k,m]),o.jsxs(pn.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:h,autoComplete:p,disabled:f,form:g,onChange:$=>{A.current||l($.target.value)},...n,style:{...nj,...n.style},ref:S,defaultValue:k,children:[U1(i)&&!L?o.jsx("option",{value:""}):null,Array.from(w)]},y)},"SelectBubbleInput"));function wN(e){return typeof e=="function"}Fn(wN,"isFunction");function U1(e){return e===""||e===void 0}Fn(U1,"shouldShowPlaceholder");function Cw(e){const t=Sr(e),n=s.useRef(""),r=s.useRef(0),a=s.useCallback(l=>{const u=n.current+l;t(u);function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}Fn(f,"updateSearch"),f(u)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}Fn(Cw,"useTypeaheadSearch");function jw(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=yN(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}Fn(jw,"findNextItem");function yN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Fn(yN,"wrapArray");var GU=Object.defineProperty,Cr=(e,t)=>GU(e,"name",{value:t,configurable:!0}),[Aw,Ude]=zs("Tooltip",[Il]),Ym=Il(),YU="TooltipProvider",qU=700,d4="tooltip.open",[XU,Nw]=Aw(YU),QU=Cr(e=>{const{__scopeTooltip:t,delayDuration:n=qU,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(XU,{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"),f4="Tooltip",[JU,W1]=Aw(f4),eW=Cr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,f=Nw(f4,e.__scopeTooltip),h=Ym(t),[p,g]=s.useState(null),[m,w]=s.useState(void 0),y=Fs(),b=s.useRef(0),S=l??f.disableHoverableContent,k=u??f.delayDuration,C=s.useRef(!1),[E,A]=yi({prop:r,defaultProp:a??!1,onChange:Cr(R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(d4))):f.onClose(),i==null||i(R)},"onChange"),caller:f4}),L=s.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),$=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,A(!0)},[A]),N=s.useCallback(()=>{window.clearTimeout(b.current),b.current=0,A(!1)},[A]),j=s.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,A(!0),b.current=0},k)},[k,A]);s.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const P=m??y;return o.jsx(Im,{...h,children:o.jsx(JU,{scope:t,contentId:P,setContentId:w,open:E,stateAttribute:L,trigger:p,onTriggerChange:g,onTriggerEnter:s.useCallback(()=>{f.isOpenDelayedRef.current?j():$()},[f.isOpenDelayedRef,j,$]),onTriggerLeave:s.useCallback(()=>{S?N():(window.clearTimeout(b.current),b.current=0)},[N,S]),onOpen:$,onClose:N,disableHoverableContent:S,children:n})})},"Tooltip"),I5="TooltipTrigger",tW=s.forwardRef(Cr(function(t,n){const{__scopeTooltip:r,"aria-describedby":a,...i}=t,l=W1(I5,r),u=Nw(I5,r),f=Ym(r),h=s.useRef(null),p=cn(n,h,l.onTriggerChange),g=s.useRef(!1),m=s.useRef(!1),w=s.useCallback(()=>g.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",w),[w]),o.jsx(V1,{asChild:!0,...f,children:o.jsx(pn.button,{"aria-describedby":l.open?NN(a,l.contentId):a,"data-state":l.stateAttribute,...i,ref:p,onPointerMove:Mt(t.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),m.current=!0)}),onPointerLeave:Mt(t.onPointerLeave,()=>{l.onTriggerLeave(),m.current=!1}),onPointerDown:Mt(t.onPointerDown,()=>{l.open&&l.onClose(),g.current=!0,document.addEventListener("pointerup",w,{once:!0})}),onFocus:Mt(t.onFocus,()=>{g.current||l.onOpen()}),onBlur:Mt(t.onBlur,l.onClose),onClick:Mt(t.onClick,l.onClose)})})},"TooltipTrigger")),bN="TooltipPortal",[nW,rW]=Aw(bN,{forceMount:void 0}),sW=Cr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=W1(bN,t);return o.jsx(nW,{scope:t,forceMount:n,children:o.jsx(ps,{present:n||i.open,children:o.jsx(I1,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),h1="TooltipContent",aW=s.forwardRef(Cr(function(t,n){const r=rW(h1,t.__scopeTooltip),{forceMount:a=r.forceMount,side:i="top",...l}=t,u=W1(h1,t.__scopeTooltip);return o.jsx(ps,{present:a||u.open,children:u.disableHoverableContent?o.jsx(xN,{side:i,...l,ref:n}):o.jsx(oW,{side:i,...l,ref:n})})},"TooltipContent")),oW=s.forwardRef(Cr(function(t,n){const r=W1(h1,t.__scopeTooltip),a=Nw(h1,t.__scopeTooltip),i=s.useRef(null),l=cn(n,i),[u,f]=s.useState(null),{trigger:h,onClose:p}=r,g=i.current,{onPointerInTransitChange:m}=a,w=s.useCallback(()=>{f(null),m(!1)},[m]),y=s.useCallback((b,S)=>{const k=b.currentTarget,C={x:b.clientX,y:b.clientY},E=kN(C,k.getBoundingClientRect()),A=SN(C,E),L=EN(S.getBoundingClientRect()),$=jN([...A,...L]);f($),m(!0)},[m]);return s.useEffect(()=>()=>w(),[w]),s.useEffect(()=>{if(h&&g){const b=Cr(k=>y(k,g),"handleTriggerLeave"),S=Cr(k=>y(k,h),"handleContentLeave");return h.addEventListener("pointerleave",b),g.addEventListener("pointerleave",S),()=>{h.removeEventListener("pointerleave",b),g.removeEventListener("pointerleave",S)}}},[h,g,y,w]),s.useEffect(()=>{if(u){const b=Cr(S=>{const k=S.target,C={x:S.clientX,y:S.clientY},E=(h==null?void 0:h.contains(k))||(g==null?void 0:g.contains(k)),A=!CN(C,u);E?w():A&&(w(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,g,u,p,w]),o.jsx(xN,{...t,ref:l})},"TooltipContentHoverable")),iW=Em("TooltipContent"),xN=s.forwardRef(Cr(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":i,id:l,onEscapeKeyDown:u,onPointerDownOutside:f,...h}=t,p=W1(h1,r),g=Ym(r),{onClose:m}=p,[w,y]=s.useState(null),b=cn(n,y);Mm(w),s.useEffect(()=>(document.addEventListener(d4,m),()=>document.removeEventListener(d4,m)),[m]),s.useEffect(()=>{if(p.trigger){const k=Cr(C=>{C.target instanceof Node&&C.target.contains(p.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",k,{capture:!0}),()=>window.removeEventListener("scroll",k,{capture:!0})}},[p.trigger,m]);const{setContentId:S}=p;return mr(()=>(S(l),()=>{S(void 0)}),[l,S]),o.jsx(O1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:k=>k.preventDefault(),onDismiss:m,children:o.jsxs(Fm,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...g,...h,ref:b,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(iW,{children:a}),i?o.jsx(rj,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),lW=s.forwardRef(Cr(function(t,n){const{__scopeTooltip:r,...a}=t,i=Ym(r);return o.jsx(hz,{...i,...a,ref:n})},"TooltipArrow"));function kN(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")}}Cr(kN,"getExitSideFromRect");function SN(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}Cr(SN,"getPaddedExitPoints");function EN(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}]}Cr(EN,"getPointsFromRect");function CN(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,m=f.y;p>r!=m>r&&n<(g-h)*(r-p)/(m-p)+h&&(a=!a)}return a}Cr(CN,"isPointInPolygon");function jN(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),AN(t)}Cr(jN,"getHull");function AN(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)}Cr(AN,"getHullPresorted");function NN(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Cr(NN,"concatAriaDescribedby");var M8={exports:{}};/*!
|
|
93
|
+
Copyright (c) 2018 Jed Watson.
|
|
94
|
+
Licensed under the MIT License (MIT), see
|
|
95
|
+
http://jedwatson.github.io/classnames
|
|
96
|
+
*/var F5;function cW(){return F5||(F5=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})()})(M8)),M8.exports}var uW=cW();const Gt=xS(uW),lo={asChild:{type:"boolean"}},Ro={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}},Mw={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}},dW=["1","2","3","4"],MN={...lo,align:{type:"enum",className:"rt-r-align",values:["start","center"],default:"center"},size:{type:"enum",className:"rt-r-size",values:dW,default:"3",responsive:!0},width:Ro.width,minWidth:Ro.minWidth,maxWidth:{...Ro.maxWidth,default:"600px"},...Mw},RN=["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"],Vl={color:{type:"enum",values:RN,default:void 0}},Rw={color:{type:"enum",values:RN,default:""}},qc={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}},fW=["normal","start","end","both"],PN={trim:{type:"enum",className:"rt-r-lt",values:fW,responsive:!0}},hW=["left","center","right"],LN={align:{type:"enum",className:"rt-r-ta",values:hW,responsive:!0}},pW=["wrap","nowrap","pretty","balance"],TN={wrap:{type:"enum",className:"rt-r-tw",values:pW,responsive:!0}},$N={truncate:{type:"boolean",className:"rt-truncate"}},mW=["light","regular","medium","bold"],DN={weight:{type:"enum",className:"rt-r-weight",values:mW,responsive:!0}},gW=["h1","h2","h3","h4","h5","h6"],vW=["1","2","3","4","5","6","7","8","9"],wW={as:{type:"enum",values:gW,default:"h1"},...lo,size:{type:"enum",className:"rt-r-size",values:vW,default:"6",responsive:!0},...DN,...LN,...PN,...$N,...TN,...Vl,...qc},yW=["initial","xs","sm","md","lg","xl"],Pw=new Set(yW);function HN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U0(e){return typeof e=="object"&&e!==null&&Object.keys(e).some(t=>Pw.has(t))}function tl({className:e,customProperties:t,...n}){const r=Ap({allowArbitraryValues:!0,className:e,...n}),a=bW({customProperties:t,...n});return[r,a]}function Ap({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:a=i=>i}){const i=[];if(t){if(typeof t=="string"&&r.includes(t))return _5(n,t,a);if(U0(t)){const l=t;for(const u in l){if(!HN(l,u)||!Pw.has(u))continue;const f=l[u];if(f!==void 0){if(r.includes(f)){const h=_5(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 _5(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 bW({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(!HN(i,l)||!Pw.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 Np(...e){let t={};for(const n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}function xW(...e){return Object.assign({},...e)}function Mr(e,...t){let n,r;const a={...e},i=xW(...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=Ap({allowArbitraryValues:!1,value:u,className:f.className,propValues:f.values,parseValue:f.parseValue});n=Gt(n,p);continue}if(f.type==="string"||f.type==="enum | string"){const p=f.type==="string"?[]:f.values,[g,m]=tl({className:f.className,customProperties:f.customProperties,propValues:p,parseValue:f.parseValue,value:u});r=Np(r,m),n=Gt(n,g);continue}if(f.type==="boolean"&&u){n=Gt(n,f.className);continue}}}return a.className=Gt(n,e.className),a.style=Np(r,e.style),a}const lc=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],_o={m:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:lc,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}},Lw=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="h1",color:l,...u}=Mr(e,wW,_o);return s.createElement(Uc,{"data-accent-color":l,...u,ref:t,className:Gt("rt-Heading",r)},a?n:s.createElement(i,null,n))});Lw.displayName="Heading";const kW=["span","div","label","p"],SW=["1","2","3","4","5","6","7","8","9"],EW={as:{type:"enum",values:kW,default:"span"},...lo,size:{type:"enum",className:"rt-r-size",values:SW,responsive:!0},...DN,...LN,...PN,...$N,...TN,...Vl,...qc},$c=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="span",color:l,...u}=Mr(e,EW,_o);return s.createElement(Uc,{"data-accent-color":l,...u,ref:t,className:Gt("rt-Text",r)},a?n:s.createElement(i,null,n))});$c.displayName="Text";function CW(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 jW=["none","small","medium","large","full"],qm={radius:{type:"enum",values:jW,default:void 0}},ra={hasBackground:{default:!0},appearance:{default:"inherit"},accentColor:{default:"indigo"},grayColor:{default:"auto"},panelBackground:{default:"translucent"},radius:{default:"medium"},scaling:{default:"100%"}},Ru=()=>{},Mp=s.createContext(void 0);function Tw(){const e=s.useContext(Mp);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const co=s.forwardRef((e,t)=>s.useContext(Mp)===void 0?s.createElement(QU,{delayDuration:200},s.createElement(T_,{dir:"ltr"},s.createElement(ON,{...e,ref:t}))):s.createElement($w,{...e,ref:t}));co.displayName="Theme";const ON=s.forwardRef((e,t)=>{const{appearance:n=ra.appearance.default,accentColor:r=ra.accentColor.default,grayColor:a=ra.grayColor.default,panelBackground:i=ra.panelBackground.default,radius:l=ra.radius.default,scaling:u=ra.scaling.default,hasBackground:f=ra.hasBackground.default,...h}=e,[p,g]=s.useState(n);s.useEffect(()=>g(n),[n]);const[m,w]=s.useState(r);s.useEffect(()=>w(r),[r]);const[y,b]=s.useState(a);s.useEffect(()=>b(a),[a]);const[S,k]=s.useState(i);s.useEffect(()=>k(i),[i]);const[C,E]=s.useState(l);s.useEffect(()=>E(l),[l]);const[A,L]=s.useState(u);return s.useEffect(()=>L(u),[u]),s.createElement($w,{...h,ref:t,isRoot:!0,hasBackground:f,appearance:p,accentColor:m,grayColor:y,panelBackground:S,radius:C,scaling:A,onAppearanceChange:g,onAccentColorChange:w,onGrayColorChange:b,onPanelBackgroundChange:k,onRadiusChange:E,onScalingChange:L})});ON.displayName="ThemeRoot";const $w=s.forwardRef((e,t)=>{const n=s.useContext(Mp),{asChild:r,isRoot:a,hasBackground:i,appearance:l=(n==null?void 0:n.appearance)??ra.appearance.default,accentColor:u=(n==null?void 0:n.accentColor)??ra.accentColor.default,grayColor:f=(n==null?void 0:n.resolvedGrayColor)??ra.grayColor.default,panelBackground:h=(n==null?void 0:n.panelBackground)??ra.panelBackground.default,radius:p=(n==null?void 0:n.radius)??ra.radius.default,scaling:g=(n==null?void 0:n.scaling)??ra.scaling.default,onAppearanceChange:m=Ru,onAccentColorChange:w=Ru,onGrayColorChange:y=Ru,onPanelBackgroundChange:b=Ru,onRadiusChange:S=Ru,onScalingChange:k=Ru,...C}=e,E=r?Uc:"div",A=f==="auto"?CW(u):f,L=e.appearance==="light"||e.appearance==="dark",$=i===void 0?a||L:i;return s.createElement(Mp.Provider,{value:s.useMemo(()=>({appearance:l,accentColor:u,grayColor:f,resolvedGrayColor:A,panelBackground:h,radius:p,scaling:g,onAppearanceChange:m,onAccentColorChange:w,onGrayColorChange:y,onPanelBackgroundChange:b,onRadiusChange:S,onScalingChange:k}),[l,u,f,A,h,p,g,m,w,y,b,S,k])},s.createElement(E,{"data-is-root-theme":a?"true":"false","data-accent-color":u,"data-gray-color":A,"data-has-background":$?"true":"false","data-panel-background":h,"data-radius":p,"data-scaling":g,ref:t,...C,className:Gt("radix-themes",{light:l==="light",dark:l==="dark"},C.className)}))});$w.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},K1=e=>s.createElement(ZV,{...e});K1.displayName="AlertDialog.Root";const IN=s.forwardRef(({children:e,...t},n)=>s.createElement(zV,{...t,ref:n,asChild:!0},Li(e)));IN.displayName="AlertDialog.Trigger";const G1=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=MN,{className:i}=Mr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=Mr(t,a);return s.createElement(BV,{container:f,forceMount:u},s.createElement(co,{asChild:!0},s.createElement(UV,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${i}`},s.createElement(YV,{...h,ref:n,className:Gt("rt-BaseDialogContent","rt-AlertDialogContent",l)}))))))});G1.displayName="AlertDialog.Content";const Y1=s.forwardRef((e,t)=>s.createElement(qV,{asChild:!0},s.createElement(Lw,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));Y1.displayName="AlertDialog.Title";const q1=s.forwardRef((e,t)=>s.createElement(XV,{asChild:!0},s.createElement($c,{as:"p",size:"3",...e,asChild:!1,ref:t})));q1.displayName="AlertDialog.Description";const X1=s.forwardRef(({children:e,...t},n)=>s.createElement(QV,{...t,ref:n,asChild:!0},Li(e)));X1.displayName="AlertDialog.Action";const Q1=s.forwardRef(({children:e,...t},n)=>s.createElement(eZ,{...t,ref:n,asChild:!0},Li(e)));Q1.displayName="AlertDialog.Cancel";function AW(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 NW=["1","2","3"],MW=["solid","soft","surface","outline"],RW={...lo,size:{type:"enum",className:"rt-r-size",values:NW,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:MW,default:"soft"},...Rw,...qc,...qm},FN=s.forwardRef((e,t)=>{const{asChild:n,className:r,color:a,radius:i,...l}=Mr(e,RW,_o),u=n?Uc:"span";return s.createElement(u,{"data-accent-color":a,"data-radius":i,...l,ref:t,className:Gt("rt-reset","rt-Badge",r)})});FN.displayName="Badge";const _N=Uc,PW=["div","span"],LW=["none","inline","inline-block","block","contents"],TW={as:{type:"enum",values:PW,default:"div"},...lo,display:{type:"enum",className:"rt-r-display",values:LW,responsive:!0}},cc=["0","1","2","3","4","5","6","7","8","9"],$W={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:cc,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:cc,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:cc,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:cc,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:cc,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:cc,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:cc,responsive:!0}},R8=["visible","hidden","clip","scroll","auto"],DW=["static","relative","absolute","fixed","sticky"],x0=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],HW=["0","1"],OW=["0","1"],IW=["start","center","end","baseline","stretch"],FW=["start","center","end","baseline","stretch"],VN={...$W,...Ro,...Mw,position:{type:"enum",className:"rt-r-position",values:DW,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:x0,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:x0,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:x0,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:x0,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:x0,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:R8,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:R8,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:R8,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:HW,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:OW,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:IW,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:FW,responsive:!0}},W0=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=Mr(e,TW,VN,_o);return s.createElement(r?_N:a,{...i,ref:t,className:Gt("rt-Box",n)})});W0.displayName="Box";const _W=["1","2","3","4"],VW=["classic","solid","soft","surface","outline","ghost"],V5={...lo,size:{type:"enum",className:"rt-r-size",values:_W,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:VW,default:"solid"},...Rw,...qc,...qm,loading:{type:"boolean",className:"rt-loading",default:!1}},P8=["0","1","2","3","4","5","6","7","8","9"],ZW={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:P8,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:P8,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:P8,responsive:!0}},zW=["div","span"],BW=["none","inline-flex","flex"],UW=["row","column","row-reverse","column-reverse"],WW=["start","center","end","baseline","stretch"],KW=["start","center","end","between"],GW=["nowrap","wrap","wrap-reverse"],YW={as:{type:"enum",values:zW,default:"div"},...lo,display:{type:"enum",className:"rt-r-display",values:BW,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:UW,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:WW,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:KW,parseValue:qW,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:GW,responsive:!0},...ZW};function qW(e){return e==="between"?"space-between":e}const Zs=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=Mr(e,YW,VN,_o);return s.createElement(r?_N:a,{...i,ref:t,className:Gt("rt-Flex",n)})});Zs.displayName="Flex";const XW=["1","2","3"],QW={size:{type:"enum",className:"rt-r-size",values:XW,default:"2",responsive:!0},loading:{type:"boolean",default:!0}},Tr=s.forwardRef((e,t)=>{const{className:n,children:r,loading:a,...i}=Mr(e,QW,_o);if(!a)return r;const l=s.createElement("span",{...i,ref:t,className:Gt("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(Zs,{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(Zs,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,l))))});Tr.displayName="Spinner";const JW=rj;function ZN(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r)]))}function eK(e){return e==="3"?"3":"2"}function tK(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}const zN=s.forwardRef((e,t)=>{const{size:n=V5.size.default}=e,{className:r,children:a,asChild:i,color:l,radius:u,disabled:f=e.loading,...h}=Mr(e,V5,_o),p=i?Uc:"button";return s.createElement(p,{"data-disabled":f||void 0,"data-accent-color":l,"data-radius":u,...h,ref:t,className:Gt("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(JW,null,a),s.createElement(Zs,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,s.createElement(Tr,{size:ZN(n,tK)})))):a)});zN.displayName="BaseButton";const ja=s.forwardRef(({className:e,...t},n)=>s.createElement(zN,{...t,ref:n,className:Gt("rt-Button",e)}));ja.displayName="Button";const nK=["1","2","3"],rK=["soft","surface","outline"],Z5={...lo,size:{type:"enum",className:"rt-r-size",values:nK,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:rK,default:"soft"},...Rw,...qc},BN=s.createContext({}),h4=s.forwardRef((e,t)=>{const{size:n=Z5.size.default}=e,{asChild:r,children:a,className:i,color:l,...u}=Mr(e,Z5,_o),f=r?Uc:"div";return s.createElement(f,{"data-accent-color":l,...u,className:Gt("rt-CalloutRoot",i),ref:t},s.createElement(BN.Provider,{value:s.useMemo(()=>({size:n}),[n])},a))});h4.displayName="Callout.Root";const sK=s.forwardRef(({className:e,...t},n)=>s.createElement("div",{...t,className:Gt("rt-CalloutIcon",e),ref:n}));sK.displayName="Callout.Icon";const p4=s.forwardRef(({className:e,...t},n)=>{const{size:r}=s.useContext(BN);return s.createElement($c,{as:"p",size:ZN(r,eK),...t,asChild:!1,ref:n,className:Gt("rt-CalloutText",e)})});p4.displayName="Callout.Text";const aK=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.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"})));aK.displayName="ThickDividerHorizontalIcon";const Hd=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.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"})));Hd.displayName="ThickCheckIcon";const UN=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.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"})));UN.displayName="ChevronDownIcon";const Dw=zn.forwardRef((e,t)=>zn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},zn.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"})));Dw.displayName="ThickChevronRightIcon";const oK=["1","2","3"],k0={...lo,size:{values:oK,default:"1"},...qm,scrollbars:{default:"both"}};function iK(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 uc=_o.m.values;function lK(e){const[t,n]=tl({className:"rt-r-m",customProperties:["--margin"],propValues:uc,value:e.m}),[r,a]=tl({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:uc,value:e.mx}),[i,l]=tl({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:uc,value:e.my}),[u,f]=tl({className:"rt-r-mt",customProperties:["--margin-top"],propValues:uc,value:e.mt}),[h,p]=tl({className:"rt-r-mr",customProperties:["--margin-right"],propValues:uc,value:e.mr}),[g,m]=tl({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:uc,value:e.mb}),[w,y]=tl({className:"rt-r-ml",customProperties:["--margin-left"],propValues:uc,value:e.ml});return[Gt(t,r,i,u,h,g,w),Np(n,a,l,f,p,m,y)]}const J1=s.forwardRef((e,t)=>{const{rest:n,...r}=iK(e),[a,i]=lK(r),{asChild:l,children:u,className:f,style:h,type:p,scrollHideDelay:g=p!=="scroll"?0:void 0,dir:m,size:w=k0.size.default,radius:y=k0.radius.default,scrollbars:b=k0.scrollbars.default,...S}=n;return s.createElement(iN,{type:p,scrollHideDelay:g,className:Gt("rt-ScrollAreaRoot",a,f),style:Np(i,h),asChild:l},AW({asChild:l,children:u},k=>s.createElement(s.Fragment,null,s.createElement(cN,{...S,ref:t,className:"rt-ScrollAreaViewport"},k),s.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),b!=="vertical"?s.createElement(o4,{"data-radius":y,orientation:"horizontal",className:Gt("rt-ScrollAreaScrollbar",Ap({className:"rt-r-size",value:w,propValues:k0.size.values}))},s.createElement(l4,{className:"rt-ScrollAreaThumb"})):null,b!=="horizontal"?s.createElement(o4,{"data-radius":y,orientation:"vertical",className:Gt("rt-ScrollAreaScrollbar",Ap({className:"rt-r-size",value:w,propValues:k0.size.values}))},s.createElement(l4,{className:"rt-ScrollAreaThumb"})):null,b==="both"?s.createElement(aU,{className:"rt-ScrollAreaCorner"}):null)))});J1.displayName="ScrollArea";const cK=["1","2"],uK=["solid","soft"],Ao={size:{type:"enum",className:"rt-r-size",values:cK,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:uK,default:"solid"},...Vl,...qc},WN={...lo,...Vl},KN={...Vl},GN={...Vl},ef=e=>s.createElement(eB,{...e});ef.displayName="ContextMenu.Root";const tf=s.forwardRef(({children:e,...t},n)=>s.createElement(nB,{...t,ref:n,asChild:!0},Li(e)));tf.displayName="ContextMenu.Trigger";const YN=s.createContext({}),nf=s.forwardRef((e,t)=>{const n=Tw(),{size:r=Ao.size.default,variant:a=Ao.variant.default,highContrast:i=Ao.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=Mr(e,Ao),m=f||n.accentColor;return s.createElement(YA,{container:h,forceMount:p},s.createElement(co,{asChild:!0},s.createElement(sB,{"data-accent-color":m,alignOffset:-Number(r)*4,collisionPadding:10,...g,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",l)},s.createElement(J1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-ContextMenuViewport")},s.createElement(YN.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:m,highContrast:i}),[r,a,m,i])},u))))))});nf.displayName="ContextMenu.Content";const dK=s.forwardRef(({className:e,...t},n)=>s.createElement(oB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuLabel","rt-ContextMenuLabel",e)}));dK.displayName="ContextMenu.Label";const rf=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=WN.color.default,shortcut:i,...l}=e;return s.createElement(iB,{"data-accent-color":a,...l,ref:t,className:Gt("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",n)},s.createElement(Cm,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},i))});rf.displayName="ContextMenu.Item";const fK=s.forwardRef(({className:e,...t},n)=>s.createElement(aB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuGroup","rt-ContextMenuGroup",e)}));fK.displayName="ContextMenu.Group";const hK=s.forwardRef(({className:e,...t},n)=>s.createElement(cB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",e)}));hK.displayName="ContextMenu.RadioGroup";const pK=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=GN.color.default,...i}=e;return s.createElement(uB,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Gt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",r)},s.createElement(Cm,null,n),s.createElement(qA,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});pK.displayName="ContextMenu.RadioItem";const mK=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=KN.color.default,...l}=e;return s.createElement(lB,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Gt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",r)},s.createElement(Cm,null,n),s.createElement(qA,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(Hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},a))});mK.displayName="ContextMenu.CheckboxItem";const gK=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(fB,{...a,asChild:!1,ref:t,className:Gt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},s.createElement(Dw,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});gK.displayName="ContextMenu.SubTrigger";const vK=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(YN),{className:l,children:u,container:f,forceMount:h,...p}=Mr({size:n,variant:r,color:a,highContrast:i,...e},Ao);return s.createElement(YA,{container:f,forceMount:h},s.createElement(co,{asChild:!0},s.createElement(hB,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",l)},s.createElement(J1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-ContextMenuViewport")},u)))))});vK.displayName="ContextMenu.SubContent";const Xm=s.forwardRef(({className:e,...t},n)=>s.createElement(dB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuSeparator","rt-ContextMenuSeparator",e)}));Xm.displayName="ContextMenu.Separator";const Hw=e=>s.createElement(Ll,{...e,modal:!0});Hw.displayName="Dialog.Root";const wK=s.forwardRef(({children:e,...t},n)=>s.createElement(Jv,{...t,ref:n,asChild:!0},Li(e)));wK.displayName="Dialog.Trigger";const Ow=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=MN,{className:i}=Mr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=Mr(t,a);return s.createElement(Tl,{container:f,forceMount:u},s.createElement(co,{asChild:!0},s.createElement($l,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${i}`},s.createElement(Dl,{...h,ref:n,className:Gt("rt-BaseDialogContent","rt-DialogContent",l)}))))))});Ow.displayName="Dialog.Content";const Iw=s.forwardRef((e,t)=>s.createElement(Hl,{asChild:!0},s.createElement(Lw,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));Iw.displayName="Dialog.Title";const yK=s.forwardRef((e,t)=>s.createElement(ew,{asChild:!0},s.createElement($c,{as:"p",size:"3",...e,asChild:!1,ref:t})));yK.displayName="Dialog.Description";const bK=s.forwardRef(({children:e,...t},n)=>s.createElement(_1,{...t,ref:n,asChild:!0},Li(e)));bK.displayName="Dialog.Close";const Es=e=>s.createElement(vB,{...e});Es.displayName="DropdownMenu.Root";const Cs=s.forwardRef(({children:e,...t},n)=>s.createElement(yB,{...t,ref:n,asChild:!0},Li(e)));Cs.displayName="DropdownMenu.Trigger";const qN=s.createContext({}),js=s.forwardRef((e,t)=>{const n=Tw(),{size:r=Ao.size.default,variant:a=Ao.variant.default,highContrast:i=Ao.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=Mr(e,Ao),m=f||n.accentColor;return s.createElement(QA,{container:h,forceMount:p},s.createElement(co,{asChild:!0},s.createElement(xB,{"data-accent-color":m,align:"start",sideOffset:4,collisionPadding:10,...g,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",l)},s.createElement(J1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},s.createElement(qN.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:m,highContrast:i}),[r,a,m,i])},u))))))});js.displayName="DropdownMenu.Content";const m4=s.forwardRef(({className:e,...t},n)=>s.createElement(SB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));m4.displayName="DropdownMenu.Label";const Wn=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=WN.color.default,shortcut:i,...l}=e;return s.createElement(EB,{"data-accent-color":a,...l,ref:t,className:Gt("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},s.createElement(Cm,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});Wn.displayName="DropdownMenu.Item";const xK=s.forwardRef(({className:e,...t},n)=>s.createElement(kB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));xK.displayName="DropdownMenu.Group";const Rp=s.forwardRef(({className:e,...t},n)=>s.createElement(jB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));Rp.displayName="DropdownMenu.RadioGroup";const Gu=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=GN.color.default,...i}=e;return s.createElement(AB,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Gt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",r)},n,s.createElement(JA,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Hd,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});Gu.displayName="DropdownMenu.RadioItem";const kK=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=KN.color.default,...l}=e;return s.createElement(CB,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Gt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",r)},n,s.createElement(JA,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(Hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},a))});kK.displayName="DropdownMenu.CheckboxItem";const SK=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(MB,{...a,asChild:!1,ref:t,className:Gt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s.createElement(Dw,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});SK.displayName="DropdownMenu.SubTrigger";const EK=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(qN),{className:l,children:u,container:f,forceMount:h,...p}=Mr({size:n,variant:r,color:a,highContrast:i,...e},Ao);return s.createElement(QA,{container:f,forceMount:h},s.createElement(co,{asChild:!0},s.createElement(RB,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Gt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},s.createElement(J1,{type:"auto"},s.createElement("div",{className:Gt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},u)))))});EK.displayName="DropdownMenu.SubContent";const Ec=s.forwardRef(({className:e,...t},n)=>s.createElement(NB,{...t,asChild:!1,ref:n,className:Gt("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));Ec.displayName="DropdownMenu.Separator";const CK=["1","2","3","4"],jK={...lo,size:{type:"enum",className:"rt-r-size",values:CK,default:"2",responsive:!0},width:Ro.width,minWidth:Ro.minWidth,maxWidth:{...Ro.maxWidth,default:"480px"},...Mw},yd=e=>s.createElement(DB,{...e});yd.displayName="Popover.Root";const bd=s.forwardRef(({children:e,...t},n)=>s.createElement(FB,{...t,ref:n,asChild:!0},Li(e)));bd.displayName="Popover.Trigger";const xd=s.forwardRef((e,t)=>{const{className:n,forceMount:r,container:a,...i}=Mr(e,jK);return s.createElement(ZB,{container:a,forceMount:r},s.createElement(co,{asChild:!0},s.createElement(zB,{align:"start",sideOffset:8,collisionPadding:10,...i,ref:t,className:Gt("rt-PopperContent","rt-PopoverContent",n)})))});xd.displayName="Popover.Content";const AK=s.forwardRef(({children:e,...t},n)=>s.createElement(GB,{...t,ref:n,asChild:!0},Li(e)));AK.displayName="Popover.Close";const NK=s.forwardRef(({children:e,...t},n)=>s.createElement(OB,{...t,ref:n}));NK.displayName="Popover.Anchor";const MK=["1","2","3"],Fw={size:{type:"enum",className:"rt-r-size",values:MK,default:"2",responsive:!0}},RK=["classic","surface","soft","ghost"],PK={variant:{type:"enum",className:"rt-variant",values:RK,default:"surface"},...Vl,...qm,placeholder:{type:"string"}},LK=["solid","soft"],TK={variant:{type:"enum",className:"rt-variant",values:LK,default:"solid"},...Vl,...qc},_w=s.createContext({}),XN=e=>{const{children:t,size:n=Fw.size.default,...r}=e;return s.createElement(gU,{...r},s.createElement(_w.Provider,{value:s.useMemo(()=>({size:n}),[n])},t))};XN.displayName="Select.Root";const QN=s.forwardRef((e,t)=>{const n=s.useContext(_w),{children:r,className:a,color:i,radius:l,placeholder:u,...f}=Mr({size:n==null?void 0:n.size,...e},{size:Fw.size},PK,_o);return s.createElement(wU,{asChild:!0},s.createElement("button",{"data-accent-color":i,"data-radius":l,...f,ref:t,className:Gt("rt-reset","rt-SelectTrigger",a)},s.createElement("span",{className:"rt-SelectTriggerInner"},s.createElement(bU,{placeholder:u},r)),s.createElement(xU,{asChild:!0},s.createElement(UN,{className:"rt-SelectIcon"}))))});QN.displayName="Select.Trigger";const JN=s.forwardRef((e,t)=>{const n=s.useContext(_w),{className:r,children:a,color:i,container:l,...u}=Mr({size:n==null?void 0:n.size,...e},{size:Fw.size},TK),f=Tw(),h=i||f.accentColor;return s.createElement(CU,{container:l},s.createElement(co,{asChild:!0},s.createElement(jU,{"data-accent-color":h,sideOffset:4,...u,asChild:!1,ref:t,className:Gt({"rt-PopperContent":u.position==="popper"},"rt-SelectContent",r)},s.createElement(iN,{type:"auto",className:"rt-ScrollAreaRoot"},s.createElement(TU,{asChild:!0,className:"rt-SelectViewport"},s.createElement(cN,{className:"rt-ScrollAreaViewport",style:{overflowY:void 0}},a)),s.createElement(o4,{className:"rt-ScrollAreaScrollbar rt-r-size-1",orientation:"vertical"},s.createElement(l4,{className:"rt-ScrollAreaThumb"}))))))});JN.displayName="Select.Content";const eM=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(VU,{...a,asChild:!1,ref:t,className:Gt("rt-SelectItem",n)},s.createElement(BU,{className:"rt-SelectItemIndicator"},s.createElement(Hd,{className:"rt-SelectItemIndicatorIcon"})),s.createElement(ZU,null,r))});eM.displayName="Select.Item";const $K=s.forwardRef(({className:e,...t},n)=>s.createElement(OU,{...t,asChild:!1,ref:n,className:Gt("rt-SelectGroup",e)}));$K.displayName="Select.Group";const DK=s.forwardRef(({className:e,...t},n)=>s.createElement(FU,{...t,asChild:!1,ref:n,className:Gt("rt-SelectLabel",e)}));DK.displayName="Select.Label";const HK=s.forwardRef(({className:e,...t},n)=>s.createElement(UU,{...t,asChild:!1,ref:n,className:Gt("rt-SelectSeparator",e)}));HK.displayName="Select.Separator";const OK={content:{type:"ReactNode",required:!0},width:Ro.width,minWidth:Ro.minWidth,maxWidth:{...Ro.maxWidth,default:"360px"}},Vw=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,...m}=Mr(e,OK),w={open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f};return s.createElement(eW,{...w},s.createElement(tW,{asChild:!0},n),s.createElement(sW,{container:p,forceMount:g},s.createElement(co,{asChild:!0},s.createElement(aW,{sideOffset:4,collisionPadding:10,...m,asChild:!1,ref:t,className:Gt("rt-TooltipContent",r)},s.createElement($c,{as:"p",className:"rt-TooltipText",size:"1"},h),s.createElement(lW,{className:"rt-TooltipArrow"})))))});Vw.displayName="Tooltip";const Qr={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 tM(e,t){try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}const g4="scenri:pref-changed";function nM(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}try{window.dispatchEvent(new CustomEvent(g4,{detail:{key:e,value:t}}))}catch{}}function v4(e,t){try{const n=localStorage.getItem(e);return n===null?null:(localStorage.setItem(t,n),localStorage.removeItem(e),n)}catch{return null}}function Pa(e,t){const[n,r]=s.useState(()=>tM(e,t)),a=s.useRef(n);return s.useEffect(()=>{Object.is(a.current,n)||(a.current=n,nM(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(g4,i),()=>window.removeEventListener(g4,i)},[e]),[n,r]}function IK(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 L8(e,t){const[n,r]=Pa(e,t),[a,i]=s.useState(null);return[a??n,u=>{i(null),r(u)},i,a]}const FK=()=>tM(Qr.lastBrand,null),_K=e=>nM(Qr.lastBrand,e),w4="sc-theme",VK="bt-theme",ZK=()=>window.matchMedia("(prefers-color-scheme: light)").matches,rM=s.createContext({choice:"system",mode:"dark",setChoice:()=>{},toggle:()=>{}}),zK=()=>s.useContext(rM);function BK(){const e=localStorage.getItem(w4)??v4(VK,w4);return e==="light"||e==="dark"||e==="system"?e:"system"}function UK({children:e}){const[t,n]=s.useState(BK),[r,a]=s.useState(()=>ZK()?"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(w4,t)},[i,t]);const l=s.useMemo(()=>({choice:t,mode:i,setChoice:n,toggle:()=>n(i==="dark"?"light":"dark")}),[t,i]);return o.jsx(rM.Provider,{value:l,children:o.jsx(co,{appearance:i,accentColor:"gray",grayColor:"gray",radius:"large",scaling:"100%",children:e})})}const sM=s.createContext({push:()=>{}}),rr=()=>s.useContext(sM),WK=3,KK=140,K0=e=>{var t;return!!(e.action||(t=e.actions)!=null&&t.length)},GK=e=>{var t;return((t=e.actions)!=null&&t.length?e.actions:e.action?[e.action]:[]).slice(0,2)};function T8(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=K0(e)?9e3:4e3,r=K0(e)?14e3:8e3;return Math.min(n+Math.max(0,t-40)*45,r)}function YK(e,t,n){const r=n>1?` (${n} times)`:"";return`${e}${r}${t?` ${t}`:""}`}const qK=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function XK({kind:e}){if(e==="info")return null;const t=e==="success"?Gn:e==="warning"?Sm:Bc;return o.jsx(t,{className:"sc-toast-ic",size:16,weight:"regular","aria-hidden":"true"})}function QK({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(C=>{a.current=C,n(C)},[]),g=s.useCallback(C=>{const E=C.kind==="error"?u.current:l.current;if(!E)return;const A=YK(C.title,C.detail,C.count);E.textContent=A,window.setTimeout(()=>{E.textContent===A&&(E.textContent="")},1e3)},[]),m=s.useCallback(C=>{const E=i.current.get(C);(E==null?void 0:E.handle)!=null&&window.clearTimeout(E.handle),i.current.delete(C),p(a.current.map(A=>A.id===C&&!A.leaving?{...A,leaving:!0}:A)),window.setTimeout(()=>p(a.current.filter(A=>A.id!==C)),KK+40)},[p]),w=s.useCallback((C,E)=>{if(!Number.isFinite(E))return;const A=i.current.get(C)??{remaining:E,since:0,handle:null};A.handle!=null&&window.clearTimeout(A.handle),A.remaining=E,A.since=Date.now(),A.handle=window.setTimeout(()=>m(C),E),i.current.set(C,A)},[m]),y=s.useCallback(C=>{const E=i.current.get(C);!E||E.handle==null||(window.clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.remaining-(Date.now()-E.since)))},[]),b=s.useCallback(C=>{const E=i.current.get(C);!E||E.handle!=null||w(C,E.remaining)},[w]);s.useEffect(()=>{const C=()=>{const E=[...i.current.keys()];document.hidden?E.forEach(y):E.forEach(b)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[y,b]),s.useLayoutEffect(()=>{const C=f.current;if(!C)return;const E=new Map,A=!qK();for(const L of C.querySelectorAll("[data-toast-id]")){const $=Number(L.dataset.toastId),N=L.getBoundingClientRect().top;E.set($,N);const j=h.current.get($);if(!A||j===void 0||L.hasAttribute("data-leaving"))continue;const P=j-N;P&&(L.style.transition="none",L.style.transform=`translateY(${P}px)`,L.getBoundingClientRect(),L.style.transition="transform 160ms cubic-bezier(.2, .7, .3, 1)",L.style.transform="")}h.current=E},[t]),s.useLayoutEffect(()=>{const C=f.current;if(!C)return;const E=()=>{const $=document.querySelector(".sc-canvas-dock");if(!$||!t.length){delete C.dataset.overDock;return}const N=C.getBoundingClientRect(),j=$.getBoundingClientRect();N.left<j.right&&j.left<N.right?(C.style.setProperty("--sc-toasts-over-dock",`${Math.round(window.innerHeight-j.top+10)}px`),C.dataset.overDock=""):delete C.dataset.overDock};E(),window.addEventListener("resize",E);const A=document.querySelector(".sc-canvas-dock"),L=typeof ResizeObserver>"u"||!A?null:new ResizeObserver(E);return L==null||L.observe(A),()=>{window.removeEventListener("resize",E),L==null||L.disconnect()}},[t]);const S=s.useCallback(C=>{const E=a.current.filter(j=>!j.leaving),A=K0(C)?void 0:E.find(j=>j.kind===C.kind&&j.title===C.title&&j.detail===C.detail&&!K0(j));if(A){const j={...A,count:A.count+1};p(a.current.map(R=>R.id===A.id?j:R));const P=i.current.get(A.id);P&&P.handle==null?P.remaining=T8(j):w(A.id,T8(j)),j.quiet||g(j);return}const L={...C,id:r.current++,count:1},$=[...a.current,L],N=j=>!j.leaving;for(;$.filter(N).length>WK;){let j=$.findIndex(H=>N(H)&&H.kind!=="error"&&!K0(H));j===-1&&(j=$.findIndex(H=>N(H)&&H.kind!=="error")),j===-1&&(j=$.findIndex(N));const P=$.splice(j,1)[0],R=i.current.get(P.id);(R==null?void 0:R.handle)!=null&&window.clearTimeout(R.handle),i.current.delete(P.id)}p($),w(L.id,T8(L)),L.quiet||g(L)},[g,w,p]),k=s.useMemo(()=>({push:S}),[S]);return s.useEffect(()=>{if(typeof localStorage<"u"&&localStorage.getItem("scenri:toast-probe"))return window.__scenriToast=S,()=>{delete window.__scenriToast}},[S]),o.jsxs(sM.Provider,{value:k,children:[e,Ur.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:z5,onMouseDown:z5,children:t.map(C=>{const E=GK(C);return o.jsx("div",{className:"sc-toast-wrap","data-toast-id":C.id,"data-leaving":C.leaving||void 0,children:o.jsxs("article",{className:"sc-toast","data-kind":C.kind,onPointerEnter:()=>y(C.id),onPointerLeave:()=>b(C.id),onFocus:()=>y(C.id),onBlur:A=>{A.currentTarget.contains(A.relatedTarget)||b(C.id)},children:[o.jsx(XK,{kind:C.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:[C.title,C.count>1?o.jsxs("span",{className:"sc-toast-n",children:["×",C.count]}):null]}),C.detail?o.jsx("small",{children:C.detail.slice(0,160)}):null]}),o.jsx("button",{type:"button",className:"sc-toast-x",onClick:()=>m(C.id),"aria-label":"Dismiss",children:o.jsx(jn,{size:14,weight:"regular"})})]}),E.length?o.jsx("div",{className:"sc-toast-acts",children:E.map(A=>o.jsx("button",{type:"button",className:"sc-toast-act",onClick:()=>{A.onClick(),m(C.id)},children:A.label},A.label))}):null]})]})},C.id)})})]}),document.body)]})}function z5(e){e.stopPropagation(),e.type==="mousedown"&&e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()}async function Ye(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 JK=(e,t,n)=>Ye("DELETE",`/api/brands/${e}/${t}/${n}`),y4=(e,t)=>JK(e,"products",t);async function aM(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 eG=e=>`/api/brands/${e}/export`;async function tG(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 p1(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 Pp(e){if(!e||typeof e!="object")return e;const{products:t,scenes:n,characters:r,...a}=e;return a}function nG(e,t,n){try{return fetch(`/api/brands/${e}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({brand:Pp(t),keepAssets:!0,base:Pp(n)}),keepalive:!0}).then(r=>r.ok?r.json():null).catch(()=>null)}catch{return Promise.resolve(null)}}const Dr=e=>`/api/images/${e}`,es=e=>e!=null&&e.startsWith("asset:")?Dr(e.slice(6)):null,oM={large:960,tile:640,small:320,micro:160},vn=(e,t)=>`${Dr(e)}/thumb?w=${oM[t]}`,Qm=(e,t)=>e!=null&&e.startsWith("asset:")?vn(e.slice(6),t):null,rG=/^\/api\/images\/([a-f0-9]{32})(?:\/thumb\?w=\d+)?$/,sG=/^(\/api\/(?:(?:presenter-avatars|presenter-thumbnails|scene-thumbnails|demo-product-thumbnails|showcase-previews)\/[a-z0-9-]+|scene-previews\/[a-z0-9-]+\/ref-[0-9]{2})\.jpg)(?:\?v=(\d+))?(?:[?&]w=\d+)?$/;function Tn(e,t){if(!e)return e;const n=rG.exec(e);if(n)return t==="full"?Dr(n[1]):vn(n[1],t);const r=sG.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=${oM[t]}`}function kc(e){const t=Tn(e,"tile"),n=Tn(e,"large");if(!(!t||!n||t===n))return`${t} 640w, ${n} 960w`}const iM={large:"(max-width: 720px) 50vw, 360px",compact:"(max-width: 720px) 50vw, 240px"};function B5(e){return e.every(t=>t.kind==="root")}let lM=new Map;function aG(e){const t=new Map;for(const n of e)for(const r of n.legacyNames??[])r!==n.name&&t.set(r,n.name);lM=t}function oG(e){var r;const t=e.promptHead??"",n=(r=/^\[([^\]]+)\]/.exec(t))==null?void 0:r[1];if(n)return lM.get(n)??n;if(t.startsWith("Remove all overlaid marketing text")||t.startsWith("Remove ALL text"))return"Text lift"}function Hr(e){const t=oG(e);return t||(e.promptHead??"").trim().split(/\s+/).slice(0,6).join(" ")||(e.kind==="edit"?"Edit":"Generation")}const cM=[{id:"newest",label:"Newest first"},{id:"oldest",label:"Oldest first"},{id:"cost",label:"Highest cost"},{id:"keepers",label:"Keepers first"}];function iG(e){return cM.some(t=>t.id===e)}const uM=[{id:"all",label:"All"},{id:"keepers",label:"Keepers"},{id:"archived",label:"Archived"}];function lG(e){return uM.some(t=>t.id===e)}function cG(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 b4(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 Yu=(e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id),Ee={brands:()=>Ye("GET","/api/brands"),createBrand:e=>Ye("POST","/api/brands",{brand:e}),brandFromUrl:e=>Ye("POST","/api/brands/from-url",{url:e}),updateBrand:(e,t,n)=>Ye("PUT",`/api/brands/${e}`,{brand:Pp(t),keepAssets:!0,base:Pp(n)}),deleteBrand:e=>Ye("DELETE",`/api/brands/${e}`),guide:()=>Ye("GET","/api/guide"),guideIntent:e=>Ye("POST","/api/guide",e,void 0,{keepalive:!0}),refreshBrandFromUrl:(e,t)=>Ye("POST",`/api/brands/${e}/refresh-from-url`,t?{url:t}:{}),updateLogo:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/logos/${t}`,n),deleteLogo:(e,t)=>Ye("DELETE",`/api/brands/${e}/logos/${t}`),projects:e=>Ye("GET",`/api/projects?brandId=${encodeURIComponent(e)}`),createProject:(e,t)=>Ye("POST","/api/projects",{brandId:e,name:t}),tree:e=>Ye("GET",`/api/projects/${e}/tree`),activity:e=>Ye("GET",`/api/brands/${e}/activity`),workspace:e=>Ye("GET",`/api/brands/${e}/workspace`),feed:(e,t,n)=>Ye("GET",`/api/brands/${e}/feed${cG(t)}`,void 0,n),node:e=>Ye("GET",`/api/nodes/${e}`),lineage:e=>Ye("GET",`/api/nodes/${e}/lineage`),usage:e=>Ye("GET",`/api/brands/${e}/usage`),sets:e=>Ye("GET",`/api/brands/${e}/sets`),createSet:(e,t)=>Ye("POST",`/api/brands/${e}/sets`,{name:t}),renameSet:(e,t)=>Ye("PATCH",`/api/sets/${e}`,{name:t}),deleteSet:e=>Ye("DELETE",`/api/sets/${e}`),addToSet:(e,t)=>Ye("POST",`/api/sets/${e}/nodes`,{nodeIds:t}),removeFromSet:(e,t)=>Ye("POST",`/api/sets/${e}/nodes/remove`,{nodeIds:t}),engines:()=>Ye("GET","/api/engines"),codexStatus:(e={})=>Ye("GET",`/api/engines/codex/status${e.force?"?force=1":""}`),repairCodexEnv:e=>Ye("POST","/api/engines/codex/repair-env",{keys:e}),restoreCodexEnv:()=>Ye("POST","/api/engines/codex/restore-env"),installCodex:()=>Ye("POST","/api/engines/codex/install"),loginCodex:()=>Ye("POST","/api/engines/codex/login"),setCap:(e,t)=>Ye("PUT","/api/caps",{engineId:e,capUsd:t}),addNode:e=>Ye("POST","/api/nodes",e),cancelNode:e=>Ye("POST",`/api/nodes/${e}/cancel`),retryNode:e=>Ye("POST",`/api/nodes/${e}/retry`),scenes:()=>Ye("GET","/api/scenes"),presenters:()=>Ye("GET","/api/presenters"),presenterFrames:e=>Ye("GET",`/api/presenter-previews/${e}`),demoProducts:()=>Ye("GET","/api/demo-products"),demoProductFrames:e=>Ye("GET",`/api/demo-product-previews/${e}`),showcase:()=>Ye("GET","/api/showcase"),previewBrief:(e,t,n,r)=>Ye("POST","/api/brief/preview",{brief:e,engineId:t,brandId:n,...r?{parentId:r}:{}}),keep:(e,t)=>Ye("POST",`/api/nodes/${e}/keep`,{kept:t}),archiveNode:(e,t)=>Ye("POST",`/api/nodes/${e}/archive`,{archived:t}),deleteNode:e=>Ye("DELETE",`/api/nodes/${e}`),deleteNodesBatch:e=>Ye("POST","/api/nodes/delete-batch",{nodeIds:e}),settings:()=>Ye("GET","/api/settings"),saveSettings:e=>Ye("PUT","/api/settings",e),costs:()=>Ye("GET","/api/costs/summary"),home:()=>Ye("GET","/api/home"),reveal:()=>Ye("POST","/api/system/reveal"),version:()=>Ye("GET","/api/version"),updateStatus:()=>Ye("GET","/api/update/status"),updateCheck:()=>Ye("POST","/api/update/check"),updateApply:()=>Ye("POST","/api/update/apply"),updateRestart:()=>Ye("POST","/api/update/restart"),desktop:()=>Ye("GET","/api/desktop"),phone:(e=!1)=>Ye("GET",e?"/api/phone?fresh=1":"/api/phone"),phoneNewCode:()=>Ye("POST","/api/phone/code"),phoneHelp:()=>Ye("GET","/api/phone/help"),phoneAllow:()=>Ye("POST","/api/phone/allow"),desktopInstall:()=>Ye("POST","/api/desktop/install"),quit:()=>Ye("POST","/api/system/quit"),releaseNotes:()=>Ye("GET","/api/release/notes"),releaseSeen:e=>Ye("POST","/api/release/seen",{version:e}),releaseUsed:e=>Ye("POST","/api/release/used",{feature:e}),sceneFrames:e=>Ye("GET",`/api/scene-previews/${e}`),pickSceneView:(e,t)=>Ye("POST",`/api/scenes/${e}/views/${t}/pick`),deleteData:e=>Ye("DELETE",`/api/data?scope=${e}`),libraryProduct:(e,t)=>Ye("GET",`/api/brands/${e}/products-library/${encodeURIComponent(t)}`),productsLibrary:e=>Ye("GET",`/api/brands/${e}/products-library`),catalogImport:(e,t,n)=>Ye("POST",`/api/brands/${e}/catalog/import`,n?{url:t,urls:n}:{url:t}),catalogScan:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/scan`,t?{url:t}:{}),catalogDetails:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/details`,{urls:t}),catalogScanState:(e,t,n)=>Ye("GET",`/api/brands/${e}/catalog/scans/${t}`,void 0,n),cancelCatalogScan:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/scans/${t}/cancel`),catalogJob:(e,t)=>Ye("GET",`/api/brands/${e}/catalog/jobs/${t}`),catalogJobs:e=>Ye("GET",`/api/brands/${e}/catalog/jobs`),cancelCatalogJob:(e,t)=>Ye("POST",`/api/brands/${e}/catalog/jobs/${t}/cancel`),deleteCatalogProduct:(e,t)=>Ye("DELETE",`/api/brands/${e}/catalog/products/${t}`),updateProduct:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/products/${t}`,n),updateCatalogProduct:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/catalog/products/${t}`,n),productSize:(e,t)=>Ye("GET",`/api/brands/${e}/products/${t}/size`),setProductSize:(e,t,n)=>Ye("PUT",`/api/brands/${e}/products/${t}/size`,{size:n}),setProductShots:(e,t,n)=>Ye("PUT",`/api/brands/${e}/products/${t}/shots`,{files:n}),assetBuildCapabilities:()=>Ye("GET","/api/asset-builds/capabilities"),startAssetBuild:(e,t)=>Ye("POST",`/api/brands/${e}/asset-builds`,t),assetBuild:(e,t)=>Ye("GET",`/api/brands/${e}/asset-builds/${t}`),assetBuilds:e=>Ye("GET",`/api/brands/${e}/asset-builds`),cancelAssetBuild:(e,t)=>Ye("POST",`/api/brands/${e}/asset-builds/${t}/cancel`),deleteAssetBuild:(e,t)=>Ye("DELETE",`/api/brands/${e}/asset-builds/${t}`),createProduct:(e,t)=>Ye("POST",`/api/brands/${e}/products`,t),createPresenterDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts`,t),presenterDrafts:e=>Ye("GET",`/api/brands/${e}/presenter-drafts`),presenterDraft:(e,t)=>Ye("GET",`/api/brands/${e}/presenter-drafts/${t}`),updatePresenterDraft:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/presenter-drafts/${t}`,n),generateDraftView:(e,t,n,r={})=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/generate`,r),approveDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/approve`),redoDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/redo`),revertDraftView:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/revert`),stopDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/stop`),restoreDraftView:(e,t,n,r)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/restore`,{hash:r}),savePresenterDraft:(e,t)=>Ye("POST",`/api/brands/${e}/presenter-drafts/${t}/save`),deletePresenterDraft:(e,t)=>Ye("DELETE",`/api/brands/${e}/presenter-drafts/${t}`),createPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters`,t),updatePresenter:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/presenters/${t}`,n),deletePresenter:(e,t)=>Ye("DELETE",`/api/brands/${e}/presenters/${t}`),duplicatePresenter:(e,t,n)=>Ye("POST",`/api/brands/${e}/presenters/${t}/duplicate`,{name:n}),editPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters/${t}/edit`),revertPresenter:(e,t)=>Ye("POST",`/api/brands/${e}/presenters/${t}/revert`),createScene:(e,t)=>Ye("POST",`/api/brands/${e}/scenes`,t),updateScene:(e,t,n)=>Ye("PATCH",`/api/brands/${e}/scenes/${t}`,n),deleteScene:(e,t)=>Ye("DELETE",`/api/brands/${e}/scenes/${t}`),sceneExamples:(e,t)=>Ye("GET",`/api/brands/${e}/scenes/${t}/examples`),drawSceneExamples:(e,t,n)=>Ye("POST",`/api/brands/${e}/scenes/${t}/examples`,n),stopSceneExamples:(e,t)=>Ye("POST",`/api/brands/${e}/scenes/${t}/examples/stop`),removeSceneExample:(e,t,n)=>Ye("DELETE",`/api/brands/${e}/scenes/${t}/examples/${n}`),generateScenePreview:(e,t)=>Ye("POST",`/api/brands/${e}/scenes/${t}/preview`),rereadScene:(e,t,n)=>Ye("POST",`/api/brands/${e}/scenes/${t}/reread`,{correction:n}),startSceneStudioJob:(e,t)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs`,t),sceneStudioJob:(e,t)=>Ye("GET",`/api/brands/${e}/scene-studio/jobs/${t}`),cancelSceneStudioJob:(e,t)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/cancel`),labelSceneStudioJob:(e,t,n)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/label`,{label:n}),attachSceneStudioJob:(e,t,n)=>Ye("POST",`/api/brands/${e}/scene-studio/jobs/${t}/attach`,{sceneId:n})},x4="scenri:guide-heading",uG=["first-shot","refine","product","presenter","scene","reuse"],dG=e=>uG.includes(e);function fG(){try{const e=typeof window>"u"?null:window.sessionStorage.getItem(x4);if(!e)return null;if(e.startsWith("{")){const t=JSON.parse(e);return typeof t.brandId=="string"&&dG(t.task)?{brandId:t.brandId,task:t.task}:null}return{brandId:e,task:"first-shot"}}catch{return null}}function dM(e){try{e?window.sessionStorage.setItem(x4,JSON.stringify(e)):window.sessionStorage.removeItem(x4)}catch{}}const hG={loaded:!1,heading:null,eligible:!1,welcome:null,hidden:!0,done:{},lessons:{},progress:{},dismissed:[],active:null,activeNodes:[],activeDraftId:null,counts:null};let ro={...hG,heading:fG()},U5=null,$8=null,W5=!1;const k4=new Set;function Cc(e){ro=e;for(const t of k4)t()}function fM(e){const t=e;return{...t,lessons:t.lessons??{},progress:t.progress??{},loaded:!0,heading:ro.heading}}function Lp(){return $8??($8=Ee.guide().then(e=>Cc(fM(e))).catch(()=>{ro.loaded||Cc({...ro,loaded:!0})}).finally(()=>{$8=null})),$8}function pG(){return!W5&&typeof document<"u"&&(W5=!0,document.addEventListener("visibilitychange",()=>{!document.hidden&&ro.loaded&&Lp()})),U5??(U5=Lp()),U5}function D8(){return Lp()}function mG(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 pc(e){const t=ro;return Cc(mG(ro,e)),Ee.guideIntent(e).then(n=>Cc(fM(n))).catch(()=>{Cc(t),Lp()})}function gG(e){return k4.add(e),()=>k4.delete(e)}const hM=e=>`scenri:guide-via-bar:${e}`,S4=(e,t)=>t==="first-shot"||t==="reuse"?hM(e):`scenri:guide-via:${e}:${t}`;function pM(e,t){const n={brandId:e,task:t};dM(n),Cc({...ro,heading:n})}function E4(){dM(null),ro.heading&&Cc({...ro,heading:null})}function lp(){return ro}function Zw(){return s.useSyncExternalStore(gG,lp)}const pt={root:"/",setup:"/setup",brand:"/:brandSlug",kit:"/:brandSlug/kit",products:"/:brandSlug/products",product:"/:brandSlug/products/:productId",scenes:"/:brandSlug/places",sceneStudio:"/:brandSlug/places/new/:convoId?",scene:"/:brandSlug/places/:sceneId",sceneEdit:"/:brandSlug/places/:sceneId/edit/:convoId?",presenters:"/:brandSlug/people",presenterStudio:"/:brandSlug/people/new/:draftId?",presenter:"/:brandSlug/people/:presenterId",presenterEdit:"/:brandSlug/people/:presenterId/edit",hub:"/:brandSlug/create",hubShot:"/:brandSlug/create/shots/:shotId",set:"/:brandSlug/sets/:setSlug",setShot:"/:brandSlug/sets/:setSlug/shots/:shotId",whatsNew:"/:brandSlug/whats-new",legacy:"/b/*",legacyPresenters:"/:brandSlug/presenters/*",legacyScenes:"/:brandSlug/scenes/*",notFound:"*"},Ho=e=>hs(pt.brand,{brandSlug:e.slug}),sd=e=>hs(pt.products,{brandSlug:e.slug}),Aa=(e,t)=>hs(pt.product,{brandSlug:e.slug,productId:t}),gl=e=>hs(pt.scenes,{brandSlug:e.slug}),Br=(e,t)=>hs(pt.scene,{brandSlug:e.slug,sceneId:t}),vl=(e,t)=>hs(pt.sceneStudio,{brandSlug:e.slug,convoId:t??void 0}),zw=(e,t,n)=>hs(pt.sceneEdit,{brandSlug:e.slug,sceneId:t,convoId:n??void 0}),di=e=>hs(pt.presenters,{brandSlug:e.slug}),La=(e,t)=>hs(pt.presenter,{brandSlug:e.slug,presenterId:t}),wl=(e,t)=>hs(pt.presenterStudio,{brandSlug:e.slug,draftId:t??void 0}),Jm=(e,t)=>hs(pt.presenterEdit,{brandSlug:e.slug,presenterId:t}),jr=e=>hs(pt.hub,{brandSlug:e.slug}),H0=(e,t)=>hs(pt.set,{brandSlug:e.slug,setSlug:t.slug}),Tp=e=>hs(pt.whatsNew,{brandSlug:e.slug}),e2=(e,t,n)=>t?hs(pt.setShot,{brandSlug:e.slug,setSlug:t.slug,shotId:n}):hs(pt.hubShot,{brandSlug:e.slug,shotId:n});function vG(e,t=""){const[,,n,...r]=e.split("/");if(!n)return pt.root;const a=`/${n}${wG(r)}`;return t?a+t:a}function wG(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?`/${[gM[t]??t,...e.slice(1)].join("/")}`:""}const mM={presenter:"person",scene:"place"},K5=(e,t)=>e.get(mM[t])??e.get(t),G5=["person","presenter","place","scene"],kd=(e,t)=>`${mM[e]}=${encodeURIComponent(t)}`,yG=e=>e==="places"||e==="scenes"?"Places":e==="products"?"Products":void 0,bG=e=>e==="person"||e==="presenter"?"presenter":e==="place"||e==="scene"?"scene":null,gM={presenters:"people",scenes:"places"};function xG(e,t="",n=""){const[,r,a,...i]=e.split("/");return`/${[r,gM[a]??a,...i].join("/")}${t}${n}`}const H8="Scenri",Y5=" - ",q5=40,kG=[["whatsnew","What's new"],["setup","Providers"],["settings","Settings"]],SG=[[pt.setup,"Set up",!1],[pt.hubShot,"Shot",!1],[pt.setShot,"Shot",!1],[pt.hub,"Create",!1],[pt.set,"Create",!0],[pt.kit,"Brand kit",!1],[pt.whatsNew,"What's new",!1],[pt.product,"Products",!0],[pt.products,"Products",!1],[pt.scene,"Places",!0],[pt.scenes,"Places",!1],[pt.presenter,"People",!0],[pt.presenters,"People",!1],[pt.brand,"Home",!1]];function EG(e){if(!e)return null;const t=e.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").replace(/\s+/g," ").trim();return t?t.length>q5?`${t.slice(0,q5-1).trimEnd()}…`:t:null}function CG(e,t="",n=null){const r=new URLSearchParams(t);for(const[a,i]of kG)if(r.has(a))return i+Y5+H8;for(const[a,i,l]of SG)if(xl(a,e))return((l?EG(n):null)??i)+Y5+H8;return H8}const vM=s.createContext(null);function jG(){const{pathname:e,search:t}=Bn(),[n,r]=s.useState(null);return s.useEffect(()=>{document.title=CG(e,t,n)},[e,t,n]),r}function Xc(e){const t=s.useContext(vM);s.useEffect(()=>{if(t)return t(e??null),()=>t(null)},[t,e])}function ki(e,t){return JSON.stringify(e)===JSON.stringify(t)?e:t}function t2(e){const t=e.current;e.current=[];for(const n of t)n()}const AG={scenes:[],collections:[],verticals:[],loaded:!1,error:!1};function NG(){const[e,t]=s.useState(AG),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.scenes().then(f=>{aG(f.scenes),u&&t(h=>ki(h,{scenes:f.scenes,collections:f.collections,verticals:f.verticals,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&t2(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const MG={presenters:[],categories:[],styles:[],loaded:!1,error:!1};function RG(){const[e,t]=s.useState(MG),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.presenters().then(f=>{u&&t(h=>ki(h,{presenters:f.presenters,categories:f.categories,styles:f.styles,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&t2(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const PG={demoProducts:[],categories:[],loaded:!1,error:!1};function LG(){const[e,t]=s.useState(PG),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.demoProducts().then(f=>{u&&t(h=>ki(h,{demoProducts:f.demoProducts,categories:f.categories,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&t2(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const TG={showcase:[],categories:[],loaded:!1,error:!1};function $G(){const[e,t]=s.useState(TG),[n,r]=s.useState(0),a=s.useRef(!1),i=s.useRef([]);s.useEffect(()=>{let u=!0;return Ee.showcase().then(f=>{u&&t(h=>ki(h,{showcase:f.showcase,categories:f.categories,loaded:!0,error:!1}))}).catch(()=>{u&&!a.current&&t(f=>({...f,loaded:!0,error:!0}))}).finally(()=>{u&&t2(i)}),()=>{u=!1}},[n]);const l=s.useCallback(u=>new Promise(f=>{i.current.push(f),a.current=!!(u!=null&&u.quiet),a.current||t(h=>({...h,loaded:!1,error:!1})),r(h=>h+1)}),[]);return{...e,refetch:l}}const $h=[{id:"brand",label:"Brand kit",Icon:GF,scope:"brand",sub:e=>`What every shot for ${e} can draw on.`},{id:"usage",label:"Usage",Icon:PF,scope:"brand",sub:e=>`What ${e} has made, one square per day.`},{id:"engines",label:"Providers",Icon:a1,scope:"studio",sub:()=>"Where your images are made, and what each may spend."},{id:"appearance",label:"Appearance",Icon:TF,scope:"studio",sub:()=>"How Scenri looks on this device."},{id:"library",label:"Library",Icon:Zv,scope:"studio",sub:()=>"Your work, as plain files on this computer. Back them up like anything else."},{id:"phone",label:"Local access",Icon:$F,scope:"studio",sub:()=>"Open Scenri on your phone, tablet or another computer, or from your desktop.",feature:"local-access"},{id:"updates",label:"Updates",Icon:yp,scope:"studio",sub:()=>"How this copy of Scenri stays current."},{id:"about",label:"About",Icon:bm,scope:"studio",sub:()=>"The copy of Scenri you are running."},{id:"danger",label:"Danger zone",Icon:km,scope:"apart",sub:()=>"These do not come back. Export from Library first if you are not certain."}],wM={brand:"brand",usage:"usage",engines:"engines",budget:"engines",general:"appearance",appearance:"appearance",library:"library",phone:"phone",updates:"updates",about:"about",danger:"danger"},DG="index",yM=e=>e!==null&&Object.hasOwn(wM,e),HG=e=>yM(e)?wM[e]:"brand",OG=e=>!yM(e);function bM(e){return e.milestones.map(t=>t.label)}const il=[{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 person",moments:["presenter"]},{label:"Choose a place",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 person",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 people 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 place",summary:"A setting and its light, saved to shoot in again, from pictures of it or a few questions.",milestones:[{label:"Find where your places 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"}],C4={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 IG(e){return il.find(t=>t.id===e||Bw(t.id)===e)??null}const FG={presenter:"person",scene:"place"},Bw=e=>FG[e]??e;function _G(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 VG(e,t){return e.find(n=>t(n)!=="done")??null}const Uw=Object.fromEntries(il.map(e=>[e.id,Object.fromEntries(e.milestones.flatMap((t,n)=>t.moments.map(r=>[r,n])))]));function xM(e,t){let n=0;for(const r of t){const a=Uw[e][r];a!==void 0&&a>n&&(n=a)}return n}function ZG(e,t){return xM(e,t)>0}function zG(e,t){var a;const n=Uw[e][t],r=((a=il.find(i=>i.id===e))==null?void 0:a.milestones.length)??0;return n===void 0||!r?null:{at:n+1,of:r}}const O8=e=>e.status==="done"&&e.images>0;function X5(e,t,n){const r=xM(e,t);return n?Math.max(BG(e,n),r):r}function BG(e,t){const n=t.moment?Uw[e][t.moment]:void 0;if(n!==void 0)return n;switch(e){case"first-shot":return t.nodes.some(O8)?5:t.nodes.length>0?4:0;case"reuse":return t.nodes.some(O8)?4:t.nodes.length>0?3:0;case"presenter":return t.draft?3:0;case"refine":return t.nodes.some(O8)||t.nodes.some(r=>r.status==="running")?3:0;default:return 0}}const j4={"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}},kM=["settings","setup","new","whatsnew","learn","welcome"];function Zl(){const{open:e}=Nr("settings");return s.useCallback(t=>e(t??DG),[e])}function UG(){const{open:e}=Nr("welcome");return s.useCallback(()=>e("1"),[e])}const A4={current:null};function SM(){const{open:e}=Nr("learn");return s.useCallback((t="lessons")=>e(Bw(t)),[e])}const Q5="codex-cli";function zl(){const{open:e}=Nr("setup");return s.useCallback((t=Q5)=>{e(typeof t=="string"?t:Q5)},[e])}function EM(e){var t;e.preventDefault(),(t=e.currentTarget)==null||t.focus({preventScroll:!0})}function CM({failure:e,density:t,onRetry:n,dismiss:r}){const a=Zl(),i=zl(),{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,m=!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:u?void 0:"alert",children:[o.jsx("span",{className:"sc-fail-ic","aria-hidden":!0,children:o.jsx(Bc,{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(s1,{size:u?12:14})," Try again"]}),r&&o.jsx("button",{type:"button",className:"sc-fail-alt",onClick:r.onClick,children:r.label})]}),m&&o.jsxs("details",{className:"sc-fail-raw",children:[o.jsx("summary",{children:"Details"}),o.jsx("pre",{children:e.raw})]})]})}function Ww({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(Bc,{size:16,weight:"fill"}):o.jsx(bm,{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 jM(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 Ar=jM(()=>localStorage),Qc=jM(()=>sessionStorage),AM=720*60*60*1e3;function NM(e){return e?e.phase==="ready"?e.blockReason!=="dev"&&e.blockReason!=="unsupervised"&&e.blockReason!=="launcher-too-old":e.canApply:!1}function WG(e){return!!(e!=null&&e.available)&&e.blockReason!=="dev"}function KG(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:NM(e)}}function GG(e,t){return e!==null&&t!==e}const YG=e=>e!==200;async function qG(e,t){const n=t.sleep??(r=>new Promise(a=>setTimeout(a,r)));for(let r=0;r<=t.boundMs;r+=t.stepMs){if(YG(await e()))return!0;await n(t.stepMs)}return!1}const XG=1800*1e3,J5=300*1e3,I8=e=>new Promise(t=>setTimeout(t,e)),MM="scenri:update-dismissed",QG=()=>Qc.get(MM),JG=e=>Qc.set(MM,e),RM=s.createContext(null);function n2(){const e=s.useContext(RM);if(!e)throw new Error("useUpdateCenter must be used inside UpdateCenterProvider");return e}function eY({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(QG),u=s.useRef(void 0),f=s.useRef(!1),[h,p]=s.useState(!1);s.useEffect(()=>{let R=!0;return Ee.version().then(H=>R&&p(H.thisComputer===!0)).catch(()=>{}),()=>{R=!1}},[]),s.useEffect(()=>{let R=!0;const H=async()=>{if(!(!R||f.current)){if(!document.hidden)try{const U=await Ee.updateStatus();R&&n(U)}catch{}R&&(u.current=window.setTimeout(H,XG))}};H();const D=()=>{document.hidden||!R||(window.clearTimeout(u.current),H())};return document.addEventListener("visibilitychange",D),window.addEventListener("focus",D),()=>{R=!1,window.clearTimeout(u.current),document.removeEventListener("visibilitychange",D),window.removeEventListener("focus",D)}},[]);const[g,m]=s.useState(null),w=s.useCallback(async()=>{a(!0);try{n(await Ee.updateCheck()),m(null)}catch(R){m(String((R==null?void 0:R.message)??R))}finally{a(!1)}},[]),y=s.useCallback(()=>{const R=t==null?void 0:t.latest;R&&(JG(R),l(R))},[t]),b=(t==null?void 0:t.latest)!=null&&t.latest===i,[S,k]=s.useState("idle"),[C,E]=s.useState(null),A=s.useCallback(async R=>{k("restarting");try{await Ee.updateRestart()}catch(D){if(typeof D.status=="number"){k("idle"),E(String((D==null?void 0:D.message)??D));return}}const H=Date.now()+3e4;for(;Date.now()<H;){await I8(800);try{if((await Ee.version()).version!==R){location.reload();return}}catch{}}k("idle"),E("The restart did not complete. Check the terminal Scenri runs in.")},[]),L=s.useCallback(async()=>{if(S!=="idle")return{kind:"still-running"};k("stopping");try{await Ee.quit()}catch(H){if(typeof H.status=="number")return k("idle"),{kind:"refused",reason:String((H==null?void 0:H.message)??H)}}return await qG(()=>fetch("/api/version",{cache:"no-store"}).then(H=>H.status,()=>null),{boundMs:8e3,stepMs:250})?(f.current=!0,k("stopped"),{kind:"stopped"}):(k("idle"),{kind:"still-running"})},[S]);s.useEffect(()=>{S==="stopped"&&window.close()},[S]);const $=s.useCallback(async()=>{if(S!=="idle")return;E(null);const R=t==null?void 0:t.current;try{if((t==null?void 0:t.phase)!=="ready"){k("applying"),await Ee.updateApply();const H=Date.now()+J5;let D=!1;for(;Date.now()<H;){await I8(1500);const U=await Ee.updateStatus();if(n(U),U.phase==="ready"){D=!0;break}if(U.phase==="error"){E(U.error??"The update could not be staged."),k("idle");return}}if(!D){E("Couldn't download the update. Try again."),k("idle");return}}await A(R)}catch(H){E(String((H==null?void 0:H.message)??H)),k("idle")}},[S,t,A]),N=s.useRef(!1);s.useEffect(()=>{if((t==null?void 0:t.phase)!=="staging"||S!=="idle"||N.current)return;N.current=!0;let R=!0;const H=Date.now()+J5;return(async()=>{for(;R&&Date.now()<H;){if(await I8(1500),!R)return;try{const U=await Ee.updateStatus();if(!R||(n(U),U.phase!=="staging"))return}catch{}}})().finally(()=>{N.current=!1}),()=>{R=!1}},[t==null?void 0:t.phase,S]);const{pathname:j}=Bn(),P=j===pt.setup;return o.jsxs(RM.Provider,{value:{status:t,checking:r,checkNow:w,checkError:g,dismissed:b,dismiss:y,apply:$,quit:L,thisComputer:h,busy:S,applyError:C},children:[S==="stopped"?o.jsx(nY,{}):e,S!=="restarting"&&S!=="stopped"&&h&&WG(t)&&!b&&!P&&o.jsx(rY,{}),S==="restarting"&&o.jsx(tY,{version:(t==null?void 0:t.stagedVersion)??(t==null?void 0:t.latest)??null})]})}function tY({version:e}){return o.jsxs(PM,{children:[o.jsx(mE,{size:22}),o.jsx("b",{children:e?`Updating to Scenri ${e}`:"Updating Scenri"}),o.jsx("small",{children:"Restarting. This page reconnects by itself."})]})}function nY(){return o.jsxs(PM,{className:"sc-upd-stopped",children:[o.jsx(AC,{size:22}),o.jsx("b",{children:"Scenri is shut down"}),o.jsx("small",{children:"You can close this tab. Start it again from your desktop icon or with npx scenri."})]})}function PM({children:e,className:t}){return Ur.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 rY(){const{status:e,dismiss:t,apply:n,busy:r,applyError:a}=n2(),i=Zl();if(!e)return null;const l=KG(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(HF,{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 sY(e,t){return!e||t.updatedAt>=e.updatedAt}function aY(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0||e[n]===t||!sY(e[n],t))return e;const r=e.slice();return r[n]=t,r}function oY(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 Kw=(e,t)=>`scenri:new-${e}-${t}`,iY=e=>Qc.get(e),lY=(e,t)=>Qc.set(e,t);function O0(e){Qc.del(e),Ar.del(e)}function F8(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 ek=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function LM(e,t){const n=Kw(e,t),r=iY(n);if(!r)return null;let a;try{a=JSON.parse(r)}catch{return O0(n),null}if(typeof a!="object"||a===null)return O0(n),null;const i=a;if(i.v!==1||i.brandId!==e||i.kind!==t)return O0(n),null;const l=Date.now()-Date.parse(i.updatedAt??"");return!Number.isFinite(l)||l>AM?(O0(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:ek(i.facets),imageHashes:ek(i.imageHashes),importUrl:typeof i.importUrl=="string"?i.importUrl:"",pending:typeof i.pending=="string"?i.pending:null}}function _8(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};lY(Kw(e,t),JSON.stringify(r))}function Zu(e,t){O0(Kw(e,t))}function cY(e,t,n){const r=LM(e,t);(r==null?void 0:r.pending)===n&&Zu(e,t)}function uY(e,t){if(!e)return!1;if(e.pending===null)return!0;const n=t??"unknown";return n==="failed"||n==="cancelled"||n==="unknown"}const qu=e=>`scenri:draft-${e}`;let N4=0;function dY(){return N4+=1,()=>{N4-=1}}const jc=()=>N4>0?"":"&fresh=1",fY=e=>Ar.get(e),hY=(e,t)=>Ar.set(e,t),cp=e=>Ar.del(e);function V8(e,t){return e.some(n=>n.t==="text"?!!n.v.trim():n.t!=="template")||Object.values(t).some(n=>!!n.trim())}function tk(e){const t=fY(qu(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 cp(qu(e)),null;const a=Date.now()-Date.parse(r.updatedAt??"");return!Number.isFinite(a)||a>AM?(cp(qu(e)),null):{v:1,brandId:e,updatedAt:r.updatedAt,tokens:r.tokens,tplFields:r.tplFields,setSlug:r.setSlug??null,...M4(r.lent)?{lent:M4(r.lent)}:{}}}function M4(e){if(typeof e!="object"||e===null)return;const t=e,n={...typeof t.format=="string"?{format:t.format}:{},...typeof t.count=="number"&&Number.isInteger(t.count)&&t.count>0?{count:t.count}:{},...typeof t.quality=="string"?{quality:t.quality}:{}};return Object.keys(n).length?n:void 0}function Gw(e,t){const n=M4(t.lent),r={v:1,brandId:e,updatedAt:new Date().toISOString(),tokens:t.tokens,tplFields:t.tplFields,setSlug:t.setSlug??null,...n?{lent:n}:{}};hY(qu(e),JSON.stringify(r))}function nk(e){cp(qu(e))}const R4="scenri:draft-returned";function pY(e,t){Gw(e,t),window.dispatchEvent(new CustomEvent(R4,{detail:e}))}const TM="the engine",$M=/no engine here can draw/i,mY=[{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=>`${xo(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=>`${xo(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=>`${xo(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=>`${xo(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=>`${xo(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=>`${xo(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=>`${xo(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:$M,kind:"setup",title:()=>"Image generation is not set up yet.",fix:"Set it up, and this goes on from where it stopped.",remedy:{label:"Set up",opens:"setup"},retryable:!1},{re:/reading pictures needs codex/i,kind:"setup",title:()=>"Reading pictures needs Codex, which is not set up yet.",fix:"Set it up, and the pictures are read from where they are.",remedy:{label:"Set up",opens:"setup"},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:/ChatGPT plan cannot run .+ in Codex/i,kind:"setup",title:()=>"Your ChatGPT plan cannot run this Codex model.",fix:"Choose another model in Codex, then run this again.",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=>`${xo(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=>`${xo(e)} had a problem on its end.`,fix:"Nothing wrong on your side. Try again shortly.",retryable:!0},{re:/produced no images|returned no image|no images returned|finished but produced no/i,kind:"empty",title:e=>`${xo(e)} finished without making a picture.`,fix:"Run it again. This usually clears on a second try.",retryable:!0}];function xo(e){return e===TM?"The engine":e}function uo(e,t){const n=(e??"").trim(),r=(t??"").replace(/\s*\(BYOK\)\s*$/i,"").trim()||TM;if(!n)return{kind:"unknown",title:"This shot did not finish.",raw:"",retryable:!0};for(const a of mY){if(!a.re.test(n))continue;const i=a.title(r)||gY(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 DM(){return{kind:"cancelled",title:"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",raw:"",retryable:!0}}function ln(e,t,n){const r=e instanceof Error?e.message:typeof e=="string"?e:String((e==null?void 0:e.message)??e),a=uo(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 gY(e){const t=e.trim();if(!t)return t;const n=t[0].toUpperCase()+t.slice(1);return/[.!?]$/.test(n)?n:`${n}.`}const r2=[{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"}],sf=e=>r2.filter(e).map(t=>t.id),HM=sf(()=>!0),vY=sf(e=>e.tier==="core"),OM=sf(e=>e.tier==="supplementary"),Dc=Object.fromEntries(r2.map(e=>[e.id,e.strip])),xn=Object.fromEntries(r2.map(e=>[e.id,e.name])),Ac=e=>xn[e],IM=Object.fromEntries(r2.map(e=>[e.id,e.from])),P4=new Set(sf(e=>e.gate===!0)),ti=e=>P4.has(e)?void 0:"auto",G0=4,rk=25*1024*1024,fi=e=>sf(t=>{var n;return t.tier==="core"||!!e.extras||((n=e.views[t.id])==null?void 0:n.status)!=="empty"});function s2(e){return fi(e).find(t=>e.views[t].status!=="approved")??null}const wY=e=>s2(e)===null,hi=e=>e.views.portrait.status==="approved"||!!e.views.portrait.prior,Hc=e=>e.stage!=="idle"||!!e.activeView;function Yw(e){if(Hc(e))return null;const t=s2(e);if(!t)return null;const n=e.views[t];return n.status!=="empty"&&n.status!=="stale"||n.error?null:IM[t].every(r=>e.views[r].status==="approved")?t:null}function FM(e,t){return t??(Hc(e)?e.activeView:null)??s2(e)??"portrait"}function _M(e,t){return fi(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:Dc[n],state:a,hash:r.hash,photo:r.origin==="photo",drawing:e.activeView===n,approved:r.status==="approved",error:!!r.error}})}const yY={woman:"a woman",man:"a man",androgynous:"an androgynous person"},bY={woman:"her",man:"his",androgynous:"their"},$p=/\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,xY=/^(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 kY(e){const t=e.trim().split(/[^\p{L}\p{N}']+/u).filter(Boolean);return t.some(n=>$p.test(n))?t.every(n=>xY.test(n)||$p.test(n)):!1}const qw=/\b(\d0s|\d{2}\s*(years|yo)|teen|twenties|thirties|forties|fifties|sixties|seventies|elderly|young|old(er)?|middle-aged|adult)\b/i,SY=120,EY=18;function CY(e){const t=e.match(/\d+/g);return t!=null&&t.length?t.every(n=>{const r=Number(n);return r>=EY&&r<=SY}):!1}const jY=/\b(hair|bald|shaved|buzz|blonde?|brunette|redhead|ginger|greying|silver|auburn|platinum)\b/i,AY=/\b(skin|complexion|fair|pale|light|olive|tan|tanned|brown|deep|dark|ebony|black|white|freckled|golden)\b/i,NY=/\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,MY=/\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,RY=/\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,ka=e=>NY.test(e)||qw.test(e)||jY.test(e)||AY.test(e)||MY.test(e)||RY.test(e);function PY(e,t){const n=t.trim();if(!n)return"";const r=[],a=e.steer&&!$p.test(n)?yY[e.steer]:"";if(a&&r.push(a),e.age&&!qw.test(n)){const l=e.steer?bY[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 LY(e,t){var r;const n=((r=e.analysis)==null?void 0:r.suitableCategories)??[];return!n.length||t.length?null:n}function VM(e){return HM.some(t=>{const n=e.views[t];return!!n.hash&&n.origin!=="photo"&&n.status!=="empty"})}function TY(e,t){if(Hc(e))return"Still drawing";for(const n of fi(e)){const r=e.views[n];if(r.status==="candidate")return`Decide on the ${Ac(n)} first`;if(r.status==="stale")return`Redo the ${Ac(n)} first`;if(r.status!=="approved")return`Use the ${Ac(n)} first`}return t.trim()?null:"Give them a name"}const ZM=/\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 zM(e,t,n){if(!e.trim())return{blocked:"Say what should change."};if(!hi(n))return n.views.portrait.status!=="candidate"?{blocked:"Nothing to adjust yet."}:{view:"portrait",scope:"identity"};if(t==="portrait"||ZM.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 ${Ac(t)} yet.`}:{view:t,scope:"view"}}function sk(e,t){return hi(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 $Y(e,t,n){const r=e.trim(),a=zM(r||"this",t,n);if("blocked"in a)return r?{chip:null,hint:a.blocked,tone:"alert"}:{chip:null,hint:sk(t,n)};const i=hi(n)?a.scope==="identity"?"Changing the person":`Refining the ${xn[a.view]}`:"Adjusting the face";return{chip:{view:a.view,label:i},hint:sk(t,n)}}const ak=e=>e.charAt(0).toUpperCase()+e.slice(1);function DY(e){var p,g,m,w;if(e.source!=="photos"||e.stage==="analyzing")return null;const t=(p=e.readError)==null?void 0:p.trim();if(t){const y=uo(t);return{text:`The photos could not be read${y.kind!=="unknown"?`. ${y.title}`:`: ${/[.!?]$/.test(t)?t:`${t}.`}`} Their face is drawn from them anyway.`,tone:"warn"}}const n=(m=(g=e.analysis)==null?void 0:g.conflict)==null?void 0:m.trim();if(n)return{text:`These photos may show more than one person: ${n}`,tone:"warn"};const r=((w=e.analysis)==null?void 0:w.photos)??[];if(r.length&&r.every(y=>y.usable===!1))return null;const a=fi(e),i=a.filter(y=>e.views[y].origin==="photo"),l=a.filter(y=>e.views[y].origin!=="photo"),u=y=>y.length<=2?y.map(Ac).join(" and "):`${y.slice(0,-1).map(Ac).join(", ")} and ${Ac(y[y.length-1])}`,f=i.length?`${ak(u(i))} from your ${i.length===1?"photo":"photos"}.`:"";if(!l.length)return{text:f};const h=l.length>=3&&i.length?"The rest are drawn from them.":`${ak(u(l))} ${l.length===1?"is":"are"} drawn from them.`;return{text:[f,h].filter(Boolean).join(" ")}}const BM=e=>{var t;return(e.activeView?(t=e.views[e.activeView])==null?void 0:t.startedAt:void 0)??e.updatedAt};function UM(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 ${xn[t]}`}function Xw(e,t){return WM(t).some(n=>!!e.views[n].hash)}function WM(e){const t=new Set;for(let n=!0;n;){n=!1;for(const r of HM)r===e||t.has(r)||IM[r].some(a=>a===e||t.has(a))&&(t.add(r),n=!0)}return[...t]}function HY(e,t){const n=e.views[t].hash;return n?WM(t).some(r=>{const a=e.views[r];return!!a.hash&&!(a.conditionedOn??[]).includes(n)}):!1}function KM(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 OY=["hero","close","hands","angle","bold"],Ja={hero:"Hero",close:"Close-up",hands:"Hands",angle:"Another angle",bold:"A bold one"},fl={place:"Empty",hero:"Hero",close:"Close-up",hands:"Hands",angle:"Angle",bold:"Bold"},L4=e=>e==="Place"?fl.place:e,ok={hero:"hero",close:"close-up",hands:"hands",angle:"other angle",bold:"bold one"},GM=(e,t)=>!!e&&e.status==="running"&&e.roles.includes(t)&&!e.done.includes(t)&&!e.failed.some(n=>n.role===t);function YM(e=[],t){const n=[];for(const r of OY){const a=e.find(l=>l.role===r);if(GM(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 IY(e,t=[],n){return e.filter(r=>!t.some(a=>a.role===r)&&!GM(n,r))}function FY(e=[]){return e.filter(t=>t.earlier).map(t=>t.role)}function Qw(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 ok?ok[e.step]:null;return`${n?`Drawing the ${n}`:"Drawing examples"}${t}`}return e.done===1?"One example drawn":`${e.done??0} examples drawn`}function m1(e){const t=uo(e);return t.kind==="unknown"?null:[t.title,t.fix].filter(Boolean).join(" ")}const qM=50;function qa(e){return Date.parse(e.includes("T")?e:`${e.replace(" ","T")}Z`)}function Xa(e){return e.startedAt||e.createdAt}function a2(e,t=Date.now()){const n=qa(e);return Number.isNaN(n)?0:Math.max(0,Math.round((t-n)/1e3))}function Jw(e,t=Date.now()){const n=a2(e,t);return n<20?"generating":n<60?"still generating":"taking longer than usual"}function Oc(e,t=Date.now()){const n=a2(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 XM(e,t=Date.now()){const n=a2(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 QM(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 JM=e=>e.setNames.length>0?`${e.setNames.join(", ")} · `:"";function _Y(e){const t=uo(e);return t.kind==="restarted"?t.title:e??"failed"}function T4(e,t,n=Date.now(),r=1){const a=JM(e),i=r>1?`${r} shots`:"ready",l=e.status==="running"?`${a}${Jw(Xa(e),n)}`:e.status==="error"?`${a}${_Y(e.error)}`: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 · ${Hr(e)}`:Hr(e),subtitle:l,thumb:e.images[0]??null,percent:null,startedAt:e.status==="running"?Xa(e):e.createdAt,href:e2(t,null,e.id)}}function VY(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 T4(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=T4({...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:`${JM(a)}${i.length} of ${r.length} shots`}:u}function ZY(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"}const $4="content:library";function zY(e,t){const n={id:$4,kind:"library",thumb:null,startedAt:e.startedAt??t,href:null},r=e.total??0;if(e.arriving)return{...n,state:"running",title:"Downloading the Scenri library",subtitle:r?`${e.landed??0} of ${r} pictures`:"Pictures for the examples, products and people",percent:e.totalBytes?Math.min(99,Math.floor((e.bytes??0)/e.totalBytes*100)):null};if(e.outcome==="complete")return{...n,state:"done",title:"Scenri library downloaded",subtitle:r?`${r} pictures for the examples, products and people`:"Pictures for the examples",percent:100};if(e.outcome==="partial"){const a=e.failed??0;return{...n,state:"partial",title:"Scenri library partly downloaded",subtitle:`${a} ${a===1?"picture":"pictures"} did not download. Scenri tries again when it next starts.`,percent:null}}return null}function BY(e){return e==="library"?"Downloading the library":e==="catalog"?"Importing":"Rendering"}function UY(e){const t=e.filter(n=>n.state==="running");return t.find(n=>n.kind!=="library")??t[0]??null}function WY(e,t){const n=ZY(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:QM(e),startedAt:e.createdAt,href:sd(t)}}function KY(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"?La(t,e.assetId):Br(t,e.assetId):null}}function GY(e){if(e.kind==="examples"){const n=Qw(e);return e.status==="done"&&e.error?`${n} · ${Math.max(1,(e.total??0)-(e.done??0))} did not draw`:n}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.job==="change"&&!e.thumb?"The words are changed":e.attachTo?"On its place now":"The picture is drawn";const t=e.step&&e.step in xn?xn[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 YY(e,t){const n=e.status==="failed"?"error":e.status==="done"&&e.error?"partial":e.status,r=e.kind==="examples"?e.sceneId?Br(t,e.sceneId):null:e.kind==="scene"?e.conversation?e.sceneId?zw(t,e.sceneId,e.conversation):vl(t,e.conversation):e.attachTo?Br(t,e.attachTo):null:e.presenterId?Jm(t,e.presenterId):e.draftId?wl(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 person":"New place"),subtitle:GY(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 D4=e=>e.startsWith("scene:")||e.startsWith("presenter:")||e.startsWith("examples:");function ik(e,t){return e?e.split("?")[0].replace(/\/$/,"")===t.replace(/\/$/,""):!1}function lk(e,t,n){var l;if(!e.id.startsWith("examples:")||!e.href)return!1;const r=e.href.split("?")[0].split("/").pop(),a=t.match(/\/places\/([^/]+)\/edit(?:\/|$)/);if(a)return a[1]===r;const i=t.match(/\/places\/new\/([^/]+)/);if(!i)return!1;try{return((l=JSON.parse(Ar.get(`scenri:scene-studio:${n}:${i[1]}`)??"null"))==null?void 0:l.sceneId)===r}catch{return!1}}function qY(e,t=12){const n=e.filter(a=>a.state==="running"),r=e.filter(a=>a.state!=="running").sort((a,i)=>qa(i.startedAt)-qa(a.startedAt)).slice(0,t);return n.sort((a,i)=>qa(a.startedAt)-qa(i.startedAt)),[...n,...r]}function XY(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 QY(e,t){if(!e)return[];const n=new Set(t.map(r=>r.id));return[...e.values()].filter(r=>r.state==="running"&&!n.has(r.id)&&(D4(r.id)||r.id.startsWith("build:"))).map(r=>({...r,state:"error",subtitle:"Lost when Scenri restarted. Start it again."}))}function JY(e,t){return e.length===0?null:new Map([...t.map(n=>[n.id,n]),...e.map(n=>[n.id,n])])}function eq(e,t,n=qM){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)=>qa(i.at)-qa(a.at)).slice(0,n)}function tq(e,t){const n=e.filter(a=>!a.watched);if(!t)return n.length;const r=qa(t);return n.filter(a=>qa(a.at)>r).length}const eR=e=>`scenri:notifications-${e}`,tR=e=>`scenri:notifications-seen-${e}`,nR=e=>Ar.get(e),rR=(e,t)=>Ar.set(e,t);function ck(e){const t=nR(eR(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}const uk=(e,t)=>rR(eR(e),JSON.stringify(t.slice(0,qM))),dk=e=>nR(tR(e)),nq=(e,t)=>rR(tR(e),t),sR=e=>`scenri:activity-running-${e}`;function rq(e){const t=Qc.get(sR(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>(r==null?void 0:r.state)==="running"):[]}catch{return[]}}const sq=(e,t)=>Qc.set(sR(e),JSON.stringify(t.filter(n=>n.state==="running")));function Z8(e,t){return e===t?!0:e.length!==t.length?!1:JSON.stringify(e)===JSON.stringify(t)}const aq=1500,oq=5e3,aR=s.createContext(null);function ua(){const e=s.useContext(aR);if(!e)throw new Error("useTaskCenter must be used inside TaskCenterProvider");return e}let fk=null,hk=!1;function iq({brand:e,onActivity:t,children:n}){const r=Un(),{push:a}=rr(),{refreshBrands:i,noteContent:l}=Mn(),u=e.id,[f,h]=s.useState([]),[p,g]=s.useState([]),[m,w]=s.useState([]),y=s.useRef(e);y.current=e;const b=s.useRef([]);b.current=p;const[S,k]=s.useState(()=>ck(u)),[C,E]=s.useState(()=>dk(u)),[A,L]=s.useState(!1),$=s.useRef(null),N=s.useRef(!1),j=s.useRef(null),P=s.useRef(null),R=s.useRef(new Set),H=s.useRef(0),D=s.useRef(new Set),U=s.useRef(i);U.current=i;const _=s.useRef(l);_.current=l;const B=s.useRef(null),K=s.useRef(A);K.current=A;const V=s.useRef(r);V.current=r;const{pathname:O}=Bn(),I=s.useRef(!1);I.current=/\/(create|sets)(\/|$)/.test(O);const Y=s.useRef(a);Y.current=a;const Z=s.useRef(t);Z.current=t,s.useEffect(()=>{Ee.version().then(({version:me})=>{P.current??(P.current=me)}).catch(()=>{})},[]),s.useEffect(()=>{$.current=null,R.current=new Set,H.current=0,D.current=new Set,h([]),g([]),w([]),k(ck(u)),E(dk(u))},[u]);const X=s.useCallback(async()=>{var De,Se;let me,re,ee;try{const[{nodes:Q,jobs:je,studio:Re=[],boot:se,content:G},{builds:oe}]=await Promise.all([Ee.activity(u),Ee.assetBuilds(u)]);if(y.current.id!==u)return;re=oe,ee=Re,se&&j.current&&se!==j.current&&(N.current=!0,Ee.version().then(({version:Pe})=>{GG(P.current,Pe)&&location.reload()}).catch(()=>{})),se&&(j.current=se),(De=Z.current)==null||De.call(Z,u,Q),_.current(G),G!=null&&G.arriving&&(fk??(fk=new Date().toISOString()));const Ne=new Map,Ue=[];for(const Pe of Q)Pe.batchId?Ne.set(Pe.batchId,[...Ne.get(Pe.batchId)??[],Pe]):Ue.push(Pe);const st=Date.now();me=[...Ue.map(Pe=>T4(Pe,y.current,st)),...[...Ne.values()].map(Pe=>VY(Pe,y.current,st)),...je.map(Pe=>WY(Pe,y.current)),...oe.map(Pe=>KY(Pe,y.current)),...Re.map(Pe=>YY(Pe,y.current)),...G?[zY(G,fk??new Date().toISOString())].filter(Pe=>Pe!==null):[]]}catch{N.current=!0;return}const q=re.filter(Q=>Q.finished&&Q.assetId&&!D.current.has(Q.id)),ie=new Set(re.map(Q=>Q.id)),Oe=b.current.some(Q=>!Q.finished&&!ie.has(Q.id)),ae=ee.filter(Q=>Q.kind==="scene"&&Q.status==="done"&&!!Q.attachTo&&!D.current.has(Q.id));for(const Q of ae)D.current.add(Q.id);const pe=ee.filter(Q=>Q.kind==="examples"&&(Q.done??0)>0).map(Q=>`${Q.id}:${Q.done}`).filter(Q=>!D.current.has(Q));for(const Q of pe)D.current.add(Q);if(q.length||Oe||ae.length||pe.length){for(const Q of q)D.current.add(Q.id),cY(u,Q.kind,Q.id);if(await U.current(),y.current.id!==u)return}g(Q=>Z8(Q,re)?Q:re),w(Q=>Z8(Q,ee)?Q:ee);const Te=$.current??JY(rq(u),me),gt=N.current?QY(Te,me):[];N.current=!1;const Ze=XY(Te,[...me,...gt]).filter(Q=>Q.id!==$4?!0:hk?!1:(hk=!0,!0));$.current=new Map(me.map(Q=>[Q.id,Q])),sq(u,me.filter(Q=>Q.id!==$4)),H.current=me.filter(Q=>Q.state==="running").length;const tt=qY(me);if(h(Q=>Z8(Q,tt)?Q:tt),Ze.length!==0&&(k(Q=>{const je=window.location.pathname,Re=Ze.map(G=>G.kind==="library"?G.state==="done"?{...G,watched:!0}:G:D4(G.id)&&(ik(G.href,je)||lk(G,je,u))?{...G,watched:!0}:I.current&&G.state!=="error"?{...G,watched:!0}:G),se=eq(Q,Re);return uk(u,se),se}),!K.current))for(const Q of Ze){if(Q.kind==="library"||R.current.has(Q.id)||(R.current.add(Q.id),Q.state==="cancelled"))continue;if(D4(Q.id)){const se=window.location.pathname;if(ik(Q.href,se)||lk(Q,se,u))continue;const G=Q.href,oe=G?[{label:"Open",onClick:()=>V.current(G)}]:void 0;if(Q.state==="error"){Y.current({kind:"error",title:`${Q.title} did not finish`,detail:Q.subtitle,actions:oe});continue}if(Q.state==="partial"){Y.current({kind:"warning",title:Q.id.startsWith("examples:")?`Some ${Q.title} examples did not draw`:`${Q.title} did not fully finish`,detail:Q.subtitle,actions:oe});continue}Y.current({kind:"success",title:Q.id.startsWith("examples:")?`${Q.title} examples are ready`:Q.kind==="scene"&&!Q.thumb?`${Q.title} is changed`:`${Q.title} is drawn`,detail:Q.kind==="presenter"?Q.subtitle:void 0,actions:oe});continue}if(Q.state!=="error"&&I.current&&Q.kind!=="presenter"&&Q.kind!=="scene")continue;const je=Q.href,Re=je?{label:"View",onClick:()=>V.current(je)}:void 0;if(Q.state==="error"){const se=I.current&&(Q.kind==="generation"||Q.kind==="edit");Y.current({kind:"error",title:`${Q.title} failed`,detail:Q.subtitle,action:Re,quiet:se});continue}if(Q.kind==="presenter"||Q.kind==="scene"){const se=Q.id.startsWith("build:")?((Se=re.find(oe=>`build:${oe.id}`===Q.id))==null?void 0:Se.assetId)??null:null,G=jr(y.current);Y.current({kind:"success",title:`${Q.title} is ready`,detail:Q.subtitle,actions:je?[{label:Q.kind==="presenter"?"View person":"View place",onClick:()=>V.current(je)},{label:"Use in a shot",onClick:()=>V.current(`${G}?${kd(Q.kind==="presenter"?"presenter":"scene",se??"")}&compose=1${jc()}`)}]:void 0});continue}if(Q.kind==="catalog"&&Q.state==="partial"){Y.current({kind:"warning",title:"Some products did not import",detail:Q.subtitle,action:Re});continue}Y.current({kind:"success",title:Q.kind==="catalog"?"Import finished":"Generation finished",detail:Q.kind==="catalog"?Q.title:void 0,action:Re})}},[u]);s.useEffect(()=>{let me=null,re=!0,ee=0;const q=async Oe=>{if(!re||Oe!==ee||(document.hidden||await X(),!re||Oe!==ee))return;const ae=!document.hidden&&H.current>0;me=setTimeout(()=>void q(Oe),ae?aq:oq)},ie=()=>{me&&clearTimeout(me),me=null,ee+=1,document.hidden||q(ee)};return B.current=ie,q(ee),document.addEventListener("visibilitychange",ie),window.addEventListener("focus",ie),()=>{re=!1,B.current=null,me&&clearTimeout(me),document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",ie)}},[X]);const z=s.useCallback(()=>{var me;return(me=B.current)==null?void 0:me.call(B)},[]),J=s.useCallback(()=>{const me=new Date().toISOString();E(me),nq(u,me)},[u]),he=s.useCallback(()=>{k([]),uk(u,[]),J()},[u,J]),te=s.useMemo(()=>({tasks:f,running:f.filter(me=>me.state==="running").length,builds:p,studio:m,feed:S,unread:tq(S,C),markSeen:J,clearFeed:he,panelOpen:A,setPanelOpen:L,poke:z}),[f,p,m,S,C,J,he,A,z]);return o.jsx(aR.Provider,{value:te,children:n})}const oR=["primary","mark","wordmark","monochrome","alternate"],ey=["light","dark","any"],Dh={primary:"Primary logo",mark:"Mark",wordmark:"Wordmark",monochrome:"Monochrome",alternate:"Alternate"},lq=/^[a-f0-9]{32}$/,cq=e=>{const t=String(e??"");if(!t.startsWith("asset:"))return null;const n=t.slice(6);return lq.test(n)?n:null},uq=e=>oR.includes(e)?e:"primary",dq=e=>ey.includes(e)?e:"any";function af(e){return(Array.isArray(e==null?void 0:e.logos)?e.logos:[]).filter(n=>n&&String(n.file??"").trim()).map(n=>{const r=cq(n.file),a=String(n.clearSpace??"").trim();return{hash:r,file:String(n.file),role:uq(n.role),background:dq(n.background),...a?{clearSpace:a}:{},attachable:r!==null}})}function of(e){return af(e).filter(t=>t.attachable)}function o2(e){return e.find(t=>t.role==="primary")??e[0]??null}function fq(e){return o2(af(e))}function hq(e){const t=af(e);return t.find(n=>n.role==="mark")??o2(t)}function pq(e){const t=af(e).filter(a=>a.hash),n=t.find(a=>a.role==="mark");if(n)return{mark:n,square:!0};const r=o2(t);return!r||r.role==="wordmark"?null:{mark:r,square:!1}}const mq=1.6,gq=(e,t)=>t>0&&e/t<=mq;function vq(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 wq=e=>e.length>0&&e.every(t=>t>=200);function i2(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 ty(e){const{brand:t}=un(),{pathname:n}=Bn(),r=!!gn(pt.brand),a=!!gn({path:pt.hub,end:!1}),i=!!gn({path:pt.set,end:!1}),l=a||i,u=!!gn({path:pt.products,end:!1}),f=!!gn({path:pt.scenes,end:!1}),h=!!gn({path:pt.presenters,end:!1}),p=g=>g?"fill":"regular";return[{key:"home",label:"Home",icon:o.jsx(VF,{size:e,weight:p(r)}),active:r,to:Ho(t)},{key:"create",label:"Create",icon:o.jsx(XF,{size:e,weight:p(l)}),active:l,to:l?`${n}?compose=1`:`${jr(t)}?compose=1`},{key:"products",label:"Products",icon:o.jsx(xm,{size:e,weight:p(u)}),active:u,to:sd(t)},{key:"presenters",label:"People",icon:o.jsx(ym,{size:e,weight:p(h)}),active:h,to:di(t)},{key:"scenes",label:"Places",icon:o.jsx(wm,{size:e,weight:p(f)}),active:f,to:gl(t)}]}const Na=e=>{var t,n;return((n=(t=e.json)==null?void 0:t.meta)==null?void 0:n.name)??e.slug};function yq(e){return([...e.trim()].find(n=>new RegExp("\\p{L}|\\p{N}","u").test(n))??"?").toUpperCase()}function bq(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 pk=new Map;function xq(e,t){const n=e.naturalWidth,r=e.naturalHeight,a=t||gq(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=wq(vq(n,r).map(([f,h])=>u.getImageData(f,h,1,1).data[3])))}catch{}return{fits:a,bleed:i}}function iR({brand:e,size:t=20,round:n=!1}){var h,p,g;const[,r]=s.useReducer(m=>m+1,0),a=pq(e.json),i=a?Qm(a.mark.file,"micro"):null,l=i?pk.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:bq(f)}},"aria-hidden":!0,children:[u?o.jsx("img",{src:u,alt:""}):yq(Na(e)),i&&!l&&o.jsx("img",{src:i,alt:"",hidden:!0,onLoad:m=>{pk.set(i,xq(m.currentTarget,!!(a!=null&&a.square))),r()}})]})}function kq(){const e=ty(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(Vn,{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 Sq({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 Eq({mode:e,lead:t,running:n,unread:r,animate:a}){const i=Cq(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(Sq,{value:l?(t.percent??0)/100:0,indeterminate:!l,size:32}),t.thumb?o.jsx("img",{src:vn(t.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):o.jsx(v8,{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(v8,{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(v8,{size:18})})}function Cq(e){return s.useRef(e).current}const Dp=new Set;let ad=0;const lR=e=>{ad=requestAnimationFrame(lR);for(const t of Dp)t(e/1e3)};function cR(e){Dp.add(e),ad||(ad=requestAnimationFrame(lR))}function uR(e){Dp.delete(e),!Dp.size&&ad&&(cancelAnimationFrame(ad),ad=0)}function jq(e){let t=[0],n=1;for(;n<e;){const r=n*2,a=new Array(r*r);for(let i=0;i<r;i++)for(let l=0;l<r;l++)a[i*r+l]=4*t[i%n*n+l%n]+[0,2,3,1][Math.floor(i/n)*2+Math.floor(l/n)];t=a,n=r}return t}function Aq(e,t,n){const r=jq(e).map(i=>(i+.5)/(e*e)),a=new Float32Array(t*n);for(let i=0,l=0;i<n;i++)for(let u=0;u<t;u++,l++)a[l]=r[i%e*e+u%e];return a}function Y0(e){const t=getComputedStyle(e),n=mk(t.getPropertyValue("--sc-fg").trim()||"#f5f5f5"),r=mk(t.getPropertyValue("--sc-raised").trim()||"#1a1a1a");return{ink:[0,1,2].map(a=>Math.round(n[a]*.22+r[a]*.78)),ground:r}}const H4=e=>(255<<24|e[2]<<16|e[1]<<8|e[0])>>>0,z8=(e,t,n)=>(.2126*e+.7152*t+.0722*n)/255,g1=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Nq(e){const t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const n=window.matchMedia("(prefers-color-scheme: dark)");return n.addEventListener("change",e),()=>{t.disconnect(),n.removeEventListener("change",e)}}function mk(e){const t=document.createElement("canvas");t.width=t.height=1;const n=t.getContext("2d");if(!n)return[110,110,110];n.fillStyle=e,n.fillRect(0,0,1,1);const r=n.getImageData(0,0,1,1).data;return[r[0],r[1],r[2]]}const Pu=2,Mq=8,dR=.55,fR=Math.PI*2,Rq=e=>e<0?0:Math.min(e,1),hR=e=>e-Math.floor(e),ny=e=>{const t=Rq(e);return t*t*(3-2*t)},Hp=(e,t,n)=>ny((e-t)/(n-t)),ry=(e,t)=>4*(.35*e+.8*t)/fR;function Pq(e){const t=Math.min(1,Math.max(.3,e/240));return{short:e*t,gain:1+(1-t)*.6}}function pR(e,t){const n=Math.max(4,Math.round(e/Pu)),r=Math.max(4,Math.round(t/Pu)),a=n*Pu,i=r*Pu,{short:l,gain:u}=Pq(Math.min(a,i)),f=new Float32Array(n*r),h=new Float64Array(n*r),p=new Float64Array(n*r);for(let g=0,m=0;g<r;g++)for(let w=0;w<n;w++,m++){const y=((w+.5)*Pu-a/2)/l,b=-((g+.5)*Pu-i/2)/l,S=Math.hypot(y,b);f[m]=u*dR*ny(S**1.2),h[m]=1/Math.max(S,1e-6)**1.2,p[m]=6*Math.atan2(b,y)/fR}return{w:n,h:r,shape:f,curl:h,arm:p,thr:Aq(Mq,n,r)}}const Lq=.6,Tq=(e,t)=>t===null?1:ny((e-t)/Lq);function O4(e,t,n,r){const a=e.getContext("2d"),i=H4(t.ink);let l=null,u=null,f=new Uint32Array(0);return{size(h,p){a&&(l=pR(h,p),e.width=l.w,e.height=l.h,u=a.createImageData(l.w,l.h),f=new Uint32Array(u.data.buffer))},draw(h){if(!a||!l||!u)return;const p=Tq(h,r),g=ry(h,n),{shape:m,curl:w,arm:y,thr:b}=l;for(let S=0;S<f.length;S++)f[S]=m[S]*p*hR(w[S]+y[S]+g)>b[S]?i:0;a.putImageData(u,0,0)}}}function mR(e,t,n,r,a){const i=e.getContext("2d"),{w:l,h:u,shape:f,curl:h,arm:p,thr:g}=pR(r,a);e.width=l,e.height=u;const m=document.createElement("canvas");m.width=l,m.height=u;const w=m.getContext("2d",{willReadFrequently:!0});if(!i||!w)return null;w.imageSmoothingQuality="high";const y=Math.max(l/t.naturalWidth,u/t.naturalHeight),b=l/y,S=u/y;w.drawImage(t,(t.naturalWidth-b)/2,(t.naturalHeight-S)/2,b,S,0,0,l,u);const k=w.getImageData(0,0,l,u).data,C=z8(...n.ink)>z8(...n.ground),E=new Float32Array(l*u),A=new Float32Array(l*u);for(let R=0;R<E.length;R++){const H=R*4,D=z8(k[H],k[H+1],k[H+2]);E[R]=dR*(C?D:1-D);const U=E[R]>g[R]?n.ink:n.ground,_=(Math.abs(U[0]-k[H])+Math.abs(U[1]-k[H+1])+Math.abs(U[2]-k[H+2]))/765;A[R]=(1-_+g[R])/2}const L=Hq(A),$=H4(n.ink),N=H4(n.ground),j=i.createImageData(l,u),P=new Uint32Array(j.data.buffer);return(R,H,D)=>{for(let U=0;U<P.length;U++){if(L[U]<H){P[U]=0;continue}const _=f[U]*hR(h[U]+p[U]+D);P[U]=_+(E[U]-_)*R>g[U]?$:N}i.putImageData(j,0,0)}}const Op=900;function $q(e,t,n,r,a,i,l){const u=mR(e,t,n,a,i),f=Op/1e3;return{ms:Op,draw(h){const p=Math.min(h,.6);u==null||u(Hp(h,0,.6),Hp(h,.35,1),ry(l+f*(p-p*p/1.2),r))}}}function Dq(e,t,n,r,a,i,l){const u=mR(e,t,n,a,i),f=Op/1e3;return{ms:Op,draw(h){const p=Math.max(0,h-.4);u==null||u(1-Hp(h,.4,1),1-Hp(h,0,.65),ry(l+f-f*(.36-p*p)/1.2,r))}}}function Hq(e){const n=l=>Math.min(1023,Math.floor(l*1024)),r=new Uint32Array(1024);for(let l=0;l<e.length;l++)r[n(e[l])]++;const a=new Float64Array(1024);for(let l=1;l<1024;l++)a[l]=a[l-1]+r[l-1];const i=new Float32Array(e.length);for(let l=0;l<e.length;l++){const u=n(e[l]);i[l]=(a[u]+r[u]/2)/e.length}return i}const Oq=4;let Xi=null;function Iq(e,t){var l;const n=performance.now()/1e3,r=Xi&&Date.now()-Xi.epoch<2500?Xi:null;if(e)return r||(Xi={perf:n,epoch:Date.now()}),((l=r??Xi)==null?void 0:l.perf)??n;if(!t)return null;const a=qa(t);if(Number.isNaN(a))return null;const i=(Date.now()-a)/1e3;return i>Oq?null:Xi&&Math.abs(a-Xi.epoch)<2500?Xi.perf:n-Math.max(0,i)}const Hh=new Map;function $a({index:e=0,appear:t,since:n,from:r}){const a=s.useRef(null),i=s.useRef(null),[l]=s.useState(()=>Iq(t,n)),[u]=s.useState(r),[f,h]=s.useState(()=>!!u&&!g1());return s.useLayoutEffect(()=>{const p=a.current;if(!(p!=null&&p.getContext("2d")))return;const g=g1(),m=i.current,w=u&&(m!=null&&m.complete)&&m.naturalWidth?u:null,y=g||w?null:l;let b=O4(p,Y0(p),e,y),S=!0;const k=()=>{const R=p.getBoundingClientRect();R.width<2||R.height<2||(b.size(R.width,R.height),b.draw(performance.now()/1e3))};let C=null,E=0,A=0;const L=()=>{C=null,m&&(m.style.visibility="hidden"),h(!1),k()};if(w&&m){const R=p.getBoundingClientRect(),H=performance.now();for(const[U,_]of Hh)H-_>1e4&&Hh.delete(U);const D=Hh.get(w.at)??H;Hh.set(w.at,D),C=Dq(p,m,Y0(p),e,R.width,R.height,D/1e3),E=H-D,A=H,E<C.ms?C.draw(E/C.ms):L()}else m?L():k();const $=R=>{if(C){const H=R*1e3;E+=Math.min(50,Math.max(0,H-A)),A=H,E<C.ms?C.draw(E/C.ms):L()}else S&&b.draw(R)},N=new ResizeObserver(()=>{C||k()});N.observe(p);const j=new IntersectionObserver(([R])=>{S=R.isIntersecting});j.observe(p);const P=Nq(()=>{b=O4(p,Y0(p),e,y),C||k()});return g||cR($),()=>{uR($),N.disconnect(),j.disconnect(),P()}},[e,l,u]),o.jsxs("span",{className:"sc-rendering","aria-hidden":!0,children:[f&&u&&o.jsx("img",{ref:i,className:"sc-rendering-from",src:u.src,alt:"",decoding:"sync"}),o.jsx("canvas",{ref:a,className:"sc-swirl"})]})}function gk({onClose:e,onSeen:t,onOpenDetail:n}){const{tasks:r,feed:a,unread:i,clearFeed:l}=ua(),u=r.filter(k=>k.state==="running"),{brand:f}=un(),{push:h}=rr(),p=Vq(1e3),g=s.useRef(null),m=s.useRef(null),w=s.useRef(!1);s.useEffect(()=>{var k;!w.current||a.length>0||(w.current=!1,(k=g.current)==null||k.focus({preventScroll:!0}))},[a.length]);const y=()=>{w.current=!0,l()},b=k=>{var C;k.detail===0&&((C=m.current)==null||C.focus({preventScroll:!0})),t()},S=k=>{if(k.startsWith("node:")){Ee.cancelNode(k.slice(5)).catch(C=>h(ln(C,"Could not cancel this shot")));return}if(k.startsWith("build:")){Ee.cancelAssetBuild(f.id,k.slice(6)).catch(C=>h(ln(C,"Could not stop this build")));return}if(k.startsWith("scene:")){Ee.cancelSceneStudioJob(f.id,k.slice(6)).catch(C=>h(ln(C,"Could not stop this place")));return}if(k.startsWith("presenter:")){const C=k.split(":")[1]??"";Ee.stopDraft(f.id,C).catch(E=>h(ln(E,"Could not stop this person")));return}k.startsWith("catalog:")&&Ee.cancelCatalogJob(f.id,k.slice(8)).catch(C=>h(ln(C,"Could not stop this import")))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-head",children:"Activity"}),u.length>0&&o.jsxs("section",{"aria-label":"In progress",children:[o.jsx("h3",{className:"sc-notif-label",children:"In progress"}),u.map(k=>o.jsx(Fq,{task:k,now:p,onNavigate:e,onCancel:S,onOpenDetail:n},k.id))]}),a.length===0&&u.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):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:b,children:"Mark all read"}),o.jsx("button",{ref:m,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:"Work that finishes shows up here."}):o.jsx("div",{className:"sc-notif-scroll",children:a.map(k=>o.jsx(_q,{item:k,now:p,onNavigate:e,onSeen:t},k.id))})]})]})}function gR({task:e}){return e.thumb?o.jsx("img",{src:vn(e.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):e.state==="running"?e.kind==="catalog"||e.kind==="library"?o.jsx("span",{className:"sc-placeholder"}):o.jsx($a,{}):e.state==="error"?o.jsx(Bc,{size:17,weight:"fill"}):e.state==="cancelled"?o.jsx(r_,{size:17,color:"var(--sc-fg3)"}):e.kind==="catalog"?o.jsx(DC,{size:17}):e.kind==="library"?o.jsx(zF,{size:17}):e.kind==="presenter"?o.jsx(ym,{size:17}):e.kind==="scene"?o.jsx(wm,{size:17}):o.jsx(Oa,{size:17})}function Fq({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&&e.id.startsWith("catalog:")?e.id.slice(8):null,f=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(gR,{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",role:"progressbar","aria-label":e.title,"aria-valuenow":e.percent,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${e.percent}%`}})}):null]}),o.jsx("span",{className:"sc-notif-time",children:i?Oc(e.startedAt,t):XM(e.startedAt,t)})]});return o.jsxs("div",{className:"sc-notif-row-wrap",children:[u?o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,onClick:()=>a(u),children:f}):e.href?o.jsx(Vn,{className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,to:e.href,onClick:n,children:f}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,disabled:!0,children:f}),i&&l&&o.jsx("button",{type:"button",className:"sc-notif-row-cancel",onClick:h=>{h.stopPropagation(),r(e.id)},children:"Cancel"})]})}function _q({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(gR,{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:XM(e.at,t)})]});return e.href?o.jsx(Vn,{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 Vq(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function Od(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 vR({label:e,onClose:t,children:n}){const{sheet:r,grip:a}=Od(t);return s.useEffect(()=>{const i=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),Ur.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 wR(e,t){const{pathname:n}=Bn(),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 Zq=new Set(["Shift","Control","Alt","AltGraph","Meta","CapsLock","Fn","FnLock","Hyper","Super","OS"]);let Ip=null;function vk(e){Ip!==e&&(Ip=e,document.documentElement.dataset.input=e)}function zq(){const e=n=>{n.isComposing||n.key==="Unidentified"||Zq.has(n.key)||vk("keyboard")},t=()=>vk("pointer");return window.addEventListener("keydown",e,!0),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("keydown",e,!0),window.removeEventListener("pointerdown",t,!0)}}function Bq(){return Ip}function l2(e){return Ip!=="pointer"&&e.matches(":focus-visible")}function hr({label:e,open:t,children:n}){return o.jsx(Vw,{content:e,className:"sc-tip",maxWidth:"220px",...t?{open:!0}:{},children:bR(n)})}function yR(e,t,n){return n?t:o.jsx(hr,{label:e,children:t})}function bR(e){const t=e.props.onFocus;return s.cloneElement(e,{onFocus:n=>{t==null||t(n),Bq()==="pointer"&&n.preventDefault()}})}function Gs({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}=Od(i);s.useEffect(()=>{e&&window.dispatchEvent(new CustomEvent("scenri:modal-open"))},[e]);const m=l??EM,w=u;return o.jsx(Ll,{open:e,onOpenChange:y=>!y&&i(),children:o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-newdlg-scrim","data-tone":h}),o.jsx(Dl,{className:"sc-newdlg-layer",...r?{}:{"aria-describedby":void 0},onOpenAutoFocus:m,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 As({className:e,children:t}){return o.jsx(Hl,{className:e,children:t})}const Ns=s.forwardRef(function({children:t,...n},r){return o.jsx(_1,{asChild:!0,ref:r,...n,children:t})});function Ic({className:e,asChild:t,children:n}){return o.jsx(ew,{className:e,asChild:t,children:n})}const wk=300,Uq={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 I4({brandId:e,jobId:t,onDismiss:n}){const[r,a]=s.useState(null),[i,l]=s.useState(!1);s.useEffect(()=>{let g=!1,m;const w=async()=>{try{const y=await Ee.catalogJob(e,t);if(g)return;a(y),y.finishedAt||(m=setTimeout(w,wk))}catch{g||(m=setTimeout(w,wk*3))}};return w(),()=>{g=!0,m&&clearTimeout(m)}},[e,t]);const u=!!r&&!r.finishedAt,f=r?QM(r):0,h=(r==null?void 0:r.errors)??[],p=async()=>{l(!0);try{await Ee.cancelCatalogJob(e,t)}catch{l(!1)}};return o.jsxs(Gs,{open:!0,className:"sc-imp",maxWidth:"440px",described:!0,onDismiss:n,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Importing products"}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(Ic,{className:"sc-imp-sub",children:o.jsxs("span",{role:"status",children:[r?Uq[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,m)=>o.jsx("li",{children:g.message},m))})]}),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 da="(max-width: 767px)";function Or(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 yk=new Map;function Wq(e){let t=yk.get(e);if(!t){const n=window.matchMedia(e);t={mq:n,subscribe:r=>(n.addEventListener("change",r),()=>n.removeEventListener("change",r))},yk.set(e,t)}return t}function sy(){const e=Wq("(hover: none)");return s.useSyncExternalStore(e.subscribe,()=>e.mq.matches,()=>!1)}function Kq(){const{tasks:e,running:t,unread:n,panelOpen:r,setPanelOpen:a,markSeen:i}=ua(),{brand:l}=un(),u=Or(da),f=Gq(),[h,p]=s.useState(null);s.useEffect(()=>p(null),[l.id]),wR(r,()=>a(!1));const g=UY(e),m=t>0?"busy":n>0?"new":"quiet",w="Activity"+(n?`, ${n} unread`:"")+(t?`, ${t} task${t===1?"":"s"} running`:""),y=m==="busy"&&g?`${BY(g.kind)}, ${Oc(g.startedAt,Date.now())}`:"Activity",b=o.jsx(Eq,{mode:m,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":m,"data-on":r||void 0,"aria-label":w,"aria-expanded":r,onClick:()=>a(!r),children:b}),r?o.jsx(vR,{label:"Activity",onClose:()=>a(!1),children:o.jsx(gk,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})}):null,h?o.jsx(I4,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]}):o.jsxs(o.Fragment,{children:[o.jsxs(yd,{open:r,onOpenChange:a,children:[o.jsx(hr,{label:y,children:o.jsx(bd,{children:o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":m,"aria-label":w,children:b})})}),o.jsx(xd,{align:"end",sideOffset:20,className:"sc-notif-pop","aria-label":"Activity",children:o.jsx(gk,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})})]}),h?o.jsx(I4,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]})}function Gq(){const[e,t]=s.useState(!1),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,t(!0))},[]),e}function Yq(){const e=ty(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(Vn,{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 F4=s.createContext(null);function xR({label:e,className:t,offset:n=22,trigger:r,children:a}){const i=Or(da),[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 wR(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(vR,{label:e,onClose:h,children:o.jsxs("div",{className:"sc-menu-sheet",children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(F4.Provider,{value:{close:h,focusTrigger:p},children:a})]})})]}):o.jsxs(Es,{open:l,onOpenChange:u,modal:!1,children:[o.jsx(Cs,{children:s.cloneElement(r,{ref:f})}),o.jsxs(js,{align:"end",sideOffset:n,className:`sc-menu ${t??""}`,onPointerDownOutside:g=>{var m;(m=f.current)!=null&&m.contains(g.target)&&g.preventDefault()},onCloseAutoFocus:g=>{g.preventDefault();const m=document.activeElement;(!m||m===document.body)&&p()},children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(F4.Provider,{value:{close:null,focusTrigger:p},children:a})]})]})}function od({className:e="sc-menu-item",to:t,onSelect:n,disabled:r,children:a,...i}){const l=s.useContext(F4),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(Vn,{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(Wn,{asChild:!0,className:e,...i,children:o.jsx(Vn,{to:t,children:a})}):o.jsx(Wn,{className:e,onSelect:f,disabled:r,...i,children:a})}function kR(e,t){return[...e].sort((n,r)=>t(n).localeCompare(t(r),void 0,{sensitivity:"base"})||n.slug.localeCompare(r.slug))}function qq(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 kR(a,n)}function Xn({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),m=l!==void 0;return o.jsxs(K1,{open:l,onOpenChange:w=>{w&&(h.current=!1),u==null||u(w)},children:[l===void 0&&o.jsx(IN,{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(G1,{maxWidth:"420px",onOpenAutoFocus:()=>{m&&(g.current=document.activeElement)},onCloseAutoFocus:w=>{var y;!m||!((y=g.current)!=null&&y.isConnected)||(w.preventDefault(),g.current.focus())},children:[o.jsx(Y1,{children:t}),o.jsx(q1,{size:"2",children:n}),o.jsxs(Zs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Q1,{children:o.jsx(ja,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(X1,{children:o.jsx(ja,{color:"red",onClick:p,disabled:r,children:e})})]})]})]})}function Xq(){const{brand:e}=un(),t=Zl(),n=Un(),r=n2(),{push:a}=rr(),[i,l]=s.useState(!1),u=async()=>{const f=await r.quit();f.kind==="refused"&&a({kind:"warning",title:"Scenri is still working",detail:f.reason}),f.kind==="still-running"&&a({kind:"error",title:"Scenri did not shut down",detail:"It is still running. Try again in a moment."})};return o.jsxs(o.Fragment,{children:[o.jsxs(xR,{label:"Brands",className:"sc-menu-brand",trigger:o.jsx("button",{type:"button",className:"sc-org-btn","aria-label":`${Na(e)}, brand and settings`,children:o.jsx(iR,{brand:e,size:32,round:!0})}),children:[o.jsx(Jq,{}),o.jsx("div",{className:"sc-menu-rule"}),o.jsxs(od,{onSelect:()=>n("/setup"),children:[o.jsx(gr,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up a brand"})]}),o.jsxs(od,{onSelect:()=>t(),children:[o.jsx(DF,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Settings"})]}),r.thisComputer&&o.jsxs(od,{"data-quit":"",onSelect:()=>l(!0),children:[o.jsx(AC,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Shut down Scenri"})]})]}),o.jsx(Xn,{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 Qq=7;function Jq(){const{brands:e}=Mn(),{brand:t}=un(),n=Un(),[r,a]=s.useState(""),i=m=>Na(m).trim().toLowerCase(),l=new Map;for(const m of e)l.set(i(m),(l.get(i(m))??0)+1);const u=e.length>=Qq,f=r.trim(),h=u&&f?qq(e,f,Na):[],p=m=>{const w=m.id===t.id,y=(l.get(i(m))??0)>1;return o.jsxs(od,{"data-current":w||void 0,"data-two-line":y||void 0,onSelect:w?void 0:()=>n(Ho(m)),children:[o.jsx(iR,{brand:m,size:20,round:!0}),o.jsxs("span",{className:"sc-menu-brand-lb",children:[o.jsx("span",{dir:"auto",children:Na(m)}),y&&o.jsxs("span",{className:"sc-menu-brand-sub",children:["/",m.slug]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Gn,{size:14,className:"sc-menu-check","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", current brand"})]})]},m.id)},g=kR(e.filter(m=>m.id!==t.id),Na);return u?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"sc-menu-find",children:[o.jsx(gd,{size:16,"aria-hidden":"true"}),o.jsx("input",{type:"search",value:r,placeholder:"Find a brand","aria-label":"Find a brand",onChange:m=>a(m.target.value),onKeyDown:m=>{const w=h.find(y=>y.id!==t.id);m.key!=="Enter"||!w||(m.preventDefault(),n(Ho(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 eX(){const e=Or("(min-width: 1024px)"),t=SM(),[n]=Ml();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 Si(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 ay(e){const t=es(e.avatar);if(t)return{src:t};const n=a=>{var i;return Array.isArray(a)?es((i=a[0])==null?void 0:i.file):null},r=es(e.preview)??n(e.shots)??n(e.sourceRefs);return r?{src:r,crop:"top"}:{src:null}}const SR=["hero","close","hands","angle","bold"],_4=e=>Array.isArray(e)?e.map(t=>es(t==null?void 0:t.file)).filter(t=>!!t):[],oy=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 v1(e){return e.length<2?[...e]:e.slice().reverse()}function ER(e){const t=e.filter(n=>n.origin!=="catalog");return t.length===e.length?v1(e):[...v1(t),...e.filter(n=>n.origin==="catalog")]}function lf(e){return v1(oy(e).filter(t=>!t.supersededBy).map(CR))}function tX(e,t){const n=oy(e).find(r=>r.id===t);return n?CR(n):void 0}function iy(e,t){var i;const n=oy(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 CR(e){var a;const t=_4(e.shots),n=_4(e.sourceRefs),r=es(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:es(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 Jc(e){var n;const t=((n=e==null?void 0:e.json)==null?void 0:n.scenes)??[];return v1(t.map(rX))}function w1(e,t){return Jc(e).find(n=>n.id===t)}const nX=["place",...SR];function rX(e){var l;const t=_4(e.refs),n=es(e.preview)??null,r=Array.isArray(e.examples)?e.examples.filter(u=>SR.includes(u==null?void 0:u.role)&&es(u==null?void 0:u.file)).map(u=>({role:u.role,url:es(u.file),hash:String(u.file).slice(6),earlier:u.from!==e.preview,with:u.presenter?"presenter":"product",...u.setup?{setup:String(u.setup)}:{}})):void 0,a=nX.includes(e.cover)?e.cover:void 0,i=a&&a!=="place"?(l=r==null?void 0:r.find(u=>u.role===a&&!u.earlier))==null?void 0:l.url:void 0;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:i??n,placeUrl:n,...a?{cover:a}:{},previewColor:null,custom:!0,refs:t,previewHash:/^asset:[a-f0-9]{32}$/.test(String(e.preview??""))?String(e.preview).slice(6):null,...e.anchor===!0?{anchor:!0}:{},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(u=>(u==null?void 0:u.id)&&(u==null?void 0:u.label)&&(u==null?void 0:u.camera)).map(u=>({id:String(u.id),label:String(u.label),camera:String(u.camera)})):void 0,examples:r}}function sX(e){const t=e.cover;return!t||t==="place"?"place":!e.examples||e.examples.some(n=>n.role===t&&!n.earlier)?t:"place"}function Fp(e,t){const n=new Set(e.map(r=>r.id));return[...e,...t.filter(r=>!n.has(r.id))]}function up(e,t){return t.map(n=>n.t==="character"&&n.id?{...n,id:iy(e,n.id)}:n)}function jR(){const{brand:e,products:t}=un(),{scenes:n,presenters:r,demoProducts:a,showcase:i}=Mn();return s.useMemo(()=>{const l={presenters:lf(e),scenes:Jc(e)},u=new Set,f=y=>!y||u.has(y)?null:(u.add(y),y),h=(y,b)=>{for(const S of y){const k=f(b(S));if(k)return Tn(k,"tile")}return null},p=y=>h(i.filter(b=>{var S;return(((S=b.brief)==null?void 0:S.tokens)??[]).some(k=>(k==null?void 0:k.t)===y)}),b=>b.previewUrl),g=h([...t].reverse(),y=>{var b,S;return es((S=(b=y==null?void 0:y.shots)==null?void 0:b[0])==null?void 0:S.file)}),m=h(l.presenters,y=>y.previewUrl??Si(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:m??p("character")??h(r,y=>y.previewUrl??Si(y).src)??null,count:l.presenters.length,own:!!m},scene:{url:w??h(n,y=>y.previewUrl)??p("template")??null,count:l.scenes.length,own:!!w}}},[e,t,n,r,a,i])}const aX=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",nouns:"products",icon:xm},{kind:"presenter",label:"Person",line:"Who appears in the shot",noun:"person",nouns:"people",icon:ym},{kind:"scene",label:"Place",line:"Where it happens, and its light",noun:"place",nouns:"places",icon:wm}],bk=(e,t,n)=>e===0?"None yet":`${e} ${e===1?t:n}`;function oX({suggest:e,onPick:t}){const n=s.useRef(null),{close:r}=Nr("new"),a=jR(),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(Gs,{className:"sc-newpick",maxWidth:"620px",onDismiss:r,onOpenAutoFocus:l=>{l.preventDefault(),i()},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Add to this brand"}),o.jsx(Ns,{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:aX.map(({kind:l,label:u,line:f,noun:h,nouns:p,icon:g})=>{const{url:m,count:w,own:y}=a[l];return o.jsxs("button",{type:"button",className:"sc-pick","data-kind":l,onClick:()=>t(l),"aria-label":`${u}. ${f}. ${bk(w,h,p)}.`,children:[o.jsxs("span",{className:"sc-pick-media",children:[m?o.jsx("img",{src:m,alt:"",loading:"lazy"}):o.jsx("span",{className:"sc-pick-blank",children:o.jsx(g,{size:22})}),y&&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:bk(w,h,p)})]},l)})})})]})}const id=14,iX=768,Ei=[{px:190,label:"Compact",cells:3,cols:6,min:200},{px:320,label:"Large",cells:2,cols:5,min:280}];function lX(e){let t=Ei[0];for(const n of Ei)Math.abs(n.px-e)<Math.abs(t.px-e)&&(t=n);return t}const AR=320;function NR(e){const t=typeof e=="number"&&Number.isFinite(e)?e:AR;let n=Ei[0].px;for(const r of Ei)Math.abs(r.px-t)<Math.abs(n-t)&&(n=r.px);return n}const Sd=5;function eu(e){const t=typeof e=="number"?e:Sd;return t===7||t===5?t:t===6?5:Sd}const cX={5:8,7:14};function uX(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 dX(){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 B8(e,t){return Math.max(1,Math.floor((e-id*(t-1))/t))}function fX(e,t,n){if(e<=0)return{tile:t,cols:1};if(n)return{tile:Math.floor((e-id)/2),cols:2};const r=Ei[1],a=Ei[0],i=Math.min(r.cols,Math.max(1,Math.floor((e+id)/(r.min+id))));if(lX(t).px===r.px)return{tile:B8(e,i),cols:i};let l=Math.min(a.cols,i+1);return l>1&&B8(e,l)<a.min&&(l=i),{tile:B8(e,l),cols:l}}function xk(e){return Math.max(1,e)}function c2(e){return eu(e)===5?"large":"compact"}const cf=s.createContext("large");function MR(){return s.useContext(cf)}const hX=[{value:7,label:"Compact",hint:"More cards per row",cells:3},{value:5,label:"Large",hint:"Fewer, larger cards",cells:2}],pX=Ei.map(e=>({value:e.px,label:e.label,hint:e.label==="Compact"?"More shots per row":"Fewer, larger shots",cells:e.cells}));function u2({value:e,onChange:t}){return o.jsx(RR,{label:"Grid size",value:eu(e),options:hX,onChange:n=>t(n)})}function mX({value:e,onChange:t}){return o.jsx(RR,{label:"Shot size",value:NR(e),options:pX,onChange:t})}function RR({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(gX,{cells:i.cells})},i.value)})]})}function gX({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 d2(e){const t=eu(e),n=(t===5?Ei[1]:Ei[0]).min;return{"--sc-wall-cols":String(t),"--sc-tile-min":`${n}px`}}function ld({name:e}){const t={size:14,"aria-hidden":!0};switch(e){case"open":return o.jsx(qE,{...t});case"continue":return o.jsx(Ea,{...t});case"open-tab":return o.jsx(Mc,{...t});case"refine":return o.jsx(cC,{...t});case"select":return o.jsx(Gn,{...t,weight:"bold"});case"keep":return o.jsx(to,{...t});case"kept":return o.jsx(to,{...t,weight:"fill"});case"unset":return o.jsx(GE,{...t});case"versions":return o.jsx(LC,{...t});case"archive":return o.jsx(vm,{...t});case"restore":return o.jsx(s1,{...t});case"delete":case"discard":return o.jsx(Pl,{...t});case"use":return o.jsx(gr,{...t});case"duplicate":return o.jsx(bp,{...t});case"rename":return o.jsx(qF,{...t});case"edit":return o.jsx(Rd,{...t});case"cover":return o.jsx(ZF,{...t})}}const PR=new Set;function V4(e){return PR.has(e)}function Z4(e){e&&PR.add(e)}function Ma({src:e,srcSet:t,sizes:n=iM.large,crop:r,wait:a,blank:i="sc-lookpage-ref-blank",keep:l}){const[u,f]=s.useState({src:e,srcSet:t}),h=!!l&&u.src!==e&&V4(u.src);s.useEffect(()=>{if(!h){f(N=>N.src===e&&N.srcSet===t?N:{src:e,srcSet:t});return}let L=!0;const $=new Image;return t&&($.sizes=n,$.srcset=t),$.src=e,$.decode().catch(()=>{}).then(()=>{L&&(Z4(e),f({src:e,srcSet:t}))}),()=>{L=!1}},[h,e,t,n]);const p=h?u.src:e,g=h?u.srcSet:t,[m,w]=s.useState(null),[y,b]=s.useState(null),S=s.useRef(null),k=s.useCallback(()=>{Z4(p),b(p)},[p]),C=s.useCallback(L=>{S.current=L,L!=null&&L.complete&&L.naturalWidth&&k()},[k]);if(s.useLayoutEffect(()=>{const L=S.current;L!=null&&L.complete&&L.naturalWidth&&k()},[k]),m===p)return o.jsx("span",{className:i,"aria-hidden":!0,children:o.jsx(Oa,{size:20})});const E=V4(p),A=E||y===p;return o.jsxs(o.Fragment,{children:[a&&!A&&o.jsx("span",{className:"sc-placeholder"}),o.jsx("img",{ref:C,src:p,...g?{srcSet:g,sizes:n}:{},alt:"",loading:E?"eager":"lazy",decoding:E?"sync":"async","data-reveal":"","data-ready":A||void 0,"data-cached":E||void 0,...r?{"data-crop":r}:{},onLoad:k,onError:()=>w(p)})]})}function ly(){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(Oa,{size:20})})})})}function cy({node:e,to:t}){return o.jsx(Vn,{className:"sc-lookcard","aria-label":`Open ${Hr(e)}`,to:t,children:o.jsx(Ma,{src:vn(e.images[0],"tile"),blank:"sc-lookcard-blank"})})}function cd({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()}))},m=new ResizeObserver(()=>p());return m.observe(f),f.addEventListener("scroll",g,{passive:!0}),()=>{h&&cancelAnimationFrame(h),i.current=()=>{},m.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,m=u*h,w=performance.now();a.current=!0;const y=b=>{const S=Math.min(1,(b-w)/420);f.scrollLeft=g+m*(1-(1-S)**3),i.current(),S<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(Ha,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-slider-arrow next","aria-label":"Next",onClick:()=>l(1),children:o.jsx(Rl,{size:13,weight:"bold"})}),o.jsxs("div",{className:"sc-slider-track",ref:r,children:[t,t]})]})]})}function kk(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(ld,{name:r.icon}),r.label]})]},r.key))}function vX({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:m,bookmarked:w,onBookmark:y,menu:b,fresh:S,size:k="grid",chosen:C,batching:E,onPick:A}){const[L,$]=s.useState(!1),N=s.useRef(null),j=sy(),P=MR(),R=(J,he)=>yR(J,he,j),H=u==="use"&&!!f&&!!h&&!E,D=b??[],U=D.find(J=>J.key==="delete"),_=D.length>0,B=J=>{J.preventDefault(),J.stopPropagation(),A==null||A(e)};s.useEffect(()=>{if(!L)return;const J=he=>{var te;(te=N.current)!=null&&te.contains(he.target)||$(!1)};return document.addEventListener("pointerdown",J),()=>document.removeEventListener("pointerdown",J)},[L]);const K=t?o.jsx(Ma,{src:Tn(t,"tile"),srcSet:kc(t),sizes:iM[P],wait:!0,keep:!0,blank:"sc-lookcard-blank"}):n?o.jsx("span",{className:"sc-lookcard-blank","data-waiting":!0,children:o.jsx("span",{className:"sc-placeholder"})}):o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Oa,{size:20})}),V=J=>{J.preventDefault(),J.stopPropagation()},O=_?o.jsxs(Es,{children:[R("More",o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${a}`,onClick:J=>J.stopPropagation(),onContextMenu:J=>J.stopPropagation(),children:[o.jsx(Vv,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(_v,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})),o.jsx(js,{side:"top",align:"end",sideOffset:4,collisionPadding:12,children:kk(D,Wn,Ec)})]}):null,I=O||U||y?o.jsxs("div",{className:"sc-corner",children:[O,U&&R(U.label,o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-remove sc-cell-danger","aria-label":U.label,onClick:J=>{V(J),U.onSelect()},children:o.jsx(Pl,{size:15})})),y&&R(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:J=>{V(J),y(e)},children:o.jsx(to,{size:15,weight:w?"fill":"regular"})}))]}):null,Y=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":k,"data-on":g||void 0,"data-just-added":S||void 0,"aria-pressed":!!g,"aria-label":r,onClick:()=>m==null?void 0:m(e),children:[o.jsxs("span",{className:"sc-lookcard-media",children:[K,o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0}),o.jsx("span",{className:"sc-lookcard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]}),Y]});const Z=()=>{if(E&&A){A(e);return}if(H&&j){if(!L){$(!0);return}$(!1)}f?f(e):h==null||h(e)},X=()=>{$(!1),h==null||h(e)},z=o.jsxs("div",{ref:N,className:"sc-lookcard","data-fb":"catalog-card","data-fb-id":e,"data-variant":u,"data-size":k,"data-armed":L||void 0,"data-just-added":S||void 0,"data-picked":C||void 0,"data-batching":E||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[p?o.jsxs(Vn,{className:"sc-lookcard-open",to:p,"aria-label":E?`${C?"Deselect":"Select"} ${a}`:r,onClick:J=>{if(E&&A){B(J);return}if(H&&j){if(!L){J.preventDefault(),$(!0);return}$(!1)}},children:[K,!E&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}):o.jsxs("button",{type:"button",className:"sc-lookcard-open",onClick:Z,"aria-label":E?`${C?"Deselect":"Select"} ${a}`:r,children:[K,!E&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}),H&&o.jsx("button",{type:"button",className:"sc-lookcard-use",onClick:X,children:l}),A&&R(C?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":C||void 0,"aria-pressed":!!C,"aria-label":C?`Deselect ${a}`:`Select ${a}`,onClick:B,children:o.jsx(Gn,{size:13,weight:"bold"})}))]}),I,Y]});return D.length===0||j?z:o.jsxs(ef,{children:[o.jsx(tf,{children:z}),o.jsx(nf,{children:kk(D,rf,Xm)})]})}function f2({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 sc-wait-late","data-variant":"skeleton","data-size":e,"data-caption":n?void 0:"photo","aria-hidden":!0},a))})}const Id=s.memo(vX),wX=/^(p|product|products|item|items|dp|sku)$/i;function yX(e){let t="";try{const r=new URL(e).pathname.split("/").filter(Boolean);t=[...r].reverse().find(a=>!wX.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 bX(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 U8=24,xX=12;function LR({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(z=>z.url).filter(Boolean),[t.candidateUrls,t.cards]),[f,h]=s.useState(""),[p,g]=s.useState(()=>new Set(u)),[m,w]=s.useState(U8),[y,b]=s.useState(()=>{const z=new Map;for(const J of t.cards??[])J.url&&z.set(J.url,{externalKey:J.externalKey,title:J.title,url:J.url,images:J.image?[{url:J.image}]:[]});for(const J of t.candidates)J.url&&z.set(J.url,J);return z}),S=s.useRef(new Set),k=s.useRef(y),C=s.useRef(!0),[E,A]=s.useState(0);s.useEffect(()=>(C.current=!0,()=>{C.current=!1}),[]);const[L,$]=s.useState(null),N=s.useRef(null),j=s.useMemo(()=>u.map(z=>({url:z,name:yX(z)})),[u]),P=s.useMemo(()=>j.filter(z=>bX(z.name,f)),[j,f]),R=s.useMemo(()=>P.slice(0,m),[P,m]);s.useEffect(()=>w(U8),[f]);const H=s.useRef([]),D=s.useRef(0),U=s.useRef(()=>{}),_=2,B=120,K=s.useCallback(()=>{for(;D.current<_&&H.current.length;){const z=H.current.splice(Math.max(0,H.current.length-xX));if(!z.length)return;D.current++,A(D.current),Ee.catalogDetails(e,z).then(({products:J})=>{if(!C.current)return;const he=new Map(k.current);for(const te of J)te.url&&he.set(te.url,te);for(let te=0;te<J.length&&te<z.length;te++)he.has(z[te])||he.set(z[te],J[te]);k.current=he,b(he)}).catch(()=>{for(const J of z)S.current.delete(J)}).finally(()=>{D.current=Math.max(0,D.current-1),C.current&&(A(D.current),U.current())})}},[e]);U.current=K,s.useEffect(()=>{const z=N.current;if(!z)return;const J=new IntersectionObserver(he=>{let te=!1;for(const me of he){if(!me.isIntersecting)continue;const re=me.target.dataset.fbId;if(J.unobserve(me.target),!(!re||k.current.has(re)||S.current.has(re))){for(S.current.add(re),H.current.push(re);H.current.length>B;){const ee=H.current.shift();ee&&S.current.delete(ee)}te=!0}}te&&U.current()},{root:z,rootMargin:"250% 0px"});for(const he of z.querySelectorAll("[data-fb-id]"))J.observe(he);return()=>J.disconnect()},[m,f]),s.useEffect(()=>{if(!L||m>=P.length)return;const z=L.closest(".sc-wizpick-grid"),J=new IntersectionObserver(he=>{he.some(te=>te.isIntersecting)&&w(te=>te+U8)},{root:z,rootMargin:"0px 0px 300% 0px"});return J.observe(L),()=>J.disconnect()},[L,m,P.length]);const V=s.useCallback(z=>{g(J=>{const he=new Set(J);return he.delete(z)||he.add(z),he})},[]),O=P.length>0&&P.every(z=>p.has(z.url)),I=p.size===u.length,Y=()=>{g(z=>{const J=new Set(z);for(const he of P)O?J.delete(he.url):J.add(he.url);return J})},Z=p.size,X=Z===1?"1 product":`${Z.toLocaleString()} products`;return o.jsxs(Gs,{open:!0,className:"sc-wizpick",maxWidth:"760px",described:!0,onDismiss:l,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Products on your site"}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx(Ic,{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(gd,{size:13}),o.jsx("input",{type:"search",value:f,onChange:z=>h(z.target.value),placeholder:`Search ${u.length.toLocaleString()} products`,"aria-label":"Search products"})]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:Y,disabled:!P.length,children:O?"Select none":f?`Select these ${P.length.toLocaleString()}`:"Select all"}),o.jsxs("span",{className:"sc-wizpick-count",children:[Z.toLocaleString()," selected"]})]}),o.jsxs("div",{className:"sc-wizpick-grid",ref:N,children:[R.map(z=>{var he,te;const J=y.get(z.url);return o.jsx(Id,{id:z.url,previewUrl:((te=(he=J==null?void 0:J.images)==null?void 0:he[0])==null?void 0:te.url)??null,pending:!J,title:(J==null?void 0:J.title)??z.name,primary:(J==null?void 0:J.title)??z.name,secondary:(J==null?void 0:J.price)!=null?`${J.currency??""} ${J.price}`.trim():(J==null?void 0:J.category)??"",useLabel:"Import",variant:"select",selected:p.has(z.url),onToggle:V,size:"grid"},z.url)}),m<P.length&&o.jsx("div",{className:"sc-wizpick-end",ref:$,"aria-hidden":!0}),!P.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}):E>0&&o.jsx("span",{className:"sc-wizpick-loading",children:"Loading products"}),o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!Z||n||y.size===0&&E>0,onClick:()=>I?i():a([...p]),children:n?"Importing":`Import ${X}`})]})]})}const W8=700,kX=45e3,SX=3e3;function TR(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),m=s.useRef(!0);s.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]),s.useEffect(()=>{if(!e)return;let b=!1,S,k=null;i(!0),u(!1),r(null),h(null);const C=(A,L)=>{r(A),h(L),i(!1),u(!0)};return(async()=>{try{const{scanId:A}=await Ee.catalogScan(e,t);if(k=A,b||!m.current){Ee.cancelCatalogScan(e,A).catch(()=>{});return}const L=Date.now()+kX,$=async()=>{if(!(b||!m.current)){if(Date.now()>L){C(null,{kind:"timeout"});return}try{const N=await Ee.catalogScanState(e,A,AbortSignal.timeout(SX));if(b||!m.current)return;if(N.status==="running"){S=setTimeout($,W8);return}N.result?C(N.result,null):C(null,{kind:"error",reason:N.error??"The look for a shop did not finish."})}catch(N){if(b||!m.current)return;if((N==null?void 0:N.status)===404){C(null,{kind:"error",reason:"The look for a shop was interrupted."});return}S=setTimeout($,W8)}}};S=setTimeout($,W8)}catch{b||C(null,{kind:"error",reason:"The look for a shop could not start."})}})(),()=>{b=!0,S&&clearTimeout(S),k&&Ee.cancelCatalogScan(e,k).catch(()=>{})}},[e,t,p]);const w=s.useCallback(()=>g(b=>b+1),[]);return{scan:n,scanning:a,settled:l,outcome:a?{kind:"scanning"}:f||(n?{kind:"result",scan:n}:{kind:"idle"}),retry:w}}const y1=[{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:"three-quarter",label:"Three-quarter"}]},{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:"side",label:"Side"}]},{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:"side",label:"Side"}]},{key:"accessories",label:"Accessories",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beverage",label:"Beverage",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"food",label:"Food",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"other",label:"Other",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]}],uy=new Map(y1.map(e=>[e.key,e]));uy.get("other");function b1(e){var t;return e?((t=uy.get(e))==null?void 0:t.label)??e:null}function EX(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 dy(e){return e.category&&uy.has(e.category)?e.category:EX(e.productType,e.tags)??null}function CX({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:m}){const{close:w}=Nr("new");return o.jsxs(Gs,{maxWidth:f,onDismiss:w,onPaste:y=>{var S;if(!g)return;const b=Array.from(((S=y.clipboardData)==null?void 0:S.files)??[]).filter(k=>k.type.startsWith("image/"));b.length&&(y.preventDefault(),g(b))},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(Ha,{size:15})}),o.jsx(As,{className:"sc-newdlg-title",children:e}),o.jsx(Ns,{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:m}),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(Tr,{size:"1"}):null,a]}),r&&o.jsx("p",{className:"sc-dlg-foot",children:r})]})]})}function $R({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 Sk({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}=$R({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 m=Array.from(g.target.files??[]);g.target.value="",m.length&&l(m)}}),n?o.jsx(Tr,{}):f,o.jsx("span",{className:"sc-dropzone-label",children:e}),t&&o.jsx("small",{children:t})]})}function DR({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(Sk,{label:n,hint:r,busy:a,onFiles:i,onReject:u,children:o.jsx(gr,{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:vn(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(Sk,{label:`${f} more`,busy:a,onFiles:i,onReject:u,children:o.jsx(gr,{size:15})})]})}let I0=null;const HR=(e,t)=>`${e}:${t}`;function jX(e,t,n){I0={key:HR(e,t),fields:n}}function AX(e,t){if(!I0||I0.key!==HR(e,t))return null;const{fields:n}=I0;return I0=null,n}const Ek={name:"",instruction:"",facets:[],imageHashes:[],importUrl:""};function NX(e,t,n){const r=n.restore??!1,[a,i]=s.useState(Ek),[l,u]=s.useState(!1),[f,h]=s.useState(null),p=s.useRef(null),g=s.useRef(null),m=s.useRef(n.pendingState);m.current=n.pendingState;const w=s.useRef(n.exists);w.current=n.exists;const y=s.useRef(n.onDiscarded);y.current=n.onDiscarded;const b=s.useRef(a);b.current=a,s.useEffect(()=>{var P;if(r){const R=AX(e,t);if(R){i(R);return}}const N=LM(e,t),j=N!=null&&N.pending?m.current(N.pending):null;if(N!=null&&N.pending&&j==="unknown"&&((P=w.current)!=null&&P.call(w,N.name))){Zu(e,t);return}if(N&&!N.pending){Zu(e,t);return}N&&uY(N,j)&&(g.current=N.pending,i({name:N.name,instruction:N.instruction,facets:N.facets,imageHashes:N.imageHashes,importUrl:N.importUrl}))},[e,t,r]);const S=s.useCallback(N=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{g.current&&F8(N)?_8(e,t,{...N,pending:g.current}):Zu(e,t)},400)},[e,t]),k=s.useCallback(N=>{i(j=>{const P={...j,...typeof N=="function"?N(j):N};return S(P),P})},[S]),C=s.useCallback(()=>{var j;p.current&&clearTimeout(p.current);const N=b.current;if(g.current&&F8(N)){_8(e,t,{...N,pending:g.current});return}Zu(e,t),F8(N)&&(jX(e,t,N),(j=y.current)==null||j.call(y))},[e,t]);s.useEffect(()=>(window.addEventListener("beforeunload",C),()=>{window.removeEventListener("beforeunload",C),C()}),[C]);const E=s.useCallback(async N=>{u(!0),h(null);try{const j=n.max-b.current.imageHashes.length,P=[];for(const R of N.slice(0,j))P.push(await p1(R));k(R=>({imageHashes:[...new Set([...R.imageHashes,...P])].slice(0,n.max)}))}catch(j){h(String(j.message??j))}finally{u(!1)}},[n.max,k]),A=s.useCallback(N=>k(j=>({imageHashes:j.imageHashes.filter(P=>P!==N)})),[k]),L=s.useCallback(N=>k(j=>({facets:j.facets.includes(N)?j.facets.filter(P=>P!==N):[...j.facets,N]})),[k]),$=s.useCallback(N=>{if(p.current&&clearTimeout(p.current),!N){Zu(e,t),g.current=null,i(Ek);return}g.current=N,i(j=>(_8(e,t,{...j,pending:N}),j))},[e,t]);return{fields:a,set:k,uploading:l,err:f,setErr:h,addFiles:E,removeHash:A,toggleFacet:L,submitted:$}}const Ck=6,MX=3;function RX({onBack:e,onStarted:t,restore:n,onDiscarded:r}){var j,P;const{brand:a}=un(),{applyBrand:i}=Mn(),[l,u]=s.useState(!1),[f,h]=s.useState(!1),[p,g]=s.useState(!1),m=NX(a.id,"product",{max:Ck,pendingState:()=>"unknown",restore:n,onDiscarded:r}),w=m.fields.imageHashes.length>0&&!m.uploading,y=m.uploading?"Photos are still uploading":w?void 0:"Add at least one photo",b=async()=>{u(!0),m.setErr(null);try{const{productId:R,...H}=await Ee.createProduct(a.id,{name:m.fields.name.trim(),imageHashes:m.fields.imageHashes,category:m.fields.facets[0]});i(H);const D=m.fields.name.trim()||"Product";m.submitted(null),t({kind:"product",id:R,name:D})}catch(R){m.setErr(String(R.message??R))}finally{u(!1)}},[S,k]=s.useState(null),{scan:C,scanning:E,settled:A}=TR(S?a.id:null,S??void 0),L=async R=>{const H=S??m.fields.importUrl.trim()??"";h(!0),m.setErr(null);try{await Ee.catalogImport(a.id,H,R),m.set({importUrl:""}),k(null),t({kind:"product",id:"",name:H})}catch(D){m.setErr(String(D.message??D))}finally{h(!1)}},$=()=>{var H,D;const R=m.fields.importUrl.trim()||(((D=(H=a.json)==null?void 0:H.meta)==null?void 0:D.website)??"");R&&(m.setErr(null),k(R))};s.useEffect(()=>{!S||!A||C&&C.verdict==="found"&&C.candidates.length||L()},[C,A,S]);const N=R=>{R.key==="Enter"&&(R.preventDefault(),w&&!l&&b())};return o.jsxs(CX,{title:"New product",error:m.err,footnote:"Added to this brand. No preview.",primaryLabel:"Add product",ready:w,blocked:y,busy:l,onBack:e,onPrimary:()=>void b(),onPasteFiles:R=>void m.addFiles(R),children:[o.jsxs("div",{className:"sc-assetform",children:[o.jsx(DR,{hashes:m.fields.imageHashes,max:Ck,label:"Add packshots",hint:`Straight, well-lit packshots. The first ${MX} are the ones a shot attaches.`,busy:m.uploading,onAdd:R=>void m.addFiles(R),onRemove:m.removeHash,onReject:()=>m.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:m.fields.name,onChange:R=>m.set({name:R.target.value}),onKeyDown:N})]})}),o.jsxs("fieldset",{className:"sc-assetform-facets",children:[o.jsx("legend",{children:"Category"}),o.jsx("div",{className:"sc-assetform-facets-chips",children:y1.map(R=>o.jsx("button",{type:"button",className:"sc-chip","data-on":m.fields.facets[0]===R.key||void 0,"aria-pressed":m.fields.facets[0]===R.key,onClick:()=>m.set({facets:m.fields.facets[0]===R.key?[]:[R.key]}),children:R.label},R.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:((P=(j=a.json)==null?void 0:j.meta)==null?void 0:P.website)??"https://yourstore.com",value:m.fields.importUrl,onChange:R=>m.set({importUrl:R.target.value}),onKeyDown:R=>{R.key==="Enter"&&$()}}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:f||E,onClick:$,children:E?"Looking…":f?"Starting…":"Import"})]})]}):o.jsx("button",{type:"button",className:"sc-newdlg-secmore",onClick:()=>g(!0),children:"Import a catalog from a store URL"})}),C&&C.verdict==="found"&&C.candidates.length>0&&o.jsx(LR,{brandId:a.id,scan:C,busy:f,onImport:R=>void L(R),onImportAll:()=>void L(),onDismiss:()=>k(null)})]})}const K8="1",PX={product:"Product",presenter:"Person",scene:"Place"},LX=["product","presenter","scene"],TX=e=>!!e&&LX.includes(e),OR=s.createContext(null);function IR(){const e=s.useContext(OR);if(!e)throw new Error("useCreateAsset must be used inside AssetCreateHost");return e}function Bl(){return IR().open}function FR(){const e=!!gn({path:pt.products,end:!1}),t=!!gn({path:pt.presenters,end:!1}),n=!!gn({path:pt.scenes,end:!1});return e?"product":t?"presenter":n?"scene":null}function fy(){const{announce:e,caps:t}=IR();return{announce:e,caps:t}}function $X({children:e}){const{brand:t}=un(),n=Un(),r=Bn(),{push:a}=rr(),{refreshBrands:i}=Mn(),{builds:l,poke:u}=ua(),f=Nr("new"),h=f.value,p=FR(),g=!!gn({path:pt.presenterStudio}),m=!!gn({path:pt.presenterEdit}),w=!!gn({path:pt.sceneStudio}),y=!!gn({path:pt.sceneEdit}),[b,S]=s.useState(null),[k,C]=s.useState(!1),[E,A]=s.useState(!1),L=s.useRef(null),$=s.useRef(null),N=f.open,j=f.set,P=f.close,R=s.useCallback((z,J)=>{if(L.current=z==="choose"||!(J!=null&&J.onCreated)?null:{kind:z,fn:J.onCreated},z==="presenter"){n(wl(t));return}if(z==="scene"){n(vl(t),{state:{from:r.pathname+r.search}});return}$.current=document.activeElement instanceof HTMLElement?document.activeElement:null,C(z==="choose"),A(!1),N(z==="choose"?K8:z)},[N,n,t,r.pathname,r.search]);s.useEffect(()=>{const z=bG(h);z==="presenter"&&n(wl(t),{replace:!0}),z==="scene"&&n(vl(t),{replace:!0})},[h,n,t]);const H=s.useCallback(()=>{L.current=null,C(!1),P()},[P]),D=s.useCallback(z=>{a({kind:"success",title:`${PX[z]} discarded`,detail:"Nothing was saved.",action:{label:"Undo",onClick:()=>{A(!0),C(!1),N(z)}}})},[N,a]);s.useEffect(()=>{h===null&&A(!1)},[h]),s.useEffect(()=>{if(h!==null)return;const z=$.current;$.current=null,z!=null&&z.isConnected&&z.focus()},[h]);const U=h!==null||g||m||w||y,_=Nr("setup").value,B=Nr("settings").value,K=!!_||!!B;s.useEffect(()=>{if(!U||K)return;let z=!0,J=null;const he=te=>Ee.assetBuildCapabilities().then(me=>z&&S(me)).catch(()=>{z&&te&&(J=setTimeout(()=>he(!1),600))});return he(!0),()=>{z=!1,J&&clearTimeout(J)}},[U,K]);const V=s.useCallback(z=>{const J=l.find(he=>he.id===z);return J?J.stage==="failed"?"failed":J.stage==="cancelled"?"cancelled":J.stage==="done"?"done":"running":"unknown"},[l]),O=s.useCallback((z,J)=>{var re;const he=L.current;L.current=null,u();const te=!!(J!=null&&J.quiet);if(z.kind==="product"){if(!z.id){a({kind:"info",title:"Importing your catalog",detail:z.name});return}(he==null?void 0:he.kind)==="product"&&he.fn(z),a({kind:"success",title:`${z.name} added`,actions:[{label:"Add details",onClick:()=>n(Aa(t,z.id))},{label:"Use in a shot",onClick:()=>n(`${jr(t)}?product=${z.id}&compose=1${jc()}`)}]});return}if(z.kind==="presenter"){if((he==null?void 0:he.kind)==="presenter"&&he.fn(z),te)return;a({kind:"success",title:`${z.name} added`,actions:[{label:"Use in a shot",onClick:()=>n(`${jr(t)}?${kd("presenter",z.id)}&compose=1${jc()}`)}]});return}if(i(),(he==null?void 0:he.kind)==="scene"&&he.fn(z),te)return;const me=(re=z.verticals)!=null&&re.length?`Filed under ${z.verticals.join(" and ")}.`:void 0;a({kind:"success",title:z.how==="updated"?`${z.name} changed`:`${z.name} saved`,detail:me,actions:[{label:"Open",onClick:()=>n(Br(t,z.id))},{label:"Use in a shot",onClick:()=>n(`${jr(t)}?${kd("scene",z.id)}&compose=1${jc()}`)}]})},[t,n,u,a,i]),I=s.useCallback(z=>{O(z),H()},[H,O]),Y=s.useMemo(()=>({open:R,announce:O,caps:b}),[R,O,b]),Z=TX(h)?h:null,X={onBack:k?()=>j(K8):void 0,onStarted:I,caps:b,pendingState:V,restore:E,onDiscarded:()=>Z&&D(Z)};return o.jsxs(OR.Provider,{value:Y,children:[e,h===K8&&o.jsx(oX,{suggest:p,onPick:z=>{if(z==="presenter"){n(wl(t),{replace:!0});return}if(z==="scene"){n(vl(t),{replace:!0});return}C(!0),j(z)}}),Z==="product"&&o.jsx(RX,{...X},"product")]})}const jk=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",nouns:"products",icon:xm},{kind:"presenter",label:"Person",line:"Who appears in the shot",noun:"person",nouns:"people",icon:ym},{kind:"scene",label:"Place",line:"Where it happens, and its light",noun:"place",nouns:"places",icon:wm}],DX={product:"New product",presenter:"New person",scene:"New place"};function HX(){var f,h;const e=Bl(),t=FR(),n=jR(),{showcase:r}=Mn(),a=((f=r.find(p=>p.previewUrl))==null?void 0:f.previewUrl)??null,i=ty(16).find(p=>p.key==="create"),l=i?`${i.to}&attach=all`:"",u=t?DX[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(gr,{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:(h=jk.find(p=>p.kind===t))==null?void 0:h.noun})]})]}):o.jsxs(Vn,{className:"sc-new-go",to:l,"aria-label":"New shot","data-attach-opener":"",children:[o.jsx(gr,{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(xR,{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(kl,{size:12,weight:"bold",className:"sc-new-caret","aria-hidden":"true"})}),children:[o.jsxs(od,{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:Tn(a,"tile"),alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(fE,{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"}),jk.map(p=>{const{url:g,count:m}=n[p.kind];return o.jsxs(od,{className:"sc-menu-item sc-start-row",onSelect:()=>e(p.kind),children:[o.jsx("span",{className:"sc-start-pic",children:g?o.jsx("img",{src:g,alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(p.icon,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:p.label}),o.jsx("small",{children:p.line})]}),o.jsxs("span",{className:"sc-start-n",children:[m===0?"None yet":m,o.jsx("span",{className:"sc-vh",children:` ${m===1?p.noun:p.nouns} so far`})]})]},p.kind)})]})]})}const OX=24,IX=8;function FX(){const e=Or(da),{pathname:t}=Bn();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<=IX:f>OX)&&(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 _R=["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"],_X=["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 VX(e){return o.jsx("svg",{viewBox:"0 0 263.79 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:[..._R,..._X].map(t=>o.jsx("path",{d:t},t))})}function ZX(e){return o.jsx("svg",{viewBox:"0 0 64 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:_R.map(t=>o.jsx("path",{d:t},t))})}function zX(){const{brand:e}=un();return FX(),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(Vn,{className:"sc-wordmark","aria-label":"Scenri home",to:Ho(e),children:o.jsx(VX,{"aria-hidden":"true"})})}),o.jsx(Yq,{}),o.jsxs("div",{className:"sc-topbar-end",children:[o.jsx(eX,{}),o.jsx(Kq,{}),o.jsx(HX,{}),o.jsx(Xq,{})]})]})}const BX=60;function UX(){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>BX?`${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 VR=s.createContext(null);function ZR(){return s.useContext(VR)}function WX({brand:e,children:t}){const n=e.id,[r,a]=s.useState({products:[],loaded:!1}),i=s.useRef(null),{tasks:l}=ua(),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 Ee.productsLibrary(n);if(w!==h.current||p.current!==n)return;const b=JSON.stringify(y.products);if(i.current===b)return;i.current=b,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 m=s.useMemo(()=>({products:r.products,productsLoaded:r.loaded,importing:f,refreshProducts:g}),[r.products,r.loaded,f,g]);return o.jsx(VR.Provider,{value:m,children:t})}function KX({feature:e}){const{isNew:t}=tu();return t(e)?o.jsx("span",{className:"sc-tag sc-tag-new",children:"New"}):null}function us({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 GX={npx:"run with npx",global:"installed with npm",managed:"managed install",dev:"running from source",unknown:"local studio"};function YX({version:e}){return o.jsxs(us,{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}`:""," · ",GX[(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://scenri.co",target:"_blank",rel:"noreferrer",children:"scenri.co"})," ","·"," ",o.jsx("a",{href:"https://github.com/tonygorb/scenri",target:"_blank",rel:"noreferrer",children:"GitHub"})]})]})})]})}function z4({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 Ak=()=>o.jsx("span",{className:"sc-setpop-tick","aria-hidden":!0,children:o.jsx(Gn,{size:12,weight:"bold"})});function si({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,b;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 m=f.indexOf(t),w=g==="first"?f[0]:g==="last"?f[f.length-1]:g===1?f[m<0||m===f.length-1?0:m+1]:f[m<=0?f.length-1:m-1];a(w),(b=(y=u.current)==null?void 0:y.querySelector(`[data-id="${w}"]`))==null||b.focus()};return o.jsx("div",{className:i,role:"radiogroup","aria-label":e,ref:u,tabIndex:-1,onKeyDown:h,children:l})}const ai=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})}),qX=({children:e})=>o.jsx("p",{className:"sc-setpop-foot",children:e}),Nk=[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}];function XX(){const{choice:e,setChoice:t}=zK();return o.jsx(us,{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(si,{label:"Theme",className:"sc-seg",value:e,ids:Nk.map(n=>n.id),onChange:n=>t(n),children:Nk.map(n=>o.jsx(ai,{id:n.id,className:"sc-seg-o",on:e===n.id,label:n.label,onPick:()=>t(n.id),children:n.label},n.id))})]})})}function QX({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=m=>{const w=m.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(m=>o.jsx("button",{type:"button",className:"sc-chip",onClick:()=>p(m),"aria-label":`Never show ${m}`,children:m},m))}):null;return o.jsxs(o.Fragment,{children:[e.length===0&&g,o.jsxs("div",{className:"sc-chips",children:[e.map((m,w)=>o.jsxs("span",{className:"sc-chips-item",children:[o.jsx("span",{dir:"auto",children:m}),o.jsx("button",{type:"button",onClick:()=>t(e.filter((y,b)=>b!==w)),"aria-label":`Remove ${m}`,children:o.jsx(jn,{size:10,weight:"bold"})})]},m)),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:m=>{const w=m.target.value;if(w.includes(",")){const y=w.split(",");for(const b of y.slice(0,-1))p(b);f(y[y.length-1]);return}f(w.slice(0,l))},onKeyDown:m=>{m.key==="Enter"?(m.preventDefault(),p(u)):m.key==="Backspace"&&!u&&e.length&&t(e.slice(0,-1))},onBlur:()=>p(u)})]}),e.length>0&&g]})}const JX=["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"],Mk=e=>e.trim().toLowerCase();function eQ(e){const t=new Set((e??[]).map(Mk));return JX.filter(n=>!t.has(Mk(n)))}function tQ({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(QX,{label:"Things this brand never shows",value:n,placeholder:"Or type your own",suggestions:eQ(n),max:24,onChange:r})})}function nQ(){const{brand:e}=un(),{applyBrand:t}=Mn(),{push:n}=rr(),[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({}),g=s.useRef(!1),m=s.useRef(!1),w=s.useCallback(()=>({...f.current.json??{},...u.current}),[]),y=s.useCallback(async()=>{if(!Object.keys(u.current).length)return;if(g.current){m.current=!0;return}g.current=!0,l("saving");const E=u.current;try{const A=await Ee.updateBrand(f.current.id,w(),{...p.current});t(A);for(const L of Object.keys(E))u.current[L]===E[L]?delete p.current[L]:p.current[L]=E[L];a(L=>{const $={...L};for(const N of Object.keys(E))L[N]===E[N]&&delete $[N];return $}),l(m.current?"pending":"idle")}catch(A){l("error"),n({...ln(A,"Could not save the brand"),action:{label:"Retry",onClick:()=>void y()}})}finally{g.current=!1,m.current&&(m.current=!1,y())}},[t,w,n]),b=s.useCallback((E,A)=>{var N;h.current&&(clearTimeout(h.current),h.current=null);for(const j of Object.keys(E))j in p.current||(p.current[j]=((N=f.current.json)==null?void 0:N[j])??null);const L={...u.current,...E};u.current=L,a(L),l("pending");const $=(A==null?void 0:A.debounce)??0;$>0?h.current=setTimeout(()=>void y(),$):y()},[y]),S=s.useCallback(async()=>{h.current&&(clearTimeout(h.current),h.current=null),await y()},[y]),k=s.useCallback(E=>{a({}),u.current={},p.current={},t(E),l("idle")},[t]),C=e.id;return s.useEffect(()=>{a({}),u.current={},p.current={},l("idle")},[C]),s.useEffect(()=>{const E=()=>{Object.keys(u.current).length&&nG(f.current.id,w(),{...p.current}).then(A=>{A&&t(A)})};return window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E),h.current&&clearTimeout(h.current),E()}},[w,t]),{json:w(),state:i,patch:b,flush:S,applyRow:k}}function hy(e){const t=s.useRef(e);t.current=e,s.useEffect(()=>()=>t.current(),[])}function rQ(e){return e==="saving"?"Saving…":e==="pending"?"Unsaved changes":e==="error"?"Not saved":"Saved"}function sQ({brand:e,doc:t}){const{push:n}=rr(),[r,a]=s.useState(!1),i=t.json??{},l=i.meta??{},u=l.name??e.slug,f=af(i),h=o2(f)??void 0,p=f.filter(b=>b!==h),g=b=>{const S={...l};for(const[k,C]of Object.entries(b)){const E=C.trim();E?S[k]=E:delete S[k]}S.name||(S.name=l.name),t.patch({meta:S})},m=async(b,S)=>{a(!0);try{await t.flush(),t.applyRow(await S())}catch(k){n(ln(k,b))}finally{a(!1)}},w=b=>void m("Could not upload that mark",async()=>{const S=await aM(e.id,b[0]),k=S.logoEdge;return k&&k<512&&n({kind:"warning",title:"Logo added, but it is small",detail:`Only ${k}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`}),S}),{dropProps:y}=$R({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(aQ,{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 m("Could not remove that mark",()=>Ee.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:b=>void m("Could not update that mark",()=>Ee.updateLogo(e.id,h.hash??"",{background:b.target.value})),"aria-label":"Sits on",children:ey.map(b=>o.jsx("option",{value:b,children:b==="any"?"Any background":`On ${b}`},b))})]}),o.jsx(Rk,{label:"Name",value:l.name??"",placeholder:e.slug,maxLength:120,onCommit:b=>g({name:b})}),o.jsx(Rk,{label:"Tagline",value:l.tagline??"",placeholder:"Add a tagline",maxLength:200,onCommit:b=>g({tagline:b})}),p.map(b=>o.jsx(oQ,{mark:b,busy:r,onRole:S=>void m("Could not retag that mark",()=>Ee.updateLogo(e.id,b.hash??"",{role:S})),onBackground:S=>void m("Could not update that mark",()=>Ee.updateLogo(e.id,b.hash??"",{background:S})),onRemove:()=>void m("Could not remove that mark",()=>Ee.deleteLogo(e.id,b.hash??""))},b.hash??b.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(gr,{size:12}),"Add",o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:r,onChange:b=>{const S=Array.from(b.target.files??[]);b.target.value="",S.length&&w(S)}})]})]})]})}function Rk({label:e,value:t,placeholder:n,maxLength:r,onCommit:a}){const[i,l]=s.useState(t),u=s.useRef(t),f=p=>{u.current=p,l(p)};s.useEffect(()=>{u.current=t,l(t)},[t]);const h=()=>{const p=u.current.trim();p!==t&&a(p)};return hy(h),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:p=>f(p.target.value),onBlur:()=>{h(),f(u.current.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),p.currentTarget.blur()),p.key==="Escape"&&(f(t),p.currentTarget.blur())}})]})}function aQ({mark:e,name:t,busy:n,onUpload:r}){const[a,i]=s.useState(null);if(e){const l=e.hash?Dr(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(Bv,{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 oQ({mark:e,busy:t,onRole:n,onBackground:r,onRemove:a}){const i=e.hash?Dr(e.hash):e.file;return o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:Dh[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:Dh[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:oR.map(l=>o.jsx("option",{value:l,children:Dh[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:ey.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 ${Dh[e.role]}`,children:o.jsx(km,{size:13})})]})]})}const Pk={primary:"Primary",secondary:"Secondary",accent:"Accent",neutral:"Neutral"},iQ=(e,t)=>t<=1?Pk[e]:`${Pk[e]} ${t}`;function lQ(e){return/^(Primary|Secondary|Accent|Neutral)( [2-9]\d*)?$/.test(String(e??"").trim())}const cQ=/^#[0-9A-F]{6}$/;function dr(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 cQ.test(r)?r:null}const uQ=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;function dQ(e){const t=String(e??"").trim();return uQ.test(t)?dr(t):null}function aa(e){const t=[],n={primary:0,secondary:0,accent:0,neutral:0},r=(a,i)=>{const l=dr(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||iQ(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 py(e,t){const n={},r=[],a=[],i=p=>{const g=p.name.trim();return g&&!lQ(g)?{hex:p.hex,name:g}:{hex:p.hex}};for(const p of e){const g=dr(p.hex);if(!g)continue;const m=i({...p,hex:g});p.slot==="neutral"?a.push(m):r.push(m)}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 Lk=e=>e.slot!=="neutral";function h2(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 zR(e,t){const n=dr(t);if(!n)return{palette:e,added:!1,swatch:null};const r=aa(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=py(i,e),u=aa(l).find(f=>f.hex===n)??null;return{palette:l,added:!0,swatch:u}}function fQ(e,t){const n=dr(t);if(!n)return{palette:e,removed:!1};const r=aa(e),a=r.filter(i=>i.hex!==n);return a.length===r.length?{palette:e,removed:!1}:{palette:py(a,e),removed:!0}}function p2(){return(p2=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 BR(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 q0(e){var t=s.useRef(e),n=s.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var x1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},X0=function(e){return"touches"in e},B4=function(e){return e&&e.ownerDocument.defaultView||self},Tk=function(e,t,n){var r=e.getBoundingClientRect(),a=X0(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:x1((a.pageX-(r.left+B4(e).pageXOffset))/r.width),top:x1((a.pageY-(r.top+B4(e).pageYOffset))/r.height)}},$k=function(e){!X0(e)&&e.preventDefault()},UR=zn.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,a=BR(e,["onMove","onKey","onEnd"]),i=s.useRef(null),l=q0(t),u=q0(n),f=q0(r),h=s.useRef(null),p=s.useRef(!1),g=s.useMemo(function(){var S=function(E){$k(E),(X0(E)?E.touches.length>0:E.buttons>0)&&i.current?l(Tk(i.current,E,h.current)):(C(!1),f())},k=function(){C(!1),f()};function C(E){var A=p.current,L=B4(i.current),$=E?L.addEventListener:L.removeEventListener;$(A?"touchmove":"mousemove",S),$(A?"touchend":"mouseup",k)}return[function(E){var A=E.nativeEvent,L=i.current;if(L&&($k(A),!(function(N,j){return j&&!X0(N)})(A,p.current)&&L)){if(X0(A)){p.current=!0;var $=A.changedTouches||[];$.length&&(h.current=$[0].identifier)}L.focus(),l(Tk(L,A,h.current)),C(!0)}},function(E){var A=E.which||E.keyCode;A<37||A>40||(E.preventDefault(),u({left:A===39?.05:A===37?-.05:0,top:A===40?.05:A===38?-.05:0}))},function(E){var A=E.which||E.keyCode;A>=37&&A<=40&&f()},C]},[u,l,f]),m=g[0],w=g[1],y=g[2],b=g[3];return s.useEffect(function(){return b},[b]),zn.createElement("div",p2({},a,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:i,onKeyDown:w,onKeyUp:y,tabIndex:0,role:"slider"}))}),my=function(e){return e.filter(Boolean).join(" ")},WR=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,i=my(["react-colorful__pointer",e.className]);return zn.createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},zn.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Is=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},hQ=function(e){return wQ(U4(e))},U4=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?Is(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?Is(parseInt(e.substring(6,8),16)/255,2):1}},pQ=function(e){return vQ(gQ(e))},mQ=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:Is(e.h),s:Is(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Is(a/2),a:Is(r,2)}},W4=function(e){var t=mQ(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},gQ=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:Is(255*[r,u,l,l,f,r][h]),g:Is(255*[f,r,r,u,l,l][h]),b:Is(255*[l,l,f,r,r,u][h]),a:Is(a,2)}},Oh=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vQ=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=a<1?Oh(Is(255*a)):"";return"#"+Oh(t)+Oh(n)+Oh(r)+i},wQ=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:60*(u<0?u+6:u),s:i?l/i*100:0,v:i/255*100,a}},yQ=zn.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,a=my(["react-colorful__hue",e.className]);return zn.createElement("div",{className:a},zn.createElement(UR,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:x1(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":Is(t),"aria-valuemax":"360","aria-valuemin":"0"},zn.createElement(WR,{className:"react-colorful__hue-pointer",left:t/360,color:W4({h:t,s:100,v:100,a:1})})))}),bQ=zn.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,a={backgroundColor:W4({h:t.h,s:100,v:100,a:1})};return zn.createElement("div",{className:"react-colorful__saturation",style:a},zn.createElement(UR,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:x1(t.s+100*i.left,0,100),v:x1(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+Is(t.s)+"%, Brightness "+Is(t.v)+"%"},zn.createElement(WR,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:W4(t)})))}),KR=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xQ=function(e,t){return e.toLowerCase()===t.toLowerCase()||KR(U4(e),U4(t))};function kQ(e,t,n,r){var a=q0(n),i=q0(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;KR(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)})},[]),m=s.useCallback(function(){p.current&&(p.current=!1,i(h.current.color))},[i]);return[u,g,m]}var SQ=typeof window<"u"?s.useLayoutEffect:s.useEffect,EQ=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Dk=new WeakMap,CQ=function(e){SQ(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(!Dk.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=EQ();l&&i.setAttribute("nonce",l),Dk.set(r,i),a.appendChild(i)}}},[])},jQ=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=BR(e,["className","colorModel","color","onChange","onChangeEnd"]),f=s.useRef(null);CQ(f);var h=kQ(n,a,i,l),p=h[0],g=h[1],m=h[2],w=my(["react-colorful",t]);return zn.createElement("div",p2({},u,{ref:f,className:w}),zn.createElement(bQ,{hsva:p,onChange:g,onChangeEnd:m}),zn.createElement(yQ,{hue:p.h,onChange:g,onChangeEnd:m,className:"react-colorful__last-control"}))},AQ={defaultColor:"000",toHsva:hQ,fromHsva:function(e){return pQ({h:e.h,s:e.s,v:e.v,a:1})},equal:xQ},NQ=function(e){return zn.createElement(jQ,p2({},e,{colorModel:AQ}))};function Ed({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=dr(e)??"#000000",[m,w]=s.useState(g),[y,b]=s.useState(!1);s.useEffect(()=>{y||w(g)},[g,y]);const S=L=>{const $=dr(L);$&&(w($),f==="live"&&t($))},k=L=>{const $=dr(L);$&&(w($),t($),f==="close"&&b(!1))},C=L=>{if(b(L),L||f!=="close")return;const $=dr(m);$&&$!==g&&t($)},E=[...new Set((r??[]).map(L=>dr(L)).filter(L=>!!L))],A=o.jsx(bd,{children:o.jsx("button",{type:"button",className:a??"sc-cp-trigger",style:{background:g,...i},"aria-label":n,...l,children:p})});return o.jsxs(yd,{open:y,onOpenChange:C,children:[u?o.jsx(hr,{label:n,children:A}):A,o.jsxs(xd,{className:"sc-cp",align:h,sideOffset:6,width:"232px",children:[o.jsx(NQ,{color:m,onChange:S}),o.jsxs("div",{className:"sc-cp-foot",children:[o.jsx("span",{className:"sc-cp-preview",style:{background:m},"aria-hidden":!0}),o.jsx("input",{className:"sc-cp-hex",value:m,spellCheck:!1,maxLength:7,"aria-label":"Hex value",onChange:L=>{w(L.target.value);const $=dr(L.target.value);$&&f==="live"&&t($)},onBlur:()=>w(dr(m)??g),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),f==="close"?k(m):b(!1))}})]}),E.length>0&&o.jsx("div",{className:"sc-cp-presets",children:E.map(L=>o.jsx("button",{type:"button",style:{background:L},"data-on":L===m||void 0,title:L,"aria-label":L,onClick:()=>f==="close"?k(L):S(L)},L))})]})]})}function MQ({doc:e,suggestions:t}){var w;const n=(w=e.json)==null?void 0:w.palette,[r,a]=s.useState(()=>aa(n)),i=JSON.stringify(n??{});s.useEffect(()=>{a(aa(n))},[i]);const l=(y,b=0)=>{a(y),e.patch({palette:py(y,n)},{debounce:b})},u=(y,b,S=0)=>l(r.map((k,C)=>C===y?{...k,...b}:k),S),f=()=>l([...r,{hex:h2(r),name:"",slot:r.length?"accent":"primary"}]),h=(t??[]).filter(y=>{const b=dr(y.hex);return b&&!r.some(S=>S.hex===b)}),p=(y,b)=>o.jsx(RQ,{swatch:y,presets:r.map(S=>S.hex),onHex:S=>u(b,{hex:S},300),onRemove:()=>l(r.filter((S,k)=>k!==b))},`${y.slot}-${b}`),g=r.map((y,b)=>[y,b]),m=g.filter(([y])=>!Lk(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])=>Lk(y)).map(([y,b])=>p(y,b)),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sc-pal-group",children:"Neutrals"}),m.map(([y,b])=>p(y,b))]}),o.jsxs("div",{className:"sc-pal-foot",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:f,children:[o.jsx(gr,{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 b=dr(y.hex);return o.jsx("button",{type:"button",className:"sc-pal-sugg-chip",style:{background:b},title:`Add ${b}`,"aria-label":`Add ${b}`,onClick:()=>l([...r,{hex:b,name:"",slot:"accent"}])},b)})]})]})]})}function RQ({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=dr(a);u&&n(u),i(u??e.hex)};return hy(()=>{a!==e.hex&&l()}),o.jsxs("div",{className:"sc-pal-row",children:[o.jsx(Ed,{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(km,{size:13})})]})}function PQ({onSaveState:e}){var w,y;const{brand:t}=un(),{push:n}=rr(),r=nQ();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 C;const b=h.trim(),S=b&&!/^https?:\/\//i.test(b)?`https://${b}`:b;p(S);const k={...((C=r.json)==null?void 0:C.meta)??{}};S?k.website=S:delete k.website,r.patch({meta:k})};hy(()=>{h.trim()!==f&&g()});const m=async()=>{var b,S,k;i(!0);try{await r.flush();const C=await Ee.refreshBrandFromUrl(t.id);r.applyRow(C),u(((b=C.suggestions)==null?void 0:b.palette)??[]),n({kind:(S=C.warnings)!=null&&S.length?"warning":"success",title:"Read the website again",detail:(k=C.warnings)!=null&&k.length?C.warnings.join(" "):"Your edits were kept."})}catch(C){n(ln(C,"Could not read that website"))}finally{i(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(us,{title:"Identity",sub:"The name and the mark.",children:o.jsx(sQ,{brand:t,doc:r})}),o.jsx(us,{title:"Palette",sub:"Favoured on a shot that asks for the kit.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(MQ,{doc:r,suggestions:l})})}),o.jsx(us,{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(tQ,{doc:r})})}),o.jsxs(us,{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:b=>p(b.target.value),onBlur:g,onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),b.currentTarget.blur())}}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:!f||a,onClick:()=>void m(),children:[a?o.jsx(Tr,{size:"1"}):o.jsx(vE,{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:eG(t.id),download:!0,onClick:()=>void r.flush(),children:"Export"})]})]})]})}const yl=e=>e.replace(/\s*\(BYOK\)\s*$/i,""),k1="codex-cli";function LQ(e,t){var n;return e.some(r=>r.id===t)?t:((n=e[0])==null?void 0:n.id)??k1}const TQ=e=>e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");function $Q(e){return e.free?e.localOnly?"Runs on your ChatGPT plan":"No cost per image":`$${TQ(e.perGeneration)} / image`}function DQ(e,t){if(t)return e.available?"Manage":"Connect";if(e.available)return e.id===k1?"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 HQ(e){if(e.trim()==="")return null;const t=e.trim().replace(/^\$\s*|\s*\$$/g,"").replace(/\s+/g,""),n=/^\d{1,3}(,\d{3})+(\.\d+)?$/.test(t)?t.replace(/,/g,""):t;if(/^(\d+(\.\d*)?|\.\d+)$/.test(n))return Number(n)}function OQ({engines:e,onSaved:t,thisComputer:n}){const r=e.filter(f=>!f.free),{push:a}=rr(),[i,l]=s.useState({});s.useEffect(()=>{l(Object.fromEntries(r.map(f=>[f.id,f.cap===null?"":String(f.cap)])))},[e]);const u=async f=>{const h=g=>l(m=>({...m,[f.id]:g===null?"":String(g)})),p=HQ(i[f.id]??"");if(p===void 0){h(f.cap),a({kind:"warning",title:"That is not an amount",detail:"Type the cap in dollars, like 20 or 12.50."});return}if(p===f.cap){h(p);return}try{await Ee.setCap(f.id,p),h(p),t()}catch(g){h(f.cap),a(ln(g,"Could not save that cap"))}};return r.length?o.jsx(us,{title:"Monthly caps",sub:n?"Your own API budget. Generation stops before a cap is crossed, so a runaway loop cannot spend your month.":"Your own API budget. Generation stops before a cap is crossed. Caps are set on the computer running Scenri.",children:r.map(f=>{const h=f.generationsLeft,p=f.generationsTotal,g=p&&p>0?Math.min(100,Math.round((p-(h??0))/p*100)):0,m=`$${f.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:yl(f.displayName)}),o.jsx("small",{children:h===null?m:`${m} · ${h} 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:i[f.id]??"",onChange:w=>l(y=>({...y,[f.id]:w.target.value})),onBlur:()=>void u(f),disabled:!n,"aria-label":`${yl(f.displayName)} monthly cap in dollars`})]})]}),p!==null&&o.jsx("div",{className:"sc-meter",children:o.jsx("i",{style:{width:`${g}%`}})})]},f.id)})}):o.jsx(us,{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 IQ({onDone:e,thisComputer:t}){const{brand:n,resetShots:r}=un(),{refresh:a}=Mn(),i=Un(),[l,u]=s.useState(!1),f=s.useCallback(async h=>{u(!0);try{await Ee.deleteData(h),e(),h==="shots"&&r(),h==="all"&&window.location.replace("/")}finally{u(!1)}},[e,r]);return o.jsxs(o.Fragment,{children:[o.jsx(us,{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 ",Na(n),", its sets and every shot. Other brands stay."]})]}),o.jsx(Xn,{label:"Delete brand",title:`Delete ${Na(n)}?`,body:"The kit, its sets and every shot go with it. Exports you already downloaded stay yours.",busy:l,onConfirm:()=>{u(!0),Ee.deleteBrand(n.id).then(()=>a()).then(()=>i("/",{replace:!0})).finally(()=>u(!1))}})]})}),t&&o.jsxs(us,{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, products, people and places stay."})]}),o.jsx(Xn,{label:"Delete shots",title:"Delete every generated shot?",body:"Brands, products, people and places stay. Every set and every generated shot goes.",busy:l,onConfirm:()=>void f("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(Xn,{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:l,onConfirm:()=>void f("all")})]})]})]})}function FQ(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 _Q({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 Ee.desktopInstall(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1600),t(await Ee.desktop())}catch(g){r(String((g==null?void 0:g.message)??g))}finally{i(!1)}}},p=FQ(e,n);return o.jsx(us,{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 GR(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 VQ(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 ZQ(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 zQ=[{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"}],YR=e=>zQ.find(t=>t.engineId===e),qR={"codex-cli":{Mark:GR,size:16,plate:"#FFFFFF",ink:"#000000"},openrouter:{Mark:VQ,size:18,plate:"#FFFFFF",ink:"#7624F4"},replicate:{Mark:ZQ,size:15,plate:"#E42022",ink:"#FFFFFF"}},XR=e=>{const t=qR[e];return t?{plate:t.plate,ink:t.ink}:void 0},BQ={demo:LF};function QR({engineId:e,scale:t=1}){const n=qR[e];if(n){const a=Math.round(n.size*t);return o.jsx(n.Mark,{width:a,height:a})}const r=BQ[e]??a1;return o.jsx(r,{size:Math.round(15*t)})}const UQ=e=>[...e].sort((t,n)=>+(n.id===k1)-+(t.id===k1));function WQ({engines:e}){const t=zl(),r=e.filter(a=>a.available).length===0;return o.jsx(us,{children:UQ(e).map(a=>{const i=YR(a.id),l=yl(a.displayName),u=DQ(a,!!i),f=a.available?"Connected":null,h=!f&&a.reason&&(!u||a.code==="unverified"),p=XR(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(QR,{engineId:a.id})}),o.jsxs("span",{className:"sc-eng-name",children:[o.jsx("b",{children:l}),o.jsx("small",{children:$Q(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 KQ=e=>e>1e9?`${(e/1e9).toFixed(1)} GB`:e>1e6?`${Math.round(e/1e6)} MB`:`${Math.round(e/1e3)} KB`,G8=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function GQ(e){return e===0?0:e<3?1:e<6?2:e<12?3:4}function Hk(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Ok(e,t){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),a=new Date(r);a.setDate(r.getDate()-r.getDay()-(t-1)*7);const i=(t-1)*7+r.getDay()+1,l=[],u=[];let f=-1,h=0;for(let p=0;p<i;p++){const g=new Date(a);g.setDate(a.getDate()+p);const m=Hk(g),w=e.get(m)??0;if(h+=w,l.push({key:m,level:GQ(w),title:w?`${w} run${w===1?"":"s"} on ${g.getDate()} ${G8[g.getMonth()]}`:`nothing on ${g.getDate()} ${G8[g.getMonth()]}`}),g.getDay()===0){const y=g.getMonth()!==f&&g.getDate()<=7;y&&(f=g.getMonth()),u.push({key:m,label:y?G8[g.getMonth()]:""})}}return{cells:l,months:u,sum:h,from:Hk(a)}}function YQ({info:e,thisComputer:t}){const{push:n}=rr();return o.jsxs(us,{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,`${KQ(e.bytes)} across ${e.images} images`].filter(Boolean).join(" · "):"…"})]}),t&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void Ee.reveal().catch(r=>n(ln(r,"Could not open the library folder"))),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 qQ(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 Fd=function(e,t){let a=e;const i=F0[t];let l=null,u=0,f=null;const h=[],p={},g=function(N,j){u=a*4+17,l=(function(P){const R=new Array(P);for(let H=0;H<P;H+=1){R[H]=new Array(P);for(let D=0;D<P;D+=1)R[H][D]=null}return R})(u),m(0,0),m(u-7,0),m(0,u-7),b(),y(),k(N,j),a>=7&&S(N),f==null&&(f=A(a,i,h)),C(f,j)},m=function(N,j){for(let P=-1;P<=7;P+=1)if(!(N+P<=-1||u<=N+P))for(let R=-1;R<=7;R+=1)j+R<=-1||u<=j+R||(0<=P&&P<=6&&(R==0||R==6)||0<=R&&R<=6&&(P==0||P==6)||2<=P&&P<=4&&2<=R&&R<=4?l[N+P][j+R]=!0:l[N+P][j+R]=!1)},w=function(){let N=0,j=0;for(let P=0;P<8;P+=1){g(!0,P);const R=Ji.getLostPoint(p);(P==0||N>R)&&(N=R,j=P)}return j},y=function(){for(let N=8;N<u-8;N+=1)l[N][6]==null&&(l[N][6]=N%2==0);for(let N=8;N<u-8;N+=1)l[6][N]==null&&(l[6][N]=N%2==0)},b=function(){const N=Ji.getPatternPosition(a);for(let j=0;j<N.length;j+=1)for(let P=0;P<N.length;P+=1){const R=N[j],H=N[P];if(l[R][H]==null)for(let D=-2;D<=2;D+=1)for(let U=-2;U<=2;U+=1)D==-2||D==2||U==-2||U==2||D==0&&U==0?l[R+D][H+U]=!0:l[R+D][H+U]=!1}},S=function(N){const j=Ji.getBCHTypeNumber(a);for(let P=0;P<18;P+=1){const R=!N&&(j>>P&1)==1;l[Math.floor(P/3)][P%3+u-8-3]=R}for(let P=0;P<18;P+=1){const R=!N&&(j>>P&1)==1;l[P%3+u-8-3][Math.floor(P/3)]=R}},k=function(N,j){const P=i<<3|j,R=Ji.getBCHTypeInfo(P);for(let H=0;H<15;H+=1){const D=!N&&(R>>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=!N&&(R>>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]=!N},C=function(N,j){let P=-1,R=u-1,H=7,D=0;const U=Ji.getMaskFunction(j);for(let _=u-1;_>0;_-=2)for(_==6&&(_-=1);;){for(let B=0;B<2;B+=1)if(l[R][_-B]==null){let K=!1;D<N.length&&(K=(N[D]>>>H&1)==1),U(R,_-B)&&(K=!K),l[R][_-B]=K,H-=1,H==-1&&(D+=1,H=7)}if(R+=P,R<0||u<=R){R-=P,P=-P;break}}},E=function(N,j){let P=0,R=0,H=0;const D=new Array(j.length),U=new Array(j.length);for(let V=0;V<j.length;V+=1){const O=j[V].dataCount,I=j[V].totalCount-O;R=Math.max(R,O),H=Math.max(H,I),D[V]=new Array(O);for(let z=0;z<D[V].length;z+=1)D[V][z]=255&N.getBuffer()[z+P];P+=O;const Y=Ji.getErrorCorrectPolynomial(I),X=S1(D[V],Y.getLength()-1).mod(Y);U[V]=new Array(Y.getLength()-1);for(let z=0;z<U[V].length;z+=1){const J=z+X.getLength()-U[V].length;U[V][z]=J>=0?X.getAt(J):0}}let _=0;for(let V=0;V<j.length;V+=1)_+=j[V].totalCount;const B=new Array(_);let K=0;for(let V=0;V<R;V+=1)for(let O=0;O<j.length;O+=1)V<D[O].length&&(B[K]=D[O][V],K+=1);for(let V=0;V<H;V+=1)for(let O=0;O<j.length;O+=1)V<U[O].length&&(B[K]=U[O][V],K+=1);return B},A=function(N,j,P){const R=Ik.getRSBlocks(N,j),H=Fk();for(let U=0;U<P.length;U+=1){const _=P[U];H.put(_.getMode(),4),H.put(_.getLength(),Ji.getLengthInBits(_.getMode(),N)),_.write(H)}let D=0;for(let U=0;U<R.length;U+=1)D+=R[U].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 E(H,R)};p.addData=function(N,j){j=j||"Byte";let P=null;switch(j){case"Numeric":P=XQ(N);break;case"Alphanumeric":P=QQ(N);break;case"Byte":P=JQ(N);break;case"Kanji":P=eJ(N);break;default:throw"mode:"+j}h.push(P),f=null},p.isDark=function(N,j){if(N<0||u<=N||j<0||u<=j)throw N+","+j;return l[N][j]},p.getModuleCount=function(){return u},p.make=function(){if(a<1){let N=1;for(;N<40;N++){const j=Ik.getRSBlocks(N,i),P=Fk();for(let H=0;H<h.length;H++){const D=h[H];P.put(D.getMode(),4),P.put(D.getLength(),Ji.getLengthInBits(D.getMode(),N)),D.write(P)}let R=0;for(let H=0;H<j.length;H++)R+=j[H].dataCount;if(P.getLengthInBits()<=R*8)break}a=N}g(!1,w())},p.createTableTag=function(N,j){N=N||2,j=typeof j>"u"?N*4:j;let P="";P+='<table style="',P+=" border-width: 0px; border-style: none;",P+=" border-collapse: collapse;",P+=" padding: 0px; margin: "+j+"px;",P+='">',P+="<tbody>";for(let R=0;R<p.getModuleCount();R+=1){P+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)P+='<td style="',P+=" border-width: 0px; border-style: none;",P+=" border-collapse: collapse;",P+=" padding: 0px; margin: 0px;",P+=" width: "+N+"px;",P+=" height: "+N+"px;",P+=" background-color: ",P+=p.isDark(R,H)?"#000000":"#ffffff",P+=";",P+='"/>';P+="</tr>"}return P+="</tbody>",P+="</table>",P},p.createSvgTag=function(N,j,P,R){let H={};typeof arguments[0]=="object"&&(H=arguments[0],N=H.cellSize,j=H.margin,P=H.alt,R=H.title),N=N||2,j=typeof j>"u"?N*4:j,P=typeof P=="string"?{text:P}:P||{},P.text=P.text||null,P.id=P.text?P.id||"qrcode-description":null,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-title":null;const D=p.getModuleCount()*N+j*2;let U,_,B,K,V="",O;for(O="l"+N+",0 0,"+N+" -"+N+",0 0,-"+N+"z ",V+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',V+=H.scalable?"":' width="'+D+'px" height="'+D+'px"',V+=' viewBox="0 0 '+D+" "+D+'" ',V+=' preserveAspectRatio="xMinYMin meet"',V+=R.text||P.text?' role="img" aria-labelledby="'+L([R.id,P.id].join(" ").trim())+'"':"",V+=">",V+=R.text?'<title id="'+L(R.id)+'">'+L(R.text)+"</title>":"",V+=P.text?'<description id="'+L(P.id)+'">'+L(P.text)+"</description>":"",V+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',V+='<path d="',B=0;B<p.getModuleCount();B+=1)for(K=B*N+j,U=0;U<p.getModuleCount();U+=1)p.isDark(B,U)&&(_=U*N+j,V+="M"+_+","+K+O);return V+='" stroke="transparent" fill="black"/>',V+="</svg>",V},p.createDataURL=function(N,j){N=N||2,j=typeof j>"u"?N*4:j;const P=p.getModuleCount()*N+j*2,R=j,H=P-j;return sJ(P,P,function(D,U){if(R<=D&&D<H&&R<=U&&U<H){const _=Math.floor((D-R)/N),B=Math.floor((U-R)/N);return p.isDark(B,_)?0:1}else return 1})},p.createImgTag=function(N,j,P){N=N||2,j=typeof j>"u"?N*4:j;const R=p.getModuleCount()*N+j*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(N,j),H+='"',H+=' width="',H+=R,H+='"',H+=' height="',H+=R,H+='"',P&&(H+=' alt="',H+=L(P),H+='"'),H+="/>",H};const L=function(N){let j="";for(let P=0;P<N.length;P+=1){const R=N.charAt(P);switch(R){case"<":j+="<";break;case">":j+=">";break;case"&":j+="&";break;case'"':j+=""";break;default:j+=R;break}}return j},$=function(N){N=typeof N>"u"?2:N;const P=p.getModuleCount()*1+N*2,R=N,H=P-N;let D,U,_,B,K;const V={"██":"█","█ ":"▀"," █":"▄"," ":" "},O={"██":"▀","█ ":"▀"," █":" "," ":" "};let I="";for(D=0;D<P;D+=2){for(_=Math.floor((D-R)/1),B=Math.floor((D+1-R)/1),U=0;U<P;U+=1)K="█",R<=U&&U<H&&R<=D&&D<H&&p.isDark(_,Math.floor((U-R)/1))&&(K=" "),R<=U&&U<H&&R<=D+1&&D+1<H&&p.isDark(B,Math.floor((U-R)/1))?K+=" ":K+="█",I+=N<1&&D+1>=H?O[K]:V[K];I+=`
|
|
97
|
+
`}return P%2&&N>0?I.substring(0,I.length-P-1)+Array(P+1).join("▀"):I.substring(0,I.length-1)};return p.createASCII=function(N,j){if(N=N||1,N<2)return $(j);N-=1,j=typeof j>"u"?N*2:j;const P=p.getModuleCount()*N+j*2,R=j,H=P-j;let D,U,_,B;const K=Array(N+1).join("██"),V=Array(N+1).join(" ");let O="",I="";for(D=0;D<P;D+=1){for(_=Math.floor((D-R)/N),I="",U=0;U<P;U+=1)B=1,R<=U&&U<H&&R<=D&&D<H&&p.isDark(_,Math.floor((U-R)/N))&&(B=0),I+=B?K:V;for(_=0;_<N;_+=1)O+=I+`
|
|
98
|
+
`}return O.substring(0,O.length-1)},p.renderTo2dContext=function(N,j){j=j||2;const P=p.getModuleCount();for(let R=0;R<P;R++)for(let H=0;H<P;H++)N.fillStyle=p.isDark(R,H)?"black":"white",N.fillRect(H*j,R*j,j,j)},p};Fd.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};Fd.createStringToBytes=function(e,t){const n=(function(){const a=nJ(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(),m=String.fromCharCode(f<<8|h),w=p<<8|g;u[m]=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 is={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},F0={L:1,M:0,Q:3,H:2},Qi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ji=(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 Qi.PATTERN000:return function(u,f){return(u+f)%2==0};case Qi.PATTERN001:return function(u,f){return u%2==0};case Qi.PATTERN010:return function(u,f){return f%3==0};case Qi.PATTERN011:return function(u,f){return(u+f)%3==0};case Qi.PATTERN100:return function(u,f){return(Math.floor(u/2)+Math.floor(f/3))%2==0};case Qi.PATTERN101:return function(u,f){return u*f%2+u*f%3==0};case Qi.PATTERN110:return function(u,f){return(u*f%2+u*f%3)%2==0};case Qi.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=S1([1],0);for(let f=0;f<l;f+=1)u=u.multiply(S1([1,nl.gexp(f)],0));return u},a.getLengthInBits=function(l,u){if(1<=u&&u<10)switch(l){case is.MODE_NUMBER:return 10;case is.MODE_ALPHA_NUM:return 9;case is.MODE_8BIT_BYTE:return 8;case is.MODE_KANJI:return 8;default:throw"mode:"+l}else if(u<27)switch(l){case is.MODE_NUMBER:return 12;case is.MODE_ALPHA_NUM:return 11;case is.MODE_8BIT_BYTE:return 16;case is.MODE_KANJI:return 10;default:throw"mode:"+l}else if(u<41)switch(l){case is.MODE_NUMBER:return 14;case is.MODE_ALPHA_NUM:return 13;case is.MODE_8BIT_BYTE:return 16;case is.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 m=0;m<u;m+=1){let w=0;const y=l.isDark(g,m);for(let b=-1;b<=1;b+=1)if(!(g+b<0||u<=g+b))for(let S=-1;S<=1;S+=1)m+S<0||u<=m+S||b==0&&S==0||y==l.isDark(g+b,m+S)&&(w+=1);w>5&&(f+=3+w-5)}for(let g=0;g<u-1;g+=1)for(let m=0;m<u-1;m+=1){let w=0;l.isDark(g,m)&&(w+=1),l.isDark(g+1,m)&&(w+=1),l.isDark(g,m+1)&&(w+=1),l.isDark(g+1,m+1)&&(w+=1),(w==0||w==4)&&(f+=3)}for(let g=0;g<u;g+=1)for(let m=0;m<u-6;m+=1)l.isDark(g,m)&&!l.isDark(g,m+1)&&l.isDark(g,m+2)&&l.isDark(g,m+3)&&l.isDark(g,m+4)&&!l.isDark(g,m+5)&&l.isDark(g,m+6)&&(f+=40);for(let g=0;g<u;g+=1)for(let m=0;m<u-6;m+=1)l.isDark(m,g)&&!l.isDark(m+1,g)&&l.isDark(m+2,g)&&l.isDark(m+3,g)&&l.isDark(m+4,g)&&!l.isDark(m+5,g)&&l.isDark(m+6,g)&&(f+=40);let h=0;for(let g=0;g<u;g+=1)for(let m=0;m<u;m+=1)l.isDark(m,g)&&(h+=1);const p=Math.abs(100*h/u/u-50)/5;return f+=p*10,f},a})(),nl=(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})(),S1=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]^=nl.gexp(nl.glog(r.getAt(l))+nl.glog(a.getAt(u)));return S1(i,0)},r.mod=function(a){if(r.getLength()-a.getLength()<0)return r;const i=nl.glog(r.getAt(0))-nl.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]^=nl.gexp(nl.glog(a.getAt(u))+i);return S1(l,0).mod(a)},r},Ik=(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 F0.L:return e[(a-1)*4+0];case F0.M:return e[(a-1)*4+1];case F0.Q:return e[(a-1)*4+2];case F0.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],m=l[h*3+2];for(let w=0;w<p;w+=1)f.push(t(g,m))}return f},n})(),Fk=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},XQ=function(e){const t=is.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},QQ=function(e){const t=is.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},JQ=function(e){const t=is.MODE_8BIT_BYTE,n=Fd.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},eJ=function(e){const t=is.MODE_KANJI,n=Fd.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},JR=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},tJ=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},nJ=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},rJ=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 m=0;for(;g.length-m>255;)h.writeByte(255),h.writeBytes(g,m,255),m+=255;h.writeByte(g.length-m),h.writeBytes(g,m,g.length-m),h.writeByte(0),h.writeString(";")};const l=function(h){const p=h;let g=0,m=0;const w={};return w.write=function(y,b){if(y>>>b)throw"length over";for(;g+b>=8;)p.writeByte(255&(y<<g|m)),b-=8-g,y>>>=8-g,m=0,g=0;m=y<<g|m,g=g+b},w.flush=function(){g>0&&p.writeByte(m)},w},u=function(h){const p=1<<h,g=(1<<h)+1;let m=h+1;const w=f();for(let C=0;C<p;C+=1)w.add(String.fromCharCode(C));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(g));const y=JR(),b=l(y);b.write(p,m);let S=0,k=String.fromCharCode(a[S]);for(S+=1;S<a.length;){const C=String.fromCharCode(a[S]);S+=1,w.contains(k+C)?k=k+C:(b.write(w.indexOf(k),m),w.size()<4095&&(w.size()==1<<m&&(m+=1),w.add(k+C)),k=C)}return b.write(w.indexOf(k),m),b.write(g,m),b.flush(),y.toByteArray()},f=function(){const h={};let p=0;const g={};return g.add=function(m){if(g.contains(m))throw"dup key:"+m;h[m]=p,p+=1},g.size=function(){return p},g.indexOf=function(m){return h[m]},g.contains=function(m){return typeof h[m]<"u"},g};return i},sJ=function(e,t,n){const r=rJ(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=JR();r.write(a);const i=tJ(),l=a.toByteArray();for(let u=0;u<l.length;u+=1)i.writeByte(l[u]);return i.flush(),"data:image/gif;base64,"+i};Fd.stringToBytes;const Y8=4;function aJ({value:e,label:t,size:n=200}){const{side:r,path:a}=s.useMemo(()=>{const i=Fd(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+Y8} ${f+Y8}h1v1h-1z`);return{side:l+Y8*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 oJ=3e4,iJ=5*6e4;function lJ(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 cJ=e=>e.url,uJ=e=>`${e.slice(0,3)} ${e.slice(3)}`;function dJ(e,t,n){return e.lastVisit&&e.lastVisit.at>=t-iJ?"connected":n-t>=oJ?"stuck":"waiting"}function fJ(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 hJ(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 pJ(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 mJ(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 gJ=2e3;function vJ(){const{markUsed:e}=tu();s.useLayoutEffect(()=>{e("local-access")},[e]);const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(null),[u,f]=s.useState(()=>Date.now()),[h,p]=s.useState(!1),[g,m]=s.useState(null),[w,y]=s.useState("idle"),[b,S]=s.useState(!1),k=s.useRef(null),C=s.useRef(null),{push:E}=rr(),A=s.useCallback(async(K=!1)=>{try{n(await Ee.phone(K)),a(!1)}catch{a(!0)}},[]),[L,$]=s.useState(!1),N=async()=>{$(!0);try{n(await Ee.phoneNewCode()),l(Date.now())}catch{E({kind:"warning",title:"Could not make a new code"})}finally{$(!1)}};s.useEffect(()=>{A();const K=setInterval(()=>{f(Date.now()),A()},gJ);return()=>{clearInterval(K),k.current&&clearTimeout(k.current)}},[A]);const j=t?cJ(t):null;s.useEffect(()=>{j&&i===null&&l(Date.now())},[j,i]);const P=t&&j&&i!==null?dJ(t,i,u):null;s.useEffect(()=>{P==="stuck"&&p(!0)},[P]);const R=!!j&&!!(t!=null&&t.thisComputer);s.useEffect(()=>{if(!R)return;let K=!0;return Ee.phoneHelp().then(V=>K&&m(V.firewall)).catch(()=>K&&m("unknown")),()=>{K=!1}},[R]);const H=lJ(t,r),D=t?hJ(g,t.platform):null,U=t?pJ(w,t.platform):null,_=async()=>{j&&(await qQ(j,C.current)?(S(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>S(!1),1600)):E({kind:"warning",title:"Could not copy the link",detail:j}))},B=async()=>{y("asking");try{const K=await Ee.phoneAllow();m(K.firewall),y(K.result)}catch{y("failed")}};return o.jsxs(us,{title:"Other devices",children:[o.jsxs("div",{className:"sc-set-row",ref:C,children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open on your phone"}),o.jsx("small",{"data-prose":"",children:H.sentence})]}),H.action==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void _(),children:o.jsx("span",{"aria-live":"polite",children:b?"Copied":"Copy link"})}),H.action==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void A(!0),children:"Check again"})]}),t&&j&&o.jsxs("div",{className:"sc-phone",children:[o.jsx(aJ,{value:j,label:`QR code for ${t.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:t.address})," in any browser on the same Wi-Fi, then enter ",o.jsx("b",{className:"sc-phone-key",children:uJ(t.code)}),"."]}),t.thisComputer&&D&&o.jsxs("div",{className:"sc-phone-fw",role:"status",children:[o.jsx("p",{children:D.text}),D.canAllow&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:w==="asking",onClick:()=>void B(),children:w==="asking"?"Waiting for your permission…":"Allow Scenri"})]}),t.thisComputer&&U&&o.jsx("p",{className:"sc-phone-allow","data-state":w,"aria-live":"polite",children:U}),t.thisComputer&&P&&o.jsx("p",{className:"sc-phone-arrival","data-state":P,"aria-live":"polite",children:fJ(P,t)}),t.thisComputer&&o.jsxs("details",{className:"sc-phone-help",open:h,onToggle:K=>p(K.currentTarget.open),children:[o.jsx("summary",{children:"Not opening?"}),o.jsx("ul",{children:mJ(g,t).map(K=>o.jsx("li",{children:K},K))})]})]})]}),(t==null?void 0:t.thisComputer)&&j&&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:L,onClick:()=>void N(),children:L?"Making…":"New code"})]})]})}function wJ(e){switch(e){case"npx":return"npx scenri update";case"global":case"managed":return"scenri update";default:return"npx scenri@latest"}}function yJ({version:e}){var S;const t=n2(),n=tu(),{brand:r}=un(),a=t.status,[i,l]=s.useState(null),[u,f]=s.useState(!1);s.useEffect(()=>{Ee.settings().then(k=>l(!!k.updateCheck)).catch(()=>{})},[]);const h=async()=>{if(i===null)return;const k=!i;l(k);try{await Ee.saveSettings({updateCheck:k})}catch{l(!k)}},p=s.useRef(null);s.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=wJ(e==null?void 0:e.installKind),m=async()=>{try{await navigator.clipboard.writeText(g),f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1600)}catch{}},w=t.checking?o.jsx("span",{className:"sc-tag",children:"checking…"}):a!=null&&a.available?o.jsxs("span",{className:"sc-tag sc-tag-gold",children:[a.latest," available"]}):t.checkError||a!=null&&a.error?o.jsx("span",{className:"sc-tag",children:"couldn't check for updates"}):a!=null&&a.checkedAt?o.jsx("span",{className:"sc-tag",children:"up to date"}):null;let y,b;return a!=null&&a.available?(e==null?void 0:e.installKind)==="dev"?(y="Running from source. Pull and rebuild when you're ready; nothing here touches your checkout.",b=null):(e==null?void 0:e.thisComputer)!==!0?(y="Updates are installed on the computer running Scenri.",b=null):NM(a)?a.phase==="ready"?(y=t.applyError??`${a.stagedVersion} is downloaded and verified. Restarting finishes it.`,b="restart"):a.phase==="staging"?(y="Downloading in the background. Nothing interrupts your work.",b="downloading"):a.phase==="error"?(y=t.applyError??a.error??"Couldn't download the update. Try again.",b="update"):(y=`You are on ${a.current}.`,b="update"):(y=o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{children:g})," in a terminal, then start Scenri again. Your library is not part of the app and stays put."]}),b="copy"):(y=a&&!a.enabled?"Automatic checks are off. Checking here still works.":"New versions announce themselves here.",b="check"),o.jsxs(us,{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:[y,(a==null?void 0:a.available)&&a.phase!=="ready"&&a.notesUrl&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:a.notesUrl,target:"_blank",rel:"noreferrer",children:["See what's in ",a.latest]})]})]})]}),w,b==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:t.checking,onClick:()=>void t.checkNow(),children:"Check for updates"}),(b==="update"||b==="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…":(a==null?void 0:a.phase)==="error"?"Try again":"Update"}),b==="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!0,children:"Downloading…"}),b==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void m(),children:u?"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:i===null,onClick:()=>void h(),children:i===null?"…":i?"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:((S=n.featured)==null?void 0:S.title)??"What changed in Scenri, newest first."})]}),o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:Tp(r),children:"Show"})]})]})}function _k({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 bJ({brandId:e}){const[t,n]=s.useState(null);s.useEffect(()=>{let u=!0;return n(null),Ee.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;for(const g of t??[])u.set(g.day,(u.get(g.day)??0)+g.generations+g.edits);const f=Ok(u,53),h=Ok(u,13),p={generation:0,edit:0};for(const g of t??[])g.day<f.from||(p.generation+=g.generations,p.edit+=g.edits);return{year:f,quarter:h,total:f.sum,byKind:p}},[t]);return o.jsx(us,{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(_k,{weeks:53,months:r.months,cells:r.cells}),o.jsx(_k,{weeks:13,months:a.months,cells:a.cells})]})})}function xJ({engines:e,brandId:t,onSaved:n}){const r=Nr("settings"),a=r.value!==null,[i,l]=s.useState(null);s.useEffect(()=>{if(!a||i)return;let y=!0;return Ee.version().then(b=>y&&l(b)).catch(()=>{}),()=>{y=!1}},[a,i]);const[u,f]=s.useState(null);s.useEffect(()=>{if(!a)return;let y=!0;return Ee.home().then(b=>y&&f(b)).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 Ee.desktop().then(b=>y&&p(b)).catch(()=>{}),()=>{y=!1}},[a,g]);const[m,w]=s.useState("idle");return o.jsx(Gs,{open:a,className:"sc-set",maxWidth:"880px",onDismiss:r.close,children:o.jsx(kJ,{value:r.value,onPick:r.set,saved:o.jsx(SJ,{state:m}),page:y=>o.jsx(EJ,{page:y,engines:e,brandId:t,onSaved:n,onKitState:w,version:i,home:u,desktop:h,onDesktop:p})})})}function kJ({value:e,onPick:t,saved:n,page:r}){const a=Or(da),{brand:i}=un(),l=HG(e),[u,f]=s.useState(()=>OG(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)},m=$h.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(Ha,{size:15})}),o.jsx(As,{className:"sc-newdlg-title",children:m.label}),l==="brand"&&n,o.jsx(Vk,{})]}),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:m.sub(Na(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:b=>{b?h.current.set(y.id,b):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}),y.feature&&o.jsx(KX,{feature:y.feature}),a&&o.jsx(Rl,{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(As,{className:"sc-newdlg-title",children:"Settings"}),o.jsx(Vk,{})]}),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:$h.filter(y=>y.scope==="brand").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Studio"}),o.jsx("ul",{children:$h.filter(y=>y.scope==="studio").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Delete"}),o.jsx("ul",{className:"sc-set-apart",children:$h.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:m.label}),o.jsx("p",{children:m.sub(Na(i))})]}),l==="brand"&&n]}),r(l)]},l)]})]},"index")}function SJ({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(Gn,{size:12,weight:"bold"}),rQ(e)]})}function EJ({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(PQ,{onSaveState:a});case"usage":return o.jsx(bJ,{brandId:n});case"engines":return o.jsxs(o.Fragment,{children:[o.jsx(WQ,{engines:t}),o.jsx(OQ,{engines:t,onSaved:r,thisComputer:h})]});case"appearance":return o.jsx(XX,{});case"library":return o.jsx(YQ,{info:l,thisComputer:h});case"phone":return o.jsxs(o.Fragment,{children:[o.jsx(vJ,{}),h&&o.jsx(_Q,{status:u,onStatus:f})]});case"updates":return o.jsx(yJ,{version:i});case"about":return o.jsx(YX,{version:i});case"danger":return o.jsx(IQ,{onDone:r,thisComputer:h})}}function Vk(){return o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}function CJ(e){return!e.lead||e.spent||e.firstUse||e.onPage||!e.loaded||!e.visible||e.dialogOpen?!1:e.running===0&&!e.builds.some(t=>!t.finished)}function jJ(e){return e>0?`See ${e} more update${e===1?"":"s"}`:"See all updates"}const eP="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1920'%20height='1080'%20viewBox='0%200%201920%201080'%20fill='none'%3e%3c!--%20Scenri%20og-image,%20Figma%20hYeysad0V3rwpN49vWNSeE%20node%205480:2:%20the%20ground%20and%20the%20logo,%20paths%20as%20exported%20--%3e%3ctitle%3eScenri%3c/title%3e%3crect%20width='1920'%20height='1080'%20fill='%2311100E'/%3e%3cpath%20d='M872.355%20532.044L846.18%20528.839C836.935%20527.733%20833.219%20525.379%20833.219%20521.182C833.219%20516.503%20841.132%20513.78%20853.355%20513.78C867.79%20513.78%20876.439%20516.247%20881.374%20525.379L902.473%20518.828C894.079%20500.678%20875.447%20495.375%20855.311%20495.375C827.292%20495.375%20809.142%20504.762%20809.142%20523.649C809.142%20537.971%20819.891%20545.883%20841.982%20548.577L865.804%20551.527C876.042%20552.774%20878.906%20555.469%20878.906%20559.184C878.906%20564.118%20871.363%20567.578%20857.041%20567.578C839.515%20567.578%20832.709%20564.005%20827.888%20554.986L805.796%20561.537C813.708%20579.801%20832.454%20585.983%20855.567%20585.983C884.21%20585.983%20903.239%20576.341%20903.239%20556.972C903.239%20543.132%20893.738%20534.624%20872.384%20532.044H872.355Z'%20fill='%23fff'/%3e%3cpath%20d='M962.368%20514.262C974.478%20514.262%20985.453%20518.091%20990.643%20530.938L1012.73%20525.635C1007.91%20508.591%20989.508%20495.517%20962%20495.517C930.266%20495.517%20907.663%20513.043%20907.663%20540.693C907.663%20568.344%20930.266%20586.125%20962%20586.125C989.537%20586.125%201007.94%20572.796%201012.73%20555.752L990.643%20550.449C985.453%20563.296%20974.478%20567.124%20962.368%20567.124C945.948%20567.124%20932.619%20558.843%20932.619%20541.941V539.474C932.619%20522.572%20945.948%20514.291%20962.368%20514.291V514.262Z'%20fill='%23fff'/%3e%3cpath%20d='M1043.99%20548.946H1095.23V531.42H1043.99V515.142H1100.79V496.85H1019.29V584.509H1101.64V566.245H1043.99V548.946Z'%20fill='%23fff'/%3e%3cpath%20d='M1177.84%20545.997H1177.73L1135.73%20496.85H1110.43V584.509H1133.4V527.96H1133.52L1181.93%20584.509H1200.81V496.85H1177.84V545.997Z'%20fill='%23fff'/%3e%3cpath%20d='M1301.32%20526.003C1301.32%20507.116%201289.47%20496.85%201266.13%20496.85H1212.04V584.509H1236.75V556.348H1256.99L1274.04%20584.509H1302.2L1282.32%20553.143C1294.66%20548.691%201301.32%20539.672%201301.32%20525.975V526.003ZM1276.62%20527.478C1276.62%20535.021%201272.42%20538.708%201263.91%20538.708H1236.75V515.113H1263.91C1272.42%20515.113%201276.62%20518.828%201276.62%20526.23V527.478Z'%20fill='%23fff'/%3e%3cpath%20d='M1334.05%20496.85H1309.35V584.509H1334.05V496.85Z'%20fill='%23fff'/%3e%3cpath%20d='M767.454%20503.06V560.034L731.665%20595.739V485.79H750.155C759.712%20485.79%20767.454%20493.532%20767.454%20503.089V503.06Z'%20fill='%23fff'/%3e%3cpath%20d='M621.744%20485.789V595.739H603.253C593.696%20595.739%20585.954%20587.997%20585.954%20578.44V521.466L621.744%20485.761V485.789Z'%20fill='%23fff'/%3e%3cpath%20d='M731.664%20595.71L695.96%20631.5H638.986C629.429%20631.5%20621.687%20623.758%20621.687%20614.201V595.71H731.636H731.664Z'%20fill='%23fff'/%3e%3cpath%20d='M621.744%20485.79L657.42%20450H714.394C723.951%20450%20731.693%20457.742%20731.693%20467.299V485.79H621.744Z'%20fill='%23fff'/%3e%3c/svg%3e",AJ="/assets/whatsnew-stage-DlyjaAn6.webp",NJ=["January","February","March","April","May","June","July","August","September","October","November","December"];function tP(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const n=NJ[Number(t[2])-1];return n?`${Number(t[3])} ${n} ${t[1]}`:e}function MJ(e){const t=tP(e);if(t===e)return e;const[n,r,a]=t.split(" ");return`${n} ${r.slice(0,3)} ${a}`}const RJ="/assets/0.17.0-select-several-DdAw3yQ3.webp",PJ="/assets/0.17.1-presenter-identity-BfgRpajU.webp",LJ="/assets/0.17.2-presenter-prompt-BiaRpVJN.webp",TJ="/assets/0.18.0-portrait-standard-CrJ6Ixm2.webp",$J="/assets/0.19.0-home-examples-Dv7HjKk9.webp",DJ="/assets/0.20.0-made-in-place-B0L_kS__.webp",HJ="/assets/0.21.0-home-examples-J92K_hqk.webp",OJ="/assets/0.22.0-people-places-DBgKia30.webp",IJ=Object.assign({"./assets/whatsnew/0.17.0-select-several.webp":RJ,"./assets/whatsnew/0.17.1-presenter-identity.webp":PJ,"./assets/whatsnew/0.17.2-presenter-prompt.webp":LJ,"./assets/whatsnew/0.18.0-portrait-standard.webp":TJ,"./assets/whatsnew/0.19.0-home-examples.webp":$J,"./assets/whatsnew/0.20.0-made-in-place.webp":DJ,"./assets/whatsnew/0.21.0-home-examples.webp":HJ,"./assets/whatsnew/0.22.0-people-places.webp":OJ});function FJ(e){return IJ[`./assets/whatsnew/${e}`]??null}const nP="Scenri could not read its release notes. If you are running a development server, it may predate this page; restart it and try again.",rP="There is nothing new to show here yet.",_J={fetchpriority:"high"};function sP(e){var r;const t=(r=e==null?void 0:e.sections.find(a=>a.image))==null?void 0:r.image,n=t?FJ(t.file):null;return t&&n?{src:n,alt:t.alt}:null}function aP({picture:e,eager:t=!1,onOpen:n,onBroken:r}){const[a,i]=s.useState("wait"),l=s.useCallback(h=>{h!=null&&h.complete&&h.naturalWidth>0&&i("ready")},[]);if(a==="broken")return null;const u=a==="ready"||void 0,f=o.jsx("img",{ref:l,...t?_J:void 0,src:e.src,alt:e.alt,loading:t?"eager":"lazy",decoding:"async",onLoad:()=>i("ready"),onError:()=>{i("broken"),r==null||r()}});return n?o.jsxs("button",{type:"button",className:"sc-wn-media","data-ready":u,"aria-haspopup":"dialog",onClick:n,children:[f,o.jsx("span",{className:"sc-vh",children:", view larger"}),o.jsx("span",{className:"sc-corner","aria-hidden":"true",children:o.jsx("span",{className:"sc-cell-ctl",children:o.jsx(NF,{size:14})})})]}):o.jsx("div",{className:"sc-wn-media","data-ready":u,children:f})}function VJ({src:e,alt:t,onClose:n}){const r=s.useRef(null);return o.jsx(Ll,{open:!0,onOpenChange:a=>!a&&n(),children:o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-wn-lb-scrim"}),o.jsxs(Dl,{className:"sc-wn-lb","aria-describedby":void 0,onOpenAutoFocus:a=>{r.current=document.activeElement,EM(a)},onCloseAutoFocus:a=>{var i;a.preventDefault(),(i=r.current)!=null&&i.isConnected&&r.current.focus()},onClick:n,children:[o.jsx(Hl,{className:"sc-vh",children:t}),o.jsx("div",{className:"sc-wn-media sc-wn-lb-stage","data-ready":!0,children:o.jsx("img",{src:e,alt:t})}),o.jsx(_1,{className:"sc-icon-btn sc-wn-lb-close","aria-label":"Close",children:o.jsx(jn,{size:16})})]})]})})}function oP({version:e,current:t=!1}){return o.jsxs("span",{className:"sc-tag sc-tag-version","data-on":t||void 0,children:[o.jsx("span",{className:"sc-vh",children:"Version "}),e,t&&o.jsx("span",{className:"sc-vh",children:", the version you are on"})]})}function ZJ({sections:e}){return o.jsx("div",{className:"sc-wn-areas",children:e.map(t=>o.jsxs("section",{className:"sc-wn-area",children:[o.jsx("h3",{children:t.heading}),o.jsx("p",{children:t.body})]},t.heading))})}function iP({entry:e,current:t=!1,hideVersion:n=!1}){return o.jsxs("p",{className:"sc-wn-when",children:[!n&&o.jsx(oP,{version:e.version,current:t}),o.jsxs("time",{dateTime:e.date,children:[o.jsx("span",{"aria-hidden":"true",children:MJ(e.date)}),o.jsx("span",{className:"sc-vh",children:tP(e.date)})]})]})}function zJ({version:e,current:t}){return o.jsxs("div",{className:"sc-wn-media sc-wn-fallback","data-ready":!0,children:[o.jsx("img",{src:eP,alt:""}),o.jsx("span",{className:"sc-wn-fallback-chip","data-theme":"dark",children:o.jsx(oP,{version:e,current:t})})]})}function BJ({href:e,version:t}){return o.jsxs("a",{className:"sc-wn-notes",href:e,target:"_blank",rel:"noopener noreferrer",children:["Release notes",o.jsxs("span",{className:"sc-vh",children:[" for ",t," on GitHub, opens in a new tab"]}),o.jsx(Mc,{size:12,"aria-hidden":"true"})]})}function UJ(){const e=Nr("whatsnew"),{brand:t}=un(),{status:n,featured:r,recent:a,unseen:i,lead:l,running:u,markSeen:f}=tu(),h=e.value!==null&&n!=="loading",p=r,g=s.useRef({open:!1,more:0});h&&!g.current.open?g.current={open:!0,more:i.filter(A=>A!==(p==null?void 0:p.version)).length}:h||(g.current.open=!1);const m=()=>{f(),e.close()},w=s.useRef(h);s.useEffect(()=>{w.current&&!h&&f(),w.current=h},[h,f]);const[y,b]=s.useState(null),S=p&&y!==p.version?sP(p):null,k=(S==null?void 0:S.src)??eP;s.useEffect(()=>{if(l)for(const A of[k,AJ]){const L=new Image;L.fetchPriority="high",L.src=A}},[l,k]);const C=s.useRef(!1),E=A=>{!A.metaKey&&!A.ctrlKey&&!A.shiftKey&&!A.altKey&&(C.current=!0)};return o.jsxs(Gs,{open:h,className:"sc-wn",tone:"dim",maxWidth:"520px",described:!0,onDismiss:m,onCloseAutoFocus:A=>{C.current&&(A.preventDefault(),C.current=!1)},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"What's new"}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]}),o.jsx("div",{className:"sc-newdlg-body",children:p?o.jsxs("article",{className:"sc-wn-ex",children:[S?o.jsx(aP,{picture:S,eager:!0,onBroken:()=>b(p.version)},p.version):o.jsx(zJ,{version:p.version,current:p.version===u}),o.jsx(iP,{entry:p,current:p.version===u,hideVersion:!S}),o.jsx(Ic,{asChild:!0,children:o.jsx("h3",{className:"sc-wn-hed",children:o.jsx(Vn,{className:"sc-wn-ex-link",to:`${Tp(t)}#v${p.version}`,replace:!0,onClick:E,children:p.title})})})]}):o.jsx(Ic,{className:"sc-wn-txt",children:n==="failed"?nP:rP})}),o.jsxs("div",{className:"sc-newdlg-foot sc-wn-foot",children:[a.length>0&&o.jsxs(Vn,{className:"sc-wn-link",to:Tp(t),replace:!0,onClick:E,children:[jJ(g.current.more),o.jsx(Ea,{size:13,"aria-hidden":"true"})]}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",children:"Got it"})})]})]})}function WJ(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 lP(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 KJ(e){return`Scenri will start Codex without ${lP(e)}. Nothing on your computer changes, and you can undo this here later.`}function GJ(e){return`Scenri is starting Codex without ${lP(e)} on this computer.`}const YJ=2e3,qJ=5*6e4;function XJ({engines:e,onSaved:t}){const n=Nr("setup"),r=n.close,a=n.value,i=a?YR(a):void 0,u=!!i||a==="codex-cli",f=e.find(g=>g.id===a),[h,p]=s.useState(!0);return s.useEffect(()=>{let g=!0;return Ee.version().then(m=>g&&p(m.thisComputer!==!1)).catch(()=>{}),()=>{g=!1}},[]),o.jsx(Gs,{open:u,className:"sc-setup",maxWidth:"520px",onDismiss:r,onOpenAutoFocus:i&&h?g=>{var m;g.preventDefault(),(m=g.target.querySelector(".sc-setup-key input"))==null||m.focus()}:void 0,children:i?o.jsx(QJ,{provider:i,name:f?yl(f.displayName):i.engineId,connected:!!(f!=null&&f.available),thisComputer:h,onSaved:t,onDone:r}):o.jsx(JJ,{engines:e,onSaved:t,onDone:r})})}function cP({title:e}){return o.jsxs("div",{className:"sc-newdlg-head sc-setup-head",children:[o.jsx(As,{className:"sc-newdlg-title sc-setup-title",children:e}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})]})}function QJ({provider:e,name:t,connected:n,thisComputer:r,onSaved:a,onDone:i}){const[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(null),[m,w]=s.useState(!1),y=async()=>{const S=l.trim();if(S){h(!0),g(null);try{await Ee.saveSettings({[e.settingKey]:S}),u(""),a(),i()}catch(k){g(k.message)}finally{h(!1)}}},b=async()=>{h(!0),g(null);try{await Ee.saveSettings({[e.settingKey]:""});const S=await Ee.settings();if(a(),S[e.settingKey]){w(!0);return}i()}catch(S){g(S.message)}finally{h(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(cP,{title:n?`${t} key`:`Connect ${t}`}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(uP,{engineId:e.engineId,name:t,state:n?"Connected":"Not connected",ready:n}),o.jsx("p",{className:"sc-setup-lead",children:r?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.`:"Keys are added on the computer running Scenri."})]}),r&&o.jsxs("form",{className:"sc-setup-key",onSubmit:S=>{S.preventDefault(),y()},children:[o.jsx("input",{className:"sc-in",type:"password",placeholder:e.hint,value:l,onChange:S=>u(S.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:f||!l.trim(),children:[f?o.jsx(Tr,{size:"1"}):o.jsx(fC,{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(Mc,{size:13})]})]})]}),r&&n&&o.jsx("div",{className:"sc-setup-cut",children:o.jsx(Xn,{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:f,onConfirm:()=>void b()})}),m&&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."]}),p&&o.jsx("div",{className:"sc-setup-problem",children:o.jsxs("p",{"data-detail":"",children:[o.jsx(Sm,{size:15})," ",p]})})]})]})}function JJ({engines:e,onSaved:t,onDone:n}){const r=zl(),[a,i]=s.useState("checking"),[l,u]=s.useState(null),[f,h]=s.useState(!1),[p,g]=s.useState("mac"),[m,w]=s.useState(null),[y,b]=s.useState([]),[S,k]=s.useState([]),C=s.useRef(null),E=s.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null)},[]),A=s.useCallback(async(K=!1)=>{const{state:V,reason:O,platform:I,conflictKeys:Y,ignoredKeys:Z}=await Ee.codexStatus({force:K});return I&&g(I),w(O??null),b(Y??[]),k(Z??[]),i(V),V},[]);s.useEffect(()=>(u(null),i("checking"),A().catch(()=>i("unverified")),E),[A,E]);const L=s.useCallback(()=>{u(null),i("checking"),A(!0).catch(()=>i("unverified"))},[A]),$=async()=>{u(null),i("repairing");try{const{state:K,conflictKeys:V,ignoredKeys:O,reason:I}=await Ee.repairCodexEnv(y);b(V??[]),k(O??[]),w(I??null),i(K)}catch(K){u({detail:K.message}),i("env-conflict")}},N=async()=>{u(null),i("checking");try{const{state:K,conflictKeys:V,ignoredKeys:O}=await Ee.restoreCodexEnv();b(V??[]),k(O??[]),i(K)}catch{A().catch(()=>i("unverified"))}};s.useEffect(()=>{a==="ready"&&t()},[a,t]);const j=async()=>{u(null),i("installing");try{const K=await Ee.installCodex();if(K.ok||K.state!=="not-installed"){i(K.state);return}u({detail:K.detail,command:K.fallbackCommand,docsUrl:K.docsUrl}),i(K.state)}catch(K){u({detail:K.message,command:"npm install -g @openai/codex"}),i("not-installed")}},P=async()=>{u(null),i("signing-in");const K=Date.now();E(),C.current=window.setInterval(()=>{if(Date.now()-K>qJ){E(),i("not-authenticated"),u({detail:"Sign-in did not finish. Try again, or use the command below.",command:"codex login"});return}Ee.codexStatus().then(({state:V})=>{V==="ready"&&(E(),i("ready"))}).catch(()=>{})},YJ);try{const V=await Ee.loginCodex();if(E(),V.ok||V.state==="ready"){i(V.state);return}u({detail:V.detail,command:V.fallbackCommand}),i(V.state)}catch(V){E(),u({detail:V.message,command:"codex login --device-auth"}),i("not-authenticated")}},R=s.useRef(null);s.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const H=K=>{var V;(V=navigator.clipboard)==null||V.writeText(K).then(()=>{h(!0),R.current&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>h(!1),1600)})},D=e.filter(K=>K.available&&K.id!=="codex-cli"&&!K.localOnly),U=a==="checking"||a==="installing"||a==="signing-in"||a==="repairing",_=a==="not-installed"||a==="installing"?{step:0,label:"Install Codex CLI",verb:a==="installing"?"Installing":"Install",busy:a==="installing",run:j}: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:P}:a==="env-conflict"||a==="repairing"?{step:2,label:"Ignore that key",verb:a==="repairing"?"Ignoring":"Ignore that key",busy:a==="repairing",run:$}:null,B=a==="not-installed"||a==="installing"||a==="not-authenticated"||a==="signing-in";return o.jsxs(o.Fragment,{children:[o.jsx(cP,{title:"Set up image generation"}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(uP,{engineId:"codex-cli",name:"Codex CLI",state:eee[a],ready:a==="ready",busy:U}),o.jsx("p",{className:"sc-setup-lead",children:tee[a](m)}),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(nee,{phase:a,act:_}),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:KJ(y)}),a==="ready"&&S.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[GJ(S)," ",o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:N,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(Gn,{size:14}):o.jsx(bp,{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(K=>yl(K.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(Sm,{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(Gn,{size:14}):o.jsx(bp,{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(Mc,{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:L,children:[o.jsx(yp,{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:L,children:[o.jsx(yp,{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(fC,{size:15})," Add a provider key"]}),o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>void A(),children:"Back to Codex setup"})]}),B&&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 eee={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"},tee={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 uP({engineId:e,name:t,state:n,ready:r,busy:a}){const i=XR(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(QR,{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(Tr,{size:"1"}):r?o.jsx("span",{className:"d"}):null,n]})]})]})}function nee({phase:e,act:t}){const{installed:n,signedIn:r,connected:a}=WJ(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(Gn,{size:14,weight:"bold"}):f+1}),m=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:m,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:[m?o.jsx(Tr,{size:"1"}):null,t.verb,m?null:o.jsx(Ea,{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 ree(){const{brands:e}=Mn(),t=dP(e);return t?o.jsx(Ta,{to:Ho(t),replace:!0}):o.jsx(Ta,{to:"/setup",replace:!0})}function dP(e){const t=FK();return e.find(n=>n.id===t)??e[0]??null}const see=48;function aee(e,t,n=see){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&&Yu(u[u.length-1],a)<0)continue;r??(r=[...e]);let f=0;for(;f<r.length&&Yu(r[f],a)<=0;)f++;r.splice(f,0,a),r.length>n&&(r.length=n)}return r??e}const fP='[data-guide="library.new"]',_d=(e,t)=>({id:"go",voice:"ask",point:`[data-guide="nav.${e}"]`,side:"bottom",soft:!0,...t}),oee='[data-guide="compose"] .sc-attachpanel',iee='[data-guide="compose"] .sc-attachpanel .sc-ap-body',_p='[data-guide="compose"] .sc-promptcard',lee='[data-guide="compose.add"]',hP='[data-guide="compose"] .sc-brief-line',Vp='[data-guide="compose.send"]',pP='[data-guide="compose.engine"]',ud=".sc-pstudio",K4=`${ud} .sc-convo-card`,cee=".sc-newdlg-layer",dd=".sc-ovl",Cn={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 person",body:"A person is someone Scenri keeps. Pick one and the same face shows your product in every shot."},scene:{title:"Choose a place",body:"A place is a setting 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 person and the place 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, people and places."},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 places live here",body:"A place is a setting and its light, saved to shoot in again. Open Places to make one."},sceneNew:{title:"Start a new place",body:"Describe the place in a sentence, start from pictures of it, or let it guide you."},presenterGo:{title:"Your people live here",body:"A person is someone Scenri keeps, the same face in every shot. Open People to make one."},presenterNew:{title:"Start a new person",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 person uses this face, so take the one you want."},presenterSave:{title:"Save your person",body:"Once saved they are in your ingredients, ready for every shot."},sceneStart:{title:"Describe the place, or start from pictures",body:"A place is the setting 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 place",body:"Every shot made in this place 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."}},bl=e=>`.sc-feed .sc-cell[data-fb-node="${e}"]`,gy=e=>e.status==="done"&&e.images>0,vy=e=>e.status==="error"||e.status==="cancelled"||e.status==="done"&&e.images===0,G4=e=>e.products+e.presenters+(e.scene?1:0)+e.others,Zk={product:"Products",presenter:"People",scene:"Places"};function mP(e){if(!e.here)return e.heading?_d("create",Cn.go):null;const t=e.composer,n=e.nodes.find(gy);if(n)return{id:"result",voice:"note",point:bl(n.id),side:"bottom",...Cn.result,done:!0};const r=e.nodes.find(u=>u.status==="running");if(r)return{id:"waiting",voice:"note",point:bl(r.id),side:"bottom",...Cn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||G4(t)>0||t.words,i=e.nodes.find(vy);if(i&&!a)return{id:"failed",voice:"note",point:bl(i.id),side:"bottom",...Cn.failed};if(t.engine!=="ready")return{id:"engine",voice:"ask",point:pP,side:"top",...Cn.engine};if(!e.begun&&G4(t)===0&&!t.words)return{id:"intro",voice:"ask",live:[],start:!0,...Cn.intro};const l=vP(t);return l?Y4(l,t.pickerOpen):{id:"make",voice:"ask",point:Vp,live:[hP,Vp],side:"top",...Cn.make}}function gP(e){if(!e.here)return e.heading?_d("create",Cn.go):null;const t=e.composer,n=e.nodes.find(gy);if(n)return{id:"again",voice:"note",point:bl(n.id),side:"bottom",...Cn.reuseResult,done:!0};const r=e.nodes.find(l=>l.status==="running");if(r)return{id:"waiting",voice:"note",point:bl(r.id),side:"bottom",...Cn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||G4(t)>0||t.words,i=e.nodes.find(vy);return i&&!a?{id:"failed",voice:"note",point:bl(i.id),side:"bottom",...Cn.failed}:t.engine!=="ready"?{id:"engine",voice:"ask",point:pP,side:"top",...Cn.engine}:t.products===0?Y4("product",t.pickerOpen,Cn.reuseProduct):t.scene?{id:"make",voice:"ask",point:Vp,live:[hP,Vp],side:"top",...Cn.make}:Y4("scene",t.pickerOpen,Cn.reuseScene)}function vP(e){return e.products===0?"product":e.presenters===0?"presenter":e.scene?null:"scene"}function Y4(e,t,n){const r=n??Cn[e];return t?{id:e,voice:"ask",point:oee,live:[iee],lit:[_p],beside:!0,side:"right",...r}:{id:e,voice:"ask",point:lee,side:"top",...r}}const wP=`${dd} .sc-promptcard`,uee=`${dd} .sc-stage-img`,zk=`${dd} .sc-trail`,Bk=".sc-feed";function dee(e){if(e.heading)return _d("create",Cn.refineGo);if(!e.here)return null;if(!e.open&&!e.armed)return{id:"choose",voice:"ask",point:Bk,live:[Bk],beside:!0,side:"left",...Cn.refineChoose};const t=e.nodes.find(gy);if(t)return e.open?{id:"refined",voice:"note",shell:dd,point:zk,side:"top",...Cn.refineResult,done:!0}:{id:"refined",voice:"note",point:bl(t.id),side:"bottom",...Cn.refineResult,done:!0};if(e.nodes.some(r=>r.status==="running"))return{id:"refining",voice:"quiet"};const n=e.nodes.find(vy);return n&&!e.asking?e.open?{id:"refine-failed",voice:"note",shell:dd,point:zk,side:"top",...Cn.refineFailed}:{id:"refine-failed",voice:"note",point:bl(n.id),side:"bottom",...Cn.refineFailed}:e.open?{id:"ask",voice:"ask",shell:dd,point:wP,also:[uee],beside:!0,side:"left",...Cn.refineAsk}:{id:"ask",voice:"ask",point:_p,live:[_p],beside:!0,side:"top",...Cn.refineAsk}}function yP(e){if(e.heading)return _d("presenters",Cn.presenterGo);const t=e.studio;if(t){const n=`${ud} [data-turn="q:${t.open}"]`,r=(a,i,l=[],u)=>({id:a,voice:"ask",shell:ud,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",Cn.presenterStart,[K4]);case"noengine":return r("engine",Cn.presenterEngine);case"identity":case"revision":return r("face",Cn.presenterFace,[".sc-pstudio-well",K4],[`${ud} [data-turn]:has(+ [data-turn="q:${t.open}"])`]);case"save":return r("save",Cn.presenterSave);default:return{id:"studio",voice:"quiet"}}}return e.onPage?{id:"new",voice:"ask",point:fP,side:"bottom",...Cn.presenterNew}:null}function fee(e,t){return{id:e,voice:"ask",shell:cee,point:".sc-newdlg",beside:!0,side:"left",...t}}function bP(e){return{id:"new",voice:"ask",point:fP,side:"bottom",...e}}function hee(e){var n,r;if(e.heading)return _d("scenes",Cn.sceneGo);const t=e.studio;if(t){const a=`${ud} [data-turn="q:${t.open}"]`,i=(l,u)=>({id:l,voice:"ask",shell:ud,point:`${a} .sc-convo-ask`,live:[a],also:[K4],beside:!0,side:"left",...u});return t.open==="source"?i("start",Cn.sceneStart):(n=t.open)!=null&&n.startsWith("agree-")?i("words",Cn.sceneWords):(r=t.open)!=null&&r.startsWith("decide-")?{id:"use",voice:"quiet"}:{id:"studio",voice:"quiet"}}return e.onPage?bP(Cn.sceneNew):null}function pee(e){return e.heading?_d("products",Cn.productGo):e.dialogOpen?fee("product",Cn.productMake):e.onPage?bP(Cn.productNew):null}function xP(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 mee(e,t,n){return e?xP(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 gee(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 vee={"first-shot":"shot",reuse:"shot",refine:"refine",product:"product",presenter:"presenter",scene:"scene"};function Ih(e,t){return!(!t.eligible||t.hidden||t.active&&(t.active.task===e||t.active.task==="first-shot")||t.done[vee[e]]||t.dismissed.includes(e)||e==="refine"&&!t.done.shot)}function wee(e){return e.onMainPage&&e.eligible&&e.welcome===null&&e.ready&&e.visible&&!e.blocked&&!e.busy}const Xu={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 yee(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 bee(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 xee="https://github.com/tonygorb/scenri",kee="https://scenri.co",See="https://scenri.co/docs";function Eee(){var k,C;const e=gn(pt.hub),t=gn(pt.set),n=!!e||!!t,r=tu(),a=n2(),i=!!((k=a.status)!=null&&k.available),l=i&&!a.dismissed||r.unread,u=Zl(),f=zl(),h=SM(),p=UG(),{engines:g}=Mn(),m=!g.some(E=>E.available),{brand:w}=un(),{pathname:y}=Bn(),b=s.useRef(!1),S=Tp(w);return o.jsx("div",{className:"sc-help-float",children:o.jsxs(Es,{children:[o.jsx(hr,{label:"Help",children:o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-icon-btn sc-help-btn","aria-label":"Help",children:[o.jsx(QF,{size:16}),l&&o.jsx("span",{className:"sc-upd-dot","aria-hidden":"true"})]})})}),o.jsxs(js,{align:"end",side:"top",sideOffset:8,className:"sc-menu sc-help-menu",onCloseAutoFocus:E=>{b.current&&(E.preventDefault(),b.current=!1)},children:[i&&o.jsxs(Wn,{className:"sc-menu-item","data-update":"",onSelect:()=>u("updates"),children:[o.jsx(mE,{size:18,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:["Update available · ",(C=a.status)==null?void 0:C.latest]})]}),o.jsxs(o.Fragment,{children:[o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>{A4.current="help",h()},children:[o.jsx(FF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Learn"})]}),o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>p(),children:[o.jsx(_F,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:Xu.again})]})]}),n&&o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>window.dispatchEvent(new Event("scenri:shortcuts")),children:[o.jsx(BF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Keyboard shortcuts"})]}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs(Vn,{to:S,onClick:E=>{!E.metaKey&&!E.ctrlKey&&!E.shiftKey&&!E.altKey&&y!==S&&(b.current=!0)},children:[o.jsx(UF,{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"})]})]})}),m&&o.jsxs(Wn,{className:"sc-menu-item",onSelect:()=>f(),children:[o.jsx(a1,{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(Wn,{className:"sc-menu-item",onSelect:()=>u("about"),children:[o.jsx(bm,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"About Scenri"})]}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:See,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(MF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Docs"})]})}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:kee,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(IF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"scenri.co"})]})}),o.jsx(Wn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:xee,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(OF,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Scenri on GitHub"})]})})]})]})})}function Cee(){return o.jsx(Eee,{})}const jee={composer:null,overlay:null,studio:null,showing:!1};let so=jee;const q4=new Set;function m2(e){so=e;for(const t of q4)t()}const wy=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function Uk(e){wy(so.composer,e)||m2({...so,composer:e})}function Wk(e){wy(so.overlay,e)||m2({...so,overlay:e})}function Zp(e){wy(so.studio,e)||m2({...so,studio:e})}function Kk(e){so.showing!==e&&m2({...so,showing:e})}function kP(e){return q4.add(e),()=>q4.delete(e)}function Aee(){return so}function SP(){return s.useSyncExternalStore(kP,Aee)}function Nee(){return s.useSyncExternalStore(kP,()=>so.showing)}function Mee({open:e,pictures:t,note:n,onTake:r,onDecline:a}){return o.jsxs(Gs,{open:e,className:"sc-welcome",maxWidth:"440px",described:!0,tone:"guide",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsxs(As,{className:"sc-newdlg-title",children:["Welcome to ",o.jsx("span",{className:"sc-accent",children:"Scenri"})]}),o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":Xu.notNow,children:o.jsx(jn,{size:16})})})]}),o.jsx(Ic,{className:"sc-welcome-lede",children:Xu.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:Xu.notNow}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:r,children:Xu.take})]})]})}const Gk=e=>e.t!=="format",ni=()=>[{t:"text",v:""}],eo=e=>e.t==="product"?`p:${e.id}`:e.t==="template"?`t:${e.id}`:e.t==="ref"?`r:${e.imageHash}`:g2(e);function Ree(e,t){const n=new Set,r=l=>{const u=eo(l);return u?n.has(u)?!1:(n.add(u),!0):!0},a=e.filter(Gk).filter(r),i=t.filter(Gk).filter(r);return{own:a,carried:i}}function yy(e){const{own:t,carried:n}=Ree(e.tokens??[],e.inherited??[]),r=[...t,...n],a=r.length?r:ni(),i=a.some(l=>l.t==="template");return e.templateId&&!i?[{t:"template",id:e.templateId},...a]:a}const vc="sc-token",uf=`.${vc}`,g2=e=>e.t==="template"?`t:${e.id}${e.setup||e.view?`|${e.setup??""}`:""}${e.view?`|${e.view}|${e.viewName??""}`:""}`: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}`:"",ks=e=>{const t=e.slice(0,1),n=e.slice(2);if(t==="t"){const[r,a,i,l]=n.split("|");return r?{t:"template",id:r,...a?{setup:a}:{},...i?{view:i,...l?{viewName:l}:{}}:{}}: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},pi="\uFEFF",Ul=//g,Nc=e=>!!e&&e.nodeType===Node.TEXT_NODE&&e.textContent===pi,EP=e=>{var t;return e.length-(((t=e.match(Ul))==null?void 0:t.length)??0)};function So(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)?Bp(e,n.startContainer,n.startOffset):null}function Ya(e,t){if(!e)return;let n=0;for(const r of Array.from(e.childNodes)){const a=Cd(r);if(r.nodeType===Node.TEXT_NODE){if(t<=n+a){Po(e,r,zp(r,t-n));return}}else if(t<=n+a){const i=r.nextSibling;if((i==null?void 0:i.nodeType)===Node.TEXT_NODE){Po(e,i,zp(i,0));return}break}n+=a}wc(e)}function zp(e,t){const n=e.textContent??"";if(n===pi)return 1;let r=0,a=0;for(;a<n.length&&r<t;)n[a]!==pi&&(r+=1),a+=1;return a}function wc(e){if(!e)return;e.focus({preventScroll:!0});const t=e.lastChild;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE){Po(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 Pee(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 Po(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 Cd=e=>e.nodeType===Node.TEXT_NODE?EP(e.textContent??""):1;function Bp(e,t,n){if(t===e){let a=0;for(let i=0;i<n&&i<e.childNodes.length;i++)a+=Cd(e.childNodes[i]);return a}let r=0;for(const a of Array.from(e.childNodes)){if(a===t)return r+EP((a.textContent??"").slice(0,n));if(a.contains(t))return r+1;r+=Cd(a)}return r}function Co(e){var n,r;if(!e)return;const t=So(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(Ul,""),u=l.length?l:i.length?pi:"";u!==i&&(a.textContent=u),u||a.remove()}for(const a of Array.from(e.childNodes))Nc(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(pi),a),((r=a.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(pi),a.nextSibling));_0(e)||t!==null&&Ya(e,t)}function Lee(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(pi)&&(u!==pi||!Vs(l.previousSibling)&&!Vs(l.nextSibling)))return!1}return!0}function Tee(e){return e.querySelector(uf)?!1:!(e.textContent??"").replace(/[ ]/g,"").trim()}function _0(e){if(!e)return!1;const t=Tee(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(vc);function by(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 Yk(e){var a;if(!e)return ni();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(Ul,"");continue}const l=i,u=(a=l.dataset)==null?void 0:a.tok;if(u){const f=ks(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 qk(e,t,n){if(e){e.textContent="";for(const r of $ee(t)){if(r.t==="text"){r.v&&e.appendChild(document.createTextNode(r.v));continue}e.appendChild(n(r))}Co(e)}}function $ee(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 q8(e,t){for(const n of Array.from(e.querySelectorAll(uf))){const r=ks(n.dataset.tok??"");if(r&&eo(r)===t)return n}return null}function CP(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 jP(){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 Sc(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;Po(e,a,Nc(a)?1:n==="after"?0:a.length)}const Up=9;function AP(e){if(!e.firstChild)return[];const t=document.createRange();return t.selectNodeContents(e),Array.from(t.getClientRects()).filter(n=>n.height>0)}function NP(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 Xk(e,t,n){if(!e)return!1;const r=AP(e),a=NP(r,n);if(!a)return!1;const i=a.top+a.height/2;for(const u of Array.from(e.querySelectorAll(uf))){const f=u.getBoundingClientRect();if(!(f.bottom<a.top||f.top>a.bottom)&&!(t<f.left-Up||t>f.right+Up))return Sc(e,u,t<f.left+f.width/2?"before":"after"),!0}if(n>=a.top&&n<=a.bottom)return!1;const l=MP(t,i);return!l||!e.contains(l.node)||l.node.nodeType!==Node.TEXT_NODE?!1:(Po(e,l.node,l.offset),!0)}function Dee(e,t,n){if(!e)return null;const r=NP(AP(e),n);if(!r)return null;const a=r.top+r.height/2;for(const l of Array.from(e.querySelectorAll(uf))){const u=l.getBoundingClientRect();if(!(u.bottom<r.top||u.top>r.bottom)&&!(t<u.left-Up||t>u.right+Up))return{beside:l,side:t<u.left+u.width/2?"before":"after"}}const i=MP(t,a);return!i||!e.contains(i.node)?null:{node:i.node,offset:i.offset}}function MP(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 Hee(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){Ya(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=_ee(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)}Co(e),Ya(e,ao(e,t)+1)}const Oee=["$","/","@","#"],Iee=e=>Oee.includes(e),Wp=e=>e===" "||e===`
|
|
100
|
+
`||e===" "||e===pi;function Fee(e){const t=CP(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(Wp(r))return null;if(Iee(r))return n===0||Wp(t[n-1])?{sigil:r,query:t.slice(n+1)}:null}return null}function _ee(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 X8(e,t){if(!e||!t)return;e.normalize();const n=ao(e,t);t.remove(),Co(e),Ya(e,n)}function ao(e,t){let n=0;for(const r of Array.from(e.childNodes)){if(r===t)break;n+=Cd(r)}return n}function Vee(e,t){var u,f;const n=by(e);if(!n||!e)return!1;const{text:r,at:a}=n,i=Nc(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:(Po(e,h,Nc(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:(Po(e,l,Nc(l)?1:l.length),!0)}function Qk(e,t){const n=by(e);if(!n)return null;const{text:r,at:a}=n,i=Nc(r);return t==="Backspace"?Vs(r.previousSibling)&&(i||a===0)?r.previousSibling:null:Vs(r.nextSibling)&&(i||a===r.length)?r.nextSibling:null}function Jk(e,t){const n=by(e);return!n||!Nc(n.text)?!1:t==="Backspace"?!n.text.previousSibling:!n.text.nextSibling}function Zee(e,t){const n=So(e);if(!e||n==null)return null;const r=Array.from(e.childNodes).filter(Vs);if(t==="forward")return r.find(a=>ao(e,a)>=n)??null;for(let a=r.length-1;a>=0;a--)if(ao(e,r[a])<n)return r[a];return null}const fd=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function zee(e){let t="",n="",r=!1;const a=i=>{var f;if(i.nodeType===Node.TEXT_NODE){const h=(i.textContent??"").replace(Ul,"");if(!h)return;t+=h,n+=fd(h),r=!1;return}const l=i,u=(f=l.dataset)==null?void 0:f.tok;if(u){const h=ri(l);t+=(r?" ":"")+h,r=!0,n+=`<span data-sc-tok="${fd(u)}">${fd(h)}</span>`;return}i.childNodes.forEach(a)};return e.cloneContents().childNodes.forEach(a),{text:t,html:`<span data-sc-brief="1">${n}</span>`}}function Bee(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(fd(l));continue}const i=t(a);n.push(i),r.push(`<span data-sc-tok="${fd(g2(a))}">${fd(i)}</span>`)}return{text:n.join(" "),html:`<span data-sc-brief="1">${r.join(" ")}</span>`}}function ri(e){var t;return(((t=e.querySelector(".sc-token-label"))==null?void 0:t.textContent)??"").trim()}function Uee(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(Ul,"");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=ks(u);r.push(f??l.textContent??"")};return n.childNodes.forEach(a),r.length?r:null}function RP(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=df(e);return r.filter((i,l)=>l===r.length-1||!/^[ \n]*$/.test(a.slice(i,r[l+1])))}const df=e=>e.map(t=>t.t==="text"?t.v:"").join(""),xy=(e,t,n)=>{const r=n<=t?e.slice(n,t):e.slice(t+1,n);return/^[ \n]*$/.test(r)};function Wee(e,t){const n=df(e);return RP(e).filter(r=>!xy(n,t,r))}function Kee(e,t){return e.find(n=>n>=t)??(e.length?e[e.length-1]:null)}function Gee(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 PP(e,t,n){if(!e||!t.parentNode)return!1;const r=ao(e,t);if(xy(df(v2(e)),r,n))return!1;let a=null,i=0;for(const l of Array.from(e.childNodes)){const u=Cd(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(zp(l,f))}else a=n===i?l:l.nextSibling;break}i+=u}return a===t?!1:(t.remove(),e.insertBefore(t,a),Co(e),!0)}function e9(e,t,n){if(!e)return!1;const r=ao(e,t),a=Wee(v2(e),r),i=n===-1?[...a].reverse().find(l=>l<r):a.find(l=>l>r+1);return i===void 0?!1:PP(e,t,i)}function Yee(e,t){if(!e)return t;const n=df(v2(e));let r=t;for(;r>0&&(n[r-1]===" "||n[r-1]===`
|
|
102
|
+
`);)r-=1;return r}function t9(e,t,n,r){if(!e)return null;const a=Dee(e,n,r);if(!a)return null;const i=v2(e),l=ao(e,t),u=RP(i),f="beside"in a?ao(e,a.beside)+(a.side==="before"?0:1):a.node.nodeType===Node.TEXT_NODE||a.node===e?Bp(e,a.node,a.offset):null;if(f===null)return null;const h="beside"in a&&a.side==="after"?Kee(u,f):Gee(u,f);return h===null?null:{units:h,noop:xy(df(i),l,h)}}function X4(e,t){const n=ri(t)||"the chip",r=qee(t);if(r)return`Moved ${n} before ${r}.`;const a=Xee(t);return a?`Moved ${n} after ${a}.`:ao(e,t)===0?`Moved ${n} to the start of the brief.`:`Moved ${n} to the end of the brief.`}const LP=3;function qee(e){for(let t=e.nextSibling;t;t=t.nextSibling){if(Vs(t))return ri(t)||null;const n=(t.textContent??"").replace(Ul,"").trim();if(n)return`"${n.split(/\s+/).slice(0,LP).join(" ")}"`}return null}function Xee(e){for(let t=e.previousSibling;t;t=t.previousSibling){if(Vs(t))return ri(t)||null;const n=(t.textContent??"").replace(Ul,"").trim();if(n)return`"${n.split(/\s+/).slice(-LP).join(" ")}"`}return null}function v2(e){const t=[];let n="";for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.TEXT_NODE){n+=(r.textContent??"").replace(Ul,"");continue}n&&(t.push({t:"text",v:n}),n=""),t.push({t:"ref",imageHash:""})}return n&&t.push({t:"text",v:n}),t}function Q4(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 S0=e=>(e==null?void 0:e.querySelector('[data-kind="template"]'))??null,rl=e=>{var t;return((t=e==null?void 0:e.closest)==null?void 0:t.call(e,uf))??null};function Q8(e,t,n={}){var a;if(!e)return!1;let r=!1;for(let i=0;i<32;i++){const l=Jee(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)};nte(e,l.node,l.start,l.end,t(u)),r=!0}return r&&Co(e),r}function Qee(e,t){var i;e.dataset.kind="color",e.dataset.tok=g2(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 Jee(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=tte(a.textContent??"",t,(u,f)=>ete(a,f,u)),l=i[i.length-1];if(l)return{node:a,...l}}return null}function ete(e,t,n){if(n>0)return Wp(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||Wp(a[a.length-1]??"")}return!0}function tte(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=dQ(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 nte(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&&Po(e,g,Math.min(h,(g.textContent??"").length));return}if(h<=r||!u.length){Po(e,t,t.length);return}Po(e,t,Math.min(h-r,t.length))}}function hd(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 rte(){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 E0="data-sc-coach-inert",ste=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function ate(e=document.body){let t=new Set;const n=a=>{a.hasAttribute("inert")&&!a.hasAttribute(E0)||(a.setAttribute(E0,""),a.setAttribute("inert",""))},r=a=>{a.hasAttribute(E0)&&(a.removeAttribute(E0),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)||ste.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(E0)))},release(){for(const a of t)r(a);t=new Set}}}const dp=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),mi=e=>e.right-e.left,No=e=>e.bottom-e.top;function TP(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 C0(e,t){return{left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}}function n9(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 $P(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function r9(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 mi(n)>0&&No(n)>0?n:null}function s9(e,t){let{top:n,bottom:r}=e;const a=(e.top+e.bottom)/2;for(const i of t)$P(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 ote=e=>e==="top"||e==="bottom";function ite(e,t,n){return t?ote(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 a9=e=>e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left",Os=e=>Math.round(e*2)/2;function lte(e,t,n){const r=Os(t),a=Os(n),i=e.map(u=>{const f=Math.max(0,Os(mi(u))),h=Math.max(0,Os(No(u))),p=Os(Math.max(0,Math.min(u.radius,f/2,h/2)));return`<rect x='${Os(u.left)}' y='${Os(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 cte(e,t,n,r){const a=Os(t),i=Os(n),l=e.map(p=>{const g=Math.max(0,Os(mi(p))),m=Math.max(0,Os(No(p))),w=Os(Math.max(0,Math.min(p.radius,g/2,m/2)));return{x:Os(p.left),y:Os(p.top),ww:g,hh:m,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 ute(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=>mi(a)>0&&No(a)>0)}const o9=0,dte=10,J8=14,j0=4,e6="data-guide-stage",fte="rgba(255,255,255,0.05)",J4="[data-guide-shape]",i9=[],hte="[data-radix-popper-content-wrapper], .sc-setpop, .sc-morepop, .sc-shotsheet, .sc-note-pop",l9='input, textarea, [contenteditable]:not([contenteditable="false"])',pte=17,Fh=12,mte=20,gte=450,vte=768,c9=90,wte=8,u9=12,yte=2e3,bte=".sc-topbar, .sc-tabbar, .sc-filterbar, .sc-canvas-dock, .sc-help-float, .sc-pstudio-head, .sc-newdlg-head",xte=120,kte="[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",t6=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 Ste(e){const{id:t,voice:n,target:r,live:a,side:i,container:l,onShown:u}=e,f=e.lit??i9,h=e.also??i9,p=n==="ask",g=!r,m=!!(e.title||e.body),w=s.useId(),y=s.useId(),b=s.useRef(null),S=s.useRef(null),k=s.useRef(null),C=s.useRef(null),E=s.useRef(null),A=s.useRef(null),L=s.useRef(null),$=s.useRef(null),N=s.useRef(null),j=s.useRef(null),[P,R]=s.useState("moving"),[H]=s.useState(Mte),[D,U]=s.useState(()=>t6(e)),_=s.useRef(e);_.current=e;const B=s.useRef(!1),K=s.useRef(null),V=s.useRef([]),O=P==="shown"&&D.id===t?t6(e):D,I=n6(a),Y=n6(h),Z=n6(f);s.useEffect(()=>{if(p)return j.current=ate(l),()=>{var z;(z=j.current)==null||z.release(),j.current=null;for(const J of V.current)J.removeAttribute(e6);V.current=[]}},[p,l]),s.useLayoutEffect(()=>{var Zt,jt,Ft;const z=b.current,J=S.current,he=k.current,te=C.current,me=E.current,re=A.current;if(p&&(!he||!te||!me||!re)||m&&(!z||!J))return;let ee=!0,q=0,ie=0,Oe=!1,ae=!1,pe="",Te=0,gt=0,Ze=0,tt=null,De=null,Se=null;const Q=window.matchMedia("(prefers-reduced-motion: reduce)").matches,je=a[0]??r??l;let Re="",se=r?_h(r):null;R("moving");const G=()=>{var Pt;return(Pt=j.current)==null?void 0:Pt.set([...z?[z]:[],...he?[he]:[],...te?[te]:[],...me?[me]:[],...re?[re]:[],...a,...h,...[...document.querySelectorAll(kte)].filter($t=>![...a,...h].some(ke=>$t.contains(ke)))])},oe=()=>{var Pt,$t;(Pt=j.current)==null||Pt.release(),ae=!1,R("away"),($t=r??a[0])!=null&&$t.isConnected&&st()};if(p&&j.current&&B.current){G(),ae=!0;const Pt=a.find(ke=>ke.matches(l9)),$t=document.activeElement;Pt&&!a.some(ke=>ke.contains($t))&&d9(Pt)}const Ne=async()=>{const Pt=++q;if(r&&!r.isConnected||a.some(ne=>!ne.isConnected))return oe(),_.current.onLost();const $t=window.innerWidth,ke=window.innerHeight,Je=window.visualViewport,Et=[{left:0,top:0,right:$t,bottom:ke},...Je?[{left:Je.offsetLeft,top:Je.offsetTop,right:Je.offsetLeft+Je.width,bottom:Je.offsetTop+Je.height}]:[]],Xe=ne=>{const ce=ne===r?se:_h(ne);return ce?[...Et,dp(ce.getBoundingClientRect())]:Et},rt=Ete(je,l),nt=rt.filter(ne=>mi(ne)>$t/3),qt=r?r9(dp(r.getBoundingClientRect()),Xe(r)):null,Yt=qt&&s9(qt,nt);if(r&&!Yt)return!Oe&&Ze<u9&&(Ze++,se=_h(r),r6(r,se,Q).then(()=>ee&&Pe())),oe();const an=[],Wt=[];for(const ne of[...r?[r]:[],...a,...h,...f,...f9()]){const ce=h9(ne);Wt.includes(ce)||Wt.push(ce)}const Rn=new Set([...r?[r]:[],...a,...f,...f9()].map(h9));let Bt=null;for(const ne of Wt){const ce=r9(dp(ne.getBoundingClientRect()),Xe(ne)),ue=ce&&s9(ce,nt);if(!ue)continue;const ze=fp(ne);an.push(ze>=4||ne.matches("img, video, canvas")?{...C0(ue,o9),radius:ze+o9}:{...C0(ue,dte),radius:J8}),Rn.has(ne)&&(Bt=Bt?TP(Bt,ue):ue)}if(!g&&!Yt&&!Bt)return oe();if(ae&&(a.some(ne=>ne.closest("[inert]"))||z!=null&&z.closest("[inert]"))&&(ae=!1),p&&he&&te&&me&&re){if(!an.length&&Yt){const ue=r,ze=p9(ue);an.push({...C0(Yt,j0),radius:n9(fp(ue),ze.radius,j0,J8,No(Yt),ze.height,ze.count)})}for(const ue of V.current)Wt.includes(ue)||ue.removeAttribute(e6);for(const ue of Wt)ue.setAttribute(e6,"");V.current=Wt;const ce=`${an.map(ue=>[ue.left,ue.top,ue.right,ue.bottom,ue.radius].map(Math.round).join(",")).join("|")}@${$t}x${ke}`;if(ce!==Re&&(Re=ce,Nte(he,te,re,an,H)),r&&Yt){const ue=Tte(r),ze=p9(r),Ve=ue??C0(Yt,j0);Object.assign(me.style,{left:`${Ve.left}px`,top:`${Ve.top}px`,width:`${mi(Ve)}px`,height:`${No(Ve)}px`,borderRadius:`${ue?Lte:n9(fp(r),ze.radius,j0,J8,No(Yt),ze.height,ze.count)}px`}),me.hidden=!1}else me.hidden=!0}if(z&&document.documentElement.style.setProperty("--sc-coach-h",`${Math.round(z.offsetHeight)}px`),z&&g&&(z.style.right="",z.style.left=`${Math.round(($t-z.offsetWidth)/2)}px`,z.style.top=`${Math.round((ke-z.offsetHeight)/2)}px`,z.dataset.side="centre",J&&(J.hidden=!0)),z&&J&&r&&Yt){z.style.right="";const ne={top:Fh+Cte(rt,ke),bottom:Fh+jte(rt,ke),left:Fh,right:Fh},ce=$t>=vte;De!==ce&&(De!==null&&r&&(se=_h(r),r6(r,se,Q)),tt=null,De=ce);const ue=i==="left"||i==="right"?"top":i,ze=!ce&&mi(Yt)>$t*.6,Ve=ce?i:ze?`${ue}-start`:ue,xt=($e,qe)=>lA(Ate($e,r),z,{strategy:"fixed",placement:tt??Ve,middleware:[aA(pte),iA({padding:ne,fallbackPlacements:qe}),oA({padding:ne}),n4({element:J,padding:mte})]}),yt=!ce&&Bt?{...Yt,top:Bt.top,bottom:Bt.bottom}:Yt,kt=($e,qe)=>$P({left:$e,top:qe,right:$e+z.offsetWidth,bottom:qe+z.offsetHeight},C0(yt,j0)),Ae=ce&&(i==="left"||i==="right")?[a9(i),"top","bottom"]:ce?void 0:ze?["bottom-start","top-start"]:["bottom","top"],ve=!p&&No(Yt)>ke*.6,et=ce&&(e.beside||a.length>1),Ct=ve?{...Yt,top:Yt.bottom-1}:et?ite(Yt,Bt,i):yt;let xe=await xt(Ct,ve?["top"]:Ae);if(!ee||Pt!==q||!ve&&kt(xe.x,xe.y)&&(xe=await xt(yt,void 0),!ee||Pt!==q))return;if(!ve&&kt(xe.x,xe.y))return R("stowed");tt=xe.placement;const it=xe.placement.split("-")[0];z.style.left=`${Math.round(xe.x)}px`,z.style.top=`${Math.round(xe.y)}px`,z.dataset.side=it;const wt=xe.middlewareData.arrow;J.dataset.edge=a9(it),J.style.left=(wt==null?void 0:wt.x)!=null?`${wt.x}px`:"",J.style.top=(wt==null?void 0:wt.y)!=null?`${wt.y}px`:"",J.hidden=!wt||Math.abs(wt.centerOffset)>1}if(p&&!ae&&(G(),ae=!0),!Oe){if($te([...r?[r]:[],...a])&&++gt<u9){window.setTimeout(Pe,c9);return}const ne=[...r?[r]:[],...a,...h,...f].map(ce=>{const ue=ce.getBoundingClientRect();return[ue.left,ue.top,ue.right,ue.bottom].map(Math.round).join(",")}).join("|");if(ne!==pe&&(pe=ne,Te=0),++Te<2&&Te<wte){window.setTimeout(Pe,c9);return}}R("shown"),Oe||(Oe=!0,Ie(),st())};let Ue=0;const st=()=>{const Pt=r??a[0];if(!Pt)return;cancelAnimationFrame(Ue);let $t=Pt.getBoundingClientRect();const ke=performance.now()+yte,Je=()=>{if(!ee)return;const Et=Pt.getBoundingClientRect();(Et.top!==$t.top||Et.left!==$t.left||Et.height!==$t.height)&&($t=Et,Pe()),performance.now()<ke&&(Ue=requestAnimationFrame(Je))};Ue=requestAnimationFrame(Je)},Pe=()=>{cancelAnimationFrame(ie),ie=requestAnimationFrame(()=>void Ne())},Ie=()=>{B.current=!0;let Pt=!1;if(p&&z){const $t=Et=>!!Et&&a.some(Xe=>Xe.contains(Et)),ke=document.activeElement,Je=a.find(Et=>Et.matches(l9))??null;N.current&&$t(ke)?N.current=null:N.current?(((N.current==="back"?L.current:null)??$.current??z).focus({preventScroll:!0}),N.current=null):Je&&!$t(ke)?d9(Je):(!ke||ke===document.body||ke.closest("[inert]"))&&(z.focus({preventScroll:!0}),Pt=!0)}u(t,Pt)},Ge=B.current&&!Q&&m&&K.current!==t?xte:0;K.current=t,Rte(Ge).then(()=>{if(ee)return Ur.flushSync(()=>U(t6(_.current))),r?r6(r,se,Q):void 0}).then(()=>{ee&&(Se=sA(je,z??he??je,Pe))});const ft=new ResizeObserver(Pe);for(const Pt of a)ft.observe(Pt);r&&ft.observe(r),z&&ft.observe(z);for(const Pt of[...r?[r]:[],...a]){const $t=(Zt=Pt==null?void 0:Pt.closest)==null?void 0:Zt.call(Pt,J4);$t&&ft.observe($t)}(jt=window.visualViewport)==null||jt.addEventListener("resize",Pe),(Ft=window.visualViewport)==null||Ft.addEventListener("scroll",Pe);let bt=0;const at=p?new MutationObserver(()=>{ae&&(cancelAnimationFrame(bt),bt=requestAnimationFrame(G))}):null;return at==null||at.observe(l,{childList:!0,subtree:!0}),()=>{var Pt,$t;ee=!1,document.documentElement.style.removeProperty("--sc-coach-h"),cancelAnimationFrame(ie),cancelAnimationFrame(Ue),cancelAnimationFrame(bt),at==null||at.disconnect(),Se==null||Se(),ft.disconnect(),(Pt=window.visualViewport)==null||Pt.removeEventListener("resize",Pe),($t=window.visualViewport)==null||$t.removeEventListener("scroll",Pe)}},[t,p,m,r,I,Y,Z,i,l,u,H]),s.useEffect(()=>{if(!m||!r||!Pte(r))return;const z=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);if(!z.includes(y))return r.setAttribute("aria-describedby",[...z,y].join(" ")),()=>{const J=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(he=>he&&he!==y);J.length?r.setAttribute("aria-describedby",J.join(" ")):r.removeAttribute("aria-describedby")}},[m,r,y]);const{onEscape:X}=e;return s.useEffect(()=>{if(!p)return;const z=ee=>!!ee&&a.some(q=>q.contains(ee)),J=ee=>{var pe;const q=b.current,ie=ee.target instanceof Node?ee.target:null,Oe=z(ie),ae=document.activeElement;if(ee.key==="Escape"){if(ee.defaultPrevented||ae!=null&&ae.closest('[role="dialog"]:not(.sc-coach):not(.sc-attachpanel)')||Oe&&(ae!=null&&ae.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="listbox"]')))return;ee.preventDefault(),ee.stopPropagation(),X(t);return}Oe||(!ie||ie===document.body||ie===document.documentElement||q!=null&&q.contains(ie)||(pe=C.current)!=null&&pe.contains(ie))&&ee.stopPropagation()};let he=0,te=!1;const me=ee=>{te=ee.target instanceof Node&&z(ee.target)},re=ee=>{ee.relatedTarget||te||!b.current||(cancelAnimationFrame(he),he=requestAnimationFrame(()=>{var ie;if(!document.hasFocus())return;const q=document.activeElement;(!q||q===document.body||q.closest("[inert]"))&&((ie=b.current)==null||ie.focus({preventScroll:!0}))}))};return window.addEventListener("keydown",J,!0),window.addEventListener("pointerdown",me,!0),document.addEventListener("focusout",re,!0),()=>{cancelAnimationFrame(he),window.removeEventListener("keydown",J,!0),window.removeEventListener("pointerdown",me,!0),document.removeEventListener("focusout",re,!0)}},[t,p,I,X]),Ur.createPortal(o.jsxs(o.Fragment,{children:[p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:k,className:"sc-coach-veil","data-veil":H?"mask":"panels","data-soft":e.soft||void 0,"data-state":P,"aria-hidden":"true",children:g9.map(z=>o.jsx("div",{className:"sc-coach-panel"},z))}),o.jsx("div",{ref:C,className:"sc-coach-catch","data-guide":"catch","data-state":P,"aria-hidden":"true",onMouseDown:z=>z.preventDefault(),children:g9.map(z=>o.jsx("div",{className:"sc-coach-catch-part"},z))}),o.jsx("div",{ref:A,className:"sc-coach-rim","data-state":P,"aria-hidden":"true"}),o.jsx("div",{ref:E,className:"sc-coach-ring","data-state":P,"aria-hidden":"true",hidden:!0})]}),m&&o.jsxs("div",{ref:b,className:"sc-coach","data-guide":"card","data-voice":p?"coach":"card","data-beside":e.beside||void 0,...p?{role:"dialog","aria-labelledby":O.title?w:void 0}:{role:"note"},"aria-describedby":y,tabIndex:-1,"data-state":P,children:[o.jsx("div",{ref:S,className:"sc-coach-arrow","aria-hidden":"true",hidden:!0}),o.jsxs("div",{className:"sc-coach-head",children:[O.title?o.jsx("h2",{id:w,className:"sc-coach-title",children:O.title}):o.jsx("p",{id:y,className:"sc-coach-body","data-lead":"",children:O.body}),O.count&&o.jsxs("p",{className:"sc-coach-count",children:[o.jsx("span",{className:"sc-vh",children:"Step "}),O.count]}),o.jsx(hr,{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})})})]}),O.title&&O.body&&o.jsx("p",{id:y,className:"sc-coach-body",children:O.body}),(O.canBack||O.action)&&o.jsxs("div",{className:"sc-coach-foot",children:[O.canBack&&o.jsx("button",{ref:L,type:"button",className:"sc-coach-back",onClick:()=>{N.current="back",e.onBack(t)},children:"Back"}),O.action&&o.jsx("button",{ref:$,type:"button",className:"sc-btn sc-btn-primary sc-coach-next",onClick:()=>{N.current="action",e.onAction(t)},children:O.action.label})]})]})]}),l)}function d9(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}wc(e)}function f9(){return[...document.querySelectorAll(hte)].filter(e=>e.getClientRects().length>0)}function n6(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 Ete(e,t){const n=[];for(const r of document.querySelectorAll(bte))t.contains(r)&&(r.contains(e)||e.contains(r)||r.getClientRects().length===0||n.push(dp(r.getBoundingClientRect())));return n}function Cte(e,t){return Math.max(0,...e.filter(n=>n.top<=0&&n.bottom<t/3).map(n=>n.bottom))}function jte(e,t){return Math.max(0,...e.filter(n=>n.bottom>=t&&n.top>t*2/3).map(n=>t-n.top))}function Ate(e,t){const n={x:e.left,y:e.top,left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:mi(e),height:No(e)};return{getBoundingClientRect:()=>n,contextElement:t}}function Nte(e,t,n,r,a){const i=window.innerWidth,l=window.innerHeight,u=r.reduce((h,p)=>h?TP(h,p):p,null),f=u?ute(u,i,l):[];if(a){const h=lte(r,i,l),p=e.style;p.maskImage=h,p.webkitMaskImage=h,n.style.backgroundImage=cte(r,i,l,fte)}else m9(e,f);m9(t,f)}function fp(e){return Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||0}function h9(e){return e.closest(J4)??e.querySelector(J4)??e}function p9(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,fp(a)),n=Math.max(n,a.getBoundingClientRect().height));return{radius:t,height:n,count:r}}function m9(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:`${mi(a)}px`,height:`${No(a)}px`})})}const g9=[0,1,2,3];function Mte(){return typeof CSS>"u"?!1:CSS.supports("mask-image",'url("x.svg")')||CSS.supports("-webkit-mask-image",'url("x.svg")')}function _h(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 r6(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,gte)})}function Rte(e){return e>0?new Promise(t=>window.setTimeout(t,e)):Promise.resolve()}function Pte(e){return e.matches('button, a[href], input, select, textarea, [tabindex], [contenteditable="true"]')}const Lte=10;function Tte(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 $te(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 ur=e=>e.kind==="question"?`q:${e.question.id}`:`${e.kind}:${e.id}`;function Dte(e){const t=e[e.length-1];return(t==null?void 0:t.kind)!=="question"||t.question.kind!=="confirm"||t.question.quiet||t.question.noEnter||e.some(r=>r.kind==="question"&&r.question.reopened||r.kind==="you"&&r.editing)?null:t.question}const ff=320,ky=180,Hte=28,Ote=700;function w2(e){const t=e.split(/(\s+)/).filter(a=>a.length>0),n=t.filter(a=>!/^\s+$/.test(a)).length,r=Math.min(Hte,Math.floor(Ote/Math.max(1,n)));return{words:t,step:r,total:ff+ky+r*n+160}}function s6(e,t){return e.every(n=>!!t[n.id])}function Ite(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 Fte(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const _te=/^(hi|hello|hey|heya|hiya|yo|hola|shalom|sup|good (morning|afternoon|evening)|thanks|thank you|thx|cheers)\b/i,Vte=/^(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,Zte=/^(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,zte=/^(start over|start again|restart|reset|cancel|stop|quit|exit|go back|back|undo|never ?mind|forget it|close)\b/i,Bte=/^(skip|next|continue|go|go on|proceed|generate|draw|render|build|show me|show|try|do it|let'?s go|begin|start)\b/i,v9=/^(help|help me|how does this work|what do i do|what should i (write|say|type)|instructions|\?+)[\s!.,?]*$/i,Ute=/\b(presenters?|avatars?|characters?|Scenri|create|creating|generate|generating|images?|pictures?|shoot|campaign|brand|product)\b/i,Wte=/^(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,Kte=/^[b-df-hj-np-tv-xz]{3,}$/i,Gte=/(.)\1{3,}/,Yte=/\b(like|as|resembling|resembles|similar to|looks? like|looking like)\s+([A-Z][a-z]+)(?:\s+[A-Z][a-z]+)*\b/,qte=/^(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 oi(e,t){const n=e.trim();if(!n)return null;const r=Yte.exec(n);if(r&&!qte.test(r[2]))return"likeness";if(t(n))return null;if(!new RegExp("\\p{L}","u").test(n))return v9.test(n)?"help":"nonsense";const a=n.split(/\s+/).filter(Boolean),i=a.length;if(v9.test(n))return"help";if(_te.test(n)&&i<=4)return"greeting";if(Vte.test(n))return"ack";const l=u=>u.replace(/[^a-z]/gi,"");return i<=8&&a.some(u=>Wte.test(l(u))||Kte.test(l(u))||Gte.test(l(u)||u))?"nonsense":Zte.test(n)||/\?\s*$/.test(n)?"question":zte.test(n)&&i<=4?"nav":Ute.test(n)&&i<=10?"intent":Bte.test(n)&&i<=4?"go":i===1&&/^[A-Z][a-z]+$/.test(n)?null:i<=2?"vague":null}const Xte=e=>`aside-said-${e}`,w9=e=>e.startsWith("aside-said-")?e.slice(11):null,Ci=(e,t=!1,n=!1)=>[...n?[]:[{kind:"you",id:Xte(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}],Kp=e=>(e.kind==="you"||e.kind==="scenri")&&e.id.startsWith("aside-");function DP(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question.id;if(!Kp(n))return null}return null}const Gp=()=>new Date().toISOString();function Qte({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 Jte({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,m=Number.parseFloat(getComputedStyle(p).columnGap)||0,w=g?g.offsetWidth+m: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(y9,{dir:-1,live:r.back,onGo:l}),o.jsx("div",{className:"sc-convo-plates",ref:n,children:t}),f&&o.jsx(y9,{dir:1,live:r.on,onGo:l})]})}function y9({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(Ha,{size:14,weight:"bold"}):o.jsx(Rl,{size:14,weight:"bold"})})}const ene=106;function b9({options:e,picked:t,onPick:n}){return o.jsx(Jte,{step:ene,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 HP=6e4,tne=60*HP,a6=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),nne=e=>e.toLocaleDateString([],{day:"numeric",month:"short"});function rne(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 sne(e,t=Date.now()){const n=Math.max(0,t-e);if(n<45e3)return"just now";if(n<tne)return`${Math.max(1,Math.round(n/HP))} min ago`;const r=new Date(e),a=rne(r,new Date(t));return a===0?a6(r):a===1?`Yesterday ${a6(r)}`:`${nne(r)} ${a6(r)}`}const ane=e=>new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"});function one({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:m,current:w,restore:y,onRestore:b,retry:S,onRetry:k,onShow:C}){const[E]=s.useState(l),A=Ey(u,E),{playing:L,thinking:$}=VP(a,e,E,A==="true");return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"scenri","data-arrive":L||void 0,"data-leave":A,"data-turn":f,"data-dim":h||void 0,style:L?{...OP(E),"--sc-convo-after":`${w2(e).total}ms`}:void 0,children:[i&&o.jsx(Sy,{thinking:$,at:n,now:r}),o.jsxs("p",{className:"sc-convo-say","data-tone":t,"data-reveal":L||void 0,children:[$&&o.jsx(FP,{}),o.jsx(_P,{text:e,playing:L})]}),p&&o.jsxs("span",{className:"sc-convo-shot","data-reveal":L||void 0,"data-current":w||void 0,children:[m&&C?o.jsx("button",{type:"button",className:"sc-convo-shot-pick","aria-label":g?`Show ${g} on the stage`:"Show this on the stage",onClick:()=>C(m),children:o.jsx(x9,{thumb:p,label:g,current:w})}):o.jsx(x9,{thumb:p,label:g,current:w}),y&&b?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>b(y.view,y.hash),children:"Put back"}):S&&k?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>k(S),children:"Try again"}):w&&o.jsx("span",{className:"sc-convo-shot-do",children:"Active"})]})]})}const OP=e=>({"--sc-convo-start":`${e}ms`,"--sc-convo-think":`${ff}ms`});function Sy({thinking:e,at:t,now:n}){return o.jsxs("span",{className:"sc-convo-who","data-thinking":e||void 0,"aria-hidden":"true",children:[o.jsx(ZX,{className:"sc-convo-mark"}),"Scenri",t?o.jsx(IP,{at:t,now:n}):null]})}function IP({at:e,now:t}){return o.jsx("time",{className:"sc-convo-time",dateTime:new Date(e).toISOString(),title:ane(e),children:sne(e,t)})}function ine({what:e="Thinking"}){return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-working":"true",children:[o.jsx(Sy,{thinking:!0}),o.jsx("p",{className:"sc-convo-say",children:o.jsxs("span",{className:"sc-convo-work",children:[e,o.jsx(lne,{})]})})]})}function lne(){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 FP(){return o.jsxs("span",{className:"sc-convo-dots","aria-hidden":"true",children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]})}function _P({text:e,playing:t}){const n=s.useRef(t);if(t&&(n.current=!0),!n.current)return o.jsx(o.Fragment,{children:e});const{words:r,step:a}=w2(e);let i=0,l=0;return o.jsx(o.Fragment,{children:r.map(u=>{const f=l;if(l+=u.length,/^\s+$/.test(u))return u;const h=i++;return o.jsx("span",{className:"sc-convo-w",style:{"--sc-convo-word-delay":`${h*a}ms`},children:u},`${f}:${u}`)})})}function VP(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+w2(t).total),p=setTimeout(()=>u(!1),n+ff);return()=>{clearTimeout(h),clearTimeout(p)}},[a,t,n]),{playing:a&&!r,thinking:a&&l&&!r}}function Ey(e,t,n=ff+ky){const r=s.useRef(performance.now());if(e)return performance.now()-r.current<t+n?"early":"true"}function x9({thumb:e,label:t,current:n}){return o.jsx("img",{src:vn(e,"micro"),srcSet:`${vn(e,"micro")} 160w, ${vn(e,"small")} 320w, ${vn(e,"tile")} 640w`,sizes:"(max-width: 767px) 248px, 128px",alt:n&&t?`${t}, active`:t??""})}const cne=300,une=e=>typeof e=="string"?e:null,dne=e=>Array.isArray(e)?e:[],fne=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};function hne({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:m,onStarter:w,onDescribe:y,onAttachFiles:b,onCancel:S}){var re,ee,q,ie,Oe;const[k]=s.useState(a),C=Ey(i,k),{playing:E,thinking:A}=VP(t,e.prompt,k,C==="true"),L="given"in e?e.given:void 0,[$,N]=s.useState(()=>fne(L)),[j,P]=s.useState(null),[R,H]=s.useState(()=>new Set(dne(L))),D=!!l||!!n,U=s.useRef(!1);s.useEffect(()=>{U.current&&!D&&P(null),U.current=D},[D]),s.useEffect(()=>{e.attempt&&P(null)},[e.attempt]);const _=(ae,pe)=>{j||(P(ae),m==null||m(e.id,{picked:ae,picks:$}),g(pe))},B=j??une(L),K=s.useRef(null),V=s.useRef(null),O=s.useRef(()=>{});O.current=()=>{e.kind==="pick"&&e.more&&!e.loading&&g({kind:"pick",action:{type:"more"}})};const I=e.kind==="pick"?e.items.length:0,Y=e.kind==="pick"&&!!e.more;s.useEffect(()=>{const ae=V.current,pe=K.current;if(!ae||!pe||!Y||typeof IntersectionObserver>"u")return;const Te=new IntersectionObserver(gt=>gt.some(Ze=>Ze.isIntersecting)&&O.current(),{root:pe,rootMargin:"0px 0px 240px 0px"});return Te.observe(ae),()=>Te.disconnect()},[I,Y]);const Z=I>0;s.useLayoutEffect(()=>{const ae=K.current;if(!ae||!Z||typeof ResizeObserver>"u")return;const pe=()=>{const gt=ae.querySelector(".sc-convo-plate");gt&&ae.style.setProperty("--sc-pick-row",`${gt.getBoundingClientRect().height}px`)};pe();const Te=new ResizeObserver(pe);return Te.observe(ae),()=>Te.disconnect()},[Z]);const X=e.kind==="pick"?(re=e.search)==null?void 0:re.value:void 0;s.useEffect(()=>{K.current&&(K.current.scrollTop=0)},[X]);const z=w2(e.prompt),J=`sc-convo-q-${e.id}`,he=s.useRef(null),te=e.reopened&&S&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost sc-convo-cancel",onClick:S,children:"Cancel"}),me="attach"in e&&e.attach&&b&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass",onClick:()=>{var ae;return(ae=he.current)==null?void 0:ae.click()},children:[o.jsx(YF,{size:14,weight:"bold"}),e.attach]}),o.jsx("input",{ref:he,type:"file",accept:"image/*",hidden:!0,"aria-label":e.attach,onChange:ae=>{const pe=Array.from(ae.target.files??[]).filter(Te=>Te.type.startsWith("image/"));ae.target.value="",pe.length&&b(pe)}})]});return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-arrive":E||void 0,"data-leave":C,"data-turn":u,"data-dim":f||void 0,"data-reopened":e.reopened||void 0,style:E?{...OP(k),"--sc-convo-after":`${z.total}ms`}:void 0,children:[!e.reopened&&r&&o.jsx(Sy,{thinking:A,at:h,now:p}),!e.reopened&&o.jsxs("p",{className:"sc-convo-say",id:J,"data-tone":e.tone,"data-reveal":E||void 0,children:[A&&o.jsx(FP,{}),o.jsx(_P,{text:e.prompt,playing:E})]}),e.reopened&&o.jsx("span",{id:J,hidden:!0,children:e.prompt}),!e.reopened&&e.hint&&o.jsx("p",{className:"sc-convo-hint","data-reveal":E||void 0,children:e.hint}),o.jsxs("fieldset",{className:"sc-convo-q","aria-labelledby":J,hidden:e.kind==="text"&&!((ee=e.starters)!=null&&ee.length)&&!e.cost&&!e.note?!0:void 0,tabIndex:-1,"data-kind":e.kind,"data-reveal":E||void 0,"data-picked":!!j||void 0,disabled:n||void 0,children:[e.starters&&e.starters.length>0&&o.jsx("div",{className:"sc-convo-starters",children:e.starters.map(ae=>o.jsx(hr,{label:ae.text,children:o.jsx("button",{type:"button",className:"sc-convo-starter",onClick:()=>w==null?void 0:w(ae.text),children:ae.label})},ae.text))}),e.kind==="choice"&&((q=e.options)==null?void 0:q.some(ae=>ae.card))&&o.jsx(b9,{options:e.options,picked:B,onPick:ae=>_(ae,{kind:"choice",id:ae})}),e.kind==="choice"&&e.options&&!e.groups&&!e.options.some(ae=>ae.card)&&o.jsx("div",{className:"sc-convo-choices sc-convo-ask","data-guide-shape":"",children:e.options.map(ae=>o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice","aria-pressed":e.multi?R.has(ae.id):void 0,"data-on":(e.multi?R.has(ae.id):B===ae.id)||void 0,onClick:()=>e.multi?H(pe=>{const Te=new Set(pe);return Te.delete(ae.id)||Te.add(ae.id),Te}):_(ae.id,{kind:"choice",id:ae.id}),children:ae.label},ae.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":j==="skip"||!j&&e.skipped||void 0,onClick:()=>_("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}),me,!e.multi&&te]}),e.kind==="choice"&&!e.groups&&!e.multi&&!e.describe&&!e.attach&&te&&o.jsx("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:te}),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":j==="submit"||void 0,onClick:()=>_("submit",{kind:"choices",picks:Object.fromEntries([...R].map(ae=>[ae,"on"]))}),children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),te]}),e.kind==="choice"&&e.groups&&o.jsxs("div",{className:"sc-convo-groups",children:[e.groups.map(ae=>o.jsxs("div",{className:"sc-convo-group",children:[o.jsx("span",{className:"sc-convo-group-lb",id:`sc-convo-g-${e.id}-${ae.id}`,children:ae.label}),o.jsx(si,{label:ae.label,value:$[ae.id]??"",ids:ae.options.map(pe=>pe.id),onChange:pe=>N(Te=>({...Te,[ae.id]:pe})),className:"sc-convo-choices",children:ae.options.map(pe=>o.jsx(ai,{id:pe.id,on:$[ae.id]===pe.id,label:pe.label,className:"sc-chip sc-convo-choice",onPick:()=>N(Te=>({...Te,[ae.id]:pe.id})),children:pe.label},pe.id))})]},ae.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":!s6(e.groups,$)||void 0,title:s6(e.groups,$)?void 0:"Pick one in each row, or skip.","data-on":j==="submit"||void 0,onClick:()=>{s6(e.groups??[],$)&&_("submit",{kind:"choices",picks:$})},children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),te]})]}),e.kind==="swatches"&&o.jsxs("div",{className:"sc-convo-look",children:[e.row.options.some(ae=>ae.card)?e.layout==="grid"?o.jsx(Qte,{options:e.row.options,picked:B,onPick:ae=>_(ae,{kind:"swatches",picks:{[e.row.id]:ae}})}):o.jsx(b9,{options:e.row.options,picked:B,onPick:ae=>_(ae,{kind:"swatches",picks:{[e.row.id]:ae}})}):o.jsx("div",{className:"sc-convo-swatches",children:e.row.options.map(ae=>o.jsx(hr,{label:ae.label,children:o.jsx("button",{type:"button",className:ae.color?"sc-convo-swatch":"sc-chip sc-convo-choice",style:ae.color?{"--sc-swatch":ae.color}:void 0,"aria-label":ae.label,"aria-pressed":B===ae.id,"data-on":B===ae.id||void 0,onClick:()=>_(ae.id,{kind:"swatches",picks:{[e.row.id]:ae.id}}),children:ae.color?null:ae.label})},ae.id))}),(e.skip||e.describe||te)&&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":j==="skip"||!j&&e.skipped,"data-on":j==="skip"||!j&&e.skipped||void 0,onClick:()=>_("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}),te]})]}),e.kind==="photos"&&o.jsxs("div",{className:"sc-convo-photos-q",children:[o.jsx(DR,{hashes:e.hashes,max:e.max,label:((ie=e.drop)==null?void 0:ie.label)??"Add a photo of their face",hint:((Oe=e.drop)==null?void 0:Oe.hint)??"Drop it here, or choose a file",busy:e.busy,onAdd:ae=>g({kind:"photos",action:{type:"add",files:ae}}),onRemove:ae=>g({kind:"photos",action:{type:"remove",hash:ae}}),onReject:()=>g({kind:"photos",action:{type:"reject"}})}),e.instead&&o.jsx("button",{type:"button",className:"sc-convo-other","data-on":j==="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:()=>_("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:ae=>g({kind:"photos",action:{type:"attest",checked:ae.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":!!o6(e)||void 0,title:o6(e)??void 0,"data-on":j==="submit"||void 0,onClick:()=>{o6(e)||_("submit",{kind:"photos",action:{type:"submit"}})},children:e.submit}),e.back&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":j==="back"||void 0,onClick:()=>_("back",{kind:"photos",action:{type:"back"}}),children:e.back}),te]})]}),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:ae=>g({kind:"pick",action:{type:"query",text:ae.target.value}}),onKeyDown:ae=>{var pe;ae.key!=="Escape"||!((pe=e.search)!=null&&pe.value)||(ae.preventDefault(),g({kind:"pick",action:{type:"query",text:""}}))}}),o.jsxs("fieldset",{ref:K,className:"sc-convo-pick-scroll","aria-labelledby":J,"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},(ae,pe)=>o.jsx("span",{className:"sc-convo-plate sc-convo-pick-wait",children:o.jsx("span",{className:"sc-convo-plate-in"})},pe))}),e.items.length>0&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid",children:e.items.map(ae=>o.jsx("button",{type:"button",className:"sc-convo-plate","aria-label":ae.alt,"aria-pressed":B===ae.id,"data-on":B===ae.id||void 0,onClick:()=>_(ae.id,{kind:"pick",action:{type:"pick",id:ae.id}}),children:o.jsx("span",{className:"sc-convo-plate-in",style:{backgroundImage:`url("${vn(ae.hash,"small")}")`}})},ae.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:V,className:"sc-convo-pick-end","aria-hidden":!0})]}),o.jsx("p",{className:"sc-vh",role:"status",children:e.loading?"":e.status??""}),(e.back||te)&&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":j==="back"||void 0,onClick:()=>_("back",{kind:"pick",action:{type:"back"}}),children:e.back}),te]})]}),e.kind==="confirm"&&e.quote&&o.jsx(pne,{text:e.quote,label:e.quoteLabel,folded:e.quoteFolded}),e.kind==="confirm"&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[e.options.map((ae,pe)=>o.jsx("button",{type:"button",className:`sc-btn ${pe===0&&!e.quiet?"sc-btn-primary":"sc-btn-ghost"}`,"data-on":j===ae.id||void 0,onClick:()=>_(ae.id,{kind:"confirm",id:ae.id}),children:ae.label},ae.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}),me,te]}),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 pne({text:e,label:t="The brief",folded:n=!1}){const[r,a]=s.useState(!1),[i,l]=s.useState(!n);return s.useEffect(()=>{if(!r)return;const u=setTimeout(()=>a(!1),1600);return()=>clearTimeout(u)},[r]),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":r||void 0,onClick:()=>{var u;(u=navigator.clipboard)==null||u.writeText(e).then(()=>a(!0),()=>{})},children:[r?o.jsx(Gn,{size:13,weight:"bold"}):o.jsx(bp,{size:13,weight:"bold"}),r?"Copied":"Copy"]})]}),o.jsx("p",{className:"sc-convo-brief-text","data-folded":!i||void 0,children:e}),n&&o.jsx("button",{type:"button",className:"sc-convo-brief-more","aria-expanded":i,onClick:()=>l(u=>!u),children:i?"Show less":"Show all"})]})}function o6(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 mne({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:m,onCancel:w}){const[y]=s.useState(!!l),[b]=s.useState(f),S=Ey(u,y?b: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":S,"data-turn":h,"data-dim":p||void 0,style:y?{"--sc-convo-start":`${b}ms`}:void 0,children:[n?o.jsx(IP,{at:n,now:r}):null,i&&m&&w?o.jsx(gne,{text:e,onSave:m,onCancel:w}):o.jsxs("div",{className:"sc-convo-bubble",children:[a&&g&&o.jsx(hr,{label:"Change this answer",children:o.jsx("button",{type:"button",className:"sc-convo-edit","aria-label":"Change this answer",onClick:g,children:o.jsx(Rd,{size:13})})}),o.jsx("p",{children:e}),t&&t.length>0&&o.jsx("div",{className:"sc-convo-photos",children:t.map((k,C)=>o.jsx("img",{src:vn(k,"micro"),alt:`Yours, ${C+1} of ${t.length}`},k))})]})]})}function gne({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 vne=180,k9=3e3,ZP=460,wne="cubic-bezier(0.22, 1, 0.36, 1)",yne=220,bne=450,xne=48;function kne({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:m,onRetry:w,onShow:y}){var Re;const b=s.useRef(null),S=s.useRef(!0),k=s.useRef(!!a),C=s.useRef(performance.now());k.current&&performance.now()-C.current>k9&&(k.current=!1),s.useEffect(()=>{if(!k.current)return;const se=()=>{k.current=!1},G=window.setTimeout(se,k9);return window.addEventListener("pointerdown",se,{capture:!0}),window.addEventListener("keydown",se,{capture:!0}),()=>{window.clearTimeout(G),window.removeEventListener("pointerdown",se,{capture:!0}),window.removeEventListener("keydown",se,{capture:!0})}},[]);const E=Fte(),A=s.useRef(e),L=s.useRef(null),$=s.useRef(null),N=s.useRef(null),j=s.useRef(null),P=s.useRef(null),R=s.useRef([]),[,H]=s.useState(0),D=s.useRef(new Map),U=s.useRef(0),_=performance.now(),B=s.useRef(!1),K=Cne(e);if(K!==L.current){L.current=K,B.current=!0;const se=j.current&&_<j.current.until?j.current:null,G=se?S9(A.current,se):A.current,oe=new Set(e.map(ur)),Ne=C9(e),Ue=C9(G),st=Pe=>Pe.startsWith("you:")&&Ne.has(Vh(Pe))||Pe.startsWith("q:")&&Ue.has(Pe)&&oe.has(Vh(Pe));if(R.current=G.map(ur).filter(Pe=>!oe.has(Pe)&&!st(Pe)),Ne.size&&!Ue.size){const Pe=Vh([...Ne][0]),Ie=G.find(Ge=>ur(Ge)===Pe);N.current=(Ie==null?void 0:Ie.kind)==="you"?{key:Pe,text:Ie.text}:null}if(Ue.size>0&&Ne.size===0){const Pe=N.current;N.current=null;const Ie=Pe?e.find(bt=>ur(bt)===Pe.key):void 0,Ge=!!Pe&&((Ie==null?void 0:Ie.kind)!=="you"||Ie.text!==Pe.text),ft=e[e.length-1];$.current=Ge&&(ft==null?void 0:ft.kind)==="question"?ur(ft):null}if(!E&&R.current.length){const Pe=R.current.some(ft=>!(se!=null&&se.gone.has(ft))),Ie=se!=null&&se.look&&R.current.includes(`q:${se.look.qid}`)?se.look:null,Ge=P.current??Ie;j.current={from:G,gone:new Set(R.current),look:Ge,until:Pe?_+(P.current?cne:vne):(se==null?void 0:se.until)??_}}else j.current=null;P.current=null,A.current=e}const V=j.current&&_<j.current.until?j.current:null;V||(j.current=null),s.useEffect(()=>{if(!V)return;const se=window.setTimeout(()=>H(G=>G+1),Math.max(0,V.until-performance.now()));return()=>window.clearTimeout(se)},[V]);const O=(se,G)=>{P.current={qid:se,look:G}},I=V?S9(e,V):e,Y=s.useRef(null);if(Y.current===null){const se=r?Mne(r):null;Y.current=se??new Set(a||e.length>2?e.map(ur):[])}const Z=s.useRef(null);Z.current===null&&(Z.current=(r?Ane(r):null)??new Map);const[X,z]=s.useState(()=>Date.now()),J=Math.max(0,...Z.current.values()),he=X-J<36e5;s.useEffect(()=>{if(!he)return;const se=window.setInterval(()=>z(Date.now()),3e4);return()=>window.clearInterval(se)},[he]),$.current&&(Y.current.delete($.current),$.current=null);const te=new Set;for(const se of I){const G=ur(se);se.kind==="question"&&se.question.reopened||Y.current.has(G)||te.add(G)}if(a&&k.current&&te.size){for(const se of te)Y.current.add(se);te.clear()}const me=[];let re=Number.POSITIVE_INFINITY;{const se=new Set(I.map(ur));for(const G of[...D.current.keys()])se.has(G)||D.current.delete(G);for(const G of I){const oe=ur(G);if(!te.has(oe)){me.push(G);continue}let Ne=D.current.get(oe);if(Ne===void 0){const Ue=G.kind==="you"||G.kind==="scenri"&&!!G.quiet;Ne=Math.max(_,Ue?0:U.current,(V==null?void 0:V.until)??0),D.current.set(oe,Ne),U.current=Math.max(U.current,Ne+(Ue?yne:ff+ky))}Ne<=_?me.push(G):re=Math.min(re,Ne-_)}}s.useEffect(()=>{if(re===Number.POSITIVE_INFINITY)return;const se=window.setTimeout(()=>H(G=>G+1),re);return()=>window.clearTimeout(se)},[re]),s.useEffect(()=>{const se=Y.current;if(se){for(const G of R.current)se.delete(G);for(const G of me){if(G.kind==="question"&&G.question.reopened)continue;const oe=ur(G);V!=null&&V.gone.has(oe)||se.add(oe)}r&&Rne(r,se),r&&Z.current&&Nne(r,Z.current)}});const ee=s.useRef(null),q=s.useCallback(()=>{const se=b.current;if(!se)return null;const G=ee.current;return G!=null&&G.isConnected&&G.scrollHeight>G.clientHeight?G:(ee.current=ev(se),ee.current)},[]);s.useEffect(()=>{const se=()=>{const G=q();G&&(S.current=G.scrollHeight-G.scrollTop-G.clientHeight<24)};return document.addEventListener("scroll",se,{passive:!0,capture:!0}),()=>document.removeEventListener("scroll",se,{capture:!0})},[q]);const ie=(()=>{const se=e.find(oe=>oe.kind==="question"&&oe.question.reopened);if(se)return ur(se);const G=e.find(oe=>oe.kind==="you"&&oe.editing);return G?ur(G):null})();s.useLayoutEffect(()=>{var oe;if(!S.current||ie)return;const se=document.activeElement;if(se instanceof HTMLInputElement&&se.type==="search"&&((oe=b.current)!=null&&oe.contains(se)))return;const G=q();G&&(G.scrollTop=G.scrollHeight)});const Oe=s.useRef(ie);Oe.current=ie;const ae=e.length;s.useEffect(()=>{const se=ae>0&&b.current?jne(b.current):null;if(!se||typeof ResizeObserver>"u")return;const G=new ResizeObserver(()=>{!S.current||Oe.current||(se.scrollTop=se.scrollHeight)});return G.observe(se),()=>G.disconnect()},[ae]);const pe=s.useRef(null);s.useLayoutEffect(()=>{var st,Pe,Ie,Ge;if(ie===pe.current)return;const se=pe.current;pe.current=ie;const G=b.current;if(!G)return;const oe=document.activeElement;if(!(!oe||oe===document.body||G.contains(oe)))return;if(ie){if(S.current=!1,ie.startsWith("you:"))return;(Pe=(st=A0(G,ie))==null?void 0:st.querySelector(".sc-convo-q"))==null||Pe.focus({preventScroll:!0});return}if(!se)return;const Ue=se.startsWith("q:")?Vh(se):se;(Ge=(Ie=A0(G,Ue))==null?void 0:Ie.querySelector(".sc-convo-edit"))==null||Ge.focus({preventScroll:!0})}),s.useEffect(()=>{if(!ie)return;const se=window.setTimeout(()=>{const G=A0(b.current,ie),oe=b.current&&ev(b.current);if(!G||!oe)return;const Ne=G.getBoundingClientRect(),Ue=oe.getBoundingClientRect();Ne.bottom-Ue.bottom>xne&&E9(G,E)},ZP);return()=>window.clearTimeout(se)},[ie,E]);const Te=e.length&&e[e.length-1].kind==="question"?ur(e[e.length-1]):null,gt=s.useRef(Te);s.useLayoutEffect(()=>{var st,Pe;const se=b.current;if(ie||!se||Te===gt.current)return;const G=document.activeElement,oe=(st=G==null?void 0:G.closest(".sc-convo-turn"))==null?void 0:st.getAttribute("data-turn"),Ne=!G||G===document.body||G!==se&&G.contains(se)||!!oe&&oe.startsWith("q:")&&oe!==Te;if(!Te||!Ne){gt.current=Te;return}const Ue=(Pe=A0(se,Te))==null?void 0:Pe.querySelector(".sc-convo-q:not([hidden])");Ue&&(gt.current=Te,Ue.focus({preventScroll:!0}))});const Ze=s.useRef(Te),tt=s.useRef(null);s.useEffect(()=>{if(Te===Ze.current)return;if(!Te){ie&&(tt.current=Ze.current),Ze.current=null;return}const se=A0(b.current,Te);if(!se)return;Ze.current=Te;const G=tt.current!==null,oe=tt.current===Te;if(tt.current=null,S.current||G&&oe)return;const Ne=()=>{Ene(se,b.current)||E9(se,E)};if(!G){Ne();return}const Ue=window.setTimeout(Ne,bne);return()=>window.clearTimeout(Ue)},[Te,ie,E]);const De=s.useRef(new Map);s.useLayoutEffect(()=>{const se=b.current;if(!se)return;const G=new Map,oe=B.current;B.current=!1;for(const Ne of se.querySelectorAll(".sc-convo-turn")){const Ue=Ne.dataset.turn??"",st=Ne.offsetTop;G.set(Ue,st);const Pe=De.current.get(Ue);!oe||E||Pe===void 0||Math.abs(Pe-st)<1||Sne(Ne,Pe-st)}De.current=G});const Se=new Set;if(ie){Se.add(ie);const se=ie.slice(ie.indexOf(":")+1);Se.add(`scenri:asked-${se}`);const G=me.findIndex(oe=>ur(oe)===ie);if(G>=0){for(let oe=G+1;oe<me.length&&Kp(me[oe]);oe++)Se.add(ur(me[oe]));for(let oe=G-1;oe>=0&&Kp(me[oe]);oe--)Se.add(ur(me[oe]))}}for(const se of me){const G=ur(se);Z.current.has(G)||Z.current.set(G,Date.now())}let Q=!1;const je=[];for(const se of me){const G=ur(se),oe=!!ie&&!Se.has(G),Ne=Z.current.get(G),Ue=!!(V!=null&&V.gone.has(G)),st=Ue&&se.kind==="question"&&((Re=V==null?void 0:V.look)==null?void 0:Re.qid)===se.question.id,Pe=se.kind==="scenri"&&!!se.quiet,Ie=!E&&!Ue&&te.has(G)&&!Pe,Ge=0,ft=Q;Ue||(Q=se.kind==="scenri"||se.kind==="question"&&!se.question.reopened),se.kind==="you"?je.push(o.jsx(mne,{text:se.text,photos:se.photos,editable:se.editable,editing:se.editing,arrive:Ie,leave:Ue,delay:Ge,turnId:G,dim:oe,at:Ne,now:X,onEdit:se.editable&&l?()=>l(se.id):void 0,onSave:u?bt=>u(se.id,bt):void 0,onCancel:f},G)):se.kind==="scenri"?je.push(o.jsx(one,{text:se.text,tone:se.tone,reveal:Ie,leave:Ue,eyebrow:!ft,delay:Ge,turnId:G,dim:oe,at:Ne,now:X,thumb:se.thumb,label:se.label,view:se.view,current:se.current,restore:se.restore,onRestore:m,retry:se.retry,onRetry:w,onShow:y},G)):je.push(o.jsx(hne,{question:se.question,reveal:Ie,leave:Ue&&!st,spent:Ue,delay:Ge,turnId:G,dim:oe,busy:t||oe,eyebrow:!ft,at:Ne,now:X,onAnswer:bt=>i(se.question.id,bt),onPick:O,onStarter:h,onDescribe:p,onAttachFiles:g,onCancel:f},G))}return o.jsx("div",{ref:b,className:"sc-convo-log",role:"log","aria-live":"polite","aria-relevant":"additions","data-changing":ie?"true":void 0,children:o.jsxs("div",{className:"sc-convo-turns",children:[je,n&&o.jsx(ine,{what:n===!0?void 0:n})]})})}function S9(e,t){const n=[],r=new Set(e.map(ur));let a=0;for(const i of t.from){const l=ur(i);if(t.gone.has(l)){r.has(l)||n.push(i);continue}for(;a<e.length&&ur(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 Sne(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:ZP,easing:wne,fill:"both"});r.id="slide",r.onfinish=()=>{e.style.transform="",r.cancel()}}function Ene(e,t){if(!t)return!1;const n=ev(t),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();return r.top>=a.top&&r.top<=a.bottom-24}function E9(e,t){var n;(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest",behavior:t?"auto":"smooth"})}function A0(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 Cne(e){const t=[];for(const n of e){const r=ur(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 C9(e){const t=new Set;for(const n of e)n.kind==="question"&&n.question.reopened&&t.add(ur(n));return t}function Vh(e){return e.startsWith("you:")?`q:${e.slice(4)}`:e.startsWith("q:")?`you:${e.slice(2)}`:""}function ev(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}function jne(e){for(let t=e;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if(n==="auto"||n==="scroll")return t}return null}const Cy=e=>`scenri:convo-said:${e}`;function hl(e){try{sessionStorage.removeItem(Cy(e)),sessionStorage.removeItem(jy(e))}catch{}}const jy=e=>`scenri:convo-at:${e}`;function Ane(e){try{const t=sessionStorage.getItem(jy(e));return t?new Map(Object.entries(JSON.parse(t))):null}catch{return null}}function Nne(e,t){try{sessionStorage.setItem(jy(e),JSON.stringify(Object.fromEntries(t)))}catch{}}function Mne(e){try{const t=sessionStorage.getItem(Cy(e));return t?new Set(JSON.parse(t)):null}catch{return null}}function Rne(e,t){try{sessionStorage.setItem(Cy(e),JSON.stringify([...t]))}catch{}}const j9={product:"product",presenter:"person"};function i6(e){return`${["No","One","Two","Three","Four","Five"][e]??String(e)} picture${e===1?"":"s"}`}function l6(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 ge={title:"Create place",editTitle:"Edit place",intent:"Create a place",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 place 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=>`Pick one above, or describe the ${e}`,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 place",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 place",stillReading:"Still writing what your shots are told",readingHead:"What your shots are told",placeLabel:"The place",emptyLabel:"Empty",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?",drawsTwo:"It draws two pictures: the place, and the place in use.",agreeBlind:"Here is the place, in full. Nothing here can draw yet, so it is saved as words.",noReader:"Reading pictures needs Codex, which is not set up yet.",noReaderOff:"Set up Codex above to read them.",changePictures:"Change pictures",readAgain:"I read the place again.",draw:"Draw the place",saveWords:"Save place",here:"Here is the place.",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.`,decideSaved:"Nothing has changed yet.",use:"Use this place",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.`,failedSaid:e=>`${e} Nothing was drawn.`,failedKept:e=>`That did not go through: ${e}. The picture you had is kept.`,sayDifferently:"Say it differently",lost:"That work is gone: the server restarted while it ran. Try it again.",offline:"Lost touch with Scenri. Still trying.",stopLost:"Stop did not reach Scenri. Press it again.",busyElsewhere:"This place is already being worked on in another window. Try again once that is done.",retry:"Try again",version:e=>`Version ${e}`,saved:"Saved.",savedQuiet:"Saved. Nothing is drawn until you ask.",usedOff:"The place is saved. Choose above.",showInUse:(e,t)=>`Show it in use? ${i6(t.length)} with a Scenri demo ${j9[e]} in the place: ${l6(t.map(n=>n.toLowerCase()))}.`,staleSet:e=>`${i6(e)} here show${e===1?"s":""} the place as it was before. Draw ${e===1?"it":"them"} again?`,moreViews:e=>`Add ${i6(e.length).toLowerCase()} of it in use? ${l6(e)}.`,drawIt:"Draw it",drawThem:"Draw them",drawThemAgain:"Draw them again",inUse:e=>`Saved. Now it is shown in use, with a Scenri demo ${j9[e]}.`,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]+$/,"")}.`,exampleFailedSaid:(e,t)=>`The ${e.toLowerCase()} did not draw. ${t}`,more:e=>`Add ${["no","one","two","three"][e.length]??e.length} more? ${l6(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 place",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:"Pick 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 place holds the setting and its light. Add people 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 place is read from.",heicNotYet:"HEIC pictures cannot be read yet. Export them as JPEG, then add them.",leaveTitle:"Stop making this place?",leaveBody:"Nothing has been read yet, so the answers here go.",leave:"Leave",discardTitle:"Discard the changes?",discardBody:"The place 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."},Pne="part of the place itself, never a separate object that competes with the subject, and leaving the subject a clear place to stand",zP={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 Ay(e,t){const n=e?zP[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 Lne(e){return Object.keys(zP).flatMap(t=>Ay(t,e)??[])}const Tne=["water","stone","colour","citrus","volcanic","dark","plaster","linen"],hf=["world","surface","light","signature"],ba=(e,t)=>`scene-${e}-${t}`,Cl={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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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:ba("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"]}]}},$ne=new Set([...Cl.world.options.map(e=>e.card),...Cl.light.options.filter(e=>e.card).map(e=>e.card),...Tne.flatMap(e=>["surface","light","signature"].flatMap(t=>(Ay(e,t)??[]).map(n=>n.card)))]);function Dne(e,t){return e==="world"?Cl.world.options:Ay(t,e)??Cl[e].options}function Hne(e,t){const n=Dne(e,t),r=n.every(a=>!!a.card&&$ne.has(a.card));return{id:e,label:Cl[e].prompt,options:n.map(a=>({id:a.id,label:a.label,...r?{card:a.card}:{}}))}}const One={world:"place",surface:"surface",light:"light",signature:"idea"},A9=e=>One[e],Lo=(e,t)=>{if(!t)return;const n=Cl[e].options.find(r=>r.id===t);return n||e==="world"?n:Lne(e).find(r=>r.id===t)},Ine="one signature idea that makes this place unforgettable, invented for it and never generic";function Fne(e){const t=` ${e.toLowerCase().replace(/[^a-z0-9]+/g," ")} `,n={};for(const r of hf){let a=null;for(const i of Cl[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 jd=4e3,BP=8e3,_ne=["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"],tv=["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"],UP=["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"],WP=["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"],KP=["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"],GP=["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"],YP={world:[..._ne,...tv],surface:tv,light:WP,signature:UP,stage:KP,camera:GP},Vne=e=>` ${e.toLowerCase().replace(/[^a-z0-9é]+/g," ").trim()} `,Zne=(e,t)=>e.includes(` ${t.replace(/[^a-z0-9é]+/g," ")} `);function qP(e){const t=Vne(e),n=r=>r.some(a=>Zne(t,a));return{world:n(YP.world),surface:n(tv),light:n(WP),signature:n(UP),stage:n(KP),camera:n(GP)}}const zne=e=>Object.keys(YP).filter(t=>e[t]);function Bne(e){const t=["world","surface","light"].filter(r=>!e[r]),n=zne(e).length>=3?t.filter(r=>r==="world"):t.slice(0,2);return e.signature?n:[...n,"signature"]}const gi="__passed",V0=e=>{var t;return(t=e.source)==null?void 0:t.door},Une=e=>{var t;return V0(e)==="words"?Bne(qP(((t=e.source)==null?void 0:t.text)??"")):[]},y2=[{id:"source",applies:()=>!0},{id:"photos",applies:e=>V0(e)==="photos"},{id:"shot",applies:e=>V0(e)==="shot"},{id:"reuse",applies:e=>{var t;return V0(e)==="shot"&&!!((t=e.shot)!=null&&t.scene)}},...hf.map(e=>({id:e,applies:t=>V0(t)==="guided"||Une(t).includes(e)}))],hp=y2.map(e=>e.id),Yp=e=>hf.includes(e),N9=e=>hp.includes(e),Wne=e=>{var t;return!!e&&(!!e.pick||!!((t=e.words)!=null&&t.trim()))};function Ny(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":Wne(t[e])}const Kne=e=>y2.filter(t=>t.applies(e)&&Ny(t.id,e)).map(t=>t.id);function XP(e){var t;return((t=y2.find(n=>n.applies(e)&&!Ny(n.id,e)))==null?void 0:t.id)??null}const QP=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:hf.some(l=>sl(l,e[l])!==null)},M9=e=>!!e.source&&XP(e)===null&&QP(e),nv=(e,t)=>JSON.stringify(e)!==JSON.stringify(t);function My(e,t){const n={...e},r=[];for(const[a,i]of Object.entries(t))nv(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=>hp.indexOf(i)));for(const i of hp)hp.indexOf(i)<=a||i in t||delete n[i]}for(const a of y2)n[a.id]!==void 0&&!a.applies(n)&&delete n[a.id];return n}function Gne(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(Yp(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:gi,...i?{words:i}:{}}}}return null}function R9(e){var t;return(e==null?void 0:e.pick)===gi?[Ine,(t=e.words)==null?void 0:t.trim()].filter(Boolean).join(", "):sl("signature",e)}function sl(e,t){var a,i;if(!t)return null;const n=t.pick&&t.pick!==gi?(a=Lo(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 P9=e=>e?`, ${Pne}`:"";function Yne(e){var l,u,f,h,p,g,m;if(((l=e.source)==null?void 0:l.door)==="words"){const w=(e.source.text??"").trim(),y=sl("world",e.world),b=sl("light",e.light)??(qP(w).light?null:((f=Lo("world",(u=e.world)==null?void 0:u.pick))==null?void 0:f.light)??null),S=R9(e.signature),k=[y,sl("surface",e.surface),b,S].filter(Boolean);return k.length?`${w.replace(/[.\s]+$/,"")}, ${k.join(", ")}${P9(S)}.`:w}if(((h=e.source)==null?void 0:h.door)!=="guided")return"";const t=sl("world",e.world),n=sl("light",e.light)??((g=Lo("world",(p=e.world)==null?void 0:p.pick))==null?void 0:g.light)??null,r=R9(e.signature),i=`${[t??"a place",sl("surface",e.surface),n,r].filter(Boolean).join(", ").replace(/^./,w=>w.toUpperCase())}${P9(r)}.`;return(m=e.world)!=null&&m.pick?`${i.slice(0,-1)}. ${ge.worldIsAStart}`:i}function qne(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 L9=e=>/^image\/hei[cf]/i.test(e.type)||/\.hei[cf]$/i.test(e.name),Xne={answers:{},revision:0,editing:null,held:null,asides:[]};function JP(e,t){var n,r;switch(t.type){case"answer":{const a=My(e.answers,t.patch);return nv(a,e.answers)?{...e,answers:a,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 a=[...new Set(t.hashes)].slice(0,4),i=e.editing==="photos";return{...e,answers:{...e.answers,photos:{hashes:a,done:i}},revision:e.revision+1}}case"photo":return JP(e,{type:"photos",hashes:[...((r=e.answers.photos)==null?void 0:r.hashes)??[],t.hash]});case"edit":return Ny(t.id,e.answers)?{...e,editing:t.id,held:e.answers}:e;case"cancel-edit":return!e.held||!nv(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 Qne=e=>({answers:e.held??e.answers,revision:e.revision,asides:e.asides}),Jne=/^[a-f0-9]{32}$/,T9=/^[\w.:-]{1,80}$/;function ere(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,jd)}:{}});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"&&T9.test(i.id)&&typeof i.hash=="string"&&Jne.test(i.hash)){const u=i.scene,f=u&&typeof u.id=="string"&&T9.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 hf){const f=t.answers[u];if(!f||typeof f!="object")continue;const h=typeof f.pick=="string"&&(f.pick===gi||Lo(u,f.pick))?f.pick:void 0,p=typeof f.words=="string"?f.words.slice(0,jd):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:My({},n),revision:Number(t.revision)||0,editing:null,held:null,asides:l}}const qp=4,eL=BP,Ry=60,tL={place:"",pictures:[],heldPictures:[],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 tre(e){return{...tL,place:e.place,pictures:e.pictures.slice(0,qp),heldPictures:e.pictures.slice(qp),readRev:0,versions:[{reading:e.reading,hash:e.hash,...e.anchor?{anchor:!0}:{},...e.hash&&e.hero?{hero:e.hero,...e.heroWith?{heroWith:e.heroWith}:{}}:{},coverage:[],how:"read"}],current:0,name:e.name,named:!0}}const $r=e=>e.versions[e.current]??null,$9=e=>e.versions.some(t=>!!t.hash);function nre(e,t){return!t||e.job||e.inputsRev===0||e.readRev!==null&&e.readRev===e.inputsRev||e.readTried===e.inputsRev?null:e.inputsRev}const nL=e=>e.readRev!==null&&e.readRev!==e.inputsRev;function rre(e,t){var n,r,a;switch(t.type){case"inputs":{const i=t.place.slice(0,eL),l=[...new Set(t.pictures)].slice(0,qp);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,Ry),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"stop-failed":{if(!e.job||e.job.id!==t.id||!e.job.stopping)return e;const{stopping:i,...l}=e.job;return{...e,job:l}}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 i.phase===e.job.phase&&i.since===e.job.since&&i.coverage.join(`
|
|
104
|
+
`)===e.job.coverage.join(`
|
|
105
|
+
`)&&JSON.stringify(i.pending)===JSON.stringify(e.job.pending)?e:D9({...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=$r(e))==null?void 0:n.reading)??null:null),h=l.status==="failed"?l.error??ge.failed:null;if(l.status==="cancelled"){if(!f)return{...u,error:i.kind==="make"?ge.stoppedRead:ge.stopped};if(i.kind==="again"&&!l.hash)return{...u,error:ge.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(k=>k.hash)?"again":"draw",m={reading:f,hash:l.hash,...l.hash&&l.anchor?{anchor:!0}:{},...l.hash&&l.hero?{hero:l.hero,...l.heroWith?{heroWith:l.heroWith}:{}}:{},ask:i.kind==="change"?i.ask:void 0,coverage:(r=l.coverage)!=null&&r.length?l.coverage:i.kind==="again"?((a=$r(e))==null?void 0:a.coverage)??[]:[],how:g},w=$r(e),y=i.kind==="make"&&!l.hash&&w&&!w.hash&&w.how==="read",b=y?e.versions.map((k,C)=>C===e.current?m:k):[...e.versions,m],S={...u,versions:b,current:y?e.current:b.length-1,readRev:i.kind==="make"?i.inputsRev:e.readRev,error:p?ge.stoppedChange:h};return D9(S,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=$r(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,...i.anchor?{anchor:!0}:{},...i.hero?{hero:i.hero,...i.heroWith?{heroWith:i.heroWith}:{}}:{},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};case"set-failed":return t.more?{...e,moreAsked:!1}:{...e,setDrawn:!1}}}function D9(e,t){return e.named||!(t!=null&&t.name)?e:{...e,name:t.name.slice(0,Ry)}}function sre(e){var n;const t=e.job?e.job.phase==="drawing"?e.job.pending:null:((n=$r(e))==null?void 0:n.reading)??null;return t?!e.job&&nL(e)?{can:!1,why:ge.stillReading,words:t}:e.name.trim()?{can:!0,why:null,words:t}:{can:!1,why:ge.nameIt,words:t}:{can:!1,why:e.job?ge.stillReading:null,words:null}}const c6=e=>e.job?e.job.phase==="changing"?ge.changing:e.job.phase==="drawing"?ge.drawing:e.pictures.length?ge.readingPhotos:ge.reading:void 0;function are(e){var r;const t=new Map;e.versions.forEach((a,i)=>{a.hash&&t.set(a.hash,i)});const n=((r=$r(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 rL=e=>(e==null?void 0:e.hero)??(e==null?void 0:e.hash)??null,ore=(e,t)=>e.versions.slice(0,t+1).filter(n=>!!n.hash).length,ire=(e,t)=>e.versions.map(n=>n.hash).lastIndexOf(t);function lre(e){const t=[{label:ge.placeLabel,text:e.prompt}];return e.lighting&&t.push({label:ge.lightLabel,text:e.lighting}),e.camera&&t.push({label:ge.cameraLabel,text:e.camera}),e.figure&&t.push({label:ge.figureLabel,text:e.figureTreatment?`${H9(e.figure)}, ${H9(e.figureTreatment)}.`:e.figure}),t}const H9=e=>e.replace(/[.\s]+$/,""),cre=/\b(presenters?|models?|influencers?|celebrit(y|ies)|actors?|actress(es)?)\b/i,ure=/\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,dre=/\b(add|put|place|include|show|feature|with|holding|wearing|sitting|standing)\b/i,fre=/\b(no|without|remove|removing|empty|nobody|none|take out|get rid of|less)\b/i,hre=/^\s*(undo|go back|revert|back to|previous|the (first|last|previous|old|earlier) (one|version))\b/i,pre=/^\s*(hi|hello|hey|thanks|thank you|ok|okay|cool|nice|great|good|wow|yes|no)\b[\s!.]*$/i,mre=/^(?: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,sL=e=>{var t,n;return((n=(t=mre.exec(e.trim()))==null?void 0:t[1])==null?void 0:n.trim())||null};function gre(e){const t=e.trim(),n=sL(t);return n?{kind:"rename",name:n}:hre.test(t)?{kind:"navigate",say:ge.usePutBack}:pre.test(t)||/\?\s*$/.test(t)&&!/\b(make|can you|could you|try)\b/i.test(t)?{kind:"chatter",say:ge.sayAChange}:(cre.test(t)||ure.test(t))&&dre.test(t)&&!fre.test(t)?{kind:"refuse",say:ge.notInAScene}:{kind:"change"}}const vre=(e,t)=>{var n;return!!((n=$r(e))!=null&&n.ask)&&$r(e).ask.trim().toLowerCase()===t.trim().toLowerCase()},aL=e=>!e.saved&&(e.versions.length>0||!!e.job||!!e.error),O9=(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);function wre(e,t){const n={};for(const[r,a]of Object.entries(e))JSON.stringify(a)!==JSON.stringify(t[r])&&(n[r]=a);return"previewHash"in n&&(n.anchor=e.anchor),"heroHash"in n&&e.heroWith&&(n.heroWith=e.heroWith),n}const oL=1;function yre(e){return JSON.stringify({v:oL,...e})}function bre(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||t.v!==oL)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,...u.anchor===!0&&typeof u.hash=="string"?{anchor:!0}:{},...typeof u.hero=="string"&&typeof u.hash=="string"?{hero:u.hero,...u.heroWith&&typeof u.heroWith=="object"?{heroWith:u.heroWith}:{}}:{},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,eL):"",pictures:n(t.pictures).slice(0,qp),heldPictures:n(t.heldPictures).slice(0,4),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,Ry):"",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 xre(e){if(!e||e.loading)return"";const t=e.items.length;return t?ge.shotCount(t,e.more):e.error?ge.shotsFailed:e.query.trim()?ge.shotNotFound(e.query.trim()):ge.shotNone}function I9(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 kre(e){return lre(e).map(t=>t.label===ge.placeLabel?t.text:`${t.label}: ${t.text.replace(/[.\s]+$/,"")}.`).join(" ")}const b2=new Set([ge.stopped,ge.stoppedRead,ge.stoppedDraw,ge.stoppedChange,ge.lost,ge.failed,ge.busyElsewhere]),Sre=e=>b2.has(e)?e:m1(e)??ge.failedKept(e.replace(/[.\s]+$/,"")),Ere=new Set([ge.stopped,ge.stoppedRead,ge.stoppedDraw,ge.stoppedChange]),u6=e=>Ere.has(e)?{}:{tone:"alert"},F9=e=>{if(b2.has(e))return e;const t=m1(e);return t?ge.failedSaid(t):ge.failedFirst(e.replace(/[.\s]+$/,""))},iL=e=>e&&!b2.has(e)?uo(e).remedy:void 0,rv=e=>{const t=iL(e);return t?[{id:`remedy:${t.opens}`,label:t.label}]:[]};function _9(e){const t=!iL(e)&&!b2.has(e)&&!uo(e).retryable;return[...rv(e),...t?[{id:"reword",label:ge.sayDifferently}]:[],{id:"retry",label:ge.retry}]}function V9(e,t,n,r,a){var y,b,S,k,C,E,A,L,$,N,j,P,R,H;const i=t.answers,l=n?{reopened:!0}:{};if(e==="source")return{id:e,kind:"choice",prompt:ge.source,options:[{id:"photos",label:ge.addPictures},{id:"guided",label:ge.guideMe}],given:((y=i.source)==null?void 0:y.door)==="words"?void 0:((b=i.source)==null?void 0:b.door)==="shot"?"photos":(S=i.source)==null?void 0:S.door,note:((k=i.source)==null?void 0:k.door)==="words"?i.source.text:void 0,...l};if(e==="photos")return{id:e,kind:"photos",prompt:ge.photos,hashes:((C=i.photos)==null?void 0:C.hashes)??[],max:4,busy:r>0,submit:ge.readThem,back:ge.guideInstead,drop:ge.photosDrop,...l,...a&&a.any!==!1&&!((E=i.photos)!=null&&E.hashes.length)&&r===0&&!n?{instead:ge.fromShot,...a.any===null?{insteadWaiting:!0}:{}}:{}};if(e==="shot"){const D=(a==null?void 0:a.query.trim())??"";return{id:e,kind:"pick",prompt:ge.shot,items:(a==null?void 0:a.items)??[],given:(A=i.shot)==null?void 0:A.id,search:{label:ge.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?ge.shotsFailed:D?ge.shotNotFound(D):ge.shotNone,status:xre(a),back:n?void 0:ge.backToPictures,...l}}if(e==="reuse"){const D=(($=(L=i.shot)==null?void 0:L.scene)==null?void 0:$.name)??"";return{id:e,kind:"choice",prompt:ge.madeIn(D),options:[{id:"use",label:ge.takeScene(D)},{id:"read",label:ge.readNew}],given:i.reuse,...l}}const u=i[e],f=e==="light"?(j=Lo("world",(N=i.world)==null?void 0:N.pick))==null?void 0:j.light:void 0,h=e==="surface"&&!!Lo("world",(P=i.world)==null?void 0:P.pick),p=(u==null?void 0:u.pick)===gi||u==null?void 0:u.pick,g=(u==null?void 0:u.pick)===gi,m=u==null?void 0:u.words,w=((R=i.source)==null?void 0:R.door)==="words";return{id:e,kind:"swatches",prompt:lL(e,i),row:Hne(e,(H=i.world)==null?void 0:H.pick),layout:e==="world"?"grid":void 0,hint:e==="world"&&!w?ge.worldHint:void 0,skip:f?ge.keepWorldLight:h?ge.keepWorldSurface:e==="signature"&&!w?ge.suggestOne:w?ge.leaveToReading:ge.skip,describe:ge.describeInstead,given:p,skipped:g,note:m,...l}}function lL(e,t){var r,a,i;const n=e==="light"?(a=Lo("world",(r=t.world)==null?void 0:r.pick))==null?void 0:a.light:void 0;if(n)return ge.worldLightPrompt(n);if(((i=t.source)==null?void 0:i.door)==="words"){if(e==="world")return ge.followWorld;if(e==="light")return ge.followLight}return Cl[e].prompt}function Cre(e,t){var n,r;return e==="source"?ge.source:e==="photos"?ge.photos:e==="shot"?ge.shot:e==="reuse"?ge.madeIn(((r=(n=t.shot)==null?void 0:n.scene)==null?void 0:r.name)??""):lL(e,t)}function Z9(e,t){var f,h,p,g,m,w,y,b,S,k,C;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:ge.fromShotAnswer}:{text:((p=t.source)==null?void 0:p.door)==="photos"?ge.addPictures:ge.guideMe};if(e==="shot")return{text:ge.shotAnswer,photos:t.shot?[t.shot.hash]:[]};if(e==="reuse")return{text:ge.readNew};if(e==="photos"){const E=((g=t.photos)==null?void 0:g.hashes.length)??0;return{text:`${E} ${E===1?"picture":"pictures"}`,photos:(m=t.photos)==null?void 0:m.hashes}}const n=t[e],r=e==="light"&&(n==null?void 0:n.pick)===gi&&((y=Lo("world",(w=t.world)==null?void 0:w.pick))==null?void 0:y.light),a=e==="surface"&&(n==null?void 0:n.pick)===gi&&!!Lo("world",(b=t.world)==null?void 0:b.pick),i=r?ge.keepWorldLight:a?ge.keepWorldSurface:((S=t.source)==null?void 0:S.door)==="words"?ge.leaveToReading:e==="signature"?ge.suggestOne:ge.skip,l=(n==null?void 0:n.pick)===gi?i:(k=Lo(e,n==null?void 0:n.pick))==null?void 0:k.label,u=(C=n==null?void 0:n.words)==null?void 0:C.trim();return{text:l&&u?`${l}, ${u}`:u??l??""}}const z9=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,jre=e=>{const t=$r(e);return t?`${t.hash?"decide":"agree"}-${e.current}`:null};function Are(e){var w,y,b,S,k,C;const{setup:t,studio:n,edit:r}=e,a=t.answers,i=[],l=new Set,u=E=>{for(const A of t.asides.filter(L=>L.q===E&&!l.has(L)).sort(z9))l.add(A),i.push(...Ci(A))};r?i.push({kind:"scenri",id:"edit-open",text:ge.editOpen(r.name)}):i.push({kind:"you",id:"intent",text:ge.intent});const f=r?null:XP(a);if(!r)for(const E of Kne(a)){if(i.push({kind:"scenri",id:`asked-${E}`,text:Cre(E,a),quiet:!0}),u(E),t.editing===E){i.push({kind:"question",question:V9(E,t,!0,e.uploading,e.shots)});continue}const A=Z9(E,a);i.push({kind:"you",id:E,text:A.text,photos:A.photos,editable:!n.job&&!n.saved})}const h=n.versions.findIndex(E=>!!E.hash);n.versions.forEach((E,A)=>{if(E.how==="read"&&A>0&&i.push({kind:"scenri",id:`reread-${A}`,text:ge.readAgain}),E.how==="change"&&i.push({kind:"you",id:`ask-${A}`,text:E.ask??""}),E.hash&&(E.how==="draw"&&i.push({kind:"you",id:`draw-${A}`,text:ge.draw}),E.how==="again"&&i.push({kind:"you",id:`again-${A}`,text:ge.tryAgain}),A===h&&!r&&B9(i,e),i.push({kind:"scenri",id:`pic-${A}`,text:E.how==="change"?ge.changed:E.how==="again"?ge.again:ge.here,thumb:rL(E)??E.hash,label:ge.version(ore(n,A)),view:"scene",current:A===n.current,restore:A===n.current||n.saved?void 0:{view:"scene",hash:E.hash}})),A===n.current)for(const[L,$]of E.coverage.entries())i.push({kind:"scenri",id:`cover-${A}-${L}`,text:$});u(`agree-${A}`),u(`decide-${A}`)});const p=n.job;(p==null?void 0:p.kind)==="again"&&i.push({kind:"you",id:`pending-${p.id}`,text:h<0?ge.draw:ge.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&&B9(i,e),n.saved&&Nre(i,e);let g=null;const m=!r&&!p&&!n.versions.length&&e.canRead===!1&&((w=a.source)==null?void 0:w.door)===e.noReader?e.noReader:null;if(m==="photos"&&((y=a.photos)!=null&&y.hashes.length)&&i.push({kind:"you",id:"photos",...Z9("photos",a)}),m)g={id:"noreader",kind:"confirm",quiet:!0,prompt:ge.noReader,options:[{id:"remedy:setup",label:"Set up"},{id:"unstop",label:m==="photos"?ge.changePictures:ge.anotherShot}]};else if(f)g=V9(f,t,!1,e.uploading,e.shots);else if(p){if(p.kind==="again"&&h<0&&!n.named&&!e.editingName){const E=((S=p.pending??((b=$r(n))==null?void 0:b.reading))==null?void 0:S.name)??n.name;g={id:"name",kind:"text",prompt:ge.name,starters:E?[{label:E,text:E}]:void 0}}}else if(n.saved)g=Mre(e);else{const E=$r(n);if(e.stale&&!r)n.error&&(g={id:"retry",kind:"confirm",...u6(n.error),prompt:F9(n.error),options:_9(n.error)});else if(!E&&n.error)g={id:"retry",kind:"confirm",...u6(n.error),prompt:F9(n.error),options:_9(n.error)};else if(E){n.error&&i.push({kind:"scenri",id:`error-${n.versions.length}`,text:Sre(n.error),...u6(n.error)});const A=kre(E.reading);if(E.hash){const L=!!r&&!r.changed;g={id:`decide-${n.current}`,kind:"confirm",prompt:L?ge.decideSaved:(r?ge.decideEdit:ge.decide)(n.name.trim()||E.reading.name),quote:A,quoteLabel:ge.readingHead,...E.how==="draw"||E.how==="again"?{quoteFolded:!0}:{},options:[...rv(n.error),...L?[]:[{id:"use",label:r?ge.saveChanges:ge.use}],...e.canDraw?[{id:"again",label:ge.tryAgain}]:[]],...L?{quiet:!0}:{},describe:ge.changeSomething}}else{const L=!r&&((k=a.source)==null?void 0:k.door)==="photos",$=!r&&((C=a.source)==null?void 0:C.door)==="shot",N=$?[{id:"another-shot",label:ge.anotherShot}]:[],j=E.how==="change"?ge.agreeChanged:L?ge.agreePhotos:$?ge.agreeShot:ge.agree;g={id:`agree-${n.current}`,kind:"confirm",prompt:e.canDraw?E.reading.hero==="place"?j:`${j} ${ge.drawsTwo}`:ge.agreeBlind,quote:A,quoteLabel:ge.readingHead,options:[...rv(n.error),...e.canDraw?[{id:"draw",label:ge.draw}]:[{id:"use",label:r?ge.saveChanges:ge.saveWords}],...N]}}}}for(const E of t.asides.filter(A=>!l.has(A)).sort(z9))i.push(...Ci(E));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 Nre(e,t){const{studio:n,edit:r,set:a,canDraw:i}=t;if(e.push({kind:"you",id:"use",text:r?ge.saveChanges:i?ge.use:ge.saveWords}),!a)return;const l=cL(t),u=a.tiles.filter(m=>!(m.role==="hero"&&m.hash===l)),f=u.length>0||a.running;e.push({kind:"scenri",id:"saved",text:f?ge.inUse(a.who):a.read&&a.noSubject&&i?ge.noLibrary:a.read&&i&&a.first.length?ge.savedQuiet:ge.saved}),(n.setDrawn||n.setDeclined)&&e.push({kind:"you",id:"set-start",text:n.setDrawn?a.stale?ge.drawThemAgain:l?ge.drawIt:ge.drawThem:ge.notNow});const h=n.moreAsked?ge.addThem:n.moreDeclined?ge.notNow:null;let p=!1;const g=()=>{!h||p||(p=!0,e.push({kind:"you",id:"more",text:h}))};for(const m of u)if(m.role!=="hero"&&m.role!=="close"&&g(),m.state==="shown"&&m.hash)e.push({kind:"scenri",id:`ex-${m.role}-${m.hash}`,text:ge.exampleHere[m.role],thumb:m.hash,label:Ja[m.role],view:m.role,...a.running||n.job?{}:{retry:m.role}});else if(m.state==="failed"){const w=m.error?m1(m.error):null;e.push({kind:"scenri",id:`ex-failed-${m.role}`,text:w?ge.exampleFailedSaid(Ja[m.role],w):ge.exampleFailed(Ja[m.role],m.error??ge.failed),tone:"alert"})}g()}function Mre(e){var u;const{set:t,studio:n}=e,r=n.name.trim()||((u=$r(n))==null?void 0:u.reading.name)||"The place";if(!t||t.running||!t.read)return null;const a=cL(e);if(e.canDraw&&t.first.length&&!n.setDrawn&&!n.setDeclined){const f=t.first.map(h=>Ja[h]);return{id:"set-start",kind:"confirm",prompt:t.stale?ge.staleSet(t.first.length):a?ge.moreViews(f):ge.showInUse(t.who,f),options:[{id:"draw-set",label:t.stale?ge.drawThemAgain:t.first.length===1?ge.drawIt:ge.drawThem},{id:"not-now",label:ge.notNow}]}}const i=t.tiles.some(f=>f.role==="hero"&&f.state==="shown");if(e.canDraw&&i&&t.missing.length&&!n.setDeclined&&!n.moreDeclined&&!n.moreAsked)return{id:"set-more",kind:"confirm",prompt:ge.more(t.missing.map(f=>Ja[f])),options:[{id:"more",label:ge.addThem},{id:"not-now",label:ge.notNow}]};const l=t.tiles.filter(f=>f.state==="failed");return{id:"set-done",kind:"confirm",prompt:l.length?ge.readyMissing(r):t.tiles.length?ge.ready(r):ge.readyUndrawn(r),options:[...l.length&&e.canDraw?[{id:"retry-failed",label:ge.tryAgain}]:[],{id:"done",label:t.finish}]}}function cL(e){var n,r;const t=((n=$r(e.studio))==null?void 0:n.hero)??null;return t&&((r=e.set)!=null&&r.tiles.some(a=>a.role==="hero"&&a.state==="shown"&&a.hash===t))?t:null}function B9(e,t){if(!t.studio.named&&!t.editingName)return;e.push({kind:"scenri",id:"asked-name",text:ge.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 Rre(e,t){var l,u,f;const{setup:n,studio:r}=e,a=(h,p=!1)=>({target:{kind:"off",why:h},placeholder:"",label:ge.lineLabel,action:ge.send,working:p,attach:!1});if(r.saved){const h=!!r.job||!!((l=e.set)!=null&&l.running);return a(t&&!h?ge.usedOff:"",h)}const i=n.editing;return i==="source"?Qo({kind:"source"},ge.sourcePlaceholder,!0):i&&Yp(i)?Qo({kind:"row",id:i},ge.rowPlaceholder(A9(i))):i==="photos"?a(ge.photosOff):i==="shot"?a(ge.shotOff):i==="reuse"?a(ge.reuseOff):!t&&!r.job&&n.answers.source&&!QP(n.answers)?Qo({kind:"source"},ge.nothingSaidPlaceholder,!0):t?t.id==="source"?Qo({kind:"source"},ge.sourcePlaceholder,!0):t.id==="photos"?{...a(ge.photosOff),attach:!0}:t.id==="shot"?a(ge.shotOff):t.id==="reuse"?a(ge.reuseOff):t.id==="noreader"?a(ge.noReaderOff):Yp(t.id)?Qo({kind:"row",id:t.id},ge.rowPlaceholder(A9(t.id))):t.id==="name"?Qo({kind:"name"},ge.namePlaceholder):t.id==="retry"?Qo({kind:"source"},ge.nothingSaidPlaceholder,!0):t.id.startsWith("agree-")?e.canDraw?Qo({kind:"add"},e.edit?ge.addPlaceholder:((u=n.answers.source)==null?void 0:u.door)==="photos"?ge.keepPlaceholder:((f=n.answers.source)==null?void 0:f.door)==="shot"?ge.keepShotPlaceholder:ge.addPlaceholder):a(""):t.id.startsWith("decide-")?{...Qo({kind:"change"},ge.changePlaceholder),action:ge.change}:a(""):r.job?a("",!0):a("")}function Qo(e,t,n=!1){return{target:e,placeholder:t,label:t,action:ge.send,working:!1,attach:n}}const Pre=/\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,uL=e=>Pre.test(e)||e.trim().split(/\s+/).length>=5&&!/\?\s*$/.test(e);function U9(e,t){switch(e){case"greeting":case"ack":return t==="source"?ge.greet:ge.greetRow;case"question":case"help":return ge.askHelp;case"nav":return ge.startOverIsUp;case"go":return t==="source"?ge.goFirst:ge.greetRow;default:return ge.notAPlace}}function W9(e,t){if(t==="source"){const r=oi(e,uL);return r==="vague"?null:r}const n=oi(e,()=>!1);return n==="vague"||n==="intent"||n==="likeness"?null:n}const dL=2;function Lre(e,t){return JSON.stringify({v:dL,setup:Qne(e),studio:yre(t)})}function fL(e){if(!e)return null;try{const t=JSON.parse(e);return(t==null?void 0:t.v)!==dL?null:{setup:ere(t.setup),studio:bre(typeof t.studio=="string"?t.studio:null)}}catch{return null}}const Py=e=>`scenri:scene-studio:${e}:`;function Tre(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=fL(typeof(n==null?void 0:n.session)=="string"?n.session:null),a=r==null?void 0:r.studio;if(!a||!aL(a))return null;const i=[a.versions[a.current],...[...a.versions].reverse()].find(g=>g==null?void 0:g.hash),l=$r(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 $re(e,t,n=Dre()){const r=new Map(t.filter(l=>l.kind==="scene").map(l=>[l.id.slice(6),l])),a=e.map(l=>{const u=l.jobId?r.get(l.jobId):void 0;return u?l.drawing?{...l,name:l.name||u.name,hash:u.status==="done"&&u.thumb?u.thumb:l.hash,drawing:u.status==="running",failed:u.status==="failed"}:l:{...l,drawing:!1}}),i=new Set([...e.map(l=>l.convo),...n]);for(const l of t)l.kind!=="scene"||l.status!=="running"||!l.conversation||l.sceneId||i.has(l.conversation)||(i.add(l.conversation),a.push({convo:l.conversation,name:l.name,hash:null,drawing:!0,failed:!1,read:!1,jobId:l.id.slice(6),at:Date.parse(l.startedAt)||0}));return a.filter(l=>l.drawing||l.hash||l.failed||l.read).sort((l,u)=>u.at-l.at)}function Dre(){var t;const e=[];for(const n of Ar.keys("scenri:scene-studio:"))try{(t=JSON.parse(Ar.get(n)??"null"))!=null&&t.sceneId&&e.push(n.slice(n.lastIndexOf(":")+1))}catch{}return e}function Hre(e){return e.drawing?"Drawing":e.hash?"Drawn, not used yet":e.failed?"Did not finish":"Not drawn yet"}function pp(e){const t=Py(e);return Ar.keys(t).map(n=>Tre(n.slice(t.length),Ar.get(n))).filter(n=>!!n)}function Ore(e,t){Ar.set(e,JSON.stringify({at:Date.now(),sceneId:t,done:!0}))}function Ire(e,t){try{const n=JSON.parse(Ar.get(`${Py(e)}${t}`)??"null");return(n==null?void 0:n.done)===!0&&typeof n.sceneId=="string"?n.sceneId:null}catch{return null}}function Fre(e,t){const n=`${Py(e)}${t}`;Ar.del(n),hl(n)}function _re(e,t,n,r){const a=ZG(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 hL(){const{brand:e,recent:t,products:n}=un(),r=Un(),a=Bl(),i=!!gn(pt.hub),l=!!gn(pt.hubShot),u=!!gn(pt.products),f=!!gn(pt.scenes),h=!!gn(pt.presenters),p=!!gn(pt.presenterStudio),g=!!gn(pt.sceneStudio);return s.useCallback(async m=>{var E,A;const w=t.find(L=>L.kind!=="root"&&L.status==="done"&&L.images.length>0),y=m==="refine"&&!w?"first-shot":m==="reuse"&&n.length===0?"product":m,b=lp().active;(b==null?void 0:b.task)===y&&b.brandId===e.id&&!b.paused||await pc({start:{task:y,brandId:e.id}});const S=((A=(E=lp().progress)==null?void 0:E[y])==null?void 0:A.reached)??[],k=lp().activeDraftId,C=_re(y,{onHub:i,onShot:l,onProducts:u,onScenes:f,onPresenters:h,onStudio:p,onSceneStudio:g},S,k);switch(C.kind!=="head"&&E4(),C.kind){case"stay":try{window.localStorage.removeItem(S4(e.id,y)),(y==="first-shot"||y==="reuse")&&window.localStorage.removeItem(hM(e.id))}catch{}return(y==="first-shot"||y==="reuse")&&i?r(jr(e)):void 0;case"head":return pM(e.id,y);case"hub":return r(jr(e));case"products":return r(sd(e));case"scenes":return r(gl(e));case"presenters":return r(di(e));case"studio":return r(wl(e,k));case"sceneStudio":{const L=pp(e.id).sort(($,N)=>N.at-$.at)[0];return r(vl(e,(L==null?void 0:L.convo)??null))}case"dialog":return a(C.asset)}},[e,t,n,r,a,i,l,u,f,h,p,g])}const Vre=Number(window.localStorage.getItem("scenri:welcome-settle-ms")??900),Zre='[role="dialog"]:not(.sc-coach):not(.sc-attachpanel):not(.sc-swap), [role="alertdialog"], .sc-lightbox',zre='[data-guide="compose"] .sc-attachpanel';function Bre(){var Ve,xt,yt,kt,ot,ht,Ae;const e=Zw(),t=SP(),n=Mn(),{brand:r,recent:a,subscribeActivity:i,products:l,importing:u}=un(),{tasks:f,builds:h}=ua(),{push:p}=rr(),g=hL(),m=Un(),[w]=Ml(),y=Nr("new"),b=!!gn(pt.brand),S=!!gn(pt.hub),k=((Ve=gn(pt.hubShot))==null?void 0:Ve.params.shotId)??null,C=!!gn(pt.presenterStudio),E=!!gn(pt.sceneStudio),A=!!gn(pt.products),L=!!gn(pt.scenes),$=!!gn(pt.presenters),N=e.active,j=N&&N.brandId===r.id?N.task:null,P=j&&!(N!=null&&N.paused)?j:null,R=P==="first-shot"||P==="reuse"?"generation":P==="refine"?"edit":null,H=e.loaded&&e.eligible&&e.welcome===null,[D,U]=s.useState(e.activeNodes);s.useEffect(()=>U(e.activeNodes),[e.activeNodes]),s.useEffect(()=>{if(!(!R||!N))return i(ve=>U(et=>bee(et,ve,N.since,R)))},[R,N,i]);const _=!!((xt=t.composer)!=null&&xt.busy),B=s.useRef(!1),[K,V]=s.useState(!1);s.useEffect(()=>{B.current&&!_&&R&&(V(!0),D8().finally(()=>V(!1))),B.current=_},[_,R]);const[,O]=s.useState(0),I=s.useRef(0),Y=s.useCallback(()=>{cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>O(ve=>ve+1))},[]);s.useEffect(()=>{if(!P&&!H)return;const ve=new MutationObserver(Y);return ve.observe(document.body,{childList:!0,subtree:H}),window.addEventListener("resize",Y),()=>{cancelAnimationFrame(I.current),ve.disconnect(),window.removeEventListener("resize",Y)}},[P,H,Y]);const[Z,X]=s.useState(()=>!document.hidden);s.useEffect(()=>{const ve=()=>X(!document.hidden);return document.addEventListener("visibilitychange",ve),()=>document.removeEventListener("visibilitychange",ve)},[]);const z=!!P||H,J=kM.some(ve=>w.has(ve)),he=z&&(J||[...document.querySelectorAll(Zre)].some(ve=>!ve.closest("[data-radix-popper-content-wrapper], .sc-shotsheet"))),te=w.get("new"),me=P?`scenri:guide-begun:${r.id}:${P}`:null,[re,ee]=s.useState(!1);s.useEffect(()=>{ee(!!me&&window.localStorage.getItem(me)==="1")},[me]);const q=s.useCallback(()=>{if(me)try{window.localStorage.setItem(me,"1")}catch{}ee(!0)},[me]),ie=e.heading,Oe=ve=>!!ve&&(ie==null?void 0:ie.brandId)===r.id&&ie.task===ve&&!he,ae=ve=>ve==="first-shot"||ve==="reuse"||ve==="refine"?S:ve==="product"?A:ve==="scene"?L:ve==="presenter"?$||C:!1,[pe,Te]=s.useState(!1);s.useEffect(()=>{let ve=!1;try{ve=!!P&&window.localStorage.getItem(S4(r.id,P))==="1"}catch{}Te(ve)},[P,r.id,ie]),s.useEffect(()=>{if(!(!ie||ie.brandId!==r.id)&&ae(ie.task)){try{window.localStorage.setItem(S4(r.id,ie.task),"1")}catch{}Te(!0),(ie.task==="first-shot"||ie.task==="reuse")&&q(),E4()}},[ie,S,A,L,$,C,r.id,q]);const gt=s.useRef(null);s.useEffect(()=>{const ve=gt.current;!ve||ae(ve)||(gt.current=null,pM(r.id,ve))},[S,A,L,$,C,r.id]),s.useEffect(()=>{e.loaded&&!j&&ie&&E4()},[e.loaded,j,ie]);let Ze=null;if(P==="first-shot"||P==="reuse"){const ve=((yt=t.composer)==null?void 0:yt.brandId)===r.id?t.composer:null,et=S&&Oe(P),Ct={here:S&&!he,heading:Oe(P)&&!S,composer:ve&&K?{...ve,busy:!0}:ve,nodes:D,begun:re||et||D.length>0};Ze=P==="reuse"?gP(Ct):mP(Ct)}else if(P==="refine"){const ve=((kt=t.composer)==null?void 0:kt.brandId)===r.id?t.composer:null,et=!!k;Ze=dee({here:et||S&&!he,heading:Oe(P)&&!S&&!et,open:et,armed:S&&!!(ve!=null&&ve.refining),nodes:D,asking:et?!!dc(wP):!!dc(_p)})}else P==="presenter"?Ze=yP({heading:Oe(P)&&!$&&!C,onPage:$&&!C&&!he,studio:C?t.studio:null}):P==="scene"?Ze=hee({heading:Oe(P)&&!L&&!E,onPage:L&&!E&&!he,studio:E?t.studio:null}):P==="product"&&(Ze=pee({heading:Oe(P)&&!A,onPage:A&&!he&&te!=="product",dialogOpen:te==="product"}));const tt=((ot=t.composer)==null?void 0:ot.brandId)===r.id?t.composer:null,De=P==="first-shot"&&tt?vP(tt):P==="reuse"&&tt?tt.products===0?"product":tt.scene?null:"scene":null,Se=!!((ht=t.composer)!=null&&ht.pickerOpen);s.useEffect(()=>{Se&&(P==="first-shot"&&!De?window.dispatchEvent(new Event("scenri:guide-close-picker")):De&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Zk[De]}})))},[P,Se,De]),s.useEffect(()=>{P==="first-shot"&&!De&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:null}}))},[P,De]),s.useEffect(()=>{if(P)return document.documentElement.dataset.guideTask=P,()=>{delete document.documentElement.dataset.guideTask}},[P]);const Q=(Ze==null?void 0:Ze.point)===zre&&window.innerWidth<1024;if(s.useEffect(()=>{if(Q)return document.documentElement.dataset.guidePicker="",()=>{delete document.documentElement.dataset.guidePicker}},[Q]),P&&Ze&&Ze.voice!=="quiet"){const ve=zG(P,Ze.id);ve&&(Ze={...Ze,...ve})}const je=P&&Ze&&Ze.voice!=="quiet"?Ze.id:null,Re=s.useRef("");s.useEffect(()=>{var et,Ct;if(!P||!je)return;const ve=`${P}:${je}`;Re.current!==ve&&(Re.current=ve,!((Ct=(et=e.progress)==null?void 0:et[P])!=null&&Ct.reached.includes(je))&&pc({reached:{task:P,moment:je}}))},[P,je,e.progress]);const se=Ze,G=s.useRef(new Set),oe=s.useCallback(ve=>{G.current.add(ve),pc({finish:ve})},[]),Ne=s.useCallback(ve=>{pc({dismiss:ve}),p({kind:"info",title:"Guide closed",detail:"Continue it any time from Learn."})},[p]);s.useEffect(()=>{P==="first-shot"&&k&&D.some(ve=>ve.id===k&&ve.status==="done"&&ve.images>0)&&oe("first-shot")},[P,k,D,oe]),s.useEffect(()=>{P==="refine"&&k&&D8()},[P,k]);const Ue=s.useRef(!1);s.useEffect(()=>{if(P!=="refine"){Ue.current=!1;return}k?Ue.current=!0:Ue.current&&(Ue.current=!1,oe("refine"))},[P,k,oe]);const st=j==="presenter"||j==="scene"||j==="product",Pe=h.filter(ve=>!ve.finished).length;s.useEffect(()=>{st&&D8()},[st,r,l.length,Pe,u]),s.useEffect(()=>{st&&e.counts&&gee(e,e.counts)&&oe(N==null?void 0:N.task)},[st,e,N,oe]);const Ie=!!((Ae=t.overlay)!=null&&Ae.engaged);s.useEffect(()=>{if(!e.loaded||!e.eligible)return;const ve={eligible:e.eligible,hidden:e.hidden,done:e.done,dismissed:e.dismissed,active:N},Ct=!!k&&Ie&&a.some(xe=>xe.id===k&&xe.status==="done")&&Ih("refine",ve)?"refine":E&&Ih("scene",ve)?"scene":te==="product"&&Ih("product",ve)?"product":C&&Ih("presenter",ve)?"presenter":null;!Ct||G.current.has(Ct)||(G.current.add(Ct),pc({start:{task:Ct,brandId:r.id}}))},[e,N,k,Ie,a,te,C,E,r.id]);const[Ge,ft]=s.useState(""),bt=s.useRef(se);bt.current=se;const at=s.useCallback((ve,et)=>{if(ft(""),et)return;const Ct=bt.current,xe=Ct?[Ct.title,Ct.body].filter(Boolean).join(". "):"";xe&&requestAnimationFrame(()=>ft(xe))},[]),[Zt,jt]=s.useState(!1),Ft=Nr("welcome"),Pt=Ft.value!==null,$t=b&&n.showcaseLoaded||S,ke=h.some(ve=>!ve.finished)||f.some(ve=>ve.state==="running"&&ve.kind!=="catalog"&&ve.kind!=="library"),Je=wee({onMainPage:b||S,eligible:e.eligible,welcome:e.welcome,ready:$t&&!document.querySelector('[data-variant="skeleton"]'),visible:Z,blocked:he,busy:ke});s.useEffect(()=>{if(!Je)return;const ve=window.setTimeout(()=>jt(!0),Vre);return()=>window.clearTimeout(ve)},[Je]);const Et=s.useMemo(()=>yee(n.showcase).map(ve=>Ure(ve.previewUrl)),[n.showcase]),Xe=n.engines.some(ve=>ve.available),rt=l.length>0,nt=se&&(se.voice==="ask"||se.voice==="note")?se:null,qt=nt!=null&&nt.shell?dc(nt.shell):document.body,Yt=nt!=null&&nt.point?dc(nt.point):null,an=(nt==null?void 0:nt.live)??(nt!=null&&nt.point?[nt.point]:[]),Wt=an.map(ve=>dc(ve)).filter(ve=>!!ve),Rn=((nt==null?void 0:nt.also)??[]).map(ve=>dc(ve)).filter(ve=>!!ve),Bt=((nt==null?void 0:nt.lit)??[]).map(ve=>dc(ve)).filter(ve=>!!ve),ne=!!nt&&!!qt&&(!nt.point||!!Yt)&&Wt.length===an.length,ce=nt&&!ne?nt:null,ue=Zt||ne;s.useEffect(()=>Kk(ue),[ue]),s.useEffect(()=>()=>Kk(!1),[]),s.useEffect(()=>{if(!ce)return;const ve=(ce.shell?document.querySelector(ce.shell):null)??document.querySelector(".sc-feed")??document.body,et=new MutationObserver(Y);return et.observe(ve,{childList:!0,subtree:!0}),()=>et.disconnect()},[ce==null?void 0:ce.id,ce==null?void 0:ce.shell,Y]);const ze=ve=>{P&&(ve.done?oe(P):Ne(P))};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:Ge}),nt&&ne&&o.jsx(Ste,{id:nt.id,voice:nt.voice,target:Yt,live:Wt,also:Rn,lit:Bt,side:nt.side??"top",beside:nt.beside,soft:nt.soft,container:qt,title:nt.title,body:nt.body,at:nt.at,of:nt.of,canBack:mee(P,nt.id,pe||!!(S&&Oe(P))),action:nt.start?{label:"Start"}:nt.done?{label:"Done"}:null,closeLabel:nt.done?"Close":"Close guide",onBack:()=>{const ve=P?xP(P,nt.id):null;if(ve){window.dispatchEvent(new CustomEvent("scenri:guide-take-back",{detail:{kind:ve}})),window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:Zk[ve]}}));return}if(P==="presenter"&&(nt.id==="start"||nt.id==="face"||nt.id==="save"))return m(di(r),{replace:!0});if((P==="product"||P==="scene")&&nt.id===P)return y.close();if(P==="refine"&&nt.id==="ask"){if(k)return m(jr(r),{replace:!0});window.dispatchEvent(new Event("scenri:guide-clear-refine"));return}if(pe&&P&&(nt.id==="new"||nt.id==="choose"||nt.id==="product"))return window.dispatchEvent(new Event("scenri:guide-close-picker")),gt.current=P,m(Ho(r))},onAction:()=>{if(nt.start)return q();nt.done&&P&&oe(P)},onClose:()=>ze(nt),onEscape:()=>ze(nt),onShown:at,onLost:Y}),o.jsx(Mee,{open:Zt||Pt,pictures:Et,note:Xu.note({engineReady:Xe,ownsProducts:rt}),onTake:()=>{const ve=Zt;jt(!1),Pt&&Ft.close(),ve?pc({welcome:"taken"}).then(()=>g("first-shot")):window.setTimeout(()=>void g("first-shot"),0)},onDecline:()=>{const ve=Zt;jt(!1),Pt&&Ft.close(),ve&&pc({welcome:"declined"})}})]})}function dc(e){for(const t of document.querySelectorAll(e))if(t.getClientRects().length>0)return t;return null}function Ure(e){return`${e}${e.includes("?")?"&":"?"}w=320`}const Wre="lessons";function Kre(){var V;const e=Nr("learn"),t=e.value!==null,n=IG(e.value),r=Or(da),a=Zw(),i=SP(),{brand:l,recent:u,products:f}=un(),h=hL(),[p,g]=s.useState(null);s.useEffect(()=>{t||!p||(g(null),h(p))},[t,p,h]);const m=s.useRef(!1),w=O=>{m.current=!0,g(O),e.close()},y=s.useRef(null);s.useEffect(()=>{t&&(y.current=A4.current,A4.current=null)},[t]);const b=()=>{const O=m.current;if(m.current=!1,O)return;const I=y.current==="help";requestAnimationFrame(()=>{var X;if(document.activeElement!==document.body)return;const Y=I?".sc-help-btn":".sc-learn-btn",Z=I?".sc-learn-btn":".sc-help-btn";(X=document.querySelector(Y)??document.querySelector(Z))==null||X.focus()})},S=!!gn(pt.hub),k=!!gn(pt.presenterStudio),C=!!gn(pt.presenters),E=O=>{var I;return((I=a.heading)==null?void 0:I.brandId)===l.id&&a.heading.task===O},A=((V=a.active)==null?void 0:V.brandId)===l.id&&!a.active.paused?a.active.task:null,L=u.some(O=>O.kind!=="root"&&O.status==="done"&&O.images.length>0),$=O=>O.needs==="shot"&&!L||O.needs==="product"&&f.length===0?O.needs??null:null,N=O=>{var z,J,he,te,me,re;const I=((J=(z=a.progress)==null?void 0:z[O.id])==null?void 0:J.reached)??[];if(A!==O.id)return X5(O.id,I,null);const Y=((he=i.composer)==null?void 0:he.brandId)===l.id?i.composer:null,Z={here:S,heading:E(O.id),composer:S?Y:null,nodes:a.activeNodes,begun:!0},X=O.id==="first-shot"?((te=mP(Z))==null?void 0:te.id)??null:O.id==="reuse"?((me=gP(Z))==null?void 0:me.id)??null:O.id==="presenter"?((re=yP({heading:E("presenter"),onPage:C&&!k,studio:k?i.studio:null}))==null?void 0:re.id)??null:null;return X5(O.id,I,{moment:X,nodes:a.activeNodes,draft:!!a.activeDraftId})},j=O=>_G(O.id,a,l.id,N(O)),P=VG(il,j),R=n??P??il[0],H=il.filter(O=>j(O)==="done").length;s.useEffect(()=>{if(t)for(const O of Object.values(j4))new Image().src=O.wide},[t]);const D=s.useRef(null),U=s.useRef(new Map),_=s.useRef(null),B=s.useRef(!1);s.useEffect(()=>{var Y;const O=t&&!B.current;if(B.current=t,!t)return;const I=()=>{var Z,X;(Z=D.current)==null||Z.focus({preventScroll:!0}),(X=D.current)==null||X.scrollIntoView({block:"nearest"})};r&&n?(_.current=n.id,I()):r&&_.current?(Y=U.current.get(_.current))==null||Y.focus({preventScroll:!0}):O&&I()},[t,r,n]);const K=(O,I)=>o.jsx(Gre,{lesson:O,state:j(O),at:N(O),blocked:$(O),describe:I,actionRef:D,onBegin:()=>w(O.id)});return o.jsx(Gs,{open:t,className:"sc-learn",maxWidth:"880px",described:!0,onDismiss:e.close,onCloseAutoFocus:b,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(Wre),"aria-label":"All lessons",children:o.jsx(Ha,{size:15})}),o.jsx(As,{className:"sc-newdlg-title",children:n.title}),o.jsx(K9,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-learn-body",children:K(n,!0)})]},`one-${n.id}`):o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Learn"}),o.jsxs("span",{className:"sc-learn-count",children:[H," of ",il.length," done"]}),o.jsx(K9,{})]}),o.jsx(Ic,{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:il.map(O=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-learn-row","data-state":j(O),"aria-current":!r&&R.id===O.id?"true":void 0,ref:I=>{I?U.current.set(O.id,I):U.current.delete(O.id)},onClick:()=>e.set(Bw(O.id)),children:[o.jsx("span",{className:"sc-learn-thumb",children:o.jsx("img",{src:j4[O.id].square,alt:"",decoding:"async"})}),o.jsxs("span",{className:"sc-learn-say",children:[o.jsx("span",{className:"sc-learn-name",children:O.title}),o.jsx(pL,{lesson:O,state:j(O),at:N(O),blocked:$(O)})]}),(P==null?void 0:P.id)===O.id&&o.jsx("span",{className:"sc-learn-next",children:"Next"})]})},O.id))}),!r&&K(R,!1)]})]},"all")})}function Gre({lesson:e,state:t,at:n,blocked:r,describe:a,actionRef:i,onBegin:l}){const u=r?C4[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(Ic,{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:j4[e.id].wide,alt:"",decoding:"async"})}),o.jsxs("div",{className:"sc-learn-copy",children:[o.jsx("div",{className:"sc-learn-kicker",children:o.jsx(pL,{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:bM(e).map((g,m)=>{const w=h(m),y=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:w==="done"?o.jsx(Gn,{size:14,weight:"bold"}):m+1}),b=t==="active"&&m===n?"step":void 0,S=o.jsx("span",{className:"sc-learn-step-name",children:g});return o.jsx("li",{children:m===f?o.jsxs("button",{ref:i,type:"button",className:"sc-learn-step","data-state":w,"data-here":"","aria-current":b,"aria-label":`${u}: ${g}`,onClick:l,children:[y,S,o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[u," ",o.jsx(Ea,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":w,"aria-current":b,children:[y,S,w==="done"&&o.jsx("span",{className:"sc-vh",children:", done"})]})},g)})}),r&&o.jsx("p",{className:"sc-learn-note",children:C4[r].note})]})]})]})}function pL({lesson:e,state:t,at:n,blocked:r}){const a=bM(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(Gn,{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:C4[r].status}):o.jsxs("span",{className:"sc-learn-status",children:[a," step",a===1?"":"s"]})}function K9(){return o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}const mL=s.createContext(null),Yre={products:[],productsLoaded:!1,importing:!1,refreshProducts:async()=>{}};function un(){const e=s.useContext(mL),t=ZR()??Yre;if(!e)throw new Error("useBrand must be used inside BrandLayout");return s.useMemo(()=>({...e,...t}),[e,t])}const gL=s.createContext(null);function qre(){const e=s.useContext(gL);if(!e)throw new Error("useAssetsPanel must be used inside BrandLayout");return e}function Xre(){const{brandSlug:e}=ia(),{pathname:t,search:n}=Bn(),r=gn({path:pt.brand,end:!1}),{brands:a,engines:i,refresh:l}=Mn(),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,m]=s.useState([]),[w,y]=s.useState([]),[b,S]=s.useState({}),[k,C]=s.useState(!1),[E,A]=s.useState(0),L=s.useCallback(()=>A(re=>re+1),[]),$=Un(),[N,j]=Pa(Qr.assetsOpen,window.innerWidth>=1280),P=s.useCallback(()=>j(re=>!re),[]),R=s.useMemo(()=>({open:N,toggle:P,setOpen:j}),[N,P]);UX();const H=s.useRef(null),D=a.find(re=>re.slug===e)??a.find(re=>re.id===e)??a.find(re=>re.id===H.current)??null;D&&(H.current=D.id);const U=s.useRef(D==null?void 0:D.id);U.current=D==null?void 0:D.id;const _=s.useCallback(async()=>{if(!D)return;const re=D.id,ee=await Ee.workspace(re);U.current===re&&(f(ee.project),p(ee.root),m(ee.recent),y(ee.sets),S(ee.membership),C(!0))},[D==null?void 0:D.id]),B=s.useRef(new Set),K=s.useCallback(re=>(B.current.add(re),()=>{B.current.delete(re)}),[]),V=s.useCallback(re=>{if(re.length){m(ee=>aee(ee,re));for(const ee of B.current)ee(re)}},[]),O=s.useCallback((re,ee)=>{!D||re!==D.id||V(ee)},[D==null?void 0:D.id,V]),I=s.useCallback(re=>y(ee=>ee.map(q=>q.id===re.id?re:q)),[]),Y=s.useCallback(re=>y(ee=>ee.filter(q=>q.id!==re)),[]),Z=s.useCallback(re=>y(ee=>ee.some(q=>q.id===re.id)?ee:[re,...ee]),[]),X=s.useCallback((re,ee)=>S(q=>({...q,[re]:ee})),[]),z=s.useMemo(()=>D?{brand:D,workspace:(u==null?void 0:u.brandId)===D.id?u:null,root:h,recent:g,sets:w,membership:b,loaded:k,refresh:_,applySet:I,dropSet:Y,insertSet:Z,applyMembership:X,applyNodes:V,subscribeActivity:K,shotsEpoch:E,resetShots:L}:null,[D,u,h,g,w,b,k,_,I,Y,Z,X,V,K,E,L]);s.useEffect(()=>{C(!1),m([]),p(null)},[D==null?void 0:D.id]),s.useEffect(()=>{D&&_K(D.id)},[D==null?void 0:D.id]),s.useEffect(()=>{_()},[_]);const J=s.useCallback(()=>{l(),_()},[l,_]),he=r?t.slice(r.pathnameBase.length):"",te=!!D&&e!==D.slug,me=D?Ho(D)+he+n:"";if(s.useEffect(()=>{te&&$(me,{replace:!0})},[te,me,$]),!D){const re=dP(a),ee=!!H.current&&!a.some(Oe=>Oe.id===H.current),q=new URLSearchParams(n);ee&&(q.delete("settings"),q.delete("new"));const ie=q.toString();return o.jsx(Ta,{to:re?Ho(re)+he+(ie?`?${ie}`:""):pt.root,replace:!0})}return o.jsxs(mL.Provider,{value:z,children:[o.jsx(xJ,{engines:i,brandId:D.id,onSaved:J}),o.jsx(XJ,{engines:i,onSaved:l}),o.jsx(UJ,{}),o.jsx(iq,{brand:D,onActivity:O,children:o.jsxs(WX,{brand:D,children:[o.jsx(tse,{}),o.jsx($X,{children:o.jsxs(gL.Provider,{value:R,children:[o.jsxs("div",{className:"sc-shell",children:[o.jsx(zX,{}),o.jsx(zc,{}),o.jsx(kq,{})]}),o.jsx(Bre,{}),o.jsx(Kre,{}),o.jsx(Cee,{})]})})]})})]})}const Qre=Number(window.localStorage.getItem("scenri:whatsnew-settle-ms")??2500)||2500,vL=s.createContext(null);function tu(){const e=s.useContext(vL);if(!e)throw new Error("useWhatsNew must be used inside WhatsNewProvider");return e}function Jre({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState("loading"),[i,l]=s.useState(!1),[u,f]=s.useState([]),h=Nr("whatsnew");s.useEffect(()=>{let N=!0;return Ee.releaseNotes().then(j=>{if(N){if(f(j.newFeatures??[]),!Array.isArray(j.recent)){a("failed");return}n({...j,releasesUrl:j.releasesUrl??null,history:j.history??j.recent,unseen:j.unseen??[],lead:j.lead??null}),a("ready")}}).catch(()=>{N&&a("failed")}),()=>{N=!1}},[]);const p=(t==null?void 0:t.recent)??G9,g=p[0]??null,m=s.useMemo(()=>p.find(N=>N.version===(t==null?void 0:t.lead))??null,[p,t==null?void 0:t.lead]),w=h.open,y=(m==null?void 0:m.version)??null,b=s.useCallback(()=>{l(!0),y&&w(y)},[w,y]),S=s.useRef(null),k=s.useCallback(()=>{!t||t.unseen.length===0||S.current===t.version||(S.current=t.version,n({...t,seen:t.version,unseen:[],lead:null}),Ee.releaseSeen(t.version).catch(()=>{}))},[t]),C=(t==null?void 0:t.releasesUrl)??null,E=s.useCallback(N=>C?`${C}/tag/v${N}`:null,[C]),A=s.useCallback(N=>u.includes(N),[u]),L=s.useCallback(N=>{u.includes(N)&&(f(j=>j.filter(P=>P!==N)),Ee.releaseUsed(N).catch(()=>{}))},[u]),$=s.useMemo(()=>({status:r,recent:p,history:(t==null?void 0:t.history)??G9,featured:g,running:t&&t.version!=="0.0.0"?t.version:null,unseen:(t==null?void 0:t.unseen)??ese,lead:m,releasesUrl:C,notesFor:E,unread:((t==null?void 0:t.unseen.length)??0)>0,autoOpenSpent:i,autoOpen:b,markSeen:k,isNew:A,markUsed:L}),[r,t,p,g,m,C,E,i,b,k,A,L]);return o.jsx(vL.Provider,{value:$,children:e})}const G9=[],ese=[];function tse(){var k;const e=tu(),{running:t,builds:n}=ua(),{loaded:r}=un(),[a]=Ml(),i=!!gn(pt.whatsNew),[l,u]=s.useState(()=>!document.hidden),f=s.useRef(!1),h=Zw(),p=Nee(),g=h.eligible&&h.welcome===null,m=g||p||((k=h.active)==null?void 0:k.task)==="first-shot"&&!h.active.paused,w=!h.loaded||m;m&&(f.current=!0);const y=s.useRef(!1),{markSeen:b}=e;s.useEffect(()=>{g?y.current=!0:y.current&&(y.current=!1,b())},[g,b]),s.useEffect(()=>{const C=()=>u(!document.hidden);return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[]);const S=kM.some(C=>a.has(C));return s.useEffect(()=>{if(!CJ({lead:e.lead!==null,spent:f.current||e.autoOpenSpent,loaded:r,visible:l,dialogOpen:S,running:t,builds:n,firstUse:w,onPage:i}))return;const E=window.setTimeout(()=>{f.current=!0,e.autoOpen()},Qre);return()=>window.clearTimeout(E)},[e,r,l,S,t,n,w,i]),null}function nse(e,t){return!!e&&e.arriving===t.arriving&&e.installs===t.installs&&(e.landed??0)===(t.landed??0)&&(e.failed??0)===(t.failed??0)&&(e.outcome??null)===(t.outcome??null)}function rse(e,t){return e?e.installs!==t.installs||(e.landed??0)!==(t.landed??0)||(e.outcome??null)!==(t.outcome??null):t.installs>0||(t.landed??0)>0}function sse(e,t){return e?e.arriving||t:!0}const ase=5e3,wL=s.createContext(null);function Mn(){const e=s.useContext(wL);if(!e)throw new Error("useAppData must be used inside AppShell");return e}function ose(){const e=jG(),[t,n]=s.useState(null),[r,a]=s.useState([]),[i,l]=s.useState(null),u=NG(),f=RG(),h=LG(),p=$G(),[g,m]=s.useState(null),w=s.useCallback(V=>{V&&m(O=>nse(O,V)?O:V)},[]),y=s.useRef(null),[b,S]=s.useState(!1),[k,C]=s.useState(0),{refetch:E}=u,{refetch:A}=f,{refetch:L}=h,{refetch:$}=p;s.useEffect(()=>{if(!g)return;const V=y.current;if(y.current=g,!rse(V,g))return;const O=!g.arriving;O&&S(!0),C(I=>I+1),Promise.all([E,A,L,$].map(I=>I({quiet:!0}))).finally(()=>{O&&S(!1)})},[g,E,A,L,$]);const N=sse(g,b),j=s.useRef(0),P=s.useRef(new Map),R=s.useRef(0),H=s.useRef(!1),D=s.useCallback(V=>{P.current.set(V.id,++j.current),n(O=>O&&aY(O,V))},[]),U=s.useCallback(async()=>{const V=++j.current;R.current=V;const O=await Ee.brands();if(R.current!==V)return;const I=new Set;for(const[Y,Z]of P.current)Z>V&&I.add(Y);n(Y=>oY(Y,O,I))},[]),_=s.useCallback(()=>U().catch(()=>{}),[U]),B=s.useCallback(async()=>{try{await Promise.all([U(),Ee.engines().then(a)]),H.current=!0}catch(V){H.current||l(String(V.message??V))}},[U]);s.useEffect(()=>{B(),pG()},[B]),s.useEffect(()=>{let V=0;const O=()=>{document.hidden||Date.now()-V<ase||(V=Date.now(),_())};return document.addEventListener("visibilitychange",O),window.addEventListener("focus",O),()=>{document.removeEventListener("visibilitychange",O),window.removeEventListener("focus",O)}},[_]);const K=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:B,refreshBrands:_,applyBrand:D,contentArriving:N,libraryTick:k,noteContent:w},[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,B,_,D,N,k,w]);return i?o.jsx(Zs,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Ww,{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(Zs,{align:"center",justify:"center",height:"100vh",children:o.jsx(Tr,{size:"3"})}):o.jsx(wL.Provider,{value:K,children:o.jsx(vM.Provider,{value:e,children:o.jsx(eY,{children:o.jsxs(Jre,{children:[o.jsx(lE,{}),o.jsx(zc,{})]})})})})}function Nr(e){const[t,n]=Ml(),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 Zh(e,t=""){const[n,r]=Ml(),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 Y9(e,t){const n=q9(t.name),r=X9(t.url);return!n&&!r?null:e.find(a=>{var i,l,u,f;return!!(r&&X9((l=(i=a.json)==null?void 0:i.meta)==null?void 0:l.website)===r||n&&q9(((f=(u=a.json)==null?void 0:u.meta)==null?void 0:f.name)??a.slug)===n)})??null}const q9=e=>String(e??"").trim().replace(/\s+/g," ").toLowerCase()||null,X9=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 ise(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 lse(e){return e.logo.status!=="primary"||e.colors.count===0||e.name.source==="hostname"}const N0=(e,t=!1)=>({key:"products",found:t,label:"Products",value:e});function cse(e){switch(e.kind){case"idle":return null;case"scanning":return N0("looking for a shop");case"timeout":return N0("this site took too long to search");case"error":return N0("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 N0(`${n?"about ":""}${t.count.toLocaleString()} found`,!0)}return N0("we could not load the catalogue")}}}function use(e){return e.kind==="timeout"||e.kind==="error"?!0:e.kind==="result"&&(e.scan.verdict==="blocked"||e.scan.verdict==="likely")}function dse(e){var t;return(e==null?void 0:e.verdict)!=="found"?!1:e.candidates.length>0||(((t=e.cards)==null?void 0:t.length)??0)>0}function fse(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 hse(){var re,ee,q,ie,Oe,ae;const{brands:e,refresh:t}=Mn(),n=Un(),r=e.length>0,[a,i]=s.useState(""),[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(!1),[m,w]=s.useState(null),[y,b]=s.useState(null),[S,k]=s.useState(!1),[C,E]=s.useState(!1),[A,L]=s.useState(null),[$,N]=s.useState(null),[j,P]=s.useState(null),[R,H]=s.useState(null),D=s.useRef(!1),U=s.useRef(null),_=async(pe,Te)=>{D.current=!0,U.current=null,b(pe),await t(),n(`${Ho(pe)}${Te?`?settings=${Te}`:""}`,{replace:!0})},B=s.useRef(!1);s.useEffect(()=>{B.current=!1;const pe=()=>{const Te=U.current;!Te||D.current||(U.current=null,fetch(`/api/brands/${Te}`,{method:"DELETE",keepalive:!0}).catch(()=>{}))};return window.addEventListener("pagehide",pe),()=>{B.current=!0,window.removeEventListener("pagehide",pe),pe()}},[]);const K=async(pe=!1)=>{var Te,gt;if(!pe){const Ze=Y9(e,{url:a.trim()});if(Ze){H(Ze);return}}g(!0),w(null);try{const Ze=await Ee.brandFromUrl(a);if(B.current){fetch(`/api/brands/${Ze.id}`,{method:"DELETE",keepalive:!0}).catch(()=>{});return}b(Ze),U.current=Ze.id,L(Ze.report),N(((Te=Ze.report)==null?void 0:Te.read)===!1&&((gt=Ze.warnings)==null?void 0:gt.slice(0,2).join(" "))||null),g(!1)}catch(Ze){w(String(Ze.message??Ze)),g(!1)}},V=async(pe=!1)=>{if(!pe){const Te=Y9(e,{name:l});if(Te){H(Te);return}}g(!0),w(null);try{await _(await Ee.createBrand({specVersion:"0.1",meta:{name:l.trim()||"Untitled brand"}}))}catch(Te){w(String(Te.message??Te)),g(!1)}},O=()=>n("/",{replace:!0}),{scan:I,scanning:Y,outcome:Z,retry:X}=TR((y==null?void 0:y.id)??null),z=cse(Z),J=Z.kind==="timeout"||Z.kind==="error",he=async pe=>{var Te,gt;if(y){P(null),E(!0);try{await Ee.catalogImport(y.id,String(((gt=(Te=y.json)==null?void 0:Te.meta)==null?void 0:gt.website)??a),pe)}catch{P("That did not start. Check your connection and try again."),E(!1);return}E(!1),k(!1),await _(y)}},te=y?aa((re=y.json)==null?void 0:re.palette):[],me=y?es((ee=fq(y.json))==null?void 0:ee.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:O,style:r?void 0:{visibility:"hidden"},children:[o.jsx(Ha,{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&&A?o.jsxs(o.Fragment,{children:["Built from ",A.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:Y?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",disabled:!0,children:[o.jsx(Tr,{size:"1"})," Looking for products"]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(y),children:"Skip and add the brand only"})})]}):J?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:X,children:["Look for products again ",o.jsx(Ea,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(y),children:"Continue without products"})})]}):dse(I)?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>k(!0),children:["Add brand and products ",o.jsx(Ea,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(y),children:"Just the brand"})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>void _(y),children:["Looks right ",o.jsx(Ea,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(y,"brand"),children:A&&lse(A)?"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:pe=>{u(pe.target.value),H(null)},onKeyDown:pe=>pe.key==="Enter"&&l.trim()&&!p&&void V()}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!l.trim()||p,onClick:()=>void V(),children:p?o.jsx(Tr,{size:"1"}):o.jsxs(o.Fragment,{children:["Create it ",o.jsx(Ea,{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:pe=>{i(pe.target.value),H(null)},onKeyDown:pe=>pe.key==="Enter"&&a.trim()&&!p&&void K()}),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 K(),children:p?o.jsx(Tr,{size:"1"}):o.jsxs(o.Fragment,{children:["Build the kit ",o.jsx(Ea,{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"})})]})]}),R&&o.jsxs(h4,{color:"amber",mt:"3",size:"1",children:[o.jsxs(p4,{children:["You already have ",Na(R),". 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(Ho(R)),children:["Open ",Na(R)," instead"]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{H(null),f?V(!0):K(!0)},children:"Create anyway"})]})]}),m&&o.jsx(h4,{color:"red",mt:"3",size:"1",children:o.jsx(p4,{children:m})})]})]}),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(Tr,{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:te.length?16:0},children:[o.jsx("span",{className:"sc-kit-logo",style:{width:44,height:44,padding:7,borderRadius:12},children:me?o.jsx("img",{src:me,alt:""}):o.jsx(Oa,{size:16,color:"var(--sc-fg3)"})}),o.jsxs("span",{children:[o.jsx("b",{dir:"auto",style:{fontFamily:"var(--sc-font-display)",fontSize:16},children:(ie=(q=y.json)==null?void 0:q.meta)==null?void 0:ie.name}),((ae=(Oe=y.json)==null?void 0:Oe.meta)==null?void 0:ae.tagline)&&o.jsx("small",{dir:"auto",style:{display:"block",color:"var(--sc-fg3)",fontSize:11.5},children:fse(String(y.json.meta.tagline),72)})]})]}),te.length>0&&o.jsx("div",{style:{display:"flex",gap:8},children:te.slice(0,5).map(pe=>o.jsx("span",{style:{flex:1,height:44,borderRadius:9,border:"1px solid var(--sc-line)",background:pe.hex}},pe.hex))}),A&&o.jsx("ul",{className:"sc-kit-lines",role:"status",children:[...ise(A),...z?[z]:[]].map(pe=>o.jsxs("li",{"data-found":pe.found?"":void 0,children:[pe.key==="products"&&Y?o.jsx(Tr,{size:"1"}):pe.found?o.jsx(Gn,{size:12,weight:"bold"}):o.jsx(WF,{size:12}),o.jsx("span",{className:"sc-kit-line-label",children:pe.label}),o.jsx("span",{className:"sc-kit-line-value",children:pe.value})]},pe.key))}),$&&o.jsx("p",{className:"sc-kit-note",role:"status",children:$}),!Y&&!J&&use(Z)&&o.jsx("button",{type:"button",className:"sc-wizpick-open",onClick:X,children:"Try the catalogue again"})]})]})]})}),S&&I&&y&&o.jsx(LR,{brandId:y.id,scan:I,busy:C,error:j,onImport:pe=>void he(pe),onImportAll:()=>void he(),onDismiss:()=>k(!1)})]})}const zu=e=>{const t=(e??"").trim();return t||null};function pse(e){const t=e;return{name:e.name,brand:zu(t.brand)??zu(t.vendor),qualifier:zu(t.format)??zu(t.subcategory)??zu(t.variant)}}function mse(e){return!e.brand||e.name.toLowerCase().startsWith(e.brand.toLowerCase())?e.name:`${e.brand} ${e.name}`}function Oo(e,t){const n=pse(e);if(t==="chip")return n.name;const r=mse(n);return t==="tooltip"?[r,n.qualifier].filter(Boolean).join(" · "):r}function jl(e,t){return t==="tooltip"?[e.name,zu(e.lighting)].filter(Boolean).join(" · "):e.name}function Xp(e){return[e.name,...e.legacyNames??[],...e.keywords??[],e.description,e.lighting,e.subject].concat(e.collections??[],e.verticals??[]).filter(Boolean).join(" ")}function Ly(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 Qp(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 gse(e,t,n){return[e.title,e.category,n,t.product?Ly(t.product):null,t.presenter?Qp(t.presenter):null,t.scene?Xp(t.scene):null].filter(Boolean).join(" ")}function Ty(){const{brand:e}=un(),t=Un(),n=jr(e);return s.useCallback(r=>{t(`${n}?${kd("presenter",r)}&compose=1${jc()}`)},[n,t])}function x2(){const{brand:e}=un(),t=Un(),n=jr(e);return s.useCallback((r,a,i,l)=>{const u=a?`&setup=${encodeURIComponent(a)}`:"",f=i?`&ref=${encodeURIComponent(i)}${l?`&view=${l}`:""}`:"";t(`${n}?${kd("scene",r)}${u}${f}&compose=1${jc()}`)},[n,t])}function sv(e){return{...e.brief,...e.quality?{quality:e.quality}:{},_at:Date.now()}}function vse(){const{brand:e}=un(),t=Un(),n=jr(e);return s.useCallback(r=>{t(`${n}?showcase=${encodeURIComponent(r)}`)},[n,t])}const mp=e=>`sc-favscenes-${e}`,wse=e=>`sc-favlooks-${e}`,yse=e=>`bt-favlooks-${e}`;function yL(e,t){return e==="presenter"?`sc-favpresenters-${t}`:e==="product"?`sc-favproducts-${t}`:mp(t)}function bL(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function ji(e){try{const t=localStorage.getItem(mp(e))??v4(wse(e),mp(e))??v4(yse(e),mp(e));return bL(t)}catch{return[]}}function Ad(e,t){try{return e==="scene"?ji(t):bL(localStorage.getItem(yL(e,t)))}catch{return[]}}function xL(e,t,n){try{localStorage.setItem(yL(e,t),JSON.stringify(n))}catch{}}function k2(e,t,n){const r=Ad(e,t),a=r.includes(n)?r.filter(i=>i!==n):[...r,n];return xL(e,t,a),a}function $y(e,t,n,r){const a=Ad(e,t),i=r?[...a,...n.filter(l=>!a.includes(l))]:a.filter(l=>!n.includes(l));return xL(e,t,i),i}const kL=[{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"}],bse=new Map(kL.map(e=>[e.key,e]));function d6(e){var t;return e?((t=bse.get(e))==null?void 0:t.label)??e:null}function xse(e){const t=new Map(kL.map((n,r)=>[n.key,r]));return[...e].sort((n,r)=>(t.get(n)??99)-(t.get(r)??99)||n.localeCompare(r))}function kse(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},m=0;const w=P=>{P.style.position="fixed",P.style.left="0",P.style.top="0",P.style.margin="0",P.style.zIndex="var(--sc-z-popover)",P.style.pointerEvents="none"},y=()=>{const P=R=>{var H,D;window.removeEventListener("click",P,!0),!((D=(H=R.target).closest)!=null&&D.call(H,'[data-role="remove"]'))&&(R.stopPropagation(),R.preventDefault())};window.addEventListener("click",P,!0),setTimeout(()=>window.removeEventListener("click",P,!0),250)},b=()=>{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(m)},S=P=>{!e.isConnected||!e.contains(document.activeElement)||(f!==null?Ya(e,f):Sc(e,P,"after"))},k=()=>{if(!a)return;const P=a;b(),y(),S(P),t.onCancelled()},C=P=>{if(P.button!==0||P.pointerType==="touch")return;const R=P.target;if(R.closest('[data-role="remove"]'))return;const H=rl(R);H&&(r={chip:H,x:P.clientX,y:P.clientY})},E=P=>{var H,D;if(!r)return;f=So(e),a=r.chip,t.onDragStart(),(H=window.getSelection())==null||H.removeAllRanges(),e.setAttribute("data-chip-drag","");const R=a.getBoundingClientRect();p={dx:r.x-R.left,dy:r.y-R.top},r=null;try{e.setPointerCapture(P.pointerId),h=P.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=`${R.width}px`,i.style.height=`${R.height}px`,i.style.fontSize=getComputedStyle(a).fontSize,g={w:R.width,h:R.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),A(P)},A=P=>{if(!i||!a)return;const R=Math.min(Math.max(4,P.clientX-p.dx),window.innerWidth-g.w-4),H=Math.min(Math.max(4,P.clientY-p.dy),window.innerHeight-g.h-4);i.style.transform=`translate3d(${R}px, ${H}px, 0)`;const D=t9(e,a,P.clientX,P.clientY);if(u=D,!l)return;const U=D&&!D.noop?Q9(e,D.units):null;if(!U||!D){l.style.display="none";return}const _=Yee(e,D.units),B=_<D.units?Q9(e,_):null,K=!!B&&Math.abs(B.top+B.height/2-(U.top+U.height/2))<U.height/2,V=B&&K?(B.left+U.left)/2:U.left;l.style.display="",l.style.transform=`translate3d(${V-1.5}px, ${U.top-2}px, 0)`,l.style.height=`${U.height+4}px`},L=P=>{if(r){if(Math.hypot(P.clientX-r.x,P.clientY-r.y)<5)return;P.preventDefault(),E(P);return}if(!a)return;P.preventDefault(),cancelAnimationFrame(m);const{clientX:R,clientY:H}=P;m=requestAnimationFrame(()=>A({clientX:R,clientY:H}))},$=P=>{if(r){r=null;return}if(!a)return;const R=a;let H;try{H=t9(e,R,P.clientX,P.clientY)??u}catch{H=u}finally{b()}if(y(),H&&!H.noop&&PP(e,R,H.units)){Sc(e,R,"after"),t.onMoved(R,X4(e,R));return}S(R),t.onCancelled()},N=P=>{P.key==="Escape"&&a&&(P.stopPropagation(),k())},j=P=>{rl(P.target)&&P.preventDefault()};return e.addEventListener("pointerdown",C),e.addEventListener("dragstart",j),e.addEventListener("lostpointercapture",k),window.addEventListener("pointermove",L),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",k),window.addEventListener("blur",k),window.addEventListener("keydown",N,!0),()=>{b(),e.removeEventListener("pointerdown",C),e.removeEventListener("dragstart",j),e.removeEventListener("lostpointercapture",k),window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",k),window.removeEventListener("blur",k),window.removeEventListener("keydown",N,!0)}}function Q9(e,t){let n=0;const r=Array.from(e.childNodes);for(let l=0;l<r.length;l++){const u=r[l],f=Cd(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 m=u.getBoundingClientRect();return new DOMRect(t===n?m.left:m.right,m.top,0,m.height)}const p=document.createRange();p.setStart(u,zp(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 Sse({kind:e,label:t,thumb:n,onInspect:r,onMove:a,onRemove:i,onClose:l}){const{sheet:u,grip:f}=Od(()=>l("dismiss")),h=e==="mark"?"brand mark":"reference image";return o.jsx(Ll,{open:!0,onOpenChange:p=>!p&&l("dismiss"),children:o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-shotsheet-scrim"}),o.jsxs(Dl,{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(Hl,{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(Fv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(1),children:["Move later ",o.jsx(Ea,{size:13})]})]}),i&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:i,children:[o.jsx(Pl,{size:13}),"Remove ",e==="mark"?"mark":"reference"]})]})]})]})})}const Ese=440,Cse=460,jse=600,J9=156,SL=8,gp=14,f6=20,kr=12,EL=200,Ase=240,CL=204;function Nse(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-kr*2),i=e.right+gp+r+kr<=t.width?e.right+gp:Math.max(kr,e.left-gp-r),l=Math.max(kr,Math.min(e.top,t.height-kr-CL));return{left:i,top:l,width:r,maxHeight:Math.max(EL,t.height-l-kr),side:"beside"}}function Mse(e,t){const n=(r,a)=>Math.min(Math.max(r,f6),Math.max(f6,a-f6));return t.side==="beside"?{edge:t.left>=e.right?"left":"right",x:0,y:n((e.top+e.bottom)/2-t.top,CL)}:{edge:t.side==="above"?"bottom":"top",x:n((e.left+e.right)/2-t.left,t.width),y:0}}function Rse(e,t,n,r){if(e.bottom<0||e.top>t.height)return null;const a=SL,i=Math.min(n.width,t.width-kr*2),l=n.height,u=Math.min(Math.max(e.left+(e.right-e.left)/2-i/2,kr),Math.max(kr,t.width-i-kr)),h=e.top-a-kr>=l?e.top-a-l:Math.min(e.bottom+a,Math.max(kr,t.height-l-kr));return{left:u,top:h}}function Dy(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min((n==null?void 0:n.width)??Ese,t.width-kr*2),a=(n==null?void 0:n.gap)??SL,i=e.top-a-kr,l=t.height-e.bottom-a-kr,u=i>=Ase||i>=l?"above":"below",f=u==="above"?i:l,h=Math.max(EL,Math.min((n==null?void 0:n.maxHeight)??Cse,f)),p=Math.min(Math.max(e.left,kr),Math.max(kr,t.width-r-kr)),g=u==="above"?Math.max(kr,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 jL(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 Pse=["ref","mark","product","presenter","scene","shot"],vp=e=>Pse.includes(e),AL={ref:"Reference image",mark:"Brand mark",product:"Product",presenter:"Person",scene:"Place",shot:"Shot"};function Lse(e){return e.side==="below"||e.side==="beside"?{top:Math.round(e.top)}:{bottom:Math.round(window.innerHeight-(e.top+e.maxHeight))}}function Vd({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[m,w]=s.useState(null),[y,b]=s.useState(!1);if(s.useEffect(()=>b(!1),[n]),s.useLayoutEffect(()=>{var C,E;const k=()=>{const A=window.visualViewport,L=e.getBoundingClientRect(),$={width:(A==null?void 0:A.width)??window.innerWidth,height:(A==null?void 0:A.height)??window.innerHeight},N=u==="beside"?Nse(L,$,{width:J9}):Dy(L,$,{width:J9,gap:gp});if(!N){g();return}w({...N,tail:Mse(L,N)})};return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),(C=window.visualViewport)==null||C.addEventListener("resize",k),(E=window.visualViewport)==null||E.addEventListener("scroll",k),()=>{var A,L;window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0),(A=window.visualViewport)==null||A.removeEventListener("resize",k),(L=window.visualViewport)==null||L.removeEventListener("scroll",k)}},[e,u,g]),s.useEffect(()=>{const k=C=>{C.key==="Escape"&&g()};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[g]),!m)return null;const S=l??AL[t];return Ur.createPortal(o.jsxs("div",{className:"sc-chip-preview","data-kind":t,"data-side":m.side,"aria-hidden":"true",style:{left:Math.round(m.left),...Lse(m),maxWidth:m.width,maxHeight:m.maxHeight},onPointerEnter:h,onPointerLeave:p,children:[o.jsx("span",{className:"sc-chip-preview-tail","data-edge":m.tail.edge,style:m.tail.edge==="left"||m.tail.edge==="right"?{top:Math.round(m.tail.y)}:{left:Math.round(m.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(Oa,{size:20}),"Image unavailable"]}):o.jsx("img",{className:"sc-chip-preview-plate",src:n,alt:"",decoding:"async",onError:()=>b(!0)}),r&&o.jsx("b",{dir:"auto",children:r}),S&&o.jsx("span",{children:S})]}),i&&o.jsx("p",{className:"sc-chip-preview-note",children:i}),a&&o.jsx("p",{className:"sc-swap-warn",children:a})]}),document.body)}const Tse=160,$se=120;function Zd(){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),Tse)},[a]),l=s.useCallback(()=>{a(),n.current=setTimeout(()=>t(null),$se)},[a]),u=s.useCallback(()=>{a(),t(null)},[a]);return s.useEffect(()=>a,[a]),{shown:e,open:i,keep:a,close:l,closeNow:u}}const Z0="sc-insert-menu";function Dse(e){var t;return!!(((t=e.nativeEvent)==null?void 0:t.isComposing)??e.isComposing)||e.keyCode===229}function Hse(e){return e==="/"?"Places":e==="@"?"People":e==="#"?"Colors":"Products"}function Ose(e){return e==="/"?"No matching places":e==="#"?"No matching colours":e==="@"?"No matching people":"No matching products"}function Ise({menuOpen:e,handled:t}){return!e&&!t}function Fse(e,t){return t||!e?{open:!1}:{open:!0,sigil:e.sigil,query:e.query}}function _se(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 Vse(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.right-e.left,h:e.bottom-e.top}}function Zse(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 zse(e,t,n){return n?t:e||t}function Bse(e,t){return!t||e==null?!0:e===t?!1:!t.contains(e)}function h6(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 Use(e,t,n){return Math.min(n,Math.max(0,e)+Math.max(0,t))}function Wse(e,t,n){return n>0&&t>0&&e!==t}function Kse(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 NL=320,Jp=320,Gse=280,yc=8,mc=12,Yse=8,e7=80,qse=120,ML=48;function RL(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>ML)}function Xse(e){return{top:e.top,bottom:Math.min(e.bottom,e.top+22),left:e.left,right:e.left+2}}function PL(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n.width-t-r))}function av(e,t,n,r){const a=n?Yse:mc,i=n?Math.max(0,e.right-e.left):Math.min(NL,t.width-a*2),l=n?e.left:PL(e.left,i,t,a),u=n?Math.min(Gse,Math.floor(t.height*.4)):Jp,f=Math.min(u,r??u),h=e.top-yc-a,p=Math.max(0,Math.min(f,h)),g=Math.max(a,e.top-yc-p);return{left:l,top:g,width:i,maxHeight:p,side:"above",shell:"dock"}}function t7(e,t,n,r){const a=Math.min(NL,n.width-mc*2),i=PL(e.left,a,n,mc),l=e.top-yc-mc,u=n.height-e.bottom-yc-mc,f=l>=qse||l>=u?"above":"below",h=Math.min(Jp,r??Jp),p=f==="above"?l:u,g=Math.min(h,r==null?Math.max(e7,p):p);if(f==="above"){const w=Math.max(mc,e.top-yc-Math.min(h,l)),y=Math.min(h,e.top-yc-w);return r==null&&y<e7?av(t,n,!1):{left:i,top:w,width:a,maxHeight:y,side:f,shell:"caret"}}const m=e.bottom+yc;return m+Math.min(g,u)>n.height-mc?av(t,n,!1,r):{left:i,top:m,width:a,maxHeight:Math.min(h,u),side:f,shell:"caret"}}function Qse(e,t,n,r={}){if(r.phone)return av(t,n,!0,r.height);const a=r.line??t;if(RL(e,n)&&e)return t7(e,t,n,r.height);const i=e&&e.right-e.left>ML?e:a;return t7(Xse(i),t,n,r.height)}function Jse({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=Or(da),[m,w]=s.useState(0),[y,b]=s.useState(null),S=s.useRef(null),k=s.useRef(null),C=s.useRef(null),E=s.useRef(null),A=`${u??""}\0${r}`,L=s.useRef({}),$=s.useRef(f);$.current=f;const N=s.useRef(i);N.current=i;const j=s.useRef(0),P=s.useCallback(()=>{var _;Wse(j.current,a.length,N.current)&&(j.current=a.length,(_=$.current)==null||_.call($))},[a.length]);s.useEffect(()=>{w(0),j.current=0},[r]),s.useEffect(()=>{w(_=>Math.min(_,Math.max(0,a.length-1)))},[a.length]),s.useEffect(()=>{E.current=null,L.current={}},[u]);const R=s.useCallback(_=>{var J;const B=t==null?void 0:t.getBoundingClientRect();if(!B)return null;const K=(n==null?void 0:n.getBoundingClientRect())??B,V=window.visualViewport,O={width:(V==null?void 0:V.width)??window.innerWidth,height:(V==null?void 0:V.height)??window.innerHeight},I=!!((J=S.current)!=null&&J.contains(document.activeElement)),Y=I?null:jP(),Z=Y&&RL(Y,O)?Y:null;Z&&(E.current=Vse(Z,K));const X=E.current?Zse(K,E.current):null,z=zse(Z,X,I)??(I?null:(e==null?void 0:e.getBoundingClientRect())??null);return Qse(z,B,O,{phone:g,line:K,height:_})},[e,t,n,g]);s.useLayoutEffect(()=>{var V,O;L.current.sigil!==u&&(L.current={sigil:u});const _=()=>{const I=N.current>0?void 0:L.current.height,Y=R(I);b(Z=>h6(Z,Y)?Z:Y)},B=I=>{Bse(I.target,S.current)&&_()};_();const K=requestAnimationFrame(_);return window.addEventListener("resize",_),window.addEventListener("scroll",B,!0),(V=window.visualViewport)==null||V.addEventListener("resize",_),(O=window.visualViewport)==null||O.addEventListener("scroll",_),()=>{var I,Y;cancelAnimationFrame(K),window.removeEventListener("resize",_),window.removeEventListener("scroll",B,!0),(I=window.visualViewport)==null||I.removeEventListener("resize",_),(Y=window.visualViewport)==null||Y.removeEventListener("scroll",_)}},[e,t,n,g,u,R]),s.useLayoutEffect(()=>{if(!y||!S.current)return;if(i>0){if(L.current.height==null&&L.current.sigil===(u??""))return;L.current={sigil:u??""};const I=R();I&&!h6(y,I)&&b(I);return}const _=S.current,B=k.current,K=B?_.offsetHeight-B.clientHeight:_.offsetHeight,V=Use(K,(B==null?void 0:B.scrollHeight)??0,Jp);if(!(V>0)||L.current.height===V&&L.current.sigil===(u??""))return;L.current={sigil:u??"",height:V};const O=R(V);!O||h6(y,O)||b(O)},[y,A,R,i,a.length,u]),s.useLayoutEffect(()=>{const _=B=>{B.isComposing||B.keyCode===229||(B.key==="ArrowDown"?(B.preventDefault(),m>=a.length-1?P():w(K=>K+1)):B.key==="ArrowUp"?(B.preventDefault(),w(K=>Math.max(0,K-1))):(B.key==="Enter"||B.key==="Tab")&&a[m]?(B.preventDefault(),a[m].run()):B.key==="Escape"&&(B.preventDefault(),p()))};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[a,m,p,P]),s.useEffect(()=>{const _=k.current,B=_==null?void 0:_.querySelector('[data-active="true"]');_&&B&&Kse(_,B)},[m]),s.useEffect(()=>{const _=C.current,B=k.current;if(!_||!B)return;const K=new IntersectionObserver(V=>{B.scrollTop<=0||V.some(O=>O.isIntersecting)&&P()},{root:B,rootMargin:"0px 0px 8px 0px"});return K.observe(_),()=>K.disconnect()},[y,A,P]);const H=a[m]?`${Z0}-opt-${m}`:null;if(s.useEffect(()=>(h==null||h(H),()=>h==null?void 0:h(null)),[H,h]),s.useEffect(()=>{const _=B=>{B.target.closest(".sc-cmd")||(Q4(B),p())};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[p]),!y)return null;const D=`${Z0}-list`,U=Hse(u);return Ur.createPortal(o.jsx("div",{className:"sc-cmd",id:Z0,"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:S,children:o.jsxs("div",{className:"sc-cmd-list",ref:k,role:"listbox","aria-label":U,id:D,children:[a.length?a.map((_,B)=>{var V;const K=B===0||_.group!==((V=a[B-1])==null?void 0:V.group);return o.jsxs("div",{children:[K&&o.jsx(n7,{name:_.group,total:l}),o.jsxs("button",{type:"button",id:`${Z0}-opt-${B}`,className:"sc-cmd-row",role:"option","aria-selected":B===m,"data-active":B===m,onMouseEnter:()=>w(B),onMouseDown:O=>Q4(O),onClick:()=>_.run(),children:[_.thumb?o.jsx("img",{src:_.thumb,alt:"","data-crop":_.crop}):_.swatch?o.jsx("span",{className:"sc-cmd-swatch",style:{background:_.swatch}}):null,o.jsx(eae,{text:_.label,query:r}),_.hint&&o.jsx("span",{className:"sc-cmd-hint",children:_.hint})]})]},_.key)}):o.jsxs(o.Fragment,{children:[o.jsx(n7,{name:U,total:l}),o.jsx("div",{className:"sc-cmd-empty",children:Ose(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:C,className:"sc-cmd-sentinel","aria-hidden":!0})]})]})}),document.body)}function n7({name:e,total:t}){return o.jsxs("div",{className:"sc-cmd-group",children:[e," ",o.jsx("span",{className:"sc-cmd-n",children:t})]})}function eae({text:e,query:t}){return o.jsx("span",{className:"sc-cmd-label",children:_se(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 tae={fragrance:["Fragrance"],footwear:["Footwear"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]},nae={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 rae(e,t){if(!t)return!1;const n=tae[t];return!!n&&n.some(r=>e.verticals.includes(r))}function sae(e,t){if(!t)return!1;const n=nae[t];return!!n&&n.some(r=>e.suitableCategories.includes(r))}function r7(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[\u200e\u200f\u061c\u202a-\u202e\u2066-\u2069]/g,"").toLowerCase()}const aae=4;function Io(e,t){const n=r7(t).trim().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=r7(e);return n.every(a=>r.includes(a)||a.length>=aae&&a.endsWith("s")&&r.includes(a.slice(0,-1)))}function Hy(e,t){return{visible:e.slice(0,t),remaining:Math.max(0,e.length-t)}}function LL(e,t){return[...e].sort((n,r)=>Number(t(r))-Number(t(n)))}function TL(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 pf={product:"product",presenter:"person",scene:"place"},oae={product:"products",presenter:"people",scene:"places"},pl=48;function iae(e){return e?e.t==="product"?"product":e.t==="character"?"presenter":e.t==="template"?"scene":null:null}function Bu(e){const t=iae(e);return t||((e==null?void 0:e.t)==="color"?"color":null)}function lae(e){const t=Bu(e);return t||((e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.t:null)}function p6(e){return(e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.imageHash:null}const Q0=e=>{const t=(e??"").trim();return t||void 0},s7=e=>(e==null?void 0:e.custom)===!0;function ml(e,t){return e==="product"?[...(t.libraryProducts.length?t.libraryProducts:t.brandProducts).map(r=>{var a,i;return a7(r,"brand",Qm((i=(a=r.shots)==null?void 0:a[0])==null?void 0:i.file,"tile"))}),...t.demoProducts.map(r=>a7(r,"catalog",r.previewUrl??null))]:e==="presenter"?[...t.presenters.map(n=>{const r=Si(n);return{kind:"presenter",id:n.id,label:n.name,full:[n.name,Q0(n.descriptor)].filter(Boolean).join(" · "),sub:Q0(n.descriptor),search:Qp(n),thumb:Tn(r.src,"tile"),crop:r.crop,source:s7(n)?"brand":"catalog",recommended:sae(n,t.productCategory),token:{t:"character",id:n.id}}}),...t.cast.map(n=>{const r=ay(n);return{kind:"presenter",id:n.id,label:n.name,full:n.name,search:n.name,thumb:Tn(r.src,"tile"),crop:r.crop,source:"brand",token:{t:"character",id:n.id}}})]:t.scenes.map(n=>({kind:"scene",id:n.id,label:jl(n,"card"),full:jl(n,"tooltip"),sub:Q0(n.lighting),search:Xp(n),thumb:Tn(n.previewUrl??null,"tile"),tint:hd(n.previewColor),source:s7(n)?"brand":"catalog",recommended:rae(n,t.productCategory),token:{t:"template",id:n.id}}))}function a7(e,t,n){return{kind:"product",id:e.id,label:Oo(e,"chip"),full:Oo(e,"tooltip"),sub:cae(e),search:Ly(e),thumb:n,source:t,token:{t:"product",id:e.id}}}function cae(e){const t=e;return Q0(t.brand)??Q0(t.vendor)}function pd(e,t){const n=t.trim();return n?e.filter(r=>Io(r.search,n)):e}function o7(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 S2(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=[...pd(a,n.query)].sort((h,p)=>o7(e,h,n.bookmarked)-o7(e,p,n.bookmarked)).map(h=>n.bookmarked.has(h.id)?{...h,bookmarked:!0}:h),{visible:u,remaining:f}=Hy(l,n.shown??pl);return{current:r,items:u,remaining:f,total:l.length}}const uae={$:"product","/":"scene","@":"presenter"},$L={Products:8,People:8,Colors:16,Places:8},DL={$:"Products","/":"Places","@":"People","#":"Colors"};function M0(e){return $L[DL[e??"$"]]}function HL(e){return{key:`${e.kind}:${e.id}`,group:e.kind==="presenter"?"People":e.kind==="scene"?"Places":"Products",label:e.label,hint:e.sub,search:e.search,thumb:e.thumb??void 0,crop:e.crop,token:e.token}}function dae(e,t,n){return S2(e,t,{currentId:null,query:"",bookmarked:n,shown:t.length}).items.map(HL)}function i7(e,t){const{visible:n,remaining:r}=Hy(e,t);return{items:n,remaining:r,total:e.length}}function fae(e,t,n={query:""}){const r=n.query.trim(),a=n.bookmarked??new Set,i=n.shown??$L[DL[e]];if(e==="#"){const h=(t.colors??[]).map(hae),p=r?h.filter(g=>Io(g.search??g.label,r)):h;return i7(p,i)}const l=uae[e],u=l==="product"?t.products:l==="presenter"?t.presenters:t.scenes??[],f=r?pd(u,r).map(HL):dae(l,u,a);return i7(f,i)}function hae(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 pae="(pointer: coarse)";function mae(e){return Or(da)?o.jsx(xae,{...e}):o.jsx(bae,{...e,onMove:void 0})}function gae(){return!Or(pae)}const vae=e=>`Remove ${pf[e]}`;function l7(e,t,n){const r={slug:t};return e==="product"?Aa(r,n):e==="presenter"?La(r,n):Br(r,n)}function OL({kind:e,currentId:t,candidates:n,brandId:r,brandSlug:a,warning:i,note:l,onPick:u,onRemove:f,onClose:h,onAttachRequest:p,onMove:g,views:m,autoFocusSearch:w}){const[y,b]=s.useState(""),[S,k]=s.useState(!1),C=async O=>{if(!(!m||S)){k(!0);try{await m.onPick(O)}finally{k(!1)}}},[E,A]=s.useState(pl),L=s.useRef(null),$=s.useRef(null),[N,j]=s.useState(0),P=s.useMemo(()=>e==="scene"?new Set(ji(r)):new Set,[e,r]);s.useEffect(()=>{A(pl),j(0)},[y]);const R=s.useMemo(()=>S2(e,n,{currentId:t,query:y,bookmarked:P,shown:E}),[e,n,t,y,P,E]);s.useLayoutEffect(()=>{var O;w&&((O=L.current)==null||O.focus({preventScroll:!0}))},[w]),s.useEffect(()=>{j(O=>Math.max(0,Math.min(O,R.items.length-1)))},[R.items.length]);const H=s.useCallback(O=>{var Y;const I=(Y=$.current)==null?void 0:Y.querySelectorAll("[data-nav]")[O];I&&(j(O),I.focus({preventScroll:!0}),I.scrollIntoView({block:"nearest"}))},[]),D=s.useCallback(()=>{const O=$.current;return O?Math.max(1,getComputedStyle(O).gridTemplateColumns.split(" ").filter(Boolean).length):1},[]),U=O=>{var X;if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),h("escape");return}const I=O.target===L.current;if(I&&O.key==="ArrowDown"){O.preventDefault(),H(0);return}if(I&&O.key==="Enter"){O.preventDefault(),R.items[0]&&u(R.items[0]);return}if(I)return;const Y=D(),Z=O.key==="ArrowRight"?1:O.key==="ArrowLeft"?-1:O.key==="ArrowDown"?Y:O.key==="ArrowUp"?-Y:0;if(Z){O.preventDefault();const z=N+Z;z<0&&Z===-Y?(X=L.current)==null||X.focus():z>=0&&z<R.items.length&&H(z);return}O.key==="Home"?(O.preventDefault(),H(0)):O.key==="End"&&(O.preventDefault(),H(R.items.length-1))},_=pf[e],B=oae[e],K=e==="product",V=!!R.current&&!!m&&m.options.length>1&&!y.trim();return o.jsxs("div",{className:"sc-swap-inner","data-sections":V||void 0,onKeyDown:U,children:[o.jsx("div",{className:"sc-swap-head",children:o.jsxs("span",{className:"sc-swap-search",children:[o.jsx(gd,{size:13}),o.jsx("input",{ref:L,type:"text",value:y,onChange:O=>b(O.target.value),placeholder:`Search ${B}`,"aria-label":`Search ${B}`,autoComplete:"off",spellCheck:!1})]})}),R.current&&!V&&o.jsxs("div",{className:"sc-swap-cur",title:R.current.full,children:[o.jsx(c7,{src:R.current.thumb,tinted:!!R.current.tint,crop:R.current.crop}),o.jsxs("span",{className:"sc-swap-curtext",children:[o.jsx("b",{dir:"auto",children:R.current.label}),R.current.sub&&o.jsx("span",{dir:"auto",children:R.current.sub})]}),o.jsx("a",{className:"sc-swap-open",href:l7(e,a,R.current.id),target:"_blank",rel:"noreferrer",title:`Open this ${_} in a new tab`,"aria-label":`Open ${R.current.label} in a new tab`,children:o.jsx(Mc,{size:14})}),o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]}),o.jsxs("div",{className:"sc-swap-body",children:[V&&R.current&&m&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsx("span",{className:"sc-ap-sec-title",dir:"auto",children:R.current.label}),o.jsxs("a",{className:"sc-ap-sec-act sc-swap-sec-open",href:l7(e,a,R.current.id),target:"_blank",rel:"noreferrer","aria-label":`Open ${R.current.label} in a new tab`,children:["Open",o.jsx(Mc,{size:12})]})]}),o.jsxs("fieldset",{className:"sc-swap-this","aria-label":`${R.current.label}: the picture a shot follows`,"aria-busy":S||void 0,children:[o.jsx(wae,{views:m.options,on:!m.picked,disabled:S,onPress:()=>void C(null)}),m.options.map(O=>o.jsx(yae,{option:O,on:m.picked===O.view,disabled:S,onPress:()=>void C(m.picked===O.view?null:O)},O.view))]}),o.jsx("div",{className:"sc-ap-sec sc-swap-sec-others",children:o.jsxs("span",{className:"sc-ap-sec-title",children:["Other ",B,o.jsx("span",{className:"sc-ap-sec-n",children:R.total})]})})]}),R.items.length===0&&o.jsx("p",{className:"sc-swap-empty",children:y.trim()?`Nothing matches “${y.trim()}”.`:`No other ${B}.`}),o.jsx("div",{className:"sc-swap-grid",ref:$,role:"listbox","aria-label":`Choose a ${_}`,children:R.items.map((O,I)=>o.jsxs("div",{className:"sc-swap-card",role:"option","aria-selected":!1,"data-nav":I,tabIndex:I===N?0:-1,title:O.full,style:O.tint?{"--tint":O.tint}:void 0,onFocus:()=>j(I),onClick:()=>u(O),onKeyDown:Y=>{Y.key!=="Enter"&&Y.key!==" "||(Y.preventDefault(),u(O))},children:[o.jsx(c7,{src:O.thumb,tinted:!!O.tint,crop:O.crop}),o.jsxs("b",{dir:"auto",children:[O.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(to,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),O.label]}),K&&O.sub&&o.jsx("span",{dir:"auto",children:O.sub}),e==="scene"&&o.jsx(Oy,{})]},O.id))}),R.remaining>0&&o.jsxs("button",{type:"button",className:"sc-swap-more",onClick:()=>A(O=>O+pl),children:["Show ",Math.min(pl,R.remaining)," more of ",R.total]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[t&&!R.current&&o.jsxs("p",{className:"sc-swap-warn",children:["This ",_," 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("People"),children:"Attach a person"})]}),g&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(-1),children:[o.jsx(Fv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(1),children:["Move later ",o.jsx(Ea,{size:13})]})]}),f&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:f,children:[o.jsx(Pl,{size:13}),vae(e)]})]})]})}function Oy(){return o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(gr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Gn,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(jn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]})}function wae({views:e,on:t,disabled:n,onPress:r}){const a=e.slice(0,4),i=e.length-3;return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"data-whole":"","aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb sc-swap-mosaic","data-count":a.length,children:a.map((l,u)=>o.jsxs("span",{className:"sc-swap-cut","data-more":u===3&&i>0?"":void 0,children:[o.jsx("img",{src:Tn(l.thumb,"micro"),alt:"",loading:"lazy"}),u===3&&i>0&&o.jsxs("span",{className:"sc-swap-cut-more",children:["+",i]})]},l.view))}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Whole place"})}),o.jsx(Oy,{})]})}function yae({option:e,on:t,disabled:n,onPress:r}){return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx("img",{src:Tn(e.thumb,"small"),alt:"",loading:"lazy"})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:e.name})}),o.jsx(Oy,{})]})}function c7({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(Oa,{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 bae(e){const{anchor:t,kind:n,onClose:r}=e,a=gae(),[i,l]=s.useState(null),u=s.useRef(null);return s.useLayoutEffect(()=>{var h,p;const f=()=>{const g=window.visualViewport,m=Dy(t.getBoundingClientRect(),{width:(g==null?void 0:g.width)??window.innerWidth,height:(g==null?void 0:g.height)??window.innerHeight},n==="scene"?{maxHeight:jse}:void 0);if(!m){r("outside");return}l(m)};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,m;window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),(g=window.visualViewport)==null||g.removeEventListener("resize",f),(m=window.visualViewport)==null||m.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?Ur.createPortal(o.jsx("div",{ref:u,className:"sc-swap","data-kind":n,"data-side":i.side,role:"dialog","aria-label":`Change ${pf[n]}`,style:jL(i),children:o.jsx(OL,{...e,autoFocusSearch:a})}),document.body):null}function xae(e){const{kind:t,onClose:n}=e,{sheet:r,grip:a}=Od(()=>n("dismiss"));return o.jsx(Ll,{open:!0,onOpenChange:i=>!i&&n("dismiss"),children:o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-shotsheet-scrim"}),o.jsxs(Dl,{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(Hl,{className:"sc-vh",children:["Change ",pf[t]]})]}),o.jsx(OL,{...e,autoFocusSearch:!1})]})]})})}const kae=260;function Sae(e){return Or(da)?o.jsx(Cae,{...e}):o.jsx(Eae,{...e,onMove:void 0})}function Lu(e,t){const n=e?dr(e):null,r=t?dr(t):null;return!!n&&n===r}function IL({currentHex:e,currentName:t,palette:n,onPick:r,onRemove:a,onClose:i,onMove:l}){const u=s.useMemo(()=>{const k=new Set,C=[],E=L=>{const $=dr(L.hex);!$||k.has($)||(k.add($),C.push({...L,hex:$}))},A=e?dr(e):null;A&&!n.some(L=>Lu(L.hex,A))&&E({hex:A,name:t||A,slot:"accent"});for(const L of n)E(L);return C},[n,e,t]),f=s.useRef(null),[h,p]=s.useState(()=>Math.max(0,u.findIndex(k=>Lu(k.hex,e))));s.useEffect(()=>{p(k=>Math.max(0,Math.min(k,Math.max(0,u.length-1))))},[u.length]),s.useLayoutEffect(()=>{var C,E;const k=Math.max(0,u.findIndex(A=>Lu(A.hex,e)));(E=(C=f.current)==null?void 0:C.querySelectorAll("[data-nav]")[k])==null||E.focus({preventScroll:!0})},[]);const g=s.useCallback(k=>{var E;const C=(E=f.current)==null?void 0:E.querySelectorAll("[data-nav]")[k];C&&(p(k),C.focus({preventScroll:!0}))},[]),m=k=>{if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),i("escape");return}if(k.key==="ArrowDown"||k.key==="ArrowUp"){k.preventDefault();const C=h+(k.key==="ArrowDown"?1:-1);C>=0&&C<u.length&&g(C)}},w=k=>r({t:"color",hex:k.hex,name:k.name||void 0}),y=(k,C)=>{const E=u.find(A=>Lu(A.hex,k));r({t:"color",hex:k,name:(E==null?void 0:E.name)||void 0},{live:!0})},b=e?dr(e):null,S=!!b&&!n.some(k=>Lu(k.hex,b));return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:m,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((k,C)=>{const E=Lu(k.hex,e),A=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-swap-dot",style:{background:k.hex},"aria-hidden":!0}),o.jsx("b",{dir:"auto",children:k.name}),o.jsx("span",{children:k.hex}),E&&o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Gn,{size:11,weight:"bold"})})]});return S&&E?o.jsx(Ed,{className:"sc-swap-swatch",triggerStyle:{background:"none"},value:k.hex,presets:n.map(L=>L.hex),commitMode:"live",align:"start",label:`Edit ${k.name}`,triggerProps:{role:"option","aria-selected":!0,"data-on":"","data-nav":C,tabIndex:C===h?0:-1,title:`${k.name} ${k.hex}`,onFocus:()=>p(C)},onChange:L=>y(L),children:A},"current-custom"):o.jsx("div",{className:"sc-swap-swatch",role:"option","aria-selected":E,"data-on":E||void 0,"data-nav":C,tabIndex:C===h?0:-1,title:`${k.name} ${k.hex}`,onFocus:()=>p(C),onClick:()=>w(k),onKeyDown:L=>{L.key!=="Enter"&&L.key!==" "||(L.preventDefault(),w(k))},children:A},k.hex)})})}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs(Ed,{className:"sc-swap-swatch sc-swap-custom",triggerStyle:{background:"none"},value:e??h2(n),presets:n.map(k=>k.hex),commitMode:"live",align:"start",label:"Custom colour",onChange:k=>y(k),children:[o.jsx(gr,{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(Fv,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(1),children:["Move later ",o.jsx(Ea,{size:13})]})]}),a&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:a,children:[o.jsx(Pl,{size:13}),"Remove colour"]})]})]})}function Eae(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=Dy(t.getBoundingClientRect(),{width:(h==null?void 0:h.width)??window.innerWidth,height:(h==null?void 0:h.height)??window.innerHeight},{width:kae});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?Ur.createPortal(o.jsx("div",{ref:i,className:"sc-swap","data-kind":"color","data-side":r.side,role:"dialog","aria-label":"Change colour",style:jL(r),children:o.jsx(IL,{...e})}),document.body):null}function Cae(e){const{onClose:t}=e,{sheet:n,grip:r}=Od(()=>t("dismiss"));return o.jsx(Ll,{open:!0,onOpenChange:a=>!a&&t("dismiss"),children:o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-shotsheet-scrim"}),o.jsxs(Dl,{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(Hl,{className:"sc-vh",children:"Change colour"})]}),o.jsx(IL,{...e})]})]})})}function mf(e){const{brand:t,products:n}=un(),{scenes:r,presenters:a,demoProducts:i}=Mn(),l=s.useMemo(()=>Fp(Jc(t),r),[t,r]),u=s.useMemo(()=>Fp(lf(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 v1(((p=t==null?void 0:t.json)==null?void 0:p.products)??[])},[t]);return s.useMemo(()=>({libraryProducts:ER(n),brandProducts:h,demoProducts:i,presenters:u,cast:f,scenes:l,productCategory:e??null}),[n,h,i,u,f,l,e])}const R0=new Map,jae=64;function FL(e){let t=R0.get(e);if(!t)for(t=Nae(e).then(n=>n?Mae(n.data,4):null).catch(()=>null),R0.set(e,t);R0.size>jae;)R0.delete(R0.keys().next().value);return t}function Aae(e,t){FL(t).then(n=>{const r=hd(n??void 0);!r||!e.isConnected||(e.dataset.tinted="true",e.style.setProperty("--tint",r))})}async function Nae(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 Mae(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}=Rae(i,l,u);if(h<.18||p<.12||p>.92)continue;const g=h*(1-Math.abs(p-.5)*1.2),m=n[Math.min(23,Math.floor(f/360*24))];m.score+=g,m.r+=i*g,m.g+=l*g,m.b+=u*g}const r=n.reduce((a,i)=>i.score>a.score?i:a,n[0]);return r.score<=0?null:Pae(r.r/r.score,r.g/r.score,r.b/r.score)}function Rae(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 Pae(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 E2(e){const{libraryTick:t}=Mn(),n=s.useRef(t),r=s.useRef(e);r.current=e,s.useEffect(()=>{t!==n.current&&(n.current=t,r.current())},[t])}const u7=["hero","place","close","hands","angle","bold"],d7=e=>[...e].sort((t,n)=>u7.indexOf(t.view)-u7.indexOf(n.view));function Lae(e){const t=e&&e.custom?e:null,n=e&&!t?e.id:null,[r,a]=s.useState(null);if(s.useEffect(()=>{if(!n)return;let i=!0;return Ee.sceneFrames(n).then(l=>{if(!i)return;const u=l.views.map(f=>({view:f.view,name:fl[f.view],thumb:f.url,hash:null}));a({id:n,views:u})}).catch(()=>{}),()=>{i=!1}},[n]),E2(()=>{if(!n)return;const i=n;Ee.sceneFrames(i).then(l=>{const u=l.views.map(f=>({view:f.view,name:fl[f.view],thumb:f.url,hash:null}));a(f=>f&&f.id!==i?f:ki(f,{id:i,views:u}))}).catch(()=>{})}),t){const i=[];t.placeUrl&&t.previewHash&&i.push({view:"place",name:fl.place,thumb:t.placeUrl,hash:t.previewHash});for(const l of t.examples??[])i.push({view:l.role,name:fl[l.role],thumb:l.url,hash:l.hash});return d7(i)}return r&&r.id===n?d7(r.views):[]}function Tae(e){return!e||e.cap==null||e.cap<=0?null:e.cap}function $ae(e){const t=new Set;if(!e||e.cap==null||e.cap<=0)return t;const n=new Set(e.attachments.map(r=>bc(r.role,r.id??r.hash)));for(const r of e.dropped){const a=bc(r.role,r.id??r.hash);r.reason!=="missing"&&!n.has(a)&&t.add(a)}return t}const bc=(e,t)=>`${e}:${t}`,z0=new Set(["product","character","ref","mark","template"]),em=12,ov=`Shot is full: ${em} 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 vi(e){const t=Xr.find(n=>n.id===e);return t?t.w/t.h:1}function Dae(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 zh=6,Hae=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:m,described:w,describedNote:y,onInspect:b,activeProductCategory:S,onAttachRequest:k,onSubmit:C,onDropFiles:E},A){var Lt,Ut,Nt,_t,Me,Be,Qe;const L=s.useRef(null),$=s.useRef(null),N=s.useId(),[j,P]=s.useState(""),R=s.useCallback(F=>{P(""),requestAnimationFrame(()=>P(F))},[]),H=s.useRef(null),[D,U]=s.useState(null),[_,B]=s.useState(null),K=Zd(),{shown:V,closeNow:O}=K,I=s.useRef(_);s.useEffect(()=>{I.current=_},[_]);const Y=s.useRef(m);s.useEffect(()=>{Y.current=m},[m]);const[Z,X]=s.useState(""),[z,J]=s.useState(M0("$")),[he,te]=s.useState(null),me=s.useRef(!1),re=s.useRef(0),[ee,q]=s.useState(!1),ie=s.useRef(0),{products:Oe}=un(),ae=Oe.length?Oe:((Lt=r.json)==null?void 0:Lt.products)??[],pe=((Ut=r.json)==null?void 0:Ut.characters)??[],Te=s.useMemo(()=>of(r.json),[r]),gt=s.useCallback((F,de)=>{var Qn,dn,vr;const ye=document.createElement("span");ye.className=vc,ye.contentEditable="false",ye.dir="ltr",ye.dataset.kind=F.t,ye.dataset.tok=g2(F),ye.dataset.uid=de??`u${re.current++}`;let Ke="",Le=null,ct,Ot=null;const zt=TL(F,{products:ae,demoProducts:l,cast:pe,presenters:i,scenes:a});if((zt==null?void 0:zt.kind)==="scene"){const Kt=zt.scene;Ke=Kt?jl(Kt,"chip"):"missing place",Le=Tn((Kt==null?void 0:Kt.previewUrl)??null,"micro"),Kt&&F.t==="template"&&F.view&&(Le=vn(F.view,"micro"),F.viewName&&(Ke=`${Ke} · ${L4(F.viewName)}`));const br=hd(Kt==null?void 0:Kt.previewColor);br&&(ye.dataset.tinted="true",ye.style.setProperty("--tint",br)),!br&&Le&&zt.custom&&Aae(ye,Le)}else if((zt==null?void 0:zt.kind)==="product"){const Kt=zt.product??zt.demo;Ke=Kt?Oo(Kt,"chip"):"missing product",Le=zt.product?Qm((dn=(Qn=zt.product.shots)==null?void 0:Qn[0])==null?void 0:dn.file,"micro"):Tn(((vr=zt.demo)==null?void 0:vr.previewUrl)??null,"micro")}else if((zt==null?void 0:zt.kind)==="presenter"){const{character:Kt,presenter:br}=zt;Ke=(Kt==null?void 0:Kt.name)??(br==null?void 0:br.name)??"missing person";const Ir=Kt?ay(Kt):br?Si(br):{src:null};Le=Tn(Ir.src,"micro"),ct=Ir.crop}else if(F.t==="color")Ke=F.name??F.hex,Ot=F.hex;else if(F.t==="ref")Ke=F.label??"Image",Le=vn(F.imageHash,"micro");else if(F.t==="mark"){const Kt=Te.find(br=>br.hash===F.imageHash);Ke=Kt?i2(r.json,Kt):"missing mark",Le=vn(F.imageHash,"micro")}if(Ke.startsWith("missing ")&&(ye.dataset.missing=""),Le){const Kt=document.createElement("img");Kt.src=Le,Kt.alt="",ct&&(Kt.dataset.crop=ct),Kt.onerror=()=>Kt.remove(),ye.appendChild(Kt)}else if(Ot){const Kt=document.createElement("span");Kt.className="sc-token-swatch",Kt.style.background=Ot,ye.appendChild(Kt)}const Rt=document.createElement("span");Rt.className="sc-token-label",Rt.dir="auto",Rt.textContent=Ke,ye.appendChild(Rt);const Sn=(m==null?void 0:m(F))??null;Sn&&(ye.title=Sn,F.t!=="template"&&(ye.dataset.warn="1")),w!=null&&w(F)&&(ye.dataset.described="1");const Jt=Bu(F);if(Jt){const Kt=Jt==="color"?"colour":pf[Jt];ye.tabIndex=-1,ye.setAttribute("role","button"),ye.setAttribute("aria-haspopup","dialog"),ye.setAttribute("aria-expanded","false"),ye.setAttribute("aria-label",`${Kt}: ${Ke}. Change or remove.`)}else ye.tabIndex=-1,ye.setAttribute("role","button"),ye.setAttribute("aria-haspopup","dialog"),ye.setAttribute("aria-expanded","false"),ye.setAttribute("aria-label",`${F.t==="mark"?"brand mark":"reference image"}: ${Ke}. Open, remove or move.`);ye.setAttribute("aria-keyshortcuts","Alt+ArrowLeft Alt+ArrowRight"),ye.setAttribute("aria-describedby",N),ye.setAttribute("draggable","false");const En=document.createElement("button");return En.type="button",En.tabIndex=-1,En.setAttribute("aria-hidden","true"),En.dataset.role="remove",En.appendChild(rte()),ye.appendChild(En),ye},[a,ae,pe,i,l,Te,r,m,w,N]),Ze=s.useCallback(()=>{const F=L.current;F&&n(Yk(F))},[n]);s.useEffect(()=>{const F=L.current;F&&(qk(F,t!=null&&t.length?t:ni(),de=>gt(de)),_0(F))},[]);const tt=s.useCallback((F,de)=>{var Le;const ye=L.current,Ke=ye==null?void 0:ye.querySelector(`[data-uid="${CSS.escape(F)}"]`);if(ye&&Ke&&e9(ye,Ke,de)){Sc(ye,Ke,"after");const ct=So(ye);ct!==null&&(H.current=ct,((Le=I.current)==null?void 0:Le.uid)===F&&(I.current={...I.current,caret:ct}),B(Ot=>Ot&&Ot.uid===F?{...Ot,caret:ct}:Ot)),Ze(),R(X4(ye,Ke))}},[Ze,R]);s.useEffect(()=>{const F=L.current;if(F)return kse(F,{onDragStart:()=>{U(null),X(""),O()},onMoved:(de,ye)=>{Ze(),R(ye)},onCancelled:()=>R("Reorder cancelled.")})},[Ze,R,O]),s.useEffect(()=>{const F=L.current;if(F)for(const de of F.querySelectorAll(`.${vc}`)){const ye=ks(de.dataset.tok??"");if(!ye)continue;const Ke=(m==null?void 0:m(ye))??null;Ke&&ye.t!=="template"?de.dataset.warn="1":delete de.dataset.warn,w!=null&&w(ye)?de.dataset.described="1":delete de.dataset.described,Ke&&!("open"in de.dataset)?de.title=Ke:de.removeAttribute("title")}},[m,w]),s.useEffect(()=>{const F=()=>{const de=So(L.current);de!==null&&(H.current=de)};return document.addEventListener("selectionchange",F),()=>document.removeEventListener("selectionchange",F)},[]);const De=s.useCallback(F=>{const de=L.current;if(!de)return;if(F.t==="template"){const ct=S0(de);if(ct){ct.replaceWith(gt(F,ct.dataset.uid)),Co(de),Ze(),U(null),X("");return}}const ye=eo(F);if(ye){const ct=q8(de,ye);if(ct){U(null),X(""),R(`${ri(ct)||"That"} is already in the brief.`);return}}if(z0.has(F.t)&&!(F.t==="template"&&S0(de))&&Array.from(de.querySelectorAll(`.${vc}`)).filter(Ot=>z0.has(Ot.dataset.kind??"")).length>=em){U(null),X(""),R(ov);return}Hee(de,gt(F),{eatQuery:!!D,fallbackUnits:H.current});const Le=So(de);Le!==null&&(H.current=Le),Ze(),U(null),X("")},[D,gt,Ze,R]),Se=s.useRef(De);s.useEffect(()=>{Se.current=De},[De]);const Q=s.useCallback((F,de)=>{const ye=L.current,Ke=ye==null?void 0:ye.querySelector(`[data-uid="${CSS.escape(F)}"]`);return!ye||!Ke?!1:(Ke.replaceWith(gt(de,F)),Co(ye),Ze(),!0)},[gt,Ze]),je=s.useCallback(F=>{const de=L.current,ye=de==null?void 0:de.querySelector(`[data-uid="${CSS.escape(F)}"]`);if(!de||!ye)return null;const Ke=ao(de,ye);return X8(de,ye),Ze(),Ke},[Ze]),Re=()=>{var F;return document.documentElement.dataset.guideTask==="first-shot"&&!!((F=L.current)!=null&&F.closest('[data-guide="compose"]'))},se=(F,de)=>{var ct;const ye=[...F.querySelectorAll(".sc-token")];if(!ye.length)return!1;const[Ke]=((ct=de.getTargetRanges)==null?void 0:ct.call(de))??[];if(!Ke)return!1;const Le=document.createRange();return Le.setStart(Ke.startContainer,Ke.startOffset),Le.setEnd(Ke.endContainer,Ke.endOffset),ye.some(Ot=>Le.intersectsNode(Ot))},G=s.useRef(je);s.useEffect(()=>{G.current=je},[je]),s.useEffect(()=>{const F=L.current;if(!F)return;const de=ye=>{if(ye.inputType.startsWith("delete")&&Re()&&se(F,ye))return ye.preventDefault();const Ke=ye.inputType==="deleteContentBackward"?"Backspace":ye.inputType==="deleteContentForward"?"Delete":null;if(!Ke)return;const Le=Qk(F,Ke);if(!(Le!=null&&Le.dataset.uid)){Jk(F,Ke)&&ye.preventDefault();return}ye.preventDefault();const ct=G.current(Le.dataset.uid);ct!=null&&Ya(F,ct)};return F.addEventListener("beforeinput",de),()=>F.removeEventListener("beforeinput",de)},[]);const oe=s.useCallback(F=>{const de=ks(F.dataset.tok??"");if(!de||de.t!=="ref"&&de.t!=="mark")return!1;const ye=L.current,Ke=ye?So(ye):null;return Ke!=null&&(H.current=Ke),O(),b==null||b({src:Dr(de.imageHash),kind:de.t,label:de.t==="mark"?ri(F):null}),!0},[b,O]),Ne=s.useCallback((F,de,ye,Ke)=>{const Le=F.dataset.uid;Le&&(O(),F.dataset.open="",F.hasAttribute("aria-haspopup")&&F.setAttribute("aria-expanded","true"),F.removeAttribute("title"),U(null),X(""),B({uid:Le,kind:de,anchor:F,caret:ye,touch:Ke}))},[O]),Ue=s.useCallback((F,de)=>{var Ot;const ye=I.current;if(I.current=null,B(null),!ye)return;const Ke=L.current,Le=Ke==null?void 0:Ke.querySelector(`[data-uid="${CSS.escape(ye.uid)}"]`);if(Le){delete Le.dataset.open,Le.hasAttribute("aria-haspopup")&&Le.setAttribute("aria-expanded","false");const zt=ks(Le.dataset.tok??""),Rt=zt?((Ot=Y.current)==null?void 0:Ot.call(Y,zt))??null:null;Rt&&(Le.title=Rt)}const ct=de!==void 0?de:ye.caret;if(ye.touch){ct!=null&&(H.current=ct);return}Ke&&(Ke.focus({preventScroll:!0}),ct!=null?Ya(Ke,ct):wc(Ke))},[]);s.useEffect(()=>{if(!_)return;const F=L.current;F!=null&&F.querySelector(`[data-uid="${CSS.escape(_.uid)}"]`)||Ue("outside")},[_,Ue]),s.useEffect(()=>{var F;V&&((F=L.current)!=null&&F.contains(V.anchor)||O())},[V,O]),s.useEffect(()=>{const F=V==null?void 0:V.anchor;if(!F)return;F.dataset.open="";const de=F.getAttribute("title");return de&&F.removeAttribute("title"),()=>{delete F.dataset.open,de&&F.setAttribute("title",de)}},[V]),s.useImperativeHandle(A,()=>({insert:F=>Se.current(F),setTokens:F=>{const de=L.current;de&&(qk(de,F.length?F:ni(),ye=>gt(ye)),_0(de),n(Yk(de)))},removeTemplate:()=>{const F=L.current,de=F?S0(F):null;!F||!de||(X8(F,de),Ze())},remove:F=>{const de=L.current;if(!de)return;const ye=q8(de,eo(F));ye&&(X8(de,ye),Ze())},openMenu:F=>{X(""),J(M0("$")),U({anchor:F})},focus:()=>wc(L.current),restoreCaret:()=>{const F=L.current;if(!F)return;F.focus({preventScroll:!0});const de=H.current;de!=null?Ya(F,de):wc(F)}}));const st=mf(S),Pe=s.useCallback(F=>ml(F,st),[st]),Ie=s.useMemo(()=>new Set(ji(r.id)),[r.id]),Ge=s.useMemo(()=>{var F;return D?fae(D.sigil??"$",{products:ml("product",st),presenters:ml("presenter",st),scenes:f?[]:ml("scene",st),colors:aa((F=r.json)==null?void 0:F.palette)},{query:Z,bookmarked:Ie,shown:z}):{items:[],remaining:0,total:0}},[D,st,Z,Ie,z,f,(Nt=r.json)==null?void 0:Nt.palette]),ft=s.useMemo(()=>Ge.items.map(F=>({...F,run:()=>F.token.t==="template"?u(F.token.id):Se.current(F.token)})),[Ge.items,u]),bt=s.useCallback(()=>{Ge.remaining<=0||J(F=>F+M0(D==null?void 0:D.sigil))},[Ge.remaining,D==null?void 0:D.sigil]),at=F=>{const de=L.current,ye=F.target;if(ye.closest('[data-role="remove"]')){if(F.preventDefault(),Re())return;const Rt=rl(ye);_&&(Rt==null?void 0:Rt.dataset.uid)===_.uid&&Ue("remove"),Rt!=null&&Rt.dataset.uid&&je(Rt.dataset.uid),U(null);return}const Ke=rl(ye),Le=Ke==null?void 0:Ke.getBoundingClientRect();if(!(!!Ke&&!!Le&&F.clientX-Le.left>zh&&Le.right-F.clientX>zh)){if(Pee(de))return;Xk(de,F.clientX,F.clientY);return}Xk(de,F.clientX,F.clientY);const Ot=Ke.dataset.uid??null;if(Ot&&(_==null?void 0:_.uid)===Ot){F.detail!==0&&Ue("outside");return}const zt=Bu(ks(Ke.dataset.tok??""));if(!zt){oe(Ke);return}Ne(Ke,zt,So(de),!1)},Zt=F=>{if(F.pointerType!=="mouse")return;const de=L.current;if(_||D||de&&"chipDrag"in de.dataset)return;const ye=rl(F.target),Ke=ye==null?void 0:ye.dataset.uid;if(!ye||!Ke||!jt(ye)){K.close();return}if((V==null?void 0:V.uid)===Ke){K.keep();return}K.open({uid:Ke,anchor:ye})},jt=F=>{const de=ks(F.dataset.tok??"");if(p6(de))return!0;const ye=Bu(de);return!!(ye&&ye!=="color"&&vp(ye)&&F.querySelector("img"))},Ft=F=>{const de=rl(F.target),ye=de==null?void 0:de.dataset.uid;!de||!ye||_||D||jt(de)&&l2(de)&&K.open({uid:ye,anchor:de})},Pt=F=>{if(F.pointerType==="mouse")return;const de=F.target;if(de.closest('[data-role="remove"]'))return;const ye=rl(de);if(!ye)return;const Ke=ye.getBoundingClientRect();if(F.clientX-Ke.left<=zh||Ke.right-F.clientX<=zh)return;const Le=lae(ks(ye.dataset.tok??""));if(!Le||ye.dataset.uid&&(_==null?void 0:_.uid)===ye.dataset.uid)return;F.preventDefault();const ct=L.current,Ot=document.activeElement===ct,zt=Ot?So(ct):H.current;Ot&&(ct==null||ct.blur()),Ne(ye,Le,zt,!0)},$t=F=>{const de=L.current,ye=rl(F.target);if(ye&&!_){const Ke=()=>{Sc(de,ye,"after"),de==null||de.focus({preventScroll:!0})};if(F.altKey&&(F.key==="ArrowLeft"||F.key==="ArrowRight")){F.preventDefault(),de&&e9(de,ye,F.key==="ArrowLeft"?-1:1)&&(ye.focus({preventScroll:!0}),Ze(),R(X4(de,ye)));return}if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.preventDefault(),Sc(de,ye,F.key==="ArrowLeft"?"before":"after"),de==null||de.focus({preventScroll:!0});return}if(F.key==="Tab"){F.preventDefault(),Sc(de,ye,F.shiftKey?"before":"after"),de==null||de.focus({preventScroll:!0});return}if(F.key==="Enter"||F.key===" "){F.preventDefault();const Le=Bu(ks(ye.dataset.tok??""));Le&&de?Ne(ye,Le,ao(de,ye)+1,!1):oe(ye);return}if(F.key==="Backspace"||F.key==="Delete"){if(F.preventDefault(),Re())return;const Le=ye.dataset.uid?je(ye.dataset.uid):null;de==null||de.focus({preventScroll:!0}),Le!=null&&Ya(de,Le);return}if(F.key==="Escape"){F.preventDefault(),Ke();return}}if(F.key==="Escape"&&D){F.preventDefault(),U(null),X("");return}if(F.key==="Enter"&&!F.shiftKey){const Ke=F.defaultPrevented;F.preventDefault(),Ise({menuOpen:!!D,handled:Ke})&&C();return}if(!(D||_)&&!Dse(F)){if(F.key==="Tab"&&!F.altKey&&!F.metaKey&&!F.ctrlKey){const Ke=Zee(de,F.shiftKey?"back":"forward");Ke&&(F.preventDefault(),Ke.focus({preventScroll:!0}));return}if(!F.shiftKey&&!F.altKey&&!F.metaKey&&!F.ctrlKey){if(F.key==="ArrowLeft"||F.key==="ArrowRight"){Vee(de,F.key==="ArrowLeft"?"left":"right")&&F.preventDefault();return}if(F.key==="Backspace"||F.key==="Delete"){const Ke=Qk(de,F.key);if(Ke!=null&&Ke.dataset.uid){if(F.preventDefault(),Re())return;const Le=je(Ke.dataset.uid);Le!=null&&Ya(de,Le);return}if(Jk(de,F.key)){F.preventDefault();return}}}if((F.key==="$"||F.key==="/"||F.key==="@"||F.key==="#")&&!Re()){const Ke=L.current,Le=CP(Ke),ct=Le.slice(-1);if(Le.length&&!/[\s\u00a0]/.test(ct))return;X(""),J(M0(F.key)),U({anchor:{getBoundingClientRect:()=>jP()??(Ke==null?void 0:Ke.getBoundingClientRect())??new DOMRect},sigil:F.key})}}},ke=s.useCallback(F=>{var de,ye;return(ye=aa((de=r.json)==null?void 0:de.palette).find(Ke=>Ke.hex===F))==null?void 0:ye.name},[(_t=r.json)==null?void 0:_t.palette]),Je=s.useCallback(()=>{requestAnimationFrame(()=>{const F=$.current;if(!F)return;F.scrollHeight-F.scrollTop-F.clientHeight>1?F.dataset.more="":delete F.dataset.more})},[]);s.useEffect(()=>{const F=$.current;if(!F)return;Je();const de=new ResizeObserver(Je);de.observe(F);for(const ye of F.children)de.observe(ye);return()=>de.disconnect()},[Je]);const Et=F=>{Je();const de=L.current,ye=F==null?void 0:F.nativeEvent;if(ye!=null&&ye.isComposing)return;Lee(de)||Co(de),_0(de)&&wc(de);const Ke=me.current;me.current=!1;const Le=Q8(de,Ot=>gt(Ot),{commit:Ke,nameFor:ke});Le&&(U(null),X(""));const ct=Le?{open:!1}:Fse(Fee(de),Ke);ct.open?D&&(ct.query!==Z&&J(M0(ct.sigil)),X(ct.query)):D&&(U(null),X("")),Ze()},Xe=F=>{const de=window.getSelection();if(!de||de.rangeCount===0||de.isCollapsed)return null;const ye=de.getRangeAt(0),{text:Ke,html:Le}=zee(ye);return Ke?(F.clipboardData.setData("text/plain",Ke),F.clipboardData.setData("text/html",Le),F.preventDefault(),ye):null},rt=F=>{Xe(F)},nt=F=>{const de=Xe(F);de&&(de.deleteContents(),Co(L.current),Ze())},qt=s.useCallback(F=>F.t==="template"?a.some(de=>de.id===F.id):F.t==="product"?ae.some(de=>de.id===F.id)||l.some(de=>de.id===F.id):F.t==="character"?pe.some(de=>de.id===F.id)||i.some(de=>de.id===F.id):F.t==="mark"?Te.some(de=>de.hash===F.imageHash):!0,[a,ae,pe,i,l,Te]);s.useEffect(()=>{const F=L.current;if(F)for(const de of F.querySelectorAll(`.${vc}[data-missing]`)){const ye=ks(de.dataset.tok??"");ye&&qt(ye)&&de.replaceWith(gt(ye,de.dataset.uid))}},[qt,gt]);const Yt=F=>{Array.from(F.dataTransfer.types).includes("Files")&&(F.preventDefault(),ie.current++,q(!0))},an=F=>F.preventDefault(),Wt=()=>{ie.current=Math.max(0,ie.current-1),ie.current===0&&q(!1)},Rn=F=>{F.preventDefault(),ie.current=0,q(!1),F.dataTransfer.files.length&&(E==null||E(F.dataTransfer.files))},Bt=F=>{F.preventDefault();const de=F.clipboardData.files;if(de.length&&Array.from(de).some(Le=>Le.type.startsWith("image/"))){E==null||E(de);return}me.current=!0;const ye=Uee(F.clipboardData.getData("text/html"));if(ye&&ne(ye)){const Le=L.current;Q8(Le,ct=>gt(ct),{commit:!0,nameFor:ke})&&Ze();return}const Ke=F.clipboardData.getData("text/plain");Ke&&document.execCommand("insertText",!1,Ke)},ne=F=>{const de=L.current,ye=window.getSelection();if(!de||!ye||ye.rangeCount===0||!de.contains(ye.getRangeAt(0).startContainer))return!1;const Ke=ye.getRangeAt(0);Ke.deleteContents();let Le=!1,ct=Array.from(de.querySelectorAll(`.${vc}`)).filter(dn=>z0.has(dn.dataset.kind??"")).length,Ot=!1;const zt=new Set,Rt=[];for(const dn of F){if(typeof dn=="string"){Rt.push(dn);continue}if(!qt(dn)){Rt.push(Fae(dn,a,ae));continue}if(dn.t==="template"){if(Le)continue;Le=!0}const vr=eo(dn);if(vr){if(zt.has(vr)||q8(de,vr))continue;zt.add(vr)}if(z0.has(dn.t)&&!(dn.t==="template"&&S0(de))){if(ct>=em){Ot=!0;continue}ct+=1}Rt.push(dn)}Ot&&R(ov);const Sn=Le?S0(de):null,Jt=document.createDocumentFragment();for(const dn of Rt)Jt.appendChild(typeof dn=="string"?document.createTextNode(dn):gt(dn));const En=Jt.lastChild;Ke.insertNode(Jt),Sn&&Sn.remove();const Qn=En?En.nodeType===Node.TEXT_NODE?Bp(de,En,En.length):Bp(de,de,Array.from(de.childNodes).indexOf(En)+1):So(de)??0;return Co(de),Ya(de,Qn),Ze(),!0},ce=s.useCallback(()=>{requestAnimationFrame(()=>{const F=L.current;F&&document.activeElement===F&&_0(F)&&wc(F)})},[]),ue=_?ks(_.anchor.dataset.tok??""):null,ze=p6(ue),Ve=(_==null?void 0:_.kind)==="scene"&&(ue==null?void 0:ue.t)==="template"?a.find(F=>F.id===ue.id)??null:null,xt=Lae(Ve),yt=(ue==null?void 0:ue.t)==="template"&&ue.view?((Me=xt.find(F=>F.hash===ue.view)??xt.find(F=>!!ue.viewName&&F.name===L4(ue.viewName)))==null?void 0:Me.view)??null:null,kt=async F=>{if(!_||(ue==null?void 0:ue.t)!=="template")return;const{uid:de}=_,{id:ye,setup:Ke}=ue;let Le=(F==null?void 0:F.hash)??null;if(F&&!Le)try{Le=(await Ee.pickSceneView(ye,F.view)).hash}catch{return}Q(de,{t:"template",id:ye,...Ke?{setup:Ke}:{},...F&&Le?{view:Le,viewName:F.name}:{}}),Ue("pick")},ot=ue?(m==null?void 0:m(ue))??null:null,ht=ue&&(w!=null&&w(ue))?y??null:null,Ae=V?ks(V.anchor.dataset.tok??""):null,ve=p6(Ae),et=((Be=V==null?void 0:V.anchor.querySelector("img"))==null?void 0:Be.getAttribute("src"))??null,Ct=ve?vn(ve,"tile"):Tn(et,"tile"),xe=Bu(Ae),it=Ae&&vp(Ae.t)?Ae.t:xe&&xe!=="color"&&vp(xe)?xe:null,wt=Ae?(m==null?void 0:m(Ae))??null:null,$e=Ae&&(w!=null&&w(Ae))?y??null:null,qe=Re()?void 0:()=>{if(!_)return;const F=je(_.uid);Ue("remove",F)};return o.jsxs("div",{className:"sc-brief",ref:$,onScroll:Je,"data-drag-over":ee||void 0,children:[o.jsx("span",{id:N,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:j}),o.jsx("div",{ref:L,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?Z0:void 0,"aria-activedescendant":D?he??void 0:void 0,"aria-label":g,"aria-placeholder":h,tabIndex:0,dir:"auto","data-ph":h,...p?{"data-ph-sm":p}:{},onClick:at,onPointerDown:Pt,onPointerOver:Zt,onPointerLeave:F=>F.pointerType==="mouse"&&K.close(),onFocusCapture:Ft,onKeyDown:$t,onInput:Et,onCopy:rt,onCut:nt,onPaste:Bt,onDragEnter:Yt,onDragOver:an,onDragLeave:Wt,onDrop:Rn,onFocus:ce,onBlur:()=>{const F=L.current;Q8(F,de=>gt(de),{commit:!0,nameFor:ke})&&(U(null),X("")),Ze()}}),D&&o.jsx(Jse,{anchor:D.anchor,composer:{getBoundingClientRect:()=>{var F,de,ye;return((de=(F=L.current)==null?void 0:F.closest(".sc-promptcard"))==null?void 0:de.getBoundingClientRect())??((ye=L.current)==null?void 0:ye.getBoundingClientRect())??new DOMRect}},line:{getBoundingClientRect:()=>{var F;return((F=L.current)==null?void 0:F.getBoundingClientRect())??new DOMRect}},query:Z,options:ft,remaining:Ge.remaining,total:Ge.total,sigil:D.sigil,onMore:bt,onActiveId:te,onClose:()=>{U(null),X("")}}),V&&Ct&&it&&o.jsx(Vd,{anchor:V.anchor,kind:it,src:Ct,label:ri(V.anchor),warning:wt,note:$e,onOpen:()=>{const F=V.anchor;if(ve){oe(F);return}O(),b==null||b({src:Ct,kind:it,label:ri(F)})},onHoverIn:K.keep,onHoverOut:K.close,onClose:O},V.uid),(_==null?void 0:_.kind)==="ref"||(_==null?void 0:_.kind)==="mark"?o.jsx(Sse,{kind:_.kind,label:ri(_.anchor),thumb:ze?vn(ze,"micro"):null,onInspect:()=>oe(_.anchor),onMove:F=>tt(_.uid,F),onRemove:qe,onClose:Ue},_.uid):(_==null?void 0:_.kind)==="color"?o.jsx(Sae,{anchor:_.anchor,currentHex:Bh(_.anchor),currentName:Oae(_.anchor),palette:aa((Qe=r.json)==null?void 0:Qe.palette),onPick:(F,de)=>{var Ke;const ye=_.uid;if(de!=null&&de.live){const Le=(Ke=L.current)==null?void 0:Ke.querySelector(`[data-uid="${CSS.escape(ye)}"]`);Le&&Qee(Le,F),Ze();return}if(Iae(F.hex,Bh(_.anchor))){Ue("pick");return}Q(ye,F),Ue("pick")},onRemove:qe,onMove:F=>tt(_.uid,F),onClose:Ue},_.uid):_?o.jsx(mae,{kind:_.kind,anchor:_.anchor,currentId:Bh(_.anchor),candidates:Pe(_.kind),brandId:r.id,brandSlug:r.slug,warning:ot,note:ht,onAttachRequest:k?F=>{Ue("outside"),k(F)}:void 0,onPick:F=>{const de=_.uid;if(F.id===Bh(_.anchor)){Ue("pick");return}F.kind==="scene"?u(F.id):Q(de,F.token),Ue("pick")},onRemove:qe,onMove:F=>tt(_.uid,F),onClose:Ue,views:_.kind==="scene"?{options:xt,picked:yt,onPick:kt}:void 0},_.uid):null]})});function Bh(e){const t=ks(e.dataset.tok??"");return t?t.t==="color"?t.hex:"id"in t?t.id:null:null}function Oae(e){const t=ks(e.dataset.tok??"");return(t==null?void 0:t.t)==="color"?t.name:void 0}function Iae(e,t){const n=e?dr(e):null,r=t?dr(t):null;return!!n&&n===r}function Fae(e,t,n){var r,a;if(e.t==="template"){const i=((r=t.find(l=>l.id===e.id))==null?void 0:r.name)??"template";return e.view&&e.viewName?`${i} · ${L4(e.viewName)}`:i}return 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 Uh(e,t){return t===null?e===null:e===t}function _ae(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 Iy({"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 m=0;const w=()=>{const A=g.querySelector(":scope > button[data-on]");if(!A)return g.style.setProperty("--sc-ink-x","0px"),g.style.setProperty("--sc-ink-w","0px"),null;const L=A.querySelector(".sc-vlabel")??A;return g.style.setProperty("--sc-ink-x",`${A.offsetLeft+L.offsetLeft}px`),g.style.setProperty("--sc-ink-w",`${L.offsetWidth}px`),A},y=()=>{const A=g.scrollWidth-g.clientWidth;if(A<=1){delete p.dataset.overflowLeft,delete p.dataset.overflowRight;return}g.scrollLeft>2?p.dataset.overflowLeft="":delete p.dataset.overflowLeft,g.scrollLeft<A-2?p.dataset.overflowRight="":delete p.dataset.overflowRight},b=A=>{const L=g.scrollWidth-g.clientWidth;if(L<=0)return;const $=[...g.querySelectorAll(":scope > button")],N=$.indexOf(A);if(N<0)return;const j=72,P=g.scrollLeft,R=P+g.clientWidth,H=$[N-1],D=$[N+1],U=D?D.offsetLeft+Math.min(j,D.offsetWidth):A.offsetLeft+A.offsetWidth+8,_=H?Math.max(0,H.offsetLeft+H.offsetWidth-j):Math.max(0,A.offsetLeft-8);let B=P;if(U>R)B=Math.min(L,U-g.clientWidth);else if(_<P)B=_;else return;if(Math.abs(B-P)<1)return;const K=window.matchMedia("(prefers-reduced-motion: reduce)").matches;g.scrollTo({left:B,behavior:K?"auto":"smooth"})},S=w();S&&b(S),y(),g.dataset.inkReady||requestAnimationFrame(()=>{g.dataset.inkReady=""});const k=()=>{m||(m=requestAnimationFrame(()=>{m=0,y()}))},C=A=>{if(g.scrollWidth<=g.clientWidth+1||Math.abs(A.deltaX)>Math.abs(A.deltaY)||A.deltaY===0)return;const L=g.scrollWidth-g.clientWidth,$=Math.max(0,Math.min(L,g.scrollLeft+A.deltaY));$!==g.scrollLeft&&(A.preventDefault(),g.scrollLeft=$,y())},E=new ResizeObserver(()=>{w(),y()});E.observe(g);for(const A of g.querySelectorAll(":scope > button"))E.observe(A);return g.addEventListener("scroll",k,{passive:!0}),g.addEventListener("wheel",C,{passive:!1}),()=>{m&&cancelAnimationFrame(m),E.disconnect(),g.removeEventListener("scroll",k),g.removeEventListener("wheel",C)}},[t,l]);const u=p=>{Uh(t,p)||(a.current&&_ae(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(b=>Uh(t,b.value)));let m=g;if(p.key==="ArrowRight"?m=Math.min(n.length-1,g+1):p.key==="ArrowLeft"?m=Math.max(0,g-1):p.key==="Home"?m=0:p.key==="End"&&(m=n.length-1),m===g)return;u(n[m].value);const w=(y=i.current)==null?void 0:y.querySelectorAll(":scope > button")[m];w==null||w.focus()},h=n.findIndex(p=>Uh(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 m=Uh(t,p.value);return o.jsxs("button",{type:"button",role:"tab","aria-selected":m,"data-on":m?"":void 0,tabIndex:m||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 zd({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;Ur.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 m=g.target;m!=null&&m.isContentEditable||m&&/^(input|textarea|select)$/i.test(m.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(gd,{size:16})}),o.jsxs("div",{className:"sc-libsearch-field",children:[o.jsx(gd,{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 _L({why:e,children:t}){return e?o.jsx(Vw,{content:e,className:"sc-tip",maxWidth:"220px",children:bR(t)}):t}const Vae=["All","Products","People","Places","Colors","Brand","Shots"],tm=Vae.filter(e=>e!=="All"),f7={Products:"Products",People:"People",Places:"Places",Colors:"Brand colors",Brand:"Brand marks",Shots:"Shots"},Zae={Products:"Product",People:"Person",Places:"Place",Colors:"Brand color",Brand:"Brand mark",Shots:"Reference shot"},iv={Products:"products",People:"people",Places:"places",Colors:"brand colors",Brand:"brand marks",Shots:"shots"},zae={Products:"square",People:"square",Places:"square",Colors:"swatch",Brand:"square",Shots:"square"},VL={Products:132,People:132,Places:132,Colors:132,Brand:132,Shots:132},lv={Products:96,People:96,Places:96,Colors:96,Brand:96,Shots:96},h7=10;function Bae(e,t,n){const r=(n?lv:VL)[e];return r<=0||t<=0?1:Math.max(1,Math.floor((t+h7)/(r+h7)))}const Uae={product:"Products",presenter:"People",scene:"Places"};function Wae(e){const t=Uae[e.kind];return{key:eo(e.token),group:t,shape:zae[t],label:e.label,sub:e.kind==="product"?e.sub:void 0,full:e.recommended?`${e.full} · Recommended`:e.full,search:e.search,thumb:Tn(e.thumb??null,"small"),crop:e.crop,recommended:e.recommended,bookmarked:e.bookmarked,token:e.token}}function Kae(e){const t=of(e).map(r=>{const a=r.hash,i=i2(e,r);return{key:`m:${a}`,group:"Brand",shape:"square",label:i,full:`${i} · the mark itself`,search:i,thumb:vn(a,"micro"),token:{t:"mark",imageHash:a}}}),n=aa(e==null?void 0:e.palette).map(r=>{const a={t:"color",hex:r.hex,name:r.name};return{key:eo(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 Gae(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:vn(n.images[0],"micro"),token:{t:"ref",imageHash:n.images[0],label:"Shot"}}})}const p7=(e,t)=>Io(`${e.label} ${e.sub??""} ${e.search}`,t),ZL=`
|
|
106
|
+
`;function Yae(e){return e.map(eo).filter(t=>t.length>0).join(ZL)}function qae(e){return new Set(e?e.split(ZL):[])}const Xae=new Set(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"]);function Qae(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 Jae(e,t){const n=t.trim();return e==="All"?n?`Nothing matches “${n}”.`:"Nothing to add yet.":n?`No matching ${iv[e]}.`:e==="Shots"?"No finished shots yet.":`No ${iv[e]} yet.`}function eoe(e){return[{value:null,label:"All",count:tm.reduce((n,r)=>n+e[r],0)},...tm.map(n=>({value:n,label:n,count:e[n]}))]}const toe=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(noe,{src:t.thumb,crop:t.crop}),o.jsxs("span",{className:"sc-ap-cap",children:[o.jsxs("span",{className:"sc-vh",children:[Zae[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(gr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Gn,{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(_L,{why:h,children:p})});function noe({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(Oa,{size:16}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async","data-crop":t,onError:()=>r(!0)})})}function m7({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(Bv,{size:22,"aria-hidden":!0})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Upload image"})})]})}const roe=48,soe={items:[],total:0,hasMore:!1,loading:!1,settled:!1,error:null,loadMore:()=>{}};function Fy(e,t,n=!0){const r=t.trim(),{shotsEpoch:a,subscribeActivity:i}=un(),l=`${e}|${r}|${a}`,[u,f]=s.useState({key:"",items:[],next:null,total:0}),[h,p]=s.useState(!1),[g,m]=s.useState(null),w=s.useRef(null),y=s.useCallback(async k=>{var E;(E=w.current)==null||E.abort();const C=new AbortController;w.current=C,p(!0),m(null);try{const A=await Ee.feed(e,{lens:"all",sort:"newest",q:r,limit:roe,cursor:k??void 0},C.signal);if(C.signal.aborted)return;f(L=>{var N;const $=k===null||L.key!==l;return{key:l,items:$?A.items:[...L.items,...A.items],next:A.next,total:((N=A.counts)==null?void 0:N.all)??($?A.items.length:L.total)}})}catch(A){if(C.signal.aborted)return;m(String(A.message??A))}finally{C.signal.aborted||p(!1)}},[e,r,l]);s.useEffect(()=>{if(!n)return;const k=u.key===""?0:150,C=setTimeout(()=>void y(null),k);return()=>clearTimeout(C)},[y,n]),s.useEffect(()=>()=>{var k;return(k=w.current)==null?void 0:k.abort()},[]),s.useEffect(()=>i(k=>{const C=new Map(k.map(E=>[E.id,E]));f(E=>{if(!E.items.some(L=>C.has(L.id)))return E;const A=E.items.flatMap(L=>{const $=C.get(L.id);return $?$.archived?[]:[{...L,...$}]:[L]});return{...E,items:A,total:Math.max(0,E.total-(E.items.length-A.length))}})}),[i]);const b=u.key===l?u:null,S=s.useCallback(()=>{b!=null&&b.next&&y(b.next)},[b==null?void 0:b.next,y]);return b?{items:b.items.filter(k=>k.status==="done"&&k.images.length>0),total:b.total,hasMore:b.next!==null,loading:h,settled:!0,error:g,loadMore:S}:{...soe,loading:h,error:g,loadMore:S}}const m6={Products:"product",People:"presenter",Places:"scene"};function aoe({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:m,onFiles:w,onClose:y}){const b=s.useRef(a).current,S=mf(b),k=s.useMemo(()=>new Set(ji(e.id)),[e.id]),C=Bl(),{applyBrand:E}=Mn(),{push:A}=rr(),[L,$]=s.useState(!1),[N,j]=s.useState(""),P=s.useDeferredValue(N),[R,H]=s.useState(pl),[D,U]=s.useState(0),[_,B]=s.useState(f?347:696),K=s.useRef(null),V=s.useRef(null);s.useEffect(()=>{H(pl),U(0)},[t,P]),s.useLayoutEffect(()=>{const De=V.current;if(!De)return;const Se=()=>B(De.clientWidth-2*ioe(De));Se();const Q=new ResizeObserver(Se);return Q.observe(De),()=>Q.disconnect()},[]);const O=s.useMemo(()=>({product:ml("product",S),presenter:ml("presenter",S),scene:ml("scene",S)}),[S]),I=s.useMemo(()=>Kae(e.json),[e.json]),Y=Fy(e.id,P),Z=s.useMemo(()=>Gae(Y.items,Y.total),[Y.items,Y.total]),X=s.useMemo(()=>{const De={};for(const Se of tm){const Q=m6[Se];De[Se]=Se==="Shots"?Y.total:Q?pd(O[Q],P).length:I.filter(je=>je.group===Se&&p7(je,P)).length}return De},[O,I,P,Y.total]),z=s.useCallback((De,Se)=>{const Q=m6[De];if(Q){const Re=S2(Q,O[Q],{currentId:null,query:P,bookmarked:k,shown:Se});return{group:De,items:Re.items.map(Wae),total:Re.total,remaining:Re.remaining}}if(De==="Shots"){const Re=Z.slice(0,Se),se=Y.hasMore?Math.max(1,Y.total-Z.length):Math.max(0,Z.length-Se);return{group:De,items:Re,total:Y.total,remaining:se}}const je=I.filter(Re=>Re.group===De&&p7(Re,P));return{group:De,items:je.slice(0,Se),total:je.length,remaining:Math.max(0,je.length-Se)}},[O,I,P,k,Z,Y.hasMore,Y.total]),J=s.useMemo(()=>{if(t==="All"){const De=[];for(const Se of tm){const Q=Bae(Se,_,f),je=z(Se,f&&De.length===0?Math.max(1,Q-1):Q);je.items.length>0&&De.push(je)}return De}return[z(t,t==="Shots"?Number.MAX_SAFE_INTEGER:R)]},[t,z,R,_,f]),{flat:he,navGroups:te}=s.useMemo(()=>{const De=[],Se=[];for(const Q of J)Q.items.length&&(Se.push({start:De.length,end:De.length+Q.items.length-1}),De.push(...Q.items));return{flat:De,navGroups:Se}},[J]);s.useEffect(()=>{U(De=>Math.max(0,Math.min(De,he.length-1)))},[he.length]);const me=s.useCallback(De=>{var Q;const Se=(Q=V.current)==null?void 0:Q.querySelector(`[data-nav="${De}"]`);Se&&(U(De),Se.focus({preventScroll:!0}),Se.scrollIntoView({block:"nearest"}))},[]),re=s.useRef(null),ee=s.useRef(()=>{});ee.current=()=>{const De=J[0];!De||t==="All"||De.remaining<=0||(De.group==="Shots"?Y.loading||Y.loadMore():H(Se=>Se+pl))},s.useEffect(()=>{const De=re.current,Se=V.current;if(!De||!Se)return;const Q=new IntersectionObserver(je=>{je.some(Re=>Re.isIntersecting)&&ee.current()},{root:Se,rootMargin:"0px 0px 240px 0px"});return Q.observe(De),()=>Q.disconnect()},[t,J]);const q=s.useCallback(De=>{var Q,je;const Se=he[De];Se&&(u.has(Se.key)?g(Se):p(Se),h&&((je=(Q=document.activeElement)==null?void 0:Q.blur)==null||je.call(Q)))},[he,u,h,p,g]),ie=De=>{const Se=De.clipboardData.files;!Se.length||!Array.from(Se).some(Q=>Q.type.startsWith("image/"))||(De.preventDefault(),w(Se))},Oe=De=>{var se,G;const Se=De.target,Q=Se instanceof HTMLInputElement&&!!((se=K.current)!=null&&se.contains(Se));if(De.key==="Escape"){if(Q)return;De.preventDefault(),De.stopPropagation(),y();return}if(Q){De.key==="ArrowDown"?(De.preventDefault(),De.stopPropagation(),me(0)):De.key==="Enter"&&(De.preventDefault(),De.stopPropagation(),q(0));return}if(!Xae.has(De.key)||(De.stopPropagation(),Se.closest('[role="tablist"]')))return;const je=Se.closest("[data-nav]");if(!je)return;De.preventDefault();const Re=Qae(D,De.key,ooe(je.closest(".sc-ap-grid")),te);if(Re==="search"){const oe=K.current;(G=(oe==null?void 0:oe.querySelector(".sc-libsearch[data-open] input"))??(oe==null?void 0:oe.querySelector(".sc-libsearch-toggle")))==null||G.focus()}else Re!=null&&me(Re)},ae=async De=>{$(!0);try{const Se=await aM(e.id,De);E(Se);const Q=Se.logoHash;Q&&p({key:`m:${Q}`,group:"Brand",shape:"square",label:"Logo",full:"Logo",search:"",token:{t:"mark",imageHash:Q}});const je=Se.logoEdge;je&&je<512&&A({kind:"warning",title:"Logo added, but it is small",detail:`Only ${je}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`})}catch(Se){A(ln(Se,"Could not upload that logo"))}finally{$(!1)}},pe=De=>C(De,{onCreated:Se=>{if(Se.kind===De){if(Se.kind==="product"){const Q={t:"product",id:Se.id};p({key:eo(Q),group:"Products",shape:"square",label:"Product",full:"",search:"",token:Q});return}if(Se.kind==="presenter"){const Q={t:"character",id:Se.id};p({key:eo(Q),group:"People",shape:"square",label:"Person",full:Se.name,search:Se.name,token:Q});return}n("Places")}}}),Te=async De=>{var je;const Se=zR((je=e.json)==null?void 0:je.palette,De);if(!Se.swatch)return;if(Se.added)try{const Re=await Ee.updateBrand(e.id,{...e.json??{},palette:Se.palette},e.json);E(Re)}catch(Re){A(ln(Re,"Could not save the brand"));return}const Q={t:"color",hex:Se.swatch.hex,name:Se.swatch.name};p({key:eo(Q),group:"Colors",shape:"swatch",label:Se.swatch.name,full:"",search:"",swatch:Se.swatch.hex,token:Q})},gt=De=>i&&De==="Places"?"Places set up a new shot. Press X on Refining to use one.":l&&De!=="Colors"?l:null,Ze=he.length===0;let tt=0;return o.jsxs("div",{className:"sc-ap-inner",onKeyDown:Oe,onPaste:ie,children:[o.jsxs("div",{className:"sc-ap-head",ref:K,children:[o.jsx("div",{className:"sc-ap-tabs",children:o.jsx(Iy,{"aria-label":"What to add",activeKey:t==="All"?null:t,items:eoe(X),onSelect:De=>n(De??"All")})}),o.jsxs("div",{className:"sc-ap-actions",children:[o.jsxs("div",{className:"sc-ap-actions-add",children:[o.jsx(zd,{value:N,onChange:j,noun:t==="All"?"everything":iv[t],total:t==="All"?void 0:X[t],shortcut:!1}),!f&&o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-ap-upload",onClick:m,title:"Add an image from your computer. It joins the shot as a reference.",children:[o.jsx(Bv,{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:V,children:[i&&t==="Places"&&o.jsx("p",{className:"sc-ap-hint",children:"Places set up a new shot, so they sit out while you are refining. Press X on Refining to use one."}),J.map((De,Se)=>{var oe,Ne,Ue;const Q=gt(De.group),je=tt;tt+=De.items.length;const Re=m6[De.group],G={"--ap-min":`${(f?lv:VL)[De.group]}px`,"--ap-lines":Re==="product"?2:1};return o.jsxs("section",{className:"sc-ap-group","aria-label":f7[De.group],children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsxs("span",{className:"sc-ap-sec-title",children:[f7[De.group],o.jsx("span",{className:"sc-ap-sec-n",children:De.total})]}),t==="All"&&De.total>De.items.length&&o.jsxs("button",{type:"button",className:"sc-ap-sec-act",onClick:()=>n(De.group),children:["Show all ",De.total]}),t==="Products"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>pe("product"),children:"Add product"}),t==="People"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>pe("presenter"),children:"Create person"}),t==="Places"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>pe("scene"),children:"Create place"}),t==="Colors"&&o.jsx(Ed,{className:"sc-ap-sec-act sc-ap-add",triggerStyle:{background:"none"},value:h2(aa((oe=e.json)==null?void 0:oe.palette)),presets:aa((Ne=e.json)==null?void 0:Ne.palette).map(st=>st.hex),commitMode:"close",align:"end",label:"Add color",onChange:st=>void Te(st),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":L||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",className:"sc-vh",disabled:L,onChange:st=>{var Ie;const Pe=(Ie=st.target.files)==null?void 0:Ie[0];st.target.value="",Pe&&ae(Pe)}}),"Add logo"]})]}),o.jsxs("div",{className:"sc-ap-grid","data-shape":((Ue=De.items[0])==null?void 0:Ue.shape)??"square",style:G,children:[f&&Se===0&&!r&&o.jsx(m7,{onClick:m}),De.items.map((st,Pe)=>o.jsx(toe,{card:st,index:je+Pe,active:je+Pe===D,ticked:u.has(st.key),why:Q,onPick:q,onFocus:U},st.key))]}),t!=="All"&&De.remaining>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:re,className:"sc-ap-sentinel","aria-hidden":!0}),o.jsxs("p",{className:"sc-ap-foot","aria-live":"polite",children:[De.items.length," of ",De.total]})]})]},De.group)}),t==="Shots"&&Y.error&&o.jsxs("p",{className:"sc-ap-empty",children:["Could not load the shots. ",Y.error]}),Ze&&f&&o.jsx("div",{className:"sc-ap-grid",style:{"--ap-min":`${lv.Products}px`},children:o.jsx(m7,{onClick:m})}),Ze&&!(t==="Shots"&&(!Y.settled||Y.loading||Y.error))&&o.jsx("p",{className:"sc-ap-empty",children:Jae(t,N)})]})]})}function ooe(e){return e?Math.max(1,getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length):1}function ioe(e){return Number.parseFloat(getComputedStyle(e).paddingLeft)||0}const loe="(pointer: coarse)";function coe(e){const t=Or(da),n=Or(loe),[r,a]=s.useState(e.initialTab??"All");s.useEffect(()=>{a(e.initialTab??"All")},[e.initialTab,e.tabNonce]);const[i]=Ml(),l=i.get("new")!==null;return o.jsx(uoe,{id:e.id,phone:t,touch:n,creating:l,onClose:e.onClose,children:o.jsx(aoe,{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 uoe({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,b;const p=l.current,g=p==null?void 0:p.parentElement;if(!t||!p||!g)return;const m=()=>{const S=p.closest(".sc-shell")??document.documentElement,k=Number.parseFloat(getComputedStyle(S).getPropertyValue("--sc-topbar-h"))||0,C=g.getBoundingClientRect().top-k-16;p.style.setProperty("--ap-avail",`${Math.max(160,Math.round(C))}px`)};m();const w=new ResizeObserver(m);return w.observe(g),window.addEventListener("resize",m),(y=window.visualViewport)==null||y.addEventListener("resize",m),(b=window.visualViewport)==null||b.addEventListener("scroll",m),()=>{var S,k;w.disconnect(),window.removeEventListener("resize",m),(S=window.visualViewport)==null||S.removeEventListener("resize",m),(k=window.visualViewport)==null||k.removeEventListener("scroll",m)}},[t]),s.useEffect(()=>{const p=g=>{var w;if(g.key!=="Escape"||r)return;const m=document.activeElement;m instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(m))||(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,m=p.target;g instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(g))&&!m.closest("input")&&g.blur(),Q4(p)};return s.useEffect(()=>{const p=g=>{if(r)return;const m=g.target;m.closest('[data-guide="catch"], [data-guide="card"], [data-guide="inline"]')||document.querySelector('[data-guide="catch"]')||m.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 doe({target:e,onOpenImage:t,onClear:n}){var f;const r=Zd(),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()||Hr(e),u=s.useCallback(()=>{a&&(r.closeNow(),t())},[a,r.closeNow,t]);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-token sc-target-chip",children:[o.jsxs("button",{type:"button",className:"sc-target-open","aria-haspopup":"dialog","aria-label":`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,children:[a?o.jsx("img",{src:vn(a,"micro"),alt:""}):o.jsx("span",{className:"sc-target-thumb",children:o.jsx($a,{})}),"Refining"]}),n&&o.jsx("button",{type:"button",className:"sc-target-x","aria-label":"Make a new shot instead",onClick:h=>{h.stopPropagation(),r.closeNow(),n()},children:o.jsx(jn,{size:12})})]}),r.shown&&a&&o.jsx(Vd,{anchor:r.shown.anchor,kind:"shot",src:vn(a,"tile"),label:l,noun:"Refining this shot",onOpen:u,onHoverIn:r.keep,onHoverOut:r.close,onClose:r.closeNow})]})}function Nd({src:e,kind:t,label:n,noun:r,actions:a,onRestoreFocus:i,onClose:l}){const[u,f]=s.useState(!1),h=r??AL[t],p=s.useRef(null);return o.jsxs(Gs,{className:"sc-lightbox",maxWidth:"min(880px, 92vw)",onOpenAutoFocus:()=>{p.current=document.activeElement},onCloseAutoFocus:g=>{var m;if(g.preventDefault(),i)return i();(m=p.current)!=null&&m.isConnected&&p.current.focus()},onDismiss:l,children:[o.jsx("div",{className:"sc-newdlg-head sc-lightbox-head",children:o.jsx(Ns,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(jn,{size:16})})})}),o.jsx("div",{className:"sc-lightbox-frame","data-kind":t,children:u?o.jsxs("span",{className:"sc-lightbox-blank",children:[o.jsx(Oa,{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 foe={"codex-cli":{sizing:"advisory"},openrouter:{sizing:"ratio"},replicate:{sizing:"ratio"},fal:{sizing:"exact"},demo:{sizing:"exact"}},hoe={sizing:"exact"},zL=e=>foe[e]??hoe;function poe(e,t){const n=zL(e).formats;return!n||n.includes(t)}const _y=e=>zL(e).sizing,moe="portrait",goe=1,voe="standard",ii=[{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"}],nm=[1,2,3,4],BL=e=>Xr.filter(t=>!poe(e,t.id)).map(t=>t.id),cv=(e,t)=>t.length===0?void 0:`${e} cannot make ${Xr.filter(n=>t.includes(n.id)).map(n=>n.hint).join(" or ")}.`,Vy=e=>{var n;e.preventDefault();const t=e.currentTarget??e.target;(n=t==null?void 0:t.querySelector('[role="radiogroup"]'))==null||n.focus()};function g6({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(yd,{open:r,onOpenChange:a,children:[o.jsx(bd,{children:o.jsx("button",{type:"button",className:"sc-var","aria-label":e,"data-guide":u,children:n})}),o.jsx(xd,{ref:f,className:"sc-setpop",align:"end",sideOffset:8,width:t,onOpenAutoFocus:Vy,onCloseAutoFocus:l,onInteractOutside:h=>{var p;(p=h.target)!=null&&p.closest(".sc-prompt-pills")&&h.preventDefault()},children:i(()=>a(!1))})]})}function woe({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 m=Xr.find($=>$.id===r)??Xr[0],w=ii.find($=>$.id===u)??ii[1],y=BL(t),b=_y(t),[S,k]=s.useState(null),C=s.useRef(null);C.current=S;const E=$=>{$.preventDefault(),C.current===null&&(h==null||h($))},A={aspect:"shape",variants:"count",resolution:"quality"},L=$=>({open:S===$,onCloseAutoFocus:E,guide:p?`compose.${A[$]}`:void 0,onOpenChange:N=>{!N&&C.current===$&&(g==null||g(A[$])),k(j=>N?$:j===$?null:j)}});return o.jsxs("div",{className:"sc-prompt-pills","data-guide":p?"compose.settings-row":void 0,children:[o.jsx(g6,{...L("aspect"),aria:`Aspect ${m.label}, ${m.hint}`,width:"178px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(z4,{w:m.w,h:m.h,slot:15,box:13}),m.label]}),children:$=>o.jsxs(o.Fragment,{children:[o.jsx(si,{label:"Aspect ratio",className:"sc-setpop-list",value:r,ids:Xr.map(N=>N.id),unavailable:y,onChange:a,children:Xr.map(N=>o.jsxs(ai,{id:N.id,className:"sc-setrow",on:N.id===r,unavailable:y.includes(N.id),label:`${N.label}, ${N.hint}`,onPick:()=>{a(N.id),$()},children:[o.jsx(z4,{w:N.w,h:N.h,slot:20,box:17}),o.jsx("span",{className:"sc-setrow-n",children:N.label}),o.jsx("span",{className:"sc-setrow-v",children:N.hint}),o.jsx(Ak,{})]},N.id))}),cv(n,y)&&o.jsx(qX,{children:cv(n,y)})]})}),e==="generation"&&o.jsx(g6,{...L("variants"),aria:`${i} shot${i===1?"":"s"}`,width:"156px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(LC,{size:14}),i]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(si,{label:"Shots",className:"sc-seg",value:String(i),ids:nm.map(String),onChange:N=>l(Number(N)),children:nm.map(N=>o.jsx(ai,{id:String(N),className:"sc-seg-o",on:N===i,label:`${N} shot${N===1?"":"s"}`,onPick:()=>{l(N),$()},children:N},N))})})}),e==="generation"&&b!=="ratio"&&o.jsx(g6,{...L("resolution"),aria:`Resolution ${w.label}, ${w.edge} px`,width:"192px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(qE,{size:14}),w.label]}),children:$=>o.jsx(o.Fragment,{children:o.jsx(si,{label:"Resolution",className:"sc-setpop-list",value:u,ids:ii.map(N=>N.id),onChange:N=>f(N),children:ii.map(N=>o.jsxs(ai,{id:N.id,className:"sc-setrow",on:N.id===u,label:`${N.label}, ${N.edge} px, ${N.note}`,onPick:()=>{f(N.id),$()},children:[o.jsx("span",{className:"sc-setrow-n",children:N.label}),o.jsxs("span",{className:"sc-setrow-v",children:[N.edge," px"]}),o.jsx(Ak,{})]},N.id))})})})]})}function UL({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,engineChoices:h,onEngine:p}){const g=BL(t),m=_y(t);return o.jsxs(o.Fragment,{children:[h&&p&&h.length>1&&o.jsx(Wh,{label:"Engine",children:o.jsx(si,{label:"Engine",className:"sc-seg",value:t,ids:h.map(w=>w.id),onChange:p,children:h.map(w=>o.jsx(ai,{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(Wh,{label:"Aspect ratio",note:cv(n,g),children:o.jsx(si,{label:"Aspect ratio",className:"sc-seg",value:r,ids:Xr.map(w=>w.id),unavailable:g,onChange:a,children:Xr.map(w=>o.jsxs(ai,{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(z4,{w:w.w,h:w.h,slot:17,box:14}),w.hint]},w.id))})}),e==="generation"&&o.jsx(Wh,{label:"Shots",children:o.jsx(si,{label:"Shots",className:"sc-seg",value:String(i),ids:nm.map(String),onChange:w=>l(Number(w)),children:nm.map(w=>o.jsx(ai,{id:String(w),className:"sc-seg-o",on:w===i,label:`${w} shot${w===1?"":"s"}`,onPick:()=>l(w),children:w},w))})}),e==="generation"&&m!=="ratio"&&o.jsx(Wh,{label:"Resolution",note:m==="advisory"?"This engine renders at its own size, so this is a request rather than a guarantee.":void 0,children:o.jsx(si,{label:"Resolution",className:"sc-seg",value:u,ids:ii.map(w=>w.id),onChange:w=>f(w),children:ii.map(w=>o.jsx(ai,{id:w.id,className:"sc-seg-o",on:w.id===u,label:m==="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 Wh({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 yoe({guide:e,onSettle:t,...n}){const[r,a]=s.useState(!1),i=f=>{!f&&r&&(t==null||t()),a(f)},{sheet:l,grip:u}=Od(()=>i(!1));return o.jsxs(Ll,{open:r,onOpenChange:i,children:[o.jsx(Jv,{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(zv,{size:16})})}),o.jsxs(Tl,{children:[o.jsx($l,{className:"sc-shotsheet-scrim"}),o.jsxs(Dl,{ref:l,className:"sc-shotsheet","aria-describedby":void 0,onOpenAutoFocus:Vy,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(Hl,{className:"sc-vh",children:"Shot settings"})]}),o.jsx(UL,{...n})]})]})]})}const WL=e=>e.t==="template"&&typeof e.view=="string"&&Object.hasOwn(fl,e.view);async function boe(e){return Promise.all(e.map(async t=>{if(t.t!=="template"||!WL(t))return t;const{view:n,viewName:r,...a}=t,i=await Ee.pickSceneView(t.id,n).then(l=>l.hash,()=>null);return i?{...a,view:i,...r?{viewName:r}:{}}:a}))}function g7(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 xoe(e,t){return e>0&&t>0&&Math.abs(Math.log(t))<Math.abs(Math.log(e))-.01?"crop":"extend"}const v6=2,koe=.15;function Soe(e,t){if(xoe(e,t)==="crop")return"crop";if(!(e>0&&t>0))return"extend";const n=t>e?t/e:e/t;return(n>v6?Math.max(v6,n*(1-koe)):n)>v6+1e-9?"crop":"extend"}const uv=4,rm=24,J0=24,KL={product:[],presenter:[],scene:null,ref:[],color:[]};function Eoe(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 Coe(e){return`${e.product.join(",")}|${e.presenter.join(",")}|${e.scene??""}|${e.ref.join(",")}|${e.color.join(",")}`}function joe(e,t,n){const r=e.slice(0,n);return{visible:r,more:Math.max(0,e.length-r.length)}}const Zy=s.forwardRef(function({projectId:t,brand:n,engines:r,parentId:a,initialBrief:i,suppressDraftRestore:l,startScene:u,startSetup:f,startPresenter:h,startProduct:p,startRef:g,startView:m,startFresh:w,onSeedsSpent:y,openAttachTab:b,onQueued:S,onSending:k,onAttached:C,onCeiling:E,target:A,holdFor:L,onClearTarget:$,sourceImage:N,onRestoreBranchId:j,setSlug:P,persistDraft:R=!0,variant:H="dock",guided:D=!1},U){var Ud,Sf;const{products:_,productsLoaded:B}=un(),{demoProducts:K,demoProductsLoaded:V,loaded:O}=Mn(),I=mf(),Y=I.scenes,Z=I.presenters,X=Zl(),z=zl(),{push:J}=rr(),he=r.filter(we=>we.available),[te,me]=Pa(Qr.engine,k1);s.useEffect(()=>{const we=LQ(he,te);we!==te&&me(we)},[he,te,me]);const re=he.length===0&&r.some(we=>we.code==="not-installed"||we.code==="not-authenticated"),ee=he.length===0,q=ee?re?{icon:o.jsx(GR,{}),title:"Image generation is not set up yet",detail:"About a minute, using the ChatGPT account you already have.",action:"Set up",onAct:()=>z(),info:!0}:{icon:o.jsx(a1,{size:15}),title:"No image provider connected",detail:"Add a provider key and this prompt is ready to run.",action:"Open settings",onAct:()=>X("engines"),info:!1}:null,[ie,Oe]=s.useState(ni()),[ae,pe]=s.useState(void 0),[Te,gt,Ze,tt]=L8(Qr.format,moe),[De,Se]=s.useState({}),Q=A&&A.kind!=="root"?A:null,je=Q?Dae(Q.brief):void 0,Re=Q?De[Q.id]??je??Te:Te,se=we=>{Q?Se(mt=>({...mt,[Q.id]:we})):gt(we)},[G,oe]=s.useState({}),[Ne,Ue,st,Pe]=L8(Qr.count,goe),[Ie,Ge]=s.useState(!1),[ft,bt]=s.useState(null),[at,Zt]=s.useState(null),[jt,Ft]=s.useState(!1),[Pt,$t]=s.useState("All"),[ke,Je]=s.useState(0),[Et,Xe]=s.useState(null),[rt,nt,qt,Yt]=L8(Qr.quality,voe),[an,Wt]=s.useState(!1),[Rn,Bt]=s.useState(!1),ne=we=>Bt(we),ce=Or("(max-width: 767px)"),ue=s.useRef(null),ze=s.useRef(null),Ve=s.useRef(null),xt=s.useId(),yt={...tt?{format:tt}:{},...Pe?{count:Pe}:{},...Yt?{quality:Yt}:{}},kt=s.useRef({tokens:ie,tplFields:G,branchId:(A==null?void 0:A.id)??null,lent:yt});kt.current={tokens:ie,tplFields:G,branchId:(A==null?void 0:A.id)??null,lent:yt};const ot=s.useRef(null),ht=s.useRef(null),Ae=s.useRef(null),ve=s.useRef(void 0),et=s.useRef(void 0),Ct=s.useRef(void 0),xe=s.useRef(void 0),it=s.useCallback(we=>{if(Ae.current&&(clearTimeout(Ae.current),Ae.current=null),!R)return;const mt=kt.current;if(mt.branchId)return;const tn=ot.current??mt.tokens;V8(tn,mt.tplFields)?Gw(we,{tokens:tn,tplFields:mt.tplFields,setSlug:P,lent:mt.lent}):nk(we)},[P,R]);s.useEffect(()=>{b&&($t(b),Ft(!0))},[b]);const wt=s.useCallback(we=>{if(!we.some(WL)){ot.current=null,pe(we);return}ot.current=we,boe(we).then(mt=>{ot.current===we&&(ot.current=null,pe(mt))})},[]),$e=we=>{Ze(we.format&&Xr.some(mt=>mt.id===we.format)?we.format:null),st(we.count??null),qt(we.quality&&ii.some(mt=>mt.id===we.quality)?we.quality:null)};s.useEffect(()=>{if(!i)return;const we=(i.tokens??[]).find(mt=>mt.t==="format");we&&Ze(we.id),st(i.variants??null),i.quality&&qt(i.quality),oe(i.templateFields??{}),wt(yy(i))},[i]),s.useEffect(()=>{var Ef;const we=ht.current,mt=!!we&&we!==n.id;mt&&it(we);const tn=!R||!mt&&(!!i||!!l),mn=we!==n.id;let rn=null,Nn=null,Kr=null;if(!tn&&mn){const Dn=tk(n.id);Dn&&V8(Dn.tokens,Dn.tplFields)?(rn=up(n,Dn.tokens),Nn=Dn.tplFields,Kr=Dn.lent??null):mt&&(rn=ni(),Nn={})}mt&&(Ze(null),st(null),qt(null),Se({}));const On=!!u&&u!==ve.current||!!h&&h!==et.current||!!p&&p!==Ct.current||!!g&&!u&&g!==xe.current;let sr=null;if(w&&On){const Dn=mn?null:kt.current,ns=rn??(Dn?ot.current??Dn.tokens:null),ws=Nn??(Dn==null?void 0:Dn.tplFields)??{};ns&&V8(ns,ws)&&(sr={tokens:ns,tplFields:ws,lent:Kr??(Dn==null?void 0:Dn.lent)??null}),rn=ni(),Nn={},Kr=null,Ze(null),st(null),qt(null)}const ir=()=>mn?ni():kt.current.tokens;let Fa=!1;if(u&&u!==ve.current){ve.current=u,Fa=!0;const Dn=rn??ir(),ns=Dn.find(_a=>_a.t==="template"),ws=(ns==null?void 0:ns.id)??null,I2=((Ef=Y.find(_a=>_a.id===u))==null?void 0:Ef.name)??"this place",Wd=g7(ws,u,I2,null,null),ou=g&&/^[a-f0-9]{32}$/.test(g)?g:null,Cf=m&&m in fl?fl[m]:void 0;if((Wd.changed||ou)&&(rn=[{t:"template",id:u,...f?{setup:f}:{},...ou?{view:ou,...Cf?{viewName:Cf}:{}}:{}},...Dn.filter(_a=>_a.t!=="template")],Wd.toast)){const _a=Wd.toast;J({kind:"info",title:_a.title,action:{label:"Undo",onClick:()=>{var jf,Af;_a.prevSceneId?(jf=ue.current)==null||jf.insert({t:"template",id:_a.prevSceneId}):(Af=ue.current)==null||Af.removeTemplate()}}})}}if(h&&h!==et.current){et.current=h,Fa=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="character"&&ws.id===h)||(rn=[...Dn,{t:"character",id:h}])}if(p&&p!==Ct.current){Ct.current=p,Fa=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="product"&&ws.id===p)||(rn=[...Dn,{t:"product",id:p}])}if(g&&!u&&/^[a-f0-9]{32}$/.test(g)&&g!==xe.current){xe.current=g,Fa=!0;const Dn=rn??ir();Dn.some(ws=>ws.t==="ref"&&ws.imageHash===g)||(rn=[...Dn,{t:"ref",imageHash:g,label:"Place view"}])}if(rn&&(wt(rn),Nn&&oe(Nn)),Kr&&$e(Kr),sr){const Dn=sr,ns=n.id;J({kind:"info",title:"Started a new shot",action:{label:"Undo",onClick:()=>pY(ns,{tokens:Dn.tokens,tplFields:Dn.tplFields,setSlug:P,lent:Dn.lent??void 0})}})}Fa&&(y==null||y()),ht.current=n.id},[n.id,u,h,p,g]),s.useEffect(()=>{var we;ae&&((we=ue.current)==null||we.setTokens(ae),pe(void 0))},[ae]);const qe=s.useMemo(()=>{var rn;const we=Xr.find(Nn=>Nn.id===Re)??Xr[0],tn=(((rn=ii.find(Nn=>Nn.id===rt))==null?void 0:rn.edge)??1024)/Math.max(we.w,we.h),mn=Nn=>Math.max(256,Math.round(Nn*tn/8)*8);return{t:"format",id:we.id,w:mn(we.w),h:mn(we.h)}},[Re,rt]),Lt=s.useMemo(()=>[qe,...ie],[qe,ie]),Ut=s.useMemo(()=>({tokens:Lt,templateFields:G,variants:Ne,quality:rt,format:Re}),[Lt,G,Ne,rt,Re]),Nt=ie.some(we=>we.t==="text"?!!we.v.trim():!0),_t=s.useMemo(()=>{const we=ie.find(mt=>mt.t==="template");return we?Y.find(mt=>mt.id===we.id)??null:null},[ie,Y]),Me=s.useMemo(()=>{const we=ie.find(mt=>mt.t==="template");return(we==null?void 0:we.id)??null},[ie]),Be=s.useCallback(we=>{var Nn,Kr;const mt=(_t==null?void 0:_t.id)??null,tn=(A==null?void 0:A.id)??null,mn=((Nn=Y.find(On=>On.id===we))==null?void 0:Nn.name)??"this place",rn=g7(mt,we,mn,tn,A?Hr(A):null);if(rn.changed&&((Kr=ue.current)==null||Kr.insert({t:"template",id:we}),rn.toast)){const On=rn.toast;J({kind:"info",title:On.title,action:{label:"Undo",onClick:()=>{var sr,ir;On.prevSceneId?(sr=ue.current)==null||sr.insert({t:"template",id:On.prevSceneId}):(ir=ue.current)==null||ir.removeTemplate(),On.branchWasCleared&&tn&&(j==null||j(tn))}}})}},[_t,A,Y,J,j]);s.useImperativeHandle(U,()=>({insertToken:we=>{var mt;return(mt=ue.current)==null?void 0:mt.insert(we)},removeToken:we=>{var mt;return(mt=ue.current)==null?void 0:mt.remove(we)},applyScene:we=>Be(we),removeTemplate:()=>{var we;return(we=ue.current)==null?void 0:we.removeTemplate()},openAttach:we=>fo(we),showAttach:()=>{le.current||fo("All")},focus:()=>{var we;return(we=ue.current)==null?void 0:we.focus()},submit:()=>{po()}}));const Qe=s.useMemo(()=>Eoe(ie),[ie]),F=Coe(Qe),de=Yae(ie),ye=s.useMemo(()=>qae(de),[de]),Ke=s.useRef(Qe);Ke.current=Qe,s.useEffect(()=>{C==null||C(Ke.current)},[F,C]),s.useEffect(()=>{var we;!O||!Me||_t||((we=ue.current)==null||we.removeTemplate(),J({kind:"warning",title:"That place is no longer available",detail:"Removed from the brief."}))},[O,Me,_t,J]);const Le=s.useRef(null);s.useEffect(()=>(Ae.current&&clearTimeout(Ae.current),Ae.current=setTimeout(()=>it(ht.current??n.id),500),()=>{Ae.current&&clearTimeout(Ae.current)}),[ie,G,tt,Pe,Yt,A==null?void 0:A.id,n.id,it]),s.useEffect(()=>R?dY():void 0,[R]),s.useEffect(()=>{if(!R)return;const we=mt=>{const tn=mt.detail;if(tn!==(ht.current??n.id))return;const mn=tk(tn);mn&&(wt(up(n,mn.tokens)),oe(mn.tplFields),$e(mn.lent??{}))};return window.addEventListener(R4,we),()=>window.removeEventListener(R4,we)},[R,n,wt]),s.useEffect(()=>()=>it(ht.current??n.id),[it]),s.useEffect(()=>{const we=()=>it(ht.current??n.id);return window.addEventListener("beforeunload",we),()=>window.removeEventListener("beforeunload",we)},[it,n.id]);const ct=r.find(we=>we.id===te),Ot=ct?yl(ct.displayName):"This engine",zt=!!A&&A.kind!=="root"&&A.status==="running",Rt=A&&A.kind!=="root"&&A.status==="done"&&A.images.length>0||zt,Sn=!!(ct!=null&&ct.supportsEdit),En=!!Q&&!!je&&je!==Re&&Rt&&!_t,Qn=En?Soe(vi(je),vi(Re)):null,dn=Qn==="crop",vr=Qn==="extend"&&Sn,Kt=Xr.find(we=>we.id===Re),br=Kt?`${Kt.label} ${Kt.hint}`:Re,[Ir,wn]=s.useState(null),Vo=()=>{A!=null&&A.images[0]&&wn({src:Dr(A.images[0]),kind:"shot",label:Hr(A),noun:"Refining this shot"})},An=Rt&&!_t&&(Sn||dn||vr)?"edit":"generation",Ys=An==="edit"&&!!A&&H!=="overlay",Rs=Rt?_t?"A place starts a new shot.":dn||vr||Sn?null:`${(ct==null?void 0:ct.displayName)??"This engine"} cannot edit. This makes a new shot.`:null,on=s.useMemo(()=>{const we=Xr.find(Nn=>Nn.id===Re)??Xr[0],mt=`Aspect ${we.label} ${we.hint}`;if(An==="edit")return mt;const tn=ii.find(Nn=>Nn.id===rt),mn=_y(te),rn=mn==="ratio"||!tn?null:mn==="advisory"?`${tn.label}, asking for ${tn.edge} px`:`${tn.label} ${tn.edge} px`;return[mt,`${Ne} shot${Ne===1?"":"s"}`,rn&&`resolution ${rn}`].filter(Boolean).join(", ")},[An,Re,Ne,rt,te]),yn=s.useRef(void 0),Kn=s.useRef(void 0);s.useEffect(()=>{var mn;const we=Rt?(A==null?void 0:A.id)??null:null,mt=we!==yn.current&&yn.current!==void 0;yn.current=we;const tn=Me!==Kn.current;Kn.current=Me,!(!_t||!Rt)&&(mt&&!tn&&we?(mn=ue.current)==null||mn.removeTemplate():$==null||$())},[_t,Me,Rt,A,$]);const Wr=(at==null?void 0:at.warnings.filter(we=>we.includes("built around a product")))??[],Jn=En&&!Nt,_n=dn&&Nt,ts=Z.length>0&&ie.some(we=>we.t==="character"&&!Z.some(mt=>mt.id===we.id)),fa=!Ie&&(Nt||Jn)&&!_n&&!ts&&!!t&&!zt&&!L&&(dn||!ee),Zo=ee&&!dn?"Image generation is not set up yet":Ie?"Working on the last one":t?zt?"Wait for this version to finish, or press X to start a new shot":L?"Wait for this refinement to finish":_n?"This shape is reached by cropping, and a crop uses no words. Clear the prompt, or keep the current shape.":ts?"Remove the person who is no longer in your roster":!Nt&&!Jn?"Write a prompt first":null:"Still opening this brand";s.useEffect(()=>{const we=An==="edit"&&!!A;if(dn||!Nt&&!we){Zt(null);return}Le.current&&clearTimeout(Le.current);const mt=Ut;return Le.current=setTimeout(()=>{Ee.previewBrief(Ut,te,n.id,we?A.id:void 0).then(tn=>Zt({...tn,forBrief:mt})).catch(()=>Zt(null))},280),()=>{Le.current&&clearTimeout(Le.current)}},[Ut,te,n.id,Nt,An,A,dn]);const ms=we=>{var mt;se(we),(mt=ue.current)==null||mt.focus()},qs=we=>{var mt;nt(we),(mt=ue.current)==null||mt.focus()},zo=we=>{var mt;Ue(we),(mt=ue.current)==null||mt.focus()},Xs=we=>{var mt;we.preventDefault(),(mt=ue.current)==null||mt.focus()},fo=we=>{$t(we),Je(mt=>mt+1),Ft(!0)},le=s.useRef(!1);le.current=jt;const Fe=s.useRef(fo);Fe.current=fo;const lt=s.useCallback(({restore:we})=>{var mt;le.current&&(le.current=!1,Ft(!1),we&&((mt=ue.current)==null||mt.restoreCaret()))},[]),en=s.useRef(Be);en.current=Be;const nn=s.useRef(ie);nn.current=ie;const Zn=s.useCallback(we=>{var tn;const mt=we.token;mt.t==="template"?en.current(mt.id):(tn=ue.current)==null||tn.insert(mt)},[]),$n=s.useCallback(we=>{var tn,mn;const mt=we.token;mt.t==="template"?(tn=ue.current)==null||tn.removeTemplate():(mn=ue.current)==null||mn.remove(mt)},[]),Pn=async we=>{var tn;if(!(we!=null&&we.length))return;const mt=Array.from(we).filter(mn=>mn.type.startsWith("image/"));if(!mt.length){J({kind:"warning",title:"Only images can be attached here"});return}Wt(!0),bt(null);try{for(const mn of mt.slice(0,4)){const rn=await p1(mn);(tn=ue.current)==null||tn.insert({t:"ref",imageHash:rn,label:Aoe(mn.name)})}mt.length>4&&J({kind:"warning",title:"Only the first 4 images were attached",detail:`${mt.length-4} more ${mt.length-4===1?"was":"were"} skipped. Attach ${mt.length-4===1?"it":"them"} in another pick.`})}catch(mn){bt(String(mn.message??mn)),J(ln(mn,"Could not attach that image"))}finally{Wt(!1),Ve.current&&(Ve.current.value="")}},fn=at&&at.forBrief===Ut?at:null,or=s.useMemo(()=>ie.filter(we=>z0.has(we.t)).length,[ie]),ha=s.useRef(null),Fr=s.useMemo(()=>or===0?(ha.current=null,null):(fn&&(ha.current={cap:Tae(fn),described:$ae(fn),preview:fn}),ha.current),[fn,or]),nu=(Fr==null?void 0:Fr.cap)??null,gs=(Fr==null?void 0:Fr.preview)??null,ho=(ct==null?void 0:ct.displayName)??"This engine",Wl=or>=em?ov:null;s.useEffect(()=>{E==null||E(Wl)},[Wl,E]);const ru=we=>{const mt=Fr==null?void 0:Fr.described;return!mt||mt.size===0?!1:we.t==="product"?mt.has(bc("product",we.id)):we.t==="character"?mt.has(bc("character",we.id)):we.t==="template"?mt.has(bc("scene",we.id)):we.t==="ref"?mt.has(bc("reference",we.imageHash)):we.t==="mark"?mt.has(bc("brand",we.imageHash)):!1},bf=nu!=null?`Described in words: ${ho} pictures ${nu} per shot, products and people first. Drag it earlier to picture it.`:null,Ti=_t?Wr.length>0?"This place builds around a product. Attach one.":(gs==null?void 0:gs.warnings.some(we=>we.includes("built around a person")))??!1?"This place builds around a person. Without one, only the setting renders.":null:null,su=we=>{var Nn,Kr;if(we.t==="template")return Ti;if(we.t==="product"&&B&&V&&!((_.length?_:((Nn=n.json)==null?void 0:Nn.products)??[]).some(ir=>ir.id===we.id)||K.some(ir=>ir.id===we.id)))return"This product is no longer in your library. Remove it from the brief.";if(we.t==="mark"&&!of(n.json).some(On=>On.hash===we.imageHash))return"This mark is no longer in your brand kit. Remove it from the brief.";if(!gs)return null;const mt=(ct==null?void 0:ct.displayName)??"this engine",tn=gs.cap,mn=On=>`${On} won't reach ${mt} this time.`,rn=(On,sr)=>{var ir;return((ir=gs.dropped)==null?void 0:ir.some(Fa=>Fa.role===On&&Fa.id===sr&&Fa.reason==="missing"))??!1};if(we.t==="ref"&&!gs.attachments.some(On=>On.hash===we.imageHash))return tn===0?`This reference won't reach ${mt}. Choose an engine that reads images, or remove it.`:tn==null?mn("This reference"):null;if(we.t==="mark"&&!gs.attachments.some(On=>On.role==="brand"&&On.hash===we.imageHash))return tn===0?`The brand mark won't reach ${mt}, so the logo can't be drawn from it. Choose an engine that reads images.`:tn==null?`${mn("The brand mark")} The logo can't be drawn from it.`:null;if(we.t==="mark"){const On=gs.warnings.find(sr=>sr.includes("px across"));if(On)return On}if(we.t==="product"){const sr=(_.length?_:((Kr=n.json)==null?void 0:Kr.products)??[]).find(ir=>ir.id===we.id)??K.find(ir=>ir.id===we.id);if(sr&&!gs.attachments.some(ir=>ir.role==="product"&&ir.id===sr.id))return rn("product",sr.id)?`${sr.name} has no usable photo. Re-add one, or remove this.`:null}if(we.t==="character"){const On=Z.find(sr=>sr.id===we.id);if(!On&&Z.length>0)return"This person is no longer in your roster. Remove them from the brief.";if(On&&!gs.attachments.some(sr=>sr.role==="character"&&sr.id===On.id))return rn("character",On.id)?`${On.name} has no usable photo. Re-add one, or remove this.`:null}return null},xf=s.useCallback(su,[gs,ct==null?void 0:ct.displayName,Ti,_,B,n.json,K,V,Z]),vs=s.useCallback(ru,[Fr]),po=async()=>{var mt,tn,mn;if(!fa)return;Ge(!0),bt(null);const we=ie.flatMap(rn=>rn.t==="text"?[rn.v]:[]).join(" ").replace(/\s+/g," ").trim();k==null||k({said:we||"Your shot",count:An==="generation"?Ne:1,format:Re});try{if(!t)throw new Error("the workspace is still loading");const rn=await Ee.addNode({projectId:t,parentId:An==="edit"&&A?A.id:a,kind:An,engineId:te,count:Ne,brief:{...Ut,tokens:up(n,Ut.tokens)},...An==="edit"&&N?{sourceImage:N}:{},...An==="edit"&&Qn?{reshape:Qn}:{}}),Nn=rn.warnings??[];Nn.length===1?J({kind:"warning",title:"Sent, with one thing to know",detail:Nn[0]}):Nn.length>1&&J({kind:"warning",title:`Sent, with ${Nn.length} things to know`,detail:Nn.join(" ")}),ot.current=null,(mt=ue.current)==null||mt.setTokens(ni()),oe({}),Ze(null),Se({}),st(null),qt(null),R&&nk(n.id),S(rn.id,An,(tn=rn.siblings)==null?void 0:tn.map(Kr=>Kr.id),(mn=rn.siblings)!=null&&mn.length?rn.siblings:[rn])}catch(rn){const Nn=String(rn.message??rn);bt(Nn),J(ln(rn,"That did not send",ct==null?void 0:ct.displayName)),k==null||k(null)}finally{Ge(!1)}},$i=(Ud=ie.find(we=>we.t==="product"))==null?void 0:Ud.id,Di=$i?_.find(we=>we.id===$i)??(((Sf=n.json)==null?void 0:Sf.products)??[]).find(we=>we.id===$i)??K.find(we=>we.id===$i)??null:null,kf=Di?dy(Di):null,au=D?{brandId:n.id,products:ie.filter(we=>we.t==="product").length,presenters:ie.filter(we=>we.t==="character").length,scene:!!_t,others:ie.filter(we=>we.t==="color"||we.t==="ref"||we.t==="mark").length,words:ie.some(we=>we.t==="text"&&!!we.v.trim()),busy:Ie,pickerOpen:jt,refining:An==="edit"&&!!A,engine:ee?re?"setup":"settings":"ready"}:null;s.useEffect(()=>{au&&Uk(au)}),s.useEffect(()=>{if(D)return()=>Uk(null)},[D]),s.useEffect(()=>{if(!D||!jt)return;const we=()=>lt({restore:!0});return window.addEventListener("scenri:guide-close-picker",we),()=>window.removeEventListener("scenri:guide-close-picker",we)},[D,jt,lt]),s.useEffect(()=>{if(!D)return;const we=mt=>{var Nn;const{kind:tn}=mt.detail,mn=tn==="presenter"?"character":tn==="scene"?"template":"product",rn=[...nn.current].reverse().find(Kr=>Kr.t===mn);rn&&((Nn=ue.current)==null||Nn.remove(rn))};return window.addEventListener("scenri:guide-take-back",we),()=>window.removeEventListener("scenri:guide-take-back",we)},[D]),s.useEffect(()=>{if(!$)return;const we=()=>$();return window.addEventListener("scenri:guide-clear-refine",we),()=>window.removeEventListener("scenri:guide-clear-refine",we)},[$]),s.useEffect(()=>{if(!D)return;const we=mt=>{const{tab:tn}=mt.detail;Xe(tn??null),tn&&Fe.current(tn)};return window.addEventListener("scenri:guide-picker",we),()=>{window.removeEventListener("scenri:guide-picker",we),Xe(null)}},[D]);const[Kl,Hi]=s.useState(!1),Gl=H==="overlay"&&(Kl||ie.some(we=>we.t==="text"&&!!we.v.trim()));return s.useEffect(()=>{H==="overlay"&&Wk({engaged:Gl})},[H,Gl]),s.useEffect(()=>{if(H==="overlay")return()=>Wk(null)},[H]),o.jsxs("div",{className:"sc-composer","data-guide":D?"compose":void 0,onPointerDownCapture:H==="overlay"&&!Kl?()=>Hi(!0):void 0,onKeyDownCapture:H==="overlay"&&!Kl?()=>Hi(!0):void 0,children:[o.jsx("input",{ref:Ve,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:we=>void Pn(we.target.files)}),Ir&&o.jsx(Nd,{src:Ir.src,kind:Ir.kind,label:Ir.label,noun:Ir.noun,onRestoreFocus:()=>{var we;return(we=ue.current)==null?void 0:we.restoreCaret()},onClose:()=>wn(null)}),jt&&o.jsx(coe,{brand:n,activeProductCategory:kf,refining:Ys,full:Wl,initialTab:Pt,tabNonce:ke,only:Et,id:xt,attached:ye,onUpload:()=>{var we;return(we=Ve.current)==null?void 0:we.click()},onFiles:we=>void Pn(we),onPick:Zn,onRemove:$n,onClose:lt}),q&&o.jsx("div",{className:"sc-notes","data-guide-shape":D?"":void 0,children:q&&o.jsxs("div",{className:"sc-banner","data-tone":"action",children:[o.jsx("span",{className:"sc-banner-ic",children:q.icon}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:q.title}),o.jsxs("small",{children:[q.detail,q.info&&o.jsxs(yd,{children:[o.jsx(bd,{children:o.jsx("button",{type:"button",className:"sc-note-info","aria-label":"What a ChatGPT account has to do with this",children:o.jsx(bm,{size:13})})}),o.jsxs(xd,{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:()=>X("engines"),children:"Use a provider key instead"})]})]})]})]}),o.jsx("button",{type:"button",className:"sc-banner-act","data-primary":"","data-guide":D?"compose.engine":void 0,onClick:q.onAct,children:q.action})]})}),o.jsxs("div",{className:"sc-promptcard","data-guide-shape":D?"":void 0,children:[Rt&&($||H==="overlay"&&An==="edit")&&o.jsxs("div",{className:"sc-target","data-note":Rs?"":void 0,children:[o.jsx(doe,{target:A,onOpenImage:Vo,onClear:$}),Rs&&o.jsx("small",{className:"sc-target-note",children:Rs})]}),Rt&&!$&&Rs&&!(H==="overlay"&&An==="edit")&&o.jsx("small",{className:"sc-target-note sc-target-note-alone",children:Rs}),En&&(dn||vr)&&o.jsxs("small",{className:"sc-reshape-hint","aria-live":"polite",children:[dn?"Will crop to":"Will extend to"," ",br]}),o.jsx(Hae,{ref:ue,onChange:Oe,brand:n,templates:Y,presenters:Z,demoProducts:K,onTemplatePick:Be,scenesSitOut:Ys,flag:xf,described:vs,describedNote:bf,onInspect:we=>wn(we),onAttachRequest:we=>fo(we),activeProductCategory:kf,placeholder:_t?"Add art direction, or run it as written":An==="edit"?"Say what to change about this shot":"What should we shoot? (use $ / @ #)",placeholderSm:_t||An==="edit"?void 0:"What should we shoot? ($ / @ #)",label:_t?"Art direction":An==="edit"?"What to change":"Shot brief",onSubmit:()=>void po(),onDropFiles:we=>void Pn(we)}),o.jsxs("div",{className:"sc-prompt-row",children:[o.jsxs("div",{className:"sc-prompt-left",children:[o.jsx("button",{type:"button",ref:ze,className:"sc-icon-btn sc-attach-toggle","data-guide":D?"compose.add":void 0,"aria-expanded":jt,"aria-controls":jt?xt:void 0,"aria-label":"Add to shot",title:"Add a product, a person, a place, a colour or an image",onClick:()=>jt?lt({restore:!1}):fo("All"),children:an?o.jsx(Tr,{size:"1"}):o.jsx(gr,{size:16})}),he.length>1&&o.jsxs(XN,{value:te,onValueChange:me,children:[o.jsxs(QN,{variant:"ghost",className:"sc-mini-sel",children:[o.jsx(a1,{size:14}),o.jsx("span",{className:"sc-mini-sel-t",children:ct?yl(ct.displayName):"Demo"})]}),o.jsx(JN,{children:he.map(we=>o.jsx(eM,{value:we.id,children:yl(we.displayName)},we.id))})]})]}),o.jsxs("div",{className:"sc-prompt-right",children:[o.jsx(woe,{mode:An,engineId:te,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:zo,quality:rt,onQuality:qs,onCloseAutoFocus:Xs,guided:D}),o.jsxs(yd,{open:Rn,onOpenChange:ne,children:[o.jsx(bd,{children:o.jsxs("button",{type:"button",className:"sc-var sc-more","aria-label":`Shot settings. ${on}`,"data-guide":D&&!ce?"compose.settings":void 0,children:[o.jsx(zv,{size:14}),"More"]})}),o.jsx(xd,{className:"sc-morepop",align:"end",sideOffset:8,width:"300px",onOpenAutoFocus:Vy,onCloseAutoFocus:Xs,children:o.jsx(UL,{mode:An,engineId:te,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:zo,quality:rt,onQuality:qs})})]}),o.jsx(yoe,{guide:D&&ce?"compose.settings":void 0,mode:An,engineId:te,engineName:Ot,formatId:Re,onFormat:ms,count:Ne,onCount:zo,quality:rt,onQuality:qs}),o.jsxs("button",{type:"button",className:"sc-send","data-refine":An==="edit"?"":void 0,"data-guide":D?"compose.send":void 0,"aria-disabled":!fa||void 0,onClick:()=>void po(),"aria-label":An==="edit"?"Refine":"Generate",title:ft??Ti??Zo??`${An==="edit"?"Refine":"Generate"} (enter)`,children:[o.jsx("span",{className:"sc-send-ico",children:Ie?o.jsx(Tr,{size:"1"}):o.jsx(EE,{size:17,weight:"bold"})}),o.jsx("span",{className:"sc-send-lb",children:An==="edit"?"Refine":"Generate"})]})]})]})]})]})});function Aoe(e){return e.replace(/\.[a-z0-9]{2,5}$/i,"").trim()||"Image"}function zy(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 GL({full:e=!0,children:t}){const[n,r]=s.useState(null);return zy(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 By(){const{brand:e}=un(),{tasks:t}=ua(),[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,m=hq(e.json),w=es(m==null?void 0:m.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:(m==null?void 0:m.role)==="mark"?"sc-impbar-badge":void 0}):o.jsx(DC,{size:13,weight:"regular"})}),o.jsx("span",{className:"sc-impbar-count",children:h.subtitle}),o.jsx("span",{className:"sc-impbar-clock",children:Oc(h.startedAt,l)})]}),p&&o.jsxs("button",{type:"button",className:"sc-impbar-stop",disabled:g,"aria-label":"Stop importing",onClick:()=>{r(h.id),Ee.cancelCatalogJob(e.id,p).catch(()=>r(null))},children:[o.jsx(jn,{size:12,weight:"bold"}),g?"Stopping":"Stop"]})]}),a&&o.jsx(I4,{brandId:e.id,jobId:a,onDismiss:()=>i(null)})]})}const Noe={presenter:"Person",product:"Product",scene:"Place"};function YL({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:m,sceneHref:w,active:y,hideRecipe:b,decorative:S,size:k="grid"}){const{contentArriving:C}=Mn(),E=[t,a,u].filter(Boolean).join(" · "),A=a?{key:"presenter",name:a,previewUrl:i,linked:!!(m&&l),href:m&&l?m(l):void 0}:null,L=n&&t?{key:"product",name:t,previewUrl:n,linked:!!(g&&r),href:g&&r?g(r):void 0}:null,$=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":S||void 0,...S?{inert:""}:{},children:[o.jsx(Id,{id:e.id,previewUrl:e.previewUrl,pending:!e.previewUrl&&C,title:e.title,primary:e.title,secondary:b?"":E,useLabel:"Recreate this",variant:"use",onOpen:p,onUse:p,size:k}),(A||L||$)&&o.jsx(Roe,{presenter:A,product:L,scene:$})]})}function Moe(e){return o.jsx(f2,{...e,caption:!1})}function Roe({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(v7,{credit:e,open:r==="presenter",onEnter:()=>a("presenter"),children:Loe(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(v7,{credit:h,open:r===h.key,onEnter:()=>a(h.key),style:f(),children:Poe({credit:h,step:p===0?1:2})})]},h.key))]})]})}function v7({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=MR(),p=h==="large"?144:88,g=h==="large"?168:112;if(s.useLayoutEffect(()=>{var k,C;if(!t||!e.previewUrl){f(null);return}const w=()=>{const E=i.current;if(!E)return;const A=E.getBoundingClientRect(),L=l.current,$=(L==null?void 0:L.offsetWidth)||p,N=(L==null?void 0:L.offsetHeight)||g,j=window.visualViewport,P=Rse(A,{width:(j==null?void 0:j.width)??window.innerWidth,height:(j==null?void 0:j.height)??window.innerHeight},{width:$,height:N});if(!P){f(null);return}f({left:Math.round(P.left),top:Math.round(P.top)})};w();const y=requestAnimationFrame(w),b=i.current,S=b?new ResizeObserver(w):null;return b&&S&&S.observe(b),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),(k=window.visualViewport)==null||k.addEventListener("resize",w),(C=window.visualViewport)==null||C.addEventListener("scroll",w),()=>{var E,A;cancelAnimationFrame(y),S==null||S.disconnect(),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),(E=window.visualViewport)==null||E.removeEventListener("resize",w),(A=window.visualViewport)==null||A.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 m=Noe[e.key];return o.jsxs("span",{ref:i,className:"sc-credit-tip","data-open":t||void 0,onPointerEnter:n,style:a,children:[r,t&&Ur.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":`${m}: ${e.name}`,children:o.jsxs("span",{className:"sc-credit-tip-card",children:[o.jsx("img",{src:Tn(e.previewUrl,"small"),alt:""}),o.jsx("span",{className:"sc-credit-tip-name",children:e.name}),o.jsx("span",{className:"sc-credit-tip-role",children:m})]})}),document.body)]})}function Poe({credit:e,step:t}){const{name:n,previewUrl:r,linked:a,href:i}=e;return a&&i?o.jsx(Vn,{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:Tn(r,"micro"),alt:""}):null}):o.jsx("span",{className:"sc-showcase-chip","data-step":t,children:r?o.jsx("img",{src:Tn(r,"micro"),alt:n}):o.jsx("span",{className:"sc-vh",children:n})})}function Loe(e){const{name:t,previewUrl:n,linked:r,href:a}=e;return r&&a?o.jsxs(Vn,{className:"sc-showcase-badge",to:a,"data-link":!0,"aria-label":`See ${t}`,onClick:i=>i.stopPropagation(),children:[n?o.jsx("img",{src:Tn(n,"micro"),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:Tn(n,"micro"),alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]})}function w7(e){return{key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(e,"_blank")}}function y7(e){return{key:"select",icon:"select",label:"Select",onSelect:e}}function Al(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(w7(e.draft.href)),e.select&&n.push(y7(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(w7(e.href)),e.use&&t.push({key:"use",icon:"use",label:e.use.label,onSelect:e.use.run}),e.select&&t.push(y7(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 person",onSelect:e.onDuplicate}),e.onEdit&&t.push({key:"edit",icon:"edit",label:"Edit person",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 cs(e,t){if(e==="draft")return{tool:"Discard",menu:t>1?`Discard ${t} drafts`:"Discard",icon:"discard",danger:!0};const n=e==="presenter"?"Delete person":e==="product"?"Delete product":"Delete place",r=e==="presenter"?"people":e==="product"?"products":"places";return{tool:"Delete",menu:t>1?`Delete ${t} ${r}`:n,icon:"delete",danger:!0}}function Ai(e,t){const n=t>1;return e==="owned-scene"?n?"Shots already made here keep their images. Their recipe will say these places are gone, and building from one again will miss them.":"Shots already made here keep their images. Their recipe will say this place is gone, and building from one again will miss it.":e==="product"?n?"Shots already made with them keep their images. Their recipe loses these products, and building from one again will miss them.":"Shots already made with it keep their images. Their recipe loses this product, and building from one again will miss it.":n?"Shots already made with them keep their images. Their recipe loses these people, and building from one again will miss them.":"Shots already made with them keep their images. Their recipe loses this person, and building from one again will miss them."}const b7={scenes:"places",presenters:"people",products:"products"};function C2(e,t,n){return{tool:t?"Remove from keepers":"Keep",menu:e>1?t?`Remove ${e} ${b7[n]} from Keepers`:`Add ${e} ${b7[n]} to Keepers`:t?"Remove from Keepers":"Add to Keepers",icon:t?"kept":"keep"}}function j2({kind:e,count:t,openLabel:n,onOpen:r,href:a,onDeselect:i,onAct:l,onKeep:u,allKept:f}){const h=cs(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 m=C2(t,!!f,e==="presenter"?"presenters":e==="product"?"products":"scenes");p.push({key:"keep",icon:m.icon,label:m.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 sm(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 dv({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:m,fresh:w,chosen:y,batching:b,onPick:S,batch:k,size:C="grid"}){const A=k?j2({kind:"presenter",count:k.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>S==null?void 0:S(e.id),onAct:k.onAct,onKeep:k.onKeep,allKept:k.allKept}):Al(!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:S?{run:()=>S(e.id)}:void 0,keep:m?{on:!!g,run:()=>m(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 person",run:()=>h(e.id)}:void 0});return o.jsx(Id,{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:A,bookmarked:g,onBookmark:m,fresh:w,chosen:y,batching:b,onPick:S,size:C})}function qL(e){return o.jsx(f2,{...e})}function E1({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:m,onPick:w,batch:y,size:b="grid"}){const k=y&&h?j2({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}):Al(!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 place",run:()=>h(e.id)}:void 0});return o.jsx(Id,{id:e.id,previewUrl:e.previewUrl,title:e.description||jl(e,"tooltip"),primary:jl(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:k,chosen:g,batching:m,onPick:w,size:b})}function XL(e){return o.jsx(f2,{...e})}const Uu=new Map,Toe=50;function $oe(e,t){for(Uu.delete(e),Uu.set(e,t);Uu.size>Toe;)Uu.delete(Uu.keys().next().value)}function Doe(e){return Uu.get(e)}const Hoe=1e3;function ds({className:e="sc-home",children:t}){const n=s.useRef(null),{key:r}=Bn(),a=s.useRef(!1);return s.useLayoutEffect(()=>{const i=n.current,l=Doe(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,Hoe);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||$oe(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 A2({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 N2({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(Iy,{"aria-label":t.label,activeKey:t.selected,items:n,onSelect:t.onSelect})}const Uy=o.jsx(to,{size:21,weight:"regular"});function Mo({shape:e,title:t,body:n,action:r,mark:a,onRetry:i}){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:i,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:[a&&o.jsx("span",{className:"sc-lib-zero-mark","aria-hidden":!0,children:a}),t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r]})}function M2({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(Mo,{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 Ooe=150;function gf(e){const[t,n]=Ml(),r=t.get("q")??"",a=e.join(","),i=s.useMemo(()=>{const C={};for(const E of a.split(",").filter(Boolean))C[E]=t.get(E)||null;return C},[t,a]),l=s.useCallback(C=>{n(E=>{const A=new URLSearchParams(E);for(const[L,$]of Object.entries(C))$===null||$===""?A.delete(L):A.set(L,$);return A},{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 m=s.useCallback(C=>{f(C),g(),p.current=setTimeout(()=>{p.current=null,h.current=C,l({q:C||null})},Ooe)},[l,g]),w=s.useCallback((C,E)=>l({[C]:E}),[l]),y=l,b=u.trim().length>0||Object.values(i).some(Boolean),S=s.useCallback(()=>{g(),f(""),h.current="",l({q:null})},[l,g]),k=s.useCallback(()=>{g(),f(""),h.current="";const C={q:null};for(const E of a.split(",").filter(Boolean))C[E]=null;l(C)},[l,g,a]);return{q:u,setQ:m,facets:i,setFacet:w,setFacets:y,active:b,clearSearch:S,clear:k}}const Ioe=6,ll=new Map;function x7(e){return ll.get(e)??null}function Foe(e){if(e.key)for(ll.delete(e.key),ll.set(e.key,e);ll.size>Ioe;)ll.delete(ll.keys().next().value)}function _oe(e){for(const[t,n]of ll)n.brandId===e&&ll.delete(t)}const Voe=8;function Zoe(){var je;const{engines:e,scenes:t,loaded:n,presenters:r,presentersLoaded:a,demoProducts:i,showcase:l,showcaseCategories:u,showcaseLoaded:f,showcaseError:h,refetchShowcase:p}=Mn(),{brand:g,workspace:m,root:w,products:y,applyNodes:b}=un(),S=t,{poke:k}=ua(),C=Bl(),E=Un(),{push:A}=rr(),L=Ty(),$=x2(),N=vse(),j=Or(da),{q:P,setQ:R,facets:H,setFacet:D,clearSearch:U,clear:_}=gf(["category"]),B=H.category,K=Re=>D("category",Re),V=P.trim().length>0,[O,I]=Pa(Qr.wallDensity,Sd),Y=eu(O),Z=Re=>I(Re),X=d2(Y),z=c2(Y),J=cX[Y],he=Re=>{const se=new URLSearchParams(Re??{}).toString();E(`${jr(g)}${se?`?${se}`:""}`)},te=y.length?y:((je=g.json)==null?void 0:je.products)??[],me=Re=>{var Ne,Ue,st;const se=(Ne=Re.brief.tokens.find(Pe=>Pe.t==="product"))==null?void 0:Ne.id,G=(Ue=Re.brief.tokens.find(Pe=>Pe.t==="character"))==null?void 0:Ue.id,oe=(st=Re.brief.tokens.find(Pe=>Pe.t==="template"))==null?void 0:st.id;return{product:se?i.find(Pe=>Pe.id===se):void 0,presenter:G?r.find(Pe=>Pe.id===G):void 0,scene:oe?S.find(Pe=>Pe.id===oe):void 0}},re=s.useMemo(()=>{const Re=new Map;for(const se of l){const{product:G,presenter:oe,scene:Ne}=me(se);Re.set(se.id,gse(se,{product:G,presenter:oe,scene:Ne},d6(se.category)))}return Re},[l,i,r,S]),ee=s.useMemo(()=>(B?l.filter(se=>se.category===B):l).filter(se=>Io(re.get(se.id)??se.title,P)),[l,B,P,re]),q=s.useMemo(()=>{const Re=xse(u);return{key:"category",label:"Categories",everyLabel:"All examples",everyCount:l.length,selected:B,onSelect:K,options:Re.map(se=>({value:se,label:d6(se)??se,count:l.filter(G=>G.category===se).length}))}},[l,u,B,K]),ie=Re=>{const{product:se,presenter:G,scene:oe}=me(Re);return{productName:se?Oo(se,"chip"):null,productPreviewUrl:(se==null?void 0:se.previewUrl)??null,productId:(se==null?void 0:se.id)??null,presenterName:(G==null?void 0:G.name)??null,presenterPreviewUrl:G?Si(G).src:null,presenterId:(G==null?void 0:G.id)??null,sceneName:oe?jl(oe,"chip"):null,scenePreviewUrl:(oe==null?void 0:oe.previewUrl)??null,sceneId:(oe==null?void 0:oe.id)??null}},[Oe,ae]=s.useState(null),Te=j?N:Re=>{const se=l.find(G=>G.id===Re);se&&(ae(sv(se)),A({kind:"info",title:`Starting from "${se.title}"`}))},gt=()=>{const se=[...ji(g.id)].reverse().find(G=>S.some(oe=>oe.id===G));he(se?{place:se,attach:"products",compose:"1"}:{attach:"products",compose:"1"})},Ze=s.useMemo(()=>Fp(lf(g),r),[g,r]),tt=Ze.slice(0,J),De=s.useMemo(()=>{const Re=ji(g.id);return Fp(Jc(g),LL(S,se=>Re.includes(se.id)))},[S,g]),Se=De.slice(0,J),Q=s.useMemo(()=>{var st,Pe,Ie,Ge,ft;const Re=new Set,se=bt=>!bt||Re.has(bt)?null:(Re.add(bt),Tn(bt,"tile")),G=bt=>{for(const at of bt){const Zt=l.find(Ft=>Ft.id===at&&Ft.previewUrl),jt=se(Zt==null?void 0:Zt.previewUrl);if(jt)return jt}return null},oe=bt=>{for(const at of bt){const Zt=S.find(Ft=>Ft.id===at&&Ft.previewUrl),jt=se(Zt==null?void 0:Zt.previewUrl);if(jt)return jt}return null},Ne=bt=>{for(const at of l)if(!(!at.previewUrl||Re.has(at.previewUrl))&&!(bt&&!at.brief.tokens.some(Zt=>Zt.t===bt)))return se(at.previewUrl);return null},Ue=te.find(bt=>{var at,Zt;return es((Zt=(at=bt==null?void 0:bt.shots)==null?void 0:at[0])==null?void 0:Zt.file)});return{compose:se(Ue?es((Pe=(st=Ue.shots)==null?void 0:st[0])==null?void 0:Pe.file):null)??G(["c15-orange-pool","orris-waterline","hoops-painted-canvas"])??se((Ie=i.find(bt=>bt.id==="calder-vane-c15-serum"))==null?void 0:Ie.previewUrl)??se((Ge=i.find(bt=>bt.previewUrl))==null?void 0:Ge.previewUrl)??Ne("product"),product:G(["ridgeline-tyre-top","ridgeline-boulder-gap","yuzu-ice-burst"])??se((ft=i.find(bt=>bt.id==="voss-rowe-ridgeline-trail"))==null?void 0:ft.previewUrl)??Ne("product"),presenter:se(Si(r.find(bt=>bt.id==="odette")??r.find(bt=>bt.avatarUrl)??r[0]??{}).src)??Ne("character"),scene:oe(["travertine-window-light","palm-shade-garden","lantern-room","cobalt-container","sunlit-color-field"])??G(["lounge-chair-travertine","lounge-chair-snowfall","capsule-model-village"])??Ne("template")}},[S,r,te,i,l]);return o.jsx(cf.Provider,{value:z,children:o.jsxs(ds,{children:[o.jsxs("main",{className:"sc-main",id:"main","data-no-dock":j||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:gt,children:[o.jsx(QL,{thumbUrl:Q.compose,fallback:o.jsx(fE,{size:22,weight:"fill"})}),o.jsx("b",{children:"Create an image"})]}),o.jsx(w6,{tone:"product",title:"Add a product",count:te.length,thumbUrl:Q.product,icon:o.jsx(xm,{size:22,weight:"fill"}),onClick:()=>C("product")}),o.jsx(w6,{tone:"presenter",title:"Create a person",thumbUrl:Q.presenter,icon:o.jsx(e_,{size:22,weight:"fill"}),onClick:()=>C("presenter")}),o.jsx(w6,{tone:"scene",title:"Create a place",thumbUrl:Q.scene,icon:o.jsx(KF,{size:22,weight:"fill"}),onClick:()=>C("scene")})]}),(!f||h||l.length>0)&&o.jsxs("section",{children:[!f&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":z,style:X,"aria-hidden":!0,children:o.jsx(Moe,{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(A2,{filters:o.jsx(N2,{mode:"tabs",group:q}),search:l.length>=Voe&&o.jsx(zd,{value:P,onChange:R,noun:"examples",total:l.length}),density:o.jsx(u2,{value:Y,onChange:Z})}),ee.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":z,style:X,children:ee.map(Re=>o.jsx(YL,{entry:Re,size:"grid",hideRecipe:!0,onOpen:Te,productHref:se=>Aa(g,se),presenterHref:se=>La(g,se),sceneHref:se=>Br(g,se),...ie(Re)},Re.id))}),ee.length===0&&(V?o.jsx(M2,{noun:"examples",q:P,facet:B?d6(B):null,onClearSearch:U,onClearAll:_}):o.jsx("p",{className:"sc-looks-empty",children:"No example carries that category yet."}))]})]}),(!a||tt.length>0)&&o.jsxs("section",{children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"People"})}),a?o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":z,style:X,children:tt.map(Re=>o.jsx(dv,{presenter:Re,variant:"navigate",size:"grid",onOpen:L},Re.id))}):o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":z,style:X,"aria-hidden":!0,children:o.jsx(qL,{size:"grid",count:J})}),(!a||Ze.length>tt.length)&&o.jsx("div",{className:"sc-lib-more",children:o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:di(g),children:a?`Show all ${Ze.length} people`:"Show all people"})})]}),(!n||Se.length>0)&&o.jsxs("section",{children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Places"})}),n?o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":z,style:X,children:Se.map(Re=>o.jsx(E1,{scene:Re,variant:"navigate",size:"grid",onOpen:$},Re.id))}):o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":z,style:X,"aria-hidden":!0,children:o.jsx(XL,{size:"grid",count:J})}),(!n||De.length>Se.length)&&o.jsx("div",{className:"sc-lib-more",children:o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:gl(g),children:n?`Show all ${De.length} places`:"Show all places"})})]})]}),!j&&o.jsxs(GL,{children:[o.jsx(By,{}),o.jsx(Zy,{projectId:(m==null?void 0:m.id)||null,brand:g,engines:e,parentId:w,initialBrief:Oe,onQueued:(Re,se,G,oe)=>{oe!=null&&oe.length&&b(oe),k(),_oe(g.id),E(jr(g))}})]})]})})}function w6({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(QL,{thumbUrl:a,fallback:n}),o.jsxs("b",{children:[t,r?o.jsx(FN,{variant:"soft",radius:"full",size:"1",children:r}):null]})]})}function QL({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 JL({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 m=Un(),w=sy(),y=g?j2({kind:"draft",count:g.count,openLabel:"Continue",onOpen:()=>m(i),href:i,onDeselect:()=>p==null?void 0:p(e),onAct:g.onAct}):Al(u?{draft:{onContinue:()=>m(i),href:i,onDiscard:()=>u(e)},select:p?{run:()=>p(e)}:void 0}:{onOpen:()=>m(i),href:i}),b=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(Vn,{className:"sc-lookcard-media",to:i,"aria-label":h?`${f?"Deselect":"Select"} ${t}`:`Continue ${t}`,onClick:S=>{h&&p&&(S.preventDefault(),p(e))},children:[n?o.jsx("img",{src:vn(n,"tile"),alt:""}):o.jsx("span",{className:"sc-lookcard-blank",children:l}),r&&o.jsx($a,{}),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:S=>{S.preventDefault(),S.stopPropagation(),p(e)},children:o.jsx(Gn,{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?b:o.jsxs(ef,{children:[o.jsx(tf,{children:b}),o.jsx(nf,{children:y.map(S=>o.jsxs("span",{style:{display:"contents"},children:[S.separated&&o.jsx(Xm,{}),o.jsxs(rf,{color:S.danger?"red":void 0,onSelect:S.onSelect,children:[o.jsx(ld,{name:S.icon}),S.label]})]},S.key))})]})}function Wy({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(),m=g.length>0,w=b=>{b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)};s.useEffect(()=>{p.current=!1,w(h.current)},[t]),s.useEffect(()=>{r||(p.current=!1)},[r]);const y=()=>{if(!(!m||r||p.current)){if(g===t.trim())return l();p.current=!0,i(g)}};return o.jsxs(Gs,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:l,onOpenAutoFocus:b=>{b.preventDefault();const S=h.current;S&&(S.focus(),S.select(),w(S))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:e}),o.jsx(Ns,{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:b=>{f(b.target.value),w(b.currentTarget)},onKeyDown:b=>{b.key==="Enter"&&(b.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:!m||r,"data-busy":r||void 0,onClick:y,children:r?"Saving":"Save"})]})]})}function eT({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:"timer","aria-label":`${Jw(e,t)}, ${Oc(e,t)}`,children:Oc(e,t)})}function zoe({build:e,onCancel:t,onRetry:n,onDismiss:r}){const a=e.stage==="failed",i=a?uo(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($a,{since:e.startedAt}),o.jsx(eT,{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(vE,{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 Ky({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(y6,{label:l.label,onClick:l.onAct,children:o.jsx(to,{size:17,weight:l.filled?"fill":"regular"})}),o.jsx(y6,{label:n,tone:a?"danger":void 0,onClick:i,children:o.jsx(Boe,{name:r})})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(y6,{label:"Done",onClick:u,children:o.jsx(jn,{size:16,weight:"bold"})})})]})}function Boe(e){return o.jsx(Pl,{size:17})}function y6({label:e,tone:t,onClick:n,children:r}){return o.jsx(hr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}const P0=()=>({kind:null,ids:new Set});function Gy(e){const[t,n]=s.useState(P0),r=s.useCallback(()=>n(P0()),[]);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(m=>{if(m.kind&&m.kind!==p)return m;const w=new Set(m.ids);return w.has(g)?w.delete(g):w.add(g),w.size?{kind:m.kind??p,ids:w}:P0()})},[]),i=s.useCallback((p,g)=>{n({kind:p,ids:new Set(g)})},[]),l=s.useCallback(p=>{const g=new Set(p);n(m=>{const w=new Set([...m.ids].filter(y=>g.has(y)));return w.size?{kind:m.kind,ids:w}:P0()})},[]),u=s.useCallback(p=>{n(g=>{if(!g.ids.has(p))return g;const m=new Set(g.ids);return m.delete(p),m.size?{kind:g.kind,ids:m}:P0()})},[]),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 Yy({label:e}){return o.jsx("div",{className:"sc-starter-rule",children:o.jsx("span",{children:e})})}const b6=60;function C1(e,t){const[n,r]=s.useState(b6);s.useEffect(()=>{r(b6)},[t]);const{visible:a,remaining:i}=Hy(e,n),l=s.useCallback(()=>r(u=>u+b6),[]);return{visible:a,remaining:i,showMore:l}}const Uoe=24,Woe=8,x6="__bookmarked";function Koe(){const{scenes:e,collections:t,verticals:n,loaded:r,error:a,refetch:i,applyBrand:l,refreshBrands:u}=Mn(),{brand:f}=un(),h=e,{push:p}=rr(),g=Un(),[m,w]=s.useState(()=>ji(f.id)),y=Ae=>w(k2("scene",f.id,Ae)),b=x2(),{builds:S,poke:k,studio:C}=ua(),E=Bl(),A=s.useMemo(()=>Jc(f),[f]),L=S.filter(Ae=>Ae.kind==="scene"&&(!Ae.finished||Ae.stage==="failed")),$=!!gn({path:pt.sceneStudio}),[N,j]=s.useState(()=>pp(f.id)),P=C.filter(Ae=>Ae.kind==="scene").map(Ae=>`${Ae.id}:${Ae.status}`).join("|");s.useEffect(()=>{$||j(pp(f.id))},[$,f.id,P]);const R=s.useMemo(()=>$re(N,C),[N,C]),[H,D]=s.useState(null),U=Ae=>{Ae.drawing&&Ae.jobId&&Ee.cancelSceneStudioJob(f.id,Ae.jobId).catch(()=>{}),Fre(f.id,Ae.convo),j(pp(f.id))},_=Ae=>{const ve=R.find(et=>et.convo===Ae);ve&&(ve.hash||ve.drawing?D(ve):U(ve))},{q:B,setQ:K,facets:V,setFacets:O,clearSearch:I,clear:Y}=gf(["vertical","bookmarked"]),Z=V.vertical,X=V.bookmarked==="1",z=Gy(`${f.id}|${B}|${Z??""}|${X?"1":""}`),J=B.trim().length>0,[he,te]=Pa(Qr.wallDensity,Sd),me=eu(he),re=Ae=>te(Ae),ee=d2(me),q=c2(me),ie=Ae=>g(Br(f,Ae)),[Oe,ae]=s.useState(null),[pe,Te]=s.useState(!1),[gt,Ze]=s.useState(null),[tt,De]=s.useState(!1),[Se,Q]=s.useState(null),[je,Re]=s.useState(!1),se=s.useCallback(Ae=>{const ve=A.find(et=>et.id===Ae);ve&&ae(ve)},[A]),G=s.useCallback(Ae=>{const ve=A.find(et=>et.id===Ae);ve&&(Q(null),Ze(ve))},[A]),oe=async Ae=>{if(!(!gt||tt)){De(!0),Q(null);try{l((await Ee.updateScene(f.id,gt.id,{name:Ae})).brand),Ze(null)}catch(ve){const et=ln(ve,"Could not rename this place");Q([et.title,et.detail].filter(Boolean).join(" "))}finally{De(!1)}}},Ne=async()=>{if(!(!Oe||pe)){Te(!0);try{l((await Ee.deleteScene(f.id,Oe.id)).brand),z.forget(Oe.id),ae(null)}catch(Ae){(Ae==null?void 0:Ae.status)===404?(await u(),z.forget(Oe.id),ae(null)):p(ln(Ae,"Could not delete this place"))}finally{Te(!1)}}},Ue=s.useMemo(()=>X?h.filter(Ae=>m.includes(Ae.id)):Z?h.filter(Ae=>Ae.verticals.includes(Z)):h,[h,Z,X,m]),Pe=!(A.length>0||L.length>0||R.length>0),Ie=[...h,...A].reduce((Ae,ve)=>Ae+(m.includes(ve.id)?1:0),0),Ge=X&&Ie===0,ft=Ge&&Pe,bt=Ge&&!Pe,at=J||X&&!ft,Zt=s.useMemo(()=>ft?h:Ue,[ft,h,Ue]),jt=s.useMemo(()=>Zt.filter(Ae=>Io(Xp(Ae),B)),[Zt,B]),[Ft,Pt]=s.useState(()=>new Set),{visible:$t,remaining:ke,showMore:Je}=C1(jt,`${Z??""}|${X?"bookmarked":""}|${ft?"browse":""}|${B}`),Et=Ae=>[...A,...h].filter(ve=>!ve.verticals.length||ve.verticals.includes(Ae)).length,Xe=[{value:x6,label:"Keepers",count:Ie},...n.map(Ae=>({value:Ae,label:Ae,count:Et(Ae)}))],rt=h.length>0?"tabs":"none",nt={key:"vertical",label:"Vertical",everyLabel:"All places",everyCount:h.length+A.length,selected:X?x6:Z,onSelect:Ae=>O(Ae===x6?{bookmarked:"1",vertical:null}:{bookmarked:null,vertical:Ae}),options:Xe},qt=s.useMemo(()=>A.filter(Ae=>Z?!Ae.verticals.length||Ae.verticals.includes(Z):!0).filter(Ae=>Io(Xp(Ae),B)).filter(Ae=>X?m.includes(Ae.id):!0),[A,Z,B,X,m]),Yt=X?qt.length>0:R.length>0||L.length>0||qt.length>0,{visible:an,remaining:Wt,showMore:Rn}=C1(qt,`${f.id}|${Z??""}|${X?"bookmarked":""}|${B}`),[Bt,ne]=s.useState(null);s.useEffect(()=>{if(!Bt||Wt<=0)return;const Ae=new IntersectionObserver(ve=>{ve.some(et=>et.isIntersecting)&&Rn()},{root:Bt.closest(".sc-home"),rootMargin:"200% 0px"});return Ae.observe(Bt),()=>Ae.disconnect()},[Bt,Wt,Rn]);const ce=()=>{z.ids.size===1?se([...z.ids][0]):Re(!0)},ue=[...z.ids],ze=ue.length>0&&ue.every(Ae=>m.includes(Ae)),Ve=()=>w($y("scene",f.id,ue,!ze)),xt=C2(z.ids.size,ze,"scenes"),yt=async()=>{if(pe)return;const Ae=[...z.ids];Te(!0);try{const{failed:ve,error:et}=await sm(Ae,Ct=>Ee.deleteScene(f.id,Ct));await u(),z.retain(ve),Re(!1),et&&p(ln(et,"Could not delete these places"))}finally{Te(!1)}},kt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>E("scene"),children:[o.jsx(gr,{size:12})," Create place"]}),ot=(Ae,ve=!1)=>o.jsx("div",{className:"sc-masonry","data-wall":ve||void 0,"data-density":!0,"data-density-size":q,style:ee,children:Ae.map(et=>o.jsx(E1,{scene:et,variant:"use",size:"grid",onOpen:ie,href:Br(f,et.id),onUse:b,bookmarked:m.includes(et.id),onBookmark:y},et.id))}),ht=o.jsx(A2,{title:"Places",filters:o.jsx(N2,{mode:rt,group:nt}),density:o.jsx(u2,{value:me,onChange:re}),search:h.length>=Woe&&o.jsx(zd,{value:B,onChange:K,noun:"places",total:h.length})});return o.jsxs(cf.Provider,{value:q,children:[o.jsx(ds,{children:o.jsxs("main",{className:"sc-looks sc-scenes",id:"main","data-hero":Pe||void 0,onClick:z.onBlank,children:[!Pe&&ht,Yt&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your places"})}),o.jsxs("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":q,style:ee,children:[!X&&R.map(Ae=>o.jsx(JL,{id:Ae.convo,name:Ae.name||"Untitled place",hash:Ae.hash,drawing:Ae.drawing,state:Hre(Ae),href:vl(f,Ae.convo),blank:o.jsx(OC,{size:44,weight:"thin"}),onDiscard:_},Ae.convo)),H&&o.jsx(Xn,{label:"Discard",title:`Discard ${H.name||"this unfinished place"}?`,body:H.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:Ae=>{Ae||D(null)},onConfirm:()=>{U(H),D(null)}}),!X&&L.map(Ae=>o.jsx(zoe,{build:Ae,onCancel:ve=>void Ee.cancelAssetBuild(f.id,ve).then(k),onDismiss:ve=>void Ee.deleteAssetBuild(f.id,ve).then(k),onRetry:()=>E("scene")},Ae.id)),an.map(Ae=>o.jsx(E1,{scene:Ae,variant:"use",size:"grid",onOpen:ie,href:Br(f,Ae.id),onUse:b,bookmarked:m.includes(Ae.id),onBookmark:y,onDelete:se,onRename:G,chosen:z.ids.has(Ae.id),batching:z.batching==="owned-scene",onPick:z.picking("owned-scene")?ve=>z.toggle("owned-scene",ve):void 0,batch:z.kind==="owned-scene"&&z.ids.has(Ae.id)?{count:z.ids.size,onAct:ce,onKeep:Ve,allKept:ze}:null},Ae.id))]}),Wt>0&&o.jsx("div",{ref:ne,"aria-hidden":!0}),Wt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Rn,children:["Show ",Math.min(Wt,60)," more"]})}),gt&&o.jsx(Wy,{title:"Rename place",name:gt.name,maxLength:60,busy:tt,error:Se,onConfirm:Ae=>void oe(Ae),onDismiss:()=>{tt||Ze(null)}}),Oe&&o.jsx(Xn,{label:"Delete place",title:`Delete ${Oe.name}?`,body:Ai("owned-scene",1),open:!0,busy:pe,onOpenChange:Ae=>{!Ae&&!pe&&ae(null)},onConfirm:()=>void Ne()}),je&&o.jsx(Xn,{label:cs("owned-scene",z.ids.size).menu,title:`${cs("owned-scene",z.ids.size).menu}?`,body:Ai("owned-scene",z.ids.size),open:!0,busy:pe,onOpenChange:Ae=>{!Ae&&!pe&&Re(!1)},onConfirm:()=>void yt()})]}),Pe&&r&&!a&&h.length>0&&o.jsx(Mo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Build your own ",o.jsx("em",{children:"place"})]}),body:"Upload a few pictures of a location, or describe one, and its light and materials carry into every image you make.",action:kt}),Yt&&r&&!a&&Ue.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri places"})}),Pe&&r&&!a&&h.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Yy,{label:"Or start from one of ours"}),ht]}),!r&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":q,style:ee,"aria-hidden":!0,children:o.jsx(XL,{size:"grid",count:8})}),r&&a&&o.jsx(Mo,{shape:"error",title:"Couldn't load this library",body:"Something went wrong reaching the catalog.",onRetry:()=>i()}),r&&!a&&!at&&t.map(Ae=>{const ve=Zt.filter(xe=>xe.collections.includes(Ae));if(!ve.length)return null;const Ct=Ft.has(Ae)?ve:ve.slice(0,Uoe);return o.jsxs("section",{className:"sc-coll",children:[o.jsx("h2",{children:Ae}),ot(Ct),Ct.length<ve.length&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>Pt(xe=>new Set(xe).add(Ae)),children:["Show all ",ve.length]})})]},Ae)}),r&&!a&&at&&$t.length>0&&ot($t,!0),r&&!a&&bt&&o.jsx(Mo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a place from its card and it stays here.",mark:Uy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>O({bookmarked:null}),children:"Browse every place"})}),r&&!a&&h.length>0&&!bt&&jt.length===0&&qt.length===0&&o.jsx(M2,{noun:"places",q:B,facet:ft?null:X?"Keepers":Z,onClearSearch:I,onClearAll:Y}),at&&ke>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Je,children:["Show ",Math.min(ke,60)," more"]})})]})}),o.jsx(zc,{}),z.kind==="owned-scene"&&z.ids.size>0&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Ky,{count:z.ids.size,loaded:an.length,tool:cs("owned-scene",z.ids.size).tool,icon:cs("owned-scene",z.ids.size).icon,danger:!0,onAct:ce,keep:{label:xt.tool,filled:ze,onAct:Ve},onClear:z.clear,onSelectAll:()=>z.selectAll("owned-scene",an.map(Ae=>Ae.id))})})]})}function qy(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 Ee.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 fv=[{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"}],tT=4;function Goe(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 Xy({to:e,wall:t,where:n}){return o.jsxs("div",{className:"sc-lookpage-crumb",children:[o.jsx(Vn,{to:e,children:t}),o.jsx("span",{children:"/"}),o.jsx("span",{children:n})]})}function Qy({kind:e,brandId:t,id:n}){const[r,a]=s.useState(()=>Ad(e,t).includes(n));s.useEffect(()=>{a(Ad(e,t).includes(n))},[e,t,n]);const i=r?"Remove from Keepers":"Add to Keepers";return o.jsx(hr,{label:i,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-lookpage-keep","data-kept":r||void 0,"aria-pressed":r,"aria-label":i,onClick:()=>a(k2(e,t,n).includes(n)),children:o.jsx(to,{size:15,weight:r?"fill":"regular"})})})}function Yoe({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(kl,{size:13,className:"sc-chipfield-caret","aria-hidden":!0})]})}function qoe({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,m]=s.useState(""),w=s.useRef(null),y=[...n,...e.filter(L=>!n.some($=>Tu($,L)))],b=g.trim(),S=b?y.filter(L=>L.toLowerCase().includes(b.toLowerCase())):y,k=e.length>=u,C=b.length>0&&!y.some(L=>Tu(L,b))&&!k,E=L=>{const $=e.some(N=>Tu(N,L));!$&&k||t($?e.filter(N=>!Tu(N,L)):[...e,L])},A=()=>{var L;C&&(t([...e,b.slice(0,f)]),m(""),(L=w.current)==null||L.focus())};return s.useEffect(()=>{if(!h)return;const L=setTimeout(()=>{var $;return($=w.current)==null?void 0:$.focus()},0);return()=>clearTimeout(L)},[h]),o.jsxs(Es,{open:h,onOpenChange:L=>{p(L),L||m("")},children:[o.jsx(Yoe,{items:e,placeholder:a,open:h,onOpen:()=>p(!0),onRemove:L=>t(e.filter($=>!Tu($,L))),hit:o.jsx(Cs,{children:o.jsx("button",{type:"button",className:"sc-chipfield-hit","aria-label":r})})}),o.jsxs(js,{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:L=>m(L.target.value),onKeyDown:L=>{L.stopPropagation(),L.key==="Enter"?(L.preventDefault(),C?A():S.length===1&&E(S[0])):L.key==="Escape"&&p(!1)}}),o.jsxs("div",{className:"sc-chippick-list",children:[S.map(L=>{const $=e.some(N=>Tu(N,L));return o.jsxs(Wn,{className:"sc-menu-item","data-on":$||void 0,"data-off":!$&&k?"":void 0,onSelect:N=>{N.preventDefault(),E(L)},children:[o.jsx("span",{className:"sc-menu-lb",children:L}),$&&o.jsx(Gn,{size:14,className:"sc-menu-check","aria-hidden":"true"})]},L)}),!S.length&&!C&&o.jsx("p",{className:"sc-chippick-none",children:l})]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(Wn,{className:"sc-menu-item",onSelect:L=>{L.preventDefault(),A()},children:[o.jsx(gr,{size:16,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:['Add "',b,'"']})]})]}),k&&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 nT({name:e,categories:t,known:n,hint:r,ways:a,wayChoices:i,wayMax:l,busy:u,error:f,onSave:h,onDismiss:p}){const[g,m]=s.useState(e),[w,y]=s.useState(t),[b,S]=s.useState(()=>[...a??[]]),k=g.trim(),C=k.length>0,E=N=>N.map(j=>j.id).join(" "),A=k!==e.trim()||w.join(" ")!==t.join(" ")||!!a&&E(b)!==E(a),L=b.length>=(l??Number.POSITIVE_INFINITY)?[]:(i??[]).filter(N=>!b.some(j=>j.id===N.id)),$=()=>{if(!(!C||u)){if(!A)return p();h({name:k,categories:w,...a?{ways:b}:{}})}};return o.jsxs(Gs,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:p,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ns,{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:N=>m(N.target.value),onKeyDown:N=>N.key==="Enter"&&$()})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Categories"}),o.jsx(qoe,{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:[b.map(N=>o.jsxs("div",{className:"sc-pdetails-way",children:[o.jsx("span",{className:"sc-pdetails-way-lb",children:N.label}),o.jsx("span",{className:"sc-pdetails-way-sub",children:N.camera}),o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":`Remove ${N.label}`,onClick:()=>S(b.filter(j=>j.id!==N.id)),children:o.jsx(jn,{size:13,weight:"bold","aria-hidden":!0})})]},N.id)),L.length>0&&o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-label":"Add a way to shoot it",children:[o.jsx(gr,{size:12,weight:"bold","aria-hidden":!0}),o.jsx("span",{children:"Add a way"})]})}),o.jsx(js,{children:L.map(N=>o.jsx(Wn,{onSelect:()=>S([...b,N]),children:N.label},N.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:!C,"data-busy":u||void 0,onClick:$,children:u?"Saving":"Save"})]})]})}function rT(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 j1({count:e,label:t,className:n,trackClassName:r,style:a,children:i}){const{shellRef:l,railRef:u,page:f}=rT(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(Ha,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-rail-arrow next","aria-label":`${t}, later`,onClick:()=>f(1),children:o.jsx(Rl,{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 R2(){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},[])}function Qu({variant:e,label:t,isCover:n,onOpen:r,onUse:a,onCover:i,busy:l=!1}){const u=!n&&!!i;return e==="sheet"?o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:l,onClick:a,children:"Use this view"}),u&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:l,onClick:i,children:"Set as cover"})]}):o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-lookcard-use","aria-label":`Use this view: ${t}`,disabled:l,onClick:a,children:"Use this view"}),(r||a||u)&&o.jsx("div",{className:"sc-corner",children:o.jsxs(Es,{children:[o.jsx(hr,{label:"More",children:o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${t}`,children:[o.jsx(Vv,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(_v,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})}),o.jsxs(js,{side:"bottom",align:"end",sideOffset:4,collisionPadding:12,children:[r&&o.jsxs(Wn,{onSelect:r,children:[o.jsx(ld,{name:"open"}),"Open"]}),a&&o.jsxs(Wn,{disabled:l,onSelect:a,children:[o.jsx(ld,{name:"use"}),"Use this view"]}),u&&o.jsxs(Wn,{disabled:l,onSelect:i,children:[o.jsx(ld,{name:"cover"}),"Set as cover"]})]})]})})]})}function am({label:e,isCover:t}){return o.jsxs("span",{className:"sc-refset-lb","data-cover":t||void 0,"aria-hidden":!0,children:[e,t&&o.jsx("span",{className:"sc-sceneview-cover",children:" · Cover"})]})}const k7=1500;function sT(e,t,n){const{refreshBrands:r}=Mn(),[a,i]=s.useState(null),[l,u]=s.useState([]),[f,h]=s.useState([]),[p,g]=s.useState(!1),[m,w]=s.useState(0),[y,b]=s.useState(!1),S=s.useRef(void 0),k=s.useRef(r);k.current=r,s.useEffect(()=>{if(!t)return;let E=!0,A=null;const L=async()=>{var $;try{const N=await Ee.sceneExamples(e,t);if(!E)return;const j=N.job?`${N.job.id}:${N.job.status}`:null;if(N.job&&N.job.status!=="running"&&S.current!==void 0&&j!==S.current&&await k.current(),!E)return;S.current=j,i(N.job),u(N.first),h(N.more),g(!0),b(!1),(($=N.job)==null?void 0:$.status)==="running"&&(A=setTimeout(L,k7))}catch(N){E&&(N==null?void 0:N.status)!==404&&(A=setTimeout(L,k7*2))}};return L(),()=>{E=!1,A&&clearTimeout(A)}},[e,t,n,m]);const C=s.useCallback(()=>{b(!0),w(E=>E+1)},[]);return{job:a,first:l,more:f,read:p,waiting:y,again:C}}const Xoe=["no","one","two","three","four","five"];function Qoe({brandId:e,scene:t,onError:n}){var O;const{applyBrand:r}=Mn(),a=x2(),i=R2(),{job:l,first:u,again:f}=sT(e,t.id,t.placeUrl??null),[h,p]=s.useState(!1),[g,m]=s.useState(!1),[w,y]=s.useState(!1),[b,S]=s.useState(null),k=YM(t.examples,l),C=(l==null?void 0:l.status)==="running",E=FY(t.examples),A=async()=>{if(g||!u.length)return;const I=i();m(!0),n(null);try{await Ee.drawSceneExamples(e,t.id,{first:!0}),f()}catch(Y){I()&&n(String((Y==null?void 0:Y.message)??Y))}finally{I()&&m(!1)}},L=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 A(),children:[E.length?"Draw them again":"Draw it in use",`, ${Xoe[u.length]??u.length} picture${u.length===1?"":"s"}`]})}):null,$=async I=>{const Y=fv.find(X=>X.id===I);if(!Y||h)return;const Z=i();p(!0),n(null);try{const X=t.setups??[];if(!X.some(z=>z.id===Y.id)){const z=await Ee.updateScene(e,t.id,{setups:[...X,Y]});r(z.brand)}if(!Z())return;a(t.id,Y.id)}catch(X){Z()&&n(String((X==null?void 0:X.message)??X))}finally{Z()&&p(!1)}},N=async I=>{const Y=i();y(!0),n(null);try{const Z=await Ee.updateScene(e,t.id,{cover:I});r(Z.brand)}catch(Z){Y()&&n(String((Z==null?void 0:Z.message)??Z))}finally{Y()&&y(!1)}},j=sX(t),P=(I,Y)=>I?()=>a(t.id,void 0,I,Y):void 0,R=t.placeUrl?{src:t.placeUrl,label:ge.emptyLabel,view:"place",...t.previewHash?{hash:t.previewHash}:{}}:null,H=I=>o.jsx(Qu,{variant:"sheet",label:I.label,isCover:I.view===j,onUse:P(I.hash,I.view),onCover:()=>void N(I.view),busy:w});if(!k.length&&!R)return o.jsx(ly,{});if(!k.length&&R)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-scenepage-place sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${R.label}, open`,onClick:()=>S(R),children:o.jsx(Ma,{src:Tn(R.src,"tile"),srcSet:kc(R.src)})}),o.jsx(Qu,{variant:"tile",label:R.label,isCover:!0,onOpen:()=>S(R),onUse:P(R.hash,"place")})]}),L,b&&o.jsx(Nd,{src:b.src,kind:"scene",label:b.label,noun:t.name,onClose:()=>S(null),actions:H(b)})]});const D=b==null?void 0:b.tile,U=D!=null&&D.setup?fv.find(I=>I.id===D.setup):void 0,_=!!U&&((t.setups??[]).some(I=>I.id===U.id)||(t.setups??[]).length<tT),B=C&&l?Qw({status:l.status,step:l.current,done:l.done.length,total:l.roles.length,error:l.error}):E.length>0?`${E.length===1?`The ${Ja[E[0]].toLowerCase()} shows`:"These show"} an earlier picture of this place.`:null,K=((O=k[0])==null?void 0:O.role)==="hero",V=R?o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame","data-cover":j==="place"||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`The place${j==="place"?", the cover":""}, open`,onClick:()=>S(R),children:o.jsx(Ma,{src:Tn(R.src,"tile"),srcSet:kc(R.src)})}),o.jsx(Qu,{variant:"tile",label:R.label,isCover:j==="place",onOpen:()=>S(R),onUse:P(R.hash,"place"),onCover:()=>void N("place"),busy:w})]}),o.jsx(am,{label:ge.emptyLabel,isCover:j==="place"})]},"place"):null;return o.jsxs(o.Fragment,{children:[o.jsxs(j1,{count:k.length+(R?1:0),label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:[!K&&V,k.map((I,Y)=>{const Z=Ja[I.role],X=()=>S({src:I.url,label:Z,view:I.role,tile:I,...I.hash?{hash:I.hash}:{}});return o.jsxs(s.Fragment,{children:[o.jsxs("li",{children:[I.state==="drawing"?o.jsxs("span",{className:"sc-refset-tile","data-state":"drawing",role:"img","aria-label":`${Z}, drawing`,children:[I.url&&o.jsx(Ma,{src:Tn(I.url,"tile"),srcSet:kc(I.url)}),o.jsx($a,{})]}):I.state==="failed"?o.jsxs("span",{className:"sc-refset-tile","data-state":"failed",role:"img","aria-label":`${Z} did not draw`,title:I.error?m1(I.error)??I.error:void 0,children:[o.jsx(Bc,{size:20,"aria-hidden":!0}),o.jsx("span",{children:"Did not draw"}),I.error&&o.jsx("small",{className:"sc-refset-why",children:m1(I.error)??I.error})]}):o.jsxs("span",{className:"sc-sceneview-frame","data-cover":j===I.role||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${Z}${j===I.role?", the cover":""}, open`,onClick:X,children:o.jsx(Ma,{src:Tn(I.url,"tile"),srcSet:kc(I.url)})}),o.jsx(Qu,{variant:"tile",label:Z,isCover:j===I.role,onOpen:X,onUse:P(I.hash,I.role),onCover:()=>void N(I.role),busy:w})]}),o.jsx(am,{label:Z,isCover:j===I.role})]}),K&&Y===0&&V]},I.role)})]}),B&&o.jsx("p",{className:"sc-scenepage-examples-state","aria-live":"polite",children:B}),L,b&&o.jsx(Nd,{src:b.src,kind:"scene",label:b.label,noun:t.name,onClose:()=>S(null),actions:U&&_?o.jsxs(o.Fragment,{children:[H(b),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:h,onClick:()=>void $(U.id),children:"Shoot it this way"})]}):H(b)})]})}const S7=["hero","place","close","hands","angle","bold"],E7=3;function Joe(){var Ze,tt,De,Se,Q;const{sceneId:e}=ia(),{scenes:t,loaded:n,error:r,refetch:a,applyBrand:i,refreshBrands:l}=Mn(),{brand:u}=un(),f=t,h=Un(),p=x2(),g=u.id,[m,w]=s.useState([]),[y,b]=s.useState([]),[S,k]=s.useState(null),[C,E]=s.useState(!1),[A,L]=s.useState(null),$=je=>h(Br(u,je)),N=w1(u,e??""),j=N??f.find(je=>je.id===e);Xc(j==null?void 0:j.name);const P=!!N;s.useEffect(()=>{let je=!0;if(w([]),b([]),!P)return Ee.sceneFrames(e??"").then(Re=>{je&&(w(Re.frames),b(Re.views??[]),k(e??""))}).catch(()=>{je&&(w([]),k(e??""))}),()=>{je=!1}},[e,P]);const R=s.useRef(e);R.current=e,E2(()=>{if(P)return;const je=e??"";Ee.sceneFrames(je).then(Re=>{R.current===e&&(w(se=>ki(se,Re.frames)),b(se=>ki(se,Re.views??[])))}).catch(()=>{})});const H=qy(u.id,[e??""]),D=s.useMemo(()=>{if(!j||P)return[];return f.filter(se=>se.id!==j.id).sort((se,G)=>Re(G)-Re(se)).slice(0,8);function Re(se){const G=se.lighting.split(/[ ,]+/).some(Ne=>Ne.length>3&&j.lighting.toLowerCase().includes(Ne.toLowerCase())),oe=se.collections.some(Ne=>j.collections.includes(Ne));return(G?2:0)+(oe?1:0)}},[f,j,P]),U=s.useMemo(()=>{if(j||!n||r)return[];const je=ji(g);return LL(f,Re=>je.includes(Re.id)).slice(0,6)},[j,n,r,f,g]),[_,B]=s.useState(null),[K,V]=s.useState(!1),[O,I]=s.useState(!1),[Y,Z]=s.useState(!1),X=s.useRef(!1),z=R2(),J=s.useMemo(()=>[...new Set([...f.flatMap(je=>je.verticals),...Jc(u).flatMap(je=>je.verticals)])].sort((je,Re)=>je.localeCompare(Re)),[f,u]),he=async je=>{if(N){I(!0),B(null);try{const Re=await Ee.updateScene(u.id,N.id,{name:je.name,verticals:je.categories,...je.ways?{setups:je.ways}:{}});i(Re.brand),Z(!1)}catch(Re){B(String(Re.message??Re))}finally{I(!1)}}},te=async()=>{if(!N||X.current)return;X.current=!0;const je=z(),Re=gl(u);V(!0);try{const se=await Ee.deleteScene(u.id,N.id);i(se.brand)}catch(se){if((se==null?void 0:se.status)!==404){X.current=!1,je()&&(B(String(se.message??se)),V(!1));return}await l()}je()&&h(Re,{replace:!0})};if(!n&&!N)return o.jsx(ds,{children:o.jsx("main",{className:"sc-lookpage sc-scenepage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!N)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this place"}),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(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"This place 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(Vn,{className:"sc-btn sc-btn-primary",to:`${jr(u)}?compose=1`,children:"Start from scratch"}),o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:gl(u),children:"Browse all places"})]}),U.length>0&&o.jsx(cd,{label:"You might like",children:U.map(je=>o.jsx(E1,{scene:je,variant:"navigate",size:"slider",onOpen:$,href:Br(u,je.id)},je.id))})]})});const me=y.length?[...y].sort((je,Re)=>S7.indexOf(je.view)-S7.indexOf(Re.view)).map(je=>({src:je.url,label:je.view==="place"?ge.emptyLabel:Ja[je.view],view:je.view})):m.length?m.map((je,Re)=>({src:je,label:`Example ${Re+1}`})):j.previewUrl?[{src:j.previewUrl,label:j.cover&&j.cover!=="place"?Ja[j.cover]:ge.emptyLabel}]:[],re=async je=>{if(C)return;const Re=z();E(!0),B(null);try{const{hash:se}=await Ee.pickSceneView(j.id,je);if(!Re())return;p(j.id,void 0,se,je)}catch(se){B(String((se==null?void 0:se.message)??se))}finally{E(!1)}},ee=(N==null?void 0:N.setups)??[],q=((N==null?void 0:N.refs)??[]).filter(je=>je!==(N==null?void 0:N.placeUrl)),ie=((tt=(Ze=N==null?void 0:N.examples)==null?void 0:Ze.find(je=>!je.earlier))==null?void 0:tt.with)??((Se=(De=N==null?void 0:N.examples)==null?void 0:De[0])==null?void 0:Se.with),Oe=ie&&(ie==="presenter"?"person":"product"),ae=!!N&&(N.anchor===!0||!!(N.figure&&N.figureTreatment)),pe=N!=null&&N.previewHash||(Q=N==null?void 0:N.examples)!=null&&Q.length?" Use a view to shoot like it.":"",Te=N?N.figure&&ae?`The person in it is a stand-in: with a person attached, the picture goes with the shot and they take the role.${pe}`:ae?`${Oe?`Shown in use with a Scenri demo ${Oe}. `:""}Shots are given its picture as their world and find their own frame in it.${pe}`:Oe?`Shown in use with a Scenri demo ${Oe}. Shots are told the words.${pe}`:N.placeUrl?`Shots are told the words.${pe}`:"":"",gt=N?Goe({refs:q,setups:N.setups},Te):"";return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx(Xy,{to:gl(u),wall:"Places",where:N?"Yours":"Scenri library"}),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(je=>o.jsx("li",{className:"sc-chip","data-static":!0,children:je},je))}),o.jsx("p",{className:"sc-lookpage-lede",children:j.description}),o.jsxs("div",{className:"sc-lookpage-acts",children:[ee.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 p(j.id),children:"Use in a shot"}),o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-more","aria-label":"Use it a way",children:o.jsx(kl,{size:12,weight:"bold","aria-hidden":!0})})}),o.jsx(js,{children:ee.map(je=>o.jsx(Wn,{onSelect:()=>void p(j.id,je.id),children:je.label},je.id))})]})]}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void p(j.id),children:"Use in a shot"}),N&&o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:zw(u,N.id),children:"Edit place"}),o.jsx(Qy,{kind:"scene",brandId:g,id:j.id}),N&&o.jsx(hr,{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(Rd,{size:17})})})]}),_&&o.jsx("p",{className:"sc-assetform-err",children:_}),N?o.jsx(Qoe,{brandId:u.id,scene:N,onError:B},N.id):S!==(e??"")?o.jsx(j1,{count:E7,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:Array.from({length:E7},(je,Re)=>o.jsxs("li",{"aria-hidden":!0,children:[o.jsx("span",{className:"sc-sceneview-frame",children:o.jsx("span",{className:"sc-refset-tile","data-state":"loading",children:o.jsx("span",{className:"sc-placeholder"})})}),o.jsx(am,{label:"",isCover:!1})]},Re))}):me.length>1?o.jsx(j1,{count:me.length,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:me.map(je=>o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${je.label}, open`,onClick:()=>L(je),children:o.jsx(Ma,{src:Tn(je.src,"tile"),srcSet:kc(je.src)})}),je.view&&o.jsx(Qu,{variant:"tile",label:je.label,isCover:!1,onOpen:()=>L(je),onUse:()=>void re(je.view),busy:C})]}),o.jsx(am,{label:je.label,isCover:!1})]},je.src))}):me.length===1?o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${me[0].label}, open`,onClick:()=>L(me[0]),children:o.jsx(Ma,{src:Tn(me[0].src,"tile"),srcSet:kc(me[0].src)})})}):o.jsx(ly,{}),N&&o.jsxs("section",{className:"sc-scenepage-told",children:[o.jsxs("dl",{className:"sc-lookpage-told",children:[o.jsxs("div",{children:[o.jsx("dt",{children:ge.lightLabel}),o.jsx("dd",{dir:"auto",children:N.lighting})]}),N.camera&&o.jsxs("div",{children:[o.jsx("dt",{children:ge.cameraLabel}),o.jsx("dd",{dir:"auto",children:N.camera})]}),N.figure&&o.jsxs("div",{children:[o.jsx("dt",{children:ge.figureLabel}),o.jsx("dd",{dir:"auto",children:N.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((je,Re)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${Re+1}, open`,onClick:()=>L({src:je,label:`Source photo ${Re+1}`}),children:o.jsx(Ma,{src:Tn(je,"micro")})},je))})]}),N&&o.jsxs("div",{className:"sc-prec",children:[gt&&o.jsx("p",{className:"sc-prec-note",children:gt}),o.jsx(Xn,{label:"Delete place",title:`Delete ${N.name}?`,body:Ai("owned-scene",1),busy:K,onConfirm:()=>void te()})]}),H.length>0&&o.jsx(cd,{label:`Shots made in ${j.name}`,children:H.map(je=>o.jsx(cy,{node:je,to:e2(u,null,je.id)},je.id))}),D.length>0&&o.jsx(cd,{label:"Other places, similar light",children:D.map(je=>o.jsx(E1,{scene:je,variant:"navigate",size:"slider",onOpen:$,href:Br(u,je.id)},je.id))}),Y&&N&&o.jsx(nT,{name:N.name,categories:N.verticals,known:J,hint:"The verticals this place suits, so it surfaces where you work.",ways:ee,wayChoices:fv,wayMax:tT,busy:O,error:_,onSave:je=>void he(je),onDismiss:()=>Z(!1)}),A&&o.jsx(Nd,{src:A.src,kind:"scene",label:A.label,noun:j.name,onClose:()=>L(null),actions:A.view?o.jsx(Qu,{variant:"sheet",label:A.label,isCover:!1,onUse:()=>void re(A.view),busy:C}):void 0})]})})}function eie({draft:e,href:t,onDiscard:n,chosen:r,batching:a,onPick:i,batch:l}){return o.jsx(JL,{id:e.id,name:e.name.trim()||"Untitled person",hash:e.hash,drawing:!!e.drawing,state:tie(e),href:t,blank:o.jsx(t_,{size:44,weight:"thin"}),onDiscard:n,chosen:r,batching:a,onPick:i,batch:l})}function tie(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 nie({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(Gs,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:a,onOpenAutoFocus:m=>{m.preventDefault();const w=u.current;w&&(w.focus(),w.select())},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Duplicate person"}),o.jsx(Ns,{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:m=>l(m.target.value),onKeyDown:m=>m.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 rie=60;function sie(e,t,n=rie){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 aie=8,k6="__bookmarked";function oie(){const{presenters:e,presenterCategories:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l}=Mn(),{brand:u}=un(),f=Un(),h=Ty(),{push:p}=rr(),{q:g,setQ:m,facets:w,setFacets:y,clearSearch:b,clear:S}=gf(["category","bookmarked"]),k=w.category,C=w.bookmarked==="1",[E,A]=s.useState(()=>Ad("presenter",u.id)),L=xe=>A(k2("presenter",u.id,xe)),$=Gy(`${u.id}|${g}|${k??""}|${C?"1":""}`),N=Bl(),j=s.useMemo(()=>lf(u),[u]),[P,R]=Pa(Qr.wallDensity,Sd),H=eu(P),D=xe=>R(xe),U=d2(H),_=c2(H),B=xe=>f(La(u,xe)),K=xe=>f(Jm(u,xe)),V=s.useMemo(()=>k?e.filter(xe=>xe.suitableCategories.includes(k)):e,[e,k]),O=s.useMemo(()=>V.filter(xe=>Io(Qp(xe),g)),[V,g]),I=s.useRef(null),Y=s.useRef(null),Z=o.jsxs("button",{ref:Y,type:"button",className:"sc-btn sc-btn-primary",onClick:()=>N("presenter"),children:[o.jsx(gr,{size:12})," Create person"]}),[X,z]=s.useState([]),J=s.useRef(0),he=s.useCallback(()=>{const xe=++J.current;return Ee.presenterDrafts(u.id).then(it=>{xe===J.current&&z(it.drafts.filter(wt=>!wt.presenterId))}).catch(()=>{}),()=>{xe===J.current&&J.current++}},[u.id]),te=!!gn({path:pt.presenterStudio}),{tasks:me}=ua(),re=me.filter(xe=>xe.id.startsWith("presenter:")).map(xe=>`${xe.id}:${xe.state}:${xe.percent??""}`).join("|");s.useEffect(()=>{if(!te)return he()},[te,he,re]);const ee=s.useCallback(xe=>{const it=Math.max(0,X.findIndex(wt=>wt.id===xe));q.current=it,$.forget(xe),z(wt=>wt.filter($e=>$e.id!==xe)),Ee.deletePresenterDraft(u.id,xe).finally(()=>he())},[u.id,X,he,$.forget]),q=s.useRef(null);s.useEffect(()=>{var $e;const xe=q.current;if(xe===null)return;q.current=null;const it=($e=I.current)==null?void 0:$e.querySelectorAll("[data-build] .sc-cardpuck"),wt=it!=null&&it.length?it[Math.min(xe,it.length-1)]:Y.current??document.querySelector(".sc-new-go");wt==null||wt.focus()},[X]);const[ie,Oe]=s.useState(null),[ae,pe]=s.useState(!1),[Te,gt]=s.useState(!1),Ze=s.useCallback(xe=>{const it=X.find(wt=>wt.id===xe);it!=null&&it.drawn?Oe(it):ee(xe)},[X,ee]),[tt,De]=s.useState(null),[Se,Q]=s.useState(null),[je,Re]=s.useState(null),[se,G]=s.useState(!1),[oe,Ne]=s.useState(null),[Ue,st]=s.useState(null),Pe=s.useCallback(xe=>{const it=j.find(wt=>wt.id===xe);it&&(Ne(null),De(it))},[j]),Ie=s.useCallback(xe=>{const it=j.find(wt=>wt.id===xe);it&&(Ne(null),Q(it))},[j]),Ge=async xe=>{if(!(!Se||se)){G(!0),Ne(null);try{i((await Ee.updatePresenter(u.id,Se.id,{name:xe})).brand),Q(null)}catch(it){const wt=ln(it,"Could not rename this person");Ne([wt.title,wt.detail].filter(Boolean).join(" "))}finally{G(!1)}}},ft=s.useCallback(xe=>{const it=j.find(wt=>wt.id===xe);it&&Re(it)},[j]),bt=s.useRef(null);s.useEffect(()=>{var $e;const xe=bt.current;if(xe===null)return;bt.current=null;const it=($e=I.current)==null?void 0:$e.querySelectorAll(".sc-lookcard:not([data-build]) .sc-lookcard-more"),wt=it!=null&&it.length?it[Math.min(xe,it.length-1)]:Y.current??document.querySelector(".sc-new-go");wt==null||wt.focus()},[e,u]);const at=async xe=>{if(!(!tt||se)){G(!0),Ne(null);try{const it=await Ee.duplicatePresenter(u.id,tt.id,xe);i(it.brand),De(null),st(it.presenter.id)}catch(it){const wt=ln(it,"Could not duplicate this person");Ne([wt.title,wt.detail].filter(Boolean).join(" "))}finally{G(!1)}}},Zt=async()=>{if(!(!je||se)){bt.current=Math.max(0,jt.findIndex(xe=>xe.id===je.id)),G(!0);try{const xe=await Ee.deletePresenter(u.id,je.id);i(xe.brand),$.forget(je.id),Re(null)}catch(xe){(xe==null?void 0:xe.status)===404?(await l(),$.forget(je.id),Re(null)):p(ln(xe,"Could not delete this person"))}finally{G(!1)}}};s.useEffect(()=>{var it,wt;if(!Ue)return;(wt=(it=I.current)==null?void 0:it.querySelector(".sc-lookcard[data-just-added]"))==null||wt.scrollIntoView({block:"nearest"});const xe=window.setTimeout(()=>st(null),1800);return()=>window.clearTimeout(xe)},[Ue]);const jt=s.useMemo(()=>j.filter(xe=>k?!xe.suitableCategories.length||xe.suitableCategories.includes(k):!0).filter(xe=>Io(Qp(xe),g)).filter(xe=>C?E.includes(xe.id):!0),[j,k,g,C,E]),Pt=!(j.length>0||X.length>0),$t=[...j,...e].reduce((xe,it)=>xe+(E.includes(it.id)?1:0),0),ke=C&&$t===0,Je=ke&&Pt,Et=ke&&!Pt,Xe=!C||Je,rt=jt.filter(xe=>!C||Je||E.includes(xe.id)),nt=Xe&&X.length>0||rt.length>0,{visible:qt,remaining:Yt,showMore:an}=C1(rt,`${u.id}|${k??""}|${C?"keepers":""}|${Je?"browse":""}|${g}`),[Wt,Rn]=s.useState(null);s.useEffect(()=>{if(!Wt||Yt<=0)return;const xe=new IntersectionObserver(it=>{it.some(wt=>wt.isIntersecting)&&an()},{root:Wt.closest(".sc-home"),rootMargin:"200% 0px"});return xe.observe(Wt),()=>xe.disconnect()},[Wt,Yt,an]);const Bt=s.useMemo(()=>!C||Je?O:O.filter(xe=>E.includes(xe.id)),[O,C,Je,E]),{visible:ne,remaining:ce,showMore:ue}=C1(Bt,`${k??""}|${C?"keepers":""}|${Je?"browse":""}|${g}`),ze=e.length+j.length>0?"tabs":"none",Ve=s.useCallback(async xe=>{const{failed:it,error:wt}=await sm(xe,$e=>Ee.deletePresenterDraft(u.id,$e));z($e=>$e.filter(qe=>it.includes(qe.id)||!xe.includes(qe.id))),$.retain(it),he(),wt&&p(ln(wt,"Could not discard these drafts"))},[u.id,he,$.retain,p]),xt=()=>{const xe=X.filter(it=>$.ids.has(it.id));xe.some(it=>it.drawn)?xe.length===1?Oe(xe[0]):pe(!0):Ve(xe.map(it=>it.id))},yt=()=>{const xe=[...$.ids];xe.length===1?ft(xe[0]):gt(!0)},kt=[...$.ids],ot=$.kind==="presenter"&&kt.length>0&&kt.every(xe=>E.includes(xe)),ht=()=>A($y("presenter",u.id,kt,!ot)),Ae=C2($.ids.size,ot,"presenters"),ve=async()=>{if(se)return;const xe=[...$.ids];G(!0);try{const{failed:it,error:wt}=await sm(xe,$e=>Ee.deletePresenter(u.id,$e));await l(),$.retain(it),gt(!1),wt&&p(ln(wt,"Could not delete these people"))}finally{G(!1)}},et={key:"category",label:"Category",everyLabel:"All people",everyCount:e.length+j.length,selected:C?k6:k,onSelect:xe=>y(xe===k6?{bookmarked:"1",category:null}:{bookmarked:null,category:xe}),options:[{value:k6,label:"Keepers",count:$t},...t.map(xe=>({value:xe,label:xe,count:[...j,...e].filter(it=>!it.suitableCategories.length||it.suitableCategories.includes(xe)).length}))]},Ct=o.jsx(A2,{title:"People",filters:o.jsx(N2,{mode:ze,group:et}),density:o.jsx(u2,{value:H,onChange:D}),search:e.length>=aie&&o.jsx(zd,{value:g,onChange:m,noun:"people",total:e.length})});return o.jsxs(cf.Provider,{value:_,children:[o.jsx(ds,{children:o.jsxs("main",{className:"sc-looks sc-presenters",id:"main","data-hero":Pt||void 0,onClick:$.onBlank,children:[!Pt&&Ct,nt&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your people"})}),o.jsxs("div",{ref:I,className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:U,children:[Xe&&X.map(xe=>o.jsx(eie,{draft:xe,href:wl(u,xe.id),onDiscard:Ze,chosen:$.ids.has(xe.id),batching:$.batching==="draft",onPick:$.picking("draft")?it=>$.toggle("draft",it):void 0,batch:$.kind==="draft"&&$.ids.has(xe.id)?{count:$.ids.size,onAct:xt}:null},xe.id)),ie&&o.jsx(Xn,{label:"Discard",title:`Discard ${ie.name.trim()||"this unfinished person"}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:xe=>{xe||Oe(null)},onConfirm:()=>{ee(ie.id),Oe(null)}}),qt.map(xe=>o.jsx(dv,{presenter:xe,variant:"use",size:"grid",onOpen:B,href:La(u,xe.id),onUse:h,onDuplicate:Pe,onEdit:K,onDelete:ft,onRename:Ie,bookmarked:E.includes(xe.id),onBookmark:L,fresh:xe.id===Ue,chosen:$.ids.has(xe.id),batching:$.batching==="presenter",onPick:$.picking("presenter")?it=>$.toggle("presenter",it):void 0,batch:$.kind==="presenter"&&$.ids.has(xe.id)?{count:$.ids.size,onAct:yt,onKeep:ht,allKept:ot}:null},xe.id)),Se&&o.jsx(Wy,{title:"Rename person",name:Se.name,maxLength:60,busy:se,error:oe,onConfirm:xe=>void Ge(xe),onDismiss:()=>{se||Q(null)}}),tt&&o.jsx(nie,{suggested:sie(tt.name,j.map(xe=>xe.name)),busy:se,error:oe,onConfirm:xe=>void at(xe),onDismiss:()=>{se||De(null)}}),je&&o.jsx(Xn,{label:"Delete person",title:`Delete ${je.name}?`,body:Ai("presenter",1),open:!0,busy:se,onOpenChange:xe=>{!xe&&!se&&Re(null)},onConfirm:()=>void Zt()}),Te&&o.jsx(Xn,{label:cs("presenter",$.ids.size).menu,title:`${cs("presenter",$.ids.size).menu}?`,body:Ai("presenter",$.ids.size),open:!0,busy:se,onOpenChange:xe=>{!xe&&!se&>(!1)},onConfirm:()=>void ve()}),ae&&o.jsx(Xn,{label:cs("draft",$.ids.size).menu,title:`${cs("draft",$.ids.size).menu}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:xe=>{xe||pe(!1)},onConfirm:()=>{const xe=[...$.ids];pe(!1),Ve(xe)}})]}),Yt>0&&o.jsx("div",{ref:Rn,"aria-hidden":!0}),Yt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:an,children:["Show ",Math.min(Yt,60)," more"]})})]}),Pt&&n&&!r&&e.length>0&&o.jsx(Mo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Create your own ",o.jsx("em",{children:"person"})]}),body:"Describe someone new, or add photos of a real person. They stay the same person in every image you make.",action:Z}),nt&&n&&!r&&ne.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri people"})}),!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":_,style:U,"aria-hidden":!0,children:o.jsx(qL,{size:"grid",count:8})}),n&&r&&o.jsx(Mo,{shape:"error",title:"Couldn't load Scenri people",body:"Something went wrong reaching the catalog.",onRetry:()=>a()}),Pt&&n&&!r&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Yy,{label:"Or cast someone from ours"}),Ct]}),n&&!r&&ne.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:U,children:ne.map(xe=>o.jsx(dv,{presenter:xe,variant:"use",size:"grid",onOpen:B,href:La(u,xe.id),onUse:h,bookmarked:E.includes(xe.id),onBookmark:L},xe.id))}),n&&!r&&Et&&o.jsx(Mo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a person from their card and they stay here.",mark:Uy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>y({bookmarked:null}),children:"Browse everyone"})}),n&&!r&&!Et&&!Bt.length&&e.length>0&&o.jsx(M2,{noun:"people",q:g,facet:C?"Keepers":k,onClearSearch:b,onClearAll:S}),n&&!r&&!e.length&&o.jsx(Mo,{shape:"zero",body:"Scenri people are still being cast. Check back soon."}),ce>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:ue,children:["Show ",Math.min(ce,60)," more"]})})]})}),$.ids.size>0&&($.kind==="draft"||$.kind==="presenter")&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Ky,{count:$.ids.size,loaded:$.kind==="draft"?X.length:qt.length,tool:cs($.kind,$.ids.size).tool,icon:cs($.kind,$.ids.size).icon,danger:cs($.kind,$.ids.size).danger,onAct:$.kind==="draft"?xt:yt,keep:$.kind==="presenter"?{label:Ae.tool,filled:ot,onAct:ht}:null,onClear:$.clear,onSelectAll:()=>$.selectAll($.kind==="draft"?"draft":"presenter",($.kind==="draft"?X:qt).map(xe=>xe.id))})}),o.jsx(zc,{})]})}const C7={portrait:"Face",identity:"Face",front:"Full body","three-quarter":"Three-quarter",back:"Back",left:"Left",right:"Right","left-profile":"Left","right-profile":"Right"},j7=3;function iie(){var me;const{presenterId:e=""}=ia(),{presenters:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l,presenterCategories:u}=Mn(),{brand:f}=un(),h=Un(),p=R2(),g=s.useRef(!1),m=Ty(),[w,y]=s.useState([]),[b,S]=s.useState(null),[k,C]=s.useState(null),E=tX(f,e),A=E??t.find(re=>re.id===e);Xc(A==null?void 0:A.name);const L=!!E,[$,N]=s.useState(null);s.useEffect(()=>{let re=!0;if(y([]),!L)return Ee.presenterFrames(e).then(ee=>{re&&(y(ee.frames),N(e))}).catch(()=>{re&&(y([]),N(e))}),()=>{re=!1}},[e,L]);const j=s.useRef(e);j.current=e,E2(()=>{if(L)return;const re=e;Ee.presenterFrames(re).then(ee=>{j.current===re&&y(q=>ki(q,ee.frames))}).catch(()=>{})});const P=!!gn({path:pt.presenterEdit});s.useEffect(()=>{let re=!0;if(C(null),!(!L||P))return Ee.presenterDrafts(f.id).then(ee=>{if(!re)return;const q=ee.drafts.find(ie=>ie.presenterId===e);C((q==null?void 0:q.id)??null)}).catch(()=>{}),()=>{re=!1}},[f.id,e,L,P]);const R=((me=f.json)==null?void 0:me.characters)??[],H=R.find(re=>re.presenterId===e),D=R.find(re=>re.id===e),U=qy(f.id,[e??"",(H==null?void 0:H.id)??""]),[_,B]=s.useState(null),[K,V]=s.useState(!1),[O,I]=s.useState(!1),Y=async re=>{if(E){V(!0),B(null);try{const ee=await Ee.updatePresenter(f.id,E.id,re);i(ee.brand),I(!1)}catch(ee){B(String(ee.message??ee))}finally{V(!1)}}},Z=async()=>{if(!E||g.current)return;g.current=!0;const re=p(),ee=di(f);V(!0);try{const q=await Ee.deletePresenter(f.id,E.id);i(q.brand)}catch(q){if((q==null?void 0:q.status)!==404){g.current=!1,re()&&(B(String(q.message??q)),V(!1));return}await l()}re()&&h(ee,{replace:!0})},X=iy(f,e);if(X!==e)return o.jsx(Ta,{to:La(f,X),replace:!0});if(!n&&!E)return o.jsx(ds,{children:o.jsx("main",{className:"sc-lookpage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!E)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this person"}),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(!A)return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This person 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(Vn,{className:"sc-btn sc-btn-primary",to:di(f),children:"Browse people"})})]})});const z=E?(Array.isArray(D==null?void 0:D.shots)?D.shots:[]).map((re,ee)=>({src:es(re==null?void 0:re.file),label:C7[(re==null?void 0:re.angle)??""]??`Reference ${ee+1}`,angle:typeof(re==null?void 0:re.angle)=="string"?re.angle:void 0})).filter(re=>!!re.src):w.length?w.map((re,ee)=>({src:re.url,label:C7[re.angle]??`Reference ${ee+1}`,angle:re.angle})):A.previewUrl?[{src:A.previewUrl,label:"Preview"}]:[],J=Jm(f,e),he=Si(E??A),te=[...new Set([...u,...lf(f).flatMap(re=>re.suitableCategories??[])])].sort((re,ee)=>re.localeCompare(ee));return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-presenterpage",id:"main",children:[o.jsx(Xy,{to:di(f),wall:"People",where:E?"Yours":"Scenri library"}),he.src&&o.jsx("div",{className:"sc-presenterpage-avatar",children:o.jsx(Ma,{src:Tn(he.src,"small"),crop:he.crop})}),o.jsx("h1",{children:A.name}),A.suitableCategories.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:A.suitableCategories.map(re=>o.jsx("li",{className:"sc-chip","data-static":!0,children:re},re))}),A.descriptor&&o.jsx("p",{className:"sc-lookpage-lede",children:A.descriptor}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>m(e),children:"Use in a shot"}),E&&o.jsx(Vn,{className:"sc-btn sc-btn-ghost",to:J,children:k?"Continue editing":"Edit person"}),o.jsx(Qy,{kind:"presenter",brandId:f.id,id:e}),E&&o.jsx(hr,{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:()=>I(!0),children:o.jsx(Rd,{size:17})})})]}),_&&o.jsx("p",{className:"sc-assetform-err",children:_}),!E&&$!==e?o.jsx(j1,{count:j7,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:Array.from({length:j7},(re,ee)=>o.jsxs("li",{"aria-hidden":!0,children:[o.jsx("span",{className:"sc-refset-tile","data-state":"loading",children:o.jsx("span",{className:"sc-placeholder"})}),o.jsx("span",{className:"sc-refset-lb"})]},ee))}):z.length>0?o.jsx(j1,{count:z.length,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:z.map(re=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","data-role":re.angle,"aria-label":`${re.label}, open`,onClick:()=>S(re),children:o.jsx(Ma,{src:Tn(re.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:re.label})]},re.label))}):o.jsx(ly,{}),E&&E.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:E.sourceRefs.map((re,ee)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${ee+1}, open`,onClick:()=>S({src:re,label:`Source photo ${ee+1}`}),children:o.jsx(Ma,{src:Tn(re,"micro")})},re))})]}),E&&o.jsxs("div",{className:"sc-prec",children:[o.jsxs("p",{className:"sc-prec-note",children:[A.ageRange?`${A.ageRange} · `:"",E.source==="synthetic"?"Created in Scenri. Not a real person.":E.source==="photos"?"Built from your photographs.":"Saved in Scenri.",E.likeness?` Likeness confirmed ${new Date(E.likeness.attestedAt).toLocaleDateString()}.`:""]}),o.jsx(Xn,{label:"Delete person",title:`Delete ${E.name}?`,body:Ai("presenter",1),busy:K,onConfirm:()=>void Z()})]}),U.length>0&&o.jsx(cd,{label:`Shots featuring ${A.name}`,children:U.map(re=>o.jsx(cy,{node:re,to:e2(f,null,re.id)},re.id))}),O&&E&&o.jsx(nT,{name:E.name,categories:A.suitableCategories,known:te,hint:"The verticals they suit, so they surface where you work.",busy:K,error:_,onSave:re=>void Y({name:re.name,suitableCategories:re.categories}),onDismiss:()=>I(!1)}),b&&o.jsx(Nd,{src:b.src,kind:"presenter",label:b.label,noun:A.name,onClose:()=>S(null)})]})})}function lie({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:m,focusKey:w,onStop:y,stopping:b,onAttach:S,onAttachFiles:k,attachLabel:C,colour:E,refs:A,onSend:L}){const $=s.useRef(null),N=s.useRef(null),[j,P]=s.useState(void 0);s.useLayoutEffect(()=>{const Z=$.current;if(!Z)return;Z.style.height="auto";const X=Number.parseFloat(getComputedStyle(Z).maxHeight)||Number.POSITIVE_INFINITY;Z.style.height=`${Math.min(Z.scrollHeight,X)}px`,Z.style.overflowY=Z.scrollHeight>X?"auto":"hidden"},[i]);const[R,H]=s.useState(!1),D=Or(da);s.useEffect(()=>{if(!w||w===j||f||(P(w),D))return;const Z=$.current;if(Z==null||Z.focus({preventScroll:!0}),Z!=null&&Z.value){Z.select(),H(!0);const X=setTimeout(()=>H(!1),700);return()=>clearTimeout(X)}},[w,j,f,D]);const U=f||g,_=!!(E!=null&&E.hex)||!!(A!=null&&A.some(Z=>!Z.busy)),B=!i.trim()&&!u&&!_,K=()=>{U||B||L(i)},V=m?{text:m,tone:"alert"}:{text:(r==null?void 0:r.hint)??a??"",tone:r==null?void 0:r.tone},O=!!y&&(g||!i.trim()&&!_),I=g||O?null:f&&h?h:B&&!f?"Nothing typed yet.":null,Y=o.jsxs("button",{type:"button",className:"sc-convo-send","aria-disabled":(O?!!b:g||U||B)||void 0,"aria-busy":g||O||void 0,"data-stop":O||void 0,onClick:O?b?void 0:y:g?void 0:K,children:[o.jsx("span",{className:"sc-convo-send-ico",children:g||O?o.jsx("span",{className:"sc-convo-spin","aria-hidden":"true"}):o.jsx(EE,{size:17,weight:"bold"})}),O?b?"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":R||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:[A==null?void 0:A.map(Z=>o.jsxs("span",{className:"sc-token","data-kind":"image","data-busy":Z.busy||void 0,dir:"ltr",children:[o.jsx("img",{src:Z.src,alt:""}),o.jsx("span",{className:"sc-token-label",children:Z.label}),o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":`Remove ${Z.label}`,onClick:Z.onRemove,children:o.jsx(jn,{size:11,weight:"bold"})})]},Z.key)),E&&o.jsxs("span",{className:"sc-token","data-kind":"color","data-empty":E.hex?void 0:"",dir:"ltr",children:[o.jsxs(Ed,{className:"sc-convo-chip",triggerStyle:{background:"none"},value:E.hex??E.seed??"#808080",commitMode:"live",align:"start",label:E.hex?`${E.label}. Change the colour.`:"Pick a colour",onChange:E.onPick,children:[o.jsx("span",{className:"sc-token-swatch",style:E.hex?{background:E.hex}:void 0}),o.jsx("span",{className:"sc-token-label",children:E.label})]}),E.hex&&o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":"Remove colour",onClick:E.onClear,children:o.jsx(jn,{size:11,weight:"bold"})})]}),o.jsx("textarea",{ref:$,className:"sc-in",rows:1,maxLength:jd,"aria-label":t,placeholder:E!=null&&E.hex&&!i?"":f&&h?h:e,value:i,disabled:f,onChange:Z=>l(Z.target.value),onKeyDown:Z=>{Z.key!=="Enter"||Z.shiftKey||(Z.preventDefault(),K())}})]}),o.jsxs("div",{className:"sc-convo-row",children:[(S||k)&&o.jsxs(o.Fragment,{children:[o.jsx(hr,{label:U&&h?h:C??"Add photos",children:o.jsx("button",{type:"button",className:"sc-convo-attach","aria-label":C??"Add photos","aria-disabled":U||void 0,onClick:U?void 0:k?()=>{var Z;return(Z=N.current)==null?void 0:Z.click()}:S,children:o.jsx(gr,{size:16,weight:"bold"})})}),k&&o.jsx("input",{ref:N,type:"file",accept:"image/*",hidden:!0,"aria-label":C??"Add a picture",onChange:Z=>{const X=Array.from(Z.target.files??[]).filter(z=>z.type.startsWith("image/"));Z.target.value="",X.length&&k(X)}})]}),I?o.jsx(hr,{label:I,children:Y}):Y]})]}),V.text?o.jsx("small",{className:"sc-convo-line",role:V.tone==="alert"?"alert":void 0,"data-tone":V.tone,children:V.text}):null]})}function aT({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 A7=500,oT=400,iT=760,$u=e=>Math.min(iT,Math.max(oT,Math.round(e)));function cie({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 m=s.useRef(null),[w,y]=s.useState(null);zy(w,"--sc-pstudio-dock-h"),s.useEffect(()=>{const A=L=>{L.key!=="Escape"||L.defaultPrevented||(L.preventDefault(),g())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[g]);const[b,S]=Pa(Qr.pstudioRailW,A7),k=s.useRef(0),C=s.useRef(0),E=s.useRef(null);return Ur.createPortal(o.jsx(Ld,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:A=>{var L;E.current=document.activeElement instanceof HTMLElement?document.activeElement:null,A.preventDefault(),(L=m.current)==null||L.focus({preventScroll:!0})},onUnmountAutoFocus:A=>{var L,$;(L=E.current)!=null&&L.isConnected||(A.preventDefault(),($=document.querySelector(".sc-new-go")??document.getElementById("main"))==null||$.focus())},children:o.jsxs("div",{ref:m,tabIndex:-1,className:"sc-pstudio","data-kind":u,style:{"--sc-pstudio-rail-set":`${$u(b)}px`},role:"dialog","aria-modal":"true","aria-labelledby":"sc-pstudio-title",onDragOver:A=>{p&&Array.from(A.dataTransfer.types).includes("Files")&&A.preventDefault()},onDrop:A=>{var $;if(!p||A.defaultPrevented)return;const L=Array.from((($=A.dataTransfer)==null?void 0:$.files)??[]);L.length&&(A.preventDefault(),p(L))},onPaste:A=>{var $;if(!h)return;const L=Array.from((($=A.clipboardData)==null?void 0:$.files)??[]).filter(N=>N.type.startsWith("image/"));L.length&&(A.preventDefault(),h(L))},children:[o.jsxs("div",{className:"sc-pstudio-grid",children:[o.jsx(hr,{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}),o.jsx("div",{className:"sc-pstudio-resize",role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuemin":oT,"aria-valuemax":iT,"aria-valuenow":$u(b),tabIndex:0,onPointerDown:A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),A.currentTarget.setPointerCapture(A.pointerId))},onPointerMove:A=>{if(!A.currentTarget.hasPointerCapture(A.pointerId))return;const L=A.currentTarget.closest(".sc-pstudio");k.current=A.clientX,!C.current&&(C.current=requestAnimationFrame(()=>{C.current=0,L==null||L.style.setProperty("--sc-pstudio-rail-set",`${$u(window.innerWidth-k.current)}px`)}))},onPointerUp:A=>{A.currentTarget.releasePointerCapture(A.pointerId),C.current&&(cancelAnimationFrame(C.current),C.current=0),S($u(window.innerWidth-A.clientX))},onDoubleClick:()=>S(A7),onKeyDown:A=>{if(A.key==="ArrowLeft")S(L=>$u(L+16));else if(A.key==="ArrowRight")S(L=>$u(L-16));else return;A.preventDefault()}})]}),l]})}),document.body)}function uie({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 m=die(n),[w,y]=s.useState(null),b=f??[],S=Math.max(0,b.findIndex(R=>w?R.hash===w:R.current)),k=b[S];s.useEffect(()=>y(null),[e]);const C=fie(w&&b.some(R=>R.hash===w)?w:e),[E,A]=s.useState(void 0);s.useEffect(()=>{C||A(void 0)},[C]);const L=R=>{const H=b[S+R];H&&y(H.hash)},$=s.useRef(null),[N,j]=s.useState(!1);s.useLayoutEffect(()=>{const R=$.current,H=!!(R!=null&&R.complete&&R.naturalWidth);j(!H),H&&(R!=null&&R.naturalHeight)&&A(R.naturalWidth/R.naturalHeight)},[C]);const P=!!e&&!C;return 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:E?{"--sc-well-ar":E}:void 0,children:[e&&C?o.jsx("img",{ref:$,src:Dr(C),srcSet:`${vn(C,"tile")} 640w, ${Dr(C)} 1024w`,sizes:"(max-width: 767px) 92vw, 44vw",alt:t,decoding:"async","data-waiting":N||void 0,onLoad:R=>{const H=R.currentTarget;j(!1),H.naturalWidth&&H.naturalHeight&&A(H.naturalWidth/H.naturalHeight)}}):o.jsx("span",{className:"sc-pstudio-well-blank",children:!n&&!e&&o.jsx(aT,{glyph:g,lead:p==null?void 0:p.lead,hint:p==null?void 0:p.hint})}),(n&&!e||P)&&o.jsx($a,{}),n&&o.jsxs("span",{className:"sc-pstudio-doing",children:[o.jsx("span",{children:u??"Drawing"}),r&&o.jsx("time",{"aria-hidden":"true",children:Oc(r,m)})]}),b.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":S===0||void 0,onClick:()=>S>0&&L(-1),children:o.jsx(Ha,{size:13,weight:"bold"})}),o.jsxs("span",{className:"sc-pstudio-vers-n","aria-live":"polite",children:["Version ",(k==null?void 0:k.n)??1," of ",b.length]}),o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version after","aria-disabled":S===b.length-1||void 0,onClick:()=>S<b.length-1&&L(1),children:o.jsx(Rl,{size:13,weight:"bold"})}),k&&!k.current&&h&&o.jsx("button",{type:"button",className:"sc-pstudio-vers-put",onClick:()=>h(k.hash),children:"Put back"}),(k==null?void 0:k.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 H=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":H,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:vn(R.hash,"micro"),alt:""}):null,R.drawing?o.jsx($a,{}):null,R.approved&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","aria-hidden":!0,children:o.jsx(Gn,{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(Sm,{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 die(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 fie(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=`${vn(e,"tile")} 640w, ${Dr(e)} 1024w`,i.sizes="(max-width: 767px) 92vw, 44vw",i.src=Dr(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 Jy({surface:e,onClose:t}){var h,p,g;const n=Or(da),r=e,a=(h=r.stage)==null?void 0:h.onPick,i=a?m=>a(m):void 0,l=Dte(r.turns);s.useEffect(()=>{if(!l||r.busy)return;let m=!1;const w=y=>{var S,k;if(y.key!=="Enter"||y.shiftKey||y.defaultPrevented||m)return;const b=y.target;!((S=b==null?void 0:b.matches)!=null&&S.call(b,".sc-convo-q"))||((k=b.closest(".sc-convo-turn"))==null?void 0:k.getAttribute("data-turn"))!==`q:${l.id}`||(y.preventDefault(),m=!0,r.onAnswer(l.id,{kind:"confirm",id:l.options[0].id}))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[l,r.busy,r.onAnswer]);const u=r.glyph??o.jsx(n_,{size:32}),f=n?null:r.stage?o.jsx(uie,{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:u}):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(aT,{glyph:u,lead:(p=r.stageEmpty)==null?void 0:p.lead,hint:(g=r.stageEmpty)==null?void 0:g.hint})})})})});return o.jsx(cie,{kind:r.kind??"presenter",title:r.title,headAction:r.headAction,resizeLabel:"Resize the conversation",onPaste:r.onPaste,onClose:t,overlay:r.overlay,stage:f,bodyProps:{"data-convo":!0},body:o.jsx(kne,{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:m=>(r.onStarter??r.onText)(m),onDescribe:r.onDescribe,onAttachFiles:r.onAttachRef}),foot:o.jsxs(o.Fragment,{children:[r.dock,r.composer&&o.jsx(lie,{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 Bd=[{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"}]}}],Ia=e=>Bd.find(t=>t.id===e),hie=/\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 lT(e){return hie.test(e??"")}function pie(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&&!lT(n)?`${n} ${r}`:n:r?`${((l=Ia(e))==null?void 0:l.label.toLowerCase())??e} ${r}`:""}function N7(e,t){const n=(t??[]).filter(r=>/\b(left|right)\b/i.test(r.words)&&(e==="front"||!mie.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 mie=new Set(["tattoo","prosthetic"]),P2=["who","age","heritage","skin","hair","length","facial","eyes","build","height"],Fc="either",_c=e=>{var t,n;return[(e==null?void 0:e.pick)===Fc?"":(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(", ")},cT=e=>{var t;return!!(e!=null&&e.pick||(t=e==null?void 0:e.words)!=null&&t.trim())},L2=e=>{var t;return((t=e.source)==null?void 0:t.door)==="scratch"},hv=e=>{var t;return L2(e)&&((t=e.source)==null?void 0:t.via)==="taps"},T2=e=>{var t;return L2(e)&&((t=e.source)==null?void 0:t.via)!=="taps"},$2=e=>{var t;return((t=e.source)==null?void 0:t.door)==="photos"},gie=/\b(slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size)\b/i;function eb(e){const t=e.trim(),n=t.split(/\s+/).filter(Boolean).length,r=[];return $p.test(t)||r.push("who"),qw.test(t)||r.push("age"),r.length&&!gie.test(t)&&n<8&&r.push("build"),r}const vie=(e,t)=>P2.every(n=>!gT(`look-${n}`,e,t)||e[`look-${n}`]!==void 0),uT=e=>T2(e)&&e.describe!==void 0&&eb(e.describe).length>0,wie=e=>T2(e)&&e.describe!==void 0&&(!uT(e)||e.gaps!==void 0),yie=(e,t)=>{var n;return $2(e)&&!!t.draft&&t.draft.source==="photos"&&t.canGenerate&&t.draft.stage!=="analyzing"&&(e.traits!==void 0||!((n=t.draft.keep)!=null&&n.trim()))},dT=(e,t)=>hv(e)?vie(e,t):T2(e)?wie(e):yie(e,t),bie=(e,t)=>L2(e)||$2(e)&&!!t.draft,fT=e=>t=>{var n;return!!((n=t.traits)!=null&&n.includes(e))},hT=e=>t=>cT(t[`trait-${e}`]),pT=e=>t=>{var n;return fT(e)(t)&&hT(e)(t)&&!!((n=Ia(e))!=null&&n.where)&&!lT(_c(t[`trait-${e}`]))},Kh=(e,t)=>Array.isArray(e)&&e.includes(t),xie=(e,t)=>{var n;return dT(e,t)&&(((n=e.traits)==null?void 0:n.every(r=>hT(r)(e)&&(!pT(r)(e)||e[`trait-${r}-where`]!==void 0)))??!1)},kie=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),Sie=(e,t)=>{var r;if(!$2(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)},wi=[{id:"source",applies:()=>!0},{id:"photos",applies:$2},{id:"weakphotos",applies:Sie},...P2.map(e=>({id:`look-${e}`,applies:e==="facial"?t=>{var n;return hv(t)&&((n=t["look-who"])==null?void 0:n.pick)!=="woman"}:hv})),{id:"describe",applies:T2},{id:"gaps",applies:uT,dependsOn:[{on:"describe"}]},{id:"traits",applies:bie,ready:dT},...Bd.flatMap(e=>[{id:`trait-${e.id}`,applies:fT(e.id),dependsOn:[{on:"traits",changed:(t,n)=>Kh(t,e.id)!==Kh(n,e.id)}]},{id:`trait-${e.id}-where`,applies:pT(e.id),dependsOn:[{on:`trait-${e.id}`,changed:(t,n)=>_c(t)!==_c(n)},{on:"traits",changed:(t,n)=>Kh(t,e.id)!==Kh(n,e.id)}]}]),{id:"keep",applies:L2,ready:xie,optional:!0,sticky:!0}],mT=new Map(wi.map(e=>[e.id,e])),Eie=wi.map(e=>e.id),A1=e=>{const t=wi.findIndex(n=>n.id===e);return t<0?wi.length:t},Cie=e=>mT.get(e);function gT(e,t,n){return Cie(e).applies(t,n)}function vT(e,t,n){if(e==="photos")return!!n.draft&&n.draft.source==="photos";const r=t[e];return r===void 0?!1:fr(e)||Aie(e)?cT(r):!0}function wT(e,t){return wi.filter(n=>n.applies(e,t)&&vT(n.id,e,t)).map(n=>n.id)}function D2(e,t){var n;return((n=wi.find(r=>{var a;return!r.optional&&r.applies(e,t)&&(((a=r.ready)==null?void 0:a.call(r,e,t))??!0)&&!vT(r.id,e,t)}))==null?void 0:n.id)??null}function M7(e,t,n){const r={...e},a=new Set,i=new Set(Object.keys(t));for(const[u,f]of Object.entries(t))kie(e[u],f)&&(f===void 0?delete r[u]:r[u]=f,a.add(u));if(a.size){const u=wi.map(g=>g.id),f=Math.min(...[...a].map(g=>u.indexOf(g))),h=new Set(a),p=g=>(g.dependsOn??[]).some(m=>h.has(m.on));for(const g of wi)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 wi){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 jie(e){const t={};for(const n of e.traits??[]){const r=e[`trait-${n}`];r&&(t[n]={words:_c(r)||void 0,where:_c(e[`trait-${n}-where`])||void 0,refs:r.refs.length?r.refs:void 0})}return t}function yT(e){const t={};for(const n of P2){const r=e[`look-${n}`];r!==void 0&&(t[n]=r)}return t}const bT=e=>Bd.map(t=>t.id).filter(t=>e.includes(t)),fr=e=>e.startsWith("look-"),Aie=e=>e.startsWith("trait-"),sa=e=>mT.has(e);function fs(e){if(!e.startsWith("trait-"))return null;const t=e.endsWith("-where"),n=t?e.slice(6,-6):e.slice(6);return Ia(n)?{id:n,part:t?"where":"what"}:null}const Nie=[{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"}],Mie=[{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"}],Rie=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"]),Pie=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 Lie(e){const[t,n,r]=Pie(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 Tie=e=>{var t;return((t=Nie.find(n=>e<n.to))==null?void 0:t.name)??"red"};function $ie(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 Die(e){return e<.18?"deep":e<.34?"dark":e>=.88?"pale":e>=.74?"light":""}function xT(e){var u;const{h:t,s:n,l:r}=Lie(e);if(n<.09){const f=((u=Mie.find(h=>r<h.to))==null?void 0:u.name)??"grey";return{name:f,family:f,h:t,s:n,l:r}}const a=Tie(t),i=$ie(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=Die(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 Hie(e){const{family:t,h:n,s:r,l:a}=xT(e);return Rie.has(t)?!0:n>=16&&n<=60&&a>=.7&&r<.7||r<.09}const tb=[{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"}],kT=[{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"}],nb=[{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"}],ST=[{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"}],Oie=[{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"}],rb=[{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"}],ET=[{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"}],CT=[{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"}],Iie={},jT=[{id:"woman",label:"Woman"},{id:"man",label:"Man"},{id:"androgynous",label:"Androgynous"}],AT=["20s","30s","40s","50s","60+"].map(e=>({id:e,label:e})),vf={who:{row:{id:"who",label:"Who",options:jT},prompt:"Who are they?"},age:{row:{id:"age",label:"Age",options:AT},prompt:"Roughly how old?"},heritage:{row:{id:"heritage",label:"Heritage",options:Oie},prompt:"Where are they from?"},skin:{row:{id:"skin",label:"Skin",options:nb},prompt:"And their skin?"},eyes:{row:{id:"eyes",label:"Eyes",options:rb},prompt:"What colour are their eyes?"},facial:{row:{id:"facial",label:"Facial hair",options:ET},prompt:"Any facial hair?"},hair:{row:{id:"hair",label:"Hair",options:tb},prompt:"What colour is their hair?"},length:{row:{id:"length",label:"Length",options:kT},prompt:"And the length?"},build:{row:{id:"build",label:"Build",options:ST},prompt:"And their build?"},height:{row:{id:"height",label:"Height",options:CT},prompt:"And how tall?"}};P2.map(e=>vf[e]);const R7=new Set(["hair","skin","eyes"]),Fie={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"},_ie=e=>e==="man"?"man":e==="woman"?"woman":"androgynous",Vie=new Set(["length","height","build"]),Zie=900;function sb(e,t,n){const r=zie(e,t);if(r.far<Zie)return r.id;const a=xT(e).name;return n==="hair"&&!Hie(e)?`dyed ${a}`:a}function zie(e,t,n){const r=h=>{const p=h.replace("#","");return(p.length===3?p.split("").map(m=>m+m):[p.slice(0,2),p.slice(2,4),p.slice(4,6)]).map(m=>Number.parseInt(m,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,m]=r(h.color),w=(a-p)**2+(i-g)**2+(l-m)**2;w<f&&(f=w,u=h)}return{id:u.id,far:f}}const P7=e=>e==="skin"?nb:e==="eyes"?rb:tb,wp=e=>e.charAt(0).toUpperCase()+e.slice(1);function NT(e){const t=H=>H!=null&&H.pick&&H.pick!==Fc?H.pick:"",n=(H,D,U)=>{var B;const _=t(H);return _?_.startsWith("#")?sb(_,D,U):_:((B=H==null?void 0:H.words)==null?void 0:B.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,U)=>n(H,D,U).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(" "),m=[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&&m.push(a(y,r(e.age)));const b=[],S=i(e.length,kT),k=i(e.hair,tb,"hair"),C=[S,k].filter(Boolean).join(" ");C&&b.push(a(`${C} hair`,r(e.length),r(e.hair)));const E=i(e.facial,ET);E&&b.push(a(E,r(e.facial)));const A=i(e.eyes,rb);A&&b.push(a(`${A} eyes`,r(e.eyes)));const L=i(e.skin,nb,"skin");L&&b.push(a(`${L} skin`,r(e.skin)));const $=i(e.height,CT),N=i(e.build,ST),j=$?a(Iie[$]??$,r(e.height)):"",P=N?a(`${/^[aeiou]/.test(N)?"an":"a"} ${N} build`,r(e.build)):"",R=[j,P&&(j?`with ${P}`:P)].filter(Boolean).join(" ");return R&&b.push(R),b.length&&m.push(`with ${b.join(", ")}`),a(m.join(" "),r(e.who))}function Bie(e,t){var i,l;const n=t.pick,r=n===Fc?"Either way":n!=null&&n.startsWith("#")?wp(sb(n,e.options,e.id)):n?((i=e.options.find(u=>u.id===n))==null?void 0:i.label)??wp(n):"",a=((l=t.words)==null?void 0:l.trim())??"";return r?a?`${r}, ${a}`:r:wp(a)}function Uie(e){return wp(NT(e))}const N1=e=>typeof e=="string"&&e.startsWith("aside:"),Wie=e=>e.slice(6),om={answers:{},revision:0,editing:null,saying:null,says:0,text:"",colour:null,composing:null,asides:[],unsure:null,extrasDeclined:!1,held:!1,uploading:0},Kie="That did not read as a description of someone.",MT=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Gie(e){if(!e||e==="name")return null;if(e==="keep")return"keep";const t=fs(e);return t&&t.part==="what"?`trait-${t.id}`:null}function L7(e,t){var r;const n=Gie(t);return n?{id:n,refs:((r=e.answers[n])==null?void 0:r.refs)??[]}:null}function S6(e){const t=e.composing;if(!t)return e.answers;const n=e.answers[t.id];if(!n||MT(n.refs,t.refs))return e.answers;if(!_c(n)&&!t.refs.length){const r={...e.answers};return delete r[t.id],r}return{...e.answers,[t.id]:{...n,refs:t.refs}}}function Yie(e,t){var r;if(!fr(t)&&!fs(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 pv(e,t,n,r){return e.filter(a=>!a.q||!sa(a.q)?!0:!gT(a.q,t,n)||a.edit&&t[a.q]!==void 0?!1:r===void 0||A1(a.q)<=r)}function qie(e){const t=Object.keys(e).filter(n=>sa(n));return t.length?Math.min(...t.map(A1)):void 0}function RT(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 E6(e,t){const n=e.unsure;if(!n)return e;const r=D2(e.answers,t),a=u=>u&&(u===r||sa(u)&&e.answers[u]!==void 0)?u:null,i=e.asides.map(u=>u.q==="unsure"?{...u,q:a(n.q)}:u),l=RT(i,{said:n.said,reply:Kie,q:a(n.q),at:n.at});return{...e,unsure:null,asides:pv([...i,l],e.answers,t)}}function Xie(e,t){var n,r,a;switch(t.type){case"answer":{const i=M7(e.answers,t.patch,t.ctx),l=!MT(i,e.answers),u=E6(e,t.ctx);return{...u,answers:i,revision:l?e.revision+1:e.revision,asides:pv(u.asides,i,t.ctx,qie(t.patch)),editing:null,saying:null,colour:null,composing:null,text:""}}case"edit":{const i=N1(t.id)||t.id==="name"?void 0:Yie(e,t.id);return{...e,answers:S6(e),composing:N1(t.id)?null:L7(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&&sa(i.q)?i.q:null,u=l&&e.answers[l]!==void 0?M7(e.answers,{[l]:void 0},t.ctx):e.answers,f=pv(e.asides.filter(h=>h.at<=t.at),u,t.ctx,l?A1(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:S6(e),composing:null,editing:null,saying:null,colour:null,text:""};case"say":{const i=e.saying===t.id?null:t.id;return{...e,answers:S6(e),composing:L7(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&&sa(t.aside.q)&&e.answers[t.aside.q]!==void 0?{...t.aside,after:!0}:t.aside;return{...e,asides:[...e.asides,RT(e.asides,l)],text:""}}case"unsure":return{...E6(e,t.ctx),unsure:t.unsure,text:""};case"settle-unsure":return E6(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"hold":return e.held===t.held?e:{...e,held:t.held};case"start-over":return{...om,revision:e.revision+1,text:t.text??""};case"restore":return{...om,answers:t.answers,revision:t.revision,asides:t.asides??[],extrasDeclined:!!t.extrasDeclined,held:!!t.held}}}function mv(e,t){return D2(e.answers,t)===null&&!e.editing&&!e.saying}const PT=5,LT=40;function Qie(e){return JSON.stringify({v:PT,answers:e.answers,revision:e.revision,asides:e.asides.slice(-LT),...e.extrasDeclined?{extrasDeclined:!0}:{},...e.held?{held:!0}:{}})}function Jie(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 ele(e){var r;if(fr(e))return vf[e.slice(5)].row.options;const t=fs(e),n=t&&Ia(t.id);return n?t.part==="where"?((r=n.where)==null?void 0:r.options)??[]:n.options:[]}function T7(e,t){return t===Fc||/^#[0-9a-f]{6}$/i.test(t)?{pick:t}:ele(e).some(n=>n.id===t)?{pick:t}:{words:t}}function tle(e,t){if(e==="keep")return typeof t=="string"?{words:t,refs:[]}:t;if(typeof t=="string"&&(fr(e)||fs(e)))return T7(e,t);const n=fs(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}:{...T7(e,r.words),refs:a}}return t}function im(e){if(!e)return null;try{const t=JSON.parse(e);if(t.v!==PT&&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))sa(a)&&(n[a]=tle(a,i));const r=(Array.isArray(t.asides)?t.asides:[]).map(Jie).filter(a=>a!==null).slice(-LT);return{answers:n,revision:typeof t.revision=="number"?t.revision:0,asides:r,...t.extrasDeclined===!0?{extrasDeclined:!0}:{},...t.held===!0?{held:!0}:{}}}catch{return null}}const qn={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?",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 person, in full. Ready to draw?",noEngine:"Drawing a person needs image generation, which is not set up yet.",identity:e=>`Here is ${e==="them"?"the face":e}. Use this person to draw the rest from this face, or change something.`,change:"What should change?",landed:e=>`Here is the ${e}. Use it, or try again.`,extras:"Add back and profile views? Three more pictures, for shots from behind or in profile."},TT=e=>e==="photos"?"the photos":"the face",$T=[{id:"photos",label:"Add photos"},{id:"scratch",label:"Describe someone"}],nle={photos:/\b(photos?|pictures?|pics?|upload|images?|selfies?)\b/,scratch:/\b(scratch|describe|description|invent|make (someone|one|them) up|imagine|new person)\b/},rle=[{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."}];function DT(e){const t=(e??"").replace(/\s*\(BYOK\)\s*$/i,"").trim();return`I have permission to use this person's likeness, and to send these photos ${t?/^codex/i.test(t)?"to OpenAI, through Codex, to draw them":`to ${t} to draw them`:"to the engine that draws them"}.`}DT(null);function sle(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 ale=(e,t)=>`${e} is larger than ${Math.round(t/1024/1024)}MB. Choose a smaller copy of it.`,ole=e=>/\.hei[cf]$/i.test(e)?`${e} is a HEIC photo, which Scenri cannot read yet. Export it as JPEG and add that.`:`${e} could not be read as a photograph. JPEG, PNG and WebP all work.`,ile="First portrait appears here",lle=(e,t)=>!e||e==="portrait"||!t?ile:`The ${t} appears here`;function cle(e,t=0){return e==="agree"?"Ready when you are":e==="source"?"Describe them, or add photos":e==="photos"?t?"Continue when the photos are in":"Add their photos":e==="retry"?"Try again from the conversation":e==="noengine"?"Set up image generation to draw them":"Keep describing your person"}const HT=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 ule(e){return e===1?"One photo":`${e} photos`}function dle(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 fle="That does not read as a description yet. Draw from it anyway, or describe them: age, hair, build, skin, presence.",hle=e=>e===0?void 0:e===1?"Changing this asks the one after it again.":`Changing this asks the ${e} after it again.`,ple="Change this answer?",mle="The face is drawn again from the change, and the views built on it follow. Nothing already saved changes.",gle="The views drawn from the photos are drawn again with the change. The photos themselves stay as they are.",vle={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"},wle={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"}},xs=e=>e.charAt(0).toUpperCase()+e.slice(1);function fc(e,t,n,r="",a,i=!1){const l=t==="look"?wle[a??""]??null:null,u=(l==null?void 0:l.how)??vle[t],f=i?"":` ${xs(u)}.`;if(n>=2&&e!=="likeness"){const h=t==="look"||t==="detail"?"Or Skip it and we will choose.":"";return i?h||`${xs(u)}.`:`${xs(u)}.${h?` ${h}`:""}`}switch(e){case"likeness":return"Describe them by looks. Scenri does not draw a named person.";case"help":return l?`${xs(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"?`${xs(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. ${xs(u)}.`;case"intent":return l?`${xs(u)}.`:t==="refine"?`Nothing changes until it is said what: ${u}.`:`That is what we are here for. Who are they? ${xs(u)}.`;case"nonsense":return l?`That is not ${l.thing}.${f}`:t==="name"?`That is not a name. ${xs(u)}.`:t==="refine"?`That does not say what should change. ${xs(u)}.`:t==="detail"?`That does not say what it looks like. ${xs(u)}.`:`That does not describe anyone. ${xs(u)}.`;case"greeting":return n?`Still here.${f}`:/^(hi|hello|hey|heya|hiya|yo|hola|shalom|good)\b/i.test(r.trim())?`Hi.${f}`:`${xs(u)}.`;case"ack":return n?`Still here.${f}`:i?"Go ahead.":`Go ahead: ${u}.`;case"vague":return n?`Still here. ${xs(u)}.`:`${xs(u)}.`}}const yle=e=>e.trim().replace(/[.\s]+$/,""),ab=e=>e?e==="portrait"?"Everything else you had is kept.":"The face and everything else you had are kept.":"Everything you had is kept.";function H2(e,t,n=ab(null)){const r=uo(t);if(r.kind==="unknown")return{text:`${e}: ${yle(t)}. ${n}`};const a=r.remedy??(r.retryable?void 0:{label:"Providers",opens:"engines"});return{text:`${e}. ${r.fix?`${r.title} ${r.fix}`:r.title}`,remedy:a}}const gv=e=>e&&OM.includes(e)?[{id:"skip-extras",label:"Not now"}]:[];function OT(e,t=[]){return{id:"retry",kind:"confirm",tone:"alert",prompt:e.text,options:[...e.remedy?[{id:`remedy:${e.remedy.opens}`,label:e.remedy.label}]:[],{id:"retry",label:"Retry"},...t]}}function Gh(e,t){const n=e==="portrait"?"face":xn[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"},...gv(e)]}:OT(H2(`The ${n} could not be drawn`,t,ab(e)),gv(e))}function ble(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 xle(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 kle=e=>e.charAt(0).toUpperCase()+e.slice(1);function Sle({draft:e,ui:t,afterCoverage:n,asides:r,openId:a,placed:i}){var re;const l=[],u=(ee,q,ie)=>l.push({kind:"scenri",id:ee,text:q,tone:ie}),f=ee=>l.push({kind:"question",question:ee}),h=((re=e.name)==null?void 0:re.trim())??"",p=h||"them",g=()=>{h&&(l.push({kind:"scenri",id:"asked-name",text:qn.name,quiet:!0}),l.push({kind:"you",id:"name",text:h,editable:!0,editing:t.editingName||void 0}))},m=()=>f({id:"name",kind:"text",prompt:qn.name}),w=(ee,q=[])=>t.failedView?Gh(t.failedView,ee):OT(H2("That did not go through",ee),q),y=()=>{h||m()};if(e.stage==="analyzing")return u("reading",`Reading ${TT(e.source)}.`),h?g():m(),l;const b=DY(e);b&&u("coverage",b.text,b.tone),l.push(...n);const S=e.views.portrait,k=e.activeView,C=e.asks??[],E=C[C.length-1],A=E?e.views[E.view]:null,L=!!E&&!!A&&(A.status==="generating"&&e.activeView===E.view||A.status==="candidate"&&A.adjustment===E.text||!!A.error),$=ee=>ee==="portrait"&&!hi(e)?qn.identity(p):qn.change,N=(e.results??[]).filter(ee=>ee.how!=="restored"),j=e.decisions??[],P=!e.activeView&&e.stage==="idle",R=new Map,H=new Map,D=new Map;for(const ee of N){const q=`${ee.view}:${ee.hash}`;if(D.set(q,ee),R.has(q))continue;const ie=(H.get(ee.view)??0)+1;H.set(ee.view,ie),R.set(q,ie)}const U=ee=>R.get(`${ee.view}:${ee.hash}`)??1,_=(ee,q)=>{const ie=U(ee),Oe=e.views[ee.view].hash===ee.hash,ae=(H.get(ee.view)??0)>1;return{kind:"scenri",id:q,text:`Here is ${xn[ee.view]} ${ie}.`,thumb:ee.hash,view:ee.view,label:`${Dc[ee.view]} ${ie}`,current:ae&&Oe&&D.get(`${ee.view}:${ee.hash}`)===ee,restore:P&&!Oe&&!Xw(e,ee.view)?{view:ee.view,hash:ee.hash}:void 0}},B=new Set,K=new Map(C.map(ee=>{const q=N.find(ie=>!B.has(ie)&&ie.how==="drawn"&&ie.view===ee.view&&ie.ask===ee.text&&ie.at>=ee.at);return q&&B.add(q),[ee,q]})),V=new Map;for(const ee of j)ee.what==="use"&&!V.has(ee.view)&&V.set(ee.view,ee);const O=ee=>ee==="portrait"?`Here is ${p} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${xn[ee]}. Use it, or keep the previous one.`,I=ee=>{const q=ee===V.get(ee.view),ie=ee.view==="portrait"&&q,Oe=ee.what==="again"?"Try again":ee.what==="keep"?"Keep previous":ie?"Use this person":ee.view==="portrait"?"Use this":"Use it";return[{kind:"scenri",id:`asked-decided-${ee.at}`,text:ie?qn.identity(p):q?qn.landed(xn[ee.view]):O(ee.view),quiet:!0},{kind:"you",id:`decided-${ee.at}`,text:Oe,editable:!1}]},Y=()=>{const ee=L?C.slice(0,-1):C,q=xle(e),ie=r.filter(pe=>!i.has(pe)&&(pe.q!==a||pe.at<=q));for(const pe of ie)i.add(pe);const Oe=N.find(pe=>OM.includes(pe.view)),ae=[...ee.map(pe=>{const Te=K.get(pe);return{at:pe.at,turns:[{kind:"scenri",id:`asked-ask-${pe.at}`,text:$(pe.view),quiet:!0},{kind:"you",id:`ask-${pe.at}`,text:pe.text,editable:!1},...Te?[_(Te,`redrew-${pe.at}`)]:[]]}}),...N.filter(pe=>!B.has(pe)).map(pe=>({at:pe.at,turns:[_(pe,`result-${pe.at}`)]})),...j.map(pe=>({at:pe.at,turns:I(pe)})),...ie.map(pe=>({at:pe.at,turns:Ci(pe)})),...hi(e)&&(e.extras||t.extrasDeclined)?[{at:Oe?Oe.at.slice(0,-1):"~",turns:[{kind:"scenri",id:"asked-extras",text:qn.extras,quiet:!0},{kind:"you",id:"extras",text:e.extras?"Add them":"Not now",editable:!1}]}]:[]];ae.sort((pe,Te)=>pe.at<Te.at?-1:pe.at>Te.at?1:0);for(const pe of ae)l.push(...pe.turns)},Z=()=>{!L||!E||(l.push({kind:"scenri",id:`asked-ask-${E.at}`,text:$(E.view),quiet:!0}),l.push({kind:"you",id:`ask-${E.at}`,text:E.text,editable:!1}))};if(!hi(e)){const ee=S.status==="generating"||k==="portrait"&&S.status!=="candidate";return ee&&!C.length?(u("drawing-face","Drawing their face."),h?g():m(),l):(g(),Y(),ee?(Z(),u("drawing-face",L?"Adjusting the face. Everything else stays.":"Drawing their face."),h||m(),l):t.failed?(y(),f(w(t.failed)),l):S.error?(y(),Z(),f(Gh("portrait",S.error)),l):(S.status==="candidate"&&(y(),Z(),f({id:"identity",kind:"confirm",prompt:L?"Adjusted. Use this person, or try again.":qn.identity(p),hint:N7("portrait",e.keepItems),options:[{id:"use",label:"Use this person"},{id:"again",label:"Try again"}],describe:"Change something"})),l))}g(),Y();const X=Object.keys(e.views),z=fi(e),J=[...z].reverse().find(ee=>P4.has(ee)),he=z.find(ee=>!P4.has(ee)),te=X.find(ee=>e.views[ee].status==="candidate"),me=z.find(ee=>!!e.views[ee].error);if(t.failed&&!k)return y(),f(w(t.failed,gv(s2(e)))),l;if(k)return Z(),u(`drawing-${k}`,L&&(E==null?void 0:E.view)===k?`Redrawing the ${xn[k]}.`:k===J&&!e.views[k].hash?`Drawing the ${xn[k]} from this face.`:k===he&&!e.views[k].hash&&J?`Building the rest of the set from the ${xn[J]}.`:`Drawing the ${xn[k]}.`),h||m(),l;if(te){y(),Z();const ee=e.views[te],q=!!ee.prior,ie=ae=>ae?R.get(`${te}:${ae}`)??0:0,Oe=!!ee.hash&&!!ee.prior&&ie(ee.hash)<ie(ee.prior);if(ee.error){const ae=Gh(te,ee.error);u(`failed-${te}`,ae.prompt,ee.error==="cancelled"?void 0:"alert")}return ee.hash&&l.push({kind:"scenri",id:`candidate-${te}-${ee.hash}`,text:Oe?`Here is ${xn[te]} ${ie(ee.hash)} again.`:ee.error?`Here is the ${xn[te]} as it is.`:q?te==="portrait"?`Here is ${p} with the change.`:`Redrew the ${xn[te]}.`:`Here is the ${xn[te]}.`,thumb:ee.hash,label:Dc[te],view:te,current:!0}),f({id:te==="portrait"?"revision":"view-revision",kind:"confirm",prompt:q?te==="portrait"?`Use this, or keep the previous one.${HY(e,te)?" Using it redraws the views built on the face.":""}`:"Use it, or keep the previous one.":"Use it, or try again.",hint:te==="portrait"||te==="front"?N7(te,e.keepItems):void 0,options:[{id:"use",label:te==="portrait"?"Use this":"Use it"},...q?[{id:"keep",label:"Keep previous"}]:[],{id:"again",label:"Try again"}]}),l}return me?(y(),Z(),f(Gh(me,e.views[me].error??"")),l):wY(e)?!e.extras&&!t.extrasDeclined?(y(),u("set-ready","The set is ready. Select a view and say what is wrong to redraw it."),f({id:"extras",kind:"confirm",prompt:qn.extras,noEnter:!0,options:[{id:"add",label:"Add them"},{id:"save",label:"Not now"}]}),l):h?(f({id:"save",kind:"confirm",prompt:`${kle(p)} is ready.${ble(e)}`,options:[{id:"save",label:"Save person"}]}),l):(m(),l):(h||m(),l)}const Ele={who:{label:"Who",options:jT},age:{label:"Age",options:AT},build:{label:"Build",options:["slender","average","athletic","fuller"].map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}},lm=e=>e.charAt(0).toUpperCase()+e.slice(1);function Cle(e){return!e||e==="skipped"?"Draw as is":Object.values(e).map(t=>lm(t)).join(", ")}function jle(e){const t=e.map(n=>{var r;return((r=Ia(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 Ale=e=>Ite(e,$T,nle),IT=(e,t)=>e.trim().slice(0,t).trimEnd(),Nle=BP;function wf(e){return IT(Mle(e),Nle)}function Mle(e){var a;if(((a=e.source)==null?void 0:a.via)==="taps"){const i=yT(e),l=_c(i.who);return NT(l&&!ka(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 PY({steer:n.who??null,age:n.age??null},r)}function Rle(e){return O2(e).map(t=>t.words)}const Ple=jd,Lle=12;function O2(e){var i,l;const t=jie(e),n=(u,f,h)=>({id:u,words:IT(f,Ple),...h!=null&&h.length?{refs:h.slice(0,4)}:{}}),r=[];for(const u of bT(e.traits??[])){const f=t[u],h=f?pie(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,Lle)}function $7(e){const t=Rle(e);return t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Tle(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 $le(e,t,n,r){const a=r.toLowerCase().split(/[^a-z0-9]+/).filter(l=>l.length>2);if(!a.length)return!0;const i=wf({...e,[t]:n}).toLowerCase();return a.every(l=>i.includes(l))}function Dle(e){const t=im(e.setup??null);return t&&Object.keys(t.answers).length?{answers:t.answers,asides:t.asides,...t.extrasDeclined?{extrasDeclined:t.extrasDeclined}:{}}:{answers:Hle(e),asides:[]}}function Hle(e){const t=im(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},...D7(e)}:{source:{door:"scratch",via:"typed"},describe:e.direction??"",gaps:"skipped",traits:[],...D7(e)}}function D7(e){const t=e.keepItems??[];if(!t.length)return{};const n={},r=[];let a;for(const i of t){const l=Bd.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 FT=(e,t,n)=>({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,...n?{engine:n}:{}});function Ole(e,t,n){var a,i;if(e==="source")return t.kind==="choice"?{source:{door:t.id,via:"taps"}}:null;if(fr(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:Fc,...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:Bd.map(l=>l.id).filter(l=>t.picks[l])}:t.kind==="skip"?{traits:[]}:null;const r=fs(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 Ile(e,t){var r;return`the ${((r=Ia(e))==null?void 0:r.label.toLowerCase())??"detail"} in the attached ${t===1?"picture":"pictures"}`}const H7="A scar, a ring, anything we missed",Fle=new Set(["describe","keep"]),_le=new Set(["likeness","help","question","greeting","ack","nav","intent","go","nonsense"]);function O7(e,t){const n=(t==null?void 0:t.trim())??"";return e?n?`${e}, ${n}`:e:lm(n)}const Vle=/^(?:but|and|though|although|only|just|except(?: that)?|with|without|plus)\s+/i,I7=e=>Vle.test(e.trim());function C6(e){return e.trim().replace(/[.\s]+$/,"").replace(/^(?:but|and|though|although|only|just|except(?: that)?)\s+/i,"").trim()}function M1(e,t){if(!e)return!1;if(Fle.has(e))return!0;if(!fr(e)&&!fs(e))return!1;const n=t[e];return!!n&&!n.pick&&!!n.words}function Yh(e,t,n){const r=t.trim();return r?e==="look-age"&&CY(r)?null:e!=="look-who"&&(fr(e)||e.startsWith("trait-"))&&kY(r)?"nonsense":fr(e)||e.startsWith("trait-")||e==="keep"?zle(r,n):e==="describe"||e==="source"?oi(r,n):null:"vague"}function j6(e,t,n){if(e&&fr(e))return"look";if(e==="keep"||e!=null&&e.startsWith("trait-"))return"detail";const r=e??t;if(r&&fr(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 F7=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"]),Zle=/^[a-z]{1,10}\d+$/i,zle=(e,t)=>{const n=e.trim(),r=n.toLowerCase().replace(/[^a-z ]/g,"");if(F7.has(r)||F7.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=>Zle.test(l)))return"nonsense";const i=oi(e,t);return i&&_le.has(i)?i:null};function Ble(e,t){return e==="name"?"metadata":t?e==="source"||e==="photos"?"start-over":"redraw":"plain"}function _7(e,t,n,r){var f,h,p,g,m,w,y,b,S;const a=t.answers,i=r?{reopened:!0,cost:hle(wT(a,n).filter(k=>k!=="keep"&&A1(k)>A1(e)).length)}:{};switch(e){case"source":return{id:e,kind:"choice",prompt:qn.source,options:$T,given:(f=a.source)==null?void 0:f.door,...i};case"weakphotos":return{id:e,kind:"confirm",prompt:qn.weakPhotos,noEnter:!0,options:[{id:"again",label:"Use different photos"},{id:"anyway",label:"Draw from these anyway"}]};case"photos":{const k=a.photos??{hashes:[],attested:!1};return{id:e,kind:"photos",prompt:qn.photos,hint:dle(k.hashes.length,G0),hashes:k.hashes,max:G0,busy:t.uploading>0,attest:{text:DT(n.engine),checked:k.attested},submit:"Continue",back:"Describe someone instead"}}case"describe":return{id:e,kind:"text",prompt:qn.describe,starters:rle};case"gaps":{const k=eb(a.describe??"");return{id:e,kind:"choice",prompt:HT(k.length),groups:k.map(C=>({id:C,...Ele[C]})),submit:"Continue",skip:"Skip, draw as is",given:a.gaps&&a.gaps!=="skipped"?a.gaps:void 0,...i}}case"traits":{const k=((h=a.source)==null?void 0:h.door)==="photos";return{id:e,kind:"choice",prompt:k?qn.traitsPhotos:qn.traits,multi:!0,options:Bd.map(C=>({id:C.id,label:C.label})),submit:"Continue",skip:k?"Nothing to add":"Nothing else",given:a.traits,...i}}case"keep":return{id:e,kind:"text",prompt:qn.keep}}if(fr(e)){const k=e.slice(5),{row:C,prompt:E}=vf[k],A=_ie((p=a["look-who"])==null?void 0:p.pick),L=Vie.has(k)?{...C,options:C.options.map($=>$.card?{...$,card:`${$.card}-${A}`}:$)}:C;return{id:e,kind:"swatches",prompt:E,hint:k==="who"?qn.lookHint:void 0,row:L,skip:"Skip",describe:k==="who"?"Describe them instead":void 0,saying:t.saying===e,given:((g=a[e])==null?void 0:g.pick)===Fc||(m=a[e])==null?void 0:m.pick,skipped:((w=a[e])==null?void 0:w.pick)===Fc,note:(y=a[e])==null?void 0:y.words,...i}}const l=fs(e),u=l?Ia(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(k=>({id:k.id,label:k.label})),saying:t.saying===e,given:(b=a[e])==null?void 0:b.pick,note:(S=a[e])==null?void 0:S.words,...i};if(l&&u){const k=a[`trait-${l.id}`];return{id:e,kind:"choice",prompt:u.ask,hint:u.hint,options:u.options.map(C=>({id:C.id,label:C.label,card:C.card})),attach:k!=null&&k.refs.length?"Replace the reference":"Add a reference",saying:t.saying===e,given:k==null?void 0:k.pick,note:k==null?void 0:k.words,...i}}return{id:e,kind:"text",prompt:""}}function A6(e,t){var a,i,l;switch(e){case"source":return qn.source;case"photos":return qn.photos;case"describe":return((a=t.source)==null?void 0:a.via)==="typed"?qn.source:qn.describe;case"gaps":return HT(eb(t.describe??"").length);case"traits":return((i=t.source)==null?void 0:i.door)==="photos"?qn.traitsPhotos:qn.traits;case"keep":return qn.keep}if(fr(e))return vf[e.slice(5)].prompt;const n=fs(e),r=n?Ia(n.id):void 0;return!n||!r?"":n.part==="where"?((l=r.where)==null?void 0:l.ask)??"":r.ask}function V7(e,t,n){var u,f,h,p,g,m,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:ule(y.length),photos:y}}case"describe":return{text:(t.describe??"").trim()};case"gaps":return{text:Cle(t.gaps)};case"traits":return{text:jle(bT(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(fr(e)){const y=e.slice(5);return{text:Bie(vf[y].row,t[e]??{})}}const r=fs(e),a=r?Ia(r.id):void 0;if(!r||!a)return{text:""};if(r.part==="where"){const y=t[e]??{},b=y.pick?((m=(g=a.where)==null?void 0:g.options.find(S=>S.id===y.pick))==null?void 0:m.label)??lm(y.pick):"";return{text:O7(b,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)??lm(i.pick):"";return{text:O7(l,i==null?void 0:i.words),photos:i!=null&&i.refs.length?i.refs:void 0}}function Ule(e){const t=e.state.asides,n=t.length?DP(Z7(e,[],null)):null;return Z7(e,t,n)}const _T=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,cm=(e,t)=>N1(e.editing)&&Wie(e.editing)===t.at;function Z7(e,t,n){const r=new Set,a=Wle(e,t,n,r),i=a.length&&a[a.length-1].kind==="question"?a.pop():null,l=t.filter(f=>!r.has(f)).sort(_T),u=e.state.unsure;for(const f of l)(!u||f.at<u.at)&&a.push(...Ci(f,cm(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:fle,options:[{id:"use",label:"Use it anyway"}]}});for(const f of l)f.at>=u.at&&a.push(...Ci(f,cm(e.state,f)))}return a}function Wle({state:e,draft:t,canGenerate:n,engine:r,failed:a,failedView:i,awaiting:l},u,f,h){var P,R,H,D,U,_;const p=FT(t,n,r),g=e.answers,m=[{kind:"you",id:"intent",text:"Create a person"}],w=[],y=((P=g.source)==null?void 0:P.door)==="photos",b=(B,K,V=!1)=>{const O=u.filter(I=>!h.has(I)&&!!I.q&&I.q!==f&&K.includes(I.q)&&!!I.after===V).sort(_T);for(const I of O)h.add(I),B.push(...Ci(I,cm(e,I)))},S=B=>u.find(K=>K.edit&&K.q===B&&!h.has(K)),k=(B,K,V=!0)=>{var I;if(B.push({kind:"scenri",id:`asked-${K}`,text:A6(K,g),quiet:!0}),b(B,K==="describe"&&((I=g.source)==null?void 0:I.via)==="typed"?["source","describe"]:[K]),!V){const Y=S(K);Y&&(h.add(Y),B.push({kind:"you",id:K,text:Y.said}),B.push(...Ci(Y,cm(e,Y),!0))),b(B,[K],!0);return}const O=V7(K,g,t);B.push({kind:"you",id:K,text:O.text,photos:O.photos,editable:!0,editing:e.editing===K&&M1(K,g)||void 0}),b(B,[K],!0)},C=new Set(wT(g,p)),E=Eie.filter(B=>C.has(B)||u.some(K=>K.edit&&K.q===B));for(const B of E){const K=y&&t&&B!=="source"&&B!=="photos"?w:m;if(e.editing===B&&!M1(B,g)){K.push({kind:"scenri",id:`asked-${B}`,text:A6(B,g),quiet:!0}),b(K,[B]),K.push({kind:"question",question:_7(B,e,p,!0)}),b(K,[B],!0);continue}B==="source"&&((R=g.source)==null?void 0:R.via)==="typed"||k(K,B,C.has(B))}let A=null;const L=((H=g.source)==null?void 0:H.door)==="photos"&&e.held&&!t,$=!n&&(t?!!Yw(t):((D=g.source)==null?void 0:D.door)==="scratch"||L)&&!(t&&e.editing);if(L&&!n&&((U=g.photos)!=null&&U.hashes.length)&&(m.push({kind:"scenri",id:"asked-photos",text:A6("photos",g),quiet:!0}),m.push({kind:"you",id:"photos",...V7("photos",g,null)})),$)A={id:"noengine",kind:"confirm",quiet:!0,prompt:qn.noEngine,options:[{id:"setup",label:"Set up"},...L?[{id:"change",label:"Change photos"}]:[]]};else{const B=D2(g,p);B?A=_7(B,e,p,!1):!t&&((_=g.source)==null?void 0:_.door)==="scratch"&&(g.source.via==="taps"||e.held?A={id:"agree",kind:"confirm",prompt:qn.agree,quote:g.source.via==="taps"?`${Uie(yT(g))}${$7(g)?`, and always ${$7(g)}`:""}.`:wf(g),options:[{id:"draw",label:"Draw the person"}]}:a&&(A={id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${a}. Nothing was drawn.`,options:[{id:"retry",label:"Retry"}]}))}if(l&&(A=null),!t)return A&&m.push({kind:"question",question:A}),m;const N=Sle({draft:t,ui:{extrasDeclined:e.extrasDeclined,failed:a,failedView:i,editingName:e.editing==="name"},afterCoverage:w,asides:u,openId:f,placed:h}),j=[...m,...A?N.filter(B=>B.kind!=="question"):N];return A&&j.push({kind:"question",question:A}),j}function VT(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question;if(!Kp(n))return null}return null}function Kle(e,t,n){return e.some(r=>r.kind==="scenri"&&(r.id==="reading"||r.id.startsWith("drawing-")))?!1:(t==null?void 0:t.stage)==="analyzing"?`Reading ${TT(t.source)}`:t!=null&&t.activeView?"Drawing":n}const Jo={placeholder:"Nothing to type yet",label:"Message",action:"Send"},z7=(e,t)=>({placeholder:t?Fie[e]??"In your words":R7.has(e)?"Tap a swatch above, or say the colour":"Pick one above, or describe it",label:"Describe it",action:"Send",color:R7.has(e)});function B7(e,t){const n=fs(e),r=n?Ia(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"?"Pick one above, or say where it is":`Pick 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 ZT(e,t,n){var a;const r=e.trim();return!!t&&!((a=t.name)!=null&&a.trim())&&n!=="name"&&/^[A-Z][a-z]+(?:\s[A-Z][a-z]+)?$/.test(r)&&!ka(r)}function Gle(e,t,n,r){const a=Yle(e,t,n,r);return a.action==="Refine"&&!a.off&&ZT(t.text,n,(e==null?void 0:e.id)??null)?{...a,label:"Their name",action:"Send"}:a}function Yle(e,t,n,r){if(t.editing!==null&&(t.editing==="name"||N1(t.editing)||M1(t.editing,t.answers)))return{...Jo,off:"Finish the change above."};if(t.saying==="keep")return{placeholder:H7,label:"What should stay the same about them",action:"Send"};if(t.saying&&fr(t.saying))return z7(t.saying.slice(5),!0);if(t.saying)return B7(t.saying,!0);if(t.editing!==null)return{...Jo,off:"Finish the change above."};if(e){if(fr(e.id))return z7(e.id.slice(5),!1);if(e.id.startsWith("trait-"))return B7(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:H7,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:"Pick one above, or say it in your own words",label:"Fill in what is missing",action:"Send"};case"photos":return{...Jo,off:"Add their photos above."};case"noengine":return{...Jo,off:"Set up image generation above."};case"retry":return{...Jo,off:"Retry above."}}}return n?n.stage==="analyzing"?{...Jo,off:`Reading ${n.source==="photos"?"the photos":"the face"}.`}:Hc(n)?hi(n)?{placeholder:U7(r,n),label:"What should change",action:"Refine",off:""}:{...Jo,off:""}:hi(n)?{placeholder:U7(r,n),label:"What should change",action:"Refine"}:{...Jo,off:"The face comes first."}:{...Jo,off:"Starting the draft."}}function U7(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: ${xn[e]}`}function W7(e,t){return e.saying?e.saying:t&&sa(t.id)&&(t.id==="source"||t.id==="describe")||t&&sa(t.id)&&(fr(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 qle=/\b(here|in this (view|one|picture|image|frame)|this (view|one|picture|image|frame))\b/i,Xle=/\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,Qle=/\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,Jle=/\b(simpler|plainer|plain|neutral|cleaner|tidier)\b/i,ece=/\b(outfit|clothes|clothing|top|wardrobe|wearing)\b/i;function zT(e,t,n){const r=e.trim();if(!r)return{blocked:"Say what should change."};if(Qle.test(r)&&!(Jle.test(r)&&ece.test(r)))return{scope:"out-of-scope"};const a=ZM.test(r),i=Xle.test(r),l=qle.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 ${xn[t]} yet.`}:{scope:"view",view:t}}const BT=e=>`Use Create for wardrobe, products and places. Edits here change who ${e} is.`;function tce(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=zT(a,t,n);return"blocked"in l?{chip:null,hint:l.blocked,tone:"alert"}:l.scope==="out-of-scope"?{chip:null,hint:BT(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 ${xn[l.view]}`},hint:"Changes this view only. Hair, skin, age or build change the person."}}const nce=e=>e.replace(/^asset:/,"");function ob(e,t){if((e.identityEdits??[]).join(`
|
|
107
|
+
`)!==(t.identityEdits??[]).join(`
|
|
108
|
+
`))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??"",nce(i.file)]));for(const i of fi(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}function K7(e,t){var n,r;return!ob(e,t)&&!e.activeView&&e.stage==="idle"&&!((n=e.asks)!=null&&n.length)&&(e.results??[]).every(a=>{var i;return((i=e.views[a.view])==null?void 0:i.hash)===a.hash})&&!((r=e.decisions)!=null&&r.length)}const G7=(e,t)=>t==="cancelled"?{text:`Stopped drawing the ${xn[e]}. Nothing finished was touched.`,stopped:!0}:{...H2(`The ${xn[e]} could not be drawn`,t,ab(e)),stopped:!1},rce=e=>vY.filter(t=>e.views[t].status==="empty"&&t!=="portrait"),sce=e=>e.length<=2?e.map(t=>xn[t]).join(" and "):`${e.slice(0,-1).map(t=>xn[t]).join(", ")} and ${xn[e[e.length-1]]}`,ace={building:!1,buildDeclined:!1,scopeAsk:null,failed:null,conflict:null},oce="Say what should change: hair, age or build change the person; anything else changes the view on the stage.",ice="Still here. Select a view and say what is wrong with it, or say what should change about them.";function lce(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?ice:oce}}const gc={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 cce(e){const t=e.ui.asides??[],n=t.length?DP(Y7(e,[],null)):null;return Y7(e,t,n)}function Y7({draft:e,base:t,name:n,selected:r,canGenerate:a,ui:i},l,u){var ee;const f=[{kind:"scenri",id:"opening",text:gc.opening(n)}],h=new Set,p=()=>{for(const q of l)h.has(q)||f.push(...Ci(q));return f},g=(q,ie,Oe)=>{Oe&&f.push({kind:"scenri",id:`asked-${q}`,text:Oe}),f.push({kind:"you",id:q,text:ie,editable:!1})},m=(q,ie,Oe)=>f.push({kind:"scenri",id:q,text:ie,tone:Oe}),w=q=>f.push({kind:"question",question:q});if(!e)return p();const y=rce(e),b=e.source!=="synthetic"||!!((ee=e.direction)!=null&&ee.trim()),S=fi(e).some(q=>e.views[q].status==="candidate");if(y.length&&b&&!S&&!i.building&&!i.buildDeclined&&!Hc(e)&&a){const q=fi(e).filter(ie=>e.views[ie].status==="approved").length;return w({id:"legacy",kind:"confirm",prompt:`${n} has ${q===1?"one reference":`${q} references`}. Build the ${sce(y)} from it?`,options:[{id:"build",label:"Build them"},{id:"not",label:"Not now"}]}),p()}const k=fi(e),C=e.activeView,E=k.find(q=>e.views[q].status==="candidate"),A=k.find(q=>!!e.views[q].error),L=(t==null?void 0:t.identityEdits)??[];(e.identityEdits??[]).filter(q=>!L.includes(q)).forEach((q,ie)=>{g(`edit-${ie}`,q,gc.change),m(`changed-${ie}`,`Changed ${n}. The views built on the face were redrawn.`)});const N=e.asks??[],j=N[N.length-1],P=j?e.views[j.view]:null,R=!!j&&!!P&&(P.status==="generating"&&e.activeView===j.view||P.status==="candidate"&&P.adjustment===j.text||!!P.error),H=new Set((e.identityEdits??[]).map(q=>q.toLowerCase())),D=(R?N.slice(0,-1):N).filter(q=>!(q.view==="portrait"&&H.has(q.text.replace(/\s+/g," ").toLowerCase()))),U=[...N,...e.results??[],...e.decisions??[]].map(q=>q.at).reduce((q,ie)=>ie>q?ie:q,""),_=l.filter(q=>!h.has(q)&&(q.q!==u||q.at<=U));for(const q of _)h.add(q);const B=(e.results??[]).filter(q=>q.how!=="restored"),K=!e.activeView&&e.stage==="idle",V=new Map,O=new Map,I=new Map;for(const q of B){const ie=`${q.view}:${q.hash}`;if(I.set(ie,q),V.has(ie))continue;const Oe=(O.get(q.view)??0)+1;O.set(q.view,Oe),V.set(ie,Oe)}const Y=q=>V.get(`${q.view}:${q.hash}`)??1,Z=(q,ie)=>{const Oe=Y(q),ae=e.views[q.view].hash===q.hash,pe=(O.get(q.view)??0)>1;return{kind:"scenri",id:ie,text:`Here is ${xn[q.view]} ${Oe}.`,thumb:q.hash,view:q.view,label:`${Dc[q.view]} ${Oe}`,current:pe&&ae&&I.get(`${q.view}:${q.hash}`)===q,restore:K&&!ae?{view:q.view,hash:q.hash}:void 0}},X=new Set,z=new Map(N.map(q=>{const ie=B.find(Oe=>!X.has(Oe)&&Oe.how==="drawn"&&Oe.view===q.view&&Oe.ask===q.text&&Oe.at>=q.at);return ie&&X.add(ie),[q,ie]})),J=(e.decisions??[]).filter(q=>!(q.view==="portrait"&&q.what==="use")),he=q=>[{kind:"scenri",id:`asked-decided-${q.at}`,text:q.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 ${xn[q.view]}. Use it, or keep the previous one.`},{kind:"you",id:`decided-${q.at}`,text:q.what==="again"?"Try again":q.what==="keep"?"Keep previous":"Use it",editable:!1}],te=[...D.map(q=>{const ie=z.get(q);return{at:q.at,turns:[{kind:"scenri",id:`asked-ask-${q.at}`,text:gc.change},{kind:"you",id:`ask-${q.at}`,text:q.text,editable:!1},...ie?[Z(ie,`redrew-${q.at}`)]:[]]}}),...B.filter(q=>!X.has(q)).map(q=>({at:q.at,turns:[Z(q,`result-${q.at}`)]})),...J.map(q=>({at:q.at,turns:he(q)})),..._.map(q=>({at:q.at,turns:Ci(q)}))];te.sort((q,ie)=>q.at<ie.at?-1:q.at>ie.at?1:0);for(const q of te)f.push(...q.turns);if(i.scopeAsk)return g("scope-ask",i.scopeAsk.said),w({id:"scope",kind:"choice",prompt:gc.scope,options:[{id:"view",label:`This view (the ${xn[r]})`},{id:"identity",label:"The person"}]}),p();const me=()=>{R&&j&&g(`ask-${j.at}`,j.text,gc.change)};if(C){const q=e.views[C];return me(),m(`drawing-${C}`,R&&(j==null?void 0:j.view)===C?C==="portrait"?`Changing ${n}. Everything else stays.`:`Redrawing the ${xn[C]}.`:q.status==="stale"||k.some(ie=>e.views[ie].status==="stale")?`Redrawing the views built on the face. The ${xn[C]} first.`:`Drawing the ${xn[C]}.`),p()}if(E){me();const q=e.views[E];if(q.error){const ie=G7(E,q.error);m(`failed-${E}`,ie.text,ie.stopped?void 0:"alert")}return q.hash&&f.push({kind:"scenri",id:`candidate-${E}-${q.hash}`,text:q.error?`Here is the ${xn[E]} as it is.`:E==="portrait"?`Here is ${n} with the change.`:`Redrew the ${xn[E]}.`,thumb:q.hash,label:Dc[E],view:E,current:!0}),w({id:E==="portrait"?"revision":"view-revision",kind:"confirm",prompt:E==="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:E==="portrait"?"Use this":"Use it"},{id:"keep",label:"Keep previous"},{id:"again",label:"Try again"}]}),p()}if(i.failed||A){me();const q=A?G7(A,e.views[A].error??""):{...H2("That did not go through",i.failed??""),stopped:!1};return w({id:"retry",kind:"confirm",...q.stopped?{quiet:!0}:{tone:"alert"},prompt:q.text,options:[...q.remedy?[{id:`remedy:${q.remedy.opens}`,label:q.remedy.label}]:[],{id:"retry",label:q.stopped?"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 re=k.find(q=>e.views[q].status==="stale");return re?(m(`drawing-${re}`,`Redrawing the views built on the face. The ${xn[re]} first.`),p()):(t&&ob(e,t)&&w({id:"save",kind:"confirm",prompt:`The set is coherent. ${gc.saved}`,options:[{id:"save",label:"Save changes"}]}),p())}function uce(e,t,n){return!(!n||t.id!==n||e&&e.id===t.id&&t.updatedAt<e.updatedAt)}function UT(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(null),[f,h]=s.useState(null),[p,g]=s.useState(!1),{poke:m}=ua(),w=s.useRef(!0);s.useEffect(()=>(w.current=!0,()=>{w.current=!1}),[]);const y=s.useRef(t);y.current=t;const b=s.useCallback(K=>{w.current&&r(V=>uce(V,K,y.current)?K:V)},[]),S=s.useRef(!1);s.useEffect(()=>{r(null),i(!1),u(null),S.current=!1,g(!1)},[t]);const k=s.useCallback(async()=>{if(!t)return;const K=t;try{b(await Ee.presenterDraft(e,K)),S.current&&w.current&&y.current===K&&(S.current=!1,u(null))}catch(V){if(!w.current||y.current!==K)return;/HTTP 404|not found/i.test(String((V==null?void 0:V.message)??V))?i(!0):(S.current=!0,h(null),u(String((V==null?void 0:V.message)??V)))}},[e,t,b]);s.useEffect(()=>{k()},[k]);const C=!!n&&(n.stage!=="idle"||!!n.activeView);s.useEffect(()=>{if(!C)return;const K=setInterval(()=>void k(),1500);return()=>clearInterval(K)},[C,k]);const E=s.useCallback(async(K,V=null)=>{const O=y.current;g(!0),u(null),S.current=!1;try{return b(await K()),m(),!0}catch(I){return!w.current||y.current!==O?!1:(I==null?void 0:I.status)===409?(k(),!1):(S.current=!1,h(V),u(String((I==null?void 0:I.message)??I)),!1)}finally{w.current&&g(!1)}},[b,k,m]),A=s.useCallback((K,V,O)=>E(async()=>(await Ee.generateDraftView(e,t??"",K,{...V?{adjustment:V}:{},...O?{decide:O}:{}})).draft,K),[E,e,t]),L=s.useCallback(K=>E(()=>Ee.approveDraftView(e,t??"",K)),[E,e,t]),$=s.useCallback(K=>E(()=>Ee.redoDraftView(e,t??"",K)),[E,e,t]),N=s.useRef(!1),j=s.useCallback(async K=>{if(N.current)return!1;N.current=!0;try{return await E(K)}finally{N.current=!1}},[E]),P=s.useCallback(K=>j(()=>Ee.revertDraftView(e,t??"",K)),[j,e,t]),[R,H]=s.useState(!1),D=s.useCallback(async()=>{H(!0);try{return await E(()=>Ee.stopDraft(e,t??""))}finally{w.current&&H(!1)}},[E,e,t]),U=s.useCallback((K,V)=>j(()=>Ee.restoreDraftView(e,t??"",K,V)),[j,e,t]),_=s.useCallback(K=>E(()=>Ee.updatePresenterDraft(e,t??"",K)),[E,e,t]),B=s.useCallback(()=>{S.current=!1,u(null)},[]);return{draft:n,gone:a,err:l,errView:f,busy:p,drawing:C,reload:k,generate:A,approve:L,redo:$,revert:P,stop:D,stopping:R,restore:U,update:_,clearErr:B}}function dce({presenterId:e,onLeave:t,caps:n}){var Re,se;const{brand:r}=un(),{applyBrand:a,refreshBrands:i}=Mn(),l=zl(),u=Zl(),f=Nr("setup").value,h=Nr("settings").value,p=!!f||!!h,g=!!(n!=null&&n.canGenerate),[m,w]=s.useState(null),[y,b]=s.useState(null),[S,k]=s.useState(ace),[C,E]=s.useState(""),[A,L]=s.useState(null),[$,N]=s.useState(!1),[j,P]=s.useState(null),[R,H]=s.useState(!1),[D,U]=s.useState(!1),_=s.useRef(new Set),B=(((Re=r.json)==null?void 0:Re.characters)??[]).find(G=>G.id===e),K=((se=B==null?void 0:B.name)==null?void 0:se.trim())||"them",V=B?{shots:B.shots??[],identityEdits:B.identityEdits??[]}:null;s.useEffect(()=>{let G=!0;return w(null),b(null),Ee.editPresenter(r.id,e).then(oe=>{G&&w(oe.id)}).catch(oe=>{G&&b(String((oe==null?void 0:oe.message)??oe))}),()=>{G=!1}},[r.id,e]);const O=UT(r.id,m),I=O.draft,Y=I?`presenter-edit:${r.id}:${e}:${I.id}`:void 0,Z=!0;s.useEffect(()=>{if(!I||O.busy||!g||O.err)return;const G=Yw(I);if(!G||I.views[G].status==="empty"&&!S.building)return;const oe=`${G}:${I.views[G].attempts}:${I.generations}:${I.views[G].status}`;_.current.has(oe)||(_.current.add(oe),O.generate(G,void 0,ti(G)))},[I,O.busy,O.generate,g,O.err,S.building]);const X=I?FM(I,A):"portrait",z=I?I.views[X]:null,J=!!I&&(I.activeView===X||I.stage==="analyzing"),he=!!I&&!I.activeView&&I.stage==="idle",te=O.err&&I&&!I.activeView?O.err:null,me=s.useMemo(()=>cce({draft:I,base:V,name:K,selected:X,canGenerate:g,ui:{...S,failed:te}}),[I,V,K,X,g,S,te]),re=VT(me),ee=!!I&&!!V&&ob(I,V),q=!!I&&!!V&&K7(I,V),ie=s.useCallback(G=>{Y&&hl(Y),t(G)},[Y,t]),Oe=s.useCallback(async()=>{if(!(!I||R)){H(!0),P(null);try{const G=await Ee.savePresenterDraft(r.id,I.id);ie(G.presenter.id),a(G.brand)}catch(G){H(!1);const oe=String((G==null?void 0:G.message)??G);/changed elsewhere|HTTP 409/i.test(oe)?k(Ne=>({...Ne,conflict:oe})):P(oe)}}},[I,R,r.id,a,ie]),ae=s.useCallback(async()=>{U(!0);try{I&&await Ee.deletePresenterDraft(r.id,I.id)}catch{}ie(e)},[I,r.id,e,ie]),pe=s.useCallback(async()=>{if(!(!I||!V)){U(!0);try{K7(await Ee.presenterDraft(r.id,I.id),V)&&await Ee.deletePresenterDraft(r.id,I.id)}catch{}ie(e)}},[I,V,r.id,e,ie]),Te=s.useCallback(async()=>{U(!0);try{const G=await Ee.revertPresenter(r.id,e);I&&await Ee.deletePresenterDraft(r.id,I.id).catch(()=>{}),ie(G.presenter.id),a(G.brand)}catch(G){U(!1),P(String((G==null?void 0:G.message)??G))}},[r.id,e,I,a,ie]),gt=s.useCallback((G,oe)=>{var Ne;if(P(null),!!I)switch(G){case"legacy":if(oe.kind!=="confirm")return;k(Ue=>({...Ue,building:oe.id==="build",buildDeclined:oe.id!=="build"}));return;case"scope":{if(oe.kind!=="choice")return;const Ue=((Ne=S.scopeAsk)==null?void 0:Ne.said)??"";k(st=>({...st,scopeAsk:null})),oe.id==="identity"?O.generate("portrait",Ue):O.generate(X,Ue,ti(X)),L(oe.id==="identity"?"portrait":X);return}case"revision":case"view-revision":{if(oe.kind!=="confirm")return;const Ue=Object.keys(I.views).find(st=>I.views[st].status==="candidate")??X;oe.id==="use"&&O.approve(Ue),oe.id==="keep"&&O.revert(Ue),oe.id==="again"&&O.generate(Ue,I.views[Ue].adjustment,ti(Ue)),N(!1);return}case"retry":{if(oe.kind==="confirm"&&oe.id.startsWith("remedy:")){const st=oe.id.slice(7);st==="setup"?l():u(st);return}if(O.err){O.clearErr(),_.current=new Set;return}const Ue=Object.keys(I.views).find(st=>!!I.views[st].error);Ue&&O.generate(Ue,I.views[Ue].adjustment,ti(Ue));return}case"conflict":k(Ue=>({...Ue,conflict:null})),U(!0),Promise.all([i(),Ee.deletePresenterDraft(r.id,I.id).catch(()=>{})]).finally(()=>ie(e));return;case"save":Oe();return}},[I,S.scopeAsk,O,X,Oe,i,ie,e,r.id,l,u]),Ze=s.useCallback(G=>{const oe=G.trim();if(!oe||!I)return!1;P(null);const Ne=(re==null?void 0:re.id)??null,Ue=Gp(),st=(ft,bt)=>({...ft,asides:[...ft.asides??[],{said:oe,reply:bt,q:Ne,at:Ue}]}),Pe=ft=>ft.scopeAsk?{...ft,scopeAsk:null,asides:[...ft.asides??[],{said:ft.scopeAsk.said,reply:gc.scope,q:"scope",at:ft.scopeAsk.at}]}:ft,Ie=oi(oe,ka);if(Ie&&Ie!=="vague")return k(ft=>st(ft,lce(Ie,K,(ft.asides??[]).some(bt=>bt.q===Ne)))),E(""),!0;if(!g)return P("Image generation is not set up, so nothing can be redrawn yet."),!1;const Ge=zT(oe,X,I);return"blocked"in Ge?(P(Ge.blocked),!1):Ge.scope==="out-of-scope"?(k(ft=>st(Pe(ft),BT(K))),E(""),!0):Ge.scope==="ambiguous"?(k(ft=>({...Pe(ft),scopeAsk:{said:oe,at:Ue}})),E(""),!0):(k(ft=>Pe(ft)),L(Ge.view),N(!1),O.generate(Ge.view,oe,Ge.scope==="view"?ti(Ge.view):void 0),E(""),!0)},[I,g,X,O,re==null?void 0:re.id,K]),tt=I?tce(C,X,I,K):null,De=tt?{chip:tt.chip?{label:tt.chip.label,thumb:I!=null&&I.views[tt.chip.view].hash?vn(I.views[tt.chip.view].hash,"micro"):void 0}:null,hint:tt.hint,tone:tt.tone}:null,Se=$&&(z!=null&&z.prior)?z.prior:z==null?void 0:z.hash,Q=I?(re==null?void 0:re.id)==="legacy"?"Decide above.":(re==null?void 0:re.id)==="conflict"?"Reload to continue.":(re==null?void 0:re.id)==="scope"?"Pick above.":(re==null?void 0:re.id)==="retry"?"Retry above.":I.stage==="analyzing"?"Reading the photos.":I.activeView?"":null:null,je=!!I;return{d:I,record:B,name:K,view:X,slot:z,dirty:ee,saving:R,leaving:D,openErr:y,canRevert:!!(B!=null&&B.revisionOf),discard:ae,revert:Te,closeUntouched:q?()=>void pe():null,keepPrevious:z&&z.status==="approved"&&z.prior&&!J&&!(I!=null&&I.activeView)&&(I==null?void 0:I.stage)==="idle"?()=>void O.revert(X):null,surface:{title:"Edit person",memoryKey:Y,resumed:Z,turns:me,busy:O.busy||R||D||p,stage:I?{hash:Se,alt:`${Dc[X]}${(z==null?void 0:z.status)==="candidate"?", candidate":""}`,drawing:J,since:BM(I),doing:UM(I),takes:Xw(I,X)?[]:KM(I,X),onTake:he?G=>{O.busy||O.restore(X,G)}:void 0,items:_M(I,X),onPick:G=>{L(G),N(!1)},compare:z&&z.status==="candidate"&&z.prior?{on:$,toggle:()=>N(G=>!G)}:void 0}:null,composer:je?{placeholder:X==="portrait"?`What should change about ${K}?`:`Change this view: ${xn[X]}`,label:"What should change",action:"Refine",scope:Q?null:De,hint:null,why:Q??void 0,error:j,disabled:O.busy||R||D||!!Q,working:!!(I!=null&&I.activeView),onStop:I!=null&&I.activeView?()=>void O.stop():void 0,stopping:O.stopping,focusKey:`${(re==null?void 0:re.id)??"open"}:${(I==null?void 0:I.id)??""}`}:null,text:C,onText:E,onSend:Ze,onAnswer:gt,onRestore:(G,oe)=>{O.busy||(L(G),O.restore(G,oe))}},setupNeeded:g?null:l}}function fce({onClose:e,...t}){const n=dce(t),r=o.jsxs(o.Fragment,{children:[n.canRevert&&o.jsx(Xn,{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(Xn,{label:"Discard changes",tone:"quiet",title:"Discard the changes?",body:"The views redrawn in this session are thrown away. The saved person stays as they were.",busy:n.leaving,onConfirm:()=>void n.discard()})]}),a=n.keepPrevious?o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,disabled:n.surface.busy,children:"Keep previous"})]}):n.openErr?o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n.openErr}):null;return o.jsx(Jy,{surface:{...n.surface,headAction:r,dock:a},onClose:n.closeUntouched??e})}function hce(){const{presenterId:e=""}=ia(),{brand:t}=un(),n=Un(),{caps:r}=fy();Xc("Edit person");const a=s.useRef(!1);s.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]);const[i]=s.useState(()=>iy(t,e)),l=s.useCallback(f=>{a.current&&n(La(t,f),{replace:!0})},[n,t]),u=s.useCallback(()=>n(La(t,e),{replace:!0}),[n,t,e]);return i!==e?o.jsx(Ta,{to:Jm(t,i),replace:!0}):o.jsx(fce,{presenterId:e,onLeave:l,onClose:u,caps:r})}function pce(e,t){return(t.source!=="synthetic"||(t.direction??"")===wf(e.answers))&&mce(t.keepItems,O2(e.answers))}function mce(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 gce(e,t){return{...t.source==="synthetic"?{direction:wf(e.answers)}:{},keepItems:O2(e.answers)}}const vce=e=>e.source==="photos"?e.views.front.hash?"front":null:e.views.portrait.hash?"portrait":null;function WT(e){if(!e.draftId)return!1;const t=e.draft;return t?e.seededFor!==t.id&&(!e.state.answers.source||!mv(e.state,e.ctx)):!0}function wce(e){const{state:t,draft:n,ctx:r}=e;if(e.busy||e.err)return[];if(n){if(WT(e))return[{kind:"seed",...Dle(n)}];if(!mv(t,r))return[];const i=[];pce(t,n)||i.push({kind:"sync",patch:gce(t,n),redo:vce(n)});const l=e.canDraw?Yw(n):null;return l&&i.push({kind:"draw",view:l,decide:ti(l)}),i}if(e.draftId)return[];if(!e.canDraw||!mv(t,r))return[];const a=t.answers.source;return(a==null?void 0:a.door)==="scratch"&&a.via!=="taps"&&!t.held?[{kind:"start"}]:[]}function yce(e){for(const t of wce(e))if(!e.done.has(KT(t,e)))return t;return null}function KT(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)}`;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 Du=(e,t)=>`scenri:presenter-setup:${e}:${t}`,al={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 q7(e,t){let n=al.read("scenri:tab");return n||(n=[...crypto.getRandomValues(new Uint8Array(6))].map(r=>r.toString(16).padStart(2,"0")).join(""),al.write("scenri:tab",n)),`${n}:${e}:${t}`}function bce(e,t){var r,a,i;const n=t==="keep"?"detail":((a=Ia(((r=fs(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 X7(e,t,n){const r=e.editing&&e.editing!=="name"?e.editing:e.saying??D2(e.answers,t);if(r==="keep"||!r&&n==="agree")return"keep";if(!r)return null;const a=fs(r);return a&&a.part==="what"?`trait-${a.id}`:null}function xce({draftId:e,convoKey:t,onOpenDraft:n,onLeaveDraft:r,onStarted:a,caps:i}){var Lt,Ut,Nt,_t;const{brand:l}=un(),{presenterCategories:u,applyBrand:f}=Mn(),h=zl(),p=Zl(),g=Nr("setup").value,m=Nr("settings").value,w=!!g||!!m,[y,b]=s.useState(!1);s.useEffect(()=>b(!1),[i]);const S=!!(i!=null&&i.canGenerate)&&!y,[k,C]=s.useReducer(Xie,{brandId:l.id,convoKey:t},Me=>{const Be=im(al.read(Du(Me.brandId,Me.convoKey)));return Be?{...om,answers:Be.answers,revision:Be.revision,asides:Be.asides,extrasDeclined:!!Be.extrasDeclined,held:!!Be.held}:om}),E=s.useRef(k);E.current=k;const A=Qie(k),L=Object.keys(k.answers).length>0||k.asides.length>0,$=s.useRef(t);s.useEffect(()=>{L?al.write(Du(l.id,t),A):al.remove(Du(l.id,t));const Me=$.current;$.current=t,Me!==t&&e&&t===e&&(al.remove(Du(l.id,Me)),hl(`presenter-create:${l.id}:${Me}`))},[l.id,t,e,A,L]);const N=s.useRef(null);s.useEffect(()=>{if(!e||N.current===A)return;const Me=setTimeout(()=>{N.current=A,Ee.updatePresenterDraft(l.id,e,{setup:A}).catch(()=>{N.current=null})},800);return()=>clearTimeout(Me)},[l.id,e,A]);const[j,P]=s.useState(null),[R,H]=s.useState(!1),[D,U]=s.useState(null),[_,B]=s.useState([]),[K,V]=s.useState(!1),[O,I]=s.useState(null),[Y,Z]=s.useState(!1),[X,z]=s.useState(null),[J,he]=s.useState(null),[te,me]=s.useState(0),[re,ee]=s.useState([]),q=s.useRef(new Map),[ie]=s.useState(()=>!!e||!!im(al.read(Du(l.id,t))));s.useEffect(()=>()=>{for(const Me of q.current.values())URL.revokeObjectURL(Me)},[]);const Oe=s.useRef(!1),ae=s.useRef(new Set),pe=s.useRef(!1),Te=s.useRef(null),gt=s.useRef(!1),Ze=s.useRef(!0);s.useEffect(()=>(Ze.current=!0,()=>{Ze.current=!1}),[]);const tt=s.useRef(new Set),De=s.useRef(0),Se=UT(l.id,e),Q=Se.draft,je=(i==null?void 0:i.engineName)??null,Re=s.useMemo(()=>FT(Q,S,je),[Q,S,je]);s.useEffect(()=>{ae.current=new Set,Oe.current=!1,B([]),N.current=null,e||(gt.current=!1)},[e]),s.useEffect(()=>{if(Oe.current||!Q)return;const Me=LY(Q,_);Me&&(Oe.current=!0,B(Me))},[Q,_]),s.useEffect(()=>{Se.gone&&r()},[Se.gone,r]);const se=s.useCallback(()=>{al.remove(Du(l.id,t)),hl(`presenter-create:${l.id}:${t}`)},[l.id,t]),G=s.useCallback(Me=>n(Me,!0),[n]),oe=s.useCallback(Me=>{if(!$M.test(Me)){U(Me);return}b(!0),C({type:"hold",held:!0})},[]),Ne=s.useCallback(async()=>{const Me=E.current;if(!S||Y)return;const Be=Me.revision;C({type:"hold",held:!1}),Z(!0),U(null);try{const Qe=O2(Me.answers),F=await Ee.createPresenterDraft(l.id,{source:"synthetic",direction:wf(Me.answers),...Qe.length?{keepItems:Qe}:{},clientKey:q7(t,Be)});if(E.current.revision!==Be||!Ze.current){Ee.deletePresenterDraft(l.id,F.id).catch(()=>{});return}G(F.id)}catch(Qe){oe(String((Qe==null?void 0:Qe.message)??Qe))}finally{Z(!1)}},[l.id,S,Y,G,t,oe]),Ue=s.useCallback(async()=>{const Me=E.current,Be=Me.answers.photos;if(!(Be!=null&&Be.hashes.length)||!Be.attested||Y)return;if(!S){C({type:"hold",held:!0});return}C({type:"hold",held:!1});const Qe=Me.revision;Z(!0),U(null);try{const F=await Ee.createPresenterDraft(l.id,{source:"photos",imageHashes:Be.hashes,attestation:!0,clientKey:q7(t,Qe)});if(E.current.revision!==Qe||!Ze.current){Ee.deletePresenterDraft(l.id,F.id).catch(()=>{});return}G(F.id)}catch(F){oe(String((F==null?void 0:F.message)??F))}finally{Z(!1)}},[l.id,S,Y,G,t,oe]),st=s.useCallback(async Me=>{U(null);const Be=()=>{var Ke;return((Ke=E.current.answers.photos)==null?void 0:Ke.hashes)??[]},Qe=Me.slice(0,Math.max(0,G0-Be().length-De.current));De.current+=Qe.length;const F=[];let de=0;C({type:"upload-begin"});try{for(const Ke of Qe){if(Ke.size>rk){F.push(ale(Ke.name,rk));continue}try{const Le=await p1(Ke);Be().includes(Le)&&(de+=1),C({type:"uploaded",hash:Le,max:G0})}catch{F.push(ole(Ke.name))}}}finally{De.current-=Qe.length,C({type:"upload-end"})}const ye=sle({over:Me.length-Qe.length,same:de,failed:F,max:G0});ye&&U(ye)},[]),Pe=s.useCallback(Me=>{C({type:"answer",patch:Me,ctx:Re}),!S&&Me.describe!==void 0&&C({type:"hold",held:!0})},[Re,S]),Ie=s.useCallback(async Me=>{const Be=Me??Q;if(!Be||K)return;const Qe=TY(Be,Be.name);if(Qe){I(Qe);return}V(!0),I(null);try{await Ee.updatePresenterDraft(l.id,Be.id,{facets:_});const F=await Ee.savePresenterDraft(l.id,Be.id);f(F.brand),se(),C({type:"start-over"}),a({kind:"presenter",id:F.presenter.id,name:F.presenter.name})}catch(F){V(!1),I(String((F==null?void 0:F.message)??F))}},[Q,K,S,l.id,_,se,a,f]),Ge=s.useCallback(async()=>{const Be=E.current.answers.describe||(Q==null?void 0:Q.direction)||"";gt.current=!!e,se(),C({type:"start-over",text:Be}),U(null),z(null),he(null),ae.current=new Set,Q&&!VM(Q)&&await Ee.deletePresenterDraft(l.id,Q.id).catch(()=>{}),r()},[Q,e,l.id,se,r]),ft=Q?Se.err&&!Hc(Q)?Se.err:null:D,bt=s.useMemo(()=>Ule({state:k,draft:Q,canGenerate:S,engine:je,failed:ft,failedView:Se.errView,awaiting:WT({state:k,draft:Q,ctx:Re,draftId:e,seededFor:Te.current})}),[k,Q,S,je,ft,Se.errView,e,Re]),at=VT(bt),Zt=s.useRef(null);Zt.current=(at==null?void 0:at.id)??null;const jt=Q?FM(Q,j):"portrait",Ft=Q?Q.views[jt]:null,Pt=!!Q&&(Q.activeView===jt||Q.stage==="analyzing"),$t=!!Q&&!Q.activeView&&Q.stage==="idle",ke={state:k,draft:Q,ctx:Re,canDraw:S,busy:Se.busy||Y||pe.current||gt.current||(Q?Hc(Q):!1),err:!!Se.err||!Q&&!!D,draftId:e,seededFor:Te.current,done:ae.current},Je=yce(ke),Et=s.useRef(Je);Et.current=Je;const Xe=Je?KT(Je,ke):"";s.useEffect(()=>{var Be;Q&&Te.current!==Q.id&&!ke.busy&&!ke.err&&((Be=Et.current)==null?void 0:Be.kind)!=="seed"&&(Te.current=Q.id);const Me=Et.current;if(!(!Me||ae.current.has(Xe)))switch(ae.current.add(Xe),Me.kind){case"seed":Te.current=(Q==null?void 0:Q.id)??null,C({type:"restore",answers:Me.answers,revision:E.current.revision+1,asides:Me.asides,extrasDeclined:Me.extrasDeclined});return;case"start":Ne();return;case"sync":pe.current=!0,(async()=>{if(!(await Se.update(Me.patch)||await Se.update(Me.patch))){ae.current.delete(Xe);return}Me.redo&&await Se.redo(Me.redo)})().finally(()=>{pe.current=!1});return;case"draw":Se.generate(Me.view,void 0,Me.decide);return}},[Xe,Q,Ne,Se.update,Se.redo,Se.generate]);const rt=s.useCallback((Me,Be,Qe,F,de=!1)=>{C({type:"aside",aside:{said:Me,reply:Be,q:Qe,at:Gp(),kind:F,...de?{edit:!0}:{}}})},[]),nt=s.useCallback((Me,Be)=>{U(null);const Qe=E.current;if(sa(Me)){if(Me==="weakphotos"&&Be.kind==="confirm"){Be.id==="again"&&Ge(),Be.id==="anyway"&&Pe({weakphotos:{pick:"anyway"}});return}const F=Ole(Me,Be,Qe.answers);if(F){const de=Qe.text.trim(),ye=F[Me],Ke=(fr(Me)||!!fs(Me))&&ye&&typeof ye=="object"&&!ye.words;Pe(Ke&&de?{...F,[Me]:{...ye,words:C6(de)}}:F);return}if(Me==="photos"&&Be.kind==="photos"){const de=Be.action;de.type==="add"&&st(de.files),de.type==="remove"&&C({type:"remove-photo",hash:de.hash}),de.type==="attest"&&C({type:"attest",checked:de.checked}),de.type==="reject"&&U("That was not an image. Drop a photo, or choose a file."),de.type==="submit"&&Ue(),de.type==="back"&&Pe({source:{door:"scratch",via:"taps"}})}return}switch(Me){case"unsure":{if(Be.kind!=="confirm"||Be.id!=="use"||!Qe.unsure)return;const F=Qe.unsure.said,de=Qe.unsure.q==="describe"?"describe":"source";C({type:"settle-unsure",ctx:Re}),Pe(de==="describe"?{describe:F}:{source:{door:"scratch",via:"typed"},describe:F});return}case"noengine":Be.kind==="confirm"&&Be.id==="setup"&&h(),Be.kind==="confirm"&&Be.id==="change"&&C({type:"hold",held:!1});return;case"agree":{if(Be.kind!=="confirm")return;Be.id==="draw"&&Ne();return}case"identity":if(Be.kind!=="confirm"||!Q)return;Be.id==="use"&&(Se.approve("portrait"),P(null)),Be.id==="again"&&Se.generate("portrait");return;case"revision":case"view-revision":{if(Be.kind!=="confirm"||!Q)return;const F=Me==="revision"?"portrait":Object.keys(Q.views).find(de=>Q.views[de].status==="candidate")??jt;Be.id==="use"&&Se.approve(F),Be.id==="keep"&&Se.revert(F),Be.id==="again"&&Se.generate(F,Q.views[F].adjustment,ti(F)),H(!1);return}case"retry":{if(Be.kind==="confirm"&&Be.id.startsWith("remedy:")){const de=Be.id.slice(7);de==="setup"?h():p(de);return}if(Be.kind==="confirm"&&Be.id==="skip-extras"){Se.clearErr(),Se.update({extras:!1}),C({type:"extras-declined"});return}if(!Q){ae.current=new Set,U(null);return}if(Se.err){Se.clearErr(),ae.current=new Set([...ae.current].filter(de=>de.startsWith("sync:")));return}const F=Object.keys(Q.views).find(de=>!!Q.views[de].error);F&&Se.generate(F,Q.views[F].adjustment,ti(F));return}case"extras":if(Be.kind!=="confirm")return;Be.id==="add"&&Se.update({extras:!0}),Be.id==="save"&&C({type:"extras-declined"});return;case"save":Ie();return}},[Pe,st,Ue,Ne,h,p,Q,Se,jt,Ie]),qt=s.useCallback(Me=>{var vr,Kt,br,Ir,wn,Vo,An,Ys,Rs;const Be=Me.trim(),Qe=E.current,F=W7(Qe,at),de=F&&((vr=Qe.colour)==null?void 0:vr.step)===F?Qe.colour.hex:null,ye=F&&fr(F)?F.slice(5):null,Ke=F==="keep"?(((Kt=Qe.answers.keep)==null?void 0:Kt.refs)??[]).length:F!=null&&F.startsWith("trait-")?(((br=Qe.answers[F])==null?void 0:br.refs)??[]).length:0,Le=Be||de||"";if(!Le&&!Ke)return!1;if(U(null),F==="name"){const on=Le.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||Le;return Q&&Se.update({name:on.slice(0,60)}),C({type:"text",text:""}),!0}const ct=(on,yn)=>Qe.asides.filter(Kn=>Kn.q===on&&Kn.kind===yn).length,Ot=(on,yn=null)=>j6(on,yn,!!(Q!=null&&Q.views.portrait.hash)),zt=(on,yn,Kn,Wr)=>{const Jn=Kn!==null&&Qe.editing===Kn;Jn&&Pe({[Kn]:void 0}),rt(on,yn,Kn,Wr,Jn)};if(F&&F!=="keep"&&F.startsWith("trait-")){const on=fs(F);if(!on)return!1;const yn=on.part==="what"?((Ir=Qe.answers[F])==null?void 0:Ir.refs)??[]:[];if(!Be&&yn.length)return Pe({[F]:{pick:(wn=Qe.answers[F])==null?void 0:wn.pick,words:Ile(on.id,yn.length),refs:yn}}),!0;const Kn=Yh(F,Be,ka);if(!Be||Kn)return zt(Be,fc(Kn??"vague",Ot(F),ct(F,Kn??"vague"),Be,void 0,!0),F,Kn??"vague"),!0;const Wr=I7(Be),Jn=Wr?C6(Be):Be;if(on.part==="where"){const _n=Qe.answers[F];Pe({[F]:{pick:Wr?_n==null?void 0:_n.pick:void 0,words:Jn}})}else{const _n=Qe.answers[F];Pe({[F]:{pick:Wr?_n==null?void 0:_n.pick:void 0,words:Jn,refs:(_n==null?void 0:_n.refs)??[]}})}return!0}if(F==="keep"){const on=Qe.answers.keep,yn=(on==null?void 0:on.refs)??[],Kn=Be||(yn.length&&!(on!=null&&on.words)?"the detail in the attached picture":"");return Kn?(Pe({keep:{words:[(Vo=on==null?void 0:on.words)==null?void 0:Vo.trim(),Kn].filter(Boolean).join(", "),refs:yn}}),!0):!1}if(F&&fr(F)&&ye){const on=Be&&!/^#[0-9a-f]{6}$/i.test(Be)?Yh(F,Be,ka):null;if(on)return zt(Be,fc(on,Ot(F),ct(F,on),Be,ye,!0),F,on),!0;const yn=Qe.answers[F],Kn=!Be||I7(Be),Wr=de??(Kn?yn==null?void 0:yn.pick:void 0),Jn={pick:Wr,words:Be?Kn?C6(Be):Be:yn==null?void 0:yn.words};if(Be&&!Wr&&!$le(Qe.answers,F,Jn,Be)){const _n=Qe.answers.keep;return Pe({keep:{words:[(An=_n==null?void 0:_n.words)==null?void 0:An.trim(),Tle(Be)].filter(Boolean).join(", "),refs:(_n==null?void 0:_n.refs)??[]}}),!0}return Pe({[F]:Jn}),!0}const Rt=(at==null?void 0:at.id)??null,Sn=Rt==="unsure"?((Ys=Qe.unsure)==null?void 0:Ys.q)??"source":Rt;if(Rt==="traits"){const on=oi(Le,ka);if(on)return rt(Le,fc(on,Ot(null,Rt),ct(Rt,on),Le),Rt,on),!0;const yn=Qe.answers.keep;return Pe({traits:[],keep:{words:[(Rs=yn==null?void 0:yn.words)==null?void 0:Rs.trim(),Le].filter(Boolean).join(", "),refs:(yn==null?void 0:yn.refs)??[]}}),!0}if(Rt==="gaps"){const on=oi(Le,ka);if(on)return rt(Le,fc(on,Ot(null,Rt),ct(Rt,on),Le),Rt,on),!0;const yn=(Qe.answers.describe??"").trim().replace(/[.\s]+$/,"");return Pe({describe:yn?`${yn}, ${Le}`:Le}),!0}const Jt=Ot(null,Sn),En=Sn==="source"?Ale(Le):null,Qn=En?null:oi(Le,ka);if(Qn&&(Jt==="source"||Jt==="describe"||Qn!=="vague"))return rt(Le,fc(Qn,Jt,ct(Rt,Qn),Le),Rt,Qn),!0;if((Sn==="source"||Sn==="describe")&&!En&&!ka(Le))return C({type:"unsure",unsure:{said:Le,q:Rt,at:Gp()},ctx:Re}),!0;if((Sn==="source"||Sn==="describe")&&C({type:"settle-unsure",ctx:Re}),Sn==="source")return En?(Pe({source:{door:En,via:"taps"}}),!0):(Pe({source:{door:"scratch",via:"typed"},describe:Le}),!0);if(Sn==="describe")return Pe({describe:Le}),!0;if(ZT(Le,Q,Sn))return Se.update({name:Le.slice(0,60)}),C({type:"text",text:""}),!0;if(Sn==="name"){const on=Le.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||Le;return Q&&Se.update({name:on.slice(0,60)}),C({type:"text",text:""}),!0}if(!Q)return!1;if(Sn==="identity")return Se.generate("portrait",Le),C({type:"text",text:""}),!0;const dn=zM(Le,jt,Q);return"blocked"in dn?(U(dn.blocked),!1):(P(dn.view),H(!1),Se.generate(dn.view,Le,dn.scope==="view"?ti(dn.view):void 0),C({type:"text",text:""}),!0)},[at,Pe,rt,Q,Se,jt]),Yt=s.useCallback(Me=>{if(Me==="name"){C({type:"edit",id:"name"});return}const Be=w9(Me);if(Be){C({type:"edit",id:`aside:${Be}`});return}if(!sa(Me))return;const Qe=Ble(Me,Q);if(Qe==="start-over"){z("start-over");return}if(Qe==="redraw"){he(Me),z("redraw");return}C({type:"edit",id:Me})},[Q]),an=s.useCallback(()=>{z(null),J&&C({type:"edit",id:J}),he(null)},[J]),Wt=s.useCallback((Me,Be)=>{const Qe=E.current.answers;if(Me==="keep"||Me.startsWith("trait-")&&!Me.endsWith("-where")){const F=Qe[Me];Pe({[Me]:{pick:Me==="keep"||F==null?void 0:F.pick,words:Be,refs:(F==null?void 0:F.refs)??[]}});return}if(fr(Me)||Me.startsWith("trait-")){const F=Qe[Me];Pe({[Me]:{pick:F==null?void 0:F.pick,words:Be}});return}Pe({[Me]:Be})},[Pe]),Rn=s.useCallback((Me,Be)=>{const Qe=Be.trim();if(!Qe)return;if(Me==="name"){C({type:"cancel-edit"}),Q&&Se.update({name:Qe.slice(0,60)});return}const F=w9(Me);if(F){const ye=E.current,Ke=ye.asides.find(Jt=>Jt.at===F);if(!Ke)return;const Le=Ke.q&&sa(Ke.q)?Ke.q:null,ct=Le?Yh(Le,Qe,ka):oi(Qe,ka);if(!ct&&Le){C({type:"drop-aside",at:F}),Wt(Le,Qe);return}const Ot=j6(Le,Ke.q,!!(Q!=null&&Q.views.portrait.hash)),zt=Le&&fr(Le)?Le.slice(5):void 0,Rt=ct??"vague",Sn=ye.asides.filter(Jt=>Jt.q===Ke.q&&Jt.at<Ke.at&&Jt.kind===Rt).length;C({type:"amend-aside",at:F,said:Qe,reply:fc(Rt,Ot,Sn,Qe,zt),kind:Rt,ctx:Re});return}if(!sa(Me)||!M1(Me,E.current.answers))return;const de=Yh(Me,Qe,ka);if(de){const ye=E.current,Ke=j6(Me,Me,!!(Q!=null&&Q.views.portrait.hash)),Le=fr(Me)?Me.slice(5):void 0,ct=ye.asides.filter(Ot=>Ot.q===Me&&Ot.kind===de).length;Pe({[Me]:void 0}),rt(Qe,fc(de,Ke,ct,Qe,Le),Me,de);return}Wt(Me,Qe)},[Q,Se.update,Pe,Wt,qt,at,Re]),Bt=s.useCallback(()=>C({type:"cancel-edit"}),[]),ne=s.useCallback(()=>{const Me=E.current,Be=Me.editing&&Me.editing!=="name"&&!N1(Me.editing)?Me.editing:null,Qe=Be&&!M1(Be,Me.answers)?Be:at==null?void 0:at.id;if(Qe==="agree"){C({type:"say",id:"keep"});return}if(Qe==="identity"){me(F=>F+1);return}if(!(!Qe||!sa(Qe))){if(Qe==="look-who"){Pe({source:{door:"scratch",via:"words"}});return}C({type:"say",id:Qe})}},[at==null?void 0:at.id,Pe]),ce=s.useCallback(()=>X7(E.current,Re,Zt.current),[Re]),ue=s.useCallback(Me=>{const Be=ce();if(Be){U(null),E.current.saying!==Be&&C({type:"say",id:Be});for(const Qe of Me.slice(0,1)){const F=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,de=URL.createObjectURL(Qe);ee(ye=>[...ye,{key:F,id:Be,url:de}]),p1(Qe).then(ye=>{if(tt.current.delete(F)){URL.revokeObjectURL(de);return}q.current.has(ye)?URL.revokeObjectURL(de):q.current.set(ye,de),C({type:"ref",id:Be,hash:ye}),ee(Ke=>Ke.filter(Le=>Le.key!==F))}).catch(ye=>{tt.current.delete(F)||U(String((ye==null?void 0:ye.message)??ye)),ee(Ke=>Ke.filter(Le=>Le.key!==F)),URL.revokeObjectURL(de)})}}},[ce]),ze=(Me,Be,Qe)=>{const F=sb(Me,Be,Qe);return F.charAt(0).toUpperCase()+F.slice(1)},Ve=Me=>P7(Me).flatMap(Be=>{const Qe=Be.color?dr(Be.color):null;return Qe?[{hex:Qe,name:Be.label,slot:"accent"}]:[]}),xt=X7(k,Re,(at==null?void 0:at.id)??null),yt=(()=>{var ct,Ot,zt;if(!xt)return;const Me=((ct=k.answers[xt])==null?void 0:ct.refs)??[],Be=xt==="keep"?Me.slice(((Ot=k.composing)==null?void 0:Ot.id)==="keep"?k.composing.refs.length:Me.length):Me,Qe=re.filter(Rt=>Rt.id===xt);if(!Be.length&&!Qe.length)return;const F=xt==="keep"?null:fs(xt),de=F&&((zt=Ia(F.id))==null?void 0:zt.label)||"Detail",ye=Be.length+Qe.length>1;let Ke=0;const Le=()=>ye?`${de} ${++Ke}`:de;return[...Be.map(Rt=>({key:Rt,src:q.current.get(Rt)??vn(Rt,"micro"),label:Le(),onRemove:()=>C({type:"ref",id:xt,hash:Rt,remove:!0})})),...Qe.map(Rt=>({key:Rt.key,src:Rt.url,label:Le(),busy:!0,onRemove:()=>{tt.current.add(Rt.key),ee(Sn=>Sn.filter(Jt=>Jt.key!==Rt.key))}}))]})(),kt=Gle(at,k,Q,jt),ot=Se.busy||Y||!!kt.off,ht=xt,Ae=W7(k,at),ve=Ae==="name"?null:Ae,et=ve&&fr(ve)?ve.slice(5):null,Ct=kt.color&&et?Ve(et):null,xe=ve&&((Lt=k.colour)==null?void 0:Lt.step)===ve?k.colour.hex:null,it=Q&&hi(Q)&&!kt.off&&!(at!=null&&at.id.match(/^(name|describe)$/))?(()=>{const Me=$Y(k.text,jt,Q),Be=Me.chip?Q.views[Me.chip.view].hash:void 0;return{chip:Me.chip?{label:Me.chip.label,thumb:Be?vn(Be,"micro"):void 0}:null,hint:Me.hint,tone:Me.tone}})():null,wt=Q?_M(Q,jt):[],$e=(Ft==null?void 0:Ft.hash)??((Q==null?void 0:Q.stage)==="analyzing"?Q.sources[0]:void 0),qe=R&&(Ft!=null&&Ft.prior)?Ft.prior:$e;return{d:Q,view:jt,slot:Ft,facets:_,setFacets:B,presenterCategories:u,saving:K,saveErr:O,confirming:X,setConfirming:z,confirmEdit:an,pendingEdit:J,startOver:Ge,begun:Object.keys(k.answers).length>0||!!Q,unsaved:!e&&!Q&&Object.keys(k.answers).length>0,leave:()=>{se(),C({type:"start-over"})},revision:k.revision,open:(at==null?void 0:at.id)??null,keepPrevious:Ft&&Ft.status==="approved"&&Ft.prior&&!Pt&&!(Q!=null&&Q.activeView)&&(Q==null?void 0:Q.stage)==="idle"?()=>void Se.revert(jt):null,surface:{title:"Create person",memoryKey:`presenter-create:${l.id}:${t}`,resumed:ie,turns:bt,busy:Se.busy||Y||w,working:Kle(bt,Q,Y||Se.busy),stageEmpty:{lead:lle(Q?jt:void 0,xn[jt]),hint:cle((at==null?void 0:at.id)??null,((Ut=k.answers.photos)==null?void 0:Ut.hashes.length)??0)},stage:Q?{hash:qe,alt:`${Dc[jt]}${(Ft==null?void 0:Ft.status)==="candidate"?", candidate":""}`,drawing:Pt,since:BM(Q),doing:UM(Q),takes:Xw(Q,jt)?[]:KM(Q,jt),onTake:$t?Me=>void Se.restore(jt,Me):void 0,items:wt,onPick:Me=>{P(Me),H(!1)},compare:Ft&&Ft.status==="candidate"&&Ft.prior?{on:R,toggle:()=>H(Me=>!Me)}:void 0}:null,composer:{placeholder:kt.placeholder,label:kt.label,action:kt.action,scope:it,hint:null,why:kt.off??void 0,error:D??O,disabled:ot,working:!!Q&&!!Q.activeView&&(at==null?void 0:at.id)!=="name",onStop:Q!=null&&Q.activeView?()=>void Se.stop():void 0,stopping:Se.stopping,focusKey:at&&!(at.id==="agree"&&!k.saying)?`${at.id}:${(Q==null?void 0:Q.id)??"setup"}:${te}:${k.saying??""}:${k.says}`:void 0,onAttach:!ht&&!Q&&(at==null?void 0:at.id)==="source"?()=>Pe({source:{door:"photos",via:"taps"}}):void 0,onAttachFiles:ht?ue:void 0,attachLabel:ht?bce(k,ht):"Add photos",refs:yt,colour:Ct&&et?{hex:xe,label:xe?ze(xe,P7(et),et):"Pick a colour",seed:(Nt=Ct[Math.floor(Ct.length/2)])==null?void 0:Nt.hex,onPick:Me=>C({type:"colour",hex:Me,step:ve}),onClear:()=>C({type:"colour",hex:null,step:ve})}:null},text:k.text,onText:Me=>C({type:"text",text:Me}),onSend:qt,onAnswer:nt,onRestore:(Me,Be)=>{P(Me),Se.restore(Me,Be)},onEdit:Yt,onSaveEdit:Rn,onCancelEdit:Bt,onDescribe:ne,onAttachRef:ue,onStarter:Me=>{(at==null?void 0:at.id)==="agree"&&C({type:"say",id:"keep"}),C({type:"text",text:Me})},onPaste:!Q&&((_t=k.answers.source)==null?void 0:_t.door)==="photos"?Me=>void st(Me):void 0}}}function kce({onClose:e,...t}){const n=xce(t),r=n.d,{push:a}=rr();s.useEffect(()=>Zp({open:n.open}),[n.open]),s.useEffect(()=>()=>Zp(null),[]);const[i,l]=s.useState(!1);s.useEffect(()=>{i&&!n.unsaved&&l(!1)},[i,n.unsaved]);const u=()=>{if(n.unsaved){l(!0);return}r&&!n.saving&&a({kind:"info",title:"Kept on People",detail:"Continue it from its card."}),e()},f=n.begun?r?o.jsx(Xn,{label:"Start over",tone:"quiet",title:"Start over?",body:`This conversation begins again from the first question. ${VM(r)?"The views drawn so far are kept: the unfinished person stays on your wall.":"Nothing has been drawn yet, so nothing is kept."}`,open:n.confirming==="start-over"||void 0,busy:!1,onOpenChange:m=>{m||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,h=o.jsx(o.Fragment,{children:n.keepPrevious&&n.slot&&o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]})}),p=o.jsx(Xn,{label:"Change it",title:ple,body:(r==null?void 0:r.source)==="photos"?gle:mle,busy:!1,open:n.confirming==="redraw",onOpenChange:m=>{m||n.setConfirming(null)},onConfirm:n.confirmEdit}),g=o.jsxs(o.Fragment,{children:[p,o.jsx(Xn,{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:i,onOpenChange:m=>{m||l(!1)},onConfirm:()=>{l(!1),n.leave(),e()}})]});return o.jsx(Jy,{surface:{...n.surface,headAction:f,dock:h,overlay:g},onClose:u})}function Sce(){const{draftId:e=null}=ia(),{key:t}=Bn(),{brand:n}=un(),r=Un(),{announce:a,caps:i}=fy();Xc("Create person");const l=s.useRef(!1);s.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const u=s.useRef(e),f=s.useRef(0);e!==u.current&&(u.current=e,f.current+=1);const h=s.useCallback((m,w=!1)=>{l.current&&(w&&(u.current=m),r(wl(n,m),{replace:w}))},[r,n]),p=s.useCallback(()=>{l.current&&(u.current=null,r(wl(n),{replace:!0}))},[r,n]),g=s.useCallback(()=>r(di(n),{replace:!0}),[r,n]);return o.jsx(kce,{draftId:e,convoKey:e??t,onOpenDraft:h,onLeaveDraft:p,onClose:g,onStarted:m=>{a(m,{quiet:l.current&&m.kind==="presenter"}),l.current&&r(m.kind==="presenter"?La(n,m.id):di(n),{replace:!0})},caps:i},f.current)}const Q7=1e3,Ece=3,Cce=1e3;function J7(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,...e.heldPictures],...n!=null&&n.hash?{previewHash:n.hash,anchor:n.anchor===!0}:{},...n!=null&&n.hash&&n.hero?{heroHash:n.hero,...n.heroWith?{heroWith:n.heroWith}:{}}:{}}}function jce(e){var H,D;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,m]=s.useState(!1),[w,y]=s.useState(0),b=s.useRef(t);b.current=t;const S=s.useRef(e.seed);S.current=e.seed;const k=s.useRef(!1),C=s.useRef(e.onSaved);C.current=e.onSaved;const{poke:E}=ua(),A=s.useCallback(async(U,_={})=>{if(!(k.current||b.current.job)){k.current=!0,m(!0);try{const B=b.current,K=$r(B),V=U==="make"?{kind:U,instruction:B.place,imageHashes:B.pictures,draw:_.draw??!1,..._.shot?{shot:!0}:{}}:U==="again"?{kind:U,reading:K==null?void 0:K.reading,imageHashes:B.pictures}:{kind:U,reading:K==null?void 0:K.reading,ask:_.ask,from:(K==null?void 0:K.hash)??void 0,...K!=null&&K.hash&&K.anchor?{fromAnchor:!0}:{},...K!=null&&K.hash&&K.hero?{fromHero:K.hero,...K.heroWith?{heroWith:K.heroWith}:{}}:{},imageHashes:B.pictures,draw:_.draw},O=B.name.trim()||(K==null?void 0:K.reading.name)||void 0,{jobId:I,job:Y,existing:Z}=await Ee.startSceneStudioJob(r,{...V,conversation:i,...a?{sceneId:a}:{},...O?{label:O}:{}});if(Z&&Y.kind!==U){n({type:"error",text:ge.busyElsewhere});return}n({type:"started",id:I,kind:Y.kind,ask:Y.kind===U?_.ask:void 0,since:Y.phaseAt}),E()}catch(B){n({type:"error",text:String((B==null?void 0:B.message)??B)}),y(K=>K+1)}finally{k.current=!1,m(!1)}}},[r,n,E]);s.useEffect(()=>{const U=b.current;if(U.job||!U.versions.length&&!U.inputsRev)return;let _=!0;return Ee.activity(r).then(B=>{var V;const K=(V=B.studio)==null?void 0:V.find(O=>O.kind==="scene"&&O.conversation===i&&O.status==="running"&&!!O.job);!_||!(K!=null&&K.job)||b.current.job||k.current||n({type:"started",id:K.id.slice(6),kind:K.job,since:K.startedAt})}).catch(()=>{}),()=>{_=!1}},[r,i,n]);const L=t.named?t.name.trim():"",$=((H=t.job)==null?void 0:H.id)??null;s.useEffect(()=>{!$||!L||Ee.labelSceneStudioJob(r,$,L).catch(()=>{})},[$,L,r]);const N=((D=t.job)==null?void 0:D.id)??null;s.useEffect(()=>{if(!N)return;let U=!0,_=0,B=!0,K;const V=async()=>{var O;try{const I=await Ee.sceneStudioJob(r,N);if(!U)return;_=0,f(!1),B&&I.status==="running"&&((O=b.current.job)!=null&&O.stopping)&&Ee.cancelSceneStudioJob(r,N).catch(()=>{}),B=!1,I.status==="running"?(n({type:"progress",job:I}),K=setTimeout(V,Q7)):n({type:"finished",job:I})}catch(I){if(!U)return;if((I==null?void 0:I.status)===404){f(!1),n({type:"lost",id:N,error:ge.lost});return}_++,_>=Ece&&f(!0),K=setTimeout(V,Math.min(Q7*2**Math.min(_,3),8e3))}};return V(),()=>{U=!1,clearTimeout(K)}},[N,r,n]);const j=s.useCallback(()=>{const U=b.current.job;if(!U||U.stopping)return Promise.resolve(!0);n({type:"stopping",id:U.id});const _=()=>Ee.cancelSceneStudioJob(r,U.id);return _().catch(()=>new Promise(B=>setTimeout(B,Cce)).then(_)).then(()=>!0,()=>(n({type:"stop-failed",id:U.id}),!1))},[r,n]),P=s.useCallback(U=>{const _=ire(b.current,U);_>=0&&n({type:"put-back",index:_})},[n]),R=s.useCallback(async(U={})=>{var O,I,Y,Z;const _=b.current,B=((O=$r(_))==null?void 0:O.reading.name)||((Y=(I=_.job)==null?void 0:I.pending)==null?void 0:Y.name)||"",K={..._,name:_.name.trim()||B},V=sre(K);if(!(!V.can||!V.words||k.current)){k.current=!0,p(!0);try{const X=((Z=_.job)==null?void 0:Z.phase)==="drawing"?_.job.id:null,z=J7(K,V.words,X?null:$r(_)??null),J=S.current,he=J?$r(J):null,te=a&&!U.asNew?await Ee.updateScene(r,a,J&&he?wre(z,J7(J,he.reading,he)):z):await Ee.createScene(r,{...z,conversation:i});l(te.brand);const me=te.scene;if(X){const re=await Ee.attachSceneStudioJob(r,X,me.id).catch(()=>null);(re==null?void 0:re.state)==="landed"&&l(re.brand)}n({type:"saved",id:me.id}),C.current({id:me.id,name:me.name,verticals:me.verticals??[]},!!U.asNew)}catch(X){n({type:"error",text:String((X==null?void 0:X.message)??X)})}finally{k.current=!1,p(!1)}}},[r,a,i,l,n]);return{offline:u,saving:h,starting:g,failed:w,start:A,stop:j,putBack:P,use:R}}const Ace="scenri:scene-studio:",Nce=10080*60*1e3;function GT(e){const t=Ar.get(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Mce(e){const t=GT(e);return fL(typeof(t==null?void 0:t.session)=="string"?t.session:null)}function Rce(e,t,n){Ar.set(e,JSON.stringify({at:Date.now(),sceneId:n,session:t}))}function Pce(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 eS(e){Ar.del(e)}function Lce(e=Date.now()){var t;for(const n of Ar.keys(Ace)){let r=0;try{r=Number((t=JSON.parse(Ar.get(n)??"null"))==null?void 0:t.at)||0}catch{}e-r>Nce&&Ar.del(n)}}function Tce(e){var ve,et,Ct,xe,it,wt;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(()=>{Lce();const $e=Mce(l);return $e||hl(l),$e}),[p,g]=s.useReducer(JP,null,()=>(h==null?void 0:h.setup)??Xne),[m,w]=s.useReducer(rre,null,()=>(h==null?void 0:h.studio)??a??tL),[y,b]=s.useState(0),[S,k]=s.useState(""),C=s.useRef(null),[E,A]=s.useState(!1),[L,$]=s.useState(void 0),[N,j]=s.useState(null),P=s.useRef(!1),R=s.useRef(p);R.current=p;const H=s.useRef(m);H.current=m;const[D,U]=s.useState(null),_=s.useRef(e.onSaved);_.current=e.onSaved;const B=jce({s:m,dispatch:w,brandId:t.id,sceneId:r,conversation:i,seed:a,applyBrand:n,onSaved:($e,qe)=>_.current($e,r&&!qe?"updated":"created")}),K=s.useRef(!1);s.useEffect(()=>{if(P.current)return;const $e=GT(l);if(($e==null?void 0:$e.done)===!0||K.current&&!$e){P.current=!0;return}const qe=typeof($e==null?void 0:$e.sceneId)=="string"?$e.sceneId:null;Rce(l,Lre(p,m),r??m.saved??qe),K.current=!0},[p,m,l,r]);const V=m.saved,O=V?w1(t,V):void 0,I=sT(t.id,V,(O==null?void 0:O.placeUrl)??null),Y=((ve=I.job)==null?void 0:ve.status)==="running",[Z,X]=s.useState(!1),[z,J]=s.useState(0),[he,te]=s.useState(!1);s.useEffect(()=>{Y||te(!1)},[Y]);const me=s.useMemo(()=>YM(O==null?void 0:O.examples,I.job),[O==null?void 0:O.examples,I.job]),re=s.useRef(e.onDone);re.current=e.onDone;const ee=s.useMemo(()=>{var qe,Lt;if(!V)return;const $e=(O==null?void 0:O.examples)??[];return{tiles:me,running:Y||Z||I.waiting,read:I.read,who:((qe=$e[0])==null?void 0:qe.with)??((Lt=I.job)==null?void 0:Lt.subject.kind)??((O==null?void 0:O.subject)==="person"||O!=null&&O.figure?"presenter":"product"),noSubject:I.read&&!I.job&&!$e.length&&I.more.length===0,missing:IY(I.more,$e,I.job),first:I.first,stale:I.first.length>0&&$e.some(Ut=>Ut.earlier),finish:e.finish}},[V,O,me,Y,Z,I.waiting,I.read,I.job,I.first,I.more,e.finish]),q=s.useCallback($e=>{V&&(j(null),X(!0),Ee.drawSceneExamples(t.id,V,$e).then(()=>{X(!1),I.again()}).catch(qe=>{X(!1),J(Lt=>Lt+1),"roles"in $e||w({type:"set-failed",more:"more"in $e}),j(String((qe==null?void 0:qe.message)??qe))}))},[t.id,V,I.again]),ie=s.useCallback(()=>{V&&(P.current=!0,Ore(l,V),hl(l),re.current(V))},[V,l]),[Oe,ae]=s.useState(null);s.useEffect(()=>ae(null),[m.current]),s.useEffect(()=>{f||p.editing||!M9(p.answers)||w({type:"inputs",place:Yne(p.answers),pictures:qne(p.answers)})},[p.answers,p.editing,f]);const pe=s.useRef(new Set),Te=nre(m,!f&&M9(p.answers));s.useEffect(()=>{var $e;Te===null||B.starting||pe.current.has(Te)||(pe.current.add(Te),B.start("make",{draw:!1,shot:(($e=R.current.answers.source)==null?void 0:$e.door)==="shot"}))},[Te,B.starting,B.start]);const[gt,Ze]=s.useState(""),tt=Fy(t.id,gt,!f),De=s.useRef(tt);De.current=tt;const Se=s.useRef([]);tt.settled&&!tt.error&&(Se.current=tt.items);const Q=tt.settled?tt.items:Se.current,je=!tt.error&&(!tt.settled||tt.loading),{recent:Re,loaded:se}=un(),[G,oe]=s.useState(null);s.useEffect(()=>{!gt.trim()&&tt.settled&&!tt.error&&oe(tt.items.length>0)},[gt,tt.settled,tt.error,tt.items.length]);const Ne=G??(Re.length>0?!0:se?!1:null),Ue=s.useMemo(()=>({any:Ne,items:Q.map($e=>({id:$e.id,hash:$e.images[0],alt:Pce($e.promptHead)})),query:gt,more:tt.settled&&tt.hasMore,loading:je,error:tt.error}),[Ne,Q,gt,tt.settled,tt.hasMore,je,tt.error]),st=Mn().scenes,Pe=(u==null?void 0:u.canRead)??!0,[Ie,Ge]=s.useState(null),ft=s.useCallback(async $e=>{var _t,Me,Be;const qe=Se.current.find(Qe=>Qe.id===$e)??tt.items.find(Qe=>Qe.id===$e);if(!(qe!=null&&qe.images[0]))return;const Lt=R.current.revision;let Ut=I9(qe.brief);if(!Ut&&qe.kind==="edit"){const Qe=await Ee.lineage(qe.id).catch(()=>null);if(Ut=I9((_t=Qe==null?void 0:Qe.ancestors.find(F=>F.kind==="generation"))==null?void 0:_t.brief),R.current.revision!==Lt)return}const Nt=Ut?((Me=w1(t,Ut))==null?void 0:Me.name)??((Be=st.find(Qe=>Qe.id===Ut))==null?void 0:Be.name):void 0;if(!Pe&&!(Ut&&Nt)){Ge("shot");return}Ge(null),Et({shot:{id:qe.id,hash:qe.images[0],...Ut&&Nt?{scene:{id:Ut,name:Nt}}:{}},reuse:void 0})},[t,st,tt.items,Pe]),bt=s.useCallback(()=>{var qe;const $e=(qe=R.current.answers.shot)==null?void 0:qe.scene;$e&&(P.current=!0,eS(l),hl(l),re.current($e.id,{existing:!0}))},[l]),at=(u==null?void 0:u.canDraw)??!0,Zt=B.offline?ge.offline:N,jt={setup:p,studio:m,canDraw:at,canRead:Pe,noReader:Ie,uploading:y,edit:f&&{...f,changed:O9(m,a)},editingName:E,note:Zt,stale:nL(m),shots:Ue,set:ee},Ft=B.failed+z,Pt=s.useMemo(()=>Are(jt).map($e=>$e.kind==="question"&&Ft?{...$e,question:{...$e.question,attempt:Ft}}:$e),[p,m,at,Pe,Ie,y,E,Zt,f,Ue,ee,Ft]),$t=(()=>{const $e=Pt[Pt.length-1];return($e==null?void 0:$e.kind)==="question"?$e.question:null})(),ke=Rre(jt,$t),Je=($e,qe,Lt)=>g({type:"aside",aside:{said:$e,reply:qe,q:Lt,at:Gp()}}),Et=s.useCallback($e=>{const qe=R.current,Lt=qe.held??qe.answers;qe.editing&&$9(H.current)&&JSON.stringify(My(Lt,$e))!==JSON.stringify(Lt)&&w({type:"forget-record"}),g({type:"answer",patch:$e})},[]),Xe=s.useRef(0),rt=s.useCallback(async $e=>{var Me,Be;const qe=$e.some(L9),Lt=$e.filter(Qe=>Qe.type.startsWith("image/")&&!L9(Qe));if(!Lt.length){j(qe?ge.heicNotYet:ge.onlyPictures);return}((Me=R.current.answers.source)==null?void 0:Me.door)!=="photos"&&Et({source:{door:"photos"}});const Nt=4-(((Be=R.current.answers.photos)==null?void 0:Be.hashes)??[]).length-Xe.current;if(Nt<=0){j(ge.fourPictures);return}const _t=Lt.slice(0,Nt);j(Lt.length>Nt?ge.fourPictures:qe?ge.heicNotYet:null),Xe.current+=_t.length,b(Qe=>Qe+1);try{for(const Qe of _t)try{g({type:"photo",hash:await p1(Qe)})}catch(F){j(`${Qe.name} could not be added: ${String((F==null?void 0:F.message)??F)}`)}finally{Xe.current-=1}}finally{b(Qe=>Qe-1)}},[Et]),nt=s.useRef(me);nt.current=me;const qt=Zl(),Yt=zl(),an=s.useCallback(($e,qe)=>{var Lt,Ut;if(j(null),qe.kind==="confirm"&&qe.id.startsWith("remedy:")){const Nt=qe.id.slice(7);Nt==="setup"?Yt():(Nt==="engines"||Nt==="budget")&&qt(Nt);return}if(qe.kind==="confirm"&&qe.id==="reword"){$(String(Date.now()));return}if($e==="photos"&&qe.kind==="photos"){const Nt=qe.action,_t=((Lt=R.current.answers.photos)==null?void 0:Lt.hashes)??[];Nt.type==="add"?rt(Nt.files):Nt.type==="instead"?Et({source:{door:"shot"}}):Nt.type==="remove"?g({type:"photos",hashes:_t.filter(Me=>Me!==Nt.hash)}):Nt.type==="reject"?j(ge.onlyPictures):Nt.type==="submit"&&_t.length?Pe?(Ge(null),Et({photos:{hashes:_t,done:!0}})):Ge("photos"):Nt.type==="back"&&Et({source:{door:"guided"}});return}if($e==="shot"&&qe.kind==="pick"){const Nt=qe.action;Nt.type==="pick"?ft(Nt.id):Nt.type==="query"?Ze(Nt.text):Nt.type==="more"?De.current.loading||De.current.loadMore():Nt.type==="back"&&(Ze(""),Et({source:{door:"photos"},photos:{hashes:[],done:!1}}));return}if($e==="reuse"&&qe.kind==="choice"&&qe.id==="use"){bt();return}if($e==="reuse"&&!Pe){Ge("shot");return}if($e==="noreader"){qe.kind==="confirm"&&qe.id==="unstop"&&Ge(null);return}if(N9($e)){const Nt=Gne($e,qe,R.current.answers);Nt&&Et(Nt);return}if($e==="retry"){B.start("make",{draw:!1,shot:((Ut=R.current.answers.source)==null?void 0:Ut.door)==="shot"});return}if(qe.kind==="confirm"){if($e==="set-start"){qe.id==="draw-set"?(w({type:"set-drawn"}),q({first:!0})):w({type:"set-declined"});return}if($e==="set-more"){qe.id==="more"?(w({type:"ask-more"}),q({more:!0})):w({type:"decline-more"});return}if($e==="set-done"){qe.id==="retry-failed"?q({roles:nt.current.filter(Nt=>Nt.state==="failed").map(Nt=>Nt.role)}):ie();return}qe.id==="draw"||qe.id==="again"?B.start("again"):qe.id==="use"?B.use():qe.id==="another-shot"&&ce.current("shot")}},[rt,Et,B.start,B.use,q,ie,ft,bt,qt,Yt,Pe]),Wt=$e=>{$e.trim()?!C.current&&ke.target.kind!=="off"&&(C.current=ke.target):C.current=null,k($e)},Rn=$e=>{const qe=Bt($e);return qe&&(C.current=null,k("")),qe};function Bt($e){var qe;{const Lt=$e.trim();if(!Lt)return!1;j(null);const Ut=C.current??ke.target;if(Ut.kind==="source"){if(uL(Lt))return Et({source:{door:"words",text:Lt.slice(0,jd)}}),!0;const Nt=Fne(Lt),_t=Object.keys(Nt);return _t.length>0?(Et({source:{door:"guided"},...Object.fromEntries(_t.map(Me=>[Me,{pick:Nt[Me]}]))}),!0):(Je(Lt,U9(W9(Lt,"source")??"vague","source"),"source"),!0)}if(Ut.kind==="row"&&Yp(Ut.id)){const Nt=W9(Lt,"row");if(Nt)return Je(Lt,U9(Nt,"row"),Ut.id),!0;const _t=(qe=R.current.answers[Ut.id])==null?void 0:qe.pick;return Et({[Ut.id]:{..._t?{pick:_t}:{},words:Lt.slice(0,jd)}}),!0}if(Ut.kind==="name")return w({type:"name",text:sL(Lt)??Lt}),!0;if(Ut.kind==="add"||Ut.kind==="change"){if(m.job||B.starting)return!1;const Nt=gre(Lt),_t=jre(m);return Nt.kind==="rename"?(w({type:"name",text:Nt.name}),Je(Lt,ge.renamed(Nt.name),_t),!0):Nt.kind!=="change"?(Je(Lt,Nt.say,_t),Nt.kind!=="refuse"):(Ut.kind==="add"?B.start("change",{ask:Lt,draw:!1}):vre(m,Lt)?B.start("again"):B.start("change",{ask:Lt}),!0)}return!1}}const ne=s.useCallback($e=>{m.job||($e==="name"?A(!0):N9($e)&&($e==="shot"&&Ze(""),$9(m)?U($e):g({type:"edit",id:$e})))},[m]),ce=s.useRef(ne);ce.current=ne;const ue=s.useCallback(($e,qe)=>{$e==="name"&&(qe.trim()&&w({type:"name",text:qe.trim()}),A(!1))},[]),ze=s.useCallback(()=>{A(!1),g({type:"cancel-edit"})},[]),Ve=$r(m),xt=Y&&I.job?Qw({status:I.job.status,step:I.job.current,done:I.job.done.length,total:I.job.roles.length,error:I.job.error}):void 0,yt=m.job?c6(m):B.saving?"Saving":xt,kt=[];let ot=null;const ht=$e=>({view:"place",label:ge.emptyLabel,state:$e==="place"?"current":"approved",hash:(Ve==null?void 0:Ve.hash)??void 0,photo:!1,drawing:!1,approved:!0,error:!1});if(V){const $e=Y?(et=I.job)==null?void 0:et.current:null,qe=((Ct=[...me].reverse().find(_t=>_t.state==="shown"))==null?void 0:Ct.role)??null,Lt=Oe??$e??qe??"place",Ut=((xe=me[0])==null?void 0:xe.role)==="hero"&&me[0].state==="shown";Ut||kt.push(ht(Lt));for(const[_t,Me]of me.entries())kt.push({view:Me.role,label:Ja[Me.role],state:Lt===Me.role?"current":Me.state==="shown"?"approved":"todo",hash:Me.hash,photo:!1,drawing:Me.state==="drawing",approved:Me.state==="shown",error:Me.state==="failed"}),Ut&&_t===0&&kt.push(ht(Lt));const Nt=kt.find(_t=>_t.view===Lt)??kt[0];ot={hash:Nt.hash,drawing:Nt.drawing}}else if(Ve!=null&&Ve.hash&&Ve.hero){const $e=Oe==="place"?"place":"hero";kt.push({view:"hero",label:Ja.hero,state:$e==="hero"?"current":"approved",hash:Ve.hero,photo:!1,drawing:!1,approved:!0,error:!1},ht($e))}const Ae=!f&&(!!p.answers.source||m.versions.length>0);return{title:f?ge.editTitle:ge.title,turns:Pt,working:yt,busy:B.saving,resumed:!!h,memoryKey:l,stage:ot?{hash:ot.hash,alt:`${m.name.trim()||(Ve==null?void 0:Ve.reading.name)||"The place"}, in use`,drawing:ot.drawing||!!m.job&&m.job.phase==="drawing",doing:xt??c6(m),items:kt,onPick:$e=>ae($e)}:{hash:(Oe==="place"?Ve==null?void 0:Ve.hash:rL(Ve))??void 0,alt:`Preview of ${m.name.trim()||(Ve==null?void 0:Ve.reading.name)||"the place"}`,drawing:!!m.job&&m.job.phase==="drawing",since:((it=m.job)==null?void 0:it.since)??void 0,doing:c6(m),takes:m.job?void 0:are(m),onTake:B.putBack,items:kt,onPick:$e=>ae($e)},composer:{placeholder:ke.placeholder,label:ke.label,action:ke.action,disabled:ke.target.kind==="off",why:ke.target.kind==="off"&&ke.target.why||null,working:ke.working,onStop:m.job?()=>{j(null),B.stop().then($e=>{$e||j(ge.stopLost)})}:Y&&V?()=>{te(!0),Ee.stopSceneExamples(t.id,V).then(()=>I.again()).catch(()=>{te(!1),j(ge.stopLost)})}:void 0,stopping:!!((wt=m.job)!=null&&wt.stopping)||he,focusKey:L,onAttachFiles:ke.attach?$e=>void rt($e):void 0,attachLabel:ge.attachLabel},text:S,onText:Wt,onSend:Rn,onAnswer:an,onEdit:ne,onSaveEdit:ue,onCancelEdit:ze,confirmingEdit:D!==null,confirmEdit:()=>{D&&g({type:"edit",id:D}),U(null)},cancelConfirm:()=>U(null),onRestore:($e,qe)=>B.putBack(qe),onRetry:$e=>q({roles:[$e]}),onDescribe:()=>$(String(Date.now())),onStarter:$e=>{Wt($e),$(String(Date.now()))},onPaste:($t==null?void 0:$t.id)==="source"||($t==null?void 0:$t.id)==="photos"?$e=>void rt($e):void 0,canDraw:at,begun:Ae,unsaved:m.saved?!1:f?O9(m,a):Ae,running:!!m.job||Y,saved:!!V,finish:ie,keptAsDraft:!f&&aL(m),leave:()=>{B.stop(),P.current=!0,eS(l),hl(l)}}}function $ce({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 m=Tce({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),[b,S]=s.useState(!1),k=m.turns[m.turns.length-1],C=(k==null?void 0:k.kind)==="question"?k.question.id:null;s.useEffect(()=>Zp({open:C}),[C]),s.useEffect(()=>()=>Zp(null),[]);const E=!!n,A=()=>{if(m.busy){S(!0);return}if(m.saved){m.finish();return}if(m.running||m.keptAsDraft){u();return}if(m.unsaved){y(!0);return}m.leave(),u()};s.useEffect(()=>{!b||m.busy||(S(!1),A())},[b,m.busy]);const L=!E&&m.begun&&!m.saved?o.jsx(Xn,{label:ge.startOver,tone:"quiet",title:ge.startOverTitle,body:ge.startOverBody,busy:!1,onConfirm:()=>{m.leave(),f()}}):null;return o.jsx(Jy,{onClose:A,surface:{kind:"scene",glyph:o.jsx(OC,{size:32}),title:m.title,turns:m.turns,busy:m.busy,working:m.working,memoryKey:m.memoryKey,resumed:m.resumed,stage:m.stage,stageEmpty:{lead:ge.emptyLead,hint:ge.emptyHint},composer:m.composer,text:m.text,onText:m.onText,onSend:m.onSend,onAnswer:m.onAnswer,onEdit:m.onEdit,onSaveEdit:m.onSaveEdit,onCancelEdit:m.onCancelEdit,onRestore:m.onRestore,onRetry:m.onRetry,onDescribe:m.onDescribe,onStarter:m.onStarter,onPaste:m.onPaste,headAction:L,overlay:o.jsxs(o.Fragment,{children:[o.jsx(Xn,{label:ge.changeIt,title:ge.changeTitle,body:ge.changeBody,busy:!1,open:m.confirmingEdit,onOpenChange:$=>{$||m.cancelConfirm()},onConfirm:m.confirmEdit}),o.jsx(Xn,{label:E?ge.discard:ge.leave,title:E?ge.discardTitle:ge.leaveTitle,body:E?ge.discardBody:ge.leaveBody,busy:!1,open:w,onOpenChange:$=>{$||y(!1)},onConfirm:()=>{y(!1),m.leave(),u()}})]})}})}const vv=e=>{const t=/^asset:([a-f0-9]{32})$/.exec(String(e??""));return t?t[1]:null};function Dce(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=>vv(u==null?void 0:u.file)).filter(Boolean);return tre({place:String(r.instruction??""),pictures:i,reading:a,hash:vv(r.preview)??null,anchor:r.anchor===!0,...Hce(r),name:a.name})}function Hce(e){const t=(Array.isArray(e.examples)?e.examples:[]).find(a=>(a==null?void 0:a.role)==="hero"&&(a==null?void 0:a.from)===e.preview),n=vv(t==null?void 0:t.file);if(!n)return{};const r={...t.product?{product:String(t.product)}:{},...t.presenter?{presenter:String(t.presenter)}:{}};return{hero:n,heroWith:r}}function Oce(){return[...crypto.getRandomValues(new Uint8Array(6))].map(t=>t.toString(16).padStart(2,"0")).join("")}function tS(){const{sceneId:e=null,convoId:t=null}=ia(),{key:n,state:r}=Bn(),{brand:a}=un(),{applyBrand:i}=Mn(),l=Un(),{announce:u,caps:f}=fy();Xc(e?"Edit place":"Create place");const[h]=s.useState(()=>e?Dce(a,e):null),p=typeof(r==null?void 0:r.from)=="string"?r.from:null,g=p&&(xl(pt.hub,p.split("?")[0])||xl(pt.set,p.split("?")[0])),m=s.useCallback(()=>{var S;p&&(((S=window.history.state)==null?void 0:S.idx)??0)>0?l(-1):l(p??(e?Br(a,e):gl(a)),{replace:!0})},[l,p,e,a]),w=s.useMemo(()=>t??Oce(),[t,n]);s.useEffect(()=>{t||e&&!h||l(e?zw(a,e,w):vl(a,w),{replace:!0,state:r})},[t,w,e,h,a,l,r]);const y=s.useRef(null),b=s.useMemo(()=>t?Ire(a.id,t):null,[a.id,t]);return e&&!h?o.jsx(Ta,{to:Br(a,e),replace:!0}):b?o.jsx(Ta,{to:Br(a,b),replace:!0}):o.jsx($ce,{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:m,onStartOver:()=>l(vl(a),{replace:!0,state:r}),onSaved:(S,k)=>{y.current={made:S,how:k}},finish:g?ge.useInAShot:ge.openScene,onDone:(S,k)=>{var C,E;if(!(k!=null&&k.existing)&&!w1(a,S)){l(gl(a),{replace:!0});return}if(!(k!=null&&k.existing)){const A=w1(a,S),L=((C=y.current)==null?void 0:C.made.id)===S?y.current.made:null;u({kind:"scene",id:S,name:(L==null?void 0:L.name)??(A==null?void 0:A.name)??"",verticals:(L==null?void 0:L.verticals)??(A==null?void 0:A.verticals)??[],how:((E=y.current)==null?void 0:E.how)??(e===S?"updated":"created")},{quiet:!(g&&p)})}g&&p?l(`${p.split("?")[0]}?${kd("scene",S)}&compose=1`,{replace:!0}):l(Br(a,S),{replace:!0})}},w)}function YT(){const{brand:e}=un(),t=Un(),n=jr(e);return s.useCallback(r=>{t(`${n}?product=${encodeURIComponent(r)}&compose=1${jc()}`)},[n,t])}function Ice({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:m,onPick:w,batch:y,size:b="grid"}){var k,C;const S=s.useMemo(()=>y?j2({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}):Al({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(Id,{id:e.id,previewUrl:es((C=(k=e.shots)==null?void 0:k[0])==null?void 0:C.file),title:Oo(e,"tooltip"),primary:Oo(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:S,bookmarked:h,onBookmark:p,chosen:g,batching:m,onPick:w,size:b})}function Fce(e){return o.jsx(f2,{...e})}const qT=s.memo(Ice);function _ce({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,size:h="grid"}){const p=b1(e.category)??e.category,{contentArriving:g}=Mn(),m=s.useMemo(()=>Al({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(Id,{id:e.id,previewUrl:e.previewUrl,pending:!e.previewUrl&&g,title:`${Oo(e,"tooltip")} · ${p}`,primary:Oo(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:m,bookmarked:u,onBookmark:f,size:h})}const XT=s.memo(_ce),Vce=8,N6="__bookmarked";function Zce(){var Et;const{brand:e,products:t,productsLoaded:n,refreshProducts:r}=un(),a=((Et=ZR())==null?void 0:Et.importing)??!1,{demoProducts:i,applyBrand:l,refreshBrands:u}=Mn(),{push:f}=rr(),h=n&&t.length===0,p=Un(),g=YT(),m=Bl(),{q:w,setQ:y,facets:b,setFacets:S,clearSearch:k,clear:C}=gf(["category","bookmarked"]),E=b.category,A=b.bookmarked==="1",[L,$]=s.useState(()=>Ad("product",e.id)),N=Xe=>$(k2("product",e.id,Xe)),j=Gy(`${e.id}|${w}|${E??""}|${A?"1":""}`),[P,R]=Pa(Qr.wallDensity,Sd),H=eu(P),D=s.useCallback(Xe=>R(Xe),[R]),U=s.useMemo(()=>d2(H),[H]),_=c2(H),B=s.useMemo(()=>{const Xe=a?t.filter(rt=>{var nt;return(((nt=rt.shots)==null?void 0:nt.length)??0)>0}):t;return ER(Xe).map(rt=>({product:rt,category:dy(rt),own:!0}))},[t,a]),K=s.useMemo(()=>i.map(Xe=>({product:Xe,category:Xe.category,own:!1})),[i]),V=s.useMemo(()=>[...B,...K],[B,K]),O=s.useMemo(()=>V.reduce((Xe,rt)=>Xe+(L.includes(rt.product.id)?1:0),0),[V,L]),I=A&&O===0,Y=I&&h,Z=I&&!h,X=s.useMemo(()=>{const Xe=new Map;for(const{category:rt}of V)rt&&Xe.set(rt,(Xe.get(rt)??0)+1);return Xe},[V]),z=s.useMemo(()=>y1.filter(Xe=>X.has(Xe.key)),[X]),J=V.length>0?"tabs":"none",he=s.useCallback(Xe=>p(Aa(e,Xe)),[p,e]),[te,me]=s.useState(null),[re,ee]=s.useState(!1),[q,ie]=s.useState(null),[Oe,ae]=s.useState(!1),[pe,Te]=s.useState(null),[gt,Ze]=s.useState(!1),tt=s.useCallback(Xe=>{const rt=t.find(nt=>nt.id===Xe);rt&&me(rt)},[t]),De=Xe=>Xe.origin==="catalog"||Xe.id.startsWith("cat-"),Se=s.useCallback(Xe=>{const rt=t.find(nt=>nt.id===Xe);!rt||De(rt)||(Te(null),ie(rt))},[t]),Q=async Xe=>{if(!(!q||Oe)){ae(!0),Te(null);try{l(await Ee.updateProduct(e.id,q.id,{name:Xe})),ie(null)}catch(rt){const nt=ln(rt,"Could not rename this product");Te([nt.title,nt.detail].filter(Boolean).join(" "))}finally{ae(!1)}}},je=async()=>{if(!te||re)return;ee(!0);const Xe=te.origin==="catalog"||te.id.startsWith("cat-");try{Xe?(await Ee.deleteCatalogProduct(e.id,te.id),await r()):l(await y4(e.id,te.id)),j.forget(te.id),me(null)}catch(rt){(rt==null?void 0:rt.status)===404?(await Promise.all([u(),r()]),j.forget(te.id),me(null)):f(ln(rt,"Could not delete this product"))}finally{ee(!1)}},Re=s.useCallback(Xe=>Xe.filter(({product:rt})=>Y||!A||L.includes(rt.id)).filter(({category:rt})=>!E||rt===E).filter(({product:rt,category:nt})=>Io([Ly(rt),b1(nt)].filter(Boolean).join(" "),w)).map(({product:rt})=>rt),[E,w,A,L,Y]),se=s.useMemo(()=>Re(B),[Re,B]),G=s.useMemo(()=>Re(K),[Re,K]),{visible:oe,remaining:Ne,showMore:Ue}=C1(se,`${E??""}|${A?"keepers":""}|${w}`),[st,Pe]=s.useState(null);s.useEffect(()=>{if(!st||Ne<=0)return;const Xe=st.closest(".sc-home"),rt=new IntersectionObserver(nt=>{nt.some(qt=>qt.isIntersecting)&&Ue()},{root:Xe,rootMargin:"200% 0px"});return rt.observe(st),()=>rt.disconnect()},[st,Ne,Ue]);const Ie={key:"category",label:"Category",everyLabel:"All products",everyCount:V.length,selected:A?N6:E,onSelect:Xe=>S(Xe===N6?{bookmarked:"1",category:null}:{bookmarked:null,category:Xe}),options:[{value:N6,label:"Keepers",count:O},...z.map(Xe=>({value:Xe.key,label:Xe.label,count:X.get(Xe.key)??0}))]},Ge=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>m("product"),children:[o.jsx(gr,{size:12})," Add product"]}),ft=h,bt=t.length>0,at=o.jsx(A2,{title:"Products",filters:o.jsx(N2,{mode:J,group:Ie}),density:o.jsx(u2,{value:H,onChange:D}),search:V.length>=Vce&&o.jsx(zd,{value:w,onChange:y,noun:"products",total:V.length})}),Zt=Xe=>{const rt=t.find(qt=>qt.id===Xe);return rt&&rt.origin==="catalog"||Xe.startsWith("cat-")?Ee.deleteCatalogProduct(e.id,Xe):y4(e.id,Xe)},jt=()=>{const Xe=[...j.ids];Xe.length===1?tt(Xe[0]):Ze(!0)},Ft=[...j.ids],Pt=Ft.length>0&&Ft.every(Xe=>L.includes(Xe)),$t=()=>$($y("product",e.id,Ft,!Pt)),ke=C2(j.ids.size,Pt,"products"),Je=async()=>{if(re)return;const Xe=[...j.ids];ee(!0);try{const{failed:rt,error:nt}=await sm(Xe,Zt);await Promise.all([u(),r()]),j.retain(rt),Ze(!1),nt&&f(ln(nt,"Could not delete these products"))}finally{ee(!1)}};return o.jsx(cf.Provider,{value:_,children:o.jsxs(ds,{children:[o.jsxs("main",{className:"sc-looks sc-products",id:"main","data-hero":ft||void 0,onClick:j.onBlank,children:[n&&!ft&&at,!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":_,style:U,"aria-hidden":!0,children:o.jsx(Fce,{size:"grid",count:8})}),bt&&oe.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":_,style:U,children:oe.map(Xe=>o.jsx(qT,{product:Xe,variant:"use",size:"grid",onOpen:he,href:Aa(e,Xe.id),onUse:g,bookmarked:L.includes(Xe.id),onBookmark:N,onDelete:tt,onRename:De(Xe)?void 0:Se,chosen:j.ids.has(Xe.id),batching:j.batching==="product",onPick:j.picking("product")?rt=>j.toggle("product",rt):void 0,batch:j.kind==="product"&&j.ids.has(Xe.id)?{count:j.ids.size,onAct:jt,onKeep:$t,allKept:Pt}:null},Xe.id))}),Ne>0&&o.jsx("div",{ref:Pe,"aria-hidden":!0}),Ne>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Ue,children:["Show ",Math.min(Ne,60)," more"]})}),q&&o.jsx(Wy,{title:"Rename product",name:q.name,maxLength:500,busy:Oe,error:pe,onConfirm:Xe=>void Q(Xe),onDismiss:()=>{Oe||ie(null)}}),te&&o.jsx(Xn,{label:"Delete product",title:`Delete ${te.name}?`,body:Ai("product",1),open:!0,busy:re,onOpenChange:Xe=>{!Xe&&!re&&me(null)},onConfirm:()=>void je()}),gt&&o.jsx(Xn,{label:cs("product",j.ids.size).menu,title:`${cs("product",j.ids.size).menu}?`,body:Ai("product",j.ids.size),open:!0,busy:re,onOpenChange:Xe=>{!Xe&&!re&&Ze(!1)},onConfirm:()=>void Je()})]}),ft&&o.jsx(Mo,{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:Ge}),bt&&oe.length>0&&G.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri products"})}),ft&&K.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Yy,{label:"Or borrow one of ours"}),at]}),n&&G.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:U,children:G.map(Xe=>o.jsx(XT,{product:Xe,variant:"use",size:"grid",onUse:g,onOpen:he,href:Aa(e,Xe.id),bookmarked:L.includes(Xe.id),onBookmark:N},Xe.id))}),n&&Z&&o.jsx(Mo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a product from its card and it stays here.",mark:Uy,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>S({bookmarked:null}),children:"Browse every product"})}),n&&!Z&&se.length===0&&G.length===0&&o.jsx(M2,{noun:"products",q:w,facet:A?"Keepers":E?b1(E):null,onClearSearch:k,onClearAll:C})]}),o.jsxs("div",{className:"sc-wall-dock",children:[j.kind==="product"&&j.ids.size>0&&o.jsx(Ky,{count:j.ids.size,loaded:oe.length,tool:cs("product",j.ids.size).tool,icon:cs("product",j.ids.size).icon,danger:!0,onAct:jt,keep:{label:ke.tool,filled:Pt,onAct:$t},onClear:j.clear,onSelectAll:()=>j.selectAll("product",oe.map(Xe=>Xe.id))}),o.jsx(By,{})]})]})})}function zce({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(A=>A.file===f)??e[0],[e,f]);s.useEffect(()=>{var A;e.length&&!e.some(L=>L.file===f)&&h(((A=e[0])==null?void 0:A.file)??null)},[e,f]);const g=p?e.findIndex(A=>A.file===p.file):-1,m=!!l&&g>0,w=!!u&&!!p&&e.length>1,y=!!(r&&i&&e.length>0),b=e.length>1||y,{shellRef:S,railRef:k,page:C}=rT(e.length),E=A=>{const L=A==null?void 0:A[0];L&&(i==null||i(L))};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:A=>{A.preventDefault(),A.dataTransfer.dropEffect="copy"},onDrop:A=>{A.preventDefault(),E(A.dataTransfer.files)},children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:A=>{E(A.target.files),A.target.value=""}}),a?o.jsx(Tr,{size:"2"}):o.jsx(gr,{size:22,weight:"bold"}),o.jsx("span",{children:"Add a reference"})]}):o.jsx("span",{className:"sc-refstage-blank",children:o.jsx(Oa,{size:22})})}),b&&o.jsxs("div",{className:"sc-refrail-shell",ref:S,children:[o.jsxs("div",{className:"sc-refrail-track",children:[o.jsx("button",{type:"button",className:"sc-refrail-arrow prev","aria-label":"Previous references",onClick:()=>C(-1),children:o.jsx(Ha,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-refrail-arrow next","aria-label":"Next references",onClick:()=>C(1),children:o.jsx(Rl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-refrail",ref:k,children:e.map((A,L)=>o.jsx("button",{type:"button",className:"sc-refrail-item","data-on":(p==null?void 0:p.file)===A.file?"":void 0,"data-spare":L>=t?"":void 0,"aria-label":`Reference ${L+1}`,"aria-pressed":(p==null?void 0:p.file)===A.file,onClick:()=>h(A.file),children:o.jsx("img",{src:A.url,alt:"",loading:"lazy"})},A.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:A=>{E(A.target.files),A.target.value=""}}),a?o.jsx(Tr,{size:"1"}):o.jsx(gr,{size:16,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:r})]})]}),(m||w)&&o.jsx("div",{className:"sc-refacts",children:o.jsxs("span",{className:"sc-refacts-pair",children:[m&&o.jsxs("button",{type:"button",className:"sc-refact sc-refact-lead",onClick:()=>l==null?void 0:l(p.file),children:[o.jsx(jF,{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 Bce({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 Uce({value:e,onChange:t}){const n=b1(e)??"Other",r=e&&y1.some(a=>a.key===e)?e:"other";return o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-pdetails-field sc-catpick","aria-label":`Category: ${n}`,children:[n,o.jsx(kl,{size:11,weight:"bold"})]})}),o.jsx(js,{align:"center",sideOffset:8,children:o.jsx(Rp,{value:r,children:y1.map(a=>o.jsx(Gu,{value:a.key,onSelect:()=>t(a.key),children:a.label},a.key))})})]})}const M6='mm|cm|inches|inch|in|m|"';function nS(e){if(!e)return;const t=e.toLowerCase();return t==='"'||t==="inch"||t==="inches"?"in":t==="mm"||t==="cm"||t==="m"||t==="in"?t:void 0}function R1(e){const t=Number(e.trim().replace(",","."));return e.trim()&&Number.isFinite(t)&&t>0?String(t):""}const yf=["height","width","depth"],wv={height:"Height",width:"Width",depth:"Depth"};function QT(e){var f,h,p,g,m,w;const t={unit:"cm",height:"",width:"",depth:""},n=e.trim();if(!n||!new RegExp(M6,"i").test(n))return t;const r={},a=(y,b)=>{if(r[b])return;const S=n.match(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${M6})?\\s*(?:${y})\\b`,"i"));if(!S)return;const k=R1(S[1]);k&&(r[b]={value:k,unit:nS(S[2])})};a("tall|high","height"),a("across|wide","width"),a("long","width"),a("deep","depth");const i=yf.filter(y=>r[y]);if(i.length){const y=new Set(i.map(b=>{var S;return(S=r[b])==null?void 0:S.unit}).filter(b=>!!b));return y.size>1?t:{unit:[...y][0]??"cm",height:((f=r.height)==null?void 0:f.value)??"",width:((h=r.width)==null?void 0:h.value)??"",depth:((p=r.depth)==null?void 0:p.value)??""}}const l=[];for(const y of n.matchAll(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${M6})?`,"gi"))){const b=R1(y[1]);b&&l.push({value:b,unit:nS(y[2])})}if(!l.length)return t;const u=l.map(y=>y.unit).filter(y=>!!y);return!u.length||new Set(u).size>1?t:{unit:u[u.length-1],height:((g=l[0])==null?void 0:g.value)??"",width:((m=l[1])==null?void 0:m.value)??"",depth:((w=l[2])==null?void 0:w.value)??""}}function Wce(e){const t=QT(e),n=yf.flatMap(i=>t[i]?[`${wv[i]} ${t[i]} ${t.unit}`]:[]);if(n.length)return n;const r=e.trim();if(!r)return[];const a=r.replace(/^about\s+/i,"");return[a.charAt(0).toUpperCase()+a.slice(1)]}const Kce={height:"tall",width:"across",depth:"deep"};function Gce(e){return yf.map(t=>{const n=R1(e[t]);return n?`${n} ${e.unit} ${Kce[t]}`:""}).filter(Boolean).join(" and ")}function Yce(e,t){return yf.every(n=>R1(e[n])===R1(t[n]))}function qce({size:e,category:t,busy:n,error:r,onSave:a,onDismiss:i}){const l=t??"other",u=(e==null?void 0:e.text)??"",[f]=s.useState(()=>QT(u)),[h,p]=s.useState(f),[g,m]=s.useState(l),w=(k,C)=>k.trim().toLowerCase()===C.trim().toLowerCase(),y=Yce(h,f)?u:Gce(h),b=()=>{if(!n){if(w(y,u)&&g===l)return i();a({size:y,category:g})}},S=(e==null?void 0:e.by)==="person"?"Yours. Clear it to go back to the size read from its photo.":(e==null?void 0:e.by)==="record"?"From your store's listing.":e?"Read from its photo.":"Not read yet.";return o.jsxs(Gs,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:i,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(As,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ns,{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("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Category"}),o.jsx(Uce,{value:g,onChange:m}),o.jsx("span",{className:"sc-pdetails-hint",children:"Where it is filed, so it surfaces with that kind of product."})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Size"}),o.jsx("div",{className:"sc-size",children:yf.map(k=>o.jsxs("label",{className:"sc-size-dim",children:[o.jsx("span",{className:"sc-size-name",children:wv[k]}),o.jsxs("span",{className:"sc-size-box",children:[o.jsx("input",{className:"sc-pdetails-field",inputMode:"decimal","aria-label":wv[k],value:h[k],onChange:C=>p({...h,[k]:C.target.value}),onKeyDown:C=>C.key==="Enter"&&b()}),o.jsx("span",{className:"sc-size-unit","aria-hidden":!0,children:h.unit})]})]},k))}),o.jsx("span",{className:"sc-pdetails-hint",children:S})]}),r&&o.jsx("p",{className:"sc-assetform-err",children:r})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:i,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-busy":n||void 0,onClick:b,children:n?"Saving":"Save"})]})]})}const Xce=3;function Qce(e){const t=e,n=(t.brand??t.vendor??"").trim();return!n||e.name.toLowerCase().startsWith(n.toLowerCase())?null:n}function Jce(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim()}function eue(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 tue(){var Pe;const{productId:e=""}=ia(),{brand:t,products:n,productsLoaded:r,refreshProducts:a}=un(),{demoProducts:i,demoProductsLoaded:l,applyBrand:u,refreshBrands:f}=Mn(),h=Un(),p=YT(),{push:g}=rr(),[m,w]=s.useState(!1),[y,b]=s.useState(!1),[S,k]=s.useState(null),C=s.useRef(null),E=s.useRef({}),A=s.useRef(!1),L=R2(),$=n.find(Ie=>Ie.id===e),[N,j]=s.useState(null);s.useEffect(()=>{if(($==null?void 0:$.origin)!=="catalog"){j(null);return}let Ie=!0;return Ee.libraryProduct(t.id,$.id).then(Ge=>{Ie&&j(Ge.product)}).catch(()=>{}),()=>{Ie=!1}},[t.id,$]);const P=N&&$&&N.id===$.id?{...N,...$,shots:N.shots}:$,R=s.useMemo(()=>P?void 0:i.find(Ie=>Ie.id===e),[P,i,e]);Xc((Pe=P??R)==null?void 0:Pe.name);const[H,D]=s.useState([]);s.useEffect(()=>{if(!R){D([]);return}let Ie=!0;return Ee.demoProductFrames(R.id).then(Ge=>{Ie&&D(Ge.frames)}).catch(()=>{Ie&&D([])}),()=>{Ie=!1}},[R==null?void 0:R.id]);const U=s.useRef(R==null?void 0:R.id);U.current=R==null?void 0:R.id,E2(()=>{const Ie=R==null?void 0:R.id;Ie&&Ee.demoProductFrames(Ie).then(Ge=>{U.current===Ie&&D(ft=>ki(ft,Ge.frames))}).catch(()=>{})});const[_,B]=s.useState((P==null?void 0:P.name)??"");s.useEffect(()=>{B((P==null?void 0:P.name)??"")},[P==null?void 0:P.id]);const K=qy(t.id,[e??""]),[V,O]=s.useState(null),[I,Y]=s.useState(!1),[Z,X]=s.useState(!1),[z,J]=s.useState(null),he=!!(P??R);s.useEffect(()=>{if(O(null),!he||!e)return;let Ie=!0;return Ee.productSize(t.id,e).then(Ge=>{Ie&&O(Ge.size)}).catch(()=>{}),()=>{Ie=!1}},[t.id,e,he]);const te=async Ie=>{if(!e)return!1;const Ge=L();X(!0),J(null);try{const ft=await Ee.setProductSize(t.id,e,Ie);return Ge()&&(O(ft.size),Y(!1)),!0}catch(ft){return J(String(ft.message??ft)),!1}finally{X(!1)}},me=((P==null?void 0:P.origin)??"manual")==="manual",re=async(Ie,Ge)=>{Ge&&Ie&&typeof Ie=="object"&&"json"in Ie?u(Ie):await a()},ee=Ie=>{if(!P||A.current)return;E.current={...E.current,...Ie},C.current&&clearTimeout(C.current);const Ge=t.id,ft=P.id,bt=me;C.current=setTimeout(()=>{C.current=null;const at=E.current;E.current={},(bt?Ee.updateProduct(Ge,ft,at):Ee.updateCatalogProduct(Ge,ft,at)).then(jt=>re(jt,bt)).catch(jt=>k(String(jt.message??jt)))},500)},q=async Ie=>{const Ge=(V==null?void 0:V.text)??"",ft=Ie.size.trim().toLowerCase()!==Ge.trim().toLowerCase();ft&&!await te(Ie.size)||(Ie.category!==(gt??"other")&&ee({category:Ie.category}),ft||Y(!1))},ie=async Ie=>{const Ge=me;w(!0),k(null);try{await re(await Ie,Ge)}catch(ft){k(String(ft.message??ft))}finally{w(!1)}},Oe=async()=>{if(!P||A.current)return;A.current=!0,C.current&&clearTimeout(C.current),C.current=null,E.current={};const Ie=L(),Ge=sd(t),ft=P.origin==="catalog"||P.id.startsWith("cat-");b(!0),k(null);try{ft?(await Ee.deleteCatalogProduct(t.id,P.id),await a()):u(await y4(t.id,P.id))}catch(bt){if((bt==null?void 0:bt.status)!==404){A.current=!1,Ie()&&(k(String(bt.message??bt)),b(!1));return}await Promise.all([f(),a()])}Ie()&&h(Ge,{replace:!0})};if(!P&&!R&&(!l||!r))return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-refskeleton sc-wait-late","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(!P&&!R)return o.jsx(ds,{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(Vn,{className:"sc-btn sc-btn-primary",to:sd(t),children:"Browse products"})})]})});const ae=R?"none":me?"full":"fields",pe=P??R,Te=(P==null?void 0:P.id)??R.id,gt=P?dy(P):(R==null?void 0:R.category)??null,Ze=Qce(pe),tt=Ie=>{const Ge=es(Ie.file);return Ge?[{file:Ie.file,url:Ge,angle:Ie.angle}]:[]},De=R?H.map(Ie=>({file:Ie.angle,url:Ie.url,angle:Ie.angle})):((P==null?void 0:P.shots)??[]).flatMap(tt),Se=Ie=>{const Ge=De.map(bt=>bt.file),ft=Ge.indexOf(Ie)+1;ie(Ee.setProductShots(t.id,Te,Ge.filter(bt=>bt!==Ie))).then(()=>g({kind:"success",title:"Reference removed",detail:`Reference ${ft} of ${Ge.length}`,action:{label:"Undo",onClick:()=>void ie(Ee.setProductShots(t.id,Te,Ge))}}))},Q=R?"Our reference set. Yours replaces it.":De.length===0?me?"No reference yet.":"No reference yet. Images from your store are still arriving.":De.length===1?"One angle. A shot has to guess at every side it can't see.":De.length===2?"Two angles. A third pins the shape.":"The first three build every shot. Remove any that show a different colour or version.",je=ae==="none"?null:"Add image",Re=P!=null&&P.descriptionHtml?eue(Jce(P.descriptionHtml),200):"",se=(R==null?void 0:R.description)||Re||null,G=Wce((V==null?void 0:V.text)??""),oe=R?[R.subcategory]:[P==null?void 0:P.variant,P==null?void 0:P.material,G.length?null:P==null?void 0:P.dimensions],Ne=b1(gt),Ue=oe.filter(Boolean),st=R?i.filter(Ie=>Ie.id!==Te).slice(0,8):n.filter(Ie=>Ie.id!==Te).slice(0,8);return o.jsx(ds,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsx(Xy,{to:sd(t),wall:"Products",where:R?"Scenri library":me?"Yours":"From your store"}),Ze&&o.jsx("p",{className:"sc-lookpage-house",children:o.jsx("em",{className:"sc-accent",children:Ze})}),ae==="full"?o.jsx(Bce,{label:"Product name",value:_,onChange:Ie=>{B(Ie),ee({name:Ie})}}):o.jsx("h1",{dir:"auto",children:pe.name}),(Ne||G.length>0)&&o.jsxs("div",{className:"sc-lookpage-marks",children:[Ne&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:o.jsx("li",{className:"sc-chip","data-static":!0,children:Ne})}),G.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Size",children:G.map(Ie=>o.jsx("li",{className:"sc-chip","data-static":!0,children:Ie},Ie))})]}),se&&o.jsx("p",{className:"sc-lookpage-lede",children:se}),Ue.length>0&&o.jsx("p",{className:"sc-lookpage-facts",children:Ue.join(" · ")}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>p(Te),children:"Use in a shot"}),o.jsx(Qy,{kind:"product",brandId:t.id,id:Te}),ae!=="none"&&o.jsx(hr,{label:"Edit details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit details","aria-haspopup":"dialog",onClick:()=>{J(null),Y(!0)},children:o.jsx(Rd,{size:17})})})]}),S&&o.jsx("p",{className:"sc-assetform-err",children:S}),o.jsx(zce,{refs:De,cap:Xce,note:Q,addLabel:je,busy:m,onAdd:ae==="none"?void 0:Ie=>void ie(tG(t.id,Te,Ie)),onPromote:ae==="none"?void 0:Ie=>void ie(Ee.setProductShots(t.id,Te,[Ie,...De.map(Ge=>Ge.file).filter(Ge=>Ge!==Ie)])),onRemove:ae==="none"?void 0:Se}),K.length>0&&o.jsx(cd,{label:`Shots featuring ${pe.name}`,children:K.map(Ie=>o.jsx(cy,{node:Ie,to:e2(t,null,Ie.id)},Ie.id))}),st.length>0&&o.jsx(cd,{label:R?"Other products in the library":"Other products",children:st.map(Ie=>R?o.jsx(XT,{product:Ie,variant:"navigate",size:"slider",onOpen:Ge=>h(Aa(t,Ge)),href:Aa(t,Ie.id)},Ie.id):o.jsx(qT,{product:Ie,variant:"navigate",size:"slider",onOpen:Ge=>h(Aa(t,Ge)),href:Aa(t,Ie.id)},Ie.id))}),I&&o.jsx(qce,{size:V,category:gt,busy:Z,error:z,onSave:Ie=>void q(Ie),onDismiss:()=>Y(!1)}),P&&o.jsx("div",{className:"sc-ownedbits",children:o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Xn,{label:"Delete product",title:`Delete ${P.name}?`,body:Ai("product",1),busy:y,onConfirm:()=>void Oe()})})})]})})}function nue(e,t){const n=new Map(e);let r=0,a=0,i=0;const l=[];for(const f of t){n.set(f.id,f.status);const h=e.get(f.id);if(h!==f.status){if(h===void 0){f.status==="running"&&(r+=1);continue}f.status==="done"?a+=1:f.status==="error"?l.push(f.error):f.status==="cancelled"&&(i+=1)}}const u=[];return r&&u.push(r===1?"Generating shot.":`Generating ${r} shots.`),a&&u.push(a===1?"Shot ready.":`${a} shots ready.`),l.length===1?u.push(`Shot failed${l[0]?`: ${l[0]}`:"."}`):l.length&&u.push(`${l.length} shots failed.`),i&&u.push(i===1?"Shot cancelled.":`${i} shots cancelled.`),{messages:u,next:n}}const rue=[{label:"Generate",keys:["cmd","enter"]},{label:"Jump to the prompt",keys:["/"]},{label:"Product menu",keys:["$"]},{label:"Place menu",keys:["/"]},{label:"Person 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 sue({open:e,onOpenChange:t}){return o.jsx(Hw,{open:e,onOpenChange:t,children:o.jsxs(Ow,{maxWidth:"360px","aria-describedby":void 0,children:[o.jsx(Iw,{children:"Shortcuts"}),o.jsx("div",{className:"sc-keys",children:rue.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))})]})})}function ib({img:e,ready:t,index:n=0,since:r,onDone:a}){const i=s.useRef(null),[l,u]=s.useState(!1);return s.useLayoutEffect(()=>{const f=i.current;if(!f||t)return;const h=O4(f,Y0(f),n,null),p=f.getBoundingClientRect();h.size(p.width,p.height),h.draw(performance.now()/1e3);const g=m=>h.draw(m);return cR(g),()=>uR(g)},[t]),s.useLayoutEffect(()=>{const f=i.current,h=e.current;if(!f||!h||!t)return;const p=f.getBoundingClientRect(),g=performance.now(),m=r??g,w=$q(f,h,Y0(f),n,p.width,p.height,m/1e3);let y=Math.min(w.ms,g-m);w.draw(y/w.ms);let b=g,S=requestAnimationFrame(function k(C){y+=Math.min(50,Math.max(0,C-b)),b=C;const E=Math.min(1,y/w.ms);w.draw(E),E<1?S=requestAnimationFrame(k):u(!0)});return()=>cancelAnimationFrame(S)},[t]),s.useEffect(()=>{l&&a()},[l,a]),o.jsx("canvas",{ref:i,className:"sc-arrival","aria-hidden":!0})}const R6=V4,aue=Z4;function oue({src:e,fallback:t,alt:n="",aspect:r,guess:a=!0,arrival:i,index:l=0}){const[u,f]=s.useState(!1),h=u&&t?t:e,[p,g]=s.useState(!1),[m,w]=s.useState(!1),[y,b]=s.useState(()=>R6(h)),[S,k]=s.useState(h);h!==S&&(k(h),g(!1),w(!1),b(R6(h)));const C=s.useRef(null),E=s.useCallback(()=>{aue(h),g(!0)},[h]),A=s.useCallback(j=>{C.current=j,j!=null&&j.complete&&j.naturalWidth&&E()},[E]);s.useLayoutEffect(()=>{const j=C.current;j!=null&&j.complete&&j.naturalWidth&&E()},[E]);const[L,$]=s.useState(()=>!i||g1()?null:R6(h)?rS(h)!==void 0?"run":null:"hold");L==="hold"&&p&&(JT.set(h,performance.now()),$("run"));const N=s.useCallback(()=>$(null),[]);return o.jsx("span",{className:"sc-cellimg","data-loaded":p||void 0,"data-cached":y||void 0,"data-guess":a||void 0,"data-broken":m||void 0,style:r?{"--sc-cell-ar":r}:void 0,children:m?o.jsx(Oa,{className:"sc-cellimg-broken",size:24,weight:"regular","aria-hidden":!0}):o.jsxs(o.Fragment,{children:[!p&&!y&&L!=="hold"&&o.jsx("span",{className:"sc-placeholder"}),o.jsx("img",{ref:A,src:h,alt:n,loading:y?"eager":"lazy",decoding:y?"sync":"async",onLoad:()=>E(),onError:()=>{t&&!u?f(!0):w(!0)}}),L&&o.jsx(ib,{img:C,ready:L==="run",index:l,since:rS(h),onDone:N})]})})}const JT=new Map,rS=e=>{const t=JT.get(e);return t!==void 0&&performance.now()-t<2e3?t:void 0};function e$({name:e}){return o.jsx(ld,{name:e})}function iue({node:e,chosen:t,picking:n,batching:r,armed:a,menu:i,onPick:l,onBranch:u,onToggleKeep:f,onArchive:h,onDelete:p}){const g=Hr(e),m=sy(),w=(b,S)=>yR(b,S,m),y=()=>{const b=e.images[0];if(!b)return;const S=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",k=document.createElement("a");k.href=Dr(b),k.download=`${S}.png`,k.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(Gn,{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(Gn,{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(Es,{children:[w("More",o.jsx(Cs,{children:o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-more","aria-label":`More for ${g}`,children:o.jsx(Vv,{size:16,weight:"bold"})})})),o.jsx(js,{align:"end",sideOffset:4,collisionPadding:12,children:i.map(b=>o.jsxs("span",{style:{display:"contents"},children:[b.separated&&o.jsx(Ec,{}),o.jsxs(Wn,{color:b.danger?"red":void 0,onSelect:b.onSelect,children:[o.jsx(e$,{name:b.icon}),b.label]})]},b.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(cC,{size:15,weight:"bold"})})),e.images[0]&&w("Download",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Download ${g}`,onClick:y,children:o.jsx(BE,{size:15})})),e.archived?p&&w("Delete permanently",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Delete ${g} permanently`,onClick:()=>p(e),children:o.jsx(Pl,{size:15})})):h&&w("Archive",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Archive ${g}`,onClick:()=>h(e),children:o.jsx(vm,{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(to,{size:15,weight:e.kept?"fill":"regular"})}))]})})]})}function t$(e,t){return e>1?`Remove ${e} shots from ${t}`:`Remove from ${t}`}function qh(e,t,n){return e>1?n(e):t}function lue(e,{chosen:t,batching:n,versions:r,onOpen:a,onBranch:i,onPick:l,onVersions:u,onToggleKeep:f,onArchive:h,onDeletePermanently:p,shotHref:g,inSet:m,filedIn:w,onRemoveFromSet:y,batch:b}){const S=[{key:"open",icon:"open",label:"Open",onSelect:()=>a(e.id)}];g&&S.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(g(e.id),"_blank")}),i&&!n&&S.push({key:"branch",icon:"refine",label:"Refine",onSelect:()=>i(e.id)});const k=!!(n&&t&&b&&b.count>0),C=!!(k&&b&&b.count>1);l&&S.push({key:"pick",icon:"select",label:t?C?"Deselect this shot":"Deselect":"Select",onSelect:()=>l(e.id)});const E=N=>N?"Remove from Keepers":"Add to Keepers",A=(N,j)=>N?`Remove ${j} shots from Keepers`:`Add ${j} shots to Keepers`;k&&b?S.push({key:"keep",icon:b.allKept?"kept":"keep",label:qh(b.count,E(b.allKept),N=>A(b.allKept,N)),onSelect:b.onKeep,separated:C}):f&&S.push({key:"keep",icon:e.kept?"kept":"keep",label:E(e.kept),onSelect:()=>f(e)});const L=k?b==null?void 0:b.onRemoveFromSet:y,$=k?m?[m]:[]:m?[m]:w??[];if(L)for(const N of $)S.push({key:`unset-${N.id}`,icon:"unset",label:t$(k&&b?b.count:1,N.name),onSelect:()=>L(N)});return r>0&&u&&!n&&S.push({key:"versions",icon:"versions",label:`Show ${r} version${r===1?"":"s"}`,onSelect:()=>u(e.id)}),k&&b?(S.push({key:"archive",icon:b.archived?"restore":"archive",label:b.archived?qh(b.count,"Restore",N=>`Restore ${N} shots`):qh(b.count,"Archive",N=>`Archive ${N} shots`),onSelect:b.archived?b.onRestore:b.onArchive,danger:!b.archived,separated:!0}),b.archived&&S.push({key:"delete",icon:"delete",label:qh(b.count,"Delete permanently",N=>`Delete ${N} shots permanently`),onSelect:b.onDelete,danger:!0,separated:!0})):(h&&S.push({key:"archive",icon:e.archived?"restore":"archive",label:e.archived?"Restore":"Archive",onSelect:()=>h(e),danger:!e.archived,separated:!0}),p&&e.archived&&S.push({key:"delete",icon:"delete",label:"Delete permanently",onSelect:()=>p(e),danger:!0,separated:!0})),S}function n$(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:vi((l=e.brief)==null?void 0:l.format),guess:!0}}const cue=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 m=lue(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(ef,{children:[o.jsx(tf,{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(Vn,{className:"sc-cell-open",to:f.shotHref(t.id),"aria-label":l?`${a?"Deselect":"Select"} ${Hr(t)}`:`Open ${Hr(t)}`,onClick:w=>{var y;l&&(w.preventDefault(),(y=f.onPick)==null||y.call(f,t.id))},children:o.jsx(oue,{src:vn(t.images[0],"tile"),fallback:Dr(t.images[0]),arrival:uue(t),index:t.batchIndex,...n$(t,0)})}),o.jsx(iue,{node:t,chosen:a,picking:i,batching:l,armed:r,menu:m,onPick:f.onPick,onBranch:f.onBranch,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDelete:f.onDeleteAsk})]})}),o.jsx(nf,{children:m.map(w=>o.jsxs("span",{style:{display:"contents"},children:[w.separated&&o.jsx(Xm,{}),o.jsxs(rf,{color:w.danger?"red":void 0,onSelect:w.onSelect,children:[o.jsx(e$,{name:w.icon}),w.label]})]},w.key))})]})});function uue(e){const t=qa(Xa(e));return Number.isFinite(t)&&Date.now()-(t+(e.durationMs??0))<9e4}const due=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":vi((i=t.brief)==null?void 0:i.format)},children:[o.jsxs(Vn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Hr(t)}, still rendering`,children:[o.jsx($a,{index:t.batchIndex,since:Xa(t)}),o.jsx(eT,{since:Xa(t)})]}),a&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-cancel",onClick:()=>a(t),children:"Cancel"})]})}),fue=s.memo(function({node:t,selected:n,shotHref:r,engineName:a,onRetry:i,onArchive:l}){var h;const u=t.status==="cancelled",f=u?DM():uo(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,style:(h=t.brief)!=null&&h.format?{"--sc-cell-ar":vi(t.brief.format)}:void 0,children:[o.jsx(Vn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Hr(t)}`}),o.jsx("span",{className:"sc-cell-failed",children:o.jsx(CM,{failure:f,density:"tile",onRetry:()=>i(t),dismiss:l?{label:t.archived?"Restore":"Dismiss",onClick:()=>l(t)}:void 0})})]})}),hue=40,pue=1,sS=64,mue=e=>e>hue,gue=e=>Math.floor(e/sS)*sS,vue=112;function Xh(e,t,n){const r=Math.max(0,n-2),a=t&&t>0?t:4/5,i=Math.round(r/a)+2;return(e==="failed"&&n<=200?Math.max(i,vue):i)+id}function aS(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 wue(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 oS(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 yue(e,t){const n=t*pue;return[e-n,e+t+n]}function lb(e){const t=e.getBoundingClientRect().top,n=e.querySelector(".sc-toolbar");return n?Math.max(t,n.getBoundingClientRect().bottom):t}function bue(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 m=()=>{var k;const S=i.current;if(S&&performance.now()<S.until){a.current=S.anchor;return}i.current=null,a.current=h.scrollTop>0?xue(e,lb(h),(k=a.current)==null?void 0:k.id):null},w=()=>{if(p=0,t){const S=e.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop,k={top:gue(h.scrollTop-S),height:h.clientHeight};r(C=>C.top===k.top&&C.height===k.height?C:k)}m(),cancelAnimationFrame(g),g=requestAnimationFrame(m)},y=()=>{p||(p=requestAnimationFrame(w))};u.current=w,w(),h.addEventListener("scroll",y,{passive:!0});const b=new ResizeObserver(y);return b.observe(h),b.observe(e),()=>{cancelAnimationFrame(p),cancelAnimationFrame(g),u.current=()=>{},h.removeEventListener("scroll",y),b.disconnect()}},[e,t]),{...n,anchor:a,resync:f,hold:l}}function xue(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 kue(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 m=g.target.getAttribute("data-fb-node");if(!m)continue;const w=g.target;if(w.offsetHeight<=2||w.offsetWidth<=2)continue;const y=(w.offsetHeight-2)/(w.offsetWidth-2),b=r.current.get(m);(b===void 0||Math.abs(b-y)>.004)&&(r.current.set(m,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+id},[n])}function Sue({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:m,onBranch:w,branchingFrom:y,onVersions:b,engineName:S,tile:k,pending:C,onNearEnd:E,inSet:A,setsFor:L,onRemoveFromSet:$,onKeepPicked:N,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H}){const D=e.filter(G=>G.kind!=="root"),U=!!p,_=U&&((h==null?void 0:h.size)??0)>0,B=s.useMemo(()=>{if(!h||h.size===0)return null;let G=0,oe=0,Ne=0;for(const Ue of e)!h.has(Ue.id)||Ue.kind==="root"||(G+=1,Ue.kept&&(oe+=1),Ue.archived&&(Ne+=1));return{count:h.size,allKept:G>0&&oe===G,archived:G>0&&Ne===G}},[e,h]),[K,V]=s.useState(null),[O,I]=s.useState(!1),[Y,Z]=s.useState(null),{tile:X,cols:z}=fX(uX(Y),k,dX()<iX),[J,he]=s.useState(null);s.useEffect(()=>{if(!J||!E)return;const G=J.closest(".sc-canvas"),oe=new IntersectionObserver(Ne=>{Ne.some(Ue=>Ue.isIntersecting)&&E()},{root:G,rootMargin:"200% 0px"});return oe.observe(J),()=>oe.disconnect()},[J,E]);const te=s.useRef({onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:S,onRemoveFromSet:$,onKeepPicked:N,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H});te.current={onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:b,engineName:S,onRemoveFromSet:$,onKeepPicked:N,onArchivePicked:j,onRestorePicked:P,onDeletePicked:R,onRemovePickedFromSet:H};const me=!!f,re=!!R,ee=s.useMemo(()=>({onOpen:G=>te.current.onOpen(G),shotHref:G=>te.current.shotHref(G),onRetry:G=>te.current.onRetry(G),onCancel:i?G=>{var oe,Ne;return(Ne=(oe=te.current).onCancel)==null?void 0:Ne.call(oe,G)}:void 0,onToggleKeep:l?G=>{var oe,Ne;return(Ne=(oe=te.current).onToggleKeep)==null?void 0:Ne.call(oe,G)}:void 0,onArchive:u?G=>{var oe,Ne;return(Ne=(oe=te.current).onArchive)==null?void 0:Ne.call(oe,G)}:void 0,onBranch:w?G=>{var oe,Ne;return(Ne=(oe=te.current).onBranch)==null?void 0:Ne.call(oe,G)}:void 0,onPick:p?G=>{var oe,Ne;return(Ne=(oe=te.current).onPick)==null?void 0:Ne.call(oe,G)}:void 0,onVersions:b?G=>{var oe,Ne;return(Ne=(oe=te.current).onVersions)==null?void 0:Ne.call(oe,G)}:void 0,onDeleteAsk:me?G=>V(G):void 0,engineName:S?G=>{var oe,Ne;return(Ne=(oe=te.current).engineName)==null?void 0:Ne.call(oe,G)}:void 0,onRemoveFromSet:$?(G,oe)=>{var Ne,Ue;return(Ue=(Ne=te.current).onRemoveFromSet)==null?void 0:Ue.call(Ne,G,oe)}:void 0,onKeepPicked:N?()=>{var G,oe;return(oe=(G=te.current).onKeepPicked)==null?void 0:oe.call(G)}:void 0,onArchivePicked:j?()=>{var G,oe;return(oe=(G=te.current).onArchivePicked)==null?void 0:oe.call(G)}:void 0,onRestorePicked:P?()=>{var G,oe;return(oe=(G=te.current).onRestorePicked)==null?void 0:oe.call(G)}:void 0,onDeletePickedAsk:re?()=>I(!0):void 0,onRemovePickedFromSet:H?G=>{var oe,Ne;return(Ne=(oe=te.current).onRemovePickedFromSet)==null?void 0:Ne.call(oe,G)}:void 0}),[!!i,!!l,!!u,!!w,!!p,!!b,me,re,!!S,!!$,!!N,!!j,!!P,!!H]),q=[...m?Array.from({length:Math.max(1,m.count)},(G,oe)=>({key:`sending-${oe}`,node:null,said:m.said,slot:oe})):[],...D.map(G=>({key:G.id,node:G}))],ie=G=>G.status==="cancelled"||G.status==="error"||G.images.length===0,Oe=G=>{const oe=G.node;return oe?oe.status==="running"?o.jsx(due,{node:oe,selected:oe.id===t,shotHref:ee.shotHref,onCancel:ee.onCancel},oe.id):ie(oe)?o.jsx(fue,{node:oe,selected:oe.id===t,shotHref:ee.shotHref,engineName:ee.engineName,onRetry:ee.onRetry,onArchive:ee.onArchive},oe.id):o.jsx(cue,{node:oe,selected:oe.id===t,armed:oe.id===y,chosen:(h==null?void 0:h.has(oe.id))??!1,picking:U,batching:_,versions:oe.childCount,handlers:ee,inSet:A,filedIn:L==null?void 0:L(oe.id),pickedMeta:B},oe.id):o.jsxs("div",{className:"sc-cell","data-running":"true","data-sending":"true",style:m!=null&&m.format?{"--sc-cell-ar":vi(m.format)}:void 0,children:[o.jsx($a,{index:G.slot,appear:!0}),o.jsx("span",{className:"sc-cell-tag",children:"sending"}),o.jsx("span",{className:"sc-cell-said",dir:"auto",children:G.said})]},G.key)},ae=G=>{var Ne,Ue;const oe=G.node;return oe?oe.status==="running"?Xh("running",vi((Ne=oe.brief)==null?void 0:Ne.format),X):ie(oe)?Xh("failed",(Ue=oe.brief)!=null&&Ue.format?vi(oe.brief.format):3/2,X):Xh("done",n$(oe,0).aspect,X):Xh("sending",void 0,X)},pe=mue(q.length),Te=bue(Y,pe),gt=kue(Y,pe,X),Ze=xk(z),tt=`${Ze}:${X}`,De=s.useRef(tt),Se=s.useRef({items:q,heightOf:gt,estimate:ae});Se.current={items:q,heightOf:gt,estimate:ae};const Q=s.useRef(null);if(s.useLayoutEffect(()=>{const G=De.current;De.current=tt;const oe=Te.anchor.current,Ne=Y==null?void 0:Y.closest(".sc-canvas");if(!(G===tt||!oe||!Y||!Ne)){if(Q.current={anchor:oe,until:performance.now()+Eue},Te.hold(oe,Q.current.until),!iS(Y,Ne,oe)){const{items:Ue,heightOf:st,estimate:Pe}=Se.current,Ie=Ue.findIndex(at=>{var Zt;return((Zt=at.node)==null?void 0:Zt.id)===oe.id});if(Ie<0)return;const Ge=oS(Ue.length,Ze)[Ie%Ze],ft=aS(Ge.map(at=>(Ue[at].node&&st(Ue[at].node.id))??Pe(Ue[at]))),bt=Y.getBoundingClientRect().top+ft[Math.floor(Ie/Ze)];Ne.scrollTop+=bt-lb(Ne)-oe.offset}Te.resync()}},[tt,Ze,Y,Te.anchor,Te.resync,Te.hold]),s.useLayoutEffect(()=>{const G=Q.current,oe=Y==null?void 0:Y.closest(".sc-canvas");if(!(!G||!Y||!oe)){if(performance.now()>G.until){Q.current=null;return}iS(Y,oe,G.anchor)}}),s.useEffect(()=>{const G=Y==null?void 0:Y.closest(".sc-canvas");if(!G)return;const oe=()=>{Q.current=null,Te.hold(null)},Ne=["wheel","touchstart","keydown","pointerdown"];for(const Ue of Ne)G.addEventListener(Ue,oe,{passive:!0});return()=>{for(const Ue of Ne)G.removeEventListener(Ue,oe)}},[Y,Te.hold]),C&&B5(D)&&!m){const G=Math.max(1,Math.min(z,8));return o.jsx("div",{className:"sc-feed","aria-busy":"true",ref:Z,style:{"--sc-tile":`${X}px`,"--sc-cols":G},children:Array.from({length:G},(oe,Ne)=>o.jsx("div",{className:"sc-feed-col",children:Array.from({length:2},(Ue,st)=>o.jsx("div",{className:"sc-cell sc-wait-late","data-placeholder":"true",children:o.jsx("span",{className:"sc-placeholder"})},`pending-${Ne}-${st}`))},`col-${G}-${Ne}`))})}if(B5(D)&&!m)return o.jsx(o.Fragment,{children:g??o.jsx("p",{className:"sc-feed-empty",children:"Nothing here yet."})});const je=xk(z),Re=oS(q.length,je),se=pe?yue(Te.top,Te.height):null;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-feed",ref:Z,style:{"--sc-tile":`${X}px`,"--sc-cols":je},children:Re.map((G,oe)=>{const Ne=`col-${je}-${oe}`;if(!se)return o.jsx("div",{className:"sc-feed-col",children:G.map(Ge=>Oe(q[Ge]))},Ne);const Ue=G.map(Ge=>(q[Ge].node&>(q[Ge].node.id))??ae(q[Ge])),st=aS(Ue),[Pe,Ie]=wue(st,se[0],se[1]);return o.jsxs("div",{className:"sc-feed-col",children:[Pe>0&&o.jsx("div",{className:"sc-feed-pad",style:{height:st[Pe]},"aria-hidden":!0}),G.slice(Pe,Ie).map(Ge=>Oe(q[Ge])),Ie<G.length&&o.jsx("div",{className:"sc-feed-pad",style:{height:st[G.length]-st[Ie]},"aria-hidden":!0})]},Ne)})}),E&&o.jsx("div",{className:"sc-feed-end",ref:he,"aria-hidden":!0}),o.jsx(K1,{open:!!K||O,onOpenChange:G=>{G||(V(null),I(!1))},children:o.jsxs(G1,{maxWidth:"420px",children:[o.jsx(Y1,{children:O?`Delete ${(B==null?void 0:B.count)??0} shot${((B==null?void 0:B.count)??0)===1?"":"s"} permanently?`:"Delete this shot permanently?"}),o.jsx(q1,{size:"2",children:"This cannot be undone."}),o.jsxs(Zs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Q1,{children:o.jsx(ja,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(X1,{children:o.jsx(ja,{color:"red",onClick:()=>{O?R==null||R():K&&(f==null||f(K)),V(null),I(!1)},children:"Delete permanently"})})]})]})})]})}const Eue=800;function iS(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-lb(t)-n.offset;return Math.abs(a)>=1&&(t.scrollTop+=a),!0}function Cue(e){return e==="open"||e==="result"?"open":"compact"}function yv({name:e,kind:t,count:n,mode:r,onToggle:a,action:i,children:l}){const u=Cue(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(kl,{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 r$({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(Oa,{size:14})}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:10,weight:"bold"})})]}),n&&o.jsxs("span",{className:"sc-acard-label",children:[e.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(to,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),e.label]})]});return o.jsx(_L,{why:r?a:null,children:l})}function P6({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 m=s.useMemo(()=>new Set(r),[r]),[w,y]=s.useState(rm);return s.useEffect(()=>{a!=="open"&&y(rm)},[a]),a==="result"&&n.length===0?null:o.jsx(yv,{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(gr,{size:10})}),children:b=>{const{visible:S,more:k}=joe(n,m,b==="open"?w:uv);return o.jsxs("div",{className:b==="open"?"sc-acard-grid":"sc-arow",children:[S.map(C=>o.jsx(r$,{candidate:C,on:m.has(C.id),named:b==="open",disabled:!!f&&!m.has(C.id),title:f??void 0,onClick:()=>m.has(C.id)?u(C.id):l(C.id)},C.id)),b==="open"&&k>0&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:()=>y(C=>C+J0),"aria-label":`Show ${Math.min(k,J0)} more ${h}`,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",k]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})}})}const lS=220,cS="cubic-bezier(0.32, 0.72, 0, 1)";function L6(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 jue(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 L6(a))for(const l of[...i.body.getAnimations(),...i.group.getAnimations()])l.finish();n.current=L6(a)}};return s.useLayoutEffect(()=>{const a=n.current;n.current=null;const i=e.current;if(!(!a||!i))for(const l of L6(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:lS,easing:cS}),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:lS,easing:cS})}}},[t]),r}function Aue({brand:e,shots:t,shotsTotal:n,attached:r=KL,full:a,onToken:i,offToken:l,onTemplate:u,offTemplate:f,onClose:h}){const p=mf(),g=Bl(),{applyBrand:m}=Mn(),{push:w}=rr(),[y,b]=IK(Qr.assetsExpanded,null),S=s.useRef(null),k=jue(S,y),C=z=>{k(),b(J=>J===z?null:z)},[E,A]=s.useState(""),L=E.trim().length>0,$=z=>{k(),A(""),b(z)},N=z=>L?"result":y===null?"idle":y===z?"open":"collapsed",j=s.useMemo(()=>new Set(ji(e.id)),[e.id]),P=s.useMemo(()=>{const z=J=>{const he=ml(J,p);return S2(J,he,{currentId:null,query:"",bookmarked:j,shown:he.length}).items};return{product:z("product"),presenter:z("presenter"),scene:z("scene")}},[p,j]),R=s.useMemo(()=>({product:pd(P.product,E),presenter:pd(P.presenter,E),scene:pd(P.scene,E)}),[P,E]),H=s.useMemo(()=>{var z;return aa((z=e.json)==null?void 0:z.palette)},[e]),D=s.useMemo(()=>L?H.filter(z=>Io(`${z.name} ${z.hex}`,E)):H,[H,E,L]),U=z=>{(async()=>{var he;const J=zR((he=e.json)==null?void 0:he.palette,z);if(J.swatch){if(J.added)try{const te=await Ee.updateBrand(e.id,{...e.json??{},palette:J.palette},e.json);m(te)}catch(te){w(ln(te,"Could not save the brand"));return}$("colors")}})()},_=z=>{(async()=>{var he;const J=fQ((he=e.json)==null?void 0:he.palette,z);if(J.removed)try{const te=await Ee.updateBrand(e.id,{...e.json??{},palette:J.palette},e.json);m(te)}catch(te){w(ln(te,"Could not save the brand"))}})()},B=N("shots")==="open",K=Fy(e.id,"",B),V=s.useMemo(()=>{const z=new Set,J=[];for(const he of[...t,...K.items])he.status!=="done"||he.images.length===0||z.has(he.id)||(z.add(he.id),J.push(he));return J},[t,K.items]),O=Math.max(n??0,K.total,V.length),[I,Y]=s.useState(rm);s.useEffect(()=>{B||Y(rm)},[B]);const Z=()=>{Y(z=>z+J0),K.hasMore&&V.length<I+2*J0&&K.loadMore()},X=L&&!R.product.length&&!R.presenter.length&&!R.scene.length&&!D.length;return o.jsxs("aside",{ref:S,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(gd,{size:12}),o.jsx("input",{value:E,onChange:z=>A(z.target.value),onKeyDown:z=>{z.key==="Escape"&&E&&(z.stopPropagation(),A(""))},placeholder:"Search assets","aria-label":"Search assets in this panel"}),L&&o.jsx("button",{type:"button",className:"sc-assets-clear",onClick:()=>A(""),"aria-label":"Clear search",children:o.jsx(jn,{size:11})})]})}),X&&o.jsxs("p",{className:"sc-assets-zero",children:["Nothing here matches “",E.trim(),"”."]}),o.jsx(P6,{kind:"product",title:"Products",items:R.product,attached:r.product,mode:N("product"),onToggle:C,onPick:z=>i({t:"product",id:z}),onUnpick:z=>l({t:"product",id:z}),full:a,moreLabel:"products",createLabel:"Add product",onCreate:()=>g("product",{onCreated:z=>{z.kind==="product"&&($("product"),i({t:"product",id:z.id}))}})}),o.jsx(P6,{kind:"presenter",title:"People",items:R.presenter,attached:r.presenter,mode:N("presenter"),onToggle:C,onPick:z=>i({t:"character",id:z}),onUnpick:z=>l({t:"character",id:z}),full:a,moreLabel:"people",createLabel:"Create person",onCreate:()=>g("presenter",{onCreated:()=>$("presenter")})}),o.jsx(P6,{kind:"scene",title:"Places",items:R.scene,attached:r.scene?[r.scene]:[],mode:N("scene"),onToggle:C,onPick:u,onUnpick:()=>f(),full:a,moreLabel:"places",createLabel:"Create place",onCreate:()=>g("scene",{onCreated:z=>{z.kind==="scene"&&$("scene")}})}),!(L&&D.length===0)&&o.jsx(yv,{name:"Brand colors",count:D.length,mode:N("colors"),onToggle:()=>C("colors"),action:o.jsx(Ed,{className:"sc-aadd",triggerStyle:{background:"none"},value:h2(H),presets:H.map(z=>z.hex),commitMode:"close",align:"end",label:"Add colour",onChange:U,children:o.jsx(gr,{size:10})}),children:z=>o.jsx("div",{className:"sc-arow",children:(z==="open"?D:D.slice(0,uv)).map(J=>{const he=r.color.includes(J.hex.toLowerCase());return o.jsxs("div",{className:"sc-aswatch-tile","data-on":he||void 0,children:[o.jsxs("button",{type:"button",title:`${J.name} ${J.hex}`,"aria-pressed":he,onClick:()=>he?l({t:"color",hex:J.hex,name:J.name}):i({t:"color",hex:J.hex,name:J.name}),children:[o.jsx("span",{className:"sc-aswatch",style:{background:J.hex}}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Gn,{size:10,weight:"bold"})})]}),z==="open"&&o.jsx("button",{type:"button",className:"sc-aswatch-x","aria-label":`Remove ${J.name}`,title:"Remove",onClick:()=>_(J.hex),children:o.jsx(jn,{size:10,weight:"bold"})})]},J.hex)})})}),V.length>0&&!L&&o.jsx(yv,{name:"Recent shots",count:O,mode:N("shots"),onToggle:()=>C("shots"),children:z=>o.jsxs("div",{className:z==="open"?"sc-acard-grid":"sc-arow",children:[V.slice(0,z==="open"?I:uv).map((J,he)=>{const te=J.images[0],me=r.ref.includes(te);return o.jsx(r$,{candidate:{label:`Shot ${O-he}`,full:`Shot ${O-he} · as reference`,thumb:vn(te,"micro")},on:me,named:z==="open",disabled:!!a&&!me,title:a??void 0,onClick:()=>me?l({t:"ref",imageHash:te}):i({t:"ref",imageHash:te,label:"Shot"})},J.id)}),z==="open"&&(V.length>I||K.hasMore)&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:Z,"aria-label":`Show ${J0} more shots`,"aria-busy":K.loading||void 0,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",Math.max(1,O-Math.min(V.length,I))]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})})]})}function Nue({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:m,lensCounts:w,onLens:y,q:b,onQ:S,searchTotal:k,sort:C,onSort:E,tile:A,onTile:L,assets:$,onAssets:N,showAssets:j}){const P=t?t.id:n?"__ungrouped__":"__all__",R=t?t.name:n?"Not in a set":"All shots",H=!!t||n,D=Or(da),[U,_]=s.useState(!1),[B,K]=s.useState(!1),[V,O]=s.useState(!1),[I,Y]=s.useState(""),Z=s.useRef(null),X=s.useRef(!1),z=()=>{X.current=!0,K(!0),Y(""),_(!0)},J=()=>{t&&(X.current=!1,K(!1),Y(t.name),_(!0))};s.useEffect(()=>{g&&z()},[g]);const he=()=>{const ie=I.trim();if(!ie)return;const Oe=X.current;X.current=!1,K(!1),_(!1),Oe?u(ie):h==null||h(ie)},te=ie=>{if(ie){_(!0);return}const Oe=X.current;X.current=!1,K(!1),_(!1),Oe&&(f==null||f())},me=uM.map(ie=>({value:ie.id==="all"?null:ie.id,label:ie.label,count:w==null?void 0:w[ie.id]})),re=o.jsxs(o.Fragment,{children:[o.jsxs(Rp,{value:P,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(Ec,{}),e.map(ie=>o.jsx(Gu,{value:ie.id,onSelect:()=>l(ie),children:ie.name},ie.id))]}),o.jsx(Ec,{}),o.jsx(Wn,{onSelect:()=>{f==null||f(),z()},children:"New set"}),t&&h&&o.jsx(Wn,{onSelect:J,children:"Rename"}),t&&p&&o.jsx(Wn,{color:"red",onSelect:()=>O(!0),children:"Delete set"})]}),ee=o.jsx(Rp,{value:C,onValueChange:ie=>E(ie),children:cM.map(ie=>o.jsx(Gu,{value:ie.id,children:ie.label},ie.id))}),q=H||C!=="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(Ha,{size:16})}),o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-place","data-on":H||void 0,"aria-label":R,children:[o.jsx(Zv,{className:"sc-toolbar-place-ic",size:16}),o.jsx("span",{className:"sc-toolbar-place-t",children:R}),o.jsx(kl,{size:10,className:"sc-caret"})]})}),o.jsx(js,{align:"start",children:re})]})]}),o.jsx(Hw,{open:U,onOpenChange:te,children:o.jsxs(Ow,{maxWidth:"360px","aria-describedby":void 0,onOpenAutoFocus:ie=>{ie.preventDefault();const Oe=Z.current;Oe&&(Oe.focus(),Oe.select())},children:[o.jsx(Iw,{children:B?"Name this set":"Rename set"}),o.jsx("input",{ref:Z,className:"sc-in",style:{width:"100%",marginTop:8},value:I,"aria-label":"Set name",onChange:ie=>Y(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&he()}}),o.jsxs(Zs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ja,{variant:"soft",color:"gray",onClick:()=>te(!1),children:"Cancel"}),o.jsx(ja,{onClick:he,disabled:!I.trim(),children:"Save"})]})]})}),o.jsx(K1,{open:V,onOpenChange:O,children:o.jsxs(G1,{maxWidth:"420px",children:[o.jsx(Y1,{children:"Delete this set?"}),o.jsx(q1,{size:"2",children:"Shots stay in the library. Only the set goes."}),o.jsxs(Zs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Q1,{children:o.jsx(ja,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(X1,{children:o.jsx(ja,{color:"red",onClick:()=>{p==null||p(),O(!1)},children:"Delete set"})})]})]})}),o.jsx(Iy,{"aria-label":"Shot lenses",activeKey:m==="all"?null:m,items:me,onSelect:ie=>y(ie??"all")})]}),o.jsxs("div",{className:"sc-toolbar-actions",children:[o.jsx(zd,{value:b,onChange:S,noun:"shots",total:k}),D?o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn sc-toolbar-view","data-on":q||void 0,"aria-label":`Set and sort: ${R}`,children:[o.jsx(zv,{size:15}),q&&o.jsx("span",{className:"sc-toolbar-view-dot","aria-hidden":!0})]})}),o.jsxs(js,{align:"end",children:[o.jsx(m4,{children:"Set"}),re,o.jsx(Ec,{}),o.jsx(m4,{children:"Sort"}),ee]})]}):o.jsxs(Es,{children:[o.jsx(Cs,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn","aria-label":"Sort shots",children:[o.jsx(AF,{size:14}),o.jsx("span",{className:"sc-toolbar-btn-t",children:"Sort"}),o.jsx(kl,{size:10})]})}),o.jsx(js,{align:"end",children:ee})]}),o.jsx(mX,{value:A,onChange:L}),j&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-toolbar-assets","data-on":$||void 0,onClick:N,"aria-label":"Assets panel","aria-pressed":$,title:"Assets panel (.)",children:o.jsx(JF,{size:15,mirrored:!0})})]})]})}function Mue(e){const{push:t}=rr(),n=s.useCallback(l=>Ee.archiveNode(l.id,!0).then(u=>(e(u),t({kind:"success",title:"Archived",detail:Hr(l),action:{label:"Undo",onClick:()=>void Ee.archiveNode(l.id,!1).then(e)}}),!0)).catch(u=>(t(ln(u,"Could not archive this shot")),!1)),[e,t]),r=s.useCallback(l=>Ee.archiveNode(l.id,!1).then(u=>(e(u),!0)).catch(u=>(t(ln(u,"Could not restore this shot")),!1)),[e,t]),a=s.useCallback(l=>Promise.all(l.map(u=>Ee.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=>Ee.archiveNode(f.id,!1))).then(f=>{for(const h of f)e(h)})}}}),!0}).catch(u=>(t(ln(u,"Could not archive these shots")),!1)),[e,t]),i=s.useCallback(l=>Promise.all(l.map(u=>Ee.archiveNode(u,!1))).then(u=>{for(const f of u)e(f);return!0}).catch(u=>(t(ln(u,"Could not restore these shots")),!1)),[e,t]);return{archive:n,archiveBatch:a,unarchive:r,unarchiveBatch:i}}function Rue(e){const{push:t}=rr(),n=s.useCallback(a=>Ee.deleteNode(a.id).then(()=>e([a.id])).catch(i=>t(ln(i,"Could not delete this shot"))),[e,t]),r=s.useCallback(a=>Ee.deleteNodesBatch(a).then(()=>e(a)).catch(i=>t(ln(i,"Could not delete these shots"))),[e,t]);return{remove:n,removeBatch:r}}function Pue(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(m=>(m==null?void 0:m.t)==="product"))==null?void 0:h.id,l=(p=a.find(m=>(m==null?void 0:m.t)==="character"))==null?void 0:p.id,u=(g=a.find(m=>(m==null?void 0:m.t)==="template"))==null?void 0:g.id;return{product:i?t.find(m=>m.id===i):void 0,presenter:l?n.find(m=>m.id===l):void 0,scene:u?r.find(m=>m.id===u):void 0}}function Lue(e,t){const{product:n,presenter:r,scene:a}=Pue(e,t);return{productName:n?Oo(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?Si(r).src:null,presenterId:(r==null?void 0:r.id)??null,sceneName:a?jl(a,"chip"):null,scenePreviewUrl:(a==null?void 0:a.previewUrl)??null,sceneId:(a==null?void 0:a.id)??null}}function Tue(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()}))},m=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",m,{passive:!1}),h.addEventListener("pointerdown",w),()=>{p&&cancelAnimationFrame(p),u(),h.removeEventListener("scroll",g),h.removeEventListener("wheel",m),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 m=g.offsetWidth||232,w=Number.parseFloat(getComputedStyle(p).columnGap)||0,y=m+w,b=r.current??p.scrollLeft;r.current=b+y*h;const S=()=>{u()};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p.scrollLeft=r.current,S(),l();return}cancelAnimationFrame(a.current);let k=0;const C=()=>{const E=r.current;if(E===null)return;const A=E-p.scrollLeft;if(k+=1,Math.abs(A)<.5||k>45){p.scrollLeft=E,S(),l();return}p.scrollLeft+=A*.16,a.current=requestAnimationFrame(C)};a.current=requestAnimationFrame(C)},[u,l]);return{ref:t,page:f}}function $ue(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 Due({entries:e,catalogs:t,stagedId:n,onUse:r,productHref:a,presenterHref:i,sceneHref:l}){const u=s.useMemo(()=>$ue(e).slice(0,10),[e]),{ref:f,page:h}=Tue(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(Ha,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-shelf-arrow next","aria-label":"More examples",onClick:()=>h(1),children:o.jsx(Rl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-shelf-row",ref:f,children:[0,1,2].map(p=>u.map(g=>o.jsx(YL,{entry:g,size:"grid",hideRecipe:!0,decorative:p!==1,active:n===g.id,onOpen:()=>r(g),productHref:a,presenterHref:i,sceneHref:l,...Lue(g,t)},`${p}-${g.id}`)))})]})]})}function L0({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 Hue({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:m,onDeleteBatch:w,loaded:y,onSelectAll:b}){const[S,k]=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?b: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(Hu,{label:"Restore",onClick:()=>m(g),children:o.jsx(s1,{size:17})}),o.jsx(Hu,{label:`Delete ${e} permanently`,tone:"danger",onClick:()=>k(!0),children:o.jsx(Pl,{size:17})})]}):o.jsxs(o.Fragment,{children:[o.jsx(Hu,{label:h?"Remove from keepers":"Keep",onClick:u,children:o.jsx(to,{size:17,weight:h?"fill":"regular"})}),o.jsxs(Es,{children:[o.jsx(hr,{label:"Add to set",children:o.jsx(Cs,{children:o.jsx("button",{type:"button",className:"sc-picked-tool","aria-label":"Add to set",children:o.jsx(Zv,{size:17})})})}),o.jsxs(js,{children:[t.filter(C=>C.id!==(n==null?void 0:n.id)).map(C=>o.jsx(Wn,{onSelect:()=>r(C),children:C.name},C.id)),t.some(C=>C.id!==(n==null?void 0:n.id))&&o.jsx(Ec,{}),o.jsx(Wn,{onSelect:i,children:"New set…"})]})]}),n&&a&&o.jsx(Hu,{label:t$(e,n.name),onClick:a,children:o.jsx(GE,{size:17})}),o.jsx(Hu,{label:"Archive",tone:"danger",onClick:()=>f(g),children:o.jsx(vm,{size:17})})]})}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(Hu,{label:"Done",onClick:l,children:o.jsx(jn,{size:16,weight:"bold"})})}),p&&o.jsx(Xn,{label:`Delete ${e} permanently`,title:`Delete ${e} shot${e===1?"":"s"} permanently?`,body:"This cannot be undone.",busy:!1,open:S,onOpenChange:k,onConfirm:()=>w(g)})]})}function Hu({label:e,tone:t,onClick:n,children:r}){return o.jsx(hr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}function Oue(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 Iue(e){switch(e){case"oldest":return(t,n)=>Yu(n,t);case"cost":return(t,n)=>n.costUsd-t.costUsd||Yu(t,n);case"keepers":return(t,n)=>Number(n.kept)-Number(t.kept)||Yu(t,n);default:return Yu}}function s$(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 Fue(e,t){return t==="archived"?e.archived:t==="keepers"?!e.archived&&e.kept:!e.archived}function uS(e,t,n){var r;return(r=t.q)!=null&&r.trim()?null:s$(e,t,n)&&Fue(e,t.lens)}function dS(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 T6(e,t,n,r){if(!r)return e;const a=dS(t),i=dS(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 _ue(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}function bv(e,t){const n=e.findIndex(a=>a.id===t.id);if(n===-1||_ue(e[n],t))return e;const r=[...e];return r[n]=t,r}function fS(e,t){const n=new Set(t);return e.some(r=>n.has(r.id))?e.filter(r=>!n.has(r.id)):e}function Vue(e,t,n,r){if(e.some(u=>u.id===t.id))return bv(e,t);const a=Iue(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 Zue(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 zue(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function a$(e,t){const n=new Set(t.map(a=>a.id)),r=[];for(const a of e)a.status==="running"&&!n.has(a.id)&&r.push(a.id);return r}function Bue(e,t){const n=t,r={...e};for(const a of Object.keys(e))a in n&&(r[a]=n[a]);return r}const $6=60;function Uue(e,t,n){const{shotsEpoch:r}=un(),a=`${Oue(e,t)}#${r}`,[i,l]=s.useState(()=>{const N=x7(a);return N?{...N,error:null}:{brandId:e,key:"",items:[],next:null,counts:null,error:null}}),[u,f]=s.useState(0),[h,p]=s.useState(!1),g=s.useRef(i);g.current=i;const m=s.useRef(t);m.current=t;const w=s.useRef(n);w.current=n;const y=s.useRef(!1);s.useEffect(()=>{const N=new AbortController;p(!0);const j=x7(a);return j&&g.current.key!==a&&l({...j,error:null}),Ee.feed(e,{...m.current,limit:$6},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 R=String((P==null?void 0:P.message)??P);l(H=>H.key===a?{...H,error:R}:{brandId:e,key:a,items:[],next:null,counts:null,error:R})}).finally(()=>{N.signal.aborted||p(!1)}),()=>N.abort()},[e,a,u]),s.useEffect(()=>{i.key&&!i.error&&Foe(i)},[i]);const b=s.useCallback(()=>f(N=>N+1),[]),S=s.useCallback(()=>{const N=g.current;if(N.key!==a||!N.next||y.current)return;y.current=!0,p(!0);const j=N.next;Ee.feed(e,{...m.current,limit:$6,cursor:j}).then(P=>{l(R=>R.key!==a?R:{...R,items:Zue(R.items,P.items),next:P.next,counts:P.counts??R.counts})}).catch(()=>{}).finally(()=>{y.current=!1,p(!1)})},[e,a]),k=s.useCallback(async()=>{const N=await Ee.feed(e,{...m.current,limit:$6});l(j=>j.key!==a?j:{...j,items:zue(j.items,N.items),next:j.items.length?j.next:N.next,counts:N.counts??j.counts,error:null})},[e,a]),C=s.useCallback(N=>{l(j=>{const P=j.items.find(_=>_.id===N.id);if(!P)return j;const R=m.current,D=uS(N,R,w.current)===!1?fS(j.items,[N.id]):bv(j.items,N),U=j.counts?T6(j.counts,P,N,!0):j.counts;return D===j.items&&U===j.counts?j:{...j,items:D,counts:U}})},[]),E=s.useCallback((N,j)=>{let P=!1;l(R=>{let H=R.items,D=R.counts;const U=m.current;for(const _ of N){if(H.some(O=>O.id===_.id)){H=bv(H,_);continue}const B=uS(_,U,w.current);if(B===null){P=!0;continue}const K=s$(_,U,w.current);B&&(H=Vue(H,_,U.sort,R.next===null));const V=(j==null?void 0:j.get(_.id))??null;D&&(D=T6(D,V,_,K))}return H===R.items&&D===R.counts?R:{...R,items:H,counts:D}}),P&&k().catch(()=>{})},[k]),A=s.useCallback(N=>{l(j=>{const P=j.items.filter(H=>N.includes(H.id));if(!P.length)return j;let R=j.counts;if(R)for(const H of P)R=T6(R,H,null,!0);return{...j,items:fS(j.items,N),counts:R}})},[]),L=i.brandId===e?i.items:[],$=s.useMemo(()=>new Map(L.map(N=>[N.id,N])),[L]);return{items:L,byId:$,counts:i.brandId===e?i.counts:null,ready:i.key===a&&!i.error,loading:h,complete:i.key===a&&i.next===null,error:i.key===a?i.error:null,loadMore:S,patch:C,insert:E,drop:A,refresh:k,retry:b}}function Wue(){const e=gn(pt.hubShot),t=gn(pt.setShot);return(e==null?void 0:e.params.shotId)??(t==null?void 0:t.params.shotId)??null}function hS(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 Ee.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 o$({set:e}){const{engines:t,scenes:n,presenters:r,demoProducts:a,showcase:i,showcaseLoaded:l}=Mn(),{brand:u,workspace:f,root:h,recent:p,sets:g,membership:m,loaded:w,refresh:y,applySet:b,dropSet:S,insertSet:k,applyMembership:C,applyNodes:E,subscribeActivity:A,products:L}=un(),$=n,N=mf(),j=Un(),[P,R]=Ml(),H=Wue(),[D,U]=s.useState(null),[_,B]=s.useState(!1);s.useEffect(()=>{const le=()=>B(!0);return window.addEventListener("scenri:shortcuts",le),()=>window.removeEventListener("scenri:shortcuts",le)},[]);const{open:K,toggle:V,setOpen:O}=qre(),I=Or("(min-width: 1280px)"),Y=I&&K,[Z,X]=s.useState(null),[z,J]=s.useState(KL),[he,te]=s.useState(null),[me,re]=s.useState(null),ee=s.useRef(!1);s.useEffect(()=>{if(!ee.current||H)return;ee.current=!1;const le=requestAnimationFrame(()=>{var Fe;return(Fe=Ie.current)==null?void 0:Fe.focus()});return()=>cancelAnimationFrame(le)},[H,me]);const[q,ie]=s.useState(null),[Oe,ae]=s.useState(new Set),[pe,Te]=Zh("tab","all"),[gt,Ze]=Zh("in",""),[tt,De]=Zh("branch",""),[Se,Q]=Zh("lineage",""),[je,Re]=Pa(Qr.tileSize,AR),se=NR(je),{q:G,setQ:oe,clearSearch:Ne}=gf([]),[Ue,st]=Pa(Qr.feedSort,"newest"),Pe=iG(Ue)?Ue:"newest",Ie=s.useRef(null),{push:Ge}=rr(),{poke:ft}=ua(),[bt,at]=s.useState(null),Zt=(f==null?void 0:f.id)??"",jt=e?H0(u,e):jr(u),Ft=s.useCallback(le=>{const Fe=P.toString();return`${jt}/shots/${le}${Fe?`?${Fe}`:""}`},[jt,P]),Pt=s.useCallback((le,Fe=!1)=>j(Ft(le),{replace:Fe}),[j,Ft]),$t=s.useCallback(()=>{const le=new URLSearchParams(P);le.delete("panel");const Fe=le.toString();j(`${jt}${Fe?`?${Fe}`:""}`,{replace:!0})},[jt,j,P]),ke=lG(pe)?pe:"all",Je=!e&>==="ungrouped";s.useEffect(()=>{pe==="ungrouped"&&(Te(null),Ze("ungrouped"))},[pe,Te,Ze]);const Et=s.useMemo(()=>{const le=new Map;for(const Fe of g)for(const lt of m[Fe.id]??[])le.has(lt)||le.set(lt,[]),le.get(lt).push(Fe);return le},[g,m]),Xe=s.useMemo(()=>({lens:ke,set:e==null?void 0:e.id,ungrouped:Je||void 0,lineage:Se||void 0,q:G.trim()||void 0,sort:Pe}),[ke,e==null?void 0:e.id,Je,Se,G,Pe]),rt=s.useRef(m);rt.current=m;const nt=s.useRef(Et);nt.current=Et;const qt=s.useRef(new Set),Yt=s.useMemo(()=>({inSet:le=>e?(rt.current[e.id]??[]).includes(le):!1,inAnySet:le=>nt.current.has(le),inLineage:le=>le.id===Se||le.parentId!==null&&qt.current.has(le.parentId)}),[e==null?void 0:e.id,Se]),an=Uue(u.id,Xe,Yt),{items:Wt,byId:Rn,counts:Bt}=an,ne=s.useRef(an);ne.current=an,qt.current=s.useMemo(()=>new Set(Wt.map(le=>le.id)),[Wt]);const ce=s.useRef(new Map);s.useEffect(()=>{for(const le of Wt)ce.current.set(le.id,le)},[Wt]);const ue=s.useRef(new Set),ze=s.useRef(null),[Ve,xt]=s.useState("");s.useEffect(()=>A(le=>{const{messages:Fe,next:lt}=nue(ze.current??new Map,le),en=ze.current===null;if(ze.current=lt,!en&&Fe.length){const fn=Fe.join(" ");xt(or=>or===fn?`${fn} `:fn)}const nn=ne.current;let Zn=!1;const $n=[],Pn=new Map;for(const fn of le){if(nn.byId.has(fn.id))nn.patch(fn);else if(ce.current.has(fn.id)){const or=ce.current.get(fn.id);or&&Pn.set(fn.id,or),$n.push(fn)}else fn.kind!=="root"&&(Zn=!0);ce.current.set(fn.id,fn)}$n.length&&nn.insert($n,Pn),Zn&&nn.ready&&nn.refresh().catch(()=>{});for(const fn of a$(nn.byId.values(),le))ue.current.has(fn)||(ue.current.add(fn),Ee.node(fn).then(or=>{const ha=ne.current.byId.get(fn);ha&&ne.current.patch(Bue(ha,or))}).catch(or=>{(or==null?void 0:or.status)===404&&ne.current.drop([fn])}).finally(()=>ue.current.delete(fn)))}),[A]);const yt=w&&an.ready,kt=hS(Se||null,Rn);s.useEffect(()=>{!Se||!kt.missing||(Q(null),Ge({kind:"info",title:"That shot is no longer available",detail:"Showing everything instead."}))},[Se,kt.missing,Q,Ge]);const ot=s.useMemo(()=>{var en,nn;const le=L.length?L:((en=u.json)==null?void 0:en.products)??[],Fe=((nn=u.json)==null?void 0:nn.characters)??[],lt=N.scenes;return{product:Zn=>{const $n=le.find(Pn=>Pn.id===Zn)??a.find(Pn=>Pn.id===Zn);return $n?Oo($n,"chip"):null},person:Zn=>{var $n,Pn;return(($n=Fe.find(fn=>fn.id===Zn))==null?void 0:$n.name)??((Pn=r.find(fn=>fn.id===Zn))==null?void 0:Pn.name)??null},scene:Zn=>{const $n=lt.find(Pn=>Pn.id===Zn);return $n?jl($n,"chip"):null}}},[L,a,u,r,N.scenes]),ht=s.useMemo(()=>{const le=D?Rn.get(D):void 0;return le||(Wt.find(Fe=>Fe.status!=="error")??Wt[0]??null)},[Rn,Wt,D]),Ae=hS(tt||null,Rn),ve=s.useMemo(()=>{const le=Ae.node;return!le||le.kind==="root"?null:le.status==="running"||le.status==="done"&&le.images.length>0?le:null},[Ae.node]),et=(ve==null?void 0:ve.images[0])??null,Ct=s.useCallback(()=>De(null),[De]),xe=s.useRef(null),it=s.useCallback((...le)=>{if(xe.current){for(const lt of le)xe.current.add(lt);return}const Fe=new Set(le);xe.current=Fe,queueMicrotask(()=>{xe.current=null,R(lt=>{const en=new URLSearchParams(lt);for(const nn of Fe)en.delete(nn);return en},{replace:!0})})},[R]),wt=s.useCallback(()=>it(...G5,"setup","product","ref","view","fresh"),[it]);s.useEffect(()=>{!tt||!yt||(Ae.node&&!ve?(Ct(),Ge({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})):Ae.missing&&(Ct(),Ge({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})))},[tt,Ae.node,Ae.missing,ve,yt,Ct,Ge]);const $e=s.useCallback(le=>{var Fe;De(le),(Fe=Ie.current)==null||Fe.focus()},[De]),qe=le=>U(le),Lt=le=>H||/\/shots\//.test(window.location.pathname)?Pt(le,!0):qe(le),Ut=s.useCallback(le=>{for(const Fe of le)ce.current.set(Fe.id,Fe);ne.current.insert(le),E(le),ft()},[E,ft]),Nt=s.useCallback(async()=>{try{await y(),await ne.current.refresh(),X(null)}catch(le){X(String(le.message??le))}},[y]),_t=s.useCallback(le=>E([le]),[E]),{archive:Me,archiveBatch:Be,unarchive:Qe,unarchiveBatch:F}=Mue(_t),de=s.useCallback(le=>ne.current.drop(le),[]),{remove:ye,removeBatch:Ke}=Rue(de);s.useEffect(()=>{H&&U(H)},[H]);const Le=s.useRef(new Set),ct=async le=>{var Fe,lt;if(le.status==="running")return le.id;if(Le.current.has(le.id))return null;if(le.status==="error"||le.status==="cancelled"){Le.current.add(le.id);try{const en=await Ee.retryNode(le.id);return E([en]),ft(),en.id}catch(en){return Ge(ln(en,"Could not run this again")),null}finally{Le.current.delete(le.id)}}Le.current.add(le.id);try{const en=await Ee.node(le.id),nn=await Ee.addNode({projectId:Zt,parentId:le.parentId,kind:le.kind==="edit"?"edit":"generation",prompt:en.prompt,engineId:le.engineId,count:1,brief:le.brief,...le.kind==="edit"&&((Fe=le.brief)!=null&&Fe.sourceImage)?{sourceImage:le.brief.sourceImage}:{}});return Ut((lt=nn.siblings)!=null&<.length?nn.siblings:[nn]),(nn==null?void 0:nn.id)??null}catch(en){return Ge(ln(en,"Could not run this again")),null}finally{Le.current.delete(le.id)}},Ot=async le=>{try{await Ee.cancelNode(le.id),E([{...le,status:"cancelled"}]),ft()}catch(Fe){Ge(ln(Fe,"Could not cancel this shot"))}},zt=s.useCallback(le=>{var Fe,lt,en;le!=null&&le.scene&&((Fe=Ie.current)==null||Fe.applyScene(le.scene)),le!=null&&le.scenesPanel&&((lt=Ie.current)==null||lt.openAttach("Places")),(en=Ie.current)==null||en.focus()},[]);s.useEffect(()=>{var Fe;if(P.get("compose")===null)return;const le=P.get("attach")==="all";zt(),le&&((Fe=Ie.current)==null||Fe.showAttach()),it("compose",...le?["attach"]:[])},[P,zt,it]);const Rt=P.get("showcase"),Sn=s.useRef(null);s.useEffect(()=>{if(!Rt||!l||Sn.current===Rt)return;Sn.current=Rt;const le=i.find(Fe=>Fe.id===Rt);le?(re(sv(le)),Ge({kind:"info",title:`Starting from "${le.title}"`})):Ge({kind:"info",title:"That example is no longer available",detail:"Starting from scratch instead."}),R(Fe=>{const lt=new URLSearchParams(Fe);return lt.delete("showcase"),lt},{replace:!0})},[Rt,l,i,R,Ge]);const Jt=async(le,Fe=!le.kept)=>{E([{...le,kept:Fe}]);try{E([await Ee.keep(le.id,Fe)])}catch(lt){E([le]),Ge(ln(lt,"Could not update keeper status"))}},En=s.useMemo(()=>[...Oe].map(le=>Rn.get(le)).filter(le=>!!le),[Rn,Oe]),Qn=async()=>{const le=!(En.length>0&&En.every(lt=>lt.kept)),Fe=En.filter(lt=>lt.kept!==le);E(Fe.map(lt=>({...lt,kept:le})));try{E(await Promise.all(Fe.map(lt=>Ee.keep(lt.id,le))))}catch(lt){E(Fe),Ge(ln(lt,"Could not update keeper status"))}},dn=le=>{const Fe=le.map(lt=>Rn.get(lt)).filter(lt=>!!lt&&!lt.archived);Fe.length&&E(Fe.map(lt=>({...lt,archived:!0}))),ae(new Set),Be(le).then(lt=>{lt||E(Fe)})},vr=le=>{const Fe=le.map(lt=>Rn.get(lt)).filter(lt=>!!lt&<.archived);Fe.length&&E(Fe.map(lt=>({...lt,archived:!1}))),ae(new Set),F(le).then(lt=>{lt||E(Fe)})},Kt=s.useCallback((le,Fe)=>{rt.current={...rt.current,[le]:Fe},C(le,Fe)},[C]),br=async le=>{try{const Fe=await Ee.addToSet(le.id,[...Oe]);Kt(le.id,Fe.nodeIds),ae(new Set),(e||Je)&&ne.current.refresh()}catch(Fe){Ge(ln(Fe,"Could not add to the set"))}},Ir=async(le,Fe)=>{const lt=rt.current[le.id]??[],en=lt.filter(nn=>!Fe.includes(nn));Kt(le.id,en),ae(nn=>{if(!Fe.some($n=>nn.has($n)))return nn;const Zn=new Set(nn);for(const $n of Fe)Zn.delete($n);return Zn}),(e==null?void 0:e.id)===le.id&&ne.current.drop(Fe);try{const nn=await Ee.removeFromSet(le.id,Fe);Kt(le.id,nn.nodeIds),Je&&ne.current.refresh()}catch(nn){Kt(le.id,lt),((e==null?void 0:e.id)===le.id||Je)&&ne.current.refresh(),Ge(ln(nn,"Could not remove from the set"))}},wn=le=>Ir(le,[...Oe]),Vo=(le,Fe)=>Ir(Fe,[le.id]),An=s.useRef([]),[Ys,Rs]=s.useState(!1);s.useEffect(()=>{Ys&&Rs(!1)},[Ys]);const on=async(le,Fe)=>{const lt=Fe.trim();if(lt)try{const en=await Ee.createSet(u.id,lt);if(k(en),le.length>0){const nn=await Ee.addToSet(en.id,le);Kt(en.id,nn.nodeIds)}ae(new Set),j(H0(u,en))}catch(en){Ge(ln(en,"Could not create the set"))}},yn=()=>{const le=An.current;return An.current=[],le},Kn=async le=>{if(!e)return;const Fe=le.trim();if(!(!Fe||Fe===e.name))try{const lt=await Ee.renameSet(e.id,Fe);b(lt),j(H0(u,lt),{replace:!0}),y()}catch(lt){Ge(ln(lt,"Could not rename the set"))}},Wr=async()=>{if(e)try{await Ee.deleteSet(e.id),S(e.id),j(jr(u),{replace:!0}),y()}catch(le){Ge(ln(le,"Could not delete the set"))}},Jn=async le=>{var fn;const Fe=((fn=/\/shots\/([^/?#]+)/.exec(window.location.pathname))==null?void 0:fn[1])??null,lt=Fe?Rn.get(Fe)??null:ht;if(!lt)return;if(le==="left"||le==="right"){const{prev:or,next:ha}=b4(Wt,lt.id),Fr=le==="left"?or:ha;Fr&&Lt(Fr.id);return}const en=await Ee.lineage(lt.id).catch(()=>null);if(!en)return;const nn=en.history??[...en.ancestors,lt,...en.children.slice(0,1)],{prev:Zn,next:$n}=b4(nn.filter(or=>or.id===lt.id||or.images[0]),lt.id),Pn=le==="up"?Zn:$n;Pn&&Lt(Pn.id)};s.useEffect(()=>{const le=Fe=>{var $n,Pn;if(Fe.defaultPrevented)return;const lt=document.activeElement,en=((lt==null?void 0:lt.tagName)??"").toUpperCase(),nn=en==="INPUT"||en==="TEXTAREA"||en==="SELECT"||!!(lt!=null&<.closest('[contenteditable="true"]'))||!!(lt!=null&<.closest('[role="separator"]')),Zn=!!(lt!=null&<.closest('button, a[href], [role="button"], [role="tab"], [role="menuitem"]'));if(Fe.key==="Enter"&&(Fe.metaKey||Fe.ctrlKey)){if(H||Kue(lt))return;($n=Ie.current)==null||$n.submit(),Fe.preventDefault();return}if(!nn){if(Fe.key==="?"){B(!0),Fe.preventDefault();return}if(Fe.key==="/"&&!H){(Pn=Ie.current)==null||Pn.focus(),Fe.preventDefault();return}if(Fe.key==="Escape"&&_){B(!1),Fe.preventDefault();return}if(Fe.key==="Escape"&&H){$t(),Fe.preventDefault();return}if(Fe.key==="Escape"&&Oe.size>0){ae(new Set),Fe.preventDefault();return}if(Fe.key==="Escape"&&tt){Ct(),Fe.preventDefault();return}if(ht){if(Fe.key==="b"&&ht.kind!=="root"&&ht.status==="done"&&ht.images.length>0){$e(ht.id),Fe.preventDefault();return}if(Fe.key==="k"&&ht.kind!=="root"&&ht.status==="done"){Jt(ht),Fe.preventDefault();return}Fe.key==="ArrowLeft"?(Jn("left"),Fe.preventDefault()):Fe.key==="ArrowRight"?(Jn("right"),Fe.preventDefault()):Fe.key==="ArrowUp"?(Jn("up"),Fe.preventDefault()):Fe.key==="ArrowDown"?(Jn("down"),Fe.preventDefault()):Fe.key==="Enter"&&!H&&ht.kind!=="root"&&!Zn?Pt(ht.id):Fe.key==="."&&!H&&I&&V()}}};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[ht,H,_,Oe.size,tt,$e,De,h,I]);const _n=le=>ae(Fe=>{const lt=new Set(Fe);return lt.delete(le)||lt.add(le),lt}),ts=yt&&Bt!==null&&Bt.total===0,fa=Y||ts&&I,Zo=ts?o.jsx(Due,{entries:i,catalogs:{demoProducts:a,presenters:r,scenes:$},stagedId:q,productHref:le=>Aa(u,le),presenterHref:le=>La(u,le),sceneHref:le=>Br(u,le),onUse:le=>{ie(le.id),re(sv(le))}}):G.trim()?o.jsx(L0,{text:`No shots match “${G.trim()}”.`,onAll:Ne,actionLabel:"Clear search"}):ke==="keepers"?o.jsx(L0,{text:"No keepers yet. Star a shot and it lands here.",onAll:()=>Te(null)}):ke==="archived"?o.jsx(L0,{text:"Nothing archived.",onAll:()=>Te(null)}):e?o.jsx(L0,{text:"Nothing in this set yet. Pick shots on All, then add them here."}):Je?o.jsx(L0,{text:"Every shot is already in a set.",onAll:()=>Ze(null)}):null,ms=s.useRef(0);!G.trim()&&Bt&&(ms.current=Bt[ke]);const[qs,zo]=Pa(Qr.feedCounts,null);s.useEffect(()=>{if(!Bt)return;const le={brandId:u.id,all:Bt.all,keepers:Bt.keepers,archived:Bt.archived};zo(Fe=>Fe&&Fe.brandId===le.brandId&&Fe.all===le.all&&Fe.keepers===le.keepers&&Fe.archived===le.archived?Fe:le)},[u.id,Bt,zo]);const Xs=s.useMemo(()=>Bt?{all:Bt.all,keepers:Bt.keepers,archived:Bt.archived}:(qs==null?void 0:qs.brandId)===u.id?{all:qs.all,keepers:qs.keepers,archived:qs.archived}:null,[Bt,qs,u.id]),fo={byId:Rn,items:Wt,loadMore:an.loadMore,complete:an.complete,rootId:h,recent:p,loaded:yt,setsFor:le=>Et.get(le)??[],brand:u,engines:t,projectId:Zt,close:$t,select:Lt,retry:le=>{ct(le).then(Fe=>{Fe&&Lt(Fe)})},cancel:le=>void Ot(le),keep:le=>void Jt(le),reload:Nt,remix:le=>{var Zn;const Fe=(Zn=le.brief)==null?void 0:Zn.tokens,lt=le.prompt??le.promptHead,en=Fe!=null&&Fe.length||!lt?le.brief:{...le.brief,tokens:[{t:"text",v:lt}]},nn=en!=null&&en.tokens?{...en,tokens:up(u,en.tokens)}:en;re({...nn,_at:Date.now()}),nn&&Gw(u.id,{tokens:yy(nn),tplFields:nn.templateFields??{}}),$t(),Ge({kind:"info",title:"Starting from this shot",detail:"Its prompt, chips and settings are in the composer. Change anything, then Generate."}),ee.current=!0},branch:le=>{$e(le.id),$t()},archive:le=>Me(le).then(Fe=>{Fe&&$t()}),unarchive:le=>Qe(le).then(()=>{}),delete:le=>void ye(le).then(()=>$t()),landed:Ut,refined:(le,Fe)=>{Fe==="edit"&&De(le)},subscribeActivity:A,tokenNames:ot};return o.jsxs("div",{className:"sc-work","data-assets":fa,children:[o.jsxs("main",{className:"sc-canvas",id:"main","data-page-scroll":"","data-firstrun":ts||void 0,onClick:le=>{if(Oe.size===0&&!D)return;const Fe=le.target;Fe.closest(".sc-cell")||Fe.closest("button, a, input, select, textarea, label, [role], [contenteditable]")||(ae(new Set),U(null))},children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:Ve}),(Z||an.error)&&o.jsx("div",{className:"sc-canvas-alert",children:o.jsx(Ww,{failure:uo(Z??an.error??""),action:an.error&&!Z?o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:an.retry,children:"Try again"}):void 0})}),(!ts||e)&&o.jsx(Nue,{sets:g,active:e,ungrouped:Je,ungroupedCount:(Bt==null?void 0:Bt.ungrouped)??0,onPlaceAll:()=>e?j(jr(u)):Ze(null),onPlaceUngrouped:()=>e?j(`${jr(u)}?in=ungrouped`):Ze("ungrouped"),onOpenSet:le=>j(H0(u,le)),onNewSet:le=>void on(yn(),le),onResetNewSet:()=>{An.current=[]},onRenameSet:le=>void Kn(le),onDeleteSet:()=>void Wr(),askCreate:Ys,lens:ke,lensCounts:Xs,onLens:le=>Te(le==="all"?null:le),q:G,onQ:oe,searchTotal:G.trim()?ms.current:(Bt==null?void 0:Bt[ke])??0,sort:Pe,onSort:st,tile:se,onTile:Re,assets:Y,onAssets:V,showAssets:I}),Se&&kt.node&&o.jsxs("div",{className:"sc-lineage-bar",children:[o.jsx("button",{type:"button",className:"sc-crumb-back",onClick:()=>Q(null),children:"All shots"}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("b",{dir:"auto",children:Hr(kt.node)}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("span",{className:"sc-crumb-here",children:"versions"})]}),o.jsx(Sue,{nodes:Wt,selectedId:D,onOpen:Pt,shotHref:Ft,onRetry:le=>void ct(le),onCancel:le=>void Ot(le),onToggleKeep:le=>void Jt(le),onArchive:le=>le.archived?Qe(le):Me(le),onDeletePermanently:ye,engineName:le=>{var Fe;return(Fe=t.find(lt=>lt.id===le))==null?void 0:Fe.displayName},picked:Oe,onPick:_n,sending:bt,onBranch:$e,branchingFrom:(ve==null?void 0:ve.id)??null,onVersions:Q,tile:se,empty:yt?Zo:null,pending:!yt&&!an.error,onNearEnd:an.complete?void 0:an.loadMore,inSet:e,setsFor:le=>Et.get(le)??[],onRemoveFromSet:(le,Fe)=>void Vo(le,Fe),onKeepPicked:()=>void Qn(),onArchivePicked:()=>dn([...Oe]),onRestorePicked:()=>vr([...Oe]),onDeletePicked:()=>void Ke([...Oe]).then(()=>ae(new Set)),onRemovePickedFromSet:le=>void wn(le)})]}),fa&&o.jsx("div",{className:"sc-assets-backdrop",onClick:()=>O(!1),"aria-hidden":!0}),o.jsx(sue,{open:_,onOpenChange:B}),I&&o.jsx(Aue,{brand:u,shots:p,shotsTotal:(Xs==null?void 0:Xs.all)??0,attached:z,full:he,onToken:le=>{var Fe;return(Fe=Ie.current)==null?void 0:Fe.insertToken(le)},offToken:le=>{var Fe;return(Fe=Ie.current)==null?void 0:Fe.removeToken(le)},onTemplate:le=>{var Fe;return(Fe=Ie.current)==null?void 0:Fe.applyScene(le)},offTemplate:()=>{var le;return(le=Ie.current)==null?void 0:le.removeTemplate()},onClose:()=>O(!1)}),o.jsxs(GL,{full:!fa,children:[o.jsx(By,{}),Oe.size>0&&o.jsx(Hue,{count:Oe.size,sets:g,activeSet:e,onAdd:le=>void br(le),onRemove:e?()=>void wn(e):void 0,onNew:()=>{An.current=[...Oe],Rs(!0)},onClear:()=>ae(new Set),onKeep:()=>void Qn(),onArchiveBatch:le=>dn(le),allKept:En.length>0&&En.every(le=>le.kept),archivedLens:ke==="archived",pickedIds:[...Oe],onRestoreBatch:le=>vr(le),onDeleteBatch:le=>void Ke(le).then(()=>ae(new Set)),loaded:Wt.length,onSelectAll:()=>ae(new Set(Wt.map(le=>le.id)))}),o.jsx(Zy,{ref:Ie,projectId:Zt||null,brand:u,engines:t,parentId:h,initialBrief:me,suppressDraftRestore:Rt!==null,startScene:K5(P,"scene")??void 0,startSetup:P.get("setup")??void 0,startPresenter:K5(P,"presenter")??void 0,startProduct:P.get("product")??void 0,startRef:P.get("ref")??void 0,startView:P.get("view")??void 0,startFresh:P.get("fresh")==="1",onSeedsSpent:wt,openAttachTab:yG(P.get("attach")),target:ve,onClearTarget:Ct,onRestoreBranchId:De,guided:!0,setSlug:(e==null?void 0:e.slug)??null,onSending:at,onAttached:J,onCeiling:te,sourceImage:et??void 0,onQueued:(le,Fe,lt,en)=>{re(null),R(Pn=>{const fn=new URLSearchParams(Pn);for(const or of G5)fn.delete(or);return fn.delete("attach"),fn.delete("product"),fn},{replace:!0});const nn=()=>at(null),Zn=()=>{Fe!=="edit"||!le||R(Pn=>{const fn=new URLSearchParams(Pn);return fn.set("branch",le),fn},{replace:!0})},$n=()=>{Ut(en??[]),Zn(),nn()};e&&le?Ee.addToSet(e.id,lt!=null&<.length?lt:[le]).then(Pn=>Kt(e.id,Pn.nodeIds)).catch(Pn=>Ge(ln(Pn,"Could not add to the set"))).finally($n):$n()}})]}),o.jsx(zc,{context:fo})]})}const pS='[aria-modal="true"], [role="alertdialog"], .rt-BaseDialogContent, .sc-newdlg-layer';function Kue(e){return e!=null&&e.closest(pS)?!0:!!(e!=null&&e.closest("[data-radix-popper-content-wrapper]"))&&!!document.querySelector(pS)}const xv=new Map,Gue=4e3;function Yue(e){xv.set(e,performance.now())}function que(e){const t=xv.get(e);if(t!==void 0&&performance.now()-t<Gue)return t;xv.delete(e)}function Xue(e){var t;return vi((t=e.brief)==null?void 0:t.format)}function Que(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 Jue=e=>({"--sc-pic-ar":e[0]/e[1],"--sc-pic-w":`${e[0]}px`});function ede({node:e,onRetry:t,onCancel:n,engineName:r,menu:a}){const[i,l]=s.useState(null),[,u]=s.useState(0);s.useEffect(()=>{if(e.status!=="running")return;const k=setInterval(()=>u(C=>C+1),1e3);return()=>clearInterval(k)},[e.status]),e.status==="running"&&D6.add(e.id);const[,f]=s.useState(0),h=s.useRef(null),[p,g]=s.useState(null),m=s.useCallback(()=>{D6.delete(e.id),f(k=>k+1)},[e.id]);if(s.useEffect(()=>{e.status!=="done"&&(e1=null)},[e.status]),s.useEffect(()=>()=>{e1=null},[]),e.kind==="root")return o.jsx(W0,{className:"sc-frame",p:"8",children:o.jsxs(Zs,{direction:"column",align:"center",gap:"2",py:"6",children:[o.jsx($c,{className:"sc-display",size:"7",align:"center",children:"Blank canvas, full brand."}),o.jsx($c,{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":Xue(e)},children:[o.jsx($a,{since:Xa(e),from:tde(e.id)}),o.jsxs("div",{className:"sc-stage-wait-say",children:[o.jsx("span",{className:"sc-stage-wait-t",role:"timer","aria-label":`${Jw(Xa(e))}, ${a2(Xa(e))} seconds`,children:Oc(Xa(e))}),n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"})]})]});if(e.status==="cancelled"||e.status==="error"){const C=e.status==="cancelled"?DM():uo(e.error,r);return o.jsx(CM,{failure:C,density:"stage",onRetry:t})}const w=e.status==="done"?e.images[0]:void 0,y=w?Que(e)??(i==null?void 0:i.size)??null:null,b=!!w&&!!y&&e.status==="done"&&D6.has(e.id)&&!g1(),S=w?o.jsxs(W0,{className:y?"sc-frame sc-stage-pic":"sc-frame sc-stage-free",style:y?Jue(y):void 0,"data-arriving":b||void 0,children:[o.jsx(nde,{hash:w,alt:e.promptHead,imgRef:h,bare:b,onPainted:(k,C,E)=>{l({hash:k,size:[C,E]}),g(k),e1=k}}),b&&o.jsx(ib,{img:h,ready:p===w,onDone:m})]}):o.jsx(Zs,{justify:"center",children:o.jsx(W0,{className:"sc-frame",style:{display:"inline-block",maxWidth:"100%"}})});return a?o.jsxs(ef,{children:[o.jsx(tf,{children:S}),a]}):S}const D6=new Set;let e1=null;function tde(e){const t=que(e);return t!==void 0&&e1?{src:Dr(e1),at:t}:void 0}function nde({hash:e,alt:t,onPainted:n,imgRef:r,bare:a}){const[i,l]=s.useState(null),u=s.useRef(null),f=i===e,h=g=>{!(g!=null&&g.complete)||!g.naturalWidth||g.src!==new URL(Dr(e),location.href).href||u.current!==e&&(u.current=e,l(e),n==null||n(e,g.naturalWidth,g.naturalHeight))},p=u.current&&u.current!==e?Dr(u.current):vn(e,"tile");return o.jsxs(W0,{position:"relative",style:{lineHeight:0},children:[!f&&!a&&o.jsx("img",{className:"sc-stage-under",src:p,alt:"","aria-hidden":!0,decoding:"async"}),o.jsx("img",{ref:g=>{r&&(r.current=g),h(g)},src:Dr(e),alt:t,className:"sc-stage-img","data-ready":f||void 0,onLoad:g=>h(g.currentTarget)})]})}const rde=e=>((e==null?void 0:e.tokens)??[]).filter(t=>t&&typeof t.t=="string");function i$(e,t){return rde(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 person";case"template":return t.scene(String(r.id))??"a place";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 kv=new Set;function l$({id:e}){return kv.add(e),null}function c$({id:e,src:t,active:n}){const r=s.useRef(null),[a,i]=s.useState(!1),[,l]=s.useState(0),u=s.useCallback(()=>{kv.delete(e),l(f=>f+1)},[e]);return!kv.has(e)||g1()?o.jsx("img",{src:t,alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":n,width:52,height:52}):o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":n,children:[o.jsx("img",{ref:f=>{r.current=f,f!=null&&f.complete&&f.naturalWidth&&!a&&i(!0)},src:t,alt:"",className:"sc-thumb-landing",decoding:"async",onLoad:()=>i(!0)}),o.jsx(ib,{img:r,ready:a,onDone:u})]})}const sde=e=>e===0?"Original":`Refinement ${e}`,ade=e=>e===0?"the original":`Refinement ${e}`,ode=(e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id),ide=e=>e.status==="cancelled"?"Stopped":"Did not finish";function lde(e,t,n){const r=new Set(e.map(m=>m.id)),a=new Map(n.map(m=>[m.id,m]));a.set(t.id,t);const i=[...a.values()].filter(m=>!r.has(m.id)&&m.parentId!==null&&r.has(m.parentId)),l=(i.length?[...e,...i].sort(ode):e).map(m=>a.get(m.id)??m),f=(l.some(m=>m.id===t.id)?l:[...l,t]).filter(m=>m.id===t.id||m.images[0]||m.status==="running"||m.parentId===t.id&&(m.status==="error"||m.status==="cancelled"));let h=0;const p=f.map(m=>{const w=m.images[0]?"ready":m.status==="running"?"pending":"failed";if(w==="failed"&&m.kind==="edit")return{node:m,index:-1,label:ide(m),from:null,state:w};const y=m.kind==="edit"?++h:0;return{node:m,index:y,label:sde(y),from:null,state:w}}),g=new Map(p.map((m,w)=>[m.node.id,w]));return p.map((m,w)=>{if(w===0||!m.node.parentId||m.node.parentId===p[w-1].node.id)return m;const y=g.get(m.node.parentId);return y===void 0||p[y].index<0?m:{...m,from:ade(p[y].index)}})}function cde(e,t){var n;return((n=e.find(r=>r.state==="pending"&&r.node.parentId===t))==null?void 0:n.node)??null}function u$(e,t){const n=e.find(a=>a.node.id===t);if(!n)return"";if(n.index<0)return n.label;const r=Math.max(0,...e.map(a=>a.index));return n.index===0?"Original":`Refinement ${n.index} of ${r}`}const Qh=28;function ude({trail:e,activeId:t,names:n,onSelect:r}){var w;const a=s.useRef(null),i=s.useMemo(()=>e.map(y=>i$(y.node,n)),[e,n]),l=Zd(),u=(y,b,S)=>l.open({key:y.node.id,src:vn(y.node.images[0],"tile"),label:y.label,said:i[b],from:y.from,el:S,id:y.node.id});s.useEffect(()=>{var y,b;(b=(y=a.current)==null?void 0:y.querySelector('[aria-pressed="true"]'))==null||b.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[t]);const[f,h]=s.useState(null);s.useEffect(()=>{const y=a.current;if(!y)return;const b=()=>{const C=y.scrollWidth-y.clientWidth;if(C<=1)return h(null);const E=y.scrollLeft;h(E<=1?"end":E>=C-1?"start":"both")},S=()=>{const C=y.querySelector("[data-pending]")??y.querySelector('[aria-pressed="true"]');if(!C)return;const E=C.getBoundingClientRect(),A=y.getBoundingClientRect();E.left<A.left+Qh?y.scrollLeft-=A.left+Qh-E.left:E.right>A.right-Qh&&(y.scrollLeft+=E.right-(A.right-Qh))};b(),y.addEventListener("scroll",b,{passive:!0});const k=new ResizeObserver(()=>{S(),b()});return k.observe(y),()=>{y.removeEventListener("scroll",b),k.disconnect()}},[e.length]),s.useEffect(()=>{const y=a.current;if(!y)return;const b=S=>{y.scrollWidth<=y.clientWidth||Math.abs(S.deltaY)<=Math.abs(S.deltaX)||(S.preventDefault(),y.scrollLeft+=S.deltaY)};return y.addEventListener("wheel",b,{passive:!1}),()=>y.removeEventListener("wheel",b)},[]);const p=y=>{var C,E;const b=[...((C=a.current)==null?void 0:C.querySelectorAll(".sc-trail-tile:not([aria-disabled])"))??[]],S=b.indexOf(document.activeElement);let k=-1;if(y.key==="ArrowRight")k=Math.min(b.length-1,S+1);else if(y.key==="ArrowLeft")k=Math.max(0,S-1);else if(y.key==="Home")k=0;else if(y.key==="End")k=b.length-1;else return;y.preventDefault(),y.stopPropagation(),(E=b[k])==null||E.focus()},g=e.some(y=>y.node.id===t)?t:(w=e[0])==null?void 0:w.node.id,m=u$(e,t);return o.jsxs("div",{className:"sc-trail",children:[m&&o.jsx("span",{className:"sc-trail-say",children:m}),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,b)=>{const S=y.node,k=S.id===t,C=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[b]?`${y.label}: ${i[b]}`:y.label}${C?", still rendering":""}`,"aria-pressed":k,"data-pending":C||void 0,tabIndex:S.id===g?0:-1,onClick:()=>{l.closeNow(),r(S.id)},onPointerEnter:E=>E.pointerType==="mouse"&&y.state==="ready"&&u(y,b,E.currentTarget),onPointerLeave:E=>E.pointerType==="mouse"&&l.close(),onFocus:E=>l2(E.currentTarget)&&y.state==="ready"&&u(y,b,E.currentTarget),children:y.state==="ready"?o.jsx(c$,{id:S.id,src:vn(S.images[0],"micro"),active:k}):C?o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":k,children:[o.jsx($a,{since:Xa(S)}),o.jsx(l$,{id:S.id})]}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":k,children:o.jsx(Bc,{size:14})})},S.id)})}),l.shown&&o.jsx(Vd,{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 b;const y=(b=l.shown)==null?void 0:b.id;l.closeNow(),y&&r(y)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const dde=200,mS=32;function fde({shots:e,activeId:t,onSelect:n,onEndReached:r,complete:a}){var y;const i=s.useRef(null),l=Zd(),u=(b,S)=>l.open({key:b.id,src:vn(b.images[0],"tile"),label:Hr(b),el:S,id:b.id}),f=s.useRef(!1);s.useLayoutEffect(()=>{var S;const b=(S=i.current)==null?void 0:S.querySelector('[aria-pressed="true"]');b&&(b.scrollIntoView({block:"center",behavior:f.current?"smooth":"auto"}),f.current=!0)},[t]);const h=s.useRef(null),p=()=>{const b=i.current,S=h.current;if(!b||!S)return;const k=b.scrollHeight-b.clientHeight,C=b.scrollTop;S.style.setProperty("--sc-shotrail-start",k>1?Math.min(1,C/mS).toFixed(3):"0"),S.style.setProperty("--sc-shotrail-end",k>1?Math.min(1,(k-C)/mS).toFixed(3):"0")};s.useLayoutEffect(()=>{const b=i.current;if(!b)return;p();const S=new ResizeObserver(p);return S.observe(b),()=>S.disconnect()},[e.length]);const g=()=>{p();const b=i.current;!b||a||b.scrollTop+b.clientHeight>=b.scrollHeight-dde&&r()},m=b=>{var E,A;const S=[...((E=i.current)==null?void 0:E.querySelectorAll(".sc-shotrail-tile:not([aria-disabled])"))??[]],k=S.indexOf(document.activeElement);let C=-1;if(b.key==="ArrowDown")C=Math.min(S.length-1,k+1);else if(b.key==="ArrowUp")C=Math.max(0,k-1);else if(b.key==="Home")C=0;else if(b.key==="End")C=S.length-1;else return;b.preventDefault(),b.stopPropagation(),(A=S[C])==null||A.focus()},w=e.some(b=>b.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:m,children:e.map(b=>{const S=b.id===t,k=b.status==="running",C=b.status==="done"&&!!b.images[0];return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-shotrail-tile","aria-label":k?`${Hr(b)}, still rendering`:Hr(b),"aria-pressed":S,tabIndex:b.id===w?0:-1,onClick:()=>{l.closeNow(),n(b.id)},onPointerEnter:E=>E.pointerType==="mouse"&&C&&u(b,E.currentTarget),onPointerLeave:E=>E.pointerType==="mouse"&&l.close(),onFocus:E=>l2(E.currentTarget)&&C&&u(b,E.currentTarget),children:C?o.jsx(c$,{id:b.id,src:vn(b.images[0],"micro"),active:S}):k?o.jsxs("span",{className:"sc-thumb sc-thumb-wait","data-active":S,children:[o.jsx($a,{since:Xa(b)}),o.jsx(l$,{id:b.id})]}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":S,children:o.jsx(Bc,{size:14})})},b.id)})})}),l.shown&&o.jsx(Vd,{anchor:l.shown.el,kind:"shot",noun:"Shot",side:"beside",src:l.shown.src,label:l.shown.label,onOpen:()=>{var S;const b=(S=l.shown)==null?void 0:S.id;l.closeNow(),b&&n(b)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const hde=60;function pde({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)<hde||Math.abs(i)<2*Math.abs(l)||(i<0?e():t())},onPointerCancel:()=>{n.current=null}}}function mde(e){const t=Un(),n=Zd(),{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 b=y.target;b!=null&&b.closest(".sc-chip-preview")||b!=null&&b.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=>l2(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})}}),m=o.jsxs(o.Fragment,{children:[u&&o.jsx(Vd,{anchor:u.el,kind:u.kind,src:Tn(u.src,"tile"),label:u.label,onOpen:()=>{const w=u;f(),w.to?t(w.to):p({src:Tn(w.src,"full"),kind:w.kind,label:w.label})},onHoverIn:n.keep,onHoverOut:()=>!i&&n.close(),onClose:f},u.key),h&&o.jsx(Nd,{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:m}}function gde({brief:e,prompt:t,brand:n,saidRef:r,expanded:a,clamped:i}){var $,N;const{scenes:l,presenters:u,demoProducts:f}=Mn(),h=mde(".sc-ingredient"),p=(e==null?void 0:e.tokens)??[],g=(($=n==null?void 0:n.json)==null?void 0:$.products)??[],m=((N=n==null?void 0:n.json)==null?void 0:N.characters)??[],w=Jc(n),y=of(n==null?void 0:n.json),[b,S]=s.useState({});s.useEffect(()=>{for(const j of p){if((j==null?void 0:j.t)!=="template")continue;const P=w.find(H=>H.id===j.id);if(!(P!=null&&P.previewUrl)||hd(P.previewColor))continue;const R=`t${j.id}`;FL(P.previewUrl).then(H=>{const D=hd(H??void 0);D&&S(U=>U[R]?U:{...U,[R]:D})})}});const k={products:g,demoProducts:f,cast:m,presenters:u,scenes:[...w,...l]},C=j=>{var R,H;const P=TL(j,k);if((P==null?void 0:P.kind)==="product"){const{product:D,demo:U}=P;return{key:`p${j.id}`,kind:"product",label:(D==null?void 0:D.name)??(U==null?void 0:U.name)??"product",thumb:D?Qm((H=(R=D==null?void 0:D.shots)==null?void 0:R[0])==null?void 0:H.file,"micro"):(U==null?void 0:U.previewUrl)??null,to:n&&(D||U)?Aa(n,j.id):void 0}}if((P==null?void 0:P.kind)==="presenter"){const{character:D,presenter:U}=P,_=(U==null?void 0:U.id)??(D==null?void 0:D.presenterId)??((D==null?void 0:D.origin)==="custom"?D.id:void 0),B=D?ay(D):U?Si(U):{src:null};return{key:`h${j.id}`,kind:"presenter",label:D!=null&&D.supersededBy?`${D.name}, edited since`:(D==null?void 0:D.name)??(U==null?void 0:U.name)??"someone",thumb:B.src,crop:B.crop,to:n&&_?La(n,_):void 0}}if((P==null?void 0:P.kind)==="scene"){const D=P.scene;return{key:`t${j.id}`,kind:"scene",label:(D==null?void 0:D.name)??"a place no longer in the catalog",thumb:(D==null?void 0:D.previewUrl)??null,to:n&&D?Br(n,D.id):void 0,tint:hd(D==null?void 0:D.previewColor),custom:P.custom}}if((j==null?void 0:j.t)==="color")return{key:`c${j.hex}`,kind:"color",label:j.name??j.hex,swatch:j.hex};if((j==null?void 0:j.t)==="ref")return{key:`r${j.imageHash}`,kind:"ref",label:j.label??"reference image",thumb:vn(j.imageHash,"micro"),previewHash:j.imageHash};if((j==null?void 0:j.t)==="mark"){const D=y.find(U=>U.hash===j.imageHash);return{key:`m${j.imageHash}`,kind:"mark",label:D?i2(n==null?void 0:n.json,D):"brand mark",thumb:vn(j.imageHash,"micro"),previewHash:j.imageHash}}return null},E=j=>{const P=o.jsxs(o.Fragment,{children:[j.thumb?o.jsx("img",{src:j.thumb,alt:"","data-crop":j.crop}):j.swatch?o.jsx("i",{style:{background:j.swatch}}):null,j.label]}),R=j.tint??(j.custom?b[j.key]:void 0),H=R?{"--tint":R}:void 0,D=(j.previewHash?vn(j.previewHash,"tile"):Tn(j.thumb,"tile"))??(j.to?"":null);if(D!==null&&vp(j.kind)){const U=j.kind,_=h.isOpen(j.key),B={key:j.key,src:D,kind:U,label:j.label,to:j.to};return o.jsx("button",{type:"button",className:"sc-ingredient","data-kind":j.kind,"data-tinted":R?"":void 0,style:H,title:_?void 0:`${j.label}. Preview.`,"aria-label":`${j.label}. Preview.`,...h.bind(B),children:P},j.key)}return o.jsx("span",{className:"sc-ingredient","data-kind":j.kind,"data-tinted":R?"":void 0,style:H,title:j.label,children:P},j.key)},A=[];for(const j of p){if(j.t==="text"){const R=j.v.trim();R&&A.push(R);continue}const P=C(j);P&&A.push(E(P))}if(!A.length&&!t)return null;const L=A.flatMap((j,P)=>P?[" ",j]:[j]);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:L.length?L:t||""}),h.surface]})}const vde=256,cl=new Map;function Sv(e,t){for(cl.delete(e),cl.set(e,t);cl.size>vde;)cl.delete(cl.keys().next().value)}function d$(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 wde(e,t){Sv(e,t);for(const n of t.history??[])n.id!==e&&Sv(n.id,d$(t.history??[],n))}function gS(e){const t=e.parentId?cl.get(e.parentId):void 0,n=t==null?void 0:t.history;if(!n)return;const r=n.some(a=>a.id===e.id)?n.map(a=>a.id===e.id?e:a):[...n,e];for(const a of r)Sv(a.id,d$(r,a))}function yde(e){var i;const[t,n]=s.useState(()=>{const l=cl.get(e.id);return l?{id:e.id,lineage:l}:null});s.useEffect(()=>{let l=!0;return Ee.lineage(e.id).then(u=>{l&&(wde(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:cl.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 bde=32,ul=new Map;function xde(e){for(ul.delete(e.id),ul.set(e.id,e);ul.size>bde;)ul.delete(ul.keys().next().value)}function kde(e){const[t,n]=s.useState(()=>ul.get(e.id)??null);return s.useEffect(()=>{const r=ul.get(e.id);if(r){n(r);return}let a=!0;return Ee.node(e.id).then(i=>{a&&(xde(i),n(i))}).catch(()=>{}),()=>{a=!1}},[e.id]),(t==null?void 0:t.id)===e.id?t:ul.get(e.id)??null}const Sde="(max-width: 1023px)",f$=380,h$=480,vS=380,Ou=e=>Math.min(h$,Math.max(f$,Math.round(e)));function Ede({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:m,onLanded:w,onRemix:y,onArchive:b,onUnarchive:S,onDelete:k,onRefined:C,subscribeActivity:E,tokenNames:A}){const{ancestors:L,children:$,history:N}=yde(e),j=kde(e),P=s.useMemo(()=>l.find(ke=>ke.id===e.engineId),[l,e.engineId]),{push:R}=rr(),[H,D]=Pa(Qr.ovlPanelW,vS),U=s.useRef(0),_=s.useRef(0),B=s.useRef(null),K=s.useMemo(()=>{var ke;return(((ke=e.brief)==null?void 0:ke.tokens)??[]).some(Je=>(Je==null?void 0:Je.t)&&Je.t!=="text"&&Je.t!=="format")},[e.brief]),V=s.useMemo(()=>{const ke=of(i.json);return{...A,mark:Je=>{const Et=ke.find(Xe=>Xe.hash===Je);return Et?i2(i.json,Et):null}}},[A,i]),O=s.useMemo(()=>i$(j??e,V),[j,e,V]),[I,Y]=s.useState(!1),[Z,X]=s.useState(!1),[z,J]=s.useState(!1),[he,te]=s.useState(!1),[me,re]=s.useState(!1),[ee,q]=s.useState(!1);s.useEffect(()=>{J(!1),q(!1),te(!1)},[e.id]),s.useEffect(()=>{if(!z)return;const ke=setTimeout(()=>J(!1),1400);return()=>clearTimeout(ke)},[z]),s.useEffect(()=>{if(!ee)return;const ke=setTimeout(()=>q(!1),1400);return()=>clearTimeout(ke)},[ee]);const[ie,Oe]=s.useState(null);zy(ie,"--sc-ovl-dock-h");const ae=s.useRef(null),[pe,Te]=s.useState(!1),[gt,Ze]=s.useState(!1);s.useEffect(()=>Te(!1),[e.id]),s.useLayoutEffect(()=>{const ke=ae.current;if(!ke||pe)return;const Je=()=>Ze(ke.scrollHeight>ke.clientHeight+1);Je();const Et=new ResizeObserver(Je);return Et.observe(ke),()=>Et.disconnect()},[O,pe]);const[tt,De]=s.useState([]);s.useEffect(()=>{if(!(!E||tt.length===0))return E(ke=>{const Je=new Map(ke.map(Et=>[Et.id,Et]));De(Et=>{const Xe=Et.map(rt=>Je.get(rt.id)??rt);return Xe.some((rt,nt)=>rt!==Et[nt])?Xe:Et})})},[E,tt.length]);const Se=s.useMemo(()=>lde(N??[...L,e,...$.slice(0,6)],e,tt.length?[...n,...tt]:n),[N,L,e,$,n,tt]),Q=s.useMemo(()=>cde(Se,e.id),[Se,e.id]);s.useEffect(()=>{const ke=tt.find(Je=>Je.status==="done"&&Je.images[0]);ke&&(De(Je=>Je.filter(Et=>Et.id!==ke.id)),gS(ke),e.id===ke.parentId&&h(ke.id))},[tt,e.id,h]);const je=s.useMemo(()=>Se.find(ke=>ke.node.id===e.id)??null,[Se,e.id]),Re=Or(Sde),se=Se.length>1&&Re?u$(Se,e.id):e.kind!=="edit"?"Shot":N&&je?je.label:"Refinement",G=s.useMemo(()=>b4(n,e.id),[n,e.id]);s.useEffect(()=>{G.at>=0&&!a&&n.length-G.at<=6&&r()},[G.at,n.length,a,r]);const oe=ke=>{const Je=ke>0?G.next:G.prev;Je&&h(Je.id)},Ne=Zd(),Ue=(ke,Je)=>ke!=null&&ke.images[0]?{onPointerEnter:Et=>{Et.pointerType==="mouse"&&Ne.open({key:ke.id,src:vn(ke.images[0],"tile"),label:Hr(ke),noun:Je,el:Et.currentTarget,id:ke.id})},onPointerLeave:Et=>{Et.pointerType==="mouse"&&Ne.close()}}:{},st=pde({onLeft:()=>oe(1),onRight:()=>oe(-1)});s.useEffect(()=>{const ke=Ne.shown;if(!ke)return;const Je=ke.noun==="Next shot"?G.next:G.prev;Je!=null&&Je.images[0]?Ne.open({key:Je.id,src:vn(Je.images[0],"tile"),label:Hr(Je),noun:ke.noun,el:ke.el,id:Je.id}):Ne.closeNow()},[e.id]),s.useEffect(()=>{var Xe,rt;const ke=Se.findIndex(nt=>nt.node.id===e.id),Et=[(Xe=Se[ke-1])==null?void 0:Xe.node,(rt=Se[ke+1])==null?void 0:rt.node,G.prev,G.next].filter(nt=>!!(nt!=null&&nt.images[0])).map(nt=>{var Yt;const qt=new Image;return qt.decoding="async",qt.src=vn(nt.images[0],"tile"),(Yt=qt.decode)==null||Yt.call(qt).catch(()=>{}),qt});return()=>{for(const nt of Et)nt.src=""}},[Se,e.id,G.prev,G.next]);const Pe=e.images[0],Ie=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",Ge=async(ke=!1)=>{if(!Z){X(!0);try{const Je=fetch(Dr(Pe)).then(Et=>{if(!Et.ok)throw new Error(`HTTP ${Et.status}`);return Et.blob()});await navigator.clipboard.write([new ClipboardItem({"image/png":Je})]),ke?R({kind:"success",title:"Copied to clipboard"}):J(!0)}catch(Je){R(ln(Je,"Copy failed"))}finally{X(!1)}}},ft=async()=>{if(!he){te(!0);try{await(e.archived?S(e):b(e))}finally{te(!1)}}},bt=async()=>{if(!me){re(!0);try{const ke=e.brief?yy(e.brief):null;if(!ke||ke.every(Je=>Je.t==="text"&&!Je.v.trim()))await navigator.clipboard.writeText(O);else{const Je=rt=>{var nt;switch(rt.t){case"text":return rt.v;case"product":return V.product(rt.id)??"a product";case"character":return V.person(rt.id)??"a person";case"template":return V.scene(rt.id)??"a place";case"color":return rt.name??rt.hex;case"ref":return"reference image";case"mark":return((nt=V.mark)==null?void 0:nt.call(V,rt.imageHash))??"brand mark"}},{text:Et,html:Xe}=Bee(ke,Je);await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Et],{type:"text/plain"}),"text/html":new Blob([Xe],{type:"text/html"})})])}q(!0)}catch(ke){R(ln(ke,"Copy failed"))}finally{re(!1)}}};s.useEffect(()=>{const ke=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ke}},[]);const at=[{key:"download",label:"Download",icon:o.jsx(BE,{size:14}),onClick:()=>{const ke=document.createElement("a");ke.href=Dr(Pe),ke.download=`${Ie}.png`,ke.click()}},{key:"keep",label:e.kept?"Remove from keepers":"Keep",icon:o.jsx(to,{size:14,weight:e.kept?"fill":"regular"}),onClick:()=>m(e),tint:e.kept?"var(--sc-star)":void 0,on:e.kept},{key:"copy",label:"Copy image",icon:z?o.jsx(Gn,{size:14,weight:"bold"}):o.jsx(o5,{size:14}),onClick:()=>void Ge(),onMenu:()=>void Ge(!0),busy:Z,said:z?"Copied":void 0}],Zt=[{key:"archive",label:e.archived?"Restore":"Archive",icon:e.archived?o.jsx(s1,{size:14}):o.jsx(vm,{size:14}),onClick:()=>void ft(),busy:he},...e.archived?[{key:"delete",label:"Delete permanently",icon:o.jsx(km,{size:14}),onClick:()=>Y(!0),tint:"var(--sc-red)",dialog:!0}]:[]],jt=e.status==="done"&&e.images.length>0,Ft=!jt&&e.kind!=="edit"&&!!e.brief,Pt=jt?[...at,...Zt]:Zt,$t=jt?o.jsx(nf,{children:Pt.map(ke=>o.jsxs(rf,{onSelect:ke.onMenu??ke.onClick,disabled:ke.busy,color:ke.tint?"red":void 0,children:[ke.icon,ke.label]},ke.key))}):void 0;return Ur.createPortal(o.jsx(Ld,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:ke=>{var Je;ke.preventDefault(),(Je=B.current)==null||Je.focus({preventScroll:!0})},children:o.jsxs("div",{ref:B,tabIndex:-1,className:"sc-ovl","data-fb":"shot-overlay","data-fb-node":e.id,role:"dialog","aria-modal":"true","aria-label":Hr(e),"data-rail":n.length>1?"":void 0,style:{"--sc-ovl-panel-w":`${Ou(H)}px`},children:[n.length>1&&o.jsx(fde,{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(hr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:f,"aria-label":"Close",children:o.jsx(jn,{size:13})})}),G.at>=0&&n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!G.prev,onClick:()=>G.prev&&h(G.prev.id),"aria-label":"Previous shot",...Ue(G.prev,"Previous shot"),children:o.jsx(Ha,{size:13})}),o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!G.next,onClick:()=>G.next&&h(G.next.id),"aria-label":"Next shot",...Ue(G.next,"Next shot"),children:o.jsx(Rl,{size:13})})]})]}),Pt.length>0&&o.jsxs("div",{className:"sc-ovl-bar-r",children:[o.jsx("div",{className:"sc-ovl-acts",children:Pt.map(ke=>o.jsx(hr,{label:ke.said??ke.label,open:!!ke.said,children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:ke.onClick,"aria-label":ke.label,"aria-pressed":ke.on===void 0?void 0:ke.on,"data-on":ke.on||void 0,"aria-haspopup":ke.dialog?"dialog":void 0,"aria-busy":ke.busy||void 0,"data-busy":ke.busy||void 0,style:ke.tint?{color:ke.tint}:void 0,children:ke.icon})},ke.key))}),o.jsxs(Es,{children:[o.jsx(hr,{label:"More actions",children:o.jsx(Cs,{children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-overflow","aria-label":"More actions",children:o.jsx(_v,{size:18,weight:"bold"})})})}),o.jsx(js,{align:"end",sideOffset:6,children:Pt.map(ke=>o.jsxs(Wn,{onSelect:ke.onMenu??ke.onClick,disabled:ke.busy,color:ke.tint?"red":void 0,children:[ke.icon,ke.label]},ke.key))})]})]})]}),o.jsx(K1,{open:I,onOpenChange:Y,children:o.jsxs(G1,{maxWidth:"420px",children:[o.jsx(Y1,{children:"Delete this shot permanently?"}),o.jsx(q1,{size:"2",children:"This cannot be undone."}),o.jsxs(Zs,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Q1,{children:o.jsx(ja,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(X1,{children:o.jsx(ja,{color:"red",onClick:()=>k(e),children:"Delete permanently"})})]})]})}),Ne.shown&&o.jsx(Vd,{anchor:Ne.shown.el,kind:"shot",noun:Ne.shown.noun,src:Ne.shown.src,label:Ne.shown.label,onOpen:()=>{var Je;const ke=(Je=Ne.shown)==null?void 0:Je.id;Ne.closeNow(),ke&&h(ke)},onHoverIn:Ne.keep,onHoverOut:Ne.close,onClose:Ne.closeNow},Ne.shown.key),o.jsxs("div",{className:"sc-ovl-stage","data-takes":Se.length>1?"":void 0,...st,children:[o.jsx(ede,{node:e,onRetry:()=>p(e),onCancel:()=>g(e),engineName:P==null?void 0:P.displayName,menu:$t}),Se.length>1?o.jsx(ude,{trail:Se,activeId:e.id,names:V,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":f$,"aria-valuemax":h$,"aria-valuenow":Ou(H),tabIndex:0,onPointerDown:ke=>{ke.button===0&&(ke.preventDefault(),ke.stopPropagation(),ke.currentTarget.setPointerCapture(ke.pointerId))},onPointerMove:ke=>{if(!ke.currentTarget.hasPointerCapture(ke.pointerId))return;const Je=ke.currentTarget.closest(".sc-ovl");U.current=ke.clientX,!_.current&&(_.current=requestAnimationFrame(()=>{_.current=0,Je==null||Je.style.setProperty("--sc-ovl-panel-w",`${Ou(window.innerWidth-U.current)}px`)}))},onPointerUp:ke=>{ke.currentTarget.hasPointerCapture(ke.pointerId)&&(ke.currentTarget.releasePointerCapture(ke.pointerId),D(Ou(window.innerWidth-ke.clientX)))},onDoubleClick:ke=>{ke.stopPropagation(),D(vS)},onKeyDown:ke=>{ke.key==="ArrowLeft"?D(Je=>Ou(Je+16)):ke.key==="ArrowRight"&&D(Je=>Ou(Je-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:se}),e.archived&&o.jsx("small",{className:"sc-ovl-flag",children:"archived"}),jt&&e.costUsd>0&&o.jsxs("small",{className:"sc-ovl-spend",title:"Of your API budget",children:["$",e.costUsd.toFixed(2)]})]}),e.kind!=="root"&&(O||K)&&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(hr,{label:ee?"Copied":"Copy the prompt",open:ee||void 0,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-copy","aria-label":"Copy the prompt","aria-busy":me||void 0,"data-busy":me?"":void 0,onClick:()=>void bt(),children:ee?o.jsx(Gn,{size:14,weight:"bold"}):o.jsx(o5,{size:14})})})]}),o.jsx("div",{className:"sc-brief-record",children:o.jsx(gde,{brief:e.brief,prompt:(j==null?void 0:j.prompt)??e.promptHead,brand:i,saidRef:ae,expanded:pe,clamped:gt&&!pe})}),(gt||pe)&&o.jsx("button",{type:"button",className:"sc-s sc-ovl-more","aria-expanded":pe,onClick:()=>Te(ke=>!ke),children:pe?o.jsxs(o.Fragment,{children:[o.jsx(RF,{size:12})," Show less"]}):o.jsxs(o.Fragment,{children:[o.jsx(kl,{size:12})," Show more"]})})]}),(jt||Ft)&&o.jsxs("div",{className:"sc-sugg",children:[Ft&&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(Rd,{size:12})," Edit the prompt"]}),jt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>p(e),title:"Run the same setup again for a different take",children:[o.jsx(s1,{size:12})," Try again"]}),jt&&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(yp,{size:12})," Reuse setup"]})]})]}),(jt||e.status==="running")&&o.jsx("div",{className:"sc-ovl-edit sc-dock",ref:Oe,children:o.jsx(Zy,{variant:"overlay",projectId:u,brand:i,engines:l,parentId:t,target:e,holdFor:e.status==="running"?e:Q,sourceImage:Pe,persistDraft:!1,onQueued:(ke,Je,Et,Xe)=>{w(Xe??[]);const rt=Je==="edit"?Xe==null?void 0:Xe.find(nt=>nt.id===ke):void 0;rt?(Yue(rt.id),gS(rt),De(nt=>[...nt.filter(qt=>qt.id!==rt.id),rt]),h(rt.id)):ke&&h(ke),ke&&(C==null||C(ke,Je))}})})]})]})}),document.body)}function wS(){const{shotId:e}=ia(),t=KH(),{push:n}=rr(),r=e?t.byId.get(e)??null:null,[a,i]=s.useState(null);s.useEffect(()=>{if(!e||r)return;let g=!0;return Ee.node(e).then(m=>g&&i({id:e,node:m.kind==="root"?null:m})).catch(()=>g&&i({id:e,node:null})),()=>{g=!1}},[e,r]);const l=s.useRef(a);l.current=a,s.useEffect(()=>{if(!e||r)return;let g=!0;const m=t.subscribeActivity(w=>{const y=w.find(S=>S.id===e);if(y)return i({id:e,node:y});const b=l.current;(b==null?void 0:b.id)!==e||!b.node||!a$([b.node],w).length||Ee.node(e).then(S=>g&&i({id:e,node:S.kind==="root"?null:S})).catch(()=>{})});return()=>{g=!1,m()}},[e,r,t.subscribeActivity]);const u=r??(a!==null&&a.id===e?a.node:null),f=!r&&a!==null&&a.id===e&&a.node===null,h=s.useRef(null);u&&(h.current=u);const p=u??(f?null:h.current);return s.useEffect(()=>{f&&(n({kind:"info",title:"That shot is no longer available",detail:"Back to the feed."}),t.close())},[f,t.close,n]),p?o.jsx(Ede,{node:p,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,subscribeActivity:t.subscribeActivity,tokenNames:t.tokenNames,onRemix:t.remix,onArchive:()=>t.archive(p),onUnarchive:()=>t.unarchive(p),onDelete:()=>t.delete(p)}):f?null:o.jsx("div",{className:"sc-ovl-wait",role:"status","aria-label":"Loading",children:o.jsx(Tr,{size:"3"})})}const yS=10;function Cde(){const{status:e,recent:t,history:n,featured:r,running:a,releasesUrl:i,notesFor:l,markSeen:u}=tu(),{hash:f}=Bn(),h=f.startsWith("#v")?n.findIndex(k=>`#v${k.version}`===f)+1:0,[p,g]=s.useState(yS),m=Math.min(n.length,Math.max(p,t.length,h)),w=m<n.length,y=s.useRef(null),b=k=>{var C;y.current=k?((C=n[m])==null?void 0:C.version)??null:null,g(m+yS)};s.useEffect(()=>{var C,E;const k=y.current;y.current=null,!(!k||w)&&((E=(C=document.getElementById(`v${k}`))==null?void 0:C.querySelector("h2"))==null||E.focus())},[m,w]),s.useEffect(()=>{e==="ready"&&u()},[e,u]);const S=s.useRef(null);return s.useEffect(()=>{let k=0;const C=requestAnimationFrame(()=>{k=window.setTimeout(()=>{var E;return(E=S.current)==null?void 0:E.focus({preventScroll:!0})},0)});return()=>{cancelAnimationFrame(C),window.clearTimeout(k)}},[]),s.useEffect(()=>{var k;e!=="ready"||!f||(k=document.getElementById(decodeURIComponent(f.slice(1))))==null||k.scrollIntoView({block:"start"})},[e,f]),o.jsx(ds,{children:o.jsxs("main",{className:"sc-wn-page",id:"main","aria-labelledby":"sc-wn-title",children:[o.jsxs("header",{className:"sc-wn-page-head",children:[o.jsx("h1",{id:"sc-wn-title",ref:S,tabIndex:-1,children:"What's new"}),o.jsx("p",{children:"What changed in Scenri, newest first."})]}),e==="failed"?o.jsx("p",{className:"sc-wn-txt",children:nP}):e==="ready"&&n.length===0?o.jsx("p",{className:"sc-wn-txt",children:rP}):o.jsxs(o.Fragment,{children:[o.jsx("ol",{className:"sc-wn-list",children:n.slice(0,m).map(k=>o.jsx(jde,{current:k.version===a,entry:k,lead:k.version===(r==null?void 0:r.version),notes:l(k.version)},k.version))}),w&&o.jsx(Ade,{count:m,onMore:b})]}),e==="ready"&&i&&o.jsxs("footer",{className:"sc-wn-page-foot",children:[o.jsx("p",{children:"Every version, and every fix the notes here leave out, is in the full release notes."}),o.jsxs("a",{className:"sc-wn-link",href:i,target:"_blank",rel:"noopener noreferrer",children:["Full release notes",o.jsx("span",{className:"sc-vh",children:" on GitHub, opens in a new tab"}),o.jsx(Mc,{size:13,"aria-hidden":"true"})]})]})]})})}function jde({entry:e,lead:t,current:n,notes:r}){const a=!!e.announce,i=sP(e),[l,u]=s.useState(!1);return o.jsxs("li",{className:"sc-wn-row",id:`v${e.version}`,"data-kind":a?"headline":"small","data-lead":t||void 0,children:[o.jsx(iP,{entry:e,current:n}),o.jsxs("div",{className:"sc-wn-what",children:[e.title&&o.jsx("h2",{className:"sc-wn-row-hed",tabIndex:-1,children:e.title}),i&&o.jsx(aP,{picture:i,eager:t,onOpen:()=>u(!0)}),o.jsx(ZJ,{sections:e.sections}),r&&o.jsx(BJ,{href:r,version:e.version})]}),l&&i&&o.jsx(VJ,{src:i.src,alt:i.alt,onClose:()=>u(!1)})]})}function Ade({count:e,onMore:t}){const n=s.useRef(null),r=s.useRef(t);return r.current=t,s.useEffect(()=>{const a=n.current;if(!a||typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(l=>l.some(u=>u.isIntersecting)&&r.current(!1),{rootMargin:"0px 0px 480px 0px"});return i.observe(a),()=>i.disconnect()},[e]),o.jsx("div",{className:"sc-wn-more",children:o.jsx("button",{ref:n,type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>r.current(document.activeElement===n.current),children:"Show older updates"})})}function Nde(){const e=aE();return o.jsx(Zs,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Ww,{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(ja,{size:"1",variant:"soft",color:"gray",onClick:()=>window.location.reload(),children:"Reload"})})})}function Mde(){const{setSlug:e=""}=ia(),{pathname:t,search:n}=Bn(),{brand:r,sets:a,loaded:i,refresh:l}=un(),u=Un(),f=gn({path:pt.set,end:!1}),h=a.find(m=>m.slug===e)??a.find(m=>m.id===e)??null;Xc(h==null?void 0:h.name);const[p,g]=s.useState(null);if(s.useEffect(()=>{if(!i||h)return;if(p===e){u(jr(r),{replace:!0});return}let m=!0;return l().finally(()=>m&&g(e)),()=>{m=!1}},[i,h,e,p,r,u,l]),s.useEffect(()=>{h&&g(null)},[h]),!i||!h)return null;if(h.slug!==e){const m=f?t.slice(f.pathnameBase.length):"";return o.jsx(Ta,{to:H0(r,h)+m+n,replace:!0})}return o.jsx(o$,{set:h},h.id)}function Rde(){const{pathname:e,search:t}=Bn();return o.jsx(Ta,{to:vG(e,t),replace:!0})}function bS(){const{pathname:e,search:t,hash:n}=Bn();return o.jsx(Ta,{to:xG(e,t,n),replace:!0})}function Pde(){const{brandSlug:e}=ia();return o.jsx(Ta,{to:`/${e}?settings=brand`,replace:!0})}function Lde(){const{sceneId:e}=ia();return o.jsxs(o.Fragment,{children:[o.jsx(Joe,{},e),o.jsx(zc,{})]})}function Tde(){const{presenterId:e}=ia();return o.jsxs(o.Fragment,{children:[o.jsx(iie,{},e),o.jsx(zc,{},e)]})}function $de(){const{productId:e}=ia();return o.jsx(tue,{},e)}const Dde=ZO([{element:o.jsx(ose,{}),errorElement:o.jsx(Nde,{}),children:[{index:!0,element:o.jsx(ree,{})},{path:pt.setup,element:o.jsx(hse,{})},{path:pt.legacy,element:o.jsx(Rde,{})},{path:pt.brand,element:o.jsx(Xre,{}),children:[{index:!0,element:o.jsx(Zoe,{})},{path:pt.hub,element:o.jsx(o$,{set:null}),children:[{path:pt.hubShot,element:o.jsx(wS,{})}]},{path:pt.set,element:o.jsx(Mde,{}),children:[{path:pt.setShot,element:o.jsx(wS,{})}]},{path:pt.kit,element:o.jsx(Pde,{})},{path:pt.whatsNew,element:o.jsx(Cde,{})},{path:pt.products,element:o.jsx(Zce,{})},{path:pt.product,element:o.jsx($de,{})},{path:pt.scenes,element:o.jsx(Koe,{}),children:[{path:pt.sceneStudio,element:o.jsx(tS,{})}]},{path:pt.scene,element:o.jsx(Lde,{}),children:[{path:pt.sceneEdit,element:o.jsx(tS,{})}]},{path:pt.presenters,element:o.jsx(oie,{}),children:[{path:pt.presenterStudio,element:o.jsx(Sce,{})}]},{path:pt.presenter,element:o.jsx(Tde,{}),children:[{path:pt.presenterEdit,element:o.jsx(hce,{})}]},{path:pt.legacyPresenters,element:o.jsx(bS,{})},{path:pt.legacyScenes,element:o.jsx(bS,{})}]},{path:pt.notFound,element:o.jsx(Ta,{to:pt.root,replace:!0})}]}]),H6=localStorage.getItem("sc-theme")??localStorage.getItem("bt-theme");document.documentElement.dataset.theme=H6==="light"||H6==="dark"?H6:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";zq();const Hde={color:"currentColor",size:"1em",weight:"regular",mirrored:!1,"aria-hidden":!0};MD.createRoot(document.getElementById("root")).render(o.jsx(zn.StrictMode,{children:o.jsx(uE.Provider,{value:Hde,children:o.jsx(UK,{children:o.jsx(QK,{children:o.jsx(fO,{router:Dde})})})})}));
|