@homepages/concrete 13.0.1 → 14.0.0
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 +34 -0
- package/README.md +4 -5
- package/codemods/manifest.json +7 -0
- package/dist/artifact/playground/client/assets/index-DZbV6Ucf.js +1338 -0
- package/dist/artifact/playground/client/index.html +1 -1
- package/dist/artifact/playground/host.mjs +22 -22
- package/dist/cli/build/manifest.js +1 -1
- package/dist/cli/build/record.js +1 -1
- package/dist/cli/check/load-workspace.js +3 -6
- package/dist/cli/commands.js +63 -15
- package/dist/cli/media/deriver-plugin.js +10 -1
- package/dist/cli/publish/artifact.js +18 -40
- package/dist/cli/publish/fixtures.js +1 -1
- package/dist/cli/publish/index.js +90 -115
- package/dist/cli/publish/report.js +36 -56
- package/dist/cli/publish/send.js +142 -0
- package/dist/cli/publish/target.js +33 -31
- package/dist/cli/publish/verdict.js +65 -0
- package/dist/cli/release/client.js +69 -0
- package/dist/cli/release/index.js +143 -0
- package/dist/cli/release/report.js +73 -0
- package/dist/cli/upgrade/fixture-modules.js +3 -5
- package/dist/cli.js +1 -0
- package/dist/css/graph.js +29 -40
- package/dist/fixtures/media-plugin.js +7 -25
- package/dist/fixtures/package-stylesheets.js +12 -48
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/media-resolution/dist/image.js +23 -0
- package/dist/packages/internal/playground/dist/fixture-formats.js +5 -1
- package/dist/packages/internal/playground/dist/host/built.js +4 -12
- package/dist/packages/internal/playground/dist/host/catalog-fixture.js +0 -1
- package/dist/packages/internal/playground/dist/host/download.js +1 -8
- package/dist/packages/internal/playground/dist/host/fixture-addresses.js +3 -4
- package/dist/packages/internal/playground/dist/host/program.js +1 -2
- package/dist/packages/internal/playground/dist/host/serve.js +4 -30
- package/dist/packages/internal/playground/dist/host/stored-fixtures.js +2 -9
- package/dist/packages/internal/playground/dist/layout.js +5 -5
- package/dist/packages/internal/playground/dist/send-wire.js +9 -0
- package/dist/packages/internal/playground/dist/server/changes.js +0 -1
- package/dist/packages/internal/playground/dist/server/listen.js +2 -19
- package/dist/packages/internal/property-facts/dist/registry-facts.js +0 -7
- package/dist/packages/internal/template-artifact/dist/framework-floor.js +33 -0
- package/dist/packages/internal/template-artifact/dist/index.js +3 -3
- package/dist/packages/internal/template-artifact/dist/layout.js +2 -39
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +6 -57
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
- package/dist/template/logic-build.js +38 -19
- package/guide/reference/cli/INDEX.md +5 -4
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +1 -1
- package/guide/reference/cli/install.md +1 -1
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +1 -1
- package/guide/reference/cli/publish.md +17 -16
- package/guide/reference/cli/release.md +57 -0
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +1 -1
- package/package.json +6 -4
- package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +0 -1338
- package/dist/cli/publish/captures.js +0 -61
- package/dist/cli/publish/client.js +0 -118
- package/dist/cli/publish/pack.js +0 -77
- package/dist/cli/publish/playground.js +0 -27
- package/dist/cli/publish/wire.js +0 -23
|
@@ -1,1338 +0,0 @@
|
|
|
1
|
-
var e2=e=>{throw TypeError(e)};var xy=(e,t,n)=>t.has(e)||e2("Cannot "+n);var q=(e,t,n)=>(xy(e,t,"read from private field"),n?n.call(e):t.get(e)),Me=(e,t,n)=>t.has(e)?e2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),we=(e,t,n,r)=>(xy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ie=(e,t,n)=>(xy(e,t,"access private method"),n);var Df=(e,t,n,r)=>({set _(i){we(e,t,i,n)},get _(){return q(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function aD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wy={exports:{}},Ic={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var t2;function lD(){if(t2)return Ic;t2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var c=null;if(a!==void 0&&(c=""+a),i.key!==void 0&&(c=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:a}}return Ic.Fragment=t,Ic.jsx=n,Ic.jsxs=n,Ic}var n2;function cD(){return n2||(n2=1,wy.exports=lD()),wy.exports}var h=cD(),ky={exports:{}},Fe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var r2;function uD(){if(r2)return Fe;r2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function j(P,Y,L){this.props=P,this.context=Y,this.refs=S,this.updater=L||_}j.prototype.isReactComponent={},j.prototype.setState=function(P,Y){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,Y,"setState")},j.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function O(){}O.prototype=j.prototype;function A(P,Y,L){this.props=P,this.context=Y,this.refs=S,this.updater=L||_}var $=A.prototype=new O;$.constructor=A,k($,j.prototype),$.isPureReactComponent=!0;var C=Array.isArray;function I(){}var z={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function F(P,Y,L){var Z=L.ref;return{$$typeof:e,type:P,key:Y,ref:Z!==void 0?Z:null,props:L}}function W(P,Y){return F(P.type,Y,P.props)}function G(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function H(P){var Y={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(L){return Y[L]})}var U=/\/+/g;function D(P,Y){return typeof P=="object"&&P!==null&&P.key!=null?H(""+P.key):Y.toString(36)}function K(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(I,I):(P.status="pending",P.then(function(Y){P.status==="pending"&&(P.status="fulfilled",P.value=Y)},function(Y){P.status==="pending"&&(P.status="rejected",P.reason=Y)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,Y,L,Z,ne){var fe=typeof P;(fe==="undefined"||fe==="boolean")&&(P=null);var de=!1;if(P===null)de=!0;else switch(fe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(P.$$typeof){case e:case t:de=!0;break;case y:return de=P._init,M(de(P._payload),Y,L,Z,ne)}}if(de)return ne=ne(P),de=Z===""?"."+D(P,0):Z,C(ne)?(L="",de!=null&&(L=de.replace(U,"$&/")+"/"),M(ne,Y,L,"",function(ee){return ee})):ne!=null&&(G(ne)&&(ne=W(ne,L+(ne.key==null||P&&P.key===ne.key?"":(""+ne.key).replace(U,"$&/")+"/")+de)),Y.push(ne)),1;de=0;var pe=Z===""?".":Z+":";if(C(P))for(var N=0;N<P.length;N++)Z=P[N],fe=pe+D(Z,N),de+=M(Z,Y,L,fe,ne);else if(N=v(P),typeof N=="function")for(P=N.call(P),N=0;!(Z=P.next()).done;)Z=Z.value,fe=pe+D(Z,N++),de+=M(Z,Y,L,fe,ne);else if(fe==="object"){if(typeof P.then=="function")return M(K(P),Y,L,Z,ne);throw Y=String(P),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return de}function B(P,Y,L){if(P==null)return P;var Z=[],ne=0;return M(P,Z,"","",function(fe){return Y.call(L,fe,ne++)}),Z}function X(P){if(P._status===-1){var Y=P._result;Y=Y(),Y.then(function(L){(P._status===0||P._status===-1)&&(P._status=1,P._result=L)},function(L){(P._status===0||P._status===-1)&&(P._status=2,P._result=L)}),P._status===-1&&(P._status=0,P._result=Y)}if(P._status===1)return P._result.default;throw P._result}var se=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},J={map:B,forEach:function(P,Y,L){B(P,function(){Y.apply(this,arguments)},L)},count:function(P){var Y=0;return B(P,function(){Y++}),Y},toArray:function(P){return B(P,function(Y){return Y})||[]},only:function(P){if(!G(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Fe.Activity=m,Fe.Children=J,Fe.Component=j,Fe.Fragment=n,Fe.Profiler=i,Fe.PureComponent=A,Fe.StrictMode=r,Fe.Suspense=f,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(P){return z.H.useMemoCache(P)}},Fe.cache=function(P){return function(){return P.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(P,Y,L){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Z=k({},P.props),ne=P.key;if(Y!=null)for(fe in Y.key!==void 0&&(ne=""+Y.key),Y)!T.call(Y,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&Y.ref===void 0||(Z[fe]=Y[fe]);var fe=arguments.length-2;if(fe===1)Z.children=L;else if(1<fe){for(var de=Array(fe),pe=0;pe<fe;pe++)de[pe]=arguments[pe+2];Z.children=de}return F(P.type,ne,Z)},Fe.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:a,_context:P},P},Fe.createElement=function(P,Y,L){var Z,ne={},fe=null;if(Y!=null)for(Z in Y.key!==void 0&&(fe=""+Y.key),Y)T.call(Y,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ne[Z]=Y[Z]);var de=arguments.length-2;if(de===1)ne.children=L;else if(1<de){for(var pe=Array(de),N=0;N<de;N++)pe[N]=arguments[N+2];ne.children=pe}if(P&&P.defaultProps)for(Z in de=P.defaultProps,de)ne[Z]===void 0&&(ne[Z]=de[Z]);return F(P,fe,ne)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(P){return{$$typeof:u,render:P}},Fe.isValidElement=G,Fe.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:X}},Fe.memo=function(P,Y){return{$$typeof:p,type:P,compare:Y===void 0?null:Y}},Fe.startTransition=function(P){var Y=z.T,L={};z.T=L;try{var Z=P(),ne=z.S;ne!==null&&ne(L,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(I,se)}catch(fe){se(fe)}finally{Y!==null&&L.types!==null&&(Y.types=L.types),z.T=Y}},Fe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Fe.use=function(P){return z.H.use(P)},Fe.useActionState=function(P,Y,L){return z.H.useActionState(P,Y,L)},Fe.useCallback=function(P,Y){return z.H.useCallback(P,Y)},Fe.useContext=function(P){return z.H.useContext(P)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(P,Y){return z.H.useDeferredValue(P,Y)},Fe.useEffect=function(P,Y){return z.H.useEffect(P,Y)},Fe.useEffectEvent=function(P){return z.H.useEffectEvent(P)},Fe.useId=function(){return z.H.useId()},Fe.useImperativeHandle=function(P,Y,L){return z.H.useImperativeHandle(P,Y,L)},Fe.useInsertionEffect=function(P,Y){return z.H.useInsertionEffect(P,Y)},Fe.useLayoutEffect=function(P,Y){return z.H.useLayoutEffect(P,Y)},Fe.useMemo=function(P,Y){return z.H.useMemo(P,Y)},Fe.useOptimistic=function(P,Y){return z.H.useOptimistic(P,Y)},Fe.useReducer=function(P,Y,L){return z.H.useReducer(P,Y,L)},Fe.useRef=function(P){return z.H.useRef(P)},Fe.useState=function(P){return z.H.useState(P)},Fe.useSyncExternalStore=function(P,Y,L){return z.H.useSyncExternalStore(P,Y,L)},Fe.useTransition=function(){return z.H.useTransition()},Fe.version="19.2.6",Fe}var o2;function n0(){return o2||(o2=1,ky.exports=uD()),ky.exports}var w=n0();const ci=aD(w);var _y={exports:{}},Uc={},Sy={exports:{}},Ey={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var i2;function dD(){return i2||(i2=1,(function(e){function t(M,B){var X=M.length;M.push(B);e:for(;0<X;){var se=X-1>>>1,J=M[se];if(0<i(J,B))M[se]=B,M[X]=J,X=se;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var B=M[0],X=M.pop();if(X!==B){M[0]=X;e:for(var se=0,J=M.length,P=J>>>1;se<P;){var Y=2*(se+1)-1,L=M[Y],Z=Y+1,ne=M[Z];if(0>i(L,X))Z<J&&0>i(ne,L)?(M[se]=ne,M[Z]=X,se=Z):(M[se]=L,M[Y]=X,se=Y);else if(Z<J&&0>i(ne,X))M[se]=ne,M[Z]=X,se=Z;else break e}}return B}function i(M,B){var X=M.sortIndex-B.sortIndex;return X!==0?X:M.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],p=[],y=1,m=null,x=3,v=!1,_=!1,k=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function $(M){for(var B=n(p);B!==null;){if(B.callback===null)r(p);else if(B.startTime<=M)r(p),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(p)}}function C(M){if(k=!1,$(M),!_)if(n(f)!==null)_=!0,I||(I=!0,H());else{var B=n(p);B!==null&&K(C,B.startTime-M)}}var I=!1,z=-1,T=5,F=-1;function W(){return S?!0:!(e.unstable_now()-F<T)}function G(){if(S=!1,I){var M=e.unstable_now();F=M;var B=!0;try{e:{_=!1,k&&(k=!1,O(z),z=-1),v=!0;var X=x;try{t:{for($(M),m=n(f);m!==null&&!(m.expirationTime>M&&W());){var se=m.callback;if(typeof se=="function"){m.callback=null,x=m.priorityLevel;var J=se(m.expirationTime<=M);if(M=e.unstable_now(),typeof J=="function"){m.callback=J,$(M),B=!0;break t}m===n(f)&&r(f),$(M)}else r(f);m=n(f)}if(m!==null)B=!0;else{var P=n(p);P!==null&&K(C,P.startTime-M),B=!1}}break e}finally{m=null,x=X,v=!1}B=void 0}}finally{B?H():I=!1}}}var H;if(typeof A=="function")H=function(){A(G)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=G,H=function(){D.postMessage(null)}}else H=function(){j(G,0)};function K(M,B){z=j(function(){M(e.unstable_now())},B)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var X=x;x=B;try{return M()}finally{x=X}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(M,B){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var X=x;x=M;try{return B()}finally{x=X}},e.unstable_scheduleCallback=function(M,B,X){var se=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?se+X:se):X=se,M){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=X+J,M={id:y++,callback:B,priorityLevel:M,startTime:X,expirationTime:J,sortIndex:-1},X>se?(M.sortIndex=X,t(p,M),n(f)===null&&M===n(p)&&(k?(O(z),z=-1):k=!0,K(C,X-se))):(M.sortIndex=J,t(f,M),_||v||(_=!0,I||(I=!0,H()))),M},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(M){var B=x;return function(){var X=x;x=B;try{return M.apply(this,arguments)}finally{x=X}}}})(Ey)),Ey}var s2;function fD(){return s2||(s2=1,Sy.exports=dD()),Sy.exports}var jy={exports:{}},fn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var a2;function hD(){if(a2)return fn;a2=1;var e=n0();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(f,p,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:f,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fn.createPortal=function(f,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return a(f,p,null,y)},fn.flushSync=function(f){var p=c.T,y=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=y,r.d.f()}},fn.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},fn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},fn.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var y=p.as,m=u(y,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:v}):y==="script"&&r.d.X(f,{crossOrigin:m,integrity:x,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},fn.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},fn.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,m=u(y,p.crossOrigin);r.d.L(f,y,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},fn.preloadModule=function(f,p){if(typeof f=="string")if(p){var y=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},fn.requestFormReset=function(f){r.d.r(f)},fn.unstable_batchedUpdates=function(f,p){return f(p)},fn.useFormState=function(f,p,y){return c.H.useFormState(f,p,y)},fn.useFormStatus=function(){return c.H.useHostTransitionStatus()},fn.version="19.2.6",fn}var l2;function jA(){if(l2)return jy.exports;l2=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(),jy.exports=hD(),jy.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var c2;function pD(){if(c2)return Uc;c2=1;var e=fD(),t=n0(),n=jA();function r(o){var s="https://react.dev/errors/"+o;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+o+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var s=o,l=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,(s.flags&4098)!==0&&(l=s.return),o=s.return;while(o)}return s.tag===3?l:null}function c(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function u(o){if(o.tag===31){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function f(o){if(a(o)!==o)throw Error(r(188))}function p(o){var s=o.alternate;if(!s){if(s=a(o),s===null)throw Error(r(188));return s!==o?null:o}for(var l=o,d=s;;){var g=l.return;if(g===null)break;var b=g.alternate;if(b===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===l)return f(g),o;if(b===d)return f(g),s;b=b.sibling}throw Error(r(188))}if(l.return!==d.return)l=g,d=b;else{for(var E=!1,R=g.child;R;){if(R===l){E=!0,l=g,d=b;break}if(R===d){E=!0,d=g,l=b;break}R=R.sibling}if(!E){for(R=b.child;R;){if(R===l){E=!0,l=b,d=g;break}if(R===d){E=!0,d=b,l=g;break}R=R.sibling}if(!E)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?o:s}function y(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=y(o),s!==null)return s;o=o.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),A=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function H(o){return o===null||typeof o!="object"?null:(o=G&&o[G]||o["@@iterator"],typeof o=="function"?o:null)}var U=Symbol.for("react.client.reference");function D(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===U?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case k:return"Fragment";case j:return"Profiler";case S:return"StrictMode";case C:return"Suspense";case I:return"SuspenseList";case F:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case _:return"Portal";case A:return o.displayName||"Context";case O:return(o._context.displayName||"Context")+".Consumer";case $:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return s=o.displayName||null,s!==null?s:D(o.type)||"Memo";case T:s=o._payload,o=o._init;try{return D(o(s))}catch{}}return null}var K=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},se=[],J=-1;function P(o){return{current:o}}function Y(o){0>J||(o.current=se[J],se[J]=null,J--)}function L(o,s){J++,se[J]=o.current,o.current=s}var Z=P(null),ne=P(null),fe=P(null),de=P(null);function pe(o,s){switch(L(fe,s),L(ne,o),L(Z,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?_S(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=_S(s),o=SS(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Y(Z),L(Z,o)}function N(){Y(Z),Y(ne),Y(fe)}function ee(o){o.memoizedState!==null&&L(de,o);var s=Z.current,l=SS(s,o.type);s!==l&&(L(ne,o),L(Z,l))}function le(o){ne.current===o&&(Y(Z),Y(ne)),de.current===o&&(Y(de),$c._currentValue=X)}var xe,_e;function Oe(o){if(xe===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);xe=s&&s[1]||"",_e=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+xe+o+_e}var be=!1;function Te(o,s){if(!o||be)return"";be=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(ue){var ae=ue}Reflect.construct(o,[],ye)}else{try{ye.call()}catch(ue){ae=ue}o.call(ye.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(ye=o())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),E=b[0],R=b[1];if(E&&R){var V=E.split(`
|
|
44
|
-
`),oe=R.split(`
|
|
45
|
-
`);for(g=d=0;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;for(;g<oe.length&&!oe[g].includes("DetermineComponentFrameRoot");)g++;if(d===V.length||g===oe.length)for(d=V.length-1,g=oe.length-1;1<=d&&0<=g&&V[d]!==oe[g];)g--;for(;1<=d&&0<=g;d--,g--)if(V[d]!==oe[g]){if(d!==1||g!==1)do if(d--,g--,0>g||V[d]!==oe[g]){var he=`
|
|
46
|
-
`+V[d].replace(" at new "," at ");return o.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",o.displayName)),he}while(1<=d&&0<=g);break}}}finally{be=!1,Error.prepareStackTrace=l}return(l=o?o.displayName||o.name:"")?Oe(l):""}function tt(o,s){switch(o.tag){case 26:case 27:case 5:return Oe(o.type);case 16:return Oe("Lazy");case 13:return o.child!==s&&s!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Te(o.type,!1);case 11:return Te(o.type.render,!1);case 1:return Te(o.type,!0);case 31:return Oe("Activity");default:return""}}function Ne(o){try{var s="",l=null;do s+=tt(o,l),l=o,o=o.return;while(o);return s}catch(d){return`
|
|
47
|
-
Error generating stack: `+d.message+`
|
|
48
|
-
`+d.stack}}var Ve=Object.prototype.hasOwnProperty,it=e.unstable_scheduleCallback,It=e.unstable_cancelCallback,zt=e.unstable_shouldYield,$r=e.unstable_requestPaint,xt=e.unstable_now,jo=e.unstable_getCurrentPriorityLevel,qs=e.unstable_ImmediatePriority,Ri=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Le=e.unstable_LowPriority,Je=e.unstable_IdlePriority,gt=e.log,lt=e.unstable_setDisableYieldValue,Ut=null,yt=null;function nn(o){if(typeof gt=="function"&<(o),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ut,o)}catch{}}var dn=Math.clz32?Math.clz32:Zs,Vs=Math.log,zr=Math.LN2;function Zs(o){return o>>>=0,o===0?32:31-(Vs(o)/zr|0)|0}var Ks=256,Gs=262144,Ys=4194304;function br(o){var s=o&42;if(s!==0)return s;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Qs(o,s,l){var d=o.pendingLanes;if(d===0)return 0;var g=0,b=o.suspendedLanes,E=o.pingedLanes;o=o.warmLanes;var R=d&134217727;return R!==0?(d=R&~b,d!==0?g=br(d):(E&=R,E!==0?g=br(E):l||(l=R&~o,l!==0&&(g=br(l))))):(R=d&~b,R!==0?g=br(R):E!==0?g=br(E):l||(l=d&~o,l!==0&&(g=br(l)))),g===0?0:s!==0&&s!==g&&(s&b)===0&&(b=g&-g,l=s&-s,b>=l||b===32&&(l&4194048)!==0)?s:g}function Ti(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function xd(o,s){switch(o){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wd(){var o=Ys;return Ys<<=1,(Ys&62914560)===0&&(Ys=4194304),o}function ql(o){for(var s=[],l=0;31>l;l++)s.push(o);return s}function $i(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function dm(o,s,l,d,g,b){var E=o.pendingLanes;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=l,o.entangledLanes&=l,o.errorRecoveryDisabledLanes&=l,o.shellSuspendCounter=0;var R=o.entanglements,V=o.expirationTimes,oe=o.hiddenUpdates;for(l=E&~l;0<l;){var he=31-dn(l),ye=1<<he;R[he]=0,V[he]=-1;var ae=oe[he];if(ae!==null)for(oe[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}l&=~ye}d!==0&&Vl(o,d,0),b!==0&&g===0&&o.tag!==0&&(o.suspendedLanes|=b&~(E&~s))}function Vl(o,s,l){o.pendingLanes|=s,o.suspendedLanes&=~s;var d=31-dn(s);o.entangledLanes|=s,o.entanglements[d]=o.entanglements[d]|1073741824|l&261930}function Zl(o,s){var l=o.entangledLanes|=s;for(o=o.entanglements;l;){var d=31-dn(l),g=1<<d;g&s|o[d]&s&&(o[d]|=s),l&=~g}}function kd(o,s){var l=s&-s;return l=(l&42)!==0?1:Kl(l),(l&(o.suspendedLanes|s))!==0?0:l}function Kl(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Gl(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function ie(){var o=B.p;return o!==0?o:(o=window.event,o===void 0?32:KS(o.type))}function Se(o,s){var l=B.p;try{return B.p=o,s()}finally{B.p=l}}var Ue=Math.random().toString(36).slice(2),Ze="__reactFiber$"+Ue,Pe="__reactProps$"+Ue,vr="__reactContainer$"+Ue,Dr="__reactEvents$"+Ue,Q$="__reactListeners$"+Ue,X$="__reactHandles$"+Ue,u1="__reactResources$"+Ue,Yl="__reactMarker$"+Ue;function fm(o){delete o[Ze],delete o[Pe],delete o[Dr],delete o[Q$],delete o[X$]}function Xs(o){var s=o[Ze];if(s)return s;for(var l=o.parentNode;l;){if(s=l[vr]||l[Ze]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(o=MS(o);o!==null;){if(l=o[Ze])return l;o=MS(o)}return s}o=l,l=o.parentNode}return null}function Ws(o){if(o=o[Ze]||o[vr]){var s=o.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return o}return null}function Ql(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o.stateNode;throw Error(r(33))}function Js(o){var s=o[u1];return s||(s=o[u1]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Xt(o){o[Yl]=!0}var d1=new Set,f1={};function zi(o,s){ea(o,s),ea(o+"Capture",s)}function ea(o,s){for(f1[o]=s,o=0;o<s.length;o++)d1.add(s[o])}var W$=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),h1={},p1={};function J$(o){return Ve.call(p1,o)?!0:Ve.call(h1,o)?!1:W$.test(o)?p1[o]=!0:(h1[o]=!0,!1)}function _d(o,s,l){if(J$(s))if(l===null)o.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+l)}}function Sd(o,s,l){if(l===null)o.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+l)}}function Lr(o,s,l,d){if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttributeNS(s,l,""+d)}}function Yn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function m1(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function e3(o,s,l){var d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s);if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,b=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return g.call(this)},set:function(E){l=""+E,b.call(this,E)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function hm(o){if(!o._valueTracker){var s=m1(o)?"checked":"value";o._valueTracker=e3(o,s,""+o[s])}}function g1(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return o&&(d=m1(o)?o.checked?"true":"false":o.value),o=d,o!==l?(s.setValue(o),!0):!1}function Ed(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var t3=/[\n"\\]/g;function Qn(o){return o.replace(t3,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function pm(o,s,l,d,g,b,E,R){o.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?o.type=E:o.removeAttribute("type"),s!=null?E==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+Yn(s)):o.value!==""+Yn(s)&&(o.value=""+Yn(s)):E!=="submit"&&E!=="reset"||o.removeAttribute("value"),s!=null?mm(o,E,Yn(s)):l!=null?mm(o,E,Yn(l)):d!=null&&o.removeAttribute("value"),g==null&&b!=null&&(o.defaultChecked=!!b),g!=null&&(o.checked=g&&typeof g!="function"&&typeof g!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?o.name=""+Yn(R):o.removeAttribute("name")}function y1(o,s,l,d,g,b,E,R){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(o.type=b),s!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||s!=null)){hm(o);return}l=l!=null?""+Yn(l):"",s=s!=null?""+Yn(s):l,R||s===o.value||(o.value=s),o.defaultValue=s}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,o.checked=R?o.checked:!!d,o.defaultChecked=!!d,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.name=E),hm(o)}function mm(o,s,l){s==="number"&&Ed(o.ownerDocument)===o||o.defaultValue===""+l||(o.defaultValue=""+l)}function ta(o,s,l,d){if(o=o.options,s){s={};for(var g=0;g<l.length;g++)s["$"+l[g]]=!0;for(l=0;l<o.length;l++)g=s.hasOwnProperty("$"+o[l].value),o[l].selected!==g&&(o[l].selected=g),g&&d&&(o[l].defaultSelected=!0)}else{for(l=""+Yn(l),s=null,g=0;g<o.length;g++){if(o[g].value===l){o[g].selected=!0,d&&(o[g].defaultSelected=!0);return}s!==null||o[g].disabled||(s=o[g])}s!==null&&(s.selected=!0)}}function b1(o,s,l){if(s!=null&&(s=""+Yn(s),s!==o.value&&(o.value=s),l==null)){o.defaultValue!==s&&(o.defaultValue=s);return}o.defaultValue=l!=null?""+Yn(l):""}function v1(o,s,l,d){if(s==null){if(d!=null){if(l!=null)throw Error(r(92));if(K(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),s=l}l=Yn(s),o.defaultValue=l,d=o.textContent,d===l&&d!==""&&d!==null&&(o.value=d),hm(o)}function na(o,s){if(s){var l=o.firstChild;if(l&&l===o.lastChild&&l.nodeType===3){l.nodeValue=s;return}}o.textContent=s}var n3=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function x1(o,s,l){var d=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?o.setProperty(s,""):s==="float"?o.cssFloat="":o[s]="":d?o.setProperty(s,l):typeof l!="number"||l===0||n3.has(s)?s==="float"?o.cssFloat=l:o[s]=(""+l).trim():o[s]=l+"px"}function w1(o,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(o=o.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?o.setProperty(d,""):d==="float"?o.cssFloat="":o[d]="");for(var g in s)d=s[g],s.hasOwnProperty(g)&&l[g]!==d&&x1(o,g,d)}else for(var b in s)s.hasOwnProperty(b)&&x1(o,b,s[b])}function gm(o){if(o.indexOf("-")===-1)return!1;switch(o){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 r3=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),o3=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function jd(o){return o3.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ir(){}var ym=null;function bm(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ra=null,oa=null;function k1(o){var s=Ws(o);if(s&&(o=s.stateNode)){var l=o[Pe]||null;e:switch(o=s.stateNode,s.type){case"input":if(pm(o,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=o;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qn(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==o&&d.form===o.form){var g=d[Pe]||null;if(!g)throw Error(r(90));pm(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===o.form&&g1(d)}break e;case"textarea":b1(o,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&ta(o,!!l.multiple,s,!1)}}}var vm=!1;function _1(o,s,l){if(vm)return o(s,l);vm=!0;try{var d=o(s);return d}finally{if(vm=!1,(ra!==null||oa!==null)&&(pf(),ra&&(s=ra,o=oa,oa=ra=null,k1(s),o)))for(s=0;s<o.length;s++)k1(o[s])}}function Xl(o,s){var l=o.stateNode;if(l===null)return null;var d=l[Pe]||null;if(d===null)return null;l=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(o=o.type,d=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!d;break e;default:o=!1}if(o)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xm=!1;if(Ur)try{var Wl={};Object.defineProperty(Wl,"passive",{get:function(){xm=!0}}),window.addEventListener("test",Wl,Wl),window.removeEventListener("test",Wl,Wl)}catch{xm=!1}var Oo=null,wm=null,Od=null;function S1(){if(Od)return Od;var o,s=wm,l=s.length,d,g="value"in Oo?Oo.value:Oo.textContent,b=g.length;for(o=0;o<l&&s[o]===g[o];o++);var E=l-o;for(d=1;d<=E&&s[l-d]===g[b-d];d++);return Od=g.slice(o,1<d?1-d:void 0)}function Ad(o){var s=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&s===13&&(o=13)):o=s,o===10&&(o=13),32<=o||o===13?o:0}function Cd(){return!0}function E1(){return!1}function _n(o){function s(l,d,g,b,E){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var R in o)o.hasOwnProperty(R)&&(l=o[R],this[R]=l?l(b):b[R]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Cd:E1,this.isPropagationStopped=E1,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Cd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Cd)},persist:function(){},isPersistent:Cd}),s}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nd=_n(Di),Jl=m({},Di,{view:0,detail:0}),i3=_n(Jl),km,_m,ec,Md=m({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Em,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==ec&&(ec&&o.type==="mousemove"?(km=o.screenX-ec.screenX,_m=o.screenY-ec.screenY):_m=km=0,ec=o),km)},movementY:function(o){return"movementY"in o?o.movementY:_m}}),j1=_n(Md),s3=m({},Md,{dataTransfer:0}),a3=_n(s3),l3=m({},Jl,{relatedTarget:0}),Sm=_n(l3),c3=m({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),u3=_n(c3),d3=m({},Di,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),f3=_n(d3),h3=m({},Di,{data:0}),O1=_n(h3),p3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},m3={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"},g3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function y3(o){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(o):(o=g3[o])?!!s[o]:!1}function Em(){return y3}var b3=m({},Jl,{key:function(o){if(o.key){var s=p3[o.key]||o.key;if(s!=="Unidentified")return s}return o.type==="keypress"?(o=Ad(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?m3[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Em,charCode:function(o){return o.type==="keypress"?Ad(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ad(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),v3=_n(b3),x3=m({},Md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),A1=_n(x3),w3=m({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Em}),k3=_n(w3),_3=m({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),S3=_n(_3),E3=m({},Md,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),j3=_n(E3),O3=m({},Di,{newState:0,oldState:0}),A3=_n(O3),C3=[9,13,27,32],jm=Ur&&"CompositionEvent"in window,tc=null;Ur&&"documentMode"in document&&(tc=document.documentMode);var N3=Ur&&"TextEvent"in window&&!tc,C1=Ur&&(!jm||tc&&8<tc&&11>=tc),N1=" ",M1=!1;function R1(o,s){switch(o){case"keyup":return C3.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ia=!1;function M3(o,s){switch(o){case"compositionend":return T1(s);case"keypress":return s.which!==32?null:(M1=!0,N1);case"textInput":return o=s.data,o===N1&&M1?null:o;default:return null}}function R3(o,s){if(ia)return o==="compositionend"||!jm&&R1(o,s)?(o=S1(),Od=wm=Oo=null,ia=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return C1&&s.locale!=="ko"?null:s.data;default:return null}}var T3={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 $1(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s==="input"?!!T3[o.type]:s==="textarea"}function z1(o,s,l,d){ra?oa?oa.push(d):oa=[d]:ra=d,s=wf(s,"onChange"),0<s.length&&(l=new Nd("onChange","change",null,l,d),o.push({event:l,listeners:s}))}var nc=null,rc=null;function $3(o){yS(o,0)}function Rd(o){var s=Ql(o);if(g1(s))return o}function D1(o,s){if(o==="change")return s}var L1=!1;if(Ur){var Om;if(Ur){var Am="oninput"in document;if(!Am){var I1=document.createElement("div");I1.setAttribute("oninput","return;"),Am=typeof I1.oninput=="function"}Om=Am}else Om=!1;L1=Om&&(!document.documentMode||9<document.documentMode)}function U1(){nc&&(nc.detachEvent("onpropertychange",P1),rc=nc=null)}function P1(o){if(o.propertyName==="value"&&Rd(rc)){var s=[];z1(s,rc,o,bm(o)),_1($3,s)}}function z3(o,s,l){o==="focusin"?(U1(),nc=s,rc=l,nc.attachEvent("onpropertychange",P1)):o==="focusout"&&U1()}function D3(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Rd(rc)}function L3(o,s){if(o==="click")return Rd(s)}function I3(o,s){if(o==="input"||o==="change")return Rd(s)}function U3(o,s){return o===s&&(o!==0||1/o===1/s)||o!==o&&s!==s}var Ln=typeof Object.is=="function"?Object.is:U3;function oc(o,s){if(Ln(o,s))return!0;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return!1;var l=Object.keys(o),d=Object.keys(s);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!Ve.call(s,g)||!Ln(o[g],s[g]))return!1}return!0}function F1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function B1(o,s){var l=F1(o);o=0;for(var d;l;){if(l.nodeType===3){if(d=o+l.textContent.length,o<=s&&d>=s)return{node:l,offset:s-o};o=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=F1(l)}}function H1(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?H1(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function q1(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Ed(o.document);s instanceof o.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)o=s.contentWindow;else break;s=Ed(o.document)}return s}function Cm(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}var P3=Ur&&"documentMode"in document&&11>=document.documentMode,sa=null,Nm=null,ic=null,Mm=!1;function V1(o,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mm||sa==null||sa!==Ed(d)||(d=sa,"selectionStart"in d&&Cm(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ic&&oc(ic,d)||(ic=d,d=wf(Nm,"onSelect"),0<d.length&&(s=new Nd("onSelect","select",null,s,l),o.push({event:s,listeners:d}),s.target=sa)))}function Li(o,s){var l={};return l[o.toLowerCase()]=s.toLowerCase(),l["Webkit"+o]="webkit"+s,l["Moz"+o]="moz"+s,l}var aa={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},Rm={},Z1={};Ur&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function Ii(o){if(Rm[o])return Rm[o];if(!aa[o])return o;var s=aa[o],l;for(l in s)if(s.hasOwnProperty(l)&&l in Z1)return Rm[o]=s[l];return o}var K1=Ii("animationend"),G1=Ii("animationiteration"),Y1=Ii("animationstart"),F3=Ii("transitionrun"),B3=Ii("transitionstart"),H3=Ii("transitioncancel"),Q1=Ii("transitionend"),X1=new Map,Tm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Tm.push("scrollEnd");function ur(o,s){X1.set(o,s),zi(s,[o])}var Td=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Xn=[],la=0,$m=0;function $d(){for(var o=la,s=$m=la=0;s<o;){var l=Xn[s];Xn[s++]=null;var d=Xn[s];Xn[s++]=null;var g=Xn[s];Xn[s++]=null;var b=Xn[s];if(Xn[s++]=null,d!==null&&g!==null){var E=d.pending;E===null?g.next=g:(g.next=E.next,E.next=g),d.pending=g}b!==0&&W1(l,g,b)}}function zd(o,s,l,d){Xn[la++]=o,Xn[la++]=s,Xn[la++]=l,Xn[la++]=d,$m|=d,o.lanes|=d,o=o.alternate,o!==null&&(o.lanes|=d)}function zm(o,s,l,d){return zd(o,s,l,d),Dd(o)}function Ui(o,s){return zd(o,null,null,s),Dd(o)}function W1(o,s,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l);for(var g=!1,b=o.return;b!==null;)b.childLanes|=l,d=b.alternate,d!==null&&(d.childLanes|=l),b.tag===22&&(o=b.stateNode,o===null||o._visibility&1||(g=!0)),o=b,b=b.return;return o.tag===3?(b=o.stateNode,g&&s!==null&&(g=31-dn(l),o=b.hiddenUpdates,d=o[g],d===null?o[g]=[s]:d.push(s),s.lane=l|536870912),b):null}function Dd(o){if(50<Oc)throw Oc=0,qg=null,Error(r(185));for(var s=o.return;s!==null;)o=s,s=o.return;return o.tag===3?o.stateNode:null}var ca={};function q3(o,s,l,d){this.tag=o,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(o,s,l,d){return new q3(o,s,l,d)}function Dm(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Pr(o,s){var l=o.alternate;return l===null?(l=In(o.tag,s,o.key,o.mode),l.elementType=o.elementType,l.type=o.type,l.stateNode=o.stateNode,l.alternate=o,o.alternate=l):(l.pendingProps=s,l.type=o.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=o.flags&65011712,l.childLanes=o.childLanes,l.lanes=o.lanes,l.child=o.child,l.memoizedProps=o.memoizedProps,l.memoizedState=o.memoizedState,l.updateQueue=o.updateQueue,s=o.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=o.sibling,l.index=o.index,l.ref=o.ref,l.refCleanup=o.refCleanup,l}function J1(o,s){o.flags&=65011714;var l=o.alternate;return l===null?(o.childLanes=0,o.lanes=s,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,s=l.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),o}function Ld(o,s,l,d,g,b){var E=0;if(d=o,typeof o=="function")Dm(o)&&(E=1);else if(typeof o=="string")E=Yz(o,l,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case F:return o=In(31,l,s,g),o.elementType=F,o.lanes=b,o;case k:return Pi(l.children,g,b,s);case S:E=8,g|=24;break;case j:return o=In(12,l,s,g|2),o.elementType=j,o.lanes=b,o;case C:return o=In(13,l,s,g),o.elementType=C,o.lanes=b,o;case I:return o=In(19,l,s,g),o.elementType=I,o.lanes=b,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case A:E=10;break e;case O:E=9;break e;case $:E=11;break e;case z:E=14;break e;case T:E=16,d=null;break e}E=29,l=Error(r(130,o===null?"null":typeof o,"")),d=null}return s=In(E,l,s,g),s.elementType=o,s.type=d,s.lanes=b,s}function Pi(o,s,l,d){return o=In(7,o,d,s),o.lanes=l,o}function Lm(o,s,l){return o=In(6,o,null,s),o.lanes=l,o}function ek(o){var s=In(18,null,null,0);return s.stateNode=o,s}function Im(o,s,l){return s=In(4,o.children!==null?o.children:[],o.key,s),s.lanes=l,s.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},s}var tk=new WeakMap;function Wn(o,s){if(typeof o=="object"&&o!==null){var l=tk.get(o);return l!==void 0?l:(s={value:o,source:s,stack:Ne(s)},tk.set(o,s),s)}return{value:o,source:s,stack:Ne(s)}}var ua=[],da=0,Id=null,sc=0,Jn=[],er=0,Ao=null,xr=1,wr="";function Fr(o,s){ua[da++]=sc,ua[da++]=Id,Id=o,sc=s}function nk(o,s,l){Jn[er++]=xr,Jn[er++]=wr,Jn[er++]=Ao,Ao=o;var d=xr;o=wr;var g=32-dn(d)-1;d&=~(1<<g),l+=1;var b=32-dn(s)+g;if(30<b){var E=g-g%5;b=(d&(1<<E)-1).toString(32),d>>=E,g-=E,xr=1<<32-dn(s)+g|l<<g|d,wr=b+o}else xr=1<<b|l<<g|d,wr=o}function Um(o){o.return!==null&&(Fr(o,1),nk(o,1,0))}function Pm(o){for(;o===Id;)Id=ua[--da],ua[da]=null,sc=ua[--da],ua[da]=null;for(;o===Ao;)Ao=Jn[--er],Jn[er]=null,wr=Jn[--er],Jn[er]=null,xr=Jn[--er],Jn[er]=null}function rk(o,s){Jn[er++]=xr,Jn[er++]=wr,Jn[er++]=Ao,xr=s.id,wr=s.overflow,Ao=o}var rn=null,wt=null,Xe=!1,Co=null,tr=!1,Fm=Error(r(519));function No(o){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(Wn(s,o)),Fm}function ok(o){var s=o.stateNode,l=o.type,d=o.memoizedProps;switch(s[Ze]=o,s[Pe]=d,l){case"dialog":Ge("cancel",s),Ge("close",s);break;case"iframe":case"object":case"embed":Ge("load",s);break;case"video":case"audio":for(l=0;l<Cc.length;l++)Ge(Cc[l],s);break;case"source":Ge("error",s);break;case"img":case"image":case"link":Ge("error",s),Ge("load",s);break;case"details":Ge("toggle",s);break;case"input":Ge("invalid",s),y1(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ge("invalid",s);break;case"textarea":Ge("invalid",s),v1(s,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||d.suppressHydrationWarning===!0||wS(s.textContent,l)?(d.popover!=null&&(Ge("beforetoggle",s),Ge("toggle",s)),d.onScroll!=null&&Ge("scroll",s),d.onScrollEnd!=null&&Ge("scrollend",s),d.onClick!=null&&(s.onclick=Ir),s=!0):s=!1,s||No(o,!0)}function ik(o){for(rn=o.return;rn;)switch(rn.tag){case 5:case 31:case 13:tr=!1;return;case 27:case 3:tr=!0;return;default:rn=rn.return}}function fa(o){if(o!==rn)return!1;if(!Xe)return ik(o),Xe=!0,!1;var s=o.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=o.type,l=!(l!=="form"&&l!=="button")||iy(o.type,o.memoizedProps)),l=!l),l&&wt&&No(o),ik(o),s===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));wt=NS(o)}else if(s===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));wt=NS(o)}else s===27?(s=wt,qo(o.type)?(o=uy,uy=null,wt=o):wt=s):wt=rn?rr(o.stateNode.nextSibling):null;return!0}function Fi(){wt=rn=null,Xe=!1}function Bm(){var o=Co;return o!==null&&(On===null?On=o:On.push.apply(On,o),Co=null),o}function ac(o){Co===null?Co=[o]:Co.push(o)}var Hm=P(null),Bi=null,Br=null;function Mo(o,s,l){L(Hm,s._currentValue),s._currentValue=l}function Hr(o){o._currentValue=Hm.current,Y(Hm)}function qm(o,s,l){for(;o!==null;){var d=o.alternate;if((o.childLanes&s)!==s?(o.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),o===l)break;o=o.return}}function Vm(o,s,l,d){var g=o.child;for(g!==null&&(g.return=o);g!==null;){var b=g.dependencies;if(b!==null){var E=g.child;b=b.firstContext;e:for(;b!==null;){var R=b;b=g;for(var V=0;V<s.length;V++)if(R.context===s[V]){b.lanes|=l,R=b.alternate,R!==null&&(R.lanes|=l),qm(b.return,l,o),d||(E=null);break e}b=R.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=l,b=E.alternate,b!==null&&(b.lanes|=l),qm(E,l,o),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===o){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function ha(o,s,l,d){o=null;for(var g=s,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var R=g.type;Ln(g.pendingProps.value,E.value)||(o!==null?o.push(R):o=[R])}}else if(g===de.current){if(E=g.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(o!==null?o.push($c):o=[$c])}g=g.return}o!==null&&Vm(s,o,l,d),s.flags|=262144}function Ud(o){for(o=o.firstContext;o!==null;){if(!Ln(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Hi(o){Bi=o,Br=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function on(o){return sk(Bi,o)}function Pd(o,s){return Bi===null&&Hi(o),sk(o,s)}function sk(o,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},Br===null){if(o===null)throw Error(r(308));Br=s,o.dependencies={lanes:0,firstContext:s},o.flags|=524288}else Br=Br.next=s;return l}var V3=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(l,d){o.push(d)}};this.abort=function(){s.aborted=!0,o.forEach(function(l){return l()})}},Z3=e.unstable_scheduleCallback,K3=e.unstable_NormalPriority,Pt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zm(){return{controller:new V3,data:new Map,refCount:0}}function lc(o){o.refCount--,o.refCount===0&&Z3(K3,function(){o.controller.abort()})}var cc=null,Km=0,pa=0,ma=null;function G3(o,s){if(cc===null){var l=cc=[];Km=0,pa=Qg(),ma={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Km++,s.then(ak,ak),s}function ak(){if(--Km===0&&cc!==null){ma!==null&&(ma.status="fulfilled");var o=cc;cc=null,pa=0,ma=null;for(var s=0;s<o.length;s++)(0,o[s])()}}function Y3(o,s){var l=[],d={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return o.then(function(){d.status="fulfilled",d.value=s;for(var g=0;g<l.length;g++)(0,l[g])(s)},function(g){for(d.status="rejected",d.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),d}var lk=M.S;M.S=function(o,s){V_=xt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&G3(o,s),lk!==null&&lk(o,s)};var qi=P(null);function Gm(){var o=qi.current;return o!==null?o:bt.pooledCache}function Fd(o,s){s===null?L(qi,qi.current):L(qi,s.pool)}function ck(){var o=Gm();return o===null?null:{parent:Pt._currentValue,pool:o}}var ga=Error(r(460)),Ym=Error(r(474)),Bd=Error(r(542)),Hd={then:function(){}};function uk(o){return o=o.status,o==="fulfilled"||o==="rejected"}function dk(o,s,l){switch(l=o[l],l===void 0?o.push(s):l!==s&&(s.then(Ir,Ir),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw o=s.reason,hk(o),o;default:if(typeof s.status=="string")s.then(Ir,Ir);else{if(o=bt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=s,o.status="pending",o.then(function(d){if(s.status==="pending"){var g=s;g.status="fulfilled",g.value=d}},function(d){if(s.status==="pending"){var g=s;g.status="rejected",g.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw o=s.reason,hk(o),o}throw Zi=s,ga}}function Vi(o){try{var s=o._init;return s(o._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Zi=l,ga):l}}var Zi=null;function fk(){if(Zi===null)throw Error(r(459));var o=Zi;return Zi=null,o}function hk(o){if(o===ga||o===Bd)throw Error(r(483))}var ya=null,uc=0;function qd(o){var s=uc;return uc+=1,ya===null&&(ya=[]),dk(ya,o,s)}function dc(o,s){s=s.props.ref,o.ref=s!==void 0?s:null}function Vd(o,s){throw s.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(s),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":o)))}function pk(o){function s(te,Q){if(o){var re=te.deletions;re===null?(te.deletions=[Q],te.flags|=16):re.push(Q)}}function l(te,Q){if(!o)return null;for(;Q!==null;)s(te,Q),Q=Q.sibling;return null}function d(te){for(var Q=new Map;te!==null;)te.key!==null?Q.set(te.key,te):Q.set(te.index,te),te=te.sibling;return Q}function g(te,Q){return te=Pr(te,Q),te.index=0,te.sibling=null,te}function b(te,Q,re){return te.index=re,o?(re=te.alternate,re!==null?(re=re.index,re<Q?(te.flags|=67108866,Q):re):(te.flags|=67108866,Q)):(te.flags|=1048576,Q)}function E(te){return o&&te.alternate===null&&(te.flags|=67108866),te}function R(te,Q,re,me){return Q===null||Q.tag!==6?(Q=Lm(re,te.mode,me),Q.return=te,Q):(Q=g(Q,re),Q.return=te,Q)}function V(te,Q,re,me){var $e=re.type;return $e===k?he(te,Q,re.props.children,me,re.key):Q!==null&&(Q.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&Vi($e)===Q.type)?(Q=g(Q,re.props),dc(Q,re),Q.return=te,Q):(Q=Ld(re.type,re.key,re.props,null,te.mode,me),dc(Q,re),Q.return=te,Q)}function oe(te,Q,re,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=Im(re,te.mode,me),Q.return=te,Q):(Q=g(Q,re.children||[]),Q.return=te,Q)}function he(te,Q,re,me,$e){return Q===null||Q.tag!==7?(Q=Pi(re,te.mode,me,$e),Q.return=te,Q):(Q=g(Q,re),Q.return=te,Q)}function ye(te,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Lm(""+Q,te.mode,re),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return re=Ld(Q.type,Q.key,Q.props,null,te.mode,re),dc(re,Q),re.return=te,re;case _:return Q=Im(Q,te.mode,re),Q.return=te,Q;case T:return Q=Vi(Q),ye(te,Q,re)}if(K(Q)||H(Q))return Q=Pi(Q,te.mode,re,null),Q.return=te,Q;if(typeof Q.then=="function")return ye(te,qd(Q),re);if(Q.$$typeof===A)return ye(te,Pd(te,Q),re);Vd(te,Q)}return null}function ae(te,Q,re,me){var $e=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return $e!==null?null:R(te,Q,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===$e?V(te,Q,re,me):null;case _:return re.key===$e?oe(te,Q,re,me):null;case T:return re=Vi(re),ae(te,Q,re,me)}if(K(re)||H(re))return $e!==null?null:he(te,Q,re,me,null);if(typeof re.then=="function")return ae(te,Q,qd(re),me);if(re.$$typeof===A)return ae(te,Q,Pd(te,re),me);Vd(te,re)}return null}function ue(te,Q,re,me,$e){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return te=te.get(re)||null,R(Q,te,""+me,$e);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case v:return te=te.get(me.key===null?re:me.key)||null,V(Q,te,me,$e);case _:return te=te.get(me.key===null?re:me.key)||null,oe(Q,te,me,$e);case T:return me=Vi(me),ue(te,Q,re,me,$e)}if(K(me)||H(me))return te=te.get(re)||null,he(Q,te,me,$e,null);if(typeof me.then=="function")return ue(te,Q,re,qd(me),$e);if(me.$$typeof===A)return ue(te,Q,re,Pd(Q,me),$e);Vd(Q,me)}return null}function Ce(te,Q,re,me){for(var $e=null,nt=null,Re=Q,He=Q=0,Qe=null;Re!==null&&He<re.length;He++){Re.index>He?(Qe=Re,Re=null):Qe=Re.sibling;var rt=ae(te,Re,re[He],me);if(rt===null){Re===null&&(Re=Qe);break}o&&Re&&rt.alternate===null&&s(te,Re),Q=b(rt,Q,He),nt===null?$e=rt:nt.sibling=rt,nt=rt,Re=Qe}if(He===re.length)return l(te,Re),Xe&&Fr(te,He),$e;if(Re===null){for(;He<re.length;He++)Re=ye(te,re[He],me),Re!==null&&(Q=b(Re,Q,He),nt===null?$e=Re:nt.sibling=Re,nt=Re);return Xe&&Fr(te,He),$e}for(Re=d(Re);He<re.length;He++)Qe=ue(Re,te,He,re[He],me),Qe!==null&&(o&&Qe.alternate!==null&&Re.delete(Qe.key===null?He:Qe.key),Q=b(Qe,Q,He),nt===null?$e=Qe:nt.sibling=Qe,nt=Qe);return o&&Re.forEach(function(Yo){return s(te,Yo)}),Xe&&Fr(te,He),$e}function De(te,Q,re,me){if(re==null)throw Error(r(151));for(var $e=null,nt=null,Re=Q,He=Q=0,Qe=null,rt=re.next();Re!==null&&!rt.done;He++,rt=re.next()){Re.index>He?(Qe=Re,Re=null):Qe=Re.sibling;var Yo=ae(te,Re,rt.value,me);if(Yo===null){Re===null&&(Re=Qe);break}o&&Re&&Yo.alternate===null&&s(te,Re),Q=b(Yo,Q,He),nt===null?$e=Yo:nt.sibling=Yo,nt=Yo,Re=Qe}if(rt.done)return l(te,Re),Xe&&Fr(te,He),$e;if(Re===null){for(;!rt.done;He++,rt=re.next())rt=ye(te,rt.value,me),rt!==null&&(Q=b(rt,Q,He),nt===null?$e=rt:nt.sibling=rt,nt=rt);return Xe&&Fr(te,He),$e}for(Re=d(Re);!rt.done;He++,rt=re.next())rt=ue(Re,te,He,rt.value,me),rt!==null&&(o&&rt.alternate!==null&&Re.delete(rt.key===null?He:rt.key),Q=b(rt,Q,He),nt===null?$e=rt:nt.sibling=rt,nt=rt);return o&&Re.forEach(function(sD){return s(te,sD)}),Xe&&Fr(te,He),$e}function pt(te,Q,re,me){if(typeof re=="object"&&re!==null&&re.type===k&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var $e=re.key;Q!==null;){if(Q.key===$e){if($e=re.type,$e===k){if(Q.tag===7){l(te,Q.sibling),me=g(Q,re.props.children),me.return=te,te=me;break e}}else if(Q.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&Vi($e)===Q.type){l(te,Q.sibling),me=g(Q,re.props),dc(me,re),me.return=te,te=me;break e}l(te,Q);break}else s(te,Q);Q=Q.sibling}re.type===k?(me=Pi(re.props.children,te.mode,me,re.key),me.return=te,te=me):(me=Ld(re.type,re.key,re.props,null,te.mode,me),dc(me,re),me.return=te,te=me)}return E(te);case _:e:{for($e=re.key;Q!==null;){if(Q.key===$e)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){l(te,Q.sibling),me=g(Q,re.children||[]),me.return=te,te=me;break e}else{l(te,Q);break}else s(te,Q);Q=Q.sibling}me=Im(re,te.mode,me),me.return=te,te=me}return E(te);case T:return re=Vi(re),pt(te,Q,re,me)}if(K(re))return Ce(te,Q,re,me);if(H(re)){if($e=H(re),typeof $e!="function")throw Error(r(150));return re=$e.call(re),De(te,Q,re,me)}if(typeof re.then=="function")return pt(te,Q,qd(re),me);if(re.$$typeof===A)return pt(te,Q,Pd(te,re),me);Vd(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(l(te,Q.sibling),me=g(Q,re),me.return=te,te=me):(l(te,Q),me=Lm(re,te.mode,me),me.return=te,te=me),E(te)):l(te,Q)}return function(te,Q,re,me){try{uc=0;var $e=pt(te,Q,re,me);return ya=null,$e}catch(Re){if(Re===ga||Re===Bd)throw Re;var nt=In(29,Re,null,te.mode);return nt.lanes=me,nt.return=te,nt}finally{}}}var Ki=pk(!0),mk=pk(!1),Ro=!1;function Qm(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xm(o,s){o=o.updateQueue,s.updateQueue===o&&(s.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function To(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function $o(o,s,l){var d=o.updateQueue;if(d===null)return null;if(d=d.shared,(st&2)!==0){var g=d.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),d.pending=s,s=Dd(o),W1(o,null,l),s}return zd(o,d,s,l),Dd(o)}function fc(o,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var d=s.lanes;d&=o.pendingLanes,l|=d,s.lanes=l,Zl(o,l)}}function Wm(o,s){var l=o.updateQueue,d=o.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var E={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?g=b=E:b=b.next=E,l=l.next}while(l!==null);b===null?g=b=s:b=b.next=s}else g=b=s;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},o.updateQueue=l;return}o=l.lastBaseUpdate,o===null?l.firstBaseUpdate=s:o.next=s,l.lastBaseUpdate=s}var Jm=!1;function hc(){if(Jm){var o=ma;if(o!==null)throw o}}function pc(o,s,l,d){Jm=!1;var g=o.updateQueue;Ro=!1;var b=g.firstBaseUpdate,E=g.lastBaseUpdate,R=g.shared.pending;if(R!==null){g.shared.pending=null;var V=R,oe=V.next;V.next=null,E===null?b=oe:E.next=oe,E=V;var he=o.alternate;he!==null&&(he=he.updateQueue,R=he.lastBaseUpdate,R!==E&&(R===null?he.firstBaseUpdate=oe:R.next=oe,he.lastBaseUpdate=V))}if(b!==null){var ye=g.baseState;E=0,he=oe=V=null,R=b;do{var ae=R.lane&-536870913,ue=ae!==R.lane;if(ue?(Ye&ae)===ae:(d&ae)===ae){ae!==0&&ae===pa&&(Jm=!0),he!==null&&(he=he.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ce=o,De=R;ae=s;var pt=l;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){ye=Ce.call(pt,ye,ae);break e}ye=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,ae=typeof Ce=="function"?Ce.call(pt,ye,ae):Ce,ae==null)break e;ye=m({},ye,ae);break e;case 2:Ro=!0}}ae=R.callback,ae!==null&&(o.flags|=64,ue&&(o.flags|=8192),ue=g.callbacks,ue===null?g.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:R.tag,payload:R.payload,callback:R.callback,next:null},he===null?(oe=he=ue,V=ye):he=he.next=ue,E|=ae;if(R=R.next,R===null){if(R=g.shared.pending,R===null)break;ue=R,R=ue.next,ue.next=null,g.lastBaseUpdate=ue,g.shared.pending=null}}while(!0);he===null&&(V=ye),g.baseState=V,g.firstBaseUpdate=oe,g.lastBaseUpdate=he,b===null&&(g.shared.lanes=0),Uo|=E,o.lanes=E,o.memoizedState=ye}}function gk(o,s){if(typeof o!="function")throw Error(r(191,o));o.call(s)}function yk(o,s){var l=o.callbacks;if(l!==null)for(o.callbacks=null,o=0;o<l.length;o++)gk(l[o],s)}var ba=P(null),Zd=P(0);function bk(o,s){o=Wr,L(Zd,o),L(ba,s),Wr=o|s.baseLanes}function eg(){L(Zd,Wr),L(ba,ba.current)}function tg(){Wr=Zd.current,Y(ba),Y(Zd)}var Un=P(null),nr=null;function zo(o){var s=o.alternate;L(Dt,Dt.current&1),L(Un,o),nr===null&&(s===null||ba.current!==null||s.memoizedState!==null)&&(nr=o)}function ng(o){L(Dt,Dt.current),L(Un,o),nr===null&&(nr=o)}function vk(o){o.tag===22?(L(Dt,Dt.current),L(Un,o),nr===null&&(nr=o)):Do()}function Do(){L(Dt,Dt.current),L(Un,Un.current)}function Pn(o){Y(Un),nr===o&&(nr=null),Y(Dt)}var Dt=P(0);function Kd(o){for(var s=o;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ly(l)||cy(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var qr=0,Be=null,ft=null,Ft=null,Gd=!1,va=!1,Gi=!1,Yd=0,mc=0,xa=null,Q3=0;function At(){throw Error(r(321))}function rg(o,s){if(s===null)return!1;for(var l=0;l<s.length&&l<o.length;l++)if(!Ln(o[l],s[l]))return!1;return!0}function og(o,s,l,d,g,b){return qr=b,Be=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,M.H=o===null||o.memoizedState===null?n_:vg,Gi=!1,b=l(d,g),Gi=!1,va&&(b=wk(s,l,d,g)),xk(o),b}function xk(o){M.H=bc;var s=ft!==null&&ft.next!==null;if(qr=0,Ft=ft=Be=null,Gd=!1,mc=0,xa=null,s)throw Error(r(300));o===null||Bt||(o=o.dependencies,o!==null&&Ud(o)&&(Bt=!0))}function wk(o,s,l,d){Be=o;var g=0;do{if(va&&(xa=null),mc=0,va=!1,25<=g)throw Error(r(301));if(g+=1,Ft=ft=null,o.updateQueue!=null){var b=o.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}M.H=r_,b=s(l,d)}while(va);return b}function X3(){var o=M.H,s=o.useState()[0];return s=typeof s.then=="function"?gc(s):s,o=o.useState()[0],(ft!==null?ft.memoizedState:null)!==o&&(Be.flags|=1024),s}function ig(){var o=Yd!==0;return Yd=0,o}function sg(o,s,l){s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~l}function ag(o){if(Gd){for(o=o.memoizedState;o!==null;){var s=o.queue;s!==null&&(s.pending=null),o=o.next}Gd=!1}qr=0,Ft=ft=Be=null,va=!1,mc=Yd=0,xa=null}function mn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?Be.memoizedState=Ft=o:Ft=Ft.next=o,Ft}function Lt(){if(ft===null){var o=Be.alternate;o=o!==null?o.memoizedState:null}else o=ft.next;var s=Ft===null?Be.memoizedState:Ft.next;if(s!==null)Ft=s,ft=o;else{if(o===null)throw Be.alternate===null?Error(r(467)):Error(r(310));ft=o,o={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Ft===null?Be.memoizedState=Ft=o:Ft=Ft.next=o}return Ft}function Qd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gc(o){var s=mc;return mc+=1,xa===null&&(xa=[]),o=dk(xa,o,s),s=Be,(Ft===null?s.memoizedState:Ft.next)===null&&(s=s.alternate,M.H=s===null||s.memoizedState===null?n_:vg),o}function Xd(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return gc(o);if(o.$$typeof===A)return on(o)}throw Error(r(438,String(o)))}function lg(o){var s=null,l=Be.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=Be.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Qd(),Be.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(o),d=0;d<o;d++)l[d]=W;return s.index++,l}function Vr(o,s){return typeof s=="function"?s(o):s}function Wd(o){var s=Lt();return cg(s,ft,o)}function cg(o,s,l){var d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var g=o.baseQueue,b=d.pending;if(b!==null){if(g!==null){var E=g.next;g.next=b.next,b.next=E}s.baseQueue=g=b,d.pending=null}if(b=o.baseState,g===null)o.memoizedState=b;else{s=g.next;var R=E=null,V=null,oe=s,he=!1;do{var ye=oe.lane&-536870913;if(ye!==oe.lane?(Ye&ye)===ye:(qr&ye)===ye){var ae=oe.revertLane;if(ae===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ye===pa&&(he=!0);else if((qr&ae)===ae){oe=oe.next,ae===pa&&(he=!0);continue}else ye={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(R=V=ye,E=b):V=V.next=ye,Be.lanes|=ae,Uo|=ae;ye=oe.action,Gi&&l(b,ye),b=oe.hasEagerState?oe.eagerState:l(b,ye)}else ae={lane:ye,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(R=V=ae,E=b):V=V.next=ae,Be.lanes|=ye,Uo|=ye;oe=oe.next}while(oe!==null&&oe!==s);if(V===null?E=b:V.next=R,!Ln(b,o.memoizedState)&&(Bt=!0,he&&(l=ma,l!==null)))throw l;o.memoizedState=b,o.baseState=E,o.baseQueue=V,d.lastRenderedState=b}return g===null&&(d.lanes=0),[o.memoizedState,d.dispatch]}function ug(o){var s=Lt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=l.dispatch,g=l.pending,b=s.memoizedState;if(g!==null){l.pending=null;var E=g=g.next;do b=o(b,E.action),E=E.next;while(E!==g);Ln(b,s.memoizedState)||(Bt=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),l.lastRenderedState=b}return[b,d]}function kk(o,s,l){var d=Be,g=Lt(),b=Xe;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=s();var E=!Ln((ft||g).memoizedState,l);if(E&&(g.memoizedState=l,Bt=!0),g=g.queue,hg(Ek.bind(null,d,g,o),[o]),g.getSnapshot!==s||E||Ft!==null&&Ft.memoizedState.tag&1){if(d.flags|=2048,wa(9,{destroy:void 0},Sk.bind(null,d,g,l,s),null),bt===null)throw Error(r(349));b||(qr&127)!==0||_k(d,s,l)}return l}function _k(o,s,l){o.flags|=16384,o={getSnapshot:s,value:l},s=Be.updateQueue,s===null?(s=Qd(),Be.updateQueue=s,s.stores=[o]):(l=s.stores,l===null?s.stores=[o]:l.push(o))}function Sk(o,s,l,d){s.value=l,s.getSnapshot=d,jk(s)&&Ok(o)}function Ek(o,s,l){return l(function(){jk(s)&&Ok(o)})}function jk(o){var s=o.getSnapshot;o=o.value;try{var l=s();return!Ln(o,l)}catch{return!0}}function Ok(o){var s=Ui(o,2);s!==null&&An(s,o,2)}function dg(o){var s=mn();if(typeof o=="function"){var l=o;if(o=l(),Gi){nn(!0);try{l()}finally{nn(!1)}}}return s.memoizedState=s.baseState=o,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:o},s}function Ak(o,s,l,d){return o.baseState=l,cg(o,ft,typeof d=="function"?d:Vr)}function W3(o,s,l,d,g){if(tf(o))throw Error(r(485));if(o=s.action,o!==null){var b={payload:g,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};M.T!==null?l(!0):b.isTransition=!1,d(b),l=s.pending,l===null?(b.next=s.pending=b,Ck(s,b)):(b.next=l.next,s.pending=l.next=b)}}function Ck(o,s){var l=s.action,d=s.payload,g=o.state;if(s.isTransition){var b=M.T,E={};M.T=E;try{var R=l(g,d),V=M.S;V!==null&&V(E,R),Nk(o,s,R)}catch(oe){fg(o,s,oe)}finally{b!==null&&E.types!==null&&(b.types=E.types),M.T=b}}else try{b=l(g,d),Nk(o,s,b)}catch(oe){fg(o,s,oe)}}function Nk(o,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){Mk(o,s,d)},function(d){return fg(o,s,d)}):Mk(o,s,l)}function Mk(o,s,l){s.status="fulfilled",s.value=l,Rk(s),o.state=l,s=o.pending,s!==null&&(l=s.next,l===s?o.pending=null:(l=l.next,s.next=l,Ck(o,l)))}function fg(o,s,l){var d=o.pending;if(o.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,Rk(s),s=s.next;while(s!==d)}o.action=null}function Rk(o){o=o.listeners;for(var s=0;s<o.length;s++)(0,o[s])()}function Tk(o,s){return s}function $k(o,s){if(Xe){var l=bt.formState;if(l!==null){e:{var d=Be;if(Xe){if(wt){t:{for(var g=wt,b=tr;g.nodeType!==8;){if(!b){g=null;break t}if(g=rr(g.nextSibling),g===null){g=null;break t}}b=g.data,g=b==="F!"||b==="F"?g:null}if(g){wt=rr(g.nextSibling),d=g.data==="F!";break e}}No(d)}d=!1}d&&(s=l[0])}}return l=mn(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tk,lastRenderedState:s},l.queue=d,l=Jk.bind(null,Be,d),d.dispatch=l,d=dg(!1),b=bg.bind(null,Be,!1,d.queue),d=mn(),g={state:s,dispatch:null,action:o,pending:null},d.queue=g,l=W3.bind(null,Be,g,b,l),g.dispatch=l,d.memoizedState=o,[s,l,!1]}function zk(o){var s=Lt();return Dk(s,ft,o)}function Dk(o,s,l){if(s=cg(o,s,Tk)[0],o=Wd(Vr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=gc(s)}catch(E){throw E===ga?Bd:E}else d=s;s=Lt();var g=s.queue,b=g.dispatch;return l!==s.memoizedState&&(Be.flags|=2048,wa(9,{destroy:void 0},J3.bind(null,g,l),null)),[d,b,o]}function J3(o,s){o.action=s}function Lk(o){var s=Lt(),l=ft;if(l!==null)return Dk(s,l,o);Lt(),s=s.memoizedState,l=Lt();var d=l.queue.dispatch;return l.memoizedState=o,[s,d,!1]}function wa(o,s,l,d){return o={tag:o,create:l,deps:d,inst:s,next:null},s=Be.updateQueue,s===null&&(s=Qd(),Be.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=o.next=o:(d=l.next,l.next=o,o.next=d,s.lastEffect=o),o}function Ik(){return Lt().memoizedState}function Jd(o,s,l,d){var g=mn();Be.flags|=o,g.memoizedState=wa(1|s,{destroy:void 0},l,d===void 0?null:d)}function ef(o,s,l,d){var g=Lt();d=d===void 0?null:d;var b=g.memoizedState.inst;ft!==null&&d!==null&&rg(d,ft.memoizedState.deps)?g.memoizedState=wa(s,b,l,d):(Be.flags|=o,g.memoizedState=wa(1|s,b,l,d))}function Uk(o,s){Jd(8390656,8,o,s)}function hg(o,s){ef(2048,8,o,s)}function ez(o){Be.flags|=4;var s=Be.updateQueue;if(s===null)s=Qd(),Be.updateQueue=s,s.events=[o];else{var l=s.events;l===null?s.events=[o]:l.push(o)}}function Pk(o){var s=Lt().memoizedState;return ez({ref:s,nextImpl:o}),function(){if((st&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Fk(o,s){return ef(4,2,o,s)}function Bk(o,s){return ef(4,4,o,s)}function Hk(o,s){if(typeof s=="function"){o=o();var l=s(o);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return o=o(),s.current=o,function(){s.current=null}}function qk(o,s,l){l=l!=null?l.concat([o]):null,ef(4,4,Hk.bind(null,s,o),l)}function pg(){}function Vk(o,s){var l=Lt();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&rg(s,d[1])?d[0]:(l.memoizedState=[o,s],o)}function Zk(o,s){var l=Lt();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&rg(s,d[1]))return d[0];if(d=o(),Gi){nn(!0);try{o()}finally{nn(!1)}}return l.memoizedState=[d,s],d}function mg(o,s,l){return l===void 0||(qr&1073741824)!==0&&(Ye&261930)===0?o.memoizedState=s:(o.memoizedState=l,o=K_(),Be.lanes|=o,Uo|=o,l)}function Kk(o,s,l,d){return Ln(l,s)?l:ba.current!==null?(o=mg(o,l,d),Ln(o,s)||(Bt=!0),o):(qr&42)===0||(qr&1073741824)!==0&&(Ye&261930)===0?(Bt=!0,o.memoizedState=l):(o=K_(),Be.lanes|=o,Uo|=o,s)}function Gk(o,s,l,d,g){var b=B.p;B.p=b!==0&&8>b?b:8;var E=M.T,R={};M.T=R,bg(o,!1,s,l);try{var V=g(),oe=M.S;if(oe!==null&&oe(R,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var he=Y3(V,d);yc(o,s,he,Hn(o))}else yc(o,s,d,Hn(o))}catch(ye){yc(o,s,{then:function(){},status:"rejected",reason:ye},Hn())}finally{B.p=b,E!==null&&R.types!==null&&(E.types=R.types),M.T=E}}function tz(){}function gg(o,s,l,d){if(o.tag!==5)throw Error(r(476));var g=Yk(o).queue;Gk(o,g,s,X,l===null?tz:function(){return Qk(o),l(d)})}function Yk(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:X},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:l},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function Qk(o){var s=Yk(o);s.next===null&&(s=o.alternate.memoizedState),yc(o,s.next.queue,{},Hn())}function yg(){return on($c)}function Xk(){return Lt().memoizedState}function Wk(){return Lt().memoizedState}function nz(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var l=Hn();o=To(l);var d=$o(s,o,l);d!==null&&(An(d,s,l),fc(d,s,l)),s={cache:Zm()},o.payload=s;return}s=s.return}}function rz(o,s,l){var d=Hn();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},tf(o)?e_(s,l):(l=zm(o,s,l,d),l!==null&&(An(l,o,d),t_(l,s,d)))}function Jk(o,s,l){var d=Hn();yc(o,s,l,d)}function yc(o,s,l,d){var g={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(tf(o))e_(s,g);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var E=s.lastRenderedState,R=b(E,l);if(g.hasEagerState=!0,g.eagerState=R,Ln(R,E))return zd(o,s,g,0),bt===null&&$d(),!1}catch{}finally{}if(l=zm(o,s,g,d),l!==null)return An(l,o,d),t_(l,s,d),!0}return!1}function bg(o,s,l,d){if(d={lane:2,revertLane:Qg(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},tf(o)){if(s)throw Error(r(479))}else s=zm(o,l,d,2),s!==null&&An(s,o,2)}function tf(o){var s=o.alternate;return o===Be||s!==null&&s===Be}function e_(o,s){va=Gd=!0;var l=o.pending;l===null?s.next=s:(s.next=l.next,l.next=s),o.pending=s}function t_(o,s,l){if((l&4194048)!==0){var d=s.lanes;d&=o.pendingLanes,l|=d,s.lanes=l,Zl(o,l)}}var bc={readContext:on,use:Xd,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};bc.useEffectEvent=At;var n_={readContext:on,use:Xd,useCallback:function(o,s){return mn().memoizedState=[o,s===void 0?null:s],o},useContext:on,useEffect:Uk,useImperativeHandle:function(o,s,l){l=l!=null?l.concat([o]):null,Jd(4194308,4,Hk.bind(null,s,o),l)},useLayoutEffect:function(o,s){return Jd(4194308,4,o,s)},useInsertionEffect:function(o,s){Jd(4,2,o,s)},useMemo:function(o,s){var l=mn();s=s===void 0?null:s;var d=o();if(Gi){nn(!0);try{o()}finally{nn(!1)}}return l.memoizedState=[d,s],d},useReducer:function(o,s,l){var d=mn();if(l!==void 0){var g=l(s);if(Gi){nn(!0);try{l(s)}finally{nn(!1)}}}else g=s;return d.memoizedState=d.baseState=g,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:g},d.queue=o,o=o.dispatch=rz.bind(null,Be,o),[d.memoizedState,o]},useRef:function(o){var s=mn();return o={current:o},s.memoizedState=o},useState:function(o){o=dg(o);var s=o.queue,l=Jk.bind(null,Be,s);return s.dispatch=l,[o.memoizedState,l]},useDebugValue:pg,useDeferredValue:function(o,s){var l=mn();return mg(l,o,s)},useTransition:function(){var o=dg(!1);return o=Gk.bind(null,Be,o.queue,!0,!1),mn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,l){var d=Be,g=mn();if(Xe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),bt===null)throw Error(r(349));(Ye&127)!==0||_k(d,s,l)}g.memoizedState=l;var b={value:l,getSnapshot:s};return g.queue=b,Uk(Ek.bind(null,d,b,o),[o]),d.flags|=2048,wa(9,{destroy:void 0},Sk.bind(null,d,b,l,s),null),l},useId:function(){var o=mn(),s=bt.identifierPrefix;if(Xe){var l=wr,d=xr;l=(d&~(1<<32-dn(d)-1)).toString(32)+l,s="_"+s+"R_"+l,l=Yd++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=Q3++,s="_"+s+"r_"+l.toString(32)+"_";return o.memoizedState=s},useHostTransitionStatus:yg,useFormState:$k,useActionState:$k,useOptimistic:function(o){var s=mn();s.memoizedState=s.baseState=o;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=bg.bind(null,Be,!0,l),l.dispatch=s,[o,s]},useMemoCache:lg,useCacheRefresh:function(){return mn().memoizedState=nz.bind(null,Be)},useEffectEvent:function(o){var s=mn(),l={impl:o};return s.memoizedState=l,function(){if((st&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},vg={readContext:on,use:Xd,useCallback:Vk,useContext:on,useEffect:hg,useImperativeHandle:qk,useInsertionEffect:Fk,useLayoutEffect:Bk,useMemo:Zk,useReducer:Wd,useRef:Ik,useState:function(){return Wd(Vr)},useDebugValue:pg,useDeferredValue:function(o,s){var l=Lt();return Kk(l,ft.memoizedState,o,s)},useTransition:function(){var o=Wd(Vr)[0],s=Lt().memoizedState;return[typeof o=="boolean"?o:gc(o),s]},useSyncExternalStore:kk,useId:Xk,useHostTransitionStatus:yg,useFormState:zk,useActionState:zk,useOptimistic:function(o,s){var l=Lt();return Ak(l,ft,o,s)},useMemoCache:lg,useCacheRefresh:Wk};vg.useEffectEvent=Pk;var r_={readContext:on,use:Xd,useCallback:Vk,useContext:on,useEffect:hg,useImperativeHandle:qk,useInsertionEffect:Fk,useLayoutEffect:Bk,useMemo:Zk,useReducer:ug,useRef:Ik,useState:function(){return ug(Vr)},useDebugValue:pg,useDeferredValue:function(o,s){var l=Lt();return ft===null?mg(l,o,s):Kk(l,ft.memoizedState,o,s)},useTransition:function(){var o=ug(Vr)[0],s=Lt().memoizedState;return[typeof o=="boolean"?o:gc(o),s]},useSyncExternalStore:kk,useId:Xk,useHostTransitionStatus:yg,useFormState:Lk,useActionState:Lk,useOptimistic:function(o,s){var l=Lt();return ft!==null?Ak(l,ft,o,s):(l.baseState=o,[o,l.queue.dispatch])},useMemoCache:lg,useCacheRefresh:Wk};r_.useEffectEvent=Pk;function xg(o,s,l,d){s=o.memoizedState,l=l(d,s),l=l==null?s:m({},s,l),o.memoizedState=l,o.lanes===0&&(o.updateQueue.baseState=l)}var wg={enqueueSetState:function(o,s,l){o=o._reactInternals;var d=Hn(),g=To(d);g.payload=s,l!=null&&(g.callback=l),s=$o(o,g,d),s!==null&&(An(s,o,d),fc(s,o,d))},enqueueReplaceState:function(o,s,l){o=o._reactInternals;var d=Hn(),g=To(d);g.tag=1,g.payload=s,l!=null&&(g.callback=l),s=$o(o,g,d),s!==null&&(An(s,o,d),fc(s,o,d))},enqueueForceUpdate:function(o,s){o=o._reactInternals;var l=Hn(),d=To(l);d.tag=2,s!=null&&(d.callback=s),s=$o(o,d,l),s!==null&&(An(s,o,l),fc(s,o,l))}};function o_(o,s,l,d,g,b,E){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(d,b,E):s.prototype&&s.prototype.isPureReactComponent?!oc(l,d)||!oc(g,b):!0}function i_(o,s,l,d){o=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,d),s.state!==o&&wg.enqueueReplaceState(s,s.state,null)}function Yi(o,s){var l=s;if("ref"in s){l={};for(var d in s)d!=="ref"&&(l[d]=s[d])}if(o=o.defaultProps){l===s&&(l=m({},l));for(var g in o)l[g]===void 0&&(l[g]=o[g])}return l}function s_(o){Td(o)}function a_(o){console.error(o)}function l_(o){Td(o)}function nf(o,s){try{var l=o.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function c_(o,s,l){try{var d=o.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function kg(o,s,l){return l=To(l),l.tag=3,l.payload={element:null},l.callback=function(){nf(o,s)},l}function u_(o){return o=To(o),o.tag=3,o}function d_(o,s,l,d){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var b=d.value;o.payload=function(){return g(b)},o.callback=function(){c_(s,l,d)}}var E=l.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(o.callback=function(){c_(s,l,d),typeof g!="function"&&(Po===null?Po=new Set([this]):Po.add(this));var R=d.stack;this.componentDidCatch(d.value,{componentStack:R!==null?R:""})})}function oz(o,s,l,d,g){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&ha(s,l,g,!0),l=Un.current,l!==null){switch(l.tag){case 31:case 13:return nr===null?mf():l.alternate===null&&Ct===0&&(Ct=3),l.flags&=-257,l.flags|=65536,l.lanes=g,d===Hd?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),Kg(o,d,g)),!1;case 22:return l.flags|=65536,d===Hd?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([d]):l.add(d)),Kg(o,d,g)),!1}throw Error(r(435,l.tag))}return Kg(o,d,g),mf(),!1}if(Xe)return s=Un.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,d!==Fm&&(o=Error(r(422),{cause:d}),ac(Wn(o,l)))):(d!==Fm&&(s=Error(r(423),{cause:d}),ac(Wn(s,l))),o=o.current.alternate,o.flags|=65536,g&=-g,o.lanes|=g,d=Wn(d,l),g=kg(o.stateNode,d,g),Wm(o,g),Ct!==4&&(Ct=2)),!1;var b=Error(r(520),{cause:d});if(b=Wn(b,l),jc===null?jc=[b]:jc.push(b),Ct!==4&&(Ct=2),s===null)return!0;d=Wn(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,o=g&-g,l.lanes|=o,o=kg(l.stateNode,d,o),Wm(l,o),!1;case 1:if(s=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Po===null||!Po.has(b))))return l.flags|=65536,g&=-g,l.lanes|=g,g=u_(g),d_(g,o,l,d),Wm(l,g),!1}l=l.return}while(l!==null);return!1}var _g=Error(r(461)),Bt=!1;function sn(o,s,l,d){s.child=o===null?mk(s,null,l,d):Ki(s,o.child,l,d)}function f_(o,s,l,d,g){l=l.render;var b=s.ref;if("ref"in d){var E={};for(var R in d)R!=="ref"&&(E[R]=d[R])}else E=d;return Hi(s),d=og(o,s,l,E,b,g),R=ig(),o!==null&&!Bt?(sg(o,s,g),Zr(o,s,g)):(Xe&&R&&Um(s),s.flags|=1,sn(o,s,d,g),s.child)}function h_(o,s,l,d,g){if(o===null){var b=l.type;return typeof b=="function"&&!Dm(b)&&b.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=b,p_(o,s,b,d,g)):(o=Ld(l.type,null,d,s,s.mode,g),o.ref=s.ref,o.return=s,s.child=o)}if(b=o.child,!Mg(o,g)){var E=b.memoizedProps;if(l=l.compare,l=l!==null?l:oc,l(E,d)&&o.ref===s.ref)return Zr(o,s,g)}return s.flags|=1,o=Pr(b,d),o.ref=s.ref,o.return=s,s.child=o}function p_(o,s,l,d,g){if(o!==null){var b=o.memoizedProps;if(oc(b,d)&&o.ref===s.ref)if(Bt=!1,s.pendingProps=d=b,Mg(o,g))(o.flags&131072)!==0&&(Bt=!0);else return s.lanes=o.lanes,Zr(o,s,g)}return Sg(o,s,l,d,g)}function m_(o,s,l,d){var g=d.children,b=o!==null?o.memoizedState:null;if(o===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(b=b!==null?b.baseLanes|l:l,o!==null){for(d=s.child=o.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~b}else d=0,s.child=null;return g_(o,s,b,l,d)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},o!==null&&Fd(s,b!==null?b.cachePool:null),b!==null?bk(s,b):eg(),vk(s);else return d=s.lanes=536870912,g_(o,s,b!==null?b.baseLanes|l:l,l,d)}else b!==null?(Fd(s,b.cachePool),bk(s,b),Do(),s.memoizedState=null):(o!==null&&Fd(s,null),eg(),Do());return sn(o,s,g,l),s.child}function vc(o,s){return o!==null&&o.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function g_(o,s,l,d,g){var b=Gm();return b=b===null?null:{parent:Pt._currentValue,pool:b},s.memoizedState={baseLanes:l,cachePool:b},o!==null&&Fd(s,null),eg(),vk(s),o!==null&&ha(o,s,d,!0),s.childLanes=g,null}function rf(o,s){return s=sf({mode:s.mode,children:s.children},o.mode),s.ref=o.ref,o.child=s,s.return=o,s}function y_(o,s,l){return Ki(s,o.child,null,l),o=rf(s,s.pendingProps),o.flags|=2,Pn(s),s.memoizedState=null,o}function iz(o,s,l){var d=s.pendingProps,g=(s.flags&128)!==0;if(s.flags&=-129,o===null){if(Xe){if(d.mode==="hidden")return o=rf(s,d),s.lanes=536870912,vc(null,o);if(ng(s),(o=wt)?(o=CS(o,tr),o=o!==null&&o.data==="&"?o:null,o!==null&&(s.memoizedState={dehydrated:o,treeContext:Ao!==null?{id:xr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},l=ek(o),l.return=s,s.child=l,rn=s,wt=null)):o=null,o===null)throw No(s);return s.lanes=536870912,null}return rf(s,d)}var b=o.memoizedState;if(b!==null){var E=b.dehydrated;if(ng(s),g)if(s.flags&256)s.flags&=-257,s=y_(o,s,l);else if(s.memoizedState!==null)s.child=o.child,s.flags|=128,s=null;else throw Error(r(558));else if(Bt||ha(o,s,l,!1),g=(l&o.childLanes)!==0,Bt||g){if(d=bt,d!==null&&(E=kd(d,l),E!==0&&E!==b.retryLane))throw b.retryLane=E,Ui(o,E),An(d,o,E),_g;mf(),s=y_(o,s,l)}else o=b.treeContext,wt=rr(E.nextSibling),rn=s,Xe=!0,Co=null,tr=!1,o!==null&&rk(s,o),s=rf(s,d),s.flags|=4096;return s}return o=Pr(o.child,{mode:d.mode,children:d.children}),o.ref=s.ref,s.child=o,o.return=s,o}function of(o,s){var l=s.ref;if(l===null)o!==null&&o.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(o===null||o.ref!==l)&&(s.flags|=4194816)}}function Sg(o,s,l,d,g){return Hi(s),l=og(o,s,l,d,void 0,g),d=ig(),o!==null&&!Bt?(sg(o,s,g),Zr(o,s,g)):(Xe&&d&&Um(s),s.flags|=1,sn(o,s,l,g),s.child)}function b_(o,s,l,d,g,b){return Hi(s),s.updateQueue=null,l=wk(s,d,l,g),xk(o),d=ig(),o!==null&&!Bt?(sg(o,s,b),Zr(o,s,b)):(Xe&&d&&Um(s),s.flags|=1,sn(o,s,l,b),s.child)}function v_(o,s,l,d,g){if(Hi(s),s.stateNode===null){var b=ca,E=l.contextType;typeof E=="object"&&E!==null&&(b=on(E)),b=new l(d,b),s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=wg,s.stateNode=b,b._reactInternals=s,b=s.stateNode,b.props=d,b.state=s.memoizedState,b.refs={},Qm(s),E=l.contextType,b.context=typeof E=="object"&&E!==null?on(E):ca,b.state=s.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(xg(s,l,E,d),b.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&wg.enqueueReplaceState(b,b.state,null),pc(s,d,b,g),hc(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(o===null){b=s.stateNode;var R=s.memoizedProps,V=Yi(l,R);b.props=V;var oe=b.context,he=l.contextType;E=ca,typeof he=="object"&&he!==null&&(E=on(he));var ye=l.getDerivedStateFromProps;he=typeof ye=="function"||typeof b.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,he||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R||oe!==E)&&i_(s,b,d,E),Ro=!1;var ae=s.memoizedState;b.state=ae,pc(s,d,b,g),hc(),oe=s.memoizedState,R||ae!==oe||Ro?(typeof ye=="function"&&(xg(s,l,ye,d),oe=s.memoizedState),(V=Ro||o_(s,l,V,d,ae,oe,E))?(he||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=oe),b.props=d,b.state=oe,b.context=E,d=V):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{b=s.stateNode,Xm(o,s),E=s.memoizedProps,he=Yi(l,E),b.props=he,ye=s.pendingProps,ae=b.context,oe=l.contextType,V=ca,typeof oe=="object"&&oe!==null&&(V=on(oe)),R=l.getDerivedStateFromProps,(oe=typeof R=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==ye||ae!==V)&&i_(s,b,d,V),Ro=!1,ae=s.memoizedState,b.state=ae,pc(s,d,b,g),hc();var ue=s.memoizedState;E!==ye||ae!==ue||Ro||o!==null&&o.dependencies!==null&&Ud(o.dependencies)?(typeof R=="function"&&(xg(s,l,R,d),ue=s.memoizedState),(he=Ro||o_(s,l,he,d,ae,ue,V)||o!==null&&o.dependencies!==null&&Ud(o.dependencies))?(oe||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,ue,V),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,ue,V)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===o.memoizedProps&&ae===o.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&ae===o.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=ue),b.props=d,b.state=ue,b.context=V,d=he):(typeof b.componentDidUpdate!="function"||E===o.memoizedProps&&ae===o.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&ae===o.memoizedState||(s.flags|=1024),d=!1)}return b=d,of(o,s),d=(s.flags&128)!==0,b||d?(b=s.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:b.render(),s.flags|=1,o!==null&&d?(s.child=Ki(s,o.child,null,g),s.child=Ki(s,null,l,g)):sn(o,s,l,g),s.memoizedState=b.state,o=s.child):o=Zr(o,s,g),o}function x_(o,s,l,d){return Fi(),s.flags|=256,sn(o,s,l,d),s.child}var Eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jg(o){return{baseLanes:o,cachePool:ck()}}function Og(o,s,l){return o=o!==null?o.childLanes&~l:0,s&&(o|=Bn),o}function w_(o,s,l){var d=s.pendingProps,g=!1,b=(s.flags&128)!==0,E;if((E=b)||(E=o!==null&&o.memoizedState===null?!1:(Dt.current&2)!==0),E&&(g=!0,s.flags&=-129),E=(s.flags&32)!==0,s.flags&=-33,o===null){if(Xe){if(g?zo(s):Do(),(o=wt)?(o=CS(o,tr),o=o!==null&&o.data!=="&"?o:null,o!==null&&(s.memoizedState={dehydrated:o,treeContext:Ao!==null?{id:xr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},l=ek(o),l.return=s,s.child=l,rn=s,wt=null)):o=null,o===null)throw No(s);return cy(o)?s.lanes=32:s.lanes=536870912,null}var R=d.children;return d=d.fallback,g?(Do(),g=s.mode,R=sf({mode:"hidden",children:R},g),d=Pi(d,g,l,null),R.return=s,d.return=s,R.sibling=d,s.child=R,d=s.child,d.memoizedState=jg(l),d.childLanes=Og(o,E,l),s.memoizedState=Eg,vc(null,d)):(zo(s),Ag(s,R))}var V=o.memoizedState;if(V!==null&&(R=V.dehydrated,R!==null)){if(b)s.flags&256?(zo(s),s.flags&=-257,s=Cg(o,s,l)):s.memoizedState!==null?(Do(),s.child=o.child,s.flags|=128,s=null):(Do(),R=d.fallback,g=s.mode,d=sf({mode:"visible",children:d.children},g),R=Pi(R,g,l,null),R.flags|=2,d.return=s,R.return=s,d.sibling=R,s.child=d,Ki(s,o.child,null,l),d=s.child,d.memoizedState=jg(l),d.childLanes=Og(o,E,l),s.memoizedState=Eg,s=vc(null,d));else if(zo(s),cy(R)){if(E=R.nextSibling&&R.nextSibling.dataset,E)var oe=E.dgst;E=oe,d=Error(r(419)),d.stack="",d.digest=E,ac({value:d,source:null,stack:null}),s=Cg(o,s,l)}else if(Bt||ha(o,s,l,!1),E=(l&o.childLanes)!==0,Bt||E){if(E=bt,E!==null&&(d=kd(E,l),d!==0&&d!==V.retryLane))throw V.retryLane=d,Ui(o,d),An(E,o,d),_g;ly(R)||mf(),s=Cg(o,s,l)}else ly(R)?(s.flags|=192,s.child=o.child,s=null):(o=V.treeContext,wt=rr(R.nextSibling),rn=s,Xe=!0,Co=null,tr=!1,o!==null&&rk(s,o),s=Ag(s,d.children),s.flags|=4096);return s}return g?(Do(),R=d.fallback,g=s.mode,V=o.child,oe=V.sibling,d=Pr(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&65011712,oe!==null?R=Pr(oe,R):(R=Pi(R,g,l,null),R.flags|=2),R.return=s,d.return=s,d.sibling=R,s.child=d,vc(null,d),d=s.child,R=o.child.memoizedState,R===null?R=jg(l):(g=R.cachePool,g!==null?(V=Pt._currentValue,g=g.parent!==V?{parent:V,pool:V}:g):g=ck(),R={baseLanes:R.baseLanes|l,cachePool:g}),d.memoizedState=R,d.childLanes=Og(o,E,l),s.memoizedState=Eg,vc(o.child,d)):(zo(s),l=o.child,o=l.sibling,l=Pr(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,o!==null&&(E=s.deletions,E===null?(s.deletions=[o],s.flags|=16):E.push(o)),s.child=l,s.memoizedState=null,l)}function Ag(o,s){return s=sf({mode:"visible",children:s},o.mode),s.return=o,o.child=s}function sf(o,s){return o=In(22,o,null,s),o.lanes=0,o}function Cg(o,s,l){return Ki(s,o.child,null,l),o=Ag(s,s.pendingProps.children),o.flags|=2,s.memoizedState=null,o}function k_(o,s,l){o.lanes|=s;var d=o.alternate;d!==null&&(d.lanes|=s),qm(o.return,s,l)}function Ng(o,s,l,d,g,b){var E=o.memoizedState;E===null?o.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g,treeForkCount:b}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=d,E.tail=l,E.tailMode=g,E.treeForkCount=b)}function __(o,s,l){var d=s.pendingProps,g=d.revealOrder,b=d.tail;d=d.children;var E=Dt.current,R=(E&2)!==0;if(R?(E=E&1|2,s.flags|=128):E&=1,L(Dt,E),sn(o,s,d,l),d=Xe?sc:0,!R&&o!==null&&(o.flags&128)!==0)e:for(o=s.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&k_(o,l,s);else if(o.tag===19)k_(o,l,s);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(g){case"forwards":for(l=s.child,g=null;l!==null;)o=l.alternate,o!==null&&Kd(o)===null&&(g=l),l=l.sibling;l=g,l===null?(g=s.child,s.child=null):(g=l.sibling,l.sibling=null),Ng(s,!1,g,l,b,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=s.child,s.child=null;g!==null;){if(o=g.alternate,o!==null&&Kd(o)===null){s.child=g;break}o=g.sibling,g.sibling=l,l=g,g=o}Ng(s,!0,l,null,b,d);break;case"together":Ng(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function Zr(o,s,l){if(o!==null&&(s.dependencies=o.dependencies),Uo|=s.lanes,(l&s.childLanes)===0)if(o!==null){if(ha(o,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(o!==null&&s.child!==o.child)throw Error(r(153));if(s.child!==null){for(o=s.child,l=Pr(o,o.pendingProps),s.child=l,l.return=s;o.sibling!==null;)o=o.sibling,l=l.sibling=Pr(o,o.pendingProps),l.return=s;l.sibling=null}return s.child}function Mg(o,s){return(o.lanes&s)!==0?!0:(o=o.dependencies,!!(o!==null&&Ud(o)))}function sz(o,s,l){switch(s.tag){case 3:pe(s,s.stateNode.containerInfo),Mo(s,Pt,o.memoizedState.cache),Fi();break;case 27:case 5:ee(s);break;case 4:pe(s,s.stateNode.containerInfo);break;case 10:Mo(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,ng(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(zo(s),s.flags|=128,null):(l&s.child.childLanes)!==0?w_(o,s,l):(zo(s),o=Zr(o,s,l),o!==null?o.sibling:null);zo(s);break;case 19:var g=(o.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(ha(o,s,l,!1),d=(l&s.childLanes)!==0),g){if(d)return __(o,s,l);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),L(Dt,Dt.current),d)break;return null;case 22:return s.lanes=0,m_(o,s,l,s.pendingProps);case 24:Mo(s,Pt,o.memoizedState.cache)}return Zr(o,s,l)}function S_(o,s,l){if(o!==null)if(o.memoizedProps!==s.pendingProps)Bt=!0;else{if(!Mg(o,l)&&(s.flags&128)===0)return Bt=!1,sz(o,s,l);Bt=(o.flags&131072)!==0}else Bt=!1,Xe&&(s.flags&1048576)!==0&&nk(s,sc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(o=Vi(s.elementType),s.type=o,typeof o=="function")Dm(o)?(d=Yi(o,d),s.tag=1,s=v_(null,s,o,d,l)):(s.tag=0,s=Sg(null,s,o,d,l));else{if(o!=null){var g=o.$$typeof;if(g===$){s.tag=11,s=f_(null,s,o,d,l);break e}else if(g===z){s.tag=14,s=h_(null,s,o,d,l);break e}}throw s=D(o)||o,Error(r(306,s,""))}}return s;case 0:return Sg(o,s,s.type,s.pendingProps,l);case 1:return d=s.type,g=Yi(d,s.pendingProps),v_(o,s,d,g,l);case 3:e:{if(pe(s,s.stateNode.containerInfo),o===null)throw Error(r(387));d=s.pendingProps;var b=s.memoizedState;g=b.element,Xm(o,s),pc(s,d,null,l);var E=s.memoizedState;if(d=E.cache,Mo(s,Pt,d),d!==b.cache&&Vm(s,[Pt],l,!0),hc(),d=E.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:E.cache},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){s=x_(o,s,d,l);break e}else if(d!==g){g=Wn(Error(r(424)),s),ac(g),s=x_(o,s,d,l);break e}else{switch(o=s.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(wt=rr(o.firstChild),rn=s,Xe=!0,Co=null,tr=!0,l=mk(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Fi(),d===g){s=Zr(o,s,l);break e}sn(o,s,d,l)}s=s.child}return s;case 26:return of(o,s),o===null?(l=zS(s.type,null,s.pendingProps,null))?s.memoizedState=l:Xe||(l=s.type,o=s.pendingProps,d=kf(fe.current).createElement(l),d[Ze]=s,d[Pe]=o,an(d,l,o),Xt(d),s.stateNode=d):s.memoizedState=zS(s.type,o.memoizedProps,s.pendingProps,o.memoizedState),null;case 27:return ee(s),o===null&&Xe&&(d=s.stateNode=RS(s.type,s.pendingProps,fe.current),rn=s,tr=!0,g=wt,qo(s.type)?(uy=g,wt=rr(d.firstChild)):wt=g),sn(o,s,s.pendingProps.children,l),of(o,s),o===null&&(s.flags|=4194304),s.child;case 5:return o===null&&Xe&&((g=d=wt)&&(d=Dz(d,s.type,s.pendingProps,tr),d!==null?(s.stateNode=d,rn=s,wt=rr(d.firstChild),tr=!1,g=!0):g=!1),g||No(s)),ee(s),g=s.type,b=s.pendingProps,E=o!==null?o.memoizedProps:null,d=b.children,iy(g,b)?d=null:E!==null&&iy(g,E)&&(s.flags|=32),s.memoizedState!==null&&(g=og(o,s,X3,null,null,l),$c._currentValue=g),of(o,s),sn(o,s,d,l),s.child;case 6:return o===null&&Xe&&((o=l=wt)&&(l=Lz(l,s.pendingProps,tr),l!==null?(s.stateNode=l,rn=s,wt=null,o=!0):o=!1),o||No(s)),null;case 13:return w_(o,s,l);case 4:return pe(s,s.stateNode.containerInfo),d=s.pendingProps,o===null?s.child=Ki(s,null,d,l):sn(o,s,d,l),s.child;case 11:return f_(o,s,s.type,s.pendingProps,l);case 7:return sn(o,s,s.pendingProps,l),s.child;case 8:return sn(o,s,s.pendingProps.children,l),s.child;case 12:return sn(o,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,Mo(s,s.type,d.value),sn(o,s,d.children,l),s.child;case 9:return g=s.type._context,d=s.pendingProps.children,Hi(s),g=on(g),d=d(g),s.flags|=1,sn(o,s,d,l),s.child;case 14:return h_(o,s,s.type,s.pendingProps,l);case 15:return p_(o,s,s.type,s.pendingProps,l);case 19:return __(o,s,l);case 31:return iz(o,s,l);case 22:return m_(o,s,l,s.pendingProps);case 24:return Hi(s),d=on(Pt),o===null?(g=Gm(),g===null&&(g=bt,b=Zm(),g.pooledCache=b,b.refCount++,b!==null&&(g.pooledCacheLanes|=l),g=b),s.memoizedState={parent:d,cache:g},Qm(s),Mo(s,Pt,g)):((o.lanes&l)!==0&&(Xm(o,s),pc(s,null,null,l),hc()),g=o.memoizedState,b=s.memoizedState,g.parent!==d?(g={parent:d,cache:d},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),Mo(s,Pt,d)):(d=b.cache,Mo(s,Pt,d),d!==g.cache&&Vm(s,[Pt],l,!0))),sn(o,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Kr(o){o.flags|=4}function Rg(o,s,l,d,g){if((s=(o.mode&32)!==0)&&(s=!1),s){if(o.flags|=16777216,(g&335544128)===g)if(o.stateNode.complete)o.flags|=8192;else if(X_())o.flags|=8192;else throw Zi=Hd,Ym}else o.flags&=-16777217}function E_(o,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!PS(s))if(X_())o.flags|=8192;else throw Zi=Hd,Ym}function af(o,s){s!==null&&(o.flags|=4),o.flags&16384&&(s=o.tag!==22?wd():536870912,o.lanes|=s,Ea|=s)}function xc(o,s){if(!Xe)switch(o.tailMode){case"hidden":s=o.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?o.tail=null:l.sibling=null;break;case"collapsed":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s||o.tail===null?o.tail=null:o.tail.sibling=null:d.sibling=null}}function kt(o){var s=o.alternate!==null&&o.alternate.child===o.child,l=0,d=0;if(s)for(var g=o.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=o,g=g.sibling;else for(g=o.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=o,g=g.sibling;return o.subtreeFlags|=d,o.childLanes=l,s}function az(o,s,l){var d=s.pendingProps;switch(Pm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(s),null;case 1:return kt(s),null;case 3:return l=s.stateNode,d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),Hr(Pt),N(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(o===null||o.child===null)&&(fa(s)?Kr(s):o===null||o.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Bm())),kt(s),null;case 26:var g=s.type,b=s.memoizedState;return o===null?(Kr(s),b!==null?(kt(s),E_(s,b)):(kt(s),Rg(s,g,null,d,l))):b?b!==o.memoizedState?(Kr(s),kt(s),E_(s,b)):(kt(s),s.flags&=-16777217):(o=o.memoizedProps,o!==d&&Kr(s),kt(s),Rg(s,g,o,d,l)),null;case 27:if(le(s),l=fe.current,g=s.type,o!==null&&s.stateNode!=null)o.memoizedProps!==d&&Kr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return kt(s),null}o=Z.current,fa(s)?ok(s):(o=RS(g,d,l),s.stateNode=o,Kr(s))}return kt(s),null;case 5:if(le(s),g=s.type,o!==null&&s.stateNode!=null)o.memoizedProps!==d&&Kr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return kt(s),null}if(b=Z.current,fa(s))ok(s);else{var E=kf(fe.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?E.createElement("select",{is:d.is}):E.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?E.createElement(g,{is:d.is}):E.createElement(g)}}b[Ze]=s,b[Pe]=d;e:for(E=s.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===s)break e;for(;E.sibling===null;){if(E.return===null||E.return===s)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}s.stateNode=b;e:switch(an(b,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Kr(s)}}return kt(s),Rg(s,s.type,o===null?null:o.memoizedProps,s.pendingProps,l),null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==d&&Kr(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(o=fe.current,fa(s)){if(o=s.stateNode,l=s.memoizedProps,d=null,g=rn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}o[Ze]=s,o=!!(o.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||wS(o.nodeValue,l)),o||No(s,!0)}else o=kf(o).createTextNode(d),o[Ze]=s,s.stateNode=o}return kt(s),null;case 31:if(l=s.memoizedState,o===null||o.memoizedState!==null){if(d=fa(s),l!==null){if(o===null){if(!d)throw Error(r(318));if(o=s.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Ze]=s}else Fi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),o=!1}else l=Bm(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=l),o=!0;if(!o)return s.flags&256?(Pn(s),s):(Pn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return kt(s),null;case 13:if(d=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(g=fa(s),d!==null&&d.dehydrated!==null){if(o===null){if(!g)throw Error(r(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[Ze]=s}else Fi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),g=!1}else g=Bm(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=g),g=!0;if(!g)return s.flags&256?(Pn(s),s):(Pn(s),null)}return Pn(s),(s.flags&128)!==0?(s.lanes=l,s):(l=d!==null,o=o!==null&&o.memoizedState!==null,l&&(d=s.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==g&&(d.flags|=2048)),l!==o&&l&&(s.child.flags|=8192),af(s,s.updateQueue),kt(s),null);case 4:return N(),o===null&&ey(s.stateNode.containerInfo),kt(s),null;case 10:return Hr(s.type),kt(s),null;case 19:if(Y(Dt),d=s.memoizedState,d===null)return kt(s),null;if(g=(s.flags&128)!==0,b=d.rendering,b===null)if(g)xc(d,!1);else{if(Ct!==0||o!==null&&(o.flags&128)!==0)for(o=s.child;o!==null;){if(b=Kd(o),b!==null){for(s.flags|=128,xc(d,!1),o=b.updateQueue,s.updateQueue=o,af(s,o),s.subtreeFlags=0,o=l,l=s.child;l!==null;)J1(l,o),l=l.sibling;return L(Dt,Dt.current&1|2),Xe&&Fr(s,d.treeForkCount),s.child}o=o.sibling}d.tail!==null&&xt()>ff&&(s.flags|=128,g=!0,xc(d,!1),s.lanes=4194304)}else{if(!g)if(o=Kd(b),o!==null){if(s.flags|=128,g=!0,o=o.updateQueue,s.updateQueue=o,af(s,o),xc(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!Xe)return kt(s),null}else 2*xt()-d.renderingStartTime>ff&&l!==536870912&&(s.flags|=128,g=!0,xc(d,!1),s.lanes=4194304);d.isBackwards?(b.sibling=s.child,s.child=b):(o=d.last,o!==null?o.sibling=b:s.child=b,d.last=b)}return d.tail!==null?(o=d.tail,d.rendering=o,d.tail=o.sibling,d.renderingStartTime=xt(),o.sibling=null,l=Dt.current,L(Dt,g?l&1|2:l&1),Xe&&Fr(s,d.treeForkCount),o):(kt(s),null);case 22:case 23:return Pn(s),tg(),d=s.memoizedState!==null,o!==null?o.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(l&536870912)!==0&&(s.flags&128)===0&&(kt(s),s.subtreeFlags&6&&(s.flags|=8192)):kt(s),l=s.updateQueue,l!==null&&af(s,l.retryQueue),l=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(l=o.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==l&&(s.flags|=2048),o!==null&&Y(qi),null;case 24:return l=null,o!==null&&(l=o.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Hr(Pt),kt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function lz(o,s){switch(Pm(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return Hr(Pt),N(),o=s.flags,(o&65536)!==0&&(o&128)===0?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return le(s),null;case 31:if(s.memoizedState!==null){if(Pn(s),s.alternate===null)throw Error(r(340));Fi()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 13:if(Pn(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Fi()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Y(Dt),null;case 4:return N(),null;case 10:return Hr(s.type),null;case 22:case 23:return Pn(s),tg(),o!==null&&Y(qi),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return Hr(Pt),null;case 25:return null;default:return null}}function j_(o,s){switch(Pm(s),s.tag){case 3:Hr(Pt),N();break;case 26:case 27:case 5:le(s);break;case 4:N();break;case 31:s.memoizedState!==null&&Pn(s);break;case 13:Pn(s);break;case 19:Y(Dt);break;case 10:Hr(s.type);break;case 22:case 23:Pn(s),tg(),o!==null&&Y(qi);break;case 24:Hr(Pt)}}function wc(o,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var g=d.next;l=g;do{if((l.tag&o)===o){d=void 0;var b=l.create,E=l.inst;d=b(),E.destroy=d}l=l.next}while(l!==g)}}catch(R){dt(s,s.return,R)}}function Lo(o,s,l){try{var d=s.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var b=g.next;d=b;do{if((d.tag&o)===o){var E=d.inst,R=E.destroy;if(R!==void 0){E.destroy=void 0,g=s;var V=l,oe=R;try{oe()}catch(he){dt(g,V,he)}}}d=d.next}while(d!==b)}}catch(he){dt(s,s.return,he)}}function O_(o){var s=o.updateQueue;if(s!==null){var l=o.stateNode;try{yk(s,l)}catch(d){dt(o,o.return,d)}}}function A_(o,s,l){l.props=Yi(o.type,o.memoizedProps),l.state=o.memoizedState;try{l.componentWillUnmount()}catch(d){dt(o,s,d)}}function kc(o,s){try{var l=o.ref;if(l!==null){switch(o.tag){case 26:case 27:case 5:var d=o.stateNode;break;case 30:d=o.stateNode;break;default:d=o.stateNode}typeof l=="function"?o.refCleanup=l(d):l.current=d}}catch(g){dt(o,s,g)}}function kr(o,s){var l=o.ref,d=o.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(g){dt(o,s,g)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){dt(o,s,g)}else l.current=null}function C_(o){var s=o.type,l=o.memoizedProps,d=o.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(g){dt(o,o.return,g)}}function Tg(o,s,l){try{var d=o.stateNode;Nz(d,o.type,l,s),d[Pe]=s}catch(g){dt(o,o.return,g)}}function N_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&qo(o.type)||o.tag===4}function $g(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||N_(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&qo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function zg(o,s,l){var d=o.tag;if(d===5||d===6)o=o.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(o,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(o),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=Ir));else if(d!==4&&(d===27&&qo(o.type)&&(l=o.stateNode,s=null),o=o.child,o!==null))for(zg(o,s,l),o=o.sibling;o!==null;)zg(o,s,l),o=o.sibling}function lf(o,s,l){var d=o.tag;if(d===5||d===6)o=o.stateNode,s?l.insertBefore(o,s):l.appendChild(o);else if(d!==4&&(d===27&&qo(o.type)&&(l=o.stateNode),o=o.child,o!==null))for(lf(o,s,l),o=o.sibling;o!==null;)lf(o,s,l),o=o.sibling}function M_(o){var s=o.stateNode,l=o.memoizedProps;try{for(var d=o.type,g=s.attributes;g.length;)s.removeAttributeNode(g[0]);an(s,d,l),s[Ze]=o,s[Pe]=l}catch(b){dt(o,o.return,b)}}var Gr=!1,Ht=!1,Dg=!1,R_=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function cz(o,s){if(o=o.containerInfo,ry=Cf,o=q1(o),Cm(o)){if("selectionStart"in o)var l={start:o.selectionStart,end:o.selectionEnd};else e:{l=(l=o.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var E=0,R=-1,V=-1,oe=0,he=0,ye=o,ae=null;t:for(;;){for(var ue;ye!==l||g!==0&&ye.nodeType!==3||(R=E+g),ye!==b||d!==0&&ye.nodeType!==3||(V=E+d),ye.nodeType===3&&(E+=ye.nodeValue.length),(ue=ye.firstChild)!==null;)ae=ye,ye=ue;for(;;){if(ye===o)break t;if(ae===l&&++oe===g&&(R=E),ae===b&&++he===d&&(V=E),(ue=ye.nextSibling)!==null)break;ye=ae,ae=ye.parentNode}ye=ue}l=R===-1||V===-1?null:{start:R,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(oy={focusedElem:o,selectionRange:l},Cf=!1,Wt=s;Wt!==null;)if(s=Wt,o=s.child,(s.subtreeFlags&1028)!==0&&o!==null)o.return=s,Wt=o;else for(;Wt!==null;){switch(s=Wt,b=s.alternate,o=s.flags,s.tag){case 0:if((o&4)!==0&&(o=s.updateQueue,o=o!==null?o.events:null,o!==null))for(l=0;l<o.length;l++)g=o[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&b!==null){o=void 0,l=s,g=b.memoizedProps,b=b.memoizedState,d=l.stateNode;try{var Ce=Yi(l.type,g);o=d.getSnapshotBeforeUpdate(Ce,b),d.__reactInternalSnapshotBeforeUpdate=o}catch(De){dt(l,l.return,De)}}break;case 3:if((o&1024)!==0){if(o=s.stateNode.containerInfo,l=o.nodeType,l===9)ay(o);else if(l===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":ay(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=s.sibling,o!==null){o.return=s.return,Wt=o;break}Wt=s.return}}function T_(o,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Qr(o,l),d&4&&wc(5,l);break;case 1:if(Qr(o,l),d&4)if(o=l.stateNode,s===null)try{o.componentDidMount()}catch(E){dt(l,l.return,E)}else{var g=Yi(l.type,s.memoizedProps);s=s.memoizedState;try{o.componentDidUpdate(g,s,o.__reactInternalSnapshotBeforeUpdate)}catch(E){dt(l,l.return,E)}}d&64&&O_(l),d&512&&kc(l,l.return);break;case 3:if(Qr(o,l),d&64&&(o=l.updateQueue,o!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{yk(o,s)}catch(E){dt(l,l.return,E)}}break;case 27:s===null&&d&4&&M_(l);case 26:case 5:Qr(o,l),s===null&&d&4&&C_(l),d&512&&kc(l,l.return);break;case 12:Qr(o,l);break;case 31:Qr(o,l),d&4&&D_(o,l);break;case 13:Qr(o,l),d&4&&L_(o,l),d&64&&(o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(l=bz.bind(null,l),Iz(o,l))));break;case 22:if(d=l.memoizedState!==null||Gr,!d){s=s!==null&&s.memoizedState!==null||Ht,g=Gr;var b=Ht;Gr=d,(Ht=s)&&!b?Xr(o,l,(l.subtreeFlags&8772)!==0):Qr(o,l),Gr=g,Ht=b}break;case 30:break;default:Qr(o,l)}}function $_(o){var s=o.alternate;s!==null&&(o.alternate=null,$_(s)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(s=o.stateNode,s!==null&&fm(s)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var _t=null,Sn=!1;function Yr(o,s,l){for(l=l.child;l!==null;)z_(o,s,l),l=l.sibling}function z_(o,s,l){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ut,l)}catch{}switch(l.tag){case 26:Ht||kr(l,s),Yr(o,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ht||kr(l,s);var d=_t,g=Sn;qo(l.type)&&(_t=l.stateNode,Sn=!1),Yr(o,s,l),Mc(l.stateNode),_t=d,Sn=g;break;case 5:Ht||kr(l,s);case 6:if(d=_t,g=Sn,_t=null,Yr(o,s,l),_t=d,Sn=g,_t!==null)if(Sn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(l.stateNode)}catch(b){dt(l,s,b)}else try{_t.removeChild(l.stateNode)}catch(b){dt(l,s,b)}break;case 18:_t!==null&&(Sn?(o=_t,OS(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,l.stateNode),Ta(o)):OS(_t,l.stateNode));break;case 4:d=_t,g=Sn,_t=l.stateNode.containerInfo,Sn=!0,Yr(o,s,l),_t=d,Sn=g;break;case 0:case 11:case 14:case 15:Lo(2,l,s),Ht||Lo(4,l,s),Yr(o,s,l);break;case 1:Ht||(kr(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&A_(l,s,d)),Yr(o,s,l);break;case 21:Yr(o,s,l);break;case 22:Ht=(d=Ht)||l.memoizedState!==null,Yr(o,s,l),Ht=d;break;default:Yr(o,s,l)}}function D_(o,s){if(s.memoizedState===null&&(o=s.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Ta(o)}catch(l){dt(s,s.return,l)}}}function L_(o,s){if(s.memoizedState===null&&(o=s.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Ta(o)}catch(l){dt(s,s.return,l)}}function uz(o){switch(o.tag){case 31:case 13:case 19:var s=o.stateNode;return s===null&&(s=o.stateNode=new R_),s;case 22:return o=o.stateNode,s=o._retryCache,s===null&&(s=o._retryCache=new R_),s;default:throw Error(r(435,o.tag))}}function cf(o,s){var l=uz(o);s.forEach(function(d){if(!l.has(d)){l.add(d);var g=vz.bind(null,o,d);d.then(g,g)}})}function En(o,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d],b=o,E=s,R=E;e:for(;R!==null;){switch(R.tag){case 27:if(qo(R.type)){_t=R.stateNode,Sn=!1;break e}break;case 5:_t=R.stateNode,Sn=!1;break e;case 3:case 4:_t=R.stateNode.containerInfo,Sn=!0;break e}R=R.return}if(_t===null)throw Error(r(160));z_(b,E,g),_t=null,Sn=!1,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)I_(s,o),s=s.sibling}var dr=null;function I_(o,s){var l=o.alternate,d=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:En(s,o),jn(o),d&4&&(Lo(3,o,o.return),wc(3,o),Lo(5,o,o.return));break;case 1:En(s,o),jn(o),d&512&&(Ht||l===null||kr(l,l.return)),d&64&&Gr&&(o=o.updateQueue,o!==null&&(d=o.callbacks,d!==null&&(l=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var g=dr;if(En(s,o),jn(o),d&512&&(Ht||l===null||kr(l,l.return)),d&4){var b=l!==null?l.memoizedState:null;if(d=o.memoizedState,l===null)if(d===null)if(o.stateNode===null){e:{d=o.type,l=o.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":b=g.getElementsByTagName("title")[0],(!b||b[Yl]||b[Ze]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=g.createElement(d),g.head.insertBefore(b,g.querySelector("head > title"))),an(b,d,l),b[Ze]=o,Xt(b),d=b;break e;case"link":var E=IS("link","href",g).get(d+(l.href||""));if(E){for(var R=0;R<E.length;R++)if(b=E[R],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){E.splice(R,1);break t}}b=g.createElement(d),an(b,d,l),g.head.appendChild(b);break;case"meta":if(E=IS("meta","content",g).get(d+(l.content||""))){for(R=0;R<E.length;R++)if(b=E[R],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){E.splice(R,1);break t}}b=g.createElement(d),an(b,d,l),g.head.appendChild(b);break;default:throw Error(r(468,d))}b[Ze]=o,Xt(b),d=b}o.stateNode=d}else US(g,o.type,o.stateNode);else o.stateNode=LS(g,d,o.memoizedProps);else b!==d?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,d===null?US(g,o.type,o.stateNode):LS(g,d,o.memoizedProps)):d===null&&o.stateNode!==null&&Tg(o,o.memoizedProps,l.memoizedProps)}break;case 27:En(s,o),jn(o),d&512&&(Ht||l===null||kr(l,l.return)),l!==null&&d&4&&Tg(o,o.memoizedProps,l.memoizedProps);break;case 5:if(En(s,o),jn(o),d&512&&(Ht||l===null||kr(l,l.return)),o.flags&32){g=o.stateNode;try{na(g,"")}catch(Ce){dt(o,o.return,Ce)}}d&4&&o.stateNode!=null&&(g=o.memoizedProps,Tg(o,g,l!==null?l.memoizedProps:g)),d&1024&&(Dg=!0);break;case 6:if(En(s,o),jn(o),d&4){if(o.stateNode===null)throw Error(r(162));d=o.memoizedProps,l=o.stateNode;try{l.nodeValue=d}catch(Ce){dt(o,o.return,Ce)}}break;case 3:if(Ef=null,g=dr,dr=_f(s.containerInfo),En(s,o),dr=g,jn(o),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ta(s.containerInfo)}catch(Ce){dt(o,o.return,Ce)}Dg&&(Dg=!1,U_(o));break;case 4:d=dr,dr=_f(o.stateNode.containerInfo),En(s,o),jn(o),dr=d;break;case 12:En(s,o),jn(o);break;case 31:En(s,o),jn(o),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,cf(o,d)));break;case 13:En(s,o),jn(o),o.child.flags&8192&&o.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(df=xt()),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,cf(o,d)));break;case 22:g=o.memoizedState!==null;var V=l!==null&&l.memoizedState!==null,oe=Gr,he=Ht;if(Gr=oe||g,Ht=he||V,En(s,o),Ht=he,Gr=oe,jn(o),d&8192)e:for(s=o.stateNode,s._visibility=g?s._visibility&-2:s._visibility|1,g&&(l===null||V||Gr||Ht||Qi(o)),l=null,s=o;;){if(s.tag===5||s.tag===26){if(l===null){V=l=s;try{if(b=V.stateNode,g)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{R=V.stateNode;var ye=V.memoizedProps.style,ae=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;R.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ce){dt(V,V.return,Ce)}}}else if(s.tag===6){if(l===null){V=s;try{V.stateNode.nodeValue=g?"":V.memoizedProps}catch(Ce){dt(V,V.return,Ce)}}}else if(s.tag===18){if(l===null){V=s;try{var ue=V.stateNode;g?AS(ue,!0):AS(V.stateNode,!1)}catch(Ce){dt(V,V.return,Ce)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===o)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=o.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,cf(o,l))));break;case 19:En(s,o),jn(o),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,cf(o,d)));break;case 30:break;case 21:break;default:En(s,o),jn(o)}}function jn(o){var s=o.flags;if(s&2){try{for(var l,d=o.return;d!==null;){if(N_(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,b=$g(o);lf(o,b,g);break;case 5:var E=l.stateNode;l.flags&32&&(na(E,""),l.flags&=-33);var R=$g(o);lf(o,R,E);break;case 3:case 4:var V=l.stateNode.containerInfo,oe=$g(o);zg(o,oe,V);break;default:throw Error(r(161))}}catch(he){dt(o,o.return,he)}o.flags&=-3}s&4096&&(o.flags&=-4097)}function U_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var s=o;U_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),o=o.sibling}}function Qr(o,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)T_(o,s.alternate,s),s=s.sibling}function Qi(o){for(o=o.child;o!==null;){var s=o;switch(s.tag){case 0:case 11:case 14:case 15:Lo(4,s,s.return),Qi(s);break;case 1:kr(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&A_(s,s.return,l),Qi(s);break;case 27:Mc(s.stateNode);case 26:case 5:kr(s,s.return),Qi(s);break;case 22:s.memoizedState===null&&Qi(s);break;case 30:Qi(s);break;default:Qi(s)}o=o.sibling}}function Xr(o,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,g=o,b=s,E=b.flags;switch(b.tag){case 0:case 11:case 15:Xr(g,b,l),wc(4,b);break;case 1:if(Xr(g,b,l),d=b,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(oe){dt(d,d.return,oe)}if(d=b,g=d.updateQueue,g!==null){var R=d.stateNode;try{var V=g.shared.hiddenCallbacks;if(V!==null)for(g.shared.hiddenCallbacks=null,g=0;g<V.length;g++)gk(V[g],R)}catch(oe){dt(d,d.return,oe)}}l&&E&64&&O_(b),kc(b,b.return);break;case 27:M_(b);case 26:case 5:Xr(g,b,l),l&&d===null&&E&4&&C_(b),kc(b,b.return);break;case 12:Xr(g,b,l);break;case 31:Xr(g,b,l),l&&E&4&&D_(g,b);break;case 13:Xr(g,b,l),l&&E&4&&L_(g,b);break;case 22:b.memoizedState===null&&Xr(g,b,l),kc(b,b.return);break;case 30:break;default:Xr(g,b,l)}s=s.sibling}}function Lg(o,s){var l=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(l=o.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==l&&(o!=null&&o.refCount++,l!=null&&lc(l))}function Ig(o,s){o=null,s.alternate!==null&&(o=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==o&&(s.refCount++,o!=null&&lc(o))}function fr(o,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)P_(o,s,l,d),s=s.sibling}function P_(o,s,l,d){var g=s.flags;switch(s.tag){case 0:case 11:case 15:fr(o,s,l,d),g&2048&&wc(9,s);break;case 1:fr(o,s,l,d);break;case 3:fr(o,s,l,d),g&2048&&(o=null,s.alternate!==null&&(o=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==o&&(s.refCount++,o!=null&&lc(o)));break;case 12:if(g&2048){fr(o,s,l,d),o=s.stateNode;try{var b=s.memoizedProps,E=b.id,R=b.onPostCommit;typeof R=="function"&&R(E,s.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(V){dt(s,s.return,V)}}else fr(o,s,l,d);break;case 31:fr(o,s,l,d);break;case 13:fr(o,s,l,d);break;case 23:break;case 22:b=s.stateNode,E=s.alternate,s.memoizedState!==null?b._visibility&2?fr(o,s,l,d):_c(o,s):b._visibility&2?fr(o,s,l,d):(b._visibility|=2,ka(o,s,l,d,(s.subtreeFlags&10256)!==0||!1)),g&2048&&Lg(E,s);break;case 24:fr(o,s,l,d),g&2048&&Ig(s.alternate,s);break;default:fr(o,s,l,d)}}function ka(o,s,l,d,g){for(g=g&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var b=o,E=s,R=l,V=d,oe=E.flags;switch(E.tag){case 0:case 11:case 15:ka(b,E,R,V,g),wc(8,E);break;case 23:break;case 22:var he=E.stateNode;E.memoizedState!==null?he._visibility&2?ka(b,E,R,V,g):_c(b,E):(he._visibility|=2,ka(b,E,R,V,g)),g&&oe&2048&&Lg(E.alternate,E);break;case 24:ka(b,E,R,V,g),g&&oe&2048&&Ig(E.alternate,E);break;default:ka(b,E,R,V,g)}s=s.sibling}}function _c(o,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=o,d=s,g=d.flags;switch(d.tag){case 22:_c(l,d),g&2048&&Lg(d.alternate,d);break;case 24:_c(l,d),g&2048&&Ig(d.alternate,d);break;default:_c(l,d)}s=s.sibling}}var Sc=8192;function _a(o,s,l){if(o.subtreeFlags&Sc)for(o=o.child;o!==null;)F_(o,s,l),o=o.sibling}function F_(o,s,l){switch(o.tag){case 26:_a(o,s,l),o.flags&Sc&&o.memoizedState!==null&&Qz(l,dr,o.memoizedState,o.memoizedProps);break;case 5:_a(o,s,l);break;case 3:case 4:var d=dr;dr=_f(o.stateNode.containerInfo),_a(o,s,l),dr=d;break;case 22:o.memoizedState===null&&(d=o.alternate,d!==null&&d.memoizedState!==null?(d=Sc,Sc=16777216,_a(o,s,l),Sc=d):_a(o,s,l));break;default:_a(o,s,l)}}function B_(o){var s=o.alternate;if(s!==null&&(o=s.child,o!==null)){s.child=null;do s=o.sibling,o.sibling=null,o=s;while(o!==null)}}function Ec(o){var s=o.deletions;if((o.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];Wt=d,q_(d,o)}B_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)H_(o),o=o.sibling}function H_(o){switch(o.tag){case 0:case 11:case 15:Ec(o),o.flags&2048&&Lo(9,o,o.return);break;case 3:Ec(o);break;case 12:Ec(o);break;case 22:var s=o.stateNode;o.memoizedState!==null&&s._visibility&2&&(o.return===null||o.return.tag!==13)?(s._visibility&=-3,uf(o)):Ec(o);break;default:Ec(o)}}function uf(o){var s=o.deletions;if((o.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];Wt=d,q_(d,o)}B_(o)}for(o=o.child;o!==null;){switch(s=o,s.tag){case 0:case 11:case 15:Lo(8,s,s.return),uf(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,uf(s));break;default:uf(s)}o=o.sibling}}function q_(o,s){for(;Wt!==null;){var l=Wt;switch(l.tag){case 0:case 11:case 15:Lo(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:lc(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Wt=d;else e:for(l=o;Wt!==null;){d=Wt;var g=d.sibling,b=d.return;if($_(d),d===l){Wt=null;break e}if(g!==null){g.return=b,Wt=g;break e}Wt=b}}}var dz={getCacheForType:function(o){var s=on(Pt),l=s.data.get(o);return l===void 0&&(l=o(),s.data.set(o,l)),l},cacheSignal:function(){return on(Pt).controller.signal}},fz=typeof WeakMap=="function"?WeakMap:Map,st=0,bt=null,Ke=null,Ye=0,ut=0,Fn=null,Io=!1,Sa=!1,Ug=!1,Wr=0,Ct=0,Uo=0,Xi=0,Pg=0,Bn=0,Ea=0,jc=null,On=null,Fg=!1,df=0,V_=0,ff=1/0,hf=null,Po=null,Zt=0,Fo=null,ja=null,Jr=0,Bg=0,Hg=null,Z_=null,Oc=0,qg=null;function Hn(){return(st&2)!==0&&Ye!==0?Ye&-Ye:M.T!==null?Qg():ie()}function K_(){if(Bn===0)if((Ye&536870912)===0||Xe){var o=Gs;Gs<<=1,(Gs&3932160)===0&&(Gs=262144),Bn=o}else Bn=536870912;return o=Un.current,o!==null&&(o.flags|=32),Bn}function An(o,s,l){(o===bt&&(ut===2||ut===9)||o.cancelPendingCommit!==null)&&(Oa(o,0),Bo(o,Ye,Bn,!1)),$i(o,l),((st&2)===0||o!==bt)&&(o===bt&&((st&2)===0&&(Xi|=l),Ct===4&&Bo(o,Ye,Bn,!1)),_r(o))}function G_(o,s,l){if((st&6)!==0)throw Error(r(327));var d=!l&&(s&127)===0&&(s&o.expiredLanes)===0||Ti(o,s),g=d?mz(o,s):Zg(o,s,!0),b=d;do{if(g===0){Sa&&!d&&Bo(o,s,0,!1);break}else{if(l=o.current.alternate,b&&!hz(l)){g=Zg(o,s,!1),b=!1;continue}if(g===2){if(b=s,o.errorRecoveryDisabledLanes&b)var E=0;else E=o.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){s=E;e:{var R=o;g=jc;var V=R.current.memoizedState.isDehydrated;if(V&&(Oa(R,E).flags|=256),E=Zg(R,E,!1),E!==2){if(Ug&&!V){R.errorRecoveryDisabledLanes|=b,Xi|=b,g=4;break e}b=On,On=g,b!==null&&(On===null?On=b:On.push.apply(On,b))}g=E}if(b=!1,g!==2)continue}}if(g===1){Oa(o,0),Bo(o,s,0,!0);break}e:{switch(d=o,b=g,b){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Bo(d,s,Bn,!Io);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(g=df+300-xt(),10<g)){if(Bo(d,s,Bn,!Io),Qs(d,0,!0)!==0)break e;Jr=s,d.timeoutHandle=ES(Y_.bind(null,d,l,On,hf,Fg,s,Bn,Xi,Ea,Io,b,"Throttled",-0,0),g);break e}Y_(d,l,On,hf,Fg,s,Bn,Xi,Ea,Io,b,null,-0,0)}}break}while(!0);_r(o)}function Y_(o,s,l,d,g,b,E,R,V,oe,he,ye,ae,ue){if(o.timeoutHandle=-1,ye=s.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ir},F_(s,b,ye);var Ce=(b&62914560)===b?df-xt():(b&4194048)===b?V_-xt():0;if(Ce=Xz(ye,Ce),Ce!==null){Jr=b,o.cancelPendingCommit=Ce(rS.bind(null,o,s,b,l,d,g,E,R,V,he,ye,null,ae,ue)),Bo(o,b,E,!oe);return}}rS(o,s,b,l,d,g,E,R,V)}function hz(o){for(var s=o;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var g=l[d],b=g.getSnapshot;g=g.value;try{if(!Ln(b(),g))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Bo(o,s,l,d){s&=~Pg,s&=~Xi,o.suspendedLanes|=s,o.pingedLanes&=~s,d&&(o.warmLanes|=s),d=o.expirationTimes;for(var g=s;0<g;){var b=31-dn(g),E=1<<b;d[b]=-1,g&=~E}l!==0&&Vl(o,l,s)}function pf(){return(st&6)===0?(Ac(0),!1):!0}function Vg(){if(Ke!==null){if(ut===0)var o=Ke.return;else o=Ke,Br=Bi=null,ag(o),ya=null,uc=0,o=Ke;for(;o!==null;)j_(o.alternate,o),o=o.return;Ke=null}}function Oa(o,s){var l=o.timeoutHandle;l!==-1&&(o.timeoutHandle=-1,Tz(l)),l=o.cancelPendingCommit,l!==null&&(o.cancelPendingCommit=null,l()),Jr=0,Vg(),bt=o,Ke=l=Pr(o.current,null),Ye=s,ut=0,Fn=null,Io=!1,Sa=Ti(o,s),Ug=!1,Ea=Bn=Pg=Xi=Uo=Ct=0,On=jc=null,Fg=!1,(s&8)!==0&&(s|=s&32);var d=o.entangledLanes;if(d!==0)for(o=o.entanglements,d&=s;0<d;){var g=31-dn(d),b=1<<g;s|=o[g],d&=~b}return Wr=s,$d(),l}function Q_(o,s){Be=null,M.H=bc,s===ga||s===Bd?(s=fk(),ut=3):s===Ym?(s=fk(),ut=4):ut=s===_g?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Fn=s,Ke===null&&(Ct=1,nf(o,Wn(s,o.current)))}function X_(){var o=Un.current;return o===null?!0:(Ye&4194048)===Ye?nr===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?o===nr:!1}function W_(){var o=M.H;return M.H=bc,o===null?bc:o}function J_(){var o=M.A;return M.A=dz,o}function mf(){Ct=4,Io||(Ye&4194048)!==Ye&&Un.current!==null||(Sa=!0),(Uo&134217727)===0&&(Xi&134217727)===0||bt===null||Bo(bt,Ye,Bn,!1)}function Zg(o,s,l){var d=st;st|=2;var g=W_(),b=J_();(bt!==o||Ye!==s)&&(hf=null,Oa(o,s)),s=!1;var E=Ct;e:do try{if(ut!==0&&Ke!==null){var R=Ke,V=Fn;switch(ut){case 8:Vg(),E=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(s=!0);var oe=ut;if(ut=0,Fn=null,Aa(o,R,V,oe),l&&Sa){E=0;break e}break;default:oe=ut,ut=0,Fn=null,Aa(o,R,V,oe)}}pz(),E=Ct;break}catch(he){Q_(o,he)}while(!0);return s&&o.shellSuspendCounter++,Br=Bi=null,st=d,M.H=g,M.A=b,Ke===null&&(bt=null,Ye=0,$d()),E}function pz(){for(;Ke!==null;)eS(Ke)}function mz(o,s){var l=st;st|=2;var d=W_(),g=J_();bt!==o||Ye!==s?(hf=null,ff=xt()+500,Oa(o,s)):Sa=Ti(o,s);e:do try{if(ut!==0&&Ke!==null){s=Ke;var b=Fn;t:switch(ut){case 1:ut=0,Fn=null,Aa(o,s,b,1);break;case 2:case 9:if(uk(b)){ut=0,Fn=null,tS(s);break}s=function(){ut!==2&&ut!==9||bt!==o||(ut=7),_r(o)},b.then(s,s);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:uk(b)?(ut=0,Fn=null,tS(s)):(ut=0,Fn=null,Aa(o,s,b,7));break;case 5:var E=null;switch(Ke.tag){case 26:E=Ke.memoizedState;case 5:case 27:var R=Ke;if(E?PS(E):R.stateNode.complete){ut=0,Fn=null;var V=R.sibling;if(V!==null)Ke=V;else{var oe=R.return;oe!==null?(Ke=oe,gf(oe)):Ke=null}break t}}ut=0,Fn=null,Aa(o,s,b,5);break;case 6:ut=0,Fn=null,Aa(o,s,b,6);break;case 8:Vg(),Ct=6;break e;default:throw Error(r(462))}}gz();break}catch(he){Q_(o,he)}while(!0);return Br=Bi=null,M.H=d,M.A=g,st=l,Ke!==null?0:(bt=null,Ye=0,$d(),Ct)}function gz(){for(;Ke!==null&&!zt();)eS(Ke)}function eS(o){var s=S_(o.alternate,o,Wr);o.memoizedProps=o.pendingProps,s===null?gf(o):Ke=s}function tS(o){var s=o,l=s.alternate;switch(s.tag){case 15:case 0:s=b_(l,s,s.pendingProps,s.type,void 0,Ye);break;case 11:s=b_(l,s,s.pendingProps,s.type.render,s.ref,Ye);break;case 5:ag(s);default:j_(l,s),s=Ke=J1(s,Wr),s=S_(l,s,Wr)}o.memoizedProps=o.pendingProps,s===null?gf(o):Ke=s}function Aa(o,s,l,d){Br=Bi=null,ag(s),ya=null,uc=0;var g=s.return;try{if(oz(o,g,s,l,Ye)){Ct=1,nf(o,Wn(l,o.current)),Ke=null;return}}catch(b){if(g!==null)throw Ke=g,b;Ct=1,nf(o,Wn(l,o.current)),Ke=null;return}s.flags&32768?(Xe||d===1?o=!0:Sa||(Ye&536870912)!==0?o=!1:(Io=o=!0,(d===2||d===9||d===3||d===6)&&(d=Un.current,d!==null&&d.tag===13&&(d.flags|=16384))),nS(s,o)):gf(s)}function gf(o){var s=o;do{if((s.flags&32768)!==0){nS(s,Io);return}o=s.return;var l=az(s.alternate,s,Wr);if(l!==null){Ke=l;return}if(s=s.sibling,s!==null){Ke=s;return}Ke=s=o}while(s!==null);Ct===0&&(Ct=5)}function nS(o,s){do{var l=lz(o.alternate,o);if(l!==null){l.flags&=32767,Ke=l;return}if(l=o.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(o=o.sibling,o!==null)){Ke=o;return}Ke=o=l}while(o!==null);Ct=6,Ke=null}function rS(o,s,l,d,g,b,E,R,V){o.cancelPendingCommit=null;do yf();while(Zt!==0);if((st&6)!==0)throw Error(r(327));if(s!==null){if(s===o.current)throw Error(r(177));if(b=s.lanes|s.childLanes,b|=$m,dm(o,l,b,E,R,V),o===bt&&(Ke=bt=null,Ye=0),ja=s,Fo=o,Jr=l,Bg=b,Hg=g,Z_=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,xz(ke,function(){return lS(),null})):(o.callbackNode=null,o.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=M.T,M.T=null,g=B.p,B.p=2,E=st,st|=4;try{cz(o,s,l)}finally{st=E,B.p=g,M.T=d}}Zt=1,oS(),iS(),sS()}}function oS(){if(Zt===1){Zt=0;var o=Fo,s=ja,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var d=B.p;B.p=2;var g=st;st|=4;try{I_(s,o);var b=oy,E=q1(o.containerInfo),R=b.focusedElem,V=b.selectionRange;if(E!==R&&R&&R.ownerDocument&&H1(R.ownerDocument.documentElement,R)){if(V!==null&&Cm(R)){var oe=V.start,he=V.end;if(he===void 0&&(he=oe),"selectionStart"in R)R.selectionStart=oe,R.selectionEnd=Math.min(he,R.value.length);else{var ye=R.ownerDocument||document,ae=ye&&ye.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),Ce=R.textContent.length,De=Math.min(V.start,Ce),pt=V.end===void 0?De:Math.min(V.end,Ce);!ue.extend&&De>pt&&(E=pt,pt=De,De=E);var te=B1(R,De),Q=B1(R,pt);if(te&&Q&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==Q.node||ue.focusOffset!==Q.offset)){var re=ye.createRange();re.setStart(te.node,te.offset),ue.removeAllRanges(),De>pt?(ue.addRange(re),ue.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),ue.addRange(re))}}}}for(ye=[],ue=R;ue=ue.parentNode;)ue.nodeType===1&&ye.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ye.length;R++){var me=ye[R];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Cf=!!ry,oy=ry=null}finally{st=g,B.p=d,M.T=l}}o.current=s,Zt=2}}function iS(){if(Zt===2){Zt=0;var o=Fo,s=ja,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var d=B.p;B.p=2;var g=st;st|=4;try{T_(o,s.alternate,s)}finally{st=g,B.p=d,M.T=l}}Zt=3}}function sS(){if(Zt===4||Zt===3){Zt=0,$r();var o=Fo,s=ja,l=Jr,d=Z_;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Zt=5:(Zt=0,ja=Fo=null,aS(o,o.pendingLanes));var g=o.pendingLanes;if(g===0&&(Po=null),Gl(l),s=s.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ut,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=M.T,g=B.p,B.p=2,M.T=null;try{for(var b=o.onRecoverableError,E=0;E<d.length;E++){var R=d[E];b(R.value,{componentStack:R.stack})}}finally{M.T=s,B.p=g}}(Jr&3)!==0&&yf(),_r(o),g=o.pendingLanes,(l&261930)!==0&&(g&42)!==0?o===qg?Oc++:(Oc=0,qg=o):Oc=0,Ac(0)}}function aS(o,s){(o.pooledCacheLanes&=s)===0&&(s=o.pooledCache,s!=null&&(o.pooledCache=null,lc(s)))}function yf(){return oS(),iS(),sS(),lS()}function lS(){if(Zt!==5)return!1;var o=Fo,s=Bg;Bg=0;var l=Gl(Jr),d=M.T,g=B.p;try{B.p=32>l?32:l,M.T=null,l=Hg,Hg=null;var b=Fo,E=Jr;if(Zt=0,ja=Fo=null,Jr=0,(st&6)!==0)throw Error(r(331));var R=st;if(st|=4,H_(b.current),P_(b,b.current,E,l),st=R,Ac(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ut,b)}catch{}return!0}finally{B.p=g,M.T=d,aS(o,s)}}function cS(o,s,l){s=Wn(l,s),s=kg(o.stateNode,s,2),o=$o(o,s,2),o!==null&&($i(o,2),_r(o))}function dt(o,s,l){if(o.tag===3)cS(o,o,l);else for(;s!==null;){if(s.tag===3){cS(s,o,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Po===null||!Po.has(d))){o=Wn(l,o),l=u_(2),d=$o(s,l,2),d!==null&&(d_(l,d,s,o),$i(d,2),_r(d));break}}s=s.return}}function Kg(o,s,l){var d=o.pingCache;if(d===null){d=o.pingCache=new fz;var g=new Set;d.set(s,g)}else g=d.get(s),g===void 0&&(g=new Set,d.set(s,g));g.has(l)||(Ug=!0,g.add(l),o=yz.bind(null,o,s,l),s.then(o,o))}function yz(o,s,l){var d=o.pingCache;d!==null&&d.delete(s),o.pingedLanes|=o.suspendedLanes&l,o.warmLanes&=~l,bt===o&&(Ye&l)===l&&(Ct===4||Ct===3&&(Ye&62914560)===Ye&&300>xt()-df?(st&2)===0&&Oa(o,0):Pg|=l,Ea===Ye&&(Ea=0)),_r(o)}function uS(o,s){s===0&&(s=wd()),o=Ui(o,s),o!==null&&($i(o,s),_r(o))}function bz(o){var s=o.memoizedState,l=0;s!==null&&(l=s.retryLane),uS(o,l)}function vz(o,s){var l=0;switch(o.tag){case 31:case 13:var d=o.stateNode,g=o.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=o.stateNode;break;case 22:d=o.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(s),uS(o,l)}function xz(o,s){return it(o,s)}var bf=null,Ca=null,Gg=!1,vf=!1,Yg=!1,Ho=0;function _r(o){o!==Ca&&o.next===null&&(Ca===null?bf=Ca=o:Ca=Ca.next=o),vf=!0,Gg||(Gg=!0,kz())}function Ac(o,s){if(!Yg&&vf){Yg=!0;do for(var l=!1,d=bf;d!==null;){if(o!==0){var g=d.pendingLanes;if(g===0)var b=0;else{var E=d.suspendedLanes,R=d.pingedLanes;b=(1<<31-dn(42|o)+1)-1,b&=g&~(E&~R),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,pS(d,b))}else b=Ye,b=Qs(d,d===bt?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||Ti(d,b)||(l=!0,pS(d,b));d=d.next}while(l);Yg=!1}}function wz(){dS()}function dS(){vf=Gg=!1;var o=0;Ho!==0&&Rz()&&(o=Ho);for(var s=xt(),l=null,d=bf;d!==null;){var g=d.next,b=fS(d,s);b===0?(d.next=null,l===null?bf=g:l.next=g,g===null&&(Ca=l)):(l=d,(o!==0||(b&3)!==0)&&(vf=!0)),d=g}Zt!==0&&Zt!==5||Ac(o),Ho!==0&&(Ho=0)}function fS(o,s){for(var l=o.suspendedLanes,d=o.pingedLanes,g=o.expirationTimes,b=o.pendingLanes&-62914561;0<b;){var E=31-dn(b),R=1<<E,V=g[E];V===-1?((R&l)===0||(R&d)!==0)&&(g[E]=xd(R,s)):V<=s&&(o.expiredLanes|=R),b&=~R}if(s=bt,l=Ye,l=Qs(o,o===s?l:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),d=o.callbackNode,l===0||o===s&&(ut===2||ut===9)||o.cancelPendingCommit!==null)return d!==null&&d!==null&&It(d),o.callbackNode=null,o.callbackPriority=0;if((l&3)===0||Ti(o,l)){if(s=l&-l,s===o.callbackPriority)return s;switch(d!==null&&It(d),Gl(l)){case 2:case 8:l=Ri;break;case 32:l=ke;break;case 268435456:l=Je;break;default:l=ke}return d=hS.bind(null,o),l=it(l,d),o.callbackPriority=s,o.callbackNode=l,s}return d!==null&&d!==null&&It(d),o.callbackPriority=2,o.callbackNode=null,2}function hS(o,s){if(Zt!==0&&Zt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var l=o.callbackNode;if(yf()&&o.callbackNode!==l)return null;var d=Ye;return d=Qs(o,o===bt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),d===0?null:(G_(o,d,s),fS(o,xt()),o.callbackNode!=null&&o.callbackNode===l?hS.bind(null,o):null)}function pS(o,s){if(yf())return null;G_(o,s,!0)}function kz(){$z(function(){(st&6)!==0?it(qs,wz):dS()})}function Qg(){if(Ho===0){var o=pa;o===0&&(o=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),Ho=o}return Ho}function mS(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:jd(""+o)}function gS(o,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,o.id&&l.setAttribute("form",o.id),s.parentNode.insertBefore(l,s),o=new FormData(o),l.parentNode.removeChild(l),o}function _z(o,s,l,d,g){if(s==="submit"&&l&&l.stateNode===g){var b=mS((g[Pe]||null).action),E=d.submitter;E&&(s=(s=E[Pe]||null)?mS(s.formAction):E.getAttribute("formAction"),s!==null&&(b=s,E=null));var R=new Nd("action","action",null,d,g);o.push({event:R,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ho!==0){var V=E?gS(g,E):new FormData(g);gg(l,{pending:!0,data:V,method:g.method,action:b},null,V)}}else typeof b=="function"&&(R.preventDefault(),V=E?gS(g,E):new FormData(g),gg(l,{pending:!0,data:V,method:g.method,action:b},b,V))},currentTarget:g}]})}}for(var Xg=0;Xg<Tm.length;Xg++){var Wg=Tm[Xg],Sz=Wg.toLowerCase(),Ez=Wg[0].toUpperCase()+Wg.slice(1);ur(Sz,"on"+Ez)}ur(K1,"onAnimationEnd"),ur(G1,"onAnimationIteration"),ur(Y1,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(F3,"onTransitionRun"),ur(B3,"onTransitionStart"),ur(H3,"onTransitionCancel"),ur(Q1,"onTransitionEnd"),ea("onMouseEnter",["mouseout","mouseover"]),ea("onMouseLeave",["mouseout","mouseover"]),ea("onPointerEnter",["pointerout","pointerover"]),ea("onPointerLeave",["pointerout","pointerover"]),zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cc="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(" "),jz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cc));function yS(o,s){s=(s&4)!==0;for(var l=0;l<o.length;l++){var d=o[l],g=d.event;d=d.listeners;e:{var b=void 0;if(s)for(var E=d.length-1;0<=E;E--){var R=d[E],V=R.instance,oe=R.currentTarget;if(R=R.listener,V!==b&&g.isPropagationStopped())break e;b=R,g.currentTarget=oe;try{b(g)}catch(he){Td(he)}g.currentTarget=null,b=V}else for(E=0;E<d.length;E++){if(R=d[E],V=R.instance,oe=R.currentTarget,R=R.listener,V!==b&&g.isPropagationStopped())break e;b=R,g.currentTarget=oe;try{b(g)}catch(he){Td(he)}g.currentTarget=null,b=V}}}}function Ge(o,s){var l=s[Dr];l===void 0&&(l=s[Dr]=new Set);var d=o+"__bubble";l.has(d)||(bS(s,o,2,!1),l.add(d))}function Jg(o,s,l){var d=0;s&&(d|=4),bS(l,o,d,s)}var xf="_reactListening"+Math.random().toString(36).slice(2);function ey(o){if(!o[xf]){o[xf]=!0,d1.forEach(function(l){l!=="selectionchange"&&(jz.has(l)||Jg(l,!1,o),Jg(l,!0,o))});var s=o.nodeType===9?o:o.ownerDocument;s===null||s[xf]||(s[xf]=!0,Jg("selectionchange",!1,s))}}function bS(o,s,l,d){switch(KS(s)){case 2:var g=eD;break;case 8:g=tD;break;default:g=my}l=g.bind(null,s,l,o),g=void 0,!xm||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),d?g!==void 0?o.addEventListener(s,l,{capture:!0,passive:g}):o.addEventListener(s,l,!0):g!==void 0?o.addEventListener(s,l,{passive:g}):o.addEventListener(s,l,!1)}function ty(o,s,l,d,g){var b=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var E=d.tag;if(E===3||E===4){var R=d.stateNode.containerInfo;if(R===g)break;if(E===4)for(E=d.return;E!==null;){var V=E.tag;if((V===3||V===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;R!==null;){if(E=Xs(R),E===null)return;if(V=E.tag,V===5||V===6||V===26||V===27){d=b=E;continue e}R=R.parentNode}}d=d.return}_1(function(){var oe=b,he=bm(l),ye=[];e:{var ae=X1.get(o);if(ae!==void 0){var ue=Nd,Ce=o;switch(o){case"keypress":if(Ad(l)===0)break e;case"keydown":case"keyup":ue=v3;break;case"focusin":Ce="focus",ue=Sm;break;case"focusout":Ce="blur",ue=Sm;break;case"beforeblur":case"afterblur":ue=Sm;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=j1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=a3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=k3;break;case K1:case G1:case Y1:ue=u3;break;case Q1:ue=S3;break;case"scroll":case"scrollend":ue=i3;break;case"wheel":ue=j3;break;case"copy":case"cut":case"paste":ue=f3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=A1;break;case"toggle":case"beforetoggle":ue=A3}var De=(s&4)!==0,pt=!De&&(o==="scroll"||o==="scrollend"),te=De?ae!==null?ae+"Capture":null:ae;De=[];for(var Q=oe,re;Q!==null;){var me=Q;if(re=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||re===null||te===null||(me=Xl(Q,te),me!=null&&De.push(Nc(Q,me,re))),pt)break;Q=Q.return}0<De.length&&(ae=new ue(ae,Ce,null,l,he),ye.push({event:ae,listeners:De}))}}if((s&7)===0){e:{if(ae=o==="mouseover"||o==="pointerover",ue=o==="mouseout"||o==="pointerout",ae&&l!==ym&&(Ce=l.relatedTarget||l.fromElement)&&(Xs(Ce)||Ce[vr]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(Ce=l.relatedTarget||l.toElement,ue=oe,Ce=Ce?Xs(Ce):null,Ce!==null&&(pt=a(Ce),De=Ce.tag,Ce!==pt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(ue=null,Ce=oe),ue!==Ce)){if(De=j1,me="onMouseLeave",te="onMouseEnter",Q="mouse",(o==="pointerout"||o==="pointerover")&&(De=A1,me="onPointerLeave",te="onPointerEnter",Q="pointer"),pt=ue==null?ae:Ql(ue),re=Ce==null?ae:Ql(Ce),ae=new De(me,Q+"leave",ue,l,he),ae.target=pt,ae.relatedTarget=re,me=null,Xs(he)===oe&&(De=new De(te,Q+"enter",Ce,l,he),De.target=re,De.relatedTarget=pt,me=De),pt=me,ue&&Ce)t:{for(De=Oz,te=ue,Q=Ce,re=0,me=te;me;me=De(me))re++;me=0;for(var $e=Q;$e;$e=De($e))me++;for(;0<re-me;)te=De(te),re--;for(;0<me-re;)Q=De(Q),me--;for(;re--;){if(te===Q||Q!==null&&te===Q.alternate){De=te;break t}te=De(te),Q=De(Q)}De=null}else De=null;ue!==null&&vS(ye,ae,ue,De,!1),Ce!==null&&pt!==null&&vS(ye,pt,Ce,De,!0)}}e:{if(ae=oe?Ql(oe):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var nt=D1;else if($1(ae))if(L1)nt=I3;else{nt=D3;var Re=z3}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&gm(oe.elementType)&&(nt=D1):nt=L3;if(nt&&(nt=nt(o,oe))){z1(ye,nt,l,he);break e}Re&&Re(o,ae,oe),o==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&mm(ae,"number",ae.value)}switch(Re=oe?Ql(oe):window,o){case"focusin":($1(Re)||Re.contentEditable==="true")&&(sa=Re,Nm=oe,ic=null);break;case"focusout":ic=Nm=sa=null;break;case"mousedown":Mm=!0;break;case"contextmenu":case"mouseup":case"dragend":Mm=!1,V1(ye,l,he);break;case"selectionchange":if(P3)break;case"keydown":case"keyup":V1(ye,l,he)}var He;if(jm)e:{switch(o){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else ia?R1(o,l)&&(Qe="onCompositionEnd"):o==="keydown"&&l.keyCode===229&&(Qe="onCompositionStart");Qe&&(C1&&l.locale!=="ko"&&(ia||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&ia&&(He=S1()):(Oo=he,wm="value"in Oo?Oo.value:Oo.textContent,ia=!0)),Re=wf(oe,Qe),0<Re.length&&(Qe=new O1(Qe,o,null,l,he),ye.push({event:Qe,listeners:Re}),He?Qe.data=He:(He=T1(l),He!==null&&(Qe.data=He)))),(He=N3?M3(o,l):R3(o,l))&&(Qe=wf(oe,"onBeforeInput"),0<Qe.length&&(Re=new O1("onBeforeInput","beforeinput",null,l,he),ye.push({event:Re,listeners:Qe}),Re.data=He)),_z(ye,o,oe,l,he)}yS(ye,s)})}function Nc(o,s,l){return{instance:o,listener:s,currentTarget:l}}function wf(o,s){for(var l=s+"Capture",d=[];o!==null;){var g=o,b=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||b===null||(g=Xl(o,l),g!=null&&d.unshift(Nc(o,g,b)),g=Xl(o,s),g!=null&&d.push(Nc(o,g,b))),o.tag===3)return d;o=o.return}return[]}function Oz(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function vS(o,s,l,d,g){for(var b=s._reactName,E=[];l!==null&&l!==d;){var R=l,V=R.alternate,oe=R.stateNode;if(R=R.tag,V!==null&&V===d)break;R!==5&&R!==26&&R!==27||oe===null||(V=oe,g?(oe=Xl(l,b),oe!=null&&E.unshift(Nc(l,oe,V))):g||(oe=Xl(l,b),oe!=null&&E.push(Nc(l,oe,V)))),l=l.return}E.length!==0&&o.push({event:s,listeners:E})}var Az=/\r\n?/g,Cz=/\u0000|\uFFFD/g;function xS(o){return(typeof o=="string"?o:""+o).replace(Az,`
|
|
49
|
-
`).replace(Cz,"")}function wS(o,s){return s=xS(s),xS(o)===s}function ht(o,s,l,d,g,b){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||na(o,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&na(o,""+d);break;case"className":Sd(o,"class",d);break;case"tabIndex":Sd(o,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Sd(o,l,d);break;case"style":w1(o,d,b);break;case"data":if(s!=="object"){Sd(o,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||l!=="href")){o.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){o.removeAttribute(l);break}d=jd(""+d),o.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){o.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(l==="formAction"?(s!=="input"&&ht(o,s,"name",g.name,g,null),ht(o,s,"formEncType",g.formEncType,g,null),ht(o,s,"formMethod",g.formMethod,g,null),ht(o,s,"formTarget",g.formTarget,g,null)):(ht(o,s,"encType",g.encType,g,null),ht(o,s,"method",g.method,g,null),ht(o,s,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){o.removeAttribute(l);break}d=jd(""+d),o.setAttribute(l,d);break;case"onClick":d!=null&&(o.onclick=Ir);break;case"onScroll":d!=null&&Ge("scroll",o);break;case"onScrollEnd":d!=null&&Ge("scrollend",o);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(r(60));o.innerHTML=l}}break;case"multiple":o.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":o.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){o.removeAttribute("xlink:href");break}l=jd(""+d),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?o.setAttribute(l,""+d):o.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?o.setAttribute(l,""):o.removeAttribute(l);break;case"capture":case"download":d===!0?o.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?o.setAttribute(l,d):o.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?o.setAttribute(l,d):o.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?o.removeAttribute(l):o.setAttribute(l,d);break;case"popover":Ge("beforetoggle",o),Ge("toggle",o),_d(o,"popover",d);break;case"xlinkActuate":Lr(o,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Lr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Lr(o,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Lr(o,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Lr(o,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Lr(o,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Lr(o,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Lr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Lr(o,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":_d(o,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=r3.get(l)||l,_d(o,l,d))}}function ny(o,s,l,d,g,b){switch(l){case"style":w1(o,d,b);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(r(60));o.innerHTML=l}}break;case"children":typeof d=="string"?na(o,d):(typeof d=="number"||typeof d=="bigint")&&na(o,""+d);break;case"onScroll":d!=null&&Ge("scroll",o);break;case"onScrollEnd":d!=null&&Ge("scrollend",o);break;case"onClick":d!=null&&(o.onclick=Ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!f1.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),s=l.slice(2,g?l.length-7:void 0),b=o[Pe]||null,b=b!=null?b[l]:null,typeof b=="function"&&o.removeEventListener(s,b,g),typeof d=="function")){typeof b!="function"&&b!==null&&(l in o?o[l]=null:o.hasAttribute(l)&&o.removeAttribute(l)),o.addEventListener(s,d,g);break e}l in o?o[l]=d:d===!0?o.setAttribute(l,""):_d(o,l,d)}}}function an(o,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",o),Ge("load",o);var d=!1,g=!1,b;for(b in l)if(l.hasOwnProperty(b)){var E=l[b];if(E!=null)switch(b){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:ht(o,s,b,E,l,null)}}g&&ht(o,s,"srcSet",l.srcSet,l,null),d&&ht(o,s,"src",l.src,l,null);return;case"input":Ge("invalid",o);var R=b=E=g=null,V=null,oe=null;for(d in l)if(l.hasOwnProperty(d)){var he=l[d];if(he!=null)switch(d){case"name":g=he;break;case"type":E=he;break;case"checked":V=he;break;case"defaultChecked":oe=he;break;case"value":b=he;break;case"defaultValue":R=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,s));break;default:ht(o,s,d,he,l,null)}}y1(o,b,R,V,oe,E,g,!1);return;case"select":Ge("invalid",o),d=E=b=null;for(g in l)if(l.hasOwnProperty(g)&&(R=l[g],R!=null))switch(g){case"value":b=R;break;case"defaultValue":E=R;break;case"multiple":d=R;default:ht(o,s,g,R,l,null)}s=b,l=E,o.multiple=!!d,s!=null?ta(o,!!d,s,!1):l!=null&&ta(o,!!d,l,!0);return;case"textarea":Ge("invalid",o),b=g=d=null;for(E in l)if(l.hasOwnProperty(E)&&(R=l[E],R!=null))switch(E){case"value":d=R;break;case"defaultValue":g=R;break;case"children":b=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:ht(o,s,E,R,l,null)}v1(o,d,g,b);return;case"option":for(V in l)if(l.hasOwnProperty(V)&&(d=l[V],d!=null))switch(V){case"selected":o.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ht(o,s,V,d,l,null)}return;case"dialog":Ge("beforetoggle",o),Ge("toggle",o),Ge("cancel",o),Ge("close",o);break;case"iframe":case"object":Ge("load",o);break;case"video":case"audio":for(d=0;d<Cc.length;d++)Ge(Cc[d],o);break;case"image":Ge("error",o),Ge("load",o);break;case"details":Ge("toggle",o);break;case"embed":case"source":case"link":Ge("error",o),Ge("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in l)if(l.hasOwnProperty(oe)&&(d=l[oe],d!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:ht(o,s,oe,d,l,null)}return;default:if(gm(s)){for(he in l)l.hasOwnProperty(he)&&(d=l[he],d!==void 0&&ny(o,s,he,d,l,void 0));return}}for(R in l)l.hasOwnProperty(R)&&(d=l[R],d!=null&&ht(o,s,R,d,l,null))}function Nz(o,s,l,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,b=null,E=null,R=null,V=null,oe=null,he=null;for(ue in l){var ye=l[ue];if(l.hasOwnProperty(ue)&&ye!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":V=ye;default:d.hasOwnProperty(ue)||ht(o,s,ue,null,d,ye)}}for(var ae in d){var ue=d[ae];if(ye=l[ae],d.hasOwnProperty(ae)&&(ue!=null||ye!=null))switch(ae){case"type":b=ue;break;case"name":g=ue;break;case"checked":oe=ue;break;case"defaultChecked":he=ue;break;case"value":E=ue;break;case"defaultValue":R=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:ue!==ye&&ht(o,s,ae,ue,d,ye)}}pm(o,E,R,V,oe,he,b,g);return;case"select":ue=E=R=ae=null;for(b in l)if(V=l[b],l.hasOwnProperty(b)&&V!=null)switch(b){case"value":break;case"multiple":ue=V;default:d.hasOwnProperty(b)||ht(o,s,b,null,d,V)}for(g in d)if(b=d[g],V=l[g],d.hasOwnProperty(g)&&(b!=null||V!=null))switch(g){case"value":ae=b;break;case"defaultValue":R=b;break;case"multiple":E=b;default:b!==V&&ht(o,s,g,b,d,V)}s=R,l=E,d=ue,ae!=null?ta(o,!!l,ae,!1):!!d!=!!l&&(s!=null?ta(o,!!l,s,!0):ta(o,!!l,l?[]:"",!1));return;case"textarea":ue=ae=null;for(R in l)if(g=l[R],l.hasOwnProperty(R)&&g!=null&&!d.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:ht(o,s,R,null,d,g)}for(E in d)if(g=d[E],b=l[E],d.hasOwnProperty(E)&&(g!=null||b!=null))switch(E){case"value":ae=g;break;case"defaultValue":ue=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==b&&ht(o,s,E,g,d,b)}b1(o,ae,ue);return;case"option":for(var Ce in l)if(ae=l[Ce],l.hasOwnProperty(Ce)&&ae!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":o.selected=!1;break;default:ht(o,s,Ce,null,d,ae)}for(V in d)if(ae=d[V],ue=l[V],d.hasOwnProperty(V)&&ae!==ue&&(ae!=null||ue!=null))switch(V){case"selected":o.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:ht(o,s,V,ae,d,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in l)ae=l[De],l.hasOwnProperty(De)&&ae!=null&&!d.hasOwnProperty(De)&&ht(o,s,De,null,d,ae);for(oe in d)if(ae=d[oe],ue=l[oe],d.hasOwnProperty(oe)&&ae!==ue&&(ae!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:ht(o,s,oe,ae,d,ue)}return;default:if(gm(s)){for(var pt in l)ae=l[pt],l.hasOwnProperty(pt)&&ae!==void 0&&!d.hasOwnProperty(pt)&&ny(o,s,pt,void 0,d,ae);for(he in d)ae=d[he],ue=l[he],!d.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||ny(o,s,he,ae,d,ue);return}}for(var te in l)ae=l[te],l.hasOwnProperty(te)&&ae!=null&&!d.hasOwnProperty(te)&&ht(o,s,te,null,d,ae);for(ye in d)ae=d[ye],ue=l[ye],!d.hasOwnProperty(ye)||ae===ue||ae==null&&ue==null||ht(o,s,ye,ae,d,ue)}function kS(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mz(){if(typeof performance.getEntriesByType=="function"){for(var o=0,s=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var g=l[d],b=g.transferSize,E=g.initiatorType,R=g.duration;if(b&&R&&kS(E)){for(E=0,R=g.responseEnd,d+=1;d<l.length;d++){var V=l[d],oe=V.startTime;if(oe>R)break;var he=V.transferSize,ye=V.initiatorType;he&&kS(ye)&&(V=V.responseEnd,E+=he*(V<R?1:(R-oe)/(V-oe)))}if(--d,s+=8*(b+E)/(g.duration/1e3),o++,10<o)break}}if(0<o)return s/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var ry=null,oy=null;function kf(o){return o.nodeType===9?o:o.ownerDocument}function _S(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function SS(o,s){if(o===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&s==="foreignObject"?0:o}function iy(o,s){return o==="textarea"||o==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var sy=null;function Rz(){var o=window.event;return o&&o.type==="popstate"?o===sy?!1:(sy=o,!0):(sy=null,!1)}var ES=typeof setTimeout=="function"?setTimeout:void 0,Tz=typeof clearTimeout=="function"?clearTimeout:void 0,jS=typeof Promise=="function"?Promise:void 0,$z=typeof queueMicrotask=="function"?queueMicrotask:typeof jS<"u"?function(o){return jS.resolve(null).then(o).catch(zz)}:ES;function zz(o){setTimeout(function(){throw o})}function qo(o){return o==="head"}function OS(o,s){var l=s,d=0;do{var g=l.nextSibling;if(o.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(d===0){o.removeChild(g),Ta(s);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Mc(o.ownerDocument.documentElement);else if(l==="head"){l=o.ownerDocument.head,Mc(l);for(var b=l.firstChild;b;){var E=b.nextSibling,R=b.nodeName;b[Yl]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=E}}else l==="body"&&Mc(o.ownerDocument.body);l=g}while(l);Ta(s)}function AS(o,s){var l=o;o=0;do{var d=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(o===0)break;o--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||o++;l=d}while(l)}function ay(o){var s=o.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ay(l),fm(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}o.removeChild(l)}}function Dz(o,s,l,d){for(;o.nodeType===1;){var g=l;if(o.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(d){if(!o[Yl])switch(s){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(b=o.getAttribute("rel"),b==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(b!==g.rel||o.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||o.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||o.getAttribute("title")!==(g.title==null?null:g.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(b=o.getAttribute("src"),(b!==(g.src==null?null:g.src)||o.getAttribute("type")!==(g.type==null?null:g.type)||o.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&b&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(s==="input"&&o.type==="hidden"){var b=g.name==null?null:""+g.name;if(g.type==="hidden"&&o.getAttribute("name")===b)return o}else return o;if(o=rr(o.nextSibling),o===null)break}return null}function Lz(o,s,l){if(s==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=rr(o.nextSibling),o===null))return null;return o}function CS(o,s){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!s||(o=rr(o.nextSibling),o===null))return null;return o}function ly(o){return o.data==="$?"||o.data==="$~"}function cy(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function Iz(o,s){var l=o.ownerDocument;if(o.data==="$~")o._reactRetry=s;else if(o.data!=="$?"||l.readyState!=="loading")s();else{var d=function(){s(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),o._reactRetry=d}}function rr(o){for(;o!=null;o=o.nextSibling){var s=o.nodeType;if(s===1||s===3)break;if(s===8){if(s=o.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return o}var uy=null;function NS(o){o=o.nextSibling;for(var s=0;o;){if(o.nodeType===8){var l=o.data;if(l==="/$"||l==="/&"){if(s===0)return rr(o.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}o=o.nextSibling}return null}function MS(o){o=o.previousSibling;for(var s=0;o;){if(o.nodeType===8){var l=o.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return o;s--}else l!=="/$"&&l!=="/&"||s++}o=o.previousSibling}return null}function RS(o,s,l){switch(s=kf(l),o){case"html":if(o=s.documentElement,!o)throw Error(r(452));return o;case"head":if(o=s.head,!o)throw Error(r(453));return o;case"body":if(o=s.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Mc(o){for(var s=o.attributes;s.length;)o.removeAttributeNode(s[0]);fm(o)}var or=new Map,TS=new Set;function _f(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var eo=B.d;B.d={f:Uz,r:Pz,D:Fz,C:Bz,L:Hz,m:qz,X:Zz,S:Vz,M:Kz};function Uz(){var o=eo.f(),s=pf();return o||s}function Pz(o){var s=Ws(o);s!==null&&s.tag===5&&s.type==="form"?Qk(s):eo.r(o)}var Na=typeof document>"u"?null:document;function $S(o,s,l){var d=Na;if(d&&typeof s=="string"&&s){var g=Qn(s);g='link[rel="'+o+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),TS.has(g)||(TS.add(g),o={rel:o,crossOrigin:l,href:s},d.querySelector(g)===null&&(s=d.createElement("link"),an(s,"link",o),Xt(s),d.head.appendChild(s)))}}function Fz(o){eo.D(o),$S("dns-prefetch",o,null)}function Bz(o,s){eo.C(o,s),$S("preconnect",o,s)}function Hz(o,s,l){eo.L(o,s,l);var d=Na;if(d&&o&&s){var g='link[rel="preload"][as="'+Qn(s)+'"]';s==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+Qn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+Qn(l.imageSizes)+'"]')):g+='[href="'+Qn(o)+'"]';var b=g;switch(s){case"style":b=Ma(o);break;case"script":b=Ra(o)}or.has(b)||(o=m({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:o,as:s},l),or.set(b,o),d.querySelector(g)!==null||s==="style"&&d.querySelector(Rc(b))||s==="script"&&d.querySelector(Tc(b))||(s=d.createElement("link"),an(s,"link",o),Xt(s),d.head.appendChild(s)))}}function qz(o,s){eo.m(o,s);var l=Na;if(l&&o){var d=s&&typeof s.as=="string"?s.as:"script",g='link[rel="modulepreload"][as="'+Qn(d)+'"][href="'+Qn(o)+'"]',b=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ra(o)}if(!or.has(b)&&(o=m({rel:"modulepreload",href:o},s),or.set(b,o),l.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Tc(b)))return}d=l.createElement("link"),an(d,"link",o),Xt(d),l.head.appendChild(d)}}}function Vz(o,s,l){eo.S(o,s,l);var d=Na;if(d&&o){var g=Js(d).hoistableStyles,b=Ma(o);s=s||"default";var E=g.get(b);if(!E){var R={loading:0,preload:null};if(E=d.querySelector(Rc(b)))R.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":s},l),(l=or.get(b))&&dy(o,l);var V=E=d.createElement("link");Xt(V),an(V,"link",o),V._p=new Promise(function(oe,he){V.onload=oe,V.onerror=he}),V.addEventListener("load",function(){R.loading|=1}),V.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Sf(E,s,d)}E={type:"stylesheet",instance:E,count:1,state:R},g.set(b,E)}}}function Zz(o,s){eo.X(o,s);var l=Na;if(l&&o){var d=Js(l).hoistableScripts,g=Ra(o),b=d.get(g);b||(b=l.querySelector(Tc(g)),b||(o=m({src:o,async:!0},s),(s=or.get(g))&&fy(o,s),b=l.createElement("script"),Xt(b),an(b,"link",o),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(g,b))}}function Kz(o,s){eo.M(o,s);var l=Na;if(l&&o){var d=Js(l).hoistableScripts,g=Ra(o),b=d.get(g);b||(b=l.querySelector(Tc(g)),b||(o=m({src:o,async:!0,type:"module"},s),(s=or.get(g))&&fy(o,s),b=l.createElement("script"),Xt(b),an(b,"link",o),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(g,b))}}function zS(o,s,l,d){var g=(g=fe.current)?_f(g):null;if(!g)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Ma(l.href),l=Js(g).hoistableStyles,d=l.get(s),d||(d={type:"style",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){o=Ma(l.href);var b=Js(g).hoistableStyles,E=b.get(o);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(o,E),(b=g.querySelector(Rc(o)))&&!b._p&&(E.instance=b,E.state.loading=5),or.has(o)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},or.set(o,l),b||Gz(g,o,l,E.state))),s&&d===null)throw Error(r(528,""));return E}if(s&&d!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ra(l),l=Js(g).hoistableScripts,d=l.get(s),d||(d={type:"script",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Ma(o){return'href="'+Qn(o)+'"'}function Rc(o){return'link[rel="stylesheet"]['+o+"]"}function DS(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function Gz(o,s,l,d){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=o.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),an(s,"link",l),Xt(s),o.head.appendChild(s))}function Ra(o){return'[src="'+Qn(o)+'"]'}function Tc(o){return"script[async]"+o}function LS(o,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=o.querySelector('style[data-href~="'+Qn(l.href)+'"]');if(d)return s.instance=d,Xt(d),d;var g=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(o.ownerDocument||o).createElement("style"),Xt(d),an(d,"style",g),Sf(d,l.precedence,o),s.instance=d;case"stylesheet":g=Ma(l.href);var b=o.querySelector(Rc(g));if(b)return s.state.loading|=4,s.instance=b,Xt(b),b;d=DS(l),(g=or.get(g))&&dy(d,g),b=(o.ownerDocument||o).createElement("link"),Xt(b);var E=b;return E._p=new Promise(function(R,V){E.onload=R,E.onerror=V}),an(b,"link",d),s.state.loading|=4,Sf(b,l.precedence,o),s.instance=b;case"script":return b=Ra(l.src),(g=o.querySelector(Tc(b)))?(s.instance=g,Xt(g),g):(d=l,(g=or.get(b))&&(d=m({},l),fy(d,g)),o=o.ownerDocument||o,g=o.createElement("script"),Xt(g),an(g,"link",d),o.head.appendChild(g),s.instance=g);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Sf(d,l.precedence,o));return s.instance}function Sf(o,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,b=g,E=0;E<d.length;E++){var R=d[E];if(R.dataset.precedence===s)b=R;else if(b!==g)break}b?b.parentNode.insertBefore(o,b.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(o,s.firstChild))}function dy(o,s){o.crossOrigin==null&&(o.crossOrigin=s.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=s.referrerPolicy),o.title==null&&(o.title=s.title)}function fy(o,s){o.crossOrigin==null&&(o.crossOrigin=s.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=s.referrerPolicy),o.integrity==null&&(o.integrity=s.integrity)}var Ef=null;function IS(o,s,l){if(Ef===null){var d=new Map,g=Ef=new Map;g.set(l,d)}else g=Ef,d=g.get(l),d||(d=new Map,g.set(l,d));if(d.has(o))return d;for(d.set(o,null),l=l.getElementsByTagName(o),g=0;g<l.length;g++){var b=l[g];if(!(b[Yl]||b[Ze]||o==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(s)||"";E=o+E;var R=d.get(E);R?R.push(b):d.set(E,[b])}}return d}function US(o,s,l){o=o.ownerDocument||o,o.head.insertBefore(l,s==="title"?o.querySelector("head > title"):null)}function Yz(o,s,l){if(l===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function PS(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function Qz(o,s,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Ma(d.href),b=s.querySelector(Rc(g));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(o.count++,o=jf.bind(o),s.then(o,o)),l.state.loading|=4,l.instance=b,Xt(b);return}b=s.ownerDocument||s,d=DS(d),(g=or.get(g))&&dy(d,g),b=b.createElement("link"),Xt(b);var E=b;E._p=new Promise(function(R,V){E.onload=R,E.onerror=V}),an(b,"link",d),l.instance=b}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(o.count++,l=jf.bind(o),s.addEventListener("load",l),s.addEventListener("error",l))}}var hy=0;function Xz(o,s){return o.stylesheets&&o.count===0&&Af(o,o.stylesheets),0<o.count||0<o.imgCount?function(l){var d=setTimeout(function(){if(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend){var b=o.unsuspend;o.unsuspend=null,b()}},6e4+s);0<o.imgBytes&&hy===0&&(hy=62500*Mz());var g=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend)){var b=o.unsuspend;o.unsuspend=null,b()}},(o.imgBytes>hy?50:800)+s);return o.unsuspend=l,function(){o.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Af(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Of=null;function Af(o,s){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Of=new Map,s.forEach(Wz,o),Of=null,jf.call(o))}function Wz(o,s){if(!(s.state.loading&4)){var l=Of.get(o);if(l)var d=l.get(null);else{l=new Map,Of.set(o,l);for(var g=o.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<g.length;b++){var E=g[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(l.set(E.dataset.precedence,E),d=E)}d&&l.set(null,d)}g=s.instance,E=g.getAttribute("data-precedence"),b=l.get(E)||d,b===d&&l.set(null,g),l.set(E,g),this.count++,d=jf.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),b?b.parentNode.insertBefore(g,b.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(g,o.firstChild)),s.state.loading|=4}}var $c={$$typeof:A,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function Jz(o,s,l,d,g,b,E,R,V){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ql(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ql(0),this.hiddenUpdates=ql(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function FS(o,s,l,d,g,b,E,R,V,oe,he,ye){return o=new Jz(o,s,l,E,V,oe,he,ye,R),s=1,b===!0&&(s|=24),b=In(3,null,null,s),o.current=b,b.stateNode=o,s=Zm(),s.refCount++,o.pooledCache=s,s.refCount++,b.memoizedState={element:d,isDehydrated:l,cache:s},Qm(b),o}function BS(o){return o?(o=ca,o):ca}function HS(o,s,l,d,g,b){g=BS(g),d.context===null?d.context=g:d.pendingContext=g,d=To(s),d.payload={element:l},b=b===void 0?null:b,b!==null&&(d.callback=b),l=$o(o,d,s),l!==null&&(An(l,o,s),fc(l,o,s))}function qS(o,s){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var l=o.retryLane;o.retryLane=l!==0&&l<s?l:s}}function py(o,s){qS(o,s),(o=o.alternate)&&qS(o,s)}function VS(o){if(o.tag===13||o.tag===31){var s=Ui(o,67108864);s!==null&&An(s,o,67108864),py(o,67108864)}}function ZS(o){if(o.tag===13||o.tag===31){var s=Hn();s=Kl(s);var l=Ui(o,s);l!==null&&An(l,o,s),py(o,s)}}var Cf=!0;function eD(o,s,l,d){var g=M.T;M.T=null;var b=B.p;try{B.p=2,my(o,s,l,d)}finally{B.p=b,M.T=g}}function tD(o,s,l,d){var g=M.T;M.T=null;var b=B.p;try{B.p=8,my(o,s,l,d)}finally{B.p=b,M.T=g}}function my(o,s,l,d){if(Cf){var g=gy(d);if(g===null)ty(o,s,d,Nf,l),GS(o,d);else if(rD(g,o,s,l,d))d.stopPropagation();else if(GS(o,d),s&4&&-1<nD.indexOf(o)){for(;g!==null;){var b=Ws(g);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=br(b.pendingLanes);if(E!==0){var R=b;for(R.pendingLanes|=2,R.entangledLanes|=2;E;){var V=1<<31-dn(E);R.entanglements[1]|=V,E&=~V}_r(b),(st&6)===0&&(ff=xt()+500,Ac(0))}}break;case 31:case 13:R=Ui(b,2),R!==null&&An(R,b,2),pf(),py(b,2)}if(b=gy(d),b===null&&ty(o,s,d,Nf,l),b===g)break;g=b}g!==null&&d.stopPropagation()}else ty(o,s,d,null,l)}}function gy(o){return o=bm(o),yy(o)}var Nf=null;function yy(o){if(Nf=null,o=Xs(o),o!==null){var s=a(o);if(s===null)o=null;else{var l=s.tag;if(l===13){if(o=c(s),o!==null)return o;o=null}else if(l===31){if(o=u(s),o!==null)return o;o=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;o=null}else s!==o&&(o=null)}}return Nf=o,null}function KS(o){switch(o){case"beforetoggle":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"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jo()){case qs:return 2;case Ri:return 8;case ke:case Le:return 32;case Je:return 268435456;default:return 32}default:return 32}}var by=!1,Vo=null,Zo=null,Ko=null,zc=new Map,Dc=new Map,Go=[],nD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function GS(o,s){switch(o){case"focusin":case"focusout":Vo=null;break;case"dragenter":case"dragleave":Zo=null;break;case"mouseover":case"mouseout":Ko=null;break;case"pointerover":case"pointerout":zc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dc.delete(s.pointerId)}}function Lc(o,s,l,d,g,b){return o===null||o.nativeEvent!==b?(o={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:b,targetContainers:[g]},s!==null&&(s=Ws(s),s!==null&&VS(s)),o):(o.eventSystemFlags|=d,s=o.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),o)}function rD(o,s,l,d,g){switch(s){case"focusin":return Vo=Lc(Vo,o,s,l,d,g),!0;case"dragenter":return Zo=Lc(Zo,o,s,l,d,g),!0;case"mouseover":return Ko=Lc(Ko,o,s,l,d,g),!0;case"pointerover":var b=g.pointerId;return zc.set(b,Lc(zc.get(b)||null,o,s,l,d,g)),!0;case"gotpointercapture":return b=g.pointerId,Dc.set(b,Lc(Dc.get(b)||null,o,s,l,d,g)),!0}return!1}function YS(o){var s=Xs(o.target);if(s!==null){var l=a(s);if(l!==null){if(s=l.tag,s===13){if(s=c(l),s!==null){o.blockedOn=s,Se(o.priority,function(){ZS(l)});return}}else if(s===31){if(s=u(l),s!==null){o.blockedOn=s,Se(o.priority,function(){ZS(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){o.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Mf(o){if(o.blockedOn!==null)return!1;for(var s=o.targetContainers;0<s.length;){var l=gy(o.nativeEvent);if(l===null){l=o.nativeEvent;var d=new l.constructor(l.type,l);ym=d,l.target.dispatchEvent(d),ym=null}else return s=Ws(l),s!==null&&VS(s),o.blockedOn=l,!1;s.shift()}return!0}function QS(o,s,l){Mf(o)&&l.delete(s)}function oD(){by=!1,Vo!==null&&Mf(Vo)&&(Vo=null),Zo!==null&&Mf(Zo)&&(Zo=null),Ko!==null&&Mf(Ko)&&(Ko=null),zc.forEach(QS),Dc.forEach(QS)}function Rf(o,s){o.blockedOn===s&&(o.blockedOn=null,by||(by=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,oD)))}var Tf=null;function XS(o){Tf!==o&&(Tf=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tf===o&&(Tf=null);for(var s=0;s<o.length;s+=3){var l=o[s],d=o[s+1],g=o[s+2];if(typeof d!="function"){if(yy(d||l)===null)continue;break}var b=Ws(l);b!==null&&(o.splice(s,3),s-=3,gg(b,{pending:!0,data:g,method:l.method,action:d},d,g))}}))}function Ta(o){function s(V){return Rf(V,o)}Vo!==null&&Rf(Vo,o),Zo!==null&&Rf(Zo,o),Ko!==null&&Rf(Ko,o),zc.forEach(s),Dc.forEach(s);for(var l=0;l<Go.length;l++){var d=Go[l];d.blockedOn===o&&(d.blockedOn=null)}for(;0<Go.length&&(l=Go[0],l.blockedOn===null);)YS(l),l.blockedOn===null&&Go.shift();if(l=(o.ownerDocument||o).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var g=l[d],b=l[d+1],E=g[Pe]||null;if(typeof b=="function")E||XS(l);else if(E){var R=null;if(b&&b.hasAttribute("formAction")){if(g=b,E=b[Pe]||null)R=E.formAction;else if(yy(g)!==null)continue}else R=E.action;typeof R=="function"?l[d+1]=R:(l.splice(d,3),d-=3),XS(l)}}}function WS(){function o(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function s(){g!==null&&(g(),g=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),g!==null&&(g(),g=null)}}}function vy(o){this._internalRoot=o}$f.prototype.render=vy.prototype.render=function(o){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,d=Hn();HS(l,d,o,s,null,null)},$f.prototype.unmount=vy.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var s=o.containerInfo;HS(o.current,2,null,o,null,null),pf(),s[vr]=null}};function $f(o){this._internalRoot=o}$f.prototype.unstable_scheduleHydration=function(o){if(o){var s=ie();o={blockedOn:null,target:o,priority:s};for(var l=0;l<Go.length&&s!==0&&s<Go[l].priority;l++);Go.splice(l,0,o),l===0&&YS(o)}};var JS=t.version;if(JS!=="19.2.6")throw Error(r(527,JS,"19.2.6"));B.findDOMNode=function(o){var s=o._reactInternals;if(s===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=p(s),o=o!==null?y(o):null,o=o===null?null:o.stateNode,o};var iD={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zf.isDisabled&&zf.supportsFiber)try{Ut=zf.inject(iD),yt=zf}catch{}}return Uc.createRoot=function(o,s){if(!i(o))throw Error(r(299));var l=!1,d="",g=s_,b=a_,E=l_;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),s=FS(o,1,!1,null,null,l,d,null,g,b,E,WS),o[vr]=s.current,ey(o),new vy(s)},Uc.hydrateRoot=function(o,s,l){if(!i(o))throw Error(r(299));var d=!1,g="",b=s_,E=a_,R=l_,V=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError),l.formState!==void 0&&(V=l.formState)),s=FS(o,1,!0,s,l??null,d,g,V,b,E,R,WS),s.context=BS(null),l=s.current,d=Hn(),d=Kl(d),g=To(d),g.callback=null,$o(l,g,d),l=d,s.current.lanes=l,$i(s,l),_r(s),o[vr]=s.current,ey(o),new $f(s)},Uc.version="19.2.6",Uc}var u2;function mD(){if(u2)return _y.exports;u2=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(),_y.exports=pD(),_y.exports}var gD=mD();const yD=6,rs=12,bD=288,vD='[aria-modal="true"]',xD=".hp-sb-scroll";function _s(e){var c,u;const t=window.innerWidth,n=window.innerHeight,r=(c=e.closest(vD))==null?void 0:c.getBoundingClientRect(),i=r||(u=e.closest(xD))==null?void 0:u.getBoundingClientRect(),a=r?{top:Math.max(0,r.top),left:Math.max(0,r.left),right:Math.min(t,r.right),bottom:Math.min(n,r.bottom)}:i?{top:Math.max(0,i.top),left:0,right:t,bottom:Math.min(n,i.bottom)}:{top:0,left:0,right:t,bottom:n};return{rect:e.getBoundingClientRect(),bounds:a,viewportHeight:n,viewportWidth:t}}function Cl({rect:e,bounds:t,viewportHeight:n},{maxHeight:r=bD,minWidth:i=0,gap:a=yD,height:c}={}){if(e.bottom<t.top||e.top>t.bottom||e.right<t.left||e.left>t.right)return null;const u=t.bottom-e.bottom-a-rs,f=e.top-t.top-a-rs,p=c??Math.min(r,220),y=u<p&&f>u,x=Math.max(0,Math.min(r,y?f:u)),v=Math.max(t.left+rs,Math.min(e.left,t.right-Math.max(e.width,i)-rs)),_={left:v,width:e.width,maxWidth:Math.max(e.width,i,t.right-v-rs),maxHeight:x};return y?{..._,bottom:n-e.top+a}:{..._,top:e.bottom+a}}function wD(e,t,n){const[r,i]=w.useState(null);return w.useEffect(()=>{if(!e)return;const a=()=>{const u=t.current;u&&i(_s(u))},c=requestAnimationFrame(a);return window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),()=>{cancelAnimationFrame(c),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a)}},[e,t]),!e||!r?null:Cl(r,n)}const OA=Symbol.for("@homepages/concrete:row:of"),AA=Symbol.for("@homepages/concrete:element:of");function r0(e){return typeof e=="object"&&e!==null&&e.kind==="sibling"&&zn(e.of)}function kD(e,t){return e===t||Gt(e)&&Gt(t)&&e.key===t.key}function CA(e,t){const n=[...e];for(const r of t??[])n.some(i=>kD(i,r))||n.push(r);return n}function Ds(e){return typeof e=="object"&&e!==null&&"section"in e&&typeof e.section=="string"&&"slot"in e&&typeof e.slot=="string"}function o0(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="row"&&"field"in e&&typeof e.field=="string"}function Vu(e){if(!o0(e))return;const t=e[OA];return typeof t=="object"&&t!==null?t:void 0}function ho(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="element"}function _D(e){if(!ho(e))return;const t=e[AA];return typeof t=="object"&&t!==null?t:void 0}function Gt(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="home"&&"key"in e&&typeof e.key=="string"}function NA(e){return typeof e=="object"&&e!==null&&"head"in e&&typeof e.head=="object"&&"declaration"in e&&zn(e.declaration)}function zn(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}function SD(e){if(typeof e.slot!="string")throw new Error(`the row member "${e.field}" is read through a row that is not in scope — declare the row beside its reader (a field of the same object or item) or at the top level, and read its member there.`);return{kind:"row",slot:e.slot,field:e.field}}function ED(e){return{kind:"section",section:e.section,slot:e.slot}}function jD(e){return Ds(e)?ED(e):o0(e)?SD(e):ho(e)?{kind:"element"}:{kind:"home",key:e.key}}function OD(e){return e.kind==="section"}function Oy(e,t){if(typeof e=="function")return{kind:"compute",fn:e,reads:[]};const n=t;if(e.requires===void 0)return{kind:"compute",fn:n,reads:[...e.reads]};if(!Array.isArray(e.requires)||e.requires.length===0)throw new Error("compute(): `requires` names at least one read — omit it when the value needs none.");return{kind:"compute",fn:n,reads:CA(e.reads,e.requires),requires:[...e.requires]}}function gi(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="compute"&&"fn"in e&&typeof e.fn=="function"}function Zu(e){return typeof e=="object"&&e!==null&&e.kind==="compute"&&typeof e.fn=="function"}function AD(e,t){const n=e.kind;if(n==="home"&&"key"in e&&typeof e.key=="string")return t.facts[e.key.slice(e.key.indexOf(".")+1)]??null;if(n==="item"&&"field"in e&&typeof e.field=="string"){if(t.row===void 0)throw new Error(`a registry compute reads the member "${e.field}" of an item, outside any item`);return t.row[e.field]??null}throw new Error(`a registry compute carries a read of kind "${String(n)}", which \`defineFacts\` never stores`)}function MA(e,t){return e.fn(...e.reads.map(n=>AD(n,t)))}function d2(e,t){return typeof e=="string"?e:MA(e,{facts:t})}function RA(e){return Zu(e.source)}const CD={write:new Set(["brief","reads","requires","none"]),pick:new Set(["brief","reads","requires","unique"]),find:new Set(["brief","reads","requires","none"])};function i0(e,t){const n=`fill.${e}()`;if(typeof t.brief!="string"||t.brief.trim()==="")throw new Error(`${n}: \`brief\` is required — it is the whole instruction the model is given.`);const r=CD[e],i={kind:"fill",verb:e};for(const[c,u]of Object.entries(t)){if(!r.has(c))throw new Error(`${n}: "${c}" is not an option — it takes ${[...r].map(f=>`\`${f}\``).join(", ")}, and everything the model should know goes in the brief.`);if(c==="none"&&u!==void 0&&u!==!0)throw new Error(`${n}: \`none\` is \`true\` or absent — it admits the empty answer, and the brief's last sentence says when nothing is right.`);if(c==="unique"&&u!==void 0&&typeof u!="boolean")throw new Error(`${n}: \`unique\` is a boolean — \`false\` lets a pick repeat an element.`);if(c==="requires"&&u!==void 0&&(!Array.isArray(u)||u.length===0))throw new Error(`${n}: \`requires\` names at least one read — omit it when the fill needs none.`);u!==void 0&&(i[c]=c==="reads"||c==="requires"?[...u]:u)}const a=i.requires;return a!==void 0&&(i.reads=CA(i.reads??[],a)),i}function ND(e){return i0("write",e)}function MD(e){return i0("pick",e)}function RD(e){return i0("find",e)}const Mr={write:ND,pick:MD,find:RD};function wi(e,t){if(Ss(e))return[e];if(!Array.isArray(e)||!e.every(i=>typeof i=="object"&&i!==null))return;if(e.length===0)throw new Error(`${t} declares \`source: []\` — a list of fills names at least one fill, and a holder nothing fills declares no \`source\`.`);const n=e.filter(i=>!Ss(i)).length;if(n===0)return e;const r=n<e.length?"a derivation beside a fill":n>1?"several derivations":"a derivation in a list";throw new Error(`${t}'s \`source\` lists ${r} — \`source\` takes one derivation (a fact, a slot, a row's member, the element, a \`compute()\`) or an ordered list of fills: a holder has one write path, and a derived value has no writer beside it.`)}function pp(e){return Ss(e)||Array.isArray(e)&&e.length>0&&e.every(Ss)}function Ss(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="fill"&&"verb"in e&&(e.verb==="write"||e.verb==="pick"||e.verb==="find")&&"brief"in e&&typeof e.brief=="string"}const s0=Symbol.for("@homepages/concrete:fill:declaration");function TD(e){return pp(e)?{[s0]:Ss(e)?[e]:[...e]}:{}}const $D=Symbol.for("@homepages/concrete:fill:section");function zD(e){return e==null?void 0:e[$D]}function mr(e){if(!(typeof e!="object"||e===null))return e[s0]}const DD=["Basement","Ground","1st floor","2nd floor","3rd floor","4th floor","Penthouse"],f2=["id","slot","index","def","value","present","enclosing"],vo=["image","video","tour","document"];function wn(e){return vo.includes(e)}function po(e){return e==="media"||wn(e)}const ki={cutout:{label:"Background removed",kinds:["image"],site:"holder",options:{enclosed:{required:!1,type:"string",values:["clear","keep"]}}},autocrop:{label:"Cropped to its subject",kinds:["image"],site:"holder",options:{brief:{required:!0,type:"string"}}},probe:{label:"Probed",kinds:["image","video","document"],site:"kind",options:{}},understand:{label:"Understood",kinds:["image","video","document","tour"],site:"kind",options:{}},preview:{label:"Preview",kinds:["image","video","document"],site:"kind",options:{}},ladder:{label:"Renditions",kinds:["image","video","document"],site:"kind",options:{}},transcode:{label:"Transcoded",kinds:["video"],site:"kind",options:{}},poster:{label:"Poster",kinds:["video","document"],site:"kind",options:{}},rasterize:{label:"Pages rasterized",kinds:["document"],site:"kind",options:{}},fetch:{label:"Link fetched",kinds:["video","tour"],site:"kind",options:{}},tour_details:{label:"Tour details",kinds:["tour"],site:"kind",options:{}},crop:{label:"Cut to its crop",kinds:["image"],site:"place",options:{}}},a0=Object.keys(ki),LD=a0.filter(e=>ki[e].site==="holder");a0.filter(e=>ki[e].site==="kind");function ID(e){return typeof e=="string"&&Object.hasOwn(ki,e)}function TA(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const{kind:t,verb:n}=e;return t==="process"&&ID(n)?e:null}function l0(e){const t=ki[e.verb],n=Object.keys(t.options),r=n.length>0?`it takes ${n.map(i=>`\`${i}\``).join(", ")}`:"it takes none";for(const[i,a]of Object.entries(e)){if(i==="kind"||i==="verb"||a===void 0)continue;if(i==="reads")return`\`${e.verb}\` takes no \`reads\` — a process is about one media value, never the property`;const c=t.options[i];if(c===void 0){const u=i==="aspect"&&e.verb==="autocrop"?"; its aspect is the holder's `crop` — the aspect it locks, free form where it locks none":"";return`\`${e.verb}\` takes no option "${i}" — ${r}${u}`}if(c.values!==void 0){if(typeof a!="string"||!c.values.includes(a))return`\`${e.verb}\`'s \`${i}\` is one of ${c.values.map(u=>`"${u}"`).join(", ")}`;continue}if(typeof a!==c.type||typeof a=="string"&&a.trim()==="")return`\`${e.verb}\`'s \`${i}\` is a non-empty ${c.type}`}for(const[i,a]of Object.entries(t.options))if(a.required&&e[i]===void 0)return`\`${e.verb}\` requires \`${i}\``;return null}function yi(e){const{type:t,kinds:n}=e;if(t==="media"){const r=Array.isArray(n)?n.filter(i=>typeof i=="string"&&wn(i)):[];return r.length>0?r:vo}return typeof t=="string"&&wn(t)?[t]:[]}function $A(e){const{kinds:t,process:n}=e;if(t!==void 0){if(e.type!=="media")return"declares `kinds` — only `media()` leaves its kind open; a kind's own builder fixes it";if(!Array.isArray(t)||t.length===0||!t.every(a=>typeof a=="string"&&wn(a)))return`declares \`kinds\` ${JSON.stringify(t)} — a non-empty list of ${vo.join(", ")}`}if(n===void 0)return null;const r=LD.map(a=>`process.${a}()`).join(", ");if(!Array.isArray(n)||n.length===0)return`declares \`process\` ${JSON.stringify(n)} — a non-empty list of processes (${r})`;const i=new Set;for(const a of n){const c=TA(a);if(c===null)return`processes ${JSON.stringify(a)}, which is no process (${r})`;const{verb:u}=c,f=ki[u];if(f.site==="kind")return`processes "${u}", which every ${f.kinds.join(", ")} gets from birth on its kind's row — never a holder's to declare`;if(f.site==="place")return`processes "${u}", which every ${f.kinds.join(", ")} place gets wherever its value carries a crop — never a holder's to declare`;if(i.has(u))return`processes "${u}" twice — a holder declares each process once`;i.add(u);const p=l0(c);if(p!==null)return`processes "${u}" with options that do not fit: ${p}`;const y=yi(e).filter(m=>!f.kinds.includes(m));if(y.length>0)return`processes "${u}", which applies to ${f.kinds.join(", ")} and not to ${y.join(", ")}`}return null}const UD=new Set(["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","text/csv"]);function zA(e){const t=(e.split(";")[0]??"").trim().toLowerCase();return t.startsWith("image/")?"image":t.startsWith("video/")?"video":UD.has(t)?"document":null}function DA(e){const t=Ku(e);if(t===null)return null;const n=_i[t].kind;return n==="tour"||n==="video"?n:null}const PD=["tour","video","social","listing","file","map"],_i={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},iguide:{kind:"tour",label:"iGUIDE",pattern:/(^|\.)youriguide\.com$/i,strategy:"opengraph"},kuula:{kind:"tour",label:"Kuula",pattern:/(^|\.)kuula\.co$/i,strategy:"opengraph"},momento360:{kind:"tour",label:"Momento360",pattern:/(^|\.)momento360\.com$/i,strategy:"opengraph"},cloudpano:{kind:"tour",label:"CloudPano",pattern:/(^|\.)cloudpano\.com$/i,strategy:"none"},asteroom:{kind:"tour",label:"Asteroom",pattern:/(^|\.)asteroom\.com$/i,strategy:"none"},zillow3d:{kind:"tour",label:"Zillow 3D Home",pattern:/(^|\.)zillow\.com$/i,path:/^\/view-3d-home\//i,strategy:"none"},youtube:{kind:"video",label:"YouTube",pattern:/(^|\.)(youtube\.com|youtu\.be)$/i,strategy:"oembed"},vimeo:{kind:"video",label:"Vimeo",pattern:/(^|\.)vimeo\.com$/i,strategy:"oembed"},zillow:{kind:"listing",label:"Zillow",pattern:/(^|\.)zillow\.com$/i,strategy:"none"},redfin:{kind:"listing",label:"Redfin",pattern:/(^|\.)redfin\.com$/i,strategy:"none"},dropbox:{kind:"file",label:"Dropbox",pattern:/(^|\.)dropbox\.com$/i,strategy:"none"},drive:{kind:"file",label:"Google Drive",pattern:/^drive\.google\.com$/i,strategy:"none"},maps:{kind:"map",label:"Google Maps",pattern:/(^|\.)google\.com$/i,path:/^\/maps(\/|$)/i,strategy:"none"}};function Ku(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:")return null;for(const[n,r]of Object.entries(_i))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}function FD(e,t){const n=Ku(t);return n===null?!1:n===e?!0:PD.includes(e)&&_i[n].kind===e}const BD=new Set(vo.filter(e=>Object.values(_i).some(t=>t.kind===e)));function c0(e){return e.filter(t=>BD.has(t))}function LA(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;const t=new Date(`${e}T00:00:00Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e}function HD(e){return typeof e=="string"&&/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/.test(e)}function qD(e){if(typeof e!="string"||!/^\+?[\d\s().-]+$/.test(e))return!1;const t=e.replace(/\D/g,"").length;return t>=7&&t<=15}function VD(e){try{return new URL(e)}catch{return null}}function nu(e){const t=e.trim();return t&&(/^https?:\/\//i.test(t)?t:`https://${t}`)}function u0(e){const t=VD(e);if(t===null||t.protocol!=="http:"&&t.protocol!=="https:"||t.username!==""||t.password!=="")return!1;const n=t.hostname;return n.includes(".")&&!n.startsWith(".")&&!n.endsWith(".")}function ZD(e){const t=e.trim();if(!t)return null;const n=Ku(t);if(n==="matterport"){const r=new URL(t).searchParams.get("m");return r!==null&&/^[A-Za-z0-9]+$/.test(r)?`https://my.matterport.com/show/?m=${r}&nt=1`:null}return n!==null&&KD.has(n)?t:null}const KD=new Set(["biganto","iguide","kuula","momento360","cloudpano","asteroom","zillow3d"]);function d0(e,t){return[e,t].map(n=>(n??"").trim()).filter(n=>n!=="").join(", ")}const GD=["autocomplete","manual_pinned","resolved"],IA=["street","unit","city","state","postal"],mp=[...IA,"latitude","longitude"];function gp(e){return mp.includes(e)}function Pc(e){if(typeof e!="string")return null;const t=e.trim();return t===""?null:t}function h2(e,t){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<=t?e:null}function en(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e,n=h2(t.latitude,90),r=h2(t.longitude,180),i=n!==null&&r!==null,a=t.source,c={street:Pc(t.street),unit:Pc(t.unit),city:Pc(t.city),state:Pc(t.state),postal:Pc(t.postal),latitude:i?n:null,longitude:i?r:null,source:typeof a=="string"&&GD.includes(a)?a:null};return i||IA.some(u=>c[u]!==null)?c:null}function YD(e){const t=en(e);return t===null||t.latitude===null?!1:t.street!==null&&t.city!==null&&t.state!==null&&t.postal!==null}function f0(e){var t;return((t=/^\s*(\d{5})-?\d{4}\s*$/.exec(e))==null?void 0:t[1])??e}function QD(e){const t=d0(e.street,e.unit),n=[e.state,e.postal===null?null:f0(e.postal)].filter(i=>i!==null).join(" "),r=[t,e.city??"",n].filter(i=>i!=="").join(", ");return r===""?null:r}function XD(e,t){const n=en(e);return n===null?null:n[t]}const UA=["crop","cutout","mask_white","mask_black"],WD=["master","crop","cutout","mask_white","mask_black","poster","encode"];function Ls(e){return e!==null&&!(e.x<=0&&e.y<=0&&e.width>=1&&e.height>=1)}function JD(e,t=e){return{id:t,file:e,crop:null,name:null,renditions:{crop:null,cutout:null,mask_white:null,mask_black:null}}}function eL(e){var t;return e.url!==null?e.url.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""):((t=e.key)==null?void 0:t.split("/").pop())??e.id}function tL(e,t){const{id:n,renditions:r,...i}=e,a=e.kind==="image";return{...i,id:t.id,file:t.file,crop:a?t.crop:null,name:t.name!==null&&t.name!==""?t.name:eL(e),renditions:{...r,crop:a?t.renditions.crop:null,cutout:a?t.renditions.cutout:null,mask_white:a?t.renditions.mask_white:null,mask_black:a?t.renditions.mask_black:null}}}function nL(e){const{id:t,file:n,crop:r,name:i,renditions:a,...c}=e,{crop:u,cutout:f,mask_white:p,mask_black:y,...m}=a;return{file:{...c,id:n,renditions:m},value:{id:t,file:n,crop:r,name:i,renditions:{crop:u,cutout:f,mask_white:p,mask_black:y}}}}function h0(e,t){return tL(e,t)}function rL(e){return e.url===null?"upload":"link"}function mo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yp(e){if(!mo(e))return!1;const{id:t,kind:n,renditions:r}=e;return typeof t=="string"&&typeof n=="string"&&wn(n)&&mo(r)}function Gu(e){return mo(e)&&typeof e.id=="string"&&typeof e.file=="string"&&mo(e.renditions)&&!("kind"in e)&&!("picked"in e)}function PA(e){return mo(e)&&typeof e.file=="string"&&e.file!==""&&!Gu(e)&&!yp(e)}function xo(e){return mo(e)&&typeof e.media=="string"&&e.media!==""}function Kn(e){if(mo(e)){if(xo(e))return e.media;if(Gu(e)||yp(e))return e.id;if(PA(e))return e.picked??e.file}}function oL(e){if(xo(e))return e.media;if(PA(e))return e.file}function vb(e,t){if(Array.isArray(e))for(const n of e)vb(n,t);else if(Gu(e))t.has(e.id)||t.set(e.id,e);else if(mo(e)&&!yp(e))for(const n of Object.values(e))vb(n,t)}function Nl(e){const t=new Map;for(const[n,r]of Object.entries(e))n!=="files"&&vb(r,t);return t}function iL(e){return Object.hasOwn(e,"crop")||e.renditions!==void 0}function sL(e,t){const n=Object.hasOwn(t,"crop"),r=t.renditions??{},i=n?null:e.renditions,a=Object.fromEntries(UA.map(c=>[c,Object.hasOwn(r,c)?r[c]??null:(i==null?void 0:i[c])??null]));return{crop:n?t.crop??null:e.crop,renditions:a}}function bp(e,t){return iL(t)?{...e,...sL({crop:e.crop,renditions:e.renditions},t)}:e}function wh(e){if(Array.isArray(e))return e.map(wh);if(!mo(e))return e;if(yp(e)||Gu(e))return{media:e.id};if(xo(e)){const{crop:n,renditions:r,...i}=e;return i}const t={};for(const[n,r]of Object.entries(e))t[n]=wh(r);return t}const kh="property.uploads";function wo(e){if(typeof e=="string"&&e!=="")return[e];if(!(!Array.isArray(e)||e.length===0||!e.every(t=>typeof t=="string"&&t!=="")))return[...e]}function pu(e){const t=yi(e);if(t.length===0)return null;const n=wo(e.from);return n===void 0?{kinds:t}:{kinds:t,from:n}}function mu(e){return{kinds:e.kinds,from:wo(e.from)??[kh]}}function FA(e){return mu(e).from[0]}function xb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function aL(e){if(Kn(e)!==void 0||!xb(e))return e;for(const t of Object.values(e))if(Kn(t)!==void 0)return t}function BA(e,t){const[n,...r]=t.split(".");if(n!=="property"||r.length===0)return null;let i=e;for(const a of r)if(i=Array.isArray(i)?i.find(c=>xb(c)&&c.id===a):xb(i)&&Object.hasOwn(i,a)?i[a]:void 0,i===void 0)return null;return Array.isArray(i)?i.flatMap(a=>{const c=aL(a),u=Kn(c);return u===void 0?[]:[{id:u,value:c}]}):null}function lL(e,t){const n=Nl(e),r=new Set,i=[];for(const a of wo(t.from)??[])for(const{id:c,value:u}of BA(e,a)??[]){if(r.has(c))continue;const f=n.get(c),p=f===void 0||!Object.hasOwn(e.files,f.file)?void 0:e.files[f.file];if(f===void 0||p===void 0||!t.kinds.includes(p.kind))continue;r.add(c);const y=xo(u)?bp(f,u):f;i.push({id:c,value:y,file:p,list:a})}return i}function cL(e,t){const n={uploads:(e[kh]??t.map(r=>r.id)).map(r=>JD(r))};for(const[r,i]of Object.entries(e)){const[a,c,...u]=r.split(".");if(a!=="property"||c===void 0||u.length>0)throw new Error(`media candidates: "${r}" names no top-level property list`);r!==kh&&(n[c]=i.map(f=>({media:f})))}return{...n,files:Object.fromEntries(t.map(r=>[r.id,r]))}}function uL(e,t){const n=new Map(t.map(a=>[a.id,nL(a)])),r=cL(e,[...n.values()].map(({file:a})=>a)),i=r.uploads.map(a=>{var c;return((c=n.get(a.id))==null?void 0:c.value)??a});return{...r,uploads:i}}function dL(e){if(e===null||typeof e!="object")return null;const t=e;return t.type!=="media"||t.kinds===void 0||$A({type:"media",kinds:t.kinds})!==null||t.from!==void 0&&(!Array.isArray(t.from)||wo(t.from)===void 0)?null:pu(t)}function fL(e){return{type:"media",kinds:[...e.kinds],...e.from===void 0?{}:{from:[...e.from]}}}function hL(e,t){const n=new Set(e),r=t.filter(c=>n.has(c)),i=new Set(r);let a=0;return e.map(c=>i.has(c)?r[a++]:c)}const Ha=new Map;function HA(e){Ha.set(e.home,e)}function p0(e){const t=Ha.get(e);if(t===void 0)throw new Error(`fact registry: the ${e} registry is not declared yet — import @homepages/template-contracts/fact-registry (or ./fact-keys, ./table-members) before reading it.`);return t}const qA=new Set(["text","select","email","phone","url","date"]);function Yu(e){switch(e.type){case"number":case"image":case"address":return e.type;case"list":return pL(e.element);default:return qA.has(e.type)?"text":null}}function pL(e){return e.type==="object"?"row_list":e.type==="image"?"image_list":e.type==="number"?"number_list":qA.has(e.type)?"text_list":null}function wb(e){if(e.type==="list"){const n=e.element;if(n.type!=="object")return wb(n);for(const r of Object.values(n.fields)){const i=wb(r);if(i!==void 0)return i}return}const t=e.from===void 0?null:pu(e);return(t==null?void 0:t.from)===void 0?void 0:t}function mL(e){if(e.type!=="list")return!1;const t=e.element.type;return wn(t)||t==="media"}function gL(e){return Object.entries(e.pages).flatMap(([t,n])=>mL(n.declaration)?[`${e.home}.${t}`]:[])}function yL(e){return Zu(e.source)}const p2=new WeakMap;function VA(e){let t=p2.get(e);return t===void 0&&(t=bL(e),p2.set(e,t)),t}function bL(e){const t=new Map;for(const[n,r]of Object.entries(e.pages)){const i=r.declaration;if(i.type==="list")continue;const a=`${e.home}.${n}`;if(i.type==="address"){t.set(a,{declaration:i,value_type:"address"});for(const c of mp)t.set(`${a}.${c}`,{declaration:i,value_type:ZA(c)});continue}t.set(a,{declaration:i,value_type:vL(a,i)})}return t}function vL(e,t){if(t.type==="image")return"image";if(wn(t.type)||t.type==="media")throw new Error(`fact registry: ${e} is a single ${t.type} — a top-level media fact is an image, the one media value a slot binds.`);return t.type==="number"?"number":"text"}function ZA(e){return e==="latitude"||e==="longitude"?"number":"text"}function xL(e,t){if(t.type!=="list")return null;const n=t.element;return n.type==="object"?e:n.type==="row"?n.from.slice(n.from.indexOf(".")+1):null}let Ay;function KA(){if(Ay!==void 0)return Ay;p0("library");const e=new Map;for(const t of Ha.values())for(const[n,r]of Object.entries(t.pages)){const i=xL(n,r.declaration);i!==null&&e.set(`${t.home}.${n}`,i)}return Ha.has("property")&&Ha.has("library")&&(Ay=e),e}function m0(){return[...new Set(KA().values())]}function Qt(e){return typeof e=="string"?KA().get(e)??null:null}function Qu(e){return(e==null?void 0:e.kind)==="home"?Qt(e.key):null}function wL(e){return Qu(e.source)}function fi(e){for(const t of Ha.values()){const n=Object.hasOwn(t.pages,e)?t.pages[e]:void 0;if((n==null?void 0:n.declaration.type)==="list"&&n.declaration.element.type==="object")return t.home}throw new Error(`fact registry: no linked registry declares a table "${e}"`)}function cl(e){return`property.${e}`}function kL(e){return`${fi(e)}.${e}`}function GA(e,t){const n=e.pages[t],r=(n==null?void 0:n.declaration.type)==="list"?n.declaration.element:void 0;if((r==null?void 0:r.type)!=="object")throw new Error(`fact registry: the ${e.home} registry declares no list of objects "${t}"`);return r.fields}function YA(e){return GA(p0(fi(e)),e)}function QA(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Xu(e,t){const n=QA(YA(e),t);return n===void 0?void 0:Yu(n)}function _L(e){if(typeof e!="string")return null;const t=e.lastIndexOf(".");if(t<=0)return null;const n=Qt(e.slice(0,t));if(n===null)return null;const r=e.slice(t+1);return Xu(n,r)==="row_list"?{table:n,member:r}:null}function SL(e){if(typeof e!="string")return null;const t=e.lastIndexOf(".");if(t<=0)return null;const n=e.slice(0,t),r=Qt(n);if(r===null)return null;const i=e.slice(t+1);return Xu(r,i)===void 0?null:{table:r,tableKey:n,member:i}}const g0=["type","label","from","source","locked","when"],m2=new Set(g0),y0=Symbol.for("@homepages/concrete:table-of");function XA(e,t){return Object.defineProperty(e,y0,{value:t,enumerable:!1})}function b0(e){if(typeof e!="object"||e===null)return null;const t=e[y0];return typeof t=="string"?t:null}function EL(e){return Object.keys(YA(e))}function gu(e,t){return Object.freeze({kind:"row",field:t,[OA]:e})}function jL(e,t){return new Proxy(gu(e,t),{get(n,r,i){return typeof r=="string"&&!(r in n)&&gp(r)?gu(e,`${t}.${r}`):Reflect.get(n,r,i)}})}const WA=Symbol.for("@homepages/concrete:row:definition");function Ar(e){const t=e[WA];return typeof t=="object"&&t!==null?t:e}const OL=new Set(["then","toJSON","$$typeof","asymmetricMatch","nodeType","tagName","@@iterator"]);function AL(e,t,n=[]){const r=t===null?null:new Set(EL(t)),i=new Proxy(e,{get(a,c,u){if(c===WA)return a;if(typeof c!="string")return Reflect.get(a,c,u);if(t!==null&&r!==null){const f=[t,...n],p=f.map(m=>m===t&&!r.has(c)?void 0:Xu(m,c));if(p.every(m=>m===void 0))return Reflect.get(a,c,u);const y=p.findIndex(m=>m===void 0||m!==p[0]);if(y===-1)return p[0]==="address"?jL(i,c):gu(i,c);if(c in a||m2.has(c))return Reflect.get(a,c,u);throw new Error(`row: "${String(a.label)}" reads the member "${c}", which its \`from\` table ${f[y]} ${p[y]===void 0?"lacks":"holds at another kind"} — every table a row names carries every member its readers read, at one kind.`)}return c in a||m2.has(c)?Reflect.get(a,c,u):OL.has(c)?void 0:gu(i,c)}});return i}function CL(e){const t=new Proxy(e,{get(n,r,i){return typeof r=="string"&&!(r in n)&&gp(r)?gu(t,r):Reflect.get(n,r,i)}});return t}function g2(e,t){const n=e.map(t);return n.some((r,i)=>r!==e[i])?n:void 0}function y2(e,t){const n=e.reads===void 0?void 0:g2(e.reads,t),r=e.requires===void 0?void 0:g2(e.requires,t);return n===void 0&&r===void 0?e:{...e,...n===void 0?{}:{reads:n},...r===void 0?{}:{requires:r}}}function ul(e,t){const n=Ar(e);let r;const i=n.source;if(i!==void 0)if(gi(i)){const c=y2(i,t);c!==i&&(r={...n,source:c})}else{const c=t(i);c!==i&&(r={...n,source:c})}const a=mr(n);if(a!==void 0){let c=!1;const u=a.map(f=>{const p=y2(f,t);return p!==f&&(c=!0),p});c&&(r={...r??n,[s0]:u})}return r??n}function NL(e){return t=>{const n=Vu(t);if(n===void 0)return t;const r=e.get(n);return r===void 0?t:{kind:"row",slot:r,field:t.field}}}const JA=new Set(["row","address"]);function ML(e){const t=new Map;for(const[n,r]of Object.entries(e))typeof r=="object"&&r!==null&&JA.has(r.type)&&t.set(r,n);return t}function RL(e,t,n){const r=[e.source];ul(e,i=>(r.push(i),i));for(const[i,a]of t)if(!(i===e||a===n))for(const c of g0){const u=i[c];if(u!==void 0&&r.includes(u))return`${a}.${c}`}}function TL(e){const t=e.slice(e.indexOf(".")+1);return`reads \`${e}\`, which is the row's own \`${t}\`, not a member — a row's ${g0.map(n=>`\`${n}\``).join(", ")} are its slot definition's, and its table has no member named \`${t}\`.`}function yu(e){return JA.has(e.type)?{...Ar(e)}:e}function v0(e,t){for(const n of wi(t,e)??[])if(!(n.verb!=="pick"||n.of===void 0))throw new Error(`${e}'s \`fill.pick\` states \`of\` — a pick chooses from its holder's \`from\`; remove \`of\` and name the candidates in \`from\`.`)}function $L(e){return Ds(e)?{kind:"section",section:e.section,slot:e.slot}:zn(e)?{kind:"sibling",of:e}:Gt(e)?{kind:"home",key:e.key}:e}function gr(e){return x0(e,$L)}function zL(e,t,n){if(!(t!==!0||n===void 0)){if(gi(n)){if(n.requires!==void 0&&n.requires.length>0)return;throw new Error(`${e} is \`required\` and sourced by a \`compute()\` naming no \`requires\` — nothing to require. Name the reads the value cannot do without: \`compute({ reads, requires: [fact.property.address] }, …)\`.`)}if(Ds(n)||zn(n)||r0(n))throw new Error(`${e} is \`required\` and mirrors another slot — a mirror requires its upstream; mark that slot \`required\` instead.`)}}function x0(e,t){const n=e.source;zL(e.label??"a slot",e.required,n);const r=n!==void 0&&wi(n,e.label??"a slot")===void 0;return{...e.locked===!0?{locked:!0}:{},...e.required===!0?{required:!0}:{},...r?{source:t(n)}:{},...TD(n),...e.label!==void 0?{label:e.label}:{},...e.placeholder!==void 0?{placeholder:e.placeholder}:{},...e.when!==void 0?{when:e.when}:{}}}function Cy(e){return t=>({type:"text",size:e,...gr(t),...t.cap!==void 0?{cap:t.cap}:{}})}const xn={short:Cy("short"),medium:Cy("medium"),long:Cy("long")};function cn(e){return{type:"number",...gr(e),...e.thousandsSep!==void 0?{thousandsSep:e.thousandsSep}:{},...e.decimals!==void 0?{decimals:e.decimals}:{},...e.maxDigits!==void 0?{maxDigits:e.maxDigits}:{}}}function DL(e){return{type:"select",...gr(e),...e.creatable!==void 0?{creatable:e.creatable}:{}}}function LL(e){if(Gt(e.source))throw new Error(`select: "${e.label}" declares both \`from\` and a fact \`source\` — a select takes exactly one set of choices.`);return v0(`select: "${e.label}"`,e.source),{type:"select",...gr(e),values:[...e.from],...e.creatable!==void 0?{creatable:e.creatable}:{}}}function IL(e,t){if(Ss(t.source)&&t.source.verb!=="pick")throw new Error(`select: a display entry is filled by \`fill.pick\` — the model picks one of its cases — never \`fill.${t.source.verb}\`.`);return v0("select: a display entry",t.source),{cases:[...e],...t.locked===!0?{locked:!0}:{},...t.source!==void 0?{source:t.source}:{}}}function UL(e){if(Array.isArray(e))throw new Error("select: takes one options object — write the choices as `from`: `select({ from: [...], … })`.");if(e.options!==void 0)throw new Error("select: declares `options` — a select names its choices in `from`: `select({ from: [...], … })`.");return e.label===void 0&&Array.isArray(e.from)?IL(e.from,e):e.from!==void 0?LL(e):DL(e)}const _h=UL;function Da(e){return{type:"url",...gr(e),...e.accepts!==void 0?{accepts:e.accepts}:{}}}function eC(e){return{type:"date",...gr(e)}}function PL(e){return{type:"email",...gr(e)}}function FL(e){return{type:"phone",...gr(e)}}function w0(e={}){return CL({type:"address",...gr(e)})}function tC(e,t){const n=`${e}: "${t.label??e}"`;v0(n,t.source);const r=$A({type:e,kinds:t.kinds,process:t.process});if(r!==null)throw new Error(`${n} ${r}.`);const i=wi(t.source,n),a=t.source!==void 0&&i===void 0&&!gi(t.source);if(a&&t.from!==void 0)throw new Error(`${n} picks \`from\` a media list and declares a \`source\` — a slot bound to a fact holds what that fact holds.`);if((a||gi(t.source))&&t.process!==void 0)throw new Error(`${n} declares \`process\` beside a \`source\` that derives its value — a derived slot holds what it derives from, processed where that is declared.`);if((i==null?void 0:i.some(f=>f.verb==="pick"))===!0&&t.from===void 0)throw new Error(`${n} is picked by a \`fill.pick\` and names no \`from\` — a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media declaration without one owns its media.`);const c=BL(n,e,t.kinds,t.from),u=c==null?void 0:c.map(f=>Gt(f)?f.key:f);return{...u!==void 0?{from:u.length===1?u[0]:u}:{},...t.process!==void 0?{process:t.process.map(f=>({...f}))}:{}}}function BL(e,t,n,r){if(r===void 0)return;const i=Array.isArray(r)?r:[r];if(i.length===0)throw new Error(`${e} declares \`from: []\` — name the media list it picks from, or omit \`from\` and the declaration owns its media.`);const a=yi({type:t,kinds:n}),c=new Set;for(const u of i){const f=typeof u=="object"&&u!==null&&!Gt(u),p=Gt(u)?u.key:f&&"declaration"in u?u.declaration:u;if(c.has(p))throw new Error(`${e} picks \`from\` one media list twice — each list is named once; a media value two lists hold is one candidate, attributed to the first.`);if(c.add(p),!f)continue;const y=yi(p.element);if(y.length>0&&!a.some(m=>y.includes(m)))throw new Error(`${e} picks \`from\` a list of ${y.join(", ")}, whose items can never be ${a.join(" or ")} — each list it picks from holds items of its kinds.`)}return i}function hi(e={}){return{type:"image",...gr(e),...e.crop!==void 0?{crop:e.crop}:{},...tC("image",e)}}function k0(e={}){return{type:"media",...gr(e),...e.kinds!==void 0?{kinds:[...e.kinds]}:{},...tC("media",e)}}const _0=Symbol.for("@homepages/concrete:object:declared-fields");function Ml(e){return e[_0]}function nC(e,t){const n=Ml(t);return n!==void 0&&Object.defineProperty(e,_0,{value:n,enumerable:!1}),e}const rC="a label is a source, as a text slot takes one",kb="`label: text.short({ cap: 60, source: fill.write({ reads, brief }) })`",HL=new Set(["type","size","cap","locked"]);function qL(e,t,n){if(typeof t=="string")throw new Error(`${e} declares the label ${JSON.stringify(t)} — ${rC}: write \`label: compute(() => ${JSON.stringify(t)})\`.`);if(zn(t)){const r=Object.entries(n).find(([,i])=>i===t);if(r===void 0)return VL(e,t);if(t.type!=="text"&&t.type!=="address")throw new Error(`${e} label names its field "${r[0]}", a "${t.type}" — a label names a text or an address field.`);return{field:r[0]}}if(pp(t)){const r=Ss(t)?`\`fill.${t.verb}\``:"list of fills";throw new Error(`${e} label is a bare ${r} — the label is the fill's holder, so it states the kind the fill writes: ${kb}.`)}return xn.short({locked:!0,source:t})}function VL(e,t){const n=mr(t);if(n===void 0||n.some(c=>c.verb!=="write")||t.type!=="text")throw new Error(`${e} declares a slot as its label that is none of its fields — ${rC}: write what that slot read as the label (\`label: comp.address.street\`, \`label: compute(() => "Listing agent")\`), a written label as ${kb}; a title the user edits is a field, which the label names by its const.`);const r=Object.keys(t).filter(c=>!HL.has(c));if(r.length>0)throw new Error(`${e} label is a written text slot declaring ${r.map(c=>`\`${c}\``).join(", ")} — a label states only its kind and cap: ${kb}; a title the user edits is a field, which the label names by its const.`);const{size:i,cap:a}=t;return xn[i]({locked:!0,source:n.length===1?n[0]:n,...a!==void 0?{cap:a}:{}})}function ZL(e){const{type:t,element:n}=e;if(t==="object")return"an object — an object never holds another; flatten its fields into this one";if(t==="list"&&(n==null?void 0:n.type)==="object")return KL(e);if(t==="list"&&(n==null?void 0:n.type)==="row")return"a list of rows — declare the selection at the top level instead"}const ru="declare the list at the top level instead";function KL(e){const t=mr(e);if(t!==void 0&&t.some(i=>i.verb!=="pick")||t===void 0&&pp(e.source))return`a list of objects declaring a fill other than a pick — no fill but a pick writes a list inside an object; ${ru}`;const n=e.source;if(Gt(n))return`a list of objects sourced by the fact "${n.key}" — its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${ru}`;if(Ds(n)||r0(n)||zn(n))return`a list of objects sourced by another list slot — its items carry their own minted ids, so it lists a row's member, a \`compute()\` or authored items; ${ru}`;const r=e.element.fields;for(const[i,a]of Object.entries(r)){const c=GL(a,r);if(c!==void 0)return`a list of objects whose item field "${i}" is ${c}`}}function GL(e,t){var a,c;if(e.type==="list"&&((a=e.element)==null?void 0:a.type)==="object")return"a list of objects — a list of objects nests one level; flatten the inner list's fields into this item or declare it beside the outer list";if(mr(e)!==void 0)return`filled — no fill writes into a list inside an object; ${ru}`;const n=e.source;if(n===void 0)return;if(gi(n))return`a \`compute()\` — an item of a list inside an object reads its element, or a row \`from\` its member; ${ru}`;const{kind:r,slot:i}=n;if(r==="element"&&e.type==="row"&&Qt(e.from)!==null)return"a table's row holding the element — the element of a list inside an object is a member's item: hold it in a row `from` that member (`row({ label, from: unit.floor_plans, source: entry })`)";if(r!=="element"&&!(e.type!=="row"&&r==="row"&&typeof i=="string"&&((c=t[i])==null?void 0:c.type)==="row"))return"bound to something outside its item — an item of a list inside an object reads its element, a row `from` its member, or a row beside it"}function Wu(e){const t="object";if(e.source!==void 0)throw new Error(`${t} declares \`source\`, but an object is a pure container with no value of its own — declare it on the field that holds the value.`);if(Object.hasOwn(e.fields,"label")&&e.fields.label!==e.label)throw new Error(`${t} declares a field keyed "label" — the key is reserved for the object's label: write its source as \`label\`, beside \`fields\`.`);const n=f2.find(y=>Object.hasOwn(e.fields,y));if(n!==void 0)throw new Error(`${t} field "${n}" is named like its binding's own \`${n}\` — a field is read straight off its object's binding, which owns ${f2.map(y=>`\`${y}\``).join(", ")}. Rename the field.`);const r=e.label===void 0?void 0:qL(t,e.label,e.fields),i=r!==void 0&&!("type"in r)?r:void 0,a={...r===void 0||i!==void 0?{}:{label:r},...e.fields};if(Object.keys(a).length===0)throw new Error(`${t} declares no fields — an object groups at least one.`);for(const[y,m]of Object.entries(a)){const x=ZL(m);if(x!==void 0)throw new Error(`${t} field "${y}" is ${x}.`);if(y!=="label"&&m.label===void 0)throw new Error(`${t} field "${y}" declares no \`label\` — every field of an object states the name the editor shows it by.`)}const c=ML(a);for(const[y,m]of Object.entries(a)){const x=RL(m,c);if(x!==void 0)throw new Error(`${t} field "${y}" ${TL(x)}`)}const u=NL(c),f={};for(const[y,m]of Object.entries(a))f[y]=yu(ul(m,u));const p={type:"object",...e.locked===!0?{locked:!0}:{},...i!==void 0?{label:i}:{},fields:f,...e.when!==void 0?{when:e.when}:{}};return Object.defineProperty(p,_0,{value:a,enumerable:!1}),p}const YL=new Set(["text","select","url","date","email","phone"]);function QL(e){if(typeof e=="string")return Qt(e)??e}function XL(e){var i;if(e.type!=="object"){const a=(i=e.source)==null?void 0:i.kind;return a===void 0||a==="element"?e:void 0}const t=Object.values(e.fields??{}),n=t.filter(a=>{var c;return((c=a.source)==null?void 0:c.kind)==="element"});if(n.length===1)return n[0];const r=t.filter(a=>a.from!==void 0&&a.source===void 0);return n.length===0&&r.length===1?r[0]:void 0}function WL(e){if(e.fields!==void 0||e.element===void 0)return;const t=XL(e.element);return t===void 0?void 0:Sh(t)}function Sh(e){const t=e.type??"unknown";if(YL.has(t))return"string";if(t==="row"){const n=QL(e.from);return n===void 0?void 0:`row<${n}>`}if(t==="list"){const n=WL(e);return n===void 0?void 0:`list<${n}>`}return t==="object"?`{ ${Object.entries(e.fields??{}).map(([r,i])=>`${r}: ${Sh(i)??"unknown"}`).sort().join("; ")} }`:t}function Eh(e){const t=e.indexOf("/");return t===-1?e:e.slice(t+1)}function JL(e,t=[]){const n=new Map;for(const c of e)for(const u of c.sections){const f=Eh(u.section);n.has(f)||n.set(f,u.instance_id)}const r=new Set(t.filter(c=>!c.enabled).map(c=>c.page_id)),i=c=>{const u=n.get(c);return u===void 0||e.filter(p=>p.sections.some(y=>y.instance_id===u)).every(p=>r.has(p.id))?void 0:u};function a(c,u){if(c.kind==="home")return{layer:"home",key:c.key};const f=c.section===Eh(u.section)?u.instanceId:i(c.section);return f===void 0?void 0:{layer:"section",instanceId:f,slot:c.slot}}return{readable:i,locate:a}}function oC(e){if(e.type==="object")return null;const t=e.source;if(t===null||typeof t!="object")return null;const{kind:n,section:r,slot:i}=t;return n==="section"&&typeof r=="string"&&typeof i=="string"?{kind:"section",section:r,slot:i}:null}const b2=e=>e.type==="row"||e.type==="list"?e.type:"value";function e6(e,t){if(b2(e)!==b2(t))return!1;const n=Sh(e),r=Sh(t);return n===void 0||r===void 0||n===r}function iC(e,t,n){const r=oC(n.def);if(r===null)return{kind:"none"};const i=e.placement.locate(r,{instanceId:t.instanceId,section:n.section}),a=i===void 0?void 0:e.slotAt(i);return i===void 0||a===void 0?{kind:"unread"}:e6(n.def,a.def)?{kind:"upstream",address:i,def:a.def}:{kind:"none"}}function t6(e,t){const n=e.slotAt(t),r=n===void 0?void 0:iC(e,t,n);return(r==null?void 0:r.kind)==="upstream"?r.address:null}function n6(e,t){const n=new Set;let r=t,i=e.slotAt(t),a=!1;for(;;){if(i===void 0)return null;const c=`${r.instanceId} ${r.slot}`;if(n.has(c))return null;n.add(c);const u=iC(e,r,i);if(u.kind==="unread")return null;if(u.kind==="none")return r===t?null:{root:r,locked:a};a||(a=u.def.locked===!0),r=u.address,i=e.slotAt(r)}}const Ju=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function vp(e,t){if(Object.hasOwn(e,t))return e[t];const n=t.indexOf(".");if(n<=0)return;const r=e[t.slice(0,n)];if((r==null?void 0:r.type)!=="object"||!Ju(r.fields))return;const i=t.slice(n+1);return Object.hasOwn(r.fields,i)?r.fields[i]:void 0}function sC(e,t,n){if(t.siblings!==void 0&&Object.hasOwn(t.siblings,n))return{path:t.container===void 0?n:`${t.container}.${n}`,def:t.siblings[n],sibling:!0};if(t.nested===!0)return;const r=vp(e,n);return r===void 0?void 0:{path:n,def:r,sibling:!1}}function r6(e){return e==="row"||e==="address"}function aC(e,t,n){const r=sC(e,t,n);if(!(r===void 0||!r6(r.def.type)))return{...r,kind:r.def.type}}function o6(e){return Qt(e.from)}function bu(e){if(!Array.isArray(e.from)){const t=o6(e);return t===null?[]:[t]}return e.from.flatMap(t=>Qt(t)??[])}function lC(e,t){const n=new Set,r=[];for(const i of t){const a=e[i];for(const c of a){const u=jh(c.id);u===null||n.has(u)||(n.add(u),r.push({id:u,table:i}))}}return r}function xp(e,t,n){if(t.length>1&&n!==null){const r=lC(e,t).find(i=>i.id===n);if(r!==void 0)return r.table}return t[0]??null}function cC(e){if(e===void 0)return;if(v2(e.source))return e;if(e.type!=="object"||!Ju(e.fields))return;const t=Object.values(e.fields).filter(n=>v2(n.source));return t.length===1?t[0]:void 0}function uC(e){const t=cC(e);return(t==null?void 0:t.type)==="row"?bu(t):[]}function v2(e){return Ju(e)&&e.kind==="element"}function i6(e,t){return dC(e,e.section,e.slots,t,new Set)}function x2(e,t,n,r,i){const a=`${t??""}\0${r}`;if(i.has(a))return[];i.add(a);const c=vp(n,r);return(c==null?void 0:c.type)==="row"?bu(c):(c==null?void 0:c.type)==="list"?dC(e,t,n,c,i):[]}function dC(e,t,n,r,i){var m;const a=Ju(r.source)?r.source:void 0;if(a===void 0||a.kind==="authored"||a.kind==="derived")return uC(r.element);const c=Qu(a);if(c!==null)return[c];const{kind:u,section:f,slot:p}=a;if(u!=="section"||typeof f!="string"||typeof p!="string")return[];if(f===t)return x2(e,t,n,p,i);const y=(m=e.sectionSlots)==null?void 0:m.call(e,f);return y===void 0?[]:x2(e,f,y,p,i)}const jh=e=>typeof e=="string"&&e!==""?e:null;function S0(e,t=null){if(typeof e=="string")return t===null?null:jh(e);const n=s6(e);return n===null?null:jh(e[n])}function s6(e){return Ju(e)?["id","media","file"].find(t=>jh(e[t])!==null)??null:null}function a6(e,t){if(Gt(e)){if(Qt(e.key)===null)throw new Error(`list: "${t}" is sourced by the fact "${e.key}", which is no table — a list's source is a table, a list slot, a list-valued member, a \`compute()\` or a fill; a list of the property's media is picked (\`fill.pick\`) from its item's \`from\`, or computed over a media list (\`compute({ reads: [fact.property.property_media] }, …)\`).`);return{kind:"home",key:e.key}}if(Ds(e))return{kind:"section",section:e.section,slot:e.slot};if(zn(e))return{kind:"sibling",of:e};if(Vu(e)!==void 0||gi(e))return e;throw new Error(`list: "${t}" declares a source that is no list.`)}function fC(e){return Gt(e)?Qt(e.key):zn(e)&&e.type==="list"?b0(e):null}const l6=new Set(["label","locked","placeholder","when","source"]);function c6(e){const t={};for(const[n,r]of Object.entries(e))l6.has(n)||(t[n]=r);return t}function u6(e,t){if(Gt(e)&&Qt(e.key)!==null)return{type:"row",from:e.key,source:{kind:"element"}};for(const r of wi(e,`list: "${t}"`)??[]){if(r.verb==="write")throw new Error(hC(t,"declares no `item`"));if(r.verb==="pick")throw new Error(_b(t,"declares no `item`"))}if(pp(e))return{type:"poi"};if(zn(e)&&e.type==="list")return d6(e,t);const n=Vu(e);if(n!==void 0){const r=b0(n);if(r!==null&&Xu(r,e.field)==="image_list")return{type:"image"}}throw new Error(`list: "${t}" declares no \`item\`, and its source does not say what its elements are — declare \`item\`: a plain slot (\`item: image()\`), or a function of the element (\`item: (el) => object({ … })\`).`)}function hC(e,t){return`list: "${e}" is written by a \`fill.write\` and ${t} — the item is the kind every written element is: a value slot (\`item: text.short({ cap: 80 })\`), an object exactly one field of which holds the element (\`question: text.medium({ label: "Question", cap: 48, source: el })\`), or an object declared plainly whose members the write answers (\`item: object({ label: text.short({ label: "Unit" }), fields: { … } })\`).`}function pC(e){if(typeof e!="object"||e===null||e.type!=="object")return!1;const t=e.fields??{};return!Object.values(t).some(n=>ho(n.source))}function w2(e,t){if(e.type!=="object")return;const n=Object.entries(e.fields).filter(([,r])=>{var i;return r.type!=="row"&&((i=r.source)==null?void 0:i.kind)==="element"});if(n.length!==1)throw new Error(hC(t,n.length===0?"its object item holds the element in no field":`its object item holds the element in ${String(n.length)} fields (${n.map(([r])=>`"${r}"`).join(", ")}) — one field holds it`))}function d6(e,t){const n=e.element;if(n===void 0||n.type==="object")throw new Error(`list: "${t}" lists the items of a list of objects — declare \`item\` to say what each item holds.`);return n.type==="row"?{type:"row",from:n.from,source:{kind:"element"}}:c6(n)}function _b(e,t){return`list: "${e}" is picked by a \`fill.pick\` and ${t} — the item holds the pick in the field holding its candidates: a candidate holder itself (\`item: image({ from: fact.property.property_media })\`, \`item: row({ label: "Agent", from: fact.property.contacts })\`), or an object exactly one field of which holds candidates and no source, which its siblings read by its const (\`const photo = image({ label: "Photo", from: fact.property.property_media }); object({ fields: { photo, caption: text.short({ label: "Caption", source: fill.write({ reads: [photo], brief }) }) } })\`).`}function Sb(e){const t=Ar(e);return t.type==="row"?typeof t.from=="string":t.type==="select"?Array.isArray(t.values):typeof t.type=="string"&&(wn(t.type)||t.type==="media")&&t.from!==void 0}function Eb(e){return Ar(e).source===void 0&&mr(e)===void 0}function mC(e,t){if(e.type!=="object")return Sb(e)&&Eb(e)?null:void 0;const n=Ml(e)??e.fields??{},r=Object.entries(n).filter(([,c])=>typeof c=="object"&&c!==null&&Sb(c)&&Eb(c)),i=r.filter(([,c])=>Ar(c).type!=="select"),a=i.length>0?i:r;if(a.length>1)throw new Error(`list: "${t}"'s item declares ${String(a.length)} fields with \`from\` and no source (${a.map(([c])=>`"${c}"`).join(", ")}) — a picked list's item holds its pick in exactly one; give the others a source of their own.`);return a.length===1?a[0][0]:void 0}function k2(e){return{...yu(e),source:{kind:"element"}}}function Ny(e,t){if(t===void 0)return null;const n=t===null?e:(Ml(e)??e.fields)[t],r=Ar(n);return r.type==="row"?Qt(r.from):null}function f6(e,t){if(t===null)return k2(e);const n=e,r=(Ml(e)??n.fields)[t],i=c=>c===r||typeof c=="object"&&c!==null&&Ar(c)===Ar(r)?{kind:"element"}:c,a={};for(const[c,u]of Object.entries(n.fields))a[c]=c===t?k2(u):ul(u,i);return nC({...n,fields:a},n)}function h6(e,t,n){const r=a=>{if(!ho(a))return a;if(_D(a)!==t)throw new Error(`list: "${n}"'s item reads the element of another list — an element is read only inside its own list's item.`);return{kind:"element"}};if(e.type==="object"){const a=e,c={};let u=!1;for(const[f,p]of Object.entries(a.fields))c[f]=yu(ul(p,r)),c[f]!==p&&(u=!0);return u?nC({...a,fields:c},a):a}return yu(ul(e,r))}function gC(e,t){const n=e.type==="object"?Object.entries(e.fields):[["",e]];for(const[r,i]of n){const a=i.source;if((a==null?void 0:a.kind)==="home")throw new Error(`list: "${t}"'s item${r===""?"":` field "${r}"`} is bound to the fact "${String(a.key)}", which is the same value in every item — read the element or a row's member instead; a property fact belongs in a fill's or a \`compute()\`'s \`reads\`.`)}}function p6(e,t){if(e.item===void 0)return u6(e.source,t);const n=new Set((wi(e.source,`list: "${t}"`)??[]).map(f=>f.verb));if(n.has("pick")){const f=m6(e.item,t);return n.has("write")&&w2(f,t),f}const r={},i=Object.freeze({kind:"element",[AA]:r,[y0]:fC(e.source)}),a=typeof e.item=="function"?e.item(i):e.item;if(typeof a!="object"||a===null||typeof a.type!="string")throw new Error(`list: "${t}"'s item is no slot — return a value slot, a row or an object.`);if(a.type==="list")throw new Error(`list: "${t}"'s item is a list — a list's item is a value slot, a row or an object; a list never holds lists.`);if(a.type!=="object"&&mr(a)!==void 0)throw new Error(`list: "${t}"'s item declares a fill — one decision produces the whole list, so the fill belongs on the list's \`source:\`; a field of an object item may carry its own.`);gC(a,t);const c=h6(a,r,t);if(n.has("write")&&!pC(e.item)&&w2(c,t),c.type==="object"||c.type==="row")return c;const u={...c};return delete u.locked,u}function m6(e,t){if(typeof e=="function")throw new Error(_b(t,"declares its item as a function"));if(typeof e!="object"||e===null||typeof e.type!="string")throw new Error(`list: "${t}"'s item is no slot — return a value slot, a row or an object.`);const n=mC(e,t);if(n===void 0)throw new Error(_b(t,"its item declares no field with `from` and no source"));gC(e,t);const r=f6(e,n);if(r.type==="object"||r.type==="row")return r;const i={...r};return delete i.locked,i}function g6(e,t){const n=e.source;if(!(n===void 0||(wi(n,"list")??[]).some(a=>a.verb==="pick"))||typeof e.item!="object"||e.item===null)return fC(n);const i=e.item;if(n===void 0){if(i.type!=="object")return Ny(i,Sb(i)?null:void 0);const a=Object.entries(Ml(i)??{}).filter(([,c])=>Ar(c).type==="row"&&Eb(c));return a.length===1?Ny(i,a[0][0]):null}return Ny(i,mC(i,t))}function ar(e){const t=e.label??"list",n=e.source,r=wi(n,`list: "${t}"`),i=pC(e.item),a=(r==null?void 0:r.every(p=>p.verb==="pick"||p.verb==="write"&&i))===!0;if(r!==void 0&&e.max===void 0&&!a)throw new Error(`list: "${t}" is filled but declares no \`max\` — a fill is an open supply, so the list bounds it.`);for(const p of r??[])if(p.verb==="pick"&&p.of!==void 0)throw new Error(`list: "${t}"'s \`fill.pick\` states \`of\` — a list's pick chooses from its item's \`from\`; remove \`of\`.`);const c={type:"list",...x0(e,p=>a6(p,t)),element:p6(e,t),...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}},u=gi(n)?uC(c.element):void 0,f=u===void 0?g6(e,t):u.length===1?u[0]:null;return XA(c,f)}function wp(e,t){if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error(`process.${e}(): takes an options object, or nothing.`);const n={kind:"process",verb:e};for(const[i,a]of Object.entries(t??{}))a!==void 0&&(n[i]=a);const r=l0(n);if(r!==null)throw new Error(`process.${e}(): ${r}.`);return n}function y6(e){return wp("cutout",e)}function b6(e){return wp("autocrop",e)}function ko(e,t){return wp(e,t)}function v6(e){return ko("probe",e)}function x6(e){return ko("understand",e)}function w6(e){return ko("preview",e)}function k6(e){return ko("ladder",e)}function _6(e){return ko("transcode",e)}function S6(e){return ko("poster",e)}function E6(e){return ko("rasterize",e)}function j6(e){return ko("fetch",e)}function O6(e){return ko("tour_details",e)}function A6(e){return wp("crop",e)}const C6={cutout:y6,autocrop:b6},St={...C6,probe:v6,understand:x6,preview:w6,ladder:k6,transcode:_6,poster:S6,rasterize:E6,fetch:j6,tour_details:O6,crop:A6};function N6(e,t="a list"){return`${e} is sourced by ${t} — a row's slot source names a row, which it mirrors. A list's first row is a \`compute()\` over the list: \`source: compute({ reads: [list] }, (rows) => rows[0] ?? null)\`.`}function M6(e,t){if(Gt(e))throw new Error(`row: "${t}" is sourced by the fact "${e.key}" — a table is a row's \`from\`, never its source: \`row({ label, from: fact.${e.key} })\` holds its first row, which the user may re-pick.`);if(Ds(e))return{kind:"section",section:e.section,slot:e.slot};if(zn(e))return{kind:"sibling",of:e};if(ho(e)||gi(e))return Object.freeze({...e});throw new Error(`row: "${t}" declares a source that is no element, slot, compute or pick.`)}function R6(e,t){if(Array.isArray(e))return T6(e,t);const n=Gt(e)?Qt(e.key):null;if(n!==null)return{key:e.key,tables:[n]};const r=Vu(e);if(r!==void 0){const i=`${String(Ar(r).from)}.${e.field}`;if(_L(i)!==null)return{key:i,tables:[]}}throw new Error(e===void 0?`row: "${t}" declares no \`from\` — a row names its fact data: a table (\`row({ label, from: fact.property.contacts })\`) or a row's list-valued member (\`from: unit.floor_plans\`).`:`row: "${t}"'s \`from\` is ${Gt(e)?`the fact "${e.key}", which is not a table`:"no table or list-valued member"} — a row's \`from\` is a fact table (\`fact.property.contacts\`) or a table row's list-valued member (\`unit.floor_plans\`).`)}function T6(e,t){if(e.length===0)throw new Error(`row: "${t}" declares \`from: []\` — a row names the table it is a row of.`);const n=[],r=[];for(const i of e){const a=Gt(i)?Qt(i.key):null;if(a===null)throw new Error(`row: "${t}"'s \`from\` lists ${Gt(i)?`the fact "${i.key}", which is not a table`:"something that is no table"} — a row's list of \`from\` names tables (\`[fact.property.contacts, …]\`); a list-valued member is a row's only \`from\`.`);if(r.includes(a))throw new Error(`row: "${t}" names the ${a} table twice in \`from\` — each table is named once.`);n.push(i.key),r.push(a)}return{key:n.length===1?n[0]:n,tables:r}}function $6(e,t,n){const r=b0(zn(e)||ho(e)?e:void 0);if(!(r===null||t.includes(r)))throw new Error(`row: "${n}" is \`from\` the ${t.join(", ")} table${t.length===1?"":"s"} but its source holds a row of ${r} — a row's source yields a row of its own \`from\`.`)}function z6(e){const{key:t,tables:n}=R6(e.from,e.label),r=n[0]??null;if(r===null&&!ho(e.source))throw new Error(`row: "${e.label}" is \`from\` the list-valued member "${t}" but its source is no element — a row from a member holds an item of it, the element of the list over that member: \`source: entry\`.`);if(zn(e.source)&&e.source.type==="list")throw new Error(N6(`row: "${e.label}"`));const i=wi(e.source,`row: "${e.label}"`);for(const u of i??[]){if(u.verb!=="pick")throw new Error(`row: "${e.label}" is filled by \`fill.${u.verb}\` — a row holds a row that exists, which only a \`fill.pick({ brief })\` out of its \`from\` yields.`);if(u.of!==void 0)throw new Error(`row: "${e.label}"'s \`fill.pick\` states \`of\` — a row's pick chooses from its \`from\`; remove \`of\`.`)}i===void 0&&e.source!==void 0&&r!==null&&$6(e.source,n,e.label);const a=x0(e,u=>M6(u,e.label)),c=XA({type:"row",from:t,...a},r);return AL(c,r,n.slice(1))}const yC=["property","library"];function go(e){const t=e.indexOf("."),n=t===-1?"":e.slice(0,t);if(!yC.includes(n))throw new Error(`fact registry: "${e}" names no home's list fact`);return{home:n,key:e.slice(t+1)}}function E0(e){return e.type==="row"?e:null}function bC(e){if(e.type!=="object")return null;for(const[t,n]of Object.entries(e.fields)){const r=n.source;if(wn(n.type)&&typeof r=="object"&&r!==null&&r.kind==="element")return t}return null}function kp(e){return(Array.isArray(e.from)?e.from:[e.from]).filter(n=>typeof n=="string")}function Oh(e){const t=vC(e);return t===null?null:t.label??null}function vC(e){const t=go(e),n=t.home==="library"?yr.pages:at.pages,[r,...i]=t.key.split(".");let a=r!==void 0&&Object.hasOwn(n,r)?n[r].declaration:void 0;for(const c of i)if((a==null?void 0:a.type)==="list")a=a.element;else if((a==null?void 0:a.type)==="object")a=Object.hasOwn(a.fields,c)?a.fields[c]:void 0;else return null;return(a==null?void 0:a.type)==="list"?a:null}function Es(e){const t=[];let n=e;for(;n!==void 0&&!t.includes(n);){const r=vC(n);if(r===null)break;t.push(n),n=xC(r.element)}return t}function xC(e){const t=E0(e);if(t!==null)return kp(t)[0];const n=e.type==="object"?bC(e):null,r=e.type==="object"&&n!==null?e.fields[n]:e;if(!wn(r.type)&&r.type!=="media")return;const i=r.from,a=Array.isArray(i)?i[0]:i;return typeof a=="string"&&a!==""?a:void 0}function D6(e){const t=typeof e=="string"?[e]:[...e],n=t[0];return n===void 0?[]:[...Es(n).slice(1).filter(i=>!t.includes(i)).reverse().map(i=>[i]),t]}function _p(e){return e.head!==null}function _o(e,t){if("label"in e)throw new Error("fact registry: a page head holds no `label` — the declaration states the fact's name");for(const n of["title","description"]){const r=e[n];if(typeof r=="string"&&r.trim()==="")throw new Error(`fact registry: a page declares an empty ${n}`)}return{head:e,declaration:t}}const L6=new Set(["home","item"]);function jb(e,t,n){var a;const r=typeof t=="object"&&t!==null?n.pages.get(t):void 0;if(r!==void 0)return{kind:"home",key:`${n.home}.${r}`};if(NA(t)){const c=n.pages.get(t);if(c===void 0)throw new Error(`${e} reads a page that is not one of this registry's — a registry reads its own facts by their page's const.`);return{kind:"home",key:`${n.home}.${c}`}}const i=r0(t)?t.of:t;if(zn(i)){const c=(a=n.fields)==null?void 0:a.get(i);if(c===void 0)throw new Error(`${e} reads the declaration "${i.label??i.type}", which is not a field of the same item — a field reads its siblings by their consts, and a top-level fact by its page's const.`);return{kind:"item",field:c}}if(Gt(t)&&[...n.pages.values()].some(c=>t.key===`${n.home}.${c}`))return{kind:"home",key:t.key};if(Gt(t))throw new Error(`${e} is bound to the fact "${t.key}" — a registry declares the facts; it reads a sibling page by its const and binds none.`);if(Ds(t))throw new Error(`${e} reads a section's slot — a registry reads no section.`);if(ho(t)&&n.picked===!0)return{kind:"element"};if(ho(t))throw new Error(`${e} reads the element — a registry's list nothing picks is built by the user, so its item's fields read one another by const.`);if(Vu(t)!==void 0)throw new Error(`${e} reads the member "${t.field}" of a row that is not a field of the same item.`);if(o0(t)&&typeof t.slot=="string")return{kind:"row",slot:t.slot,field:t.field};if(typeof t=="object"&&t!==null&&L6.has(String(t.kind)))return t;throw new Error(`${e} declares a read a registry cannot answer.`)}function I6(e,t,n){return Array.isArray(t)?t.length===1?My(e,t[0],n):t.map(r=>My(e,r,n)):My(e,t,n)}function My(e,t,n){const r=typeof t=="object"&&t!==null?n.pages.get(t):void 0,i=typeof t=="string"?t:r===void 0?void 0:`${n.home}.${r}`;if(i===void 0||!n.mediaLists.has(i))throw new Error(`${e} picks \`from\` something other than one of this registry's media lists — a media field picks from a list of media (the \`uploads\` page, a sorted list), by its const, or owns its media.`);return i}function Ob(e,t,n){const r=t.reads.map(i=>jb(e,i,n));return t.requires===void 0?{kind:"compute",fn:t.fn,reads:r}:{kind:"compute",fn:t.fn,reads:r,requires:t.requires.map(i=>jb(e,i,n))}}function U6(e,t){if(t.when!==void 0)throw new Error(`${e} declares \`when\` — a registry has no display variant; a page is drawn when a template reads it.`);if(t.required!==void 0)throw new Error(`${e} declares \`required\` — a fact requires nothing on its own account; what a property must answer is what its templates require.`);if(t.type==="poi")throw new Error(`${e} is a poi — a place the platform builds is no fact.`)}function P6(e,t,n){const r=mr(n)??[];if(t==="library"&&r.length>0)throw new Error(`${e} declares a fill — a library's facts are the org's own, and nothing fills them.`);if(r.some(i=>i.verb==="find"))throw new Error(`${e} declares a \`find\` — a home's fact is answered, written or picked, never looked up.`)}function F6(e,t){const{type:n,fields:r}=t;if(n!=="object"||r===void 0)return;const i=Object.entries(r).filter(([,a])=>a.type==="row");if(i.length>0)throw new Error(`${e} holds a picked row in ${i.map(([a])=>`"${a}"`).join(", ")} — a list picking rows declares the row as its item (\`item: row({ from })\`), whose members are the row's.`)}function B6(e){const t=new Map,n=e.fields;for(const r of[n,Ml(e)??{}])for(const[i,a]of Object.entries(r))typeof a=="object"&&a!==null&&t.set(a,i);return t}function Ab(e,t,n){var i;U6(e,t),P6(e,n.home,t);let r=yu(ul(t,a=>jb(e,a,n)));switch(r.from!==void 0&&(wn(String(r.type))||r.type==="media")&&(r={...r,from:I6(e,t.from,n)}),r.type){case"object":{const a={},c={...n,fields:B6(r)};for(const[u,f]of Object.entries(r.fields))a[u]=Ab(`${e}.${u}`,f,c);r={...r,fields:a};break}case"list":{const a=r.max,c={home:n.home,pages:n.pages,mediaLists:n.mediaLists},u=((i=mr(t))==null?void 0:i.some(p=>p.verb==="pick"))===!0,f=Ab(`${e}[]`,r.element,u?{...c,picked:!0}:c);F6(`${e}[]`,f),r={...r,element:f,...Zu(a)?{max:Ob(`${e}.max`,a,c)}:{}};break}}return r}function H6(e,t,n,r){const i=`${e}.${t}`,a=Ab(i,n.declaration,r);if(a.type==="object")throw new Error(`${i} is an object — a top-level fact is a value or a list; a group of fields is a list's item.`);if(a.label===void 0)throw new Error(`${i} declares no \`label\` — a top-level fact states the name its page and its Details section show it by.`);if(n.head===null)return{head:null,declaration:a};const{title:c,description:u}=n.head;return{head:{title:typeof c=="string"?c:Ob(`${i}.title`,c,r),description:typeof u=="string"?u:Ob(`${i}.description`,u,r)},declaration:a}}const q6=["home","pages"];function V6(e){return"head"in e&&"declaration"in e}function Z6(e){const t=e.element;return e.type==="list"&&typeof(t==null?void 0:t.type)=="string"&&(wn(t.type)||t.type==="media")}function wC(e,t){if(!yC.includes(e))throw new Error(`fact registry: "${e}" is not a home`);const n=new Map,r=new Set,i={};for(const[f,p]of Object.entries(t)){if(q6.includes(f))throw new Error(`fact registry: ${e} declares a page keyed "${f}", a registry's own key`);n.set(p,f);const y=V6(p)?p:{head:null,declaration:p};i[f]=y,Z6(y.declaration)&&r.add(`${e}.${f}`)}const a={home:e,pages:n,mediaLists:r},c={};for(const[f,p]of Object.entries(i))c[f]=H6(e,f,p,a);const u={home:e,pages:c};for(const f of Object.keys(t))u[f]={kind:"home",key:`${e}.${f}`};return u}function Si(e){const t=e.declaration.label;if(typeof t!="string")throw new Error("fact registry: a page's declaration states no label");return t}const K6=[{value:"for_sale",label:"For sale",icon:"tag",description:"List price, finance details, and a sold-ready layout."},{value:"for_rent",label:"For rent",icon:"key",description:"Monthly rent, lease terms, pets, and utilities."}],G6=["sold","active"],Y6=["total","monthly"];function Q6(e){return e==null?"active":"sold"}function X6(e){return e==="for_rent"?"monthly":"total"}const W6=6371e3;function J6(e,t,n,r){const i=f=>f*Math.PI/180,a=i(n-e),c=i(r-t),u=Math.sin(a/2)**2+Math.cos(i(e))*Math.cos(i(n))*Math.sin(c/2)**2;return 2*W6*Math.asin(Math.sqrt(u))}function e8(e,t){return(e==null?void 0:e.latitude)==null||e.longitude==null||(t==null?void 0:t.latitude)==null||t.longitude==null?null:Math.round(J6(t.latitude,t.longitude,e.latitude,e.longitude))}const t8=_o({title:"Your contacts",description:"The people your listings name, with the headshots and logos they carry."},ar({label:"Contacts",item:()=>{const e=xn.short({label:"Name",cap:256});return Wu({label:e,fields:{headshot:hi({label:"Headshot"}),name:e,title:xn.short({label:"Title",cap:128}),org_name:xn.short({label:"Organization",cap:256}),email:PL({label:"Email"}),phone:FL({label:"Phone"}),website:Da({label:"Website"}),address:w0({label:"Address"}),bio:xn.long({label:"Bio",cap:4e3}),logo_dark:hi({label:"Logo for light backgrounds",process:[St.cutout()]}),logo_light:hi({label:"Logo for dark backgrounds",process:[St.cutout()]}),instagram:Da({label:"Instagram"}),linkedin:Da({label:"LinkedIn"}),x:Da({label:"X"}),facebook:Da({label:"Facebook"})}})}})),yr=wC("library",{contacts:t8});HA(yr);const Cb=_o({title:"What’s the address?",description:"We’ll build your map and neighborhood details from this."},w0({label:"Address"})),kC=_o({title:"For sale or for rent?",description:"This adjusts the pricing details we ask for."},_h({label:"Listing intent",from:[...K6]})),Ei=_o({title:"Add photos, docs, and links",description:"Everything you add helps fill and enrich your website."},ar({label:"Uploads",item:k0()})),j0=ar({label:"Media",item:k0({kinds:["image","video","tour"],from:Ei}),source:Mr.pick({brief:"What shows the property: its photographs, renderings, videos and virtual tours, of the building, its rooms, grounds, amenities, surroundings and views, which a page's gallery and sections draw for a visitor walking through the property. An upload belongs when its name or account says it is one of those. It does not belong when its name or account says it is something else: a floor plan or other diagram, a logo or brand graphic, a photograph of a person or people, a flyer, slide or other image that is mostly text, a screenshot, a map or a document page. When neither its name nor its account says what it is, you cannot tell. The list runs as a walk through the property: aerial and street views, then the approach and entry, then the interiors room by room (living spaces, kitchen and dining, bedrooms, bathrooms), then outdoor spaces, amenities, surroundings and views, every shot of one space together; a video or tour sits with the space it shows, and one of the whole property comes first."})}),_C=ar({label:"Floor plans",item:hi({label:"Floor plan",from:Ei,process:[St.cutout({enclosed:"keep"})]}),source:Mr.pick({brief:"The property's floor plans: each upload that is exactly one floor plan, a top-down view of one floor of a dwelling's rooms and walls, drawn or rendered, flat or in 3D, at any size, whatever title, figures or text are printed around it, which a page's plans draw and each unit's own plans are picked from. An upload belongs when its name or account says it shows one floor plan. It does not belong when its name or account says it holds two or more plans, or is something else: a building key or site diagram, a legend, scale bar or north arrow on its own, a logo, a photograph or plain text. When neither its name nor its account says what it is, or how many plans it holds, you cannot tell. The list runs from the lowest floor to the highest, the plans of several units in the order the units are numbered, each unit's floors together."})}),n8=ar({label:"Documents",item:k0({kinds:["document","image","video"],from:Ei}),source:Mr.pick({brief:"The property's documents: what sets out its specifics, the figures, finances, terms, legal record, condition or plans a buyer, tenant or investor studies, which a page offers as downloads and a reader wanting only them reads in place of every upload. An upload belongs when its name or account says it records those: an offering memorandum, brochure, listing sheet, rent roll, financials, comparables, lease, survey, site plan, plan set, disclosure or report. It does not belong when its name or account says it is a photograph, rendering, video or tour showing the property, an image of floor plans or elevations, a logo, a photograph of people, an ad, sign or announcement, a map, or notes for whoever makes the marketing. When neither its name nor its account says what it is, you cannot tell. The list runs as a buyer reads it: the offering memorandum, brochure or listing sheet, then the financials, rent roll and comparables, then the leases, legal record and disclosures, then the reports, surveys and plans."})}),r8=hi({label:"Hero",from:j0,source:Mr.pick({brief:"The property's cover image: the one image the page's banner draws above the address, standing for the whole property at a glance for a visitor arriving at the page. It is an image of the property, by its name or account, a photograph or a rendering alike, ranked by what it shows and never by how it was made: the front exterior of the building first, then another exterior or aerial view, then the widest, brightest view of the main living space. A close-up, a bathroom, a utility space, an empty room or anything that reads as a fragment rather than a place is a weaker cover, never ruled out, so where those are the only images of the property the best of them is the cover. A logo or brand graphic, a headshot, an image that is mostly text, a screenshot, a map, a document page, a floor plan or other diagram is not an image of the property, nor is an image whose name and account do not say what it is; with no image of the property there is no cover."})}),o8=Da({label:"Website"}),SC={unit:'"Unit 3", "#3", "Apt 3" and "Residence 3" all label "Unit 3"',space:'"Suite 200", "Ste 200" and "#200" all label "Suite 200"'};function EC(e){return`This ${e}'s floor plans: every one of the property's floor plans labeled for it, whatever the plan draws (a floor of the ${e}, its roof deck, its storage), listed beside the ${e}'s specs. A plan's label is read from its name and the text printed on it, never from the rooms drawn or any figures. A plan belongs when its label names this ${e}: the ${e}'s own label or a plain variant of it (${SC[e]}), a descriptor the ${e}'s label carries in brackets left off; a plan labeled for several ${e}s, as a shared floor printed with each ${e}'s number, belongs to each of them. A plan labeled for other ${e}s and not this one does not belong. When a plan labels no ${e}, you cannot tell. The list runs from the lowest floor to the highest.
|
|
50
|
-
|
|
51
|
-
floor: the level of the ${e} the plan draws, or the part of it where the plan draws no whole level, in the form "Basement", "2nd floor" or "Roof deck". It is read as the plan's label is, from the plan's name and a title among the words printed on it, never from what its account says the drawing shows or from the words that mark its rooms, and a ${e} number is not a floor. A plan whose name and printed title state neither has none.`}function jC(e){return`This ${e}'s photos: every one of the property's photos labeled for it, whatever the photo shows, listed beside the ${e}'s specs. A photo's label is read from its name, the text printed on it and a caption its account records, never from what it shows, any figures, how much it looks like the ${e} or where it falls among the uploads. A photo belongs when its label names this ${e}: the ${e}'s own label or a plain variant of it (${SC[e]}), a descriptor the ${e}'s label carries in brackets left off; a photo labeled for several ${e}s belongs to each of them. A photo labeled for other ${e}s and not this one does not belong. When a photo labels no ${e}, you cannot tell.`}const i8=EC("unit"),s8=jC("unit"),a8=[`The property's units: a row for each dwelling the uploads present with specs of its own, the home a listing describes or each unit a building's documents name or number, read by a buyer or tenant comparing the residences and by the user checking each row against their documents. The property is what the uploads market, whatever address they print for it. A row holds what the uploads print for that dwelling: the words printed on a sheet, a page or a floor plan, as its account quotes them, never what an account says a drawing, a photo or a map shows, the rooms, doors and spaces; each figure as printed, not worked out from other figures, rounded or carried over from another dwelling, a unit mix or the building; and a member no upload prints for that dwelling is empty. A dwelling the uploads only name, picture or mark with a status, with no specs printed for it, has no row. A plan or a row printed for several dwellings, in the form "Unit 4/6", gives each of those dwellings a row of its own carrying what is printed for it, and no row stands for two; a dwelling named in several uploads or on several pages is one row carrying everything they print for it. A commercial space is not a dwelling, nor is a unit-mix row standing for unnamed units, a whole building, a comparable property, a market average or a portfolio total.`,`label: the dwelling's own name as printed, its unit number or name, in the form "201", "Residence 201" or "4B", one dwelling's alone, without a status word and never its street address; a dwelling presented alone, with no unit name, is "Home".`,"beds, baths, sqft: as printed for that dwelling; a studio is one bedroom.",'price: the asking price or monthly rent as written for that dwelling, or, where none is printed, its status word, in the form "Sold" or "Leased".',"floor: the floor of its building the dwelling sits on, as printed; a unit number is not a floor.","hoa_monthly: the HOA, condo or strata fee printed per month for that dwelling; a fee for another period, or for the building, is not its own.","parking: the number of parking spaces printed for that dwelling, a garage counted by its cars; parking printed with no count, or for the building, is not its own.","lot_sqft: the lot printed in square feet for that dwelling, a home's own; a lot the building's dwellings share is not its own.","amenities: what sets this dwelling apart from the other dwellings in its building, each in the few words an upload states it; a feature printed for two of them, or for the building, is the building's, and a standard finish, a note printed on a plan or what the other members already say sets nothing apart. Most dwellings have none.","When no dwelling has specs of its own printed, the table is empty."].join(`
|
|
52
|
-
|
|
53
|
-
`),Lf=xn.short({label:"Unit"}),l8=cn({label:"Beds"}),c8=cn({label:"Baths",decimals:!0}),OC=cn({label:"Sq ft",thousandsSep:!0}),AC=xn.short({label:"Price",cap:40}),CC=xn.short({label:"Building floor(s)",cap:20}),NC=cn({label:"Parking spaces"}),MC=ar({label:"Amenities",max:12,item:xn.short({cap:40})});function RC(e,t){return ar({label:"Floor plans",source:Mr.pick({reads:[e],brief:t}),item:Wu({fields:{image:hi({label:"Floor plan",from:_C}),floor:_h({label:"Floor",from:[...DD],creatable:!0})}})})}function TC(e,t){return ar({label:"Photos",source:Mr.pick({reads:[e],brief:t}),item:hi({label:"Photo",from:j0})})}const u8=_o({title:"Tell us about the units",description:"Add each unit’s details and floor plans so they appear on your website."},ar({label:"Units",source:Mr.write({reads:[Ei],brief:a8}),item:Wu({label:Lf,fields:{label:Lf,beds:l8,baths:c8,sqft:OC,price:AC,floor:CC,hoa_monthly:cn({label:"Monthly HOA fee"}),parking:NC,lot_sqft:cn({label:"Lot sq ft",thousandsSep:!0}),amenities:MC,floor_plans:RC(Lf,i8),photos:TC(Lf,s8)}})})),d8=EC("space"),f8=jC("space"),h8=["The property's commercial spaces: a row for each shop, office suite, restaurant or other non-residential space the uploads present with specs of its own, named or numbered in a building's documents, read by a tenant or investor comparing the spaces and by the user checking each row against their documents. The property is what the uploads market, whatever address they print for it. A row holds what the uploads print for that space: the words printed on a sheet, a page or a floor plan, as its account quotes them, never what an account says a drawing, a photo or a map shows; each figure as printed, not worked out from other figures, rounded or carried over from another space or the building; and a member no upload prints for that space is empty. A space the uploads only name, picture or mark with a status, with no specs printed for it, has no row, and a space named in several uploads or on several pages is one row carrying everything they print for it. A dwelling is not a commercial space, nor is a whole building, a comparable property, a market average or a portfolio total.",`label: the space's own name as printed, in the form "Suite 200" or "Retail A", without a status word and never its street address.`,"use: what the space is for, as printed.","sqft: as printed for that space.",'price: the rent or price as written for that space, or, where none is printed, its status word, in the form "Leased" or "Call for pricing".',"floor: the floor of its building the space sits on, as printed; a suite number is not a floor.","parking: the number of parking spaces printed for that space; parking printed with no count, or for the building, is not its own.","amenities: what sets this space apart from the other spaces in its building, each in the few words an upload states it; a feature printed for two of them, or for the building, is the building's, and a standard fitting, a note printed on a plan or what the other members already say sets nothing apart. Most spaces have none.","When no commercial space has specs of its own printed, the table is empty."].join(`
|
|
54
|
-
|
|
55
|
-
`),If=xn.short({label:"Space"}),p8=_o({title:"Tell us about the commercial spaces",description:"Add each space’s details and floor plans so they appear on your website."},ar({label:"Commercial spaces",source:Mr.write({reads:[Ei],brief:h8}),item:Wu({label:If,fields:{label:If,use:xn.short({label:"Use",cap:40}),sqft:OC,price:AC,floor:CC,parking:NC,amenities:MC,floor_plans:RC(If,d8),photos:TC(If,f8)}})})),m8="The property's comparables: the other properties an upload sets beside the one it markets, so that property's price and specs can be weighed against theirs, read by a buyer or seller judging the price and by the user checking each row against their documents. They appear as the rows of a sales or rent comparables table, as panels with their own photo and figures, as numbered pins in a map legend or as lines in a survey of recent trades. The property the uploads market is the one this request is for, whatever address they print for it; in a building, it is the building and every unit the uploads market in it. It is never a comparable, even in its own comparables table or at the center of a comparables map, and an upload presenting it or one of its units for itself, such as a listing sheet, brochure, price list or market history, presents no comparable; another unit of its building is a comparable only where an upload sets it beside the property as one, such as a sister unit's earlier sale in a comps table. A market or area average, a portfolio total, or anything that is not one property is not a comparable. A row holds what the uploads print for that property, read through every upload whole, a table included where it continues onto the next page: each figure as printed and a listing's remarks word for word, never worked out from other figures or carried over from a neighboring row, a summary or the property itself; a studio is one bedroom; a property listed in several places is one row carrying every figure those places state; a figure no upload prints for it is empty. When no upload sets another property beside the one it markets, the list is empty.",Ry=w0({label:"Address"}),_2=eC({label:"Sale date"}),g8=_o({title:"Which properties compare?",description:"Recently sold or listed homes like this one shape the pricing story."},ar({label:"Comparables",max:50,source:Mr.write({reads:[Ei,Cb],brief:m8}),item:Wu({label:Ry,fields:{address:Ry,price:cn({label:"Price"}),sale_date:_2,beds:cn({label:"Beds"}),baths:cn({label:"Baths",decimals:!0}),sqft:cn({label:"Sq ft"}),photo:hi({label:"Photo"}),year_built:cn({label:"Year built"}),lot_sqft:cn({label:"Lot sq ft"}),stories:cn({label:"Stories",decimals:!0}),units:cn({label:"Units"}),hoa_monthly:cn({label:"HOA per month"}),list_price:cn({label:"List price"}),listed_date:eC({label:"Listed date"}),mls_number:xn.short({label:"MLS number"}),description:xn.long({label:"Description"}),status:_h({label:"Status",from:[...G6],locked:!0,source:Oy({reads:[_2]},e=>Q6(e))}),distance_m:cn({label:"Distance (m)",locked:!0,source:Oy({reads:[Ry,Cb]},(e,t)=>e8(e,t))}),price_period:_h({label:"Price period",from:[...Y6],locked:!0,source:Oy({reads:[kC]},e=>X6(e))})}})})),y8=_o({title:"Who’s on this listing?",description:"Add the contacts for this property, and drag them into the order your marketing shows them."},ar({label:"Contacts",min:1,max:12,source:Mr.pick({reads:[Ei],brief:"The listing's contacts: the people a buyer or tenant reaches about this property, chosen from the library's contacts, in the order the listing presents them, the first or most prominent first. A contact belongs when an upload's name or account says it prints their email or phone, or their full name, as a contact for this listing, an agent, broker, or sales or leasing contact, judged by their name, title, organization, email and phone against what the uploads print. A contact the uploads leave out, where their accounts name the listing's contacts, does not belong, and a shared organization, a matching first name or a name printed in another role, an architect, a photographer or a seller, names no contact. When no upload's account names any contact, there are none."}),item:z6({label:"Contact",from:yr.contacts})})),at=wC("property",{address:Cb,listing_intent:kC,description:_o({title:"Describe the property",description:"Talk it up like you would to a buyer, and our AI writes your website copy."},xn.long({label:"Description"})),uploads:Ei,property_media:j0,floor_plans:_C,property_documents:n8,hero:r8,site_url:o8,units:u8,commercial_spaces:p8,contacts:y8,comparables:g8});HA(at);const b8=["text","number","select","url","email","phone","date"],v8=new Set(b8);function O0(e){return v8.has(e)}function $C(e){return e.type===void 0||!O0(e.type)?!1:e.type!=="text"||e.size===void 0||e.size==="short"}const Nb=new Set(["image","video","tour","document"]);function zC(e){return!(e!==null&&typeof e=="object"&&e.locked===!0)}function A0(e){const t=Object.values(e).filter(zC).map(i=>i!==null&&typeof i=="object"?i:{}),n=t.filter(i=>i.type!==void 0&&Nb.has(i.type)),r=t.filter(i=>!(i.type!==void 0&&Nb.has(i.type)));return n.length===1&&r.length<=2&&r.every($C)}function x8(e){var n;if(((n=e.element)==null?void 0:n.type)!=="object")return null;const t=e.element.fields;return t!==null&&typeof t=="object"?t:{}}function DC(e,t){var i,a;const n=x8(e);if(n!==null)return A0(n)?"annotated-media":"object";const r=(i=e.element)==null?void 0:i.type;return r!==void 0&&Nb.has(r)?"media":r==="media"?((a=e.element)==null?void 0:a.from)===void 0&&t==="home"?"upload":"media":r==="row"?"row":r==="poi"?"poi":"scalar"}const w8={scalar:{expanded:"bullet-list",compact:"bullet-list"},media:{expanded:"gallery",compact:"gallery"},upload:{expanded:"media-manager",compact:"media-manager"},"annotated-media":{expanded:"annotated-gallery",compact:"annotated-gallery"},object:{expanded:"table",compact:"accordion"},row:{expanded:"row-bar",compact:"row-bar"},poi:{expanded:"poi-curation",compact:"poi-curation"}};function LC(e,t,n){const r=DC(e,n),i=r==="object"||r==="annotated-media"?"item":"unit";return{itemKind:r,view:w8[r][t],granularity:i}}function k8(e){return/[^aeiou]ies$/i.test(e)?e.slice(0,-3)+"y":/(?:ss|x|z|ch|sh)es$/i.test(e)?e.slice(0,-2):/[^s]s$/i.test(e)?e.slice(0,-1):e}function IC(e){return/^[A-Z][A-Z]/.test(e)?e:e.charAt(0).toLowerCase()+e.slice(1)}function Rr(e){const t=IC((e??"").trim());if(t==="")return{singular:"item",plural:"items"};const n=t.search(/\S+$/);return{singular:t.slice(0,n)+k8(t.slice(n)),plural:t}}function ed(e){return e.charAt(0).toUpperCase()+e.slice(1)}const _8=["verb","unique","brief","none","reads"];new Set(_8);function S2(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function S8(e){return!S2(e)||!Array.isArray(e.fills)?[]:e.fills.filter(S2).map(t=>({...t,kind:"fill"}))}function C0(e){return e!==null&&typeof e=="object"?e:null}function Is(e){const t=C0(e);if((t==null?void 0:t.kind)!=="row")return null;const{slot:n,field:r}=t;return typeof n!="string"||n===""||typeof r!="string"||r===""?null:{slot:n,field:r}}function N0(e){return Object.entries(e??{}).filter(([,t])=>{var n;return t.type==="row"&&((n=C0(t.source))==null?void 0:n.kind)==="element"}).map(([t])=>t)}function UC(e){const t=new Set(N0(e)),n={};for(const[r,i]of Object.entries(e??{})){const a=Is(i.source);a!==null&&t.has(a.slot)&&(n[r]=a.field)}return n}function Ah(e){var t;if(((t=e.element)==null?void 0:t.type)==="object")return e.element.fields}function E8(e){return Ah(e)!==void 0}function j8(e){const t=C0(e.source);if(t===null||t.kind==="authored")return{kind:"none"};const{kind:n,key:r,section:i,slot:a,transform:c}=t;if(n==="home"&&typeof r=="string"){const u=Qt(r);if(u!==null)return{kind:"table",table:u}}return n==="section"&&typeof i=="string"&&typeof a=="string"?{kind:"section",section:i,slot:a}:n==="derived"&&typeof c=="string"?{kind:"derived",transform:c}:{kind:"other"}}function js(e){return VA(at).has(e)}function PC(e){const t=VA(at).get(e);if(t===void 0)throw new Error(`fact registry: "${e}" names no property fact`);return t}function M0(e){return PC(e).value_type}function O8(){return gL(at)}function A8(e){return typeof e=="string"&&O8().includes(e)}function C8(e){if(!js(e))return;const t=PC(e).declaration;return t.type==="select"?t.values:void 0}function N8(e){return typeof e=="string"?e:null}function M8(e){const t=Kn(e);return t===void 0?null:{media:t}}function R8(e,t){const[,n="",r]=e.split("."),i=t[n];switch(M0(`property.${n}`)){case"address":{const a=en(i);return r===void 0?a:a===null?null:a[r]}case"image":return M8(i);case"number":return typeof i=="number"?i:null;case"text":return N8(i)}}function Sp(e){return GA(fi(e)==="library"?yr:at,e)}function R0(e,t){return QA(Sp(e),t)}function E2(e){return Object.keys(Sp(e))}function T0(e,t){if(t==="id")return{kind:"identity"};const n=t.indexOf("."),r=n===-1?t:t.slice(0,n),i=Xu(e,r)??null;if(i===null)return{kind:"unknown",offers:E2(e)};if(n!==-1){const a=t.slice(n+1);return i!=="address"?{kind:"unknown",offers:E2(e)}:gp(a)?{kind:"member",value_type:ZA(a),storable:Ch(e,t)}:{kind:"unknown",offers:mp.map(c=>`${r}.${c}`)}}return{kind:"member",value_type:i,storable:Ch(e,t)}}function Ch(e,t){if(t===void 0){if(Qt(e)!==null)return!0;if(!js(e))return!1;const r=e.slice(0,e.lastIndexOf("."));return!(js(r)&&M0(r)==="address")}if(!m0().includes(e))return!1;const n=R0(e,t);return n!==void 0&&!yL(n)}function T8(e,t){const n=t.source;return(n==null?void 0:n.kind)!=="row"||typeof n.field!="string"||T0(e,n.field).kind==="unknown"?null:n.field}function $0(e,t){if(t==null)return null;const n=T8(t,e);if(n===null)return null;const r=R0(t,n),i=r===void 0?null:Yu(r);if(r===void 0||i==null)return null;const a=wb(r);return{table:t,member:n,value_type:i,...a!==void 0?{filter:a}:{}}}const Ep={kind:"owned"};function j2(e){return e===null?Ep:{kind:"picked",filter:e}}function dl(e,t){if(e.from!==void 0)return j2(pu(e));const n=$0(e,t);return n===null?null:n.filter===void 0?Ep:j2(pu({type:e.type,from:n.filter.from}))}function jp(e,t){return dl(e,t)??Ep}function $8(e,t,n){return dl(t,n)??dl({...t,source:e.source},n)}function z8(e,t,n){var i;const r=dl(t,n.itemTable);return r!==null?r:n.picksBy!==null&&((i=t.source)==null?void 0:i.kind)==="element"?{kind:"picked",filter:n.picksBy}:dl({...t,source:e.source},n.listTable)??Ep}const O2=1e-6;function D8(e,t){return e.w/e.h>t?{w:e.h*t,h:e.h}:{w:e.w,h:e.w/t}}function L8(e,t){const n=Math.max(e.w,e.h*t);return{w:n,h:n/t}}function I8(e,t){const n=Math.min(1,t.width/e.w,t.height/e.h);return{w:e.w*n,h:e.h*n}}function A2(e,t,n){const r=(i,a,c)=>Math.min(Math.max(i-a/2,0),c-a);return{x:r(t.x,e.w,n.width),y:r(t.y,e.h,n.height),w:e.w,h:e.h}}function U8(e,t,n,r){const i=L8(e,r);return i.w<=n.width+O2&&i.h<=n.height+O2?A2(I8(i,n),{x:e.x+e.w/2,y:e.y+e.h/2},n):A2(D8({w:n.width,h:n.height},r),t,n)}const C2=16/10;function La(e){if(e===null||typeof e!="object")return null;const t=e,[n,r,i,a]=["x","y","width","height"].map(c=>t[c]);return![n,r,i,a].every(c=>typeof c=="number"&&Number.isFinite(c))||n===0&&r===0&&i===1&&a===1?null:{x:n,y:r,width:i,height:a}}function FC(e){var a;if(e===null||typeof e!="object")return{mode:"free",aspect:C2};const t=e,n=typeof t.aspect=="number"&&t.aspect>0?t.aspect:C2,r=(a=t.mobile)==null?void 0:a.aspect,i=typeof r=="number"&&r>0&&Math.abs(r-n)>1e-4?r:void 0;return{mode:t.mode==="free"?"free":"locked",aspect:n,...i===void 0?{}:{mobileAspect:i}}}function Os(e,t){if(e===null||t===null)return e===t;const n=r=>Math.round(r*1e4)/1e4;return n(e.x)===n(t.x)&&n(e.y)===n(t.y)&&n(e.width)===n(t.width)&&n(e.height)===n(t.height)}function P8(e,t,n){const{width:r,height:i}=t,a={x:e.x*r,y:e.y*i,w:e.width*r,h:e.height*i},c=U8(a,{x:a.x+a.w/2,y:a.y+a.h/2},t,n),u={x:c.x/r,y:c.y/i,width:c.w/r,height:c.h/i};return Os(u,{x:0,y:0,width:1,height:1})?null:u}function N2(e,t,n){return e===null||n===null?e:t===null?null:P8(e,t,n)}function BC(e,t){if(e===null||!(e>0)||!(t>0))return null;const n=Math.min(1,t/e),r=Math.min(1,e/t),i={x:(1-n)/2,y:0,width:n,height:r};return Os(i,{x:0,y:0,width:1,height:1})?null:i}function F8(e,t,n){var c,u;const r=Nl(e).get(n);if(r===void 0)return;const i=wo(t)??[kh],a=[...i,...Es(i[0]).slice(1).filter(f=>!i.includes(f))];for(const f of a){const p=(u=(c=BA(e,f))==null?void 0:c.find(({id:y})=>y===n))==null?void 0:u.value;if(p!==void 0)return xo(p)?bp(r,p):r}return r}function B8(e,t,n){const r=t.width!==null&&t.height!==null&&t.width>0&&t.height>0?{width:t.width,height:t.height}:null,i=N2(e.crop,r,n.mode==="free"?null:n.aspect),a=i===null||n.mobileAspect===void 0?null:N2(e.crop,r,n.mobileAspect),c=Object.values(e.renditions).some(u=>u!==null);return{file:e.file,picked:e.id,name:e.name,...i===null?{}:{crop:i},...r===null?{}:{ar:r.width/r.height},...a===null?{}:{mobile:{crop:a,derived:!0}},...c?{renditions:e.renditions}:{}}}function z0(e){var i;const{mode:t,aspect:n,mobileAspect:r}=FC(e.crop);return{mode:t,aspect:n,aspectLabel:(i=e.crop)==null?void 0:i.aspectLabel,mobileAspect:r}}function fl(e){return e==null?null:{nx:e.x,ny:e.y,nw:e.width,nh:e.height}}function Mb(e){return H8(e)?null:{x:e.nx,y:e.ny,width:e.nw,height:e.nh}}function Nh(e,t,n){if(e==="free")return{nx:0,ny:0,nw:1,nh:1};const r=BC(t,n);return r===null?{nx:0,ny:0,nw:1,nh:1}:{nx:r.x,ny:r.y,nw:r.width,nh:r.height}}function M2(e,t,n){const r=e.nx+e.nw/2,i=e.ny+e.nh/2;if(!t||!n)return{...e};const a=t/n;let c=e.nw,u=c/a;return u>e.nh&&(u=e.nh,c=u*a),{nx:r-c/2,ny:i-u/2,nw:c,nh:u}}function H8(e){const t=n=>Math.round(n*1e4)/1e4;return t(e.nx)===0&&t(e.ny)===0&&t(e.nw)===1&&t(e.nh)===1}function q8(e,t,n,r){const i=e==null?void 0:e.rect;return i&&i.nw&&i.nh?{nx:i.nx,ny:i.ny,nw:i.nw,nh:i.nh}:Nh(t,n,r)}const Wo=52,V8=1,Z8=6,K8=.94,ln=(e,t,n)=>n<t?t:Math.max(t,Math.min(n,e));function Uf(e,t,n,r,i,a,c){e=Math.max(Wo,e);const u=i>0?c.r-n:n-c.l;e=Math.min(e,u);let f=e/t;const p=a>0?c.b-r:r-c.t;return f>p&&(f=p,e=f*t),{w:Math.max(Wo,e),h:Math.max(Wo,e/t)}}function G8({src:e,mode:t,aspect:n,seed:r}){const i=w.useRef(null),[,a]=w.useReducer(U=>U+1,0),c=w.useRef(null),u=w.useRef({w:0,h:0}),f=w.useRef({z:1,icx:0,icy:0}),p=w.useRef({x:0,y:0,w:0,h:0}),y=w.useRef(!1),m=w.useRef(r??null),[x,v]=w.useState(null),_=()=>{const U=c.current,D=u.current;if(!U||!D.w)return{w:0,h:0};const K=Math.min(D.w/U.w,D.h/U.h)*K8;return{w:U.w*K,h:U.h*K}},k=()=>{const U=_(),D=f.current,K=U.w*D.z,M=U.h*D.z;return{l:D.icx-K/2,t:D.icy-M/2,r:D.icx+K/2,b:D.icy+M/2,w:K,h:M}},S=()=>{const U=k(),D=u.current;return{l:Math.max(U.l,0),t:Math.max(U.t,0),r:Math.min(U.r,D.w),b:Math.min(U.b,D.h)}},j=()=>{const U=k(),D=p.current,K=f.current,M=U.w/2,B=U.h/2;U.w>=D.w&&(K.icx=ln(K.icx,D.x+D.w-M,D.x+M)),U.h>=D.h&&(K.icy=ln(K.icy,D.y+D.h-B,D.y+B))},O=()=>{const U=p.current,D=S(),K=D.r-D.l,M=D.b-D.t;if(t==="locked"){let B=Math.min(U.w,K),X=B/n;X>M&&(X=M,B=X*n),U.w=B,U.h=X}else U.w=Math.min(U.w,K),U.h=Math.min(U.h,M);U.x=ln(U.x,D.l,D.r-U.w),U.y=ln(U.y,D.t,D.b-U.h)},A=()=>{O(),j(),O()},$=U=>{const D=u.current;if(!D.w||!c.current)return;f.current={z:1,icx:D.w/2,icy:D.h/2};const K=k(),M=c.current.w/c.current.h,B=U?q8(m.current,t,M,n):Nh(t,M,n);p.current={x:K.l+B.nx*K.w,y:K.t+B.ny*K.h,w:B.nw*K.w,h:B.nh*K.h},A(),y.current=!0,a()};w.useEffect(()=>{y.current=!1,c.current=null,a();const U=new Image;U.onload=()=>{c.current={w:U.naturalWidth||1,h:U.naturalHeight||1},$(!0)},U.src=e},[e]),w.useEffect(()=>{m.current=r??null},[r]),w.useEffect(()=>{c.current&&$(!1)},[t,n]),w.useLayoutEffect(()=>{const U=i.current;if(!U)return;const D=()=>{const M=U.getBoundingClientRect(),B=u.current.w;u.current={w:M.width,h:M.height},!B&&c.current?$(!0):B&&(A(),a())};D();const K=new ResizeObserver(D);return K.observe(U),()=>K.disconnect()},[]);const C=U=>{const D=i.current.getBoundingClientRect();return{x:U.clientX-D.left,y:U.clientY-D.top}},I=U=>{var X,se;if(U.button)return;U.stopPropagation(),(se=(X=U.currentTarget).setPointerCapture)==null||se.call(X,U.pointerId),v("move");const D=C(U),K={...p.current},M=J=>{const P=C(J),Y=S(),L=p.current;L.x=ln(K.x+(P.x-D.x),Y.l,Y.r-L.w),L.y=ln(K.y+(P.y-D.y),Y.t,Y.b-L.h),a()},B=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),v(null)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B)},z=U=>D=>{var J,P;if(D.button)return;D.stopPropagation(),(P=(J=D.currentTarget).setPointerCapture)==null||P.call(J,D.pointerId),v(U);const K=p.current,M={l:K.x,t:K.y,r:K.x+K.w,b:K.y+K.h},B=C(D),X=Y=>{const L=C(Y),Z=S(),ne=L.x-B.x,fe=L.y-B.y;let de=M.l,pe=M.t,N=M.r,ee=M.b;if(t==="free")U.includes("w")&&(de=ln(M.l+ne,Z.l,N-Wo)),U.includes("e")&&(N=ln(M.r+ne,de+Wo,Z.r)),U.includes("n")&&(pe=ln(M.t+fe,Z.t,ee-Wo)),U.includes("s")&&(ee=ln(M.b+fe,pe+Wo,Z.b));else{const le=n;if(U==="se"){const xe=Uf(M.r+ne-M.l,le,M.l,M.t,1,1,Z);de=M.l,pe=M.t,N=de+xe.w,ee=pe+xe.h}else if(U==="nw"){const xe=Uf(M.r-(M.l+ne),le,M.r,M.b,-1,-1,Z);N=M.r,ee=M.b,de=N-xe.w,pe=ee-xe.h}else if(U==="ne"){const xe=Uf(M.r+ne-M.l,le,M.l,M.b,1,-1,Z);de=M.l,ee=M.b,N=de+xe.w,pe=ee-xe.h}else if(U==="sw"){const xe=Uf(M.r-(M.l+ne),le,M.r,M.t,-1,1,Z);N=M.r,pe=M.t,de=N-xe.w,ee=pe+xe.h}else{const xe=(M.l+M.r)/2,_e=(M.t+M.b)/2;let Oe=K.w,be=K.h;U==="e"?Oe=(M.r+ne-xe)*2:U==="w"?Oe=(xe-(M.l+ne))*2:U==="s"?(be=(M.b+fe-_e)*2,Oe=be*le):U==="n"&&(be=(_e-(M.t+fe))*2,Oe=be*le),Oe=Math.max(Wo,Oe),be=Oe/le,Oe=Math.min(Oe,Z.r-Z.l),be=Oe/le,be>Z.b-Z.t&&(be=Z.b-Z.t,Oe=be*le),de=ln(xe-Oe/2,Z.l,Z.r-Oe),pe=ln(_e-be/2,Z.t,Z.b-be),N=de+Oe,ee=pe+be}}p.current={x:de,y:pe,w:N-de,h:ee-pe},a()},se=()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",se),window.removeEventListener("pointercancel",se),v(null)};window.addEventListener("pointermove",X),window.addEventListener("pointerup",se),window.addEventListener("pointercancel",se)},T=(U,D,K)=>{const M=f.current;U=ln(U,V8,Z8);const B=U/M.z;M.icx=D+(M.icx-D)*B,M.icy=K+(M.icy-K)*B,M.z=U,A(),a()},F=U=>{const D=u.current;T(f.current.z*U,D.w/2,D.h/2)},W=w.useRef(()=>{});W.current=U=>{U.preventDefault();const D=u.current,K=Math.exp(-U.deltaY*.0015*(U.ctrlKey?2.6:1));T(f.current.z*K,D.w/2,D.h/2)},w.useEffect(()=>{const U=i.current;if(!U)return;const D=K=>W.current(K);return U.addEventListener("wheel",D,{passive:!1}),()=>U.removeEventListener("wheel",D)},[]);const G=()=>$(!1),H=()=>{const U=k(),D=p.current;return U.w?{nx:ln((D.x-U.l)/U.w,0,1),ny:ln((D.y-U.t)/U.h,0,1),nw:ln(D.w/U.w,0,1),nh:ln(D.h/U.h,0,1)}:{nx:0,ny:0,nw:1,nh:1}};return{stageRef:i,ready:y.current,activeHandle:x,imgRect:k,box:p.current,view:f.current,onBoxDown:I,onHandleDown:z,zoomBy:F,reset:G,cropValue:H,natAspect:c.current?c.current.w/c.current.h:null}}function Y8({chrome:e,pct:t,onZoomOut:n,onZoomIn:r,resetSlot:i,children:a}){return h.jsxs("div",{className:e.foot,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex h-9 items-center overflow-hidden rounded-[9px] border border-line",children:[h.jsx("button",{type:"button",className:"grid size-9 place-items-center text-ink-2 hover:bg-[#f1f0ea] hover:text-ink",onClick:n,"aria-label":"Zoom out",children:h.jsx(e.ZoomOutIcon,{})}),h.jsx("span",{className:"grid h-9 min-w-[54px] place-items-center border-x border-line font-mono text-[12px] text-ink-2",children:t}),h.jsx("button",{type:"button",className:"grid size-9 place-items-center text-ink-2 hover:bg-[#f1f0ea] hover:text-ink",onClick:r,"aria-label":"Zoom in",children:h.jsx(e.ZoomInIcon,{})})]})]}),h.jsx("div",{className:e.actions,children:a})]})}const Q8=["n","s","e","w"],X8=["nw","ne","sw","se"];function W8({cr:e,mode:t,src:n,stageClassName:r}){const i=e.imgRect(),a=e.box,c=e.activeHandle!==null;return h.jsx("div",{className:`we-cs-stage ${r}`,ref:e.stageRef,children:e.ready&&h.jsxs(h.Fragment,{children:[h.jsx("img",{className:"we-cs-img",src:n,alt:"",draggable:!1,style:{left:i.l,top:i.t,width:i.w,height:i.h}}),h.jsxs("div",{className:`we-cs-box${c?" live":""}`,"data-mode":t,"data-crop-box":!0,style:{left:a.x,top:a.y,width:a.w,height:a.h},onPointerDown:e.onBoxDown,children:[h.jsx("div",{className:"we-cs-ring"}),h.jsxs("div",{className:"we-cs-thirds",children:[h.jsx("i",{}),h.jsx("i",{}),h.jsx("i",{}),h.jsx("i",{})]}),Q8.map(u=>h.jsx("div",{"data-crop-handle":u,className:`we-cs-h edge ${u}`,onPointerDown:e.onHandleDown(u)},u)),X8.map(u=>h.jsx("div",{"data-crop-handle":u,className:`we-cs-h corner ${u}`,onPointerDown:e.onHandleDown(u)},u))]})]})})}const J8=w.forwardRef(function({chrome:t,src:n,mode:r,aspect:i,seed:a,stageClassName:c="h-[412px]",footerActions:u,onUserEdit:f},p){const y=G8({src:n,mode:r,aspect:i,seed:a});w.useImperativeHandle(p,()=>({cropValue:()=>y.cropValue(),natAspect:()=>y.natAspect}),[y]);const m=Math.round(y.view.z*100)+"%",x=w.useRef(!1),v=w.useRef(!1),_=()=>{v.current=!0},k=()=>{v.current&&!x.current&&(x.current=!0,f==null||f())},S=()=>{v.current=!1};return h.jsxs(h.Fragment,{children:[h.jsx("div",{onPointerDownCapture:_,onPointerMoveCapture:k,onPointerUpCapture:S,children:h.jsx(W8,{cr:y,mode:r,src:n,stageClassName:c})}),h.jsx(Y8,{chrome:t,pct:m,onZoomOut:()=>y.zoomBy(1/1.25),onZoomIn:()=>y.zoomBy(1.25),resetSlot:h.jsx("button",{type:"button",className:t.buttonLink,onClick:y.reset,children:"Reset"}),children:u})]})});function HC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=HC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Op(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=HC(e))&&(r&&(r+=" "),r+=t);return r}const eI=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},tI=(e,t)=>({classGroupId:e,validator:t}),qC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Mh="-",R2=[],nI="arbitrary..",rI=e=>{const t=iI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return oI(c);const u=c.split(Mh),f=u[0]===""&&u.length>1?1:0;return VC(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],p=n[c];return f?p?eI(p,f):f:p||R2}return n[c]||R2}}},VC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=VC(e,t+1,a);if(p)return p}const c=n.validators;if(c===null)return;const u=t===0?e.join(Mh):e.slice(t).join(Mh),f=c.length;for(let p=0;p<f;p++){const y=c[p];if(y.validator(u))return y.classGroupId}},oI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?nI+r:void 0})(),iI=e=>{const{theme:t,classGroups:n}=e;return sI(n,t)},sI=(e,t)=>{const n=qC();for(const r in e){const i=e[r];D0(i,n,r,t)}return n},D0=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const c=e[a];aI(c,t,n,r)}},aI=(e,t,n,r)=>{if(typeof e=="string"){lI(e,t,n);return}if(typeof e=="function"){cI(e,t,n,r);return}uI(e,t,n,r)},lI=(e,t,n)=>{const r=e===""?t:ZC(t,e);r.classGroupId=n},cI=(e,t,n,r)=>{if(dI(e)){D0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(tI(n,e))},uI=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let c=0;c<a;c++){const[u,f]=i[c];D0(f,ZC(t,u),n,r)}},ZC=(e,t)=>{let n=e;const r=t.split(Mh),i=r.length;for(let a=0;a<i;a++){const c=r[a];let u=n.nextPart.get(c);u||(u=qC(),n.nextPart.set(c,u)),n=u}return n},dI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,fI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,c)=>{n[a]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let c=n[a];if(c!==void 0)return c;if((c=r[a])!==void 0)return i(a,c),c},set(a,c){a in n?n[a]=c:i(a,c)}}},Rb="!",T2=":",hI=[],$2=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let c=0,u=0,f=0,p;const y=i.length;for(let k=0;k<y;k++){const S=i[k];if(c===0&&u===0){if(S===T2){a.push(i.slice(f,k)),f=k+1;continue}if(S==="/"){p=k;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const m=a.length===0?i:i.slice(f);let x=m,v=!1;m.endsWith(Rb)?(x=m.slice(0,-1),v=!0):m.startsWith(Rb)&&(x=m.slice(1),v=!0);const _=p&&p>f?p-f:void 0;return $2(a,v,x,_)};if(t){const i=t+T2,a=r;r=c=>c.startsWith(i)?a(c.slice(i.length)):$2(hI,!1,c,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},mI=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const c=n[a],u=c[0]==="[",f=t.has(c);u||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(c)):i.push(c)}return i.length>0&&(i.sort(),r.push(...i)),r}},gI=e=>({cache:fI(e.cacheSize),parseClassName:pI(e),sortModifiers:mI(e),postfixLookupClassGroupIds:yI(e),...rI(e)}),yI=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},bI=/\s+/,vI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:c}=t,u=[],f=e.trim().split(bI);let p="";for(let y=f.length-1;y>=0;y-=1){const m=f[y],{isExternal:x,modifiers:v,hasImportantModifier:_,baseClassName:k,maybePostfixModifierPosition:S}=n(m);if(x){p=m+(p.length>0?" "+p:p);continue}let j=!!S,O;if(j){const z=k.substring(0,S);O=r(z);const T=O&&c[O]?r(k):void 0;T&&T!==O&&(O=T,j=!1)}else O=r(k);if(!O){if(!j){p=m+(p.length>0?" "+p:p);continue}if(O=r(k),!O){p=m+(p.length>0?" "+p:p);continue}j=!1}const A=v.length===0?"":v.length===1?v[0]:a(v).join(":"),$=_?A+Rb:A,C=$+O;if(u.indexOf(C)>-1)continue;u.push(C);const I=i(O,j);for(let z=0;z<I.length;++z){const T=I[z];u.push($+T)}p=m+(p.length>0?" "+p:p)}return p},xI=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=KC(n))&&(i&&(i+=" "),i+=r);return i},KC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=KC(e[r]))&&(n&&(n+=" "),n+=t);return n},wI=(e,...t)=>{let n,r,i,a;const c=f=>{const p=t.reduce((y,m)=>m(y),e());return n=gI(p),r=n.cache.get,i=n.cache.set,a=u,u(f)},u=f=>{const p=r(f);if(p)return p;const y=vI(f,n);return i(f,y),y};return a=c,(...f)=>a(xI(...f))},kI=[],Kt=e=>{const t=n=>n[e]||kI;return t.isThemeGetter=!0,t},GC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_I=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,SI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qo=e=>_I.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Sr=e=>!!e&&Number.isInteger(Number(e)),Ty=e=>e.endsWith("%")&&qe(e.slice(0,-1)),to=e=>SI.test(e),QC=()=>!0,CI=e=>EI.test(e)&&!jI.test(e),L0=()=>!1,NI=e=>OI.test(e),MI=e=>AI.test(e),RI=e=>!je(e)&&!Ae(e),TI=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),$I=e=>ji(e,JC,L0),je=e=>GC.test(e),Wi=e=>ji(e,eN,CI),z2=e=>ji(e,BI,qe),zI=e=>ji(e,nN,QC),DI=e=>ji(e,tN,L0),D2=e=>ji(e,XC,L0),LI=e=>ji(e,WC,MI),Pf=e=>ji(e,rN,NI),Ae=e=>YC.test(e),Fc=e=>Us(e,eN),II=e=>Us(e,tN),L2=e=>Us(e,XC),UI=e=>Us(e,JC),PI=e=>Us(e,WC),Ff=e=>Us(e,rN,!0),FI=e=>Us(e,nN,!0),ji=(e,t,n)=>{const r=GC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Us=(e,t,n=!1)=>{const r=YC.exec(e);return r?r[1]?t(r[1]):n:!1},XC=e=>e==="position"||e==="percentage",WC=e=>e==="image"||e==="url",JC=e=>e==="length"||e==="size"||e==="bg-size",eN=e=>e==="length",BI=e=>e==="number",tN=e=>e==="family-name",nN=e=>e==="number"||e==="weight",rN=e=>e==="shadow",HI=()=>{const e=Kt("color"),t=Kt("font"),n=Kt("text"),r=Kt("font-weight"),i=Kt("tracking"),a=Kt("leading"),c=Kt("breakpoint"),u=Kt("container"),f=Kt("spacing"),p=Kt("radius"),y=Kt("shadow"),m=Kt("inset-shadow"),x=Kt("text-shadow"),v=Kt("drop-shadow"),_=Kt("blur"),k=Kt("perspective"),S=Kt("aspect"),j=Kt("ease"),O=Kt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...$(),Ae,je],I=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],T=()=>[Ae,je,f],F=()=>[Qo,"full","auto",...T()],W=()=>[Sr,"none","subgrid",Ae,je],G=()=>["auto",{span:["full",Sr,Ae,je]},Sr,Ae,je],H=()=>[Sr,"auto",Ae,je],U=()=>["auto","min","max","fr",Ae,je],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...T()],B=()=>[Qo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],X=()=>[Qo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],se=()=>[Qo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],J=()=>[e,Ae,je],P=()=>[...$(),L2,D2,{position:[Ae,je]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",UI,$I,{size:[Ae,je]}],Z=()=>[Ty,Fc,Wi],ne=()=>["","none","full",p,Ae,je],fe=()=>["",qe,Fc,Wi],de=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>[qe,Ty,L2,D2],ee=()=>["","none",_,Ae,je],le=()=>["none",qe,Ae,je],xe=()=>["none",qe,Ae,je],_e=()=>[qe,Ae,je],Oe=()=>[Qo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[to],breakpoint:[to],color:[QC],container:[to],"drop-shadow":[to],ease:["in","out","in-out"],font:[RI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[to],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[to],shadow:[to],spacing:["px",qe],text:[to],"text-shadow":[to],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qo,je,Ae,S]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,je]}],"container-named":[TI],columns:[{columns:[qe,je,Ae,u]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Sr,"auto",Ae,je]}],basis:[{basis:[Qo,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Qo,"auto","initial","none",je]}],grow:[{grow:["",qe,Ae,je]}],shrink:[{shrink:["",qe,Ae,je]}],order:[{order:[Sr,"first","last","none",Ae,je]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[u,"screen",...B()]}],"min-w":[{"min-w":[u,"screen","none",...B()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,Fc,Wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,FI,zI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ty,je]}],"font-family":[{font:[II,DI,t]}],"font-features":[{"font-features":[je]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ae,je]}],"line-clamp":[{"line-clamp":[qe,"none",Ae,z2]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",Ae,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ae,Wi]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[qe,"auto",Ae,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[Sr,Ae,je]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sr,Ae,je],radial:["",Ae,je],conic:[Sr,Ae,je]},PI,LI]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ae,je]}],"outline-w":[{outline:["",qe,Fc,Wi]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",y,Ff,Pf]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",m,Ff,Pf]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[qe,Wi]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",x,Ff,Pf]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[qe,Ae,je]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":N()}],"mask-image-linear-to-pos":[{"mask-linear-to":N()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":N()}],"mask-image-t-to-pos":[{"mask-t-to":N()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":N()}],"mask-image-r-to-pos":[{"mask-r-to":N()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":N()}],"mask-image-b-to-pos":[{"mask-b-to":N()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":N()}],"mask-image-l-to-pos":[{"mask-l-to":N()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":N()}],"mask-image-x-to-pos":[{"mask-x-to":N()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":N()}],"mask-image-y-to-pos":[{"mask-y-to":N()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[Ae,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":N()}],"mask-image-radial-to-pos":[{"mask-radial-to":N()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":$()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":N()}],"mask-image-conic-to-pos":[{"mask-conic-to":N()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,je]}],filter:[{filter:["","none",Ae,je]}],blur:[{blur:ee()}],brightness:[{brightness:[qe,Ae,je]}],contrast:[{contrast:[qe,Ae,je]}],"drop-shadow":[{"drop-shadow":["","none",v,Ff,Pf]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",qe,Ae,je]}],"hue-rotate":[{"hue-rotate":[qe,Ae,je]}],invert:[{invert:["",qe,Ae,je]}],saturate:[{saturate:[qe,Ae,je]}],sepia:[{sepia:["",qe,Ae,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,je]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ae,je]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ae,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ae,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ae,je]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ae,je]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ae,je]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ae,je]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ae,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ae,je]}],ease:[{ease:["linear","initial",j,Ae,je]}],delay:[{delay:[qe,Ae,je]}],animate:[{animate:["none",O,Ae,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ae,je]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Ae,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],zoom:[{zoom:[Sr,Ae,je]}],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":J()}],"scrollbar-track-color":[{"scrollbar-track":J()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,je]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[qe,Fc,Wi,z2]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ap=wI(HI);function I2(...e){return Ap(Op(e))}function qI({view:e,onChange:t,className:n}){const r=(i,a,c)=>h.jsx("button",{type:"button","aria-label":a,"aria-pressed":e===i,onClick:()=>t(i),className:I2("flex h-7 w-8 items-center justify-center rounded-[6px] transition-[background,color] duration-[120ms]",e===i?"bg-white text-ink shadow-sm":"text-white/85 hover:text-white"),children:h.jsx("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:h.jsx("path",{d:c})})});return h.jsxs("div",{className:I2("inline-flex gap-0.5 rounded-[8px] bg-[rgba(15,18,9,0.55)] p-0.5 backdrop-blur",n),children:[r("desktop","Desktop crop","M3 5h18v11H3zM8 20h8M12 16v4"),r("mobile","Mobile crop","M8 3h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zM11 18h2")]})}const VI=(e,t)=>{const n=r=>Math.round(r*1e4)/1e4;return n(e.nx)===n(t.nx)&&n(e.ny)===n(t.ny)&&n(e.nw)===n(t.nw)&&n(e.nh)===n(t.nh)};function I0({chrome:e,open:t=!0,src:n,mode:r,aspect:i,mobileAspect:a,seed:c,mobileSeed:u,onApply:f,onClose:p,title:y="Crop photo",subtitle:m,variant:x="crop",stageClassName:v="h-[412px]"}){const[_]=w.useState(n),k=a!=null&&Math.abs(a-i)>1e-4,[S,j]=w.useState("desktop"),[O,A]=w.useState({desktop:(c==null?void 0:c.rect)??null,mobile:(u==null?void 0:u.rect)??null}),$=w.useRef(!(u!=null&&u.rect)),C=w.useRef(null),I=D=>D==="mobile"?a??i:i,z=()=>{var D;return((D=C.current)==null?void 0:D.natAspect())??i},T=D=>!(c!=null&&c.rect)&&(D===null||VI(D,Nh(r,z(),i))),F=D=>({rect:D==="desktop"?O.desktop:O.mobile}),W=()=>{var D;return((D=C.current)==null?void 0:D.cropValue())??null},G=D=>{if(D===S)return;const K=W();A(M=>{const B={...M,[S]:K??M[S]};if(S==="desktop"&&$.current){const X=B.desktop??K;B.mobile=X&&!T(X)?M2(X,a??i,z()):null}return B}),j(D)},H=()=>{S==="mobile"&&($.current=!1)},U=()=>{const D=W(),K=z(),M=(S==="desktop"?D:O.desktop)??D??{nx:0,ny:0,nw:1,nh:1};let B={rect:M,ar:K};if(k){let X=S==="mobile"?D:O.mobile;X||(X=T(M)?Nh(r,K,a??i):M2(M,a??i,K)),B={...B,mobile:{rect:X,derived:$.current}}}f(B)};return h.jsxs(e.Shell,{open:t,variant:x,onClose:p,children:[h.jsxs("div",{className:e.head,children:[h.jsxs("div",{className:e.titles,children:[h.jsx("h2",{className:e.title,children:y}),m?h.jsx("span",{className:e.subtitle,children:m}):null]}),h.jsx("button",{className:e.close,onClick:p,"aria-label":"Close",children:h.jsx(e.CloseIcon,{})})]}),h.jsxs("div",{className:"relative",children:[k&&h.jsx(qI,{view:S,onChange:G,className:"absolute right-3 top-3 z-10"}),h.jsx(J8,{ref:C,chrome:e,src:_,mode:r,aspect:I(S),seed:F(S),stageClassName:v,onUserEdit:H,footerActions:h.jsxs(h.Fragment,{children:[h.jsx("button",{className:e.buttonGhost,onClick:p,children:"Cancel"}),h.jsx("button",{className:e.buttonPrimary,onClick:U,children:"Apply crop"})]})},S)]})]})}const U2=e=>{let t;const n=new Set,r=(p,y)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const x=t;t=y??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,x))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p))},f=t=e(r,i,u);return u},ZI=(e=>e?U2(e):U2),KI=e=>e;function oN(e,t=KI){const n=ci.useSyncExternalStore(e.subscribe,ci.useCallback(()=>t(e.getState()),[e,t]),ci.useCallback(()=>t(e.getInitialState()),[e,t]));return ci.useDebugValue(n),n}const P2=e=>{const t=ZI(e),n=r=>oN(t,r);return Object.assign(n,t),n},U0=(e=>e?P2(e):P2),ou=U0(e=>({noticeByKey:{},dismissedFailures:{},notice:(t,n)=>e(r=>r.noticeByKey[t]===n?r:{noticeByKey:{...r.noticeByKey,[t]:n}}),clearNotice:t=>e(n=>{if(!(t in n.noticeByKey))return n;const r={...n.noticeByKey};return delete r[t],{noticeByKey:r}}),dismissFailure:t=>e(n=>n.dismissedFailures[t]?n:{dismissedFailures:{...n.dismissedFailures,[t]:!0}})}));function GI(e,t,n){return`${e}#${t}#${n}`}function YI(e){return ou(t=>t.noticeByKey[e])}const QI=12e4;function ao(e){return`${e.holder}#${e.mediaId}`}const Wc=U0((e,t)=>({byPlace:{},start:(n,r,i)=>{const a=ao(n),c={propertyId:r,place:n,crop:i};e(u=>({byPlace:{...u.byPlace,[a]:c}})),setTimeout(()=>{t().byPlace[a]===c&&t().settle(n)},QI)},settle:n=>e(r=>{const i=ao(n);if(!(i in r.byPlace))return r;const a={...r.byPlace};return delete a[i],{byPlace:a}})})),ah={dimOpacity:.35,grayscale:.4,transitionMs:120,spinner:{diameter:28,stroke:3,trackColor:"rgba(20,18,13,.18)",headColor:"rgba(20,18,13,.6)",spinDurationMs:800}},iN={opacity:ah.dimOpacity,filter:`grayscale(${ah.grayscale})`,transition:`opacity ${ah.transitionMs}ms`};function XI(){if(typeof document>"u"||document.getElementById("recrop-spin-kf"))return;const e=document.createElement("style");e.id="recrop-spin-kf",e.textContent="@keyframes recrop-spin{to{transform:rotate(360deg)}}",document.head.appendChild(e)}function P0({label:e="Re-cropping…"}={}){XI();const t=ah.spinner;return h.jsx("div",{"data-recrop-loading":!0,role:"status","aria-label":e,className:"pointer-events-none absolute inset-0 z-[5] grid place-items-center",children:h.jsx("span",{"aria-hidden":!0,style:{width:t.diameter,height:t.diameter,border:`${t.stroke}px solid ${t.trackColor}`,borderTopColor:t.headColor,borderRadius:"50%",animation:`recrop-spin ${t.spinDurationMs}ms linear infinite`}})})}var Rl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ls,ei,Ga,mA,WI=(mA=class extends Rl{constructor(){super();Me(this,ls);Me(this,ei);Me(this,Ga);we(this,Ga,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,ei)||this.setEventListener(q(this,Ga))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ei))==null||t.call(this),we(this,ei,void 0))}setEventListener(t){var n;we(this,Ga,t),(n=q(this,ei))==null||n.call(this),we(this,ei,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){q(this,ls)!==t&&(we(this,ls,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof q(this,ls)=="boolean"?q(this,ls):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ls=new WeakMap,ei=new WeakMap,Ga=new WeakMap,mA),F0=new WI,JI={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ti,t0,gA,eU=(gA=class{constructor(){Me(this,ti,JI);Me(this,t0,!1)}setTimeoutProvider(e){we(this,ti,e)}setTimeout(e,t){return q(this,ti).setTimeout(e,t)}clearTimeout(e){q(this,ti).clearTimeout(e)}setInterval(e,t){return q(this,ti).setInterval(e,t)}clearInterval(e){q(this,ti).clearInterval(e)}},ti=new WeakMap,t0=new WeakMap,gA),os=new eU;function tU(e){setTimeout(e,0)}var nU=typeof window>"u"||"Deno"in globalThis;function vn(){}function rU(e,t){return typeof e=="function"?e(t):e}function Tb(e){return typeof e=="number"&&e>=0&&e!==1/0}function sN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pi(e,t){return typeof e=="function"?e(t):e}function Zn(e,t){return typeof e=="function"?e(t):e}function F2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:c,stale:u}=e;if(c){if(r){if(t.queryHash!==B0(c,t.options))return!1}else if(!hl(t.queryKey,c))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function B2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(vu(t.options.mutationKey)!==vu(a))return!1}else if(!hl(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function B0(e,t){return((t==null?void 0:t.queryKeyHashFn)||vu)(e)}function vu(e){return JSON.stringify(e,(t,n)=>$b(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let r=0;r<t.length;r++)if(!hl(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!hl(e[r],t[r]))return!1;return!0}return!1}var oU=Object.prototype.hasOwnProperty;function H0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=H2(e)&&H2(t);if(!r&&!($b(e)&&$b(t)))return t;const a=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),u=c.length,f=r?new Array(u):{};let p=0;for(let y=0;y<u;y++){const m=r?y:c[y],x=e[m],v=t[m];if(x===v){f[m]=x,(r?y<a:oU.call(e,m))&&p++;continue}if(x===null||v===null||typeof x!="object"||typeof v!="object"){f[m]=v;continue}const _=H0(x,v,n+1);f[m]=_,_===x&&p++}return a===u&&p===a?e:f}function Rh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function H2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $b(e){if(!q2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!q2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function q2(e){return Object.prototype.toString.call(e)==="[object Object]"}function iU(e){return new Promise(t=>{os.setTimeout(t,e)})}function zb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?H0(e,t):t}function sU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var q0=Symbol();function aN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===q0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lN(e,t){return typeof e=="function"?e(...t):!!e}function lU(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var xu=(()=>{let e=()=>nU;return{isServer(){return e()},setIsServer(t){e=t}}})();function Db(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var cU=tU;function uU(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=cU;const a=u=>{t?e.push(u):i(()=>{n(u)})},c=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||c()}return f},batchCalls:u=>(...f)=>{a(()=>{u(...f)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Vt=uU(),Ya,ni,Qa,yA,dU=(yA=class extends Rl{constructor(){super();Me(this,Ya,!0);Me(this,ni);Me(this,Qa);we(this,Qa,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){q(this,ni)||this.setEventListener(q(this,Qa))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ni))==null||t.call(this),we(this,ni,void 0))}setEventListener(t){var n;we(this,Qa,t),(n=q(this,ni))==null||n.call(this),we(this,ni,t(this.setOnline.bind(this)))}setOnline(t){q(this,Ya)!==t&&(we(this,Ya,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return q(this,Ya)}},Ya=new WeakMap,ni=new WeakMap,Qa=new WeakMap,yA),Th=new dU;function fU(e){return Math.min(1e3*2**e,3e4)}function cN(e){return(e??"online")==="online"?Th.isOnline():!0}var Lb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uN(e){let t=!1,n=0,r;const i=Db(),a=()=>i.status!=="pending",c=k=>{var S;if(!a()){const j=new Lb(k);x(j),(S=e.onCancel)==null||S.call(e,j)}},u=()=>{t=!0},f=()=>{t=!1},p=()=>F0.isFocused()&&(e.networkMode==="always"||Th.isOnline())&&e.canRun(),y=()=>cN(e.networkMode)&&e.canRun(),m=k=>{a()||(r==null||r(),i.resolve(k))},x=k=>{a()||(r==null||r(),i.reject(k))},v=()=>new Promise(k=>{var S;r=j=>{(a()||p())&&k(j)},(S=e.onPause)==null||S.call(e)}).then(()=>{var k;r=void 0,a()||(k=e.onContinue)==null||k.call(e)}),_=()=>{if(a())return;let k;const S=n===0?e.initialPromise:void 0;try{k=S??e.fn()}catch(j){k=Promise.reject(j)}Promise.resolve(k).then(m).catch(j=>{var I;if(a())return;const O=e.retry??(xu.isServer()?0:3),A=e.retryDelay??fU,$=typeof A=="function"?A(n,j):A,C=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,j);if(t||!C){x(j);return}n++,(I=e.onFail)==null||I.call(e,n,j),iU($).then(()=>p()?void 0:v()).then(()=>{t?x(j):_()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:f,canStart:y,start:()=>(y()?_():v().then(_),i)}}var cs,bA,dN=(bA=class{constructor(){Me(this,cs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tb(this.gcTime)&&we(this,cs,os.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xu.isServer()?1/0:300*1e3))}clearGcTimeout(){q(this,cs)!==void 0&&(os.clearTimeout(q(this,cs)),we(this,cs,void 0))}},cs=new WeakMap,bA);function hU(e){return{onFetch:(t,n)=>{var y,m,x,v,_;const r=t.options,i=(x=(m=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,a=((v=t.state.data)==null?void 0:v.pages)||[],c=((_=t.state.data)==null?void 0:_.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const p=async()=>{let k=!1;const S=A=>{lU(A,()=>t.signal,()=>k=!0)},j=aN(t.options,t.fetchOptions),O=async(A,$,C)=>{if(k)return Promise.reject(t.signal.reason);if($==null&&A.pages.length)return Promise.resolve(A);const z=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:$,direction:C?"backward":"forward",meta:t.options.meta};return S(G),G})(),T=await j(z),{maxPages:F}=t.options,W=C?aU:sU;return{pages:W(A.pages,T,F),pageParams:W(A.pageParams,$,F)}};if(i&&a.length){const A=i==="backward",$=A?pU:V2,C={pages:a,pageParams:c},I=$(r,C);u=await O(C,I,A)}else{const A=e??a.length;do{const $=f===0?c[0]??r.initialPageParam:V2(r,u);if(f>0&&$==null)break;u=await O(u,$),f++}while(f<A)}return u};t.options.persister?t.fetchFn=()=>{var k,S;return(S=(k=t.options).persister)==null?void 0:S.call(k,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function V2(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pU(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xa,us,Wa,ir,ds,Jt,Du,fs,Vn,fN,no,vA,mU=(vA=class extends dN{constructor(t){super();Me(this,Vn);Me(this,Xa);Me(this,us);Me(this,Wa);Me(this,ir);Me(this,ds);Me(this,Jt);Me(this,Du);Me(this,fs);we(this,fs,!1),we(this,Du,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,ds,t.client),we(this,ir,q(this,ds).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,us,K2(this.options)),this.state=t.state??q(this,us),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,Xa)}get promise(){var t;return(t=q(this,Jt))==null?void 0:t.promise}setOptions(t){if(this.options={...q(this,Du),...t},t!=null&&t._type&&we(this,Xa,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=K2(this.options);n.data!==void 0&&(this.setState(Z2(n.data,n.dataUpdatedAt)),we(this,us,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,ir).remove(this)}setData(t,n){const r=zb(this.state.data,t,this.options);return Ie(this,Vn,no).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Ie(this,Vn,no).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=q(this,Jt))==null?void 0:r.promise;return(i=q(this,Jt))==null||i.cancel(t),n?n.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,us)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Zn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===q0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>pi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!sN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,Jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,Jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),q(this,ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(q(this,Jt)&&(q(this,fs)||Ie(this,Vn,fN).call(this)?q(this,Jt).cancel({revert:!0}):q(this,Jt).cancelRetry()),this.scheduleGc()),q(this,ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ie(this,Vn,no).call(this,{type:"invalidate"})}async fetch(t,n){var p,y,m,x,v,_,k,S,j,O,A;if(this.state.fetchStatus!=="idle"&&((p=q(this,Jt))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,Jt))return q(this,Jt).continueRetry(),q(this,Jt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(C=>C.options.queryFn);$&&this.setOptions($.options)}const r=new AbortController,i=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(we(this,fs,!0),r.signal)})},a=()=>{const $=aN(this.options,n),I=(()=>{const z={client:q(this,ds),queryKey:this.queryKey,meta:this.meta};return i(z),z})();return we(this,fs,!1),this.options.persister?this.options.persister($,I,this):$(I)},u=(()=>{const $={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,ds),state:this.state,fetchFn:a};return i($),$})(),f=q(this,Xa)==="infinite"?hU(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),we(this,Wa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=u.fetchOptions)==null?void 0:y.meta))&&Ie(this,Vn,no).call(this,{type:"fetch",meta:(m=u.fetchOptions)==null?void 0:m.meta}),we(this,Jt,uN({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:$=>{$ instanceof Lb&&$.revert&&this.setState({...q(this,Wa),fetchStatus:"idle"}),r.abort()},onFail:($,C)=>{Ie(this,Vn,no).call(this,{type:"failed",failureCount:$,error:C})},onPause:()=>{Ie(this,Vn,no).call(this,{type:"pause"})},onContinue:()=>{Ie(this,Vn,no).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const $=await q(this,Jt).start();if($===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData($),(v=(x=q(this,ir).config).onSuccess)==null||v.call(x,$,this),(k=(_=q(this,ir).config).onSettled)==null||k.call(_,$,this.state.error,this),$}catch($){if($ instanceof Lb){if($.silent)return q(this,Jt).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw Ie(this,Vn,no).call(this,{type:"error",error:$}),(j=(S=q(this,ir).config).onError)==null||j.call(S,$,this),(A=(O=q(this,ir).config).onSettled)==null||A.call(O,this.state.data,$,this),$}finally{this.scheduleGc()}}},Xa=new WeakMap,us=new WeakMap,Wa=new WeakMap,ir=new WeakMap,ds=new WeakMap,Jt=new WeakMap,Du=new WeakMap,fs=new WeakMap,Vn=new WeakSet,fN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},no=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...hN(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...Z2(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return we(this,Wa,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Vt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),q(this,ir).notify({query:this,type:"updated",action:t})})},vA);function hN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Z2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function K2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Cn,We,Lu,bn,hs,Ja,io,ri,Iu,el,tl,ps,ms,oi,nl,ct,Jc,Ib,Ub,Pb,Fb,Bb,Hb,qb,pN,xA,V0=(xA=class extends Rl{constructor(t,n){super();Me(this,ct);Me(this,Cn);Me(this,We);Me(this,Lu);Me(this,bn);Me(this,hs);Me(this,Ja);Me(this,io);Me(this,ri);Me(this,Iu);Me(this,el);Me(this,tl);Me(this,ps);Me(this,ms);Me(this,oi);Me(this,nl,new Set);this.options=n,we(this,Cn,t),we(this,ri,null),we(this,io,Db()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,We).addObserver(this),G2(q(this,We),this.options)?Ie(this,ct,Jc).call(this):this.updateResult(),Ie(this,ct,Fb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vb(q(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vb(q(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,ct,Bb).call(this),Ie(this,ct,Hb).call(this),q(this,We).removeObserver(this)}setOptions(t){const n=this.options,r=q(this,We);if(this.options=q(this,Cn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zn(this.options.enabled,q(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ie(this,ct,qb).call(this),q(this,We).setOptions(this.options),n._defaulted&&!Rh(this.options,n)&&q(this,Cn).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,We),observer:this});const i=this.hasListeners();i&&Y2(q(this,We),r,this.options,n)&&Ie(this,ct,Jc).call(this),this.updateResult(),i&&(q(this,We)!==r||Zn(this.options.enabled,q(this,We))!==Zn(n.enabled,q(this,We))||pi(this.options.staleTime,q(this,We))!==pi(n.staleTime,q(this,We)))&&Ie(this,ct,Ib).call(this);const a=Ie(this,ct,Ub).call(this);i&&(q(this,We)!==r||Zn(this.options.enabled,q(this,We))!==Zn(n.enabled,q(this,We))||a!==q(this,oi))&&Ie(this,ct,Pb).call(this,a)}getOptimisticResult(t){const n=q(this,Cn).getQueryCache().build(q(this,Cn),t),r=this.createResult(n,t);return yU(this,r)&&(we(this,bn,r),we(this,Ja,this.options),we(this,hs,q(this,We).state)),r}getCurrentResult(){return q(this,bn)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&q(this,io).status==="pending"&&q(this,io).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){q(this,nl).add(t)}getCurrentQuery(){return q(this,We)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=q(this,Cn).defaultQueryOptions(t),r=q(this,Cn).getQueryCache().build(q(this,Cn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ie(this,ct,Jc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,bn)))}createResult(t,n){var F;const r=q(this,We),i=this.options,a=q(this,bn),c=q(this,hs),u=q(this,Ja),p=t!==r?t.state:q(this,Lu),{state:y}=t;let m={...y},x=!1,v;if(n._optimisticResults){const W=this.hasListeners(),G=!W&&G2(t,n),H=W&&Y2(t,r,n,i);(G||H)&&(m={...m,...hN(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:_,errorUpdatedAt:k,status:S}=m;v=m.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let W;a!=null&&a.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(W=a.data,j=!0):W=typeof n.placeholderData=="function"?n.placeholderData((F=q(this,tl))==null?void 0:F.state.data,q(this,tl)):n.placeholderData,W!==void 0&&(S="success",v=zb(a==null?void 0:a.data,W,n),x=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(c==null?void 0:c.data)&&n.select===q(this,Iu))v=q(this,el);else try{we(this,Iu,n.select),v=n.select(v),v=zb(a==null?void 0:a.data,v,n),we(this,el,v),we(this,ri,null)}catch(W){we(this,ri,W)}q(this,ri)&&(_=q(this,ri),v=q(this,el),k=Date.now(),S="error");const O=m.fetchStatus==="fetching",A=S==="pending",$=S==="error",C=A&&O,I=v!==void 0,T={status:S,fetchStatus:m.fetchStatus,isPending:A,isSuccess:S==="success",isError:$,isInitialLoading:C,isLoading:C,data:v,dataUpdatedAt:m.dataUpdatedAt,error:_,errorUpdatedAt:k,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:O,isRefetching:O&&!A,isLoadingError:$&&!I,isPaused:m.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:$&&I,isStale:Z0(t,n),refetch:this.refetch,promise:q(this,io),isEnabled:Zn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const W=T.data!==void 0,G=T.status==="error"&&!W,H=K=>{G?K.reject(T.error):W&&K.resolve(T.data)},U=()=>{const K=we(this,io,T.promise=Db());H(K)},D=q(this,io);switch(D.status){case"pending":t.queryHash===r.queryHash&&H(D);break;case"fulfilled":(G||T.data!==D.value)&&U();break;case"rejected":(!G||T.error!==D.reason)&&U();break}}return T}updateResult(){const t=q(this,bn),n=this.createResult(q(this,We),this.options);if(we(this,hs,q(this,We).state),we(this,Ja,this.options),q(this,hs).data!==void 0&&we(this,tl,q(this,We)),Rh(n,t))return;we(this,bn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!q(this,nl).size)return!0;const c=new Set(a??q(this,nl));return this.options.throwOnError&&c.add("error"),Object.keys(q(this,bn)).some(u=>{const f=u;return q(this,bn)[f]!==t[f]&&c.has(f)})};Ie(this,ct,pN).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,ct,Fb).call(this)}},Cn=new WeakMap,We=new WeakMap,Lu=new WeakMap,bn=new WeakMap,hs=new WeakMap,Ja=new WeakMap,io=new WeakMap,ri=new WeakMap,Iu=new WeakMap,el=new WeakMap,tl=new WeakMap,ps=new WeakMap,ms=new WeakMap,oi=new WeakMap,nl=new WeakMap,ct=new WeakSet,Jc=function(t){Ie(this,ct,qb).call(this);let n=q(this,We).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vn)),n},Ib=function(){Ie(this,ct,Bb).call(this);const t=pi(this.options.staleTime,q(this,We));if(xu.isServer()||q(this,bn).isStale||!Tb(t))return;const r=sN(q(this,bn).dataUpdatedAt,t)+1;we(this,ps,os.setTimeout(()=>{q(this,bn).isStale||this.updateResult()},r))},Ub=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(q(this,We)):this.options.refetchInterval)??!1},Pb=function(t){Ie(this,ct,Hb).call(this),we(this,oi,t),!(xu.isServer()||Zn(this.options.enabled,q(this,We))===!1||!Tb(q(this,oi))||q(this,oi)===0)&&we(this,ms,os.setInterval(()=>{(this.options.refetchIntervalInBackground||F0.isFocused())&&Ie(this,ct,Jc).call(this)},q(this,oi)))},Fb=function(){Ie(this,ct,Ib).call(this),Ie(this,ct,Pb).call(this,Ie(this,ct,Ub).call(this))},Bb=function(){q(this,ps)!==void 0&&(os.clearTimeout(q(this,ps)),we(this,ps,void 0))},Hb=function(){q(this,ms)!==void 0&&(os.clearInterval(q(this,ms)),we(this,ms,void 0))},qb=function(){const t=q(this,Cn).getQueryCache().build(q(this,Cn),this.options);if(t===q(this,We))return;const n=q(this,We);we(this,We,t),we(this,Lu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pN=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(q(this,bn))}),q(this,Cn).getQueryCache().notify({query:q(this,We),type:"observerResultsUpdated"})})},xA);function gU(e,t){return Zn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Zn(t.retryOnMount,e)===!1)}function G2(e,t){return gU(e,t)||e.state.data!==void 0&&Vb(e,t,t.refetchOnMount)}function Vb(e,t,n){if(Zn(t.enabled,e)!==!1&&pi(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Z0(e,t)}return!1}function Y2(e,t,n,r){return(e!==t||Zn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Z0(e,n)}function Z0(e,t){return Zn(t.enabled,e)!==!1&&e.isStaleByTime(pi(t.staleTime,e))}function yU(e,t){return!Rh(e.getCurrentResult(),t)}var Uu,Er,hn,gs,jr,Xo,wA,bU=(wA=class extends dN{constructor(t){super();Me(this,jr);Me(this,Uu);Me(this,Er);Me(this,hn);Me(this,gs);we(this,Uu,t.client),this.mutationId=t.mutationId,we(this,hn,t.mutationCache),we(this,Er,[]),this.state=t.state||vU(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){q(this,Er).includes(t)||(q(this,Er).push(t),this.clearGcTimeout(),q(this,hn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Er,q(this,Er).filter(n=>n!==t)),this.scheduleGc(),q(this,hn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){q(this,Er).length||(this.state.status==="pending"?this.scheduleGc():q(this,hn).remove(this))}continue(){var t;return((t=q(this,gs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,u,f,p,y,m,x,v,_,k,S,j,O,A,$,C,I,z;const n=()=>{Ie(this,jr,Xo).call(this,{type:"continue"})},r={client:q(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};we(this,gs,uN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,F)=>{Ie(this,jr,Xo).call(this,{type:"failed",failureCount:T,error:F})},onPause:()=>{Ie(this,jr,Xo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,hn).canRun(this)}));const i=this.state.status==="pending",a=!q(this,gs).canStart();try{if(i)n();else{Ie(this,jr,Xo).call(this,{type:"pending",variables:t,isPaused:a}),q(this,hn).config.onMutate&&await q(this,hn).config.onMutate(t,this,r);const F=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));F!==this.state.context&&Ie(this,jr,Xo).call(this,{type:"pending",context:F,variables:t,isPaused:a})}const T=await q(this,gs).start();return await((p=(f=q(this,hn).config).onSuccess)==null?void 0:p.call(f,T,t,this.state.context,this,r)),await((m=(y=this.options).onSuccess)==null?void 0:m.call(y,T,t,this.state.context,r)),await((v=(x=q(this,hn).config).onSettled)==null?void 0:v.call(x,T,null,this.state.variables,this.state.context,this,r)),await((k=(_=this.options).onSettled)==null?void 0:k.call(_,T,null,t,this.state.context,r)),Ie(this,jr,Xo).call(this,{type:"success",data:T}),T}catch(T){try{await((j=(S=q(this,hn).config).onError)==null?void 0:j.call(S,T,t,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((A=(O=this.options).onError)==null?void 0:A.call(O,T,t,this.state.context,r))}catch(F){Promise.reject(F)}try{await((C=($=q(this,hn).config).onSettled)==null?void 0:C.call($,void 0,T,this.state.variables,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((z=(I=this.options).onSettled)==null?void 0:z.call(I,void 0,T,t,this.state.context,r))}catch(F){Promise.reject(F)}throw Ie(this,jr,Xo).call(this,{type:"error",error:T}),T}finally{q(this,hn).runNext(this)}}},Uu=new WeakMap,Er=new WeakMap,hn=new WeakMap,gs=new WeakMap,jr=new WeakSet,Xo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vt.batch(()=>{q(this,Er).forEach(r=>{r.onMutationUpdate(t)}),q(this,hn).notify({mutation:this,type:"updated",action:t})})},wA);function vU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var so,pr,Pu,kA,xU=(kA=class extends Rl{constructor(t={}){super();Me(this,so);Me(this,pr);Me(this,Pu);this.config=t,we(this,so,new Set),we(this,pr,new Map),we(this,Pu,0)}build(t,n,r){const i=new bU({client:t,mutationCache:this,mutationId:++Df(this,Pu)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){q(this,so).add(t);const n=Bf(t);if(typeof n=="string"){const r=q(this,pr).get(n);r?r.push(t):q(this,pr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(q(this,so).delete(t)){const n=Bf(t);if(typeof n=="string"){const r=q(this,pr).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&q(this,pr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Bf(t);if(typeof n=="string"){const r=q(this,pr).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Bf(t);if(typeof n=="string"){const i=(r=q(this,pr).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>{q(this,so).forEach(t=>{this.notify({type:"removed",mutation:t})}),q(this,so).clear(),q(this,pr).clear()})}getAll(){return Array.from(q(this,so))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>B2(n,r))}findAll(t={}){return this.getAll().filter(n=>B2(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(vn))))}},so=new WeakMap,pr=new WeakMap,Pu=new WeakMap,kA);function Bf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Q2(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function wU(e,t,n){const r=e.slice(0);return r[t]=n,r}var rl,Nn,ol,ys,qn,ii,Fu,Bu,Hu,qu,Yt,Zb,Kb,mN,Gb,Yb,Qb,_A,kU=(_A=class extends Rl{constructor(t,n,r){super();Me(this,Yt);Me(this,rl);Me(this,Nn);Me(this,ol);Me(this,ys);Me(this,qn);Me(this,ii);Me(this,Fu);Me(this,Bu);Me(this,Hu);Me(this,qu,[]);we(this,rl,t),we(this,ys,r),we(this,ol,[]),we(this,qn,[]),we(this,Nn,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&q(this,qn).forEach(t=>{t.subscribe(n=>{Ie(this,Yt,Yb).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,q(this,qn).forEach(t=>{t.destroy()})}setQueries(t,n){we(this,ol,t),we(this,ys,n),Vt.batch(()=>{const r=q(this,qn),i=Ie(this,Yt,Gb).call(this,q(this,ol));i.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const a=i.map(m=>m.observer),c=a.map(m=>m.getCurrentResult()),u=r.length!==a.length,f=a.some((m,x)=>m!==r[x]),p=u||f,y=p?!0:c.some((m,x)=>{const v=q(this,Nn)[x];return!v||!Rh(m,v)});!p&&!y||(p&&(we(this,qu,i),we(this,qn,a)),we(this,Nn,c),this.hasListeners()&&(p&&(Q2(r,a).forEach(m=>{m.destroy()}),Q2(a,r).forEach(m=>{m.subscribe(x=>{Ie(this,Yt,Yb).call(this,m,x)})})),Ie(this,Yt,Qb).call(this)))})}getCurrentResult(){return q(this,Nn)}getQueries(){return q(this,qn).map(t=>t.getCurrentQuery())}getObservers(){return q(this,qn)}getOptimisticResult(t,n){const r=Ie(this,Yt,Gb).call(this,t),i=r.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),a=r.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>Ie(this,Yt,Kb).call(this,c??i,n,a),()=>Ie(this,Yt,Zb).call(this,i,r)]}},rl=new WeakMap,Nn=new WeakMap,ol=new WeakMap,ys=new WeakMap,qn=new WeakMap,ii=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,qu=new WeakMap,Yt=new WeakSet,Zb=function(t,n){return n.map((r,i)=>{const a=t[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,c=>{n.forEach(u=>{u.observer.trackProp(c)})})})},Kb=function(t,n,r){if(n){const i=q(this,Hu),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((c,u)=>c!==i[u]));return(!q(this,ii)||q(this,Nn)!==q(this,Bu)||a||n!==q(this,Fu))&&(we(this,Fu,n),we(this,Bu,q(this,Nn)),r!==void 0&&we(this,Hu,r),we(this,ii,H0(q(this,ii),n(t)))),q(this,ii)}return t},mN=function(){var t;return((t=q(this,ys))==null?void 0:t.combine)!==void 0&&q(this,qn).some((n,r)=>{var i;return n.options.suspense&&((i=q(this,Nn)[r])==null?void 0:i.data)===void 0})},Gb=function(t){const n=new Map;q(this,qn).forEach(i=>{const a=i.options.queryHash;if(!a)return;const c=n.get(a);c?c.push(i):n.set(a,[i])});const r=[];return t.forEach(i=>{var f;const a=q(this,rl).defaultQueryOptions(i),u=((f=n.get(a.queryHash))==null?void 0:f.shift())??new V0(q(this,rl),a);r.push({defaultedQueryOptions:a,observer:u})}),r},Yb=function(t,n){const r=q(this,qn).indexOf(t);r!==-1&&(we(this,Nn,wU(q(this,Nn),r,n)),Ie(this,Yt,Qb).call(this))},Qb=function(){var t;if(this.hasListeners()){const n=Ie(this,Yt,Zb).call(this,q(this,Nn),q(this,qu)),r=Ie(this,Yt,mN).call(this),i=q(this,ii),a=r?i:Ie(this,Yt,Kb).call(this,n,(t=q(this,ys))==null?void 0:t.combine);(r||i!==a)&&Vt.batch(()=>{this.listeners.forEach(c=>{c(q(this,Nn))})})}},_A),Or,SA,_U=(SA=class extends Rl{constructor(t={}){super();Me(this,Or);this.config=t,we(this,Or,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??B0(i,n);let c=this.get(a);return c||(c=new mU({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){q(this,Or).has(t.queryHash)||(q(this,Or).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=q(this,Or).get(t.queryHash);n&&(t.destroy(),n===t&&q(this,Or).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return q(this,Or).get(t)}getAll(){return[...q(this,Or).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>F2(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>F2(t,r)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Or=new WeakMap,SA),Nt,si,ai,il,sl,li,al,ll,EA,gN=(EA=class{constructor(e={}){Me(this,Nt);Me(this,si);Me(this,ai);Me(this,il);Me(this,sl);Me(this,li);Me(this,al);Me(this,ll);we(this,Nt,e.queryCache||new _U),we(this,si,e.mutationCache||new xU),we(this,ai,e.defaultOptions||{}),we(this,il,new Map),we(this,sl,new Map),we(this,li,0)}mount(){Df(this,li)._++,q(this,li)===1&&(we(this,al,F0.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Nt).onFocus())})),we(this,ll,Th.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Nt).onOnline())})))}unmount(){var e,t;Df(this,li)._--,q(this,li)===0&&((e=q(this,al))==null||e.call(this),we(this,al,void 0),(t=q(this,ll))==null||t.call(this),we(this,ll,void 0))}isFetching(e){return q(this,Nt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return q(this,si).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Nt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=q(this,Nt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(pi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return q(this,Nt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=q(this,Nt).get(r.queryHash),a=i==null?void 0:i.state.data,c=rU(t,a);if(c!==void 0)return q(this,Nt).build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Vt.batch(()=>q(this,Nt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Nt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=q(this,Nt);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=q(this,Nt);return Vt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Vt.batch(()=>q(this,Nt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return Vt.batch(()=>(q(this,Nt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Vt.batch(()=>q(this,Nt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(vn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=q(this,Nt).build(this,t);return n.isStaleByTime(pi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Th.isOnline()?q(this,si).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,Nt)}getMutationCache(){return q(this,si)}getDefaultOptions(){return q(this,ai)}setDefaultOptions(e){we(this,ai,e)}setQueryDefaults(e,t){q(this,il).set(vu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...q(this,il).values()],n={};return t.forEach(r=>{hl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){q(this,sl).set(vu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...q(this,sl).values()],n={};return t.forEach(r=>{hl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...q(this,ai).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=B0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===q0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...q(this,ai).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){q(this,Nt).clear(),q(this,si).clear()}},Nt=new WeakMap,si=new WeakMap,ai=new WeakMap,il=new WeakMap,sl=new WeakMap,li=new WeakMap,al=new WeakMap,ll=new WeakMap,EA),yN=w.createContext(void 0),So=e=>{const t=w.useContext(yN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bN=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(yN.Provider,{value:e,children:t})),vN=w.createContext(!1),xN=()=>w.useContext(vN);vN.Provider;function SU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var EU=w.createContext(SU()),wN=()=>w.useContext(EU),kN=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?lN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_N=e=>{w.useEffect(()=>{e.clearReset()},[e])},SN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||lN(n,[e.error,r])),EN=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jU=(e,t)=>e.isLoading&&e.isFetching&&!t,Xb=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Wb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jN({queries:e,...t},n){const r=So(),i=xN(),a=wN(),c=w.useMemo(()=>e.map(k=>{const S=r.defaultQueryOptions(k);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);c.forEach(k=>{EN(k);const S=r.getQueryCache().get(k.queryHash);kN(k,a,S)}),_N(a);const[u]=w.useState(()=>new kU(r,c,t)),[f,p,y]=u.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(k=>m?u.subscribe(Vt.batchCalls(k)):vn,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setQueries(c,t)},[c,t,u]);const v=f.some((k,S)=>Xb(c[S],k))?f.flatMap((k,S)=>{const j=c[S];if(j&&Xb(j,k)){const O=new V0(r,j);return Wb(j,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const _=f.find((k,S)=>{const j=c[S];return j&&SN({result:k,errorResetBoundary:a,throwOnError:j.throwOnError,query:r.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(_!=null&&_.error)throw _.error;return p(y())}function OU(e,t,n){var v,_,k,S;const r=xN(),i=wN(),a=So(),c=a.defaultQueryOptions(e);(_=(v=a.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||_.call(v,c);const u=a.getQueryCache().get(c.queryHash),f=e.subscribed!==!1;c._optimisticResults=r?"isRestoring":f?"optimistic":void 0,EN(c),kN(c,i,u),_N(i);const p=!a.getQueryCache().get(c.queryHash),[y]=w.useState(()=>new t(a,c)),m=y.getOptimisticResult(c),x=!r&&f;if(w.useSyncExternalStore(w.useCallback(j=>{const O=x?y.subscribe(Vt.batchCalls(j)):vn;return y.updateResult(),O},[y,x]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),w.useEffect(()=>{y.setOptions(c)},[c,y]),Xb(c,m))throw Wb(c,y,i);if(SN({result:m,errorResetBoundary:i,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw m.error;if((S=(k=a.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||S.call(k,c,m),c.experimental_prefetchInRender&&!xu.isServer()&&jU(m,r)){const j=p?Wb(c,y,i):u==null?void 0:u.promise;j==null||j.catch(vn).finally(()=>{y.updateResult()})}return c.notifyOnChangeProps?m:y.trackResult(m)}function Rn(e,t){return OU(e,V0)}const AU=600*1e3,ON=(e,t,n)=>({queryKey:["crop-url",e,t],queryFn:()=>n(e,t),staleTime:AU});function AN(e,t,n){const r=w.useMemo(()=>[...new Set(t.filter(a=>!!a))],[t]),i=jN({queries:r.map(a=>({...ON(e,a,n),enabled:!!e}))});return w.useMemo(()=>{const a=new Map;return r.forEach((c,u)=>{var p;const f=(p=i[u])==null?void 0:p.data;typeof f=="string"&&a.set(c,f)}),a},[r,i])}function CU(e,t,n,r){return e.fetchQuery(ON(t,n,r))}/**
|
|
56
|
-
* @license lucide-react v1.28.0 - ISC
|
|
57
|
-
*
|
|
58
|
-
* This source code is licensed under the ISC license.
|
|
59
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/const CN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
61
|
-
* @license lucide-react v1.28.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const NU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
66
|
-
* @license lucide-react v1.28.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const MU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
71
|
-
* @license lucide-react v1.28.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const X2=e=>{const t=MU(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
76
|
-
* @license lucide-react v1.28.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/var $y={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
81
|
-
* @license lucide-react v1.28.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const RU=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},TU=w.createContext({}),$U=()=>w.useContext(TU),zU=w.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:c,...u},f)=>{const{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:m=!1,color:x="currentColor",className:v=""}=$U()??{},_=r??m?Number(n??y)*24/Number(t??p):n??y;return w.createElement("svg",{ref:f,...$y,width:t??p??$y.width,height:t??p??$y.height,stroke:e??x,strokeWidth:_,className:CN("lucide",v,i),...!a&&!RU(u)&&{"aria-hidden":"true"},...u},[...c.map(([k,S])=>w.createElement(k,S)),...Array.isArray(a)?a:[a]])});/**
|
|
86
|
-
* @license lucide-react v1.28.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const ve=(e,t)=>{const n=w.forwardRef(({className:r,...i},a)=>w.createElement(zU,{ref:a,iconNode:t,className:CN(`lucide-${NU(X2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=X2(e),n};/**
|
|
91
|
-
* @license lucide-react v1.28.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const DU=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],LU=ve("activity",DU);/**
|
|
96
|
-
* @license lucide-react v1.28.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const IU=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],UU=ve("archive",IU);/**
|
|
101
|
-
* @license lucide-react v1.28.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const PU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],FU=ve("arrow-down",PU);/**
|
|
106
|
-
* @license lucide-react v1.28.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const BU=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],HU=ve("arrow-left",BU);/**
|
|
111
|
-
* @license lucide-react v1.28.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const qU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],VU=ve("arrow-right",qU);/**
|
|
116
|
-
* @license lucide-react v1.28.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const ZU=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],NN=ve("arrow-up-right",ZU);/**
|
|
121
|
-
* @license lucide-react v1.28.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const KU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],GU=ve("arrow-up",KU);/**
|
|
126
|
-
* @license lucide-react v1.28.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const YU=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],QU=ve("book-open",YU);/**
|
|
131
|
-
* @license lucide-react v1.28.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const XU=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],K0=ve("box",XU);/**
|
|
136
|
-
* @license lucide-react v1.28.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const WU=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],JU=ve("building-2",WU);/**
|
|
141
|
-
* @license lucide-react v1.28.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const eP=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],tP=ve("building",eP);/**
|
|
146
|
-
* @license lucide-react v1.28.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const nP=[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]],rP=ve("calendar-days",nP);/**
|
|
151
|
-
* @license lucide-react v1.28.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const oP=[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]],iP=ve("calendar",oP);/**
|
|
156
|
-
* @license lucide-react v1.28.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const sP=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aP=ve("chart-line",sP);/**
|
|
161
|
-
* @license lucide-react v1.28.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const lP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bi=ve("check",lP);/**
|
|
166
|
-
* @license lucide-react v1.28.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const cP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],G0=ve("chevron-down",cP);/**
|
|
171
|
-
* @license lucide-react v1.28.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const uP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cp=ve("chevron-left",uP);/**
|
|
176
|
-
* @license lucide-react v1.28.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const dP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Np=ve("chevron-right",dP);/**
|
|
181
|
-
* @license lucide-react v1.28.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const fP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],hP=ve("chevrons-up-down",fP);/**
|
|
186
|
-
* @license lucide-react v1.28.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const pP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mP=ve("circle-question-mark",pP);/**
|
|
191
|
-
* @license lucide-react v1.28.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const gP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],yP=ve("clock",gP);/**
|
|
196
|
-
* @license lucide-react v1.28.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const bP=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Y0=ve("cloud-upload",bP);/**
|
|
201
|
-
* @license lucide-react v1.28.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const vP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xP=ve("copy",vP);/**
|
|
206
|
-
* @license lucide-react v1.28.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const wP=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],kP=ve("credit-card",wP);/**
|
|
211
|
-
* @license lucide-react v1.28.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const _P=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],SP=ve("crop",_P);/**
|
|
216
|
-
* @license lucide-react v1.28.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const EP=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jP=ve("database",EP);/**
|
|
221
|
-
* @license lucide-react v1.28.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const OP=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],MN=ve("download",OP);/**
|
|
226
|
-
* @license lucide-react v1.28.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const AP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],CP=ve("ellipsis-vertical",AP);/**
|
|
231
|
-
* @license lucide-react v1.28.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const NP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],MP=ve("ellipsis",NP);/**
|
|
236
|
-
* @license lucide-react v1.28.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const RP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],RN=ve("external-link",RP);/**
|
|
241
|
-
* @license lucide-react v1.28.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const TP=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],$P=ve("eye-off",TP);/**
|
|
246
|
-
* @license lucide-react v1.28.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const zP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],TN=ve("eye",zP);/**
|
|
251
|
-
* @license lucide-react v1.28.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const DP=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],LP=ve("file-pen-line",DP);/**
|
|
256
|
-
* @license lucide-react v1.28.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const IP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],$N=ve("file-spreadsheet",IP);/**
|
|
261
|
-
* @license lucide-react v1.28.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const UP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Mp=ve("file-text",UP);/**
|
|
266
|
-
* @license lucide-react v1.28.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const PP=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],zy=ve("files",PP);/**
|
|
271
|
-
* @license lucide-react v1.28.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const FP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],BP=ve("file",FP);/**
|
|
276
|
-
* @license lucide-react v1.28.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const HP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],qP=ve("film",HP);/**
|
|
281
|
-
* @license lucide-react v1.28.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const VP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ZP=ve("globe",VP);/**
|
|
286
|
-
* @license lucide-react v1.28.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const KP=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Q0=ve("grip-vertical",KP);/**
|
|
291
|
-
* @license lucide-react v1.28.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const GP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],YP=ve("house",GP);/**
|
|
296
|
-
* @license lucide-react v1.28.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const QP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Rp=ve("image",QP);/**
|
|
301
|
-
* @license lucide-react v1.28.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const XP=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],Jb=ve("images",XP);/**
|
|
306
|
-
* @license lucide-react v1.28.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const WP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],JP=ve("info",WP);/**
|
|
311
|
-
* @license lucide-react v1.28.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const e9=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],t9=ve("key-round",e9);/**
|
|
316
|
-
* @license lucide-react v1.28.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const n9=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],zN=ve("layout-grid",n9);/**
|
|
321
|
-
* @license lucide-react v1.28.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const r9=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],o9=ve("layout-template",r9);/**
|
|
326
|
-
* @license lucide-react v1.28.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const i9=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],s9=ve("library-big",i9);/**
|
|
331
|
-
* @license lucide-react v1.28.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const a9=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],X0=ve("link-2",a9);/**
|
|
336
|
-
* @license lucide-react v1.28.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const l9=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],c9=ve("link",l9);/**
|
|
341
|
-
* @license lucide-react v1.28.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const u9=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],DN=ve("list",u9);/**
|
|
346
|
-
* @license lucide-react v1.28.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const d9=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],f9=ve("lock",d9);/**
|
|
351
|
-
* @license lucide-react v1.28.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const h9=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],p9=ve("log-out",h9);/**
|
|
356
|
-
* @license lucide-react v1.28.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const m9=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],g9=ve("mail",m9);/**
|
|
361
|
-
* @license lucide-react v1.28.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const y9=[["path",{d:"M15 22a1 1 0 0 1-1-1v-4a1 1 0 0 1 .445-.832l3-2a1 1 0 0 1 1.11 0l3 2A1 1 0 0 1 22 17v4a1 1 0 0 1-1 1z",key:"1p1rcz"}],["path",{d:"M18 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 .601.2",key:"mcbcs9"}],["path",{d:"M18 22v-3",key:"1t1ugv"}],["circle",{cx:"10",cy:"10",r:"3",key:"1ns7v1"}]],b9=ve("map-pin-house",y9);/**
|
|
366
|
-
* @license lucide-react v1.28.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const v9=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],LN=ve("map-pin",v9);/**
|
|
371
|
-
* @license lucide-react v1.28.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const x9=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],w9=ve("map-pinned",x9);/**
|
|
376
|
-
* @license lucide-react v1.28.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const k9=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],_9=ve("maximize-2",k9);/**
|
|
381
|
-
* @license lucide-react v1.28.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const S9=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],E9=ve("mic",S9);/**
|
|
386
|
-
* @license lucide-react v1.28.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const j9=[["path",{d:"M5 12h14",key:"1ays0h"}]],IN=ve("minus",j9);/**
|
|
391
|
-
* @license lucide-react v1.28.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const O9=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],A9=ve("mouse-pointer-click",O9);/**
|
|
396
|
-
* @license lucide-react v1.28.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const C9=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],N9=ve("newspaper",C9);/**
|
|
401
|
-
* @license lucide-react v1.28.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const M9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],R9=ve("palette",M9);/**
|
|
406
|
-
* @license lucide-react v1.28.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const T9=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],W0=ve("pencil",T9);/**
|
|
411
|
-
* @license lucide-react v1.28.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const $9=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],z9=ve("phone",$9);/**
|
|
416
|
-
* @license lucide-react v1.28.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const D9=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],UN=ve("play",D9);/**
|
|
421
|
-
* @license lucide-react v1.28.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const L9=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],I9=ve("plug",L9);/**
|
|
426
|
-
* @license lucide-react v1.28.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const U9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],td=ve("plus",U9);/**
|
|
431
|
-
* @license lucide-react v1.28.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const P9=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],F9=ve("power",P9);/**
|
|
436
|
-
* @license lucide-react v1.28.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const B9=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],J0=ve("presentation",B9);/**
|
|
441
|
-
* @license lucide-react v1.28.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const H9=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],q9=ve("redo-2",H9);/**
|
|
446
|
-
* @license lucide-react v1.28.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const V9=[["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M16.47214 7.52786 A 5 10 0 1 0 13 21.79796",key:"1245p8"}],["path",{d:"M21.79796 11 A 10 5 0 1 0 19 15.57071",key:"1i40ks"}]],ex=ve("rotate-3d",V9);/**
|
|
451
|
-
* @license lucide-react v1.28.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const Z9=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],K9=ve("rotate-cw",Z9);/**
|
|
456
|
-
* @license lucide-react v1.28.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const G9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tx=ve("search",G9);/**
|
|
461
|
-
* @license lucide-react v1.28.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const Y9=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Q9=ve("settings",Y9);/**
|
|
466
|
-
* @license lucide-react v1.28.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const X9=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],W9=ve("share",X9);/**
|
|
471
|
-
* @license lucide-react v1.28.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const J9=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],e7=ve("sparkles",J9);/**
|
|
476
|
-
* @license lucide-react v1.28.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const t7=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],n7=ve("tag",t7);/**
|
|
481
|
-
* @license lucide-react v1.28.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const r7=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Tl=ve("trash-2",r7);/**
|
|
486
|
-
* @license lucide-react v1.28.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const o7=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],i7=ve("trending-up",o7);/**
|
|
491
|
-
* @license lucide-react v1.28.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const s7=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nx=ve("triangle-alert",s7);/**
|
|
496
|
-
* @license lucide-react v1.28.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const a7=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],l7=ve("type",a7);/**
|
|
501
|
-
* @license lucide-react v1.28.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const c7=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],u7=ve("undo-2",c7);/**
|
|
506
|
-
* @license lucide-react v1.28.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const d7=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Tp=ve("upload",d7);/**
|
|
511
|
-
* @license lucide-react v1.28.0 - ISC
|
|
512
|
-
*
|
|
513
|
-
* This source code is licensed under the ISC license.
|
|
514
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
-
*/const f7=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],h7=ve("user-plus",f7);/**
|
|
516
|
-
* @license lucide-react v1.28.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* This source code is licensed under the ISC license.
|
|
519
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
-
*/const p7=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],m7=ve("user",p7);/**
|
|
521
|
-
* @license lucide-react v1.28.0 - ISC
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the ISC license.
|
|
524
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/const g7=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],y7=ve("users",g7);/**
|
|
526
|
-
* @license lucide-react v1.28.0 - ISC
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the ISC license.
|
|
529
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/const b7=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],rx=ve("video",b7);/**
|
|
531
|
-
* @license lucide-react v1.28.0 - ISC
|
|
532
|
-
*
|
|
533
|
-
* This source code is licensed under the ISC license.
|
|
534
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const v7=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$p=ve("x",v7);function ce(...e){return Ap(Op(e))}const x7="flex flex-col gap-3.5 pt-1",As="flex flex-col gap-1",PN="text-[length:calc(11*var(--content))] font-medium text-ink-4 pl-0.5",$l="m-0 text-caption leading-[1.4] text-danger",FN="bg-[repeating-linear-gradient(135deg,rgba(20,18,13,0.05)_0_1px,transparent_1px_9px)]",vt="appearance-none cursor-pointer border-0 bg-transparent p-0 m-0 outline-none",w7="flex w-full items-stretch rounded-[calc(8*var(--content))] border border-line bg-white transition-[border-color,box-shadow] duration-[120ms] focus-within:border-accent focus-within:shadow-[0_0_0_3px_rgba(15,42,34,0.07)]",k7="min-w-0 flex-1 appearance-none border-0 bg-transparent px-2.75 py-2.25 text-[length:calc(13.5*var(--content))] text-ink outline-none placeholder:text-ink-4",zl=ce("data-[attention=required]:border-danger data-[attention=required]:bg-danger-soft","data-[attention=invalid]:border-danger data-[attention=invalid]:bg-danger-soft");function Dl(e,t){return e===null||e==="required"&&!t?{}:{"data-attention":e}}const BN="flex items-center text-[length:calc(12.5*var(--content))] text-ink-4",_7=ce(vt,"min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink-4"),S7="py-2.25",E7="text-[length:calc(13.5*var(--content))]",HN=ce(S7,E7),qN="font-mono text-[length:calc(10.5*var(--content))] [font-feature-settings:'tnum'] shrink-0",VN="text-[#7a5a14]";function j7(e,t){const n=ce(qN,"text-ink-4");return t==null?n:e>t?ce(n,"text-danger"):e>=t*.9?ce(n,VN):n}function O7({children:e}){return h.jsx("span",{className:PN,children:e})}function A7({value:e,onChange:t,placeholder:n,inputMode:r,maxLength:i,spellCheck:a,className:c,ariaLabel:u,id:f}){return h.jsx("input",{id:f,className:ce(_7,c),value:e,placeholder:n,inputMode:r,maxLength:i,spellCheck:a,"aria-label":u,onChange:p=>t(p.target.value)})}function gn(e,t,n=1.5){const r=e;return function({size:a=t}={}){return h.jsx(r,{size:a,strokeWidth:n,style:{width:`calc(${a} * var(--content))`,height:`calc(${a} * var(--content))`}})}}const Mt={trash:gn(Tl,11),plus:gn(td,14),up:gn(Tp,15),link:gn(c9,13),play:({size:e=20}={})=>h.jsx(UN,{size:e,strokeWidth:0,fill:"currentColor",style:{width:`calc(${e} * var(--content))`,height:`calc(${e} * var(--content))`}}),tour:gn(ex,18),search:gn(tx,14),x:gn($p,15),check:gn(bi,13),minus:gn(IN,16),external:gn(RN,11),grip:gn(Q0,13,1.8),calendar:gn(rP,14),chevL:gn(Cp,15),chevR:gn(Np,15),chevD:gn(G0,13)},nd=w.createContext(null);function ZN({ports:e,children:t}){return h.jsx(nd.Provider,{value:e,children:t})}function tn(){const e=w.useContext(nd);if(!e)throw new Error("useSlotEditorPorts: missing SlotEditorPortsProvider");return e}function C7(){var e;return(e=w.useContext(nd))==null?void 0:e.fillMark}function N7(){var e;return(e=w.useContext(nd))==null?void 0:e.isMediaProcessing}function M7(){var e;return(e=w.useContext(nd))==null?void 0:e.cropFailedAt}function mi(e){return tn().useEditorStore(e)}const R7="size-[calc(6*var(--content))] shrink-0 rounded-full bg-honey-ink";function pl(e,t){const n=S0(t);return e===void 0||n===null?void 0:`${e}.${n}`}function wu(e,t){return e===void 0?void 0:`${e}.${t}`}function KN(e){return e==="list"||e==="media"||wn(e)}function T7(e){const t=C7();return t===void 0||e===void 0?null:t(e)}function $7({mark:e}){return e===null?null:h.jsxs("span",{"data-fill-mark":"line",className:"inline-flex items-center gap-[calc(6*var(--content))] text-[length:calc(11.5*var(--content))] text-ink-3",children:[h.jsx("span",{className:R7,"aria-hidden":"true"}),e]})}var Tr=jA();function z7(...e){return Ap(Op(e))}const zp=1e3,vi=zp+200,D7=zp+500;let L7=0;const xi=[];let GN="",YN="";function I7(){if(xi.length!==1||typeof document>"u")return;const e=document.body;GN=e.style.overflow,YN=e.style.paddingRight;const t=window.innerWidth-document.documentElement.clientWidth;e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`)}function U7(){xi.length===0&&(typeof document>"u"||(document.body.style.overflow=GN,document.body.style.paddingRight=YN))}function QN(){const e=++L7;return xi.push(e),I7(),e}function ev(e){const t=xi.indexOf(e);t!==-1&&xi.splice(t,1),U7()}function XN(e){const t=xi.indexOf(e);return zp+(t===-1?0:t)*10}function W2(e){return xi[xi.length-1]===e}const P7="(prefers-reduced-motion: reduce)";function F7(){const[e,t]=w.useState(!1);return w.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(P7);t(n.matches);const r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const B7={sm:"max-w-[calc(420*var(--frame))]",md:"max-w-[calc(520*var(--frame))]",lg:"max-w-[calc(800*var(--frame))]",xl:"max-w-[calc(1240*var(--frame))]",full:"max-w-[calc(100vw-80px)]"},H7='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function ox({open:e,onClose:t,className:n,size:r,closeOnBackdrop:i=!0,closeOnEsc:a=!0,labelledBy:c,ariaLabel:u,children:f}){const[p,y]=w.useState("closed"),m=w.useRef(null),x=w.useRef(null),v=w.useRef(null),[_,k]=w.useState(1e3),S=F7(),[j,O]=w.useState(f);e&&j!==f&&O(f),w.useEffect(()=>{e&&p==="closed"?y("open"):!e&&p==="open"&&y(S?"closed":"closing")},[e,p,S]),w.useEffect(()=>{var C;if(p==="open"&&m.current===null){v.current=document.activeElement??null;const I=QN();m.current=I,k(XN(I)),(C=x.current)==null||C.focus()}},[p]),w.useEffect(()=>{var C,I;p==="closed"&&m.current!==null&&(ev(m.current),m.current=null,(I=(C=v.current)==null?void 0:C.focus)==null||I.call(C),v.current=null)},[p]),w.useEffect(()=>()=>{m.current!==null&&(ev(m.current),m.current=null)},[]),w.useEffect(()=>{if(p!=="closing")return;const C=setTimeout(()=>y("closed"),400);return()=>clearTimeout(C)},[p]),w.useEffect(()=>{if(p!=="open"||!a)return;const C=I=>{I.key!=="Escape"||I.defaultPrevented||m.current===null||!W2(m.current)||(I.preventDefault(),t())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[p,a,t]),w.useEffect(()=>{if(p!=="open")return;const C=I=>{if(I.key!=="Tab"||m.current===null||!W2(m.current))return;const z=x.current;if(!z)return;const T=z.querySelectorAll(H7);if(T.length===0){I.preventDefault();return}const F=T[0],W=T[T.length-1];I.shiftKey&&document.activeElement===F?(I.preventDefault(),W==null||W.focus()):!I.shiftKey&&document.activeElement===W&&(I.preventDefault(),F==null||F.focus())};return document.addEventListener("keydown",C,!0),()=>document.removeEventListener("keydown",C,!0)},[p]);const A=w.useCallback(C=>{C.target===C.currentTarget&&p==="closing"&&y("closed")},[p]);if(p==="closed"||typeof document>"u")return null;const $=p==="closing"?"closing":"open";return Tr.createPortal(h.jsx("div",{className:"hp-modal-backdrop","data-state":$,inert:$==="closing",style:{zIndex:_},onMouseDown:i?t:void 0,children:h.jsx("div",{ref:x,className:z7("hp-modal-panel",r?B7[r]:void 0,n),"data-state":$,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-label":u,tabIndex:-1,onMouseDown:C=>C.stopPropagation(),onAnimationEnd:A,children:e?f:j})}),document.body)}function WN(){const[e,t]=w.useState(zp);return w.useEffect(()=>{const n=QN();return t(XN(n)),()=>ev(n)},[]),e}const q7={youtube:"video",vimeo:"video"};function JN(e){const t=Ku(e.startsWith("http")?e:`https://${e}`);if(t!==null){const n=_i[t],r=n.kind==="tour"||n.kind==="video"?n.kind:void 0;return{key:t,name:n.label,kind:q7[t]??"link",...r?{media:r}:{}}}try{return{key:"web",name:new URL(e.startsWith("http")?e:`https://${e}`).hostname.replace(/^www\./,""),kind:"link"}}catch{return{key:"web",name:"Link",kind:"link"}}}const ix="bg-[#f7f6f2]",Mn="bg-[#eceae3]",V7="[mask-image:var(--fade-down)]",Z7="[background-image:var(--wash-soft)]";function rd({className:e,children:t}){return h.jsx("div",{"aria-hidden":"true",className:ce("pointer-events-none absolute inset-0 select-none overflow-hidden",V7,e),children:t})}function $h({icon:e,headline:t,line:n,lifted:r=!1}){return h.jsx("div",{className:ce("absolute inset-0 flex items-center justify-center-safe overflow-y-auto px-6 py-8",Z7),children:h.jsxs("div",{className:"flex max-w-full flex-col items-center text-center",children:[h.jsx("span",{"data-lifted":r||void 0,className:"grid h-14 w-14 place-items-center rounded-full bg-[#f3f2ed] text-ink-2 transition-[translate] duration-200 ease-settle data-lifted:-translate-y-0.5 motion-reduce:transition-none","aria-hidden":"true",children:e}),h.jsx("div",{className:"mt-4 text-[length:calc(17*var(--content))] font-semibold tracking-[-0.01em] text-ink",children:t}),n?h.jsx("div",{className:"mt-1.5 text-[length:calc(14*var(--content))] text-ink-3",children:n}):null]})})}const sx="inline-flex h-9 cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-lg border px-3 text-[length:calc(12.5*var(--content))] font-medium transition-colors duration-150",ax="border-line bg-canvas text-ink-2 hover:bg-[#f6f5f1] hover:text-ink",Dp="hp-anim-menu absolute z-[80] rounded-xl border border-line bg-canvas shadow-[0_1px_2px_rgba(20,18,13,0.04),0_12px_32px_-8px_rgba(20,18,13,0.16)]",eM="flex w-full cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[length:calc(12.5*var(--content))] text-ink-2 hover:bg-[#f6f5f1] hover:text-ink",J2=ce(sx,ax,"font-semibold text-ink focus-visible:bg-[#f6f5f1] aria-expanded:bg-[#f6f5f1]"),K7={large:J2,compact:ce(J2,"h-8")},G7="size-[calc(15*var(--content))] shrink-0";function zh({add:e,size:t,onClick:n,buttonRef:r,expanded:i}){return h.jsxs("button",{ref:r,type:"button",...i!==void 0?{"aria-haspopup":"dialog","aria-expanded":i}:{},"data-list-verb":e.verb,className:K7[t],onClick:n,children:[h.jsx(e.icon,{"aria-hidden":"true",strokeWidth:2.4,className:G7}),e.label]})}function od({size:e,add:t,onAdd:n,newChip:r,choose:i}){const a=i!==void 0?h.jsx(zh,{add:i.choose,size:e,onClick:i.onChoose}):r??(n!==null?h.jsx(zh,{add:t,size:e,onClick:n}):null);return a===null?null:h.jsx("div",{"data-list-verbs":"",className:"flex flex-wrap items-center gap-2",children:a})}const tM=w.createContext(null);function nM({api:e,children:t}){return h.jsx(tM.Provider,{value:e,children:t})}function lx(){const e=w.useContext(tM);if(!e)throw new Error("useMediaLibraryApi: missing MediaLibraryApiProvider");return e}async function Y7(e,t,n){let r=0;const i=Math.max(1,Math.min(t,e.length)),a=Array.from({length:i},async()=>{for(;r<e.length;){const c=r++;try{await n(e[c],c)}catch{}}});await Promise.all(a)}const Q7="We can’t read HEIC photos yet. Save it as a JPEG (on a Mac, open it in Preview and choose File > Export), then upload that.",X7=new Set([".heic",".heif"]),W7=new Set(["image/heic","image/heif","image/heic-sequence","image/heif-sequence"]);function J7(e,t){return X7.has(e)||W7.has(t)}const eF=new Set(["text/plain","text/csv"]);[...eF];const eE=500*1024*1024,Dh=[{extension:".pdf",mimeTypes:["application/pdf"],family:"pdf"},{extension:".csv",mimeTypes:["text/csv","application/vnd.ms-excel"],family:"spreadsheet"},{extension:".xlsx",mimeTypes:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],family:"spreadsheet"},{extension:".docx",mimeTypes:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],family:"text-document"},{extension:".doc",mimeTypes:["application/msword"],family:"text-document"},{extension:".txt",mimeTypes:["text/plain"],family:"text-document"},{extension:".pptx",mimeTypes:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],family:"presentation"}],rM=new Set(Dh.map(e=>e.extension)),oM=new Set(Dh.flatMap(e=>e.mimeTypes));function id(e){const t=e.indexOf(";");return(t===-1?e:e.slice(0,t)).trim().toLowerCase()}function Lp(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),n=e.slice(t+1),r=n.lastIndexOf(".");return r<=0?"":n.slice(r).toLowerCase()}function tF(e){return id(e).startsWith("image/")}function nF(e){return id(e).startsWith("video/")}function rF(e,t){return rM.has(Lp(e))&&oM.has(id(t))}function oF(e,t){return iM(e,t)!==null?!1:tF(t)||nF(t)||rF(e,t)}function iM(e,t){return J7(Lp(e),id(t))?Q7:null}function iF(e,t){const n=Lp(e),r=Dh.find(c=>c.extension===n);if(r)return r.family;const i=id(t),a=Dh.find(c=>c.mimeTypes.includes(i));return a?a.family:null}const sF=[...oM,...rM].join(","),aF="an image, a video, or a document (PDF, Word, Excel .xlsx, PowerPoint .pptx, CSV, or text)";function lF(e){return e.replace(/^https?:\/\//i,"").replace(/\/$/,"")}function cF(e){switch(e){case"pdf":return{glyph:"doc",typeNoun:"PDF"};case"spreadsheet":return{glyph:"spreadsheet",typeNoun:"Spreadsheet"};case"text-document":return{glyph:"doc",typeNoun:"Document"};case"presentation":return{glyph:"presentation",typeNoun:"Presentation"}}}function sM(e,t){const n=iF(e,t),{glyph:r,typeNoun:i}=n===null?{glyph:"doc",typeNoun:"File"}:cF(n);return{glyph:r,typeNoun:i,extension:Lp(e).replace(".","").toUpperCase()}}function uF(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1048576).toFixed(1)} MB`}function Lh(e){var t;return((t=e.renditions.poster)==null?void 0:t.url)??(e.kind==="image"?e.file_url:null)}function dF(e){var t;return e.kind!=="image"?Lh(e):(Ls(e.crop)?(t=e.renditions.crop)==null?void 0:t.url:void 0)??Lh(e)}function aM(e){if(e.kind!=="image"||e.state==="failed")return!1;const{crop:t,cutout:n}=e.renditions;return t!==null&&Ls(e.crop)&&!Os(t.over.crop,e.crop)?!0:n!==null&&!Os(n.over.crop,e.crop)}function fF(e){return e.url!==null||e.renditions.encode!==null}function lM(e){return e.url!==null&&ZD(e.url)!==null}function Ip({renditions:e={},...t}){const n=new Set(UA),r=i=>{const a=e[i];if(a===void 0)return null;const c={key:a,mime:null,width:null,height:null,bytes:null,url:a};return n.has(i)?{...c,over:{crop:t.crop??null,options:{}}}:c};return{crop:null,key:t.file_url??null,mime:null,bytes:null,url:null,provider:null,added_at:"1970-01-01T00:00:00.000Z",account:null,page_count:null,duration_ms:null,width:null,height:null,captured_at:null,scan_count:null,poster_at_ms:null,state:"ready",file_url:null,file:t.id,...t,renditions:Object.fromEntries(WD.map(i=>[i,r(i)]))}}function cM(e){var t,n,r,i;switch(e.kind){case"image":return{id:e.id,kind:"photo",name:e.name,size:"",src:((t=e.renditions.cutout)==null?void 0:t.url)??Lh(e)??""};case"video":return{id:e.id,kind:"video",name:e.name,size:"",src:((n=e.renditions.poster)==null?void 0:n.url)??"",ready:fF(e),durationMs:e.renditions.encode===null?null:e.duration_ms,videoSource:rL(e),...e.provider!==null?{provider:e.provider}:{}};case"tour":return{id:e.id,kind:"tour",name:e.name,size:"",src:((r=e.renditions.poster)==null?void 0:r.url)??"",ready:lM(e),provider:e.provider??""};case"document":return{id:e.id,kind:"document",name:e.name,size:e.bytes!==null&&e.bytes>0?uF(e.bytes):"",src:((i=e.renditions.poster)==null?void 0:i.url)??"",mime:e.mime??""}}}function hF(e){if(e==null||!Number.isFinite(e)||e<0)return"";const t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,"0")}`}const pF=5;function tE(e){return`${Math.round(e/(1024*1024))} MB`}function mF(e){return e.size>eE?{ok:!1,message:`This file is ${tE(e.size)}. The maximum upload size is ${tE(eE)}.`}:oF(e.name,e.type)?{ok:!0}:{ok:!1,message:iM(e.name,e.type)??`This file type (${e.type||"unknown"}) isn't supported. Upload ${aF}.`}}function gF(e){return e.attempt?{kind:"resume",attempt:e.attempt}:{kind:"fresh"}}function Up(e){const{mediaFactsQuery:t}=lx(),n=t(e??"");return Rn({...n,select:r=>r.facts,enabled:!!e}).data}async function tv(e,t,n){await e.invalidateQueries({queryKey:t.mediaFactsQuery(n).queryKey})}const yF=new Map;function bF(e){if(e===void 0)return yF;const t=new Map;for(const[n,r]of Nl(e)){if(!Object.hasOwn(e.files,r.file))continue;const i=e.files[r.file];"renditions"in i&&t.set(n,h0(i,r))}return t}function Ll(e){const t=Up(e===""?null:e);return w.useMemo(()=>bF(t),[t])}const vF={search:tx,chevd:G0,chevr:Np,chevl:Cp,grid:zN,list:DN,plus:td,choose:NN,cloud:Y0,dots:CP,trash:Tl,down:MN,x:$p,check:bi,warn:nx,recheck:K9,play:UN,eye:TN,pencil:W0,crop:SP,image:Rp,doc:Mp,spreadsheet:$N,presentation:J0,file:BP,video:rx,tour:K0,upload:Tp};function et({name:e,size:t=14,stroke:n=1.8}){const r=vF[e];if(!r)return null;const i={width:`calc(${t} * var(--content))`,height:`calc(${t} * var(--content))`};return e==="play"?h.jsx(r,{size:t,strokeWidth:n,fill:"currentColor",style:i}):h.jsx(r,{size:t,strokeWidth:n,style:i})}const cx={image:{process:[St.probe(),St.understand(),St.preview(),St.ladder()],gates:["probe","understand"],publishes:["preview","ladder"]},video:{process:[St.probe(),St.transcode(),St.poster(),St.understand(),St.preview(),St.ladder(),St.fetch()],gates:["probe","understand"],publishes:["transcode","poster","preview","ladder"]},document:{process:[St.probe(),St.understand(),St.poster(),St.rasterize(),St.preview(),St.ladder()],gates:["probe","understand"],publishes:["poster","preview","ladder"]},tour:{process:[St.fetch(),St.tour_details(),St.understand()],gates:["understand"],publishes:[]}};function xF(e){for(const t of vo){const n=e[t];if(n===void 0)return`has no row for ${t} — every media kind has one`;const r=new Set;for(const i of n.process){const a=TA(i);if(a===null||typeof i!="object")return`${t}'s row lists ${JSON.stringify(i)}, which is no process binding`;const c=ki[a.verb];if(c.site!=="kind")return`${t}'s row lists "${a.verb}", a holder's process — a row lists kind-site processes only`;if(!c.kinds.includes(t))return`${t}'s row lists "${a.verb}", which applies to ${c.kinds.join(", ")} and not to ${t}`;const u=l0(a);if(u!==null)return`${t}'s row lists "${a.verb}" with options that do not fit: ${u}`;if(r.has(a.verb))return`${t}'s row lists "${a.verb}" twice — a row runs each process once`;r.add(a.verb)}for(const i of n.gates)if(!r.has(i))return`${t}'s row gates on "${i}", which is not on its row`;for(const i of n.publishes)if(!r.has(i))return`${t}'s row publishes on "${i}", which is not on its row`}return null}const nE=xF(cx);if(nE!==null)throw new Error(`KIND_TABLE ${nE}.`);const wF={original:e=>e.key!==null,"pageable original":e=>e.key!==null&&e.mime==="application/pdf",master:e=>e.key!==null,poster:e=>e.renditions.poster!==null,link:e=>e.url!==null&&e.provider!==null,"any original":e=>e.key!==null||e.url!==null&&e.provider!==null},kF={probe:"original",understand:"any original",transcode:"original",poster:{video:"original",document:"pageable original"},rasterize:"pageable original",preview:{image:"master",video:"poster",document:"poster"},ladder:{image:"master",video:"poster",document:"poster"},fetch:"link",tour_details:"link"};function _F(e,t){const n=kF[e];if(typeof n=="string")return n;const r=n[t];if(r===void 0)throw new Error(`kindRow(${t}): "${e}" names no input for ${t}.`);return r}const nv={image:[],video:[{before:"poster",after:"preview"},{before:"poster",after:"ladder"},{before:"fetch",after:"understand"}],document:[{before:"poster",after:"preview"},{before:"poster",after:"ladder"}],tour:[{before:"fetch",after:"tour_details"},{before:"fetch",after:"understand"}]};for(const e of vo){const t=cx[e].process.map(n=>n.verb);for(const{before:n,after:r}of nv[e])if(!t.includes(n)||!t.includes(r))throw new Error(`KIND_TABLE: ${e}'s edge ${n} → ${r} names a verb not on its row.`)}const rE=new Map,SF={image:[St.crop()],video:[],document:[],tour:[]};for(const e of vo)for(const t of SF[e]){const n=ki[t.verb];if(n.site!=="place"||!n.kinds.includes(e))throw new Error(`PLACE_TABLE: ${e}'s row lists "${t.verb}", which is no place process of ${e}.`)}function EF(e){const t=rE.get(e);if(t!==void 0)return t;const n=cx[e],r=[...n.gates,...nv[e].filter(c=>n.gates.includes(c.after)).map(c=>c.before)],i=n.process.map(c=>{const u=_F(c.verb,e);return{verb:c.verb,binding:c,input:u,present:wF[u],gates:n.gates.includes(c.verb),publishes:n.publishes.includes(c.verb),reads:r.includes(c.verb)}}),a={kind:e,entries:i,edges:nv[e],gates:n.gates};return rE.set(e,a),a}const sd={image:{label:"Image",plural:"Images",icon:"image",solid:"bg-[#2F8A5B]",soft:"bg-[#E6F2EA] text-[#1F6440]"},video:{label:"Video",plural:"Videos",icon:"video",solid:"bg-[#D2463A]",soft:"bg-[#FBE8E5] text-[#9A2C20]"},document:{label:"Document",plural:"Documents",icon:"doc",solid:"bg-[#3F73D3]",soft:"bg-[#E7EEFB] text-[#2A55A5]"},tour:{label:"Tour",plural:"Tours",icon:"tour",solid:"bg-[#7C5BC9]",soft:"bg-[#EFEAFA] text-[#5A3EA0]"}},Ih=Object.keys(sd);function pn(e){return"send"in e}function uM(e){return pn(e)?e.id:e.record.id}function jF(e){var t;return e.renditions.poster!==null||e.state==="failed"||((t=e.failed_outputs)==null?void 0:t.poster)!==void 0?!1:e.url!==null?e.state==="processing":EF(e.kind).entries.some(n=>n.verb==="poster"&&n.present(e))}function OF(e){return e.url!==null&&e.state==="failed"}function iu(e){return e.url!==null}function dM(e){return DA(/^https?:\/\//i.test(e)?e:`https://${e}`)}const AF=()=>0;function CF({record:e,list:t,tier:n},r){const i=r(t);return{id:e.id,kind:e.kind,state:e.state==="processing"?"processing":"ready",name:e.name,bytes:e.bytes,mime:e.mime,url:e.url,thumbnailUrl:dF(e),addedAt:Date.parse(e.added_at),previewPending:jF(e),linkUnreachable:OF(e),inFlight:!1,error:null,list:t,tier:n??i,upstream:i>0}}function NF(e){const{send:t}=e;return{id:e.id,kind:e.kind,state:t.state==="uploading"?"uploading":t.state==="saving"?"processing":"failed",name:e.name,bytes:e.bytes,mime:e.mime,url:e.url,thumbnailUrl:e.preview,addedAt:e.addedAt,previewPending:!1,linkUnreachable:!1,inFlight:!0,...t.state==="uploading"?{progress:t.progress}:{},error:t.state==="failed"?t.error:null,list:e.list,tier:0,upstream:!1}}function MF(e,t=AF){return pn(e)?NF(e):CF(e,t)}function oE(e){return e.kind===null?Ih.length:Ih.indexOf(e.kind)}const RF={name:(e,t)=>e.name.localeCompare(t.name),kind:(e,t)=>oE(e)-oE(t)||t.addedAt-e.addedAt,size:(e,t)=>(t.bytes??0)-(e.bytes??0),date:(e,t)=>t.addedAt-e.addedAt,custom:(e,t)=>Number(t.inFlight)-Number(e.inFlight)};function TF(e,t,n){const r=t==="all"?[...e]:e.filter(a=>a.kind===t),i=RF[n];return r.sort((a,c)=>a.tier-c.tier||i(a,c))}function $F(e){const t={all:e.length};for(const n of Ih)t[n]=0;for(const n of e)n.kind&&(t[n.kind]+=1);return t}function fM(e){return e===null?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function hM(e,t=Date.now()){const n=new Date(e),r=new Date(t),i=c=>new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime(),a=Math.round((i(r)-i(n))/864e5);return a<=0?"Today":a===1?"Yesterday":n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function zF(e){const[t,n]=w.useState(e);return(e===null||t===null)&&t!==e&&n(e),w.useEffect(()=>{if(e===null||t===null||e===t)return;let r=!0;const i=new Image,a=()=>{r&&n(e)};return i.onload=a,i.onerror=a,i.src=e,()=>{r=!1,i.onload=null,i.onerror=null}},[e,t]),e===null?null:t}const DF="inline-flex items-center gap-1 whitespace-nowrap rounded-full px-2 py-0.75 text-[length:calc(10.5*var(--content))] font-semibold tracking-[0.01em]",LF={dot:{box:"h-4 w-4 rounded-[calc(4*var(--content))]",glyph:10},mark:{box:"h-5 w-5 rounded-md",glyph:12},lead:{box:"h-6 w-6 rounded-md",glyph:14},thumb:{box:"h-5.5 w-5.5 rounded-md",glyph:13},logo:{box:"h-14 w-14 rounded-2xl",glyph:28},hero:{box:"h-20 w-20 rounded-[calc(22*var(--content))]",glyph:40}};function Cs({kind:e,size:t="mark",glyph:n,decorative:r=!1}){const i=sd[e],a=LF[t];return h.jsx("span",{className:ce("inline-grid shrink-0 place-items-center text-white",a.box,i.solid),...r?{"aria-hidden":!0}:{role:"img","aria-label":i.label},children:h.jsx(et,{name:n??i.icon,size:a.glyph,stroke:2})})}function pM({file:e}){if(e.kind===null)return null;const t=sd[e.kind];return h.jsxs("span",{className:ce(DF,t.soft),children:[h.jsx(et,{name:t.icon,size:10,stroke:2.2}),t.label]})}function IF(e){const t=e.url!==null?JN(e.url).name:e.bytes!==null?fM(e.bytes):"",n=hM(e.addedAt);return t?`${t} · ${n}`:n}function UF(e){return sM(e.name,e.mime??"").glyph}function PF(e){return`flex items-center justify-center rounded-full border-[1.5px] border-white/85 bg-[rgba(10,12,10,0.55)] pl-0.5 text-white backdrop-blur-[2px] ${e?"h-13 w-13":"h-9 w-9"}`}const FF={row:"thumb",card:"logo",lightbox:"hero"};function ux({file:e,face:t="card"}){const n=zF(e.thumbnailUrl);if(n)return h.jsx("div",{"data-preview":"image",className:"relative h-full w-full bg-cover bg-top",style:{backgroundImage:`url("${n}")`},children:e.kind==="video"?h.jsx("span",{className:`absolute inset-0 m-auto ${PF(t==="lightbox")}`,children:h.jsx(et,{name:"play",size:t==="lightbox"?20:14})}):null});if(e.previewPending)return h.jsx("div",{"data-preview":"skeleton",className:"h-full w-full animate-pulse bg-line-soft/40"});const r=e.kind==="document"?UF(e):void 0;return h.jsxs("div",{"data-preview":"fallback",className:"flex h-full w-full flex-col items-center justify-center gap-4 bg-canvas px-4 text-center",children:[e.kind===null?h.jsx("span",{className:"text-ink-4",children:h.jsx(et,{name:"file",size:t==="row"?16:32,stroke:1.6})}):h.jsx(Cs,{kind:e.kind,size:FF[t],decorative:!0,...r===void 0?{}:{glyph:r}}),t==="lightbox"?h.jsx("span",{className:"line-clamp-2 max-w-[80%] text-body text-ink-3",children:e.name}):null]})}const Hf="absolute inset-0 z-[2] flex flex-col items-center justify-center gap-2 bg-[rgba(252,252,250,0.82)] p-2 text-center backdrop-blur-[2px]",mM="Can’t be reached",rv="We couldn’t load this link. It may be private, unpublished, or mistyped. Fix it at the provider, then re-check.",qf="absolute inset-0 z-[2] flex items-center justify-center bg-[rgba(252,252,250,0.82)] px-1";function gM({file:e,compact:t=!1,onRetry:n,onRecheck:r}){if(e.state==="uploading"){const i=e.progress??0;return h.jsx("div",{className:t?qf:Hf,children:h.jsx("span",{role:"progressbar","aria-label":"Uploading","aria-valuenow":Math.round(i),className:`h-1 overflow-hidden rounded-full bg-[#e3e0d2] ${t?"w-full":"w-[62%]"}`,children:h.jsx("span",{className:"block h-full rounded-full bg-accent transition-[width] duration-[180ms]",style:{width:`${i}%`}})})})}return e.state==="processing"?h.jsx("div",{className:t?qf:Hf,children:h.jsx("span",{role:"progressbar","aria-label":"Loading",className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-[#d9d5c6] border-t-accent [animation-duration:0.7s]"})}):e.state==="failed"&&t?h.jsx("div",{className:`${qf} text-danger`,title:e.error??void 0,children:h.jsx(et,{name:"warn",size:13})}):e.state==="failed"?h.jsxs("div",{className:`${Hf} text-[length:calc(11.5*var(--content))] font-semibold text-danger`,children:[h.jsx(et,{name:"warn",size:15}),h.jsx("span",{className:"max-w-[85%] truncate",children:e.error}),n?h.jsx("button",{type:"button",className:"rounded-full border border-line bg-canvas px-2.75 py-1 text-[length:calc(11*var(--content))] font-semibold text-ink hover:border-[#d9d6cb]",onClick:i=>{i.stopPropagation(),n()},children:"Retry"}):null]}):e.linkUnreachable&&t?h.jsx("div",{className:`${qf} text-warn`,title:rv,children:h.jsx(et,{name:"warn",size:13})}):e.linkUnreachable?h.jsxs("div",{className:`${Hf} text-[length:calc(11.5*var(--content))] font-semibold text-warn`,title:rv,children:[h.jsx(et,{name:"warn",size:15}),h.jsx("span",{className:"max-w-[90%]",children:mM}),r?h.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-full border border-line bg-canvas px-2.75 py-1 text-[length:calc(11*var(--content))] font-semibold text-ink hover:border-[#d9d6cb]",onClick:i=>{i.stopPropagation(),r()},children:[h.jsx(et,{name:"recheck",size:11}),"Re-check"]}):null]}):null}function ad(e,t,n,r){w.useEffect(()=>{if(!t)return;const i=c=>{var f,p;const u=c.target;!((f=e.current)!=null&&f.contains(u))&&!((p=r==null?void 0:r.current)!=null&&p.contains(u))&&n()},a=c=>{c.key!=="Escape"||c.defaultPrevented||(c.preventDefault(),n())};return document.addEventListener("pointerdown",i,!0),document.addEventListener("keydown",a),window.addEventListener("blur",n),()=>{document.removeEventListener("pointerdown",i,!0),document.removeEventListener("keydown",a),window.removeEventListener("blur",n)}},[e,t,n,r])}function yM({inputRef:e,accept:t,onFiles:n,disabled:r,multiple:i=!0}){return h.jsx("input",{ref:e,type:"file",multiple:i,hidden:!0,accept:t,onChange:a=>{!r&&a.target.files&&a.target.files.length>0&&n(Array.from(a.target.files)),a.target.value=""}})}function Uh(e,t="or"){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} ${t} ${e.at(-1)}`}const bM=["tour","video"],BF={tour:"3D tour",video:"video"};function dx(e){return bM.filter(t=>e.includes(t)).flatMap(t=>BF[t]??[])}function HF(e,t){const n=i=>e.includes(i);if(t.accept!==null){const i=[...n("image")?["photos"]:[],...n("image")&&n("document")?["floor plans"]:[],...n("document")?["documents"]:[],...n("video")?["video"]:[]];return i.length===0?null:`Drop ${Uh(i)} anywhere here`}if(!t.onLink)return null;const r=dx(e);return r.length===0?null:`Paste a link to a ${Uh(r)}`}function qF(e,t){const n=e.trim();if(!n)return{state:"empty"};const r=dM(n);return r===null||!t.includes(r)?{state:"refused"}:{state:"ok",kind:r,provider:JN(n).name}}function VF(e,t,n){const[r,i]=w.useState(""),a=qF(r,n),c=!t&&a.state==="ok";return{value:r,setValue:i,verdict:a,canAdd:c,submit:f=>{f.preventDefault(),f.stopPropagation(),c&&(e(r.trim()),i(""))},kinds:n}}function ZF({verdict:e,kinds:t,className:n}){return h.jsx("div",{className:ce("flex items-center gap-2 text-[length:calc(11.5*var(--content))]",n),"aria-live":"polite",children:e.state==="ok"?h.jsxs(h.Fragment,{children:[h.jsx(Cs,{kind:e.kind,decorative:!0}),h.jsxs("span",{className:"font-medium text-ink-2",children:[e.provider," ",sd[e.kind].label.toLowerCase()]})]}):e.state==="refused"?h.jsxs("span",{className:"text-warn",children:["Only ",Uh(dx(t),"and")," links can be added."]}):null})}const KF="shrink-0 cursor-pointer border border-honey-2 bg-honey font-semibold text-honey-ink transition-colors duration-150 hover:bg-honey-2 disabled:cursor-default disabled:border-line disabled:bg-[#f0efe9] disabled:text-ink-4";function GF({draft:e}){return h.jsxs("div",{className:"flex h-10 items-center rounded-lg border border-line bg-canvas py-1 pl-3 pr-1 transition-[border-color,box-shadow] duration-150 hover:border-ink-4 focus-within:border-ink-3 focus-within:shadow-[0_0_0_3px_rgba(20,18,13,0.05)]",children:[h.jsx("span",{className:"grid shrink-0 place-items-center text-ink-3","aria-hidden":"true",children:h.jsx(X0,{size:15})}),h.jsx("input",{className:"h-full min-w-0 flex-1 appearance-none border-0 bg-transparent px-2.5 py-0 text-body text-ink placeholder:text-ink-4",type:"url",inputMode:"url",placeholder:`Paste a ${Uh(dx(e.kinds))} link`,"aria-label":"Link URL",autoFocus:!0,value:e.value,onChange:t=>e.setValue(t.target.value),onKeyDown:t=>{t.key==="Enter"&&e.submit(t)}}),h.jsx("button",{type:"button",disabled:!e.canAdd,onClick:e.submit,className:ce(KF,"h-8 rounded-md px-3 text-[length:calc(12.5*var(--content))]"),children:"New link"})]})}function YF({add:e,kinds:t,dragging:n}){if(e===null)return h.jsx($h,{icon:h.jsx(Jb,{size:25,strokeWidth:1.8}),headline:"Nothing here yet"});const r=HF(t,e);return h.jsx($h,{icon:e.accept!==null?h.jsx(Y0,{size:25,strokeWidth:1.8}):h.jsx(X0,{size:24,strokeWidth:1.8}),headline:n?"Drop to upload":"Nothing uploaded yet",...r!==null?{line:r}:{},lifted:n})}function QF({onChoose:e,detail:t}){return h.jsxs("button",{type:"button",onClick:e,className:"group flex w-full cursor-pointer items-center gap-3 rounded-lg border-0 bg-transparent px-2.5 py-2.5 text-left hover:bg-[#f6f5f1] focus-visible:bg-[#f6f5f1]",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-[#f3f2ed] text-ink-2 transition-colors duration-150 group-hover:bg-canvas group-hover:text-ink group-focus-visible:bg-canvas group-focus-visible:text-ink","aria-hidden":"true",children:h.jsx(Y0,{size:18,strokeWidth:1.9})}),h.jsxs("span",{className:"flex min-w-0 flex-col",children:[h.jsx("span",{className:"text-body font-semibold text-ink",children:"Upload files"}),t!==void 0?h.jsx("span",{className:"text-[length:calc(11.5*var(--content))] text-ink-3",children:t}):null]})]})}function XF({onAdd:e,disabled:t,kinds:n}){const r=VF(e,t,n);return h.jsxs("div",{className:"flex flex-col gap-2 px-1 pb-1",children:[h.jsx(GF,{draft:r}),h.jsx(ZF,{verdict:r.verdict,kinds:n,className:"px-0.5 empty:hidden"})]})}function vM({add:e,onBrowse:t,onLinked:n,uploadDetail:r}){return h.jsxs(h.Fragment,{children:[e.accept!==null?h.jsx(QF,{onChoose:t,...r!==void 0?{detail:r}:{}}):h.jsx("div",{className:"px-1.5 pb-0.5 pt-1 text-body font-semibold text-ink",children:"New link"}),h.jsx(XF,{onAdd:i=>{e.onLink(i),n()},disabled:e.disabled,kinds:e.linkKinds??bM})]})}function WF({add:e,verb:t}){const{accept:n,onFiles:r,onLink:i,disabled:a}=e,[c,u]=w.useState(!1),f=w.useRef(null),p=w.useRef(null),y=w.useCallback(()=>u(!1),[]);ad(f,c,y);const m=()=>{var v;y(),(v=p.current)==null||v.click()},x=()=>{c?y():i?u(!0):m()};return h.jsxs("div",{className:"relative",ref:f,onClick:v=>v.stopPropagation(),children:[n!==null?h.jsx(yM,{inputRef:p,accept:n,onFiles:r,disabled:a}):null,h.jsx(zh,{add:t,size:"large",onClick:x,...i?{expanded:c}:{}}),c&&i?h.jsx("div",{className:`${Dp} left-0 top-[calc(100%+6*var(--content))] flex w-[calc(360*var(--frame))] flex-col gap-1.5 p-1.5`,role:"dialog","aria-label":t.verb,children:h.jsx(vM,{add:{...e,onLink:i},onBrowse:m,onLinked:y,uploadDetail:"Photos, floor plans, documents or video"})}):null]})}function xM(e,t,n,r=!0){const{accept:i,onFiles:a,onLink:c,disabled:u}=e,[f,p]=w.useState(!1),[y,m]=w.useState(null),x=w.useRef(null),v=w.useRef(null),_=w.useCallback(()=>{p(!1),m(null)},[]);ad(n,f,_,x),w.useLayoutEffect(()=>{if(!f)return;const j=()=>{const O=n.current,A=x.current;if(!O||!A)return;const $=A.offsetHeight,C=Cl(_s(O),{height:$,maxHeight:$,minWidth:A.offsetWidth});m(C?{left:C.left,top:C.top,bottom:C.bottom}:null)};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[f,n]);const k=()=>{var j;_(),(j=v.current)==null||j.click()},S=h.jsxs(h.Fragment,{children:[i!==null?h.jsx(yM,{inputRef:v,accept:i,onFiles:a,disabled:u,multiple:r}):null,f&&c?Tr.createPortal(h.jsx("div",{ref:x,className:`we-no-drag ${Dp} flex w-[calc(360*var(--frame))] flex-col gap-1.5 p-1.5`,style:y?{position:"fixed",...y,zIndex:vi}:{position:"fixed",top:0,left:0,zIndex:vi,opacity:0,pointerEvents:"none"},role:"dialog","aria-label":t,onClick:j=>j.stopPropagation(),children:h.jsx(vM,{add:{...e,onLink:c},onBrowse:k,onLinked:_})}),document.body):null]});return{start:()=>{c?f?_():p(!0):k()},...c?{expanded:f}:{},node:S}}function JF({add:e,intake:t,trigger:n}){const r=w.useRef(null),i=xM(t,e.label,r);return h.jsxs(h.Fragment,{children:[i.node,n({buttonRef:r,...i.expanded!==void 0?{expanded:i.expanded}:{},onClick:i.start})]})}const eB="relative cursor-grab touch-none select-none",tB="relative grid grid-cols-[repeat(auto-fill,minmax(calc(150*var(--frame)),1fr))] gap-2.5",nB={compact:"flex flex-col gap-2.5",large:"flex flex-col gap-3"},iE=new Set;function fx(e,t,n){const r=n!==null?{kind:"take",intake:n}:t!==null?{kind:"choose",open:t}:null;return{add:e.add,onAdd:r,choose:e.choose!==null&&t!==null?{choose:e.choose,onChoose:t}:void 0}}function Il(e,t,n,r,i){const a=new Set(t.map(p=>p.id)),c=e.filter(p=>{const y=n(p.value);return y===null||a.has(y)}),u=new Set(c.map(p=>n(p.value)));return[...t.filter(p=>!u.has(p.id)).map(p=>i(r(p))),...c]}function hx({engine:e,label:t,noun:n,size:r,onAdd:i,add:a,choose:c,renderTile:u,tileActions:f,onRemove:p,children:y}){const{rows:m,canAdd:x,canRemove:v}=e,{containerRef:_,getItemProps:k}=e.drag,[S,j]=w.useState(iE),O=m.filter(F=>S.has(F.key)),A=O.map(F=>F.key),$=F=>j(W=>{const G=new Set(W);return G.has(F)?G.delete(F):G.add(F),G}),C=()=>j(iE),I=F=>{p?p(F):e.removeMany(F.map(W=>W.key)),C()},z=F=>{if(!v)return null;const W=S.has(F.key)&&O.length>1?O:null;return W?{label:`Remove ${W.length} ${n}s`,glyph:"trash",danger:!0,onSelect:()=>I(W)}:{label:"Remove",glyph:"trash",danger:!0,onSelect:()=>I([F])}},T=x?h.jsx(od,{size:r,add:a,onAdd:(i==null?void 0:i.kind)==="choose"?i.open:null,...(i==null?void 0:i.kind)==="take"?{newChip:h.jsx(JF,{add:a,intake:i.intake,trigger:F=>h.jsx(zh,{add:a,size:r,...F})})}:{},choose:c}):null;return h.jsxs("div",{className:As,children:[h.jsxs("div",{className:nB[r],children:[T,m.length===0?r==="large"&&h.jsx("div",{className:"py-4.5 text-center text-small text-ink-3",children:a.empty}):h.jsx("div",{className:tB,ref:_,onClick:F=>{F.target===F.currentTarget&&C()},children:h.jsx("div",{className:"contents",role:"listbox","aria-multiselectable":!0,"aria-label":t,onKeyDown:F=>{F.key!=="Escape"||A.length===0||(F.stopPropagation(),C())},children:m.map((F,W)=>{const G=z(F),H={selected:S.has(F.key),onToggleSelect:()=>$(F.key),actions:[...(f==null?void 0:f(F))??[],...G?[G]:[]]},U=S.has(F.key)&&A.length>1?A:void 0;return h.jsx("div",{...k(F.key,U),className:eB,children:u(F,W,H)},F.key)})})})]}),y]})}const rB="data-drag-clone",sE="0 16px 38px -8px rgba(20,18,13,0.5)",oB=["id","for","name","data-dragid","data-drag-scope"];function lh(e){if(!e||e==="transparent")return!1;const t=/^rgba\([^,]+,[^,]+,[^,]+,\s*([\d.]+)\s*\)$/.exec(e);if(t)return Number(t[1])>=1;const n=/\/\s*([\d.]+)(%?)\s*\)$/.exec(e);return n?Number(n[1])>=(n[2]?100:1):!0}function iB(e){for(let t=e;t;t=t.parentElement){const n=getComputedStyle(t).backgroundColor;if(lh(n))return n}return"#fff"}function aE(e){for(let t=e;t;){const n=getComputedStyle(t).borderRadius;if(sB(n))return n;const r=t.children.length===1?t.children[0]:null;t=r&&r.offsetWidth===e.offsetWidth&&r.offsetHeight===e.offsetHeight?r:null}return null}function sB(e){return e!==""&&!/^(0(px)?\s*)+$/.test(e)}function aB(e){const t=e.cloneNode(!0),n=[e,...e.querySelectorAll("*")],r=[t,...t.querySelectorAll("*")];n.forEach((i,a)=>{const c=r[a];if(!(!c||c.tagName!==i.tagName))switch(i.tagName){case"INPUT":c.value=i.value,c.checked=i.checked;break;case"TEXTAREA":case"SELECT":c.value=i.value;break;case"VIDEO":c.muted=!0,c.autoplay=!1;break}});for(const i of r)for(const a of oB)i.removeAttribute(a);return t.setAttribute(rB,""),t.setAttribute("aria-hidden","true"),t.inert=!0,t}function lB(e,t,n){if(t===n||t<0||n<0)return e;const r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}const wM="data-drag-scope";function Dy(e){return Array.from(e.querySelectorAll("[data-dragid]")).filter(t=>t.closest(`[${wM}]`)===e)}function cB(e){const t=/^matrix(3d)?\(([^)]+)\)$/.exec(e.trim());if(!(t!=null&&t[2]))return{x:0,y:0};const n=t[2].split(",").map(Number),[r,i]=t[1]?[n[12],n[13]]:[n[4],n[5]];return{x:r||0,y:i||0}}const lE=190,cE=220,Ly="cubic-bezier(.2,.7,.3,1)",uB="0.4",dB="0",fB="1",hB="2",pB="60",Ph="data-drag-active",uE="hp-drag-reorder-active",mB=`html[${Ph}], html[${Ph}] * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }`;function Iy(e){const t=document.documentElement;if(!e){t.removeAttribute(Ph);return}if(!document.getElementById(uE)){const n=document.createElement("style");n.id=uE,n.textContent=mB,document.head.appendChild(n)}t.setAttribute(Ph,"")}function dE(e){return!e||typeof e.animate!="function"?!1:!(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}function gB(e){if(!e)return;const t=n=>{n.target!==null&&e.contains(n.target)&&(n.stopPropagation(),n.preventDefault()),window.removeEventListener("click",t,!0)};window.addEventListener("click",t,!0),setTimeout(()=>window.removeEventListener("click",t,!0),0)}const yB="pointer-events-none absolute -right-1.5 -top-1.5 z-[5] grid h-6 min-w-6 place-items-center rounded-full bg-accent px-1.5 text-[length:calc(11.5*var(--content))] font-bold tabular-nums text-white shadow-[0_1px_3px_rgba(20,18,13,0.3)]";function bB(e,t,n){const r=e.filter(a=>n.has(t(a))),i=r[0];return{collapsed:e.filter(a=>a===i||!n.has(t(a))),members:r}}function vB(e,t){const n=t[0]===void 0?-1:e.indexOf(t[0]);return n<0?e:[...e.slice(0,n),...t,...e.slice(n+1)]}function kM({items:e,getKey:t,onReorder:n,onDrop:r,axis:i="xy",threshold:a=4,ignoreSelector:c=".we-no-drag"}){const[u,f]=w.useState(null),p=w.useRef(null),y=w.useRef({}),m=w.useRef({grabX:0,grabY:0,scale:1,originLeft:0}),x=w.useRef({x:0,y:0}),v=w.useRef(null),_=w.useRef(null),k=w.useRef(null),S=w.useRef(null),j=w.useRef("#fff"),O=w.useRef(new Set),A=w.useRef(new Map),$=w.useRef(new WeakMap),C=w.useRef(null),I=w.useRef(null),z=w.useRef(e),T=w.useRef(t),F=w.useRef({onReorder:n,onDrop:r});w.useLayoutEffect(()=>{F.current={onReorder:n,onDrop:r}}),w.useEffect(()=>()=>{var ne;const L=C.current;C.current=null,L&&F.current.onDrop(L);const Z=I.current;Z&&(window.removeEventListener("pointermove",Z.move),window.removeEventListener("pointerup",Z.end),window.removeEventListener("pointercancel",Z.end)),(ne=S.current)==null||ne.remove(),k.current&&Iy(!1)},[]);function W(L){const Z=L.getBoundingClientRect(),ne=m.current.scale||1;return{x:(x.current.x-Z.left)/ne-L.clientLeft,y:(x.current.y-Z.top)/ne-L.clientTop}}function G(){const L=S.current,Z=p.current;if(!L||!Z)return;const ne=W(Z);L.style.left=`${i==="y"?m.current.originLeft:ne.x-m.current.grabX}px`,L.style.top=`${ne.y-m.current.grabY}px`}function H(){const L=p.current,{x:Z,y:ne}=W(L),fe=z.current;let de=0,pe=1/0;return Dy(L).forEach(N=>{const ee=fe.findIndex(Oe=>T.current(Oe)===N.dataset.dragid);if(ee<0)return;const le=N.offsetLeft+N.offsetWidth/2,xe=N.offsetTop+N.offsetHeight/2,_e=(Z-le)**2+(ne-xe)**2;_e<pe&&(pe=_e,de=ee)}),Math.max(0,Math.min(fe.length-1,de))}function U(L,Z,ne){const fe=!A.current.has(L),de=A.current.get(L)??{position:L.style.position,zIndex:L.style.zIndex,opacity:L.style.opacity,borderRadius:L.style.borderRadius};A.current.set(L,de),getComputedStyle(L).position==="static"&&(L.style.position="relative"),fe&&(L.style.borderRadius=aE(L)??de.borderRadius),L.style.zIndex=Z,L.style.opacity=ne?uB:de.opacity,ne?L.setAttribute("data-ghost",""):L.removeAttribute("data-ghost")}function D(L){const Z=A.current.get(L);Z&&(L.style.position=Z.position,L.style.zIndex=Z.zIndex,L.style.opacity=Z.opacity,L.style.borderRadius=Z.borderRadius,L.removeAttribute("data-ghost"),A.current.delete(L))}function K(L,Z){var N;j.current=iB(L);const ne=getComputedStyle(Z).backgroundColor,fe=aE(Z),de=aB(Z);fe&&(de.style.borderRadius=fe),Object.assign(de.style,{position:"absolute",left:"0px",top:"0px",width:`${Z.offsetWidth}px`,margin:"0",zIndex:pB,pointerEvents:"none",transform:"none",opacity:"1",transition:"none",animation:"none",boxShadow:sE,backgroundColor:lh(ne)?ne:j.current}),m.current.originLeft=Z.offsetLeft;const pe=((N=_.current)==null?void 0:N.length)??1;if(pe>1){const ee=document.createElement("span");ee.className=yB,ee.textContent=String(pe),de.appendChild(ee)}L.appendChild(de),S.current=de}function M(L,Z,ne,fe){if(Z.left===ne.left&&Z.top===ne.top)return;const de=$.current.get(L),pe=(de==null?void 0:de.playState)==="running"?cB(getComputedStyle(L).transform):{x:0,y:0};de==null||de.cancel();const N=Z.left+pe.x-ne.left,ee=Z.top+pe.y-ne.top;if(!N&&!ee)return;$.current.set(L,L.animate([{transform:`translate(${N}px,${ee}px)`},{transform:"none"}],{duration:lE,easing:Ly}));const le=j.current;fe&&!lh(getComputedStyle(L).backgroundColor)&&L.animate([{backgroundColor:le},{backgroundColor:le}],{duration:lE})}function B(L,Z,ne){var xe;(xe=$.current.get(L))==null||xe.cancel();const fe=Z.left-ne.left,de=Z.top-ne.top;if(!fe&&!de)return;const pe=getComputedStyle(L),N=lh(pe.backgroundColor)?pe.backgroundColor:j.current;U(L,hB,!1);const ee=L.animate([{transform:`translate(${fe}px,${de}px)`},{transform:"none"}],{duration:cE,easing:Ly});L.animate([{boxShadow:sE,backgroundColor:N},{boxShadow:pe.boxShadow,backgroundColor:N}],{duration:cE,easing:Ly}),$.current.set(L,ee);const le=()=>{k.current||D(L)};ee.onfinish=le,ee.oncancel=le}w.useLayoutEffect(()=>{const L=p.current;if(!L)return;L.setAttribute(wM,"");const Z=k.current,ne=O.current;O.current=new Set;const fe=Dy(L);if(Z&&!S.current){const ee=fe.find(le=>le.dataset.dragid===Z);ee&&K(L,ee)}if(!Z)for(const ee of[...A.current.keys()])D(ee);const de=dE(L),pe=y.current,N={};fe.forEach(ee=>{const le=ee.dataset.dragid,xe={left:ee.offsetLeft,top:ee.offsetTop};N[le]=xe,Z&&U(ee,le===Z?dB:fB,le===Z);const _e=pe[le];!_e||!de||(ne.has(le)?B(ee,_e,xe):M(ee,_e,xe,Z!==null&&le!==Z))}),y.current=N,Z&&G()});function X(){const L=C.current;C.current=null,L&&F.current.onDrop(L)}function se(L,Z,ne){var le,xe,_e,Oe,be;X();const fe=p.current,de=Dy(fe).find(Te=>Te.dataset.dragid===L)??null;if(!de)return;const pe=de.getBoundingClientRect(),N=fe.getBoundingClientRect().width/fe.offsetWidth||1;m.current={grabX:(ne.clientX-pe.left)/N,grabY:(ne.clientY-pe.top)/N,scale:N,originLeft:de.offsetLeft},(xe=(le=document.activeElement)==null?void 0:le.blur)==null||xe.call(le),(be=(Oe=(_e=window.getSelection)==null?void 0:_e.call(window))==null?void 0:Oe.removeAllRanges)==null||be.call(Oe),Iy(!0),x.current={x:ne.clientX,y:ne.clientY},z.current=e,T.current=t,_.current=null;let ee=L;if(Z&&Z.length>1&&Z.includes(L)){const{collapsed:Te,members:tt}=bB(e,t,new Set(Z)),Ne=tt[0];tt.length>1&&Ne!==void 0&&(_.current=tt,ee=t(Ne),z.current=Te,F.current.onReorder(Te))}k.current=ee,f(ee)}function J(L,Z,ne){L.button===0&&(L.target.closest(c)||(v.current={key:Z,x:L.clientX,y:L.clientY,group:ne},I.current={move:P,end:Y},window.addEventListener("pointermove",P),window.addEventListener("pointerup",Y),window.addEventListener("pointercancel",Y)))}function P(L){const Z=v.current;if(!Z)return;if(!k.current){if(Math.hypot(L.clientX-Z.x,L.clientY-Z.y)<a)return;se(Z.key,Z.group,L)}x.current={x:L.clientX,y:L.clientY},G();const ne=H(),fe=z.current,de=fe.findIndex(N=>T.current(N)===k.current);if(de<0||de===ne)return;const pe=lB(fe,de,ne);z.current=pe,F.current.onReorder(pe)}function Y(){window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",Y),window.removeEventListener("pointercancel",Y),I.current=null,v.current=null;const L=k.current;if(!L)return;const Z=_.current;_.current=null;const ne=Z?Z.map(de=>T.current(de)):[L];if(Z){const de=vB(z.current,Z);z.current=de,F.current.onReorder(de)}const fe=S.current;if(fe){for(const de of ne)y.current[de]={left:fe.offsetLeft,top:fe.offsetTop};O.current=new Set(ne),fe.remove(),S.current=null}gB(p.current),k.current=null,Iy(!1),f(null),C.current=z.current,dE(p.current)?requestAnimationFrame(()=>setTimeout(X,0)):X()}return{containerRef:p,getItemProps:(L,Z)=>({"data-dragid":L,onPointerDown:ne=>J(ne,L,Z)}),draggingKey:u}}let xB=0;function wB(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`li-${(xB++).toString(36)}`}function Fh(e,t){return{key:(t==null?void 0:t(e))??wB(),value:e}}function kB(e,t){return e.map(n=>Fh(n,t))}function _B(e,t,n){return t.map((r,i)=>{const a=e[i];return a!==void 0&&JSON.stringify(a.value)===JSON.stringify(r)?{key:a.key,value:r}:Fh(r,n)})}function Uy(e){return JSON.stringify(e)}function Oi({items:e,identityOf:t,fixed:n=!1,axis:r="y",commit:i,onCommitted:a}){const[c,u]=w.useState(()=>kB(e,t)),[f,p]=w.useState(()=>Uy(e)),y=w.useRef(c);w.useEffect(()=>{y.current=c},[c]);function m(S){y.current=S,u(S)}function x(S,j){m(S),p(Uy(S.map(O=>O.value))),i(S,j),a==null||a(S,j)}const v=kM({items:c,getKey:S=>S.key,onReorder:m,onDrop:S=>x(S,"reorder"),axis:r,threshold:5});if(!v.draggingKey){const S=Uy(e);S!==f&&(p(S),u(_B(c,e,t)))}function _(S,j){const O=y.current;O.some(A=>A.key===S)&&x(O.map(A=>A.key===S?{...A,value:j(A.value)}:A),"edit")}function k(S,j=0){if(n)return;const O=y.current,A=Math.min(Math.max(j,0),O.length);x([...O.slice(0,A),S,...O.slice(A)],"add")}return{rows:c,drag:v,canAdd:!n,canRemove:!n,add:(S,j)=>k(Fh(S,t),j),insert:k,remove:S=>{n||x(y.current.filter(j=>j.key!==S),"remove")},removeMany:S=>{const j=y.current,O=j.filter(A=>!S.includes(A.key));n||O.length===j.length||x(O,"remove")},setValue:(S,j)=>_(S,()=>j),updateValue:_,replace:S=>x(S,"replace"),mint:S=>Fh(S,t),indexOf:S=>c.findIndex(j=>j.key===S),keyAt:S=>{var j;return((j=c[S])==null?void 0:j.key)??null},latestRows:()=>y.current}}function Ai(e,t,n,r){return e.isEmpty(n)?r?"required":null:e.isInvalid(n,t)?"invalid":null}const SB={failed:"Crop failed. The image is unchanged. Try cropping again."};function _M(e,t,n){const r=e.find(i=>i.media===null?i.holder===t||i.holder===`${t}.${n}`:i.holder===t&&i.media===n);return(r==null?void 0:r.at)??null}function px({storeKey:e="",holderPath:t,mediaId:n,cropped:r,cropFailedAt:i,className:a}){const c=YI(e),u=ou(k=>k.clearNotice),f=ou(k=>k.dismissFailure),p=M7(),y=i??p,m=!r||t===void 0||n===""?null:(y==null?void 0:y(t,n))??null,x=m===null?null:GI(t,n,m),v=ou(k=>x!==null&&k.dismissedFailures[x]===!0),_=c??(x!==null&&!v?"failed":void 0);return _?h.jsxs("p",{role:"alert","data-crop-notice":_,className:ce($l,"flex items-center justify-between gap-2",a),onClick:k=>k.stopPropagation(),onDoubleClick:k=>k.stopPropagation(),children:[h.jsx("span",{children:SB[_]}),h.jsx("button",{type:"button",className:ce(vt,"shrink-0 underline"),onClick:()=>{u(e),x!==null&&f(x)},children:"Dismiss"})]}):null}function Tn(e){if(typeof e!="object"||e===null)return null;const t=oL(e)??Kn(e);return t===void 0||t===""?null:t}function ld(e){const t=Tn(e);if(t!==null||typeof e!="object"||e===null)return t;const n=e.id;return typeof n=="string"&&n.length>0?n:null}function ml(e){if(typeof e!="object"||e===null)return;const t=e.picked;return typeof t=="string"||t===null?t:xo(e)?e.media:void 0}function Cr(e){if(typeof e!="object"||e===null)return!1;const t=e;return["file","media"].some(n=>typeof t[n]=="string")||Kn(e)!==void 0}function SM(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const t=ld(e),n=ml(e);if(t!==null)return{file:t,...n===void 0?{}:{picked:n}}}return{file:""}}function EB(e){return e.map(SM).filter(t=>t.file!=="")}function EM(e){switch(e.kind){case"document":return sM(e.name,e.mime??"");case"video":return{glyph:"video",typeNoun:"Video",extension:""};case"photo":return{glyph:"image",typeNoun:"Image",extension:""};case"tour":return{glyph:"video",typeNoun:"3D tour",extension:""}}}function jB(e){return[EM(e).typeNoun,e.size].filter(Boolean).join(" · ")}function OB(e){const t=Ll(e);return n=>{const r=t.get(n);return r===void 0?void 0:cM(r)}}const AB={page:"expanded",panel:"compact",cell:"compact"};function CB(e){return AB[e]}const jM=w.createContext(null);function cd({place:e,children:t}){return h.jsx(jM.Provider,{value:e,children:t})}function mx(){const e=w.useContext(jM);if(e===null)throw new Error("[slot-editors] a slot editor was drawn outside a place: its container mounts <SlotPlaceProvider>.");return e}const OM=w.createContext(!1);function NB({shown:e,children:t}){return h.jsx(OM.Provider,{value:e,children:t})}function Ul(){return w.useContext(OM)}const MB=ce("flex w-full items-stretch rounded-[calc(10*var(--content))] border-[1.5px] border-line bg-canvas","transition-[border-color,box-shadow,background-color] duration-[120ms]","focus-within:border-ink focus-within:shadow-[0_0_0_4px_rgba(20,18,13,0.05)]",zl),RB="min-w-0 flex-1 appearance-none border-0 bg-transparent px-3.5 py-2.75 text-[length:calc(15*var(--content))] text-ink outline-none placeholder:text-ink-4",TB=ce("flex w-full min-w-0 flex-1 items-stretch rounded-[calc(6*var(--content))] border border-transparent bg-transparent","in-data-[card-fields]:bg-white","transition-[border-color,box-shadow,background-color] duration-100","group-hover/row:border-line group-hover/row:bg-white group-focus-within/row:border-line group-focus-within/row:bg-white","focus-within:border-ink focus-within:bg-white focus-within:shadow-[0_0_0_3px_rgba(20,18,13,0.05)]",zl),AM={"data-card-fields":""},$B="min-w-0 flex-1 appearance-none truncate border-0 bg-transparent px-2.5 py-2 text-[length:calc(13.5*var(--content))] leading-[1.2] text-ink outline-none placeholder:text-ink-4",zB={page:{frame:ce(As,"gap-1.5"),shell:MB,inner:RB,adornEnd:"pr-3.5",multiline:"resize-none leading-[1.5]",inline:!1},panel:{frame:As,shell:ce(w7,zl),inner:k7,adornEnd:"pr-2.75",multiline:"min-h-[calc(76*var(--content))] resize-none leading-[1.5]",inline:!1},cell:{frame:"flex w-full min-w-0 flex-col",shell:TB,inner:$B,adornEnd:"pr-2.5",multiline:"resize-none overflow-hidden whitespace-nowrap",inline:!0}};function Ci(){return CM(mx())}function CM(e){return{place:e,...zB[e]}}function DB({count:e,max:t}){const n=t-e;return n>Math.ceil(t/5)?null:n<=0?{left:0,tone:"text-danger"}:{left:n,tone:n<=Math.ceil(t/10)?VN:"text-ink-4"}}const LB=ce("relative","[&>input]:transition-[padding] [&>input]:duration-200 [&>input]:ease-out motion-reduce:[&>input]:transition-none","[&[data-count-open]>input]:pr-10","[&[data-count-room=band]]:flex-wrap"),IB="pointer-events-none absolute inset-y-0 right-0 flex items-center",UB=ce("flex h-0 basis-full items-end justify-end overflow-hidden","transition-[height] duration-200 ease-out motion-reduce:transition-none"),PB={page:"data-[open]:h-[calc(22*var(--content))] data-[open]:pb-2.75",panel:"data-[open]:h-[calc(20*var(--content))] data-[open]:pb-2.25",cell:""};function Ns({attention:e,count:t,className:n,ref:r,children:i}){const a=Ci(),c=Ul(),[u,f]=w.useState(!1),p=t!==void 0&&!a.inline,y=p&&u?DB(t):null,m=p&&t.multiline,x=y!==null&&h.jsxs("span",{"data-field-count":"",className:ce(qN,y.tone,"leading-none transition-[opacity,transform] duration-200 ease-out starting:translate-y-1 starting:opacity-0 motion-reduce:transition-none"),children:[y.left,h.jsx("span",{className:"sr-only",children:" characters left"})]});return h.jsxs("div",{ref:r,className:ce(a.shell,p&&LB,n),...Dl(e,c),"data-count-room":p?m?"band":"end":void 0,"data-count-open":y!==null?"":void 0,onFocus:p?()=>f(!0):void 0,onBlur:p?()=>f(!1):void 0,children:[i,m?h.jsx("div",{className:ce(UB,PB[a.place],a.adornEnd),"data-open":y!==null?"":void 0,children:x}):y!==null&&h.jsx("div",{className:ce(IB,a.adornEnd),children:x})]})}function NM({attention:e,message:t}){const n=Ci();return e!=="invalid"||n.inline?null:h.jsx("p",{className:$l,children:t})}const MM="h-[var(--list-display-h,clamp(280px,calc(100cqh-var(--list-display-clear,32px)),calc(560*var(--frame))))]",Pl="h-[var(--list-display-h,clamp(280px,calc(100cqh-var(--list-display-clear,32px)),calc(480*var(--frame))))]",gx="data-upstream:opacity-55 data-upstream:hover:opacity-100 data-upstream:focus-within:opacity-100",FB="hp-anim-menu rounded border border-line bg-canvas shadow-[0_1px_2px_rgba(20,18,13,0.04),0_8px_24px_-8px_rgba(20,18,13,0.08)]",RM="flex w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-1.75 text-left text-[length:calc(12.5*var(--content))]",BB=`${RM} text-ink-2 hover:bg-accent-soft hover:text-ink`,TM="truncate rounded-full bg-white/90 px-1.5 py-0.5 text-[length:calc(10.5*var(--content))] font-semibold text-ink-2 shadow-[0_1px_3px_rgba(0,0,0,0.18)]",$M="select-none";function HB(e,t){const n=[{label:"Preview",glyph:"eye",onSelect:t.onPreview}];return t.onRenameStart&&n.push({label:"Rename",glyph:"pencil",onSelect:t.onRenameStart}),t.onCrop&&n.push({label:"Crop",glyph:"crop",onSelect:t.onCrop}),iu(e)||n.push({label:"Download",glyph:"down",onSelect:t.onDownload}),t.onDelete&&n.push({label:t.deleteLabel??"Delete",glyph:"trash",onSelect:t.onDelete,danger:!0}),n}function zM({file:e,handlers:t,shown:n=!1}){return h.jsx(LM,{name:e.name,actions:HB(e,t),shown:n})}function DM(e){return{plain:e.filter(t=>!t.foot&&!t.danger),foot:[...e.filter(t=>t.foot&&!t.danger),...e.filter(t=>t.danger)]}}const fE=4;function LM({name:e,actions:t,shown:n=!1,scale:r="card"}){const[i,a]=w.useState(!1),c=w.useRef(null),u=w.useRef(null),f=w.useRef(null),[p,y]=w.useState(null),m=w.useCallback(()=>{a(!1),y(null)},[]);ad(c,i,m,f),w.useLayoutEffect(()=>{if(!i)return;const k=()=>{const S=u.current,j=f.current;if(!S||!j)return;const O=_s(S),A=j.offsetHeight,$=Cl(O,{height:A,maxHeight:A,gap:fE});if(!$){y(null);return}const C=document.documentElement.clientWidth-O.rect.right;if($.maxHeight>=A){y({top:$.top,bottom:$.bottom,right:C});return}const{rect:I,bounds:z}=O,T=z.bottom-rs-A,F=Math.max(z.top+rs,Math.min(I.bottom+fE,T));y({top:F,right:C})};return k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[i]);const{plain:x,foot:v}=DM(t),_=k=>h.jsxs("button",{type:"button",role:"menuitem",className:k.danger?`${RM} text-danger hover:bg-accent-soft`:BB,onClick:()=>{m(),k.onSelect()},children:[h.jsx(et,{name:k.glyph,size:13}),k.label]},k.label);return h.jsxs("span",{className:"we-no-drag relative inline-flex",ref:c,children:[h.jsx("button",{ref:u,type:"button",className:`grid shrink-0 cursor-pointer place-items-center rounded-full text-ink-3 transition-opacity duration-[120ms] hover:bg-[rgba(20,18,13,0.07)] hover:text-ink focus-visible:opacity-100 group-hover:opacity-100 group-aria-selected:opacity-100 ${n?r==="compact"?"h-6 w-6":"h-8 w-8":"h-5.5 w-5.5"} ${i||n?"opacity-100":"opacity-0"}`,"aria-label":`Actions for ${e}`,"aria-haspopup":"menu","aria-expanded":i,onClick:k=>{k.stopPropagation(),a(S=>!S)},onDoubleClick:k=>k.stopPropagation(),children:h.jsx(et,{name:"dots",size:r==="compact"?13:14})}),i?Tr.createPortal(h.jsxs("div",{ref:f,className:`we-no-drag ${FB} w-[calc(188*var(--frame))] p-1.25`,style:p?{position:"fixed",...p,zIndex:vi}:{position:"fixed",top:0,right:0,zIndex:vi,visibility:"hidden"},role:"menu",onClick:k=>k.stopPropagation(),onDoubleClick:k=>k.stopPropagation(),children:[x.map(_),v.length>0?h.jsxs(h.Fragment,{children:[x.length>0?h.jsx("div",{className:"mx-0 my-1 h-px bg-line-soft"}):null,v.map(_)]}):null]}),document.body):null]})}function IM({name:e,onCommit:t}){const[n,r]=w.useState(e);return h.jsx("input",{className:"we-no-drag min-w-0 flex-1 rounded-md border border-accent bg-canvas px-1.5 py-0.5 text-[length:calc(12.5*var(--content))] font-medium text-ink",value:n,autoFocus:!0,"aria-label":`Rename ${e}`,onFocus:i=>i.target.select(),onClick:i=>i.stopPropagation(),onDoubleClick:i=>i.stopPropagation(),onChange:i=>r(i.target.value),onKeyDown:i=>{i.key==="Enter"&&t(n.trim()),i.key==="Escape"&&t(null),i.stopPropagation()},onBlur:()=>t(n.trim())})}function UM(e,t="card"){return`group/card relative flex cursor-pointer flex-col aria-disabled:cursor-not-allowed ${t==="compact"?"rounded-xl":"rounded-2xl"} outline-none transition-[background-color,box-shadow,opacity] duration-[140ms] ${e?"bg-accent-tint ring-2 ring-accent":"bg-[#f3f2ed] hover:bg-[#ebe9e2] focus-visible:ring-2 focus-visible:ring-accent"}`}const bs={card:{bar:"flex h-12 min-w-0 items-center gap-2.5 pl-3.5 pr-2",name:"min-w-0 flex-1 truncate text-[length:calc(13*var(--content))] font-medium text-ink",thumb:"relative mx-2 aspect-[16/11] overflow-hidden rounded-xl bg-canvas"},compact:{bar:"flex h-8.5 min-w-0 items-center gap-1.5 pl-2.5 pr-1",name:"min-w-0 flex-1 truncate text-[length:calc(12*var(--content))] font-medium text-ink",thumb:"relative mx-1.5 aspect-[16/11] overflow-hidden rounded-lg bg-canvas"}},qB="we-no-drag flex cursor-auto flex-col gap-2 px-2 pt-2";function PM({kind:e,name:t,selected:n,select:r,onToggleSelect:i,scale:a="card"}){const c=a==="compact";return h.jsxs("span",{className:`relative grid shrink-0 place-items-center ${c?"h-4 w-4":"h-5 w-5"}`,children:[h.jsx("span",{className:`grid place-items-center transition-opacity duration-[120ms] ${n?"opacity-0":r.disabled?"":"group-hover/card:opacity-0"}`,children:e===null?h.jsx("span",{className:"text-ink-3",children:h.jsx(et,{name:"file",size:c?13:16})}):h.jsx(Cs,{kind:e,size:c?"dot":"mark"})}),h.jsx("button",{type:"button",role:r.control,"aria-checked":n,disabled:r.disabled,className:`we-no-drag absolute inset-0 grid cursor-pointer place-items-center border-[1.5px] transition-opacity duration-[120ms] disabled:cursor-not-allowed disabled:opacity-0 ${r.control==="radio"?"rounded-full":c?"rounded-[calc(4*var(--content))]":"rounded-md"} ${n?"border-accent bg-accent text-white opacity-100":"border-[rgba(20,18,13,0.45)] bg-canvas text-transparent opacity-0 group-hover/card:opacity-100 focus-visible:opacity-100"}`,"aria-label":n?`Deselect ${t}`:`Select ${t}`,onClick:u=>{u.stopPropagation(),i()},onDoubleClick:u=>u.stopPropagation(),children:h.jsx(et,{name:"check",size:c?10:12,stroke:2.6})})]})}function VB({file:e,selected:t,renaming:n,onClick:r,onDoubleClick:i,onToggleSelect:a,select:c,listChip:u,onRetry:f,onRecheck:p,onRenameCommit:y,handlers:m,drag:x,beneath:v,notice:_}){return h.jsxs("div",{...x,role:"option","aria-selected":t,"aria-disabled":c.disabled||void 0,"data-upstream":e.upstream||void 0,tabIndex:0,className:`${UM(t)} ${gx} ${x?$M:""}`,onClick:r,onDoubleClick:i,onKeyDown:k=>{k.target===k.currentTarget&&k.key==="Enter"&&(k.stopPropagation(),m.onPreview())},children:[h.jsxs("div",{className:bs.card.bar,children:[h.jsx(PM,{kind:e.kind,name:e.name,selected:t,select:c,onToggleSelect:a}),n?h.jsx(IM,{name:e.name,onCommit:y}):h.jsx("span",{className:bs.card.name,title:e.name,children:e.name}),h.jsx(zM,{file:e,handlers:m,shown:!0})]}),h.jsxs("div",{className:bs.card.thumb,children:[h.jsx(ux,{file:e}),h.jsx(gM,{file:e,onRetry:f,onRecheck:p}),u!==null?h.jsx("span",{className:`absolute right-2 top-2 z-[3] max-w-[calc(100%-16px)] ${TM}`,"data-list-chip":"",children:u}):null]}),v?h.jsx("div",{className:qB,...AM,onClick:k=>k.stopPropagation(),onDoubleClick:k=>k.stopPropagation(),children:v}):null,_,h.jsx("div",{className:"flex h-11 min-w-0 items-center px-3.5",children:h.jsx("span",{className:"truncate text-[length:calc(11.5*var(--content))] text-ink-3",children:IF(e)})})]})}function ZB(){return h.jsxs("div",{className:`flex flex-col rounded-2xl ${ix}`,children:[h.jsxs("div",{className:bs.card.bar,children:[h.jsx("span",{className:`h-4.5 w-4.5 shrink-0 rounded-md ${Mn}`}),h.jsx("span",{className:"min-w-0 flex-1",children:h.jsx("span",{className:`block h-2.5 w-3/5 rounded-full ${Mn}`})}),h.jsx("span",{className:`mr-1.5 h-1.5 w-4 shrink-0 rounded-full ${Mn}`})]}),h.jsx("div",{className:ce(bs.card.thumb,Mn)}),h.jsx("div",{className:"flex h-11 items-center px-3.5",children:h.jsx("span",{className:`h-2 w-2/5 rounded-full ${Mn}`})})]})}const FM="grid grid-cols-[calc(28*var(--frame))_calc(44*var(--frame))_1fr_calc(110*var(--frame))_calc(80*var(--frame))_calc(90*var(--frame))_calc(36*var(--frame))] items-center gap-2.5 px-3",hE="flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[length:calc(11.5*var(--content))] font-medium";function KB(){return h.jsxs("div",{role:"row",className:`${FM} h-9.5 text-[length:calc(11*var(--content))] font-semibold tracking-[0.02em] text-ink-3`,children:[h.jsx("span",{}),h.jsx("span",{}),h.jsx("span",{children:"Name"}),h.jsx("span",{children:"Kind"}),h.jsx("span",{children:"Size"}),h.jsx("span",{children:"Added"}),h.jsx("span",{})]})}function GB({file:e,onRetry:t,onRecheck:n}){return e.state==="failed"?h.jsxs("span",{className:`${hE} text-danger`,children:[e.error,t?h.jsx("button",{type:"button",className:"font-semibold text-ink underline",onClick:r=>{r.stopPropagation(),t()},children:"Retry"}):null]}):e.linkUnreachable?h.jsxs("span",{className:`${hE} text-warn`,title:rv,children:[mM,n?h.jsx("button",{type:"button",className:"font-semibold text-ink underline",onClick:r=>{r.stopPropagation(),n()},children:"Re-check"}):null]}):null}function YB({file:e,selected:t,renaming:n,onClick:r,onDoubleClick:i,onToggleSelect:a,select:c,listChip:u,onRetry:f,onRecheck:p,onRenameCommit:y,handlers:m,drag:x}){return h.jsxs("div",{...x,role:"row","aria-selected":t,"aria-disabled":c.disabled||void 0,"data-upstream":e.upstream||void 0,className:`group ${FM} ${gx} h-12 cursor-pointer border-t border-line-soft transition-opacity duration-[140ms] aria-disabled:cursor-not-allowed last:rounded-b-[calc(11*var(--content))] ${t?"bg-accent-soft":"hover:bg-[#fbfaf7]"} ${x?$M:""}`,onClick:r,onDoubleClick:i,children:[h.jsx("button",{type:"button",role:c.control,"aria-checked":t,disabled:c.disabled,className:`grid h-4 w-4 cursor-pointer place-items-center border-[1.5px] disabled:cursor-not-allowed disabled:opacity-40 ${c.control==="radio"?"rounded-full":"rounded-[calc(5*var(--content))]"} ${t?"border-accent bg-accent text-white":"border-[#cfccc0] bg-canvas text-transparent group-hover:border-[#b3b0a3]"}`,"aria-label":t?`Deselect ${e.name}`:`Select ${e.name}`,onClick:v=>{v.stopPropagation(),a()},onDoubleClick:v=>v.stopPropagation(),children:t?h.jsx(et,{name:"check",size:10,stroke:3}):null}),h.jsxs("span",{className:"relative block h-7.5 w-11 overflow-hidden rounded-md border border-line-soft bg-[#f4f3ee]",children:[h.jsx(ux,{file:e,face:"row"}),h.jsx(gM,{file:e,compact:!0})]}),h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n?h.jsx(IM,{name:e.name,onCommit:y}):h.jsx("span",{className:"min-w-0 truncate text-[length:calc(12.5*var(--content))] font-medium text-ink",title:e.name,children:e.name}),h.jsx(GB,{file:e,onRetry:f,onRecheck:p}),u!==null?h.jsx("span",{className:`shrink-0 ${TM}`,"data-list-chip":"",children:u}):null]}),h.jsx("span",{className:"inline-flex",children:h.jsx(pM,{file:e})}),h.jsx("span",{className:"whitespace-nowrap text-xs text-ink-3",children:fM(e.bytes)}),h.jsx("span",{className:"whitespace-nowrap text-xs text-ink-3",children:hM(e.addedAt)}),h.jsx(zM,{file:e,handlers:m})]})}const QB={control:"checkbox",disabled:!1},{bar:XB,name:WB,thumb:JB}=bs.compact,eH="we-no-drag flex cursor-auto flex-col gap-1.5 px-1.5 pt-1.5";function tH({kind:e,name:t,chrome:n,thumb:r,below:i,beneath:a}){const{selected:c,onToggleSelect:u,actions:f}=n;return h.jsxs("div",{role:"option","aria-selected":c,tabIndex:0,"data-gallery-card":"",className:UM(c,"compact"),onClick:u,onKeyDown:p=>{p.target===p.currentTarget&&(p.key===" "||p.key==="Enter")&&(p.preventDefault(),u())},children:[h.jsxs("div",{className:XB,children:[h.jsx(PM,{kind:e,name:t,selected:c,select:QB,onToggleSelect:u,scale:"compact"}),h.jsx("span",{className:WB,title:t,children:t}),f.length>0&&h.jsx(LM,{name:t,actions:f,shown:!0,scale:"compact"})]}),h.jsx("div",{className:JB,"data-thumb":!0,"data-media-tile":e,children:r}),i,a?h.jsx("div",{className:eH,...AM,onClick:p=>p.stopPropagation(),children:a}):null,h.jsx("div",{className:"h-1.5"})]})}function yx(e,t){const n=e!=null&&e.cut?e.derivativeUrl:t,[r,i]=w.useState(n);return n!==void 0&&n!==r&&i(n),n??r??t}const bx="flex max-h-full w-full flex-col overflow-hidden rounded-[14px] bg-canvas shadow-[0_24px_70px_-24px_rgba(20,18,13,0.5),0_2px_0_rgba(20,18,13,0.04)]",nH="h-[min(88vh,max(560px,calc(min(80vw,1440px)*0.625)))] max-h-full w-[min(80vw,1440px)] max-md:h-full max-md:w-full",rH=ce(bx,nH),oH="max-h-[min(calc(100vh-120px),max(680px,72vh))] w-[clamp(560px,38vw,960px)] max-w-full max-md:w-full",BM="px-[clamp(18px,1.4vw,40px)]",vx="px-[clamp(20px,1.75vw,36px)]",iH=ce("flex flex-shrink-0 items-center gap-[14px] pb-3 pt-[clamp(18px,1.6vw,30px)]",vx),sH=ce("flex min-h-0 flex-1 flex-col overflow-y-auto pb-[clamp(20px,1.75vw,36px)] pt-3 [container-type:size] [--list-display-h:100cqh] [&>*]:shrink-0",vx),xx="mr-auto flex min-w-0 flex-col gap-0.5",wx="m-0 text-[16px] font-semibold tracking-[-0.01em]",aH="text-[12px] text-ink-3",kx=ce(vt,"grid size-8 flex-shrink-0 place-items-center rounded-[8px] text-ink-3 hover:bg-[#f1f0ea] hover:text-ink"),HM="px-[18px] py-[13px]",lH=ce("flex flex-shrink-0 items-center gap-[14px]",HM),cH=ce("flex flex-shrink-0 items-center justify-between gap-3 border-t border-line-soft",HM),uH="ml-auto flex gap-2",qM=ce(vt,"inline-flex h-9 items-center gap-1.5 rounded-[9px] border border-transparent px-4 text-[13px] font-semibold"),dH=ce(qM,"border-line bg-white text-ink hover:bg-[#faf9f6]"),fH=ce(qM,"border-honey-2 bg-honey text-honey-ink hover:bg-honey-2 disabled:cursor-default disabled:opacity-45"),hH=ce(vt,"inline-flex h-9 items-center px-1 font-medium text-ink-2 hover:text-ink"),pH={page:"max-w-[920px]",crop:"max-w-[680px]"};function mH({open:e=!0,variant:t,onClose:n,children:r}){return h.jsx(ox,{open:e,onClose:n,className:ce(bx,pH[t]),children:r})}const _x={Shell:mH,head:lH,titles:xx,title:wx,subtitle:aH,close:kx,CloseIcon:Mt.x,foot:cH,actions:uH,buttonGhost:dH,buttonPrimary:fH,buttonLink:hH,ZoomOutIcon:Mt.minus,ZoomInIcon:Mt.plus},pE=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function ch(e){return e.slice(e.indexOf(".")+1)}function VM(e,t){let n=e;for(const r of t.holder.split("."))Array.isArray(n)?n=n.find(i=>pE(i)&&i.id===r):n=pE(n)?n[r]:void 0;return Array.isArray(n)?n.find(r=>Kn(r)===t.mediaId):Kn(n)===t.mediaId?n:void 0}function gH(e,t,n){if(e===void 0)return;const r=VM(e,n),i=r===void 0?void 0:t.get(n.mediaId),a=i===void 0||!Object.hasOwn(e.files,i.file)?void 0:e.files[i.file];if(i===void 0||a===void 0)return;const c=xo(r)?bp(i,r):i;return h0(a,c)}function ZM(e,t,n){const r=VM(e,n),i=t.get(n.mediaId);if(!xo(r)||i===void 0)return!1;const a=bp(i,r);return Os(a.crop,i.crop)&&(i.renditions.crop===null||a.renditions.crop!==null)}const yH=16/10;function mE(e,t){return e.state==="failed"?!0:!Os(e.crop,t)||aM(e)?!1:!Ls(t)||e.renditions.crop!==null}function KM({propertyId:e,recordAt:t,inheritsCrop:n,write:r,onFailed:i,onArrived:a}){const c=Wc(v=>v.byPlace),[u,f]=w.useState(null),p=v=>{const _=t(v),k=c[ao(v)];return k!==void 0?_===void 0||!mE(_,k.crop):_!==void 0&&aM(_)};w.useEffect(()=>{const v=Object.values(c).filter(_=>{const k=_.propertyId===e?t(_.place):void 0;return k!==void 0&&mE(k,_.crop)});if(v.length!==0){for(const _ of v)Wc.getState().settle(_.place);a==null||a()}},[c,t,e,a]);const y=async(v,_,k)=>{if(f(null),r===void 0)return;const S=Mb(k);if(!Os(S,_.crop)){Wc.getState().start(v,e,S);try{await r(v,fl(S))}catch(j){Wc.getState().settle(v),i==null||i(v),console.error("[media] home crop failed",{place:v,err:j})}}},m=u===null?void 0:t(u),x=(m==null?void 0:m.file_url)??null;return{offers:v=>{const _=t(v);return e!==""&&r!==void 0&&(_==null?void 0:_.kind)==="image"&&_.url===null&&_.file_url!==null},open:f,isOpen:m!==void 0&&x!==null,recropping:p,cropped:v=>{var _;return!n(v)&&Ls(((_=t(v))==null?void 0:_.crop)??null)},modal:u!==null&&m!==void 0&&x!==null?h.jsx(I0,{chrome:_x,src:x,mode:"free",aspect:yH,seed:{rect:fl(m.crop)},onClose:()=>f(null),onApply:v=>void y(u,m,v.rect)}):null}}const bH=1500;function vH(e){const t=Up(e===""?null:e);return w.useMemo(()=>{const n=t===void 0?new Map:Nl(t);return{recordAt:r=>gH(t,n,r),inheritsCrop:r=>t!==void 0&&ZM(t,n,r)}},[t])}function GM(e,t){const n=lx(),r=So(),{recordAt:i,inheritsCrop:a}=vH(e),{cropMedia:c}=n,u=w.useMemo(()=>c===void 0?void 0:async(x,v)=>{await c(e,x.mediaId,v,x.holder),await tv(r,n,e)},[c,e,r,n]),f=w.useMemo(()=>()=>void tv(r,n,e),[r,n,e]),p=KM({propertyId:e,recordAt:i,inheritsCrop:a,write:u,onFailed:t,onArrived:f}),y=Wc(x=>x.byPlace),m=Object.values(y).some(x=>x.propertyId===e&&p.recropping(x.place));return Rn({...n.mediaFactsQuery(e),enabled:e!==""&&m,refetchInterval:m?bH:!1}),p}function YM(e,t){var i;const n=Mb(t.rect);if(n===null){if(!e.crop&&!e.mobile)return null;const a=e.renditions?{renditions:{...e.renditions,crop:null}}:{};return{...e,crop:null,ar:null,mobile:null,...a}}const r=(i=e.mobile)!=null&&i.renditions?{renditions:e.mobile.renditions}:{};return{...e,crop:n,ar:t.ar,mobile:t.mobile?{crop:Mb(t.mobile.rect),derived:t.mobile.derived,...r}:e.mobile??null}}function QM(e,t){return e.crop?Ls(e.crop):(t==null?void 0:t.mode)!=="locked"?!1:XM(e,t.aspect)}function XM(e,t){return typeof e.ar!="number"||BC(e.ar,t)!==null}function WM(e,t){var n;return QM(e,t)?!0:(n=e.mobile)!=null&&n.crop?Ls(e.mobile.crop):t.mode==="locked"&&t.mobileAspect!==void 0&&XM(e,t.mobileAspect)}function ov(e,t){var i,a,c,u;if(!QM(e,t))return null;const n=(a=(i=e.renditions)==null?void 0:i.cutout)==null?void 0:a.key;if(typeof n=="string"&&n.startsWith(`processed/cutout/${e.file}/`))return n;const r=(u=(c=e.renditions)==null?void 0:c.crop)==null?void 0:u.key;return typeof r=="string"&&r.startsWith(`processed/crops/${e.file}/`)?r:null}function xH(e){const{width:t,height:n}=e!==null&&typeof e=="object"?e:{};return{width:typeof t=="number"?t:null,height:typeof n=="number"?n:null}}function gl(e){var t;return((t=e.renditions.cutout)==null?void 0:t.url)??Lh(e)??""}function Sx(e,t,n,r,i){const a=gl(e);if(e.file===t.file)return{...t,url:a};const c=n===void 0?void 0:F8(n,i,e.id);return c===void 0||n===void 0?{file:e.file,url:a,alt:t.alt,picked:e.id}:{...B8(c,xH(n.files[c.file]),r),url:a,alt:t.alt}}const JM={New:td,Choose:NN,Upload:Tp};function ku(e,t){return`${e} ${t}`}function Ex(e,t,n){const r=Rr(t),i=n&&e==="New"?r.singular:r.plural;return{verb:e,icon:JM[e],label:ku(e,i),empty:`No ${r.plural} yet`}}function wH(e,t,n,r){const i=n.flatMap(c=>{const u=eR(c,r);return u===null?[]:[Rr(u)[t?"plural":"singular"]]}),a=Ex("Choose",e,t);return i.length===0?a:{...a,label:ku("Choose",[...new Set(i)].join(" or "))}}const kH={property:"Property",library:"Library"};function eR(e,t){if(!/^(?:property|library)\./.test(e))return null;const n=Oh(e);if(n===null)return null;const{home:r}=go(e);return r===t?n:`${kH[r]} ${n.charAt(0).toLowerCase()}${n.slice(1)}`}function Pp(e,t={}){return e.locked===!0||!_H(e)?null:jx(e,t)}function _H(e){const t=e.type;return t==="list"||t==="row"||po(e.type)}function jx(e,t={}){const n=e.type==="list",r=EH(e,t);return{add:Ex(!n&&po(e.type)?"Upload":"New",e.label,n),choose:r===null?null:wH(e.label,n,r.lists,r.home)}}function SH(e){const[t]=e,n=e.length===1&&t!==void 0?Oh(t)??void 0:void 0;return Ex("New",n,!0)}function tR(e){return e.choose??e.add}function EH(e,t){const n=OH(e,t.table);if(n!==null&&Es(n).length>0){const a=Es(n)[1];return a===void 0?null:{lists:[a],home:go(n).home}}const r=jH(e,t),i=t.membership;if((i==null?void 0:i.kind)==="pick-row"||(i==null?void 0:i.kind)==="pick-media"){const a=i.kind==="pick-row"?i.tables.map(c=>cl(c)):is(i.filter.from);return{lists:r!==null&&r.length>0?r:a,home:"property"}}return r===null?null:{lists:r,home:"property"}}function jH(e,t){if(e.type==="list")return e.element===void 0?null:CH(e.element);if(e.type==="row")return is(e.from);if(!po(e.type))return null;const n=dl(e,t.table);return(n==null?void 0:n.kind)==="picked"?is(n.filter.from):null}function is(e){return kp({from:e}).filter(t=>/^(?:property|library)\./.test(t))}function OH(e,t){const n=e.source;if((n==null?void 0:n.kind)==="home"&&typeof n.key=="string")return/^(?:property|library)\./.test(n.key)?n.key:null;const r=(n==null?void 0:n.kind)==="row"?n.field:void 0;return typeof r!="string"||r===""||t==null?null:`${cl(t)}.${AH}.${r}`}const AH="_";function CH(e){const t=e.fields??{};if(xC(e)!==void 0)return e.from!==void 0?is(e.from):Object.values(t).flatMap(i=>is(i.from));if(e.type!=="object")return null;const n=cC(e);if((n==null?void 0:n.type)==="row"&&n.from!==void 0)return is(n.from);if(!A0(t))return null;const r=Object.values(t).filter(i=>po(i.type)&&i.locked!==!0&&i.from!==void 0);return r.length===0?null:r.flatMap(i=>is(i.from))}const Ox={image:"image/*",video:"video/*",tour:null,document:sF};function Ax(e){const t=e.flatMap(n=>Ox[n]??[]);return t.length===0?null:t.join(",")}function ud(e){return[...Ax(e)!==null?["file"]:[],...c0(e).length>0?["link"]:[]]}const NH=ve("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"ig-frame"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"ig-lens"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"ig-flash"}]]),MH=ve("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"fb-f"}]]),RH=ve("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"li-arm"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"li-stem"}],["circle",{cx:"4",cy:"4",r:"2",key:"li-dot"}]]),TH=ve("XLogo",[["path",{d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z",transform:"translate(2 2) scale(0.8333)",fill:"currentColor",stroke:"none",key:"x-mark"}]]),$H={home:YP,building:JU,apartments:tP,trendUp:i7,tag:n7,key:t9,template:o9,palette:R9,filePen:LP,library:s9,plug:I9,helpCircle:mP,lock:f9,creditCard:kP,settings:Q9,power:F9,user:m7,plus:td,globe:ZP,image:Rp,fileText:Mp,users:y7,eye:TN,eyeOff:$P,pulse:LU,search:tx,chart:aP,layout:zN,chevDown:G0,chevRight:Np,chevSelector:hP,pencil:W0,dots:MP,grip:Q0,external:RN,copy:xP,trash:Tl,archive:UU,sparkle:e7,arrowUp:GU,arrowDown:FU,arrowLeft:HU,arrowRight:VU,undo:u7,redo:q9,logout:p9,check:bi,x:$p,clock:yP,calendar:iP,mapPin:LN,userPlus:h7,mail:g9,phone:z9,share:W9,upload:Tp,bookOpen:QU,newspaper:N9,presentation:J0,instagram:NH,facebook:MH,linkedin:RH,xLogo:TH};function jt({name:e,size:t=18,stroke:n=2,fill:r,color:i,className:a,style:c}){const u=$H[e];return h.jsx(u,{size:t,strokeWidth:n,fill:r??"none",color:i,className:a,style:{flexShrink:0,width:`calc(${t} * var(--content))`,height:`calc(${t} * var(--content))`,...i===void 0?{}:{color:i},...c},"aria-hidden":"true"})}function Cx(){const e=w.useRef(0),t=w.useRef(!1),[n,r]=w.useState("idle"),[i,a]=w.useState(()=>Date.now()),c=w.useCallback(()=>{e.current+=1,e.current===1&&(t.current=!1),r("saving");let u=!1;return(f=!0)=>{u||(u=!0,f||(t.current=!0),e.current-=1,e.current===0&&(t.current?r("idle"):(r("saved"),a(Date.now()))))}},[]);return{state:n,savedAt:i,begin:c}}function zH(e,t=Date.now()){const n=Math.floor((t-e)/1e3);return n<5?"just now":n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:`${Math.floor(n/3600)}h ago`}const Py="inline-flex flex-shrink-0 items-center gap-1.5 whitespace-nowrap p-1 text-[length:calc(12.5*var(--content))] font-medium";function Nx({status:e}){const[,t]=w.useReducer(n=>n+1,0);return w.useEffect(()=>{const n=setInterval(t,15e3);return()=>clearInterval(n)},[]),e.state==="saving"?h.jsxs("div",{className:ce(Py,"text-ink-2"),children:[h.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.6px] border-ink-4 border-t-accent [animation-duration:0.8s]","aria-hidden":"true"}),h.jsx("span",{children:"Saving…"})]}):e.state==="error"?h.jsxs("div",{role:"status",className:ce(Py,"text-ink-2"),children:[h.jsx(jt,{name:"x",size:13,stroke:2.4,className:"text-danger"}),h.jsx("span",{children:"Not saved"})]}):h.jsxs("div",{className:ce(Py,"text-ink-3"),children:[h.jsx(jt,{name:"check",size:13,stroke:2.4,className:"text-good"}),h.jsxs("span",{children:["Saved"," ",h.jsx("span",{className:"ml-0.5 font-normal text-ink-4 [font-variant-numeric:tabular-nums]",children:zH(e.savedAt)})]})]})}const nR=w.createContext(null);function Fp({status:e,children:t}){return h.jsx(nR.Provider,{value:e,children:t})}function rR(){const e=w.useContext(nR);return e===null?null:h.jsx(Nx,{status:e})}function Mx({open:e=!0,onClose:t,title:n,notice:r,children:i}){return h.jsxs(ox,{open:e,onClose:t,ariaLabel:n,className:rH,children:[h.jsxs("div",{className:iH,children:[h.jsx("div",{className:xx,children:h.jsx("h2",{className:ce(wx,"truncate"),children:n})}),h.jsx(rR,{}),h.jsx("button",{type:"button",className:kx,onClick:t,"aria-label":"Close",children:h.jsx(Mt.x,{})})]}),r,h.jsx("div",{className:sH,children:i})]})}function DH(e){const[t]=e.ids,{removeFrom:n}=e,r=n===void 0&&e.ids.length===1&&t!==void 0&&!e.inFlightIds.has(t)?t:null,a=Rn({queryKey:["media-holders",e.scope,r],queryFn:()=>{if(r===null)throw new Error("holder read disabled without a single listed id");return e.holders(r)},enabled:r!==null}).data??[],c=WN(),u=e.ids.length;return Tr.createPortal(h.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/40",style:{zIndex:c},onClick:e.onCancel,children:h.jsxs("div",{className:"w-[calc(400*var(--frame))] rounded-lg border border-line bg-canvas p-5 shadow-xl",role:"alertdialog","aria-modal":"true",onClick:f=>f.stopPropagation(),children:[h.jsxs("div",{className:"text-[length:calc(15*var(--content))] font-semibold text-ink",children:[n===void 0?"Delete":"Remove"," ",u===1?"this object":`${u} objects`,n===void 0?"":` from ${n}`,"?"]}),n!==void 0?h.jsx("p",{className:"mt-1.5 text-body leading-[1.5] text-ink-2",children:u===1?"It stays in your uploads.":"They stay in your uploads."}):a.length>0?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"mt-1.5 text-body leading-[1.5] text-ink-2",children:"Deleting it also removes it from:"}),h.jsx("ul",{className:"mt-1.5 max-h-[calc(160*var(--content))] overflow-y-auto text-body leading-[1.5] text-ink","aria-label":"Where this object is used",children:a.map(f=>h.jsx("li",{className:"truncate before:mr-1.5 before:text-ink-2 before:content-['•']",children:f.name},f.id))})]}):h.jsx("p",{className:"mt-1.5 text-body leading-[1.5] text-ink-2",children:u===1?"This permanently removes the file.":`This permanently removes ${u} objects.`}),h.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[h.jsx("button",{type:"button",className:"rounded-[calc(8*var(--content))] border border-line px-3 py-1.5 text-body font-medium text-ink hover:bg-accent-soft",onClick:e.onCancel,children:"Cancel"}),h.jsx("button",{type:"button",className:"rounded-[calc(8*var(--content))] bg-danger px-3 py-1.5 text-body font-medium text-white hover:opacity-90",onClick:e.onConfirm,children:n===void 0?"Delete":"Remove"})]})]})}),document.body)}const Vf="grid h-8 w-8 place-items-center rounded-full text-white/85 hover:bg-white/[0.12] hover:text-white",gE="absolute top-1/2 z-[2] grid h-10 w-10 -translate-y-1/2 place-items-center rounded-full bg-white/10 text-white hover:bg-white/[0.22]";function LH({file:e,index:t,total:n,onClose:r,onPrev:i,onNext:a,onDownload:c,onDelete:u,onCrop:f}){const p=e.thumbnailUrl!==null,y=WN();return Tr.createPortal(h.jsxs("div",{className:"fixed inset-0 flex flex-col bg-black/80",style:{zIndex:y},role:"dialog","aria-modal":"true","aria-label":`Preview: ${e.name}`,onClick:r,children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-2.5 px-4.5 py-3.25",onClick:m=>m.stopPropagation(),children:[h.jsx("span",{className:"max-w-[44vw] truncate text-[length:calc(13.5*var(--content))] font-semibold text-white",title:e.name,children:e.name}),h.jsx(pM,{file:e}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[f?h.jsx("button",{type:"button",className:Vf,title:"Crop","aria-label":`Crop ${e.name}`,onClick:m=>{m.stopPropagation(),f()},children:h.jsx(et,{name:"crop",size:15})}):null,c&&!iu(e)?h.jsx("button",{type:"button",className:Vf,title:"Download",onClick:m=>{m.stopPropagation(),c()},children:h.jsx(et,{name:"down",size:15})}):null,u?h.jsx("button",{type:"button",className:Vf,title:"Delete",onClick:m=>{m.stopPropagation(),u()},children:h.jsx(et,{name:"trash",size:14})}):null,h.jsx("span",{className:"mx-2 h-4.5 w-px bg-white/[0.18]"}),h.jsx("button",{type:"button",className:Vf,title:"Close","aria-label":"Close preview",onClick:r,children:h.jsx(et,{name:"x",size:15})})]})]}),h.jsxs("div",{className:"relative grid min-h-0 flex-1 place-items-center px-19",children:[n>1?h.jsx("button",{type:"button",className:`${gE} left-5`,"aria-label":"Previous",onClick:m=>{m.stopPropagation(),i()},children:h.jsx(et,{name:"chevl",size:16})}):null,p?h.jsx("div",{className:"relative h-[min(560px,100%)] w-[min(880px,100%)] rounded bg-contain bg-center bg-no-repeat shadow-[0_30px_80px_-20px_rgba(0,0,0,0.6)]",style:{backgroundImage:`url("${e.thumbnailUrl??""}")`},onClick:m=>m.stopPropagation(),children:e.kind==="video"?h.jsx("span",{className:"absolute inset-0 m-auto flex h-13 w-13 items-center justify-center rounded-full border-[1.5px] border-white/85 bg-[rgba(10,12,10,0.55)] pl-0.5 text-white backdrop-blur-[2px]",children:h.jsx(et,{name:"play",size:20})}):null}):h.jsx("div",{className:"relative h-[min(420px,100%)] w-[min(560px,100%)] overflow-hidden rounded shadow-[0_30px_80px_-20px_rgba(0,0,0,0.6)]",onClick:m=>m.stopPropagation(),children:h.jsx(ux,{file:e,face:"lightbox"})}),n>1?h.jsx("button",{type:"button",className:`${gE} right-5`,"aria-label":"Next",onClick:m=>{m.stopPropagation(),a()},children:h.jsx(et,{name:"chevr",size:16})}):null]}),h.jsxs("div",{className:"shrink-0 p-3.25 text-center text-xs font-medium text-white/55",children:[t+1," of ",n]})]}),document.body)}function IH(e){return[{id:"all",label:"All"},...Ih.filter(t=>e.includes(t)).map(t=>({id:t,label:sd[t].plural}))]}const yE=[{id:"custom",label:"Custom"},{id:"date",label:"Date added"},{id:"name",label:"Name"},{id:"kind",label:"Kind"},{id:"size",label:"Size"}],UH="ml-auto inline-flex text-ink-3";function PH({filter:e,setFilter:t,counts:n,kinds:r}){const i=IH(r),[a,c]=w.useState(!1),u=w.useRef(null),f=w.useCallback(()=>c(!1),[]);ad(u,a,f);const p=e!=="all",y=i.find(m=>m.id===e)??{label:"All"};return h.jsxs("div",{className:"relative",ref:u,children:[h.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>c(m=>!m),className:`${sx} ${p?"border-accent bg-accent-soft text-accent-ink":ax}`,children:[e==="all"?null:h.jsx(Cs,{kind:e,decorative:!0}),h.jsx("span",{className:p?"text-accent-ink opacity-70":"text-ink-3",children:"Kind:"}),h.jsx("span",{className:"font-semibold",children:y.label}),h.jsx("span",{className:`inline-flex ${p?"text-accent-ink":"text-ink-3"}`,children:h.jsx(et,{name:"chevd",size:13})})]}),a?h.jsx("div",{className:`${Dp} right-0 top-[calc(100%+6*var(--content))] min-w-[calc(210*var(--frame))] p-1.5`,role:"menu",children:i.map(m=>h.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===m.id,className:eM,onClick:()=>{t(m.id),c(!1)},children:[m.id==="all"?h.jsx("span",{className:"grid h-5 w-5 place-items-center text-ink-3","aria-hidden":"true",children:h.jsx(et,{name:"grid",size:13})}):h.jsx(Cs,{kind:m.id,decorative:!0}),h.jsx("span",{children:m.label}),h.jsx("span",{className:"ml-auto text-[length:calc(11.5*var(--content))] font-medium text-ink-4",children:n[m.id]}),h.jsx("span",{className:`inline-flex w-3 text-ink-3 ${e===m.id?"":"invisible"}`,children:h.jsx(et,{name:"check",size:12,stroke:2.4})})]},m.id))}):null]})}function FH({sort:e,setSort:t}){var u;const[n,r]=w.useState(!1),i=w.useRef(null),a=w.useCallback(()=>r(!1),[]);ad(i,n,a);const c=((u=yE.find(f=>f.id===e))==null?void 0:u.label)??"Custom";return h.jsxs("span",{className:"relative inline-flex",ref:i,children:[h.jsxs("button",{type:"button",className:`${sx} ${ax}`,"aria-expanded":n,onClick:()=>r(f=>!f),children:[h.jsx("span",{className:"text-ink-3",children:"Sort:"}),h.jsx("span",{className:"font-semibold",children:c}),h.jsx("span",{className:"inline-flex text-ink-3",children:h.jsx(et,{name:"chevd",size:13})})]}),n?h.jsx("div",{className:`${Dp} right-0 top-[calc(100%+6*var(--content))] w-[calc(170*var(--frame))] p-1.5`,role:"menu",children:yE.map(f=>h.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===f.id,className:eM,onClick:()=>{t(f.id),r(!1)},children:[f.label,e===f.id?h.jsx("span",{className:UH,children:h.jsx(et,{name:"check",size:12,stroke:2.4})}):null]},f.id))}):null]})}function BH({view:e,setView:t}){const n=(r,i)=>{const a=e===r;return h.jsxs("button",{type:"button","aria-label":i,"aria-pressed":a,title:i,onClick:()=>t(r),className:`flex h-full cursor-pointer items-center gap-1 px-3 transition-colors duration-150 ${a?"bg-accent-soft text-accent-ink":"text-ink-3 hover:bg-[#f6f5f1] hover:text-ink"} ${r==="list"?"border-l border-line":""}`,children:[a?h.jsx(et,{name:"check",size:13,stroke:2.4}):null,h.jsx(et,{name:r,size:15})]})};return h.jsxs("div",{className:"flex h-9 shrink-0 overflow-hidden rounded-lg border border-line bg-canvas",role:"group","aria-label":"View",children:[n("list","List view"),n("grid","Grid view")]})}function HH({lead:e,selectionPill:t,filter:n,setFilter:r,counts:i,kinds:a,sort:c,setSort:u,view:f,setView:p}){return h.jsxs("div",{className:"flex min-h-9 shrink-0 flex-wrap items-center gap-2",onClick:y=>y.stopPropagation(),children:[e,t,h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h.jsx(PH,{filter:n,setFilter:r,counts:i,kinds:a}),h.jsx(FH,{sort:c,setSort:u}),h.jsx(BH,{view:f,setView:p})]})]})}function qH({count:e,onClear:t,onDownload:n,onDelete:r}){const i="inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[length:calc(12.5*var(--content))] font-semibold hover:bg-[rgba(15,42,34,0.08)]";return h.jsxs("div",{role:"toolbar","aria-label":"Selection",className:"flex h-9 max-w-[calc(420*var(--frame))] items-center gap-0.5 overflow-hidden whitespace-nowrap rounded-lg border border-[#d5e0cf] bg-accent-soft pl-1 pr-1 opacity-100 transition-[max-width,opacity] duration-300 ease-out starting:max-w-0 starting:opacity-0",onClick:a=>a.stopPropagation(),children:[h.jsx("button",{type:"button",className:"grid h-7 w-7 shrink-0 cursor-pointer place-items-center rounded-md text-ink-2 hover:bg-[rgba(15,42,34,0.08)]","aria-label":"Clear selection",onClick:t,children:h.jsx(et,{name:"x",size:14})}),h.jsxs("span",{className:"ml-0.5 mr-1.5 text-[length:calc(12.5*var(--content))] font-semibold text-ink",children:[e," selected"]}),h.jsx("span",{className:"mx-1 h-4 w-px shrink-0 bg-[rgba(15,42,34,0.16)]"}),h.jsxs("button",{type:"button",className:`${i} text-accent`,onClick:n,children:[h.jsx(et,{name:"down",size:13}),"Download"]}),r?h.jsxs("button",{type:"button",className:`${i} text-danger`,onClick:r,children:[h.jsx(et,{name:"trash",size:13}),"Delete"]}):null]})}function Bp(e,t,n=new Set){const r=e.includes(t);return{checked:r,disabled:!r&&n.has(t)}}function Rx(e,t,n,r){const{checked:i,disabled:a}=Bp(e,t,r);return n==="radio"?i||a?e:[t]:i?e.filter(c=>c!==t):a?e:[t,...e]}const bE="hp-uploads-view",VH=new Set;function ZH({onReset:e}){return h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center-safe gap-3 overflow-y-auto px-6 py-12 text-center",children:[h.jsx("span",{className:"text-base font-semibold tracking-[-0.01em] text-ink",children:"Nothing matches this filter"}),h.jsx("button",{type:"button",className:"inline-flex h-8 items-center justify-center rounded-lg border border-line bg-canvas px-3 text-[length:calc(12.5*var(--content))] font-medium text-ink hover:bg-[#f6f5f1]",onClick:e,children:"Show everything"})]})}const KH=ce(MM,"flex flex-col gap-3"),GH="flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border border-line bg-canvas transition-[box-shadow,background-color] duration-150 data-dragging:bg-accent-soft/40 data-dragging:ring-2 data-dragging:ring-accent",YH=ce(MM,"flex flex-col rounded-2xl border border-line bg-canvas items-center justify-center text-center text-body text-ink-3"),vE="grid grid-cols-[repeat(auto-fill,minmax(calc(200*var(--frame)),1fr))] gap-4 p-4",QH=8;function oR({filter:e,selection:t,host:n,beneathOf:r,tiers:i}){const{capabilities:a,preparing:c}=n,{kinds:u,from:f}=mu(e),p=w.useMemo(()=>{const ie=new Map((i??[]).flatMap((Se,Ue)=>Se.map(Ze=>[Ze,Ue])));return Se=>ie.get(Se)??0},[i]),y=(i==null?void 0:i.flat())??f,m=a.upload?Ax(u):null,x=(a.link??a.upload)&&c0(u).length>0,v=w.useRef(null),_=w.useRef(new Set),k=ie=>{t.mode!=="all"&&(v.current??(v.current=Date.now())),n.addFiles(ie)},S=ie=>{t.mode!=="all"&&(v.current??(v.current=Date.now())),n.addLink(ie)},j=SH(f),O=m!==null||x?{accept:m,onFiles:k,...x?{onLink:S}:{},disabled:c}:null,[A,$]=w.useState(()=>new Set),[C,I]=w.useState(()=>t.mode==="multi"?t.selectedIds:[]),[z,T]=w.useState("all"),[F,W]=w.useState("custom"),[G,H]=w.useState(null),[U,D]=w.useState(null),[K,M]=w.useState(()=>{if(typeof window>"u")return"grid";try{return window.localStorage.getItem(bE)==="list"?"list":"grid"}catch{return"grid"}}),[B,X]=w.useState(null),[se,J]=w.useState(null),[P,Y]=w.useState(!1),[L,Z]=w.useState(null),[ne,fe]=w.useState(null),de=w.useRef(0),pe=w.useRef(null);w.useEffect(()=>{try{window.localStorage.setItem(bE,K)}catch{}},[K]),w.useEffect(()=>()=>{pe.current&&clearTimeout(pe.current)},[]);const N=w.useCallback(ie=>{Z(ie),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Z(null),2400)},[]),ee=w.useMemo(()=>new Map(n.items.flatMap(ie=>pn(ie)?[]:[[ie.record.id,ie.record]])),[n.items]),le=w.useMemo(()=>new Map(n.items.flatMap(ie=>pn(ie)?[]:[[ao({holder:ch(ie.list),mediaId:ie.record.id}),ie.record]])),[n.items]),xe=w.useCallback(ie=>le.get(ao(ie)),[le]),_e=w.useMemo(()=>new Set(n.items.flatMap(ie=>!pn(ie)&&ie.inheritsCrop===!0?[ao({holder:ch(ie.list),mediaId:ie.record.id})]:[])),[n.items]),Oe=w.useCallback(ie=>_e.has(ao(ie)),[_e]),be=KM({propertyId:t.mode==="all"?n.scope:"",recordAt:xe,inheritsCrop:Oe,write:n.crop,onFailed:()=>N("Couldn't crop")}),Te=ie=>({holder:ch(ie.list),mediaId:ie.id}),tt=ie=>t.mode==="all"&&a.manage&&ie.kind==="image"&&!ie.inFlight&&be.offers(Te(ie))?{onCrop:()=>be.open(Te(ie))}:{},Ne=n.items.filter(ie=>{const Se=pn(ie)?ie.kind:ie.record.kind;return y.includes(ie.list)&&(Se===null||u.includes(Se))}).map(ie=>MF(ie,p)).map(ie=>ie.state==="ready"&&be.recropping(Te(ie))?{...ie,state:"processing"}:ie),Ve=w.useMemo(()=>new Set(n.items.filter(pn).map(uM)),[n.items]),it=$F(Ne),It=G===null?Ne:[...Ne].sort((ie,Se)=>G.indexOf(ie.id)-G.indexOf(Se.id)),zt=TF(It,z,F),[$r]=f,xt=n.reorder,jo=t.mode==="all"&&a.manage&&xt!==void 0&&F==="custom"&&f.length===1&&B===null,qs=jo?zt.filter(ie=>!ie.inFlight):[],Ri=ie=>{D(null);const Se=ie.map(Pe=>Pe.id),Ue=It.filter(Pe=>!Pe.inFlight).map(Pe=>Pe.id),Ze=hL(Ue,Se);xt===void 0||$r===void 0||Ze.every((Pe,vr)=>Pe===Ue[vr])||(H(Ze),xt($r,Se).then(()=>H(null),()=>{H(null),N("Couldn't reorder")}))},{containerRef:ke,getItemProps:Le}=kM({items:qs,getKey:ie=>ie.id,onReorder:D,onDrop:Ri,axis:K==="list"?"y":"xy",threshold:5}),Je=U===null?zt:[...zt.filter(ie=>ie.inFlight),...U],gt=w.useCallback(()=>$(new Set),[]),lt=w.useMemo(()=>t.mode==="all"?VH:new Set([...t.disabledIds??[],...Ve]),[t,Ve]),Ut=t.mode==="single"?t.selectedId===null?[]:[t.selectedId]:C,yt=ie=>{if(t.mode==="all")return;if(t.mode==="single"){const Ue=lt.has(ie)?void 0:ee.get(ie);Ue&&t.onPick(Ue);return}const Se=Rx(Ut,ie,"checkbox",lt);Se!==Ut&&(I(Se),t.onChange(Se.flatMap(Ue=>ee.get(Ue)??[])))};w.useEffect(()=>{const ie=v.current;if(ie===null||t.mode==="all")return;for(const Pe of n.items)pn(Pe)&&Pe.addedAt>=ie&&_.current.add(Pe.id);const Se=[..._.current].filter(Pe=>ee.has(Pe)&&!lt.has(Pe)),[Ue]=Se;if(Ue===void 0)return;for(const Pe of Se)_.current.delete(Pe);if(t.mode==="single"){yt(Ue);return}const Ze=[...Se.filter(Pe=>!Ut.includes(Pe)),...Ut];Ze.length!==Ut.length&&(I(Ze),t.onChange(Ze.flatMap(Pe=>ee.get(Pe)??[])))},[n.items]);const nn=ie=>{if(t.mode==="all")return{selected:A.has(ie),control:"checkbox",disabled:!1};const{checked:Se,disabled:Ue}=Bp(Ut,ie,lt);return{selected:Se,control:t.mode==="single"?"radio":"checkbox",disabled:Ue}},dn=ie=>{if(t.mode!=="all"){yt(ie);return}$(Se=>{const Ue=new Set(Se);return Ue.has(ie)?Ue.delete(ie):Ue.add(ie),Ue})},Vs=zt.findIndex(ie=>ie.id===se),zr=Vs>=0?zt[Vs]:void 0,Zs=ie=>{var Ue;if(zt.length===0)return;const Se=(Math.max(Vs,0)+ie+zt.length)%zt.length;J(((Ue=zt[Se])==null?void 0:Ue.id)??null)},Ks=ie=>{if(!se||!ie.includes(se))return;const Se=zt.findIndex(Pe=>Pe.id===se),Ze=[...zt.slice(Se+1),...zt.slice(0,Math.max(Se,0))].find(Pe=>!ie.includes(Pe.id));J(Ze?Ze.id:null)};w.useEffect(()=>{const ie=Se=>{if(be.isOpen)return;const Ue=Se.target instanceof HTMLElement?Se.target.tagName:"";if(!(Ue==="INPUT"||Ue==="TEXTAREA")){if(ne){Se.key==="Escape"&&fe(null),(Se.key==="Escape"||Se.key==="Enter")&&Se.preventDefault();return}if(Se.key==="Escape"){if(se)J(null);else if(A.size>0)gt();else return;Se.preventDefault()}else se&&Se.key==="ArrowRight"?Zs(1):se&&Se.key==="ArrowLeft"?Zs(-1):se&&Se.key==="Enter"&&Se.preventDefault()}};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)});const Gs=ie=>{Ks(ie),$(Se=>{const Ue=new Set(Se);return ie.forEach(Ze=>Ue.delete(Ze)),Ue}),n.remove(ie).then(Se=>{Se>0?N(`Couldn't delete ${Se}`):N(`Deleted ${ie.length} object${ie.length===1?"":"s"}`)})},Ys=()=>{ne&&(fe(null),Gs(ne))},br=ie=>{iu(ie)||ie.inFlight||(N("Preparing download…"),n.download(ie.id).catch(()=>N("Couldn't download")))},Qs=()=>{const ie=Ne.filter(Se=>A.has(Se.id)&&!iu(Se)&&!Se.inFlight);ie.length!==0&&(N("Preparing download…"),ie.forEach(Se=>void n.download(Se.id).catch(()=>N("Couldn't download"))))},Ti=(ie,Se)=>{X(null),!(Se===null||!Se||Se===ie.name)&&n.rename(ie.id,Se).catch(()=>N("Couldn't rename"))},xd=m!==null&&!c,wd=ie=>{ie.preventDefault(),!(!xd||!Array.from(ie.dataTransfer.types).includes("Files"))&&(de.current+=1,Y(!0))},ql=ie=>{ie.preventDefault(),de.current-=1,de.current<=0&&(de.current=0,Y(!1))},$i=ie=>{ie.preventDefault(),de.current=0,Y(!1),xd&&ie.dataTransfer.files.length>0&&k(Array.from(ie.dataTransfer.files))},dm=ie=>t.mode==="all"&&A.has(ie)&&A.size>1?zt.filter(Se=>A.has(Se.id)).map(Se=>Se.id):null,Vl=(ie,Se)=>t.mode==="all"&&ie.kind==="image"&&!ie.inFlight?h.jsx(px,{holderPath:Te(ie).holder,mediaId:ie.id,cropped:be.cropped(Te(ie)),cropFailedAt:n.cropFailedAt,className:Se}):null,Zl=ie=>{const{selected:Se,control:Ue,disabled:Ze}=nn(ie.id),Pe=dm(ie.id),vr=Pe==null?void 0:Pe.filter(Dr=>!Ve.has(Dr));return{file:ie,selected:Se,select:{control:Ue,disabled:Ze},listChip:f.length<2||ie.upstream?null:Oh(ie.list)??ie.list,renaming:B===ie.id,onClick:Dr=>{Dr.stopPropagation(),dn(ie.id)},onDoubleClick:()=>t.mode==="single"?yt(ie.id):J(ie.id),onToggleSelect:()=>dn(ie.id),...ie.state==="failed"&&n.canRetry(ie.id)?{onRetry:()=>n.retry(ie.id)}:{},...ie.linkUnreachable?{onRecheck:()=>void n.recheck(ie.id)}:{},onRenameCommit:Dr=>Ti(ie,Dr),handlers:{onPreview:()=>J(ie.id),onDownload:()=>br(ie),...tt(ie),...a.manage&&(a.rename??!0)?{onRenameStart:()=>X(ie.id)}:{},...a.manage?{onDelete:()=>fe(Pe??[ie.id]),...Pe!==null?{deleteLabel:`Delete ${Pe.length} objects`}:{}}:{}},...jo&&!ie.inFlight?{drag:Le(ie.id,vr)}:{}}},kd=ie=>{const Se=new Set(Ne.filter(Ze=>ie.includes(Ze.id)).map(Ze=>Ze.list)),[Ue]=Se;return Se.size!==1||Ue===void 0||Es(Ue).at(-1)===Ue?{}:{removeFrom:Oh(Ue)??Ue}},Kl=[...A],Gl=Ne.length===0;return h.jsxs("div",{className:"flex flex-col",onClick:gt,onDragEnter:wd,onDragOver:ie=>ie.preventDefault(),onDragLeave:ql,onDrop:$i,children:[n.loading?h.jsx("div",{className:YH,children:"Loading…"}):h.jsxs("div",{className:KH,children:[h.jsx(HH,{lead:h.jsx(od,{size:"large",add:j,onAdd:null,...O!==null?{newChip:h.jsx(WF,{add:O,verb:j})}:{}}),selectionPill:A.size>0?h.jsx(qH,{count:A.size,onClear:gt,onDownload:Qs,...a.manage?{onDelete:()=>fe(Kl)}:{}}):null,filter:z,setFilter:T,counts:it,kinds:u,sort:F,setSort:W,view:K,setView:M}),h.jsx("div",{className:GH,"data-dragging":P||void 0,children:Gl?h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx(rd,{children:h.jsx("div",{className:vE,children:Array.from({length:QH},(ie,Se)=>h.jsx(ZB,{},Se))})}),h.jsx(YF,{add:O,kinds:u,dragging:P})]}):zt.length===0?h.jsx(ZH,{onReset:()=>T("all")}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:K==="grid"?h.jsx("div",{ref:ke,className:ce("relative",vE),role:"listbox","aria-multiselectable":t.mode!=="single","aria-label":"Uploaded objects",children:Je.map(ie=>h.jsx(VB,{...Zl(ie),beneath:r==null?void 0:r(ie),notice:Vl(ie,"we-no-drag mx-3.5 mt-2")},ie.id))}):h.jsxs("div",{ref:ke,className:"relative pt-1",role:"table","aria-label":"Uploaded objects",children:[h.jsx(KB,{}),Je.map(ie=>h.jsxs(w.Fragment,{children:[h.jsx(YB,{...Zl(ie)}),Vl(ie,"px-3.5 pb-2")]},ie.id))]})})})]}),zr?h.jsx(LH,{file:zr,index:Vs,total:zt.length,onClose:()=>J(null),onPrev:()=>Zs(-1),onNext:()=>Zs(1),...!iu(zr)&&!zr.inFlight?{onDownload:()=>br(zr)}:{},...a.manage?{onDelete:()=>fe([zr.id])}:{},...tt(zr)}):null,be.modal,ne&&!c?h.jsx(DH,{scope:n.scope,ids:ne,inFlightIds:Ve,holders:n.holders,...kd(ne),onCancel:()=>fe(null),onConfirm:Ys}):null,L?h.jsx("div",{role:"status",style:{zIndex:D7},className:"fixed bottom-6 left-1/2 -translate-x-1/2 rounded-full bg-ink px-4 py-2 text-body font-semibold text-canvas shadow-[0_14px_34px_-10px_rgba(10,12,10,0.5)]",children:L}):null]})}function Tx(){return tn()}function iR(e){const t=go(e[0]).home;return D6(e).flatMap(n=>{const[r,...i]=n;return r===void 0?[]:[{lists:[r,...i],label:n.map(a=>eR(a,t)??go(a).key).join(" + ")}]}).reverse()}const iv=new Map,uh=new Map,sv=new Set,av=[],dh=new Map,xE=new Set,yl=new Map;function XH(e,t){var n;(n=yl.get(e))==null||n.onStored(t),yl.delete(e)}function Fy(e,t){var n;(n=yl.get(e))==null||n.onFailed(t),yl.delete(e)}function sR(){for(const e of sv)e()}function aR(e){return sv.add(e),()=>{sv.delete(e)}}function $x(e,t){t.length===0?iv.delete(e):iv.set(e,t),sR()}function vs(e){return iv.get(e)??av}function wE(e,t){t.length!==0&&$x(e,[...t,...vs(e)])}function lv(e,t,n){const r=vs(e);r.some(i=>i.inFlight.id===t)&&$x(e,r.map(i=>i.inFlight.id===t?n(i):i))}function kE(e,t){var a;const n=new Set(t),r=vs(e),i=r.filter(c=>n.has(c.inFlight.id));if(i.length!==0){for(const c of i)(a=c.inFlight.preview)!=null&&a.startsWith("blob:")&&URL.revokeObjectURL(c.inFlight.preview);$x(e,r.filter(c=>!n.has(c.inFlight.id)))}}function _E(e,t,n,r){const i=uh.get(e)??dh,a=i.get(t)??[];if(a.includes(n)===r)return;const c=new Map(i),u=r?[...a,n]:a.filter(f=>f!==n);u.length===0?c.delete(t):c.set(t,u),c.size===0?uh.delete(e):uh.set(e,c),sR()}function WH(e){return w.useSyncExternalStore(aR,()=>e===null?av:vs(e),()=>av)}function JH(e){return w.useSyncExternalStore(aR,()=>e===null?dh:uh.get(e)??dh,()=>dh)}function eq(e,t,n){const r=e.get(t);if(r===void 0)return!1;const i=Es(n).at(-1)??n;return r.includes(n)||r.includes(i)}function tq(e,t,n){return e.flatMap(({inFlight:r})=>{if(n.has(r.id))return[];const i=Es(r.list),a=t.find(c=>i.includes(c));return a===void 0?[]:[{...r,list:a}]})}const lR="local-",cR=()=>`${lR}${Math.random().toString(36).slice(2,10)}`,nq=e=>e.startsWith(lR);function SE(e,t){return e instanceof Error&&"problem"in e&&e.message!==""?e.message:t}function rq(e,t){const n=mF(t);return{inFlight:{id:cR(),list:e,kind:zA(t.type),name:t.name,bytes:t.size,mime:t.type,url:null,addedAt:Date.now(),preview:n.ok&&t.type.startsWith("image/")?URL.createObjectURL(t):null,send:n.ok?{state:"uploading",progress:0}:{state:"failed",error:n.message}},baggage:{file:t}}}function Bc(e,t,n){lv(e,t,r=>({...r,inFlight:{...r.inFlight,send:n}}))}function oq(e,t,n){const{postListUploadWithProgress:r,postListLink:i,withdrawListItem:a,holdListItem:c}=e,u=O=>tv(t,e,O),f=async(O,A,$)=>{_E(O,$,A,!0);try{await a(O,A,$)}catch(C){throw _E(O,$,A,!1),u(O),C}u(O)},p=async(O,A,$,C)=>{if(xE.delete(A)){Fy(A,"Removed while sending"),f(O,C,$).catch(()=>{});return}lv(O,A,I=>({...I,inFlight:{...I.inFlight,id:$,send:{state:"saving"}}})),await u(O),kE(O,[$]),XH(A,$)},y=async(O,A,$,C,I)=>{let z;try{z=(await r(O,$,C,F=>Bc(O,A,{state:"uploading",progress:F}),{attempt:I,onAttempt:F=>lv(O,A,W=>({...W,baggage:{...W.baggage,attempt:F??void 0}}))})).id}catch(T){console.error("media.upload.failed",{itemId:A,propertyId:O,into:$,name:C.name,size:C.size,mime:C.type,error:T});const F=SE(T,"Upload failed");Bc(O,A,{state:"failed",error:F}),Fy(A,F);return}await p(O,A,z,$)},m=async(O,A,$,C,I)=>{let z;try{z=(await i(O,$,C,I)).id}catch(T){console.error("media.link.create_failed",{itemId:A,propertyId:O,into:$,url:C,error:T});const F=SE(T,"Couldn’t add link");Bc(O,A,{state:"failed",error:F}),Fy(A,F);return}await p(O,A,z,$)},x=(O,A,$)=>{if(n===null)return;const C=O.filter(Boolean).map(z=>rq(A,z));wE(n,C);for(const z of C){if($===void 0)continue;const{send:T}=z.inFlight;T.state==="failed"?$.onFailed(T.error):yl.set(z.inFlight.id,$)}const I=C.filter(z=>z.inFlight.send.state==="uploading");Y7(I,pF,async z=>{z.baggage.file&&await y(n,z.inFlight.id,A,z.baggage.file)})},v=(O,A,$)=>{if(n===null)return;const C=/^https?:\/\//i.test(O)?O:`https://${O}`,I=crypto.randomUUID(),z={inFlight:{id:cR(),list:A,kind:dM(C),name:lF(C),bytes:null,mime:null,url:C,addedAt:Date.now(),preview:null,send:{state:"saving"}},baggage:{link:{url:C,idempotencyKey:I}}};wE(n,[z]),$!==void 0&&yl.set(z.inFlight.id,$),m(n,z.inFlight.id,A,C,I)},_=O=>{if(n===null)return!1;const A=vs(n).find($=>$.inFlight.id===O);return A!==void 0&&A.inFlight.send.state==="failed"&&(A.baggage.file!==void 0||A.baggage.link!==void 0)},k=O=>{if(n===null)return;const A=vs(n).find(C=>C.inFlight.id===O);if(A===void 0)return;const $=A.inFlight.list;if(A.baggage.link){const{url:C,idempotencyKey:I}=A.baggage.link;Bc(n,O,{state:"saving"}),m(n,O,$,C,I);return}if(A.baggage.file){const C=gF({attempt:A.baggage.attempt});Bc(n,O,{state:"uploading",progress:0}),y(n,O,$,A.baggage.file,C.kind==="resume"?C.attempt:void 0)}},S=async(O,A)=>{if(n===null)return 0;const $=new Set(O);for(const z of vs(n))$.has(z.inFlight.id)&&z.inFlight.send.state==="uploading"&&xE.add(z.inFlight.id);kE(n,O);const C=O.filter(z=>!nq(z));return(await Promise.allSettled(C.map(z=>f(n,A,z)))).filter(z=>z.status==="rejected").length},j=c===void 0||n===null?void 0:async(O,A)=>{await c(n,A,O),await u(n)};return{addFiles:x,addLink:v,canRetry:_,retry:k,remove:S,...j!==void 0?{hold:j}:{}}}function iq(e){const t=lx(),n=So();return w.useMemo(()=>oq(t,n,e),[t,n,e])}function sq(e,t,n,r){const i=mu(t),a=e===void 0?[]:lL(e,i).filter(({id:p,list:y})=>!eq(r,p,y)),c=e===void 0?new Map:Nl(e),u=a.map(({id:p,value:y,file:m,list:x})=>({record:h0(m,y),list:x,...e!==void 0&&ZM(e,c,{holder:ch(x),mediaId:p})?{inheritsCrop:!0}:{}}));return[...tq(n,i.from,new Set(a.map(({id:p})=>p))),...u]}function aq(e,t,n,r){const i=WH(e),a=JH(e),c=iq(e),u=w.useMemo(()=>sq(n,t,i,a),[n,t,i,a]),f=r??FA(t),p=w.useCallback(_=>c.addFiles(_,f),[c,f]),y=w.useCallback(_=>c.addLink(_,f),[c,f]),m=w.useCallback(async _=>{const k=new Map;for(const j of u){const O=uM(j);_.includes(O)&&k.set(j.list,[...k.get(j.list)??[],O])}return(await Promise.all([...k].map(([j,O])=>c.remove(O,j)))).reduce((j,O)=>j+O,0)},[u,c]),{hold:x}=c,v=w.useMemo(()=>x===void 0||r===void 0?void 0:_=>x(_,r),[x,r]);return{items:u,sent:i,deleting:a,addFiles:p,addLink:y,remove:m,canRetry:c.canRetry,retry:c.retry,...v!==void 0?{land:v}:{}}}function dd(e){const{MediaPicker:t}=Tx();return h.jsx(t,{...e})}function lq(e){return new Set(e.flatMap(t=>{if(pn(t))return[];const{record:n}=t;return n.state!=="ready"||n.kind==="tour"&&!lM(n)?[n.id]:[]}))}const EE=ce("m-0 py-1 text-caption text-ink-3",vx);function uR({useHost:e,filter:t,propertyId:n,...r}){var U;const{onClose:i}=r,a=w.useMemo(()=>iR(mu(t).from),[t]),c=w.useMemo(()=>a.map(({lists:D})=>D),[a]),u=w.useMemo(()=>({kinds:t.kinds,from:[...mu(t).from,...c.slice(1).flat()]}),[t,c]),f=e(n,u,FA(t)),{land:p}=f,y=w.useMemo(()=>new Map(c.flatMap((D,K)=>D.map(M=>[M,K]))),[c]),[m,x]=w.useState(()=>new Set),v=w.useRef(null),_=w.useMemo(()=>{if(f.loading)return f.items;const D=new Map;for(const X of f.items){if(pn(X)||m.has(X.record.id))continue;const se=D.get(X.record.id);(se===void 0||(y.get(X.list)??0)<(y.get(se.list)??0))&&D.set(X.record.id,X)}const K=[...D.values()],M=v.current??(v.current=new Map(K.map((X,se)=>[X.record.id,{tier:y.get(X.list)??0,rank:se}])));for(const X of K)M.has(X.record.id)||M.set(X.record.id,{tier:y.get(X.list)??0,rank:-M.size});const B=X=>M.get(X.record.id)??{tier:0,rank:0};return[...f.items.filter(pn),...K.map(X=>({...X,tier:B(X).tier})).sort((X,se)=>B(X).rank-B(se).rank)]},[f.items,f.loading,y,m]),{remove:k}=f,S=w.useMemo(()=>({...f,items:_,remove:async K=>{const M=K.filter(X=>_.some(se=>!pn(se)&&se.record.id===X&&(y.get(se.list)??0)===0)),B=await k(K);return B===0&&M.length>0&&x(X=>new Set([...X,...M])),B}}),[f,_,k,y]),j=w.useMemo(()=>lq(_),[_]),O=w.useMemo(()=>new Set(_.flatMap(D=>!pn(D)&&(y.get(D.list)??0)>0?[D.record.id]:[])),[_,y]),[A,$]=w.useState("idle"),[C,I]=w.useState(0),z=w.useRef(Promise.resolve()),T=w.useRef(0),F=w.useRef(new Set);if(t.kinds.length===0)return null;const W=(D,K)=>{const M=p===void 0?[]:D.filter(B=>O.has(B)&&!F.current.has(B));if(M.length===0&&T.current===0){K();return}T.current+=1,z.current=z.current.then(async()=>{try{if(p===void 0||M.length===0){K();return}$("landing");try{for(const B of M)await p(B),F.current.add(B)}catch{$("failed"),I(B=>B+1);return}$("idle"),K()}finally{T.current-=1}})},G=r.mode==="single"?{mode:"single",selectedId:r.currentId??null,disabledIds:j,onPick:D=>W([D.id],()=>r.onPick(D))}:{mode:"multi",selectedIds:r.selectedIds.filter(Boolean),disabledIds:j,onChange:D=>{const K=r.selectedIds;W(D.filter(({id:M})=>!K.includes(M)).map(({id:M})=>M),()=>r.onChange(D))}},H=((U=a[0])==null?void 0:U.label)??"";return h.jsx(Mx,{onClose:i,title:H,notice:A==="landing"?h.jsxs("p",{role:"status",className:EE,children:["Adding to ",H,"…"]}):A==="failed"?h.jsxs("p",{role:"alert",className:ce(EE,"text-danger"),children:["Couldn't add it to ",H,". Try again."]}):null,children:h.jsx(oR,{filter:t,selection:G,host:S,...p!==void 0?{tiers:c}:{}},C)})}function dR(e){const t={...e,rename:!1};return function(r,i,a){const c=Up(r),u=aq(r,i,c,a),{items:f}=u,p=w.useCallback(y=>{const m=f.find(v=>!pn(v)&&v.record.id===y),x=m===void 0||pn(m)?null:m.record.file_url;return x&&window.open(x,"_blank","noopener"),Promise.resolve()},[f]);return{items:f,loading:c===void 0,capabilities:t,preparing:!1,scope:r,addFiles:u.addFiles,addLink:u.addLink,remove:u.remove,rename:()=>Promise.resolve(),canRetry:u.canRetry,retry:u.retry,recheck:()=>Promise.resolve(),download:p,holders:()=>Promise.resolve([]),...u.land!==void 0?{land:u.land}:{}}}}function cq({capabilities:e,...t}){const{upload:n,link:r,manage:i}=e,a=w.useMemo(()=>dR({upload:n,manage:i,...r===void 0?{}:{link:r}}),[n,r,i]);return h.jsx(uR,{...t,useHost:a})}function zx(e,t){const n=N7();return e!==void 0&&t!==""&&n!==void 0&&n(e,t)}const Hp=ce(vt,"grid h-full w-[calc(36*var(--content))] cursor-pointer place-items-center rounded-[calc(6*var(--content))] text-ink-4","transition-[color,background-color] duration-[120ms] group-hover/row:text-ink-3 hover:bg-[rgba(20,18,13,.06)] hover:text-ink-2","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ink"),Dx="hover:bg-[#fbe6e2] hover:text-danger",uq="size-[calc(13*var(--content))]",dq="we-no-drag h-[calc(36*var(--content))] shrink-0",fR="flex shrink-0 items-center";function qp({icon:e,label:t,title:n,tone:r="neutral",onClick:i}){return h.jsx("button",{type:"button",className:ce(Hp,dq,r==="remove"&&Dx),"aria-label":t,title:n,onClick:i,children:ci.createElement(e,{className:uq})})}const fq={card:"rounded-2xl",compact:"rounded-xl"},hq={card:{bar:"flex h-14 min-w-0 items-center gap-3 pl-4 pr-2.5",name:"min-w-0 flex-1 truncate text-[length:calc(15*var(--content))] font-medium text-ink",mark:"h-6 w-6",button:"h-9 w-9",glyph:16},compact:{bar:"flex h-10 min-w-0 items-center gap-2 pl-3 pr-1.5",name:"min-w-0 flex-1 truncate text-[length:calc(13.5*var(--content))] font-medium text-ink",mark:"h-5 w-5",button:"h-8 w-8",glyph:15}},pq="text-ink-3",mq={card:"mx-2 rounded-xl",compact:"mx-1.5 rounded-lg"},gq=ce("flex aspect-[16/11] flex-col items-center justify-center gap-2 border-[1.5px] border-dashed border-line bg-canvas px-3 py-4 text-center","transition-[border-color,background-color] duration-[120ms]",FN),yq="border-honey-2 bg-honey-soft";function jE({kind:e,name:t,empty:n,scale:r,actions:i,attention:a,drop:c,children:u}){const f=Ul(),p=bs[r],y=hq[r],{plain:m,foot:x}=DM(i),v=(c==null?void 0:c.over)??!1;return h.jsxs("div",{"data-media-slot-card":"",className:ce("relative flex flex-col border border-transparent bg-[#f3f2ed] transition-[background-color,box-shadow] duration-[140ms]",fq[r],zl,v&&!n&&"ring-2 ring-honey-2"),...Dl(a,f),...c==null?void 0:c.handlers,"data-media-drop":c?"":void 0,children:[h.jsxs("div",{className:y.bar,children:[h.jsx("span",{className:ce("grid shrink-0 place-items-center",y.mark),children:h.jsx(Cs,{kind:e,size:r==="compact"?"mark":"lead"})}),h.jsx("span",{className:ce(y.name,n&&"font-normal text-ink-4"),title:t,children:t}),i.length>0&&h.jsx("span",{className:"we-no-drag flex shrink-0 items-center gap-0.5",children:[...m,...x].map(_=>h.jsx("button",{type:"button",className:ce(Hp,pq,y.button,_.danger&&Dx),"aria-label":_.label,title:_.label,onClick:_.onSelect,children:h.jsx(et,{name:_.glyph,size:y.glyph})},_.label))})]}),n?h.jsx("div",{className:ce(gq,mq[r],v&&yq),"data-thumb":"",children:u}):h.jsx("div",{className:p.thumb,"data-thumb":"","data-media-tile":e,children:u}),h.jsx("div",{className:r==="compact"?"h-1.5":"h-2"})]})}function cv(e){var t;return e===void 0?"Link":((t=_i[e])==null?void 0:t.label)??"Link"}function bq(e){return e.kind==="tour"?cv(e.provider):e.kind!=="video"?"":e.videoSource==="link"?cv(e.provider):e.ready===!1?"Processing…":hF(e.durationMs)||"Video"}function vq({kind:e,size:t}){return e==="tour"?h.jsx(Mt.tour,{size:t}):h.jsx(Mt.play,{size:t})}const xq="absolute bottom-0 inset-x-0 truncate bg-[rgba(15,18,9,0.55)] px-0.5 text-center text-[length:calc(7.5*var(--content))] font-bold leading-[1.5] tracking-[0.02em] text-white",wq={doc:Mp,spreadsheet:$N,presentation:J0,image:Rp,video:rx};function kq({glyph:e,extension:t,size:n=16,className:r}){const i=wq[e];return h.jsxs(h.Fragment,{children:[h.jsx(i,{size:n,strokeWidth:1.5,className:r,style:{width:`calc(${n} * var(--content))`,height:`calc(${n} * var(--content))`}}),t&&h.jsx("span",{className:xq,children:t})]})}const _q=new Set(["image","video","tour","document","media"]);function Sq(e){return yi(e).length>0}function Lx(e,t){const n=$0(e,t);return n!==null?!_q.has(n.value_type)||n.filter!==void 0?null:{holder:"home",table:n.table,field:n.member}:!Sq(e)||typeof e.from=="string"||e.source!==void 0&&e.source.kind!=="authored"?null:{holder:"section"}}function Eq(e,t){const n=Lx(e,t);return(n==null?void 0:n.holder)==="home"?n:null}function hR(){return`tmp_${globalThis.crypto.randomUUID()}`}function bl(e){return typeof e=="string"&&e.startsWith("tmp_")}function jq(e,t,n,r){const i=fi(n.table)==="library"?{home:"library"}:{home:"property",propertyId:t},a=`${n.table}.${r}.${n.field}`;return{place:`${i.home}:${a}`,take:c=>e.stageOwnedMedia(i,a,c),presign:c=>e.ownedMediaUrl(i,a,c),discard:c=>e.discardStagedMedia(i,a,c)}}function pR(e,t,n){return{place:`content:${n.deliverableId}:${n.instanceId}:${n.slotId}`,take:r=>e.uploadContentMedia(t,n,r),presign:r=>e.contentMediaUrl(t,n,r),discard:null}}function Oq(e,t){return e?e.itemId??null:t??null}function mR({props:e,table:t,ownerSlot:n,mediaId:r,inLibrary:i}){const{slot:a,propertyId:c,instanceId:u,recordContext:f,boundRowId:p,onUpload:y}=e,{api:m,useEditorStore:x}=tn(),v=x(z=>z.session.deliverable_id),_=y===void 0?Lx(n??a,t):null,k=(_==null?void 0:_.holder)==="home"?_:null,S=k===null?null:Oq(f,p),j=bl(S),O=k===null||j?null:S;let A=null;k!==null&&O!==null&&(A=jq(m,c,k,O)),((_==null?void 0:_.holder)==="section"||j)&&v!==void 0&&(A=pR(m,c,{deliverableId:v,instanceId:u,slotId:gR(e)}));const $=Rn({queryKey:["owned-media-url",A==null?void 0:A.place,r],queryFn:()=>A.presign(r),enabled:A!==null&&r!==""&&!i,retry:!1}),C=w.useRef(null);return{upload:A===null?null:async z=>{const T=await A.take(z),F=C.current;return C.current=T.media_id,A.discard!==null&&F!==null&&F!==T.media_id&&A.discard(F).catch(()=>{}),yR(T,z)},previewUrl:$.data}}function gR(e){var n;const t=(n=e.recordContext)==null?void 0:n.fieldKey;return t?`${e.slotId}.${t}`:e.slotId}function yR(e,t){const n=e.provider??("link"in t?Ku(e.url)??void 0:void 0);return n===void 0?e:{...e,provider:n}}function Ix(e,t){var c;const{api:n,useEditorStore:r}=tn(),i=r(u=>u.session.deliverable_id);if(i===void 0||((c=Lx(e))==null?void 0:c.holder)!=="section")return null;const a=pR(n,t.propertyId,{deliverableId:i,instanceId:t.instanceId,slotId:t.slotId});return async u=>yR(await a.take(u),u)}function Ia(e,t){return e===void 0||e===""||t===""?null:{holder:e,mediaId:t}}function bR(e,t){const{capabilities:n}=Tx(),r=n.framingCrop!==!1,i=!r&&t==="image",a=w.useRef(new Map),c=GM(i?e:"",u=>{const f=a.current.get(ao(u));f!==void 0&&ou.getState().notice(f,"failed")});return{framing:r&&t==="image",offers:u=>r?t==="image":i&&u!==null&&c.offers(u),recrop:(u,f)=>{a.current.set(ao(u),f),c.open(u)},recropping:u=>i&&u!==null&&c.recropping(u),cropped:u=>i&&u!==null&&c.cropped(u),modal:c.modal}}function vR(e,t,n,r){const i=t.file===""?void 0:e.get(t.file),c=((i==null?void 0:i.kind)==="image"?i.file_url??"":"")||r||t.url;if(t.crop)return{src:c,seed:fl(t.crop),inherited:!1};const u=(i==null?void 0:i.kind)==="image"&&n!=="locked"?i.crop:null;return u===null||!Ls(u)?{src:c,seed:null,inherited:!1}:{src:c,seed:fl(u),inherited:!0}}function xR(e,t){if(!e.inherited||e.seed===null)return!1;const n=i=>Math.round(i*1e4)/1e4,{seed:r}=e;return n(t.nx)===n(r.nx)&&n(t.ny)===n(r.ny)&&n(t.nw)===n(r.nw)&&n(t.nh)===n(r.nh)}function Aq({value:e,onChange:t,propertyId:n,cropCfg:r}){const{api:i}=tn(),a=Ll(n),[c,u]=w.useState(!1),f=ov(e,r),p=AN(n,[f],i.getCropDerivativeUrl),y=f?p.get(f):void 0,m=x=>{var _;if(!c)return null;const v=vR(a,e,r.mode,x);return v.src?h.jsx(I0,{chrome:_x,src:v.src,mode:r.mode,aspect:r.aspect,aspectLabel:r.aspectLabel,mobileAspect:r.mobileAspect,seed:{rect:v.seed},mobileSeed:{rect:fl((_=e.mobile)==null?void 0:_.crop)},onClose:()=>u(!1),onApply:k=>{if(u(!1),!e.file||!k.mobile&&xR(v,k.rect))return;const S=YM(e,k);S!==null&&t(S)}}):null};return{cropCfg:r,ar:e.ar??null,cut:f,derivativeUrl:y,open:()=>u(!0),modal:m}}function Ux({propertyId:e,children:t}){return h.jsx(h.Fragment,{children:t(Up(e))})}function Px(e,t){const n=Ll(t).get(e);return n===void 0?void 0:cM(n)}function Cq(e){return e==null||e===""?void 0:e}function OE(e){return{file:e.file,url:e.url,alt:e.alt}}const Nq={noun:"image",takes:ud(["image"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>e.file===t.file?{...t,url:gl(e)}:{...OE(t),file:e.file,url:gl(e),alt:t.alt,picked:e.id},fromUploaded:(e,t)=>({...OE(t),file:e.media_id,url:e.url,picked:null}),cleared:{file:"",url:"",alt:""},usePreview:function(t,n){const r=Px(t.file,n);return{src:(r==null?void 0:r.src)||t.url,name:Cq(t.name)??(r==null?void 0:r.name)}}},Mq={noun:"video",takes:ud(["video"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>({...t,file:e.file,url:"",poster:gl(e),source:e.url!==null?"link":void 0,provider:e.url!==null?e.provider??void 0:void 0,picked:e.id}),fromUploaded:(e,t)=>({...t,file:e.media_id,url:"",poster:e.poster??"",source:e.provider!==void 0?"link":void 0,provider:e.provider,picked:null}),cleared:{file:"",url:"",poster:"",alt:""},usePreview:function(t,n){const r=Px(t.file,n);return{src:(r==null?void 0:r.src)||t.poster,name:r==null?void 0:r.name,detail:r?bq(r):void 0}}},Rq={noun:"tour",takes:ud(["tour"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>({...t,file:e.file,url:"",poster:gl(e),provider:e.provider??void 0,picked:e.id}),fromUploaded:(e,t)=>({...t,file:e.media_id,url:"",poster:e.poster??"",provider:e.provider,picked:null}),cleared:{file:"",url:"",poster:"",alt:""},usePreview:function(t,n){const r=Px(t.file,n);return{src:(r==null?void 0:r.src)||t.poster,name:r==null?void 0:r.name,detail:t.file?cv((r==null?void 0:r.provider)??t.provider):void 0}}},Tq={noun:"document",takes:ud(["document"]),fileIdOf:e=>(e==null?void 0:e.file)??"",fromPicked:e=>({file:e.file,picked:e.id}),fromUploaded:e=>({file:e.media_id,picked:null}),cleared:null,usePreview:function(t,n){const r=OB(n),i=(t==null?void 0:t.file)??"";if(!i)return{src:""};const a=r(i);return a?{src:a.src,name:a.name,detail:jB(a),attachment:EM(a)}:{src:"",name:"Document unavailable"}}},$q={image:Nq,video:Mq,tour:Rq,document:Tq};function Gn(e){return $q[e]}function vl(e){return e.recordContext?e.recordContext.table??null:e.boundRowTable??null}const zq="text-[length:calc(11.5*var(--content))] text-ink-3",Dq=ce(vt,"inline-flex items-center gap-1.5 rounded-full bg-accent px-3 py-1.5 text-[length:calc(12*var(--content))] font-semibold text-white transition-[background] duration-[120ms] hover:bg-accent-ink"),Lq="flex w-full max-w-90 items-center gap-1.5",Iq="min-w-0 flex-1 rounded-lg border border-line bg-white px-2.5 py-1.75 text-[length:calc(12.5*var(--content))] text-ink outline-none placeholder:text-ink-4 focus:border-ink",Uq=ce(vt,"relative ml-[calc(10*var(--content))] grid aspect-square h-full shrink-0 cursor-pointer place-items-center overflow-hidden rounded-[calc(6*var(--content))] border border-line bg-[#e6e3da] text-ink-3","transition-[border-color,color] duration-[120ms] hover:border-ink-4 disabled:cursor-default disabled:hover:border-line","data-[empty]:border-dashed data-[empty]:not-data-[attention]:bg-transparent hover:data-[empty]:text-ink-2","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ink",zl);function AE(e){return e.kind==="image"?h.jsx(Pq,{...e}):h.jsx(wR,{...e})}function wR(e){const t=Gn(e.kind),n=mR({props:e.props,table:vl(e.props),mediaId:t.fileIdOf(e.props.value),inLibrary:!0});return h.jsx(ER,{...e,extras:{crop:null,pick:null,ownerUpload:n.upload,ownerPreview:void 0}})}function kR(e){const{slot:t,value:n,onChange:r,propertyId:i,factPath:a}=e,c=z0(t),u=Aq({value:n,onChange:r,propertyId:i,cropCfg:c}),f=Tx().capabilities.framingCrop===!1,p=GM(f?i:"");if(!f)return{...u,offered:!0,recropping:!1,cropped:WM(n,c)};const y=Ia(a,n.file);return{...u,cut:null,derivativeUrl:void 0,open:()=>{y!==null&&p.open(y)},modal:()=>p.modal,offered:y!==null&&p.offers(y),recropping:y!==null&&p.recropping(y),cropped:y!==null&&p.cropped(y)}}function Pq(e){const t=kR(e.props),n=Ll(e.props.propertyId),r=e.props.value.file,i=(c,u,f)=>{e.props.onChange(Sx(c,e.props.value,u,t.cropCfg,f))},a=mR({props:e.props,table:vl(e.props),mediaId:r,inLibrary:r!==""&&n.has(r)});return h.jsx(ER,{...e,extras:{crop:t,pick:i,ownerUpload:a.upload,ownerPreview:a.previewUrl}})}function _R(e){return e.kind==="image"?h.jsx(Fq,{...e}):h.jsx(SR,{...e,crop:null})}function Fq(e){return h.jsx(SR,{...e,crop:kR(e.props)})}function SR({kind:e,model:t,props:n,onOpen:r,crop:i}){const{slot:a,value:c,propertyId:u,required:f}=n,p=Gn(e),y=p.usePreview(c,u),m=jp(a,vl(n)),x=Pp(a,{table:vl(n)}),v=zx(n.factPath,p.fileIdOf(c));return h.jsx(qq,{kind:e,offer:m.kind,noun:p.noun,label:a.label,emptyName:x===null?a.label:tR(x).label,preview:y,empty:t.isEmpty(c),crop:i,processing:v,attention:Ai(t,a,c,f??!1),onOpen:r})}function ER({kind:e,face:t,model:n,props:r,extras:i,open:a}){var de,pe;const{slot:c,value:u,onChange:f,propertyId:p,onUpload:y,required:m}=r,{crop:x,pick:v,ownerUpload:_,ownerPreview:k}=i,S=Gn(e),j=S.usePreview(u,p),O=k?{...j,src:k}:j,A=y!==void 0?{kind:"owned"}:jp(c,vl(r)),$=n.isEmpty(u),C=Ai(n,c,u,m??!1),I=zx(r.factPath,S.fileIdOf(u))||((x==null?void 0:x.recropping)??!1),[z,T]=w.useState(!1),F=y??_??void 0,W=Bq(F,(N,ee)=>a?a.onUploaded(N,ee):f(S.fromUploaded(N,u))),G=w.useRef(null),H=a?a.accept:Ox[e]??void 0,U=a&&$?a.noun:S.noun,D=((pe=(de=Pp(c,{table:vl(r)}))==null?void 0:de.choose)==null?void 0:pe.label)??ku("Choose",U),K=(a==null?void 0:a.takes)??S.takes,M=A.kind==="owned"&&F!==void 0,B=(N,ee)=>{a?a.onPicked(N):v?v(N,ee,A.kind==="picked"?A.filter.from:void 0):f(S.fromPicked(N,u))},X=W,se=M&&K.includes("file"),J=M&&K.includes("link"),P=ku("Upload",U),Y=xM({accept:se?H??"":null,onFiles:([N])=>{N&&X.takeFile(N)},...J?{onLink:X.takeLink,...a?{}:{linkKinds:[e]}}:{},disabled:X.busy},P,G,!1),L=se||J,Z=A.kind==="picked"?[{label:D,glyph:"choose",run:()=>T(!0)}]:L?[{label:P,glyph:"upload",run:Y.start}]:[],ne=x!=null&&x.offered&&!$&&O.src?x.open:null,fe=$?null:()=>f(S.cleared);return h.jsxs("div",{ref:G,className:"flex min-w-0 flex-col gap-1",role:"group","aria-label":c.label,"data-media-face":t,"data-media-kind":e,"data-media-offer":A.kind,children:[h.jsx(Hq,{scale:t==="expanded"?"card":"compact",kind:e,noun:U,label:c.label,preview:O,empty:$,crop:x,sources:Z,onCrop:ne,onRemove:fe,drop:se?X.takeFile:null,link:J?X.takeLink:null,busy:X.busy,processing:I,attention:C}),x&&h.jsx(px,{holderPath:r.factPath,mediaId:S.fileIdOf(u),cropped:x.cropped}),X.error&&h.jsx("p",{className:$l,children:X.error}),Y.node,z&&A.kind==="picked"&&h.jsx(Ux,{propertyId:p,children:N=>h.jsx(dd,{mode:"single",propertyId:p,filter:A.filter,currentId:S.fileIdOf(u)||void 0,onClose:()=>T(!1),onPick:ee=>B(ee,N)})}),x==null?void 0:x.modal(k)]})}function Bq(e,t){const[n,r]=w.useState(!1),[i,a]=w.useState(null),c=u=>{e&&(r(!0),a(null),e(u).then(f=>t(f,u)).catch(f=>{console.error("[editor] media upload failed",f),a("Upload failed. Try again.")}).finally(()=>r(!1)))};return{busy:n,error:i,takeFile:u=>c({file:u}),takeLink:u=>c({link:u})}}function jR({kind:e,preview:t,size:n}){var r,i;return e==="document"?h.jsx(kq,{glyph:((r=t.attachment)==null?void 0:r.glyph)??"doc",extension:((i=t.attachment)==null?void 0:i.extension)??"",size:n}):e==="video"||e==="tour"?h.jsx(vq,{kind:e,size:n}):h.jsx(Mt.up,{})}function Hq({scale:e,kind:t,noun:n,label:r,preview:i,empty:a,crop:c,sources:u,onCrop:f,onRemove:p,drop:y,link:m,busy:x,processing:v,attention:_}){const[k,S]=w.useState(!1),[j,O]=w.useState(""),A=yx(c,i.src),$=y?{over:k,handlers:{onDragOver:I=>{I.preventDefault(),S(!0)},onDragLeave:I=>{I.currentTarget.contains(I.relatedTarget)||S(!1)},onDrop:I=>{var T;I.preventDefault(),S(!1);const z=(T=I.dataTransfer.files)==null?void 0:T[0];z&&y(z)}}}:null,C=[];if(f&&C.push({label:"Crop",glyph:"crop",onSelect:f}),!x)for(const I of u)C.push({label:I.label,glyph:I.glyph,onSelect:I.run,foot:!0});return p&&C.push({label:"Remove",glyph:"trash",onSelect:p,danger:!0}),a?h.jsxs(jE,{kind:t,name:`No ${n}`,empty:!0,scale:e,actions:C,attention:_,drop:$,children:[h.jsx("span",{className:"text-ink-4",children:h.jsx(jR,{kind:t,preview:i,size:24})}),(x||y)&&h.jsx("span",{className:zq,children:x?"Uploading…":k?`Drop to add this ${n}`:"Drop a file here"}),m&&h.jsxs("form",{className:Lq,onSubmit:I=>{I.preventDefault(),j.trim()&&m(j.trim()),O("")},children:[h.jsx("input",{className:Iq,value:j,onChange:I=>O(I.target.value),placeholder:`Paste a ${n} link`,"aria-label":`${r} link`}),h.jsxs("button",{type:"submit",className:Dq,disabled:x||!j.trim(),children:[h.jsx(Mt.link,{})," Add"]})]})]}):h.jsx(jE,{kind:t,name:i.name??`Untitled ${n}`,empty:!1,scale:e,actions:C,attention:_,drop:$,children:h.jsx(OR,{kind:t,src:A,preview:i,dimmed:x||v,children:x?h.jsx(P0,{label:"Uploading…"}):v&&h.jsx(Fx,{})})})}function Fx(){return h.jsx(P0,{label:"Processing…"})}function qq({kind:e,offer:t,noun:n,label:r,emptyName:i,preview:a,empty:c,crop:u,processing:f,attention:p,onOpen:y}){const m=Ul(),x=yx(u,a.src),v=e==="image"?null:a.name??(c?null:`Untitled ${n}`),_=x?h.jsx("img",{className:"absolute inset-0 size-full object-cover object-top",src:x,alt:"",draggable:!1,style:f?iN:void 0}):c?h.jsx(Mt.plus,{}):h.jsx(jR,{kind:e,preview:a,size:16});return h.jsxs("button",{type:"button",className:Uq,"data-media-summary":"","data-media-kind":e,"data-media-offer":t,"data-empty":c?"":void 0,...Dl(p,m),"aria-label":c?i:`${r}: ${v??n}`,disabled:y===void 0,onClick:y,children:[_,f&&h.jsx(Fx,{})]})}const Vq="block size-full object-cover object-top",Zq="flex size-full items-center justify-center bg-canvas",Kq="pointer-events-none absolute bottom-1.5 left-1.5 z-[3] max-w-[80%] truncate rounded-full bg-[rgba(15,18,9,0.72)] px-1.5 py-0.5 text-[length:calc(10.5*var(--content))] font-semibold tabular-nums text-white",Gq="pointer-events-none absolute inset-0 m-auto flex h-9 w-9 items-center justify-center rounded-full border-[1.5px] border-white/85 bg-[rgba(10,12,10,0.55)] pl-0.5 text-white backdrop-blur-[2px]";function OR({kind:e,src:t,preview:n,dimmed:r,children:i}){return h.jsxs(h.Fragment,{children:[t?h.jsx("img",{className:Vq,src:t,alt:"",draggable:!1,style:r?iN:void 0}):h.jsx("span",{className:Zq,children:h.jsx(Cs,{kind:e,size:"logo",decorative:!0,...e==="document"&&n.attachment?{glyph:n.attachment.glyph}:{}})}),e==="video"&&t&&h.jsx("span",{className:Gq,children:h.jsx(et,{name:"play",size:14})}),i,n.detail&&h.jsx("span",{className:Kq,children:n.detail})]})}function Bx({kind:e,value:t,propertyId:n,frame:r,holderPath:i}){const a=Gn(e),c=a.usePreview(t,n),u=zx(i,a.fileIdOf(t)),{chrome:f,crop:p,beneath:y}=r,m=yx(p,c.src),x=(p==null?void 0:p.cropping)??!1,v=c.name??(a.fileIdOf(t)?`Untitled ${a.noun}`:`No ${a.noun}`);return h.jsx(tH,{kind:e,name:v,chrome:f,thumb:h.jsx(OR,{kind:e,src:m,preview:c,dimmed:x||u,children:x?h.jsx(P0,{}):u&&h.jsx(Fx,{})}),below:p&&h.jsx(px,{storeKey:p.storeKey,holderPath:i,mediaId:a.fileIdOf(t),cropped:p.cropped}),beneath:y})}function Vp(e,t){function n(i){return h.jsx(AE,{kind:e,face:"expanded",model:t.model,props:i})}n.displayName=`MediaExpandedFace(${e})`;function r(i){return h.jsx(AE,{kind:e,face:"compact",model:t.model,props:i})}return r.displayName=`MediaCompactFace(${e})`,{model:t.model,faces:{expanded:n,compact:r},applyOptimistic:t.applyOptimistic}}function Yq(e,t){const n=Ll(t).get(e);return n===void 0?null:n.kind}function Hx(e,t,n){const r=Yq((e==null?void 0:e.kind)===void 0?(e==null?void 0:e.file)??"":"",n);return(e==null?void 0:e.kind)??r??t[0]??"image"}function Zp(e,t){return t===null||Gn(e).fileIdOf(t)===""?null:{...t,kind:e}}function CE(e,t,n,r){const i=Gn(e),a=t===e?n:i.cleared;return Zp(e,r(i,a))}function Qq(e){const t=e.map(n=>Ox[n]).filter(n=>n!==null);return{takes:ud(e),accept:t.length>0?t.join(","):void 0}}function fh(e){return"file"in e?zA(e.file.type):DA(e.link)}function Xq(e){const{kind:t}=e;return Zp(t,Gn(t).fromPicked(e,Gn(t).cleared))}function Wq(e,t,n,r){return{noun:e.length===1?Gn(t).noun:"media",...Qq(e),onPicked:i=>r(CE(i.kind,t,n,(a,c)=>a.fromPicked(i,c))),onUploaded:(i,a)=>{const c=fh(a);if(c===null||!e.includes(c))throw new Error(`a ${c??"file of no media kind"} is not among this field's ${e.join(", ")}`);r(CE(c,t,n,(u,f)=>u.fromUploaded(i,f)))}}}function NE({face:e,models:t,props:n}){const r=yi(n.slot),i=Hx(n.value,r,n.propertyId);return h.jsx(Jq,{kind:i,kinds:r,face:e,models:t,props:n},i)}function AR(e,t,n){const r=n.value===null?Gn(e).cleared:t.coerce(n.value);return{...n,value:r,onChange:i=>n.onChange(Zp(e,i))}}function Jq({kind:e,kinds:t,face:n,models:r,props:i}){const a=r[e],c=AR(e,a,i);return h.jsx(wR,{kind:e,face:n,model:a,props:c,open:Wq(t,e,c.value,i.onChange)})}function eV({models:e,props:t,onOpen:n}){const r=Hx(t.value,yi(t.slot),t.propertyId);return h.jsx(tV,{kind:r,models:e,props:t,onOpen:n},r)}function tV({kind:e,models:t,props:n,onOpen:r}){const i=t[e];return h.jsx(_R,{kind:e,model:i,onOpen:r,props:AR(e,i,n)})}function nV(e){function t(r){return h.jsx(NE,{face:"expanded",models:e.models(),props:r})}function n(r){return h.jsx(NE,{face:"compact",models:e.models(),props:r})}return{model:e.model,faces:{expanded:t,compact:n},applyOptimistic:null}}function rV(e,t){const n=e.querySelector("img");if(n){t.url&&n.setAttribute("src",t.url),n.setAttribute("alt",t.alt??""),n.style.transform="",n.style.transformOrigin="",n.style.objectPosition="";return}const r=e.querySelector("video");r&&(t.url?r.setAttribute("poster",t.url):r.removeAttribute("poster"))}function CR(e){if(e&&typeof e=="object"){const t=e,n=La(t.crop),r=ml(e);return{file:ld(t)??"",url:typeof t.url=="string"?t.url:"",alt:typeof t.alt=="string"?t.alt:"",crop:n??void 0,ar:typeof t.ar=="number"?t.ar:void 0,mobile:t.mobile&&typeof t.mobile=="object"&&La(t.mobile.crop)!==null?t.mobile:void 0,...t.renditions&&typeof t.renditions=="object"?{renditions:t.renditions}:{},...r===void 0?{}:{picked:r},...typeof t.name=="string"||t.name===null?{name:t.name}:{}}}return{file:"",url:"",alt:""}}const NR=Vp("image",{model:{defaultValue:{file:"",url:"",alt:""},coerce:CR,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:rV});function oV(e,t){const n=e.matches("img")?e:e.querySelector("img");n&&t.poster&&n.setAttribute("src",t.poster)}function MR(e){if(e&&typeof e=="object"){const t=e;return{file:ld(t)??"",url:typeof t.url=="string"?t.url:"",poster:typeof t.poster=="string"?t.poster:"",alt:typeof t.alt=="string"?t.alt:"",...typeof t.provider=="string"&&t.provider?{provider:t.provider}:{},...ml(e)===void 0?{}:{picked:ml(e)}}}return{file:"",url:"",poster:"",alt:""}}const RR=Vp("tour",{model:{defaultValue:{file:"",url:"",poster:"",alt:""},coerce:MR,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:oV});function TR({engine:e,lens:t,propertyId:n,instanceId:r,slotId:i,cropCfg:a}){const{api:c}=tn(),u=Ll(n),{rows:f}=e,[p,y]=w.useState(null),m=j=>`${n}:${r}:${i}:${j}`,x=j=>t.get(j.value),v=AN(n,f.map(j=>{const O=x(j);return O===null?null:ov(O,a)}),c.getCropDerivativeUrl),_=(j,O)=>{const A=p;y(null),A&&(!O.mobile&&xR(j,O.rect)||e.updateValue(A,$=>{const C=t.get($);if(C===null||!C.file)return $;const I=YM(C,O);return I===null?$:t.set($,I)}))},k=()=>{var $;const j=p?f.find(C=>C.key===p):null,O=j?x(j):null;if(!j||!O)return null;const A=vR(u,O,a.mode);return A.src?h.jsx(I0,{chrome:_x,src:A.src,mode:a.mode,aspect:a.aspect,aspectLabel:a.aspectLabel,mobileAspect:a.mobileAspect,seed:{rect:A.seed},mobileSeed:{rect:fl(($=O.mobile)==null?void 0:$.crop)},onApply:C=>_(A,C),onClose:()=>y(null)}):null},S=j=>{const O=x(j);return O===null?null:ov(O,a)};return{keyOf:m,cutOf:S,derivativeOf:j=>{const O=S(j);return O?v.get(O):void 0},cropped:j=>{const O=x(j);return O!==null&&WM(O,a)},open:y,modal:k}}function ME(e,t){return e.matches(t)?e:e.querySelector(t)}function iV(e,t){const n=ME(e,"video");if(n){t.poster&&n.setAttribute("poster",t.poster),t.url&&n.setAttribute("src",t.url),t.alt&&n.setAttribute("aria-label",t.alt);return}const r=ME(e,"img");r&&t.poster&&r.setAttribute("src",t.poster)}function $R(e){if(e&&typeof e=="object"){const t=e;return{file:ld(t)??"",url:typeof t.url=="string"?t.url:"",poster:typeof t.poster=="string"?t.poster:"",alt:typeof t.alt=="string"?t.alt:"",width:typeof t.width=="number"?t.width:void 0,height:typeof t.height=="number"?t.height:void 0,...t.source==="link"?{source:"link"}:{},...typeof t.provider=="string"&&t.provider?{provider:t.provider}:{},...ml(e)===void 0?{}:{picked:ml(e)}}}return{file:"",url:"",poster:"",alt:""}}const zR=Vp("video",{model:{defaultValue:{file:"",url:"",poster:"",alt:""},coerce:$R,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:iV});function sV(e,t){switch(e){case"image":return t.map(CR);case"video":return t.map($R);case"tour":return t.map(MR);case"document":return EB(t)}}function aV(e){return{get:t=>e==="image"?t:null,set:(t,n)=>n}}function lV({kind:e,label:t,itemSlot:n,offer:r,verbs:i,fixed:a,instanceId:c,slotId:u,ownerSlotId:f=u,value:p,propertyId:y,commit:m,onUpload:x,factPath:v,size:_}){const k=Gn(e),S=z0(n),j=w.useMemo(()=>sV(e,p),[e,p]),[O,A]=w.useState(!1),$=Oi({items:j,fixed:a,axis:"xy",commit:m}),{rows:C}=$,I=w.useMemo(()=>aV(e),[e]),z=TR({engine:$,lens:I,propertyId:y,instanceId:c,slotId:u,cropCfg:S}),T=bR(y,e),F=Ix(n,{propertyId:y,instanceId:c,slotId:f}),W=x??F??void 0,G=DR(W,se=>$.add(k.fromUploaded(se,k.cleared))),H=r.kind==="owned"&&W!==void 0,U=(se,J)=>e==="image"?Sx(se,k.cleared,J,S,r.kind==="picked"?r.filter.from:void 0):k.fromPicked(se,k.cleared),D=(se,J)=>{$.replace(Il(C,se,k.fileIdOf,P=>U(P,J),$.mint))},{add:K,onAdd:M,choose:B}=fx(i,r.kind==="picked"?()=>A(!0):null,r.kind==="owned"&&H?qx([e],G):null),X=G.error;return h.jsxs(hx,{engine:$,label:t,noun:k.noun,size:_,onAdd:M,add:K,choose:B,renderTile:(se,J,P)=>h.jsx(Bx,{kind:e,value:se.value,propertyId:y,holderPath:v,frame:{chrome:P,crop:e==="image"?{cfg:S,cut:z.cutOf(se),derivativeUrl:z.derivativeOf(se),cropping:T.recropping(Ia(v,k.fileIdOf(se.value))),cropped:T.framing?z.cropped(se):T.cropped(Ia(v,k.fileIdOf(se.value))),storeKey:z.keyOf(se.key)}:null}}),tileActions:se=>e==="image"&&T.offers(Ia(v,k.fileIdOf(se.value)))?[{label:"Crop",glyph:"crop",onSelect:()=>T.framing?z.open(se.key):T.recrop(Ia(v,k.fileIdOf(se.value)),z.keyOf(se.key))}]:[],children:[X&&h.jsx("p",{className:$l,children:X}),O&&r.kind==="picked"&&h.jsx(Ux,{propertyId:y,children:se=>h.jsx(dd,{mode:"multi",propertyId:y,filter:r.filter,selectedIds:C.map(J=>k.fileIdOf(J.value)),onChange:J=>D(J,se),onClose:()=>A(!1)})}),T.framing&&z.modal(),T.modal]})}function DR(e,t){const[n,r]=w.useState(!1),[i,a]=w.useState(null);return{busy:n,error:i,take:u=>{!e||u.length===0||(r(!0),a(null),(async()=>{try{for(const f of u)t(await e(f),f)}catch(f){console.error("[editor] media upload failed",f),a("Upload failed. Try again.")}finally{r(!1)}})())}}}function qx(e,t){const n=c0(e);return{accept:Ax(e),onFiles:r=>t.take(r.map(i=>({file:i}))),...n.length>0?{onLink:r=>t.take([{link:r}]),linkKinds:n}:{},disabled:t.busy}}const RE="label";function hh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Fl(e){var a;const t=hh(e);if((t==null?void 0:t.type)!=="object")return null;const n=hh(t.fields);if(n===null)return null;const r=(a=hh(t.label))==null?void 0:a.field,i=t.item_order;return{...typeof r=="string"?{labelField:r}:{},fields:n,...Array.isArray(i)?{item_order:i.filter(c=>typeof c=="string")}:{}}}function $n(e){return Fl(e.element)}function Ps(e){const{fields:t}=e,n=e.item_order;if(!n||n.length===0)return Object.entries(t);const r=new Set,i=[];for(const a of n)a in t&&!r.has(a)&&(r.add(a),i.push([a,t[a]]));for(const[a,c]of Object.entries(t))r.has(a)||i.push([a,c]);return i}function Nr(e,t){return e.labelField!==void 0&&e.fields[e.labelField]?{kind:"field",field:e.labelField}:e.fields[RE]?{kind:"field",field:RE}:{kind:"text",text:t}}function Fs(e,t,n){var c;if(e.kind==="text")return e.text;const r=(c=hh(n))==null?void 0:c[e.field],i=t.fields[e.field];if((i==null?void 0:i.type)==="address"){const u=en(r);return(u===null?null:QD(u))??"Untitled"}const a=typeof r=="string"?r.trim():typeof r=="number"?String(r):"";if(!a)return"Untitled";if((i==null?void 0:i.type)!=="select")return a;for(const u of i.values??[])if(typeof u!="string"&&u.value===a)return u.label;return a}function Vx(e){const t=$n(e);return t?Ps(t):[]}function cV(e){switch(e.type){case"text":case"select":case"url":case"email":case"phone":return"";case"number":case"date":case"image":case"video":case"tour":case"poi":case"document":case"address":case"media":return null;case"list":return[]}}function qa(e){const t={};for(const[n,r]of e)t[n]=cV(r);return t}const uV=["street","unit","city","state","postal"],LR={street:null,unit:null,city:null,state:null,postal:null,latitude:null,longitude:null,source:null};function dV(e,t){const n=e??LR,r=en({...n,...t}),i=uV.filter(a=>((r==null?void 0:r[a])??null)!==n[a]);return i.length===0?e:i.every(a=>a==="unit")?r:r===null?null:en({...r,latitude:null,longitude:null,source:null})}function TE(e,t,n){return dV(e,{[t]:n})}function fV(e){return en({...e,source:"autocomplete"})}function hV(e,t){return en({...e??LR,...t,source:"manual_pinned"})}function IR(e){return e!==null&&e.latitude!==null&&e.longitude!==null}function UR(e){return e!==null&&!IR(e)}function pV(e,t,n){const r=n===void 0||n.size===0?t!=="unit":n.has(t);return e!==null&&r&&e[t]===null}function mV(e){return UR(e)||(e==null?void 0:e.source)==="manual_pinned"}const PR={defaultValue:null,coerce:en,isEmpty:e=>e===null,isInvalid:()=>!1},uv=[{code:"AL",name:"Alabama"},{code:"AK",name:"Alaska"},{code:"AZ",name:"Arizona"},{code:"AR",name:"Arkansas"},{code:"CA",name:"California"},{code:"CO",name:"Colorado"},{code:"CT",name:"Connecticut"},{code:"DE",name:"Delaware"},{code:"DC",name:"District of Columbia"},{code:"FL",name:"Florida"},{code:"GA",name:"Georgia"},{code:"HI",name:"Hawaii"},{code:"ID",name:"Idaho"},{code:"IL",name:"Illinois"},{code:"IN",name:"Indiana"},{code:"IA",name:"Iowa"},{code:"KS",name:"Kansas"},{code:"KY",name:"Kentucky"},{code:"LA",name:"Louisiana"},{code:"ME",name:"Maine"},{code:"MD",name:"Maryland"},{code:"MA",name:"Massachusetts"},{code:"MI",name:"Michigan"},{code:"MN",name:"Minnesota"},{code:"MS",name:"Mississippi"},{code:"MO",name:"Missouri"},{code:"MT",name:"Montana"},{code:"NE",name:"Nebraska"},{code:"NV",name:"Nevada"},{code:"NH",name:"New Hampshire"},{code:"NJ",name:"New Jersey"},{code:"NM",name:"New Mexico"},{code:"NY",name:"New York"},{code:"NC",name:"North Carolina"},{code:"ND",name:"North Dakota"},{code:"OH",name:"Ohio"},{code:"OK",name:"Oklahoma"},{code:"OR",name:"Oregon"},{code:"PA",name:"Pennsylvania"},{code:"RI",name:"Rhode Island"},{code:"SC",name:"South Carolina"},{code:"SD",name:"South Dakota"},{code:"TN",name:"Tennessee"},{code:"TX",name:"Texas"},{code:"UT",name:"Utah"},{code:"VT",name:"Vermont"},{code:"VA",name:"Virginia"},{code:"WA",name:"Washington"},{code:"WV",name:"West Virginia"},{code:"WI",name:"Wisconsin"},{code:"WY",name:"Wyoming"},{code:"AS",name:"American Samoa"},{code:"GU",name:"Guam"},{code:"MP",name:"Northern Mariana Islands"},{code:"PR",name:"Puerto Rico"},{code:"VI",name:"U.S. Virgin Islands"}];function Zf(e){const t=e.trim().toLowerCase();if(t==="")return[...uv];const n=r=>{const i=r.name.toLowerCase();return r.code.toLowerCase()===t||i===t?0:i.startsWith(t)?1:i.includes(` ${t}`)?2:i.includes(t)?3:-1};return uv.map(r=>({state:r,rank:n(r)})).filter(({rank:r})=>r>=0).sort((r,i)=>r.rank-i.rank).map(({state:r})=>r)}function gV(e){const t=e.trim().toLowerCase();return t===""?null:uv.find(n=>n.code.toLowerCase()===t||n.name.toLowerCase()===t)??null}const yV="fixed overflow-y-auto rounded-[calc(10*var(--content))] border border-line bg-white p-1.5 shadow-[0_16px_38px_-12px_rgba(20,18,13,0.4)]",bV=ce(vt,"flex w-full items-center gap-3 rounded-[calc(7*var(--content))] px-2.5 py-2 text-left text-body text-ink data-[active=true]:bg-accent-soft"),vV="ml-auto text-caption font-medium text-ink-4",xV=4,wV=280,$E=220;function kV({value:e,onCommit:t,ariaLabel:n,placeholder:r,shellClassName:i,attention:a,inputClassName:c}){const u=e??"",[f,p]=w.useState(null),[y,m]=w.useState(0),[x,v]=w.useState(null),_=w.useId(),k=w.useRef(null),S=w.useRef(null),j=f!==null,O=j&&f!==u,A=Zf(O?f:""),$=w.useCallback(()=>{k.current&&v(_s(k.current))},[]);w.useEffect(()=>{if(j)return window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[j,$]),w.useEffect(()=>{var G,H;(H=(G=S.current)==null?void 0:G.querySelector('[data-active="true"]'))==null||H.scrollIntoView({block:"nearest"})},[y,j]);function C(){$(),p(u);const G=Zf("").findIndex(H=>H.code===u);m(Math.max(0,G))}function I(){p(null),v(null)}function z(G){I(),G!==e&&t(G)}function T(G){if(G===u)return I();if(G.trim()==="")return z(null);const H=gV(G);if(H)return z(H.code);const U=Zf(G);if(U.length===1)return z(U[0].code);I()}function F(G){if(!j){(G.key==="ArrowDown"||G.key==="ArrowUp")&&(G.preventDefault(),C());return}switch(G.key){case"ArrowDown":G.preventDefault(),m(H=>Math.min(A.length-1,H+1));return;case"ArrowUp":G.preventDefault(),m(H=>Math.max(0,H-1));return;case"Enter":{G.preventDefault(),G.stopPropagation();const H=A[y];H?z(H.code):T(f);return}case"Tab":{const H=O?A[y]:void 0;H?z(H.code):T(f);return}case"Escape":G.preventDefault(),I();return}}const W=x?Cl(x,{maxHeight:wV,minWidth:$E,gap:xV}):null;return h.jsxs("div",{className:i,ref:k,...a,children:[h.jsx("input",{className:c,type:"text",role:"combobox","aria-label":n,"aria-expanded":j,"aria-controls":_,"aria-autocomplete":"list",autoComplete:"address-level1",placeholder:r,value:j?f:u,onFocus:G=>{C(),G.currentTarget.select()},onChange:G=>{j||$(),p(G.target.value),m(0)},onKeyDown:F,onBlur:()=>{j&&T(f)}}),j&&W&&A.length>0&&typeof document<"u"&&Tr.createPortal(h.jsx("div",{ref:S,id:_,role:"listbox","aria-label":`${n} options`,className:yV,style:{left:W.left,top:W.top,bottom:W.bottom,maxHeight:W.maxHeight,minWidth:Math.max(W.width,$E),zIndex:vi},children:A.map((G,H)=>h.jsxs("button",{type:"button",role:"option",tabIndex:-1,"aria-selected":G.code===u,"data-active":H===y,"data-state-option":G.code,className:bV,onMouseEnter:()=>m(H),onMouseDown:U=>{U.preventDefault(),z(G.code)},children:[h.jsx("span",{className:"truncate",children:G.name}),h.jsx("span",{className:vV,children:G.code})]},G.code))}),document.body)]})}const FR=w.createContext(null);function _V({factPath:e,fields:t,children:n}){return h.jsx(FR.Provider,{value:{factPath:e,fields:t},children:n})}function Zx(e){const t=w.useContext(FR);return t!==null&&e!==void 0&&t.factPath===e?t.fields:void 0}const SV={street:{label:"Street address",placeholder:"123 Main St",panelPlaceholder:"Street address"},unit:{label:"Address 2",placeholder:"Unit 4B",panelPlaceholder:"Unit"},city:{label:"City",placeholder:"Boulder",panelPlaceholder:"City"},state:{label:"State",placeholder:"CO",panelPlaceholder:"State"},postal:{label:"ZIP",placeholder:"80301",panelPlaceholder:"ZIP"}},EV={page:{grid:"grid grid-cols-12 gap-x-3 gap-y-4",span:{street:"col-span-8",unit:"col-span-4",city:"col-span-6",state:"col-span-2",postal:"col-span-4"},labelled:!0},panel:{grid:"grid grid-cols-[1fr_3rem_1.5rem_5.5rem] gap-1.5",span:{street:"col-span-2",unit:"col-span-2",city:"",state:"col-span-2",postal:""},labelled:!1}},jV=250,OV=2e3;function AV(e){const t=mV(e),[n,r]=w.useState(!1),[i,a]=w.useState(t);!n&&i!==t&&a(t);const c=w.useRef(null),u=w.useCallback(()=>{c.current!==null&&clearTimeout(c.current),c.current=null},[]);w.useEffect(()=>u,[u]);const f=w.useCallback(()=>{u(),r(!1)},[u]),p=w.useCallback(()=>{u(),r(!0),c.current=setTimeout(()=>{c.current=null,r(!1)},OV)},[u]);return{show:n?i:t,hold:p,settle:f}}function CV(){const[e,t]=w.useState({});return{shown:(n,r)=>e[n]??r,type:(n,r)=>t(i=>({...i,[n]:r})),settle:n=>t(({[n]:r,...i})=>i),settleAll:()=>t({})}}function NV(e){const t=tn().address;return t?h.jsx(t.Input,{...e}):h.jsx("input",{className:e.className,type:"text",value:e.value,placeholder:e.placeholder,"aria-label":e.ariaLabel,autoComplete:"off",onChange:n=>e.onChange(n.target.value),onBlur:e.onBlur})}function MV({value:e,onPin:t,place:n}){const r=tn().address;if(!r)return null;const i=IR(e)?{latitude:e.latitude,longitude:e.longitude}:null;return h.jsx(r.PinMap,{pin:i,postal:(e==null?void 0:e.postal)??null,place:n,onPin:t})}function RV({value:e,show:t,onChange:n,place:r}){const[i,a]=w.useState(t);return t&&!i&&a(!0),w.useEffect(()=>{if(t)return;const c=setTimeout(()=>a(!1),jV);return()=>clearTimeout(c)},[t]),i?h.jsx("div",{"data-pin-map-reveal":!0,"data-open":t,"aria-hidden":!t,className:"grid grid-rows-[1fr] opacity-100 transition-[grid-template-rows,opacity] duration-250 ease-out starting:grid-rows-[0fr] starting:opacity-0 data-[open=false]:grid-rows-[0fr] data-[open=false]:opacity-0 motion-reduce:transition-none",children:h.jsx("div",{className:"min-h-0 overflow-hidden",children:h.jsx("div",{className:r==="page"?"pt-4":"pt-1.5",children:h.jsx(MV,{value:e,onPin:c=>n(hV(e,c)),place:r})})})}):null}function TV({value:e,onChange:t,place:n,fields:r,hold:i}){const a=CV(),c=Ul(),u=CM(n),f=EV[n],p=ce(u.inner,"w-full"),y=m=>{const x=SV[m],v=Dl(pV(e,m,r==null?void 0:r.required)?"required":null,c),_=f.labelled?x.placeholder:x.panelPlaceholder,k=(e==null?void 0:e[m])??"",S=m==="postal"?f0(k):k,j=A=>{a.type(m,A),i.hold(),t(TE(e,m,A))};let O;return m==="street"?O=h.jsx("div",{className:u.shell,...v,children:h.jsx(NV,{className:p,value:a.shown(m,S),placeholder:_,ariaLabel:x.label,onChange:j,onPick:A=>{a.settleAll(),i.settle(),t(fV(A))},onBlur:()=>a.settle(m)})}):m==="state"?O=h.jsx(kV,{value:(e==null?void 0:e.state)??null,onCommit:A=>{i.hold(),t(TE(e,"state",A??""))},ariaLabel:x.label,placeholder:_,shellClassName:u.shell,attention:v,inputClassName:p}):O=h.jsx("div",{className:u.shell,...v,children:h.jsx("input",{className:p,type:"text",value:a.shown(m,S),placeholder:_,"aria-label":x.label,autoComplete:"off",inputMode:m==="postal"?"numeric":void 0,maxLength:m==="postal"?10:void 0,onChange:A=>j(A.target.value),onBlur:()=>a.settle(m)})}),h.jsxs("label",{className:ce(u.frame,"min-w-0",f.span[m]),children:[f.labelled&&h.jsx("span",{className:PN,children:x.label}),O]},m)};return h.jsx("div",{className:f.grid,children:$V.filter(m=>r===void 0||r.used.has(m)).map(y)})}const $V=["street","unit","city","state","postal"];function zV(e){return e===void 0||e.used.has("latitude")||e.used.has("longitude")}function BR({slot:e,value:t,onChange:n,factPath:r,place:i}){const a=Zx(r)??void 0,c=AV(t),u=p=>{p.relatedTarget instanceof Node&&p.currentTarget.contains(p.relatedTarget)||c.settle()},f=p=>{c.settle(),n(p)};return h.jsxs("div",{className:"flex flex-col",role:"group","aria-label":e.label,onBlur:u,children:[h.jsx(TV,{value:t,onChange:n,place:i,fields:a,hold:c}),zV(a)&&h.jsx(RV,{value:t,show:c.show,onChange:f,place:i})]})}function DV(e){return h.jsx(BR,{...e,place:"page"})}function LV(e){return h.jsx(BR,{...e,place:"panel"})}const IV={model:PR,faces:{expanded:DV,compact:LV},applyOptimistic:null},zE=["January","February","March","April","May","June","July","August","September","October","November","December"],UV=["Su","Mo","Tu","We","Th","Fr","Sa"],DE=e=>String(e).padStart(2,"0");function HR(e,t,n){return`${String(e).padStart(4,"0")}-${DE(t+1)}-${DE(n)}`}function PV(e=new Date){return HR(e.getFullYear(),e.getMonth(),e.getDate())}function LE(e){return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7))-1}}function FV(e,t){const n=e.year*12+e.month+t;return{year:Math.floor(n/12),month:(n%12+12)%12}}function BV(e){const t=new Date(Date.UTC(e.year,e.month,1)).getUTCDay();return Array.from({length:42},(n,r)=>{const i=new Date(Date.UTC(e.year,e.month,1+r-t));return{iso:HR(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),inMonth:i.getUTCMonth()===e.month,day:i.getUTCDate()}})}const HV="fixed w-[calc(260*var(--content))] rounded-[calc(10*var(--content))] border border-line bg-white p-2.5 shadow-[0_16px_38px_-12px_rgba(20,18,13,0.4)]",IE=ce(vt,"grid size-[calc(28*var(--content))] place-items-center rounded-[calc(7*var(--content))] text-ink-3 hover:bg-accent-soft hover:text-ink"),qV=ce(vt,"flex items-center gap-1 rounded-[calc(7*var(--content))] px-2 py-1 text-[length:calc(13.5*var(--content))] font-semibold text-ink hover:bg-accent-soft data-[open=true]:bg-accent-soft"),qR=ce(vt,"grid h-[calc(32*var(--content))] place-items-center rounded-[calc(7*var(--content))] text-[length:calc(13*var(--content))] [font-variant-numeric:tabular-nums]","text-ink hover:bg-accent-soft data-[outside=true]:text-ink-4","data-[selected=true]:bg-accent data-[selected=true]:font-semibold data-[selected=true]:text-white data-[selected=true]:hover:bg-accent"),UE=ce(qR,"h-[calc(40*var(--content))]"),PE=12,VV=4,ZV=4;function KV({anchorRef:e,ownerRef:t,value:n,label:r,onPick:i,onClose:a}){const[c,u]=w.useState(()=>LE(n??PV())),[f,p]=w.useState("days"),[y,m]=w.useState(0),[x,v]=w.useState(null),_=w.useRef(null),[k,S]=w.useState(n);n!==k&&(S(n),n!==null&&u(LE(n))),w.useLayoutEffect(()=>{const C=()=>{const I=e.current,z=_.current;!I||!z||v(Cl(_s(I),{height:z.offsetHeight,minWidth:z.offsetWidth,gap:ZV}))};return C(),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[e,f]),w.useEffect(()=>{const C=T=>{var W,G;const F=T.target;(W=_.current)!=null&&W.contains(F)||(G=t.current)!=null&&G.contains(F)||a()},I=()=>a(),z=T=>{T.key!=="Escape"||T.defaultPrevented||(T.preventDefault(),a())};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",z),window.addEventListener("blur",I),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",z),window.removeEventListener("blur",I)}},[t,a]);const j=C=>{C==="years"&&m(c.year-VV),p(f===C?"days":C)},O=C=>{f==="years"?m(y+C*PE):u(FV(c,C))},A=f==="years"?"years":"month",$=(C,I,z)=>h.jsxs("button",{type:"button",className:qV,"aria-label":z,"aria-expanded":f===C,"data-open":f===C,onClick:()=>j(C),children:[I,h.jsx("span",{className:ce("text-ink-4 transition-transform",f===C&&"rotate-180"),children:h.jsx(Mt.chevD,{})})]});return Tr.createPortal(h.jsxs("div",{ref:_,role:"dialog","aria-label":`${r} calendar`,className:HV,style:{left:(x==null?void 0:x.left)??0,top:x?x.top:0,bottom:x==null?void 0:x.bottom,visibility:x?void 0:"hidden",zIndex:vi},onMouseDown:C=>C.preventDefault(),children:[h.jsxs("div",{className:"mb-1.5 flex h-[calc(28*var(--content))] items-center justify-between",children:[h.jsxs("div",{className:"flex items-center",children:[$("months",zE[c.month]??"","Choose month"),$("years",String(c.year),"Choose year")]}),f!=="months"&&h.jsxs("div",{className:"flex items-center",children:[h.jsx("button",{type:"button",className:IE,"aria-label":`Previous ${A}`,onClick:()=>O(-1),children:h.jsx(Mt.chevL,{})}),h.jsx("button",{type:"button",className:IE,"aria-label":`Next ${A}`,onClick:()=>O(1),children:h.jsx(Mt.chevR,{})})]})]}),f==="days"?h.jsxs("div",{className:"grid grid-cols-7 gap-0.5",children:[UV.map(C=>h.jsx("span",{className:"grid h-[calc(24*var(--content))] place-items-center text-[length:calc(11*var(--content))] font-medium text-ink-4",children:C},C)),BV(c).map(C=>h.jsx("button",{type:"button",className:qR,"aria-label":C.iso,"aria-pressed":C.iso===n,"data-outside":!C.inMonth,"data-selected":C.iso===n,onClick:()=>i(C.iso),children:C.day},C.iso))]}):f==="months"?h.jsx("div",{className:"grid grid-cols-3 gap-1",children:zE.map((C,I)=>h.jsx("button",{type:"button",className:UE,"aria-pressed":I===c.month,"data-selected":I===c.month,onClick:()=>{u({year:c.year,month:I}),p("days")},children:C.slice(0,3)},C))}):h.jsx("div",{className:"grid grid-cols-3 gap-1",children:Array.from({length:PE},(C,I)=>y+I).map(C=>h.jsx("button",{type:"button",className:UE,"aria-pressed":C===c.year,"data-selected":C===c.year,onClick:()=>{u({year:C,month:c.month}),p("days")},children:C},C))})]}),document.body)}const VR={defaultValue:null,coerce:e=>typeof e=="string"&&e!==""?e:null,isEmpty:e=>e===null,isInvalid:e=>!LA(e)};function FE({slot:e,value:t,onChange:n,required:r=!1}){const[i,a]=w.useState(!1),[c,u]=w.useState(!1),f=w.useRef(null),p=w.useRef(null),y=w.useRef(null),m=i||t!==null,x=Ai(VR,e,t,r),v=Ci(),_=t!==null&&LA(t)?t:null;w.useEffect(()=>{var j;i&&((j=f.current)==null||j.focus())},[i]);const k=w.useCallback(()=>{var j;u(!1),document.activeElement!==f.current&&((j=f.current)==null?void 0:j.value)===""&&a(!1)},[]),S=m?h.jsxs(Ns,{attention:x,className:c?"border-accent":void 0,ref:y,children:[h.jsx("input",{ref:f,className:ce(v.inner,"[font-variant-numeric:tabular-nums] [&::-webkit-calendar-picker-indicator]:hidden"),type:"date","aria-label":e.label,"aria-invalid":x==="invalid"||void 0,value:_??"",onFocus:()=>a(!0),onChange:j=>n(j.target.value===""?null:j.target.value),onBlur:j=>{u(!1),j.target.value===""&&a(!1)}}),h.jsx("span",{className:ce(BN,v.adornEnd),children:h.jsx("button",{type:"button",className:ce(vt,"flex items-center text-ink-4 hover:text-ink-2 data-[open=true]:text-accent"),"aria-label":`Choose ${e.label}`,"aria-haspopup":"dialog","aria-expanded":c,"data-open":c,onMouseDown:j=>j.preventDefault(),onClick:()=>c?k():u(!0),children:h.jsx(Mt.calendar,{})})})]}):h.jsx(Ns,{attention:x,children:h.jsx("button",{type:"button",className:ce(vt,v.inner,"cursor-pointer text-left text-ink-4"),"aria-label":e.label,onClick:()=>{a(!0),u(!0)},children:"None"})});return h.jsxs("div",{className:v.frame,ref:p,children:[S,m&&c&&h.jsx(KV,{anchorRef:y,ownerRef:p,value:_,label:e.label,onPick:j=>{var O;n(j),u(!1),(O=f.current)==null||O.focus()},onClose:k}),h.jsx(NM,{attention:x,message:"Not a real date. Pick one"})]})}const GV={model:VR,faces:{expanded:FE,compact:FE},applyOptimistic:null},ZR=Vp("document",{model:{defaultValue:{file:""},coerce:SM,isEmpty:e=>e===null||e.file==="",isInvalid:()=>!1},applyOptimistic:null}),Bh="data-slot-id",BE="data-slot-text-leaf",YV="data-slot-group",KR="data-slot-item",Kx="data-slot-field",GR="data-slot-unselectable",ro="data-section-instance-id";function YR(e,t){const n=[];e.hasAttribute(BE)&&n.push(e),n.push(...Array.from(e.querySelectorAll(`[${BE}]`))),n.length!==0&&n.forEach(r=>{QV(r,t)})}function QV(e,t){const n=e.ownerDocument,r=[];t.split(`
|
|
536
|
-
`).forEach((i,a)=>{a>0&&r.push(n.createElement("br")),r.push(n.createTextNode(i))}),e.replaceChildren(...r)}function fd(e){return typeof e=="string"?e:e==null?"":typeof e=="number"||typeof e=="boolean"?String(e):""}function XV(e){const[t,n]=w.useState(e),[r,i]=w.useState(e);return e!==r&&(i(e),n(e)),[t,n]}function Gx({kind:e,slot:t,value:n,onChange:r,required:i=!1}){var x;const a=n??"",[c,u]=XV(a),f=Ai(e.model,t,c,i),p=e.invalidMessage(c,t),y=v=>{if(!e.model.isEmpty(v)&&e.model.isInvalid(v,t))return;const k=e.model.isEmpty(v)?"":e.normalize(v);u(k),k!==a&&r(k)},m=Ci();return h.jsxs("div",{className:m.frame,children:[h.jsxs(Ns,{attention:f,children:[h.jsx("input",{className:m.inner,type:e.inputType,inputMode:e.inputMode,autoComplete:e.autoComplete,value:c,placeholder:t.placeholder??e.placeholder,spellCheck:!1,"aria-label":t.label,"aria-invalid":f==="invalid"||void 0,"aria-description":m.inline&&f==="invalid"?p:void 0,onChange:v=>u(v.target.value),onBlur:v=>y(v.target.value)}),!m.inline&&((x=e.adornment)==null?void 0:x.call(e,c))]}),h.jsx(NM,{attention:f,message:p})]})}const QR={model:{defaultValue:"",coerce:fd,isEmpty:e=>e.trim()==="",isInvalid:e=>!HD(e.trim())},normalize:e=>e.trim(),invalidMessage:()=>"Not a valid email address",inputType:"email",inputMode:"email",autoComplete:"email",placeholder:"name@example.com"};function HE(e){return h.jsx(Gx,{kind:QR,...e})}const WV={model:QR.model,faces:{expanded:HE,compact:HE},applyOptimistic:null},XR="section";function WR(e,t){const{itemKind:n,view:r,granularity:i}=LC(e,t,XR),a=n==="object"||n==="annotated-media"?{kind:"record",entries:Vx(e)}:{kind:"single",slot:e.element??{type:"text",label:e.label}};return{itemKind:n,view:r,granularity:i,itemContent:a,axis:r==="gallery"||r==="annotated-gallery"?"xy":"y"}}function dv(e,t){const n=Tn(e),r=Tn(t);if(n!=null||r!=null)return n===r;if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((i,a)=>dv(i,t[a]));if(typeof e=="object"||typeof t=="object"){if(typeof e!="object"||typeof t!="object")return!1;const i=e,a=t;return[...new Set([...Object.keys(i),...Object.keys(a)])].every(u=>dv(i[u],a[u]))}return qE(e)===qE(t)}function qE(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):null}function JV(e,t,n,r,i){const a=mi(u=>u.markSlotOverridden),c=!i&&!E8(e);return function(f,p){c&&a(t,n,{kind:"scalar"}),r(f.map(y=>y.value))}}function _u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function eZ(e){var t;return((t=_u(e.element))==null?void 0:t.type)==="row"}function Yx(e,t){var r;const n=(r=_u(e))==null?void 0:r.decisions;if(Array.isArray(n))return n.find(i=>{var c;const a=(c=_u(i))==null?void 0:c.produces;return Array.isArray(a)&&a[0]===t})}function Qx(e,t,n){const r=_u(t),i=S8(r).some(y=>y.verb==="pick")||eZ(e),a=i6({slots:{},...n===void 0?{}:{sectionSlots:n}},e);switch(j8(e).kind){case"table":{const y=Qu(e.source);return y===null?{kind:"owned"}:{kind:"table",table:y}}case"section":case"derived":return a.length===0?{kind:"follows"}:{kind:"follows",tables:a}}if(!i)return{kind:"owned"};const[u,...f]=a;if(u!==void 0)return{kind:"pick-row",tables:[u,...f]};const p=dL(r==null?void 0:r.of);return p===null?{kind:"owned"}:{kind:"pick-media",filter:p}}function Xx(e){switch(e.kind){case"table":return[e.table];case"pick-row":return e.tables;case"follows":return e.tables??[];case"pick-media":case"owned":return[]}}function JR(e){const t=Xx(e);return t.length===1?t[0]:null}const hd="id";function eT(e){const[t,...n]=[...new Set(e)];return t===void 0?null:[t,...n]}function Wx(e){return eT(Xx(e))}const tZ=()=>null;function pd(e){const t=eT(bu(e));return t===null?{kind:"none"}:e.source===void 0?{kind:"table",tables:t}:{kind:"table",tables:t,inert:!0}}function fv(e,t,n){const r=Wx(t);if(r!==null)return{kind:"table",tables:r};const i=_u(e.source);return t.kind==="follows"&&(i==null?void 0:i.kind)==="section"?nZ(i,n):{kind:"none"}}function nZ(e,t){const n=e.section,r=e.slot;return typeof n!="string"||typeof r!="string"?{kind:"none"}:{kind:"content",labelOf:(t==null?void 0:t({section:n,slot:r}))??tZ}}function Hh(e,t){const n=e[t];return typeof n=="string"&&n!==""?n:null}function tT({instanceId:e,slotId:t,membership:n,itemBaseline:r,insideRecord:i}){const a=mi(x=>x.markSlotOverridden),c=mi(x=>x.relinkSlot),u=hd,f=JR(n)===null&&n.kind!=="follows",p=n.kind==="table"||n.kind==="follows",y=x=>Hh(x,u),m=x=>y(x.value)??(f?x.key:null);return{identityKey:u,identityOf:y,stamp:x=>f?x.map(v=>y(v.value)===null?{key:v.key,value:{...v.value,[u]:v.key}}:v):x,markerIdentity:m,markFields:(x,v)=>{if(i)return;const _=m(x);if(_===null)return;const k=r==null?void 0:r.find(S=>S[u]===_);for(const S of Object.keys(v))S!==u&&(k!=null&&dv(v[S],k[S])?c(e,t,{kind:"item",item_id:_,field:S}):a(e,t,{kind:"item",item_id:_,field:S}))},markRemoved:x=>{if(i||n.kind!=="table")return;const v=y(x.value);v!==null&&!bl(v)&&a(e,t,{kind:"item_removed",item_id:v})},markOrder:x=>{if(i||!p||r===void 0)return;const v=x.map(O=>y(O.value)).filter(O=>O!==null),_=new Set(v),k=r.map(O=>Hh(O,u)).filter(O=>O!==null&&_.has(O)),S=new Set(k);v.filter(O=>S.has(O)).every((O,A)=>O===k[A])?c(e,t,{kind:"order"}):a(e,t,{kind:"order"})}}}async function rZ(e,t,n){const r=await e(`/properties/${t}/poi/search`,{method:"POST",json:{query:n}});return Array.isArray(r==null?void 0:r.results)?r.results:[]}async function nT(e,t,n){return e(`/properties/${t}/poi/${encodeURIComponent(n)}`)}async function oZ(e,t,n){if(n.length===0)return{};const r=await e(`/properties/${t}/poi/photo-urls`,{method:"POST",json:{place_ids:n}});return(r==null?void 0:r.urls)??{}}function rT(e){if(e==null||!Number.isFinite(e))return null;const t=e/1609.344;return t<.1?"< 0.1 mi":`${t.toFixed(1)} mi`}const qh=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Hc=e=>typeof e=="string"&&e!==""?e:void 0;function iZ(e){const t={},n=qh(e.rating);n!==void 0&&(t.rating=n);const r=qh(e.review_count);r!==void 0&&(t.review_count=r);const i=Hc(e.type_label);i!==void 0&&(t.type_label=i);const a=Hc(e.price_level);a!==void 0&&(t.price_level=a);const c=Hc(e.website_uri);c!==void 0&&(t.website_uri=c);const u=Hc(e.google_maps_uri);u!==void 0&&(t.google_maps_uri=u);const f=Hc(e.summary);f!==void 0&&(t.summary=f);const p=sZ(e.photo);return p!==void 0&&(t.photo=p),t}function sZ(e){if(!e||typeof e!="object")return;const t=e,n=qh(t.width),r=qh(t.height),i=t.attribution;if(!(n===void 0||r===void 0||typeof i!="string"))return{width:n,height:r,attribution:i}}function Jx(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||typeof t.place_id!="string"||typeof t.name!="string"||typeof t.lat!="number"||typeof t.lng!="number"?null:{id:t.id,place_id:t.place_id,name:t.name,address:typeof t.address=="string"?t.address:null,lat:t.lat,lng:t.lng,distance_m:typeof t.distance_m=="number"?t.distance_m:null,...iZ(t)}}function aZ(e){return e.map(Jx).filter(t=>t!==null)}function lZ(e){return[e.rating===void 0?null:`★ ${e.rating.toFixed(1)}${e.review_count===void 0?"":` (${e.review_count.toLocaleString()})`}`,e.type_label,rT(e.distance_m),e.address].filter(Boolean).join(" · ")}const ew="group/row relative flex min-h-10.5 items-center gap-2.5 rounded-[calc(8*var(--content))] border border-line bg-white px-2.5 py-1.75 [transition:border-color_.14s,box-shadow_.14s,background_.3s]",tw="grid w-5 flex-shrink-0 place-items-center text-ink-4",nw="flex min-w-0 flex-1 flex-col gap-px",rw="truncate text-[length:calc(13.5*var(--content))] text-ink",ow="truncate text-caption text-ink-3",cZ="rounded-[calc(8*var(--content))] border border-dashed border-line px-3 py-3.5 text-center text-[length:calc(12.5*var(--content))] text-ink-4",oT="text-caption text-danger",iT="opacity-70",sT="size-[calc(14*var(--content))] flex-shrink-0 animate-[we-ml-spin_.7s_linear_infinite] rounded-full border-2 border-[#d9d5c9] border-t-accent",uZ="size-[calc(26*var(--content))] flex-shrink-0 rounded-[calc(5*var(--content))] object-cover bg-[#f1f0ea]",dZ="we-no-drag flex flex-shrink-0 items-center gap-0.75",fZ="flex items-center gap-0.75 opacity-0 transition-opacity duration-[120ms] group-hover/row:opacity-100",hZ="grid size-6 cursor-pointer place-items-center rounded-md border-0 bg-transparent p-0 text-ink-3 outline-none hover:bg-[#f1f0ea] hover:text-ink-2",pZ=()=>h.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",className:"w-[calc(14*var(--content))] h-[calc(14*var(--content))]",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M8 14s4.5-4 4.5-7.5a4.5 4.5 0 0 0-9 0C3.5 10 8 14 8 14Z"}),h.jsx("circle",{cx:"8",cy:"6.4",r:"1.7"})]});function aT(e,t){const{apiFetch:n}=tn().api,[r,i]=w.useState({}),a=t.filter(u=>u.photo).map(u=>u.place_id).sort().join(","),c=w.useRef(new Set);return w.useEffect(()=>{const f=(a===""?[]:a.split(",")).filter(p=>!c.current.has(p));f.length!==0&&(f.forEach(p=>c.current.add(p)),oZ(n,e,f).then(p=>{i(y=>({...y,...p}))}).catch(()=>{f.forEach(p=>c.current.delete(p))}))},[a,e,n]),{urls:r,dropUrl:u=>i(f=>{if(!(u in f))return f;const p={...f};return delete p[u],p})}}function lT({row:e,photoUrl:t,onPhotoError:n,onRemove:r,dragProps:i,flashNew:a}){const c=lZ(e);return h.jsxs("div",{...i,className:ce(ew,i&&"cursor-grab hover:border-[#d9d5c9]",a&&"animate-[we-ml-rowin_.26s_cubic-bezier(.2,.7,.3,1)_both]"),children:[t?h.jsx("img",{className:uZ,src:t,alt:"",draggable:!1,onError:n}):h.jsx("span",{className:tw,children:h.jsx(pZ,{})}),h.jsxs("div",{className:nw,children:[h.jsx("span",{className:rw,children:e.name}),c&&h.jsx("span",{className:ow,children:c})]}),r&&h.jsx("div",{className:dZ,children:h.jsx("span",{className:fZ,children:h.jsx("button",{type:"button",className:ce(hZ,"hover:bg-[#fbecea] hover:text-danger"),title:"Remove",onClick:r,children:h.jsx(Mt.trash,{})})})})]})}const mZ="relative flex flex-col",gZ="flex min-w-0 items-center gap-2 rounded-[calc(8*var(--content))] border border-line bg-white px-2.5 transition-[border-color,box-shadow] duration-[120ms] focus-within:border-accent focus-within:shadow-[0_0_0_3px_rgba(15,42,34,0.07)]",yZ="grid flex-shrink-0 place-items-center text-ink-4",bZ="min-w-0 flex-1 appearance-none border-0 bg-transparent py-2.25 text-[length:calc(13.5*var(--content))] text-ink placeholder:text-ink-4",vZ="size-[calc(15*var(--content))] flex-shrink-0 animate-[we-ml-spin_.7s_linear_infinite] rounded-full border-2 border-[#d9d5c9] border-t-accent",xZ="fixed flex flex-col overflow-hidden rounded-[calc(8*var(--content))] border border-line bg-white shadow-[0_14px_30px_-12px_rgba(20,18,13,0.28)]",wZ="m-0 min-h-0 list-none overflow-y-auto p-1",kZ={maxHeight:264,gap:4},_Z=ce(vt,"flex w-full flex-col gap-px rounded-md px-2 py-1.75 text-left"),SZ="bg-accent-soft",EZ="cursor-default opacity-55",jZ="flex items-center gap-1.5 truncate text-[length:calc(13.5*var(--content))] text-ink",OZ="truncate text-caption text-ink-3",By="px-3 py-3 text-center text-[length:calc(12.5*var(--content))] text-ink-4",AZ="inline-flex flex-shrink-0 items-center gap-1 text-good",CZ=2,NZ=300;function cT({propertyId:e,placeholder:t,addedIds:n,disabled:r=!1,disabledHint:i,onSelect:a}){const{apiFetch:c}=tn().api,[u,f]=w.useState(""),[p,y]=w.useState([]),[m,x]=w.useState("idle"),[v,_]=w.useState(0),[k,S]=w.useState(0),j=w.useRef(0),O=w.useId(),A=w.useRef(null),$=w.useRef(null);w.useEffect(()=>{const F=u.trim();if(F.length<CZ){++j.current,x("idle"),y([]);return}const W=++j.current;x("loading");const G=setTimeout(()=>{rZ(c,e,F).then(H=>{W===j.current&&(y(H),_(0),x(H.length?"results":"empty"))}).catch(()=>{W===j.current&&x("error")})},NZ);return()=>clearTimeout(G)},[u,e,k,c]);function C(F){n.has(F.place_id)||(a(F),f(""),y([]),x("idle"))}function I(F){if(F.key==="Escape"){m!=="idle"&&F.preventDefault(),x("idle"),y([]);return}if(m==="results"){if(F.key==="ArrowDown")F.preventDefault(),_(W=>Math.min(p.length-1,W+1));else if(F.key==="ArrowUp")F.preventDefault(),_(W=>Math.max(0,W-1));else if(F.key==="Enter"){F.preventDefault();const W=p[v];W&&C(W)}}}const z=m!=="idle",T=wD(z,A,kZ);return h.jsxs("div",{className:mZ,onBlur:F=>{var G;const W=F.relatedTarget;!F.currentTarget.contains(W)&&!((G=$.current)!=null&&G.contains(W))&&x("idle")},children:[h.jsxs("div",{ref:A,className:ce(gZ,r&&"opacity-55"),role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-controls":O,children:[h.jsx("span",{className:yZ,children:h.jsx(Mt.search,{})}),h.jsx("input",{className:bZ,value:u,placeholder:t,disabled:r,title:r?i:void 0,onChange:F=>f(F.target.value),onKeyDown:I,"aria-label":t,"aria-autocomplete":"list","aria-activedescendant":m==="results"?`${O}-${v}`:void 0}),m==="loading"&&h.jsx("span",{className:vZ})]}),z&&T&&Tr.createPortal(h.jsxs("div",{ref:$,className:xZ,style:{left:T.left,top:T.top,bottom:T.bottom,width:T.width,maxHeight:T.maxHeight,zIndex:vi},onMouseDown:F=>F.preventDefault(),children:[m==="loading"&&h.jsx("div",{className:By,children:"Searching…"}),m==="empty"&&h.jsxs("div",{className:By,children:["No places found for “",u.trim(),"”."]}),m==="error"&&h.jsxs("div",{className:By,children:["Couldn't reach search."," ",h.jsx("button",{type:"button",className:"font-semibold text-accent-ink underline",onClick:()=>S(F=>F+1),children:"Retry"})]}),m==="results"&&h.jsx("ul",{className:wZ,role:"listbox",id:O,children:p.map((F,W)=>{const G=n.has(F.place_id),H=[rT(F.distance_m),F.address].filter(Boolean).join(" · ");return h.jsx("li",{id:`${O}-${W}`,role:"option","aria-selected":W===v,children:h.jsxs("button",{type:"button",disabled:G,className:ce(_Z,W===v&&!G&&SZ,G&&EZ),onMouseEnter:()=>_(W),onClick:()=>C(F),children:[h.jsxs("span",{className:jZ,children:[G&&h.jsxs("span",{className:AZ,children:[h.jsx(Mt.check,{size:12})," Added ·"]}),h.jsx("span",{className:"truncate",children:F.name})]}),H&&h.jsx("span",{className:OZ,children:H})]})},F.place_id)})})]}),document.body)]})}const MZ="flex flex-col gap-2.75",RZ="relative flex flex-col gap-1.75",TZ=400;function $Z({slot:e,fixed:t,value:n,propertyId:r,commit:i}){const{apiFetch:a}=tn().api,c=w.useMemo(()=>aZ(n),[n]),[u,f]=w.useState(null),[p,y]=w.useState(null),[m,x]=w.useState({}),v=w.useRef({});w.useEffect(()=>()=>{Object.values(v.current).forEach(clearTimeout)},[]);const _=Oi({items:c,identityOf:z=>z.id,fixed:t,axis:"y",commit:i}),{rows:k}=_,{urls:S,dropUrl:j}=aT(r,c);function O(z){x(T=>({...T,[z]:!0})),clearTimeout(v.current[z]),v.current[z]=setTimeout(()=>x(T=>{const F={...T};return delete F[z],F}),TZ)}async function A(z){if(f(null),!!_.canAdd&&!_.latestRows().some(T=>T.value.place_id===z.place_id)){y(z);try{let T;try{T=await nT(a,r,z.place_id)}catch{f("Couldn't add that place. Try again.");return}if(_.latestRows().some(F=>F.value.place_id===T.place_id))return;_.add(T),O(T.id)}finally{y(null)}}}const{containerRef:$,getItemProps:C}=_.drag,I=new Set(k.map(z=>z.value.place_id));return h.jsxs("div",{className:MZ,role:"group","aria-label":e.label,children:[h.jsx(cT,{propertyId:r,placeholder:e.placeholder??"Search nearby…",addedIds:I,disabled:!_.canAdd,disabledHint:"Set by its source",onSelect:z=>void A(z)}),u&&h.jsx("span",{className:oT,children:u}),(k.length>0||p)&&h.jsxs("div",{className:RZ,ref:$,children:[p&&h.jsxs("div",{className:ce(ew,iT),"aria-live":"polite",children:[h.jsx("span",{className:tw,children:h.jsx("span",{className:sT})}),h.jsxs("div",{className:nw,children:[h.jsx("span",{className:rw,children:p.name}),h.jsx("span",{className:ow,children:"Adding…"})]})]}),k.map(z=>h.jsx(lT,{row:z.value,photoUrl:S[z.value.place_id],onPhotoError:()=>j(z.value.place_id),onRemove:_.canRemove?()=>_.remove(z.key):void 0,dragProps:C(z.key),flashNew:m[z.value.id]===!0},z.key))]})]})}const zZ={property:"this property's",library:"your"},DZ={property:at.pages,library:yr.pages};function qc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function VE(e){return kp({from:e.from??[]}).filter(t=>t!=="")}function LZ(e){var r;const t=qc(e.source);if(Qu(t)!==null)return[String(t==null?void 0:t.key)];const n=qc(e.element);if(n===null)return[];if(n.type==="row"||n.type==="media"||typeof n.type=="string"&&po(n.type))return VE(n);for(const i of Object.values(qc(n.fields)??{})){const a=qc(i);if(a!==null&&((r=qc(a.source))==null?void 0:r.kind)==="element")return VE(a)}return[]}function IZ(e){const t=e.indexOf("."),n=e.slice(0,t);if(n!=="property"&&n!=="library")return null;const r=DZ[n],i=e.slice(t+1),a=Object.hasOwn(r,i)?r[i]:null;return a!==null&&_p(a)&&a.declaration.type==="list"?{home:n,label:Si(a)}:null}function uT(e){const t=[...new Set(LZ(e))],n=t.length===1?IZ(t[0]):null;return n===null?null:`From ${zZ[n.home]} ${Rr(n.label).plural}`}function UZ(e,t){var n;return((n=e==null?void 0:e.order)==null?void 0:n[t])===!0}function iw(e,t){var n;return((n=e==null?void 0:e.scalar)==null?void 0:n[t])===!0}function md(e,t){return`${e}.${t}`}function Eo(e){const t=e.indexOf(".");return t<=0||t===e.length-1||e.includes(".",t+1)?null:{object:e.slice(0,t),field:e.slice(t+1)}}function Rt(e,t){const n=Eo(t);if(n===null)return e[t];const r=e[n.object];return r!==null&&typeof r=="object"&&!Array.isArray(r)?r[n.field]:void 0}function PZ(e,t,n){const r=Eo(t);if(r===null)return{...e,[t]:n};const i=e[r.object],a=i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{};return{...e,[r.object]:{...a,[r.field]:n}}}function FZ(e,t,n,r){var i,a,c;return((c=(a=(i=e==null?void 0:e.items)==null?void 0:i[t])==null?void 0:a[n])==null?void 0:c[r])===!0}function BZ(e,t){var n;return{...((n=e==null?void 0:e.items)==null?void 0:n[t])??{}}}function dT(e,t){var n;return{...((n=e==null?void 0:e.items_removed)==null?void 0:n[t])??{}}}function HZ(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}const sw=e=>{var t;return(t=HZ(e))==null?void 0:t.source};function qZ(e,t){return Object.entries(e).flatMap(([n,r])=>{const i=Is(sw(r));return i!==null&&i.slot===t?[{key:n,member:i.field}]:[]})}function VZ(e,t){const n=e,r=[],i=(a,c,u)=>{var p;const f=Is(sw(c));f!==null&&((p=aC(n,u,f.slot))==null?void 0:p.path)===t&&r.push({key:a,member:f.field})};for(const[a,c]of Object.entries(e)){const u=Fl(c);if(u===null){i(a,c,{});continue}const f=u.fields;for(const[p,y]of Object.entries(u.fields))i(md(a,p),y,{container:a,siblings:f})}return r}function ZZ(e,t){var i;const n=Is(sw(e));if(n===null)return!1;const r=t.fields===void 0?{}:{siblings:t.fields};return((i=sC(t.slots??{},r,n.slot))==null?void 0:i.def.type)==="address"}function xl(e){var t;return((t=e.source)==null?void 0:t.kind)==="element"}function fT(e){return e.type==="row"}function hT(e,t,n){const r={};for(const i of qZ(Object.fromEntries(e),t))Object.hasOwn(n,i.member)&&(r[i.key]=n[i.member]);return r}function aw(e,t,n,r){const i=qa(e);for(const[a,c]of e)xl(c)&&(i[a]=n,r&&Object.assign(i,hT(e,a,r)));return i[t]=n,i}function pT(e,t,n){var a;const r=(a=t.find(([,c])=>fT(c)&&xl(c)))==null?void 0:a[0],i=r!==void 0?e[r]:void 0;return typeof i=="string"&&i!==""?i:Hh(e,n)}function Vh(e,t,n){return e.flatMap(r=>pT(r,t,n)??[])}function KZ(e,t){return e.map(n=>{const r=t.get(n);return r===void 0?{id:n}:{id:n,members:r}})}function mT(e,t,n,r,i,a){return Il(e,KZ(r,i),c=>pT(c,t,n),c=>aw(t,n,c.id,c.members),a)}function GZ(e,t,n,r,i){const a=e.map((u,f)=>({key:String(f),value:u}));return mT(a,t,n,r,i,u=>({key:"",value:u})).map(u=>u.value)}const YZ=new Set(["text","select","date"]),QZ=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function XZ(e,t,n,r){const i=n[r];if(e.type==="number")return typeof i=="number"?`${e.label??r} ${i.toLocaleString("en-US")}`:null;if(typeof i!="string"||i.trim()==="")return null;if(e.type==="date"){const a=new Date(`${i.slice(0,10)}T00:00:00Z`);return Number.isNaN(a.getTime())?i:QZ.format(a)}return Fs({kind:"field",field:r},t,n)}function WZ(e,t,n){const r=Nr(e,n);if(r.kind==="text")return r.text;const i=e.fields[r.field];if((i==null?void 0:i.type)==="address"){const c=en(t[r.field]),u=d0((c==null?void 0:c.street)??null,(c==null?void 0:c.unit)??null);return u!==""?u:n}const a=Fs(r,e,t);return a==="Untitled"?n:a}function JZ(e,t,n){const r=$n(e);if(r===null)return{title:n,supporting:null,image:null};const i=Nr(r,n),a=i.kind==="field"?i.field:null,c=Ps(r),u=c.find(([,m])=>m.type==="image"),f=a===null?-1:c.findIndex(([m])=>m===a),p=c.slice(f+1).filter(([,m])=>m.locked!==!0&&m.derived===void 0),y=m=>{for(const[x,v]of p){if(!m(v.type))continue;const _=XZ(v,r,t,x);if(_!==null)return _}return null};return{title:WZ(r,t,n),supporting:y(m=>YZ.has(m))??y(m=>m==="number"),image:u===void 0?null:{field:u[0],value:t[u[0]]??null}}}function eK(e){const t=e.split(/\s+/).filter(r=>/[\p{L}\p{N}]/u.test(r));return(t.length>1?[t[0][0],t[t.length-1][0]]:[...(t[0]??"").slice(0,2)]).join("").toUpperCase()}const tK="flex min-w-0 flex-1 items-center gap-[calc(12*var(--content))]",nK={bar:"size-[calc(32*var(--content))] rounded-[calc(7*var(--content))] text-[length:calc(12*var(--content))]",cell:"size-[calc(22*var(--content))] rounded-[calc(5*var(--content))] text-[length:calc(9.5*var(--content))]"},gT={bar:"text-[length:calc(15*var(--content))]",cell:"text-[length:calc(12.5*var(--content))]"},rK={bar:"text-[length:calc(13.5*var(--content))]",cell:"text-[length:calc(12*var(--content))]"};function ph({face:e,imageUrl:t,size:n="bar"}){return h.jsxs("span",{className:tK,"data-row-face":"",children:[e.image!==null&&h.jsx("span",{className:ce("relative grid shrink-0 place-items-center overflow-hidden bg-line-soft font-semibold text-ink-3",nK[n]),"data-row-face-thumb":"",children:t?h.jsx("img",{src:t,alt:"",className:"absolute inset-0 size-full object-cover object-top"}):eK(e.title)}),h.jsxs("span",{className:"flex min-w-0 items-baseline gap-[calc(8*var(--content))]",children:[h.jsx("span",{className:ce("min-w-0 shrink truncate font-medium text-ink",gT[n]),children:e.title}),e.supporting!==null&&h.jsx("span",{className:ce("min-w-0 shrink-[2] truncate text-ink-3",rK[n]),children:e.supporting})]})]})}function lo({children:e,size:t="bar"}){return h.jsx("span",{className:ce("min-w-0 flex-1 truncate text-ink-4",gT[t]),children:e})}const oK="flex w-full items-center gap-2.5 rounded-[calc(8*var(--content))] border border-line bg-white py-[calc(7*var(--content))] pl-[calc(10*var(--content))] pr-[calc(7*var(--content))] text-ink",ZE={contacts:"Contact",units:"Unit",comparables:"Comparable",commercial_spaces:"Commercial space"};function Su(e){return typeof e=="string"&&e!==""?e:null}function iK(e){const t=e==null?void 0:e.fieldKey;return e===void 0||t===void 0?[]:(e.siblingRecords??[]).flatMap((n,r)=>{if(r===e.itemIndex)return[];const i=Su(n[t]);return i===null?[]:[i]})}function sK({slot:e,value:t,onChange:n,onRowPick:r,recordContext:i,...a}){var _;const{TablePicker:c}=tn(),[u,f]=w.useState(null),p=a.rowTable??pd(e),y=p.kind==="table"&&p.inert!==!0?p.tables:null,m=!xl(e),x=(k,S)=>{k!==t&&(r?r(k,S):n(k))},v=IC(e.label);return h.jsxs("div",{className:As,role:"group","aria-label":e.label,children:[h.jsxs("div",{className:oK,children:[h.jsx(lw,{rowTable:p,value:t}),y!==null&&c!==void 0&&h.jsxs("span",{className:fR,children:[t!==null&&!bl(t)&&h.jsx(yT,{label:`Edit ${v}`,onClick:()=>f("record")}),m&&h.jsx(aK,{label:((_=jx(e).choose)==null?void 0:_.label)??ku("Choose",v),onClick:()=>f("pick")}),m&&t!==null&&h.jsx(qp,{icon:Tl,label:`Remove ${v}`,title:"Remove",tone:"remove",onClick:()=>x(null,{})})]})]}),u==="record"&&t!==null&&y!==null&&c!==void 0&&h.jsx(c,{open:!0,mode:"record",tables:y,rowId:t,onClose:()=>f(null)}),u==="pick"&&y!==null&&c!==void 0&&h.jsx(c,{open:!0,mode:"single",tables:y,selectedId:t,disabledIds:iK(i),onPick:x,onClose:()=>f(null)})]})}function yT({label:e,onClick:t}){return h.jsx(qp,{icon:W0,label:e,title:"Edit",onClick:t})}function aK({label:e,onClick:t}){return h.jsx(qp,{icon:JM.Choose,label:e,title:"Choose",onClick:t})}function lw({rowTable:e,value:t,size:n="bar"}){const{TableRowSummary:r}=tn();switch(e.kind){case"table":{if(bl(t))return h.jsx(ph,{face:{title:`New ${ZE[e.tables[0]].toLowerCase()}`,supporting:null,image:null},size:n});if(r)return h.jsx("span",{className:"flex min-w-0 flex-1",children:h.jsx(r,{tables:e.tables,rowId:t,size:n})});const i=ZE[e.tables[0]];return t===null?h.jsxs(lo,{size:n,children:["No ",i.toLowerCase()," chosen"]}):h.jsx(ph,{face:{title:i,supporting:null,image:null},size:n})}case"content":return t===null?h.jsx(lo,{size:n,children:"None"}):h.jsx(ph,{face:{title:e.labelOf(t)??"Untitled",supporting:null,image:null},size:n});case"none":return h.jsx(lo,{size:n,children:"Set automatically"})}}const lK={model:{defaultValue:null,coerce:Su,isEmpty:e=>e===null,isInvalid:()=>!1},faces:{compact:sK},applyOptimistic:null};function cK(e){var t,n,r,i;switch(DC(e,XR)){case"media":return((t=e.element)==null?void 0:t.type)==="media"?zy:((n=e.element)==null?void 0:n.type)==="video"?qP:((r=e.element)==null?void 0:r.type)==="tour"?ex:((i=e.element)==null?void 0:i.type)==="document"?zy:Jb;case"upload":return zy;case"poi":return w9;case"annotated-media":return Jb;case"object":case"row":return jP;case"scalar":return DN}}function Kp(e){switch(e.type){case"text":return l7;case"url":return X0;case"image":case"media":return Rp;case"video":return rx;case"tour":return ex;case"poi":return LN;case"address":return b9;case"document":return Mp;case"select":return A9;case"list":return cK(e);default:return K0}}function bT(e){const t=new Set(e.map(Kp));return t.size===1?[...t][0]:K0}const uK="relative flex flex-col gap-2",dK={large:"gap-3",compact:"gap-2"},fK="group/li flex touch-none items-center gap-2 rounded-[calc(8*var(--content))] border border-line bg-white px-2.75 transition-[border-color,box-shadow] duration-[120ms] hover:border-line-strong focus-within:border-accent",hK={field:"cursor-text",bar:"cursor-grab pr-2"},pK=ce(vt,"we-no-drag grid size-5.5 flex-shrink-0 place-items-center rounded-[calc(5*var(--content))] text-ink-3 transition-[background,color] duration-[120ms] hover:bg-[#FBE6E2] hover:text-[#8E2C1E]");function mK(e){const t=e.currentTarget.control;if(!t||e.target===t||e.target.closest("button")||(e.preventDefault(),t.focus(),!(t instanceof HTMLInputElement)))return;const r=e.clientX<t.getBoundingClientRect().left?0:t.value.length;t.setSelectionRange(r,r)}function cw({engine:e,itemKind:t="field",label:n,add:r,choose:i,size:a,renderControl:c,renderActions:u,onAdd:f,renderAdd:p,addUnbound:y=!1,empty:m}){const{rows:x,drag:v}=e,{containerRef:_,getItemProps:k}=v,S=p==null?void 0:p(e.add),j=x.length===0&&m!==void 0&&S==null;return h.jsx("div",{className:As,role:"group","aria-label":n,children:h.jsxs("div",{className:ce("flex flex-col",dK[a]),children:[e.canAdd&&h.jsx(od,{size:a,add:r,onAdd:y?null:()=>f(e.add),choose:i}),j&&m,S,x.length>0&&h.jsx("div",{className:uK,ref:_,children:x.map(O=>h.jsxs("label",{htmlFor:O.key,onClick:mK,...k(O.key),className:ce(fK,hK[t]),children:[h.jsx("span",{"aria-hidden":"true",className:"flex flex-shrink-0 cursor-grab items-center text-ink-4 transition-colors duration-[120ms] hover:text-ink-2",children:h.jsx(Mt.grip,{})}),c({id:O.key,value:O.value,onChange:A=>e.setValue(O.key,A)}),t==="bar"&&h.jsxs("span",{className:fR,children:[u==null?void 0:u({id:O.key,value:O.value}),e.canRemove&&h.jsx(qp,{icon:Tl,label:`Remove ${Rr(n).singular}`,title:"Remove",tone:"remove",onClick:()=>e.remove(O.key)})]}),e.canRemove&&t==="field"&&h.jsx("button",{type:"button",className:pK,title:"Remove",onClick:()=>e.remove(O.key),children:h.jsx(Mt.trash,{})})]},O.key))})]})})}function gK({engine:e,label:t,add:n,placeholder:r="List item",maxLength:i,size:a}){return h.jsx(cw,{engine:e,label:t,add:n,size:a,renderControl:({id:c,value:u,onChange:f})=>h.jsx(A7,{id:c,value:u,onChange:f,placeholder:r,ariaLabel:r,maxLength:i,className:ce("cursor-[inherit]",HN)}),onAdd:c=>c("")})}const yK="flex min-w-0 flex-1 cursor-[inherit] items-center gap-2.5 py-[calc(7*var(--content))] pl-[calc(2*var(--content))] text-ink",bK="relative h-[calc(280*var(--frame))]",vK=5,xK=ce("flex items-center gap-2 rounded-[calc(8*var(--content))] px-2.75 py-[calc(7*var(--content))] pr-2",ix),wK=ce("block size-[calc(13*var(--content))] rounded-[calc(3*var(--content))]",Mn),KE=["w-[28%]","w-[22%]","w-[34%]"];function kK({position:e}){return h.jsxs("div",{className:xK,children:[h.jsx("span",{className:"grid w-3.5 shrink-0 place-items-center",children:h.jsx("span",{className:ce("block h-[calc(14*var(--content))] w-[calc(6*var(--content))] rounded-full",Mn)})}),h.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-[calc(12*var(--content))] pl-[calc(2*var(--content))]",children:[h.jsx("span",{className:ce("block size-[calc(32*var(--content))] shrink-0 rounded-[calc(7*var(--content))]",Mn)}),h.jsx("span",{className:ce("block h-[calc(10*var(--content))] rounded-full",Mn,KE[e%KE.length])}),h.jsx("span",{className:ce("block h-[calc(8*var(--content))] w-[16%] rounded-full",Mn)})]}),[0,1].map(t=>h.jsx("span",{className:"grid h-[calc(36*var(--content))] w-[calc(36*var(--content))] shrink-0 place-items-center",children:h.jsx("span",{className:wK})},t))]})}function _K(e){return Su(typeof e=="object"&&e!==null?e.id:e)}function SK({slot:e,face:t,rowTable:n,verbs:r,fixed:i,value:a,commit:c}){const{TablePicker:u,TableCreate:f}=tn(),p=Oi({items:a.map(_K),fixed:i,axis:"y",commit:c}),[y,m]=w.useState(!1),[x,v]=w.useState(!1),[_,k]=w.useState(null),S=n.kind==="table"&&n.inert!==!0?n.tables:null,j=S!==null?u:void 0,O=S!==null?f:void 0,A=Rr(e.label).singular,$=()=>m(!0),C=j!==void 0&&r.choose!==null?{choose:r.choose,onChoose:$}:void 0,I=r.add,z=()=>v(!0),T=O!==void 0,F=p.rows.flatMap(G=>G.value!==null?[G.value]:[]),W=t==="expanded"&&p.rows.length===0?uT(e):null;return h.jsxs(h.Fragment,{children:[h.jsx(cw,{engine:p,itemKind:"bar",label:e.label,add:I,...C!==void 0?{choose:C}:{},size:t==="expanded"?"large":"compact",addUnbound:!T,onAdd:z,...t==="expanded"?{empty:h.jsxs("div",{className:bK,children:[h.jsx(rd,{className:"flex flex-col gap-2",children:Array.from({length:vK},(G,H)=>h.jsx(kK,{position:H},H))}),h.jsx($h,{icon:ci.createElement(Kp(e),{size:25,strokeWidth:1.8}),headline:I.empty,...W!==null?{line:W}:{}})]})}:{},renderControl:({id:G,value:H})=>h.jsx("div",{id:G,className:yK,children:h.jsx(lw,{rowTable:n,value:H})}),renderActions:({value:G})=>j!==void 0&&G!==null&&h.jsx(yT,{label:`Edit ${A}`,onClick:()=>k(G)})}),_!==null&&j!==void 0&&S!==null&&h.jsx(j,{open:!0,mode:"record",tables:S,rowId:_,onClose:()=>k(null)}),x&&O!==void 0&&S!==null&&h.jsx(O,{tables:S,onCreated:G=>{v(!1),p.rows.some(H=>H.value===G)||p.add(G)},onClose:()=>v(!1)}),y&&j!==void 0&&S!==null&&h.jsx(j,{open:!0,mode:"multi",tables:S,selectedIds:F,onChange:G=>p.replace(Il(p.rows,G.map(H=>({id:H})),H=>H,H=>H.id,p.mint)),onClose:()=>m(!1)})]})}const EK=12;function jK(e,t,n,r){if(e.top>=r&&e.bottom<=t-r)return null;const a=Math.max(0,n+e.top-r);return Math.abs(a-n)<1?null:a}function OK({icon:e,title:t,subtitle:n,showGrip:r=!1,open:i,adornment:a}){return h.jsxs(h.Fragment,{children:[r?h.jsx("span",{"aria-hidden":"true",className:"-mr-1 flex flex-shrink-0 cursor-grab items-center text-ink-4 transition-colors duration-[120ms] hover:text-ink-2 active:cursor-grabbing",children:h.jsx(jt,{name:"grip",size:14,stroke:1.8})}):null,h.jsx("span",{className:"grid size-6.5 flex-shrink-0 place-items-center rounded-md bg-accent-soft text-accent-ink","aria-hidden":"true",children:e}),n?h.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-px",children:[h.jsx("span",{className:"truncate text-[length:calc(13.5*var(--content))] font-medium text-ink-2",children:t}),h.jsx("span",{className:"truncate text-[length:calc(11.5*var(--content))] text-ink-3 [font-variant-numeric:tabular-nums]",children:n})]}):h.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-[length:calc(13.5*var(--content))] font-medium text-ink-2",children:t}),a,h.jsx(AK,{open:i})]})}function AK({open:e}){return h.jsx("span",{"data-acc-open":e,className:"grid flex-shrink-0 place-items-center text-ink-3 transition-transform duration-150 ease-[ease] data-[acc-open=true]:rotate-180","aria-hidden":"true",children:h.jsx(jt,{name:"chevDown",size:14,stroke:1.8})})}const Vc=new WeakSet;function vT({open:e,onToggle:t,icon:n,title:r,subtitle:i,scrollKey:a,dragId:c,dragHandleProps:u,adornment:f,children:p}){const y=w.useRef(null);return w.useEffect(()=>{if(!e)return;const m=y.current,x=m==null?void 0:m.closest(".hp-sb-scroll");if(!m||!x||Array.from(m.querySelectorAll(".we-acc")).some(O=>Vc.has(O)))return;Vc.add(m);const v=window.matchMedia("(prefers-reduced-motion: reduce)").matches,_=()=>{Vc.delete(m);const O=m.getBoundingClientRect(),A=x.getBoundingClientRect(),$=jK({top:O.top-A.top,bottom:O.bottom-A.top,height:O.height},x.clientHeight,x.scrollTop,EK);$!=null&&x.scrollTo({top:$,behavior:v?"auto":"smooth"})};if(v){const O=requestAnimationFrame(_);return()=>{cancelAnimationFrame(O),Vc.delete(m)}}const k=new AbortController,S=()=>{k.abort(),window.clearTimeout(j),_()};m.addEventListener("transitionend",O=>{O.propertyName==="grid-template-rows"&&O.target instanceof Node&&O.target.parentNode===m&&S()},{signal:k.signal});const j=window.setTimeout(S,280);return()=>{k.abort(),window.clearTimeout(j),Vc.delete(m)}},[e,a]),h.jsxs("div",{ref:y,"data-open":e,"data-dragid":c,className:ce("we-acc flex-shrink-0 overflow-hidden rounded border border-line bg-canvas","origin-center [transform:scale(var(--gx,1),var(--gy,1))] [will-change:transform]","[transition:transform_.18s_cubic-bezier(.34,1.56,.64,1),box-shadow_.18s_ease,border-color_.16s_ease]","has-[>.we-acc-head:hover]:shadow-[0_4px_14px_-6px_rgba(20,24,15,0.18)]","has-[>.we-acc-head:active]:[transition-duration:.08s]","motion-reduce:[transform:none] motion-reduce:[transition:box-shadow_.18s_ease,border-color_.16s_ease]"),children:[h.jsx("button",{type:"button",className:ce("we-acc-head flex w-full cursor-pointer appearance-none items-center gap-2.5 border-0 bg-transparent pr-3.5 py-3 text-left outline-none",u?"pl-2":"pl-3.5",u&&"touch-none"),onClick:t,onPointerDown:u==null?void 0:u.onPointerDown,"aria-expanded":e,children:h.jsx(OK,{icon:n,title:r,subtitle:i,showGrip:u!=null,open:e,adornment:f})}),h.jsx("div",{"data-acc-open":e,className:"grid grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out data-[acc-open=true]:grid-rows-[1fr] motion-reduce:transition-none",inert:!e,children:h.jsx("div",{className:"min-h-0 overflow-hidden",children:h.jsx("div",{"data-acc-open":e,className:"bg-white px-3.5 pb-4 pt-2 opacity-0 transition-opacity duration-200 ease-out data-[acc-open=true]:opacity-100 motion-reduce:transition-none",children:p})})})]})}function GE(e){return $C(e)}function CK(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n+1];GE(e[n])&&r!==void 0&&GE(r)?(t.push({kind:"pair",indices:[n,n+1]}),n++):t.push({kind:"single",index:n})}return t}function NK({items:e,rows:t}){const n=r=>r&&h.jsxs("div",{className:`${As} min-w-0`,...r.attrs,children:[r.label!==null?h.jsx(O7,{children:r.label}):null,r.node]},r.key);return h.jsx("div",{className:x7,children:t.map(r=>r.kind==="pair"?h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n(e[r.indices[0]]),n(e[r.indices[1]])]},`p${r.indices[0]}`):h.jsx("div",{children:n(e[r.index])},`s${r.index}`))})}const MK='input, textarea, select, button, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]',Zh="data-field-name",uw="data-field-scope";function RK(e,t){var r;const n=(r=e.parentElement)==null?void 0:r.closest(`[${uw}]`);return n==null||n===t||!t.contains(n)}function xT(e,t){var r;const n=Array.from(e.querySelectorAll(`[${Zh}]`)).find(i=>i.getAttribute(Zh)===t&&RK(i,e));n&&(n.scrollIntoView({block:"nearest"}),(r=n.querySelector(MK))==null||r.focus({preventScroll:!0}))}function TK(e){const t={fields:Object.fromEntries(e)};return e.filter(([,n])=>wl(n,t)&&!RA(n))}const $K="data-object-fields";function dw({fields:e,lone:t=!1,reveal:n,renderField:r}){const i=mx(),a=TK(e),c=w.useRef(null);return w.useEffect(()=>{if(!n)return;const u=requestAnimationFrame(()=>{c.current&&xT(c.current,n)});return()=>cancelAnimationFrame(u)},[n]),h.jsx("div",{ref:c,[$K]:i,[uw]:"",children:h.jsx(NK,{rows:CK(a.map(([,u])=>u)),items:a.map(([u,f])=>({key:u,label:t?null:f.label||u,attrs:{[Zh]:u},node:r(u,f)}))})})}function Bl({slot:e,instanceId:t,slotId:n,value:r,propertyId:i,onChange:a,required:c,overridden:u,selectedItemIndex:f,selectedFieldName:p,itemBaseline:y,boundRowId:m,boundRowTable:x,membership:v,rowTable:_,onRowPick:k,onUpload:S,recordContext:j,factPath:O}){const A=mx(),$=T7(e.type==="list"?void 0:O),C=Bs(e.type);if(!C)return null;const I=CB(A),z=C.faces[I];if(!z)return null;const T=C.model.coerce(r),F=h.jsx(z,{slot:e,instanceId:t,slotId:n,value:T,onChange:a,required:c,propertyId:i,selectedItemIndex:f,selectedFieldName:p,overridden:u,itemBaseline:y,boundRowId:m,boundRowTable:x,membership:v,rowTable:_,onRowPick:k,onUpload:S,recordContext:j,factPath:O});return $===null?F:h.jsxs("div",{className:"flex flex-col gap-[calc(6*var(--content))]",children:[F,h.jsx($7,{mark:$})]})}const zK=ce(vt,"inline-flex items-center gap-1.75 self-start h-9 px-3 rounded-lg text-body font-medium text-danger transition-[background,color] duration-[120ms] hover:bg-danger/15 focus-visible:bg-danger/15 focus-visible:ring-2 focus-visible:ring-danger/25"),DK="relative flex flex-col gap-3";function LK(e,t){return xl(e)?t:pd(e)}function IK({slot:e,entries:t,fixed:n,instanceId:r,slotId:i,value:a,commit:c,membership:u,verbs:f,selectedItemIndex:p,selectedFieldName:y,itemBaseline:m,rowTable:x,insideRecord:v=!1,factPath:_}){var Ri;const{TablePicker:k,TableCreate:S}=tn(),j=bT(t.map(([,ke])=>ke)),O=mi(ke=>ke.session.property_id),A=mi(ke=>ke.select),$=mi(ke=>{var Le,Je;return(Je=(Le=ke.content_doc)==null?void 0:Le.instances.find(gt=>gt.instance_id===r))==null?void 0:Je.slot_overrides}),C=u.kind==="table"?u.table:null,I=tT({instanceId:r,slotId:i,membership:u,itemBaseline:m,insideRecord:v}),{identityKey:z}=I,T=$n(e)??{fields:Object.fromEntries(t)},F=ed(Rr(e.label).singular),{add:W}=f,G=(ke,Le)=>Fs(Nr(T,`${F} ${Le+1}`),T,ke),H=Nr(T,""),U=H.kind==="field"?H.field:void 0,[D,K]=w.useState(!1),[M,B]=w.useState(!1),[X,se]=w.useState(null);function J(ke){A({kind:"slot",instance_id:r,slot_id:i,item_index:ke})}const P=w.useRef(null),Y=Oi({items:a,identityOf:I.identityOf,fixed:n,axis:"y",commit:(ke,Le)=>{I.markOrder(ke),c(I.stamp(ke),Le)},onCommitted:(ke,Le)=>{const Je=P.current;if(v||Le!=="reorder"&&Le!=="replace"||Je==null)return;const gt=ke.findIndex(lt=>lt.key===Je);gt<0?A({kind:"slot",instance_id:r,slot_id:i}):(Le==="reorder"||gt!==Y.indexOf(Je))&&J(gt)}}),{rows:L}=Y,Z=v?X:p!=null?Y.keyAt(p):null,ne=Z!=null?Y.indexOf(Z):-1;w.useEffect(()=>{P.current=Z},[Z]);function fe(ke){if(v){se(ke);return}const Le=Y.indexOf(ke);Le<0||J(Le)}function de(){v?se(null):A({kind:"slot",instance_id:r,slot_id:i})}function pe(ke){Z===ke?de():fe(ke)}const N=u.kind==="pick-row"||u.kind==="table"?Wx(u):null,ee=Y.canAdd&&(u.kind!=="pick-row"||S!==void 0),le=f.choose!==null&&Y.canAdd&&(N!==null&&k!==void 0||u.kind==="pick-media"),xe=(Ri=t.find(([,ke])=>xl(ke)))==null?void 0:Ri[0];function _e(ke){const Le=Y.mint(ke);Y.insert(Le),v?se(Le.key):J(0)}function Oe(){le&&K(!0)}function be(){if(ee){if(u.kind==="pick-row"){B(!0);return}if(u.kind==="pick-media"){K(!0);return}_e(C?{...qa(t),[z]:hR()}:qa(t))}}function Te(ke,Le){Y.replace(mT(L,t,z,ke,Le,Y.mint))}function tt(ke,Le){const Je=qa(t);for(const[gt,lt]of t)xl(lt)&&(Je[gt]=lt.type==="image"?Sx(ke,{file:"",url:"",alt:""},Le,FC(lt.crop),u.kind==="pick-media"?u.filter.from:void 0):{file:ke.file,url:gl(ke),alt:""});return Je}function Ne(ke){var Je;const Le=xe===void 0||(Je=ke[xe])==null?void 0:Je.file;return typeof Le=="string"&&Le!==""?Le:null}function Ve(ke,Le){const Je=Il(L,ke,Ne,lt=>tt(lt,Le),Y.mint),gt=new Set(Je.map(lt=>lt.key));for(const lt of L)gt.has(lt.key)||I.markRemoved(lt);Y.replace(Je)}function it(ke){if(!Y.canRemove)return;const Le=L.find(gt=>gt.key===ke);Le&&I.markRemoved(Le);const Je=Y.indexOf(ke);Y.remove(ke),Z===ke?de():!v&&ne>=0&&Je>=0&&Je<ne&&J(ne-1)}function It(ke,Le,Je={}){const gt=L.find(lt=>lt.key===ke);gt!=null&&(I.markFields(gt,Le),Y.setValue(ke,{...gt.value,...Je,...Le}))}function zt(ke,Le,Je,gt){const lt=L.find(nn=>nn.key===ke);if(lt==null)return;const Ut=I.markerIdentity(lt),yt=Je===null?{}:hT(t,Le,gt);if(Ut!==null)for(const nn of Object.keys(yt))FZ($,i,Ut,nn)&&delete yt[nn];It(ke,{[Le]:Je},yt)}const{containerRef:$r,getItemProps:xt,draggingKey:jo}=Y.drag,qs=le&&f.choose!==null?{choose:f.choose,onChoose:Oe}:void 0;return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(od,{size:"compact",add:W,onAdd:ee?be:null,choose:qs}),L.length>0&&h.jsx("div",{ref:$r,className:DK,children:L.map((ke,Le)=>{const Je=G(ke.value,Le),gt=Z===ke.key;return h.jsx("div",{children:h.jsx(vT,{open:jo==null&>,onToggle:()=>pe(ke.key),icon:h.jsx(j,{size:14}),title:Je,scrollKey:ke.key,dragId:ke.key,dragHandleProps:{onPointerDown:xt(ke.key).onPointerDown},children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsx(dw,{fields:t,reveal:!v&>?y:void 0,renderField:(lt,Ut)=>h.jsx(Bl,{slot:Ut,instanceId:r,slotId:i,value:ke.value[lt],propertyId:O,onChange:yt=>It(ke.key,{[lt]:yt}),...KN(Ut.type)?{factPath:wu(pl(_,ke.value),lt)}:{},...fT(Ut)?{rowTable:LK(Ut,x),onRowPick:(yt,nn)=>zt(ke.key,lt,yt,nn)}:{},recordContext:{...C?{itemId:Hh(ke.value,z)??void 0}:{},itemIndex:Le,siblingRecords:L.map(yt=>yt.value),fieldKey:lt,table:C,...U?{titleKey:U}:{},membership:u}})}),gt&&Y.canRemove&&h.jsxs("button",{type:"button",className:ce(zK,"max-w-full"),onClick:()=>it(ke.key),children:[h.jsx("span",{className:"inline-flex shrink-0",children:h.jsx(Mt.trash,{size:13})}),h.jsxs("span",{className:"min-w-0 truncate",children:["Delete ",Je]})]})]})})},ke.key)})}),M&&N!==null&&S!==void 0&&h.jsx(S,{tables:N,onCreated:(ke,Le)=>{B(!1),Vh(L.map(Je=>Je.value),t,z).includes(ke)||_e(aw(t,z,ke,Le))},onClose:()=>B(!1)}),D&&N!==null&&k&&h.jsx(k,{open:!0,mode:"multi",tables:N,selectedIds:Vh(L.map(ke=>ke.value),t,z),onChange:Te,onClose:()=>K(!1)}),D&&u.kind==="pick-media"&&h.jsx(Ux,{propertyId:O,children:ke=>h.jsx(dd,{mode:"multi",propertyId:O,filter:u.filter,selectedIds:L.flatMap(Le=>Ne(Le.value)??[]),onChange:Le=>Ve(Le,ke),onClose:()=>K(!1)})})]})}function YE(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label,...e.icon!==void 0?{icon:e.icon}:{},...e.description!==void 0?{description:e.description}:{}}}function wT(e){var n;if(e.values)return e.values.map(YE);const t=((n=e.source)==null?void 0:n.kind)==="home"?e.source.key:void 0;return t===void 0?[]:(C8(t)??[]).map(YE)}function su(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}const kT=["home","building","apartments","trendUp","tag","key","template","palette","filePen","library","plug","helpCircle","lock","creditCard","settings","power","user","plus","globe","image","fileText","users","eye","eyeOff","pulse","search","chart","layout","chevDown","chevRight","chevSelector","pencil","dots","grip","external","copy","trash","archive","sparkle","arrowUp","arrowDown","arrowLeft","arrowRight","undo","redo","logout","check","x","clock","calendar","mapPin","userPlus","mail","phone","share","upload","bookOpen","newspaper","presentation","instagram","facebook","linkedin","xLogo"],UK=new Set(kT);function _T(e){return typeof e=="string"&&UK.has(e)}const PK="fixed overflow-y-auto rounded-[calc(8*var(--content))] border border-line bg-white shadow-[0_16px_38px_-12px_rgba(20,18,13,0.4)]",ST=ce(vt,"flex w-full items-center justify-between gap-2 rounded-none px-2.5 py-2 text-left text-body text-ink hover:bg-accent-soft data-[active=true]:bg-accent-soft"),FK=ce(ST,"text-accent"),BK=4,QE=160,XE=240,HK=ce(vt,HN,"min-w-0 flex-1 cursor-text bg-transparent text-left text-ink outline-none placeholder:text-ink-4");function WE({open:e,className:t,onMouseDown:n}){return h.jsx("span",{className:ce("flex flex-shrink-0 items-center text-ink-4 transition-transform duration-[120ms]",e&&"rotate-180",t),onMouseDown:n,"aria-hidden":"true",children:h.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"m6 9 6 6 6-6"})})})}function qK(){return h.jsx("svg",{className:"flex-shrink-0 text-ink-2",width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 8.5l3 3 6-6.5"})})}function VK({option:e}){const t=_T(e.icon)?e.icon:null;return t===null&&e.description===void 0?h.jsx("span",{className:"truncate",children:e.label}):h.jsxs("span",{className:"flex min-w-0 items-start gap-2",children:[t!==null&&h.jsx(jt,{name:t,size:15,stroke:1.7,className:"mt-[calc(2*var(--content))] text-ink-3"}),h.jsxs("span",{className:"flex min-w-0 flex-col",children:[h.jsx("span",{className:"truncate",children:e.label}),e.description!==void 0&&h.jsx("span",{className:"text-caption leading-[1.35] text-ink-3",children:e.description})]})]})}function ZK(e,t){const n=t.toLowerCase().trim();return n?e.filter(r=>r.label.toLowerCase().includes(n)):e}function KK(e,t){const n=su(t);if(n.length!==0)return e.find(r=>su(r.value)===n||su(r.label)===n)}function hv({label:e,value:t,options:n,onChange:r,placeholder:i,bare:a=!1,autoOpen:c=!1,onDismiss:u,id:f,creatable:p=!1,canCreate:y,attention:m=null}){const x=Ci(),[v,_]=w.useState(c),[k,S]=w.useState(0),[j,O]=w.useState(null),[A,$]=w.useState(""),C=w.useId(),I=w.useRef(null),z=w.useRef(null),T=w.useRef(null),F=n.findIndex(N=>N.value===t),W=F>=0?n[F]:void 0,G=ZK(n,v?A:""),H=A.trim(),U=v?KK(n,A):void 0,D=U&&!G.some(N=>N.value===U.value)?[...G,U]:G,K=p&&H.length>0&&!U&&((y==null?void 0:y(H))??!0),M=D.length+(K?1:0);function B(){T.current&&O(_s(T.current)),S(Math.max(0,F)),_(!0)}const X=w.useCallback(()=>{_(!1),$(""),u==null||u()},[u]);function se(N){var ee;N.value!==t&&r(N.value),_(!1),$(""),(ee=z.current)==null||ee.focus()}function J(N){var ee;r(N),_(!1),$(""),(ee=z.current)==null||ee.focus()}function P(N){var ee;if(!v){(N.key==="ArrowDown"||N.key==="Enter"||N.key===" ")&&(N.preventDefault(),B());return}if(N.key==="Escape")N.preventDefault(),(ee=z.current)==null||ee.focus(),X();else if(N.key==="ArrowDown")N.preventDefault(),S(le=>Math.min(M-1,le+1));else if(N.key==="ArrowUp")N.preventDefault(),S(le=>Math.max(0,le-1));else if(N.key==="Enter")if(N.preventDefault(),k<D.length){const le=D[k];le&&se(le)}else K&&J(H)}const Y=w.useCallback(N=>{var xe,_e;const ee=(xe=I.current)==null?void 0:xe.contains(N),le=(_e=document.getElementById(C))==null?void 0:_e.contains(N);return!ee&&!le},[C]);function L(N){v&&Y(N.relatedTarget)&&X()}w.useEffect(()=>{var N;c&&((N=z.current)==null||N.focus())},[c]),w.useEffect(()=>{if(!v)return;const N=()=>{T.current&&O(_s(T.current))};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[v]),w.useEffect(()=>{if(!v)return;const N=ee=>{Y(ee.target)&&X()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[v,Y,X]);const Z=N=>{N.preventDefault(),v||B()},ne=h.jsx("input",{ref:z,id:f,className:a?HK:ce(x.inner,"cursor-text"),value:v?A:(W==null?void 0:W.label)??t,placeholder:i??"",role:"combobox","aria-haspopup":"listbox","aria-expanded":v,"aria-controls":C,"aria-label":e,onFocus:B,onClick:()=>{v||B()},onChange:N=>{$(N.target.value),v||B(),S(0)},onKeyDown:P}),fe=a?h.jsxs(h.Fragment,{children:[ne,h.jsx(WE,{open:v,className:"pl-2",onMouseDown:Z})]}):h.jsxs(h.Fragment,{children:[ne,h.jsx(WE,{open:v,className:"pl-1 pr-2.75",onMouseDown:Z})]}),de=v&&j?Cl(j,{maxHeight:XE*2,minWidth:QE,gap:BK}):null,pe=v&&de&&M>0?Tr.createPortal(h.jsxs("div",{className:PK,id:C,role:"listbox",style:{left:de.left,top:de.top,bottom:de.bottom,minWidth:Math.max(de.width,QE),maxHeight:`min(${de.maxHeight}px, calc(${XE}*var(--content)))`,zIndex:vi},children:[D.map((N,ee)=>h.jsxs("button",{type:"button",role:"option","aria-selected":N.value===t,"data-active":ee===k,className:ST,onMouseEnter:()=>S(ee),onMouseDown:le=>le.preventDefault(),onClick:()=>se(N),children:[h.jsx(VK,{option:N}),N.value===t&&h.jsx(qK,{})]},N.value)),K&&h.jsx("button",{type:"button",role:"option","aria-selected":k===D.length,"data-active":k===D.length,className:FK,onMouseEnter:()=>S(D.length),onMouseDown:N=>N.preventDefault(),onClick:()=>J(H),children:h.jsxs("span",{className:"truncate",children:["Create “",H,"”"]})})]}),document.body):null;return a?h.jsxs("div",{className:"flex min-w-0 flex-1 items-center",ref:N=>{I.current=N,T.current=N},onBlurCapture:L,children:[fe,pe]}):h.jsxs("div",{className:x.frame,ref:I,onBlurCapture:L,children:[h.jsx(Ns,{attention:m,className:v?"border-accent":void 0,ref:T,children:fe}),pe]})}function GK({engine:e,label:t,add:n,options:r,unique:i=!1,creatable:a=!1,size:c}){const[u,f]=w.useState(!1),p=e.rows.map(_=>_.value),y=_=>i?r.filter(k=>k.value===_||!p.includes(k.value)):r,m=y(null),x=_=>!i||!p.some(k=>su(k)===su(_)),v=m.length>0?m:r;return h.jsx(cw,{engine:e,label:t,add:n,size:c,renderControl:({id:_,value:k,onChange:S})=>h.jsx(hv,{bare:!0,id:_,label:t,value:k,options:y(k),onChange:S,creatable:a,canCreate:x}),onAdd:()=>f(!0),renderAdd:_=>u?h.jsx(hv,{bare:!0,autoOpen:!0,label:n.label,value:"",placeholder:"Choose one",options:v,onDismiss:()=>f(!1),onChange:k=>{f(!1),x(k)&&_(k)},creatable:a,canCreate:x}):null})}function YK({slot:e,itemSlot:t,add:n,fixed:r,value:i,commit:a,size:c}){const u=Oi({items:i,fixed:r,axis:"y",commit:a});return t.type==="select"?h.jsx(GK,{engine:u,label:e.label,add:n,options:wT(t),creatable:t.creatable===!0,unique:e.unique===!0,size:c}):h.jsx(gK,{engine:u,label:e.label,add:n,maxLength:t.cap,size:c})}const JE="grid size-[calc(18*var(--content))] shrink-0 place-items-center border-[1.5px] bg-canvas transition-[border-color,background-color] duration-[120ms]";function QK({control:e,state:t,label:n,onToggle:r}){return h.jsx("button",{type:"button",role:e,"aria-checked":t.checked,"aria-label":n,disabled:t.disabled,className:ce(vt,"flex w-full items-center justify-center",t.disabled?"cursor-not-allowed":"cursor-pointer"),onClick:i=>{i.stopPropagation(),r()},children:e==="radio"?h.jsx("span",{"aria-hidden":"true",className:ce(JE,"rounded-full",t.checked?"border-ink":"border-ink-4"),children:t.checked&&h.jsx("span",{className:"size-[calc(8*var(--content))] rounded-full bg-ink"})}):h.jsx("span",{"aria-hidden":"true",className:ce(JE,"rounded-[calc(5*var(--content))]",t.checked?"border-ink bg-ink text-canvas":"border-ink-4 text-transparent"),children:h.jsx(bi,{className:"size-[calc(11*var(--content))]",strokeWidth:3})})})}function XK(e){return e.derived!==void 0}const WK=new Set(["image","video","tour","document","media"]);function JK(e){switch(e.type){case"number":return 96;case"date":case"select":return 140;case"phone":return 150;case"url":case"email":return 200;case"address":return 260;case"image":case"video":case"tour":case"document":case"media":return 88;case"text":return e.size==="medium"||e.size==="long"?220:160;case"list":case"poi":return 140}}function eG(e){const t=JK(e),n=WK.has(e.type),r=`calc(${t}*var(--content))`;return{track:n?r:`minmax(${r},${t/100}fr)`,minPx:t}}function tG(e,t){for(const n of["[].","[0].","."]){const r=`${e}${n}`;if(!t.startsWith(r))continue;const i=t.slice(r.length);return/^[a-z_]+$/.test(i)?i:null}return null}function ET(e,t,n){const r=a=>new Set(a.map(c=>tG(e,c)).filter(c=>c!==null)),i=r(n);return{used:new Set([...r(t),...i]),required:i}}function fw(e){const t=Object.entries(e.fields);return{used:new Set(t.map(([n])=>n)),required:new Set(t.filter(([,n])=>n.required===!0).map(([n])=>n))}}function jT(e){return e.reduce((t,n)=>t+n.minPx,0)}function nG(e,t,n=Number.POSITIVE_INFINITY){const r=$n(e);if(r===null)return[];const i=Nr(r,""),a=i.kind==="field"?i.field:null,c=[];for(const[y,m]of Ps(r)){if(XK(m)||m.locked===!0||!t.used.has(y))continue;const x=y===a,v=t.required.has(y),_={key:y,slot:m,header:m.label||y,required:v,title:x,...eG(m)};c.push({column:_,pinned:x||v})}let u=n-jT(c.filter(y=>y.pinned).map(y=>y.column)),f=!1;const p=[];for(const{column:y,pinned:m}of c)m?p.push(y):!f&&y.minPx<=u?(u-=y.minPx,p.push(y)):f=!0;return p}function OT(e){if(e===null||typeof e!="object")return null;const t=ld(e);if(t===null||t==="")return null;if(Gu(e)||xo(e))return{file:t,picked:t};const{kind:n,id:r,...i}=e;return{...i,file:t,...typeof n=="string"&&wn(n)?{kind:n}:{}}}function hw(){return{image:NR.model,video:zR.model,tour:RR.model,document:ZR.model}}const rG=nV({model:{defaultValue:null,coerce:OT,isEmpty:e=>e===null||e.file==="",isInvalid:()=>!1},models:hw}),oG=ce(vt,"inline-flex self-stretch w-auto max-w-full min-w-0 cursor-pointer items-center gap-[calc(10*var(--content))] rounded-[calc(7*var(--content))] border px-[calc(11*var(--content))]","text-[length:calc(12.5*var(--content))] font-medium transition-[background,border-color,color] duration-[120ms]","data-[empty]:border-dashed data-[empty]:text-ink-3 hover:data-[empty]:border-ink-4 hover:data-[empty]:text-ink-2","border-line text-ink-2 hover:border-ink-4 disabled:cursor-default",zl),iG="inline-flex size-[calc(16*var(--content))] shrink-0 items-center justify-center opacity-80",sG="min-w-0 truncate";function Gp({slot:e,reading:t,readingText:n,attention:r,scope:i,onOpen:a}){const c=Ul(),u=t===null,f=u?Pp(e,i):null,p=f!==null?tR(f):null,y=p!==null?p.label:n!==void 0?`${e.label}: ${n}`:`Open ${e.label}`;return h.jsxs("button",{type:"button",className:oG,"data-summary-pill":e.type,"data-empty":u?"":void 0,...Dl(r,c),"aria-label":y,disabled:a===void 0,onClick:a,children:[h.jsx("span",{className:iG,children:ci.createElement(p!==null?p.icon:Kp(e),{size:14})}),h.jsx("span",{className:sG,children:u?e.label:t})]})}function Yp({slot:e,value:t,required:n}){const r=Bs(e.type);return r===null?null:Ai(r.model,e,r.model.coerce(t),n??!1)}function aG(e){var n;const t=Array.isArray(e.value)?e.value.length:0;return h.jsx(Gp,{slot:e.slot,reading:t===0?null:`${t} ${e.slot.label}`,readingText:String(t),attention:Yp(e),scope:{table:((n=e.recordContext)==null?void 0:n.table)??null},onOpen:e.onOpen})}function lG(e){const t=PR.coerce(e.value),n=d0((t==null?void 0:t.street)??null,(t==null?void 0:t.unit)??null),r=[t==null?void 0:t.city,t==null?void 0:t.state,(t==null?void 0:t.postal)==null?null:f0(t.postal)].filter(Boolean).join(", "),i=n!==""?n:r!==""?r:null;return h.jsx(Gp,{slot:e.slot,reading:i,readingText:i??void 0,attention:Yp(e)??(UR(t)?"required":null),onOpen:e.onOpen})}function cG(e){const t=Jx(e.value);return h.jsx(Gp,{slot:e.slot,reading:(t==null?void 0:t.name)??null,readingText:t==null?void 0:t.name,attention:Yp(e),onOpen:e.onOpen})}function uG(e){const t=Su(e.value);return h.jsx(Gp,{slot:e.slot,reading:t===null?null:h.jsx(lw,{rowTable:pd(e.slot),value:t,size:"cell"}),attention:Yp(e),onOpen:e.onOpen})}function Kf(e){const t=e.slot.type,n=Bs(t).model;return h.jsx(_R,{kind:t,model:n,onOpen:e.onOpen,props:{slot:e.slot,instanceId:e.instanceId,slotId:e.slotId,value:n.coerce(e.value),onChange:e.onChange,required:e.required,propertyId:e.propertyId,recordContext:e.recordContext,factPath:e.factPath}})}function dG(e){const t=Bs("media").model;return h.jsx(eV,{models:hw(),onOpen:e.onOpen,props:{slot:e.slot,instanceId:e.instanceId,slotId:e.slotId,value:t.coerce(e.value),onChange:e.onChange,required:e.required,propertyId:e.propertyId,recordContext:e.recordContext,factPath:e.factPath}})}const fG={list:aG,image:Kf,video:Kf,tour:Kf,document:Kf,media:dG,address:lG,poi:cG,row:uG};function hG(e){const n=fG[e.slot.type];return n?h.jsx(n,{...e}):null}const pw=24,AT=36,pG=36,mG=8,Hy=e=>`calc(${e}*var(--content))`,CT=ce(Pl,"flex flex-col gap-3"),NT="flex min-h-0 flex-1 flex-col overflow-hidden rounded-[calc(12*var(--content))] border border-line bg-canvas",gG="-mb-px min-h-0 flex-1 overflow-auto",yG="transition-[background-color,opacity] duration-100 hover:bg-[#fbfaf6] focus-within:bg-[#faf8f1]",mw="h-[calc(44*var(--content))]",Ji="flex min-w-0 items-stretch p-[calc(4*var(--content))]",bG=ce(Hp,Dx),vG="[data-table-cell] > *, input, textarea, select, button, a, [contenteditable], [role='button'], [role='checkbox'], [role='radio'], [tabindex]:not([tabindex='-1'])",gw="[:where(&)_:where([data-table-cell]>*,input,textarea,select,button,a,[contenteditable],[role=button],[role=checkbox],[role=radio],[tabindex]:not([tabindex='-1']))]:cursor-auto",xG=ce("cursor-grab",gw),wG=ce("cursor-pointer",gw),ej=e=>e.closest(vG)!==null,MT=11,Kh=["w-3/5","w-2/5","w-1/2","w-[70%]"],RT=ce("block h-[calc(9*var(--content))] rounded-full",Mn),kG=ce("block h-[calc(22*var(--content))] w-[calc(76*var(--content))] rounded-full",Mn),_G=ce("block size-[calc(13*var(--content))] rounded-[calc(3*var(--content))]",Mn);function TT(e){return mG+pG*(e?2:1)}function $T(e,t){return pw+(e?AT:0)+TT(t)}function SG(e,t,n){const r=TT(n),i=[Hy(pw),...t?[Hy(AT)]:[],...e.map(c=>c.track),Hy(r)],a=$T(t,n)+jT(e);return{style:{gridTemplateColumns:i.join(" "),minWidth:a},selection:t,actionsPx:r}}function EG({columns:e,layout:t,position:n,marks:r}){return h.jsxs("div",{className:ce("grid items-center border-b border-line-soft",mw),style:t.style,children:[h.jsx("span",{}),t.selection&&h.jsx("span",{}),e.map((i,a)=>h.jsx("span",{className:"min-w-0 px-[calc(18*var(--content))]",children:h.jsx("span",{className:O0(i.slot.type)?ce(RT,Kh[(n+a)%Kh.length]):kG})},i.key)),h.jsx("span",{className:"flex justify-end pr-[calc(4*var(--content))]",children:Array.from({length:r},(i,a)=>h.jsx("span",{className:"grid w-[calc(36*var(--content))] place-items-center",children:h.jsx("span",{className:_G})},a))})]})}const jG=3,OG=ce("grid items-center border-b border-line-soft","grid-cols-[calc(24*var(--content))_repeat(3,minmax(0,1fr))_calc(44*var(--content))]",mw);function AG(){return h.jsx("div",{className:CT,"data-table-pending":"",children:h.jsx("div",{className:NT,children:h.jsx("div",{className:"relative min-h-0 flex-1",children:h.jsx(rd,{children:Array.from({length:MT},(e,t)=>h.jsxs("div",{className:OG,children:[h.jsx("span",{}),Array.from({length:jG},(n,r)=>h.jsx("span",{className:"min-w-0 px-[calc(18*var(--content))]",children:h.jsx("span",{className:ce(RT,Kh[(t+r)%Kh.length])})},r)),h.jsx("span",{})]},t))})})})})}function CG(){const e=w.useRef(null),t=w.useRef(null),[n,r]=w.useState(Number.POSITIVE_INFINITY);return w.useLayoutEffect(()=>{const i=e.current;if(i===null||typeof ResizeObserver>"u")return;const a=()=>{var p;const u=((p=t.current)==null?void 0:p.getBoundingClientRect().width)??0,f=i.clientWidth;u<=0||f<=0||r(f/(u/pw))};a();const c=new ResizeObserver(a);return c.observe(i),()=>c.disconnect()},[]),{box:e,grip:t,widthPx:n}}const tj=new Set;function NG(e,t){const n=e[t];return typeof n=="string"&&n!==""?n:null}function qy(e,t,n){return e.rowId?e.rowId(t,n):NG(t,e.idKey)}function MG(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}const RG="input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])";function zT(e){return e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement?!["button","checkbox","radio","submit","reset","file","image","color","range"].includes(e.type):!1}function nj(e){return e instanceof HTMLSelectElement||e.getAttribute("aria-expanded")==="true"?!0:e instanceof HTMLInputElement&&["date","datetime-local","month","time","week","number","range"].includes(e.type)}function TG(e,t){if(!zT(e))return!0;let n,r;try{n=e.selectionStart,r=e.selectionEnd}catch{return!0}return n===null||r===null?!0:t==="start"?n===0&&r===0:n===e.value.length&&r===e.value.length}function $G(e){const{fields:t}=e;return t===null?h.jsx(AG,{}):h.jsx(zG,{...e,fields:t})}function zG({declaration:e,value:t,onChange:n,propertyId:r,instanceId:i="",slotId:a="",selection:c,onOpenRecord:u,onAdd:f,newRowStamp:p,fixed:y=!1,orderable:m=!0,add:x=jx(e).add,choose:v,factPath:_,fields:k}){const S=e,{itemContent:j}=WR(S,"expanded"),O=j.kind==="record"?j.entries:[],{box:A,grip:$,widthPx:C}=CG(),I=nG(S,k,C-$T(c!==void 0,u!==void 0)),z=$n(S),T=z?Nr(z,""):null,F=(T==null?void 0:T.kind)==="field"?T.field:void 0,W=SG(I,c!==void 0,u!==void 0),G=Array.isArray(t)?t.map(MG):[],H=Oi({items:G,fixed:y,axis:"y",commit:(N,ee)=>n(N.map(le=>le.value),ee)}),{drag:U}=H,D=H.rows,K=f!==null&&H.canAdd,M=D.map(N=>({key:N.key,index:H.indexOf(N.key),value:N.value})),B=M.length===0,X=B?uT(S):null,se=w.useRef(null);w.useLayoutEffect(()=>{const N=se.current;N&&(se.current=null,J(N.row,N.col))});function J(N,ee){var _e;const le=U.containerRef.current,xe=le==null?void 0:le.querySelector(`[data-table-cell][data-row="${N}"][data-col="${ee}"]`);(_e=xe==null?void 0:xe.querySelector(RG))==null||_e.focus()}function P(N,ee="top"){if(f){f();return}const le=ee==="top"?0:H.rows.length;se.current={row:le,col:N},H.add({...qa(O),...p==null?void 0:p()},le)}function Y(N,ee,le){H.updateValue(N,xe=>({...xe,[ee]:le}))}function L(N){if(N.defaultPrevented||N.altKey||N.ctrlKey||N.metaKey||N.nativeEvent.isComposing)return;const ee=N.target,le=ee.closest("[data-table-cell]");if(!le)return;const xe=Number(le.dataset.row),_e=Number(le.dataset.col),Oe=M.length-1;switch(N.key){case"Enter":{if(N.shiftKey||!zT(ee))return;N.preventDefault(),xe<Oe?J(xe+1,_e):K&&P(_e,"below");return}case"ArrowDown":case"ArrowUp":{if(nj(ee))return;const be=N.key==="ArrowDown"?xe+1:xe-1;if(be<0||be>Oe)return;N.preventDefault(),J(be,_e);return}case"ArrowLeft":case"ArrowRight":{if(nj(ee))return;const be=N.key==="ArrowLeft",Te=be?_e-1:_e+1;if(Te<0||Te>=I.length||!TG(ee,be?"start":"end"))return;N.preventDefault(),J(xe,Te);return}}}function Z(N){const ee=`${ed(Rr(e.label).singular)} ${N.index+1}`;if(!z||(T==null?void 0:T.kind)!=="field")return ee;const le=Fs(T,z,N.value);return le==="Untitled"?ee:le}const ne=c?c.control:null;function fe(N){if(!c)return null;const ee=qy(c,N.value,N.index);return ee===null?{checked:!1,disabled:!0}:Bp(c.ids,ee,c.held??tj)}function de(N){const ee=c?qy(c,N.value,N.index):null;if(!c||ee===null)return;const le=Rx(c.ids,ee,c.control,c.held??tj);le!==c.ids&&c.onChange(le)}function pe(N,ee){var tt;const le=fe(N),xe=U.getItemProps(N.key),_e=Z(N),Oe=pl(_,N.value),be=le!==null&&!le.disabled,Te=c?qy(c,N.value,N.index):null;return h.jsxs("div",{role:"row","data-dragid":xe["data-dragid"],"data-disabled":(le==null?void 0:le.disabled)||void 0,"data-upstream":Te!==null&&((tt=c==null?void 0:c.upstream)==null?void 0:tt.has(Te))||void 0,onPointerDown:m?Ne=>{ej(Ne.target)||xe.onPointerDown(Ne)}:void 0,onClick:be?Ne=>{ej(Ne.target)||de(N)}:void 0,className:ce("group/row grid items-stretch border-b border-line-soft data-[disabled=true]:opacity-50 data-[disabled=true]:focus-within:opacity-100",gx,mw,yG,be?wG:m?xG:gw),style:W.style,children:[h.jsx("div",{role:"cell",className:ce(Ji,"items-center justify-center"),children:m&&h.jsx("span",{"aria-hidden":"true",className:ce("flex w-full touch-none items-center justify-center","text-ink-4 opacity-0 transition-[opacity,color] duration-[120ms] group-hover/row:opacity-100 hover:text-ink-2","group-data-[drag-clone]/row:text-ink-2 group-data-[drag-clone]/row:opacity-100"),children:h.jsx(Q0,{className:"size-[calc(14*var(--content))]",strokeWidth:1.8})})}),ne&&h.jsx("div",{role:"cell",className:Ji,children:le&&h.jsx(QK,{control:ne,state:le,label:`Select ${_e}`,onToggle:()=>de(N)})}),I.map((Ne,Ve)=>h.jsx("div",{role:"cell","data-table-cell":"","data-row":ee,"data-col":Ve,"data-field":Ne.key,className:Ji,children:O0(Ne.slot.type)?h.jsx(Bl,{slot:Ne.slot,instanceId:i,slotId:a,propertyId:r,value:N.value[Ne.key],required:Ne.required,onChange:it=>Y(N.key,Ne.key,it),recordContext:{itemIndex:N.index,fieldKey:Ne.key,...F?{titleKey:F}:{}}}):h.jsx(hG,{slot:Ne.slot,instanceId:i,slotId:a,propertyId:r,value:N.value[Ne.key],required:Ne.required,onChange:it=>Y(N.key,Ne.key,it),recordContext:{itemIndex:N.index,fieldKey:Ne.key,...F?{titleKey:F}:{}},factPath:wu(Oe,Ne.key),onOpen:u?()=>u(N.index,Ne.key):void 0})},Ne.key)),h.jsxs("div",{role:"cell",className:ce(Ji,"justify-end"),children:[u&&h.jsx("button",{type:"button",className:Hp,"aria-label":`Open ${_e}`,onClick:()=>u(N.index),children:h.jsx(_9,{className:"size-[calc(13*var(--content))]"})}),H.canRemove&&h.jsx("button",{type:"button",className:bG,"aria-label":`Remove ${_e}`,onClick:()=>H.remove(N.key),children:h.jsx(Tl,{className:"size-[calc(13*var(--content))]"})})]})]},N.key)}return h.jsxs("div",{className:CT,children:[H.canAdd&&h.jsx(od,{size:"large",add:x,onAdd:K?()=>P(0):null,choose:v}),h.jsx("div",{className:NT,children:h.jsxs("div",{ref:A,className:ce(gG,B&&"flex flex-col"),role:"table","aria-rowcount":M.length+1,children:[h.jsxs("div",{role:"row",className:"sticky top-0 z-[1] grid items-stretch border-b border-line bg-canvas text-[length:calc(12*var(--content))] font-medium text-ink-3",style:W.style,children:[h.jsx("div",{ref:$,role:"columnheader",className:Ji}),W.selection&&h.jsx("div",{role:"columnheader",className:Ji}),I.map(N=>h.jsx("div",{role:"columnheader","data-field":N.key,className:"min-w-0 px-[calc(14*var(--content))] py-[calc(10*var(--content))]",children:h.jsx("span",{className:"block truncate",children:N.header})},N.key)),h.jsx("div",{role:"columnheader",className:Ji})]}),h.jsx("div",{ref:U.containerRef,className:"relative",onKeyDown:L,children:h.jsx(cd,{place:"cell",children:M.map((N,ee)=>pe(N,ee))})}),B&&h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx(rd,{children:Array.from({length:MT},(N,ee)=>h.jsx(EG,{columns:I,layout:W,position:ee,marks:(u?1:0)+(H.canRemove?1:0)},ee))}),h.jsx($h,{icon:ci.createElement(Kp(S),{size:25,strokeWidth:1.8}),headline:x.empty,...X!==null?{line:X}:{}})]})]})})]})}function DT(e,t){const{max:n}=e;if(typeof n=="number")return n;if(Zu(n)){const r=MA(n,{facts:t});return typeof r=="number"?r:null}return null}function DG(e,t){return DT(e,t)===1}function LT({object:e,row:t,reveal:n,withRecordContext:r=!1,onField:i,host:a,fieldProps:c}){const{fields:u}=a;return u===null?h.jsx(PG,{}):h.jsx(dw,{fields:Ps(e).filter(([f])=>u.used.has(f)),reveal:n,renderField:(f,p)=>h.jsx(Bl,{slot:p,instanceId:a.instanceId,slotId:`${a.slotId}.${f}`,propertyId:a.propertyId,value:t[f],required:u.required.has(f),onChange:y=>i(f,y),...KN(p.type)?{factPath:wu(a.factPath,f)}:{},...r?{recordContext:{fieldKey:f}}:{},...c==null?void 0:c(f,p)})})}const LG=5,IG=ce("block h-[calc(9*var(--content))] w-1/4 rounded-full",Mn),UG=ce("block h-[calc(40*var(--content))] w-full rounded-[calc(10*var(--content))]",ix);function PG(){return h.jsx("div",{className:"relative h-[calc(360*var(--content))]","data-record-pending":"",children:h.jsx(rd,{className:"flex flex-col gap-[calc(20*var(--content))]",children:Array.from({length:LG},(e,t)=>h.jsxs("span",{className:"flex flex-col gap-[calc(8*var(--content))]",children:[h.jsx("span",{className:IG}),h.jsx("span",{className:UG})]},t))})})}const FG=ce("relative z-[1] flex flex-shrink-0 items-center gap-[14px] py-3",BM);function BG(e){const{open:t,onClose:n}=e;return h.jsx(ox,{open:t,onClose:n,ariaLabel:e.fallbackTitle,className:ce(bx,oH),children:t?h.jsx(HG,{...e}):null})}function HG({object:e,row:t,fallbackTitle:n,onChange:r,onClose:i,propertyId:a,instanceId:c,slotId:u,factPath:f,fields:p,revealFieldName:y,fieldProps:m}){const x=Nr(e,n),v=Fs(x,e,t),_=v==="Untitled"?n:v,k=w.useRef(t);w.useEffect(()=>{k.current=t},[t]);const S=(j,O)=>{k.current={...k.current,[j]:O},r(k.current)};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:FG,children:[h.jsx("div",{className:xx,children:h.jsx("h2",{className:ce(wx,"truncate"),children:_})}),h.jsx(rR,{}),h.jsx("button",{type:"button",className:kx,"aria-label":"Close",onClick:i,children:h.jsx(Mt.x,{size:14})})]}),h.jsx("div",{className:ce("min-h-0 flex-1 overflow-y-auto py-[clamp(16px,1.2vw,28px)]",BM),children:h.jsx(cd,{place:"panel",children:h.jsx(LT,{object:e,row:t,reveal:y,withRecordContext:!0,onField:S,host:{propertyId:a,instanceId:c,slotId:u,factPath:f,fields:p},fieldProps:m})})})]})}function qG({object:e,row:t,onChange:n,propertyId:r,instanceId:i,slotId:a,factPath:c,fields:u}){return h.jsx(LT,{object:e,row:t,onField:(f,p)=>n({...t,[f]:p}),host:{propertyId:r,instanceId:i,slotId:a,factPath:c,fields:u}})}function VG({object:e,rows:t,onChange:n,factPath:r,...i}){const a=Zx(r),c=a!==void 0?a:fw(e);return h.jsx(qG,{object:e,row:t[0]??{},onChange:u=>n([u,...t.slice(1)]),factPath:pl(r,t[0]),fields:c,...i})}const ZG=new Set(["image","video","tour","document"]);function KG(e){var t;return((t=e.source)==null?void 0:t.kind)==="row"}function IT(e){return ZG.has(e.type)&&jp(e).kind==="owned"}function GG(e,t){return Ps(e).some(([n,r])=>IT(r)&&!KG(r)&&t.required.has(n))}function au({slot:e,value:t,onChange:n,propertyId:r,instanceId:i,slotId:a,selection:c,onRecordAdded:u,onAdd:f,newRowStamp:p,fixed:y,orderable:m,add:x,choose:v,factPath:_,record:k,fields:S}){const[j,O]=w.useState(null),A=k!==void 0?{index:k.index,added:k.added===!0}:j,{ownedUpload:$}=tn(),C=$n(e),I=t,z=A===null?void 0:I[A.index]??{},T=C!==null&&S!==null&&GG(C,S),F=w.useRef({open:A,rows:I});w.useEffect(()=>{F.current={open:A,rows:I}});const W=()=>{const M=F.current.rows,B=[(p==null?void 0:p())??{},...M],X={index:0,added:!0};F.current={open:X,rows:B},n(B,"add"),O(X)},G=M=>{const{open:B,rows:X}=F.current;if(B===null)return;const se=X.map((J,P)=>P===B.index?M:J);F.current={open:B,rows:se},n(se,"edit")},H=()=>{if(k!==void 0){k.onClose();return}(A==null?void 0:A.added)===!0&&(u==null||u(A.index)),O(null)},U=(M,B)=>{const X=F.current.open;return!$||X===null?Promise.reject(new Error("list-table-view: no record is open")):$({slotId:a,itemIndex:X.index,field:M},B)},D=$&&A!==null?(M,B)=>IT(B)?{onUpload:X=>U(M,X)}:{}:void 0,K=Rr(e.label).singular;return h.jsxs(h.Fragment,{children:[k===void 0&&h.jsx($G,{declaration:e,value:t,onChange:(M,B)=>n(M,B),propertyId:r,instanceId:i,slotId:a,selection:c,...x!==void 0?{add:x}:{},...v!==void 0?{choose:v}:{},...y!==void 0?{fixed:y}:{},...m!==void 0?{orderable:m}:{},onOpenRecord:C?(M,B)=>O({index:M,added:!1,field:B}):void 0,onAdd:f!==void 0?f:T?W:void 0,...p!==void 0?{newRowStamp:p}:{},factPath:_,fields:S}),C&&h.jsx(BG,{open:z!==void 0,object:C,row:z??{},fallbackTitle:(A==null?void 0:A.added)===!0?`New ${K}`:`${ed(K)} ${((A==null?void 0:A.index)??0)+1}`,propertyId:r,instanceId:i,slotId:a,fieldProps:D,factPath:pl(_,z),fields:S,revealFieldName:A==null?void 0:A.field,onChange:G,onClose:H})]})}function YG(e){return e.map(OT).filter(t=>t!==null)}function QG({label:e,itemSlot:t,offer:n,verbs:r,fixed:i,instanceId:a,slotId:c,ownerSlotId:u=c,value:f,propertyId:p,commit:y,onUpload:m,factPath:x,size:v}){const _=yi(t),k=w.useMemo(()=>YG(f),[f]),[S,j]=w.useState(!1),O=Oi({items:k,fixed:i,axis:"xy",commit:y}),{rows:A}=O,$=Ix(t,{propertyId:p,instanceId:a,slotId:u}),C=n.kind==="owned"?m??$??void 0:void 0,I=WG(C,_,O.add),{add:z,onAdd:T,choose:F}=fx(r,n.kind==="picked"?()=>j(!0):null,C!==void 0?qx(_,I):null),W=I.error;return h.jsxs(hx,{engine:O,label:e,noun:"item",size:v,onAdd:T,add:z,choose:F,renderTile:(G,H,U)=>h.jsx(JG,{value:G.value,kinds:_,propertyId:p,holderPath:x,frame:{chrome:U,crop:null}}),children:[W&&h.jsx("p",{className:$l,children:W}),S&&n.kind==="picked"&&h.jsx(dd,{mode:"multi",propertyId:p,filter:n.filter,selectedIds:A.map(G=>G.value.file),onChange:G=>O.replace(Il(A,G,H=>H.file,XG,O.mint)),onClose:()=>j(!1)})]})}function XG(e){return Xq(e)??{file:e.file}}function WG(e,t,n){const[r,i]=w.useState(!1),[a,c]=w.useState(null);return{busy:r,error:a,take:f=>{if(!e||f.length===0)return;const p=f.filter(m=>!rj(t,fh(m)));c(p.length>0?`Only ${t.join(", ")} can be added here.`:null);const y=f.filter(m=>rj(t,fh(m)));y.length!==0&&(i(!0),(async()=>{try{for(const m of y){const x=fh(m),v=Gn(x),_=Zp(x,v.fromUploaded(await e(m),v.cleared));_!==null&&n(_)}}catch(m){console.error("[editor] media upload failed",m),c("Upload failed. Try again.")}finally{i(!1)}})())}}}function rj(e,t){return t!==null&&e.includes(t)}function JG({value:e,kinds:t,propertyId:n,frame:r,holderPath:i}){const a=Hx(e,t,n);return h.jsx(Bx,{kind:a,value:eY(a,e),propertyId:n,frame:r,holderPath:i},a)}function eY(e,t){return hw()[e].coerce(t)}function UT({face:e,...t}){const{slot:n,instanceId:r,slotId:i,value:a,onChange:c,recordContext:u}=t,f=WR(n,e),p=JV(n,r,i,c,u!=null),y=t.membership??Qx(n,void 0),m=Array.isArray(a)?a:[],x=gR({slotId:i,recordContext:u}),v=u?u.table??null:Is(n.source)!==null?t.boundRowTable??null:null,_=w.useMemo(()=>f.view==="gallery"?JT(n,v):null,[f.view,n,v]),k=y.kind==="follows",{itemContent:S}=f,j=e==="compact"?"compact":"large",O=Pp(n,{table:v,membership:y});if(O===null)return null;switch(f.view){case"table":return h.jsx(nY,{slot:n,items:m,onChange:c,membership:y,verbs:O,entries:S.kind==="record"?S.entries:null,fixed:k,propertyId:t.propertyId,instanceId:r,slotId:i,factPath:t.factPath});case"annotated-gallery":{const A=S.kind==="record"?XT(S.entries):null;return A===null?null:h.jsx(rY,{list:n,label:n.label,face:e,annotated:A,listTable:v,membership:y,verbs:O,itemBaseline:t.itemBaseline,insideRecord:u!=null,fixed:k,instanceId:r,slotId:i,mediaSlotId:`${x}.${A.mediaKey}`,value:m,propertyId:t.propertyId,table:(u==null?void 0:u.table)??JR(y),selectedItemIndex:t.selectedItemIndex,selectedFieldName:t.selectedFieldName,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:j})}case"accordion":return S.kind!=="record"?null:h.jsx(IK,{slot:n,entries:S.entries,fixed:k,instanceId:r,slotId:i,value:a,commit:p,membership:y,verbs:O,rowTable:t.rowTable??fv(n,y),selectedItemIndex:t.selectedItemIndex,selectedFieldName:t.selectedFieldName,itemBaseline:t.itemBaseline,insideRecord:u!=null,factPath:t.factPath});case"gallery":{if(S.kind!=="single"||!po(S.slot.type))return null;if(_!==null)return h.jsx(oY,{label:n.label,member:_,verbs:O,fixed:k,instanceId:r,slotId:i,mediaSlotId:x,value:a,propertyId:t.propertyId,selectedItemIndex:t.selectedItemIndex,commit:p,onUpload:t.onUpload,size:j});const A=S.slot,$=S.slot.type,C=$8(n,A,v)??{kind:"owned"};if($==="media")return h.jsx(QG,{label:n.label,itemSlot:A,offer:C,verbs:O,fixed:k,instanceId:r,slotId:i,ownerSlotId:x,value:m,propertyId:t.propertyId,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:j});const I=$;return h.jsx(lV,{kind:I,label:n.label,itemSlot:A,offer:C,verbs:O,fixed:k,instanceId:r,slotId:i,ownerSlotId:x,value:m,propertyId:t.propertyId,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:j},I)}case"media-manager":return null;case"poi-curation":return h.jsx($Z,{slot:n,fixed:k,value:a,propertyId:t.propertyId,commit:p});case"bullet-list":return S.kind!=="single"?null:h.jsx(YK,{slot:n,itemSlot:S.slot,add:O.add,fixed:k,value:a,commit:p,size:j});case"row-bar":{const A=fv(n,y),$=S.kind==="single"?pd(S.slot):tY,C=t.rowTable??(A.kind!=="none"?A:$);return h.jsx(SK,{slot:n,face:e,rowTable:y.kind==="follows"&&C.kind==="table"?{...C,inert:!0}:C,verbs:O,fixed:k,value:m,commit:p})}}}const tY={kind:"none"};function nY({slot:e,items:t,onChange:n,membership:r,verbs:i,entries:a,fixed:c,propertyId:u,instanceId:f,slotId:p,factPath:y}){const{TablePicker:m,TableCreate:x}=tn(),v=Zx(y),_=v!==void 0?v:fw($n(e)??{fields:{}}),[k,S]=w.useState(!1),[j,O]=w.useState(!1),A=r.kind==="pick-row"&&a!==null?Wx(r):null,$=hd,C=t,I=w.useRef(C);w.useEffect(()=>{I.current=C});const z=m===void 0?null:()=>S(!0),T=A!==null&&z!==null&&i.choose!==null?{choose:i.choose,onChoose:z}:void 0,F=A===null?void 0:x===void 0?null:()=>O(!0),W=r.kind==="table"?()=>({[$]:hR()}):void 0;return h.jsxs(h.Fragment,{children:[h.jsx(au,{slot:e,value:t,onChange:G=>n(G),propertyId:u,instanceId:f,slotId:p,factPath:y,fields:_,fixed:c,...F!==void 0?{onAdd:F}:{},...W!==void 0?{newRowStamp:W}:{},add:i.add,...T!==void 0?{choose:T}:{}}),j&&A!==null&&a!==null&&x!==void 0&&h.jsx(x,{tables:A,onCreated:(G,H)=>{if(O(!1),Vh(I.current,a,$).includes(G))return;const U=[aw(a,$,G,H),...I.current];I.current=U,n(U)},onClose:()=>O(!1)}),k&&A!==null&&a!==null&&m!==void 0&&h.jsx(m,{open:!0,mode:"multi",tables:A,selectedIds:Vh(C,a,$),onChange:(G,H)=>{const U=GZ(I.current,a,$,G,H);I.current=U,n(U)},onClose:()=>S(!1)})]})}function rY({list:e,face:t,annotated:n,listTable:r,membership:i,itemBaseline:a,insideRecord:c,table:u,...f}){const p=tT({instanceId:f.instanceId,slotId:f.slotId,membership:i,itemBaseline:a,insideRecord:c});return h.jsx(WT,{...f,annotated:n,offer:z8(e,n.mediaSlot,{itemTable:u,listTable:r,picksBy:i.kind==="pick-media"?i.filter:null}),markers:t==="compact"?p:null,table:u})}function oY({member:e,value:t,commit:n,...r}){const i=w.useMemo(()=>Array.isArray(t)?t.map(e.toItem):[],[t,e]),a=(c,u)=>n(c.map(f=>({key:f.key,value:e.toStored(f.value)})),u);return h.jsx(WT,{...r,annotated:e.annotated,offer:jp(e.annotated.mediaSlot,null),markers:null,value:i,table:null,commit:a})}function iY(e){return h.jsx(UT,{face:"expanded",...e})}function sY(e){return h.jsx(UT,{face:"compact",...e})}const aY={model:{defaultValue:[],coerce:e=>Array.isArray(e)?e:[],isEmpty:e=>e.length===0,isInvalid:()=>!1},faces:{expanded:iY,compact:sY},applyOptimistic:null};function lY(e,t){return e.toLocaleString("en-US",{useGrouping:t.thousandsSep===!0,maximumFractionDigits:t.decimals===!0?20:0})}function cY(e,t){const n=String(e??"").replace(/[^\d.]/g,"");if(n==="")return"";const[r,i]=n.split("."),a=(r??"").replace(/\B(?=(\d{3})+(?!\d))/g,",");return i!=null?`${a}.${i}`:a}function uY(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]!==","&&n++,n===t)return r+1;return e.length}function oj(e,t,n){e.value=t,e.setSelectionRange(n,n)}function ij(e,t){let n=e.replace(t!=null&&t.decimals?/[^\d.]/g:/[^\d]/g,"");if(t!=null&&t.decimals){const i=n.indexOf(".");i>=0&&(n=n.slice(0,i+1)+n.slice(i+1).replace(/\./g,""))}const r=n.replace(/[^\d]/g,"");return(t==null?void 0:t.maxDigits)!=null&&r.length>t.maxDigits?null:n}function dY({label:e,value:t,onChange:n,group:r,decimals:i,maxDigits:a,placeholder:c,onBlur:u,attention:f=null}){const p=x=>r?cY(x):x,y=p(t),m=Ci();return h.jsx("div",{className:m.frame,children:h.jsx(Ns,{attention:f,children:h.jsx("input",{className:ce(m.inner,"[font-variant-numeric:tabular-nums]"),"aria-label":e,inputMode:i?"decimal":"numeric",value:y,placeholder:c??"0",onBlur:u,onChange:x=>{var A;const v=x.currentTarget,_=v.value,k=v.selectionStart??_.length,S=ij(_,{decimals:i,maxDigits:a});if(S==null){const $=k-(_.length-y.length);oj(v,y,Math.min(Math.max($,0),y.length));return}const j=p(S),O=((A=ij(_.slice(0,k),{decimals:i}))==null?void 0:A.length)??0;oj(v,j,uY(j,O)),n(S)}})})})}function Vy(e){return e==null?"":String(e)}function pv(e){const t=e.trim();if(t==="")return null;const n=Number(t);return Number.isFinite(n)?n:null}const PT={defaultValue:null,coerce:e=>typeof e=="number"?e:pv(typeof e=="string"?e:""),isEmpty:e=>e===null,isInvalid:()=>!1};function sj({slot:e,value:t,onChange:n,required:r=!1}){const[i,a]=w.useState(()=>Vy(t)),c=pv(i)===t?i:Vy(t);return h.jsx(dY,{attention:Ai(PT,e,t,r),label:e.label,value:c,onChange:u=>{a(u);const f=pv(u);f!==t&&n(f)},onBlur:()=>a(Vy(t)),group:e.thousandsSep,decimals:e.decimals,maxDigits:e.maxDigits,placeholder:e.placeholder})}const fY={model:PT,faces:{expanded:sj,compact:sj},applyOptimistic:(e,t,n)=>YR(e,t==null?"":lY(t,n))},FT={model:{defaultValue:"",coerce:fd,isEmpty:e=>e.trim()==="",isInvalid:e=>!qD(e.trim())},normalize:e=>e.trim(),invalidMessage:()=>"Not a valid phone number",inputType:"tel",inputMode:"tel",autoComplete:"tel",placeholder:"(555) 555-0100"};function aj(e){return h.jsx(Gx,{kind:FT,...e})}const hY={model:FT.model,faces:{expanded:aj,compact:aj},applyOptimistic:null},pY="flex flex-col gap-2";function mY({slot:e,value:t,onChange:n,propertyId:r}){const{apiFetch:i}=tn().api,[a,c]=w.useState(null),[u,f]=w.useState(null),p=w.useMemo(()=>t?[t]:[],[t]),{urls:y,dropUrl:m}=aT(r,p);async function x(v){if(c(null),(t==null?void 0:t.place_id)!==v.place_id){f(v);try{const _=await nT(i,r,v.place_id);n(_)}catch{c("Couldn't add that place. Try again.")}finally{f(null)}}}return h.jsxs("div",{className:pY,children:[h.jsx(cT,{propertyId:r,placeholder:e.placeholder??"Search nearby…",addedIds:t?new Set([t.place_id]):new Set,onSelect:v=>void x(v)}),a&&h.jsx("span",{className:oT,children:a}),u?h.jsxs("div",{className:ce(ew,iT),"aria-live":"polite",children:[h.jsx("span",{className:tw,children:h.jsx("span",{className:sT})}),h.jsxs("div",{className:nw,children:[h.jsx("span",{className:rw,children:u.name}),h.jsx("span",{className:ow,children:"Adding…"})]})]}):t?h.jsx(lT,{row:t,photoUrl:y[t.place_id],onPhotoError:()=>m(t.place_id),onRemove:()=>n(null)}):h.jsx("div",{className:cZ,children:"No place yet. Search above to choose one."})]})}const gY={model:{defaultValue:null,coerce:Jx,isEmpty:e=>e===null,isInvalid:()=>!1},faces:{compact:mY},applyOptimistic:null},yY=ce(vt,"group box-border flex flex-col items-start gap-2.5 rounded-[calc(12*var(--content))] border-[1.5px] p-4.5 text-left","transition-[background-color,border-color] duration-[120ms]","border-line bg-canvas hover:border-ink-4","aria-checked:border-honey-2 aria-checked:bg-honey-soft","data-[attention=required]:border-danger data-[attention=required]:bg-danger-soft","data-[attention=invalid]:border-danger data-[attention=invalid]:bg-danger-soft"),bY=ce("grid size-9.5 place-items-center rounded-[calc(10*var(--content))] bg-line-soft text-ink-2","transition-[background-color,color] duration-[120ms]","group-aria-checked:bg-honey group-aria-checked:text-honey-ink");function vY(e){return e.length>0&&e.every(t=>t.description!==void 0)}function xY({label:e,value:t,options:n,onChange:r,attention:i}){const a=Ul();return h.jsx("div",{className:ce(As,"gap-1.5"),children:h.jsx("div",{className:"grid grid-cols-2 gap-2.5",role:"radiogroup","aria-label":e,children:n.map(c=>{const u=_T(c.icon)?c.icon:null;return h.jsxs("button",{type:"button",role:"radio","aria-checked":c.value===t,className:yY,...Dl(i,a),onClick:()=>{c.value!==t&&r(c.value)},children:[u!==null&&h.jsx("span",{className:bY,children:h.jsx(jt,{name:u,size:18,stroke:1.7})}),h.jsx("span",{className:"text-[length:calc(15.5*var(--content))] font-semibold text-ink",children:c.label}),h.jsx("span",{className:"text-caption leading-[1.4] text-ink-3",children:c.description})]},c.value)})})})}const BT={defaultValue:null,coerce:e=>typeof e=="string"?e:null,isEmpty:e=>e===null||e==="",isInvalid:()=>!1};function HT({cards:e,slot:t,value:n,onChange:r,required:i=!1}){const a=wT(t),c=t.creatable??!1,u=Ai(BT,t,n,i);return e&&!c&&vY(a)?h.jsx(xY,{label:t.label,value:n,options:a,onChange:r,attention:u}):h.jsx(hv,{attention:u,label:t.label,value:n??"",options:a,creatable:c,placeholder:"Choose one",onChange:r})}function wY(e){return h.jsx(HT,{cards:!0,...e})}function kY(e){return h.jsx(HT,{cards:!1,...e})}const _Y={model:BT,faces:{expanded:wY,compact:kY},applyOptimistic:null};function qT(){const e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}function SY(){return w.useSyncExternalStore(()=>()=>{},()=>qT()!==null,()=>!1)}function EY({value:e,onChange:t,recording:n,onRecordingChange:r,onEnd:i}){const a=SY(),[c,u]=w.useState(0),f=w.useRef(null),p=w.useRef(""),y=w.useRef(""),m=w.useRef(t),x=w.useRef(i);w.useEffect(()=>{m.current=t,x.current=i},[t,i]),w.useEffect(()=>{if(!n)return;const k=setInterval(()=>u(S=>S+1),1e3);return()=>clearInterval(k)},[n]),w.useEffect(()=>()=>{var k;(k=f.current)==null||k.abort(),f.current=null},[]);const v=w.useCallback(()=>{const k=qT();if(!k||f.current)return;const S=new k;S.continuous=!0,S.interimResults=!0,S.lang=typeof navigator<"u"&&navigator.language||"en-US",p.current=e,y.current="",S.onresult=j=>{let O="",A="";for(let z=j.resultIndex;z<j.results.length;z++){const T=j.results[z];if(T===void 0)continue;const F=T[0].transcript;T.isFinal?O+=F:A+=F}O&&(y.current+=O);const $=y.current+A,C=p.current,I=!C||/\s$/.test(C)||/^\s/.test($)?"":" ";m.current(C+I+$)},S.onerror=()=>{},S.onend=()=>{var j;f.current=null,r(!1),u(0),(j=x.current)==null||j.call(x)},f.current=S,u(0),r(!0);try{S.start()}catch{f.current=null,r(!1)}},[r,e]),_=w.useCallback(()=>{var k;(k=f.current)==null||k.stop()},[]);return{canDictate:a,seconds:c,start:v,stop:_}}function jY(e){return`${String(Math.floor(e/60)).padStart(2,"0")}:${String(Math.floor(e%60)).padStart(2,"0")}`}const OY={short:120,medium:240,long:2e3};function AY(e){return OY[e]}const VT={defaultValue:"",coerce:fd,isEmpty:e=>e.trim()==="",isInvalid:()=>!1};function ZT(e){const t=e.slot.size??"short";return{size:t,cap:typeof e.slot.cap=="number"?e.slot.cap:AY(t)}}function KT({slot:e}){if(e.placeholder!==void 0||e.size!=="long")return e.placeholder;const t=typeof e.label=="string"?e.label.trim().toLowerCase():"";return t===""?"Start typing…":`Write the ${t} here…`}function GT({slot:e,value:t,required:n=!1}){return Ai(VT,e,t,n)}const CY={medium:2,long:5};function YT(e){const{slot:t,value:n,onChange:r}=e,{size:i,cap:a}=ZT(e),c=Ci(),u={value:n,maxLength:a,placeholder:KT(e),"aria-label":t.label};return h.jsx("div",{className:c.frame,children:h.jsx(Ns,{attention:GT(e),count:{count:n.length,max:a,multiline:i!=="short"},children:i==="short"?h.jsx("input",{className:c.inner,...u,onChange:f=>r(f.target.value)}):h.jsx("textarea",{className:ce(c.inner,c.multiline),rows:c.inline?1:CY[i],...u,onChange:f=>r(f.target.value)})})})}function NY(e){return ZT(e).size==="long"?h.jsx(MY,{...e,cap:typeof e.slot.cap=="number"?e.slot.cap:null}):h.jsx(YT,{...e})}function MY(e){const{slot:t,value:n,onChange:r,cap:i}=e,a=Ci(),c=w.useRef(null),[u,f]=w.useState(!1),p=w.useCallback(()=>requestAnimationFrame(()=>{var v;return(v=c.current)==null?void 0:v.focus()}),[]),y=w.useCallback(v=>r(i===null?v:v.slice(0,i)),[r,i]),m=EY({value:n,onChange:y,recording:u,onRecordingChange:f,onEnd:p}),x=u?null:n.length>0?i===null?`${n.length.toLocaleString()} character${n.length===1?"":"s"}`:`${n.length.toLocaleString()} / ${i.toLocaleString()}`:m.canDictate?"Type, or tap the mic to dictate":"Type to fill this in";return h.jsx("div",{className:a.frame,children:h.jsxs(Ns,{attention:GT(e),className:"flex-col overflow-hidden",children:[h.jsx("textarea",{ref:c,className:ce(a.inner,"min-h-[calc(160*var(--content))] resize-none whitespace-pre-wrap pt-3.5 leading-[1.55]"),value:n,maxLength:i??void 0,placeholder:KT(e),"aria-label":t.label,onChange:v=>r(v.target.value)}),h.jsxs("div",{className:"flex items-center justify-between gap-3 py-2 pr-2.5 pl-3.5",children:[u?h.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2.5 text-caption text-ink-2",role:"status",children:[h.jsx("span",{className:"size-2 shrink-0 animate-pulse rounded-full bg-danger","aria-hidden":"true"}),h.jsx("span",{className:"font-mono font-semibold text-ink [font-feature-settings:'tnum']",children:jY(m.seconds)}),"Listening…"]}):h.jsx("span",{className:ce(j7(n.length,i??void 0),"font-sans text-caption"),children:x}),m.canDictate&&h.jsx("button",{type:"button",className:ce(vt,"grid size-9 shrink-0 place-items-center rounded-full bg-ink text-canvas transition-[background-color,transform] duration-[120ms] hover:scale-[1.04] hover:bg-ink-2"),"aria-label":u?"Stop dictation":"Dictate with your voice",onClick:u?m.stop:m.start,children:u?h.jsx("span",{className:"block size-2.75 rounded-[2px] bg-white","aria-hidden":"true"}):h.jsx(E9,{size:16})})]})]})})}const RY={model:VT,faces:{expanded:NY,compact:YT},applyOptimistic:(e,t)=>YR(e,fd(t))};function TY(e){if(e===void 0)return"Not a valid URL";const t=Object.entries(_i).find(([r])=>r===e);if(t)return`Needs a ${t[1].label} link`;const n=$Y(e);return n.length>0?`Needs a ${e} link (${n.join(", ")})`:`Needs a ${e} link`}function $Y(e){return Object.values(_i).filter(t=>t.kind===e).map(t=>t.label)}function zY(e,t){const n=nu(e);return n===""?!1:u0(n)?t.accepts!==void 0&&!FD(t.accepts,n):!0}const QT={model:{defaultValue:"",coerce:fd,isEmpty:e=>nu(e)==="",isInvalid:zY},normalize:nu,invalidMessage:(e,t)=>u0(nu(e))?TY(t.accepts):"Not a valid URL",inputType:"text",inputMode:"url",autoComplete:"url",placeholder:"https://",adornment:e=>h.jsx(DY,{draft:e})};function DY({draft:e}){const t=nu(e);return h.jsx("span",{className:ce(BN,"pr-2.75"),children:u0(t)?h.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:ce(vt,"flex items-center text-ink-4 hover:text-accent transition-colors duration-[120ms]"),"aria-label":"Open URL in new tab",children:h.jsx(Mt.external,{})}):h.jsx("span",{className:"flex items-center text-ink-4 opacity-30",children:h.jsx(Mt.external,{})})})}function lj(e){return h.jsx(Gx,{kind:QT,...e})}const LY={model:QT.model,faces:{expanded:lj,compact:lj},applyOptimistic:null};let cj=null;function IY(){return cj??(cj={text:RY,number:fY,select:_Y,url:LY,email:WV,phone:hY,date:GV,image:NR,list:aY,poi:gY,video:zR,tour:RR,document:ZR,media:rG,address:IV}),cj}function UY(){return lK}function Bs(e){if(e==="row")return UY();const n=IY()[e];return n===void 0?null:n}function wl(e,t={}){const n=Fl(e);if(n!==null){const i={...t,fields:n.fields};return e.locked!==!0&&Object.values(n.fields).some(a=>wl(a,i))}if(ZZ(e,t))return!1;const r=Bs(e.type);return r?r.isEditable?r.isEditable(e):e.locked!==!0:!1}function XT(e){const t=e.filter(([,r])=>zC(r)),n=t.find(([,r])=>wn(r.type));return n?{mediaKey:n[0],mediaSlot:n[1],fields:t.filter(([r])=>r!==n[0])}:null}const PY="flex flex-col gap-1.5",FY="flex flex-col";function WT({label:e,annotated:t,offer:n,verbs:r,markers:i,fixed:a,instanceId:c,slotId:u,mediaSlotId:f,value:p,propertyId:y,table:m,selectedItemIndex:x,selectedFieldName:v,commit:_,onUpload:k,factPath:S,size:j}){const{mediaKey:O,mediaSlot:A,fields:$}=t,C=f??`${u}.${O}`,I=A.type,z=Gn(I),T=z0(A),F=w.useMemo(()=>[[O,A],...$],[O,A,$]),W=w.useMemo(()=>p.map(be=>be!==null&&typeof be=="object"?{...be}:{}),[p]),G=Oi({items:W,...i?{identityOf:i.identityOf}:{},fixed:a,axis:"xy",commit:(be,Te)=>{i==null||i.markOrder(be),_(i?i.stamp(be):be,Te)}}),{rows:H}=G,U=be=>{var Te;return((Te=Bs(I))==null?void 0:Te.model.coerce(be[O]))??z.cleared},D=(be,Te)=>({...be,[O]:Te}),K=(be,Te,tt)=>{const Ne=H.find(Ve=>Ve.key===be);Ne&&(i==null||i.markFields(Ne,{[Te]:tt(Ne.value)}),G.updateValue(be,Ve=>({...Ve,[Te]:tt(Ve)})))},M=be=>{for(const Te of be)i==null||i.markRemoved(Te);G.removeMany(be.map(Te=>Te.key))},B=be=>D(qa(F),be),X=w.useMemo(()=>({get:be=>I==="image"?U(be):null,set:(be,Te)=>D(be,Te)}),[I,O]),se=v!==void 0&&v!==O,J=TR({engine:G,lens:X,propertyId:y,instanceId:c,slotId:u,cropCfg:T}),P=bR(y,I),Y=be=>Ia(wu(pl(S,be),O),z.fileIdOf(U(be))),L=w.useRef(null);w.useEffect(()=>{se&&L.current&&xT(L.current,v)},[se,v,x]);const[Z,ne]=w.useState(!1),fe=Ix(A,{propertyId:y,instanceId:c,slotId:C}),de=k??fe??void 0,pe=n.kind==="owned"&&de!==void 0,N=DR(de,be=>G.add(B(z.fromUploaded(be,z.cleared)))),ee=be=>{const Te=Il(H,be,Ne=>z.fileIdOf(U(Ne)),Ne=>B(z.fromPicked(Ne,z.cleared)),G.mint),tt=new Set(Te.map(Ne=>Ne.key));for(const Ne of H)tt.has(Ne.key)||i==null||i.markRemoved(Ne);G.replace(Te)},{add:le,onAdd:xe,choose:_e}=fx(r,n.kind==="picked"?()=>ne(!0):null,n.kind==="owned"&&pe?qx([I],N):null),Oe=N.error;return h.jsxs(hx,{engine:G,label:e,noun:z.noun,size:j,onAdd:xe,add:le,choose:_e,renderTile:(be,Te,tt)=>h.jsx("div",{className:FY,"data-annotated-item":Te,children:h.jsx(Bx,{kind:I,value:U(be.value),propertyId:y,holderPath:wu(pl(S,be.value),O),frame:{chrome:tt,beneath:$.length>0&&h.jsx("div",{className:PY,ref:Te===x?L:void 0,[uw]:"",children:h.jsx(cd,{place:"cell",children:$.map(([Ne,Ve])=>h.jsx("div",{[Zh]:Ne,children:h.jsx(Bl,{slot:Ve,instanceId:c,slotId:u,value:be.value[Ne],propertyId:y,onChange:it=>K(be.key,Ne,()=>it),recordContext:{itemIndex:Te,fieldKey:Ne,table:m}})},Ne))})}),crop:I==="image"?{cfg:T,cut:J.cutOf(be),derivativeUrl:J.derivativeOf(be),cropping:P.recropping(Y(be.value)),cropped:P.framing?J.cropped(be):P.cropped(Y(be.value)),storeKey:J.keyOf(be.key)}:null}})}),onRemove:M,tileActions:be=>{const Te=Y(be.value),tt=[];return P.offers(Te)&&tt.push({label:"Crop",glyph:"crop",onSelect:()=>P.framing?J.open(be.key):P.recrop(Te,J.keyOf(be.key))}),tt},children:[Oe&&h.jsx("p",{className:$l,children:Oe}),Z&&n.kind==="picked"&&h.jsx(dd,{mode:"multi",propertyId:y,filter:n.filter,selectedIds:H.map(be=>z.fileIdOf(U(be.value))),onChange:ee,onClose:()=>ne(!1)}),P.framing&&J.modal(),P.modal]})}function BY(e){const n={...yr.pages,...at.pages}[e];return n?n.declaration:null}function JT(e,t){const n=$0(e,t);if(n===null)return null;const r=BY(n.table),i=r?$n(r):null,a=i==null?void 0:i.fields[n.member],c=a?$n(a):null;if(!c||!A0(c.fields))return null;const u=XT(Ps(c));if(u===null)return null;const{mediaKey:f,fields:p}=u,y=new Set(p.map(([m])=>m));return{annotated:u,toItem:m=>{const x=m!==null&&typeof m=="object"?m:{},v={};for(const[k,S]of Object.entries(x))y.has(k)||(v[k]=S);const _={[f]:v};for(const[k]of p)_[k]=x[k]??null;return _},toStored:m=>{const x=m[f],v=x!==null&&typeof x=="object"?{...x}:{};for(const[_]of p){const k=m[_];v[_]=typeof k=="string"&&k.trim()===""?null:k??null}return v}}}const HY=ce(vt,"flex w-full items-center rounded-none px-2.5 py-2 text-left text-body text-ink hover:bg-accent-soft data-[active=true]:bg-accent-soft");ce(HY,"text-accent");ce("absolute inset-0 grid place-items-center font-mono text-[12px] text-ink-3",FN);ce(vt,"we-no-drag grid size-5 place-items-center rounded-[4px] bg-white text-ink-2 shadow-[0_1px_2px_rgba(20,18,13,0.18)] transition-[background,color] duration-[120ms] hover:bg-[#f3f1ea] hover:text-ink");function Eu(e,t){const n=e.variant;return!n||t==null?!0:n.cases.includes(t)}const uj=new WeakMap;function mv(e,t){const n=e.element;if((n==null?void 0:n.fields)===void 0)return e;const r=uj.get(e)??new Map;uj.set(e,r);const i=r.get(t);if(i!==void 0)return i;const a=qY(n.fields,t),c=a===n.fields?e:{...e,element:{...n,fields:a}};return r.set(t,c),c}function qY(e,t){let n=!1;const r={};for(const[i,a]of Object.entries(e)){if(!Eu(a,t)){n=!0;continue}const c=mv(a,t);c!==a&&(n=!0),r[i]=c}return n?r:e}function dj(e,t,n,r,i=!1){return{kind:"object",key:e,header:t,Icon:bT(n.map(a=>a.slot)),fields:n,selectSlotId:r,lone:i}}function yw(e,t){const n=[];for(const r of e.slot_order){const i=e.slots[r];if(!Eu(i,t)||!wl(i,{slots:e.slots}))continue;const a=Fl(i);if(a!==null){const c={slots:e.slots,fields:a.fields},u=Ps(a).filter(([,f])=>wl(f,c)&&Eu(f,t)).map(([f,p])=>({slotId:md(r,f),slot:mv(p,t)}));if(u.length===0)continue;n.push(dj(r,Nr(a,r),u,r));continue}n.push(dj(r,{kind:"text",text:i.label},[{slotId:r,slot:mv(i,t)}],r,!0))}return n}function VY(e,t,n){if(e.header.kind==="text")return e.header.text;const r=Fl(t.slots[e.key]);return r===null?e.key:Fs(e.header,r,n(e.key))}function fj(e){var t;return((t=Eo(e.slotId))==null?void 0:t.field)??e.slotId}function ZY(e,t){return e.key===t||e.fields.some(n=>n.slotId===t)}function e4(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}function KY(e,t,n){const r=[];for(const i of yw(e,t))for(const{slotId:a,slot:c}of i.fields)c.variant&&e4(n(a))&&r.push(a);return r}function Gh(e,t){const n=Object.entries(Sp(e)).filter(([,i])=>Yu(i)==="address").map(([i])=>i);return t[e].map(i=>{const a={...i};for(const c of n)a[c]=en(i[c]);return a})}function gv(e,t,n){const r=T0(e,n);if(r.kind==="identity")return t.id??null;if(r.kind==="unknown")return null;const i=n.indexOf(".");if(i===-1)return t[n]??null;const a=n.slice(i+1);return gp(a)?XD(t[n.slice(0,i)],a):null}function GY(e,t,n){return Gh(e,n).find(r=>r.id===t)}function YY(e,t,n,r){const i=GY(e,t,r);return i===void 0?null:gv(e,i,n)}function yv(e,t,n,r={},i){const a=N0(n);return QY(e,t,UC(n),a,r)}function QY(e,t,n,r,i,a){return Gh(e,t).map(u=>{const f={id:u.id};for(const p of r)f[p]=u.id;for(const[p,y]of Object.entries(n))f[p]=gv(e,u,y);for(const[p,y]of Object.entries(i))f[p]=y(m=>gv(e,u,m),u.id);return f})}function XY(e,t){if(js(t))return R8(t,e);if(A8(t))return e[t.slice(9)];const n=Qt(t);if(n!==null)return Gh(n,e);const r=SL(t);if(r!==null)return Gh(r.table,e).map(i=>i[r.member]??null)}function WY(e,t,n,r){const i=Qt(e);return wh(i!==null?yv(i,t,n,r):XY(t,e)??null)}function bw(e,t,n,r,i){if(n.kind==="computed")return Object.hasOwn(r.computed,t)?r.computed[t]:void 0;const{facts:a}=r;if(a!==null){if(n.kind==="fact")return WY(n.key,a,Ah(e));if(n.kind==="member"){const c=i(n.holder);if(typeof c!="string"||c==="")return;const u=xp(a,n.tables,c);return u===null?void 0:YY(u,c,n.member,a)}}}function t4(e,t,n,r){if(n.kind==="computed"){const a=Object.hasOwn(r.computed,t)?r.computed[t]:void 0;return Array.isArray(a)?a.filter(JY):void 0}const{facts:i}=r;if(i!==null){if(n.kind==="fact")return n.table===null?void 0:yv(n.table,i,Ah(e));if(n.kind==="rows")return n.tables.flatMap(a=>yv(a,i,Ah(e)))}}function JY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function eQ(){return h.jsxs("div",{className:"hp-rest-in flex min-h-0 flex-1 flex-col items-center justify-center px-8 pb-10 text-center",children:[h.jsx("span",{className:"text-ink-4","aria-hidden":"true",children:h.jsx(jt,{name:"pencil",size:22,stroke:1.6})}),h.jsx("p",{className:"m-0 mt-3 text-body-lg font-medium text-ink-2",children:"Nothing selected"}),h.jsx("p",{className:"m-0 mt-1 max-w-[calc(220*var(--content))] text-body leading-[1.45] text-ink-4",children:"Click anything on the canvas to edit it"})]})}function tQ(e){const t=e.source;return t==null?void 0:t.kind}function hj(e,t,n,r,i){const a=r.type;if(a==="row")return{kind:"row",tables:bu(r)};const c=Is(r.source);if(c!==null){const f=aC(e,t,c.slot);return(f==null?void 0:f.kind)==="row"?{kind:"member",holder:f.path,tables:bu(f.def),member:c.field}:null}if(a==="list"){const f=Yx(i.fillSpec,n),p=Qx(r,f,i.sectionSlots),[y,...m]=p.kind==="table"?[]:Xx(p);if(y!==void 0)return{kind:"rows",tables:[y,...m]}}if(oC(r)!==null)return{kind:"slot"};const u=tQ(r);if(u==="home"){const f=r.source.key;return typeof f=="string"&&f!==""?{kind:"fact",key:f,table:Qt(f)}:null}return u==="derived"?{kind:"computed"}:null}function n4(e,t={}){const n=[];for(const[r,i]of Object.entries(e)){if(i.type==="object"){const c=i.fields??{},u={container:r,siblings:c};for(const[f,p]of Object.entries(c)){const y=md(r,f),m=hj(e,u,y,p,t);m!==null&&n.push([y,m])}continue}const a=hj(e,{},r,i,t);a!==null&&n.push([r,a])}return n}function nQ(e,t,n={}){var r;return((r=n4(e,n).find(([i])=>i===t))==null?void 0:r[1])??null}function r4(e,t){const n=e==null||e==="",r=t==null||t==="";return n||r?n&&r:e===t?!0:typeof e=="object"||typeof t=="object"?mj(e)===mj(t):pj(e)===pj(t)}function pj(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e)??""}function mj(e){const t=en(e);if(t!==null){const{source:n,...r}=t;return JSON.stringify(r)}return JSON.stringify(e,(n,r)=>r!==null&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).sort(([i],[a])=>i.localeCompare(a))):r)}function gj(e){return Si(at.pages[e])}const Zy=2.5,rQ=1;function Gf(e){return e?e.closest(".we-acc-head"):null}function Zc(e){return e.closest(".we-acc")}function yj(e,t){const n=e.offsetWidth,r=e.offsetHeight;!n||!r||(e.style.setProperty("--gx",((n+t*2)/n).toFixed(5)),e.style.setProperty("--gy",((r+t*2)/r).toFixed(5)))}function oQ(e){e.style.removeProperty("--gx"),e.style.removeProperty("--gy")}function iQ(){w.useEffect(()=>{var p;if(typeof window>"u"||(p=window.matchMedia)!=null&&p.call(window,"(prefers-reduced-motion: reduce)").matches)return;let e=null,t=Zy;const n=typeof ResizeObserver<"u"?new ResizeObserver(()=>{e&&yj(e,t)}):null,r=(y,m)=>{y&&(e&&e!==y&&i(e),e=y,t=m,yj(y,m),n==null||n.observe(y))},i=y=>{y&&(n==null||n.unobserve(y),oQ(y),e===y&&(e=null))},a=y=>{const m=Gf(y.target);m&&r(Zc(m),Zy)},c=y=>{const m=Gf(y.target);if(!m)return;const x=y.relatedTarget;x&&m.contains(x)||i(Zc(m))},u=y=>{const m=Gf(y.target);m&&r(Zc(m),rQ)},f=y=>{const m=Gf(y.target);m&&(m.matches(":hover")?r(Zc(m),Zy):i(Zc(m)))};return document.addEventListener("pointerover",a),document.addEventListener("pointerout",c),document.addEventListener("pointerdown",u),document.addEventListener("pointerup",f),()=>{document.removeEventListener("pointerover",a),document.removeEventListener("pointerout",c),document.removeEventListener("pointerdown",u),document.removeEventListener("pointerup",f),n==null||n.disconnect()}},[])}function bv(e){return fi(e)}function sQ(e){return!js(e)||!Ch(e)?null:{home:"property",path:e.slice(9)}}function o4(e,t,n){return{home:bv(e),path:`${e}.${t}.${n}`}}function Ky(e,t){const[n,,r]=e.path.split("."),i=`property.${e.path}`;if(e.home==="property"&&js(i)&&M0(i)==="address")return en(t);if(n===void 0||r===void 0||!m0().includes(n))return t;const a=R0(n,r),c=a===void 0?null:Yu(a);if(c==="address")return en(t);if(c==="text_list"||c==="number_list"){const u=c==="text_list"?"text":"number";return(Array.isArray(t)?t:[]).filter(p=>p!=null&&p!=="").map(p=>bj(u,p))}return bj(c,t)}function bj(e,t){if(e==="number"){if(t===""||t===void 0)return null;if(typeof t=="string"&&Number.isFinite(Number(t)))return Number(t)}return e==="text"&&typeof t=="number"?String(t):t}function aQ(e){return e.kind==="picks"?{kind:"picks",media_ids:e.mediaIds}:e}function vv(e,t){return e===t?!0:Array.isArray(e)?e.some(n=>vv(n,t)):e!==null&&typeof e=="object"&&Object.values(e).some(n=>vv(n,t))}function lQ(e,t,n){var u;const r=[],i=(f,p)=>{r.push({op:"relink_slot",section_instance_id:t,slot_id:f,target:p})},a=f=>n.filter(p=>p.kind===f),c=[];for(const f of a("item_create")){const p=f.table;if(p==null)continue;const y=f.item_id,m={};for(const{key:v,member:_}of e.writableItemFields(f.slotId)){const k=e.readValue({...f,kind:"item_field",field:v});k!=null&&k!==""&&(m[_]=Ky(o4(p,y,_),k))}const x=bv(p);r.push({op:"add_row",home:x,path:p,value:m,temp_id:y}),x==="library"&&r.push({op:"pick",path:p,id:y});for(const{ownerSlot:v,mediaId:_}of f.ownedMedia??[])r.push({op:"adopt_media",instance_id:t,slot:v,media_id:_,row_id:y});c.push(y)}if(c.length>0)for(const[f,p]of Object.entries(e.readSlots(t)))c.some(y=>vv(p,y))&&r.push({op:"set_slot",section_instance_id:t,slot_id:f,value:p});for(const f of a("item_remove")){const p=f.table;if(p==null)continue;const y=f.item_id;r.push(bv(p)==="library"?{op:"unpick",path:p,id:y}:{op:"remove_row",home:"property",path:`${p}.${y}`}),i(f.slotId,{kind:"item_removed",item_id:y})}for(const f of a("reorder")){if(f.table==null)continue;const p=e.readSlotOrder(f.slotId);p.length!==0&&(r.push({op:"order",home:"property",path:f.table,ids:p}),i(f.slotId,{kind:"order"}))}for(const f of a("item_field")){const p=f.fact;p!=null&&(r.push({op:"set_value",home:p.home,path:p.path,value:Ky(p,e.readValue(f))??null}),i(f.slotId,{kind:"item",item_id:f.item_id,field:f.field}))}for(const f of a("nested_list")){const p=f.fact;p==null||f.nested==null||f.table==null||(r.push({op:"set_list",home:p.home,path:p.path,list:aQ(f.nested)}),f.field!=null?i(f.slotId,{kind:"item",item_id:f.item_id,field:f.field}):i(f.slotId,{kind:"scalar"}))}for(const f of a("scalar")){const p=f.fact;p!=null&&(r.push({op:"set_value",home:p.home,path:p.path,value:Ky(p,e.readValue(f))??null}),i(f.slotId,{kind:"scalar"}))}for(const f of a("owned_media")){const p=f.fact;if(p==null)continue;const y=(u=f.ownedMedia)==null?void 0:u[0],m=Tn(e.readValue(f));y!==void 0?r.push({op:"adopt_media",instance_id:t,slot:y.ownerSlot,media_id:y.mediaId,row_id:p.path.split(".")[1]}):m==null?r.push({op:"clear_media",home:p.home,path:p.path}):r.push({op:"commit_media",home:p.home,path:p.path,media_id:m}),f.field!=null?i(f.slotId,{kind:"item",item_id:f.item_id,field:f.field}):i(f.slotId,{kind:"scalar"})}return r}async function cQ(e,t,n){const r=lQ(e,t,n);if(r.length===0)return;const{row_ids:i}=await e.send(r);for(const[a,c]of Object.entries(i))e.rewriteTempId(t,a,c);for(const a of r)a.op==="relink_slot"&&e.relinkSlot(a.section_instance_id,a.slot_id,uQ(a.target,i))}function uQ(e,t){return"item_id"in e&&Object.hasOwn(t,e.item_id)?{...e,item_id:t[e.item_id]}:e}const sr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ju(e,t,n=[]){const r=i=>{const a=Tn(i);a!==null&&sr(i)&&n.push({holder:t,mediaId:a,value:i})};if(Cr(e))r(e);else if(Array.isArray(e))for(const i of e){if(Cr(i)){r(i);continue}const a=sr(i)?S0(i):null;if(!(a===null||!sr(i)))for(const[c,u]of Object.entries(i))ju(u,`${t}.${a}.${c}`,n)}else if(sr(e))for(const[i,a]of Object.entries(e))ju(a,`${t}.${i}`,n);return n}const Yh=e=>`${e.holder}\0${e.mediaId}`;function Qh(e,t){return e==null||t==null?e==null&&t==null:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vj(e,t){if(!sr(e))return;const n=e.cutout,r=e.crop,i=sr(n)&&typeof n.key=="string"&&n.key.startsWith(`processed/cutout/${t}/`)?n:r;if(!sr(i)||!sr(i.over))return;const a=i.over.crop;return sr(a)?a:null}function i4(e,t){const n=e.crop===null||Qh(vj(t.renditions,e.mediaId),e.crop),r=t.mobile,i=sr(r)?r.renditions:void 0;return n&&(e.mobileCrop===null||Qh(vj(i,e.mediaId),e.mobileCrop))}function dQ(e,t,n,r,i){const a=`${e}.${t}`,c=new Map(ju(n,a).map(f=>[Yh(f),f.value])),u=[];for(const f of ju(r,a)){const p=c.get(Yh(f));if(p===void 0)continue;const y=La(f.value.crop),m=La(sr(f.value.mobile)?f.value.mobile.crop:void 0),x=La(sr(p.mobile)?p.mobile.crop:void 0);if(Qh(y,La(p.crop))&&Qh(m,x))continue;const v={instanceId:e,slotId:t,holder:f.holder,mediaId:f.mediaId,crop:y,mobileCrop:m,editMark:i,ackSeq:null};y===null&&m===null||i4(v,f.value)||u.push(v)}return u}function fQ(e,t){var i;const n=e.instances.find(a=>a.instance_id===t.instanceId);if(!n)return null;const r=Yh(t);return((i=ju(Rt(n.slots,t.slotId),`${t.instanceId}.${t.slotId}`).find(a=>Yh(a)===r))==null?void 0:i.value)??null}function vw(e,t,n){return e.holder===t&&e.mediaId===n}const $a=96,Kc=72,hQ=25.4,pQ=/^(\d+(?:\.\d+)?)(in|mm)$/;function Gy(e){const t=pQ.exec(e),[,n,r]=t??[];if(n===void 0||r===void 0)throw new Error(`malformed physical length: "${e}"`);const i=Number.parseFloat(n);return r==="mm"?i/hQ:i}function xw(e){if(typeof e.width=="number"&&typeof e.height=="number")return{frameWidth:e.width,frameHeight:e.height,bleed:0,viewportWidth:e.width,viewportHeight:e.height,deviceScaleFactor:1,pixelWidth:e.width,pixelHeight:e.height,pointWidth:e.width/$a*Kc,pointHeight:e.height/$a*Kc,bleedPoints:0};const t=e,n=Gy(t.width),r=Gy(t.height),i=t.bleed===void 0?0:Gy(t.bleed),a=n*$a,c=r*$a,u=i*$a,f=a+2*u,p=c+2*u,y=t.dpi/$a;return{frameWidth:a,frameHeight:c,bleed:u,viewportWidth:f,viewportHeight:p,deviceScaleFactor:y,pixelWidth:Math.round(f*y),pixelHeight:Math.round(p*y),pointWidth:(n+2*i)*Kc,pointHeight:(r+2*i)*Kc,bleedPoints:i*Kc}}const xv="concrete-frame";function s4(e){const t=xw(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}const mQ={sectionInstanceId:ro,slotId:Bh,slotGroup:YV,slotItem:KR,slotField:Kx,slotUnselectable:GR};function a4(e){const{width:t,height:n,dpi:r,bleed:i,...a}=e;return typeof t=="number"&&typeof n=="number"?{...a,width:t,height:n}:typeof t=="string"&&typeof n=="string"&&r!==void 0?{...a,width:t,height:n,dpi:r,...i===void 0?{}:{bleed:i}}:null}function gQ(e){const t=a4(e);if(!t)return;const n=xw(t);return{formatId:e.id,width:n.viewportWidth,height:n.viewportHeight,tokens:{...s4(t)}}}function yQ(e){const t=a4(e);return t===null?0:xw(t).bleed}function bQ(e,t,n){return{markers:mQ,assets:e,isSlotEditable:t,...n?{pageBox:n}:{}}}const l4="absolute bottom-4.5 z-[5]",c4="inline-flex items-center rounded-lg border border-line bg-canvas p-1 shadow-[0_1px_2px_rgba(20,18,13,0.04),0_8px_20px_-12px_rgba(20,18,13,0.18)]",Xh="grid h-7 w-7 flex-shrink-0 cursor-pointer place-items-center rounded-md text-ink-2 transition-colors hover:bg-[rgba(20,18,13,0.06)] hover:text-ink",u4="text-[length:calc(13*var(--content))]",Ua=15,Wh="h-[calc(15*var(--content))] w-[calc(15*var(--content))]",ww=w.createContext(null);function vQ({store:e,children:t}){return h.jsx(ww.Provider,{value:e,children:t})}function Ee(e){const t=w.useContext(ww);if(!t)throw new Error("useEditorStore: missing EditorStoreProvider");return oN(t,e)}function lr(){const e=w.useContext(ww);if(!e)throw new Error("useEditorStoreApi: missing EditorStoreProvider");return e}function xQ(){const e=Ee(v=>v.session.pages),t=Ee(v=>v.session.canvases),n=Ee(v=>v.currentCanvasId),r=Ee(v=>v.setCurrentCanvas),i=new Map(e.map(v=>[v.id,v.enabled])),a=v=>v.length>0&&v.every(_=>i.get(_)===!1),c=t.every(v=>v.page_ids.length===1),u=w.useRef(null),f=w.useRef(new Map),[p,y]=w.useState({left:!1,right:!1}),m=w.useCallback(()=>{const v=u.current;if(!v)return;const _=v.scrollWidth-v.clientWidth;y(_>1?{left:v.scrollLeft>1,right:v.scrollLeft<_-1}:{left:!1,right:!1})},[]);w.useEffect(()=>{var k;const v=u.current;if(!v)return;m();const _=new ResizeObserver(m);return _.observe(v),(k=document.fonts)==null||k.ready.then(m),()=>_.disconnect()},[m]),w.useEffect(()=>{var v;(v=f.current.get(n))==null||v.scrollIntoView({block:"nearest",inline:"nearest"})},[n]);const x=v=>{var _;(_=u.current)==null||_.scrollBy({left:v*160,behavior:"smooth"})};return t.length<2?null:h.jsx("div",{className:ce(l4,"pointer-events-none left-0 right-[calc(var(--we-panel-w,436px)+20px)] flex justify-center"),children:h.jsxs("div",{className:ce(c4,"pointer-events-auto min-w-0 max-w-[min(calc(560*var(--frame)),calc(100%-430*var(--content)))]"),children:[p.left&&h.jsx(xj,{dir:-1,onClick:()=>x(-1),children:h.jsx(Cp,{size:Ua,className:Wh})}),h.jsx("div",{ref:u,role:"tablist","aria-label":c?"Pages":"Canvases",onScroll:m,className:"we-no-scrollbar flex min-w-0 overflow-x-auto",children:t.map(v=>h.jsx(wQ,{ref:_=>{_?f.current.set(v.id,_):f.current.delete(v.id)},label:v.label,active:v.id===n,struck:a(v.page_ids),onClick:()=>r(v.id)},v.id))}),p.right&&h.jsx(xj,{dir:1,onClick:()=>x(1),children:h.jsx(Np,{size:Ua,className:Wh})})]})})}function xj({dir:e,onClick:t,children:n}){return h.jsx("button",{type:"button","aria-label":e===-1?"Scroll tabs left":"Scroll tabs right",onClick:t,className:Xh,children:n})}function wQ({ref:e,label:t,active:n,struck:r,onClick:i}){const[a,c]=w.useState(!1);function u(){!n&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&c(!0),i()}return h.jsx("button",{ref:e,type:"button",role:"tab","aria-selected":n,onClick:u,className:"inline-flex flex-shrink-0 cursor-pointer whitespace-nowrap",children:h.jsx("span",{onAnimationEnd:()=>c(!1),className:ce(u4,"inline-flex h-7 items-center rounded-md px-2.5 transition-[color,background-color] duration-[120ms]",a&&"hp-tab-spring",n?"font-semibold text-ink":"font-medium text-ink-3 hover:bg-[rgba(20,18,13,0.04)] hover:text-ink",r&&"line-through decoration-[var(--color-ink-4)] "+(n?"text-ink-3":"text-ink-4 hover:text-ink-3")),children:h.jsxs("span",{className:"flex max-w-[calc(150*var(--content))] flex-col items-start",children:[h.jsx("span",{className:"w-full truncate",children:t}),h.jsx("span",{"aria-hidden":"true",className:"invisible h-0 overflow-hidden font-semibold",children:t})]})})})}function d4(e,t){var n;return((n=e.parentElement)==null?void 0:n.closest(`[${t.slotId}],[${t.slotField}]`))??null}function co(e,t){return!e.hasAttribute(t.slotUnselectable)}function f4(e,t,n,r){const i=[];for(const a of Array.from(e.querySelectorAll(t)))d4(a,r)===n&&i.push(a);return i}function kw(e,t,n){return f4(e,`[${n.slotItem}="${String(t)}"]`,e,n)}function wj(e,t,n,r){var a;let i=e.closest(`[${t}]`);for(;i&&n.contains(i);){if(co(i,r)&&d4(i,r)===n)return i;i=((a=i.parentElement)==null?void 0:a.closest(`[${t}]`))??null}return null}const es=1,kQ=12,_Q=8,SQ=8;function EQ(e,t){return{"--we-r-top":`${e.top}px`,"--we-r-left":`${e.left}px`,"--we-r-w":`${e.width}px`,"--we-r-h":`${e.height}px`,"--we-r-off":`${t}px`}}function jQ(e){const t=gd(e);return t.width<=0||t.height<=0?!1:!OQ(e,t)}function kj(e){return e==="hidden"||e==="scroll"||e==="auto"||e==="clip"}function OQ(e,t){const n=e.ownerDocument.defaultView;if(!n)return!1;let r=-1/0,i=-1/0,a=1/0,c=1/0;for(let p=e.parentElement;p;p=p.parentElement){const y=n.getComputedStyle(p),m=kj(y.overflowX||y.overflow),x=kj(y.overflowY||y.overflow);if(!m&&!x)continue;const v=p.getBoundingClientRect();m&&(i=Math.max(i,v.left),a=Math.min(a,v.right)),x&&(r=Math.max(r,v.top),c=Math.min(c,v.bottom))}const u=t.left+t.width<=i||t.left>=a,f=t.top+t.height<=r||t.top>=c;return u||f}function gd(e){const t=e.getBoundingClientRect();if(t.width>0&&t.height>0)return t;let n=1/0,r=1/0,i=-1/0,a=-1/0,c=!1;for(const u of Array.from(e.children)){const f=gd(u);f.width<=0||f.height<=0||(c=!0,n=Math.min(n,f.top),r=Math.min(r,f.left),i=Math.max(i,f.right),a=Math.max(a,f.bottom))}return c?new DOMRect(r,n,i-r,a-n):t}function wv(e,t,n,r){if(!e)return;if(!t){kv(e);return}const i=EQ(gd(t),n);for(const[a,c]of Object.entries(i))e.style.setProperty(a,c);r&&e.setAttribute("data-kind",r),e.setAttribute("data-active","true")}function _j(e,t){e.removeAttribute("data-kind"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.setAttribute("data-kind",t)})})}function kv(e){e&&(e.removeAttribute("data-active"),e.removeAttribute("data-kind"))}function Gc(e,t,n,r){if(!e)return[];const i=e.ownerDocument,a=Array.from(e.querySelectorAll(".we-chrome-ring--selection")),c=e.querySelector(":scope > .we-chrome-label");for(;a.length<t.length;){const u=i.createElement("div");u.className="we-chrome-ring we-chrome-ring--selection",e.insertBefore(u,c),a.push(u)}a.forEach((u,f)=>wv(u,t[f]??null,n,r));for(const u of a.slice(Math.max(t.length,1)))u.remove();return a.slice(0,t.length)}function Sj(e,t,n){if(!e)return;if(!t||!n){mh(e);return}const r=gd(t),i=e.getAttribute("data-active")==="true",a=e.textContent!==n;e.textContent=n,e.style.setProperty("--we-l-top",`${r.top}px`),e.style.setProperty("--we-l-left",`${r.left}px`),e.style.setProperty("--we-l-indent",`${kQ}px`);const c=r.top<_Q?AQ(e):0;c>0?(e.style.setProperty("--we-l-clear",`${c}px`),e.setAttribute("data-clear-title","true")):(e.style.removeProperty("--we-l-clear"),e.removeAttribute("data-clear-title")),i&&a&&(e.removeAttribute("data-active"),e.offsetWidth),e.setAttribute("data-active","true")}function AQ(e){var a;const t=e.parentElement,n=(a=t==null?void 0:t.parentElement)==null?void 0:a.querySelector(":scope > .we-frame-titlebar");if(!t||!n||n.children.length===0)return 0;let r=-1/0;for(const c of Array.from(n.children))r=Math.max(r,c.getBoundingClientRect().right);const i=r-t.getBoundingClientRect().left;return i>0?i+SQ:0}function mh(e){e&&(e.removeAttribute("data-active"),e.textContent="")}function uo(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,t=>`\\${t}`)}function _w(e){const t=e.filter(n=>jQ(n));return t.length>0?t:e.slice(0,1)}function h4(e,t,n){const r=Array.from(e.querySelectorAll(`[${n.slotId}="${uo(t)}"]`)).filter(i=>co(i,n));return _w(r)}function CQ(e,t,n){if(!t||t.kind!=="slot"||t.item_index==null)return[];const r=[];for(const i of e)r.push(...kw(i,t.item_index,n).filter(a=>co(a,n)));return _w(r)}function p4(e,t,n){if(!t)return[];const r=e.querySelector(`[${n.sectionInstanceId}="${uo(t.instance_id)}"]`);if(!r)return[];if(t.kind==="section")return[r];const i=h4(r,t.slot_id,n);if(i.length===0)return[];if(t.item_index!=null||t.field_name){const a=t.field_name?`[${n.slotField}="${uo(t.field_name)}"]`:null,c=[];for(const u of i){let f=[u];if(!(t.item_index!=null&&(f=kw(u,t.item_index,n).filter(p=>co(p,n)),f.length===0)))for(const p of f)if(a){const y=f4(p,a,u,n).filter(m=>co(m,n));if(y.length>0){c.push(...y);continue}p!==u&&c.push(p)}else c.push(p)}if(c.length>0)return _w(c)}return i.map(a=>{const c=a.closest(`[${n.slotGroup}]`);return c&&co(c,n)?c:a})}function NQ(e,t,n){return p4(e,t,n)[0]??null}const Ej="we-enh-shield",jj="we-enh-shield--item",ss="data-we-live";function MQ(e,t,n){if(!t||t.kind!=="slot"||t.item_index==null)return[];const r=[];for(const i of m4(e,t,n))r.push(...kw(i,t.item_index,n).filter(a=>co(a,n)));return r}function m4(e,t,n){if(!t||t.kind!=="slot")return[];const r=e.querySelector(`[${n.sectionInstanceId}="${uo(t.instance_id)}"]`);return r?Array.from(r.querySelectorAll(`[${n.slotId}="${uo(t.slot_id)}"]`)):[]}function g4(e,t,n){if(e.querySelectorAll(`[${ss}]`).forEach(i=>i.removeAttribute(ss)),!t)return;const r=e.querySelector(`[${n.sectionInstanceId}="${uo(t.instance_id)}"]`);if(r)if(t.kind==="section")r.setAttribute(ss,"true");else{const i=MQ(e,t,n),a=i.length>0?i:m4(e,t,n).filter(c=>co(c,n));for(const c of a)c.setAttribute(ss,"true")}}const xs=1440,Oj=Math.round(xs*9/16),y4=14,Sw="we-frame-defaults";function RQ(e){return`
|
|
537
|
-
/* Section wrapper -- structure only. No selection chrome here;
|
|
538
|
-
rings are painted by the host's overlay. Zero margin
|
|
539
|
-
+ padding means sections butt edge-to-edge, matching publisher. */
|
|
540
|
-
[${e}] {
|
|
541
|
-
position: relative;
|
|
542
|
-
margin: 0;
|
|
543
|
-
padding: 0;
|
|
544
|
-
cursor: pointer;
|
|
545
|
-
display: grid;
|
|
546
|
-
grid-template-rows: 1fr;
|
|
547
|
-
/* Reveal transition — governs the hidden→visible direction because
|
|
548
|
-
CSS uses the destination state's transition property. Spring easing
|
|
549
|
-
gives a snappy entrance. */
|
|
550
|
-
transition:
|
|
551
|
-
grid-template-rows 200ms cubic-bezier(0.16, 1, 0.3, 1),
|
|
552
|
-
opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/* Hidden state -- collapse the section out of the page so it reflows shut.
|
|
556
|
-
The 0-height wrapper stays in flow as the anchor for the section's
|
|
557
|
-
floating edge tab (built by the host in its own document). */
|
|
558
|
-
[${e}][data-hidden="true"] {
|
|
559
|
-
grid-template-rows: 0fr;
|
|
560
|
-
opacity: 0;
|
|
561
|
-
pointer-events: none;
|
|
562
|
-
/* Collapse transition — governs the visible→hidden direction.
|
|
563
|
-
Faster + accelerating so the hide feels decisive. */
|
|
564
|
-
transition:
|
|
565
|
-
grid-template-rows 150ms cubic-bezier(0.4, 0, 1, 1),
|
|
566
|
-
opacity 120ms cubic-bezier(0.4, 0, 1, 1);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/* Per-section body holds the API HTML.
|
|
570
|
-
1. position:relative gives the body a positioning context for any
|
|
571
|
-
body-scoped chrome or future body-only effects.
|
|
572
|
-
2. isolation:isolate SEALS the section's z-index hierarchy
|
|
573
|
-
inside this stacking context. Without it, any positioned
|
|
574
|
-
descendant with z-index > 0 (the header's sticky+z-50, a
|
|
575
|
-
dropdown's z-40, a sticky CTA) creates a stacking context
|
|
576
|
-
that escapes upward. Sections never need to know the
|
|
577
|
-
editor chrome exists -- internal z-index is unconstrained. */
|
|
578
|
-
/* overflow:hidden clips section content as the grid row collapses;
|
|
579
|
-
min-height:0 lets the grid child shrink below its content size.
|
|
580
|
-
Constraint: overflow:hidden is permanent (not just during animation), so
|
|
581
|
-
section content must not overflow its section-body boundary — sticky
|
|
582
|
-
elements, absolutely-positioned dropdowns, or shadows that bleed outside
|
|
583
|
-
the section edge will be silently clipped. Template sections are
|
|
584
|
-
self-contained blocks; this is safe in practice. */
|
|
585
|
-
.we-section-body { position: relative; isolation: isolate; overflow: hidden; min-height: 0; }`}function TQ(e){return`
|
|
586
|
-
[${e}] {
|
|
587
|
-
display: contents;
|
|
588
|
-
/* Computed even while boxless, so the collapse below has a 1fr start
|
|
589
|
-
value to animate from the instant the hidden box appears. */
|
|
590
|
-
grid-template-rows: 1fr;
|
|
591
|
-
cursor: pointer;
|
|
592
|
-
}
|
|
593
|
-
[${e}] > .we-section-body { display: contents; }
|
|
594
|
-
|
|
595
|
-
/* Hidden state -- the wrapper takes a real box again: a zero-height grid
|
|
596
|
-
item in the frame column, collapsing the section out of the page while
|
|
597
|
-
staying in flow as the anchor for its edge tab. display is not
|
|
598
|
-
transitioned, so the box appears at 1fr immediately and the collapse
|
|
599
|
-
animates its full run; the reveal returns to display:contents at once —
|
|
600
|
-
a boxless wrapper has nothing to animate, so re-entry is instant by
|
|
601
|
-
design. */
|
|
602
|
-
[${e}][data-hidden="true"] {
|
|
603
|
-
display: grid;
|
|
604
|
-
grid-template-rows: 0fr;
|
|
605
|
-
opacity: 0;
|
|
606
|
-
pointer-events: none;
|
|
607
|
-
transition:
|
|
608
|
-
grid-template-rows 150ms cubic-bezier(0.4, 0, 1, 1),
|
|
609
|
-
opacity 120ms cubic-bezier(0.4, 0, 1, 1);
|
|
610
|
-
}
|
|
611
|
-
[${e}][data-hidden="true"] > .we-section-body {
|
|
612
|
-
display: block;
|
|
613
|
-
overflow: hidden;
|
|
614
|
-
min-height: 0;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/* The frame stylesheet imposes flex-shrink:0 on the column's items from
|
|
618
|
-
outside the section; with the wrapper boxless the section IS that item,
|
|
619
|
-
so the same imposition lands here. Layered so an author utility on the
|
|
620
|
-
section root still wins, exactly as it does against the stylesheet's own
|
|
621
|
-
copy of this rule. */
|
|
622
|
-
@layer ${Sw} {
|
|
623
|
-
[${e}] > .we-section-body > * { flex-shrink: 0; }
|
|
624
|
-
}`}function $Q(e,t){const n=t?`#we-page {
|
|
625
|
-
padding: 0;
|
|
626
|
-
}`:`#we-page {
|
|
627
|
-
width: ${xs}px;
|
|
628
|
-
min-height: ${Oj}px;
|
|
629
|
-
overflow: hidden;
|
|
630
|
-
border-radius: ${y4}px;
|
|
631
|
-
background: #f5f3ee;
|
|
632
|
-
padding: 0;
|
|
633
|
-
}
|
|
634
|
-
/* The window this card stands for. The card's WIDTH is a real viewport, so
|
|
635
|
-
vw units and width queries need nothing from us; its HEIGHT is the page's
|
|
636
|
-
own measurement, which makes 100svh circular here — a section sized from it
|
|
637
|
-
asks for a window its own height is what produced, and climbs on every
|
|
638
|
-
pass. The window-height token is the seam that ends it: a section writes
|
|
639
|
-
the token instead of the unit, and here it is the screen this card is cut
|
|
640
|
-
from (the floor above), a constant that settles in one pass. Declared
|
|
641
|
-
UNLAYERED, unlike the document defaults: this is not a fallback a template
|
|
642
|
-
may better, it is what the window IS on this surface, and Concrete's own
|
|
643
|
-
declaration of the token is unlayered too. A page box takes none of this —
|
|
644
|
-
a frame document is given the window its format declares, so 100svh there
|
|
645
|
-
is already the truth. */
|
|
646
|
-
:root {
|
|
647
|
-
--concrete-window-h: ${Oj}px;
|
|
648
|
-
}`;return`
|
|
649
|
-
html, body {
|
|
650
|
-
margin: 0;
|
|
651
|
-
/* The host owns the scroll container; this document never scrolls —
|
|
652
|
-
not even programmatically (overflow: clip pins scrollTop to 0), so a
|
|
653
|
-
transient gap while the host syncs the iframe's height to the page
|
|
654
|
-
can never flash a scrollbar or shift a measured rect. */
|
|
655
|
-
overflow: clip;
|
|
656
|
-
}
|
|
657
|
-
/* Document defaults, NOT document truth: the theme's own body mapping is
|
|
658
|
-
what the published page renders with, so it must win here too — fonts and
|
|
659
|
-
wraps in the frame diverge from capture otherwise. The layer (pre-declared
|
|
660
|
-
by the srcdoc, see FRAME_DEFAULTS_LAYER) is what makes these lose to any
|
|
661
|
-
template declaration. */
|
|
662
|
-
@layer ${Sw} {
|
|
663
|
-
html, body {
|
|
664
|
-
background: transparent;
|
|
665
|
-
}
|
|
666
|
-
body {
|
|
667
|
-
color: #14180F;
|
|
668
|
-
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
${n}
|
|
672
|
-
${t?TQ(e.sectionInstanceId):RQ(e.sectionInstanceId)}
|
|
673
|
-
|
|
674
|
-
/* Slot wrapper -- structure only. No outline here; the host's overlay
|
|
675
|
-
ring handles slot hover + selection too. */
|
|
676
|
-
[${e.slotId}] {
|
|
677
|
-
cursor: pointer;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
/* Slot-group container -- the gaps between grouped members (dividers,
|
|
681
|
-
padding) carry no slot id, so give the group container itself
|
|
682
|
-
the pointer cursor: the whole group reads as one clickable unit, and
|
|
683
|
-
the overlay ring outlines this container. */
|
|
684
|
-
[${e.slotGroup}],
|
|
685
|
-
[${e.slotItem}] {
|
|
686
|
-
cursor: pointer;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/* Deliberately NO position default on the marker elements: published pages
|
|
690
|
-
and captured pages set no position on them, so an unpositioned slot
|
|
691
|
-
must compute static here too — a relative default (even layered, losing
|
|
692
|
-
to author utilities) re-anchored an author's absolutely positioned
|
|
693
|
-
descendant to the slot on this surface while the published page anchored
|
|
694
|
-
it farther up, and could shift stacking the same way. Nothing in the
|
|
695
|
-
chrome needs it: rings measure client rects from the host overlay, and
|
|
696
|
-
everything that mounts absolute chrome inside the frame (island shields,
|
|
697
|
-
the crop spinner) checks the surface's computed position and forces an
|
|
698
|
-
inline relative itself. */
|
|
699
|
-
|
|
700
|
-
@media (prefers-reduced-motion: reduce) {
|
|
701
|
-
[${e.sectionInstanceId}] {
|
|
702
|
-
transition: none !important;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
/* Render-error placeholder ------------------------------------- */
|
|
707
|
-
.we-render-error {
|
|
708
|
-
margin: 8px 0;
|
|
709
|
-
padding: 24px 16px;
|
|
710
|
-
border-radius: 6px;
|
|
711
|
-
border: 1px dashed #ebebe6;
|
|
712
|
-
background: #ffffff;
|
|
713
|
-
color: #8a877e;
|
|
714
|
-
font-size: 12.5px;
|
|
715
|
-
}
|
|
716
|
-
.we-render-error__title {
|
|
717
|
-
margin: 0;
|
|
718
|
-
color: #4a4842;
|
|
719
|
-
font-weight: 500;
|
|
720
|
-
}
|
|
721
|
-
.we-render-error__detail {
|
|
722
|
-
margin: 4px 0 0 0;
|
|
723
|
-
color: #b9b6ab;
|
|
724
|
-
font-size: 11.5px;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
/* Island interaction shield: a transparent click layer derived from a live
|
|
728
|
-
island's own markup (island-shields.ts) — a base shield per island root box,
|
|
729
|
-
an item shield per rendered list-item copy. Present until the shield's
|
|
730
|
-
owner carries the live-owner stamp; a click on a shield falls through to the
|
|
731
|
-
editor's resolver, which selects the nearest marked ancestor. Base z-index 1
|
|
732
|
-
sits on the island content's plane but below floating content that must stay
|
|
733
|
-
clickable at z-index 2 (e.g. the neighborhood card over the map canvas). Item
|
|
734
|
-
shields ride one plane above the base, so a click over an item copy hits the
|
|
735
|
-
ITEM's shield and one click selects that item. */
|
|
736
|
-
.${Ej} {
|
|
737
|
-
position: absolute;
|
|
738
|
-
inset: 0;
|
|
739
|
-
z-index: 1;
|
|
740
|
-
cursor: pointer;
|
|
741
|
-
background: transparent;
|
|
742
|
-
}
|
|
743
|
-
.${jj} { z-index: 2; }
|
|
744
|
-
[${ss}] .${Ej} { display: none; }
|
|
745
|
-
|
|
746
|
-
/* A selected item rises onto the item plane. Lifting its own shield is not
|
|
747
|
-
enough: the island's base shield covers the whole island, item included, so
|
|
748
|
-
the item's controls (a tab row, a toggle) would still sit under it. Only an
|
|
749
|
-
item rises — installShield already forced its position, so the z-index takes
|
|
750
|
-
without this sheet positioning any marker — and an unselected item's shield,
|
|
751
|
-
on the same plane and later in the DOM, still takes the first click. */
|
|
752
|
-
[${ss}]:has(> .${jj}) { z-index: 2; }
|
|
753
|
-
|
|
754
|
-
/* Image slider: until the slider's \`images\` slot is the live selection, its
|
|
755
|
-
z-index:2 nav arrows would paint above the z-index:1 shield and stay
|
|
756
|
-
clickable, escaping the select-first gate. Disable them so the shield
|
|
757
|
-
catches the first click; restored once .tr-slider carries data-we-live.
|
|
758
|
-
Editor-only — deliberately not in published tokens.css. */
|
|
759
|
-
.tr-slider:not([${ss}]) .tr-slider__nav { pointer-events: none; }
|
|
760
|
-
`}function zQ(e,t){const r=e/xs,i=Number.POSITIVE_INFINITY;return Math.max(.05,Math.min(.9,.72*r,.1926*r+.54,i))}const DQ=420,Aj=.92;function LQ(e,t,n){if(!n)return e;const r=Math.max(e,DQ/n.width),i=Math.min(.9,e*xs/n.width,Aj*t.availableWidthPx/n.width,Aj*t.availableHeightPx/n.height);return Math.max(.05,Math.min(r,i))}function Cj(e,t,n){var i;let r=e.closest(`[${t}]`);for(;r&&!co(r,n);)r=((i=r.parentElement)==null?void 0:i.closest(`[${t}]`))??null;return r}function IQ(e,t,n){for(const r of Array.from(e.querySelectorAll(`[${n.markers.slotId}]`))){if(r.closest(`[${n.markers.slotGroup}]`)!==e)continue;const i=r.getAttribute(n.markers.slotId);if(i&&n.isSlotEditable(t,i))return i}return null}function UQ(e,t,n){if(!e)return null;const r=e.closest(`[${n.markers.sectionInstanceId}]`),i=r==null?void 0:r.getAttribute(n.markers.sectionInstanceId);if(!r||!i)return null;const a=t.find(S=>S.instance_id===i),c={selection:{kind:"section",instance_id:i},element:r};if(!a)return c;const u=Cj(e,n.markers.slotGroup,n.markers);if(u&&r.contains(u)){const S=IQ(u,i,n);return S?{selection:{kind:"slot",instance_id:i,slot_id:S},element:u}:c}const f=Cj(e,n.markers.slotId,n.markers),p=f==null?void 0:f.getAttribute(n.markers.slotId);if(!f||!p||!n.isSlotEditable(i,p))return c;const y=wj(e,n.markers.slotItem,f,n.markers),m=y?Number(y.getAttribute(n.markers.slotItem)):NaN,x=Number.isInteger(m)?m:void 0,v=wj(e,n.markers.slotField,f,n.markers),_=(v==null?void 0:v.getAttribute(n.markers.slotField))??null,k=_&&n.isSlotEditable(i,p,_)?_:null;return{selection:{kind:"slot",instance_id:i,slot_id:p,...x!==void 0?{item_index:x}:{},...k?{field_name:k}:{}},element:(k?v:null)??y??f}}function ui(e){return e.section_display_name?e.section_display_name:e.section_key.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function b4(e){if(!e)return"null";let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function v4(e,t){var a;const n=t.createElement("div");n.className="we-render-error";const r=t.createElement("p");r.className="we-render-error__title",r.textContent="Couldn’t render this section.";const i=t.createElement("p");return i.className="we-render-error__detail",i.textContent=((a=e.render_error)==null?void 0:a.message)??"Unknown render error.",n.appendChild(r),n.appendChild(i),n}function PQ(e,t,n){const r=t.createElement("div");r.setAttribute(n.sectionInstanceId,e.instance_id),r.setAttribute("data-section-label",ui(e)),r.dataset.renderKey=e.render_key,r.dataset.htmlHash=b4(e.html);const i=t.createElement("div");return i.className="we-section-body",e.render_error||e.html===null?i.appendChild(v4(e,t)):i.innerHTML=e.html,r.appendChild(i),r}const FQ=`(function () {
|
|
761
|
-
function CaptureIntersectionObserver(callback, options) {
|
|
762
|
-
var opts = options || {};
|
|
763
|
-
this.root = opts.root || null;
|
|
764
|
-
this.rootMargin = opts.rootMargin || "0px";
|
|
765
|
-
var threshold = opts.threshold;
|
|
766
|
-
this.thresholds = Object.freeze(
|
|
767
|
-
Array.isArray(threshold) ? threshold.slice() : [typeof threshold === "number" ? threshold : 0],
|
|
768
|
-
);
|
|
769
|
-
this._callback = callback;
|
|
770
|
-
this._queued = [];
|
|
771
|
-
this._scheduled = false;
|
|
772
|
-
}
|
|
773
|
-
CaptureIntersectionObserver.prototype._flush = function () {
|
|
774
|
-
this._scheduled = false;
|
|
775
|
-
var entries = this._queued;
|
|
776
|
-
this._queued = [];
|
|
777
|
-
if (entries.length === 0) return;
|
|
778
|
-
this._callback(entries, this);
|
|
779
|
-
};
|
|
780
|
-
CaptureIntersectionObserver.prototype.observe = function (target) {
|
|
781
|
-
var rect = target.getBoundingClientRect();
|
|
782
|
-
this._queued.push({
|
|
783
|
-
target: target,
|
|
784
|
-
isIntersecting: true,
|
|
785
|
-
intersectionRatio: 1,
|
|
786
|
-
boundingClientRect: rect,
|
|
787
|
-
intersectionRect: rect,
|
|
788
|
-
rootBounds: new DOMRectReadOnly(0, 0, window.innerWidth, window.innerHeight),
|
|
789
|
-
time: performance.now(),
|
|
790
|
-
});
|
|
791
|
-
if (this._scheduled) return;
|
|
792
|
-
this._scheduled = true;
|
|
793
|
-
var observer = this;
|
|
794
|
-
Promise.resolve().then(function () {
|
|
795
|
-
observer._flush();
|
|
796
|
-
});
|
|
797
|
-
};
|
|
798
|
-
CaptureIntersectionObserver.prototype.unobserve = function () {};
|
|
799
|
-
CaptureIntersectionObserver.prototype.disconnect = function () {
|
|
800
|
-
this._queued = [];
|
|
801
|
-
};
|
|
802
|
-
CaptureIntersectionObserver.prototype.takeRecords = function () {
|
|
803
|
-
var entries = this._queued;
|
|
804
|
-
this._queued = [];
|
|
805
|
-
return entries;
|
|
806
|
-
};
|
|
807
|
-
window.IntersectionObserver = CaptureIntersectionObserver;
|
|
808
|
-
})();`;function ot(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function kl(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function BQ(e,t="column"){return x4(e.id,{...s4(e)},t)}function x4(e,t,n="column"){const r=Object.entries(t).map(([i,a])=>`${i}:${a}`).join(";");return{class:xv,dataFormat:e,style:r,...n==="row"?{dataDirection:"row"}:{}}}function Nj(e,t,n="column"){const r=BQ(e,n),i=r.dataDirection===void 0?"":`data-direction="${r.dataDirection}" `;return`<div class="${ot(r.class)}" data-format="${ot(r.dataFormat)}" ${i}style="${ot(r.style)}">${t.join("")}</div>`}function HQ(e){switch(e.destination){case"published":return KQ(e);case"capture":return GQ(e);case"canvas":return YQ(e)}}function qQ(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${FQ}<\/script>`]}const VQ="html, body { margin: 0; padding: 0; }";function ZQ(e){const t=[`rel="${e.rel}"`,`href="${ot(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${ot(e.sizes)}"`),e.type!==void 0&&t.push(`type="${ot(e.type)}"`),`<link ${t.join(" ")} />`}function KQ(e){const{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${ot(t.title)}</title>`,`<meta name="description" content="${ot(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${ot(t.canonical)}" />`);for(const i of t.icons??[])n.push(ZQ(i));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${ot(t.siteName)}" />`),n.push(`<meta property="og:title" content="${ot(t.title)}" />`),n.push(`<meta property="og:description" content="${ot(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${ot(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${ot(t.ogImage)}" />`),t.ogImageWidth&&n.push(`<meta property="og:image:width" content="${t.ogImageWidth}" />`),t.ogImageHeight&&n.push(`<meta property="og:image:height" content="${t.ogImageHeight}" />`),t.ogImageType&&n.push(`<meta property="og:image:type" content="${ot(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${ot(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${ot(t.title)}" />`),n.push(`<meta name="twitter:description" content="${ot(t.description)}" />`),n.push(`<meta name="twitter:image" content="${ot(t.ogImage)}" />`)),n.push(...k4(e.stylesheets)),n.push(..._4(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${kl({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}<\/script>`);const r=e.siteConfig?`
|
|
809
|
-
<script type="application/json" id="concrete-site-config">${kl(e.siteConfig)}<\/script>`:"";return w4({lang:t.lang??"en",head:n,body:` <body class="concrete-root">
|
|
810
|
-
${e.root.bodyHtml}${r}${S4(e.islands,"viewport")}
|
|
811
|
-
`+(e.analyticsJs===void 0?"":` <script type="module" src="${ot(e.analyticsJs.url)}"><\/script>
|
|
812
|
-
`)+" </body>"})}function GQ(e){const t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${ot(e.title)}</title>`),t.push(...k4(e.stylesheets));const n=[VQ,...JQ(e.root)];return t.push(eX(n)),t.push(...qQ(e.islands)),t.push(..._4(e.islands)),w4({lang:"en",head:t,body:` <body>${WQ(e.root)}${S4(e.islands,"eager")}</body>`})}function YQ(e){const t=e.stylesheets.hrefs.map(n=>`<link rel="stylesheet" href="${ot(n)}">`).join("");return`<!doctype html>
|
|
813
|
-
<html>
|
|
814
|
-
<head>
|
|
815
|
-
<meta charset="utf-8">
|
|
816
|
-
<base href="${ot(e.base)}">
|
|
817
|
-
<!-- Cascade-layer order is fixed by FIRST declaration, document-wide. The
|
|
818
|
-
kernel's document defaults must lose to everything a template declares,
|
|
819
|
-
so their layer is pre-declared here, before any template stylesheet,
|
|
820
|
-
pinning it below every layer those go on to declare. -->
|
|
821
|
-
<style>@layer ${e.defaultsLayer};</style>
|
|
822
|
-
${t}${XQ(e.islands)}
|
|
823
|
-
<style>${e.frameCss}</style>
|
|
824
|
-
</head>
|
|
825
|
-
<body>
|
|
826
|
-
<div id="${ot(e.root.id)}"${QQ(e.root)}></div>
|
|
827
|
-
</body>
|
|
828
|
-
</html>`}function QQ(e){if(!e.pageBox)return"";const t=x4(e.pageBox.formatId,e.pageBox.tokens,e.pageBox.direction);return` class="${ot(t.class)}" data-format="${ot(t.dataFormat)}"`+(t.dataDirection===void 0?"":` data-direction="${t.dataDirection}"`)+` style="${ot(t.style)}"`}function XQ(e){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";const t=e.hostScriptSrc?`
|
|
829
|
-
<script id="tr-island-host" type="module" src="${ot(e.hostScriptSrc)}"><\/script>`:"";return`${Object.keys(e.importMap).length===0?"":`
|
|
830
|
-
<script type="importmap">${kl({imports:e.importMap})}<\/script>`}
|
|
831
|
-
<script>window.__TR_ISLAND_MAP=${kl(e.islandMap)};<\/script>
|
|
832
|
-
<!-- id is the contract the host's readiness gate keys off — it waits on THIS
|
|
833
|
-
element's load event, not a timeout, so a slow cold first load still
|
|
834
|
-
activates without a refresh. -->${t}`}function w4(e){const t=e.head.map(n=>` ${n}`).join(`
|
|
835
|
-
`);return`<!doctype html>
|
|
836
|
-
<html lang="${ot(e.lang)}">
|
|
837
|
-
<head>
|
|
838
|
-
${t}
|
|
839
|
-
</head>
|
|
840
|
-
${e.body}
|
|
841
|
-
</html>
|
|
842
|
-
`}function WQ(e){return e.kind==="frame"?Nj(e.format,e.sectionHtml,e.direction):e.pages.map(t=>Nj(e.format,t.sectionHtml,t.direction)).join(`
|
|
843
|
-
`)}function JQ(e){return e.kind!=="frameStack"?[]:[`body > .${xv} { break-after: page; }`,`body > .${xv}:last-child { break-after: auto; }`]}function k4(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${ot(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function eX(e){const[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
|
|
844
|
-
${n.join(`
|
|
845
|
-
`)}
|
|
846
|
-
</style>`}function _4(e){if(e.kind!=="bundles"||Object.keys(e.islandMap).length===0)return[];const t=[`<script type="importmap">${kl({imports:e.reactVendorMap})}<\/script>`];for(const n of[e.runtime.url,...Object.values(e.reactVendorMap),e.reactVendorCore.url])t.push(`<link rel="modulepreload" href="${ot(n)}" />`);return t}function S4(e,t){return e.kind==="none"||Object.keys(e.islandMap).length===0?"":`
|
|
847
|
-
<script>window.__TR_ISLAND_MAP=${kl(e.islandMap)};${t==="eager"?' window.__TR_ISLAND_SCHEDULE = "eager";':""}<\/script>
|
|
848
|
-
<script type="module" src="${ot(e.runtime.url)}"><\/script>`}function tX(e){return Object.keys(e.islandMap).length===0?{kind:"none"}:{kind:"editorHost",islandMap:e.islandMap,importMap:e.importMap,hostScriptSrc:e.hostScriptSrc}}function nX(e,t,n){return HQ({destination:"canvas",root:{kind:"canvas",id:"we-page",...n?{pageBox:{formatId:n.formatId,tokens:n.tokens,...n.direction===void 0?{}:{direction:n.direction}}}:{}},islands:tX(e),stylesheets:{kind:"links",hrefs:e.stylesheets},base:e.basePath,defaultsLayer:Sw,frameCss:$Q(t,n)})}function rX(e){return!!(e!=null&&e.getElementById("we-page"))}function oX(e){return{srcdoc:(t=e.pageBox)=>nX(e.assets,e.markers,t),buildSectionWrapper:(t,n)=>PQ(t,n,e.markers),buildErrorPlaceholder:v4,resolveTarget:(t,n)=>UQ(t,n,e),resolveSelectionEl:(t,n)=>NQ(t,n,e.markers),resolveSelectionEls:(t,n)=>p4(t,n,e.markers),resolveVisibleSlotEls:(t,n)=>h4(t,n,e.markers),resolveItemEls:(t,n)=>CQ(t,n,e.markers),setLiveOwner:(t,n)=>g4(t,n,e.markers)}}const E4=(e,t)=>`<svg class="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${t}</svg>`;function j4(e){return E4(e,'<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/>')}function O4(e){return E4(e,'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>')}const iX=42,A4=16;function sX(e,t){const n=[];for(const i of e)for(n.push({sum:i.y,n:1,items:[i]});n.length>1;){const a=n[n.length-1],c=n[n.length-2];if(!a||!c)break;const u=a.sum/a.n-(a.n-1)/2*t,f=c.sum/c.n+(c.n-1)/2*t;if(u-f<t)n.splice(n.length-2,2,{sum:c.sum+a.sum,n:c.n+a.n,items:c.items.concat(a.items)});else break}const r={};for(const i of n){const a=i.sum/i.n-(i.n-1)/2*t;i.items.forEach((c,u)=>{r[c.idx]=a+u*t})}return r}const aX=j4("we-htab-eye-off"),lX=O4("we-htab-eye-on"),_v=new WeakMap;function cX(e,t,n,r){const i=e.createElement("button");i.type="button",i.className="we-htab",i.dataset.hiddenTab=t,i.title=`Show ${n}`,i.setAttribute("aria-label",`Show ${n}`),i.innerHTML=`<span class="we-htab-eye">${aX}${lX}</span><span class="we-htab-name"></span>`;const a=i.querySelector(".we-htab-name");return a&&(a.textContent=n),_v.set(i,r),i.addEventListener("click",c=>{var u;c.stopPropagation(),(u=_v.get(i))==null||u()}),i}function uX(e,t,n,r){const i=new Map;e.querySelectorAll(".we-htab").forEach(u=>{const f=u.dataset.hiddenTab;f&&i.set(f,u)});const a=new Set,c=[];for(const u of n){let f=i.get(u.instanceId);if(!f)f=cX(t,u.instanceId,u.label,()=>r(u.instanceId)),e.appendChild(f);else{const p=f.querySelector(".we-htab-name");p&&p.textContent!==u.label&&(p.textContent=u.label),f.title=`Show ${u.label}`,f.setAttribute("aria-label",`Show ${u.label}`),_v.set(f,()=>r(u.instanceId))}a.add(u.instanceId),c.push(f)}return i.forEach((u,f)=>{a.has(f)||u.remove()}),c}function Mj(e,t,n){const r=e.map((a,c)=>{const u=t(a.dataset.hiddenTab??""),f=u?u.getBoundingClientRect().top*n:0;return{idx:c,y:f}}),i=sX(r,iX);e.forEach((a,c)=>{a.style.top=`${i[c]}px`,a.style.left=`${A4-a.offsetWidth}px`})}const dX=48,fX=30,C4=`
|
|
849
|
-
@property --we-scale {
|
|
850
|
-
syntax: "<number>";
|
|
851
|
-
inherits: true;
|
|
852
|
-
initial-value: 1;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/* The scroll container + dotted canvas surface. The host lays this element
|
|
856
|
-
out — position and size are the host's (it must both bound the height and
|
|
857
|
-
be positioned, so the frame wrapper's offset parent is the stage);
|
|
858
|
-
everything inside is kernel-defined. Declaring position here would win
|
|
859
|
-
the cascade over a host's own positioning utility classes (this sheet
|
|
860
|
-
loads after theirs), which is how the app's absolutely-positioned stage
|
|
861
|
-
once silently became in-flow and unscrollable.
|
|
862
|
-
background-attachment: local makes the grid scroll together with
|
|
863
|
-
the page card so the canvas + website read as one scene being panned, not
|
|
864
|
-
a card sliding over a fixed grid. Padding aligns the page card with the
|
|
865
|
-
floating panel: top/bottom/left 20px; the right constant (40px) covers the
|
|
866
|
-
panel's right inset (20px) plus an equal 20px gap. Fallback 436px matches
|
|
867
|
-
the panel's base CSS width.
|
|
868
|
-
The top padding also carries the label lane: a page-title row is drawn
|
|
869
|
-
ABOVE its frame's box, so the topmost frame's row would otherwise sit in
|
|
870
|
-
the 20px margin. --we-frame-label-lane is set by the stage reconciler only
|
|
871
|
-
when some frame is labeled, so a canvas whose pages declare no label keeps
|
|
872
|
-
the original 20px exactly. */
|
|
873
|
-
.we-canvas-stage {
|
|
874
|
-
overflow: auto;
|
|
875
|
-
padding: calc(20px + var(--we-frame-label-lane, 0px))
|
|
876
|
-
calc(var(--we-panel-w, 436px) + 40px) 20px 20px;
|
|
877
|
-
transition: --we-scale 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
878
|
-
background-image: radial-gradient(rgba(20, 18, 13, 0.13) 1px, transparent 1.2px);
|
|
879
|
-
background-size: 20px 20px;
|
|
880
|
-
background-position: 10px 10px;
|
|
881
|
-
background-attachment: local;
|
|
882
|
-
scrollbar-width: none;
|
|
883
|
-
-ms-overflow-style: none;
|
|
884
|
-
}
|
|
885
|
-
.we-canvas-stage::-webkit-scrollbar { width: 0; height: 0; display: none; }
|
|
886
|
-
|
|
887
|
-
/* The scaled page card's layout box: exactly the iframe's visual footprint,
|
|
888
|
-
so the stage scrolls and centers the card correctly. Auto inline margins
|
|
889
|
-
rather than flex centering: they collapse to 0 when the card overflows the
|
|
890
|
-
stage, keeping the left edge reachable by scroll at high zoom.
|
|
891
|
-
|
|
892
|
-
isolation:isolate SEALS the canvas's own stacking hierarchy (tab layer,
|
|
893
|
-
page card, chrome overlay) into this element, so those z-indexes are
|
|
894
|
-
ordered only against each other and the whole card paints at the stage's
|
|
895
|
-
position in the HOST's DOM order. Without it the overlay competed
|
|
896
|
-
directly with the host's floating chrome -- a panel, a zoom toolbar, a
|
|
897
|
-
notice banner -- and a hover outline drew straight over the controls.
|
|
898
|
-
Same reasoning as the section wrappers' isolate in the frame document. */
|
|
899
|
-
.we-canvas-frame {
|
|
900
|
-
position: relative;
|
|
901
|
-
width: calc(var(--we-page-w, ${xs}px) * var(--we-scale, 1));
|
|
902
|
-
height: calc(var(--we-page-h, 0px) * var(--we-scale, 1));
|
|
903
|
-
margin-inline: auto;
|
|
904
|
-
isolation: isolate;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
/* The multi-frame stack: one frame per row, in the canvas's page order, each
|
|
908
|
-
centered on the same axis a lone page card already used (the auto inline
|
|
909
|
-
margins above), separated by a constant host-px gap plus whatever lane the
|
|
910
|
-
label chips need. Expressed as an adjacent-sibling rule so a single-frame
|
|
911
|
-
canvas matches no selector at all and lays out byte-identically to what it
|
|
912
|
-
did before frames could stack. The gap does NOT ride --we-scale: it is
|
|
913
|
-
chrome between two pages, not a part of either, so it stays the same
|
|
914
|
-
distance at any zoom. */
|
|
915
|
-
.we-canvas-frame + .we-canvas-frame {
|
|
916
|
-
margin-top: calc(${dX}px + var(--we-frame-label-lane, 0px));
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/* Page-title row -- "Front", "Back": which page of the canvas this frame
|
|
920
|
-
is, with the visibility toggle seated directly beside the name it acts
|
|
921
|
-
on (one group, never split across the page's corners). Drawn ABOVE the
|
|
922
|
-
frame's box (bottom: 100%, in the lane the stage padding and the
|
|
923
|
-
inter-frame gap reserve) so it never covers artwork, and sized in
|
|
924
|
-
--we-content like the edge tabs: constant visual size at any zoom,
|
|
925
|
-
because it names the page rather than belonging to it.
|
|
926
|
-
pointer-events:none at the row so the lane's empty run stays stage
|
|
927
|
-
surface (a deselect click must fall through); the toggle re-enables its
|
|
928
|
-
own. */
|
|
929
|
-
.we-frame-titlebar {
|
|
930
|
-
position: absolute;
|
|
931
|
-
bottom: 100%;
|
|
932
|
-
left: 0;
|
|
933
|
-
right: 0;
|
|
934
|
-
margin-bottom: calc(4 * var(--we-content, 1px));
|
|
935
|
-
display: flex;
|
|
936
|
-
align-items: center;
|
|
937
|
-
gap: calc(6 * var(--we-content, 1px));
|
|
938
|
-
pointer-events: none;
|
|
939
|
-
}
|
|
940
|
-
/* Quiet by design: the row annotates the artwork below it, so it reads in
|
|
941
|
-
a light gray that cedes attention to the page — the ink weights are
|
|
942
|
-
reserved for the states that earn them (hover, the engaged toggle). */
|
|
943
|
-
.we-canvas-frame-label {
|
|
944
|
-
min-width: 0;
|
|
945
|
-
overflow: hidden;
|
|
946
|
-
text-overflow: ellipsis;
|
|
947
|
-
white-space: nowrap;
|
|
948
|
-
color: #a09d94;
|
|
949
|
-
font-size: calc(13 * var(--we-content, 1px));
|
|
950
|
-
font-weight: 500;
|
|
951
|
-
letter-spacing: -0.01em;
|
|
952
|
-
line-height: 1;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
/* Page-visibility toggle -- the eye beside the page title, resting in the
|
|
956
|
-
title's own gray so the row reads as one quiet group. Rendered only
|
|
957
|
-
for pages the composition marks optional (frame-visibility.ts). */
|
|
958
|
-
.we-frame-toggle {
|
|
959
|
-
flex: 0 0 auto;
|
|
960
|
-
display: grid;
|
|
961
|
-
place-items: center;
|
|
962
|
-
width: calc(24 * var(--we-content, 1px));
|
|
963
|
-
height: calc(22 * var(--we-content, 1px));
|
|
964
|
-
padding: 0;
|
|
965
|
-
border: 0;
|
|
966
|
-
border-radius: calc(6 * var(--we-content, 1px));
|
|
967
|
-
background: transparent;
|
|
968
|
-
color: #a09d94;
|
|
969
|
-
cursor: pointer;
|
|
970
|
-
pointer-events: auto;
|
|
971
|
-
transition: background-color 0.15s, color 0.15s;
|
|
972
|
-
}
|
|
973
|
-
.we-frame-toggle svg {
|
|
974
|
-
width: calc(14 * var(--we-content, 1px));
|
|
975
|
-
height: calc(14 * var(--we-content, 1px));
|
|
976
|
-
}
|
|
977
|
-
.we-frame-toggle:hover {
|
|
978
|
-
background: rgba(20, 18, 13, 0.06);
|
|
979
|
-
color: #14180F;
|
|
980
|
-
}
|
|
981
|
-
.we-frame-toggle:focus-visible {
|
|
982
|
-
outline: none;
|
|
983
|
-
background: rgba(20, 18, 13, 0.06);
|
|
984
|
-
color: #14180F;
|
|
985
|
-
box-shadow: 0 0 0 2px rgba(15, 42, 34, 0.5);
|
|
986
|
-
}
|
|
987
|
-
/* Hidden state reads as an engaged control (the section eye's hidden
|
|
988
|
-
treatment): filled box, full-ink glyph. */
|
|
989
|
-
.we-frame-toggle[data-page-visibility="hidden"] {
|
|
990
|
-
background: rgba(20, 18, 13, 0.06);
|
|
991
|
-
color: #14180F;
|
|
992
|
-
box-shadow: inset 0 0 0 1px #ebebe6;
|
|
993
|
-
}
|
|
994
|
-
/* Hidden page -- tinted to a clear deactivated state, in place and at full
|
|
995
|
-
footprint (a page never collapses the way a hidden section does), still
|
|
996
|
-
fully interactive: the tint says "excluded from the output", not
|
|
997
|
-
"locked". The title strikes through and lightens, the same reading as a
|
|
998
|
-
fully-hidden canvas's bar tab. The stamp is written by
|
|
999
|
-
frame-visibility.ts. */
|
|
1000
|
-
.we-canvas-frame[data-page-hidden="true"] > iframe {
|
|
1001
|
-
filter: grayscale(1) opacity(0.55);
|
|
1002
|
-
}
|
|
1003
|
-
.we-canvas-frame[data-page-hidden="true"] > .we-frame-titlebar > .we-canvas-frame-label {
|
|
1004
|
-
text-decoration: line-through;
|
|
1005
|
-
color: #b6b3aa;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/* The frame document: unscaled ${xs}px layout, scaled here as an
|
|
1009
|
-
element. The border-radius matches #we-page inside, so the card shadow
|
|
1010
|
-
follows the content's silhouette; both radius and shadow ride the
|
|
1011
|
-
transform, exactly as they rode the old in-document scaling. z-index 2
|
|
1012
|
-
stacks the card above the edge tabs (z-index 1) so the shadow falls over a
|
|
1013
|
-
tab's tucked-under inner edge, nestling it against the page. */
|
|
1014
|
-
.we-canvas-frame > iframe {
|
|
1015
|
-
display: block;
|
|
1016
|
-
border: 0;
|
|
1017
|
-
background: transparent;
|
|
1018
|
-
width: var(--we-page-w, ${xs}px);
|
|
1019
|
-
height: var(--we-page-h, 0px);
|
|
1020
|
-
border-radius: var(--we-page-radius, ${y4}px);
|
|
1021
|
-
box-shadow:
|
|
1022
|
-
0 1px 0 rgba(20,18,13,0.06),
|
|
1023
|
-
0 2px 6px -2px rgba(20,18,13,0.10),
|
|
1024
|
-
0 12px 28px -8px rgba(20,18,13,0.18),
|
|
1025
|
-
0 32px 64px -20px rgba(20,18,13,0.28);
|
|
1026
|
-
transform: scale(var(--we-scale, 1));
|
|
1027
|
-
transform-origin: 0 0;
|
|
1028
|
-
position: relative;
|
|
1029
|
-
z-index: 2;
|
|
1030
|
-
transition: filter 0.2s ease;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
/* Chrome overlay -- sized to the frame wrapper, i.e. the scaled page card,
|
|
1034
|
-
so x=0/y=0 is the page's top-left corner. overflow stays visible: a ring
|
|
1035
|
-
at the page boundary or a label straddling the top border extends past
|
|
1036
|
-
the card and must not clip. pointer-events:none so clicks pass through to
|
|
1037
|
-
the iframe underneath.
|
|
1038
|
-
|
|
1039
|
-
Positioning contract: chrome.ts measures a target in the FRAME document
|
|
1040
|
-
(layout truth — that document never scales or scrolls) and writes the
|
|
1041
|
-
rect as custom properties on the ring/label; the formulas here scale it
|
|
1042
|
-
into host space. Keeping the formula in the stylesheet and the data in
|
|
1043
|
-
properties is what lets a transitioned --we-scale move every ring in
|
|
1044
|
-
lockstep with the iframe's own animated transform. The ring's offset
|
|
1045
|
-
(its inflation past the target's edge) stays OUTSIDE the multiplication:
|
|
1046
|
-
constant host px at any zoom.
|
|
1047
|
-
|
|
1048
|
-
z-index 3 -- one step above the page card, and nothing more: the frame's
|
|
1049
|
-
isolate is what keeps the chrome under the host's own UI, so a large
|
|
1050
|
-
value here would buy nothing and read as an escape hatch.
|
|
1051
|
-
|
|
1052
|
-
A CLASS, not an id: every frame on the stage carries one of these, and the
|
|
1053
|
-
chrome functions are handed the overlay rather than resolving it by
|
|
1054
|
-
document-global id. */
|
|
1055
|
-
.we-chrome-overlay {
|
|
1056
|
-
position: absolute;
|
|
1057
|
-
inset: 0;
|
|
1058
|
-
pointer-events: none;
|
|
1059
|
-
z-index: 3;
|
|
1060
|
-
}
|
|
1061
|
-
.we-chrome-ring {
|
|
1062
|
-
position: absolute;
|
|
1063
|
-
pointer-events: none;
|
|
1064
|
-
border: 2px solid transparent;
|
|
1065
|
-
border-radius: 6px;
|
|
1066
|
-
opacity: 0;
|
|
1067
|
-
box-sizing: border-box;
|
|
1068
|
-
top: calc(var(--we-r-top, 0px) * var(--we-scale, 1) - var(--we-r-off, 0px));
|
|
1069
|
-
left: calc(var(--we-r-left, 0px) * var(--we-scale, 1) - var(--we-r-off, 0px));
|
|
1070
|
-
width: calc(var(--we-r-w, 0px) * var(--we-scale, 1) + 2 * var(--we-r-off, 0px));
|
|
1071
|
-
height: calc(var(--we-r-h, 0px) * var(--we-scale, 1) + 2 * var(--we-r-off, 0px));
|
|
1072
|
-
}
|
|
1073
|
-
/* Hover ring -- instant on cursor arrival, fades out on leave.
|
|
1074
|
-
Position updates instantly (no top/left transition) so dragging
|
|
1075
|
-
across elements never flickers. Ink stroke + white drop-shadow
|
|
1076
|
-
halo keeps the ring readable on both light sections and dark ones. */
|
|
1077
|
-
.we-chrome-ring--hover {
|
|
1078
|
-
border-color: rgba(15,42,34,0.85);
|
|
1079
|
-
filter: drop-shadow(0 0 1px rgba(255,255,255,0.95));
|
|
1080
|
-
transition: opacity 70ms ease-in;
|
|
1081
|
-
}
|
|
1082
|
-
.we-chrome-ring--hover[data-active="true"] {
|
|
1083
|
-
opacity: 1;
|
|
1084
|
-
transition: opacity 100ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1085
|
-
}
|
|
1086
|
-
/* Selection ring -- appears instantly (continuous with hover),
|
|
1087
|
-
then morphs ink → gold. No position transition so resize
|
|
1088
|
-
tracking stays tight. Same ink + white halo as hover. */
|
|
1089
|
-
.we-chrome-ring--selection {
|
|
1090
|
-
border-color: rgba(15,42,34,0.85);
|
|
1091
|
-
filter: drop-shadow(0 0 1px rgba(255,255,255,0.95));
|
|
1092
|
-
transform: scale(1);
|
|
1093
|
-
box-shadow: none;
|
|
1094
|
-
transition:
|
|
1095
|
-
opacity 50ms ease-in,
|
|
1096
|
-
border-color 160ms cubic-bezier(0.2, 0, 0, 1),
|
|
1097
|
-
box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
|
|
1098
|
-
}
|
|
1099
|
-
.we-chrome-ring--selection[data-active="true"] {
|
|
1100
|
-
opacity: 1;
|
|
1101
|
-
/* Instant show on select; only border + glow animate */
|
|
1102
|
-
transition:
|
|
1103
|
-
opacity 0ms,
|
|
1104
|
-
border-color 180ms cubic-bezier(0.2, 0, 0, 1),
|
|
1105
|
-
box-shadow 180ms cubic-bezier(0.2, 0, 0, 1);
|
|
1106
|
-
}
|
|
1107
|
-
.we-chrome-ring--selection[data-kind="section"],
|
|
1108
|
-
.we-chrome-ring--selection[data-kind="slot"] {
|
|
1109
|
-
border-color: #E5B832;
|
|
1110
|
-
filter: drop-shadow(0 0 1px rgba(255,255,255,0.95));
|
|
1111
|
-
box-shadow: 0 0 0 1px rgba(229,184,50,0.25), 0 8px 24px -10px rgba(229,184,50,0.35);
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
/* Geometry guides -- the trim line and the bleed region for a rendered-class
|
|
1115
|
-
page. The overlay is the page (bleed) box exactly, so insetting all four
|
|
1116
|
-
sides by the declared bleed gives the trim box with no arithmetic: the
|
|
1117
|
-
border draws the trim line and the shadow's spread fills the band between
|
|
1118
|
-
trim and page edge. Data/formula split as for the rings — guides.ts writes
|
|
1119
|
-
--we-g-bleed in frame space, the multiplication happens here, so a
|
|
1120
|
-
transitioned zoom moves the guides with the card. The 1px line itself
|
|
1121
|
-
stays OUTSIDE the multiplication: constant host px at any zoom, like the
|
|
1122
|
-
ring's offset.
|
|
1123
|
-
|
|
1124
|
-
Magenta rather than the chrome's ink/gold: a guide is an instrument about
|
|
1125
|
-
the output, never a selection, and the print convention reads instantly.
|
|
1126
|
-
The inset white hairline keeps the line legible over dark artwork, the
|
|
1127
|
-
role the rings' drop-shadow halo plays for them. First child of the
|
|
1128
|
-
overlay, so rings and the title pill paint above it. */
|
|
1129
|
-
.we-guide {
|
|
1130
|
-
position: absolute;
|
|
1131
|
-
box-sizing: border-box;
|
|
1132
|
-
pointer-events: none;
|
|
1133
|
-
opacity: 0;
|
|
1134
|
-
top: calc(var(--we-g-bleed, 0px) * var(--we-scale, 1));
|
|
1135
|
-
right: calc(var(--we-g-bleed, 0px) * var(--we-scale, 1));
|
|
1136
|
-
bottom: calc(var(--we-g-bleed, 0px) * var(--we-scale, 1));
|
|
1137
|
-
left: calc(var(--we-g-bleed, 0px) * var(--we-scale, 1));
|
|
1138
|
-
border: 1px solid rgba(214,32,140,0.9);
|
|
1139
|
-
box-shadow:
|
|
1140
|
-
inset 0 0 0 1px rgba(255,255,255,0.55),
|
|
1141
|
-
0 0 0 calc(var(--we-g-bleed, 0px) * var(--we-scale, 1)) rgba(214,32,140,0.16);
|
|
1142
|
-
transition: opacity 90ms ease-in;
|
|
1143
|
-
}
|
|
1144
|
-
.we-guide[data-active="true"] { opacity: 1; }
|
|
1145
|
-
|
|
1146
|
-
/* Section title pill -- straddles the selection's top border; geometry set
|
|
1147
|
-
by chrome.ts as custom properties, same contract as the rings. The left
|
|
1148
|
-
indent is constant host px. Sections only; slots get the outline ring but
|
|
1149
|
-
no on-canvas label. */
|
|
1150
|
-
.we-chrome-label {
|
|
1151
|
-
position: absolute;
|
|
1152
|
-
top: calc(var(--we-l-top, 0px) * var(--we-scale, 1));
|
|
1153
|
-
left: calc(var(--we-l-left, 0px) * var(--we-scale, 1) + var(--we-l-indent, 0px));
|
|
1154
|
-
pointer-events: none;
|
|
1155
|
-
z-index: 1;
|
|
1156
|
-
background: rgba(229,184,50,0.95);
|
|
1157
|
-
color: #282c32;
|
|
1158
|
-
padding: 3px 8px;
|
|
1159
|
-
border-radius: 4px;
|
|
1160
|
-
font-size: 10.5px;
|
|
1161
|
-
font-weight: 600;
|
|
1162
|
-
line-height: 1;
|
|
1163
|
-
white-space: nowrap;
|
|
1164
|
-
opacity: 0;
|
|
1165
|
-
transform: translateY(calc(-50% - 4px)) scale(0.96);
|
|
1166
|
-
transition:
|
|
1167
|
-
opacity 60ms ease-in,
|
|
1168
|
-
transform 60ms ease-in;
|
|
1169
|
-
}
|
|
1170
|
-
.we-chrome-label[data-active="true"] {
|
|
1171
|
-
opacity: 1;
|
|
1172
|
-
transform: translateY(-50%) scale(1);
|
|
1173
|
-
transition:
|
|
1174
|
-
opacity 130ms cubic-bezier(0.16, 1, 0.3, 1) 50ms,
|
|
1175
|
-
transform 130ms cubic-bezier(0.16, 1, 0.3, 1) 50ms;
|
|
1176
|
-
}
|
|
1177
|
-
/* A section that starts the page: the pill keeps its seat on the top border
|
|
1178
|
-
but starts no further left than the page-title row's end (--we-l-clear,
|
|
1179
|
-
host px, from chrome.ts), so it sits beside the title, never over it. */
|
|
1180
|
-
.we-chrome-label[data-clear-title="true"] {
|
|
1181
|
-
left: max(
|
|
1182
|
-
calc(var(--we-l-left, 0px) * var(--we-scale, 1) + var(--we-l-indent, 0px)),
|
|
1183
|
-
var(--we-l-clear, 0px)
|
|
1184
|
-
);
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
/* Hidden-section edge tabs -------------------------------------
|
|
1188
|
-
One dim chip-tab per hidden section, pinned to the page card's left edge
|
|
1189
|
-
at the collapsed wrapper's reflow seam. Built + positioned by the host
|
|
1190
|
-
orchestrator; de-collided via placeTabs. Constant visual size at any zoom
|
|
1191
|
-
— the layer sits outside the scaled iframe. --we-content is the host's
|
|
1192
|
-
interior scaling unit (its large-screen chrome scale); a host without one
|
|
1193
|
-
leaves the 1px fallback in force. A class for the same reason the overlay
|
|
1194
|
-
is one: one tab layer per frame, addressed through that frame's handle. */
|
|
1195
|
-
.we-htabs {
|
|
1196
|
-
position: absolute;
|
|
1197
|
-
inset: 0;
|
|
1198
|
-
pointer-events: none;
|
|
1199
|
-
z-index: 1;
|
|
1200
|
-
}
|
|
1201
|
-
.we-htab {
|
|
1202
|
-
position: absolute;
|
|
1203
|
-
transform: translateY(-50%);
|
|
1204
|
-
display: flex;
|
|
1205
|
-
align-items: center;
|
|
1206
|
-
gap: calc(9 * var(--we-content, 1px));
|
|
1207
|
-
height: calc(34 * var(--we-content, 1px));
|
|
1208
|
-
padding: 0 calc(${12+A4} * var(--we-content, 1px)) 0 calc(13 * var(--we-content, 1px));
|
|
1209
|
-
background: #ffffff;
|
|
1210
|
-
border: 1px solid #ebebe6;
|
|
1211
|
-
border-radius: calc(9 * var(--we-content, 1px)) 0 0 calc(9 * var(--we-content, 1px));
|
|
1212
|
-
box-shadow: 0 10px 24px -12px rgba(20,18,13,0.34);
|
|
1213
|
-
color: #4a4842;
|
|
1214
|
-
font: inherit;
|
|
1215
|
-
cursor: pointer;
|
|
1216
|
-
opacity: 1;
|
|
1217
|
-
pointer-events: auto;
|
|
1218
|
-
transition: transform 0.2s cubic-bezier(0.2,0.7,0.3,1),
|
|
1219
|
-
border-color 0.18s, box-shadow 0.18s;
|
|
1220
|
-
}
|
|
1221
|
-
.we-htab-eye {
|
|
1222
|
-
display: grid;
|
|
1223
|
-
place-items: center;
|
|
1224
|
-
flex: 0 0 auto;
|
|
1225
|
-
color: #8a877e;
|
|
1226
|
-
transition: color 0.18s;
|
|
1227
|
-
}
|
|
1228
|
-
.we-htab-eye svg { width: calc(14 * var(--we-content, 1px)); height: calc(14 * var(--we-content, 1px)); }
|
|
1229
|
-
.we-htab-name {
|
|
1230
|
-
font-size: calc(13 * var(--we-content, 1px));
|
|
1231
|
-
font-weight: 600;
|
|
1232
|
-
letter-spacing: -0.01em;
|
|
1233
|
-
color: #14180F;
|
|
1234
|
-
white-space: nowrap;
|
|
1235
|
-
}
|
|
1236
|
-
.we-htab:hover {
|
|
1237
|
-
transform: translateY(-50%) scale(1.07);
|
|
1238
|
-
border-color: rgba(15,42,34,0.5);
|
|
1239
|
-
box-shadow: 0 13px 30px -12px rgba(15,42,34,0.45);
|
|
1240
|
-
}
|
|
1241
|
-
.we-htab:hover .we-htab-eye { color: #0F2A22; }
|
|
1242
|
-
.we-htab:focus-visible {
|
|
1243
|
-
outline: none;
|
|
1244
|
-
transform: translateY(-50%) scale(1.07);
|
|
1245
|
-
border-color: #0F2A22;
|
|
1246
|
-
box-shadow: 0 0 0 3px #F3F6EF, 0 13px 30px -12px rgba(15,42,34,0.45);
|
|
1247
|
-
}
|
|
1248
|
-
/* Hover/focus swaps the eye-off glyph to the eye glyph in place — no width
|
|
1249
|
-
change, no sliding label. Only one glyph is in flow at a time, so the eye
|
|
1250
|
-
slot's grid keeps the shown glyph centered. */
|
|
1251
|
-
.we-htab-eye-on { display: none; }
|
|
1252
|
-
.we-htab:hover .we-htab-eye-off,
|
|
1253
|
-
.we-htab:focus-visible .we-htab-eye-off { display: none; }
|
|
1254
|
-
.we-htab:hover .we-htab-eye-on,
|
|
1255
|
-
.we-htab:focus-visible .we-htab-eye-on { display: block; }
|
|
1256
|
-
|
|
1257
|
-
@media (prefers-reduced-motion: reduce) {
|
|
1258
|
-
.we-canvas-stage,
|
|
1259
|
-
.we-canvas-frame > iframe,
|
|
1260
|
-
.we-chrome-ring,
|
|
1261
|
-
.we-chrome-label,
|
|
1262
|
-
.we-guide,
|
|
1263
|
-
.we-htab,
|
|
1264
|
-
.we-frame-toggle {
|
|
1265
|
-
transition: none !important;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
`,hX='<div class="we-guide"></div><div class="we-chrome-ring we-chrome-ring--hover"></div><div class="we-chrome-ring we-chrome-ring--selection"></div><div class="we-chrome-label"></div>',Sv="we-canvas-frame",Ev="we-frame-titlebar",Rj="we-canvas-frame-label",Tj="we-htabs",$j="we-chrome-overlay";function Yy(e,t,n){const r=e.querySelector(t);if(r)return r;const i=n();return e.appendChild(i),i}function N4(e,t){const n=e.querySelector(`:scope > .${Ev}`);if(n)return n;const r=t.createElement("div");return r.className=Ev,e.insertBefore(r,e.firstChild),r}function pX(e){for(let t=e.nextElementSibling;t;t=t.nextElementSibling)if(t.classList.contains(Sv))return t;return null}function mX(e,t){const n=e.ownerDocument,r=N4(e,n),i=t.label??"",a=r.querySelector(`:scope > .${Rj}`);if(i==="")a==null||a.remove();else{const y=a??r.insertBefore(n.createElement("div"),r.firstChild);y.className=Rj,y.textContent!==i&&(y.textContent=i)}const c=Yy(e,":scope > iframe",()=>n.createElement("iframe"));t.title!==void 0&&c.title!==t.title&&(c.title=t.title),t.sandbox!==void 0&&c.getAttribute("sandbox")!==t.sandbox&&c.setAttribute("sandbox",t.sandbox),c.getAttribute("srcdoc")!==t.srcdoc&&c.setAttribute("srcdoc",t.srcdoc);const u=Yy(e,`:scope > .${Tj}`,()=>{const y=n.createElement("div");return y.className=Tj,y}),f=Yy(e,`:scope > .${$j}`,()=>{const y=n.createElement("div");return y.className=$j,y.setAttribute("aria-hidden","true"),y});f.childElementCount===0&&(f.innerHTML=hX);const p=t.pageBox;return p?(e.style.setProperty("--we-page-w",`${p.width}px`),e.style.setProperty("--we-page-h",`${p.height}px`),e.style.setProperty("--we-page-radius","0px")):(e.style.removeProperty("--we-page-w"),e.style.removeProperty("--we-page-radius")),{iframe:c,overlay:f,tabLayer:u}}function gX(e,t,n){const{iframe:r}=n;return{key:t,wrapper:e,iframe:r,overlay:n.overlay,tabLayer:n.tabLayer,get doc(){return r.contentDocument},setPageHeight(i){e.style.setProperty("--we-page-h",`${i}px`)}}}function yX(e,t){const n=e.ownerDocument,r=new Map;for(const f of Array.from(e.querySelectorAll(`:scope > .${Sv}`))){const p=f.dataset.frameKey;p!==void 0&&r.set(p,f)}const i=[],a=[],c=new Set;for(const f of t){let p=r.get(f.key);p||(p=n.createElement("div"),p.className=Sv,p.dataset.frameKey=f.key);const y=mX(p,f);i.push(p),c.add(f.key),a.push(gX(p,f.key,y))}let u=null;for(let f=i.length-1;f>=0;f--){const p=i[f];p&&((p.parentNode!==e||pX(p)!==u)&&e.insertBefore(p,u),u=p)}return r.forEach((f,p)=>{c.has(p)||f.remove()}),t.some(f=>(f.label??"")!=="")?e.style.setProperty("--we-frame-label-lane",`${fX}px`):e.style.removeProperty("--we-frame-label-lane"),a}function bX(e,t,n){const r=[];for(const i of e){const a=i.doc;if(!a)continue;const c=t.resolveSelectionEls(a,n);c.length>0&&r.push({handle:i,els:c})}return r}const zj="we-frame-toggle",Dj=new WeakMap;function vX(e,t,n,r){e.dataset.pageHidden=n.hidden?"true":"false";let i=e.querySelector(`:scope > .${Ev} > .${zj}`);if(!n.toggleable){i==null||i.remove();return}i||(i=t.createElement("button"),i.type="button",i.className=zj,i.addEventListener("click",p=>{var y;p.stopPropagation(),(y=Dj.get(i))==null||y()}),N4(e,t).appendChild(i)),Dj.set(i,r);const a=n.hidden?"hidden":"visible";i.dataset.pageVisibility!==a&&(i.dataset.pageVisibility=a,i.innerHTML=n.hidden?j4("we-frame-toggle-glyph"):O4("we-frame-toggle-glyph"));const c=n.hidden?"Hidden page":"Visible page",u=`${n.hidden?"Show":"Hide"} ${n.label}`;i.title!==c&&(i.title=c),i.getAttribute("aria-label")!==u&&i.setAttribute("aria-label",u);const f=n.hidden?"true":"false";i.getAttribute("aria-pressed")!==f&&i.setAttribute("aria-pressed",f)}function xX(e,t){const n=e==null?void 0:e.querySelector(":scope > .we-guide");if(n){if(t===null){n.removeAttribute("data-active");return}n.style.setProperty("--we-g-bleed",`${t}px`),n.setAttribute("data-active","true")}}const wX=24;function kX(e,t,n,r){if(e.height+2*r<=t)return e.top>=r&&e.bottom<=t-r?null:e.top<r?Math.max(0,n+e.top-r):Math.max(0,n+e.bottom-(t-r));const a=Math.max(0,n+e.top-r);return Math.abs(a-n)<1?null:a}const Lj="__trEditorBridge",_X=1,M4=new WeakMap;function SX(e){return e?e.kind==="section"?{kind:"section",instanceId:e.instance_id}:{kind:"slot",instanceId:e.instance_id,slotId:e.slot_id,...e.item_index!==void 0?{itemIndex:e.item_index}:{},...e.field_name!==void 0?{fieldName:e.field_name}:{}}:null}function EX(e){const t=e[Lj];if(t)return t;const n=new Set,r={protocol:_X,selection:null,subscribe(i){return n.add(i),()=>{n.delete(i)}}};return M4.set(r,n),e[Lj]=r,r}function jX(e,t,n){if(!e||!t)return;const i=EX(e);i.selection=SX(n);for(const a of[...M4.get(i)??[]])a()}function R4({children:e}){return h.jsx("div",{className:"relative -mx-7 -mt-5.5 -mb-20 max-[73.75rem]:-mx-5",children:h.jsx("div",{className:"relative min-h-[480px] overflow-hidden bg-[#fafaf8] h-[calc(100dvh-var(--we-top-h,92px))]",children:e})})}function T4({children:e}){return h.jsxs(R4,{children:[h.jsx("div",{className:"we-canvas-stage absolute inset-0","aria-hidden":"true",children:h.jsx("style",{children:C4})}),h.jsx("div",{className:"absolute inset-0 grid place-items-center p-6",children:e})]})}const OX={},AX=[];function CX({ports:e,children:t}){const n=Ee(c=>c.session.fill_holders.processing??OX),r=Ee(c=>c.session.fill_holders.failed_crops??AX),i=Ee(c=>c.awaitedCuts),a=w.useMemo(()=>({...e,isMediaProcessing:(c,u)=>Object.hasOwn(n,c)&&(n[c]??[]).includes(u)||i.some(f=>vw(f,c,u)),cropFailedAt:(c,u)=>_M(r,c,u)}),[e,n,r,i]);return h.jsx(ZN,{ports:a,children:t})}function Jh(e){return(e==null?void 0:e.kind)==="section-settings"?{kind:"section",instance_id:e.instance_id}:e}function $4(e,t){return e.find(n=>n.page_ids.includes(t))}function NX(e,t){if(!t)return[];const n=new Map(e.map(r=>[r.id,r]));return t.page_ids.map(r=>n.get(r)).filter(r=>r!==void 0)}function gh(e,t){const n=t.find(r=>r.path==="/");return(n?$4(e,n.id):void 0)??e[0]}function Ou(e,t){const n=new Set(t);return e.filter(r=>n.has(r.id)).flatMap(r=>r.page_ids)}const MX={sectionInstanceId:ro,slotId:Bh,slotItem:KR,slotField:Kx,slotUnselectable:GR};function ep(e){return(e==null?void 0:e.__trIslands)??null}function RX(e,t,n){const r=()=>{};if(!e||!t)return r;if(ep(e))return n(),r;const i=t.getElementById("tr-island-host");if(!i)return r;const a=()=>{ep(e)&&n()},c=()=>{i.removeEventListener("load",a),i.removeEventListener("error",c)};return i.addEventListener("load",a),i.addEventListener("error",c),c}function Ij(e,t){var n;(n=ep(e))==null||n.hydrateSection(t)}function jv(e,t){var n;(n=ep(e))==null||n.unmountSection(t)}function TX(e,t){t.querySelectorAll(".we-section-body").forEach(n=>jv(e,n)),t.remove()}function Qy(e,t){g4(e,Jh(t),MX)}function $X(e,t){const n=e.createElement("div");n.innerHTML=t;const r=Array.from(n.querySelectorAll("img"));for(const c of r)c.loading==="lazy"&&(c.loading="eager");const i=r.filter(c=>!(c.complete&&c.naturalWidth>0)),a=Promise.all(i.map(c=>typeof c.decode=="function"?c.decode().catch(()=>{}):Promise.resolve())).then(()=>{});return{holder:n,loaded:i.length===0,ready:a}}function zX(e,t){const n=new DOMParser().parseFromString(t,"text/html"),r=Array.from(n.querySelectorAll("img")).filter(i=>Uj.test(i.getAttribute("src")??"")||Uj.test(i.getAttribute("srcset")??"")).map(i=>{var f;const a=((f=i.parentElement)==null?void 0:f.tagName)==="PICTURE"?i.parentElement:i,c=e.importNode(a,!0),u=c.tagName==="IMG"?c:c.querySelector("img");return u===null?Promise.resolve():(u.loading==="lazy"&&(u.loading="eager"),typeof u.decode=="function"?u.decode().catch(()=>{}):Promise.resolve())});return Promise.all(r).then(()=>{})}const Uj=/(^|[\s,])https?:\/\//;function z4(e,t){return new Promise(n=>{const r=setTimeout(n,t);e.then(()=>{clearTimeout(r),n()},()=>{clearTimeout(r),n()})})}const DX=4e3,Yf=new WeakMap;function LX(e,t,n,r){const i=e.ownerDocument.defaultView;if(t.render_error||t.html===null){Yf.delete(e),jv(i,e),e.innerHTML="",e.appendChild(n.buildErrorPlaceholder(t,e.ownerDocument));return}const a=$X(e.ownerDocument,t.html),c={};Yf.set(e,c);const u=()=>Yf.get(e)!==c?!1:(Yf.delete(e),jv(i,e),e.replaceChildren(...Array.from(a.holder.childNodes)),!0);if(a.loaded){u();return}z4(a.ready,DX).then(()=>{u()&&r()})}function IX(e,t){return typeof e=="string"&&e!==t}function Pj(e){const t=new Map;if(e===null)return t;const n=e;for(const[r,i]of Nl(n))t.set(r,JSON.stringify([i,n.files[i.file]??null]));return t}function UX(e,t){const n=Pj(e),r=Pj(t),i=new Set;for(const[a,c]of r)n.get(a)!==c&&i.add(a);for(const a of n.keys())r.has(a)||i.add(a);return i}function Ov(e,t){if(Array.isArray(e))return e.some(r=>Ov(r,t));if(typeof e!="object"||e===null)return!1;const n=Kn(e);return n!==void 0&&t.has(n)?!0:Object.values(e).some(r=>Ov(r,t))}function PX(e,t){return t.size===0?[]:e.instances.filter(n=>Ov(n.slots,t)).map(n=>n.instance_id)}function tp(e){return`slots.${e}`}function FX(e){const{local:t,server:n,isProtected:r}=e,i=new Map(n.instances.map(p=>[p.instance_id,p])),a=[],c=t.instances.map(p=>{const y=i.get(p.instance_id);if(!y)return p;const m=BX(p,y,x=>r(p.instance_id,x));return m===p?p:(a.push(p.instance_id),m)}),u=Av(Xy(t),Xy(n),p=>r(null,p));return{doc:a.length===0&&u===null?t:{...u??Xy(t),instances:c},changedInstanceIds:a}}function BX(e,t,n){const r=Av(e.slots,t.slots,a=>n(tp(a))),i=Av(Wy(e),Wy(t),n);return r===null&&i===null?e:{...i??Wy(e),slots:r??e.slots}}function Av(e,t,n){let r=null;const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const a of i)ws(t[a],e[a])||n(a)||(r??(r={...e}),r[a]=t[a]);if(r!==null)for(const a of Object.keys(r))r[a]===void 0&&delete r[a];return r}function Xy(e){const{instances:t,...n}=e;return n}function Wy(e){const{slots:t,...n}=e;return n}function ws(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((c,u)=>ws(c,t[u]));const n=e,r=t,i=Object.keys(n).filter(c=>n[c]!==void 0),a=Object.keys(r).filter(c=>r[c]!==void 0);return i.length===a.length&&i.every(c=>ws(n[c],r[c]))}const Ew=async({storeApi:e,renders:t})=>{const n=e.getState().iframeDocs;await Promise.all(t.flatMap(r=>n.map(i=>zX(i,r.html))))};function HX(e,t){return async({storeApi:n,local:r,incoming:i,changedInstanceIds:a})=>{const c=n.getState().session.property_id,u=Fj(r,a),f=[...Fj(i,a)].filter(p=>!u.has(p));await Promise.all(f.map(async p=>{try{const y=await CU(e,c,p,t);await VX(y)}catch{}}))}}function qX(...e){return async t=>{await Promise.all(e.map(n=>n(t)))}}const Jy=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Fj(e,t){const n=new Set,r=i=>{if(Array.isArray(i)){i.forEach(r);return}if(!Jy(i))return;const a=i.renditions;if(Jy(a))for(const c of["crop","cutout"]){const u=a[c],f=Jy(u)?u.key:void 0;typeof f=="string"&&f.startsWith("processed/")&&n.add(f)}Object.values(i).forEach(r)};for(const i of e.instances)t.includes(i.instance_id)&&r(i.slots);return n}function VX(e){const t=new Image;return t.src=e,typeof t.decode=="function"?t.decode().catch(()=>{}):Promise.resolve()}const Bj=100;function Cv(e){return structuredClone(e)}function ZX(e,t){return e===null||t===null?e===t:e.kind===t.kind&&e.instanceId===t.instanceId&&e.slotId===t.slotId&&e.pageId===t.pageId&&e.canvasId===t.canvasId}function eb(e){return{entries:[{doc:Cv(e),target:null}],index:0}}function D4(e){return e.index>0}function L4(e){return e.index<e.entries.length-1}function KX(e,t,n){const r=e.index===e.entries.length-1,i=e.entries.slice(0,e.index+1),a=i[i.length-1];if(r&&i.length>1&&ZX(a.target,t)){const f=i.slice(0,-1).concat({doc:Cv(n),target:t});return{entries:f,index:f.length-1}}let c=i.concat({doc:Cv(n),target:t}),u=c.length-1;return c.length>Bj&&(c=c.slice(c.length-Bj),u=c.length-1),{entries:c,index:u}}function GX(e){if(!D4(e))return null;const t=e.entries[e.index].target,n=e.index-1,r=e.entries[n].doc;return{next:{entries:e.entries,index:n},step:{target:t,doc:r}}}function YX(e){if(!L4(e))return null;const t=e.index+1,n=e.entries[t];return{next:{entries:e.entries,index:t},step:{target:n.target,doc:n.doc}}}function I4(e){const t=e.variant_select;return!t||t.locked||t.cases.length<2?null:t.cases}function Qp(e,t){return(t==null?void 0:t.variant)??e.variant}function QX(e,t,n){return KY(e.schema,t,r=>n?Rt(n.slots,r):void 0)}function XX(e,t,n){if(e===null)return null;const r=n.instances.find(a=>a.instance_id===e.instance_id),i=t.find(a=>a.instance_id===e.instance_id);return r===void 0||i===void 0||r.enabled===!1?null:e.kind!=="slot"||WX(i,r,e)?e:{kind:"section",instance_id:e.instance_id}}function WX(e,t,n){var u;const r=Qp(e,t),i=Eo(n.slot_id),a=e.schema.slots[(i==null?void 0:i.object)??n.slot_id];if(a===void 0||!Eu(a,r))return!1;if(i!==null){const f=(u=Fl(a))==null?void 0:u.fields[i.field];if(f===void 0||!Eu(f,r))return!1}const c=Rt(t.slots,n.slot_id);return e4(c)?!1:n.item_index===void 0||Array.isArray(c)&&n.item_index<c.length}const yh={pending:[],processing:{},failed:[],failed_crops:[],waiting:{},evaluating:!1};function JX(e){return e.pending.length>0||e.evaluating}function Hj(e,t){if(t.length===0)return e;const n={};for(const[r,i]of Object.entries(e)){const a=i.filter(c=>!t.some(u=>vw(u,r,c)));a.length>0&&(n[r]=a)}return n}function Nv(e){return JX(e.session.fill_holders)||e.awaitedCuts.length>0}function tb(e,t,n){const r=new Set(gh(t,e).page_ids),i=new Map(n.map(c=>[c.instance_id,c])),a={};for(const c of e){if(!r.has(c.id))continue;const u={};for(const f of c.instance_ids){const p=i.get(f);p&&(p.html===null&&p.render_error===null||(u[f]={html:p.html,render_error:p.render_error}))}a[c.id]=u}return a}function eW(e,t,n){const r={...e};for(const i of n){const a=t[i];if(a===void 0)continue;const c=e[i]??{},u={...c};for(const[f,p]of Object.entries(a))c[f]===void 0&&(u[f]={...p,stale:!0});r[i]=u}return r}function yo(e,t){return e.getState().backend===t}const tW=.5,nW=2;function rW(e,t,n,r){var f,p;const i=e.items;if(!((p=(f=i==null?void 0:i[t])==null?void 0:f[n])!=null&&p[r]))return;const a={...i[t]},c={...a[n]};delete c[r],Object.keys(c).length===0?delete a[n]:a[n]=c;const u={...i};Object.keys(a).length===0?delete u[t]:u[t]=a,Object.keys(u).length===0?delete e.items:e.items=u}function oW(e,t,n){var c;const r=e.items_removed;if(!((c=r==null?void 0:r[t])!=null&&c[n]))return;const i={...r[t]};delete i[n];const a={...r};Object.keys(i).length===0?delete a[t]:a[t]=i,Object.keys(a).length===0?delete e.items_removed:e.items_removed=a}function iW(e){const t={};for(const n of e){const r=n.section_key.split("/").pop();t[r]=`#${n.schema.anchor}`}return t}function sW(e,t){return e===null||t===null?e===t:e.section_failed===t.section_failed&&e.failed_decision_ids.length===t.failed_decision_ids.length&&e.failed_decision_ids.every((n,r)=>n===t.failed_decision_ids[r])}function Mv(e,t,n){if(e===t)return n;if(Array.isArray(e)){const r=e.map(i=>Mv(i,t,n));return r.some((i,a)=>i!==e[a])?r:e}if(typeof e=="object"&&e!==null){const r=Object.entries(e),i=r.map(([a,c])=>[a,Mv(c,t,n)]);return i.some(([,a],c)=>a!==r[c][1])?Object.fromEntries(i):e}return e}function aW(e){const t=gh(e.bootstrap.canvases,e.bootstrap.pages).id;let n=0,r=0;const i=new Map,a=(p,y)=>`${p??""} ${y}`,c=(p,y)=>{i.set(a(p,y),++n)};let u=[];const f=(p,y)=>{if(y.length===0)return y;const m=y.filter(x=>{const v=fQ(p,x);return v===null?!1:i4(x,v)?(u.push(x),!1):!0});return m.length===y.length?y:m};return U0((p,y)=>({backend:e.backend,session:{deliverable_id:e.bootstrap.deliverable.id,property_id:e.property_id,listing_intent:e.listing_intent,template:e.bootstrap.template,bases:e.bootstrap.bases,format:e.bootstrap.format,sections:e.bootstrap.sections,pages:e.bootstrap.pages,canvases:e.bootstrap.canvases,facts:e.bootstrap.facts,fill_holders:e.bootstrap.fill_holders??yh,content_fingerprint:e.bootstrap.content_fingerprint??null},content_doc:e.bootstrap.deliverable.content_doc,history:eb(e.bootstrap.deliverable.content_doc),selection:null,currentCanvasId:t,visitedCanvasIds:[t],page_renders:tb(e.bootstrap.pages,e.bootstrap.canvases,e.bootstrap.sections),pendingPageScroll:null,zoom:1,revealSelection:!1,hasChanges:!1,saveState:"saved",savedAt:Date.now(),iframeDocs:[],mountedFrameDocs:[],pendingSaves:0,awaitedCuts:[],select:m=>p({selection:m}),setZoom:m=>p({zoom:Math.max(tW,Math.min(nW,m))}),attachFrameDoc:m=>p(x=>x.iframeDocs.includes(m)?{}:{iframeDocs:[...x.iframeDocs,m]}),detachFrameDoc:m=>p(x=>x.iframeDocs.includes(m)?{iframeDocs:x.iframeDocs.filter(v=>v!==m)}:{}),mountFrameDoc:m=>p(x=>x.mountedFrameDocs.includes(m)?{}:{mountedFrameDocs:[...x.mountedFrameDocs,m]}),unmountFrameDoc:m=>p(x=>x.mountedFrameDocs.includes(m)?{mountedFrameDocs:x.mountedFrameDocs.filter(v=>v!==m)}:{}),setCurrentCanvas:m=>{p(x=>m===x.currentCanvasId?{}:x.session.canvases.some(v=>v.id===m)?{currentCanvasId:m,visitedCanvasIds:x.visitedCanvasIds.includes(m)?x.visitedCanvasIds:[...x.visitedCanvasIds,m],selection:null}:{})},setPendingPageScroll:m=>p({pendingPageScroll:m}),setSectionEnabled:(m,x)=>{c(m,"enabled"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>_.instance_id===m?{..._,enabled:x}:_)},hasChanges:!0}))},setPageEnabled:(m,x)=>{c(null,"page_state"),p(v=>{const _=v.content_doc.page_state??[],k=_.some(S=>S.page_id===m);return{session:{...v.session,pages:v.session.pages.map(S=>S.id===m?{...S,enabled:x}:S)},content_doc:{...v.content_doc,page_state:k?_.map(S=>S.page_id===m?{...S,enabled:x}:S):[..._,{page_id:m,enabled:x}]},hasChanges:!0}})},setSectionVariant:(m,x)=>{c(m,"variant"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>{if(_.instance_id!==m)return _;if(x===void 0){const{variant:k,...S}=_;return S}return{..._,variant:x}})},hasChanges:!0}))},setSlotValue:(m,x,v)=>{var _;c(m,tp(((_=Eo(x))==null?void 0:_.object)??x)),p(k=>{const S={...k.content_doc,instances:k.content_doc.instances.map(j=>j.instance_id===m?{...j,slots:PZ(j.slots,x,v)}:j)};return{content_doc:S,awaitedCuts:f(S,k.awaitedCuts),hasChanges:!0}})},markSlotOverridden:(m,x,v)=>{c(m,"slot_overrides"),p(_=>({content_doc:{..._.content_doc,instances:_.content_doc.instances.map(k=>{if(k.instance_id!==m)return k;const S={...k.slot_overrides??{}};if(v.kind==="scalar")S.scalar={...S.scalar??{},[x]:!0};else if(v.kind==="item"){const j={...S.items??{}},O={...j[x]??{}},A={...O[v.item_id]??{}};A[v.field]=!0,O[v.item_id]=A,j[x]=O,S.items=j}else if(v.kind==="item_removed"){const j={...S.items_removed??{}},O={...j[x]??{}};O[v.item_id]=!0,j[x]=O,S.items_removed=j}else v.kind==="order"&&(S.order={...S.order??{},[x]:!0});return{...k,slot_overrides:S}})},hasChanges:!0}))},relinkSlot:(m,x,v)=>{c(m,"slot_overrides"),p(_=>({content_doc:{..._.content_doc,instances:_.content_doc.instances.map(k=>{var j;if(k.instance_id!==m)return k;const S={...k.slot_overrides??{}};if(v.kind==="scalar"){if(!S.scalar)return k;const O={...S.scalar};delete O[x],Object.keys(O).length===0?delete S.scalar:S.scalar=O}else if(v.kind==="item")rW(S,x,v.item_id,v.field);else if(v.kind==="item_removed")oW(S,x,v.item_id);else if(v.kind==="order"){if(((j=S.order)==null?void 0:j[x])!==!0)return k;const O={...S.order};delete O[x],Object.keys(O).length===0?delete S.order:S.order=O}if(Object.keys(S).length===0){const{slot_overrides:O,...A}=k;return A}return{...k,slot_overrides:S}})},hasChanges:!0}))},restoreSlotOverrides:(m,x)=>{c(m,"slot_overrides"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>{if(_.instance_id!==m)return _;if(x===void 0){const{slot_overrides:k,...S}=_;return S}return{..._,slot_overrides:x}})}}))},rewriteTempId:(m,x,v)=>{const _=y().content_doc.instances.find(j=>j.instance_id===m);if(_===void 0)return[];const k={},S=[];for(const[j,O]of Object.entries(_.slots)){const A=Mv(O,x,v);k[j]=A,A!==O&&S.push(j)}if(S.length===0)return[];for(const j of S)c(m,tp(j));return p(j=>({content_doc:{...j.content_doc,instances:j.content_doc.instances.map(O=>O.instance_id===m?{...O,slots:k}:O)}})),S},replaceSectionHtml:(m,x,v,_=null)=>{p(k=>({page_renders:{...k.page_renders,[m]:{...k.page_renders[m]??{},[x]:{html:v,render_error:_}}}}))},applyBootstrap:m=>{p(x=>{const{pages:v,canvases:_}=m,k=new Set(_.map(O=>O.id)),S=x.visitedCanvasIds.filter(O=>k.has(O)),j=gh(_,v);return{content_doc:m.deliverable.content_doc,awaitedCuts:f(m.deliverable.content_doc,x.awaitedCuts),session:{...x.session,template:m.template,bases:m.bases,format:m.format,sections:m.sections,pages:v,canvases:_,facts:m.facts,fill_holders:m.fill_holders??yh,content_fingerprint:m.content_fingerprint??null},currentCanvasId:k.has(x.currentCanvasId)?x.currentCanvasId:j.id,visitedCanvasIds:S.includes(j.id)?S:[j.id,...S],page_renders:tb(v,_,m.sections),history:eb(m.deliverable.content_doc),hasChanges:!1,saveState:"saved",savedAt:Date.now()}})},openDeliverable:m=>{const{bootstrap:x}=m;i.clear(),u=[],p(v=>{const{pages:_,canvases:k}=x,S=new Set(k.map(T=>T.id)),j=S.has(v.currentCanvasId),O=gh(k,_),A=j?v.currentCanvasId:O.id,$=v.visitedCanvasIds.filter(T=>S.has(T)),C=$.includes(A)?$:[...$,A],I=x.deliverable.content_doc,z=j?XX(v.selection,x.sections,I):null;return{backend:m.backend,session:{deliverable_id:x.deliverable.id,property_id:m.property_id,listing_intent:m.listing_intent,template:x.template,bases:x.bases,format:x.format,sections:x.sections,pages:_,canvases:k,facts:x.facts,fill_holders:x.fill_holders??yh,content_fingerprint:x.content_fingerprint??null},content_doc:I,history:eb(I),selection:z,currentCanvasId:A,visitedCanvasIds:C,page_renders:eW(tb(_,k,x.sections),v.page_renders,new Set(Ou(k,C))),pendingPageScroll:null,revealSelection:z!==null&&!ws(x.format,v.session.format),awaitedCuts:[],hasChanges:!1,saveState:"saved",savedAt:Date.now()}})},noteSelectionRevealed:()=>p(m=>m.revealSelection?{revealSelection:!1}:{}),editMark:()=>n,mergeRefreshedDoc:(m,x,v)=>{const{doc:_,changedInstanceIds:k}=y().planRefreshMerge(m,x,v);return _!==y().content_doc&&p({content_doc:_,awaitedCuts:f(_,y().awaitedCuts)}),k},planRefreshMerge:(m,x,v)=>FX({local:y().content_doc,server:m,isProtected:(_,k)=>(i.get(a(_,k))??0)>x||v(_,k)}),commitLanding:({server:m,sinceMark:x,isWritePending:v,at:_,facts:k,rerender:S,ready:j})=>{var G;const O=y(),{doc:A,changedInstanceIds:$}=O.planRefreshMerge(m,x,v),C=[];let I=O.page_renders;for(const H of new Set([...$,...S])){const U=j.get(H),D=(G=A.instances.find(K=>K.instance_id===H))==null?void 0:G.slots;if(U===void 0||!ws(D,U.slots)){C.push(H);continue}for(const{pageId:K,html:M}of U.pages)I={...I,[K]:{...I[K]??{},[H]:{html:M,render_error:null}}}}const z=u.length,T=A===O.content_doc?O.awaitedCuts:f(A,O.awaitedCuts),F=u.slice(z),W=O.session.fill_holders;return p({content_doc:A,page_renders:I,awaitedCuts:T,session:{...O.session,facts:k,content_fingerprint:_,fill_holders:F.length===0?W:{...W,processing:Hj(W.processing,F)}}}),C},noteContentWritten:(m,x)=>p(v=>m!==null&&x!==null&&v.session.content_fingerprint===m?{session:{...v.session,content_fingerprint:x}}:{}),expectFills:()=>{r+=1,p(m=>({session:{...m.session,fill_holders:{...m.session.fill_holders,evaluating:!0}}}))},noteRetry:()=>{r+=1,p(m=>({session:{...m.session,fill_holders:{...m.session.fill_holders,failed:[],failed_crops:[],waiting:{},evaluating:!0},sections:m.session.sections.map(x=>x.fill_failure?{...x,fill_failure:null}:x)}}))},expectMark:()=>r,noteFillStatus:(m,x)=>p(v=>{const _=new Map(m.fill_failures.map(F=>[F.instance_id,F])),k=u;u=[];const S={...m.fill_holders,processing:Hj(m.fill_holders.processing,k),evaluating:m.fill_holders.evaluating||r>x},j=new Set(m.fill_holders.pending),O=new Set(m.fill_holders.failed),A=F=>F.ackSeq!==null&&x>=F.ackSeq&&!m.fill_holders.evaluating&&!j.has(F.holder),$=v.awaitedCuts.filter(F=>!O.has(F.holder)&&!A(F)),C=$.length!==v.awaitedCuts.length,I=v.session.sections.map(F=>{const W=_.get(F.instance_id),G=W?{failed_decision_ids:W.failed_decision_ids,section_failed:W.section_failed}:null;return sW(F.fill_failure,G)?F:{...F,fill_failure:G}}),z=I.some((F,W)=>F!==v.session.sections[W]),T=!ws(S,v.session.fill_holders);return!z&&!T&&!C?v:{session:{...v.session,fill_holders:T?S:v.session.fill_holders,sections:z?I:v.session.sections},awaitedCuts:C?$:v.awaitedCuts}}),awaitCuts:m=>{m.length!==0&&(r+=1,p(x=>({awaitedCuts:[...x.awaitedCuts.filter(v=>!m.some(_=>vw(v,_.holder,_.mediaId))),...m],session:{...x.session,fill_holders:{...x.session.fill_holders,evaluating:!0}}})))},ackAwaitedCuts:(m,x,v)=>p(_=>{const k=S=>S.ackSeq===null&&S.instanceId===m&&S.slotId===x&&S.editMark<=v;return _.awaitedCuts.some(k)?{awaitedCuts:_.awaitedCuts.map(S=>k(S)?{...S,ackSeq:r}:S)}:_}),dropAwaitedCuts:(m,x,v)=>p(_=>{const k=_.awaitedCuts.filter(S=>!(S.instanceId===m&&S.slotId===x&&S.editMark<=v));return k.length===_.awaitedCuts.length?_:{awaitedCuts:k}}),beginSave:()=>p(m=>({saveState:"saving",pendingSaves:m.pendingSaves+1})),finishSave:m=>p(x=>{const v=Math.max(0,x.pendingSaves-1);return v>0?{pendingSaves:v}:{pendingSaves:0,saveState:m?"saved":"error",savedAt:m?Date.now():x.savedAt}}),recordEdit:m=>p(x=>({history:KX(x.history,{...m,canvasId:x.currentCanvasId},x.content_doc)})),undo:()=>{const m=GX(y().history);return m?(p({history:m.next}),m.step):null},redo:()=>{const m=YX(y().history);return m?(p({history:m.next}),m.step):null}}))}function lW(e,t){const n=new Set(Ou(e.session.canvases,e.visitedCanvasIds)),r=new Set(Ou(e.session.canvases,[e.currentCanvasId]));return e.session.pages.filter(a=>a.instance_ids.includes(t)).map(a=>a.id).filter(a=>n.has(a)).sort((a,c)=>r.has(a)===r.has(c)?0:r.has(a)?-1:1)}async function jw(e,t,n){const r=e.getState();await U4(r,r.content_doc,t,n,(i,a)=>{yo(e,r.backend)&&e.getState().replaceSectionHtml(i,t,a,null)})}async function cW(e,t,n){const r=[];return await U4(e,t,n,void 0,(i,a)=>r.push({pageId:i,instanceId:n,html:a})),r}async function U4(e,t,n,r,i){const a=e.session.sections.find(u=>u.instance_id===n),c=t.instances.find(u=>u.instance_id===n);if(!(!a||!c)){if(e.session.pages.length===1){const u=e.session.pages[0].id,{html:f}=await e.backend.render({section_key:a.section_key,slots:c.slots,nav:{selfAnchor:a.schema.anchor,anchors:iW(e.session.sections.filter(p=>{var y;return((y=t.instances.find(m=>m.instance_id===p.instance_id))==null?void 0:y.enabled)!==!1}))},instance_id:n,variant:r});i(u,f);return}await Promise.all(lW(e,n).map(async u=>{const{html:f}=await e.backend.render({section_key:a.section_key,slots:c.slots,nav:{selfAnchor:a.schema.anchor},page_id:u,instance_id:n,variant:r});i(u,f)}))}}const qj=new WeakMap;function yd(e){let t=qj.get(e);return t||(t={timers:new Map,inFlight:new Map},qj.set(e,t)),t}function Ow(e,t){return`${e} ${t}`}function P4(e){const{timers:t}=yd(e),n=[...t.values()];t.clear();for(const{timer:r,send:i}of n)clearTimeout(r),i()}function uW(e,t,n){const{inFlight:r}=yd(e),i=Ow(t,n);return r.set(i,(r.get(i)??0)+1),()=>{const a=(r.get(i)??1)-1;a<=0?r.delete(i):r.set(i,a)}}function dW(e,t,n){const{timers:r,inFlight:i}=yd(e),a=Ow(t,n),c=`${a}.`,u=f=>f===a||f.startsWith(c);return[...r.keys()].some(u)||[...i.keys()].some(u)}function fW(e,t){const{timers:n,inFlight:r}=yd(e),i=`${t} `;for(const a of[...n.keys(),...r.keys()])if(a.startsWith(i))return!0;return!1}const Vj=tp(""),hW=4e3,pW=350,mW=e=>new Promise(t=>setTimeout(t,e));async function np(e,t,n,r=Ew){const{backend:i}=e.getState(),a=t.deliverable.content_doc,c=(_,k)=>_===null?!1:k==="slot_overrides"?fW(e,_):k.startsWith(Vj)&&dW(e,_,k.slice(Vj.length)),u=t.facts??null,f=e.getState().content_doc,p=e.getState().planRefreshMerge(a,n,c),y=PX(p.doc,UX(e.getState().session.facts,u)),m=[...new Set([...p.changedInstanceIds,...y])],x=new Map;if(m.length>0&&(await Promise.all(m.map(async _=>{try{const k=await cW(e.getState(),p.doc,_);x.set(_,{slots:gW(p.doc,_),pages:k})}catch(k){console.error("[editor] dependent re-render failed",{instanceId:_,err:k})}})),await z4(r({storeApi:e,local:f,incoming:p.doc,changedInstanceIds:m,renders:[...x.values()].flatMap(_=>_.pages)}),hW)),!yo(e,i))return;const v=e.getState().commitLanding({server:a,sinceMark:n,isWritePending:c,at:t.content_fingerprint??null,facts:u,rerender:y,ready:x});await Promise.all(v.map(_=>jw(e,_).catch(k=>{console.error("[editor] dependent re-render failed",{instanceId:_,err:k})})))}function gW(e,t){var n;return(n=e.instances.find(r=>r.instance_id===t))==null?void 0:n.slots}async function yW(e){const{storeApi:t,signal:n,wait:r=mW,intervalMs:i=pW,prepare:a=Ew}=e,{backend:c}=t.getState(),u=c.fills;if(!u)return;const f=()=>(n==null?void 0:n.aborted)===!0||!yo(t,c);for(;!f();){const p=t.getState(),y=p.editMark(),m=p.expectMark(),x=await u.status();if(f())return;const v=IX(x.content_fingerprint,t.getState().session.content_fingerprint),_=v&&t.getState().pendingSaves>0;if(v&&!_){const k=await c.bootstrap();if(f())return;await np(t,k,y,a)}if(t.getState().noteFillStatus({fill_holders:x.fill_holders??yh,fill_failures:x.fill_failures},m),!_&&!Nv(t.getState()))return;await r(i)}}async function Xp(e,t,n){if(t.fills_evaluating&&e.getState().expectFills(),!t.dependents_rederiving)return;const{backend:r}=e.getState();try{const i=await r.bootstrap();if(!yo(e,r))return;await np(e,i,n)}catch(i){console.error("[editor] dependents refresh failed",{err:i})}}function Wp(e,t){e.getState().noteContentWritten(t.prior_content_fingerprint??null,t.content_fingerprint??null)}async function F4(e,t){const n=e.getState(),r=new Set(Ou(n.session.canvases,n.visitedCanvasIds)),i=new Map(n.content_doc.instances.map(u=>[u.instance_id,u])),a=new Map(n.session.sections.map(u=>[u.instance_id,u])),c=[];for(const u of n.session.pages)if(r.has(u.id))for(const f of u.instance_ids){const p=a.get(f),y=i.get(f);!p||!y||c.push(n.backend.render({section_key:p.section_key,slots:y.slots,nav:{selfAnchor:p.schema.anchor},page_id:u.id,instance_id:f}).then(({html:m})=>{yo(e,n.backend)&&e.getState().replaceSectionHtml(u.id,f,m,null)}).catch(m=>{console.error(`[editor] nav re-render after ${t} toggle failed`,{pageId:u.id,instanceId:f,err:m})}))}await Promise.all(c)}function B4(e,t,n){e.getState().setPageEnabled(t,n),vW(e,t,n)}function bW(){const e=lr();return w.useCallback((t,n)=>{B4(e,t,n),e.getState().recordEdit({kind:"page",pageId:t})},[e])}async function vW(e,t,n){e.getState().beginSave();try{const r=e.getState().editMark(),i=await e.getState().backend.write([{op:"toggle_page",page_id:t,enabled:n}]);Wp(e,i),e.getState().finishSave(!0),e.getState().session.pages.length>1&&await F4(e,"page"),Xp(e,i,r)}catch(r){e.getState().setPageEnabled(t,!n),console.error("[editor] page toggle failed",{pageId:t,enabled:n,err:r}),e.getState().finishSave(!1)}}function H4(e,t,n){e.getState().setSectionEnabled(t,n),xW(e,t,n)}function q4(){const e=lr();return w.useCallback((t,n)=>{H4(e,t,n),e.getState().recordEdit({kind:"section",instanceId:t})},[e])}async function xW(e,t,n){e.getState().beginSave();try{const r=e.getState().editMark(),i=await e.getState().backend.write([{op:"toggle_section",section_instance_id:t,enabled:n}]);Wp(e,i),e.getState().finishSave(!0),await F4(e,"section"),Xp(e,i,r)}catch(r){e.getState().setSectionEnabled(t,!n),console.error("[editor] section toggle failed",{instanceId:t,enabled:n,err:r}),e.getState().finishSave(!1)}}const wW=0;function kW({frameHandle:e,pageId:t,frame:n,isCurrent:r,declaredHeight:i,scale:a,stage:c,onFollowLink:u}){const[f,p]=w.useState(null),[y,m]=w.useState(null),x=y!==null&&y===f,v=w.useRef(x);w.useEffect(()=>{v.current=x},[x]);const _=w.useRef(null),k=lr(),S=Ee(H=>H.session.sections),j=Ee(H=>H.session.pages.find(U=>U.id===t)),O=Ee(H=>H.page_renders[t]),A=Ee(H=>H.content_doc.instances),$=Ee(H=>H.selection),C=w.useMemo(()=>Jh($),[$]),I=q4(),z=bW(),T=w.useMemo(()=>{if(!j)return[];const H=new Map(S.map(D=>[D.instance_id,D])),U=[];for(const D of j.instance_ids){const K=H.get(D),M=O==null?void 0:O[D];!K||M===void 0||U.push({...K,html:M.html,render_error:M.render_error})}return U},[j,S,O]),F=j!=null&&j.instance_ids.some(H=>(O==null?void 0:O[H])===void 0),W=w.useCallback(H=>{const U=H.target;if(!U)return;const D=U.closest("a"),{select:K}=k.getState(),M=n.resolveTarget(U,k.getState().session.sections)??null;if(D){if(H.preventDefault(),(M==null?void 0:M.selection.kind)==="slot"){const B=k.getState().selection,X=M.selection,se=(B==null?void 0:B.kind)==="slot"&&B.instance_id===X.instance_id&&B.slot_id===X.slot_id&&(B.item_index??void 0)===(X.item_index??void 0);K(X),se&&u(D,e);return}u(D,e);return}K(M?M.selection:null)},[k,n,u,e]);w.useEffect(()=>{const H=e.iframe;function U(){const D=H.contentDocument;!D||!rX(D)||_.current!==D&&(D.body.addEventListener("click",W),_.current=D,p(D))}return H.addEventListener("load",U),U(),()=>{H.removeEventListener("load",U)}},[e,W]),w.useEffect(()=>()=>{var H;(H=_.current)==null||H.body.removeEventListener("click",W),_.current=null},[W]),w.useEffect(()=>{if(!f||i)return;const H=f.getElementById("we-page");if(!H)return;const U=()=>e.setPageHeight(H.getBoundingClientRect().height);U();const D=new ResizeObserver(U);return D.observe(H),()=>D.disconnect()},[f,i,e]),w.useEffect(()=>{if(f)return RX(f.defaultView,f,()=>m(f))},[f]),w.useEffect(()=>{if(!f||!r)return;const H=f;return k.getState().attachFrameDoc(H),()=>k.getState().detachFrameDoc(H)},[f,r,k]),w.useEffect(()=>{if(!f)return;const H=f;return k.getState().mountFrameDoc(H),()=>k.getState().unmountFrameDoc(H)},[f,k]),w.useEffect(()=>{const H=f;if(!H)return;const U=H.getElementById("we-page");if(!U)return;const D=H.defaultView,K=new Map;Array.from(U.children).forEach(B=>{const X=B.getAttribute(ro);X&&K.set(X,B)});const M=[];for(const B of T){let X=K.get(B.instance_id);if(!X)X=n.buildSectionWrapper(B,H);else{X.setAttribute("data-section-label",ui(B));const se=b4(B.html),J=X.dataset.renderKey!==B.render_key,P=X.dataset.htmlHash!==se;if(J||P){const Y=X.querySelector(":scope > .we-section-body");Y&&LX(Y,B,n,()=>{v.current&&(Ij(D,Y),Qy(H,k.getState().selection))}),X.dataset.renderKey=B.render_key,X.dataset.htmlHash=se}}M.push(X),K.delete(B.instance_id)}K.forEach(B=>TX(D,B)),M.forEach((B,X)=>{U.children[X]!==B&&U.insertBefore(B,U.children[X]??null)}),x&&(U.querySelectorAll(".we-section-body").forEach(B=>Ij(D,B)),Qy(H,k.getState().selection))},[f,T,x,k,n]);const G=Ee(H=>H.pendingPageScroll);return w.useEffect(()=>{!f||!r||F||!G||G.pageId!==t||(k.getState().setPendingPageScroll(null),bh(G.anchor,e,c,a))},[f,r,F,G,t,k,e,c]),w.useEffect(()=>{!f||!x||!r||jX(f.defaultView,f,C)},[f,x,C,T,r]),w.useEffect(()=>{j&&vX(e.wrapper,document,{toggleable:j.optional,hidden:!j.enabled,label:j.label},()=>{const H=k.getState().session.pages.find(U=>U.id===t);H&&z(t,!H.enabled)})},[j,t,e,z,k]),w.useEffect(()=>{const H=f;if(!H)return;const U=new Map(A.map(D=>[D.instance_id,D.enabled]));for(const D of T){const K=H.querySelector(`[${ro}="${uo(D.instance_id)}"]`);K&&K.setAttribute("data-hidden",U.get(D.instance_id)===!0?"false":"true")}},[f,A,T]),w.useEffect(()=>{const H=f;if(!H)return;const U=e.tabLayer,D=new Map(A.map(J=>[J.instance_id,J.enabled])),K=T.filter(J=>D.get(J.instance_id)===!1).map(J=>({instanceId:J.instance_id,label:ui(J)})),M=uX(U,document,K,J=>{I(J,!0),k.getState().select({kind:"section",instance_id:J})}),B=J=>H.querySelector(`[${ro}="${uo(J)}"]`);Mj(M,B,a);const X=H.getElementById("we-page"),se=new ResizeObserver(()=>Mj(M,B,a));return X&&se.observe(X),()=>se.disconnect()},[f,A,T,a,I,k,e]),w.useEffect(()=>{if(!r)return;const H=f;if(!H)return;const U=e.overlay;H.querySelectorAll(`[${ro}][data-selected]`).forEach(se=>se.removeAttribute("data-selected")),H.querySelectorAll(`[${ro}][data-slot-selected-inside]`).forEach(se=>se.removeAttribute("data-slot-selected-inside"));const D=U.querySelector(".we-chrome-label")??null;if(!C){Gc(U,[],es),mh(D);return}const K=A.find(se=>se.instance_id===C.instance_id);if(K&&!K.enabled){Gc(U,[],es),mh(D);return}const M=T.find(se=>se.instance_id===C.instance_id),B=H.querySelector(`[${ro}="${uo(C.instance_id)}"]`);B==null||B.setAttribute("data-selected","true");const X=n.resolveSelectionEls(H,C);if(C.kind==="section"){const se=Gc(U,X,es,"section");for(const J of se)_j(J,"section");Sj(D,X[0]??null,M?ui(M):"")}else{B==null||B.setAttribute("data-slot-selected-inside","true");const se=Gc(U,X,es,"slot");for(const J of se)_j(J,"slot");mh(D)}Qy(H,C)},[f,C,T,A,n,r,e]),w.useEffect(()=>{if(!f||!C||!r)return;const H=A.find(L=>L.instance_id===C.instance_id);if(H&&!H.enabled)return;const U=f;if(!U)return;const D=e.overlay,K=D.querySelector(".we-chrome-label")??null,M=n.resolveSelectionEls(U,C);if(M.length===0)return;const B=T.find(L=>L.instance_id===C.instance_id),X=C.kind==="section"?"section":"slot",se=C.kind==="section"&&B?ui(B):"",J=()=>{Gc(D,M,es,X),C.kind==="section"&&Sj(K,M[0]??null,se)},P=new ResizeObserver(J);for(const L of M)P.observe(L);const Y=U.getElementById("we-page");return Y&&P.observe(Y),()=>P.disconnect()},[f,C,A,T,n,r,e]),w.useEffect(()=>{const H=f;if(!H)return;const U=e.overlay.querySelector(".we-chrome-ring--hover");if(!U)return;let D=null,K=null,M=null;function B(){D&&(clearTimeout(D),D=null)}function X(){B(),K=null,M=null,kv(U??null)}function se(L,Z){M=L,K=null,wv(U??null,L,es,Z)}function J(L,Z){if(L===M){wv(U??null,L,es,Z);return}L===K&&D||(B(),K=L,kv(U??null),M=null,D=setTimeout(()=>{D=null,K===L&&se(L,Z)},wW))}function P(L){const Z=n.resolveTarget(L.target,k.getState().session.sections)??null;if(!Z){X();return}const ne=Jh(k.getState().selection),fe=Z.selection;if(fe.kind==="section"&&(ne==null?void 0:ne.kind)==="section"&&ne.instance_id===fe.instance_id||fe.kind==="slot"&&(ne==null?void 0:ne.kind)==="slot"&&ne.instance_id===fe.instance_id&&ne.slot_id===fe.slot_id&&(ne.item_index??void 0)===(fe.item_index??void 0)){X();return}J(Z.element,Z.selection.kind)}function Y(){X()}return H.body.addEventListener("mouseover",P),H.body.addEventListener("mouseleave",Y),()=>{X(),H.body.removeEventListener("mouseover",P),H.body.removeEventListener("mouseleave",Y)}},[f,k,n,e]),w.useEffect(()=>{const H=f;if(!H)return;const U=D=>{D.key==="Escape"&&k.getState().selection&&k.getState().select(null)};return H.addEventListener("keydown",U),()=>H.removeEventListener("keydown",U)},[f,k]),null}function bh(e,t,n,r){var c;const i=((c=t.doc)==null?void 0:c.getElementById(e))??null;if(!i||!n)return;const a=t.wrapper.offsetTop+i.getBoundingClientRect().top*r-80;n.scrollTo({top:Math.max(0,a),behavior:"smooth"})}const _W=/^([a-z0-9-]+)?\/?(?:#(.*))?$/;function SW(e,t,n,r){const i=r.endsWith("/")?r:`${r}/`;if(!n.startsWith(i))return null;const a=_W.exec(n.slice(i.length));if(!a)return null;const c=a[1]?`/${a[1]}`:"/",u=e.find(p=>p.path===c);if(!u)return null;const f=$4(t,u.id);return f?{pageId:u.id,canvasId:f.id,anchor:a[2]?a[2]:null}:null}function EW({canvasId:e,isCurrent:t,guides:n=!1}){const r=w.useRef(null),[i,a]=w.useState(null),c=w.useCallback(L=>{r.current=L,a(L)},[]),[u,f]=w.useState([]),[p,y]=w.useState(1),m=lr(),x=Ee(L=>L.session.canvases.find(Z=>Z.id===e)),v=Ee(L=>L.session.pages),_=Ee(L=>L.selection),k=w.useMemo(()=>Jh(_),[_]),S=Ee(L=>L.zoom),j=Ee(L=>L.session.format),O=w.useMemo(()=>gQ(j),[j]),A=w.useMemo(()=>NX(v,x),[v,x]),$=p*S,C=w.useRef($);w.useEffect(()=>{C.current=$},[$]);const I=Ee(L=>L.session.template),z=Ee(L=>L.session.bases.build),T=Ee(L=>L.backend),F=w.useMemo(()=>T.canvasAssets(I,z),[T,I,z]),W=w.useCallback((L,Z,ne)=>{var ee,le;const fe=(ee=m.getState().session.sections.find(xe=>xe.instance_id===L))==null?void 0:ee.schema.slots,de=fe==null?void 0:fe[Z];if(!de||!wl(de,{slots:fe}))return!1;const pe=(le=$n(de))==null?void 0:le.fields,N=ne===void 0||pe==null?void 0:pe[ne];return N?wl(N,{slots:fe,fields:pe}):!0},[m]),G=w.useMemo(()=>oX(bQ(F,W,O)),[F,W,O]),H=G.srcdoc(),U=w.useMemo(()=>O?{...O,direction:"row"}:void 0,[O]),D=U?G.srcdoc(U):H;w.useEffect(()=>{const L=r.current;if(!L)return;const Z=A.map(ne=>({key:ne.id,srcdoc:ne.direction==="row"?D:H,label:ne.label,title:`${ne.label} canvas`,pageBox:ne.direction==="row"?U:O,sandbox:"allow-same-origin allow-scripts"}));f(yX(L,Z))},[A,H,D,O,U]);const K=w.useMemo(()=>yQ(j),[j]);w.useEffect(()=>{for(const L of u)xX(L.overlay,n&&K>0?K:null)},[u,n,K]),w.useEffect(()=>{const L=r.current;if(!L)return;const Z=new ResizeObserver(ne=>{var de;const fe=(de=ne[0])==null?void 0:de.contentRect;fe!=null&&fe.width&&y(LQ(zQ(fe.width),{availableWidthPx:fe.width,availableHeightPx:fe.height},O&&{width:O.width,height:O.height}))});return Z.observe(L),()=>Z.disconnect()},[O]),w.useEffect(()=>{var L;(L=r.current)==null||L.style.setProperty("--we-scale",String($))},[$]);const M=w.useCallback((L,Z)=>{const ne=L.getAttribute("href")??"";if(!ne||ne==="#")return;const fe=r.current;if(ne.startsWith("#")){bh(ne.slice(1),Z,fe,C.current);return}const de=m.getState(),pe=SW(de.session.pages,de.session.canvases,ne,de.session.bases.content);if(!pe){window.open(ne,"_blank","noopener,noreferrer");return}if(pe.canvasId===de.currentCanvasId){const N=u.find(ee=>ee.key===pe.pageId);if(!N)return;pe.anchor?bh(pe.anchor,N,fe,C.current):N!==Z&&bh("we-page",N,fe,C.current);return}de.setCurrentCanvas(pe.canvasId),pe.anchor&&de.setPendingPageScroll({pageId:pe.pageId,anchor:pe.anchor})},[m,u]),B=w.useCallback(L=>{const Z=L.target,ne=Z===r.current,fe=u.some(de=>de.wrapper===Z);(ne||fe)&&m.getState().select(null)},[m,u]),X=w.useCallback(L=>{const Z=r.current;if(!Z)return null;const ne=N=>{const ee=bX(u,G,N)[0],le=ee==null?void 0:ee.els[0];return ee&&le?{wrapper:ee.handle.wrapper,el:le}:null},fe=ne(L),de=L.kind==="slot"?ne({kind:"section",instance_id:L.instance_id}):null;if(!fe&&!de)return null;const pe=requestAnimationFrame(()=>{const N=C.current,ee=Ve=>{if(!Ve)return null;const it=gd(Ve.el);return it.width>0&&it.height>0?{wrapper:Ve.wrapper,rect:it}:null},le=ee(fe)??ee(de);if(!le)return;const{wrapper:xe,rect:_e}=le,Oe=xe.offsetTop+_e.top*N-Z.scrollTop,be=_e.height*N,Te={top:Oe,bottom:Oe+be,height:be},tt=kX(Te,Z.clientHeight,Z.scrollTop,wX);if(tt==null)return;const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches;Z.scrollTo({top:tt,behavior:Ne?"auto":"smooth"})});return()=>cancelAnimationFrame(pe)},[G,u]),se=w.useRef({backend:T,selection:void 0});w.useEffect(()=>{if(se.current.backend!==T&&(se.current={backend:T,selection:k}),!(!t||!k||k===se.current.selection))return X(k)??void 0},[k,t,X,T]);const J=Ee(L=>L.revealSelection),P=Ee(L=>L.mountedFrameDocs),Y=Ee(L=>L.page_renders);return w.useEffect(()=>{if(!(!J||!t)){if(!k){m.getState().noteSelectionRevealed();return}X(k)!==null&&m.getState().noteSelectionRevealed()}},[J,t,k,X,P,Y,m]),h.jsxs("div",{ref:c,className:`we-canvas-stage absolute inset-0 [--we-content:var(--content,1px)]${t?"":" invisible"}`,inert:!t,onClick:B,children:[h.jsx("style",{children:C4}),u.map(L=>h.jsx(kW,{frameHandle:L,pageId:L.key,frame:G,isCurrent:t,declaredHeight:O!==void 0,scale:$,stage:i,onFollowLink:M},L.key))]})}function jW({guides:e=!1}){const t=Ee(r=>r.visitedCanvasIds),n=Ee(r=>r.currentCanvasId);return h.jsx(h.Fragment,{children:t.map(r=>h.jsx(EW,{canvasId:r,isCurrent:r===n,guides:e},r))})}function V4(e,t,n){var i;const r=(i=e.getState().content_doc.instances.find(a=>a.instance_id===t))==null?void 0:i.variant;e.getState().setSectionVariant(t,n),AW(e,t,n,r)}function OW(){const e=lr();return w.useCallback((t,n)=>{V4(e,t,n),e.getState().recordEdit({kind:"section-variant",instanceId:t})},[e])}async function AW(e,t,n,r){const a=e.getState().session.sections.find(u=>u.instance_id===t),c=n??(a==null?void 0:a.variant);if(!(!a||c===void 0)){e.getState().beginSave();try{const u=e.getState().editMark(),f=await e.getState().backend.write([{op:"set_variant",section_instance_id:t,variant:c}]);Wp(e,f),await jw(e,t,c),e.getState().finishSave(!0),Xp(e,f,u)}catch(u){e.getState().setSectionVariant(t,r),console.error("[editor] section variant switch failed",{instanceId:t,variant:c,err:u}),e.getState().finishSave(!1)}}}function Z4(e,t){var i,a;const n=e.schema.slots??{};if(Object.hasOwn(n,t))return n[t];const r=Eo(t);return r===null||(a=(i=n[r.object])==null?void 0:i.fields)==null?void 0:a[r.field]}function K4(e){return Object.entries(e.schema.slots??{}).flatMap(([t,n])=>NW(n)?Object.entries(n.fields??{}).map(([r,i])=>[md(t,r),i]):[[t,n]])}function G4(e){const t=new Map(e.sections.map(n=>[n.instance_id,n.section_key]));return JL(e.pages.map(n=>({id:n.id,sections:n.instance_ids.flatMap(r=>{const i=t.get(r);return i===void 0?[]:[{section:i,instance_id:r}]})})),e.pages.map(n=>({page_id:n.id,enabled:n.enabled})))}function Y4(e){const t=new Map(e.sections.map(n=>[n.instance_id,n]));return{placement:G4(e),slotAt:n=>{const r=t.get(n.instanceId),i=r===void 0?void 0:Z4(r,n.slot);return r===void 0||i===void 0?void 0:{section:r.section_key,def:i}}}}const Q4=e=>({layer:"section",instanceId:e.instanceId,slot:e.slotId});function Jp(e,t){const n=n6(Y4(e),Q4(t)),r=n===null?void 0:e.sections.find(a=>a.instance_id===n.root.instanceId),i=n===null||r===void 0?void 0:Z4(r,n.root.slot);return n===null||r===void 0||i===void 0?null:{instanceId:n.root.instanceId,slotId:n.root.slot,entry:r,slot:i,locked:n.locked}}function CW(e,t){const n=Y4(e),r=new Map;for(const u of e.sections)for(const[f]of K4(u)){const p={instanceId:u.instance_id,slotId:f},y=t6(n,Q4(p));if(y===null)continue;const m=Qf({instanceId:y.instanceId,slotId:y.slot});r.set(m,[...r.get(m)??[],p])}const i=[],a=new Set([Qf(t)]),c=[t];for(let u=c.shift();u!==void 0;u=c.shift())for(const f of r.get(Qf(u))??[]){const p=Qf(f);a.has(p)||(a.add(p),i.push(f),c.push(f))}return i}function NW(e){return e.type==="object"}function Qf(e){return`${e.instanceId} ${e.slotId}`}function MW(e,t,n){const r=RW(e.sections),i=G4(e);return a=>{var x;const c=r(a),u=(c==null?void 0:c.slot.type)==="list"?$n(c.slot):null,f=i.locate({kind:"section",section:a.section,slot:a.slot},n);if(c===null||u===null||f===void 0)return null;const p=(x=t.find(v=>v.instance_id===f.instanceId))==null?void 0:x.slots,y=p===void 0?void 0:Rt(p,a.slot),m=Nr(u,"");return v=>{const _=Array.isArray(y)?y.find(k=>k[hd]===v):void 0;return _===void 0?null:Fs(m,u,_)}}}function RW(e){return t=>{const n=e.find(i=>Eh(i.section_key)===t.section);if(n===void 0)return null;const r=vp(n.schema.slots??{},t.slot);return r===void 0?null:{slot:r,decision:Yx(n.fill_spec,t.slot)}}}function Aw(e){return t=>{var n;return(n=e.find(r=>Eh(r.section_key)===t))==null?void 0:n.schema.slots}}function Au(e,t,n){return nQ(e.schema.slots??{},n,{fillSpec:e.fill_spec,sectionSlots:Aw(t)})}function TW(e,t,n,r,i){const a=Au(e,t,i),c=vp(e.schema.slots??{},i);if(!(a===null||c===void 0))return bw(c,i,a,{facts:n,computed:e.computed},u=>Rt(r,u))}const $W=200;function X4(e,t,n,r){const i=W4(e,t,n);Rv(e,t,n,r);for(const c of Cw(e,{instanceId:t,slotId:n}))Rv(e,c.instanceId,c.slotId,r);const a=e.getState();a.awaitCuts(dQ(t,n,i,r,a.editMark())),J4(e,t,n)}function W4(e,t,n){var i;const r=(i=e.getState().content_doc.instances.find(a=>a.instance_id===t))==null?void 0:i.slots;return r?Rt(r,n):void 0}const zW=new Set(["crop","ar","mobile","renditions","url"]);function DW(e,t){if(!Cr(e)||!Cr(t)||Tn(e)!==Tn(t))return!1;const n=r=>Object.fromEntries(Object.entries(r).filter(([i])=>!zW.has(i)));return ws(n(e),n(t))}function Cw(e,t){const n=e.getState();return CW(n.session,t)}function Rv(e,t,n,r){var u,f;const i=e.getState(),a=W4(e,t,n);if(i.setSlotValue(t,n,r),DW(a,r))return;const c=i.session.sections.find(p=>p.instance_id===t);if(c){const p=Eo(n),y=c.schema.slots,m=p?(f=(u=y[p.object])==null?void 0:u.fields)==null?void 0:f[p.field]:y[n],x=`[${ro}="${Wf(t)}"]`,v=p?`${x} [${Bh}="${Wf(p.object)}"] [${Kx}="${Wf(p.field)}"]`:`${x} [${Bh}="${Wf(n)}"]`;if(m){const _=Bs(m.type),k=i.mountedFrameDocs.flatMap(S=>Array.from(S.querySelectorAll(v)));if(_!=null&&_.applyOptimistic)for(const S of k)_.applyOptimistic(S,r,m)}}}function J4(e,t,n){const r=yd(e),i=Ow(t,n),a=r.timers.get(i);a&&clearTimeout(a.timer);const c=()=>void PW(e,t,n),u=setTimeout(()=>{r.timers.delete(i),c()},$W);r.timers.set(i,{timer:u,send:c})}function e5(){const e=lr();return w.useCallback((t,n,r)=>{var f;const i=e.getState(),a=Jp(i.session,{instanceId:t,slotId:n});if(a===null){Zj(e,t,n,r);return}if(a.locked)return;const c=(f=i.content_doc.instances.find(p=>p.instance_id===t))==null?void 0:f.slot_overrides,u=iw(c,n);u&&i.relinkSlot(t,n,{kind:"scalar"}),Zj(e,a.instanceId,a.slotId,r),u&&J4(e,t,n)},[e])}function Zj(e,t,n,r){var p,y;const i=e.getState(),a=i.session.sections.find(m=>m.instance_id===t),c=a!=null&&Au(a,i.session.sections,n)!==null,u=(p=i.content_doc.instances.find(m=>m.instance_id===t))==null?void 0:p.slots,f=u?Rt(u,n):void 0;if(X4(e,t,n,r),c&&!Array.isArray(r)&&UW(f,r)){const m=e.getState(),x=((y=m.content_doc.instances.find(k=>k.instance_id===t))==null?void 0:y.slots)??{},v=TW(a,m.session.sections,m.session.facts,x,n);v!==void 0&&LW(r,v)?e.getState().relinkSlot(t,n,{kind:"scalar"}):e.getState().markSlotOverridden(t,n,{kind:"scalar"})}e.getState().recordEdit({kind:"slot",instanceId:t,slotId:n})}function LW(e,t){return Cr(e)||Cr(t)?!1:Xf(e)||Xf(t)?Xf(e)&&Xf(t)&&IW(e,t):String(e)===String(t)}function Xf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function IW(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>(e[r]??null)===(t[r]??null))}function UW(e,t){return Cr(t)&&Cr(e)?Tn(t)!==Tn(e):!0}async function PW(e,t,n){const r=e.getState(),i=r.content_doc.instances.find(O=>O.instance_id===t),a=r.session.sections.find(O=>O.instance_id===t);if(!i||!a)return;const c=Rt(i.slots,n),u=iw(i.slot_overrides,n),f=Au(a,r.session.sections,n)!==null,p={op:"set_slot",section_instance_id:t,slot_id:n,value:c,...u?{override:{kind:"scalar"}}:{}},y=BZ(i.slot_overrides,n),m=[];for(const[O,A]of Object.entries(y))for(const $ of Object.keys(A))m.push({op:"set_slot",section_instance_id:t,slot_id:n,value:c,override:{kind:"item",item_id:O,field:$}});const x=dT(i.slot_overrides,n),v=[];for(const O of Object.keys(x))v.push({op:"set_slot",section_instance_id:t,slot_id:n,value:c,override:{kind:"item_removed",item_id:O}});const _=f&&!u?{op:"relink_slot",section_instance_id:t,slot_id:n,target:{kind:"scalar"}}:null,k=UZ(i.slot_overrides,n)?{...p,override:{kind:"order"}}:f&&Array.isArray(c)?{op:"relink_slot",section_instance_id:t,slot_id:n,target:{kind:"order"}}:null;r.beginSave();const S=uW(e,t,n),j=e.getState().editMark();try{const O=await e.getState().backend.write([p,...m,...v,..._?[_]:[],...k?[k]:[]]).finally(S);Wp(e,O);const A=new Set(Cw(e,{instanceId:t,slotId:n}).map($=>$.instanceId));A.delete(t),await Promise.all([t,...A].map($=>jw(e,$))),e.getState().finishSave(!0),Xp(e,O,j),e.getState().ackAwaitedCuts(t,n,j)}catch(O){e.getState().dropAwaitedCuts(t,n,j),console.error("[editor] slot flush failed",{instanceId:t,slotId:n,err:O}),e.getState().finishSave(!1)}}function Wf(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,t=>`\\${t}`)}function t5(){const e=lr(),t=Ee(c=>D4(c.history)),n=Ee(c=>L4(c.history)),r=w.useCallback(c=>{var y,m;const{target:u,doc:f}=c;if(u.canvasId&&e.getState().setCurrentCanvas(u.canvasId),u.kind==="page"){if(!u.pageId)return;const x=((m=(y=f.page_state)==null?void 0:y.find(v=>v.page_id===u.pageId))==null?void 0:m.enabled)??!0;B4(e,u.pageId,x);return}if(!u.instanceId)return;const p=f.instances.find(x=>x.instance_id===u.instanceId);p&&(u.kind==="slot"&&u.slotId?(X4(e,u.instanceId,u.slotId,Rt(p.slots,u.slotId)),e.getState().restoreSlotOverrides(u.instanceId,p.slot_overrides),e.getState().select({kind:"slot",instance_id:u.instanceId,slot_id:u.slotId})):u.kind==="section-variant"?(V4(e,u.instanceId,p.variant),e.getState().select({kind:"section-settings",instance_id:u.instanceId})):(H4(e,u.instanceId,p.enabled),e.getState().select({kind:"section",instance_id:u.instanceId})))},[e]),i=w.useCallback(()=>{const c=e.getState().undo();c&&r(c)},[e,r]),a=w.useCallback(()=>{const c=e.getState().redo();c&&r(c)},[e,r]);return{undo:i,redo:a,canUndo:t,canRedo:n}}function FW(){const e=Ee(p=>p.zoom),t=Ee(p=>p.setZoom),{undo:n,redo:r,canUndo:i,canRedo:a}=t5(),c=()=>t(Number((e-.1).toFixed(2))),u=()=>t(Number((e+.1).toFixed(2))),f=()=>t(1);return h.jsx("div",{className:ce(l4,"left-4.5"),children:h.jsxs("div",{className:c4,children:[h.jsx("button",{type:"button",onClick:n,disabled:!i,title:"Undo","aria-label":"Undo",className:ce(Xh,Kj),children:h.jsx(jt,{name:"undo",size:Ua,stroke:1.7})}),h.jsx("button",{type:"button",onClick:r,disabled:!a,title:"Redo","aria-label":"Redo",className:ce(Xh,Kj),children:h.jsx(jt,{name:"redo",size:Ua,stroke:1.7})}),h.jsx("div",{className:"mx-1 w-px self-stretch my-0.5 bg-line"}),h.jsx(Gj,{onClick:c,label:"Zoom out",children:h.jsx(IN,{size:Ua,className:Wh})}),h.jsxs("button",{type:"button",onClick:f,title:"Fit to canvas",className:ce(u4,"min-w-[calc(46*var(--content))] cursor-pointer rounded text-center font-medium text-ink-2 transition-colors hover:text-ink [font-variant-numeric:tabular-nums]"),children:[Math.round(e*100),"%"]}),h.jsx(Gj,{onClick:u,label:"Zoom in",children:h.jsx(td,{size:Ua,className:Wh})})]})})}const Kj="disabled:cursor-not-allowed disabled:text-ink-4 disabled:hover:bg-transparent";function Gj({onClick:e,label:t,children:n}){return h.jsx("button",{type:"button",onClick:e,"aria-label":t,title:t,className:Xh,children:n})}function lu(...e){return Ap(Op(e))}const BW="flex items-start gap-[12px] py-[12px] pr-[12px] pl-[14px] border rounded-[12px] text-ink [animation:hp-notice-in_.18s_cubic-bezier(.2,.7,.3,1)]",HW="flex flex-1 min-w-0 items-start gap-[12px] transition-opacity ease-settle motion-reduce:transition-none",qW="delay-[60ms] duration-[320ms]",VW="opacity-0 duration-[120ms]",ZW="w-[28px] h-[28px] rounded-[8px] grid place-items-center flex-shrink-0",KW="appearance-none [font-family:inherit] flex-shrink-0 whitespace-nowrap h-[28px] px-[12px] rounded-[8px] border border-line bg-white text-[13px] font-semibold text-ink cursor-pointer [transition:border-color_.12s] hover:border-ink-3 disabled:cursor-default disabled:opacity-60",GW="appearance-none [font-family:inherit] w-[28px] h-[28px] grid place-items-center rounded-[8px] text-ink-3 cursor-pointer flex-shrink-0 [transition:background_.12s,color_.12s] hover:bg-[rgba(20,18,13,.08)] hover:text-ink",YW={danger:"bg-[#fdeeeb] border-danger",good:"bg-good-soft border-good/40",neutral:"bg-canvas border-line"},QW={danger:"bg-danger text-white",good:"bg-good text-white",neutral:"bg-line-soft text-ink-3"},XW={danger:h.jsx(nx,{size:15}),good:h.jsx(bi,{size:15,strokeWidth:2.5}),neutral:h.jsx(JP,{size:15})},WW="cursor-pointer font-semibold text-ink underline underline-offset-2 hover:text-danger",n5=w.createContext(!1);function JW({onClick:e,children:t}){return w.use(n5)?t:h.jsx("button",{type:"button",onClick:e,className:WW,children:t})}function eJ({tone:e,icon:t,headline:n,action:r,onDismiss:i,edge:a=!1,className:c,...u}){return h.jsx("div",{className:lu(BW,YW[e],c),...u,children:h.jsxs("div",{className:lu(HW,a?VW:qW),children:[h.jsx("span",{className:lu(ZW,QW[e]),"aria-hidden":"true",children:t??XW[e]}),h.jsx("strong",{className:"flex-1 min-w-0 pt-[4px] text-[14px] leading-[1.45] font-semibold text-ink",children:h.jsx(n5,{value:a,children:n})}),r?h.jsx("button",{className:KW,type:"button",inert:a,onClick:r.onClick,disabled:r.disabled,children:r.label}):null,h.jsx("button",{className:GW,type:"button",inert:a,"aria-label":"Dismiss",onClick:i,children:h.jsx($p,{size:15})})]})})}const rp="dismissed",Nw=new Map,Cu=new Map,Tv=new Set;function cu(e,t){return`hp-notice-dismissed:${e}:${t}`}function r5(e){const t=Nw.get(e);if(t!==void 0)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function nb(e,t){Nw.set(e,t);try{window.sessionStorage.setItem(e,t)}catch{}}function tJ(e){Nw.delete(e);try{window.sessionStorage.removeItem(e)}catch{}}function o5(){for(const e of Tv)e()}function nJ(e){return Tv.add(e),()=>Tv.delete(e)}function rJ(e,{id:t,hold:n}){var i;const r=(a,c)=>r5(cu(e,a))===c;switch(n.kind){case"page":return((i=Cu.get(e))==null?void 0:i.has(t))??!1;case"condition":return r(t,n.says);case"session":return r(t,rp);case"each":return n.ids.every(a=>r(a,rp))}}function oJ(e,{id:t,hold:n}){switch(n.kind){case"page":Cu.set(e,new Set(Cu.get(e)).add(t));break;case"condition":nb(cu(e,t),n.says);break;case"session":nb(cu(e,t),rp);break;case"each":for(const r of n.ids)nb(cu(e,r),rp);break}o5()}function iJ(e,t){let n=!1;const r=Cu.get(e);for(const i of r??[])t.some(a=>a.id===i&&a.hold.kind==="page")||(r==null||r.delete(i),n=!0);for(const{id:i,hold:a}of t){if(a.kind!=="condition")continue;const c=cu(e,i),u=r5(c);u===null||u===a.says||(tJ(c),n=!0)}n&&o5()}function sJ(e,t){const n=w.useSyncExternalStore(nJ,()=>JSON.stringify(t.filter(r=>rJ(e,r)).map(r=>r.id)),()=>"[]");return w.useEffect(()=>iJ(e,t)),w.useEffect(()=>()=>void Cu.delete(e),[e]),new Set(JSON.parse(n))}const aJ=420,lJ=160,cJ="(prefers-reduced-motion: reduce)",Yj={height:0,marginTop:"0px",marginBottom:"0px"};function Qj({height:e,marginTop:t,marginBottom:n}){return{height:`${e}px`,marginTop:t,marginBottom:n}}function $v(e){return[...e.querySelectorAll(":scope > [data-notice-layer]")]}function i5(e){const{marginTop:t,marginBottom:n}=getComputedStyle(e);return{height:e.getBoundingClientRect().height,marginTop:t,marginBottom:n}}function uJ(e){const t=new Map;for(const n of $v(e)){const{width:r,height:i}=n.getBoundingClientRect();t.set(n.dataset.noticeLayer??"",{width:r,height:i})}return{stack:i5(e),layers:t}}function dJ(e){return e!==null&&typeof e.animate=="function"&&!window.matchMedia(cJ).matches}function fJ(e,t,n){for(const u of[e,...$v(e)])for(const f of u.getAnimations())f.cancel();const r=getComputedStyle(e).getPropertyValue("--ease-settle").trim()||"ease-out",i={duration:aJ,easing:r},a=n?Yj:i5(e),c=[e.animate([Qj((t==null?void 0:t.stack)??Yj),Qj(a)],{...i,fill:n?"forwards":"none"})];for(const u of $v(e)){if(u.dataset.noticeLeaving!==void 0){c.push(u.animate([{opacity:1},{opacity:0}],{duration:lJ,easing:r,fill:"forwards"}));continue}const f=t==null?void 0:t.layers.get(u.dataset.noticeLayer??"");if(f===void 0)continue;const p=u.getBoundingClientRect();c.push(u.animate([{height:`${f.height}px`,transform:`scaleX(${f.width/p.width})`},{height:`${p.height}px`,transform:"none"}],i))}return c}function hJ(e){const t=w.useRef(null),n=w.useRef([]),r=w.useRef(0),i=JSON.stringify(e.map(p=>p.id)),[a,c]=w.useState({order:i,first:null,moved:!1,emptied:!1}),[u,f]=w.useState([]);if(a.order!==i){const p=t.current===null?null:uJ(t.current);c({order:i,first:p,moved:!0,emptied:e.length===0});const y=({notice:m})=>e.some(({id:x})=>x===m.id);f(m=>{const x=n.current.filter(_=>!y(_));return[...m.filter(_=>!y(_)&&!x.some(({notice:k})=>k.id===_.notice.id)),...x]})}return w.useLayoutEffect(()=>{n.current=e.map((p,y)=>({notice:p,depth:y}))}),w.useLayoutEffect(()=>{if(!a.moved)return;r.current+=1;const p=r.current,y=t.current;if(!dJ(y)){f([]);return}const m=fJ(y,a.first,a.emptied);Promise.allSettled(m.map(x=>x.finished)).then(()=>{p===r.current&&f([])})},[a]),{stackRef:t,leaving:u}}const Xj=["result","fault","required","status"];function pJ(e,t){return{id:"load-failed",rank:"fault",hold:{kind:"page"},tone:"danger",role:"alert",headline:e,action:t}}function mJ(e,t){return{id:e,rank:"result",hold:{kind:"page"},tone:"danger",role:"alert",headline:t}}const s5=3,gJ=8,Wj="pointer-events-none absolute top-0",yJ='[data-notice-layer]:not([inert]) button[aria-label="Dismiss"]:not([inert])';function vh(e){return`calc(${e*gJ} * var(--content))`}function bJ(e){return[...e].sort((t,n)=>Xj.indexOf(t.rank)-Xj.indexOf(n.rank))}function vJ({depth:e,leaving:t},n,r){if(e===0&&!t)return{className:"relative",style:{zIndex:r}};if(e===0)return{className:lu(Wj,"inset-x-0"),style:{zIndex:r+1}};const i=Math.min(e,s5);return{className:Wj,style:{left:vh(i),right:vh(i),bottom:vh(n-i),zIndex:t?0:r-e}}}function Ms({surface:e,notices:t,className:n}){var x;const r=sJ(e,t),i=bJ(t.filter(v=>!r.has(v.id))),{stackRef:a,leaving:c}=hJ(i),u=w.useRef(!1),f=(x=i[0])==null?void 0:x.id;if(w.useLayoutEffect(()=>{var v,_;u.current&&(u.current=!1,(_=(v=a.current)==null?void 0:v.querySelector(yJ))==null||_.focus())},[f,a]),i.length===0&&c.length===0)return null;const p=Math.max(0,Math.min(i.length-1,s5)),y=v=>{var _,k;u.current=((_=a.current)==null?void 0:_.contains(document.activeElement))??!1,oJ(e,v),(k=v.onDismiss)==null||k.call(v)},m=[...c.map(v=>({...v,leaving:!0})),...i.map((v,_)=>({notice:v,depth:_,leaving:!1}))];return h.jsx("div",{ref:a,className:lu("relative isolate",n),style:{paddingBottom:vh(p)},children:m.map(v=>{const{notice:_,depth:k}=v;return h.jsx("div",{"data-notice-layer":_.id,"data-notice-leaving":v.leaving?"":void 0,inert:v.leaving,...vJ(v,p,i.length),children:h.jsx(eJ,{tone:_.tone,icon:_.icon,headline:_.headline,action:_.action,role:_.role,onDismiss:()=>y(_),edge:k>0,className:"h-full overflow-hidden"})},_.id)})})}const Jj="hp-cta box-border inline-flex items-center justify-center gap-1.75 rounded-lg border text-center font-semibold tracking-[-0.005em]",xJ={activating:"Activating…",preparing:"Preparing…",delivering:"Downloading…"},wJ={activating:"Activating this property so its files can be rendered",preparing:"Preparing your files. This deliverable changed since it was last rendered",delivering:"Starting your download…"},eO={footer:"h-10 w-full text-[length:calc(13.5*var(--content))]",row:"h-7.5 px-4 text-[length:calc(12.5*var(--content))]"},tO={footer:{px:14,className:"w-[calc(14*var(--content))] h-[calc(14*var(--content))]"},row:{px:13,className:"w-[calc(13*var(--content))] h-[calc(13*var(--content))]"}};function kJ({phase:e,disabledReason:t,onClick:n,variant:r}){const i=h.jsx(MN,{size:tO[r].px,className:tO[r].className});if(t!==null)return h.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:t,"aria-label":`Download: ${t}`,className:`${Jj} ${eO[r]} cursor-not-allowed border-line bg-[#f3f1ea] text-ink-4`,children:[i,h.jsx("span",{children:"Download"})]});const a=e!=="idle",c=xJ[e]??"Download",u=wJ[e]??"Download";return h.jsxs("button",{type:"button",onClick:n,disabled:a,"aria-disabled":a,title:u,"aria-live":a?"polite":void 0,className:`${Jj} ${eO[r]} cursor-pointer border-honey-2 bg-honey text-honey-ink transition-[background-color,border-color,box-shadow,color,transform] hover:bg-honey-2 hover:shadow-[0_2px_6px_rgba(40,44,50,0.12)] active:translate-y-[0.5px] disabled:cursor-not-allowed disabled:border-line disabled:bg-[#f3f1ea] disabled:text-ink-4 disabled:shadow-none disabled:active:translate-y-0 disabled:hover:bg-[#f3f1ea] disabled:hover:shadow-none`,children:[a?h.jsx("span",{className:"hp-save-spin","aria-hidden":"true"}):i,h.jsx("span",{children:c})]})}const _J=900;function SJ(e,t){return e==="publishing"&&t==="published"}function EJ({state:e,isPending:t,hasOutstandingChanges:n,onClick:r}){const i=w.useRef(null),[a,c]=w.useState(!1);w.useEffect(()=>{const m=i.current;if(SJ(m,e)){c(!0);const x=setTimeout(()=>c(!1),_J);return i.current=e,()=>clearTimeout(x)}i.current=e},[e]);const u=e==="publishing"||t,f=e==="published"&&!n&&!a,p=u?"Publishing…":"Publish",y=u?"Publishing your page…":"Publish";return a?h.jsxs("button",{type:"button","aria-disabled":"true","aria-label":"Published",onClick:m=>m.preventDefault(),className:"hp-cta hp-cta-burst hp-cta-pulse relative box-border inline-flex h-10 w-full cursor-default items-center justify-center gap-1.75 overflow-visible rounded-lg border border-[var(--color-accent)] bg-[var(--color-accent)] text-center text-[length:calc(13.5*var(--content))] font-semibold tracking-[-0.005em] text-honey transition-[background-color,border-color,color] duration-[400ms]",children:[h.jsx(bi,{size:14,className:"hp-cta-check w-[calc(14*var(--content))] h-[calc(14*var(--content))]"}),h.jsx("span",{children:"Published"})]}):f?h.jsxs("button",{type:"button","aria-disabled":"true",title:"Your site is up to date","aria-label":"Published; your site is up to date",onClick:m=>m.preventDefault(),className:"hp-cta box-border inline-flex h-10 w-full cursor-not-allowed items-center justify-center gap-1.75 rounded-lg border border-line bg-[#F4F2EB] text-center text-[length:calc(13.5*var(--content))] font-semibold tracking-[-0.005em] text-[var(--color-accent)]",children:[h.jsx(bi,{size:14,className:"w-[calc(14*var(--content))] h-[calc(14*var(--content))]"}),h.jsx("span",{children:"Published"})]}):h.jsx("button",{type:"button",onClick:r,disabled:u,"aria-disabled":u,title:y,"aria-live":u?"polite":void 0,className:"hp-cta box-border inline-flex h-10 w-full cursor-pointer items-center justify-center gap-1.75 rounded-lg border border-honey-2 bg-honey text-center text-[length:calc(13.5*var(--content))] font-semibold tracking-[-0.005em] text-honey-ink transition-[background-color,border-color,box-shadow,color,transform] hover:bg-honey-2 hover:shadow-[0_2px_6px_rgba(40,44,50,0.12)] active:translate-y-[0.5px] disabled:cursor-not-allowed disabled:border-line disabled:bg-[#f3f1ea] disabled:text-ink-4 disabled:shadow-none disabled:active:translate-y-0 disabled:hover:bg-[#f3f1ea] disabled:hover:shadow-none",children:u?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"hp-save-spin","aria-hidden":"true"}),h.jsx("span",{children:p})]}):h.jsx("span",{children:p})})}var nO;function ge(e,t,n){function r(u,f){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,f);const p=c.prototype,y=Object.keys(p);for(let m=0;m<y.length;m++){const x=y[m];x in u||(u[x]=p[x].bind(u))}}const i=(n==null?void 0:n.Parent)??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function c(u){var f;const p=n!=null&&n.Parent?new a:this;r(p,u),(f=p._zod).deferred??(f.deferred=[]);for(const y of p._zod.deferred)y();return p}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var f,p;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(p=(f=u==null?void 0:u._zod)==null?void 0:f.traits)==null?void 0:p.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Va extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class a5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(nO=globalThis).__zod_globalConfig??(nO.__zod_globalConfig={});const Mw=globalThis.__zod_globalConfig;function Rs(e){return Mw}function l5(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function zv(e,t){return typeof t=="bigint"?t.toString():t}function Rw(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Tw(e){return e==null}function $w(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function jJ(e,t){const n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const rO=Symbol("evaluating");function mt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rO)return r===void 0&&(r=rO,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Hs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ni(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function oO(e){return JSON.stringify(e)}function OJ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const c5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function op(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const AJ=Rw(()=>{var e;if(Mw.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Nu(e){if(op(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(op(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function u5(e){return Nu(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const CJ=new Set(["string","number","symbol"]);function _l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mi(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function NJ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const MJ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function RJ(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Ni(e._zod.def,{get shape(){const c={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(c[u]=n.shape[u])}return Hs(this,"shape",c),c},checks:[]});return Mi(e,a)}function TJ(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Ni(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete c[u]}return Hs(this,"shape",c),c},checks:[]});return Mi(e,a)}function $J(e,t){if(!Nu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(a,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ni(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Hs(this,"shape",a),a}});return Mi(e,i)}function zJ(e,t){if(!Nu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ni(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Hs(this,"shape",r),r}});return Mi(e,n)}function DJ(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Ni(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Hs(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Mi(e,n)}function LJ(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Ni(t._zod.def,{get shape(){const u=t._zod.def.shape,f={...u};if(n)for(const p in n){if(!(p in u))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(f[p]=e?new e({type:"optional",innerType:u[p]}):u[p])}else for(const p in u)f[p]=e?new e({type:"optional",innerType:u[p]}):u[p];return Hs(this,"shape",f),f},checks:[]});return Mi(t,c)}function IJ(e,t,n){const r=Ni(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(a[c]=new e({type:"nonoptional",innerType:i[c]}))}else for(const c in i)a[c]=new e({type:"nonoptional",innerType:i[c]});return Hs(this,"shape",a),a}});return Mi(t,r)}function Pa(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function UJ(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function d5(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Jf(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ts(e,t,n){var f,p,y,m,x,v;const r=e.message?e.message:Jf((y=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:y.call(p,e))??Jf((m=t==null?void 0:t.error)==null?void 0:m.call(t,e))??Jf((x=n.customError)==null?void 0:x.call(n,e))??Jf((v=n.localeError)==null?void 0:v.call(n,e))??"Invalid input",{inst:i,continue:a,input:c,...u}=e;return u.path??(u.path=[]),u.message=r,t!=null&&t.reportInput&&(u.input=c),u}function zw(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Mu(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const f5=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},h5=ge("$ZodError",f5),p5=ge("$ZodError",f5,{Parent:Error});function PJ(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function FJ(e,t=n=>n.message){const n={_errors:[]},r=(i,a=[])=>{for(const c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>r({issues:u},[...a,...c.path]));else if(c.code==="invalid_key")r({issues:c.issues},[...a,...c.path]);else if(c.code==="invalid_element")r({issues:c.issues},[...a,...c.path]);else{const u=[...a,...c.path];if(u.length===0)n._errors.push(t(c));else{let f=n,p=0;for(;p<u.length;){const y=u[p];p===u.length-1?(f[y]=f[y]||{_errors:[]},f[y]._errors.push(t(c))):f[y]=f[y]||{_errors:[]},f=f[y],p++}}}};return r(e),n}const Dw=e=>(t,n,r,i)=>{const a=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new Va;if(c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(f=>Ts(f,a,Rs())));throw c5(u,i==null?void 0:i.callee),u}return c.value},Lw=e=>async(t,n,r,i)=>{const a=r?{...r,async:!0}:{async:!0};let c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(f=>Ts(f,a,Rs())));throw c5(u,i==null?void 0:i.callee),u}return c.value},em=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Va;return a.issues.length?{success:!1,error:new(e??h5)(a.issues.map(c=>Ts(c,i,Rs())))}:{success:!0,data:a.value}},BJ=em(p5),tm=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(c=>Ts(c,i,Rs())))}:{success:!0,data:a.value}},HJ=tm(p5),qJ=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Dw(e)(t,n,i)},VJ=e=>(t,n,r)=>Dw(e)(t,n,r),ZJ=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Lw(e)(t,n,i)},KJ=e=>async(t,n,r)=>Lw(e)(t,n,r),GJ=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return em(e)(t,n,i)},YJ=e=>(t,n,r)=>em(e)(t,n,r),QJ=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return tm(e)(t,n,i)},XJ=e=>async(t,n,r)=>tm(e)(t,n,r),WJ=/^[cC][0-9a-z]{6,}$/,JJ=/^[0-9a-z]+$/,eee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tee=/^[0-9a-vA-V]{20}$/,nee=/^[A-Za-z0-9]{27}$/,ree=/^[a-zA-Z0-9_-]{21}$/,oee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,iO=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,see=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aee="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lee(){return new RegExp(aee,"u")}const cee=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dee=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,m5=/^[A-Za-z0-9_-]*$/,pee=/^https?$/,mee=/^\+[1-9]\d{6,14}$/,g5="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gee=new RegExp(`^${g5}$`);function y5(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yee(e){return new RegExp(`^${y5(e)}$`)}function bee(e){const t=y5({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${g5}T(?:${r})$`)}const vee=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xee=/^-?\d+$/,wee=/^-?\d+(?:\.\d+)?$/,kee=/^(?:true|false)$/i,_ee=/^[^A-Z]*$/,See=/^[^a-z]*$/,Dn=ge("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),b5={number:"number",bigint:"bigint",object:"date"},v5=ge("$ZodCheckLessThan",(e,t)=>{Dn.init(e,t);const n=b5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),x5=ge("$ZodCheckGreaterThan",(e,t)=>{Dn.init(e,t);const n=b5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Eee=ge("$ZodCheckMultipleOf",(e,t)=>{Dn.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):jJ(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),jee=ge("$ZodCheckNumberFormat",(e,t)=>{var c;Dn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),r=n?"int":"number",[i,a]=MJ[t.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=xee)}),e._zod.check=u=>{const f=u.value;if(n){if(!Number.isInteger(f)){u.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?u.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):u.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}f<i&&u.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&u.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Oee=ge("$ZodCheckMaxLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Tw(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const c=zw(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Aee=ge("$ZodCheckMinLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Tw(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const c=zw(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Cee=ge("$ZodCheckLengthEquals",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Tw(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const c=zw(i),u=a>t.length;r.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nm=ge("$ZodCheckStringFormat",(e,t)=>{var n,r;Dn.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Nee=ge("$ZodCheckRegex",(e,t)=>{nm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mee=ge("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_ee),nm.init(e,t)}),Ree=ge("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=See),nm.init(e,t)}),Tee=ge("$ZodCheckIncludes",(e,t)=>{Dn.init(e,t);const n=_l(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),$ee=ge("$ZodCheckStartsWith",(e,t)=>{Dn.init(e,t);const n=new RegExp(`^${_l(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),zee=ge("$ZodCheckEndsWith",(e,t)=>{Dn.init(e,t);const n=new RegExp(`.*${_l(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Dee=ge("$ZodCheckOverwrite",(e,t)=>{Dn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Lee{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
1269
|
-
`).filter(c=>c),i=Math.min(...r.map(c=>c.length-c.trimStart().length)),a=r.map(c=>c.slice(i)).map(c=>" ".repeat(this.indent*2)+c);for(const c of a)this.content.push(c)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
1270
|
-
`))}}const Iee={major:4,minor:4,patch:3},Tt=ge("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Iee;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const a of r)for(const c of a._zod.onattach)c(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const a=(u,f,p)=>{let y=Pa(u),m;for(const x of f){if(x._zod.def.when){if(UJ(u)||!x._zod.def.when(u))continue}else if(y)continue;const v=u.issues.length,_=x._zod.check(u);if(_ instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Va;if(m||_ instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await _,u.issues.length!==v&&(y||(y=Pa(u,v)))});else{if(u.issues.length===v)continue;y||(y=Pa(u,v))}}return m?m.then(()=>u):u},c=(u,f,p)=>{if(Pa(u))return u.aborted=!0,u;const y=a(f,r,p);if(y instanceof Promise){if(p.async===!1)throw new Va;return y.then(m=>e._zod.parse(m,p))}return e._zod.parse(y,p)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const y=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return y instanceof Promise?y.then(m=>c(m,u,f)):c(y,u,f)}const p=e._zod.parse(u,f);if(p instanceof Promise){if(f.async===!1)throw new Va;return p.then(y=>a(y,r,f))}return a(p,r,f)}}mt(e,"~standard",()=>({validate:a=>{var c;try{const u=BJ(e,a);return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}}catch{return HJ(e,a).then(f=>{var p;return f.success?{value:f.data}:{issues:(p=f.error)==null?void 0:p.issues}})}},vendor:"zod",version:1}))}),Iw=ge("$ZodString",(e,t)=>{var n;Tt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??vee(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Et=ge("$ZodStringFormat",(e,t)=>{nm.init(e,t),Iw.init(e,t)}),Uee=ge("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=iee),Et.init(e,t)}),Pee=ge("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=iO(r))}else t.pattern??(t.pattern=iO());Et.init(e,t)}),Fee=ge("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=see),Et.init(e,t)}),Bee=ge("$ZodURL",(e,t)=>{Et.init(e,t),e._zod.check=n=>{var r;try{const i=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===pee.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const a=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=a.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Hee=ge("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=lee()),Et.init(e,t)}),qee=ge("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ree),Et.init(e,t)}),Vee=ge("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=WJ),Et.init(e,t)}),Zee=ge("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=JJ),Et.init(e,t)}),Kee=ge("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eee),Et.init(e,t)}),Gee=ge("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tee),Et.init(e,t)}),Yee=ge("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nee),Et.init(e,t)}),Qee=ge("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bee(t)),Et.init(e,t)}),Xee=ge("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=gee),Et.init(e,t)}),Wee=ge("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yee(t)),Et.init(e,t)}),Jee=ge("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=oee),Et.init(e,t)}),ete=ge("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=cee),Et.init(e,t),e._zod.bag.format="ipv4"}),tte=ge("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=uee),Et.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),nte=ge("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=dee),Et.init(e,t)}),rte=ge("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=fee),Et.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const c=Number(a);if(`${c}`!==a)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function w5(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ote=ge("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hee),Et.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{w5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ite(e){if(!m5.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return w5(n)}const ste=ge("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=m5),Et.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ite(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ate=ge("$ZodE164",(e,t)=>{t.pattern??(t.pattern=mee),Et.init(e,t)});function lte(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const cte=ge("$ZodJWT",(e,t)=>{Et.init(e,t),e._zod.check=n=>{lte(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),k5=ge("$ZodNumber",(e,t)=>{Tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??wee,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),ute=ge("$ZodNumberFormat",(e,t)=>{jee.init(e,t),k5.init(e,t)}),dte=ge("$ZodBoolean",(e,t)=>{Tt.init(e,t),e._zod.pattern=kee,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),fte=ge("$ZodUnknown",(e,t)=>{Tt.init(e,t),e._zod.parse=n=>n}),hte=ge("$ZodNever",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function sO(e,t,n){e.issues.length&&t.issues.push(...d5(n,e.issues)),t.value[n]=e.value}const pte=ge("$ZodArray",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let c=0;c<i.length;c++){const u=i[c],f=t.element._zod.run({value:u,issues:[]},r);f instanceof Promise?a.push(f.then(p=>sO(p,n,c))):sO(f,n,c)}return a.length?Promise.all(a).then(()=>n):n}});function ip(e,t,n,r,i,a){const c=n in r;if(e.issues.length){if(i&&a&&!c)return;t.issues.push(...d5(n,e.issues))}if(!c&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?c&&(t.value[n]=void 0):t.value[n]=e.value}function _5(e){var r,i,a,c;const t=Object.keys(e.shape);for(const u of t)if(!((c=(a=(i=(r=e.shape)==null?void 0:r[u])==null?void 0:i._zod)==null?void 0:a.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const n=NJ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function S5(e,t,n,r,i,a){const c=[],u=i.keySet,f=i.catchall._zod,p=f.def.type,y=f.optin==="optional",m=f.optout==="optional";for(const x in t){if(x==="__proto__"||u.has(x))continue;if(p==="never"){c.push(x);continue}const v=f.run({value:t[x],issues:[]},r);v instanceof Promise?e.push(v.then(_=>ip(_,n,x,t,y,m))):ip(v,n,x,t,y,m)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const mte=ge("$ZodObject",(e,t)=>{Tt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...u};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=Rw(()=>_5(t));mt(e._zod,"propValues",()=>{const u=t.shape,f={};for(const p in u){const y=u[p]._zod;if(y.values){f[p]??(f[p]=new Set);for(const m of y.values)f[p].add(m)}}return f});const i=op,a=t.catchall;let c;e._zod.parse=(u,f)=>{c??(c=r.value);const p=u.value;if(!i(p))return u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u;u.value={};const y=[],m=c.shape;for(const x of c.keys){const v=m[x],_=v._zod.optin==="optional",k=v._zod.optout==="optional",S=v._zod.run({value:p[x],issues:[]},f);S instanceof Promise?y.push(S.then(j=>ip(j,u,x,p,_,k))):ip(S,u,x,p,_,k)}return a?S5(y,p,u,f,r.value,e):y.length?Promise.all(y).then(()=>u):u}}),gte=ge("$ZodObjectJIT",(e,t)=>{mte.init(e,t);const n=e._zod.parse,r=Rw(()=>_5(t)),i=x=>{var A,$;const v=new Lee(["shape","payload","ctx"]),_=r.value,k=C=>{const I=oO(C);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};v.write("const input = payload.value;");const S=Object.create(null);let j=0;for(const C of _.keys)S[C]=`key_${j++}`;v.write("const newResult = {};");for(const C of _.keys){const I=S[C],z=oO(C),T=x[C],F=((A=T==null?void 0:T._zod)==null?void 0:A.optin)==="optional",W=(($=T==null?void 0:T._zod)==null?void 0:$.optout)==="optional";v.write(`const ${I} = ${k(C)};`),F&&W?v.write(`
|
|
1271
|
-
if (${I}.issues.length) {
|
|
1272
|
-
if (${z} in input) {
|
|
1273
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
1274
|
-
...iss,
|
|
1275
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
1276
|
-
})));
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
if (${I}.value === undefined) {
|
|
1281
|
-
if (${z} in input) {
|
|
1282
|
-
newResult[${z}] = undefined;
|
|
1283
|
-
}
|
|
1284
|
-
} else {
|
|
1285
|
-
newResult[${z}] = ${I}.value;
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
`):F?v.write(`
|
|
1289
|
-
if (${I}.issues.length) {
|
|
1290
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
1291
|
-
...iss,
|
|
1292
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
1293
|
-
})));
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
if (${I}.value === undefined) {
|
|
1297
|
-
if (${z} in input) {
|
|
1298
|
-
newResult[${z}] = undefined;
|
|
1299
|
-
}
|
|
1300
|
-
} else {
|
|
1301
|
-
newResult[${z}] = ${I}.value;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
`):v.write(`
|
|
1305
|
-
const ${I}_present = ${z} in input;
|
|
1306
|
-
if (${I}.issues.length) {
|
|
1307
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
1308
|
-
...iss,
|
|
1309
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
1310
|
-
})));
|
|
1311
|
-
}
|
|
1312
|
-
if (!${I}_present && !${I}.issues.length) {
|
|
1313
|
-
payload.issues.push({
|
|
1314
|
-
code: "invalid_type",
|
|
1315
|
-
expected: "nonoptional",
|
|
1316
|
-
input: undefined,
|
|
1317
|
-
path: [${z}]
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
if (${I}_present) {
|
|
1322
|
-
if (${I}.value === undefined) {
|
|
1323
|
-
newResult[${z}] = undefined;
|
|
1324
|
-
} else {
|
|
1325
|
-
newResult[${z}] = ${I}.value;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(C,I)=>O(x,C,I)};let a;const c=op,u=!Mw.jitless,p=u&&AJ.value,y=t.catchall;let m;e._zod.parse=(x,v)=>{m??(m=r.value);const _=x.value;return c(_)?u&&p&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(a||(a=i(t.shape)),x=a(x,v),y?S5([],_,x,v,m,e):x):n(x,v):(x.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),x)}});function aO(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!Pa(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(c=>Ts(c,r,Rs())))}),t)}const yte=ge("$ZodUnion",(e,t)=>{Tt.init(e,t),mt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),mt(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>$w(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1;const c=[];for(const u of t.options){const f=u._zod.run({value:r.value,issues:[]},i);if(f instanceof Promise)c.push(f),a=!0;else{if(f.issues.length===0)return f;c.push(f)}}return a?Promise.all(c).then(u=>aO(u,r,e,i)):aO(c,r,e,i)}}),bte=ge("$ZodIntersection",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),c=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||c instanceof Promise?Promise.all([a,c]).then(([f,p])=>lO(n,f,p)):lO(n,a,c)}});function Dv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nu(e)&&Nu(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const c=Dv(e[a],t[a]);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};i[a]=c.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],c=Dv(i,a);if(!c.valid)return{valid:!1,mergeErrorPath:[r,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lO(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const f of u.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const f of u.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),Pa(e))return e;const c=Dv(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const vte=ge("$ZodEnum",(e,t)=>{Tt.init(e,t);const n=l5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>CJ.has(typeof i)).map(i=>typeof i=="string"?_l(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const c=i.value;return r.has(c)||i.issues.push({code:"invalid_value",values:n,input:c,inst:e}),i}}),xte=ge("$ZodLiteral",(e,t)=>{if(Tt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?_l(r):r?_l(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),wte=ge("$ZodTransform",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new a5(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(n.value=c,n.fallback=!0,n));if(i instanceof Promise)throw new Va;return n.value=i,n.fallback=!0,n}});function cO(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const E5=ge("$ZodOptional",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=n.value,a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(c=>cO(c,i)):cO(a,i)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),kte=ge("$ZodExactOptional",(e,t)=>{E5.init(e,t),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),_te=ge("$ZodNullable",(e,t)=>{Tt.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$w(n.source)}|null)$`):void 0}),mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Ste=ge("$ZodDefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>uO(a,t)):uO(i,t)}});function uO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ete=ge("$ZodPrefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),jte=ge("$ZodNonOptional",(e,t)=>{Tt.init(e,t),mt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>dO(a,e)):dO(i,e)}});function dO(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ote=ge("$ZodCatch",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(c=>Ts(c,r,Rs()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Ts(a,r,Rs()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ate=ge("$ZodPipe",(e,t)=>{Tt.init(e,t),mt(e._zod,"values",()=>t.in._zod.values),mt(e._zod,"optin",()=>t.in._zod.optin),mt(e._zod,"optout",()=>t.out._zod.optout),mt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(c=>eh(c,t.in,r)):eh(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>eh(a,t.out,r)):eh(i,t.out,r)}});function eh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Cte=ge("$ZodReadonly",(e,t)=>{Tt.init(e,t),mt(e._zod,"propValues",()=>t.innerType._zod.propValues),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),mt(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(fO):fO(i)}});function fO(e){return e.value=Object.freeze(e.value),e}const Nte=ge("$ZodCustom",(e,t)=>{Dn.init(e,t),Tt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>hO(a,n,r,e));hO(i,n,r,e)}});function hO(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Mu(i))}}var pO;class Mte{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rte(){return new Mte}(pO=globalThis).__zod_globalRegistry??(pO.__zod_globalRegistry=Rte());const eu=globalThis.__zod_globalRegistry;function Tte(e,t){return new e({type:"string",...ze(t)})}function $te(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function mO(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function zte(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function Dte(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function Lte(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function Ite(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function Ute(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function Pte(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function Fte(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function Bte(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function Hte(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function qte(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function Vte(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function Zte(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function Kte(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function Gte(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function Yte(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function Qte(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function Xte(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function Wte(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function Jte(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function ene(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function tne(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function nne(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function rne(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function one(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function ine(e,t){return new e({type:"number",checks:[],...ze(t)})}function sne(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function ane(e,t){return new e({type:"boolean",...ze(t)})}function lne(e){return new e({type:"unknown"})}function cne(e,t){return new e({type:"never",...ze(t)})}function gO(e,t){return new v5({check:"less_than",...ze(t),value:e,inclusive:!1})}function rb(e,t){return new v5({check:"less_than",...ze(t),value:e,inclusive:!0})}function yO(e,t){return new x5({check:"greater_than",...ze(t),value:e,inclusive:!1})}function ob(e,t){return new x5({check:"greater_than",...ze(t),value:e,inclusive:!0})}function bO(e,t){return new Eee({check:"multiple_of",...ze(t),value:e})}function j5(e,t){return new Oee({check:"max_length",...ze(t),maximum:e})}function sp(e,t){return new Aee({check:"min_length",...ze(t),minimum:e})}function O5(e,t){return new Cee({check:"length_equals",...ze(t),length:e})}function une(e,t){return new Nee({check:"string_format",format:"regex",...ze(t),pattern:e})}function dne(e){return new Mee({check:"string_format",format:"lowercase",...ze(e)})}function fne(e){return new Ree({check:"string_format",format:"uppercase",...ze(e)})}function hne(e,t){return new Tee({check:"string_format",format:"includes",...ze(t),includes:e})}function pne(e,t){return new $ee({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function mne(e,t){return new zee({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function Hl(e){return new Dee({check:"overwrite",tx:e})}function gne(e){return Hl(t=>t.normalize(e))}function yne(){return Hl(e=>e.trim())}function bne(){return Hl(e=>e.toLowerCase())}function vne(){return Hl(e=>e.toUpperCase())}function xne(){return Hl(e=>OJ(e))}function wne(e,t,n){return new e({type:"array",element:t,...ze(n)})}function kne(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function _ne(e,t){const n=Sne(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Mu(i,r.value,n._zod.def));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=n),a.continue??(a.continue=!n._zod.def.abort),r.issues.push(Mu(a))}},e(r.value,r)),t);return n}function Sne(e,t){const n=new Dn({check:"custom",...ze(t)});return n._zod.check=e,n}function A5(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??eu,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function un(e,t,n={path:[],schemaPath:[]}){var y,m;var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const u=(m=(y=e._zod).toJSONSchema)==null?void 0:m.call(y);if(u)c.schema=u;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,x);else{const _=c.schema,k=t.processors[i.type];if(!k)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);k(e,t,_,x)}const v=e._zod.parent;v&&(c.ref||(c.ref=v),un(v,t,x),t.seen.get(v).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(c.schema,f),t.io==="input"&&yn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&"_prefault"in c.schema&&((r=c.schema).default??(r.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function C5(e,t){var c,u,f,p;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const y of e.seen.entries()){const m=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(m){const x=r.get(m);if(x&&x!==y[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,y[0])}}const i=y=>{var k;const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=(k=e.external.registry.get(y[0]))==null?void 0:k.id,j=e.external.uri??(A=>A);if(S)return{ref:j(S)};const O=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=O,{defId:O,ref:`${j("__shared")}#/${m}/${O}`}}if(y[1]===n)return{ref:"#"};const v=`#/${m}/`,_=y[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:v+_}},a=y=>{if(y[1].schema.$ref)return;const m=y[1],{ref:x,defId:v}=i(y);m.def={...m.schema},v&&(m.defId=v);const _=m.schema;for(const k in _)delete _[k];_.$ref=x};if(e.cycles==="throw")for(const y of e.seen.entries()){const m=y[1];if(m.cycle)throw new Error(`Cycle detected: #/${(u=m.cycle)==null?void 0:u.join("/")}/<root>
|
|
1330
|
-
|
|
1331
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const m=y[1];if(t===y[0]){a(y);continue}if(e.external){const v=(f=e.external.registry.get(y[0]))==null?void 0:f.id;if(t!==y[0]&&v){a(y);continue}}if((p=e.metadataRegistry.get(y[0]))==null?void 0:p.id){a(y);continue}if(m.cycle){a(y);continue}if(m.count>1&&e.reused==="ref"){a(y);continue}}}function N5(e,t){var u,f,p,y;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=m=>{const x=e.seen.get(m);if(x.ref===null)return;const v=x.def??x.schema,_={...v},k=x.ref;if(x.ref=null,k){r(k);const j=e.seen.get(k),O=j.schema;if(O.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(O)):Object.assign(v,O),Object.assign(v,_),m._zod.parent===k)for(const $ in v)$==="$ref"||$==="allOf"||$ in _||delete v[$];if(O.$ref&&j.def)for(const $ in v)$==="$ref"||$==="allOf"||$ in j.def&&JSON.stringify(v[$])===JSON.stringify(j.def[$])&&delete v[$]}const S=m._zod.parent;if(S&&S!==k){r(S);const j=e.seen.get(S);if(j!=null&&j.schema.$ref&&(v.$ref=j.schema.$ref,j.def))for(const O in v)O==="$ref"||O==="allOf"||O in j.def&&JSON.stringify(v[O])===JSON.stringify(j.def[O])&&delete v[O]}e.override({zodSchema:m,jsonSchema:v,path:x.path??[]})};for(const m of[...e.seen.entries()].reverse())r(m[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const m=(f=e.external.registry.get(t))==null?void 0:f.id;if(!m)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(m)}Object.assign(i,n.def??n.schema);const a=(p=e.metadataRegistry.get(t))==null?void 0:p.id;a!==void 0&&i.id===a&&delete i.id;const c=((y=e.external)==null?void 0:y.defs)??{};for(const m of e.seen.entries()){const x=m[1];x.def&&x.defId&&(x.def.id===x.defId&&delete x.def.id,c[x.defId]=x.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?i.$defs=c:i.definitions=c);try{const m=JSON.parse(JSON.stringify(i));return Object.defineProperty(m,"~standard",{value:{...t["~standard"],jsonSchema:{input:ap(t,"input",e.processors),output:ap(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return yn(r.element,n);if(r.type==="set")return yn(r.valueType,n);if(r.type==="lazy")return yn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return yn(r.innerType,n);if(r.type==="intersection")return yn(r.left,n)||yn(r.right,n);if(r.type==="record"||r.type==="map")return yn(r.keyType,n)||yn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:yn(r.in,n)||yn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(yn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(yn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(yn(i,n))return!0;return!!(r.rest&&yn(r.rest,n))}return!1}const Ene=(e,t={})=>n=>{const r=A5({...n,processors:t});return un(e,r),C5(r,e),N5(r,e)},ap=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},c=A5({...i??{},target:a,io:t,processors:n});return un(e,c),C5(c,e),N5(c,e)},jne={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},One=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:c,format:u,patterns:f,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof c=="number"&&(i.maxLength=c),u&&(i.format=jne[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),p&&(i.contentEncoding=p),f&&f.size>0){const y=[...f];y.length===1?i.pattern=y[0].source:y.length>1&&(i.allOf=[...y.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Ane=(e,t,n,r)=>{const i=n,{minimum:a,maximum:c,format:u,multipleOf:f,exclusiveMaximum:p,exclusiveMinimum:y}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number";const m=typeof y=="number"&&y>=(a??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";m?v?(i.minimum=y,i.exclusiveMinimum=!0):i.exclusiveMinimum=y:typeof a=="number"&&(i.minimum=a),x?v?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p:typeof c=="number"&&(i.maximum=c),typeof f=="number"&&(i.multipleOf=f)},Cne=(e,t,n,r)=>{n.type="boolean"},Nne=(e,t,n,r)=>{n.not={}},Mne=(e,t,n,r)=>{},Rne=(e,t,n,r)=>{const i=e._zod.def,a=l5(i.entries);a.every(c=>typeof c=="number")&&(n.type="number"),a.every(c=>typeof c=="string")&&(n.type="string"),n.enum=a},Tne=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const c of i.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(c))}else a.push(c);if(a.length!==0)if(a.length===1){const c=a[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else a.every(c=>typeof c=="number")&&(n.type="number"),a.every(c=>typeof c=="string")&&(n.type="string"),a.every(c=>typeof c=="boolean")&&(n.type="boolean"),a.every(c=>c===null)&&(n.type="null"),n.enum=a},$ne=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zne=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Dne=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:c,maximum:u}=e._zod.bag;typeof c=="number"&&(i.minItems=c),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=un(a.element,t,{...r,path:[...r.path,"items"]})},Lne=(e,t,n,r)=>{var p;const i=n,a=e._zod.def;i.type="object",i.properties={};const c=a.shape;for(const y in c)i.properties[y]=un(c[y],t,{...r,path:[...r.path,"properties",y]});const u=new Set(Object.keys(c)),f=new Set([...u].filter(y=>{const m=a.shape[y]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));f.size>0&&(i.required=Array.from(f)),((p=a.catchall)==null?void 0:p._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=un(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Ine=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,c=i.options.map((u,f)=>un(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",f]}));a?n.oneOf=c:n.anyOf=c},Une=(e,t,n,r)=>{const i=e._zod.def,a=un(i.left,t,{...r,path:[...r.path,"allOf",0]}),c=un(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=p=>"allOf"in p&&Object.keys(p).length===1,f=[...u(a)?a.allOf:[a],...u(c)?c.allOf:[c]];n.allOf=f},Pne=(e,t,n,r)=>{const i=e._zod.def,a=un(i.innerType,t,r),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},Fne=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},Bne=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Hne=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},qne=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let c;try{c=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},Vne=(e,t,n,r)=>{const i=e._zod.def,a=i.in._zod.traits.has("$ZodTransform"),c=t.io==="input"?a?i.out:i.in:i.out;un(c,t,r);const u=t.seen.get(e);u.ref=c},Zne=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},M5=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},Kne=ge("ZodISODateTime",(e,t)=>{Qee.init(e,t),Ot.init(e,t)});function Gne(e){return tne(Kne,e)}const Yne=ge("ZodISODate",(e,t)=>{Xee.init(e,t),Ot.init(e,t)});function Qne(e){return nne(Yne,e)}const Xne=ge("ZodISOTime",(e,t)=>{Wee.init(e,t),Ot.init(e,t)});function Wne(e){return rne(Xne,e)}const Jne=ge("ZodISODuration",(e,t)=>{Jee.init(e,t),Ot.init(e,t)});function ere(e){return one(Jne,e)}const tre=(e,t)=>{h5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>FJ(e,n)},flatten:{value:n=>PJ(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zv,2)}},isEmpty:{get(){return e.issues.length===0}}})},cr=ge("ZodError",tre,{Parent:Error}),nre=Dw(cr),rre=Lw(cr),ore=em(cr),ire=tm(cr),sre=qJ(cr),are=VJ(cr),lre=ZJ(cr),cre=KJ(cr),ure=GJ(cr),dre=YJ(cr),fre=QJ(cr),hre=XJ(cr),vO=new WeakMap;function bd(e,t,n){const r=Object.getPrototypeOf(e);let i=vO.get(r);if(i||(i=new Set,vO.set(r,i)),!i.has(t)){i.add(t);for(const a in n){const c=n[a];Object.defineProperty(r,a,{configurable:!0,enumerable:!1,get(){const u=c.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:u}),u},set(u){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:u})}})}}}const $t=ge("ZodType",(e,t)=>(Tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ap(e,"input"),output:ap(e,"output")}}),e.toJSONSchema=Ene(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>nre(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>ore(e,n,r),e.parseAsync=async(n,r)=>rre(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>ire(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>sre(e,n,r),e.decode=(n,r)=>are(e,n,r),e.encodeAsync=async(n,r)=>lre(e,n,r),e.decodeAsync=async(n,r)=>cre(e,n,r),e.safeEncode=(n,r)=>ure(e,n,r),e.safeDecode=(n,r)=>dre(e,n,r),e.safeEncodeAsync=async(n,r)=>fre(e,n,r),e.safeDecodeAsync=async(n,r)=>hre(e,n,r),bd(e,"ZodType",{check(...n){const r=this.def;return this.clone(Ni(r,{checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Mi(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(soe(n,r))},superRefine(n,r){return this.check(aoe(n,r))},overwrite(n){return this.check(Hl(n))},optional(){return kO(this)},exactOptional(){return Kre(this)},nullable(){return _O(this)},nullish(){return kO(_O(this))},nonoptional(n){return Jre(this,n)},array(){return Ru(this)},or(n){return Uw([this,n])},and(n){return Fre(this,n)},transform(n){return SO(this,Vre(n))},default(n){return Qre(this,n)},prefault(n){return Wre(this,n)},catch(n){return toe(this,n)},pipe(n){return SO(this,n)},readonly(){return ooe(this)},describe(n){const r=this.clone();return eu.add(r,{description:n}),r},meta(...n){if(n.length===0)return eu.get(this);const r=this.clone();return eu.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=eu.get(e))==null?void 0:n.description},configurable:!0}),e)),R5=ge("_ZodString",(e,t)=>{Iw.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(r,i,a)=>One(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,bd(e,"_ZodString",{regex(...r){return this.check(une(...r))},includes(...r){return this.check(hne(...r))},startsWith(...r){return this.check(pne(...r))},endsWith(...r){return this.check(mne(...r))},min(...r){return this.check(sp(...r))},max(...r){return this.check(j5(...r))},length(...r){return this.check(O5(...r))},nonempty(...r){return this.check(sp(1,...r))},lowercase(r){return this.check(dne(r))},uppercase(r){return this.check(fne(r))},trim(){return this.check(yne())},normalize(...r){return this.check(gne(...r))},toLowerCase(){return this.check(bne())},toUpperCase(){return this.check(vne())},slugify(){return this.check(xne())}})}),pre=ge("ZodString",(e,t)=>{Iw.init(e,t),R5.init(e,t),e.email=n=>e.check($te(mre,n)),e.url=n=>e.check(Ute(gre,n)),e.jwt=n=>e.check(ene(Mre,n)),e.emoji=n=>e.check(Pte(yre,n)),e.guid=n=>e.check(mO(xO,n)),e.uuid=n=>e.check(zte(th,n)),e.uuidv4=n=>e.check(Dte(th,n)),e.uuidv6=n=>e.check(Lte(th,n)),e.uuidv7=n=>e.check(Ite(th,n)),e.nanoid=n=>e.check(Fte(bre,n)),e.guid=n=>e.check(mO(xO,n)),e.cuid=n=>e.check(Bte(vre,n)),e.cuid2=n=>e.check(Hte(xre,n)),e.ulid=n=>e.check(qte(wre,n)),e.base64=n=>e.check(Xte(Are,n)),e.base64url=n=>e.check(Wte(Cre,n)),e.xid=n=>e.check(Vte(kre,n)),e.ksuid=n=>e.check(Zte(_re,n)),e.ipv4=n=>e.check(Kte(Sre,n)),e.ipv6=n=>e.check(Gte(Ere,n)),e.cidrv4=n=>e.check(Yte(jre,n)),e.cidrv6=n=>e.check(Qte(Ore,n)),e.e164=n=>e.check(Jte(Nre,n)),e.datetime=n=>e.check(Gne(n)),e.date=n=>e.check(Qne(n)),e.time=n=>e.check(Wne(n)),e.duration=n=>e.check(ere(n))});function oo(e){return Tte(pre,e)}const Ot=ge("ZodStringFormat",(e,t)=>{Et.init(e,t),R5.init(e,t)}),mre=ge("ZodEmail",(e,t)=>{Fee.init(e,t),Ot.init(e,t)}),xO=ge("ZodGUID",(e,t)=>{Uee.init(e,t),Ot.init(e,t)}),th=ge("ZodUUID",(e,t)=>{Pee.init(e,t),Ot.init(e,t)}),gre=ge("ZodURL",(e,t)=>{Bee.init(e,t),Ot.init(e,t)}),yre=ge("ZodEmoji",(e,t)=>{Hee.init(e,t),Ot.init(e,t)}),bre=ge("ZodNanoID",(e,t)=>{qee.init(e,t),Ot.init(e,t)}),vre=ge("ZodCUID",(e,t)=>{Vee.init(e,t),Ot.init(e,t)}),xre=ge("ZodCUID2",(e,t)=>{Zee.init(e,t),Ot.init(e,t)}),wre=ge("ZodULID",(e,t)=>{Kee.init(e,t),Ot.init(e,t)}),kre=ge("ZodXID",(e,t)=>{Gee.init(e,t),Ot.init(e,t)}),_re=ge("ZodKSUID",(e,t)=>{Yee.init(e,t),Ot.init(e,t)}),Sre=ge("ZodIPv4",(e,t)=>{ete.init(e,t),Ot.init(e,t)}),Ere=ge("ZodIPv6",(e,t)=>{tte.init(e,t),Ot.init(e,t)}),jre=ge("ZodCIDRv4",(e,t)=>{nte.init(e,t),Ot.init(e,t)}),Ore=ge("ZodCIDRv6",(e,t)=>{rte.init(e,t),Ot.init(e,t)}),Are=ge("ZodBase64",(e,t)=>{ote.init(e,t),Ot.init(e,t)}),Cre=ge("ZodBase64URL",(e,t)=>{ste.init(e,t),Ot.init(e,t)}),Nre=ge("ZodE164",(e,t)=>{ate.init(e,t),Ot.init(e,t)}),Mre=ge("ZodJWT",(e,t)=>{cte.init(e,t),Ot.init(e,t)}),T5=ge("ZodNumber",(e,t)=>{k5.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(r,i,a)=>Ane(e,r,i),bd(e,"ZodNumber",{gt(r,i){return this.check(yO(r,i))},gte(r,i){return this.check(ob(r,i))},min(r,i){return this.check(ob(r,i))},lt(r,i){return this.check(gO(r,i))},lte(r,i){return this.check(rb(r,i))},max(r,i){return this.check(rb(r,i))},int(r){return this.check(wO(r))},safe(r){return this.check(wO(r))},positive(r){return this.check(yO(0,r))},nonnegative(r){return this.check(ob(0,r))},negative(r){return this.check(gO(0,r))},nonpositive(r){return this.check(rb(0,r))},multipleOf(r,i){return this.check(bO(r,i))},step(r,i){return this.check(bO(r,i))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function as(e){return ine(T5,e)}const Rre=ge("ZodNumberFormat",(e,t)=>{ute.init(e,t),T5.init(e,t)});function wO(e){return sne(Rre,e)}const Tre=ge("ZodBoolean",(e,t)=>{dte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Cne(e,n,r)});function Jo(e){return ane(Tre,e)}const $re=ge("ZodUnknown",(e,t)=>{fte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Mne()});function Lv(){return lne($re)}const zre=ge("ZodNever",(e,t)=>{hte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Nne(e,n,r)});function Dre(e){return cne(zre,e)}const Lre=ge("ZodArray",(e,t)=>{pte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Dne(e,n,r,i),e.element=t.element,bd(e,"ZodArray",{min(n,r){return this.check(sp(n,r))},nonempty(n){return this.check(sp(1,n))},max(n,r){return this.check(j5(n,r))},length(n,r){return this.check(O5(n,r))},unwrap(){return this.element}})});function Ru(e,t){return wne(Lre,e,t)}const Ire=ge("ZodObject",(e,t)=>{gte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Lne(e,n,r,i),mt(e,"shape",()=>t.shape),bd(e,"ZodObject",{keyof(){return ks(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Lv()})},loose(){return this.clone({...this._zod.def,catchall:Lv()})},strict(){return this.clone({...this._zod.def,catchall:Dre()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return $J(this,n)},safeExtend(n){return zJ(this,n)},merge(n){return DJ(this,n)},pick(n){return RJ(this,n)},omit(n){return TJ(this,n)},partial(...n){return LJ($5,this,n[0])},required(...n){return IJ(z5,this,n[0])}})});function Sl(e,t){const n={type:"object",shape:e??{},...ze(t)};return new Ire(n)}const Ure=ge("ZodUnion",(e,t)=>{yte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ine(e,n,r,i),e.options=t.options});function Uw(e,t){return new Ure({type:"union",options:e,...ze(t)})}const Pre=ge("ZodIntersection",(e,t)=>{bte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Une(e,n,r,i)});function Fre(e,t){return new Pre({type:"intersection",left:e,right:t})}const Iv=ge("ZodEnum",(e,t)=>{vte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(r,i,a)=>Rne(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const c of r)if(n.has(c))a[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Iv({...t,checks:[],...ze(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const c of r)if(n.has(c))delete a[c];else throw new Error(`Key ${c} not found in enum`);return new Iv({...t,checks:[],...ze(i),entries:a})}});function ks(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Iv({type:"enum",entries:n,...ze(t)})}const Bre=ge("ZodLiteral",(e,t)=>{xte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Tne(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Hre(e,t){return new Bre({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const qre=ge("ZodTransform",(e,t)=>{wte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zne(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new a5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Mu(a,n.value,t));else{const c=a;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Mu(c))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Vre(e){return new qre({type:"transform",transform:e})}const $5=ge("ZodOptional",(e,t)=>{E5.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>M5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kO(e){return new $5({type:"optional",innerType:e})}const Zre=ge("ZodExactOptional",(e,t)=>{kte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>M5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Kre(e){return new Zre({type:"optional",innerType:e})}const Gre=ge("ZodNullable",(e,t)=>{_te.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Pne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _O(e){return new Gre({type:"nullable",innerType:e})}const Yre=ge("ZodDefault",(e,t)=>{Ste.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Bne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qre(e,t){return new Yre({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():u5(t)}})}const Xre=ge("ZodPrefault",(e,t)=>{Ete.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Wre(e,t){return new Xre({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():u5(t)}})}const z5=ge("ZodNonOptional",(e,t)=>{jte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Fne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Jre(e,t){return new z5({type:"nonoptional",innerType:e,...ze(t)})}const eoe=ge("ZodCatch",(e,t)=>{Ote.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function toe(e,t){return new eoe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const noe=ge("ZodPipe",(e,t)=>{Ate.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Vne(e,n,r,i),e.in=t.in,e.out=t.out});function SO(e,t){return new noe({type:"pipe",in:e,out:t})}const roe=ge("ZodReadonly",(e,t)=>{Cte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ooe(e){return new roe({type:"readonly",innerType:e})}const ioe=ge("ZodCustom",(e,t)=>{Nte.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$ne(e,n)});function soe(e,t={}){return kne(ioe,e,t)}function aoe(e,t){return _ne(e,t)}const loe={crop:Sl({mode:ks(["locked","free"]),aspect:as().positive().optional(),aspectLabel:oo().optional(),mobile:Sl({aspect:as().positive(),breakpoint:as().int().positive()}).strict().optional()}).strict().refine(e=>e.mode!=="locked"||e.aspect!=null,{message:"locked crop requires an aspect"}).refine(e=>e.mobile==null||e.aspect!=null,{message:"a mobile crop needs a desktop aspect to differ from"}).refine(e=>e.mobile==null||e.aspect==null||Math.abs(e.mobile.aspect-e.aspect)>1e-4,{message:"a mobile crop equal to the desktop aspect declares nothing — omit it"}).optional()},coe={playback:Sl({autoplay:Jo().optional(),loop:Jo().optional(),muted:Jo().optional(),controls:Jo().optional(),playsinline:Jo().optional(),preload:ks(["none","metadata","auto"]).optional()}).strict().refine(e=>e.autoplay!==!0||e.muted===!0,{message:"autoplay requires muted (browsers block unmuted autoplay)"}).optional()},uoe=Sl({kind:Hre("process"),verb:ks(a0)}).catchall(Lv()),Yc={from:Uw([oo().min(1),Ru(oo().min(1)).min(2)]).optional(),process:Ru(uoe).nonempty().optional()},za=e=>e==null||typeof e=="string"&&e.trim()==="",ib=e=>e==null,nh=e=>e==null||typeof e=="object"&&Object.values(e).every(t=>t==null||t===""),EO={text:{shape:{size:ks(["short","medium","long"]).optional(),cap:as().int().positive().optional()},default:()=>"",isEmpty:za},number:{shape:{thousandsSep:Jo().optional(),decimals:Jo().optional(),maxDigits:as().int().positive().optional()},default:()=>null,isEmpty:ib},select:{shape:{values:Ru(Uw([oo(),Sl({value:oo(),label:oo(),icon:ks(kT).optional(),description:oo().min(1).optional()}).strict()])).optional(),options:Sl({source:oo()}).strict().optional(),creatable:Jo().optional()},default:()=>null,isEmpty:za},image:{shape:{...loe,...Yc},default:()=>({url:"",alt:""}),isEmpty:nh},video:{shape:{...coe,...Yc},default:()=>({url:"",poster:"",alt:""}),isEmpty:nh},tour:{shape:{...Yc},default:()=>({id:"",url:"",poster:"",alt:""}),isEmpty:nh},list:{shape:{min:as().int().nonnegative().optional(),max:as().int().positive().optional()},default:()=>[],isEmpty:e=>e==null||Array.isArray(e)&&e.length===0},poi:{shape:{},default:()=>null,isEmpty:ib},url:{shape:{accepts:oo().optional()},default:()=>"",isEmpty:za},date:{shape:{},default:()=>null,isEmpty:za},email:{shape:{},default:()=>"",isEmpty:za},phone:{shape:{},default:()=>"",isEmpty:za},address:{shape:{},default:()=>null,isEmpty:e=>en(e)===null},document:{shape:{...Yc},default:()=>null,isEmpty:ib},media:{shape:{kinds:Ru(ks(vo)).nonempty().optional(),...Yc},default:()=>null,isEmpty:nh}},D5=["poi","address"];function xh(e){return typeof e=="string"&&D5.includes(e)}const doe=["url","date","email","phone"];function L5(e){return doe.includes(e)}const foe=["image","video","tour","document","media"];function jO(e){return foe.includes(e.type??"")?e.type:void 0}function hoe(e){var t;if(e.type==="list"){const n=(t=e.element)==null?void 0:t.type;return n==="select"?"select":xh(n)||n==="object"||n==="row"?void 0:jO({type:n})!==void 0?"mediaList":"list"}return e.type==="text"||L5(e.type)?"text":e.type==="select"?"choice":jO(e)}function poe(e){switch(e.type){case"list":return"list";case"text":case"url":case"date":case"email":case"phone":return"text";case"number":return"number";default:return"pick"}}const OO=new Set(["select","image","video","tour","document","media","row"]);function Pw(e,t,n){var f;const r=n.verb,i=`fillSpecFromSchema: slot "${e}" (type "${String(t.type)}")`,a=n.of;if(r==="write"&&a!==void 0)throw new Error(`${i} is filled by a \`fill.write\` that declares \`of\` — the kind a write produces is its holder's.`);if(t.type==="list"){const p=(f=t.element)==null?void 0:f.type;if(r==="write"&&moe(i,t.element),r==="find"&&!xh(p))throw new Error(`${i} is filled by \`fill.find\`, but only ${goe} are found — it sources ${yoe} or a list whose item is one.`);if(r!=="find"&&xh(p))throw new Error(`${i} is filled by \`fill.${r}\`, but a list of ${String(p)} is found by the platform's lookup, never ${r==="write"?"written":"picked"} — \`fill.find\`.`);AO(i,n);return}if(xh(t.type)){if(r==="find")return;throw new Error(`${i} is filled by \`fill.${r}\`, but ${sb(String(t.type))} is found by the platform's lookup, never ${r==="write"?"written":"picked"} — \`fill.find\`.`)}const c=t.type==="text"||t.type==="number"||L5(t.type);if(r==="write"&&c)return;if(r==="pick"&&OO.has(t.type??"")){AO(i,n);return}const u=String(t.type);throw new Error(c?`${i} is filled by \`fill.${r}\`, but ${sb(u)} is written — \`fill.write\`.`:OO.has(t.type??"")?`${i} is filled by \`fill.${r}\`, but ${sb(u)} holds a value that exists — \`fill.pick\`.`:`${i} is filled, but no fill produces that type.`)}function AO(e,t){if(!(t.verb!=="pick"||t.of===void 0))throw new Error(`${e} is filled by a \`fill.pick\` that states \`of\` — a pick chooses from its holder's \`from\`.`)}function moe(e,t){var r;const n=t!==void 0&&po(t.type??"")?"a list of media":(r=Object.entries((t==null?void 0:t.type)==="object"?t.fields??{}:{}).find(([,i])=>{var a;return po(i.type??"")&&((a=i.source)==null?void 0:a.kind)==="element"}))==null?void 0:r[0];if(n!==void 0)throw new Error(`${e} is filled by \`fill.write\`, but ${n==="a list of media"?n:`its item's media member "${n}"`} would hold what the write answers — a write composes, it does not birth media: pick it (\`fill.pick\`).`)}const goe="places and addresses",yoe=D5.map(e=>`\`${e}()\``).join(", ");function sb(e){return`${/^[aeiou]/.test(e)&&e!=="url"?"an":"a"} ${e}`}function I5(e,t){if(t.type==="list")return I5(e,boe(e,t));if(t.type==="row"){const r=wo(t.from);if(r===void 0)throw new Error(`fillSpecFromSchema: row "${e}" is picked but names no \`from\` — a row's pick chooses from its table: \`from: fact.property.…\`.`);return r.map(i=>({kind:"home",key:i}))}if(t.type==="select"){if(!Array.isArray(t.values))throw new Error(`fillSpecFromSchema: select "${e}" is picked but states no \`from\` — a pick chooses from the select's own values.`);return{type:"select",values:[...t.values]}}const n=pu(t);if(n===null)throw new Error(`fillSpecFromSchema: ${String(t.type)} "${e}" is picked, but holds no candidates — a pick chooses a row of a table, a select's value or a media slot's media value.`);if(n.from===void 0)throw new Error(`fillSpecFromSchema: ${String(t.type)} "${e}" is picked but names no \`from\` — a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media slot without one owns its media.`);return fL(n)}function CO(e){var t;return((t=e.source)==null?void 0:t.kind)!=="element"?!1:e.type==="row"?wo(e.from)!==void 0:e.type==="select"?Array.isArray(e.values):po(e.type??"")&&e.from!==void 0}function boe(e,t){const n=t.element;if(n!==void 0&&n.type!=="object"&&CO(n))return n;const r=Object.values((n==null?void 0:n.fields)??{}).filter(CO);if(r.length===1)return r[0];throw new Error(`fillSpecFromSchema: list "${e}" is picked, but its item holds ${r.length===0?"no":String(r.length)} \`from\` field${r.length===1?"":"s"} bound to the element — a picked list's item is a \`from\` primitive, or an object exactly one field of which holds the pick.`)}function Fw(e,t,n){const r=n.map(i=>{const a={kind:"fill",verb:i.verb},c=i.unique;c!==void 0&&(a.unique=c),a.brief=i.brief;const u=i.none;u!==void 0&&(a.none=u);const f=Uv(i.reads);f.length>0&&(a.reads=f);const p=Uv(i.requires);return p.length>0&&(a.requires=p),a});return n.some(i=>i.verb==="pick")?{of:I5(e,t),fills:r}:{fills:r}}function Uv(e){return(e??[]).map(t=>{if(typeof t=="object"&&t!==null&&t.kind==="item")return t;if(zn(t))throw new Error(`fillSpecFromSchema: a fill reads the slot "${typeof t.label=="string"?t.label:t.type}" by its const, which only a section declared with \`section()\` resolves — read another section's slot through its ref (\`Section.slots.<key>\`).`);if(NA(t))throw new Error("fillSpecFromSchema: a fill reads a fact registry's page — a section reads a fact through `fact.*`, never a registry's own declaration.");return jD(t)})}function Pv(e,t,n){for(const r of t??[]){const i=zD(r);for(const a of Uv(r.reads))a.kind==="home"?e.facts.add(a.key):OD(a)&&a.section!==i&&e.slots.set(`${a.section} ${a.slot}`,a)}for(const r of Array.isArray(n)?n:[n])Gt(r)&&Qt(r.key)!==null&&e.facts.add(r.key)}function voe(e,t){if(t.type==="select")throw new Error(`fillSpecFromSchema: select slot "${e}" is filled, which only a select inside a list's item may be — a top-level select is bound with \`source:\`; fill a field of a list's object item instead.`)}function xoe(e,t,n){for(const a of n)Pw(e,t,a);voe(e,t);const{of:r,fills:i}=Fw(e,t,n);return{id:e,kind:poe(t),...r===void 0?{}:{of:r},produces:[e],fills:i}}function woe(e,t,n,r){for(const u of n)Pw(e,t,u);if(!(t.type==="list"&&n.every(u=>u.verb==="pick"))&&t.type!=="row"&&hoe(t)===void 0)throw new Error(`fillSpecFromSchema: item field "${e}" (type "${String(t.type)}") is filled, but an item cannot fill one — an item's fields are written or picked inside the list's one batched call, which plans text, a date, an email, a phone, a url, a select key, a media value, a row, or a list of text, dates, emails, phones, urls, keys or media.`);const{of:a,fills:c}=Fw(e,t,n);return{...a===void 0?{}:{of:a},fills:c}}function koe(e,t,n,r){var y;const i=mr(t),a=((y=t.element)==null?void 0:y.type)==="object"?t.element.fields??{}:void 0,c={};for(const[m,x]of Object.entries(a??{})){const v=mr(x);v!==void 0&&(c[m]=woe(`${e}.${m}`,x,v),Pv(n,v,c[m].of))}i===void 0&&t.source;const u=Object.keys(c).length>0?{fields:c}:{};if(i===void 0)return Object.keys(c).length===0?void 0:{id:e,kind:"list",produces:[e],...u};for(const m of i)Pw(e,t,m);const{of:f,fills:p}=Fw(e,t,i);return Pv(n,i,f),{id:e,kind:"list",...f===void 0?{}:{of:f},produces:[e],fills:p,...u}}function NO(e,t,n,r){if(t.type==="list")return koe(e,t,n);const i=mr(t);if(i===void 0)return;const a=xoe(e,t,i);return Pv(n,i,a.of),a}function _oe(e,t){const n=[];for(const[r,i]of Object.entries(e.slots)){const a=i,c=a.type==="object"?Object.entries(a.fields??{}).map(([u,f])=>NO(`${r}.${u}`,f,t)):[NO(r,a,t)];for(const u of c)u!==void 0&&n.push(u)}return n}function Soe(){return{facts:new Set,slots:new Map}}function Eoe(e){const t=Soe(),n=e.pages,r={slots:Object.fromEntries(Object.entries(n).map(([a,c])=>[`${e.home}.${a}`,c.declaration]))},i=_oe(r,t);return{reads:[...t.facts].sort(),slot_reads:[],decisions:i}}const joe={property:["property.hero"],library:[]};function U5(e,t){const n=[];for(const r of e??[])r.kind==="home"&&r.key!==void 0?n.push(r.key):r.kind==="item"&&r.field!==void 0&&t!==null&&n.push(`${t}[].${r.field}`);return n}function Qc(e,t){return Zu(e)?U5(e.reads,t):[]}function ab(e){const t=e.from;return t===void 0||e.type==="row"?[]:[...wo(t)??[]]}function MO(e,t){const n=e==null?void 0:e.of,r=(n==null?void 0:n.type)==="media"?[...wo(n.from)??[]]:[];return[...((e==null?void 0:e.fills)??[]).flatMap(i=>U5(i.reads,t)),...r]}function RO(e){return[...new Set(e)]}function Ooe(e){var c;if(e.type==="object")return{fields:e.fields,rowsOf:null};const t=E0(e);if(t===null)return null;const n=kp(t)[0];if(n===void 0)return null;const{home:r,key:i}=go(n),a=(c=p0(r).pages[i])==null?void 0:c.declaration;return(a==null?void 0:a.type)!=="list"||a.element.type!=="object"?null:{fields:a.element.fields,rowsOf:n}}function Aoe(e,t,n){const r=e.pages[t],i=r.declaration,a=`${e.home}.${t}`,c=n.get(a),u=r.head,f=[...MO(c,a),...Qc(i.source,null),...ab(i),...u===null?[]:[...Qc(u.title,null),...Qc(u.description,null)],...i.type==="list"?[...Qc(i.max,null),...ab(i.element)]:[]],p=i.type==="list"?Ooe(i.element):null;let y;return p!==null?y=Object.entries(p.fields).map(([m,x])=>{var v;return{path:`${a}[].${m}`,declaration:x,reads:RO([...Qc(x.source,a),...MO((v=c==null?void 0:c.fields)==null?void 0:v[m],a),...ab(x)])}}):i.type==="address"?y=mp.map(m=>({path:`${a}.${m}`,declaration:null,reads:[]})):y=[{path:a,declaration:i,reads:[]}],{home:e.home,key:t,path:a,declaration:i,paged:_p(r),rowsOf:(p==null?void 0:p.rowsOf)??null,fields:y,reads:RO(f.filter(m=>m!==a))}}const TO=new WeakMap;function P5(e){const t=TO.get(e);if(t!==void 0)return t;const n=new Map;for(const i of Eoe(e).decisions)i.id!==void 0&&n.set(i.id,i);const r={home:e.home,facts:Object.keys(e.pages).map(i=>Aoe(e,i,n)),platformReads:joe[e.home]};return TO.set(e,r),r}const Coe=/^([a-z]+\.[a-z_]+)(?:(\[\]|\[0\])\.([a-z_]+))?(?:\.([a-z_]+))?$/;function Noe(e){const t=e.map(P5),n=t.flatMap(r=>r.facts);return{platformReads:t.flatMap(r=>r.platformReads),facts:n,byPath:new Map(n.map(r=>[r.path,r])),fields:new Map(n.flatMap(r=>r.fields.map(i=>[i.path,i])))}}function Moe(e,t){const n=Coe.exec(t),r=n===null?void 0:e.byPath.get(n[1]);if(n===null||r===void 0)throw new Error(`require graph: "${t}" names no fact the registries declare.`);const[,,i,a,c]=n;return{fact:r,...i===void 0?{}:{rows:i==="[0]"?"first":"every"},...a===void 0?{}:{member:a},...c===void 0?{}:{part:c}}}function di(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $O(e,t){var n;if(e===null)return t==null;switch(e.type){case"list":return!Array.isArray(t)||t.length===0;case"object":return!di(t);case"row":return t==null;case"media":return EO.image.isEmpty(t);default:return((n=EO[e.type])==null?void 0:n.isEmpty(t))??t==null}}function zO(e,t){const n=en(e);return n===null||n[t]===null}function Roe(e){if(typeof e=="string")return e;if(!di(e))return null;const t=e.id??e.row_id;return typeof t=="string"?t:null}function Toe(e,t,n,r,i){if(e.rowsOf===null)return di(n)?n[r]:void 0;const a=go(e.rowsOf),c=t[a.home],u=Roe(n),f=c==null?void 0:c[a.key],p=Array.isArray(f)&&u!==null?f.find(y=>di(y)&&y.id===u):void 0;if(di(p))return p[r];if(di(n)&&Object.hasOwn(n,r))return n[r];if(c==null&&u!==null)throw new Error(`require graph: "${i}" reads a picked row's member, but the facts hold only the pick; pass the ${a.home} facts, where the row's members are stored.`)}function $oe(e,t,n){var m,x;const{fact:r,rows:i,member:a,part:c}=Moe(e,n),u=((m=t[r.home])==null?void 0:m[r.key])??null;if(a===void 0)return c===void 0?!$O(r.declaration,u):!zO(u,c);const f=((x=e.fields.get(`${r.path}[].${a}`))==null?void 0:x.declaration)??null,p=v=>{const _=Toe(r,t,v,a,n);return c===void 0?!$O(f,_):!zO(_,c)},y=Array.isArray(u)?u:[];return i==="first"?y.length>0&&p(y[0]):y.every(p)}function zoe(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.length===0:di(e)?Object.keys(e).length===0:!1}function F5(e,t){const[n,...r]=t.split("[]"),i=n.indexOf("."),a=i<0?e[n]:e[md(n.slice(0,i),n.slice(i+1))]??B5(e[n.slice(0,i)],n.slice(i+1));return H5(a,r)}function B5(e,t){let n=e;for(const r of t.split(".").filter(i=>i!==""))n=di(n)?n[r]:void 0;return n}function H5(e,t){if(t.length===0)return zoe(e);if(!Array.isArray(e))return!1;const[n,...r]=t;return e.some(i=>H5(B5(i,n),r))}const Doe=[at,yr];function Loe(e,t,n=Doe){const r=Noe(n);return e.filter(i=>!$oe(r,t,i))}function Ioe(e){return e.split("[]")[0].split(".").slice(0,2).join(".")}function Uoe(e,t){return e.flatMap(n=>{var i;const r=((i=t.instances.find(a=>a.instance_id===n.instance_id))==null?void 0:i.slots)??{};return F5(r,n.slot)?[{instanceId:n.instance_id,pageId:n.page_id,path:n.slot,slotId:Ioe(n.slot)}]:[]})}function Poe(e,t,n){return e.some(r=>r.instanceId===t&&r.path===n)}function Foe(e,t,n){var i;const r=t.instances.find(a=>a.instance_id===e.instance_id);for(const a of yw(e.schema,Qp(e,r))){const c=a.fields.find(u=>u.slotId===n);if(c)return c.slot.label}return((i=e.schema.slots[n])==null?void 0:i.label)??n}function Boe(e,t){var n;return((n=e.find(r=>r.page_ids.includes(t)))==null?void 0:n.id)??null}const Hoe=400,Bw=w.createContext({empty:[],noteSubmitAttempt:()=>{}});function qoe({children:e}){var k;const t=So(),n=Ee(S=>S.backend.requirements),r=n.queryKey,i=Rn({queryKey:r,queryFn:()=>n.read(),retry:!1}),a=Ee(S=>S.content_doc),c=Ee(S=>S.pendingSaves),u=w.useRef(a);w.useEffect(()=>{if(c>0||a===u.current)return;const S=setTimeout(()=>{t.invalidateQueries({queryKey:r})},Hoe);return()=>clearTimeout(S)},[a,c,t,r]);const f=(k=i.data)==null?void 0:k.empty_content,p=w.useMemo(()=>f?Uoe(f,a):[],[f,a]),[y,m]=w.useState(!1),x=p.length>0,v=w.useCallback(()=>{x&&m(!0)},[x]),_=w.useMemo(()=>({empty:p,noteSubmitAttempt:v}),[p,v]);return h.jsx(Bw.Provider,{value:_,children:h.jsx(NB,{shown:y,children:e})})}function q5(){return w.useContext(Bw).empty}function Voe(){return w.useContext(Bw).noteSubmitAttempt}const DO="box-border inline-flex h-10 w-full items-center justify-center gap-1.75 rounded-lg border text-center text-[length:calc(13.5*var(--content))] font-semibold tracking-[-0.005em]";function Zoe({actions:e}){const{viewLive:t,download:n,publish:r}=e,i=Ee(y=>y.session.deliverable_id),a=Voe(),c=r?()=>{a(),r.start()}:null,u=w.useRef(!1),f=(r==null?void 0:r.pressOnArrival)===!0;w.useEffect(()=>{!f||u.current||c===null||(u.current=!0,c())},[f]);const p=[t,n,r].filter(y=>y!==void 0).length;return p===0?h.jsx("footer",{className:"flex-shrink-0 border-t border-line-soft bg-canvas p-3","data-testid":"panel-footer"}):h.jsxs("footer",{className:"flex-shrink-0 border-t border-line-soft bg-canvas p-3","data-testid":"panel-footer",children:[n?h.jsx(Ms,{surface:`download:${i}`,className:"mb-2",notices:n.error?[{id:"download-failed",rank:"result",hold:{kind:"page"},tone:"danger",role:"alert",headline:n.error,onDismiss:n.clearError}]:[]}):null,h.jsxs("div",{className:p===1?"w-full":"grid w-full grid-cols-2 gap-2",children:[t?h.jsx(Koe,{answer:t}):null,n?h.jsx(kJ,{phase:n.phase,disabledReason:n.disabledReason,onClick:()=>{a(),n.start()},variant:"footer"}):null,r&&c?h.jsx(EJ,{state:r.state,isPending:r.isPending,hasOutstandingChanges:r.hasOutstandingChanges,onClick:c}):null]})]})}function Koe({answer:e}){return e.href!==null?h.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",title:e.title,"data-testid":"view-live",className:`group ${DO} cursor-pointer border-line bg-canvas text-ink transition-[background-color,border-color,box-shadow,color,transform] hover:border-[var(--color-ink-4)] hover:bg-[#fafaf8] active:translate-y-[0.5px]`,children:[h.jsx("span",{className:"grid place-items-center text-ink-3 transition-colors group-hover:text-ink",children:h.jsx(jt,{name:"external",size:12,stroke:1.6})}),h.jsx("span",{children:"View live"})]}):h.jsxs("button",{type:"button",disabled:!0,title:e.title,"data-testid":"view-live",className:`${DO} cursor-not-allowed border-line bg-[#fafaf8] text-ink-4`,children:[h.jsx("span",{className:"grid place-items-center text-ink-4",children:h.jsx(jt,{name:"external",size:12,stroke:1.6})}),h.jsx("span",{children:"View live"})]})}const LO=new Set(["image","video","tour","document","media"]);function Goe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Yoe(e,t){var a;const r=(a=at.pages[e])==null?void 0:a.declaration;if((r==null?void 0:r.type)!=="list"||r.element.type!=="object")return null;const i=Object.hasOwn(r.element.fields,t)?r.element.fields[t]:void 0;return(i==null?void 0:i.type)==="list"?i.element:null}function Qoe(e){return e===void 0||e===""?null:e}function IO(e,t,n,r){const i=Yoe(t,n);if(i===null)return null;const a=Array.isArray(r)?r:[];if(LO.has(i.type))return{kind:"picks",mediaIds:a.map(Tn).filter(p=>p!==null)};if(i.type!=="object")return null;const c=Object.entries(i.fields),u=JT(e,t);return{kind:"items",items:a.flatMap(p=>{const y=Goe(p);if(y===null)return[];const m=Cr(y)&&u!==null?u.toItem(y):y,x={};for(const[_,k]of c)x[_]=LO.has(k.type)?Tn(m[_]):Qoe(m[_]);const v=Cr(y)?null:y.id;return[{id:typeof v=="string"&&v!==""?v:null,fields:x}]})}}function Xoe(e,t){return e.kind==="picks"||t.kind==="picks"?e.kind===t.kind&&JSON.stringify(e)===JSON.stringify(t):JSON.stringify(e.items.map(n=>n.fields))===JSON.stringify(t.items.map(n=>n.fields))}function V5(e){return e===null||typeof e!="object"||e.picked!==null?null:Tn(e)}const Woe=new Set(["image","video","tour","document","media"]),Joe=new Set(["image_list","row_list"]),eie=new Set(["text_list","number_list"]);function Hw(e,t,n){const r=Eq(t,e);if(r!==null)return{kind:"owned_media",member:r.field};if(n===void 0)return null;const i=T0(e,n);return i.kind!=="member"||!i.storable?null:Joe.has(i.value_type)?{kind:"nested_list",member:n}:Woe.has(i.value_type)?null:{kind:"value",member:n,list:eie.has(i.value_type)}}function tie(e,t=Qu(e.source)){return t===null?[]:qw(e).flatMap(({key:n,slot:r,member:i})=>{const a=Hw(t,r,i);return(a==null?void 0:a.kind)==="value"?[{key:n,member:a.member}]:[]})}function qw(e){const t=Vx(e),n=UC(Object.fromEntries(t));return t.map(([r,i])=>({key:r,slot:i,member:n[r]}))}function nie(e){return js(e)&&Ch(e)}function Z5(e,t,n,r){const i=n.table;return r.flatMap(a=>{const c=Hw(n.table,a.slot,a.member);if(c===null)return[];let u,f=null;if(c.kind==="owned_media"){if(Tn(a.current)===Tn(a.baseline))return[];f=V5(a.current)}else if(c.kind==="nested_list"){const m=IO(a.slot,i,c.member,a.current),x=IO(a.slot,i,c.member,a.baseline);if(m===null||x===null||Xoe(m,x))return[];u=m}else if(Array.isArray(a.current)&&!c.list||r4(a.current,a.baseline))return[];const p=c.kind!=="value"?c.kind:a.key===void 0?"scalar":"item_field",y=a.key??(c.kind==="value"?c.member:void 0);return[{id:`${e}:${p}:${n.identity}:${y??""}`,kind:p,label:t,slotId:e,...y!==void 0?{field:y}:{},fact:o4(i,n.rowId,c.member),item_id:n.identity,table:i,...c.kind==="owned_media"?{mediaField:c.member}:{},...f!==null?{ownedMedia:[{ownerSlot:a.key===void 0?e:`${e}.${a.key}`,mediaId:f}]}:{},...u!==void 0?{nested:u}:{}}]})}function rie(e,t,n,r,i,a){const c=Rt(a.slots,n.holder);if(typeof c!="string"||c===""||i.facts===null)return[];const u=xp(i.facts,n.tables,c);if(u===null)return[];const f=Rt(a.slots,e),p=bw(t,e,n,i,y=>Rt(a.slots,y));return Z5(e,r,{table:u,rowId:c,identity:c},[{slot:t,member:n.member,current:f,baseline:p}])}function oie(e,t){var r,i;if(e===void 0)return;if(Object.hasOwn(e,t))return e[t];const n=Eo(t);return n===null||(i=(r=e[n.object])==null?void 0:r.fields)==null?void 0:i[n.field]}function iie(e,t,n,r,i){return e.length===t.length&&e.some((a,c)=>a!==t[c])?{id:`${n}:reorder::`,kind:"reorder",label:r,slotId:n,table:i}:null}function K5(e){const t=$n(e),n=t?Nr(t,""):void 0,r=(n==null?void 0:n.kind)==="field"?n.field:void 0;return(i,a)=>{const c=r?i==null?void 0:i[r]:void 0;return typeof c=="string"&&c.trim()?c:a}}function G5(e,t,n,r,i){const a=K5(t),c=qw(t);return r.flatMap(({listItem:u,identity:f,rowId:p})=>{const y=i.get(p);if(!y)return[];const m=c.map(({key:x,slot:v,member:_})=>({key:x,slot:v,member:_,current:u[x],baseline:y[x]}));return Z5(e,a(u,f),{table:n,rowId:p,identity:f},m)})}function Y5(e){return Array.isArray(e)?e:[]}function sie(e,t,n,r,i,a){const c=[],u=hd,f=Y5(Rt(i.slots,e)),p=dT(i.slot_overrides,e),y=new Map(r.map(j=>[String(j[u]),j])),m=K5(t),x=lie(e,t,a);for(const j of f){const O=j[u];if(bl(O)){const A=x(j);c.push({id:`${e}:item_create:${String(O)}:`,kind:"item_create",label:m(j,"New item"),slotId:e,item_id:String(O),table:a,...A.length>0?{ownedMedia:A}:{}})}}for(const j of Object.keys(p))c.push({id:`${e}:item_remove:${j}:`,kind:"item_remove",label:m(y.get(j),j),slotId:e,item_id:j,table:a});const v=f.flatMap(j=>{const O=j[u];return bl(O)||typeof O!="string"||p[O]?[]:[{listItem:j,identity:O,rowId:O}]});c.push(...G5(e,t,a,v,y));const _=v.map(j=>j.identity),k=r.map(j=>String(j[u])).filter(j=>!p[j]),S=iie(_,k,e,n,a);return S&&c.push(S),c}function aie(e,t,n,r,i,a){const c=hd,u=N0(Object.fromEntries(Vx(t)))[0],f=new Map(n.map(p=>[String(p[c]),p]));return Y5(Rt(r.slots,e)).flatMap(p=>{const y=p[c];if(typeof y!="string"||y==="")return[];const m=u===void 0?void 0:p[u],x=typeof m=="string"&&m!==""?m:y,v=xp(a,i,x);return v===null?[]:G5(e,t,v,[{listItem:p,identity:y,rowId:x}],f)})}function lie(e,t,n){const r=qw(t).filter(({slot:i,member:a})=>{var c;return((c=Hw(n,i,a))==null?void 0:c.kind)==="owned_media"});return i=>r.flatMap(({key:a})=>{const c=V5(i[a]);return c===null?[]:[{ownerSlot:`${e}.${a}`,mediaId:c}]})}function cie(e,t){const n=e.schema.slots??{};return n4(n,{fillSpec:e.fill_spec,sectionSlots:Aw(t)}).flatMap(([r,i])=>{const a=oie(n,r);return a===void 0?[]:[{slotId:r,sourcing:i,schemaSlot:a,label:a.label}]})}function uie(e,t){return e.kind==="fact"&&t.type==="list"?e.table:null}function UO(e,t){const n=e.content_doc.instances.find(f=>f.instance_id===t),r=e.session.sections.find(f=>f.instance_id===t),{facts:i}=e.session;if(!n||!r||i===null)return[];const a={facts:i,computed:r.computed},c=f=>Rt(n.slots,f),u=[];for(const{slotId:f,sourcing:p,schemaSlot:y,label:m}of cie(r,e.session.sections)){if(p.kind==="row"||p.kind==="slot"||p.kind==="computed")continue;if(p.kind==="member"){u.push(...rie(f,y,p,m,a,n));continue}const x=t4(y,f,p,a)??[];if(p.kind==="rows"){y.type==="list"&&u.push(...aie(f,y,x,n,p.tables,i));continue}const v=uie(p,y);if(v!==null){u.push(...sie(f,y,m,x,n,v));continue}const _=Rt(n.slots,f),k=bw(y,f,p,a,c),S=nie(p.key)?sQ(p.key):null;S!==null&&(Array.isArray(_)||r4(_,k)||u.push({id:`${f}:scalar::`,kind:"scalar",label:m,slotId:f,fact:S}))}return u}function die(e,t){const n=UO(e,t).map(c=>({...c,instanceId:t})),r=e.session.sections.find(c=>c.instance_id===t);if(r===void 0)return n;const i=new Map;for(const[c]of K4(r)){const u=Jp(e.session,{instanceId:t,slotId:c});u===null||u.locked||u.instanceId===t||i.set(u.instanceId,(i.get(u.instanceId)??new Set).add(u.slotId))}const a=[...i].flatMap(([c,u])=>UO(e,c).filter(f=>u.has(f.slotId)).map(f=>({...f,id:`${c}/${f.id}`,instanceId:c})));return[...n,...a]}function fie(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function PO(e){return h.jsx("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:h.jsx("path",{d:"M2.5 7h9M8 3.5 11.5 7 8 10.5"})})}function hie(e){return h.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:h.jsx("path",{d:"M3.5 8.5l3 3 6-6.5"})})}function FO(e){return h.jsx("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round","aria-hidden":"true",...e,children:h.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function pie({items:e,onApply:t}){const n=e??[],r=n.length,i=n.map(W=>W.id).join("|"),[a,c]=w.useState(!1),[u,f]=w.useState("idle"),[p,y]=w.useState(!1),[m,x]=w.useState(0),v=w.useRef(null),_=w.useRef(null),k=w.useRef(null),S=w.useRef(null),j=w.useRef(n),O=w.useRef(!0);w.useLayoutEffect(()=>{j.current=n});const A=w.useRef(fie()).current,$=w.useCallback(W=>{const G=v.current;if(A||document.hidden||G==null||typeof G.animate!="function"){y(!1),c(!1),f("idle"),W==null||W();return}y(!0);const H=G.animate([{opacity:1,transform:"none"},{opacity:0,transform:"translateY(6px)"}],{duration:240,easing:"cubic-bezier(.4,0,.2,1)",fill:"forwards"});H.onfinish=()=>{y(!1),c(!1),f("idle"),W==null||W()}},[A]);w.useEffect(()=>(_.current!=null&&clearTimeout(_.current),r>0&&u==="idle"?i!==S.current&&!a&&(_.current=setTimeout(()=>{c(!0)},550)):r===0&&a&&!p&&u==="idle"&&$(),()=>{_.current!=null&&clearTimeout(_.current)}),[r,i,a,u,p,$]),w.useLayoutEffect(()=>{if(!a||u!=="idle"||A||p)return;const W=v.current;W!=null&&typeof W.animate=="function"&&!document.hidden&&W.animate([{opacity:.45,transform:"translateY(10px)"},{opacity:1,transform:"none"}],{duration:420,easing:"cubic-bezier(.18,.82,.25,1)"})},[a,u,A,p]),w.useEffect(()=>{if(u!=="applying")return;const W=G=>{G.preventDefault(),G.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[u]),w.useEffect(()=>(O.current=!0,()=>{O.current=!1,_.current!=null&&clearTimeout(_.current),k.current!=null&&clearTimeout(k.current)}),[]);const C=()=>{const W=j.current;x(W.length),f("applying"),(async()=>{try{if(await t(W),!O.current)return;c(!1),f("success"),k.current!=null&&clearTimeout(k.current),k.current=setTimeout(()=>{$(()=>{S.current=null})},1200)}catch{if(!O.current)return;f("error")}})()},I=()=>{S.current=i,$()};if(!a&&u!=="success"&&!p)return null;const z=u==="applying",T=z?m:r,F=T===1?h.jsxs(h.Fragment,{children:[h.jsx("b",{className:"font-bold text-ink",children:"1"})," change to your property details"]}):h.jsxs(h.Fragment,{children:[h.jsx("b",{className:"font-bold text-ink",children:T})," changes to your property details"]});return h.jsx("div",{className:"pointer-events-none absolute bottom-[10px] left-0 right-0 z-[6]","aria-live":"polite",children:h.jsx("div",{className:"pointer-events-none",ref:v,children:h.jsx("div",{className:"pointer-events-auto relative mx-3 rounded-[calc(11*var(--content))] border border-line bg-canvas px-[calc(13*var(--content))] pb-[calc(12*var(--content))] pt-[calc(11*var(--content))] shadow-[0_8px_22px_-8px_rgba(20,18,13,.26),0_2px_6px_rgba(20,18,13,.08)] data-[done]:border-[#cfe6d4] data-[done]:bg-[#eef6ef]","data-done":u==="success"?"":void 0,children:u==="success"?h.jsxs("div",{className:"flex items-center gap-2 text-body font-semibold text-good",children:[h.jsx("span",{className:"grid flex-shrink-0 place-items-center [animation:we-ub-pop_.34s_cubic-bezier(.2,1.3,.4,1)_both]",children:h.jsx(hie,{})}),"Updated everywhere"]}):u==="error"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start gap-[calc(9*var(--content))]",children:[h.jsxs("div",{className:"min-w-0 flex-1 text-body leading-[1.4]",children:[h.jsx("div",{className:"font-semibold text-danger",children:"Couldn't update"}),h.jsx("div",{className:"mt-0.5 text-[length:calc(11.5*var(--content))] text-ink-3",children:"Something went wrong. Please try again."})]}),h.jsx("button",{type:"button",className:"-mr-0.5 -mt-0.5 grid h-[calc(20*var(--content))] w-[calc(20*var(--content))] flex-shrink-0 cursor-pointer place-items-center rounded-[calc(5*var(--content))] text-ink-4 transition-[background-color,color] duration-[120ms] hover:bg-[rgba(20,18,13,.06)] hover:text-ink-2",onClick:I,"aria-label":"Dismiss",children:h.jsx(FO,{})})]}),h.jsxs("button",{type:"button","data-action":"retry",className:"mt-[calc(10*var(--content))] box-border inline-flex h-[calc(34*var(--content))] w-full cursor-pointer items-center justify-center gap-[calc(6*var(--content))] rounded-[calc(8*var(--content))] bg-accent text-[length:calc(12.5*var(--content))] font-semibold text-white transition-[background-color,transform] duration-[120ms] hover:bg-[#143a2f] active:translate-y-[0.5px]",onClick:C,children:["Retry ",h.jsx(PO,{})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start gap-[calc(9*var(--content))]",children:[h.jsxs("div",{className:"min-w-0 flex-1 text-body leading-[1.4] text-ink-2",children:[F,h.jsx("div",{className:"mt-0.5 text-[length:calc(11.5*var(--content))] text-ink-3",children:"Update them everywhere these details are used."})]}),h.jsx("button",{type:"button",className:"-mr-0.5 -mt-0.5 grid h-[calc(20*var(--content))] w-[calc(20*var(--content))] flex-shrink-0 cursor-pointer place-items-center rounded-[calc(5*var(--content))] text-ink-4 transition-[background-color,color] duration-[120ms] hover:bg-[rgba(20,18,13,.06)] hover:text-ink-2 disabled:cursor-default disabled:opacity-50",onClick:I,disabled:z,"aria-label":"Dismiss",children:h.jsx(FO,{})})]}),h.jsx("button",{type:"button","data-action":"apply",disabled:z,className:"mt-[calc(10*var(--content))] box-border inline-flex h-[calc(34*var(--content))] w-full cursor-pointer items-center justify-center gap-[calc(6*var(--content))] rounded-[calc(8*var(--content))] bg-accent text-[length:calc(12.5*var(--content))] font-semibold text-white transition-[background-color,transform] duration-[120ms] hover:bg-[#143a2f] active:translate-y-[0.5px] disabled:cursor-default disabled:hover:bg-accent disabled:active:translate-y-0",onClick:C,children:z?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"inline-block size-[calc(14*var(--content))] animate-spin rounded-full border-2 border-white/40 border-t-white",role:"status","aria-label":"Updating"}),"Updating…"]}):h.jsxs(h.Fragment,{children:["Update everywhere ",h.jsx(PO,{})]})})]})})})})}function mie(){const e=lr(),t=e5();return w.useCallback((n,r,i,a)=>{const c=e.getState(),u=Jp(c.session,{instanceId:n,slotId:r});if((u==null?void 0:u.locked)===!0)return;const f=u??{instanceId:n,slotId:r};if(i!==null)for(const p of[f,...Cw(e,f)])gie(e,p,a);c.markSlotOverridden(f.instanceId,f.slotId,{kind:"scalar"}),t(n,r,i)},[e,t])}function gie(e,t,n){var c;const r=e.getState(),i=r.session.sections.find(u=>u.instance_id===t.instanceId),a=(c=r.content_doc.instances.find(u=>u.instance_id===t.instanceId))==null?void 0:c.slot_overrides;for(const u of VZ((i==null?void 0:i.schema.slots)??{},t.slotId))!Object.hasOwn(n,u.member)||iw(a,u.key)||Rv(e,t.instanceId,u.key,n[u.member])}function yie({instanceId:e,selectedSlotId:t,notices:n,cardAdornment:r}){const i=Ee(A=>A.session),a=Ee(A=>A.select),c=q4(),u=Ee(A=>A.content_doc),f=w.useMemo(()=>die({content_doc:u,session:i},e),[u,i,e]),p=f.length>0,y=lr(),m=w.useCallback(async A=>{const{rewriteTempId:$,relinkSlot:C,applyBootstrap:I,backend:z}=y.getState();try{const T=new Map;for(const W of A)T.set(W.instanceId,[...T.get(W.instanceId)??[],W]);for(const[W,G]of T){const H=U=>y.getState().content_doc.instances.find(D=>D.instance_id===U);await cQ({send:U=>z.updateEverywhere(U),readValue:U=>{const D=H(W);if(!D)return;if(U.kind==="scalar"||U.kind==="owned_media"&&U.field==null)return Rt(D.slots,U.slotId);const K=D.slots[U.slotId];if(!U.table||!Array.isArray(K))return;const M=K.find(B=>B.id===U.item_id);return M==null?void 0:M[U.field??""]},readSlots:U=>{var D;return((D=H(U))==null?void 0:D.slots)??{}},rewriteTempId:$,relinkSlot:C,readSlotOrder:U=>{var X,se,J;const K=(se=(X=y.getState().session.sections.find(P=>P.instance_id===W))==null?void 0:X.schema.slots)==null?void 0:se[U],M=K?wL(K):null,B=(J=H(W))==null?void 0:J.slots[U];return!Array.isArray(B)||!M?[]:B.map(P=>P.id).filter(P=>typeof P=="string")},writableItemFields:U=>{var M;const D=y.getState().session.sections.find(B=>B.instance_id===W),K=(M=D==null?void 0:D.schema.slots)==null?void 0:M[U];return K?tie(K):[]}},W,G)}const F=await z.bootstrap();if(!yo(y,z))return;I(F),z.refresh()}catch(T){throw console.error("[editor] Update-everywhere failed",{instanceId:e,err:T}),T}},[y,e]),x=i.sections.find(A=>A.instance_id===e);if(!x)return null;const v=u.instances.find(A=>A.instance_id===e),_=!(v!=null&&v.enabled),S=x.required&&!_,j=ui(x),O=yw(x.schema,Qp(x,v));return h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex min-h-[calc(56*var(--content))] flex-shrink-0 items-center justify-between gap-3 px-5 pb-2 pt-4",children:[h.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:h.jsx("h2",{className:"m-0 truncate text-body-lg font-semibold tracking-[-0.005em] text-ink",children:j})}),h.jsxs("div",{className:"inline-flex flex-shrink-0 items-center gap-0.5",children:[h.jsx("button",{type:"button",onClick:()=>!S&&c(e,_),disabled:S,title:S?"This section is required and can’t be hidden":_?"Hidden from live page":"Visible on live page",className:`grid h-8 w-8 cursor-pointer place-items-center rounded-md transition-colors disabled:cursor-not-allowed disabled:text-ink-4 ${_?"bg-[rgba(20,18,13,0.06)] text-ink [box-shadow:inset_0_0_0_1px_var(--color-line)]":"text-ink-2 hover:bg-[rgba(20,18,13,0.06)] hover:text-ink disabled:hover:bg-transparent disabled:hover:text-ink-4"}`,children:h.jsx(jt,{name:_?"eyeOff":"eye",size:15,stroke:1.8})}),I4(x)&&h.jsx("button",{type:"button",onClick:()=>a({kind:"section-settings",instance_id:e}),title:"Section settings","aria-label":"Section settings",className:"grid h-8 w-8 cursor-pointer place-items-center rounded-md text-ink-2 transition-colors hover:bg-[rgba(20,18,13,0.06)] hover:text-ink",children:h.jsx(jt,{name:"settings",size:15,stroke:1.8})})]})]}),h.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[h.jsxs("div",{className:ce("hp-sb-scroll flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-4 pt-2",p?"pb-[124px]":"pb-6"),children:[n,O.map(A=>h.jsx(bie,{card:A,instanceId:e,instance:v,entry:x,focused:t!=null&&ZY(A,t),onFocus:()=>a({kind:"slot",instance_id:e,slot_id:A.selectSlotId}),onBlur:()=>a({kind:"section",instance_id:e}),cardAdornment:r},A.key)),O.length===0&&h.jsx("p",{className:"px-1 py-3 text-[length:calc(12.5*var(--content))] text-ink-3",children:"Nothing to edit in this section."})]}),h.jsx(pie,{items:f,onApply:m})]})]})}function bie({card:e,instanceId:t,instance:n,entry:r,focused:i,onFocus:a,onBlur:c,cardAdornment:u}){const f=Ee(y=>{var m;return((m=y.selection)==null?void 0:m.kind)==="slot"&&y.selection.instance_id===t&&y.selection.slot_id===e.key?y.selection.field_name:void 0}),p=(n==null?void 0:n.slots)??{};return h.jsx(vT,{open:i,onToggle:i?c:a,icon:e.Icon?h.jsx(e.Icon,{size:14}):null,title:VY(e,r.schema,y=>p[y]),scrollKey:e.key,adornment:u==null?void 0:u({instanceId:t,slotIds:e.fields.map(y=>y.slotId)}),children:h.jsx(cd,{place:"panel",children:h.jsx(dw,{fields:e.fields.map(y=>[fj(y),y.slot]),lone:e.lone,reveal:i?f:void 0,renderField:(y,m)=>{const x=e.fields.find(v=>fj(v)===y).slotId;return h.jsx(vie,{slotId:x,slot:m,instanceId:t,value:Rt(p,x),entry:r})}})})})}const BO="m-0 px-0.5 text-caption leading-[1.4] text-ink-4";function vie({slot:e,slotId:t,instanceId:n,value:r,entry:i}){const a=Ee(M=>M.session.sections),c=Ee(M=>M.session.pages),u=w.useMemo(()=>Jp({sections:a,pages:c},{instanceId:n,slotId:t}),[a,c,n,t]),f=u??{instanceId:n,slotId:t,entry:i,slot:e},p=Ee(M=>M.session.facts),y=w.useMemo(()=>{const M=Au(f.entry,a,f.slotId);return M===null?void 0:t4(f.slot,f.slotId,M,{facts:p,computed:f.entry.computed})},[f.entry,f.slot,f.slotId,a,p]),m=Ee(M=>M.content_doc.instances),x=Yx(f.entry.fill_spec,f.slotId),v=e.type==="list"?Qx(f.slot,x,Aw(a)):void 0,_=e.type==="row",k=MW({sections:a,pages:c},m,{instanceId:n,section:i.section_key}),S=_?pd(f.slot):v!==void 0?fv(e,v,k):void 0,j=mie(),O=e5(),A=Ee(M=>M.session.property_id),$=Ee(M=>M.selection),C=Ee(M=>{var X;if(u===null)return r;const B=(X=M.content_doc.instances.find(se=>se.instance_id===u.instanceId))==null?void 0:X.slots;return B?Rt(B,u.slotId):void 0}),I=w.useMemo(()=>{if(Is(f.slot.source)===null)return null;const M=Au(f.entry,a,f.slotId);return(M==null?void 0:M.kind)==="member"?M:null},[f.slot,f.entry,a,f.slotId]),z=Ee(M=>{var se;if(I===null)return;const B=(se=M.content_doc.instances.find(J=>J.instance_id===f.instanceId))==null?void 0:se.slots,X=B?Rt(B,I.holder):void 0;return typeof X=="string"&&X!==""?X:null}),T=I===null||p===null?void 0:xp(p,I.tables,z??null)??void 0,F=Ee(M=>{var B,X,se;return((se=(X=(B=M.content_doc.instances.find(J=>J.instance_id===f.instanceId))==null?void 0:B.slot_overrides)==null?void 0:X.scalar)==null?void 0:se[f.slotId])===!0}),W=q5(),G=Poe(W,f.instanceId,f.slotId),H=u===null?null:`${ui(u.entry)}’s ${u.slot.label}`;if((u==null?void 0:u.locked)===!0)return h.jsxs("p",{className:BO,children:["Can’t be edited here: it shows ",H,", which is locked."]});const U=($==null?void 0:$.kind)==="slot"&&$.instance_id===n&&$.slot_id===t?$:void 0,D=U==null?void 0:U.item_index,K=U==null?void 0:U.field_name;return h.jsxs(h.Fragment,{children:[h.jsx(Bl,{slot:e,instanceId:f.instanceId,slotId:f.slotId,value:C,propertyId:A,onChange:M=>O(n,t,M),overridden:F,required:G,selectedItemIndex:D,selectedFieldName:K,itemBaseline:y,boundRowId:z,boundRowTable:T,membership:v,rowTable:S,onRowPick:_?(M,B)=>j(n,t,M,B):void 0,factPath:`${f.instanceId}.${f.slotId}`}),H!==null&&h.jsxs("p",{className:BO,children:["Shows ",H,": an edit here changes it there too."]})]})}function xie({crumbs:e}){return h.jsx("nav",{className:"inline-flex min-w-0 items-center gap-1.5 text-body-lg tracking-[-0.005em]",children:e.map((t,n)=>h.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[n>0&&h.jsx("span",{className:"inline-grid place-items-center leading-none text-ink-4","aria-hidden":"true",children:h.jsx(jt,{name:"chevRight",size:12,stroke:1.8})}),t.current?h.jsx("span",{className:"max-w-[calc(220*var(--content))] truncate font-semibold text-ink",children:t.label}):h.jsx("button",{type:"button",onClick:t.onClick,className:"max-w-[calc(220*var(--content))] cursor-pointer truncate font-medium text-ink-3 transition-colors hover:text-ink hover:underline hover:underline-offset-[3px]",children:t.label})]},n))})}const wie=ce("group/case flex cursor-pointer items-center gap-2.5 rounded border border-line bg-canvas px-3 py-2.5","transition-[border-color,background-color] hover:border-[var(--color-ink-4)]","has-[:focus-visible]:border-accent","data-[selected=true]:border-accent data-[selected=true]:bg-accent-soft");function kie({instanceId:e,notices:t}){const n=Ee(m=>m.session),r=Ee(m=>m.content_doc),i=Ee(m=>m.select),a=OW(),c=n.sections.find(m=>m.instance_id===e);if(!c)return null;const u=r.instances.find(m=>m.instance_id===e),f=I4(c),p=Qp(c,u),y=QX(c,p,u).length;return h.jsxs(h.Fragment,{children:[h.jsx("header",{className:"flex min-h-[calc(56*var(--content))] flex-shrink-0 items-center justify-between gap-3 px-5 pb-2 pt-4",children:h.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:h.jsx(xie,{crumbs:[{label:ui(c),onClick:()=>i({kind:"section",instance_id:e})},{label:"Settings",current:!0}]})})}),h.jsxs("div",{className:"hp-sb-scroll flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-4 pb-6 pt-2",children:[t,f?h.jsxs("section",{"aria-label":"Variation",className:"flex flex-col gap-2.5",children:[h.jsx("h3",{className:"px-1 text-[length:calc(11.5*var(--content))] font-medium uppercase tracking-[0.04em] text-ink-3",children:"Variation"}),h.jsx("div",{className:"flex flex-col gap-2",children:f.map(m=>h.jsxs("label",{"data-selected":m.value===p,className:wie,children:[h.jsx("input",{type:"radio",className:"sr-only",name:`variation-${e}`,value:m.value,checked:m.value===p,onChange:()=>a(e,m.value)}),h.jsx("span",{"aria-hidden":"true",className:"grid size-4 flex-shrink-0 place-items-center rounded-full border-[1.5px] border-ink-4 transition-colors group-data-[selected=true]/case:border-accent",children:h.jsx("span",{className:"size-2 rounded-full bg-accent opacity-0 transition-opacity group-data-[selected=true]/case:opacity-100"})}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-[length:calc(13.5*var(--content))] font-medium text-ink",children:m.label})]},m.value))}),y>0&&h.jsxs("p",{"aria-live":"polite",className:"rounded border border-line bg-accent-soft px-3 py-2 text-[length:calc(12.5*var(--content))] leading-[1.45] text-ink-2",children:[y===1?"1 empty field in this variation":`${y} empty fields in this variation`," "]})]}):h.jsx("p",{className:"px-1 py-3 text-[length:calc(12.5*var(--content))] text-ink-3",children:"Nothing to configure in this section."})]})]})}function _ie(){const e=lr(),t=q5(),n=Ee(f=>f.session.sections),r=Ee(f=>f.content_doc),i=t[0];if(i===void 0)return null;const a=n.find(f=>f.instance_id===i.instanceId),c=a===void 0?i.slotId:Foe(a,r,i.slotId),u=()=>{const f=e.getState(),p=Boe(f.session.canvases,i.pageId);p!==null&&f.setCurrentCanvas(p),f.select({kind:"slot",instance_id:i.instanceId,slot_id:i.slotId})};return{id:"required",rank:"required",hold:{kind:"session"},tone:"danger",role:"alert",headline:h.jsxs(h.Fragment,{children:[t.length===1?"1 required slot is empty.":`${t.length} required slots are empty.`," Next:"," ",h.jsx(JW,{onClick:u,children:c})]})}}function Sie(e){return`editor:${e}`}function Eie(){return Ee(e=>{var n;const t=(n=e.selection)==null?void 0:n.instance_id;return t!==void 0&&e.session.sections.some(r=>r.instance_id===t)?t:null})}const jie={};function Oie({slots:e=jie,actions:t}){const n=w.useRef(null);return iQ(),w.useEffect(()=>{const r=n.current;if(!r)return;const i=()=>{document.documentElement.style.setProperty("--we-panel-w",`${r.offsetWidth}px`)};i();const a=new ResizeObserver(i);return a.observe(r),()=>{a.disconnect(),document.documentElement.style.removeProperty("--we-panel-w")}},[]),h.jsx("div",{ref:n,className:"absolute inset-y-5 right-5 z-20 flex w-[calc(400*var(--frame))] min-w-0 flex-col overflow-hidden rounded-lg border border-line bg-canvas shadow-[0_1px_0_rgba(20,18,13,0.04),0_24px_60px_-20px_rgba(20,18,13,0.22),0_6px_18px_-8px_rgba(20,18,13,0.10)] max-[68.75rem]:w-[388px]",onClick:r=>r.stopPropagation(),children:h.jsxs(qoe,{children:[h.jsx(Aie,{slots:e}),t?h.jsx(Zoe,{actions:t}):null]})})}function Aie({slots:e}){const t=Ee(f=>f.selection),n=Ee(f=>f.session.deliverable_id),r=Eie(),i=Sie(n),a=_ie(),c=a===null?[...e.notices??[]]:[...e.notices??[],a];if(t===null||r===null)return h.jsxs(h.Fragment,{children:[h.jsx(eQ,{}),h.jsx(Ms,{surface:i,notices:c,className:"mx-3 mt-3 flex-shrink-0"})]});const u=h.jsx(Ms,{surface:i,notices:c});return t.kind==="section-settings"?h.jsx(kie,{instanceId:r,notices:u}):h.jsx(yie,{instanceId:r,selectedSlotId:t.kind==="slot"?t.slot_id:null,notices:u,cardAdornment:e.cardAdornment})}function Cie(){return document.querySelector('[role="dialog"][aria-modal="true"]')!==null}function HO(e,t){return n=>{if(!(n.metaKey||n.ctrlKey))return;const i=n.key.toLowerCase(),a=i==="z"&&!n.shiftKey,c=i==="z"&&n.shiftKey||i==="y";!a&&!c||Cie()||(n.preventDefault(),a?e():t())}}function Nie(e=!0){const{undo:t,redo:n}=t5(),r=Ee(i=>i.iframeDocs);w.useEffect(()=>{if(!e)return;const i=HO(t,n);return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,t,n]),w.useEffect(()=>{const i=HO(t,n);for(const a of r)a.addEventListener("keydown",i);return()=>{for(const a of r)a.removeEventListener("keydown",i)}},[r,t,n])}const Mie=3e3;function Rie({storeApi:e,signal:t,doc:n=document,restingMs:r=Mie}){return new Promise(i=>{let a;const c=()=>{clearTimeout(a),f(),n.removeEventListener("visibilitychange",u),t.removeEventListener("abort",c),i()},u=()=>{n.visibilityState==="visible"?c():clearTimeout(a)},f=e.subscribe(p=>{Nv(p)&&c()});n.addEventListener("visibilitychange",u),t.addEventListener("abort",c),t.aborted||Nv(e.getState())?c():n.visibilityState!=="hidden"&&(a=setTimeout(c,r))})}const Tie=5e3;function $ie(e){const t=lr(),n=So();w.useEffect(()=>{const r=new AbortController,{signal:i}=r,a=qX(Ew,HX(n,e));return(async()=>{for(;!i.aborted;)try{if(await Rie({storeApi:t,signal:i}),i.aborted)return;await yW({storeApi:t,signal:i,prepare:a})}catch(c){console.error("[editor] fill poll failed; resuming",{err:c}),await new Promise(u=>setTimeout(u,Tie))}})(),()=>r.abort()},[t,n,e])}function zie(e,t,n){var i;const r=[];for(const a of e)if(t.includes(a.id))for(const c of a.instance_ids){const u=(i=n[a.id])==null?void 0:i[c];(u===void 0||u.stale===!0)&&r.push({pageId:a.id,instanceId:c})}return r}const qO=new WeakMap;function Die(e){let t=qO.get(e);return t||(t=new Set,qO.set(e,t)),t}function Lie(e,t){return`${e} ${t}`}function Iie(){const e=lr(),t=Ee(c=>c.session.pages),n=Ee(c=>c.session.canvases),r=Ee(c=>c.visitedCanvasIds),i=Ee(c=>c.page_renders),a=w.useMemo(()=>Ou(n,r),[n,r]);w.useEffect(()=>{const c=zie(t,a,i);if(c.length===0)return;const u=e.getState(),{backend:f}=u,p=Die(f),y=new Map(u.session.sections.map(m=>[m.instance_id,m]));for(const{pageId:m,instanceId:x}of c){const v=Lie(m,x);if(p.has(v))continue;const _=y.get(x),k=u.content_doc.instances.find(S=>S.instance_id===x);!_||!k||(p.add(v),f.render({section_key:_.section_key,slots:k.slots,nav:{selfAnchor:_.schema.anchor},page_id:m,instance_id:x}).then(({html:S})=>{yo(e,f)&&e.getState().replaceSectionHtml(m,x,S,null)}).catch(S=>{yo(e,f)&&(console.error("[editor] page section render failed",{pageId:m,instanceId:x,err:S}),e.getState().replaceSectionHtml(m,x,null,{code:"render_failed",message:"This section failed to render."}))}).finally(()=>{p.delete(v)}))}},[e,t,a,i])}function Uie({ports:e,slots:t,actions:n,guides:r=!1,beneath:i=!1}){return Nie(!i),Iie(),$ie(e.api.getCropDerivativeUrl),h.jsx(CX,{ports:e,children:h.jsxs(R4,{children:[h.jsx(jW,{guides:r}),h.jsx(Oie,{slots:t,actions:n}),h.jsx(FW,{}),h.jsx(xQ,{})]})})}function Q5(){const e=Ee(n=>n.saveState),t=Ee(n=>n.savedAt);return{state:e,savedAt:t}}function Pie(){return h.jsx(Nx,{status:Q5()})}function Fie({children:e}){return h.jsx(Fp,{status:Q5(),children:e})}const VO=12e4;function Bie(){return{id:"fill-pending",rank:"status",hold:{kind:"session"},tone:"neutral",role:"status",icon:h.jsx("span",{className:"h-[15px] w-[15px] animate-spin rounded-full border-2 border-[#d9d5c6] border-t-accent [animation-duration:0.7s]","aria-hidden":"true"}),headline:"Looking through your uploads for details to fill in"}}function Hie(e,t){return{id:"fill-applied",rank:"status",hold:{kind:"condition",says:`${e}:${t??""}`},tone:"good",icon:h.jsx(bi,{size:15,strokeWidth:2.5}),headline:e}}function qie(e,t){const[n]=w.useState(()=>Date.now()),[r,i]=w.useState(null);w.useEffect(()=>{if(e===null)return;const c=(t??Date.now())+VO-Date.now(),u=setTimeout(()=>i(e),Math.max(0,c));return()=>clearTimeout(u)},[e,t]);const a=t!==null&&n>=t+VO;return e!==null&&r!==e&&!a}function Vie(e,t){return{id:"fill-failed",rank:"fault",hold:{kind:"each",ids:t},tone:"danger",role:"alert",icon:h.jsx(nx,{size:15}),headline:`We couldn’t fill in the ${e} automatically.`}}const X5=w.createContext(null);function W5({backend:e,children:t}){return h.jsx(X5.Provider,{value:e,children:t})}function kn(){const e=w.useContext(X5);if(e===null)throw new Error("useFactsBackend: a fact surface rendered outside FactsBackendProvider");return e}const rm={home:"library"};function Vw(e){return{home:"property",propertyId:e}}function Zie(e,t){return e==="library"?rm:Vw(t)}function bo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function rh(e){return bo(e)&&typeof e.id=="string"?e.id:null}const Fa=e=>e==null||e==="";function Za(e,t){return Fa(e)||Fa(t)?Fa(e)&&Fa(t):Array.isArray(e)||Array.isArray(t)?!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>Za(n,t[r])):bo(e)&&bo(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(n=>Za(e[n],t[n])):e===t}function J5(e){return RA(e)}const e$=new Set(["image","video","tour","document","media"]),Kie=new Set(["text","number","select","url","email","phone","date"]);function om(e){return e$.has(e.type)&&"from"in e&&e.from!==void 0}function Zw(e){return e$.has(e.type)&&e.type!=="media"&&!om(e)}function El(e){const t=bo(e)?e.media_id:void 0,n=typeof t=="string"?t:Kn(e);return n!==void 0&&n!==""?{media_id:n}:null}function Gie(e){const t=e.element;return t.type==="row"||om(t)}function fo(e){if(typeof e=="string")return e;if(!bo(e))return null;const t=e.id??Kn(e);return typeof t=="string"?t:null}function uu(e,t){var r;const n=bC(e);return n!==null&&bo(t)?((r=El(t[n]))==null?void 0:r.media_id)??null:null}async function t$(e,t,n,r,i,a){var c;if(Za(r,i))return r;if(Zw(t))return Yie(e,n,r,i);if(om(t)){const u=El(i);return((c=El(r))==null?void 0:c.media_id)!==(u==null?void 0:u.media_id)&&await e.setValue(n,u),i}return t.type==="list"?Xie(e,t,n,r,i,a):t.type==="object"?n$(e,t,n,bo(r)?r:{},bo(i)?i:{},a):(await e.setValue(n,i??null),i)}async function Yie(e,t,n,r){var c,u;const i=((c=El(n))==null?void 0:c.media_id)??null,a=((u=El(r))==null?void 0:u.media_id)??null;return i===a||(a!==null?await e.commitMedia(t,a):i!==null&&await e.withdrawMedia(t,i)),r}async function n$(e,t,n,r,i,a){const c={...i};for(const[u,f]of Object.entries(t.fields)){if(J5(f))continue;const p=await t$(e,f,`${n}.${u}`,r[u],i[u],a);p!==void 0&&(c[u]=p)}return c}function Qie(e,t){const n={};for(const[r,i]of Object.entries(e.fields))J5(i)||i.type==="list"||Zw(i)||Fa(t[r])||(n[r]=om(i)?El(t[r]):t[r]);return n}async function Xie(e,t,n,r,i,a){const c=Array.isArray(r)?r:[],u=Array.isArray(i)?i:[];if(Gie(t)){const C=u.map(fo).filter(z=>z!==null),I=c.map(fo).filter(z=>z!==null);return Za(I,C)||await e.setSelection(n,C),[...u]}const f=t.element;if(Kie.has(f.type)){const C=u.filter(I=>!Fa(I));return Za(c,C)||await e.setValue(n,C),C}if(f.type!=="object")throw new Error(`fact-writes: '${n}' is a list of ${f.type} values, which the facts API cannot address by item`);const p=new Map(c.flatMap(C=>rh(C)!==null?[[rh(C),C]]:[])),y=new Set(u.map(rh).filter(C=>C!==null&&p.has(C))),m=new Map;for(const[C,I]of p){const z=uu(f,I);!y.has(C)&&z!==null&&!m.has(z)&&m.set(z,C)}const x=u.map(C=>{const I=rh(C);if(I!==null&&p.has(I))return I;const z=uu(f,C),T=z!==null?m.get(z):void 0;return T===void 0?null:(m.delete(z),y.add(T),T)}),v=[...p.keys()].filter(C=>!y.has(C)&&a.has(C));for(const C of x.keys())x[C]??(x[C]=v.shift()??null);const _=new Set(x.filter(C=>C!==null));for(const C of p.keys())_.has(C)||await e.removeRow(`${n}.${C}`);const k=[];let S=!1;for(const[C,I]of u.entries()){const z=bo(I)?I:{};let T=x[C]??null,F=T!==null?p.get(T)??{}:{};if(T===null){const W=Qie(f,z);T=(await e.addRow(n,W)).row_id,uu(f,W)!==null&&(S=!0),a.add(T),F=W}k.push({...await n$(e,f,`${n}.${T}`,F,z,a),id:T})}const j=[...p.keys()].filter(C=>_.has(C)),A=[...k.map(C=>C.id).filter(C=>!p.has(C)).reverse(),...j],$=k.map(C=>C.id);return(S&&$.length>1||!Za(A,$))&&await e.reorder(n,$),k}function lp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function r$(e){const t=Kn(e);return t!==void 0&&t!==""?t:null}function o$(e){return Object.entries(e.pages).flatMap(([t,n])=>{const r=n.declaration;if(r.type!=="list"||r.element.type!=="object")return[];const i=Object.entries(r.element.fields).flatMap(([a,c])=>Zw(c)?[a]:[]);return i.length>0?[[t,i]]:[]})}function Wie(e,t){return o$(e).flatMap(([n,r])=>(Array.isArray(t[n])?t[n]:[]).flatMap(a=>!lp(a)||typeof a.id!="string"?[]:r.flatMap(c=>{const u=a[c],f=r$(u);return f===null||lp(u)&&typeof u.url=="string"&&u.url!==""?[]:[{path:`${n}.${a.id}.${c}`,mediaId:f,home:e.home}]})))}function Jie(e,t,n){if(n.size===0)return t;let r=null;for(const[i,a]of o$(e)){const c=t[i];if(!Array.isArray(c))continue;let u=!1;const f=c.map(p=>{if(!lp(p))return p;let y=p;for(const m of a){const x=p[m],v=n.get(r$(x)??"");v===void 0||!lp(x)||x.url===v||(y={...y,[m]:{...x,url:v}},u=!0)}return y});u&&(r??(r={...t}),r[i]=f)}return r??t}function i$(e,t,n,r,i){return e.mediaUrl(Zie(t,n),r,i)}const s$=(e,t,n)=>["fact-media-url",e,t,n],a$=10*6e4;function ese(e,t,n,r=e){var c;const i=kn();return((c=Rn({queryKey:s$(e,r,n??""),queryFn:()=>i$(i,e,r,t,n??""),enabled:n!==null,staleTime:a$,retry:!1}).data)==null?void 0:c.url)??null}function tse(e,t,n){const r=kn(),i=w.useMemo(()=>Wie(e,n),[e,n]),a=jN({queries:i.map(u=>({queryKey:s$(u.home,t,u.mediaId),queryFn:()=>i$(r,u.home,t??"",u.path,u.mediaId),enabled:t!==null,staleTime:a$,retry:!1})),combine:u=>u.map(f=>{var p;return((p=f.data)==null?void 0:p.url)??null})}),c=w.useMemo(()=>{const u=new Map;return i.forEach((f,p)=>{const y=a[p];y!=null&&u.set(f.mediaId,y)}),u},[i,a]);return w.useMemo(()=>Jie(e,n,c),[e,n,c])}const nse=600,rse=2500,jl=e=>["property-facts",e],l$="library",$s=["library-facts"];function ts(e){return e.home==="library"?$s:jl(e.propertyId)}function ose(e,t){return{read:()=>e.read(t),writer:{setValue:(n,r)=>e.setValue(t,n,r),addRow:(n,r)=>e.addRow(t,n,r),removeRow:n=>e.removeRow(t,n),reorder:(n,r)=>e.reorder(t,n,r),setSelection:t.home==="property"?(n,r)=>e.setSelection(t.propertyId,n,r):(n=>Promise.reject(new Error(`use-facts-draft: '${n}': the library holds no selection`))),commitMedia:(n,r)=>e.commitMedia(t,n,r),withdrawMedia:(n,r)=>e.withdrawMedia(t,n,r)},stage:(n,r)=>e.stageMedia(t,n,r)}}function ns(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e.id;return typeof t=="string"?t:null}function ZO(e){return Array.isArray(e)?e.map(fo).filter(t=>t!==null):[]}function ise(e,t){return Array.isArray(e)?e.filter(n=>{const r=fo(n);return r!==null&&!t.has(r)}):[]}function Ba(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function c$(e){const t=e.element;return t.type!=="object"?[]:Object.entries(t.fields).flatMap(([n,r])=>r.type==="list"?[[n,r]]:[])}function Fv(e,t,n,r){if(!Array.isArray(n))return;const i=c$(t);for(const a of n){const c=fo(a);if(c!==null&&(r(e).add(c),!!Ba(a)))for(const[u,f]of i)Fv(`${e}.${c}.${u}`,f,a[u],r)}}function Bv(e,t,n){return e.map((r,i)=>i===t?n:r)}function sse(e,t,n){const r=uu(e.element,n),i=fo(n);if(r===null||i===null)return null;const a=t.findIndex(c=>Ba(c)&&ns(c)===null&&uu(e.element,c)===r);return a<0?null:Bv(t,a,{...t[a],id:i})}function u$(e,t,n,r,i,a,c){if(!Array.isArray(i))return{edited:n,stored:r,changed:!1};const u=a(e);for(const v of[...ZO(n),...ZO(r),...c])u.add(v);const f=ise(i,u);let p=Array.isArray(n)?n:[],y=Array.isArray(r)?r:void 0,m=!1;for(const v of f)p=sse(t,p,v)??[...p,v],y!==void 0&&(y=[...y,v]),m=!0;const x=c$(t);if(x.length>0)for(const v of i){const _=fo(v);if(_===null||!Ba(v))continue;const k=p.findIndex(j=>fo(j)===_),S=(y==null?void 0:y.findIndex(j=>fo(j)===_))??-1;for(const[j,O]of x){const A=p[k];if(!Ba(A))break;const $=y==null?void 0:y[S],C=u$(`${e}.${_}.${j}`,O,A[j],Ba($)?$[j]:void 0,v[j],a,c);C.changed&&(p=Bv(p,k,{...A,[j]:C.edited}),y!==void 0&&Ba($)&&(y=Bv(y,S,{...$,[j]:C.stored})),m=!0)}}return m?{edited:p,stored:y??r,changed:m}:{edited:n,stored:r,changed:m}}function im(e,t,{enabled:n,onSaveBegin:r,poll:i=!1}){var pe;const a=So(),c=kn(),u=w.useCallback(N=>e.home==="library"?{home:"library"}:{home:"property",propertyId:N},[e.home]),f=w.useCallback(N=>ose(c,u(N)),[c,u]),p=Rn({queryKey:ts(u(t??"")),queryFn:()=>f(t??"").read(),enabled:n&&t!==null,refetchInterval:i?rse:!1}),[y,m]=w.useState({}),[x,v]=w.useState({}),[_,k]=w.useState({}),S=w.useRef({}),j=w.useRef({}),O=w.useRef({}),A=w.useRef(new Set),$=w.useRef(new Set),C=w.useRef(new Set),I=w.useRef(new Map),z=w.useRef(new Map),T=w.useRef({propertyId:t,onSaveBegin:r});w.useEffect(()=>{T.current={propertyId:t,onSaveBegin:r}});const F=w.useCallback(N=>{var ee;return(ee=O.current)[N]??(ee[N]=new Set),O.current[N]},[]),W=w.useCallback(N=>{const ee=Object.hasOwn(e.pages,N)?e.pages[N]:void 0;return(ee==null?void 0:ee.declaration.type)==="list"?ee.declaration:void 0},[e]),G=w.useCallback((N,ee)=>{const le=W(N);if(le===void 0)return;const xe=Object.hasOwn(S.current,N)?S.current[N]:void 0;if(xe!==void 0&&Array.isArray(ee)){const _e=Object.hasOwn(j.current,N)?j.current[N]:void 0,Oe=u$(N,le,xe,_e,ee,F,A.current);Oe.changed&&(S.current={...S.current,[N]:Oe.edited},_e!==void 0&&(j.current[N]=Oe.stored),m(S.current))}Fv(N,le,ee,F)},[W,F]),H=w.useCallback(async(N,ee)=>{const{facts:le}=await a.fetchQuery({queryKey:ts(u(ee)),queryFn:()=>f(ee).read(),staleTime:0});G(N,le[N]),j.current[N]=le[N]},[a,u,f,G]);w.useEffect(()=>{var ee;const N=(ee=p.data)==null?void 0:ee.facts;if(N!==void 0)for(const le of Object.keys(e.pages))C.current.has(le)||G(le,N[le])},[p.data,e,G]);const U=w.useCallback((N,ee)=>{const le=async()=>{var tt,Ne,Ve;const Oe=ee??T.current.propertyId,be=Object.hasOwn(e.pages,N)?e.pages[N]:void 0;if(Oe===null||be===void 0||!$.current.has(N))return;const Te=(Ne=(tt=T.current).onSaveBegin)==null?void 0:Ne.call(tt);C.current.add(N);try{const{facts:it}=await a.ensureQueryData({queryKey:ts(u(Oe)),queryFn:()=>f(Oe).read()});G(N,it[N]);const It=S.current[N],zt=Object.hasOwn(j.current,N)?j.current[N]:it[N];j.current[N]=await t$(f(Oe).writer,be.declaration,N,zt,It,A.current);const $r=W(N);if($r!==void 0&&Fv(N,$r,j.current[N],F),S.current[N]===It){$.current.delete(N);const xt=Array.isArray(j.current[N])?j.current[N].map(ns):[];k(jo=>({...jo,[N]:xt}))}v(xt=>xt[N]?{...xt,[N]:!1}:xt),e.home==="library"&&a.invalidateQueries({queryKey:$s}),Te==null||Te(!0)}catch(it){throw v(It=>({...It,[N]:!0})),Te==null||Te(!1),await H(N,Oe).catch(()=>{}),it}finally{C.current.delete(N);const it=(Ve=a.getQueryData(ts(u(Oe))))==null?void 0:Ve.facts;it!==void 0&&G(N,it[N])}},_e=(z.current.get(N)??Promise.resolve()).then(le);return z.current.set(N,_e.catch(()=>{})),_e},[a,e,u,f,G,H,W,F]),D=w.useCallback(N=>{const ee=I.current.get(N);ee!==void 0&&clearTimeout(ee),I.current.delete(N)},[]),K=w.useCallback((N,ee)=>{S.current={...S.current,[N]:ee},$.current.add(N),m(S.current),k(le=>{if(!Object.hasOwn(le,N))return le;const{[N]:xe,..._e}=le;return _e}),D(N),I.current.set(N,setTimeout(()=>{I.current.delete(N),U(N).catch(()=>{})},nse))},[D,U]),M=w.useCallback((N,ee)=>(D(N),U(N,ee)),[D,U]),B=w.useCallback(async N=>{await Promise.all([...$.current].map(ee=>M(ee,N)))},[M]),X=w.useRef(B);w.useEffect(()=>{X.current=B}),w.useEffect(()=>()=>{X.current().catch(()=>{})},[]);const se=w.useCallback(N=>({failed:x[N]===!0,retry:()=>{U(N).catch(()=>{})}}),[x,U]),J=(pe=p.data)==null?void 0:pe.facts,P=w.useMemo(()=>({...J,...y}),[J,y]),Y=tse(e,t,P),L=w.useCallback(({key:N,index:ee})=>{var _e;const le=Y[N];return(Array.isArray(le)?ns(le[ee]):null)??((_e=_[N])==null?void 0:_e[ee])??null},[Y,_]),Z=w.useCallback(async({key:N,index:ee})=>{var Oe;await M(N);const le=Object.hasOwn(S.current,N)?S.current[N]:void 0;if(le===void 0){const be=(Oe=a.getQueryData(ts(u(T.current.propertyId??""))))==null?void 0:Oe.facts[N];return Array.isArray(be)?ns(be[ee]):null}const xe=Array.isArray(le)?ns(le[ee]):null,_e=j.current[N];return xe??(Array.isArray(_e)?ns(_e[ee]):null)},[M,a,u]),ne=w.useCallback(async(N,ee,le)=>{const xe=await Z(N),_e=T.current.propertyId;if(xe===null||_e===null)throw new Error(`use-facts-draft: ${N.key} row ${N.index} is not stored, so nothing can own media in it`);return f(_e).stage(`${N.key}.${xe}.${ee}`,le)},[Z,f]),fe=w.useCallback(async({key:N,index:ee})=>{var Ne;const le=T.current.propertyId,xe=await Z({key:N,index:ee}),_e=()=>{var Ve;return Object.hasOwn(S.current,N)?S.current[N]:(Ve=a.getQueryData(ts(u(le??""))))==null?void 0:Ve.facts[N]},Oe=_e(),be=Array.isArray(Oe)?Oe:[],Te=be[ee];if(S.current={...S.current,[N]:be.filter((Ve,it)=>it!==ee)},m(S.current),xe===null||le===null)return;try{await f(le).writer.removeRow(`${N}.${xe}`)}catch(Ve){const it=_e(),It=Array.isArray(it)?[...it]:[];throw It.splice(Math.min(ee,It.length),0,Te),S.current={...S.current,[N]:It},m(S.current),Ve}const tt=Object.hasOwn(j.current,N)?j.current[N]:(Ne=a.getQueryData(ts(u(le))))==null?void 0:Ne.facts[N];Array.isArray(tt)&&(j.current[N]=tt.filter(Ve=>ns(Ve)!==xe)),k(Ve=>{if(!Object.hasOwn(Ve,N))return Ve;const{[N]:it,...It}=Ve;return It}),e.home==="library"&&a.invalidateQueries({queryKey:$s})},[Z,a,u,f,e]),de=w.useCallback(()=>void p.refetch(),[p]);return{facts:Y,ready:J!==void 0,readFailed:p.isError&&J===void 0,retryRead:de,set:K,saveState:se,flush:B,rowId:L,storedRowId:Z,stageMedia:ne,removeRow:fe}}function KO(e,t){const n=e==null?void 0:e[t];return Array.isArray(n)?n:[]}function Kw(e){const t=Ee(y=>y.session.property_id),n=kn(),r=e.some(y=>fi(y)==="library"),i=e.some(y=>fi(y)==="property"),a=Rn({queryKey:jl(t),queryFn:()=>n.read(Vw(t)),enabled:i}),c=Rn({queryKey:$s,queryFn:()=>n.read(rm),enabled:r}),u=y=>{var m,x;return fi(y)==="library"?(m=c.data)==null?void 0:m.facts:(x=a.data)==null?void 0:x.facts},f=Object.fromEntries(m0().map(y=>[y,KO(u(y),y)]));return{rows:lC(f,e),rowOf:({id:y,table:m})=>{const x=KO(u(m),m),v=x.findIndex(_=>_.id===y);return v<0?void 0:{row:x[v],index:v}},pending:i&&a.isPending||r&&c.isPending}}const d$={contacts:yr.pages.contacts.declaration,units:at.pages.units.declaration,comparables:at.pages.comparables.declaration,commercial_spaces:at.pages.commercial_spaces.declaration},Gw=e=>Rr(d$[e].label).singular;function f$({tables:e,rowId:t,size:n}){return t===null?h.jsxs(lo,{size:n,children:["No ",Gw(e[0])," chosen"]}):h.jsx(ase,{tables:e,rowId:t,size:n})}function ase({tables:e,rowId:t,size:n}){const r=Ee(y=>y.session.property_id),{rows:i,rowOf:a,pending:c}=Kw(e),u=i.find(y=>y.id===t),f=u===void 0?void 0:a(u);if(c)return h.jsx(lo,{size:n,children:"Loading…"});if(u===void 0||f===void 0)return h.jsxs(lo,{size:n,children:[ed(Gw(e[0]))," not found"]});const p=u.table;return h.jsx(h$,{table:p,row:f.row,index:f.index,size:n,homeId:p==="contacts"?"library":r})}function lse({rowId:e,size:t}){var c;const n=kn(),r=Rn({queryKey:$s,queryFn:()=>n.read(rm)}),i=(c=r.data)==null?void 0:c.facts.contacts,a=Array.isArray(i)?i.findIndex(u=>u.id===e):-1;return r.isPending?h.jsx(lo,{size:t,children:"Loading…"}):a<0?h.jsx(lo,{size:t,children:"Contact not found"}):h.jsx(h$,{table:"contacts",row:i[a],index:a,size:t,homeId:"library"})}function h$({table:e,row:t,index:n,size:r,homeId:i}){var y,m;const a=JZ(d$[e],t,`${ed(Gw(e))} ${n+1}`),c=(y=a.image)==null?void 0:y.value,u=typeof c=="object"&&c!==null&&typeof c.url=="string"?c.url:"",f=a.image===null||u!==""?null:Kn(c)??null,p=ese(e==="contacts"?"library":"property",`${e}.${String(t.id)}.${((m=a.image)==null?void 0:m.field)??""}`,f,i);return h.jsx(ph,{face:a,imageUrl:u!==""?u:p,size:r})}const p$=w.createContext(null);function cse(e){const t=w.useContext(p$);if(!t)throw new Error("fact-page-ports: an expanded face rendered outside FactPagePorts");return e(t)}const m$=w.createContext(null);function use(e){const t=w.useContext(m$),{PinMap:n}=kn().address;return h.jsx(n,{...e,postal:e.postal??t})}function dse(e){const{useMediaListHost:t}=kn();return h.jsx(uR,{...e,useHost:t})}function fse({tables:e,rowId:t,size:n}){if(e[0]!=="contacts")throw new Error(`fact-page-ports: no intake page draws a row of '${e[0]}'`);return t===null?h.jsx(lo,{size:n,children:"No contact chosen"}):h.jsx(lse,{rowId:t,size:n})}const hse={useEditorStore:cse,capabilities:{framingCrop:!1},MediaPicker:dse,TableRowSummary:fse},lb=()=>{};function pse(e){return async({slotId:t,itemIndex:n,field:r},i)=>{if(!("file"in i))throw new Error(`fact-page-ports: '${t}.${r}' takes a file, not a link`);const a=await e({key:t,index:n},r,i.file);return{media_id:a.media_id,url:a.url}}}function du({propertyId:e,listingIntent:t,stageMedia:n,nearPostal:r=null,tablePicker:i,tableCreate:a,marks:c,isMediaProcessing:u,cropFailedAt:f,children:p}){const y=c==null?void 0:c.markFor,{api:m,address:x}=kn(),v=w.useMemo(()=>({session:{property_id:e,listing_intent:t},select:lb,markSlotOverridden:lb,relinkSlot:lb}),[e,t]),_=w.useMemo(()=>({...hse,api:m,address:{Input:x.Input,PinMap:use},...n?{ownedUpload:pse(n)}:{},...i?{TablePicker:i}:{},...a?{TableCreate:a}:{},...y?{fillMark:y}:{},...u?{isMediaProcessing:u}:{},...f?{cropFailedAt:f}:{}}),[m,x,n,i,a,y,u,f]);return h.jsx(p$.Provider,{value:v,children:h.jsx(m$.Provider,{value:r,children:h.jsx(ZN,{ports:_,children:p})})})}function g$(e,t,n){if(e===void 0)return null;const r=e.pages.find(c=>c.home===t.home&&c.key===n);if(r!==void 0)return ET(`${t.home}.${n}`,r.used,r.required);const i=Object.hasOwn(t.pages,n)?t.pages[n]:void 0,a=i===void 0?null:$n(i.declaration);return fw(a??{fields:{}})}function y$(e){const{requirements:t}=kn(),n=Rn({queryKey:t.queryKey(e??""),queryFn:()=>t.read(e??""),enabled:e!==null&&e!==""});return{answer:n.data,failed:n.isError,retry:()=>void n.refetch()}}function b$(e){return y$(e).answer}function v$(e){const t=iR(e);return{table:t.at(-1).lists[0],title:t[0].label,landsIn:t.slice(0,-1).map(({lists:r})=>r[0])}}function Yw(e){const t=e.join(`
|
|
1332
|
-
`);return w.useMemo(()=>v$(t.split(`
|
|
1333
|
-
`)),[t])}function cb(e){const{home:t,key:n}=go(e);if(t!=="property")throw new Error(`A row lands on the picking property; "${e}" is no property list.`);return n}const mse=e=>{const t=typeof e=="object"&&e!==null?e.id:void 0;return typeof t=="string"?t:null};function sm({propertyId:e,lists:t,onSaveBegin:n}){const r=im(at,e,{enabled:t.length>0,onSaveBegin:n}),[i,a]=w.useState(null),[c,u]=w.useState(()=>new Set),f=_=>{const k=r.facts[_];return Array.isArray(k)?k:[]},p=_=>f(_).flatMap(k=>mse(k)??[]),[y,m]=w.useState(null);if(y===null&&r.ready&&t.length>0){const _=[...new Set(t.flatMap(k=>p(cb(k))))];m({ordered:_,holder:new Set(p(cb(t[0])))})}return{tiers:w.useMemo(()=>y===null?null:{ordered:y.ordered,holder:new Set([...y.holder,...c])},[y,c]),land:async(_,k)=>{a(null);const S=t.map(cb).filter(j=>!p(j).includes(_));if(S.length===0)return!0;if(!r.ready)return a("This property is still loading. Try again in a moment."),!1;for(const j of S)r.set(j,[k,...f(j)]);return await r.flush(),u(j=>new Set([...j,_])),!0},refusal:i,setRefusal:a}}function gse(e,t){const n=e.pages[t];return n!==void 0&&_p(n)&&qv(n.declaration)?[t]:[]}function Hv(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}function yse(e,t){const[n,...r]=t.split(".");let i=n!==void 0&&Object.hasOwn(e.pages,n)?e.pages[n].declaration:void 0,a=null;for(const c of[null,...r]){if(c!==null)if((i==null?void 0:i.type)==="list")i=i.element;else if((i==null?void 0:i.type)==="object")i=Object.hasOwn(i.fields,c)?i.fields[c]:void 0;else break;if(i===void 0)break;"label"in i&&typeof i.label=="string"&&(a=i.label)}return a}function bse(e,t,n){const[r,...i]=n.split(".");if(r===void 0||!Object.hasOwn(e.pages,r))return!1;let a=e.pages[r].declaration,c=t[r];for(const u of i)if((a==null?void 0:a.type)==="list"){if(!Array.isArray(c)||(c=c.find(f=>S0(f)===u),c===void 0))return!1;a=a.element}else{if((a==null?void 0:a.type)==="object")a=Object.hasOwn(a.fields,u)?a.fields[u]:void 0;else if((a==null?void 0:a.type)!=="address")return!1;if(a===void 0)return!1;c=typeof c=="object"&&c!==null?c[u]:void 0}return F5({value:c},"value")}function qv(e){const t=e;return t.source!==void 0||Array.isArray(t.process)&&t.process.length>0?!0:e.type==="list"?qv(e.element):e.type==="object"?Object.values(e.fields).some(qv):!1}const cp="Filled in from your uploads",vse="Picked from your uploads";function xse(e){if(e===null)return null;switch(e.verb){case"pick":return vse;case"write":case"find":return cp}}const wse={forPage:()=>null,markFor:()=>null,noteUserEdit:()=>{},isMediaProcessing:()=>!1,cropFailedAt:()=>null},kse=2500,_se=1e4,Sse={comparables:jl,contacts:jl},GO=e=>["fill-status",e],YO=new Map;function Ese(e){let t=YO.get(e);return t===void 0&&(t=new Set(gse(at,e)),YO.set(e,t)),t}function am(e){const t=So(),n=kn(),r=Rn({queryKey:GO(e??""),queryFn:async()=>{const x=e,v=t.getQueryData(GO(x)),_=await n.fillStatus(x);return x!==l$&&await jse(t,x,v,_),_},enabled:!!e,refetchInterval:x=>{const v=x.state.data;return(v==null?void 0:v.evaluating)===!0||Object.values((v==null?void 0:v.paths)??{}).some(k=>k.pending)?kse:_se}}),[i,a]=w.useState(()=>new Set),c=w.useCallback(x=>{a(v=>v.has(x)?v:new Set(v).add(x))},[]),u=w.useCallback((x,v)=>v.owner!=="job"||v.absent||i.has(Hv(x))?null:xse(v.fill??null),[i]),f=w.useCallback(x=>{var k;const v=Ese(x),_=Object.entries(((k=r.data)==null?void 0:k.paths)??{}).filter(([S])=>v.has(Hv(S))).sort(([S],[j])=>S<j?-1:S>j?1:0);return _.length===0?null:Ose(x,_,i.has(x),u)},[r.data,i,u]),p=w.useCallback(x=>{var _;const v=(_=r.data)==null?void 0:_.paths[x];return v===void 0?null:u(x,v)},[r.data,u]),y=w.useCallback((x,v)=>{var _,k;return(((k=(_=r.data)==null?void 0:_.paths[x])==null?void 0:k.processing)??[]).includes(v)},[r.data]),m=w.useCallback((x,v)=>{var _;return _M(((_=r.data)==null?void 0:_.failed_crops)??[],x,v)},[r.data]);return e?{forPage:f,markFor:p,noteUserEdit:c,isMediaProcessing:y,cropFailedAt:m}:wse}function QO(e,t){return Object.entries(e.paths).filter(([n])=>Hv(n)===t)}async function jse(e,t,n,r){if(n===void 0)return;const i=Object.entries(Sse).filter(([a])=>{const c=QO(r,a);return c.some(([,u])=>u.pending)?!1:JSON.stringify(c)!==JSON.stringify(QO(n,a))}).map(([,a])=>e.refetchQueries({queryKey:a(t),exact:!0,type:"active"}));await Promise.all(i)}function Ose(e,t,n,r){const i=t.filter(([,y])=>y.pending).map(([y])=>y),a=t.filter(([,y])=>y.failed).map(([y])=>y),c=t.filter(([,y])=>y.owner==="job"&&!y.absent),u=!n&&c.length>0,f=new Set(c.map(([y,m])=>r(y,m)??cp)),p=c.flatMap(([,y])=>{const m=Date.parse(y.filled_at??"");return Number.isNaN(m)?[]:[m]});return{page:e,pending:i.length>0,pendingPaths:i,autoFilled:u,failed:a.length>0,failedPaths:a,mark:u?f.size===1?[...f][0]:cp:null,filledAt:u&&p.length>0?Math.max(...p):null}}function fu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Vv(e){return fu(e)?Object.entries(e).every(([t,n])=>t==="id"||n==null||n===""||(Array.isArray(n)?n.length===0:fu(n)&&Vv(n))):!0}function Ase(e,t){const n=e.findIndex((r,i)=>t[i]!==r);return n<0?e.length-1:n}function Cse(e,t){const n=go(e);return n.home==="library"?{registry:yr,homeId:l$,key:n.key}:{registry:at,homeId:t,key:n.key}}function Tu({from:e,selection:t,record:n,create:r,propertyId:i,onSaveBegin:a,tiers:c}){const{registry:u,homeId:f,key:p}=Cse(e,i),{refusalCode:y}=kn(),m=im(u,f,{enabled:!0,onSaveBegin:a}),{isMediaProcessing:x,cropFailedAt:v}=am(f===""?null:f),_=g$(b$(i),u,p),[k,S]=w.useState(null),j=u.pages,O=Object.hasOwn(j,p)?j[p]:void 0,A=m.facts[p],$=Array.isArray(A)?A:[],[C,I]=w.useState(null),z=$.map((pe,N)=>m.rowId({key:p,index:N})),[T,F]=w.useState(null);T===null&&c!==void 0&&m.ready&&F(new Set(z.flatMap(pe=>pe??[])));const W=c===void 0||T===null?$.map((pe,N)=>N):Nse(z,c.ordered,T),G=W.map(pe=>$[pe]),H=c===void 0||T===null?void 0:new Set(z.flatMap(pe=>pe!==null&&T.has(pe)&&!c.holder.has(pe)?[pe]:[])),U=w.useRef({rows:$,selection:t,draft:m});w.useEffect(()=>{U.current={rows:$,selection:t,draft:m}});const D=n===void 0?-1:W.findIndex(pe=>m.rowId({key:p,index:pe})===n.rowId),K=n!==void 0&&m.ready&&D<0;w.useEffect(()=>{K&&n.onClose()},[K,n]);const M=w.useRef(!1),[B,X]=w.useState(!1),se=r!==void 0,J=m.ready;w.useEffect(()=>{if(!se||!J||M.current)return;const{rows:pe,draft:N}=U.current;M.current=!0,N.set(p,[{},...pe]),I(0)},[se,J,p]);const P=()=>{const pe=new Map;return U.current.rows.forEach((N,ee)=>{const le=U.current.draft.rowId({key:p,index:ee});le!==null&&fu(N)&&pe.set(le,{...N,id:le})}),pe};if(O===void 0)return null;const Y=O.declaration,L=Rr(Y.label).singular,Z=t&&{ids:t.ids,control:t.control,idKey:"id",rowId:(pe,N)=>{const ee=W[N];return ee===void 0?null:m.rowId({key:p,index:ee})},held:t.held,...H!==void 0?{upstream:H}:{},onChange:pe=>t.onChange(pe,P())},ne=(pe,N)=>{if(S(null),N!=="remove"){if(c===void 0){m.set(p,pe);return}if(pe.length>W.length){const xe=new Set(G);m.set(p,[...pe.filter(_e=>!xe.has(_e)),...$]);return}const le=[...$];W.forEach((xe,_e)=>{le[xe]=pe[_e]}),m.set(p,le);return}const ee=W[Ase(G,pe)];ee!==void 0&&m.removeRow({key:p,index:ee}).catch(le=>{S(y(le)==="row_picked"?`This ${L} is on a property, so it stays in your library. Take it off every property first.`:`Couldn’t remove this ${L}. Try again.`)})},fe=pe=>{const N=W[pe];if(N!==void 0){if(Vv(U.current.rows[N])){m.removeRow({key:p,index:N}).catch(ee=>{console.error("[intake] a blank new row was not discarded",{from:e,error:ee})});return}(t==null?void 0:t.pickAdded)===!0&&m.storedRowId({key:p,index:N}).then(ee=>{const le=U.current.selection;if(le===void 0||ee===null||le.ids.includes(ee))return;const xe=P(),_e=U.current.rows[N];!xe.has(ee)&&fu(_e)&&xe.set(ee,{..._e,id:ee}),le.onChange([ee,...le.ids],xe)})}},de=m.saveState(p);if(r!==void 0){if(C===null||B)return null;const pe=()=>{X(!0);const N=C;(async()=>{const le=U.current.rows[N];if(Vv(le)){await m.removeRow({key:p,index:N});return}const xe=await m.storedRowId({key:p,index:N});xe!==null&&fu(le)&&await r.onCreated(xe,{...le,id:xe})})().catch(le=>console.error("[intake] a new row was not added",{from:e,error:le})).finally(r.onClose)};return h.jsx(du,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:x,cropFailedAt:v,children:h.jsx(au,{slot:Y,value:G,onChange:ne,propertyId:i,instanceId:`facts:${u.home}`,slotId:p,factPath:p,fields:_,record:{index:C,onClose:pe,added:!0}})})}return n!==void 0?D<0?null:h.jsx(du,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:x,cropFailedAt:v,children:h.jsx(au,{slot:Y,value:G,onChange:ne,propertyId:i,instanceId:`facts:${u.home}`,slotId:p,factPath:p,fields:_,record:{index:D,onClose:n.onClose}})}):h.jsx(du,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:x,cropFailedAt:v,children:h.jsxs("div",{className:"flex flex-col gap-[12px]","data-from-table":e,children:[h.jsx(au,{slot:Y,value:G,onChange:ne,onRecordAdded:fe,propertyId:i,instanceId:`facts:${u.home}`,slotId:p,factPath:p,selection:Z,fields:_,...c!==void 0?{orderable:!1}:{}}),k!==null&&h.jsx("p",{role:"alert",className:"text-body text-danger",children:k}),de.failed&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 text-body text-danger",children:[h.jsx("span",{children:`Couldn’t save your ${Si(O).toLowerCase()}.`}),h.jsx("button",{type:"button",onClick:de.retry,className:"cursor-pointer font-medium underline underline-offset-2",children:"Retry"})]})]})})}function Nse(e,t,n){const r=new Map(e.flatMap((f,p)=>f===null?[]:[[f,p]])),i=e.flatMap((f,p)=>f===null||!n.has(f)?[p]:[]),a=t.flatMap(f=>n.has(f)&&r.has(f)?[r.get(f)]:[]),c=new Set(a),u=e.flatMap((f,p)=>f!==null&&n.has(f)&&!c.has(p)?[p]:[]);return[...i,...a,...u]}function Qw(e){return kL(e)}function Mse(e){if(e.mode==="multi")return{ids:e.selectedIds,control:"checkbox",pickAdded:!0,onChange:(n,r)=>{const i=new Map(n.flatMap(a=>r.has(a)?[[a,r.get(a)]]:[]));e.onChange(n,i)}};const t=e.selectedId??null;return{ids:t!==null?[t]:[],control:"radio",held:new Set(e.disabledIds),pickAdded:!0,onChange:(n,r)=>{const i=n.find(c=>c!==t),a=i===void 0?void 0:r.get(i);i!==void 0&&a!==void 0&&e.onPick(i,a)}}}function Rse(e,t){return{...e,onChange:(n,r)=>{const i=n.find(c=>!e.ids.includes(c)),a=i===void 0?void 0:r.get(i);if(i===void 0||a===void 0){e.onChange(n,r);return}t(i,a).then(c=>{c&&e.onChange(n,r)})}}}function Tse({propertyId:e,onSaveBegin:t,...n}){const{tables:r,onClose:i}=n,[a]=r,c=Yw([Qw(a)]),u=sm({propertyId:e,lists:c.landsIn,onSaveBegin:t}),f=Mse(n),p=c.landsIn.length>0;return h.jsxs(Mx,{onClose:i,title:c.title,children:[p&&u.tiers===null?h.jsx("div",{className:Pl,"aria-hidden":"true"}):h.jsx(Tu,{from:c.table,propertyId:e,onSaveBegin:t,selection:p?Rse(f,u.land):f,...u.tiers!==null?{tiers:u.tiers}:{}}),u.refusal!==null&&h.jsx("p",{role:"alert",className:"mt-3 text-body text-danger",children:u.refusal})]})}const Xw=w.createContext(void 0);function $se({onSaveBegin:e,children:t}){return h.jsx(Xw.Provider,{value:e,children:t})}function zse({tables:e,onCreated:t,onClose:n}){const r=mi(f=>f.session.property_id),i=w.useContext(Xw),[a]=e,c=Yw([Qw(a)]),u=sm({propertyId:r,lists:c.landsIn,onSaveBegin:i});return h.jsx(Tu,{from:c.table,propertyId:r,onSaveBegin:i,create:{onCreated:async(f,p)=>{await u.land(f,p)&&t(f,p)},onClose:n}})}function Dse(e){const t=mi(r=>r.session.property_id),n=w.useContext(Xw);if(!e.open)return null;if(e.mode==="record"){const[r]=e.tables;return h.jsx(Tu,{from:Qw(r),propertyId:t,onSaveBegin:n,record:{rowId:e.rowId,onClose:e.onClose}})}return h.jsx(Tse,{...e,propertyId:t,onSaveBegin:n})}function x$(e,t,n){return`${e}:${t??"new"}:${n}`}function w$({registry:e,pageKey:t,facts:n,answer:r,refused:i,onDismissRefusal:a,generateMissing:c=[],autofill:u=null,save:f=null}){const p=Object.hasOwn(e.pages,t)?e.pages[t]:void 0,y=p!==void 0&&u!==null?Pse(e,p,n,u):null,m=(y==null?void 0:y.filled)??null,x=qie(m===null?null:`${m.mark}:${m.filledAt??""}`,(m==null?void 0:m.filledAt)??null);if(p===void 0)return[];const v=i?r.missing.length===0?Use(c):Ise(p,r):null;return[...v?[{...mJ("refused",v.headline),onDismiss:a}]:[],...f!=null&&f.failed?[Lse(f.retry)]:[],...y!==null&&y.failed.length>0?[Vie(Ww(y.failed),y.failedPaths)]:[],...y!=null&&y.pending?[Bie()]:[],...m!==null&&x?[Hie(m.mark,m.filledAt)]:[]]}function Lse(e){return{id:"save-failed",rank:"fault",hold:{kind:"page"},tone:"danger",role:"alert",headline:"Couldn’t save your latest changes.",action:{label:"Retry",onClick:e}}}function Ise(e,t){const n=t.missing.filter(r=>Bse(r)!==null);return n.length>0?{headline:`Add the ${Ww(_$(n))} to continue.`}:{headline:`${Vse(e)} to continue.`}}function Use(e){return e.length===0?null:{headline:`Complete the ${Ww(_$(e))} to generate.`}}function Pse(e,t,n,r){const i=XO(e,r.pendingPaths).length>0,a=r.failedPaths.filter(f=>bse(e,n,f)),c=XO(e,a),u=!i&&c.length===0;return{pending:i,failedPaths:a,failed:c,filled:u&&r.autoFilled&&t.declaration.type==="list"?{mark:r.mark??cp,filledAt:r.filledAt??null}:null}}function XO(e,t){const n=t.map(r=>yse(e,r));return[...new Set(n.filter(r=>r!==null))]}const k$=/^([a-z]+)\.([a-z_]+)(\[0?\])?(?:\.([a-z_]+))?$/,Fse={property:at,library:yr};function Bse(e){var t;return((t=k$.exec(e))==null?void 0:t[4])??null}const Hse={street:"Street address",city:"City",state:"State",postal:"ZIP",pin:"Map pin"};function qse(e){var y,m;const t=k$.exec(e);if(t===null)return e;const[,n,r,i,a]=t,c=Fse[n],u=c!==void 0&&Object.hasOwn(c.pages,r)?c.pages[r]:void 0;if(c===void 0||u===void 0)return e;if(a===void 0)return Si(u);if(i===void 0)return Hse[a==="latitude"||a==="longitude"?"pin":a]??a;const f=(m=(y=P5(c).facts.find(x=>x.key===r))==null?void 0:y.fields.find(x=>x.path===`${n}.${r}[].${a}`))==null?void 0:m.declaration;return(f!=null&&"label"in f&&typeof f.label=="string"?f.label:null)??a.replaceAll("_"," ")}function _$(e){return[...new Set(e.map(qse))]}function Vse(e){const{declaration:t}=e,n=E$(Si(e));return t.type==="list"?`Add ${n}`:t.type==="select"?`Choose the ${n}`:`Add the ${n}`}const ub=4;function Ww(e){return S$(e.map(E$))}function S$(e){const t=e.length>ub?[...e.slice(0,ub-1),`${e.length-(ub-1)} more`]:e,n=t.at(-1)??"";return t.length>1?`${t.slice(0,-1).join(", ")} and ${n}`:n}function E$(e){const t=e.charAt(1);return t!==""&&t===t.toUpperCase()&&t!==t.toLowerCase()?e:e.charAt(0).toLowerCase()+e.slice(1)}function Zse(e){return e.flatMap(t=>{if(pn(t))return[];const{record:n}=t;return n.url!==null||n.account!==null||n.state==="processing"?[]:n.kind==="document"||n.state==="failed"?[n.name]:[]})}function Kse(e){return`We can’t read ${S$(e)}, please upload ${e.length===1?"a new copy":"new copies"}.`}function Gse(e){const t=Zse(e);return t.length===0?null:{id:"unread-files",rank:"fault",hold:{kind:"condition",says:JSON.stringify([...t].sort())},tone:"danger",role:"alert",headline:Kse(t)}}function Yse(e){return{kinds:vo,from:[`property.${e}`]}}const Qse={mode:"all"};function Xse({propertyId:e,path:t,noticeSurface:n,notices:r}){const i=w.useMemo(()=>Yse(t),[t]),{useMediaListHost:a}=kn(),c=a(e,i),{cropFailedAt:u}=am(e),f=Gse(c.items);return h.jsxs(h.Fragment,{children:[h.jsx(Ms,{surface:n,notices:f===null?r:[...r,f]}),h.jsx(oR,{filter:i,selection:Qse,host:{...c,cropFailedAt:u}})]})}function Wse(e,t,n=at,r){if(e.length===0)return[];const i=n.home==="property"?yr:at;return Loe(e,{[n.home]:t,...r===void 0?{}:{[i.home]:r}},[n,i])}function Jse(e,t=at){return e.some(n=>{const r=/^([a-z]+)\.([a-z_]+)\[0?\]\./.exec(n);if(r===null||r[1]!==t.home||!Object.hasOwn(t.pages,r[2]))return!1;const i=t.pages[r[2]].declaration;return i.type==="list"&&E0(i.element)!==null})}function j$(e,t,n=at,r){return e===void 0?{missing:[]}:{missing:Wse(e.required,t,n,r)}}const eae={};function tae(e,t=at){var a;const n=t.home==="property"&&Jse(e,t),r=kn(),i=Rn({queryKey:$s,queryFn:()=>r.read(rm),enabled:n});if(n)return((a=i.data)==null?void 0:a.facts)??eae}function nae(e){return e.type==="list"&&LC(e,"expanded","home").view==="media-manager"}const rae=()=>{};function oae({registry:e,pageKey:t,facts:n,answer:r,onChange:i,propertyId:a,noticeHost:c,hostNotices:u=[],refused:f=!1,onDismissRefusal:p=rae,generateMissing:y,autofill:m=null,marks:x,isMediaProcessing:v,cropFailedAt:_,save:k=null,stageMedia:S,onLibrarySaveBegin:j}){var F;const O=tae((r==null?void 0:r.required)??[],e),A=w$({registry:e,pageKey:t,facts:n,answer:j$(r,n,e,O),refused:f,onDismissRefusal:p,generateMissing:y,autofill:m,save:k}),$=Object.hasOwn(e.pages,t)?e.pages[t]:void 0;if($===void 0)return null;const C=n[t],I=n.listing_intent,z=x$(c,a,t),T=[...A,...u];return h.jsx("div",{className:"flex flex-col gap-[12px]","data-fact-page":t,children:nae($.declaration)?h.jsx(Xse,{propertyId:a,path:t,noticeSurface:z,notices:T}):h.jsxs($se,{onSaveBegin:j,children:[h.jsx(Ms,{surface:z,notices:T}),h.jsx(du,{propertyId:a??"",listingIntent:I==="for_sale"||I==="for_rent"?I:null,stageMedia:S,nearPostal:((F=en(n.address))==null?void 0:F.postal)??null,tablePicker:Dse,tableCreate:zse,marks:x,isMediaProcessing:v,cropFailedAt:_,children:h.jsx(_V,{factPath:t,fields:r===void 0?null:ET(`${e.home}.${t}`,r.used,r.required),children:h.jsx(iae,{declaration:$.declaration,required:r!==void 0&&r.required.length>0,label:Si($),slotId:t,instanceId:`facts:${e.home}`,value:C,facts:n,onChange:i,propertyId:a??""})})})]})})}function O$(e,t,n){if(e.type!=="list")return{label:t,...e};const{max:r,...i}=e,a=DT(e,n);return{label:t,...i,...a!==null?{max:a}:{}}}function iae({declaration:e,required:t,label:n,slotId:r,instanceId:i,value:a,facts:c,onChange:u,propertyId:f}){const p=O$(e,n,c),y=e.type==="list"&&DG(e,c)?$n(p):null;return h.jsx(cd,{place:"page",children:y?h.jsx(VG,{object:y,rows:Array.isArray(a)?a:[],onChange:u,propertyId:f,instanceId:i,slotId:r,factPath:r}):h.jsx(Bl,{slot:p,instanceId:i,slotId:r,value:a,onChange:u,required:t,propertyId:f,factPath:r})})}function sae(e,t=at){return((e==null?void 0:e.pages)??[]).flatMap(n=>{if(n.home!==t.home||!n.paged||!Object.hasOwn(t.pages,n.key))return[];const r=t.pages[n.key];return _p(r)?[{kind:"fact",key:n.key,declared:r,answer:n}]:[]})}function aae(e,t){return{title:d2(e.head.title,t),description:d2(e.head.description,t)}}const lae=.3;function cae(e){const t=Math.max(0,e.viewportHeight-e.topOffset),n=lae*t,r=Math.min(t/2,e.maxScroll/2),i=p=>Math.min(1,Math.max(0,p)),a=r>0?i(e.scrollY/r):0,c=r>0?i(1-(e.maxScroll-e.scrollY)/r):0,u=e.topOffset+n*a+(t-n)*c;let f=0;return e.tops.forEach((p,y)=>{p<=u&&(f=y)}),f}function uae(e,t){const n=e.join("|"),[r,i]=w.useState(e[0]??""),a=w.useRef(null),c=w.useRef(0);w.useEffect(()=>{let f=null;const p=()=>{if(f=null,a.current)return;const v=cae({tops:e.map(_=>{var k;return((k=document.getElementById("sec-"+_))==null?void 0:k.getBoundingClientRect().top)??Number.POSITIVE_INFINITY}),topOffset:t(),viewportHeight:window.innerHeight,scrollY:window.scrollY,maxScroll:document.documentElement.scrollHeight-window.innerHeight});i(e[v]??"")},y=()=>{f==null&&(f=requestAnimationFrame(p))},m=()=>{var v;(v=a.current)!=null&&v.landed&&(a.current=null),y()},x=()=>{a.current&&(a.current=null,c.current++,y())};return p(),window.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",y),window.addEventListener("wheel",x,{passive:!0}),window.addEventListener("touchstart",x,{passive:!0}),window.addEventListener("keydown",x),()=>{window.removeEventListener("scroll",m),window.removeEventListener("resize",y),window.removeEventListener("wheel",x),window.removeEventListener("touchstart",x),window.removeEventListener("keydown",x),f&&cancelAnimationFrame(f)}},[n]);const u=w.useCallback(f=>{const p=document.getElementById("sec-"+f);if(!p)return;const y=++c.current;a.current={id:f,landed:!1},i(f);const m=()=>requestAnimationFrame(()=>{var x;c.current===y&&((x=a.current)==null?void 0:x.id)===f&&(a.current.landed=!0)});dae(p,t(),()=>c.current===y,m)},[t]);return{active:r,jump:u}}function dae(e,t,n,r){const i=Math.max(0,Math.min(e.getBoundingClientRect().top+window.scrollY-t,document.documentElement.scrollHeight-window.innerHeight)),a=window.scrollY,c=i-a;if(Math.abs(c)<2){r();return}const u=Math.min(560,200+Math.abs(c)*.35),f=typeof performance<"u"?performance.now():Date.now(),p=m=>1-Math.pow(1-m,3),y=m=>{if(!n())return;const x=Math.min(1,(m-f)/u);window.scrollTo(0,Math.round(a+c*p(x))),x<1&&requestAnimationFrame(y)};requestAnimationFrame(y),setTimeout(()=>{n()&&(Math.abs(window.scrollY-i)>2&&window.scrollTo(0,i),r())},u+90)}const WO=200,JO=320,fae="cubic-bezier(0.22, 1, 0.36, 1)";function hae({sections:e,navLabel:t,clearance:n}){const r=w.useRef(n);w.useLayoutEffect(()=>{r.current=n},[n]);const i=w.useCallback(()=>r.current(),[]),a=w.useMemo(()=>e.map(k=>k.id),[e]),{active:c,jump:u}=uae(a,i),f=w.useRef(null),p=w.useRef(null),y=w.useRef(null),m=w.useRef(null),x=w.useRef(c);w.useLayoutEffect(()=>{const k=()=>{f.current&&f.current.style.setProperty("--ip-rail-top",`${i().toString()}px`)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[i]);const v=w.useCallback(k=>{const S=y.current,j=p.current,O=j==null?void 0:j.querySelector(`[data-section="${CSS.escape(x.current)}"]`);if(!S||!j||!O)return;const A=j.getBoundingClientRect(),$=O.getBoundingClientRect(),C=$.top-A.top,I=A.bottom-$.bottom,z=m.current;m.current={top:C,bottom:I};const T=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(k&&z&&z.top!==C&&!T){const F=C>z.top;S.style.transitionProperty="top, bottom",S.style.transitionTimingFunction=fae,S.style.transitionDuration=F?`${JO.toString()}ms, ${WO.toString()}ms`:`${WO.toString()}ms, ${JO.toString()}ms`}else S.style.transitionProperty="none";S.style.top=`${C.toString()}px`,S.style.bottom=`${I.toString()}px`,S.style.opacity="1"},[]);w.useLayoutEffect(()=>{x.current=c,v(!0)},[c,v]),w.useEffect(()=>{const k=p.current;if(!k)return;const S=()=>v(!1),j=new ResizeObserver(S);return j.observe(k),"fonts"in document&&document.fonts.ready.then(S),()=>j.disconnect()},[v]);const _=w.useCallback(k=>()=>u(k),[u]);return h.jsxs("div",{ref:f,className:"flex items-start gap-10",children:[h.jsxs("nav",{ref:p,"aria-label":t,className:"sticky flex w-[calc(168*var(--frame))] shrink-0 flex-col gap-1 pt-1 top-[var(--ip-rail-top,0px)]",children:[h.jsx("span",{ref:y,"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 rounded-md bg-line-soft opacity-0"}),e.map(k=>h.jsx("button",{type:"button","data-section":k.id,"aria-current":c===k.id?"true":void 0,onClick:_(k.id),className:`relative cursor-pointer rounded-md px-2.5 py-1.75 text-left text-body-lg font-medium transition-colors duration-200 motion-reduce:transition-none ${c===k.id?"text-ink":"text-ink-3 hover:text-ink"}`,children:k.label},k.id))]}),h.jsx("div",{className:"min-w-0 flex-1",children:e.map((k,S)=>h.jsx("section",{id:`sec-${k.id}`,className:S>0?"py-10":"pt-2.5 pb-10",children:k.content},k.id))})]})}function pae({title:e,sub:t,aside:n}){return h.jsxs("header",{className:"mb-6 flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"m-0 text-[length:calc(28*var(--content))] font-semibold tracking-[-0.015em] text-ink",children:e}),t?h.jsx("p",{className:"mt-1.5 max-w-[calc(640*var(--frame))] text-lead leading-[1.5] text-ink-3",children:t}):null]}),n?h.jsx("div",{className:"shrink-0",children:n}):null]})}function mae({propertyId:e,saveCycle:t,onFactsSaved:n,clearance:r,afterFacts:i}){const a=y$(e),c=sae(a.answer),{forPage:u,noteUserEdit:f,markFor:p,isMediaProcessing:y,cropFailedAt:m}=am(e),x=im(at,e,{enabled:!0,onSaveBegin:()=>{const O=t.begin();return(A=!0)=>{O(A),A&&(n==null||n())}},poll:c.some(O=>{var A;return((A=u(O.key))==null?void 0:A.pending)===!0})}),v=x.facts,_=a.answer===void 0||!x.ready,k=a.failed&&a.answer===void 0||x.readFailed,S=()=>{a.failed&&a.retry(),x.readFailed&&x.retryRead()},j=c.map(O=>{const A=aae(O.declared,v);return{id:O.key,label:Si(O.declared),content:h.jsxs("div",{children:[h.jsx(pae,{title:A.title,sub:A.description}),h.jsx(oae,{registry:at,pageKey:O.key,facts:v,answer:O.answer,onChange:$=>{f(O.key),x.set(O.key,$)},propertyId:e,noticeHost:"details",autofill:u(O.key),marks:{markFor:p},isMediaProcessing:y,cropFailedAt:m,save:x.saveState(O.key),stageMedia:x.stageMedia,onLibrarySaveBegin:t.begin})]})}});return i!==null&&j.push(i),h.jsxs(h.Fragment,{children:[h.jsx(Ms,{surface:`details:${e}`,notices:k?[pJ("We couldn’t load this property’s details.",{label:"Try again",onClick:S})]:[]}),k||_?null:h.jsx(hae,{navLabel:"Property details sections",sections:j,clearance:r})]})}function gae(e){return P4(e),e.getState().pendingSaves===0?Promise.resolve():new Promise(t=>{const n=e.subscribe(r=>{r.pendingSaves>0||(n(),t())})})}const yae="\0added";function Jw(e,t){const n=w.useRef(e);w.useEffect(()=>{n.current=e});const r=w.useRef(!1),i=e.mode==="multi"?e.selectedIds:e.selectedId===null?[]:[e.selectedId],a=(u,f)=>{const p=n.current,y=u.find(v=>!i.includes(v)),m=i.filter(v=>!u.includes(v)),x=v=>v.filter(_=>!m.includes(_));if(y===void 0){p.mode==="multi"&&m.length>0&&p.onChange(x(p.selectedIds),new Map);return}r.current||(r.current=!0,f(y).then(v=>{if(v===null)return;const _=n.current;if(_.mode==="single"){_.onPick(v.id,v.members);return}const k=x(_.selectedIds);k.includes(v.id)||_.onChange([v.id,...k],new Map([[v.id,v.members]]))},()=>t==null?void 0:t()).finally(()=>{r.current=!1}))},c=u=>a([yae,...i],()=>u());return e.mode==="multi"?{ids:i,control:"checkbox",onChange:a,onAdded:c}:{ids:i,control:"radio",held:new Set(e.disabledIds),onChange:a,onAdded:c}}const bae=new Set(["text","number","text_list","number_list","address"]);function up(e,t,n){const r=typeof n=="object"&&n!==null?n:{},i={id:t};for(const[a,c]of Object.entries(Sp(e))){const u=Yu(c);u!==null&&bae.has(u)&&Object.hasOwn(r,a)&&(i[a]=r[a])}return i}function db(e){const t=at.pages[e];function n({property:r,saveCycle:i,pick:a,record:c}){const u=kn(),f=im(at,r.id,{enabled:!0,onSaveBegin:i.begin}),p=f.facts,y=p[e],m=Array.isArray(y)?y:[],x=w.useRef(m);w.useEffect(()=>{x.current=m});const v=w.useRef(f.flush);w.useEffect(()=>{v.current=f.flush}),w.useEffect(()=>()=>{v.current().catch(()=>{}).finally(()=>u.propertyChanged(r.id))},[r.id,u]);const{cropFailedAt:_}=am(r.id),k=Jw(a),S=b$(r.id),j=g$(S,at,e),O=S==null?void 0:S.pages.find(G=>G.home==="property"&&G.key===e),A=w$({registry:at,pageKey:e,facts:p,answer:j$(O,p),refused:!1,onDismissRefusal:()=>{},save:f.saveState(e)});if(!f.ready)return h.jsx("div",{className:Pl,"aria-hidden":"true"});const $=O$(t.declaration,Si(t),p),C=G=>m.findIndex((H,U)=>f.rowId({key:e,index:U})===G),I=async G=>{const H=C(G);if(H<0)return null;const U=await f.storedRowId({key:e,index:H});return U===null?null:{id:U,members:up(e,U,m[H])}},z=c===void 0?-1:C(c.rowId);if(c!==void 0&&z<0)return null;const T={ids:k.ids,control:k.control,idKey:"id",rowId:(G,H)=>f.rowId({key:e,index:H}),held:k.held,onChange:G=>k.onChange(G,I)},F=(G,H)=>{const U=new Set(x.current);if(f.set(e,G),H!=="add")return;const D=G.findIndex(K=>!U.has(K));D<0||k.onAdded(async()=>{const K=await f.storedRowId({key:e,index:D});return K===null?null:{id:K,members:up(e,K,x.current[D])}})},W=h.jsx(du,{propertyId:r.id,listingIntent:r.listingIntent,stageMedia:f.stageMedia,nearPostal:r.postal,cropFailedAt:_,children:h.jsx(au,{slot:$,value:m,onChange:F,propertyId:r.id,instanceId:`facts:${at.home}`,slotId:e,fields:j,...c!==void 0?{record:{index:z,onClose:c.onClose}}:{selection:T}})});return c!==void 0?W:h.jsxs("div",{className:"flex flex-col gap-[12px]",children:[h.jsx(Ms,{surface:x$("editor-table",r.id,e),notices:A}),W]})}return n.displayName=`RegistryTableBody(${e})`,n}const fb=v$([cl("contacts")]);function vae({property:e,saveCycle:t,pick:n,record:r}){const i=sm({propertyId:e.id,lists:fb.landsIn,onSaveBegin:t.begin}),a=Jw(n,()=>i.setRefusal("Couldn’t add this contact to the property. Try again.")),c=u=>async f=>{const p=u.get(f);return p===void 0||!await i.land(f,p)?null:{id:f,members:up("contacts",f,p)}};return r!==void 0?h.jsx(Tu,{from:fb.table,propertyId:e.id,onSaveBegin:t.begin,record:r}):i.tiers===null?h.jsx("div",{className:Pl,"aria-hidden":"true"}):h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(Tu,{from:fb.table,propertyId:e.id,onSaveBegin:t.begin,tiers:i.tiers,selection:{ids:a.ids,control:a.control,held:a.held,pickAdded:!0,onChange:(u,f)=>a.onChange(u,c(f))}}),i.refusal!==null&&h.jsx("p",{role:"alert",className:"text-body text-danger",children:i.refusal})]})}const xae="flex flex-col gap-1.5",wae="flex w-full cursor-pointer items-center gap-3 rounded-lg border border-line bg-white px-3 py-2.5 text-left transition-colors hover:border-ink-4 hover:bg-line-soft disabled:cursor-default disabled:opacity-50 disabled:hover:border-line disabled:hover:bg-white data-[checked]:border-accent",kae="grid size-4 shrink-0 place-items-center rounded-full border border-ink-4 after:size-2 after:rounded-full after:bg-transparent group-data-[checked]:border-accent group-data-[checked]:after:bg-accent",_ae="grid size-4 shrink-0 place-items-center rounded-[calc(4*var(--content))] border border-ink-4 after:size-2 after:rounded-[calc(2*var(--content))] after:bg-transparent group-data-[checked]:border-accent group-data-[checked]:after:bg-accent",Sae=[cl("contacts")],Eae="shrink-0 rounded-full bg-line-soft px-2 py-0.5 text-caption font-medium text-ink-3";function jae({tables:e,property:t,saveCycle:n,pick:r}){const{rows:i,rowOf:a,pending:c}=Kw(e),{land:u,refusal:f,setRefusal:p}=sm({propertyId:t.id,lists:Sae,onSaveBegin:n.begin}),y=Jw(r,()=>p("Couldn’t choose this row. Try again.")),{control:m}=y,x=async _=>{const k=i.find(j=>j.id===_),S=k===void 0?void 0:a(k);return k===void 0||S===void 0||k.table==="contacts"&&!await u(k.id,S.row)?null:{id:k.id,members:up(k.table,k.id,S.row)}},v=_=>{const k=Rx(y.ids,_.id,m,y.held);k!==y.ids&&y.onChange(k,x)};return c?h.jsx("div",{className:Pl,"aria-hidden":"true"}):h.jsxs("div",{className:"flex flex-col gap-3",children:[i.length===0?h.jsx("p",{className:"text-body text-ink-3",children:`Nothing to choose yet. Add ${e.map(gj).join(" or ").toLowerCase()} on the Details tab.`}):h.jsx(h.Fragment,{children:h.jsx("div",{role:m==="radio"?"radiogroup":"group",className:xae,children:i.map(_=>{const k=Bp(y.ids,_.id,y.held);return h.jsxs("button",{type:"button",role:m,"aria-checked":k.checked,"data-checked":k.checked?"":void 0,disabled:k.disabled,className:`group ${wae}`,onClick:()=>v(_),children:[h.jsx("span",{className:m==="radio"?kae:_ae,"aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:h.jsx(f$,{tables:[_.table],rowId:_.id,size:"bar"})}),h.jsx("span",{className:Eae,children:gj(_.table)})]},_.id)})})}),f!==null&&h.jsx("p",{role:"alert",className:"text-body text-danger",children:f})]})}const A$={units:db("units"),comparables:db("comparables"),contacts:vae,commercial_spaces:db("commercial_spaces")};function Oae(e){return e.mode==="multi"?{mode:"multi",selectedIds:e.selectedIds,onChange:e.onChange}:{mode:"single",selectedId:e.selectedId??null,disabledIds:e.disabledIds,onPick:e.onPick}}function Aae(e,t){var i;const n=t.listing_intent,r=t.address;return{id:e,listingIntent:n==="for_sale"||n==="for_rent"?n:null,postal:YD(r)&&((i=en(r))==null?void 0:i.postal)||null}}function C$(){const e=Ee(a=>a.session.property_id),t=kn(),n=So(),r=Rn({queryKey:jl(e),queryFn:()=>t.read(Vw(e)),staleTime:0});return w.useEffect(()=>()=>{t.propertyChanged(e),n.invalidateQueries({queryKey:jl(e)}),n.invalidateQueries({queryKey:$s})},[e,n,t]),{property:r.isFetchedAfterMount&&r.data!==void 0?Aae(e,r.data.facts):void 0,isError:r.isError}}function Cae(e){return e.mode==="record"?e.open?h.jsx(Mae,{tables:e.tables,rowId:e.rowId,onClose:e.onClose}):null:h.jsx(Rae,{...e})}const Nae={mode:"single",selectedId:null,disabledIds:[],onPick:()=>{}};function Mae({tables:e,rowId:t,onClose:n}){const r=C$(),i=Cx(),{rows:a,pending:c}=Kw(e),u=a.find(y=>y.id===t),f=!c&&u===void 0;if(w.useEffect(()=>{f&&n()},[f,n]),u===void 0||r.property===void 0)return null;const p=A$[u.table];return h.jsx(Fp,{status:i,children:h.jsx(p,{property:r.property,saveCycle:i,pick:Nae,record:{rowId:t,onClose:n}})})}function Rae(e){const{open:t,tables:n,onClose:r}=e,i=Cx(),a=C$(),[c]=n,u=n.length>1,{title:f}=Yw([cl(c),...n.slice(1).map(m=>cl(m))]),p=A$[c],y=Oae(e);return h.jsx(Fp,{status:i,children:h.jsx(Mx,{open:t,onClose:r,title:f,children:a.property!==void 0?u?h.jsx(jae,{tables:n,property:a.property,saveCycle:i,pick:y}):h.jsx(p,{property:a.property,saveCycle:i,pick:y}):a.isError?h.jsx("p",{className:"text-body text-danger",role:"alert",children:"Couldn’t load this property’s table. Close and try again."}):h.jsx("div",{className:Pl,"aria-hidden":"true"})})})}function Tae(e,t){return e.filter(n=>{var r;return n.pages.includes(t.page)&&(((r=n.applies)==null?void 0:r.call(n,t))??!0)})}const vd="flex flex-col gap-1 px-3 py-1.5",e1="text-[length:calc(11.5*var(--content))] font-medium text-ink-3",Ol="text-[length:calc(13*var(--content))] text-ink",lm="text-[length:calc(11.5*var(--content))]",$ae=`${lm} text-ink-3`,zs="cursor-pointer rounded-md transition-colors hover:bg-line-soft";function zae({label:e,children:t}){return h.jsxs("div",{className:vd,children:[e===void 0?null:h.jsx("span",{className:e1,children:e}),t]})}const N$=e=>e.replaceAll(" ","-"),Dae={new:"Create",rename:"Rename",duplicate:"Duplicate"};function t1({label:e,entries:t,value:n,onChoose:r,testId:i,placeholder:a="Choose…",changes:c}){const[u,f]=w.useState(!1),[p,y]=w.useState(null),m=w.useId(),x=t.find(j=>j.id===n)??null,v=j=>{j.key!=="Escape"||!u||(j.stopPropagation(),p!==null?y(null):f(!1))},_=j=>{y(O=>O===null||O.kind==="menu"?O:{...O,busy:!0,error:null}),j.then(()=>{y(null),f(!1)},O=>y(A=>A===null||A.kind==="menu"?A:{...A,busy:!1,error:O instanceof Error?O.message:String(O)}))},k=j=>{if(c===void 0||j.busy)return;const O=N$(j.value.trim());j.action==="new"?_(c.onNew(O)):j.action==="rename"?_(c.onRename(j.id,O)):_(c.onDuplicate(j.id,O))},S=j=>h.jsx(Bae,{editing:j,onValue:O=>y({...j,value:O,error:null}),onSubmit:()=>k(j),onCancel:()=>y(null)},`${j.action}-${j.id??""}`);return h.jsxs("div",{className:vd,onKeyDown:v,children:[h.jsx("span",{className:e1,children:e}),h.jsxs("button",{type:"button","data-testid":i,"aria-haspopup":"listbox","aria-expanded":u,"aria-controls":m,className:`flex h-8 w-full items-center justify-between gap-2 border border-line bg-canvas px-2 text-left ${Ol} ${zs}`,onClick:()=>{y(null),f(j=>!j)},children:[h.jsx("span",{className:"min-w-0 truncate",children:(x==null?void 0:x.name)??a}),h.jsx(jt,{name:"chevSelector",size:14,className:"text-ink-3"})]}),u?h.jsxs("div",{id:m,role:"listbox","aria-label":e,className:"flex flex-col gap-0.5",children:[t.map(j=>{const O=j.id===n,A=p!==null&&p.id===j.id;if(A&&(p==null?void 0:p.kind)==="name"&&p.action==="rename")return S(p);const $=A?(p==null?void 0:p.kind)==="menu"?"actions":(p==null?void 0:p.kind)==="confirm"?"confirm":"closed":"closed",C=A&&(p==null?void 0:p.kind)==="confirm"?p:null;return h.jsxs("div",{className:"flex flex-col gap-0.5",children:[h.jsx(Fae,{entry:j,selected:O,actions:c===void 0?null:Lae,mode:$,deleteQuestion:(c==null?void 0:c.deleteQuestion(j.id))??"",busy:(C==null?void 0:C.busy)??!1,onChoose:()=>{f(!1),y(null),O||r(j.id)},onActions:()=>y($==="actions"?null:{kind:"menu",id:j.id}),onDelete:()=>c!==void 0&&_(c.onDelete(j.id)),onCancel:()=>y(null),onAction:I=>{y(I==="rename"?{kind:"name",action:"rename",id:j.id,value:j.name,error:null,busy:!1}:I==="duplicate"?{kind:"name",action:"duplicate",id:j.id,value:`${j.name}-copy`,error:null,busy:!1}:{kind:"confirm",id:j.id,error:null,busy:!1})}}),C===null?null:h.jsx(M$,{error:C.error}),A&&(p==null?void 0:p.kind)==="name"&&p.action==="duplicate"?S(p):null]},j.id)}),c===void 0?null:(p==null?void 0:p.kind)==="name"&&p.action==="new"?S(p):h.jsxs("button",{type:"button","data-testid":`${i}-new`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left text-ink-2 ${Ol} ${zs}`,onClick:()=>y({kind:"name",action:"new",id:null,value:"",error:null,busy:!1}),children:[h.jsx(jt,{name:"plus",size:14}),c.newLabel]})]}):null]})}const Lae=[{action:"rename",icon:"pencil",label:"Rename"},{action:"duplicate",icon:"copy",label:"Duplicate"},{action:"delete",icon:"trash",label:"Delete"}],oh="transition-[translate,rotate,opacity] duration-300 ease-settle motion-reduce:transition-none",Iae=35,Uae=90,dp=`group/tip flex size-7 flex-shrink-0 items-center justify-center text-ink-3 hover:text-ink disabled:cursor-default disabled:opacity-50 ${zs}`,Pae=`h-8 min-w-0 flex-1 rounded-md border border-line bg-canvas px-2 ${Ol} transition-colors focus:border-accent disabled:opacity-60`,eA=`group/tip relative flex h-7 flex-shrink-0 items-center rounded-md px-2.5 ${lm} font-medium cursor-pointer transition-colors disabled:cursor-default disabled:opacity-60`;function hu({label:e,align:t="center",id:n,testId:r}){const i=t==="center"?"left-1/2 -translate-x-1/2 whitespace-nowrap":"right-0 w-max max-w-[calc(220*var(--frame))] text-right";return h.jsx("span",{id:n,"aria-hidden":"true","data-testid":r,className:`pointer-events-none absolute bottom-full z-10 mb-1 ${i} rounded-md bg-ink px-1.5 py-0.5 ${lm} font-medium text-canvas opacity-0 transition-opacity delay-0 group-hover/tip:opacity-100 group-hover/tip:delay-300 group-focus-visible/tip:opacity-100`,children:e})}function Fae({entry:e,selected:t,actions:n,mode:r,deleteQuestion:i,busy:a,onChoose:c,onActions:u,onAction:f,onDelete:p,onCancel:y}){const m=(n==null?void 0:n.length)??0,x=r!=="closed",v=r==="actions",_=r==="confirm",k=w.useId();return h.jsxs("div",{className:"relative flex items-center","data-entry-row":e.id,"data-actions-open":v,"data-confirming":_,style:{"--entry-actions":m},children:[h.jsxs("button",{type:"button",role:"option","aria-selected":t,"data-entry":e.id,"data-open":x,className:`flex h-8 min-w-0 flex-1 items-center gap-2 px-2 text-left ${zs} ${n===null?"":"pr-9 transition-[padding] duration-300 ease-settle motion-reduce:transition-none data-[open=true]:pr-[calc((var(--entry-actions)*7.5+8.5)*var(--spacing))]"}`,onClick:c,children:[h.jsx("span",{className:`truncate ${Ol} ${t?"font-semibold":""}`,children:e.name}),e.mark===void 0?null:h.jsx("span",{className:`flex-shrink-0 ${$ae}`,"data-testid":"entry-mark",children:e.mark}),t?h.jsx(jt,{name:"check",size:14,stroke:2.4,className:"ml-auto flex-shrink-0 text-accent"}):null]}),n===null?null:h.jsxs(h.Fragment,{children:[h.jsx("div",{role:"menu","aria-label":`Actions for ${e.name}`,inert:!v,"data-testid":"entry-actions",className:"absolute right-0 flex gap-0.5",children:n.map(({action:S,icon:j,label:O},A)=>h.jsxs("button",{type:"button",role:"menuitem","aria-label":O,"data-action":S,"data-open":v,className:`${dp} ${oh} relative translate-x-3 opacity-0 data-[open=true]:translate-x-0 data-[open=true]:opacity-100`,style:{transitionDelay:`${String((v?A:m-1-A)*Iae)}ms`},onClick:()=>f(S),children:[h.jsx(jt,{name:j,size:14}),h.jsx(hu,{label:O,align:A===m-1?"end":"center"})]},S))}),h.jsxs("div",{inert:!_,"data-testid":"entry-confirm","data-open":_,className:`absolute right-0 flex gap-1 ${oh} translate-x-3 opacity-0 data-[open=true]:translate-x-0 data-[open=true]:opacity-100`,style:{transitionDelay:`${String(_?Uae:0)}ms`},children:[h.jsxs("button",{type:"button","data-testid":"entry-delete","aria-describedby":k,disabled:a,className:`${eA} bg-danger text-canvas hover:bg-[color-mix(in_oklab,var(--color-danger)_88%,black)]`,onClick:p,children:["Delete",h.jsx(hu,{label:i,align:"end",id:k,testId:"entry-delete-question"})]}),h.jsx("button",{type:"button","data-testid":"entry-cancel",disabled:a,className:`${eA} text-ink-2 hover:bg-line-soft hover:text-ink`,onClick:y,children:"Cancel"})]}),h.jsxs("button",{type:"button","aria-label":`Actions for ${e.name}`,"aria-expanded":v,inert:_,"data-testid":"entry-menu","data-open":x,"data-confirming":_,className:`${dp} ${oh} absolute right-0 data-[open=true]:-translate-x-[calc(var(--entry-actions)*7.5*var(--spacing))] data-[confirming=true]:opacity-0`,onClick:u,children:[h.jsx(Cp,{"aria-hidden":"true",strokeWidth:2,className:`size-[calc(15*var(--content))] ${oh} group-data-[open=true]/tip:rotate-180`}),h.jsx(hu,{label:v?"Close":"Actions",align:"end"})]})]})]})}function M$({error:e}){return e===null?null:h.jsx("p",{role:"alert","data-testid":"entry-error",className:`px-2 ${lm} whitespace-pre-wrap text-danger`,children:e})}function Bae({editing:e,onValue:t,onSubmit:n,onCancel:r}){const i=c=>{c.key==="Enter"?(c.preventDefault(),n()):c.key==="Escape"&&(c.stopPropagation(),r())},a=Dae[e.action];return h.jsxs("form",{className:"hp-rest-in flex flex-col gap-1","data-testid":"entry-name",onSubmit:c=>{c.preventDefault(),n()},children:[h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx("input",{autoFocus:!0,"aria-label":"Name","aria-invalid":e.error!==null,placeholder:"Name",value:e.value,disabled:e.busy,spellCheck:!1,autoComplete:"off",className:`${Pae} mr-0.5 placeholder:text-ink-4 aria-[invalid=true]:border-danger`,onChange:c=>t(N$(c.target.value)),onKeyDown:i}),h.jsxs("button",{type:"submit","aria-label":a,"data-testid":"entry-name-submit",disabled:e.busy,className:`${dp} relative`,children:[h.jsx(jt,{name:"check",size:15,stroke:2.2,className:"text-accent"}),h.jsx(hu,{label:a})]}),h.jsxs("button",{type:"button","aria-label":"Cancel",disabled:e.busy,className:`${dp} relative`,onClick:r,children:[h.jsx(jt,{name:"x",size:15}),h.jsx(hu,{label:"Cancel",align:"end"})]})]}),h.jsx(M$,{error:e.error})]})}function Hae({label:e,on:t,onChange:n,testId:r}){return h.jsx("div",{className:vd,children:h.jsxs("button",{type:"button",role:"switch","aria-checked":t,"data-testid":r,className:`-mx-1 flex items-center justify-between gap-3 px-1 py-0.5 text-left ${Ol} ${zs}`,onClick:()=>n(!t),children:[h.jsx("span",{children:e}),h.jsx("span",{"aria-hidden":"true","data-on":t,className:"relative h-4.5 w-8 flex-shrink-0 rounded-full bg-line-strong transition-colors data-[on=true]:bg-accent",children:h.jsx("span",{"data-on":t,className:"absolute top-0.5 left-0.5 size-3.5 rounded-full bg-canvas shadow-sm transition-transform ease-settle data-[on=true]:translate-x-3.5"})})]})})}function qae({label:e,entries:t,value:n,onChoose:r,testId:i}){return h.jsxs("div",{className:vd,children:[h.jsx("span",{className:e1,children:e}),h.jsx("div",{role:"radiogroup","aria-label":e,"data-testid":i,className:"flex gap-0.5 rounded-lg bg-line-soft p-0.5",children:t.map(a=>{const c=a.id===n;return h.jsx("button",{type:"button",role:"radio","aria-checked":c,"data-on":c,"data-testid":`${i}-${a.id}`,className:"flex-1 cursor-pointer rounded-md px-2 py-1 text-[length:calc(12.5*var(--content))] font-medium text-ink-3 transition-colors hover:text-ink data-[on=true]:bg-canvas data-[on=true]:text-ink data-[on=true]:shadow-sm",onClick:()=>{c||r(a.id)},children:a.name},a.id)})})]})}function Vae({title:e,count:t,onOpen:n}){return h.jsx("div",{className:vd,children:h.jsxs("button",{type:"button",className:`-mx-1 flex items-center justify-between gap-3 px-1 py-0.5 text-left ${Ol} ${zs}`,onClick:n,children:[h.jsxs("span",{className:"flex items-center gap-2",children:[e,t===void 0?null:h.jsx("span",{"data-testid":"control-page-count",className:`${R$} bg-line-soft text-ink-2`,children:t})]}),h.jsx(jt,{name:"chevRight",size:14,className:"text-ink-3"})]})})}const R$="inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[length:calc(11*var(--content))] font-semibold tabular-nums";function Zae({title:e,onBack:t,children:n}){return h.jsxs("div",{className:"flex flex-col","data-testid":"control-page",children:[h.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line-soft px-2 py-2",children:[h.jsx("button",{type:"button","aria-label":"Back","data-testid":"control-back",className:`flex size-7 items-center justify-center text-ink-2 ${zs}`,onClick:t,children:h.jsx(jt,{name:"arrowLeft",size:15})}),h.jsx("h2",{className:"text-[length:calc(13*var(--content))] font-semibold text-ink",children:e})]}),n]})}const hb={corner:"top-left",open:!1},fp=40,ih=16,T$="concrete-playground:control",Kae=["top-left","top-right","bottom-left","bottom-right"];function tA(){try{return window.localStorage}catch{return null}}function Gae(e){try{const t=e==null?void 0:e.getItem(T$);if(!t)return hb;const n=JSON.parse(t);return{corner:Kae.find(i=>i===n.corner)??hb.corner,open:n.open===!0}}catch{return hb}}function Yae(e,t){try{e==null||e.setItem(T$,JSON.stringify(t))}catch{}}function Qae(e,t){const n=e.y<t.height/2,r=e.x<t.width/2;return n?r?"top-left":"top-right":r?"bottom-left":"bottom-right"}function nA(e,t){const n=r=>Math.max(ih,r-ih-fp);return{x:e.endsWith("left")?ih:n(t.width),y:e.startsWith("top")?ih:n(t.height)}}function rA(e,t){const n=(r,i)=>Math.min(Math.max(0,r),Math.max(0,i-fp));return{x:n(e.x,t.width),y:n(e.y,t.height)}}const Xae=100,oA=500;function Wae(e,t){const n=e.find(i=>t.at-i.at<=Xae&&i.at<t.at);if(n===void 0)return{x:0,y:0};const r=t.at-n.at;return{x:(t.x-n.x)/r,y:(t.y-n.y)/r}}function Jae(e,t,n){return Qae({x:e.x+t.x*oA,y:e.y+t.y*oA},n)}const ele=4,$$="fixed z-40",tle={"top-left":"left-[16px] top-[64px]","top-right":"right-[16px] top-[64px]","bottom-left":"left-[16px] bottom-[64px]","bottom-right":"right-[16px] bottom-[64px]"},nle="shadow-[0_1px_0_rgba(20,18,13,0.04),0_24px_60px_-20px_rgba(20,18,13,0.22),0_6px_18px_-8px_rgba(20,18,13,0.10)]",rle=[`${$$} top-0 left-0 flex size-10 cursor-pointer touch-none select-none items-center justify-center rounded-full border border-line bg-canvas text-ink-2 hover:text-ink`,"shadow-[0_1px_2px_rgba(20,18,13,0.04),0_8px_20px_-12px_rgba(20,18,13,0.18)]","transition-[translate,scale,color] duration-[420ms,120ms,150ms] ease-[cubic-bezier(0.2,1.25,0.35,1),var(--ease-settle),var(--ease-settle)]","active:scale-[0.92] data-[pressed=true]:scale-[0.92]","data-[dragging=true]:cursor-grabbing data-[dragging=true]:duration-[0ms,120ms,150ms]"].join(" "),ole=8;function iA(){return{width:window.innerWidth,height:window.innerHeight}}function ile(){const[e,t]=w.useState(iA);return w.useEffect(()=>{const n=()=>t(iA());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function sle(e,t,n){w.useEffect(()=>{if(!e)return;const r=a=>{var c;(c=t.current)!=null&&c.contains(a.target)||n()},i=()=>{window.setTimeout(()=>{var a;((a=document.activeElement)==null?void 0:a.tagName)==="IFRAME"&&n()},0)};return document.addEventListener("pointerdown",r,!0),window.addEventListener("blur",i),()=>{document.removeEventListener("pointerdown",r,!0),window.removeEventListener("blur",i)}},[e,t,n])}function ale({sections:e,context:t}){const[n,r]=w.useState(()=>Gae(tA())),[i,a]=w.useState(null),[c,u]=w.useState(!1),[f,p]=w.useState(null),y=ile(),m=w.useRef(null),x=w.useRef(!1),v=w.useRef(null),_=w.useRef(null),k=w.useId();w.useEffect(()=>Yae(tA(),n),[n]);const S=D=>r(K=>({...K,open:D})),j=w.useCallback(()=>r(D=>D.open?{...D,open:!1}:D),[]);sle(n.open,_,j);const O=i??nA(n.corner,y),A=(D,K)=>({x:D.clientX-K.pointer.x,y:D.clientY-K.pointer.y}),$=D=>({x:D.clientX,y:D.clientY,at:D.timeStamp}),C=D=>{var K,M;D.button===0&&(x.current=!1,u(!0),m.current={pointer:{x:D.clientX,y:D.clientY},origin:nA(n.corner,y),moved:!1,samples:[$(D)]},(M=(K=D.currentTarget).setPointerCapture)==null||M.call(K,D.pointerId))},I=D=>{const K=m.current;if(K===null)return;const M=A(D,K);K.samples=[...K.samples.slice(1-ole),$(D)],!(!K.moved&&Math.hypot(M.x,M.y)<ele)&&(K.moved=!0,a(rA({x:K.origin.x+M.x,y:K.origin.y+M.y},y)))},z=D=>{const K=m.current;if(m.current=null,u(!1),K===null||!K.moved)return;x.current=!0;const M=A(D,K),B=rA({x:K.origin.x+M.x,y:K.origin.y+M.y},y),X=Jae({x:B.x+fp/2,y:B.y+fp/2},Wae(K.samples,$(D)),y);r(se=>({...se,corner:X})),a(null)},T=()=>{m.current=null,u(!1),a(null)},F=D=>{if(x.current&&D.detail!==0){x.current=!1;return}S(!n.open)},W=D=>{var K;D.key!=="Escape"||!n.open||(S(!1),(K=v.current)==null||K.focus())},G=Tae(e,t),H=t.problems.length,U=G.find(D=>D.shape==="page"&&D.id===f)??null;return h.jsxs("div",{ref:_,"data-testid":"playground-control","data-corner":n.corner,onKeyDown:W,children:[h.jsxs("button",{ref:v,type:"button","aria-label":H===0?"Playground":`Playground, ${String(H)} ${H===1?"problem":"problems"}`,"aria-expanded":n.open,"aria-controls":k,"data-testid":"control-button","data-dragging":i!==null,"data-pressed":c,className:rle,style:{translate:`${String(O.x)}px ${String(O.y)}px`},onPointerDown:C,onPointerMove:I,onPointerUp:z,onPointerCancel:T,onClick:F,children:[h.jsx(jt,{name:"settings",size:18,stroke:1.7}),H===0?null:h.jsx("span",{"data-testid":"control-count",className:`${R$} absolute -top-1 -right-1 bg-danger text-canvas ring-2 ring-canvas`,children:H})]}),n.open?h.jsx("div",{id:k,role:"region","aria-label":"Playground","data-testid":"control-container",className:`${$$} ${tle[n.corner]} flex max-h-[calc(100dvh-80px)] w-[calc(288*var(--frame))] flex-col overflow-y-auto rounded-lg border border-line bg-canvas text-ink ${nle}`,children:U!==null?h.jsx(Zae,{title:U.title,onBack:()=>p(null),children:h.jsx(U.Page,{context:t})}):G.length===0?h.jsx("p",{className:"px-3 py-2.5 text-[length:calc(12.5*var(--content))] text-ink-3",children:"Nothing to change on this page."}):h.jsx("div",{className:"flex flex-col py-1",children:G.map(D=>{var K;return h.jsx("div",{"data-control-section":D.id,children:D.shape==="row"?h.jsx(D.Row,{context:t}):h.jsx(Vae,{title:D.title,count:(K=D.count)==null?void 0:K.call(D,t),onOpen:()=>p(D.id)})},D.id)})})}):null]})}const Zv={refused:null,also:[]};function z$(){let e=Zv;const t=new Set,n=i=>{e=i;for(const a of t)a()};return{saved:(i,a)=>n({refused:null,also:a.filter(c=>c.name!==i).map(c=>c.name)}),refused:i=>n({refused:i instanceof Error?i.message:String(i),also:[]}),dismiss:()=>n(Zv),subscribe:i=>(t.add(i),()=>t.delete(i)),current:()=>e}}const lle={subscribe:()=>()=>{},current:()=>Zv};function Kv(e){const t=e??lle;return w.useSyncExternalStore(t.subscribe,t.current)}function cle(e){return`${e.what}${e.file===null?"":`: ${e.file}`}
|
|
1334
|
-
${e.message}`}function ule(e){return e.map(cle).join(`
|
|
1335
|
-
|
|
1336
|
-
`)}function dle(e){if(e.kind==="template")return{source:"host",what:"Template",file:e.file,message:e.message};if(e.kind==="job"){const n=[e.subject.property,e.subject.fixture,e.subject.format].filter(r=>r!==void 0).join(" · ");return{source:"host",what:"Failed job",file:null,message:`${e.operation}${n===""?"":` on ${n}`} (${e.job}): ${e.message}`}}return{source:"host",what:"Fixture",file:e.line===void 0?e.file:`${e.file}:${String(e.line)}`,message:`${e.message} (${e.rule})`}}function fle(e,t){const[n,r]=w.useState([]);return w.useEffect(()=>{if(t===null)return;let i=!0;return e.problems().then(a=>{i&&r(a.problems.map(dle))},a=>{i&&r([{source:"host",what:"Playground",file:null,message:`The problems could not be read: ${a instanceof Error?a.message:String(a)}`}])}),()=>{i=!1}},[e,t]),n}function hle(e,t,n){const r=fle(e,t),{canvas:i,facts:a}=n,{refused:c}=Kv(i),{refused:u}=Kv(a),[f,p]=w.useState(new Map),y=w.useCallback((x,v)=>{p(_=>{if(v.length===0&&!_.has(x))return _;const k=new Map(_);return v.length===0?k.delete(x):k.set(x,v),k})},[]);return{problems:w.useMemo(()=>{const x=c===null||i===null?[]:[{source:"save",what:"Refused save",file:null,message:c,dismiss:i.dismiss}],v=u===null?[]:[{source:"facts-save",what:"Refused save",file:null,message:u,dismiss:a.dismiss}],_=[...f].flatMap(([k,S])=>S.map(j=>({...j,source:k})));return[...r,...x,...v,..._]},[r,c,i,u,a,f]),report:y}}const sA=7,ple="ladder";function hr(e){const t=new URLSearchParams;for(const[r,i]of Object.entries(e))i!=null&&i!==""&&t.set(r,i);const n=t.toString();return n===""?"":`?${n}`}const $u={site:"site",download:"download"};function mle(e){const[t,n,r,i,a,...c]=e.split("/");if(t!=="properties"||r!=="content"||n===void 0||n===""||i===void 0||i===""||a!==$u.site&&a!==$u.download)return null;try{return{property:decodeURIComponent(n),fixture:decodeURIComponent(i),output:a,rest:c.map(decodeURIComponent)}}catch{return null}}const qt={catalog:"api/catalog",problems:"api/problems",render:"api/render",save:"api/save",library:"api/library",fixtures:"api/fixtures",upload:e=>{const{target:t}=e;return`api/upload${hr({property:"property"in t?t.property:null,fixture:"fixture"in t?t.fixture:null,name:e.name,list:"list"in t?t.list:null,owner:"owner"in t?t.owner:null,instance:"instance"in t?t.instance:null,slot:"slot"in t?t.slot:null})}`},media:e=>`api/media${hr({property:e})}`,owned:e=>`api/owned${hr({fixture:e})}`,bootstrap:(e,t)=>`api/bootstrap${hr({fixture:e,format:t})}`,requirements:e=>`api/requirements${hr({fixture:e})}`,propertyRequirements:e=>`api/requirements${hr({property:e})}`,facts:(e,t)=>`api/facts${hr({property:e,home:t})}`,canvas:(e,t,n,r)=>`properties/${encodeURIComponent(e)}/content/${encodeURIComponent(t)}/${n===null?"canvas":`canvas/${encodeURIComponent(n)}`}${hr({format:r})}`,live:(e,t,n)=>`properties/${encodeURIComponent(e)}/content/${encodeURIComponent(t)}/live${n==="/"?"":`/${encodeURIComponent(n.slice(1))}`}`,leads:"api/leads/ingest",output:(e,t,n)=>`properties/${encodeURIComponent(e)}/content/${encodeURIComponent(t)}/${n==="website"?$u.site:$u.download}/`,download:(e,t,n={})=>`${qt.output(e,t,"image").slice(0,-1)}${n.page===void 0||n.page===null?"":`/${encodeURIComponent(n.page)}.png`}${hr({format:n.format})}`,site:(e,t,n)=>`${qt.output(e,t,"website")}${n==="/"?"":`${n.slice(1)}/`}`,build:"build/",jobs:"api/jobs",job:(e,t)=>`api/jobs/${encodeURIComponent(e)}${hr({wait:t===void 0?null:String(t)})}`,probe:e=>`api/probe${hr({fixture:e})}`,verify:"api/verify",changes:"__changes"},pb={files:"files",job:"job"};function n1(e){return(e==null?void 0:e.page)==="canvas"||(e==null?void 0:e.page)==="live"}function D$(e,t){const n=new URL(t).pathname,r=n.endsWith("/")?n:`${n}/`;return`${e}/`===r?"":e.startsWith(r)?e.slice(r.length):null}function gle(e,t){const[n,r,i,a,c,u,...f]=e.split("/").filter(Boolean).map(decodeURIComponent);return n!=="properties"||r===void 0?null:i===void 0?{page:"property",property:r}:i==="facts"&&a===void 0?{page:"facts",property:r}:i!=="content"||a===void 0||f.length>0?null:c==="live"?{page:"live",property:r,fixture:a,pagePath:u===void 0?"/":`/${u}`}:c!=="canvas"?null:{page:"canvas",property:r,fixture:a,canvasId:u??null,format:new URLSearchParams(t).get("format")}}function tu(e){const t=`properties/${encodeURIComponent(e.property)}`;return n1(e)?e.page==="live"?qt.live(e.property,e.fixture,e.pagePath):qt.canvas(e.property,e.fixture,e.canvasId,e.format):e.page==="facts"?`${t}/facts`:t}function Ka(e,t,n){return(n==null?void 0:n.page)==="live"?{page:"live",property:e,fixture:t,pagePath:n.pagePath}:{page:"canvas",property:e,fixture:t,canvasId:(n==null?void 0:n.canvasId)??null,format:(n==null?void 0:n.format)??null}}function zu(e,t,n){var i;const r=e.content[0];return r===void 0?{page:"facts",property:e.name}:(n==null?void 0:n.page)==="live"?Ka(e.name,r.name,n):{page:"canvas",property:e.name,fixture:r.name,canvasId:(n==null?void 0:n.canvasId)??((i=t.template.canvases[0])==null?void 0:i.id)??null,format:(n==null?void 0:n.format)??null}}const mb=e=>e.map(t=>t.name).join(", ")||"none";function yle(e,t){const{properties:n}=t;if(e===null){const c=n[0];return c===void 0?{kind:"none"}:{kind:"replace",view:zu(c,t)}}const r=n.find(c=>c.name===e.property);if(!n1(e))return r===void 0?{kind:"unknown",message:`There is no property "${e.property}" (have: ${mb(n)}).`}:e.page==="property"?{kind:"replace",view:zu(r,t)}:{kind:"view",view:e};const i=r==null?void 0:r.content.find(c=>c.name===e.fixture);if(i!==void 0){if(e.page==="canvas")return{kind:"view",view:e};const c=ble(t.template,i,e.pagePath);return c===null?{kind:"replace",view:{page:"canvas",property:e.property,fixture:e.fixture,canvasId:null,format:null}}:c===e.pagePath?{kind:"view",view:e}:{kind:"replace",view:{...e,pagePath:c}}}const a=n.find(c=>c.content.some(u=>u.name===e.fixture));return a!==void 0?{kind:"replace",view:{...e,property:a.name}}:r===void 0?{kind:"unknown",message:`There is no property "${e.property}" (have: ${mb(n)}).`}:{kind:"unknown",message:`There is no content fixture "${e.fixture}" on "${r.name}" (have: ${mb(r.content)}).`}}function ble(e,t,n){var i;if(e.output!=="website")return null;const r=e.pages.filter(a=>a.path!==void 0&&!(t.pagesOff??[]).includes(a.id));return((i=r.find(a=>a.path===n)??r[0])==null?void 0:i.path)??null}function Gv(e,t){var r,i;const n=(r=e.canvases.find(a=>a.id===t)??e.canvases[0])==null?void 0:r.pages[0];return((i=e.pages.find(a=>a.id===n))==null?void 0:i.path)??"/"}function vle(e,t,n,r){var u;const{at:i}=t;if(i===null)return null;const a=(n==null?void 0:n.page)==="canvas"?{page:"canvas",canvasId:n.canvasId,format:n.format}:(n==null?void 0:n.page)==="live"?{page:"live",pagePath:n.pagePath}:void 0;if(e.op==="new"&&e.kind==="property")return{page:"facts",property:i.property};if(e.op==="rename"&&e.kind==="property"&&(n==null?void 0:n.property)===e.name)return{...n,property:i.property};if(i.content!==void 0)return Ka(i.property,i.content,a??{page:"canvas",canvasId:((u=r.template.canvases[0])==null?void 0:u.id)??null,format:null});const c=t.properties.find(f=>f.name===i.property);return c===void 0?null:zu(c,r,a)}function xle(e,t){if((t==null?void 0:t.kind)==="replace")return e;if((t==null?void 0:t.kind)!=="view")return null;const{view:n}=t;return n.page==="canvas"?e!==null&&wle(e,n)?e:n:e!==null&&e.property===n.property?e:null}function wle(e,t){return e.property===t.property&&e.fixture===t.fixture&&e.canvasId===t.canvasId&&e.format===t.format}function L$({catalog:e,view:t}){const n=(e==null?void 0:e.template.formats)??[],r=(t==null?void 0:t.page)==="canvas"?t.format:null;return n.find(i=>i.id===r)??n[0]??null}function I$({view:e,opened:t}){if((e==null?void 0:e.page)==="live")return{page:"live",pagePath:e.pagePath};if((e==null?void 0:e.page)==="canvas")return{page:"canvas",canvasId:(t==null?void 0:t.store.getState().currentCanvasId)??e.canvasId,format:e.format}}function U$({catalog:e,view:t}){const n=e==null?void 0:e.properties.find(a=>a.name===(t==null?void 0:t.property));if(e===null||n===void 0)return[];const r=n.content.length>0,i=[];return r&&i.push({id:"canvas",name:"Canvas"}),i.push({id:"facts",name:"Facts"}),r&&e.template.output==="website"&&i.push({id:"live",name:"Live"}),i}function kle({opened:e},t){return e===null||e.property!==t?null:{page:"canvas",property:t,fixture:e.fixture,canvasId:e.store.getState().currentCanvasId,format:e.format}}function _le({context:e}){const{catalog:t,view:n,page:r,opened:i,onView:a}=e,c=U$(e),u=r==="canvas"||r==="live"||r==="facts"?r:null,f=p=>{var m,x;if(t===null||n===null||p===u)return;const{template:y}=t;if(p==="facts")a({page:"facts",property:n.property});else if(n.page==="canvas"&&p==="live"){const v=Gv(y,(i==null?void 0:i.store.getState().currentCanvasId)??n.canvasId);a(Ka(n.property,n.fixture,{page:"live",pagePath:v}))}else if(n.page==="live"&&p==="canvas"){const v=(m=y.pages.find(k=>k.path===n.pagePath))==null?void 0:m.id,_=((x=y.canvases.find(k=>v!==void 0&&k.pages.includes(v)))==null?void 0:x.id)??null;a(Ka(n.property,n.fixture,{page:"canvas",canvasId:_,format:null}))}else if(n.page==="property"||n.page==="facts"){const v=kle(e,n.property),_=t.properties.find(k=>k.name===n.property);v!==null&&p==="canvas"?a(v):v!==null&&p==="live"?a(Ka(v.property,v.fixture,{page:"live",pagePath:Gv(y,v.canvasId)})):_!==void 0&&a(zu(_,t,p==="live"?{page:"live",pagePath:"/"}:void 0))}};return h.jsx(qae,{label:"Page",testId:"page-switch",entries:c,value:u,onChoose:f})}function Sle(e){const t=e.content.map(r=>r.name);if(t.length===0)return`Delete ${e.name}?`;if(t.length===1)return`Delete ${e.name} and its content fixture ${t[0]}?`;const n=`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`;return`Delete ${e.name} and its ${String(t.length)} content fixtures, ${n}?`}function Ele({context:e}){const{catalog:t,view:n,onView:r,onFixtures:i}=e,a=(t==null?void 0:t.properties)??[],c=a.map(f=>({id:f.name,name:f.name,...f.progress===void 0?{}:{mark:f.progress.label}})),u=i===null?void 0:{newLabel:"New property",onNew:f=>i({op:"new",kind:"property",name:f}),onRename:(f,p)=>i({op:"rename",kind:"property",name:f,to:p}),onDuplicate:(f,p)=>i({op:"duplicate",kind:"property",name:f,to:p}),onDelete:f=>i({op:"delete",kind:"property",name:f}),deleteQuestion:f=>{const p=a.find(y=>y.name===f);return p===void 0?`Delete ${f}?`:Sle(p)}};return h.jsx(t1,{label:"Property",testId:"property-picker",entries:c,value:(n==null?void 0:n.property)??null,placeholder:c.length===0?"None yet":"Choose…",onChoose:f=>{const p=a.find(y=>y.name===f);p===void 0||t===null||r((n==null?void 0:n.page)==="facts"?{page:"facts",property:p.name}:zu(p,t,I$(e)))},...u===void 0?{}:{changes:u}})}function jle({context:e}){const{catalog:t,view:n,onView:r,onFixtures:i}=e,a=t==null?void 0:t.properties.find(f=>f.name===(n==null?void 0:n.property)),c=((a==null?void 0:a.content)??[]).map(f=>({id:f.name,name:f.name,...f.progress===void 0?{}:{mark:f.progress.label}})),u=i===null||a===void 0?void 0:{newLabel:"New content fixture",onNew:f=>i({op:"new",kind:"content",name:f,property:a.name}),onRename:(f,p)=>i({op:"rename",kind:"content",name:f,to:p}),onDuplicate:(f,p)=>i({op:"duplicate",kind:"content",name:f,to:p}),onDelete:f=>i({op:"delete",kind:"content",name:f}),deleteQuestion:f=>`Delete ${f}?`};return h.jsx(t1,{label:"Content",testId:"content-picker",entries:c,value:(n==null?void 0:n.page)==="canvas"||(n==null?void 0:n.page)==="live"?n.fixture:null,placeholder:c.length===0?"None on this property":"Choose…",onChoose:f=>{a!==void 0&&r(Ka(a.name,f,I$(e)))},...u===void 0?{}:{changes:u}})}function Ole({context:e}){var c;const{catalog:t,view:n,opened:r,onView:i}=e,a=((t==null?void 0:t.template.formats)??[]).map(u=>({id:u.id,name:u.id}));return h.jsx(t1,{label:"Format",testId:"format-switcher",entries:a,value:((c=L$(e))==null?void 0:c.id)??null,onChoose:u=>{(n==null?void 0:n.page)==="canvas"&&i({...n,format:u,canvasId:(r==null?void 0:r.store.getState().currentCanvasId)??n.canvasId})}})}function Ale({context:{guides:e,onGuides:t}}){return h.jsx(Hae,{label:"Trim & bleed guides",testId:"guides-toggle",on:e,onChange:t})}function Cle({context:{page:e,opened:t,factsSave:n}}){const r=e==="facts",i=Kv(r?n.notes:(t==null?void 0:t.notes)??null);return!r&&t===null?null:h.jsx(zae,{children:h.jsxs("div",{className:"flex flex-col gap-1","data-testid":"save-status",children:[r?h.jsx(Nx,{status:n.status}):h.jsx(Pie,{}),i.also.length>0?h.jsxs("p",{className:"text-[length:calc(12*var(--content))] text-ink-3","data-testid":"save-also",children:["Also changed: ",i.also.join(", ")]}):null]})})}function Nle({context:{problems:e}}){const[t,n]=w.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(ule(e)).then(()=>n(!0))};return h.jsxs("div",{className:"flex flex-col","data-testid":"problems",children:[h.jsx("ol",{className:"flex flex-col divide-y divide-line-soft",children:e.map((i,a)=>h.jsxs("li",{className:"flex items-start gap-2 px-3 py-2.5","data-problem":i.source,children:[h.jsxs("pre",{className:"min-w-0 flex-1 select-text whitespace-pre-wrap break-words font-sans text-[length:calc(12*var(--content))] text-ink",children:[h.jsx("span",{className:"font-semibold",children:i.what}),i.file===null?null:h.jsxs("span",{className:"text-ink-3",children:[": ",i.file]}),`
|
|
1337
|
-
`,i.message]}),i.dismiss===void 0?null:h.jsx("button",{type:"button","aria-label":"Dismiss","data-testid":"problem-dismiss",className:"cursor-pointer text-ink-3",onClick:i.dismiss,children:"×"})]},`${i.source}-${String(a)}`))}),h.jsx("div",{className:"border-t border-line-soft px-3 py-2",children:h.jsx("button",{type:"button","data-testid":"problems-copy",className:"cursor-pointer text-[length:calc(12*var(--content))] font-medium text-accent",onClick:r,children:t?"Copied":"Copy all"})})]})}function P$({catalog:e}){return e!==null&&e.error===void 0&&e.capabilities.save}const aA=e=>{var t;return P$(e)&&(((t=e.catalog)==null?void 0:t.properties.length)??0)>0},Mle=[{id:"problems",shape:"page",title:"Problems",pages:["canvas","facts","live","message"],applies:({problems:e})=>e.length>0,count:({problems:e})=>e.length,Page:Nle},{id:"page-switch",shape:"row",pages:["canvas","facts","live","message"],applies:e=>aA(e)&&U$(e).length>0,Row:_le},{id:"property",shape:"row",pages:["canvas","facts","live","message"],applies:P$,Row:Ele},{id:"content",shape:"row",pages:["canvas","facts","live","message"],applies:aA,Row:jle},{id:"format",shape:"row",pages:["canvas"],applies:({catalog:e})=>((e==null?void 0:e.template.formats.length)??0)>1,Row:Ole},{id:"guides",shape:"row",pages:["canvas"],applies:e=>{var t;return(((t=L$(e))==null?void 0:t.bleed)??0)>0},Row:Ale},{id:"save-status",shape:"row",pages:["canvas","facts"],applies:({page:e,opened:t})=>e==="facts"||t!==null,Row:Cle}];function Rle(e){var n,r;if(e===null)return null;const t=/filename\*=UTF-8''([^;]+)/i.exec(e);if(t)try{return decodeURIComponent(t[1].trim())}catch{return null}return((r=(n=/filename="?([^";]+)"?/i.exec(e))==null?void 0:n[1])==null?void 0:r.trim())??null}async function sh(e,t){const n=(await t.text().catch(()=>"")).trim();return new Error(n===""?`${e}: HTTP ${t.status}`:n)}function Tle(e,t=(n,r)=>fetch(n,r)){const n=a=>new URL(a,e).href,r=async a=>{const c=await t(n(a));if(!c.ok)throw await sh(a,c);return await c.json()},i=async(a,c)=>{const u=await t(n(a),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c)});if(!u.ok)throw await sh(a,u);return await u.json()};return{base:e,async catalog(){const a=await r(qt.catalog);if(a.wire!==sA)throw new Error(`This playground speaks wire ${sA}, and its host answered with wire ${String(a.wire)}.`);return a},problems:()=>r(qt.problems),bootstrap:(a,c)=>r(qt.bootstrap(a,c)),requirements:a=>r(qt.requirements(a)),propertyRequirements:a=>r(qt.propertyRequirements(a)),facts:(a,c)=>r(qt.facts(a,c)),render:a=>i(qt.render,a),save:a=>i(qt.save,a),library:a=>i(qt.library,a),fixtures:a=>i(qt.fixtures,a),async upload(a,c){const u=qt.upload(a),f=await t(n(u),{method:"POST",headers:{"content-type":c.type||"application/octet-stream"},body:c});if(!f.ok)throw await sh(u,f);return await f.json()},media:a=>r(qt.media(a)),owned:a=>r(qt.owned(a)),async download(a,c,u){var p;const f=qt.download(a,c,{format:u});for(;;){const y=await t(n(f));if(y.status===202){await((p=y.body)==null?void 0:p.cancel());continue}if(!y.ok)throw await sh(f,y);return{name:Rle(y.headers.get("content-disposition"))??"download",file:await y.blob()}}},liveHref:(a,c,u)=>n(qt.site(a,c,u)),subscribe(a){let c;try{c=new EventSource(n(qt.changes))}catch{return()=>{}}const u=Object.keys(pb).flatMap(f=>{const p=a[f];if(p===void 0)return[];const y=m=>p(JSON.parse(m.data));return c.addEventListener(pb[f],y),[()=>c.removeEventListener(pb[f],y)]});return()=>{for(const f of u)f();c.close()}}}}let Yv=null;function $le(e){Yv=e}function cm(){if(Yv===null)throw new Error("The playground's host is not installed yet.");return Yv}let F$=()=>{};function gb(e){F$=e??(()=>{})}async function r1(e){const t=cm(),n=e.kind==="library"?await t.library(e.request):await t.upload(e.request,e.file);return F$(n),n}let B$=null;function yb(e){B$=e}function H$(){return B$}const um="2026-01-01T00:00:00.000Z",Qv=new Map,Xv=new Map;function o1(e){let t=Qv.get(e);return t===void 0&&(t=cm().media(e).catch(()=>({items:[],contacts:[],lists:{}})),Qv.set(e,t)),t}function zle(e){let t=Xv.get(e);return t===void 0&&(t=cm().owned(e).catch(()=>({owned:{}})),Xv.set(e,t)),t}async function q$(e){const{items:t,lists:n}=await o1(e);return uL(n,Dle(t))}function Dle(e){return[...Ule(e),...Ple(e),...Fle(e),...Ble(e)]}async function Lle(e){return(await o1(e)).contacts}async function Ile(e,t){var a;const{items:n,contacts:r}=await o1(e);return((a=n.find(c=>c.id===t))==null?void 0:a.src)||r.map(c=>c.images[t]).find(c=>c!==void 0)}async function V$(e,t){return(await zle(e)).owned[t]}function Al(){Qv.clear(),Xv.clear()}function Ule(e){return e.filter(t=>t.kind==="photo").map(t=>Ip({id:t.id,kind:"image",name:t.name,added_at:um,file_url:t.src}))}function Ple(e){return e.filter(t=>t.kind==="video").map(t=>{const n=t.provider!==void 0,r=t.src===""?{}:{poster:t.src},i=!n&&(t.ready??!0)?{encode:t.src}:{};return Ip({id:t.id,kind:"video",name:t.name,added_at:um,duration_ms:t.durationMs??null,url:n?"":null,provider:t.provider??null,renditions:{...r,...i}})})}function Fle(e){return e.filter(t=>t.kind==="tour").map(t=>Ip({id:t.id,kind:"tour",name:t.name,added_at:um,url:t.url??"",provider:t.provider??null,renditions:t.src===""?{}:{poster:t.src}}))}function Ble(e){return e.filter(t=>t.kind==="document").map(t=>Ip({id:t.id,kind:"document",name:t.name,added_at:um,mime:t.mime??null,bytes:t.sizeBytes??null,renditions:t.src===""?{}:{poster:t.src}}))}function Hle(e,t,n){const r=Math.min(Math.max(Math.round(e.nx*t),0),Math.max(t-1,0)),i=Math.min(Math.max(Math.round(e.ny*n),0),Math.max(n-1,0)),a=Math.max(Math.min(Math.round(e.nw*t),t-r),1),c=Math.max(Math.min(Math.round(e.nh*n),n-i),1);return{sx:r,sy:i,sw:a,sh:c}}function qle(e,t){return new Promise((n,r)=>{const i=t.createElement("img");i.onload=()=>n(i),i.onerror=()=>r(new Error(`Could not load ${e} to crop it.`)),i.src=e})}async function Vle(e,t,n=document){const r=await qle(e,n),{sx:i,sy:a,sw:c,sh:u}=Hle(t,r.naturalWidth,r.naturalHeight),f=n.createElement("canvas");f.width=c,f.height=u;const p=f.getContext("2d");if(!p)throw new Error("No 2d canvas context; cannot crop.");p.drawImage(r,i,a,c,u,0,0,c,u);const y=await new Promise(m=>f.toBlob(m));if(!y)throw new Error("Canvas produced no blob; cannot crop.");return URL.createObjectURL(y)}async function i1(e,t){const n=await r1({kind:"library",request:{kind:"link",url:t,...e}});if(Al(),n.media===void 0)throw new Error("The link was saved, but the host named no media for it.");return{id:n.media}}function Zle(e){return q$(e)}function Kle(e,t,n){return i1({property:e,list:t},n)}const Gle=/^processed\/crops\/([^/]+)\/(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)$/,lA=new Map;function Yle(e,t){const n=Gle.exec(t);if(n===null)return Promise.reject(new Error(`Unknown crop ${t}.`));const[,r,i,a,c,u]=n,f={nx:Number(i),ny:Number(a),nw:Number(c),nh:Number(u)};let p=lA.get(t);return p||(p=Ile(e,r).then(y=>{if(!y)throw new Error(`The fixture's property has no media ${r} to crop.`);return Vle(y,f)}),lA.set(t,p)),p}async function s1(e,t){const n=await r1({kind:"upload",request:{target:e,name:t.name},file:t});if(Al(),n.media===void 0||n.url===void 0)throw new Error("The file was saved, but the host named no media for it.");return{id:n.media,url:new URL(n.url,cm().base).href}}async function Qle(e,t,n){await r1({kind:"library",request:{kind:"remove",property:e,list:t,media:n}}),Al()}const Z$={async postListUploadWithProgress(e,t,n,r){const{id:i}=await s1({property:e,list:t},n);return r(100),{id:i}},postListLink:(e,t,n)=>i1({property:e,list:t},n),withdrawListItem:(e,t,n)=>Qle(e,t,n),mediaFactsQuery:e=>({queryKey:["media-facts",e],queryFn:async()=>({facts:await Zle(e)})})},Xle=/^\/properties\/[^/]+\/poi\/search$/,Wle=/^\/properties\/[^/]+\/poi\/([^/]+)$/,Wv=[{place_id:"pg-coffee",name:"Bluebird Coffee",address:"88 Market St",lat:40.798,lng:-73.972,distance_m:210,rating:4.6,review_count:312,type_label:"Coffee shop",price_level:"PRICE_LEVEL_INEXPENSIVE"},{place_id:"pg-park",name:"Riverside Park",address:"500 Riverside Dr",lat:40.8,lng:-73.97,distance_m:320,type_label:"Park"},{place_id:"pg-grocer",name:"Corner Grocery",address:"45 Vine Ave",lat:40.796,lng:-73.968,distance_m:480,rating:4.1,review_count:88,type_label:"Grocery store"},{place_id:"pg-school",name:"Lincoln Elementary School",address:"12 School St",lat:40.803,lng:-73.965,distance_m:640,type_label:"Elementary school"},{place_id:"pg-transit",name:"Metro Station — 5th & Main",address:null,lat:40.799,lng:-73.975,distance_m:750,type_label:"Transit station"},{place_id:"pg-gym",name:"Eastside Fitness",address:"300 Water St",lat:40.805,lng:-73.961,distance_m:1100,rating:3.9,review_count:174,type_label:"Gym",summary:"A neighborhood gym with a lap pool and early hours."}];function Jle(e){const t=typeof e=="object"&&e!==null?e.query:void 0,n=typeof t=="string"?t.trim().toLowerCase():"";return n?{results:Wv.filter(r=>{var i;return r.name.toLowerCase().includes(n)||(((i=r.address)==null?void 0:i.toLowerCase().includes(n))??!1)})}:{results:Wv}}let ece=0;function tce(e,t={}){const n=(t.method??"GET").toUpperCase();if(n==="POST"&&Xle.test(e))return Promise.resolve(Jle(t.json));const r=n==="GET"?Wle.exec(e):null;if(r){const i=decodeURIComponent(r[1]),a=Wv.find(c=>c.place_id===i);if(a)return Promise.resolve({...a,id:`pg-row-${++ece}`})}return Promise.reject(new Error(`No API backend in the playground: ${t.method??"GET"} ${e}. This capability is served by the host application; supply a provider to use it here.`))}const nce=[{street:"88 Market St",unit:null,city:"Springfield",state:"IL",postal:"62704",latitude:39.7817,longitude:-89.6501,source:"autocomplete"},{street:"500 Riverside Dr",unit:"Apt 4B",city:"Springfield",state:"IL",postal:"62702",latitude:39.8003,longitude:-89.6437,source:"autocomplete"},{street:"45 Vine Ave",unit:null,city:"Riverton",state:"IL",postal:"62561",latitude:39.8442,longitude:-89.5393,source:"autocomplete"},{street:"12 School St",unit:null,city:"Chatham",state:"IL",postal:"62629",latitude:39.6762,longitude:-89.7045,source:"autocomplete"},{street:"300 Water St",unit:"Suite 210",city:"Springfield",state:"IL",postal:"62701",latitude:39.8017,longitude:-89.6498,source:"autocomplete"}];function Jv(e){return`${[e.street,e.unit].filter(n=>n!==null).join(", ")}, ${e.city??""}, ${e.state??""} ${e.postal??""}`.trim()}function rce(e){const t=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return nce.filter(n=>{const r=Jv(n).toLowerCase();return t.every(i=>r.includes(i))})}const oce=1e3;function ice({value:e,onChange:t,onPick:n,onBlur:r,className:i,placeholder:a,ariaLabel:c}){const u=w.useRef(null),[f,p]=w.useState(!1),[y,m]=w.useState(0),[x,v]=w.useState(null),_=rce(e),k=f&&_.length>0;w.useLayoutEffect(()=>{if(!k)return;const j=()=>{var O;return v(((O=u.current)==null?void 0:O.getBoundingClientRect())??null)};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[k]);const S=j=>{const O=_[j];O!==void 0&&(p(!1),n(O))};return h.jsxs("div",{className:"relative flex min-w-0 flex-1",children:[h.jsx("input",{ref:u,className:i,type:"text",value:e,placeholder:a,"aria-label":c,"aria-autocomplete":"list",autoComplete:"off",onChange:j=>{t(j.target.value),m(0),p(!0)},onFocus:()=>p(!0),onBlur:()=>{p(!1),r==null||r()},onKeyDown:j=>{if(k)if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();const O=j.key==="ArrowDown"?1:-1;m(A=>(A+O+_.length)%_.length)}else j.key==="Enter"?(j.preventDefault(),j.stopPropagation(),S(y)):j.key==="Escape"&&(j.stopPropagation(),p(!1))}}),k&&x!==null?Tr.createPortal(h.jsx("div",{role:"listbox","aria-label":`${c??"Address"} suggestions`,"data-testid":"address-suggestions",className:"overflow-y-auto rounded-[10px] border border-line bg-canvas p-1.5 shadow-[var(--shadow-md)]",style:{position:"fixed",left:x.left,top:x.bottom+4,minWidth:x.width,zIndex:oce},children:_.map((j,O)=>h.jsx("button",{type:"button",role:"option","aria-selected":O===y,onMouseDown:A=>{A.preventDefault(),S(O)},onMouseEnter:()=>m(O),className:`block w-full cursor-pointer rounded-md px-2.5 py-1.5 text-left text-[13px] text-ink ${O===y?"bg-[#f3f1ea]":""}`,children:Jv(j)},Jv(j)))}),document.body):null]})}const cA=.004;function sce({pin:e,place:t,onPin:n}){const r=e??{latitude:39.7817,longitude:-89.6501};return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("button",{type:"button","data-testid":"pin-box","aria-label":"Click to place the pin",className:`relative w-full cursor-crosshair rounded-lg border border-line bg-[linear-gradient(#ecebe6_1px,transparent_1px),linear-gradient(90deg,#ecebe6_1px,transparent_1px)] bg-[size:24px_24px] ${t==="page"?"h-[320px]":"h-[200px]"}`,onClick:i=>{const a=i.currentTarget.getBoundingClientRect(),c=(i.clientX-a.left)/a.width-.5,u=(i.clientY-a.top)/a.height-.5;n({latitude:r.latitude-u*2*cA,longitude:r.longitude+c*2*cA})},children:e===null?null:h.jsx("span",{"aria-hidden":"true",className:"absolute left-1/2 top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-canvas bg-accent shadow"})}),h.jsx("span",{className:"text-[11.5px] text-ink-3",children:e===null?"No map in the playground: click the box to place the pin.":`Pin at ${e.latitude.toFixed(5)}, ${e.longitude.toFixed(5)}`})]})}const a1={Input:ice,PinMap:sce},e0=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function uA(e,t){let n=e;for(const r of t.split("."))if(Array.isArray(n))n=n.find(i=>e0(i)&&i.id===r);else if(e0(n))n=n[r];else return[];return Array.isArray(n)?n:[]}function dA(e){if(!e0(e))return null;const t=e.media??e.id;return typeof t=="string"?t:null}function ace(e,t,n){if(t.includes("."))return[{op:"set_list",home:"property",path:t,list:{kind:"picks",media_ids:[...n]}}];const r=new Set(n),i=new Set(e);return[...e.filter(a=>!r.has(a)).map(a=>({op:"unpick",path:t,id:a})),...n.filter(a=>!i.has(a)).map(a=>({op:"pick",path:t,id:a})),{op:"order",home:"property",path:t,ids:[...n]}]}let lce=0;function K$(e){const{host:t,property:n}=e,r=new Map,i=async f=>{const[p,y]=await Promise.all([t.facts(n,f.home),q$(n)]),m={...p.facts.files,...y.files};return{...p,facts:{...p.facts,files:m}}},a=async f=>{try{return await f}catch(p){throw e.onRefused(p),p}},c=async f=>{const p=await a(t.save({property:n,batch:"everywhere",ops:f}));return e.onSaved(p),p},u=dR({upload:!0,manage:!0,link:!0});return{read:i,async setValue(f,p,y){await c([{op:"set_value",home:f.home,path:p,value:y}])},async addRow(f,p,y){var k;const m=`pg-row-${String(++lce)}`,v=(k=(await c([{op:"add_row",home:f.home,path:p,...y===void 0?{}:{value:y},temp_id:m}])).row_ids)==null?void 0:k[m];if(v===void 0)throw new Error("The row was saved, but the host named no row for it.");const _=uA((await i(f)).facts,p).findIndex(S=>dA(S)===v);return{row_id:v,position:_}},async removeRow(f,p){await c([{op:"remove_row",home:f.home,path:p}])},async reorder(f,p,y){return await c([{op:"order",home:f.home,path:p,ids:[...y]}]),{rows:y.map((m,x)=>({row_id:m,position:x}))}},async setSelection(f,p,y){const m=uA((await i({home:"property"})).facts,p).map(dA).filter(x=>x!==null);await c(ace(m,p,y))},async stageMedia(f,p,y){const m=await a(t.upload({target:{property:n,owner:p},name:y.name},y));if(e.onSaved(m),m.media===void 0||m.url===void 0)throw new Error("The file was saved, but the host named no media for it.");const x=new URL(m.url,t.base).href;return r.set(m.media,x),{media_id:m.media,url:x}},async commitMedia(f,p,y){await c([{op:"commit_media",home:f.home,path:p,media_id:y}])},async withdrawMedia(f,p){await c([{op:"clear_media",home:f.home,path:p}])},async mediaUrl(f,p,y){var _;const m=r.get(y);if(m!==void 0)return{url:m};const x=await t.media(n),v=x.contacts.map(k=>k.images[y]).find(k=>k!==void 0)??((_=x.items.find(k=>k.id===y))==null?void 0:_.src);if(v==null)throw new Error(`The property holds no media "${y}".`);return{url:new URL(v,t.base).href}},fillStatus:()=>Promise.resolve({paths:{},failed_crops:[],evaluating:!1}),requirements:{queryKey:f=>["playground",f,"requirements"],read:()=>t.propertyRequirements(n)},refusalCode:()=>null,propertyChanged:e.onPropertyChanged,api:e.api,address:e.address,useMediaListHost:(f,p,y)=>u(f??n,p,y??"")}}async function cce(e,t,n){var p;const r=H$(),i=(r==null?void 0:r.fixture)==null?void 0:await V$(r.fixture,n);if(i!==void 0)return i;const[a,c]=t.split(".");if(e.home!=="library"||a!=="contacts")throw new Error(`The fixture holds no owned media at '${t}'.`);const f=(p=(r===null?[]:await Lle(r.property)).find(y=>y.id===c))==null?void 0:p.images[n];if(f===void 0)throw new Error(`The property's contact ${c} has no image ${n}.`);return f}function l1(){const e=H$();if((e==null?void 0:e.fixture)==null)throw new Error("No fixture is open to save the image into.");return{property:e.property,fixture:e.fixture}}async function uce(e,t,n){if(!("file"in n))throw new Error("A row's own image is a file; upload one.");const r=l1(),i=e.home==="property"?e.propertyId:r.property,{id:a,url:c}=await s1({property:i,owner:t,fixture:r.fixture},n.file);return{media_id:a,url:c}}function dce(e,t,n){return Promise.resolve()}async function fce(e,t,n){const r={fixture:l1().fixture,instance:t.instanceId,slot:t.slotId};if("link"in n){const{id:c}=await i1(r,n.link);return{media_id:c,url:n.link}}const{id:i,url:a}=await s1(r,n.file);return{media_id:i,url:a}}async function hce(e,t,n){const r=await V$(l1().fixture,n);if(r===void 0)throw new Error(`The fixture owns no media ${n}.`);return r}const c1={apiFetch:tce,getCropDerivativeUrl:Yle,postLink:Kle,stageOwnedMedia:uce,ownedMediaUrl:cce,discardStagedMedia:dce,uploadContentMedia:fce,contentMediaUrl:hce},pce={upload:!0,link:!0,manage:!0};function mce(e){return w.createElement(cq,{...e,capabilities:pce})}const gce={useEditorStore:Ee,capabilities:{},api:c1,MediaPicker:mce,TablePicker:Cae,TableRowSummary:f$,address:a1},yce="mx-auto w-[max(90%,calc(720*var(--frame)))] max-w-[calc(1200*var(--frame))] [--list-display-clear:48px]",bce=22,vce=()=>bce;function xce({host:e,property:t,queryClient:n,saveCycle:r,notes:i,scroll:a,onSaved:c,onPropertyChanged:u}){const f=w.useRef(c),p=w.useRef(u);w.useLayoutEffect(()=>{f.current=c,p.current=u},[c,u]);const y=w.useMemo(()=>K$({host:e,property:t,api:c1,address:a1,onSaved:m=>{i.saved("",m.changed),Al(),f.current(m),p.current()},onRefused:i.refused,onPropertyChanged:()=>p.current()}),[e,t,i]);return w.useEffect(()=>e.subscribe({files:m=>{m.fixtures&&(Al(),n.invalidateQueries())}}),[e,n]),wce(t,a),h.jsx(bN,{client:n,children:h.jsx(nM,{api:Z$,children:h.jsx(W5,{backend:y,children:h.jsx(Fp,{status:r,children:h.jsx("div",{className:"playground-facts","data-testid":"facts-page",children:h.jsx("div",{className:yce,"data-property-id":t,children:h.jsx(mae,{propertyId:t,saveCycle:r,clearance:vce,afterFacts:null})})})})})})})}function wce(e,t){const n=w.useRef(null);w.useLayoutEffect(()=>{n.current=t.current>0?t.current:null,n.current===null&&window.scrollTo(0,0)},[e,t]),w.useLayoutEffect(()=>{const r=()=>{const u=n.current;u===null||document.documentElement.scrollHeight-window.innerHeight<u||(n.current=null,window.scrollTo(0,u))},i=()=>{n.current===null&&(t.current=window.scrollY)},a=()=>{n.current=null};r();const c=new ResizeObserver(r);return c.observe(document.body),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("wheel",a,{passive:!0}),window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("keydown",a),()=>{c.disconnect(),window.removeEventListener("scroll",i),window.removeEventListener("wheel",a),window.removeEventListener("touchstart",a),window.removeEventListener("keydown",a)}},[t])}const kce="This fixture changed after the template was published, so there is no file to download. Publish again to make one.",fA="download";function _ce({name:e,file:t}){const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,r.rel="noopener",document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)}function Sce(e){const{host:t,catalog:n,property:r,fixture:i}=e,a=Ee(f=>f.currentCanvasId),c=Ece(e),{template:u}=n;return u.output==="website"?{viewLive:{href:new URL(tu({page:"live",property:r,fixture:i,pagePath:Gv(u,a)}),t.base).href,title:`Open this page as it would publish: ${u.name}`}}:n.capabilities.download?{download:c}:{}}function Ece({host:e,catalog:t,property:n,fixture:r,format:i,reportProblems:a}){var k;const[c,u]=w.useState(!1),[f,p]=w.useState(null),y=w.useRef(0),m=`${n}\0${r}\0${i??""}`,x=w.useCallback(()=>{p(null),a(fA,[])},[a]);w.useEffect(()=>{y.current+=1,u(!1),x()},[m,x]);const v=()=>{var j;const S=++y.current;u(!0),x(),e.download(n,r,i??((j=t.template.formats[0])==null?void 0:j.id)??null).then(O=>{S===y.current&&(u(!1),_ce(O))},O=>{if(S!==y.current)return;const A=O instanceof Error?O.message:String(O);u(!1),p(A),a(fA,[{what:"Download",file:null,message:`${r}: ${A}`}])})},_=((k=t.properties.flatMap(S=>S.content).find(S=>S.name===r))==null?void 0:k.capturable)!==!1;return{start:v,phase:c?"preparing":"idle",disabledReason:_?null:kce,error:f,clearError:x}}function jce(e,t,n){var i;const r=new Map;for(const a of e){const c=(t==null?void 0:t[a])??(t==null?void 0:t[((i=Eo(a))==null?void 0:i.object)??a]),u=n(a)?"edited":(c==null?void 0:c.kind)??"empty",f=!n(a)&&((c==null?void 0:c.kind)==="fact"||(c==null?void 0:c.kind)==="computed")?c.ref:null;r.set(u,[...r.get(u)??[],{id:a,ref:f}])}return[...r].map(([a,c])=>({kind:a,slots:c}))}const Oce={fact:"border-accent/40 text-accent",computed:"border-accent/40 text-accent",authored:"border-line text-ink-2",empty:"border-dashed border-line text-ink-4",edited:"border-honey-2 bg-honey/20 text-honey-ink"};function Ace({chips:e}){return h.jsx("span",{className:"inline-flex flex-shrink-0 items-center gap-1","data-testid":"provenance-chips",children:e.map(t=>h.jsx("span",{"data-testid":"provenance-chip","data-provenance":t.kind,"data-slots":t.slots.map(n=>n.id).join(" "),title:`${t.kind}: ${t.slots.map(n=>n.ref===null?n.id:`${n.id} ← ${n.ref}`).join(", ")}`,className:`inline-flex h-[18px] cursor-help items-center rounded-full border bg-canvas px-1.5 font-mono text-[10px] font-normal normal-case leading-none tracking-[0.02em] ${Oce[t.kind]}`,children:t.kind},t.kind))})}const Cce=(e,t)=>JSON.stringify(e??null)===JSON.stringify(t??null);function Nce({card:e,latest:t}){var u,f;const n=Ee(p=>{var y;return(y=p.content_doc.instances.find(m=>m.instance_id===e.instanceId))==null?void 0:y.slots}),r=t(),i=r==null?void 0:r.deliverable.content_doc,a=((f=(u=i==null?void 0:i.instances)==null?void 0:u.find(p=>p.instance_id===e.instanceId))==null?void 0:f.slots)??{},c=p=>!Cce(Rt(n??{},p),Rt(a,p));return h.jsx(Ace,{chips:jce(e.slotIds,r==null?void 0:r.provenance[e.instanceId],c)})}function Mce(e){return function(n){return h.jsx(Nce,{card:n,latest:e})}}function Rce({host:e,catalog:t,opened:n,onView:r,onSaved:i,guides:a,beneath:c,reportProblems:u}){const{property:f,fixture:p,format:y,store:m,backend:x,notes:v,queryClient:_}=n;w.useEffect(()=>m.subscribe((A,$)=>{A.currentCanvasId!==$.currentCanvasId&&r({page:"canvas",property:f,fixture:p,format:y,canvasId:A.currentCanvasId})}),[m,f,p,y,r]);const k=w.useMemo(()=>K$({host:e,property:f,api:c1,address:a1,onSaved:A=>{v.saved(p,A.changed),i(A)},onRefused:v.refused,onPropertyChanged:()=>x.refresh()}),[e,f,p,x,v,i]),S=w.useMemo(()=>Mce(x.latest),[x]),j=Sce({host:e,catalog:t,property:f,fixture:p,format:y,reportProblems:u}),O=Object.keys(j).length>0;return h.jsx(bN,{client:_,children:h.jsx(nM,{api:Z$,children:h.jsx(W5,{backend:k,children:h.jsx(Uie,{ports:gce,guides:a,beneath:c,slots:{cardAdornment:S},...O?{actions:j}:{}})})})})}const Tce="max-w-[calc(440*var(--frame))] text-center text-[length:calc(13*var(--content))] text-ink-3",$ce="max-w-[calc(640*var(--frame))] whitespace-pre-wrap rounded-lg border border-line bg-canvas px-4 py-3 font-mono text-[length:calc(12.5*var(--content))] leading-relaxed text-danger shadow-[0_1px_2px_rgba(20,18,13,0.04),0_8px_20px_-12px_rgba(20,18,13,0.18)]";function zce({children:e}){return h.jsx("div",{className:"playground-shell",children:h.jsx(T4,{children:e})})}function hp({label:e}){return h.jsx("span",{role:"status","aria-label":e,className:"block size-5 animate-spin rounded-full border-2 border-line-strong border-t-accent [animation-duration:0.7s]"})}function Dce({testId:e,children:t}){return h.jsx("p",{"data-testid":e,className:Tce,children:t})}function Xc({testId:e,children:t}){return h.jsx("div",{role:"alert","data-testid":e,className:$ce,children:t})}function Lce(e,t){const n=D$(e,t),r=n===null?null:mle(n);if(r===null||r.output!==$u.site)return null;const i=r.rest.at(-1)===""?r.rest.slice(0,-1):r.rest;return i.length>1||i.includes("")||i[0]==="assets"?null:{property:r.property,fixture:r.fixture,pagePath:i.length===0?"/":`/${i[0]}`}}const Ice=2e3;function Uce({host:e,view:t,onFollow:n}){const r=w.useRef(null),i=w.useRef(null),a=e.liveHref(t.property,t.fixture,t.pagePath),c=w.useRef(a),u=w.useRef(a),[f,p]=w.useState(!1),y=w.useRef({view:t,onFollow:n});y.current={view:t,onFollow:n},w.useEffect(()=>{var v;const x=(v=r.current)==null?void 0:v.contentWindow;!x||u.current===a||(u.current=a,x.location.replace(a))},[a]),w.useEffect(()=>{const x=()=>{var k,S;return(S=(k=r.current)==null?void 0:k.contentWindow)==null?void 0:S.location.reload()};let v=null;const _=e.subscribe({files:k=>{(k.source||k.stylesheet||k.fixtures)&&x()},job:k=>{k.operation!==ple||k.state!=="done"||v!==null||(v=setTimeout(()=>{v=null,x()},Ice))}});return()=>{_(),v!==null&&clearTimeout(v)}},[e]);const m=()=>{var j;p(!0);const x=(j=r.current)==null?void 0:j.contentWindow;if(!x)return;const v=Lce(x.location.pathname,e.base);if(v===null)return;u.current=e.liveHref(v.property,v.fixture,v.pagePath);const _=i.current;if(_!==null&&_.pagePath===v.pagePath&&_.scrollY>0){const{scrollY:O}=_;x.scrollTo(0,O),x.requestAnimationFrame(()=>x.scrollTo(0,O))}else i.current={pagePath:v.pagePath,scrollY:0};x.addEventListener("scroll",()=>{i.current={pagePath:v.pagePath,scrollY:x.scrollY}});const{view:k,onFollow:S}=y.current;(v.property!==k.property||v.fixture!==k.fixture||v.pagePath!==k.pagePath)&&S({...k,property:v.property,fixture:v.fixture,pagePath:v.pagePath})};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 grid place-items-center",children:h.jsx(hp,{label:"Loading the site…"})}),h.jsx("iframe",{ref:r,src:c.current,title:`${t.fixture} — live`,"data-testid":"live-site",className:`fixed inset-0 h-full w-full border-0${f?" bg-white":""}`,onLoad:m})]})}async function hA(e,t,n){let r;try{r=await t}catch(i){throw e.onRefused(i),i}return e.onSaved(r),n(r)}function Pce(e,t){return t===0?e:`${e}${e.includes("?")?"&":"?"}v=${String(t)}`}function Fce(e,t,n){return{basePath:t,stylesheets:e.stylesheets.map(r=>Pce(r,n)),importMap:e.islands.importMap,islandMap:e.islands.map,hostScriptSrc:e.islands.hostScript}}function Bce(e){const t=e;return{deliverable:t.deliverable,template:{key:e.template.key,display_name:e.template.display_name},bases:{content:e.bases.content,build:e.bases.build},format:t.format,sections:t.sections,pages:t.pages,canvases:t.canvases,facts:t.facts,...t.fill_holders===void 0?{}:{fill_holders:t.fill_holders},content_fingerprint:t.content_fingerprint??null}}const Hce={dependents_rederiving:!1,fills_evaluating:!1,prior_content_fingerprint:null,content_fingerprint:null},qce={dependents_rederiving:!0,fills_evaluating:!1,prior_content_fingerprint:null,content_fingerprint:null};function Vce(e,t,n,r={value:0}){const{property:i,fixture:a,format:c}=t,u=new URL(e.base).pathname;let f=null;const p=new WeakMap;return{latest:()=>f,bumpStylesheets:()=>{r.value+=1},async bootstrap(){return f=await e.bootstrap(a,c),Bce(f)},render:y=>e.render({fixture:a,section_key:y.section_key,slots:y.slots,...y.instance_id===void 0?{}:{instance_id:y.instance_id},...y.page_id===void 0?{}:{page_id:y.page_id},...y.variant===void 0?{}:{variant:y.variant}}),write:y=>hA(n,e.save({fixture:a,batch:"content",ops:y}),m=>m.changed.length===0?Hce:qce),updateEverywhere:y=>hA(n,e.save({property:i,fixture:a,batch:"everywhere",ops:y}),m=>({row_ids:{...m.row_ids}})),requirements:{queryKey:["playground",a,"requirements"],read:()=>e.requirements(a)},refresh:n.onRefresh,canvasAssets(y){const m=p.get(y);if(m!==void 0)return m;if(f===null)throw new Error("The playground's canvas asked for its assets before the fixture's bootstrap landed.");const x=Fce(f,u,r.value);return p.set(y,x),x}}}const Zce={state:"opening"};function bb(e,t,n){let r=!1,i=!1;const a=()=>{if(r){i=!0;return}r=!0;const c=e.getState().editMark();t.bootstrap().then(u=>yo(e,t)?n(u,c):void 0).catch(u=>console.error("[playground] the fixture could not be reloaded",u)).finally(()=>{r=!1,i&&(i=!1,a())})};return a}function Kce({host:e,catalog:t,view:n,onSaved:r}){const[i,a]=w.useState(null),c=w.useRef(null),u=w.useRef({value:0}),f=(n==null?void 0:n.property)??null,p=(n==null?void 0:n.fixture)??null,y=(n==null?void 0:n.format)??null;w.useEffect(()=>{var z;if(p===null||f===null){c.current=null,a(null),gb(null);return}a(T=>(T==null?void 0:T.state)==="open"?T:Zce);let x=!0;const v=z$(),_=new gN({defaultOptions:{queries:{retry:!1}}}),k=((z=t==null?void 0:t.properties.find(T=>T.name===f))==null?void 0:z.summary.listingIntent)??null,S=k==="for_sale"||k==="for_rent"?k:null,j=T=>{v.saved(p,T.changed),r(T),Al(),_.invalidateQueries({queryKey:["media-facts"]})};let O=()=>{};const A=Vce(e,{property:f,fixture:p,format:y},{onSaved:j,onRefused:v.refused,onRefresh:()=>{_.invalidateQueries(),O()}},u.current),$=c.current,C=(n==null?void 0:n.canvasId)??null;return(async()=>{$!==null&&await gae($);const T=await A.bootstrap();if(!x)return;const F={backend:A,property_id:f,listing_intent:S,bootstrap:T};let W;$===null?W=aW(F):(P4($),$.getState().openDeliverable(F),W=$),c.current=W,O=bb(W,A,(G,H)=>np(W,G,H)),C!==null&&T.canvases.some(G=>G.id===C)&&W.getState().setCurrentCanvas(C),gb(G=>{j(G),O()}),a({state:"open",opened:{property:f,fixture:p,format:y,store:W,backend:A,notes:v,queryClient:_}})})().catch(T=>{x&&a({state:"failed",message:T instanceof Error?T.message:String(T)})}),()=>{x=!1}},[e,f,p,y]),w.useEffect(()=>()=>{gb(null)},[]);const m=(i==null?void 0:i.state)==="open"?i.opened:null;return w.useEffect(()=>{if(m===null)return;const{store:x,backend:v}=m,_=bb(x,v,(S,j)=>np(x,S,j)),k=bb(x,v,S=>x.getState().applyBootstrap(S));return e.subscribe({files:S=>{S.stylesheet&&v.bumpStylesheets(),S.source||S.stylesheet?k():S.fixtures&&_()}})},[e,m]),i}function pA(e){const t=D$(window.location.pathname,e.base);return t===null?null:gle(t,window.location.search)}function Gce({host:e}){const[t,n]=w.useState(null),[r,i]=w.useState(null),a=w.useRef(()=>{}),[c,u]=w.useState(()=>pA(e));w.useEffect(()=>{let J=!0,P=!1,Y=!1;const L=()=>{if(P){Y=!0;return}P=!0,e.catalog().then(Z=>{J&&(n(Z),i(null))},Z=>{J&&i(Z instanceof Error?Z.message:String(Z))}).finally(()=>{P=!1,!(!J||!Y)&&(Y=!1,L())})};return a.current=L,L(),()=>{J=!1,a.current=()=>{}}},[e]);const f=t==null?void 0:t.template.name;w.useEffect(()=>{f&&(document.title=`${f} - Playground`)},[f]),w.useEffect(()=>{const J=()=>a.current();return e.subscribe({files:P=>P.source||P.fixtures?J():void 0,job:J})},[e]),w.useEffect(()=>{const J=()=>u(pA(e));return window.addEventListener("popstate",J),()=>window.removeEventListener("popstate",J)},[e]);const p=w.useMemo(()=>t===null||t.error!==void 0?null:yle(c,t),[c,t]);w.useEffect(()=>{(p==null?void 0:p.kind)==="replace"&&(window.history.replaceState({},"",new URL(tu(p.view),e.base).href),u(p.view))},[p,e]);const y=w.useCallback(J=>{window.history.pushState({},"",new URL(tu(J),e.base).href),u(J)},[e]),m=w.useCallback(J=>{window.history.replaceState({},"",new URL(tu(J),e.base).href),u(J)},[e]),x=w.useCallback(J=>{if(J.properties.length===0)return;const P=new Map(J.properties.map(Y=>[Y.name,Y]));n(Y=>Y===null?Y:{...Y,properties:Y.properties.map(L=>P.get(L.name)??L)})},[]),v=(t==null?void 0:t.capabilities.save)===!0,_=t==null?void 0:t.template,k=w.useCallback(async J=>{const P=await e.fixtures(J);n(L=>L===null?L:{...L,properties:P.properties});const Y=_===void 0?null:vle(J,P,c,{template:_});window.history.pushState({},"",Y===null?e.base:new URL(tu(Y),e.base).href),u(Y)},[e,_,c]),[S,j]=w.useState(!1),O=(p==null?void 0:p.kind)==="view"?p.view:null,[A,$]=w.useState(null),C=xle(A,p);C!==A&&$(C);const I=(t==null?void 0:t.capabilities.save)===!0?C:null,z=Kce({host:e,catalog:t,view:I,onSaved:x}),T=(z==null?void 0:z.state)==="open"?z.opened:null,F=Cx(),[W]=w.useState(z$),[G]=w.useState(()=>new gN({defaultOptions:{queries:{retry:!1}}})),H=w.useRef(0),U=w.useMemo(()=>({status:{state:F.state,savedAt:F.savedAt},notes:W}),[F.state,F.savedAt,W]),{problems:D,report:K}=hle(e,t,{canvas:(T==null?void 0:T.notes)??null,facts:W}),M=Yce({host:e,catalog:t,catalogError:r,resolved:p,opening:z,onReplaceView:m,onSaved:x,facts:{cycle:F,notes:W,queryClient:G,scroll:H,kept:T}}),B=Qce({host:e,catalog:t,opening:z,onReplaceView:m,onSaved:x,guides:S,onView:M.kind==="canvas",reportProblems:K}),X=M.kind==="facts"&&O!==null?O.property:null;w.useEffect(()=>{yb(X!==null?{property:X,fixture:null}:T===null?null:{property:T.property,fixture:T.fixture})},[X,T]),w.useEffect(()=>()=>yb(null),[]);const se={page:M.kind,catalog:t,view:O,opened:T,factsSave:U,guides:S,onGuides:j,onView:y,problems:D,reportProblems:K,onFixtures:v?k:null};return h.jsxs(vQ,{store:(T==null?void 0:T.store)??null,children:[h.jsx(ale,{sections:Mle,context:se}),B,M.node]})}function Yce({host:e,catalog:t,catalogError:n,resolved:r,opening:i,onReplaceView:a,onSaved:c,facts:u}){const f=y=>({kind:"message",node:h.jsx(zce,{children:y})});if(n)return f(h.jsxs(Xc,{children:["The playground could not load its catalog — ",n,`
|
|
1338
|
-
`,"Is the server still starting? Try refreshing."]}));if(!t)return f(h.jsx(hp,{label:"Loading the playground…"}));if(t.error!==void 0)return f(h.jsx(Xc,{testId:"catalog-error",children:t.error}));if(!t.capabilities.save)return f(h.jsx(Xc,{testId:"no-save",children:"This playground's host does not save, and the editor edits only what it saves. Serve it with a host that saves its fixtures."}));if(r===null||r.kind==="none")return f(h.jsx(Dce,{testId:"no-fixtures",children:"There are no fixtures. Make a property from the control."}));if(r.kind==="replace")return f(h.jsx(hp,{label:"Opening the page…"}));if(r.kind==="unknown")return f(h.jsx(Xc,{testId:"unknown-fixture",children:r.message}));const{view:p}=r;if(p.page==="live")return{kind:"live",node:h.jsx(Uce,{host:e,view:p,onFollow:a})};if(!n1(p)){const{kept:y}=u;return{kind:"facts",node:h.jsx(xce,{host:e,property:p.property,queryClient:u.queryClient,saveCycle:u.cycle,notes:u.notes,scroll:u.scroll,onSaved:c,onPropertyChanged:()=>y==null?void 0:y.backend.refresh()})}}return(i==null?void 0:i.state)==="failed"?f(h.jsxs(Xc,{testId:"bootstrap-error",children:['The fixture "',p.fixture,'" could not be opened: ',i.message]})):{kind:"canvas",node:null}}function Qce({host:e,catalog:t,opening:n,onReplaceView:r,onSaved:i,guides:a,onView:c,reportProblems:u}){return t===null||n===null||n.state==="failed"||!c&&n.state!=="open"?null:h.jsx("div",{className:c?"playground-shell":"playground-shell pointer-events-none invisible fixed inset-0","data-testid":c?"playground":"playground-beneath",inert:!c,"aria-hidden":c?void 0:!0,children:n.state==="open"?h.jsx(Fie,{children:h.jsx(Rce,{host:e,catalog:t,opened:n.opened,onView:r,onSaved:i,guides:a,beneath:!c,reportProblems:u})}):h.jsx(T4,{children:h.jsx(hp,{label:"Opening the canvas…"})})})}const G$=document.getElementById("root");if(!G$)throw new Error("playground: #root missing from index.html");const Y$=Tle(document.baseURI);$le(Y$);gD.createRoot(G$).render(h.jsx(w.StrictMode,{children:h.jsx(Gce,{host:Y$})}));
|