@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
|
@@ -0,0 +1,1338 @@
|
|
|
1
|
+
var r2=e=>{throw TypeError(e)};var ky=(e,t,n)=>t.has(e)||r2("Cannot "+n);var q=(e,t,n)=>(ky(e,t,"read from private field"),n?n.call(e):t.get(e)),Me=(e,t,n)=>t.has(e)?r2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(ky(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Fe=(e,t,n)=>(ky(e,t,"access private method"),n);var If=(e,t,n,r)=>({set _(i){_e(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 lD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _y={exports:{}},Pc={};/**
|
|
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 o2;function cD(){if(o2)return Pc;o2=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 Pc.Fragment=t,Pc.jsx=n,Pc.jsxs=n,Pc}var i2;function uD(){return i2||(i2=1,_y.exports=cD()),_y.exports}var h=uD(),Sy={exports:{}},qe={};/**
|
|
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 s2;function dD(){if(s2)return qe;s2=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"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),w=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=w&&L[w]||L["@@iterator"],typeof L=="function"?L:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function E(L,Q,D){this.props=L,this.context=Q,this.refs=S,this.updater=D||_}E.prototype.isReactComponent={},E.prototype.setState=function(L,Q){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,Q,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function O(){}O.prototype=E.prototype;function A(L,Q,D){this.props=L,this.context=Q,this.refs=S,this.updater=D||_}var R=A.prototype=new O;R.constructor=A,k(R,E.prototype),R.isPureReactComponent=!0;var C=Array.isArray;function I(){}var $={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function F(L,Q,D){var Z=D.ref;return{$$typeof:e,type:L,key:Q,ref:Z!==void 0?Z:null,props:D}}function W(L,Q){return F(L.type,Q,L.props)}function G(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function H(L){var Q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(D){return Q[D]})}var U=/\/+/g;function z(L,Q){return typeof L=="object"&&L!==null&&L.key!=null?H(""+L.key):Q.toString(36)}function K(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(I,I):(L.status="pending",L.then(function(Q){L.status==="pending"&&(L.status="fulfilled",L.value=Q)},function(Q){L.status==="pending"&&(L.status="rejected",L.reason=Q)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function N(L,Q,D,Z,te){var de=typeof L;(de==="undefined"||de==="boolean")&&(L=null);var fe=!1;if(L===null)fe=!0;else switch(de){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(L.$$typeof){case e:case t:fe=!0;break;case g:return fe=L._init,N(fe(L._payload),Q,D,Z,te)}}if(fe)return te=te(L),fe=Z===""?"."+z(L,0):Z,C(te)?(D="",fe!=null&&(D=fe.replace(U,"$&/")+"/"),N(te,Q,D,"",function(ce){return ce})):te!=null&&(G(te)&&(te=W(te,D+(te.key==null||L&&L.key===te.key?"":(""+te.key).replace(U,"$&/")+"/")+fe)),Q.push(te)),1;fe=0;var pe=Z===""?".":Z+":";if(C(L))for(var P=0;P<L.length;P++)Z=L[P],de=pe+z(Z,P),fe+=N(Z,Q,D,de,te);else if(P=v(L),typeof P=="function")for(L=P.call(L),P=0;!(Z=L.next()).done;)Z=Z.value,de=pe+z(Z,P++),fe+=N(Z,Q,D,de,te);else if(de==="object"){if(typeof L.then=="function")return N(K(L),Q,D,Z,te);throw Q=String(L),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return fe}function B(L,Q,D){if(L==null)return L;var Z=[],te=0;return N(L,Z,"","",function(de){return Q.call(D,de,te++)}),Z}function Y(L){if(L._status===-1){var Q=L._result;Q=Q(),Q.then(function(D){(L._status===0||L._status===-1)&&(L._status=1,L._result=D)},function(D){(L._status===0||L._status===-1)&&(L._status=2,L._result=D)}),L._status===-1&&(L._status=0,L._result=Q)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},J={map:B,forEach:function(L,Q,D){B(L,function(){Q.apply(this,arguments)},D)},count:function(L){var Q=0;return B(L,function(){Q++}),Q},toArray:function(L){return B(L,function(Q){return Q})||[]},only:function(L){if(!G(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return qe.Activity=m,qe.Children=J,qe.Component=E,qe.Fragment=n,qe.Profiler=i,qe.PureComponent=A,qe.StrictMode=r,qe.Suspense=f,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,qe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},qe.cache=function(L){return function(){return L.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(L,Q,D){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Z=k({},L.props),te=L.key;if(Q!=null)for(de in Q.key!==void 0&&(te=""+Q.key),Q)!T.call(Q,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&Q.ref===void 0||(Z[de]=Q[de]);var de=arguments.length-2;if(de===1)Z.children=D;else if(1<de){for(var fe=Array(de),pe=0;pe<de;pe++)fe[pe]=arguments[pe+2];Z.children=fe}return F(L.type,te,Z)},qe.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},qe.createElement=function(L,Q,D){var Z,te={},de=null;if(Q!=null)for(Z in Q.key!==void 0&&(de=""+Q.key),Q)T.call(Q,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(te[Z]=Q[Z]);var fe=arguments.length-2;if(fe===1)te.children=D;else if(1<fe){for(var pe=Array(fe),P=0;P<fe;P++)pe[P]=arguments[P+2];te.children=pe}if(L&&L.defaultProps)for(Z in fe=L.defaultProps,fe)te[Z]===void 0&&(te[Z]=fe[Z]);return F(L,de,te)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(L){return{$$typeof:u,render:L}},qe.isValidElement=G,qe.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:Y}},qe.memo=function(L,Q){return{$$typeof:p,type:L,compare:Q===void 0?null:Q}},qe.startTransition=function(L){var Q=$.T,D={};$.T=D;try{var Z=L(),te=$.S;te!==null&&te(D,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(I,ie)}catch(de){ie(de)}finally{Q!==null&&D.types!==null&&(Q.types=D.types),$.T=Q}},qe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},qe.use=function(L){return $.H.use(L)},qe.useActionState=function(L,Q,D){return $.H.useActionState(L,Q,D)},qe.useCallback=function(L,Q){return $.H.useCallback(L,Q)},qe.useContext=function(L){return $.H.useContext(L)},qe.useDebugValue=function(){},qe.useDeferredValue=function(L,Q){return $.H.useDeferredValue(L,Q)},qe.useEffect=function(L,Q){return $.H.useEffect(L,Q)},qe.useEffectEvent=function(L){return $.H.useEffectEvent(L)},qe.useId=function(){return $.H.useId()},qe.useImperativeHandle=function(L,Q,D){return $.H.useImperativeHandle(L,Q,D)},qe.useInsertionEffect=function(L,Q){return $.H.useInsertionEffect(L,Q)},qe.useLayoutEffect=function(L,Q){return $.H.useLayoutEffect(L,Q)},qe.useMemo=function(L,Q){return $.H.useMemo(L,Q)},qe.useOptimistic=function(L,Q){return $.H.useOptimistic(L,Q)},qe.useReducer=function(L,Q,D){return $.H.useReducer(L,Q,D)},qe.useRef=function(L){return $.H.useRef(L)},qe.useState=function(L){return $.H.useState(L)},qe.useSyncExternalStore=function(L,Q,D){return $.H.useSyncExternalStore(L,Q,D)},qe.useTransition=function(){return $.H.useTransition()},qe.version="19.2.6",qe}var a2;function o0(){return a2||(a2=1,Sy.exports=dD()),Sy.exports}var x=o0();const pi=lD(x);var Ey={exports:{}},Fc={},jy={exports:{}},Oy={};/**
|
|
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 l2;function fD(){return l2||(l2=1,(function(e){function t(N,B){var Y=N.length;N.push(B);e:for(;0<Y;){var ie=Y-1>>>1,J=N[ie];if(0<i(J,B))N[ie]=B,N[Y]=J,Y=ie;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var B=N[0],Y=N.pop();if(Y!==B){N[0]=Y;e:for(var ie=0,J=N.length,L=J>>>1;ie<L;){var Q=2*(ie+1)-1,D=N[Q],Z=Q+1,te=N[Z];if(0>i(D,Y))Z<J&&0>i(te,D)?(N[ie]=te,N[Z]=Y,ie=Z):(N[ie]=D,N[Q]=Y,ie=Q);else if(Z<J&&0>i(te,Y))N[ie]=te,N[Z]=Y,ie=Z;else break e}}return B}function i(N,B){var Y=N.sortIndex-B.sortIndex;return Y!==0?Y:N.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=[],g=1,m=null,w=3,v=!1,_=!1,k=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(N){for(var B=n(p);B!==null;){if(B.callback===null)r(p);else if(B.startTime<=N)r(p),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(p)}}function C(N){if(k=!1,R(N),!_)if(n(f)!==null)_=!0,I||(I=!0,H());else{var B=n(p);B!==null&&K(C,B.startTime-N)}}var I=!1,$=-1,T=5,F=-1;function W(){return S?!0:!(e.unstable_now()-F<T)}function G(){if(S=!1,I){var N=e.unstable_now();F=N;var B=!0;try{e:{_=!1,k&&(k=!1,O($),$=-1),v=!0;var Y=w;try{t:{for(R(N),m=n(f);m!==null&&!(m.expirationTime>N&&W());){var ie=m.callback;if(typeof ie=="function"){m.callback=null,w=m.priorityLevel;var J=ie(m.expirationTime<=N);if(N=e.unstable_now(),typeof J=="function"){m.callback=J,R(N),B=!0;break t}m===n(f)&&r(f),R(N)}else r(f);m=n(f)}if(m!==null)B=!0;else{var L=n(p);L!==null&&K(C,L.startTime-N),B=!1}}break e}finally{m=null,w=Y,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,z=U.port2;U.port1.onmessage=G,H=function(){z.postMessage(null)}}else H=function(){E(G,0)};function K(N,B){$=E(function(){N(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(N){N.callback=null},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(N){switch(w){case 1:case 2:case 3:var B=3;break;default:B=w}var Y=w;w=B;try{return N()}finally{w=Y}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(N,B){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var Y=w;w=N;try{return B()}finally{w=Y}},e.unstable_scheduleCallback=function(N,B,Y){var ie=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ie+Y:ie):Y=ie,N){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=Y+J,N={id:g++,callback:B,priorityLevel:N,startTime:Y,expirationTime:J,sortIndex:-1},Y>ie?(N.sortIndex=Y,t(p,N),n(f)===null&&N===n(p)&&(k?(O($),$=-1):k=!0,K(C,Y-ie))):(N.sortIndex=J,t(f,N),_||v||(_=!0,I||(I=!0,H()))),N},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(N){var B=w;return function(){var Y=w;w=B;try{return N.apply(this,arguments)}finally{w=Y}}}})(Oy)),Oy}var c2;function hD(){return c2||(c2=1,jy.exports=fD()),jy.exports}var Ay={exports:{}},pn={};/**
|
|
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 u2;function pD(){if(u2)return pn;u2=1;var e=o0();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}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,g){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:g}}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 pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(f,p){var g=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,g)},pn.flushSync=function(f){var p=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=g,r.d.f()}},pn.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))},pn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},pn.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var g=p.as,m=u(g,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:m,integrity:w,fetchPriority:v}):g==="script"&&r.d.X(f,{crossOrigin:m,integrity:w,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},pn.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:g,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)},pn.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,m=u(g,p.crossOrigin);r.d.L(f,g,{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})}},pn.preloadModule=function(f,p){if(typeof f=="string")if(p){var g=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},pn.requestFormReset=function(f){r.d.r(f)},pn.unstable_batchedUpdates=function(f,p){return f(p)},pn.useFormState=function(f,p,g){return c.H.useFormState(f,p,g)},pn.useFormStatus=function(){return c.H.useHostTransitionStatus()},pn.version="19.2.6",pn}var d2;function OA(){if(d2)return Ay.exports;d2=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(),Ay.exports=pD(),Ay.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 f2;function mD(){if(f2)return Fc;f2=1;var e=hD(),t=o0(),n=OA();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 y=l.return;if(y===null)break;var b=y.alternate;if(b===null){if(d=y.return,d!==null){l=d;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===l)return f(y),o;if(b===d)return f(y),s;b=b.sibling}throw Error(r(188))}if(l.return!==d.return)l=y,d=b;else{for(var j=!1,M=y.child;M;){if(M===l){j=!0,l=y,d=b;break}if(M===d){j=!0,d=y,l=b;break}M=M.sibling}if(!j){for(M=b.child;M;){if(M===l){j=!0,l=b,d=y;break}if(M===d){j=!0,d=b,l=y;break}M=M.sibling}if(!j)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 g(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=g(o),s!==null)return s;o=o.sibling}return null}var m=Object.assign,w=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"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=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 z(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 E: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 R:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case $:return s=o.displayName||null,s!==null?s:z(o.type)||"Memo";case T:s=o._payload,o=o._init;try{return z(o(s))}catch{}}return null}var K=Array.isArray,N=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,Y={pending:!1,data:null,method:null,action:null},ie=[],J=-1;function L(o){return{current:o}}function Q(o){0>J||(o.current=ie[J],ie[J]=null,J--)}function D(o,s){J++,ie[J]=o.current,o.current=s}var Z=L(null),te=L(null),de=L(null),fe=L(null);function pe(o,s){switch(D(de,s),D(te,o),D(Z,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?jS(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=jS(s),o=OS(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Q(Z),D(Z,o)}function P(){Q(Z),Q(te),Q(de)}function ce(o){o.memoizedState!==null&&D(fe,o);var s=Z.current,l=OS(s,o.type);s!==l&&(D(te,o),D(Z,l))}function me(o){te.current===o&&(Q(Z),Q(te)),fe.current===o&&(Q(fe),Dc._currentValue=Y)}var Se,$e;function Ie(o){if(Se===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);Se=s&&s[1]||"",$e=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Se+o+$e}var xe=!1;function Le(o,s){if(!o||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ue){var ae=ue}Reflect.construct(o,[],ve)}else{try{ve.call()}catch(ue){ae=ue}o.call(ve.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(ve=o())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),j=b[0],M=b[1];if(j&&M){var V=j.split(`
|
|
44
|
+
`),oe=M.split(`
|
|
45
|
+
`);for(y=d=0;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;for(;y<oe.length&&!oe[y].includes("DetermineComponentFrameRoot");)y++;if(d===V.length||y===oe.length)for(d=V.length-1,y=oe.length-1;1<=d&&0<=y&&V[d]!==oe[y];)y--;for(;1<=d&&0<=y;d--,y--)if(V[d]!==oe[y]){if(d!==1||y!==1)do if(d--,y--,0>y||V[d]!==oe[y]){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<=y);break}}}finally{xe=!1,Error.prepareStackTrace=l}return(l=o?o.displayName||o.name:"")?Ie(l):""}function ne(o,s){switch(o.tag){case 26:case 27:case 5:return Ie(o.type);case 16:return Ie("Lazy");case 13:return o.child!==s&&s!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return Le(o.type,!1);case 11:return Le(o.type.render,!1);case 1:return Le(o.type,!0);case 31:return Ie("Activity");default:return""}}function be(o){try{var s="",l=null;do s+=ne(o,l),l=o,o=o.return;while(o);return s}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var Re=Object.prototype.hasOwnProperty,Pe=e.unstable_scheduleCallback,ht=e.unstable_cancelCallback,Ke=e.unstable_shouldYield,En=e.unstable_requestPaint,ct=e.unstable_now,Wn=e.unstable_getCurrentPriorityLevel,Jn=e.unstable_ImmediatePriority,Nt=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,it=e.log,Ye=e.unstable_setDisableYieldValue,Mt=null,wt=null;function rn(o){if(typeof it=="function"&&Ye(o),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Mt,o)}catch{}}var hn=Math.clz32?Math.clz32:Xs,Qs=Math.log,Pr=Math.LN2;function Xs(o){return o>>>=0,o===0?32:31-(Qs(o)/Pr|0)|0}var Ws=256,Js=262144,ea=4194304;function Sr(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 ta(o,s,l){var d=o.pendingLanes;if(d===0)return 0;var y=0,b=o.suspendedLanes,j=o.pingedLanes;o=o.warmLanes;var M=d&134217727;return M!==0?(d=M&~b,d!==0?y=Sr(d):(j&=M,j!==0?y=Sr(j):l||(l=M&~o,l!==0&&(y=Sr(l))))):(M=d&~b,M!==0?y=Sr(M):j!==0?y=Sr(j):l||(l=d&~o,l!==0&&(y=Sr(l)))),y===0?0:s!==0&&s!==y&&(s&b)===0&&(b=y&-y,l=s&-s,b>=l||b===32&&(l&4194048)!==0)?s:y}function Ui(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function kd(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 _d(){var o=ea;return ea<<=1,(ea&62914560)===0&&(ea=4194304),o}function Zl(o){for(var s=[],l=0;31>l;l++)s.push(o);return s}function Pi(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function hm(o,s,l,d,y,b){var j=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 M=o.entanglements,V=o.expirationTimes,oe=o.hiddenUpdates;for(l=j&~l;0<l;){var he=31-hn(l),ve=1<<he;M[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&=~ve}d!==0&&Kl(o,d,0),b!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=b&~(j&~s))}function Kl(o,s,l){o.pendingLanes|=s,o.suspendedLanes&=~s;var d=31-hn(s);o.entangledLanes|=s,o.entanglements[d]=o.entanglements[d]|1073741824|l&261930}function Gl(o,s){var l=o.entangledLanes|=s;for(o=o.entanglements;l;){var d=31-hn(l),y=1<<d;y&s|o[d]&s&&(o[d]|=s),l&=~y}}function Sd(o,s){var l=s&-s;return l=(l&42)!==0?1:Yl(l),(l&(o.suspendedLanes|s))!==0?0:l}function Yl(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 Ql(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function se(){var o=B.p;return o!==0?o:(o=window.event,o===void 0?32:QS(o.type))}function Ee(o,s){var l=B.p;try{return B.p=o,s()}finally{B.p=l}}var Be=Math.random().toString(36).slice(2),Xe="__reactFiber$"+Be,He="__reactProps$"+Be,Er="__reactContainer$"+Be,Fr="__reactEvents$"+Be,X$="__reactListeners$"+Be,W$="__reactHandles$"+Be,h1="__reactResources$"+Be,Xl="__reactMarker$"+Be;function pm(o){delete o[Xe],delete o[He],delete o[Fr],delete o[X$],delete o[W$]}function na(o){var s=o[Xe];if(s)return s;for(var l=o.parentNode;l;){if(s=l[Er]||l[Xe]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(o=$S(o);o!==null;){if(l=o[Xe])return l;o=$S(o)}return s}o=l,l=o.parentNode}return null}function ra(o){if(o=o[Xe]||o[Er]){var s=o.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return o}return null}function Wl(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o.stateNode;throw Error(r(33))}function oa(o){var s=o[h1];return s||(s=o[h1]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Wt(o){o[Xl]=!0}var p1=new Set,m1={};function Fi(o,s){ia(o,s),ia(o+"Capture",s)}function ia(o,s){for(m1[o]=s,o=0;o<s.length;o++)p1.add(s[o])}var J$=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]*$"),g1={},y1={};function e3(o){return Re.call(y1,o)?!0:Re.call(g1,o)?!1:J$.test(o)?y1[o]=!0:(g1[o]=!0,!1)}function Ed(o,s,l){if(e3(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 jd(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 Br(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 er(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function b1(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function t3(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 y=d.get,b=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(j){l=""+j,b.call(this,j)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function mm(o){if(!o._valueTracker){var s=b1(o)?"checked":"value";o._valueTracker=t3(o,s,""+o[s])}}function v1(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return o&&(d=b1(o)?o.checked?"true":"false":o.value),o=d,o!==l?(s.setValue(o),!0):!1}function Od(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 n3=/[\n"\\]/g;function tr(o){return o.replace(n3,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function gm(o,s,l,d,y,b,j,M){o.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?o.type=j:o.removeAttribute("type"),s!=null?j==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+er(s)):o.value!==""+er(s)&&(o.value=""+er(s)):j!=="submit"&&j!=="reset"||o.removeAttribute("value"),s!=null?ym(o,j,er(s)):l!=null?ym(o,j,er(l)):d!=null&&o.removeAttribute("value"),y==null&&b!=null&&(o.defaultChecked=!!b),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.name=""+er(M):o.removeAttribute("name")}function w1(o,s,l,d,y,b,j,M){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)){mm(o);return}l=l!=null?""+er(l):"",s=s!=null?""+er(s):l,M||s===o.value||(o.value=s),o.defaultValue=s}d=d??y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,o.checked=M?o.checked:!!d,o.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(o.name=j),mm(o)}function ym(o,s,l){s==="number"&&Od(o.ownerDocument)===o||o.defaultValue===""+l||(o.defaultValue=""+l)}function sa(o,s,l,d){if(o=o.options,s){s={};for(var y=0;y<l.length;y++)s["$"+l[y]]=!0;for(l=0;l<o.length;l++)y=s.hasOwnProperty("$"+o[l].value),o[l].selected!==y&&(o[l].selected=y),y&&d&&(o[l].defaultSelected=!0)}else{for(l=""+er(l),s=null,y=0;y<o.length;y++){if(o[y].value===l){o[y].selected=!0,d&&(o[y].defaultSelected=!0);return}s!==null||o[y].disabled||(s=o[y])}s!==null&&(s.selected=!0)}}function x1(o,s,l){if(s!=null&&(s=""+er(s),s!==o.value&&(o.value=s),l==null)){o.defaultValue!==s&&(o.defaultValue=s);return}o.defaultValue=l!=null?""+er(l):""}function k1(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=er(s),o.defaultValue=l,d=o.textContent,d===l&&d!==""&&d!==null&&(o.value=d),mm(o)}function aa(o,s){if(s){var l=o.firstChild;if(l&&l===o.lastChild&&l.nodeType===3){l.nodeValue=s;return}}o.textContent=s}var r3=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 _1(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||r3.has(s)?s==="float"?o.cssFloat=l:o[s]=(""+l).trim():o[s]=l+"px"}function S1(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 y in s)d=s[y],s.hasOwnProperty(y)&&l[y]!==d&&_1(o,y,d)}else for(var b in s)s.hasOwnProperty(b)&&_1(o,b,s[b])}function bm(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 o3=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"]]),i3=/^[\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 Ad(o){return i3.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Hr(){}var vm=null;function wm(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var la=null,ca=null;function E1(o){var s=ra(o);if(s&&(o=s.stateNode)){var l=o[He]||null;e:switch(o=s.stateNode,s.type){case"input":if(gm(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="'+tr(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==o&&d.form===o.form){var y=d[He]||null;if(!y)throw Error(r(90));gm(d,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===o.form&&v1(d)}break e;case"textarea":x1(o,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&sa(o,!!l.multiple,s,!1)}}}var xm=!1;function j1(o,s,l){if(xm)return o(s,l);xm=!0;try{var d=o(s);return d}finally{if(xm=!1,(la!==null||ca!==null)&&(gf(),la&&(s=la,o=ca,ca=la=null,E1(s),o)))for(s=0;s<o.length;s++)E1(o[s])}}function Jl(o,s){var l=o.stateNode;if(l===null)return null;var d=l[He]||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 qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),km=!1;if(qr)try{var ec={};Object.defineProperty(ec,"passive",{get:function(){km=!0}}),window.addEventListener("test",ec,ec),window.removeEventListener("test",ec,ec)}catch{km=!1}var Ro=null,_m=null,Cd=null;function O1(){if(Cd)return Cd;var o,s=_m,l=s.length,d,y="value"in Ro?Ro.value:Ro.textContent,b=y.length;for(o=0;o<l&&s[o]===y[o];o++);var j=l-o;for(d=1;d<=j&&s[l-d]===y[b-d];d++);return Cd=y.slice(o,1<d?1-d:void 0)}function Nd(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 Md(){return!0}function A1(){return!1}function jn(o){function s(l,d,y,b,j){this._reactName=l,this._targetInst=y,this.type=d,this.nativeEvent=b,this.target=j,this.currentTarget=null;for(var M in o)o.hasOwnProperty(M)&&(l=o[M],this[M]=l?l(b):b[M]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Md:A1,this.isPropagationStopped=A1,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=Md)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Md)},persist:function(){},isPersistent:Md}),s}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=jn(Bi),tc=m({},Bi,{view:0,detail:0}),s3=jn(tc),Sm,Em,nc,Td=m({},tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Om,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!==nc&&(nc&&o.type==="mousemove"?(Sm=o.screenX-nc.screenX,Em=o.screenY-nc.screenY):Em=Sm=0,nc=o),Sm)},movementY:function(o){return"movementY"in o?o.movementY:Em}}),C1=jn(Td),a3=m({},Td,{dataTransfer:0}),l3=jn(a3),c3=m({},tc,{relatedTarget:0}),jm=jn(c3),u3=m({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),d3=jn(u3),f3=m({},Bi,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),h3=jn(f3),p3=m({},Bi,{data:0}),N1=jn(p3),m3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g3={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"},y3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b3(o){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(o):(o=y3[o])?!!s[o]:!1}function Om(){return b3}var v3=m({},tc,{key:function(o){if(o.key){var s=m3[o.key]||o.key;if(s!=="Unidentified")return s}return o.type==="keypress"?(o=Nd(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?g3[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Om,charCode:function(o){return o.type==="keypress"?Nd(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Nd(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),w3=jn(v3),x3=m({},Td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M1=jn(x3),k3=m({},tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Om}),_3=jn(k3),S3=m({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),E3=jn(S3),j3=m({},Td,{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}),O3=jn(j3),A3=m({},Bi,{newState:0,oldState:0}),C3=jn(A3),N3=[9,13,27,32],Am=qr&&"CompositionEvent"in window,rc=null;qr&&"documentMode"in document&&(rc=document.documentMode);var M3=qr&&"TextEvent"in window&&!rc,R1=qr&&(!Am||rc&&8<rc&&11>=rc),T1=" ",$1=!1;function z1(o,s){switch(o){case"keyup":return N3.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ua=!1;function R3(o,s){switch(o){case"compositionend":return D1(s);case"keypress":return s.which!==32?null:($1=!0,T1);case"textInput":return o=s.data,o===T1&&$1?null:o;default:return null}}function T3(o,s){if(ua)return o==="compositionend"||!Am&&z1(o,s)?(o=O1(),Cd=_m=Ro=null,ua=!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 R1&&s.locale!=="ko"?null:s.data;default:return null}}var $3={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 L1(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s==="input"?!!$3[o.type]:s==="textarea"}function I1(o,s,l,d){la?ca?ca.push(d):ca=[d]:la=d,s=_f(s,"onChange"),0<s.length&&(l=new Rd("onChange","change",null,l,d),o.push({event:l,listeners:s}))}var oc=null,ic=null;function z3(o){wS(o,0)}function $d(o){var s=Wl(o);if(v1(s))return o}function U1(o,s){if(o==="change")return s}var P1=!1;if(qr){var Cm;if(qr){var Nm="oninput"in document;if(!Nm){var F1=document.createElement("div");F1.setAttribute("oninput","return;"),Nm=typeof F1.oninput=="function"}Cm=Nm}else Cm=!1;P1=Cm&&(!document.documentMode||9<document.documentMode)}function B1(){oc&&(oc.detachEvent("onpropertychange",H1),ic=oc=null)}function H1(o){if(o.propertyName==="value"&&$d(ic)){var s=[];I1(s,ic,o,wm(o)),j1(z3,s)}}function D3(o,s,l){o==="focusin"?(B1(),oc=s,ic=l,oc.attachEvent("onpropertychange",H1)):o==="focusout"&&B1()}function L3(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return $d(ic)}function I3(o,s){if(o==="click")return $d(s)}function U3(o,s){if(o==="input"||o==="change")return $d(s)}function P3(o,s){return o===s&&(o!==0||1/o===1/s)||o!==o&&s!==s}var Pn=typeof Object.is=="function"?Object.is:P3;function sc(o,s){if(Pn(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 y=l[d];if(!Re.call(s,y)||!Pn(o[y],s[y]))return!1}return!0}function q1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function V1(o,s){var l=q1(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=q1(l)}}function Z1(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?Z1(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function K1(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Od(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=Od(o.document)}return s}function Mm(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 F3=qr&&"documentMode"in document&&11>=document.documentMode,da=null,Rm=null,ac=null,Tm=!1;function G1(o,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Tm||da==null||da!==Od(d)||(d=da,"selectionStart"in d&&Mm(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}),ac&&sc(ac,d)||(ac=d,d=_f(Rm,"onSelect"),0<d.length&&(s=new Rd("onSelect","select",null,s,l),o.push({event:s,listeners:d}),s.target=da)))}function Hi(o,s){var l={};return l[o.toLowerCase()]=s.toLowerCase(),l["Webkit"+o]="webkit"+s,l["Moz"+o]="moz"+s,l}var fa={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionrun:Hi("Transition","TransitionRun"),transitionstart:Hi("Transition","TransitionStart"),transitioncancel:Hi("Transition","TransitionCancel"),transitionend:Hi("Transition","TransitionEnd")},$m={},Y1={};qr&&(Y1=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function qi(o){if($m[o])return $m[o];if(!fa[o])return o;var s=fa[o],l;for(l in s)if(s.hasOwnProperty(l)&&l in Y1)return $m[o]=s[l];return o}var Q1=qi("animationend"),X1=qi("animationiteration"),W1=qi("animationstart"),B3=qi("transitionrun"),H3=qi("transitionstart"),q3=qi("transitioncancel"),J1=qi("transitionend"),ek=new Map,zm="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(" ");zm.push("scrollEnd");function mr(o,s){ek.set(o,s),Fi(s,[o])}var zd=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)},nr=[],ha=0,Dm=0;function Dd(){for(var o=ha,s=Dm=ha=0;s<o;){var l=nr[s];nr[s++]=null;var d=nr[s];nr[s++]=null;var y=nr[s];nr[s++]=null;var b=nr[s];if(nr[s++]=null,d!==null&&y!==null){var j=d.pending;j===null?y.next=y:(y.next=j.next,j.next=y),d.pending=y}b!==0&&tk(l,y,b)}}function Ld(o,s,l,d){nr[ha++]=o,nr[ha++]=s,nr[ha++]=l,nr[ha++]=d,Dm|=d,o.lanes|=d,o=o.alternate,o!==null&&(o.lanes|=d)}function Lm(o,s,l,d){return Ld(o,s,l,d),Id(o)}function Vi(o,s){return Ld(o,null,null,s),Id(o)}function tk(o,s,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l);for(var y=!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||(y=!0)),o=b,b=b.return;return o.tag===3?(b=o.stateNode,y&&s!==null&&(y=31-hn(l),o=b.hiddenUpdates,d=o[y],d===null?o[y]=[s]:d.push(s),s.lane=l|536870912),b):null}function Id(o){if(50<Cc)throw Cc=0,Zg=null,Error(r(185));for(var s=o.return;s!==null;)o=s,s=o.return;return o.tag===3?o.stateNode:null}var pa={};function V3(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 Fn(o,s,l,d){return new V3(o,s,l,d)}function Im(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Vr(o,s){var l=o.alternate;return l===null?(l=Fn(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 nk(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 Ud(o,s,l,d,y,b){var j=0;if(d=o,typeof o=="function")Im(o)&&(j=1);else if(typeof o=="string")j=Qz(o,l,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case F:return o=Fn(31,l,s,y),o.elementType=F,o.lanes=b,o;case k:return Zi(l.children,y,b,s);case S:j=8,y|=24;break;case E:return o=Fn(12,l,s,y|2),o.elementType=E,o.lanes=b,o;case C:return o=Fn(13,l,s,y),o.elementType=C,o.lanes=b,o;case I:return o=Fn(19,l,s,y),o.elementType=I,o.lanes=b,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case A:j=10;break e;case O:j=9;break e;case R:j=11;break e;case $:j=14;break e;case T:j=16,d=null;break e}j=29,l=Error(r(130,o===null?"null":typeof o,"")),d=null}return s=Fn(j,l,s,y),s.elementType=o,s.type=d,s.lanes=b,s}function Zi(o,s,l,d){return o=Fn(7,o,d,s),o.lanes=l,o}function Um(o,s,l){return o=Fn(6,o,null,s),o.lanes=l,o}function rk(o){var s=Fn(18,null,null,0);return s.stateNode=o,s}function Pm(o,s,l){return s=Fn(4,o.children!==null?o.children:[],o.key,s),s.lanes=l,s.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},s}var ok=new WeakMap;function rr(o,s){if(typeof o=="object"&&o!==null){var l=ok.get(o);return l!==void 0?l:(s={value:o,source:s,stack:be(s)},ok.set(o,s),s)}return{value:o,source:s,stack:be(s)}}var ma=[],ga=0,Pd=null,lc=0,or=[],ir=0,To=null,jr=1,Or="";function Zr(o,s){ma[ga++]=lc,ma[ga++]=Pd,Pd=o,lc=s}function ik(o,s,l){or[ir++]=jr,or[ir++]=Or,or[ir++]=To,To=o;var d=jr;o=Or;var y=32-hn(d)-1;d&=~(1<<y),l+=1;var b=32-hn(s)+y;if(30<b){var j=y-y%5;b=(d&(1<<j)-1).toString(32),d>>=j,y-=j,jr=1<<32-hn(s)+y|l<<y|d,Or=b+o}else jr=1<<b|l<<y|d,Or=o}function Fm(o){o.return!==null&&(Zr(o,1),ik(o,1,0))}function Bm(o){for(;o===Pd;)Pd=ma[--ga],ma[ga]=null,lc=ma[--ga],ma[ga]=null;for(;o===To;)To=or[--ir],or[ir]=null,Or=or[--ir],or[ir]=null,jr=or[--ir],or[ir]=null}function sk(o,s){or[ir++]=jr,or[ir++]=Or,or[ir++]=To,jr=s.id,Or=s.overflow,To=o}var on=null,_t=null,nt=!1,$o=null,sr=!1,Hm=Error(r(519));function zo(o){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cc(rr(s,o)),Hm}function ak(o){var s=o.stateNode,l=o.type,d=o.memoizedProps;switch(s[Xe]=o,s[He]=d,l){case"dialog":Je("cancel",s),Je("close",s);break;case"iframe":case"object":case"embed":Je("load",s);break;case"video":case"audio":for(l=0;l<Mc.length;l++)Je(Mc[l],s);break;case"source":Je("error",s);break;case"img":case"image":case"link":Je("error",s),Je("load",s);break;case"details":Je("toggle",s);break;case"input":Je("invalid",s),w1(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",s);break;case"textarea":Je("invalid",s),k1(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||SS(s.textContent,l)?(d.popover!=null&&(Je("beforetoggle",s),Je("toggle",s)),d.onScroll!=null&&Je("scroll",s),d.onScrollEnd!=null&&Je("scrollend",s),d.onClick!=null&&(s.onclick=Hr),s=!0):s=!1,s||zo(o,!0)}function lk(o){for(on=o.return;on;)switch(on.tag){case 5:case 31:case 13:sr=!1;return;case 27:case 3:sr=!0;return;default:on=on.return}}function ya(o){if(o!==on)return!1;if(!nt)return lk(o),nt=!0,!1;var s=o.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=o.type,l=!(l!=="form"&&l!=="button")||ay(o.type,o.memoizedProps)),l=!l),l&&_t&&zo(o),lk(o),s===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));_t=TS(o)}else if(s===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));_t=TS(o)}else s===27?(s=_t,Yo(o.type)?(o=fy,fy=null,_t=o):_t=s):_t=on?lr(o.stateNode.nextSibling):null;return!0}function Ki(){_t=on=null,nt=!1}function qm(){var o=$o;return o!==null&&(Nn===null?Nn=o:Nn.push.apply(Nn,o),$o=null),o}function cc(o){$o===null?$o=[o]:$o.push(o)}var Vm=L(null),Gi=null,Kr=null;function Do(o,s,l){D(Vm,s._currentValue),s._currentValue=l}function Gr(o){o._currentValue=Vm.current,Q(Vm)}function Zm(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 Km(o,s,l,d){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var b=y.dependencies;if(b!==null){var j=y.child;b=b.firstContext;e:for(;b!==null;){var M=b;b=y;for(var V=0;V<s.length;V++)if(M.context===s[V]){b.lanes|=l,M=b.alternate,M!==null&&(M.lanes|=l),Zm(b.return,l,o),d||(j=null);break e}b=M.next}}else if(y.tag===18){if(j=y.return,j===null)throw Error(r(341));j.lanes|=l,b=j.alternate,b!==null&&(b.lanes|=l),Zm(j,l,o),j=null}else j=y.child;if(j!==null)j.return=y;else for(j=y;j!==null;){if(j===o){j=null;break}if(y=j.sibling,y!==null){y.return=j.return,j=y;break}j=j.return}y=j}}function ba(o,s,l,d){o=null;for(var y=s,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var j=y.alternate;if(j===null)throw Error(r(387));if(j=j.memoizedProps,j!==null){var M=y.type;Pn(y.pendingProps.value,j.value)||(o!==null?o.push(M):o=[M])}}else if(y===fe.current){if(j=y.alternate,j===null)throw Error(r(387));j.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Dc):o=[Dc])}y=y.return}o!==null&&Km(s,o,l,d),s.flags|=262144}function Fd(o){for(o=o.firstContext;o!==null;){if(!Pn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Yi(o){Gi=o,Kr=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function sn(o){return ck(Gi,o)}function Bd(o,s){return Gi===null&&Yi(o),ck(o,s)}function ck(o,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},Kr===null){if(o===null)throw Error(r(308));Kr=s,o.dependencies={lanes:0,firstContext:s},o.flags|=524288}else Kr=Kr.next=s;return l}var Z3=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()})}},K3=e.unstable_scheduleCallback,G3=e.unstable_NormalPriority,Ft={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gm(){return{controller:new Z3,data:new Map,refCount:0}}function uc(o){o.refCount--,o.refCount===0&&K3(G3,function(){o.controller.abort()})}var dc=null,Ym=0,va=0,wa=null;function Y3(o,s){if(dc===null){var l=dc=[];Ym=0,va=Wg(),wa={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Ym++,s.then(uk,uk),s}function uk(){if(--Ym===0&&dc!==null){wa!==null&&(wa.status="fulfilled");var o=dc;dc=null,va=0,wa=null;for(var s=0;s<o.length;s++)(0,o[s])()}}function Q3(o,s){var l=[],d={status:"pending",value:null,reason:null,then:function(y){l.push(y)}};return o.then(function(){d.status="fulfilled",d.value=s;for(var y=0;y<l.length;y++)(0,l[y])(s)},function(y){for(d.status="rejected",d.reason=y,y=0;y<l.length;y++)(0,l[y])(void 0)}),d}var dk=N.S;N.S=function(o,s){G_=ct(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&Y3(o,s),dk!==null&&dk(o,s)};var Qi=L(null);function Qm(){var o=Qi.current;return o!==null?o:xt.pooledCache}function Hd(o,s){s===null?D(Qi,Qi.current):D(Qi,s.pool)}function fk(){var o=Qm();return o===null?null:{parent:Ft._currentValue,pool:o}}var xa=Error(r(460)),Xm=Error(r(474)),qd=Error(r(542)),Vd={then:function(){}};function hk(o){return o=o.status,o==="fulfilled"||o==="rejected"}function pk(o,s,l){switch(l=o[l],l===void 0?o.push(s):l!==s&&(s.then(Hr,Hr),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw o=s.reason,gk(o),o;default:if(typeof s.status=="string")s.then(Hr,Hr);else{if(o=xt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=s,o.status="pending",o.then(function(d){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=d}},function(d){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw o=s.reason,gk(o),o}throw Wi=s,xa}}function Xi(o){try{var s=o._init;return s(o._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Wi=l,xa):l}}var Wi=null;function mk(){if(Wi===null)throw Error(r(459));var o=Wi;return Wi=null,o}function gk(o){if(o===xa||o===qd)throw Error(r(483))}var ka=null,fc=0;function Zd(o){var s=fc;return fc+=1,ka===null&&(ka=[]),pk(ka,o,s)}function hc(o,s){s=s.props.ref,o.ref=s!==void 0?s:null}function Kd(o,s){throw s.$$typeof===w?Error(r(525)):(o=Object.prototype.toString.call(s),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":o)))}function yk(o){function s(ee,X){if(o){var re=ee.deletions;re===null?(ee.deletions=[X],ee.flags|=16):re.push(X)}}function l(ee,X){if(!o)return null;for(;X!==null;)s(ee,X),X=X.sibling;return null}function d(ee){for(var X=new Map;ee!==null;)ee.key!==null?X.set(ee.key,ee):X.set(ee.index,ee),ee=ee.sibling;return X}function y(ee,X){return ee=Vr(ee,X),ee.index=0,ee.sibling=null,ee}function b(ee,X,re){return ee.index=re,o?(re=ee.alternate,re!==null?(re=re.index,re<X?(ee.flags|=67108866,X):re):(ee.flags|=67108866,X)):(ee.flags|=1048576,X)}function j(ee){return o&&ee.alternate===null&&(ee.flags|=67108866),ee}function M(ee,X,re,ge){return X===null||X.tag!==6?(X=Um(re,ee.mode,ge),X.return=ee,X):(X=y(X,re),X.return=ee,X)}function V(ee,X,re,ge){var ze=re.type;return ze===k?he(ee,X,re.props.children,ge,re.key):X!==null&&(X.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===T&&Xi(ze)===X.type)?(X=y(X,re.props),hc(X,re),X.return=ee,X):(X=Ud(re.type,re.key,re.props,null,ee.mode,ge),hc(X,re),X.return=ee,X)}function oe(ee,X,re,ge){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=Pm(re,ee.mode,ge),X.return=ee,X):(X=y(X,re.children||[]),X.return=ee,X)}function he(ee,X,re,ge,ze){return X===null||X.tag!==7?(X=Zi(re,ee.mode,ge,ze),X.return=ee,X):(X=y(X,re),X.return=ee,X)}function ve(ee,X,re){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Um(""+X,ee.mode,re),X.return=ee,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case v:return re=Ud(X.type,X.key,X.props,null,ee.mode,re),hc(re,X),re.return=ee,re;case _:return X=Pm(X,ee.mode,re),X.return=ee,X;case T:return X=Xi(X),ve(ee,X,re)}if(K(X)||H(X))return X=Zi(X,ee.mode,re,null),X.return=ee,X;if(typeof X.then=="function")return ve(ee,Zd(X),re);if(X.$$typeof===A)return ve(ee,Bd(ee,X),re);Kd(ee,X)}return null}function ae(ee,X,re,ge){var ze=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return ze!==null?null:M(ee,X,""+re,ge);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===ze?V(ee,X,re,ge):null;case _:return re.key===ze?oe(ee,X,re,ge):null;case T:return re=Xi(re),ae(ee,X,re,ge)}if(K(re)||H(re))return ze!==null?null:he(ee,X,re,ge,null);if(typeof re.then=="function")return ae(ee,X,Zd(re),ge);if(re.$$typeof===A)return ae(ee,X,Bd(ee,re),ge);Kd(ee,re)}return null}function ue(ee,X,re,ge,ze){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ee=ee.get(re)||null,M(X,ee,""+ge,ze);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:return ee=ee.get(ge.key===null?re:ge.key)||null,V(X,ee,ge,ze);case _:return ee=ee.get(ge.key===null?re:ge.key)||null,oe(X,ee,ge,ze);case T:return ge=Xi(ge),ue(ee,X,re,ge,ze)}if(K(ge)||H(ge))return ee=ee.get(re)||null,he(X,ee,ge,ze,null);if(typeof ge.then=="function")return ue(ee,X,re,Zd(ge),ze);if(ge.$$typeof===A)return ue(ee,X,re,Bd(X,ge),ze);Kd(X,ge)}return null}function Ne(ee,X,re,ge){for(var ze=null,st=null,Te=X,Ge=X=0,tt=null;Te!==null&&Ge<re.length;Ge++){Te.index>Ge?(tt=Te,Te=null):tt=Te.sibling;var at=ae(ee,Te,re[Ge],ge);if(at===null){Te===null&&(Te=tt);break}o&&Te&&at.alternate===null&&s(ee,Te),X=b(at,X,Ge),st===null?ze=at:st.sibling=at,st=at,Te=tt}if(Ge===re.length)return l(ee,Te),nt&&Zr(ee,Ge),ze;if(Te===null){for(;Ge<re.length;Ge++)Te=ve(ee,re[Ge],ge),Te!==null&&(X=b(Te,X,Ge),st===null?ze=Te:st.sibling=Te,st=Te);return nt&&Zr(ee,Ge),ze}for(Te=d(Te);Ge<re.length;Ge++)tt=ue(Te,ee,Ge,re[Ge],ge),tt!==null&&(o&&tt.alternate!==null&&Te.delete(tt.key===null?Ge:tt.key),X=b(tt,X,Ge),st===null?ze=tt:st.sibling=tt,st=tt);return o&&Te.forEach(function(ei){return s(ee,ei)}),nt&&Zr(ee,Ge),ze}function Ue(ee,X,re,ge){if(re==null)throw Error(r(151));for(var ze=null,st=null,Te=X,Ge=X=0,tt=null,at=re.next();Te!==null&&!at.done;Ge++,at=re.next()){Te.index>Ge?(tt=Te,Te=null):tt=Te.sibling;var ei=ae(ee,Te,at.value,ge);if(ei===null){Te===null&&(Te=tt);break}o&&Te&&ei.alternate===null&&s(ee,Te),X=b(ei,X,Ge),st===null?ze=ei:st.sibling=ei,st=ei,Te=tt}if(at.done)return l(ee,Te),nt&&Zr(ee,Ge),ze;if(Te===null){for(;!at.done;Ge++,at=re.next())at=ve(ee,at.value,ge),at!==null&&(X=b(at,X,Ge),st===null?ze=at:st.sibling=at,st=at);return nt&&Zr(ee,Ge),ze}for(Te=d(Te);!at.done;Ge++,at=re.next())at=ue(Te,ee,Ge,at.value,ge),at!==null&&(o&&at.alternate!==null&&Te.delete(at.key===null?Ge:at.key),X=b(at,X,Ge),st===null?ze=at:st.sibling=at,st=at);return o&&Te.forEach(function(aD){return s(ee,aD)}),nt&&Zr(ee,Ge),ze}function bt(ee,X,re,ge){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 ze=re.key;X!==null;){if(X.key===ze){if(ze=re.type,ze===k){if(X.tag===7){l(ee,X.sibling),ge=y(X,re.props.children),ge.return=ee,ee=ge;break e}}else if(X.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===T&&Xi(ze)===X.type){l(ee,X.sibling),ge=y(X,re.props),hc(ge,re),ge.return=ee,ee=ge;break e}l(ee,X);break}else s(ee,X);X=X.sibling}re.type===k?(ge=Zi(re.props.children,ee.mode,ge,re.key),ge.return=ee,ee=ge):(ge=Ud(re.type,re.key,re.props,null,ee.mode,ge),hc(ge,re),ge.return=ee,ee=ge)}return j(ee);case _:e:{for(ze=re.key;X!==null;){if(X.key===ze)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){l(ee,X.sibling),ge=y(X,re.children||[]),ge.return=ee,ee=ge;break e}else{l(ee,X);break}else s(ee,X);X=X.sibling}ge=Pm(re,ee.mode,ge),ge.return=ee,ee=ge}return j(ee);case T:return re=Xi(re),bt(ee,X,re,ge)}if(K(re))return Ne(ee,X,re,ge);if(H(re)){if(ze=H(re),typeof ze!="function")throw Error(r(150));return re=ze.call(re),Ue(ee,X,re,ge)}if(typeof re.then=="function")return bt(ee,X,Zd(re),ge);if(re.$$typeof===A)return bt(ee,X,Bd(ee,re),ge);Kd(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,X!==null&&X.tag===6?(l(ee,X.sibling),ge=y(X,re),ge.return=ee,ee=ge):(l(ee,X),ge=Um(re,ee.mode,ge),ge.return=ee,ee=ge),j(ee)):l(ee,X)}return function(ee,X,re,ge){try{fc=0;var ze=bt(ee,X,re,ge);return ka=null,ze}catch(Te){if(Te===xa||Te===qd)throw Te;var st=Fn(29,Te,null,ee.mode);return st.lanes=ge,st.return=ee,st}finally{}}}var Ji=yk(!0),bk=yk(!1),Lo=!1;function Wm(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jm(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 Io(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Uo(o,s,l){var d=o.updateQueue;if(d===null)return null;if(d=d.shared,(ut&2)!==0){var y=d.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),d.pending=s,s=Id(o),tk(o,null,l),s}return Ld(o,d,s,l),Id(o)}function pc(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,Gl(o,l)}}function eg(o,s){var l=o.updateQueue,d=o.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var y=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?y=b=j:b=b.next=j,l=l.next}while(l!==null);b===null?y=b=s:b=b.next=s}else y=b=s;l={baseState:d.baseState,firstBaseUpdate:y,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 tg=!1;function mc(){if(tg){var o=wa;if(o!==null)throw o}}function gc(o,s,l,d){tg=!1;var y=o.updateQueue;Lo=!1;var b=y.firstBaseUpdate,j=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var V=M,oe=V.next;V.next=null,j===null?b=oe:j.next=oe,j=V;var he=o.alternate;he!==null&&(he=he.updateQueue,M=he.lastBaseUpdate,M!==j&&(M===null?he.firstBaseUpdate=oe:M.next=oe,he.lastBaseUpdate=V))}if(b!==null){var ve=y.baseState;j=0,he=oe=V=null,M=b;do{var ae=M.lane&-536870913,ue=ae!==M.lane;if(ue?(et&ae)===ae:(d&ae)===ae){ae!==0&&ae===va&&(tg=!0),he!==null&&(he=he.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ne=o,Ue=M;ae=s;var bt=l;switch(Ue.tag){case 1:if(Ne=Ue.payload,typeof Ne=="function"){ve=Ne.call(bt,ve,ae);break e}ve=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ue.payload,ae=typeof Ne=="function"?Ne.call(bt,ve,ae):Ne,ae==null)break e;ve=m({},ve,ae);break e;case 2:Lo=!0}}ae=M.callback,ae!==null&&(o.flags|=64,ue&&(o.flags|=8192),ue=y.callbacks,ue===null?y.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},he===null?(oe=he=ue,V=ve):he=he.next=ue,j|=ae;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;ue=M,M=ue.next,ue.next=null,y.lastBaseUpdate=ue,y.shared.pending=null}}while(!0);he===null&&(V=ve),y.baseState=V,y.firstBaseUpdate=oe,y.lastBaseUpdate=he,b===null&&(y.shared.lanes=0),qo|=j,o.lanes=j,o.memoizedState=ve}}function vk(o,s){if(typeof o!="function")throw Error(r(191,o));o.call(s)}function wk(o,s){var l=o.callbacks;if(l!==null)for(o.callbacks=null,o=0;o<l.length;o++)vk(l[o],s)}var _a=L(null),Gd=L(0);function xk(o,s){o=ro,D(Gd,o),D(_a,s),ro=o|s.baseLanes}function ng(){D(Gd,ro),D(_a,_a.current)}function rg(){ro=Gd.current,Q(_a),Q(Gd)}var Bn=L(null),ar=null;function Po(o){var s=o.alternate;D(Ut,Ut.current&1),D(Bn,o),ar===null&&(s===null||_a.current!==null||s.memoizedState!==null)&&(ar=o)}function og(o){D(Ut,Ut.current),D(Bn,o),ar===null&&(ar=o)}function kk(o){o.tag===22?(D(Ut,Ut.current),D(Bn,o),ar===null&&(ar=o)):Fo()}function Fo(){D(Ut,Ut.current),D(Bn,Bn.current)}function Hn(o){Q(Bn),ar===o&&(ar=null),Q(Ut)}var Ut=L(0);function Yd(o){for(var s=o;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||uy(l)||dy(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 Yr=0,Ze=null,gt=null,Bt=null,Qd=!1,Sa=!1,es=!1,Xd=0,yc=0,Ea=null,X3=0;function Rt(){throw Error(r(321))}function ig(o,s){if(s===null)return!1;for(var l=0;l<s.length&&l<o.length;l++)if(!Pn(o[l],s[l]))return!1;return!0}function sg(o,s,l,d,y,b){return Yr=b,Ze=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,N.H=o===null||o.memoizedState===null?i_:xg,es=!1,b=l(d,y),es=!1,Sa&&(b=Sk(s,l,d,y)),_k(o),b}function _k(o){N.H=wc;var s=gt!==null&>.next!==null;if(Yr=0,Bt=gt=Ze=null,Qd=!1,yc=0,Ea=null,s)throw Error(r(300));o===null||Ht||(o=o.dependencies,o!==null&&Fd(o)&&(Ht=!0))}function Sk(o,s,l,d){Ze=o;var y=0;do{if(Sa&&(Ea=null),yc=0,Sa=!1,25<=y)throw Error(r(301));if(y+=1,Bt=gt=null,o.updateQueue!=null){var b=o.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}N.H=s_,b=s(l,d)}while(Sa);return b}function W3(){var o=N.H,s=o.useState()[0];return s=typeof s.then=="function"?bc(s):s,o=o.useState()[0],(gt!==null?gt.memoizedState:null)!==o&&(Ze.flags|=1024),s}function ag(){var o=Xd!==0;return Xd=0,o}function lg(o,s,l){s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~l}function cg(o){if(Qd){for(o=o.memoizedState;o!==null;){var s=o.queue;s!==null&&(s.pending=null),o=o.next}Qd=!1}Yr=0,Bt=gt=Ze=null,Sa=!1,yc=Xd=0,Ea=null}function yn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ze.memoizedState=Bt=o:Bt=Bt.next=o,Bt}function Pt(){if(gt===null){var o=Ze.alternate;o=o!==null?o.memoizedState:null}else o=gt.next;var s=Bt===null?Ze.memoizedState:Bt.next;if(s!==null)Bt=s,gt=o;else{if(o===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));gt=o,o={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Bt===null?Ze.memoizedState=Bt=o:Bt=Bt.next=o}return Bt}function Wd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bc(o){var s=yc;return yc+=1,Ea===null&&(Ea=[]),o=pk(Ea,o,s),s=Ze,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,N.H=s===null||s.memoizedState===null?i_:xg),o}function Jd(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return bc(o);if(o.$$typeof===A)return sn(o)}throw Error(r(438,String(o)))}function ug(o){var s=null,l=Ze.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Wd(),Ze.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 Qr(o,s){return typeof s=="function"?s(o):s}function ef(o){var s=Pt();return dg(s,gt,o)}function dg(o,s,l){var d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var y=o.baseQueue,b=d.pending;if(b!==null){if(y!==null){var j=y.next;y.next=b.next,b.next=j}s.baseQueue=y=b,d.pending=null}if(b=o.baseState,y===null)o.memoizedState=b;else{s=y.next;var M=j=null,V=null,oe=s,he=!1;do{var ve=oe.lane&-536870913;if(ve!==oe.lane?(et&ve)===ve:(Yr&ve)===ve){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}),ve===va&&(he=!0);else if((Yr&ae)===ae){oe=oe.next,ae===va&&(he=!0);continue}else ve={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(M=V=ve,j=b):V=V.next=ve,Ze.lanes|=ae,qo|=ae;ve=oe.action,es&&l(b,ve),b=oe.hasEagerState?oe.eagerState:l(b,ve)}else ae={lane:ve,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},V===null?(M=V=ae,j=b):V=V.next=ae,Ze.lanes|=ve,qo|=ve;oe=oe.next}while(oe!==null&&oe!==s);if(V===null?j=b:V.next=M,!Pn(b,o.memoizedState)&&(Ht=!0,he&&(l=wa,l!==null)))throw l;o.memoizedState=b,o.baseState=j,o.baseQueue=V,d.lastRenderedState=b}return y===null&&(d.lanes=0),[o.memoizedState,d.dispatch]}function fg(o){var s=Pt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=l.dispatch,y=l.pending,b=s.memoizedState;if(y!==null){l.pending=null;var j=y=y.next;do b=o(b,j.action),j=j.next;while(j!==y);Pn(b,s.memoizedState)||(Ht=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),l.lastRenderedState=b}return[b,d]}function Ek(o,s,l){var d=Ze,y=Pt(),b=nt;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=s();var j=!Pn((gt||y).memoizedState,l);if(j&&(y.memoizedState=l,Ht=!0),y=y.queue,mg(Ak.bind(null,d,y,o),[o]),y.getSnapshot!==s||j||Bt!==null&&Bt.memoizedState.tag&1){if(d.flags|=2048,ja(9,{destroy:void 0},Ok.bind(null,d,y,l,s),null),xt===null)throw Error(r(349));b||(Yr&127)!==0||jk(d,s,l)}return l}function jk(o,s,l){o.flags|=16384,o={getSnapshot:s,value:l},s=Ze.updateQueue,s===null?(s=Wd(),Ze.updateQueue=s,s.stores=[o]):(l=s.stores,l===null?s.stores=[o]:l.push(o))}function Ok(o,s,l,d){s.value=l,s.getSnapshot=d,Ck(s)&&Nk(o)}function Ak(o,s,l){return l(function(){Ck(s)&&Nk(o)})}function Ck(o){var s=o.getSnapshot;o=o.value;try{var l=s();return!Pn(o,l)}catch{return!0}}function Nk(o){var s=Vi(o,2);s!==null&&Mn(s,o,2)}function hg(o){var s=yn();if(typeof o=="function"){var l=o;if(o=l(),es){rn(!0);try{l()}finally{rn(!1)}}}return s.memoizedState=s.baseState=o,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:o},s}function Mk(o,s,l,d){return o.baseState=l,dg(o,gt,typeof d=="function"?d:Qr)}function J3(o,s,l,d,y){if(rf(o))throw Error(r(485));if(o=s.action,o!==null){var b={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){b.listeners.push(j)}};N.T!==null?l(!0):b.isTransition=!1,d(b),l=s.pending,l===null?(b.next=s.pending=b,Rk(s,b)):(b.next=l.next,s.pending=l.next=b)}}function Rk(o,s){var l=s.action,d=s.payload,y=o.state;if(s.isTransition){var b=N.T,j={};N.T=j;try{var M=l(y,d),V=N.S;V!==null&&V(j,M),Tk(o,s,M)}catch(oe){pg(o,s,oe)}finally{b!==null&&j.types!==null&&(b.types=j.types),N.T=b}}else try{b=l(y,d),Tk(o,s,b)}catch(oe){pg(o,s,oe)}}function Tk(o,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){$k(o,s,d)},function(d){return pg(o,s,d)}):$k(o,s,l)}function $k(o,s,l){s.status="fulfilled",s.value=l,zk(s),o.state=l,s=o.pending,s!==null&&(l=s.next,l===s?o.pending=null:(l=l.next,s.next=l,Rk(o,l)))}function pg(o,s,l){var d=o.pending;if(o.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,zk(s),s=s.next;while(s!==d)}o.action=null}function zk(o){o=o.listeners;for(var s=0;s<o.length;s++)(0,o[s])()}function Dk(o,s){return s}function Lk(o,s){if(nt){var l=xt.formState;if(l!==null){e:{var d=Ze;if(nt){if(_t){t:{for(var y=_t,b=sr;y.nodeType!==8;){if(!b){y=null;break t}if(y=lr(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){_t=lr(y.nextSibling),d=y.data==="F!";break e}}zo(d)}d=!1}d&&(s=l[0])}}return l=yn(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dk,lastRenderedState:s},l.queue=d,l=n_.bind(null,Ze,d),d.dispatch=l,d=hg(!1),b=wg.bind(null,Ze,!1,d.queue),d=yn(),y={state:s,dispatch:null,action:o,pending:null},d.queue=y,l=J3.bind(null,Ze,y,b,l),y.dispatch=l,d.memoizedState=o,[s,l,!1]}function Ik(o){var s=Pt();return Uk(s,gt,o)}function Uk(o,s,l){if(s=dg(o,s,Dk)[0],o=ef(Qr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=bc(s)}catch(j){throw j===xa?qd:j}else d=s;s=Pt();var y=s.queue,b=y.dispatch;return l!==s.memoizedState&&(Ze.flags|=2048,ja(9,{destroy:void 0},ez.bind(null,y,l),null)),[d,b,o]}function ez(o,s){o.action=s}function Pk(o){var s=Pt(),l=gt;if(l!==null)return Uk(s,l,o);Pt(),s=s.memoizedState,l=Pt();var d=l.queue.dispatch;return l.memoizedState=o,[s,d,!1]}function ja(o,s,l,d){return o={tag:o,create:l,deps:d,inst:s,next:null},s=Ze.updateQueue,s===null&&(s=Wd(),Ze.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 Fk(){return Pt().memoizedState}function tf(o,s,l,d){var y=yn();Ze.flags|=o,y.memoizedState=ja(1|s,{destroy:void 0},l,d===void 0?null:d)}function nf(o,s,l,d){var y=Pt();d=d===void 0?null:d;var b=y.memoizedState.inst;gt!==null&&d!==null&&ig(d,gt.memoizedState.deps)?y.memoizedState=ja(s,b,l,d):(Ze.flags|=o,y.memoizedState=ja(1|s,b,l,d))}function Bk(o,s){tf(8390656,8,o,s)}function mg(o,s){nf(2048,8,o,s)}function tz(o){Ze.flags|=4;var s=Ze.updateQueue;if(s===null)s=Wd(),Ze.updateQueue=s,s.events=[o];else{var l=s.events;l===null?s.events=[o]:l.push(o)}}function Hk(o){var s=Pt().memoizedState;return tz({ref:s,nextImpl:o}),function(){if((ut&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function qk(o,s){return nf(4,2,o,s)}function Vk(o,s){return nf(4,4,o,s)}function Zk(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 Kk(o,s,l){l=l!=null?l.concat([o]):null,nf(4,4,Zk.bind(null,s,o),l)}function gg(){}function Gk(o,s){var l=Pt();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&ig(s,d[1])?d[0]:(l.memoizedState=[o,s],o)}function Yk(o,s){var l=Pt();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&ig(s,d[1]))return d[0];if(d=o(),es){rn(!0);try{o()}finally{rn(!1)}}return l.memoizedState=[d,s],d}function yg(o,s,l){return l===void 0||(Yr&1073741824)!==0&&(et&261930)===0?o.memoizedState=s:(o.memoizedState=l,o=Q_(),Ze.lanes|=o,qo|=o,l)}function Qk(o,s,l,d){return Pn(l,s)?l:_a.current!==null?(o=yg(o,l,d),Pn(o,s)||(Ht=!0),o):(Yr&42)===0||(Yr&1073741824)!==0&&(et&261930)===0?(Ht=!0,o.memoizedState=l):(o=Q_(),Ze.lanes|=o,qo|=o,s)}function Xk(o,s,l,d,y){var b=B.p;B.p=b!==0&&8>b?b:8;var j=N.T,M={};N.T=M,wg(o,!1,s,l);try{var V=y(),oe=N.S;if(oe!==null&&oe(M,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var he=Q3(V,d);vc(o,s,he,Zn(o))}else vc(o,s,d,Zn(o))}catch(ve){vc(o,s,{then:function(){},status:"rejected",reason:ve},Zn())}finally{B.p=b,j!==null&&M.types!==null&&(j.types=M.types),N.T=j}}function nz(){}function bg(o,s,l,d){if(o.tag!==5)throw Error(r(476));var y=Wk(o).queue;Xk(o,y,s,Y,l===null?nz:function(){return Jk(o),l(d)})}function Wk(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:Y},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:l},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function Jk(o){var s=Wk(o);s.next===null&&(s=o.alternate.memoizedState),vc(o,s.next.queue,{},Zn())}function vg(){return sn(Dc)}function e_(){return Pt().memoizedState}function t_(){return Pt().memoizedState}function rz(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var l=Zn();o=Io(l);var d=Uo(s,o,l);d!==null&&(Mn(d,s,l),pc(d,s,l)),s={cache:Gm()},o.payload=s;return}s=s.return}}function oz(o,s,l){var d=Zn();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},rf(o)?r_(s,l):(l=Lm(o,s,l,d),l!==null&&(Mn(l,o,d),o_(l,s,d)))}function n_(o,s,l){var d=Zn();vc(o,s,l,d)}function vc(o,s,l,d){var y={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(rf(o))r_(s,y);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var j=s.lastRenderedState,M=b(j,l);if(y.hasEagerState=!0,y.eagerState=M,Pn(M,j))return Ld(o,s,y,0),xt===null&&Dd(),!1}catch{}finally{}if(l=Lm(o,s,y,d),l!==null)return Mn(l,o,d),o_(l,s,d),!0}return!1}function wg(o,s,l,d){if(d={lane:2,revertLane:Wg(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},rf(o)){if(s)throw Error(r(479))}else s=Lm(o,l,d,2),s!==null&&Mn(s,o,2)}function rf(o){var s=o.alternate;return o===Ze||s!==null&&s===Ze}function r_(o,s){Sa=Qd=!0;var l=o.pending;l===null?s.next=s:(s.next=l.next,l.next=s),o.pending=s}function o_(o,s,l){if((l&4194048)!==0){var d=s.lanes;d&=o.pendingLanes,l|=d,s.lanes=l,Gl(o,l)}}var wc={readContext:sn,use:Jd,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};wc.useEffectEvent=Rt;var i_={readContext:sn,use:Jd,useCallback:function(o,s){return yn().memoizedState=[o,s===void 0?null:s],o},useContext:sn,useEffect:Bk,useImperativeHandle:function(o,s,l){l=l!=null?l.concat([o]):null,tf(4194308,4,Zk.bind(null,s,o),l)},useLayoutEffect:function(o,s){return tf(4194308,4,o,s)},useInsertionEffect:function(o,s){tf(4,2,o,s)},useMemo:function(o,s){var l=yn();s=s===void 0?null:s;var d=o();if(es){rn(!0);try{o()}finally{rn(!1)}}return l.memoizedState=[d,s],d},useReducer:function(o,s,l){var d=yn();if(l!==void 0){var y=l(s);if(es){rn(!0);try{l(s)}finally{rn(!1)}}}else y=s;return d.memoizedState=d.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},d.queue=o,o=o.dispatch=oz.bind(null,Ze,o),[d.memoizedState,o]},useRef:function(o){var s=yn();return o={current:o},s.memoizedState=o},useState:function(o){o=hg(o);var s=o.queue,l=n_.bind(null,Ze,s);return s.dispatch=l,[o.memoizedState,l]},useDebugValue:gg,useDeferredValue:function(o,s){var l=yn();return yg(l,o,s)},useTransition:function(){var o=hg(!1);return o=Xk.bind(null,Ze,o.queue,!0,!1),yn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,l){var d=Ze,y=yn();if(nt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),xt===null)throw Error(r(349));(et&127)!==0||jk(d,s,l)}y.memoizedState=l;var b={value:l,getSnapshot:s};return y.queue=b,Bk(Ak.bind(null,d,b,o),[o]),d.flags|=2048,ja(9,{destroy:void 0},Ok.bind(null,d,b,l,s),null),l},useId:function(){var o=yn(),s=xt.identifierPrefix;if(nt){var l=Or,d=jr;l=(d&~(1<<32-hn(d)-1)).toString(32)+l,s="_"+s+"R_"+l,l=Xd++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=X3++,s="_"+s+"r_"+l.toString(32)+"_";return o.memoizedState=s},useHostTransitionStatus:vg,useFormState:Lk,useActionState:Lk,useOptimistic:function(o){var s=yn();s.memoizedState=s.baseState=o;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=wg.bind(null,Ze,!0,l),l.dispatch=s,[o,s]},useMemoCache:ug,useCacheRefresh:function(){return yn().memoizedState=rz.bind(null,Ze)},useEffectEvent:function(o){var s=yn(),l={impl:o};return s.memoizedState=l,function(){if((ut&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},xg={readContext:sn,use:Jd,useCallback:Gk,useContext:sn,useEffect:mg,useImperativeHandle:Kk,useInsertionEffect:qk,useLayoutEffect:Vk,useMemo:Yk,useReducer:ef,useRef:Fk,useState:function(){return ef(Qr)},useDebugValue:gg,useDeferredValue:function(o,s){var l=Pt();return Qk(l,gt.memoizedState,o,s)},useTransition:function(){var o=ef(Qr)[0],s=Pt().memoizedState;return[typeof o=="boolean"?o:bc(o),s]},useSyncExternalStore:Ek,useId:e_,useHostTransitionStatus:vg,useFormState:Ik,useActionState:Ik,useOptimistic:function(o,s){var l=Pt();return Mk(l,gt,o,s)},useMemoCache:ug,useCacheRefresh:t_};xg.useEffectEvent=Hk;var s_={readContext:sn,use:Jd,useCallback:Gk,useContext:sn,useEffect:mg,useImperativeHandle:Kk,useInsertionEffect:qk,useLayoutEffect:Vk,useMemo:Yk,useReducer:fg,useRef:Fk,useState:function(){return fg(Qr)},useDebugValue:gg,useDeferredValue:function(o,s){var l=Pt();return gt===null?yg(l,o,s):Qk(l,gt.memoizedState,o,s)},useTransition:function(){var o=fg(Qr)[0],s=Pt().memoizedState;return[typeof o=="boolean"?o:bc(o),s]},useSyncExternalStore:Ek,useId:e_,useHostTransitionStatus:vg,useFormState:Pk,useActionState:Pk,useOptimistic:function(o,s){var l=Pt();return gt!==null?Mk(l,gt,o,s):(l.baseState=o,[o,l.queue.dispatch])},useMemoCache:ug,useCacheRefresh:t_};s_.useEffectEvent=Hk;function kg(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 _g={enqueueSetState:function(o,s,l){o=o._reactInternals;var d=Zn(),y=Io(d);y.payload=s,l!=null&&(y.callback=l),s=Uo(o,y,d),s!==null&&(Mn(s,o,d),pc(s,o,d))},enqueueReplaceState:function(o,s,l){o=o._reactInternals;var d=Zn(),y=Io(d);y.tag=1,y.payload=s,l!=null&&(y.callback=l),s=Uo(o,y,d),s!==null&&(Mn(s,o,d),pc(s,o,d))},enqueueForceUpdate:function(o,s){o=o._reactInternals;var l=Zn(),d=Io(l);d.tag=2,s!=null&&(d.callback=s),s=Uo(o,d,l),s!==null&&(Mn(s,o,l),pc(s,o,l))}};function a_(o,s,l,d,y,b,j){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(d,b,j):s.prototype&&s.prototype.isPureReactComponent?!sc(l,d)||!sc(y,b):!0}function l_(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&&_g.enqueueReplaceState(s,s.state,null)}function ts(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 y in o)l[y]===void 0&&(l[y]=o[y])}return l}function c_(o){zd(o)}function u_(o){console.error(o)}function d_(o){zd(o)}function of(o,s){try{var l=o.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function f_(o,s,l){try{var d=o.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Sg(o,s,l){return l=Io(l),l.tag=3,l.payload={element:null},l.callback=function(){of(o,s)},l}function h_(o){return o=Io(o),o.tag=3,o}function p_(o,s,l,d){var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var b=d.value;o.payload=function(){return y(b)},o.callback=function(){f_(s,l,d)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(o.callback=function(){f_(s,l,d),typeof y!="function"&&(Vo===null?Vo=new Set([this]):Vo.add(this));var M=d.stack;this.componentDidCatch(d.value,{componentStack:M!==null?M:""})})}function iz(o,s,l,d,y){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&ba(s,l,y,!0),l=Bn.current,l!==null){switch(l.tag){case 31:case 13:return ar===null?yf():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=y,d===Vd?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),Yg(o,d,y)),!1;case 22:return l.flags|=65536,d===Vd?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)),Yg(o,d,y)),!1}throw Error(r(435,l.tag))}return Yg(o,d,y),yf(),!1}if(nt)return s=Bn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,d!==Hm&&(o=Error(r(422),{cause:d}),cc(rr(o,l)))):(d!==Hm&&(s=Error(r(423),{cause:d}),cc(rr(s,l))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,d=rr(d,l),y=Sg(o.stateNode,d,y),eg(o,y),Tt!==4&&(Tt=2)),!1;var b=Error(r(520),{cause:d});if(b=rr(b,l),Ac===null?Ac=[b]:Ac.push(b),Tt!==4&&(Tt=2),s===null)return!0;d=rr(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,o=y&-y,l.lanes|=o,o=Sg(l.stateNode,d,o),eg(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"&&(Vo===null||!Vo.has(b))))return l.flags|=65536,y&=-y,l.lanes|=y,y=h_(y),p_(y,o,l,d),eg(l,y),!1}l=l.return}while(l!==null);return!1}var Eg=Error(r(461)),Ht=!1;function an(o,s,l,d){s.child=o===null?bk(s,null,l,d):Ji(s,o.child,l,d)}function m_(o,s,l,d,y){l=l.render;var b=s.ref;if("ref"in d){var j={};for(var M in d)M!=="ref"&&(j[M]=d[M])}else j=d;return Yi(s),d=sg(o,s,l,j,b,y),M=ag(),o!==null&&!Ht?(lg(o,s,y),Xr(o,s,y)):(nt&&M&&Fm(s),s.flags|=1,an(o,s,d,y),s.child)}function g_(o,s,l,d,y){if(o===null){var b=l.type;return typeof b=="function"&&!Im(b)&&b.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=b,y_(o,s,b,d,y)):(o=Ud(l.type,null,d,s,s.mode,y),o.ref=s.ref,o.return=s,s.child=o)}if(b=o.child,!Tg(o,y)){var j=b.memoizedProps;if(l=l.compare,l=l!==null?l:sc,l(j,d)&&o.ref===s.ref)return Xr(o,s,y)}return s.flags|=1,o=Vr(b,d),o.ref=s.ref,o.return=s,s.child=o}function y_(o,s,l,d,y){if(o!==null){var b=o.memoizedProps;if(sc(b,d)&&o.ref===s.ref)if(Ht=!1,s.pendingProps=d=b,Tg(o,y))(o.flags&131072)!==0&&(Ht=!0);else return s.lanes=o.lanes,Xr(o,s,y)}return jg(o,s,l,d,y)}function b_(o,s,l,d){var y=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,y=0;d!==null;)y=y|d.lanes|d.childLanes,d=d.sibling;d=y&~b}else d=0,s.child=null;return v_(o,s,b,l,d)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},o!==null&&Hd(s,b!==null?b.cachePool:null),b!==null?xk(s,b):ng(),kk(s);else return d=s.lanes=536870912,v_(o,s,b!==null?b.baseLanes|l:l,l,d)}else b!==null?(Hd(s,b.cachePool),xk(s,b),Fo(),s.memoizedState=null):(o!==null&&Hd(s,null),ng(),Fo());return an(o,s,y,l),s.child}function xc(o,s){return o!==null&&o.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function v_(o,s,l,d,y){var b=Qm();return b=b===null?null:{parent:Ft._currentValue,pool:b},s.memoizedState={baseLanes:l,cachePool:b},o!==null&&Hd(s,null),ng(),kk(s),o!==null&&ba(o,s,d,!0),s.childLanes=y,null}function sf(o,s){return s=lf({mode:s.mode,children:s.children},o.mode),s.ref=o.ref,o.child=s,s.return=o,s}function w_(o,s,l){return Ji(s,o.child,null,l),o=sf(s,s.pendingProps),o.flags|=2,Hn(s),s.memoizedState=null,o}function sz(o,s,l){var d=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,o===null){if(nt){if(d.mode==="hidden")return o=sf(s,d),s.lanes=536870912,xc(null,o);if(og(s),(o=_t)?(o=RS(o,sr),o=o!==null&&o.data==="&"?o:null,o!==null&&(s.memoizedState={dehydrated:o,treeContext:To!==null?{id:jr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},l=rk(o),l.return=s,s.child=l,on=s,_t=null)):o=null,o===null)throw zo(s);return s.lanes=536870912,null}return sf(s,d)}var b=o.memoizedState;if(b!==null){var j=b.dehydrated;if(og(s),y)if(s.flags&256)s.flags&=-257,s=w_(o,s,l);else if(s.memoizedState!==null)s.child=o.child,s.flags|=128,s=null;else throw Error(r(558));else if(Ht||ba(o,s,l,!1),y=(l&o.childLanes)!==0,Ht||y){if(d=xt,d!==null&&(j=Sd(d,l),j!==0&&j!==b.retryLane))throw b.retryLane=j,Vi(o,j),Mn(d,o,j),Eg;yf(),s=w_(o,s,l)}else o=b.treeContext,_t=lr(j.nextSibling),on=s,nt=!0,$o=null,sr=!1,o!==null&&sk(s,o),s=sf(s,d),s.flags|=4096;return s}return o=Vr(o.child,{mode:d.mode,children:d.children}),o.ref=s.ref,s.child=o,o.return=s,o}function af(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 jg(o,s,l,d,y){return Yi(s),l=sg(o,s,l,d,void 0,y),d=ag(),o!==null&&!Ht?(lg(o,s,y),Xr(o,s,y)):(nt&&d&&Fm(s),s.flags|=1,an(o,s,l,y),s.child)}function x_(o,s,l,d,y,b){return Yi(s),s.updateQueue=null,l=Sk(s,d,l,y),_k(o),d=ag(),o!==null&&!Ht?(lg(o,s,b),Xr(o,s,b)):(nt&&d&&Fm(s),s.flags|=1,an(o,s,l,b),s.child)}function k_(o,s,l,d,y){if(Yi(s),s.stateNode===null){var b=pa,j=l.contextType;typeof j=="object"&&j!==null&&(b=sn(j)),b=new l(d,b),s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=_g,s.stateNode=b,b._reactInternals=s,b=s.stateNode,b.props=d,b.state=s.memoizedState,b.refs={},Wm(s),j=l.contextType,b.context=typeof j=="object"&&j!==null?sn(j):pa,b.state=s.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(kg(s,l,j,d),b.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(j=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),j!==b.state&&_g.enqueueReplaceState(b,b.state,null),gc(s,d,b,y),mc(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(o===null){b=s.stateNode;var M=s.memoizedProps,V=ts(l,M);b.props=V;var oe=b.context,he=l.contextType;j=pa,typeof he=="object"&&he!==null&&(j=sn(he));var ve=l.getDerivedStateFromProps;he=typeof ve=="function"||typeof b.getSnapshotBeforeUpdate=="function",M=s.pendingProps!==M,he||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(M||oe!==j)&&l_(s,b,d,j),Lo=!1;var ae=s.memoizedState;b.state=ae,gc(s,d,b,y),mc(),oe=s.memoizedState,M||ae!==oe||Lo?(typeof ve=="function"&&(kg(s,l,ve,d),oe=s.memoizedState),(V=Lo||a_(s,l,V,d,ae,oe,j))?(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=j,d=V):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{b=s.stateNode,Jm(o,s),j=s.memoizedProps,he=ts(l,j),b.props=he,ve=s.pendingProps,ae=b.context,oe=l.contextType,V=pa,typeof oe=="object"&&oe!==null&&(V=sn(oe)),M=l.getDerivedStateFromProps,(oe=typeof M=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(j!==ve||ae!==V)&&l_(s,b,d,V),Lo=!1,ae=s.memoizedState,b.state=ae,gc(s,d,b,y),mc();var ue=s.memoizedState;j!==ve||ae!==ue||Lo||o!==null&&o.dependencies!==null&&Fd(o.dependencies)?(typeof M=="function"&&(kg(s,l,M,d),ue=s.memoizedState),(he=Lo||a_(s,l,he,d,ae,ue,V)||o!==null&&o.dependencies!==null&&Fd(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"||j===o.memoizedProps&&ae===o.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===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"||j===o.memoizedProps&&ae===o.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===o.memoizedProps&&ae===o.memoizedState||(s.flags|=1024),d=!1)}return b=d,af(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=Ji(s,o.child,null,y),s.child=Ji(s,null,l,y)):an(o,s,l,y),s.memoizedState=b.state,o=s.child):o=Xr(o,s,y),o}function __(o,s,l,d){return Ki(),s.flags|=256,an(o,s,l,d),s.child}var Og={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ag(o){return{baseLanes:o,cachePool:fk()}}function Cg(o,s,l){return o=o!==null?o.childLanes&~l:0,s&&(o|=Vn),o}function S_(o,s,l){var d=s.pendingProps,y=!1,b=(s.flags&128)!==0,j;if((j=b)||(j=o!==null&&o.memoizedState===null?!1:(Ut.current&2)!==0),j&&(y=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,o===null){if(nt){if(y?Po(s):Fo(),(o=_t)?(o=RS(o,sr),o=o!==null&&o.data!=="&"?o:null,o!==null&&(s.memoizedState={dehydrated:o,treeContext:To!==null?{id:jr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},l=rk(o),l.return=s,s.child=l,on=s,_t=null)):o=null,o===null)throw zo(s);return dy(o)?s.lanes=32:s.lanes=536870912,null}var M=d.children;return d=d.fallback,y?(Fo(),y=s.mode,M=lf({mode:"hidden",children:M},y),d=Zi(d,y,l,null),M.return=s,d.return=s,M.sibling=d,s.child=M,d=s.child,d.memoizedState=Ag(l),d.childLanes=Cg(o,j,l),s.memoizedState=Og,xc(null,d)):(Po(s),Ng(s,M))}var V=o.memoizedState;if(V!==null&&(M=V.dehydrated,M!==null)){if(b)s.flags&256?(Po(s),s.flags&=-257,s=Mg(o,s,l)):s.memoizedState!==null?(Fo(),s.child=o.child,s.flags|=128,s=null):(Fo(),M=d.fallback,y=s.mode,d=lf({mode:"visible",children:d.children},y),M=Zi(M,y,l,null),M.flags|=2,d.return=s,M.return=s,d.sibling=M,s.child=d,Ji(s,o.child,null,l),d=s.child,d.memoizedState=Ag(l),d.childLanes=Cg(o,j,l),s.memoizedState=Og,s=xc(null,d));else if(Po(s),dy(M)){if(j=M.nextSibling&&M.nextSibling.dataset,j)var oe=j.dgst;j=oe,d=Error(r(419)),d.stack="",d.digest=j,cc({value:d,source:null,stack:null}),s=Mg(o,s,l)}else if(Ht||ba(o,s,l,!1),j=(l&o.childLanes)!==0,Ht||j){if(j=xt,j!==null&&(d=Sd(j,l),d!==0&&d!==V.retryLane))throw V.retryLane=d,Vi(o,d),Mn(j,o,d),Eg;uy(M)||yf(),s=Mg(o,s,l)}else uy(M)?(s.flags|=192,s.child=o.child,s=null):(o=V.treeContext,_t=lr(M.nextSibling),on=s,nt=!0,$o=null,sr=!1,o!==null&&sk(s,o),s=Ng(s,d.children),s.flags|=4096);return s}return y?(Fo(),M=d.fallback,y=s.mode,V=o.child,oe=V.sibling,d=Vr(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&65011712,oe!==null?M=Vr(oe,M):(M=Zi(M,y,l,null),M.flags|=2),M.return=s,d.return=s,d.sibling=M,s.child=d,xc(null,d),d=s.child,M=o.child.memoizedState,M===null?M=Ag(l):(y=M.cachePool,y!==null?(V=Ft._currentValue,y=y.parent!==V?{parent:V,pool:V}:y):y=fk(),M={baseLanes:M.baseLanes|l,cachePool:y}),d.memoizedState=M,d.childLanes=Cg(o,j,l),s.memoizedState=Og,xc(o.child,d)):(Po(s),l=o.child,o=l.sibling,l=Vr(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,o!==null&&(j=s.deletions,j===null?(s.deletions=[o],s.flags|=16):j.push(o)),s.child=l,s.memoizedState=null,l)}function Ng(o,s){return s=lf({mode:"visible",children:s},o.mode),s.return=o,o.child=s}function lf(o,s){return o=Fn(22,o,null,s),o.lanes=0,o}function Mg(o,s,l){return Ji(s,o.child,null,l),o=Ng(s,s.pendingProps.children),o.flags|=2,s.memoizedState=null,o}function E_(o,s,l){o.lanes|=s;var d=o.alternate;d!==null&&(d.lanes|=s),Zm(o.return,s,l)}function Rg(o,s,l,d,y,b){var j=o.memoizedState;j===null?o.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:y,treeForkCount:b}:(j.isBackwards=s,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=l,j.tailMode=y,j.treeForkCount=b)}function j_(o,s,l){var d=s.pendingProps,y=d.revealOrder,b=d.tail;d=d.children;var j=Ut.current,M=(j&2)!==0;if(M?(j=j&1|2,s.flags|=128):j&=1,D(Ut,j),an(o,s,d,l),d=nt?lc:0,!M&&o!==null&&(o.flags&128)!==0)e:for(o=s.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&E_(o,l,s);else if(o.tag===19)E_(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(y){case"forwards":for(l=s.child,y=null;l!==null;)o=l.alternate,o!==null&&Yd(o)===null&&(y=l),l=l.sibling;l=y,l===null?(y=s.child,s.child=null):(y=l.sibling,l.sibling=null),Rg(s,!1,y,l,b,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,y=s.child,s.child=null;y!==null;){if(o=y.alternate,o!==null&&Yd(o)===null){s.child=y;break}o=y.sibling,y.sibling=l,l=y,y=o}Rg(s,!0,l,null,b,d);break;case"together":Rg(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function Xr(o,s,l){if(o!==null&&(s.dependencies=o.dependencies),qo|=s.lanes,(l&s.childLanes)===0)if(o!==null){if(ba(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=Vr(o,o.pendingProps),s.child=l,l.return=s;o.sibling!==null;)o=o.sibling,l=l.sibling=Vr(o,o.pendingProps),l.return=s;l.sibling=null}return s.child}function Tg(o,s){return(o.lanes&s)!==0?!0:(o=o.dependencies,!!(o!==null&&Fd(o)))}function az(o,s,l){switch(s.tag){case 3:pe(s,s.stateNode.containerInfo),Do(s,Ft,o.memoizedState.cache),Ki();break;case 27:case 5:ce(s);break;case 4:pe(s,s.stateNode.containerInfo);break;case 10:Do(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,og(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(Po(s),s.flags|=128,null):(l&s.child.childLanes)!==0?S_(o,s,l):(Po(s),o=Xr(o,s,l),o!==null?o.sibling:null);Po(s);break;case 19:var y=(o.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(ba(o,s,l,!1),d=(l&s.childLanes)!==0),y){if(d)return j_(o,s,l);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),D(Ut,Ut.current),d)break;return null;case 22:return s.lanes=0,b_(o,s,l,s.pendingProps);case 24:Do(s,Ft,o.memoizedState.cache)}return Xr(o,s,l)}function O_(o,s,l){if(o!==null)if(o.memoizedProps!==s.pendingProps)Ht=!0;else{if(!Tg(o,l)&&(s.flags&128)===0)return Ht=!1,az(o,s,l);Ht=(o.flags&131072)!==0}else Ht=!1,nt&&(s.flags&1048576)!==0&&ik(s,lc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(o=Xi(s.elementType),s.type=o,typeof o=="function")Im(o)?(d=ts(o,d),s.tag=1,s=k_(null,s,o,d,l)):(s.tag=0,s=jg(null,s,o,d,l));else{if(o!=null){var y=o.$$typeof;if(y===R){s.tag=11,s=m_(null,s,o,d,l);break e}else if(y===$){s.tag=14,s=g_(null,s,o,d,l);break e}}throw s=z(o)||o,Error(r(306,s,""))}}return s;case 0:return jg(o,s,s.type,s.pendingProps,l);case 1:return d=s.type,y=ts(d,s.pendingProps),k_(o,s,d,y,l);case 3:e:{if(pe(s,s.stateNode.containerInfo),o===null)throw Error(r(387));d=s.pendingProps;var b=s.memoizedState;y=b.element,Jm(o,s),gc(s,d,null,l);var j=s.memoizedState;if(d=j.cache,Do(s,Ft,d),d!==b.cache&&Km(s,[Ft],l,!0),mc(),d=j.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){s=__(o,s,d,l);break e}else if(d!==y){y=rr(Error(r(424)),s),cc(y),s=__(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(_t=lr(o.firstChild),on=s,nt=!0,$o=null,sr=!0,l=bk(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Ki(),d===y){s=Xr(o,s,l);break e}an(o,s,d,l)}s=s.child}return s;case 26:return af(o,s),o===null?(l=IS(s.type,null,s.pendingProps,null))?s.memoizedState=l:nt||(l=s.type,o=s.pendingProps,d=Sf(de.current).createElement(l),d[Xe]=s,d[He]=o,ln(d,l,o),Wt(d),s.stateNode=d):s.memoizedState=IS(s.type,o.memoizedProps,s.pendingProps,o.memoizedState),null;case 27:return ce(s),o===null&&nt&&(d=s.stateNode=zS(s.type,s.pendingProps,de.current),on=s,sr=!0,y=_t,Yo(s.type)?(fy=y,_t=lr(d.firstChild)):_t=y),an(o,s,s.pendingProps.children,l),af(o,s),o===null&&(s.flags|=4194304),s.child;case 5:return o===null&&nt&&((y=d=_t)&&(d=Lz(d,s.type,s.pendingProps,sr),d!==null?(s.stateNode=d,on=s,_t=lr(d.firstChild),sr=!1,y=!0):y=!1),y||zo(s)),ce(s),y=s.type,b=s.pendingProps,j=o!==null?o.memoizedProps:null,d=b.children,ay(y,b)?d=null:j!==null&&ay(y,j)&&(s.flags|=32),s.memoizedState!==null&&(y=sg(o,s,W3,null,null,l),Dc._currentValue=y),af(o,s),an(o,s,d,l),s.child;case 6:return o===null&&nt&&((o=l=_t)&&(l=Iz(l,s.pendingProps,sr),l!==null?(s.stateNode=l,on=s,_t=null,o=!0):o=!1),o||zo(s)),null;case 13:return S_(o,s,l);case 4:return pe(s,s.stateNode.containerInfo),d=s.pendingProps,o===null?s.child=Ji(s,null,d,l):an(o,s,d,l),s.child;case 11:return m_(o,s,s.type,s.pendingProps,l);case 7:return an(o,s,s.pendingProps,l),s.child;case 8:return an(o,s,s.pendingProps.children,l),s.child;case 12:return an(o,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,Do(s,s.type,d.value),an(o,s,d.children,l),s.child;case 9:return y=s.type._context,d=s.pendingProps.children,Yi(s),y=sn(y),d=d(y),s.flags|=1,an(o,s,d,l),s.child;case 14:return g_(o,s,s.type,s.pendingProps,l);case 15:return y_(o,s,s.type,s.pendingProps,l);case 19:return j_(o,s,l);case 31:return sz(o,s,l);case 22:return b_(o,s,l,s.pendingProps);case 24:return Yi(s),d=sn(Ft),o===null?(y=Qm(),y===null&&(y=xt,b=Gm(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=l),y=b),s.memoizedState={parent:d,cache:y},Wm(s),Do(s,Ft,y)):((o.lanes&l)!==0&&(Jm(o,s),gc(s,null,null,l),mc()),y=o.memoizedState,b=s.memoizedState,y.parent!==d?(y={parent:d,cache:d},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Do(s,Ft,d)):(d=b.cache,Do(s,Ft,d),d!==y.cache&&Km(s,[Ft],l,!0))),an(o,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Wr(o){o.flags|=4}function $g(o,s,l,d,y){if((s=(o.mode&32)!==0)&&(s=!1),s){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(eS())o.flags|=8192;else throw Wi=Vd,Xm}else o.flags&=-16777217}function A_(o,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!HS(s))if(eS())o.flags|=8192;else throw Wi=Vd,Xm}function cf(o,s){s!==null&&(o.flags|=4),o.flags&16384&&(s=o.tag!==22?_d():536870912,o.lanes|=s,Na|=s)}function kc(o,s){if(!nt)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 St(o){var s=o.alternate!==null&&o.alternate.child===o.child,l=0,d=0;if(s)for(var y=o.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags&65011712,d|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=d,o.childLanes=l,s}function lz(o,s,l){var d=s.pendingProps;switch(Bm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(s),null;case 1:return St(s),null;case 3:return l=s.stateNode,d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),Gr(Ft),P(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(o===null||o.child===null)&&(ya(s)?Wr(s):o===null||o.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,qm())),St(s),null;case 26:var y=s.type,b=s.memoizedState;return o===null?(Wr(s),b!==null?(St(s),A_(s,b)):(St(s),$g(s,y,null,d,l))):b?b!==o.memoizedState?(Wr(s),St(s),A_(s,b)):(St(s),s.flags&=-16777217):(o=o.memoizedProps,o!==d&&Wr(s),St(s),$g(s,y,o,d,l)),null;case 27:if(me(s),l=de.current,y=s.type,o!==null&&s.stateNode!=null)o.memoizedProps!==d&&Wr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return St(s),null}o=Z.current,ya(s)?ak(s):(o=zS(y,d,l),s.stateNode=o,Wr(s))}return St(s),null;case 5:if(me(s),y=s.type,o!==null&&s.stateNode!=null)o.memoizedProps!==d&&Wr(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return St(s),null}if(b=Z.current,ya(s))ak(s);else{var j=Sf(de.current);switch(b){case 1:b=j.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=j.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=j.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?j.createElement(y,{is:d.is}):j.createElement(y)}}b[Xe]=s,b[He]=d;e:for(j=s.child;j!==null;){if(j.tag===5||j.tag===6)b.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===s)break e;for(;j.sibling===null;){if(j.return===null||j.return===s)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}s.stateNode=b;e:switch(ln(b,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Wr(s)}}return St(s),$g(s,s.type,o===null?null:o.memoizedProps,s.pendingProps,l),null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==d&&Wr(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(o=de.current,ya(s)){if(o=s.stateNode,l=s.memoizedProps,d=null,y=on,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}o[Xe]=s,o=!!(o.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||SS(o.nodeValue,l)),o||zo(s,!0)}else o=Sf(o).createTextNode(d),o[Xe]=s,s.stateNode=o}return St(s),null;case 31:if(l=s.memoizedState,o===null||o.memoizedState!==null){if(d=ya(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[Xe]=s}else Ki(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;St(s),o=!1}else l=qm(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=l),o=!0;if(!o)return s.flags&256?(Hn(s),s):(Hn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return St(s),null;case 13:if(d=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=ya(s),d!==null&&d.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Xe]=s}else Ki(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;St(s),y=!1}else y=qm(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(Hn(s),s):(Hn(s),null)}return Hn(s),(s.flags&128)!==0?(s.lanes=l,s):(l=d!==null,o=o!==null&&o.memoizedState!==null,l&&(d=s.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==y&&(d.flags|=2048)),l!==o&&l&&(s.child.flags|=8192),cf(s,s.updateQueue),St(s),null);case 4:return P(),o===null&&ny(s.stateNode.containerInfo),St(s),null;case 10:return Gr(s.type),St(s),null;case 19:if(Q(Ut),d=s.memoizedState,d===null)return St(s),null;if(y=(s.flags&128)!==0,b=d.rendering,b===null)if(y)kc(d,!1);else{if(Tt!==0||o!==null&&(o.flags&128)!==0)for(o=s.child;o!==null;){if(b=Yd(o),b!==null){for(s.flags|=128,kc(d,!1),o=b.updateQueue,s.updateQueue=o,cf(s,o),s.subtreeFlags=0,o=l,l=s.child;l!==null;)nk(l,o),l=l.sibling;return D(Ut,Ut.current&1|2),nt&&Zr(s,d.treeForkCount),s.child}o=o.sibling}d.tail!==null&&ct()>pf&&(s.flags|=128,y=!0,kc(d,!1),s.lanes=4194304)}else{if(!y)if(o=Yd(b),o!==null){if(s.flags|=128,y=!0,o=o.updateQueue,s.updateQueue=o,cf(s,o),kc(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!nt)return St(s),null}else 2*ct()-d.renderingStartTime>pf&&l!==536870912&&(s.flags|=128,y=!0,kc(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=ct(),o.sibling=null,l=Ut.current,D(Ut,y?l&1|2:l&1),nt&&Zr(s,d.treeForkCount),o):(St(s),null);case 22:case 23:return Hn(s),rg(),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&&(St(s),s.subtreeFlags&6&&(s.flags|=8192)):St(s),l=s.updateQueue,l!==null&&cf(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&&Q(Qi),null;case 24:return l=null,o!==null&&(l=o.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Gr(Ft),St(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function cz(o,s){switch(Bm(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return Gr(Ft),P(),o=s.flags,(o&65536)!==0&&(o&128)===0?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return me(s),null;case 31:if(s.memoizedState!==null){if(Hn(s),s.alternate===null)throw Error(r(340));Ki()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 13:if(Hn(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ki()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Q(Ut),null;case 4:return P(),null;case 10:return Gr(s.type),null;case 22:case 23:return Hn(s),rg(),o!==null&&Q(Qi),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return Gr(Ft),null;case 25:return null;default:return null}}function C_(o,s){switch(Bm(s),s.tag){case 3:Gr(Ft),P();break;case 26:case 27:case 5:me(s);break;case 4:P();break;case 31:s.memoizedState!==null&&Hn(s);break;case 13:Hn(s);break;case 19:Q(Ut);break;case 10:Gr(s.type);break;case 22:case 23:Hn(s),rg(),o!==null&&Q(Qi);break;case 24:Gr(Ft)}}function _c(o,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var y=d.next;l=y;do{if((l.tag&o)===o){d=void 0;var b=l.create,j=l.inst;d=b(),j.destroy=d}l=l.next}while(l!==y)}}catch(M){mt(s,s.return,M)}}function Bo(o,s,l){try{var d=s.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var b=y.next;d=b;do{if((d.tag&o)===o){var j=d.inst,M=j.destroy;if(M!==void 0){j.destroy=void 0,y=s;var V=l,oe=M;try{oe()}catch(he){mt(y,V,he)}}}d=d.next}while(d!==b)}}catch(he){mt(s,s.return,he)}}function N_(o){var s=o.updateQueue;if(s!==null){var l=o.stateNode;try{wk(s,l)}catch(d){mt(o,o.return,d)}}}function M_(o,s,l){l.props=ts(o.type,o.memoizedProps),l.state=o.memoizedState;try{l.componentWillUnmount()}catch(d){mt(o,s,d)}}function Sc(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(y){mt(o,s,y)}}function Ar(o,s){var l=o.ref,d=o.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(y){mt(o,s,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(y){mt(o,s,y)}else l.current=null}function R_(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(y){mt(o,o.return,y)}}function zg(o,s,l){try{var d=o.stateNode;Mz(d,o.type,l,s),d[He]=s}catch(y){mt(o,o.return,y)}}function T_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Yo(o.type)||o.tag===4}function Dg(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||T_(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&&Yo(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 Lg(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=Hr));else if(d!==4&&(d===27&&Yo(o.type)&&(l=o.stateNode,s=null),o=o.child,o!==null))for(Lg(o,s,l),o=o.sibling;o!==null;)Lg(o,s,l),o=o.sibling}function uf(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&&Yo(o.type)&&(l=o.stateNode),o=o.child,o!==null))for(uf(o,s,l),o=o.sibling;o!==null;)uf(o,s,l),o=o.sibling}function $_(o){var s=o.stateNode,l=o.memoizedProps;try{for(var d=o.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);ln(s,d,l),s[Xe]=o,s[He]=l}catch(b){mt(o,o.return,b)}}var Jr=!1,qt=!1,Ig=!1,z_=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function uz(o,s){if(o=o.containerInfo,iy=Mf,o=K1(o),Mm(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 y=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var j=0,M=-1,V=-1,oe=0,he=0,ve=o,ae=null;t:for(;;){for(var ue;ve!==l||y!==0&&ve.nodeType!==3||(M=j+y),ve!==b||d!==0&&ve.nodeType!==3||(V=j+d),ve.nodeType===3&&(j+=ve.nodeValue.length),(ue=ve.firstChild)!==null;)ae=ve,ve=ue;for(;;){if(ve===o)break t;if(ae===l&&++oe===y&&(M=j),ae===b&&++he===d&&(V=j),(ue=ve.nextSibling)!==null)break;ve=ae,ae=ve.parentNode}ve=ue}l=M===-1||V===-1?null:{start:M,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(sy={focusedElem:o,selectionRange:l},Mf=!1,Jt=s;Jt!==null;)if(s=Jt,o=s.child,(s.subtreeFlags&1028)!==0&&o!==null)o.return=s,Jt=o;else for(;Jt!==null;){switch(s=Jt,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++)y=o[l],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&b!==null){o=void 0,l=s,y=b.memoizedProps,b=b.memoizedState,d=l.stateNode;try{var Ne=ts(l.type,y);o=d.getSnapshotBeforeUpdate(Ne,b),d.__reactInternalSnapshotBeforeUpdate=o}catch(Ue){mt(l,l.return,Ue)}}break;case 3:if((o&1024)!==0){if(o=s.stateNode.containerInfo,l=o.nodeType,l===9)cy(o);else if(l===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":cy(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,Jt=o;break}Jt=s.return}}function D_(o,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:to(o,l),d&4&&_c(5,l);break;case 1:if(to(o,l),d&4)if(o=l.stateNode,s===null)try{o.componentDidMount()}catch(j){mt(l,l.return,j)}else{var y=ts(l.type,s.memoizedProps);s=s.memoizedState;try{o.componentDidUpdate(y,s,o.__reactInternalSnapshotBeforeUpdate)}catch(j){mt(l,l.return,j)}}d&64&&N_(l),d&512&&Sc(l,l.return);break;case 3:if(to(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{wk(o,s)}catch(j){mt(l,l.return,j)}}break;case 27:s===null&&d&4&&$_(l);case 26:case 5:to(o,l),s===null&&d&4&&R_(l),d&512&&Sc(l,l.return);break;case 12:to(o,l);break;case 31:to(o,l),d&4&&U_(o,l);break;case 13:to(o,l),d&4&&P_(o,l),d&64&&(o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(l=vz.bind(null,l),Uz(o,l))));break;case 22:if(d=l.memoizedState!==null||Jr,!d){s=s!==null&&s.memoizedState!==null||qt,y=Jr;var b=qt;Jr=d,(qt=s)&&!b?no(o,l,(l.subtreeFlags&8772)!==0):to(o,l),Jr=y,qt=b}break;case 30:break;default:to(o,l)}}function L_(o){var s=o.alternate;s!==null&&(o.alternate=null,L_(s)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(s=o.stateNode,s!==null&&pm(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 Et=null,On=!1;function eo(o,s,l){for(l=l.child;l!==null;)I_(o,s,l),l=l.sibling}function I_(o,s,l){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Mt,l)}catch{}switch(l.tag){case 26:qt||Ar(l,s),eo(o,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||Ar(l,s);var d=Et,y=On;Yo(l.type)&&(Et=l.stateNode,On=!1),eo(o,s,l),Tc(l.stateNode),Et=d,On=y;break;case 5:qt||Ar(l,s);case 6:if(d=Et,y=On,Et=null,eo(o,s,l),Et=d,On=y,Et!==null)if(On)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(l.stateNode)}catch(b){mt(l,s,b)}else try{Et.removeChild(l.stateNode)}catch(b){mt(l,s,b)}break;case 18:Et!==null&&(On?(o=Et,NS(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,l.stateNode),Ia(o)):NS(Et,l.stateNode));break;case 4:d=Et,y=On,Et=l.stateNode.containerInfo,On=!0,eo(o,s,l),Et=d,On=y;break;case 0:case 11:case 14:case 15:Bo(2,l,s),qt||Bo(4,l,s),eo(o,s,l);break;case 1:qt||(Ar(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&M_(l,s,d)),eo(o,s,l);break;case 21:eo(o,s,l);break;case 22:qt=(d=qt)||l.memoizedState!==null,eo(o,s,l),qt=d;break;default:eo(o,s,l)}}function U_(o,s){if(s.memoizedState===null&&(o=s.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Ia(o)}catch(l){mt(s,s.return,l)}}}function P_(o,s){if(s.memoizedState===null&&(o=s.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Ia(o)}catch(l){mt(s,s.return,l)}}function dz(o){switch(o.tag){case 31:case 13:case 19:var s=o.stateNode;return s===null&&(s=o.stateNode=new z_),s;case 22:return o=o.stateNode,s=o._retryCache,s===null&&(s=o._retryCache=new z_),s;default:throw Error(r(435,o.tag))}}function df(o,s){var l=dz(o);s.forEach(function(d){if(!l.has(d)){l.add(d);var y=wz.bind(null,o,d);d.then(y,y)}})}function An(o,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var y=l[d],b=o,j=s,M=j;e:for(;M!==null;){switch(M.tag){case 27:if(Yo(M.type)){Et=M.stateNode,On=!1;break e}break;case 5:Et=M.stateNode,On=!1;break e;case 3:case 4:Et=M.stateNode.containerInfo,On=!0;break e}M=M.return}if(Et===null)throw Error(r(160));I_(b,j,y),Et=null,On=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)F_(s,o),s=s.sibling}var gr=null;function F_(o,s){var l=o.alternate,d=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:An(s,o),Cn(o),d&4&&(Bo(3,o,o.return),_c(3,o),Bo(5,o,o.return));break;case 1:An(s,o),Cn(o),d&512&&(qt||l===null||Ar(l,l.return)),d&64&&Jr&&(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 y=gr;if(An(s,o),Cn(o),d&512&&(qt||l===null||Ar(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,y=y.ownerDocument||y;t:switch(d){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Xl]||b[Xe]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(d),y.head.insertBefore(b,y.querySelector("head > title"))),ln(b,d,l),b[Xe]=o,Wt(b),d=b;break e;case"link":var j=FS("link","href",y).get(d+(l.href||""));if(j){for(var M=0;M<j.length;M++)if(b=j[M],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)){j.splice(M,1);break t}}b=y.createElement(d),ln(b,d,l),y.head.appendChild(b);break;case"meta":if(j=FS("meta","content",y).get(d+(l.content||""))){for(M=0;M<j.length;M++)if(b=j[M],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)){j.splice(M,1);break t}}b=y.createElement(d),ln(b,d,l),y.head.appendChild(b);break;default:throw Error(r(468,d))}b[Xe]=o,Wt(b),d=b}o.stateNode=d}else BS(y,o.type,o.stateNode);else o.stateNode=PS(y,d,o.memoizedProps);else b!==d?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,d===null?BS(y,o.type,o.stateNode):PS(y,d,o.memoizedProps)):d===null&&o.stateNode!==null&&zg(o,o.memoizedProps,l.memoizedProps)}break;case 27:An(s,o),Cn(o),d&512&&(qt||l===null||Ar(l,l.return)),l!==null&&d&4&&zg(o,o.memoizedProps,l.memoizedProps);break;case 5:if(An(s,o),Cn(o),d&512&&(qt||l===null||Ar(l,l.return)),o.flags&32){y=o.stateNode;try{aa(y,"")}catch(Ne){mt(o,o.return,Ne)}}d&4&&o.stateNode!=null&&(y=o.memoizedProps,zg(o,y,l!==null?l.memoizedProps:y)),d&1024&&(Ig=!0);break;case 6:if(An(s,o),Cn(o),d&4){if(o.stateNode===null)throw Error(r(162));d=o.memoizedProps,l=o.stateNode;try{l.nodeValue=d}catch(Ne){mt(o,o.return,Ne)}}break;case 3:if(Of=null,y=gr,gr=Ef(s.containerInfo),An(s,o),gr=y,Cn(o),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ia(s.containerInfo)}catch(Ne){mt(o,o.return,Ne)}Ig&&(Ig=!1,B_(o));break;case 4:d=gr,gr=Ef(o.stateNode.containerInfo),An(s,o),Cn(o),gr=d;break;case 12:An(s,o),Cn(o);break;case 31:An(s,o),Cn(o),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,df(o,d)));break;case 13:An(s,o),Cn(o),o.child.flags&8192&&o.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(hf=ct()),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,df(o,d)));break;case 22:y=o.memoizedState!==null;var V=l!==null&&l.memoizedState!==null,oe=Jr,he=qt;if(Jr=oe||y,qt=he||V,An(s,o),qt=he,Jr=oe,Cn(o),d&8192)e:for(s=o.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(l===null||V||Jr||qt||ns(o)),l=null,s=o;;){if(s.tag===5||s.tag===26){if(l===null){V=l=s;try{if(b=V.stateNode,y)j=b.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{M=V.stateNode;var ve=V.memoizedProps.style,ae=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;M.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ne){mt(V,V.return,Ne)}}}else if(s.tag===6){if(l===null){V=s;try{V.stateNode.nodeValue=y?"":V.memoizedProps}catch(Ne){mt(V,V.return,Ne)}}}else if(s.tag===18){if(l===null){V=s;try{var ue=V.stateNode;y?MS(ue,!0):MS(V.stateNode,!1)}catch(Ne){mt(V,V.return,Ne)}}}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,df(o,l))));break;case 19:An(s,o),Cn(o),d&4&&(d=o.updateQueue,d!==null&&(o.updateQueue=null,df(o,d)));break;case 30:break;case 21:break;default:An(s,o),Cn(o)}}function Cn(o){var s=o.flags;if(s&2){try{for(var l,d=o.return;d!==null;){if(T_(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var y=l.stateNode,b=Dg(o);uf(o,b,y);break;case 5:var j=l.stateNode;l.flags&32&&(aa(j,""),l.flags&=-33);var M=Dg(o);uf(o,M,j);break;case 3:case 4:var V=l.stateNode.containerInfo,oe=Dg(o);Lg(o,oe,V);break;default:throw Error(r(161))}}catch(he){mt(o,o.return,he)}o.flags&=-3}s&4096&&(o.flags&=-4097)}function B_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var s=o;B_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),o=o.sibling}}function to(o,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)D_(o,s.alternate,s),s=s.sibling}function ns(o){for(o=o.child;o!==null;){var s=o;switch(s.tag){case 0:case 11:case 14:case 15:Bo(4,s,s.return),ns(s);break;case 1:Ar(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&M_(s,s.return,l),ns(s);break;case 27:Tc(s.stateNode);case 26:case 5:Ar(s,s.return),ns(s);break;case 22:s.memoizedState===null&&ns(s);break;case 30:ns(s);break;default:ns(s)}o=o.sibling}}function no(o,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,y=o,b=s,j=b.flags;switch(b.tag){case 0:case 11:case 15:no(y,b,l),_c(4,b);break;case 1:if(no(y,b,l),d=b,y=d.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(oe){mt(d,d.return,oe)}if(d=b,y=d.updateQueue,y!==null){var M=d.stateNode;try{var V=y.shared.hiddenCallbacks;if(V!==null)for(y.shared.hiddenCallbacks=null,y=0;y<V.length;y++)vk(V[y],M)}catch(oe){mt(d,d.return,oe)}}l&&j&64&&N_(b),Sc(b,b.return);break;case 27:$_(b);case 26:case 5:no(y,b,l),l&&d===null&&j&4&&R_(b),Sc(b,b.return);break;case 12:no(y,b,l);break;case 31:no(y,b,l),l&&j&4&&U_(y,b);break;case 13:no(y,b,l),l&&j&4&&P_(y,b);break;case 22:b.memoizedState===null&&no(y,b,l),Sc(b,b.return);break;case 30:break;default:no(y,b,l)}s=s.sibling}}function Ug(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&&uc(l))}function Pg(o,s){o=null,s.alternate!==null&&(o=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==o&&(s.refCount++,o!=null&&uc(o))}function yr(o,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)H_(o,s,l,d),s=s.sibling}function H_(o,s,l,d){var y=s.flags;switch(s.tag){case 0:case 11:case 15:yr(o,s,l,d),y&2048&&_c(9,s);break;case 1:yr(o,s,l,d);break;case 3:yr(o,s,l,d),y&2048&&(o=null,s.alternate!==null&&(o=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==o&&(s.refCount++,o!=null&&uc(o)));break;case 12:if(y&2048){yr(o,s,l,d),o=s.stateNode;try{var b=s.memoizedProps,j=b.id,M=b.onPostCommit;typeof M=="function"&&M(j,s.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(V){mt(s,s.return,V)}}else yr(o,s,l,d);break;case 31:yr(o,s,l,d);break;case 13:yr(o,s,l,d);break;case 23:break;case 22:b=s.stateNode,j=s.alternate,s.memoizedState!==null?b._visibility&2?yr(o,s,l,d):Ec(o,s):b._visibility&2?yr(o,s,l,d):(b._visibility|=2,Oa(o,s,l,d,(s.subtreeFlags&10256)!==0||!1)),y&2048&&Ug(j,s);break;case 24:yr(o,s,l,d),y&2048&&Pg(s.alternate,s);break;default:yr(o,s,l,d)}}function Oa(o,s,l,d,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var b=o,j=s,M=l,V=d,oe=j.flags;switch(j.tag){case 0:case 11:case 15:Oa(b,j,M,V,y),_c(8,j);break;case 23:break;case 22:var he=j.stateNode;j.memoizedState!==null?he._visibility&2?Oa(b,j,M,V,y):Ec(b,j):(he._visibility|=2,Oa(b,j,M,V,y)),y&&oe&2048&&Ug(j.alternate,j);break;case 24:Oa(b,j,M,V,y),y&&oe&2048&&Pg(j.alternate,j);break;default:Oa(b,j,M,V,y)}s=s.sibling}}function Ec(o,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=o,d=s,y=d.flags;switch(d.tag){case 22:Ec(l,d),y&2048&&Ug(d.alternate,d);break;case 24:Ec(l,d),y&2048&&Pg(d.alternate,d);break;default:Ec(l,d)}s=s.sibling}}var jc=8192;function Aa(o,s,l){if(o.subtreeFlags&jc)for(o=o.child;o!==null;)q_(o,s,l),o=o.sibling}function q_(o,s,l){switch(o.tag){case 26:Aa(o,s,l),o.flags&jc&&o.memoizedState!==null&&Xz(l,gr,o.memoizedState,o.memoizedProps);break;case 5:Aa(o,s,l);break;case 3:case 4:var d=gr;gr=Ef(o.stateNode.containerInfo),Aa(o,s,l),gr=d;break;case 22:o.memoizedState===null&&(d=o.alternate,d!==null&&d.memoizedState!==null?(d=jc,jc=16777216,Aa(o,s,l),jc=d):Aa(o,s,l));break;default:Aa(o,s,l)}}function V_(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 Oc(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];Jt=d,K_(d,o)}V_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Z_(o),o=o.sibling}function Z_(o){switch(o.tag){case 0:case 11:case 15:Oc(o),o.flags&2048&&Bo(9,o,o.return);break;case 3:Oc(o);break;case 12:Oc(o);break;case 22:var s=o.stateNode;o.memoizedState!==null&&s._visibility&2&&(o.return===null||o.return.tag!==13)?(s._visibility&=-3,ff(o)):Oc(o);break;default:Oc(o)}}function ff(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];Jt=d,K_(d,o)}V_(o)}for(o=o.child;o!==null;){switch(s=o,s.tag){case 0:case 11:case 15:Bo(8,s,s.return),ff(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,ff(s));break;default:ff(s)}o=o.sibling}}function K_(o,s){for(;Jt!==null;){var l=Jt;switch(l.tag){case 0:case 11:case 15:Bo(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:uc(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Jt=d;else e:for(l=o;Jt!==null;){d=Jt;var y=d.sibling,b=d.return;if(L_(d),d===l){Jt=null;break e}if(y!==null){y.return=b,Jt=y;break e}Jt=b}}}var fz={getCacheForType:function(o){var s=sn(Ft),l=s.data.get(o);return l===void 0&&(l=o(),s.data.set(o,l)),l},cacheSignal:function(){return sn(Ft).controller.signal}},hz=typeof WeakMap=="function"?WeakMap:Map,ut=0,xt=null,We=null,et=0,pt=0,qn=null,Ho=!1,Ca=!1,Fg=!1,ro=0,Tt=0,qo=0,rs=0,Bg=0,Vn=0,Na=0,Ac=null,Nn=null,Hg=!1,hf=0,G_=0,pf=1/0,mf=null,Vo=null,Kt=0,Zo=null,Ma=null,oo=0,qg=0,Vg=null,Y_=null,Cc=0,Zg=null;function Zn(){return(ut&2)!==0&&et!==0?et&-et:N.T!==null?Wg():se()}function Q_(){if(Vn===0)if((et&536870912)===0||nt){var o=Js;Js<<=1,(Js&3932160)===0&&(Js=262144),Vn=o}else Vn=536870912;return o=Bn.current,o!==null&&(o.flags|=32),Vn}function Mn(o,s,l){(o===xt&&(pt===2||pt===9)||o.cancelPendingCommit!==null)&&(Ra(o,0),Ko(o,et,Vn,!1)),Pi(o,l),((ut&2)===0||o!==xt)&&(o===xt&&((ut&2)===0&&(rs|=l),Tt===4&&Ko(o,et,Vn,!1)),Cr(o))}function X_(o,s,l){if((ut&6)!==0)throw Error(r(327));var d=!l&&(s&127)===0&&(s&o.expiredLanes)===0||Ui(o,s),y=d?gz(o,s):Gg(o,s,!0),b=d;do{if(y===0){Ca&&!d&&Ko(o,s,0,!1);break}else{if(l=o.current.alternate,b&&!pz(l)){y=Gg(o,s,!1),b=!1;continue}if(y===2){if(b=s,o.errorRecoveryDisabledLanes&b)var j=0;else j=o.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var M=o;y=Ac;var V=M.current.memoizedState.isDehydrated;if(V&&(Ra(M,j).flags|=256),j=Gg(M,j,!1),j!==2){if(Fg&&!V){M.errorRecoveryDisabledLanes|=b,rs|=b,y=4;break e}b=Nn,Nn=y,b!==null&&(Nn===null?Nn=b:Nn.push.apply(Nn,b))}y=j}if(b=!1,y!==2)continue}}if(y===1){Ra(o,0),Ko(o,s,0,!0);break}e:{switch(d=o,b=y,b){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ko(d,s,Vn,!Ho);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=hf+300-ct(),10<y)){if(Ko(d,s,Vn,!Ho),ta(d,0,!0)!==0)break e;oo=s,d.timeoutHandle=AS(W_.bind(null,d,l,Nn,mf,Hg,s,Vn,rs,Na,Ho,b,"Throttled",-0,0),y);break e}W_(d,l,Nn,mf,Hg,s,Vn,rs,Na,Ho,b,null,-0,0)}}break}while(!0);Cr(o)}function W_(o,s,l,d,y,b,j,M,V,oe,he,ve,ae,ue){if(o.timeoutHandle=-1,ve=s.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hr},q_(s,b,ve);var Ne=(b&62914560)===b?hf-ct():(b&4194048)===b?G_-ct():0;if(Ne=Wz(ve,Ne),Ne!==null){oo=b,o.cancelPendingCommit=Ne(sS.bind(null,o,s,b,l,d,y,j,M,V,he,ve,null,ae,ue)),Ko(o,b,j,!oe);return}}sS(o,s,b,l,d,y,j,M,V)}function pz(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 y=l[d],b=y.getSnapshot;y=y.value;try{if(!Pn(b(),y))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 Ko(o,s,l,d){s&=~Bg,s&=~rs,o.suspendedLanes|=s,o.pingedLanes&=~s,d&&(o.warmLanes|=s),d=o.expirationTimes;for(var y=s;0<y;){var b=31-hn(y),j=1<<b;d[b]=-1,y&=~j}l!==0&&Kl(o,l,s)}function gf(){return(ut&6)===0?(Nc(0),!1):!0}function Kg(){if(We!==null){if(pt===0)var o=We.return;else o=We,Kr=Gi=null,cg(o),ka=null,fc=0,o=We;for(;o!==null;)C_(o.alternate,o),o=o.return;We=null}}function Ra(o,s){var l=o.timeoutHandle;l!==-1&&(o.timeoutHandle=-1,$z(l)),l=o.cancelPendingCommit,l!==null&&(o.cancelPendingCommit=null,l()),oo=0,Kg(),xt=o,We=l=Vr(o.current,null),et=s,pt=0,qn=null,Ho=!1,Ca=Ui(o,s),Fg=!1,Na=Vn=Bg=rs=qo=Tt=0,Nn=Ac=null,Hg=!1,(s&8)!==0&&(s|=s&32);var d=o.entangledLanes;if(d!==0)for(o=o.entanglements,d&=s;0<d;){var y=31-hn(d),b=1<<y;s|=o[y],d&=~b}return ro=s,Dd(),l}function J_(o,s){Ze=null,N.H=wc,s===xa||s===qd?(s=mk(),pt=3):s===Xm?(s=mk(),pt=4):pt=s===Eg?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,qn=s,We===null&&(Tt=1,of(o,rr(s,o.current)))}function eS(){var o=Bn.current;return o===null?!0:(et&4194048)===et?ar===null:(et&62914560)===et||(et&536870912)!==0?o===ar:!1}function tS(){var o=N.H;return N.H=wc,o===null?wc:o}function nS(){var o=N.A;return N.A=fz,o}function yf(){Tt=4,Ho||(et&4194048)!==et&&Bn.current!==null||(Ca=!0),(qo&134217727)===0&&(rs&134217727)===0||xt===null||Ko(xt,et,Vn,!1)}function Gg(o,s,l){var d=ut;ut|=2;var y=tS(),b=nS();(xt!==o||et!==s)&&(mf=null,Ra(o,s)),s=!1;var j=Tt;e:do try{if(pt!==0&&We!==null){var M=We,V=qn;switch(pt){case 8:Kg(),j=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(s=!0);var oe=pt;if(pt=0,qn=null,Ta(o,M,V,oe),l&&Ca){j=0;break e}break;default:oe=pt,pt=0,qn=null,Ta(o,M,V,oe)}}mz(),j=Tt;break}catch(he){J_(o,he)}while(!0);return s&&o.shellSuspendCounter++,Kr=Gi=null,ut=d,N.H=y,N.A=b,We===null&&(xt=null,et=0,Dd()),j}function mz(){for(;We!==null;)rS(We)}function gz(o,s){var l=ut;ut|=2;var d=tS(),y=nS();xt!==o||et!==s?(mf=null,pf=ct()+500,Ra(o,s)):Ca=Ui(o,s);e:do try{if(pt!==0&&We!==null){s=We;var b=qn;t:switch(pt){case 1:pt=0,qn=null,Ta(o,s,b,1);break;case 2:case 9:if(hk(b)){pt=0,qn=null,oS(s);break}s=function(){pt!==2&&pt!==9||xt!==o||(pt=7),Cr(o)},b.then(s,s);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:hk(b)?(pt=0,qn=null,oS(s)):(pt=0,qn=null,Ta(o,s,b,7));break;case 5:var j=null;switch(We.tag){case 26:j=We.memoizedState;case 5:case 27:var M=We;if(j?HS(j):M.stateNode.complete){pt=0,qn=null;var V=M.sibling;if(V!==null)We=V;else{var oe=M.return;oe!==null?(We=oe,bf(oe)):We=null}break t}}pt=0,qn=null,Ta(o,s,b,5);break;case 6:pt=0,qn=null,Ta(o,s,b,6);break;case 8:Kg(),Tt=6;break e;default:throw Error(r(462))}}yz();break}catch(he){J_(o,he)}while(!0);return Kr=Gi=null,N.H=d,N.A=y,ut=l,We!==null?0:(xt=null,et=0,Dd(),Tt)}function yz(){for(;We!==null&&!Ke();)rS(We)}function rS(o){var s=O_(o.alternate,o,ro);o.memoizedProps=o.pendingProps,s===null?bf(o):We=s}function oS(o){var s=o,l=s.alternate;switch(s.tag){case 15:case 0:s=x_(l,s,s.pendingProps,s.type,void 0,et);break;case 11:s=x_(l,s,s.pendingProps,s.type.render,s.ref,et);break;case 5:cg(s);default:C_(l,s),s=We=nk(s,ro),s=O_(l,s,ro)}o.memoizedProps=o.pendingProps,s===null?bf(o):We=s}function Ta(o,s,l,d){Kr=Gi=null,cg(s),ka=null,fc=0;var y=s.return;try{if(iz(o,y,s,l,et)){Tt=1,of(o,rr(l,o.current)),We=null;return}}catch(b){if(y!==null)throw We=y,b;Tt=1,of(o,rr(l,o.current)),We=null;return}s.flags&32768?(nt||d===1?o=!0:Ca||(et&536870912)!==0?o=!1:(Ho=o=!0,(d===2||d===9||d===3||d===6)&&(d=Bn.current,d!==null&&d.tag===13&&(d.flags|=16384))),iS(s,o)):bf(s)}function bf(o){var s=o;do{if((s.flags&32768)!==0){iS(s,Ho);return}o=s.return;var l=lz(s.alternate,s,ro);if(l!==null){We=l;return}if(s=s.sibling,s!==null){We=s;return}We=s=o}while(s!==null);Tt===0&&(Tt=5)}function iS(o,s){do{var l=cz(o.alternate,o);if(l!==null){l.flags&=32767,We=l;return}if(l=o.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(o=o.sibling,o!==null)){We=o;return}We=o=l}while(o!==null);Tt=6,We=null}function sS(o,s,l,d,y,b,j,M,V){o.cancelPendingCommit=null;do vf();while(Kt!==0);if((ut&6)!==0)throw Error(r(327));if(s!==null){if(s===o.current)throw Error(r(177));if(b=s.lanes|s.childLanes,b|=Dm,hm(o,l,b,j,M,V),o===xt&&(We=xt=null,et=0),Ma=s,Zo=o,oo=l,qg=b,Vg=y,Y_=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,xz(ke,function(){return dS(),null})):(o.callbackNode=null,o.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=N.T,N.T=null,y=B.p,B.p=2,j=ut,ut|=4;try{uz(o,s,l)}finally{ut=j,B.p=y,N.T=d}}Kt=1,aS(),lS(),cS()}}function aS(){if(Kt===1){Kt=0;var o=Zo,s=Ma,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=N.T,N.T=null;var d=B.p;B.p=2;var y=ut;ut|=4;try{F_(s,o);var b=sy,j=K1(o.containerInfo),M=b.focusedElem,V=b.selectionRange;if(j!==M&&M&&M.ownerDocument&&Z1(M.ownerDocument.documentElement,M)){if(V!==null&&Mm(M)){var oe=V.start,he=V.end;if(he===void 0&&(he=oe),"selectionStart"in M)M.selectionStart=oe,M.selectionEnd=Math.min(he,M.value.length);else{var ve=M.ownerDocument||document,ae=ve&&ve.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),Ne=M.textContent.length,Ue=Math.min(V.start,Ne),bt=V.end===void 0?Ue:Math.min(V.end,Ne);!ue.extend&&Ue>bt&&(j=bt,bt=Ue,Ue=j);var ee=V1(M,Ue),X=V1(M,bt);if(ee&&X&&(ue.rangeCount!==1||ue.anchorNode!==ee.node||ue.anchorOffset!==ee.offset||ue.focusNode!==X.node||ue.focusOffset!==X.offset)){var re=ve.createRange();re.setStart(ee.node,ee.offset),ue.removeAllRanges(),Ue>bt?(ue.addRange(re),ue.extend(X.node,X.offset)):(re.setEnd(X.node,X.offset),ue.addRange(re))}}}}for(ve=[],ue=M;ue=ue.parentNode;)ue.nodeType===1&&ve.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ve.length;M++){var ge=ve[M];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Mf=!!iy,sy=iy=null}finally{ut=y,B.p=d,N.T=l}}o.current=s,Kt=2}}function lS(){if(Kt===2){Kt=0;var o=Zo,s=Ma,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=N.T,N.T=null;var d=B.p;B.p=2;var y=ut;ut|=4;try{D_(o,s.alternate,s)}finally{ut=y,B.p=d,N.T=l}}Kt=3}}function cS(){if(Kt===4||Kt===3){Kt=0,En();var o=Zo,s=Ma,l=oo,d=Y_;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Kt=5:(Kt=0,Ma=Zo=null,uS(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(Vo=null),Ql(l),s=s.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Mt,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=N.T,y=B.p,B.p=2,N.T=null;try{for(var b=o.onRecoverableError,j=0;j<d.length;j++){var M=d[j];b(M.value,{componentStack:M.stack})}}finally{N.T=s,B.p=y}}(oo&3)!==0&&vf(),Cr(o),y=o.pendingLanes,(l&261930)!==0&&(y&42)!==0?o===Zg?Cc++:(Cc=0,Zg=o):Cc=0,Nc(0)}}function uS(o,s){(o.pooledCacheLanes&=s)===0&&(s=o.pooledCache,s!=null&&(o.pooledCache=null,uc(s)))}function vf(){return aS(),lS(),cS(),dS()}function dS(){if(Kt!==5)return!1;var o=Zo,s=qg;qg=0;var l=Ql(oo),d=N.T,y=B.p;try{B.p=32>l?32:l,N.T=null,l=Vg,Vg=null;var b=Zo,j=oo;if(Kt=0,Ma=Zo=null,oo=0,(ut&6)!==0)throw Error(r(331));var M=ut;if(ut|=4,Z_(b.current),H_(b,b.current,j,l),ut=M,Nc(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Mt,b)}catch{}return!0}finally{B.p=y,N.T=d,uS(o,s)}}function fS(o,s,l){s=rr(l,s),s=Sg(o.stateNode,s,2),o=Uo(o,s,2),o!==null&&(Pi(o,2),Cr(o))}function mt(o,s,l){if(o.tag===3)fS(o,o,l);else for(;s!==null;){if(s.tag===3){fS(s,o,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Vo===null||!Vo.has(d))){o=rr(l,o),l=h_(2),d=Uo(s,l,2),d!==null&&(p_(l,d,s,o),Pi(d,2),Cr(d));break}}s=s.return}}function Yg(o,s,l){var d=o.pingCache;if(d===null){d=o.pingCache=new hz;var y=new Set;d.set(s,y)}else y=d.get(s),y===void 0&&(y=new Set,d.set(s,y));y.has(l)||(Fg=!0,y.add(l),o=bz.bind(null,o,s,l),s.then(o,o))}function bz(o,s,l){var d=o.pingCache;d!==null&&d.delete(s),o.pingedLanes|=o.suspendedLanes&l,o.warmLanes&=~l,xt===o&&(et&l)===l&&(Tt===4||Tt===3&&(et&62914560)===et&&300>ct()-hf?(ut&2)===0&&Ra(o,0):Bg|=l,Na===et&&(Na=0)),Cr(o)}function hS(o,s){s===0&&(s=_d()),o=Vi(o,s),o!==null&&(Pi(o,s),Cr(o))}function vz(o){var s=o.memoizedState,l=0;s!==null&&(l=s.retryLane),hS(o,l)}function wz(o,s){var l=0;switch(o.tag){case 31:case 13:var d=o.stateNode,y=o.memoizedState;y!==null&&(l=y.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),hS(o,l)}function xz(o,s){return Pe(o,s)}var wf=null,$a=null,Qg=!1,xf=!1,Xg=!1,Go=0;function Cr(o){o!==$a&&o.next===null&&($a===null?wf=$a=o:$a=$a.next=o),xf=!0,Qg||(Qg=!0,_z())}function Nc(o,s){if(!Xg&&xf){Xg=!0;do for(var l=!1,d=wf;d!==null;){if(o!==0){var y=d.pendingLanes;if(y===0)var b=0;else{var j=d.suspendedLanes,M=d.pingedLanes;b=(1<<31-hn(42|o)+1)-1,b&=y&~(j&~M),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,yS(d,b))}else b=et,b=ta(d,d===xt?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||Ui(d,b)||(l=!0,yS(d,b));d=d.next}while(l);Xg=!1}}function kz(){pS()}function pS(){xf=Qg=!1;var o=0;Go!==0&&Tz()&&(o=Go);for(var s=ct(),l=null,d=wf;d!==null;){var y=d.next,b=mS(d,s);b===0?(d.next=null,l===null?wf=y:l.next=y,y===null&&($a=l)):(l=d,(o!==0||(b&3)!==0)&&(xf=!0)),d=y}Kt!==0&&Kt!==5||Nc(o),Go!==0&&(Go=0)}function mS(o,s){for(var l=o.suspendedLanes,d=o.pingedLanes,y=o.expirationTimes,b=o.pendingLanes&-62914561;0<b;){var j=31-hn(b),M=1<<j,V=y[j];V===-1?((M&l)===0||(M&d)!==0)&&(y[j]=kd(M,s)):V<=s&&(o.expiredLanes|=M),b&=~M}if(s=xt,l=et,l=ta(o,o===s?l:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),d=o.callbackNode,l===0||o===s&&(pt===2||pt===9)||o.cancelPendingCommit!==null)return d!==null&&d!==null&&ht(d),o.callbackNode=null,o.callbackPriority=0;if((l&3)===0||Ui(o,l)){if(s=l&-l,s===o.callbackPriority)return s;switch(d!==null&&ht(d),Ql(l)){case 2:case 8:l=Nt;break;case 32:l=ke;break;case 268435456:l=Ve;break;default:l=ke}return d=gS.bind(null,o),l=Pe(l,d),o.callbackPriority=s,o.callbackNode=l,s}return d!==null&&d!==null&&ht(d),o.callbackPriority=2,o.callbackNode=null,2}function gS(o,s){if(Kt!==0&&Kt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var l=o.callbackNode;if(vf()&&o.callbackNode!==l)return null;var d=et;return d=ta(o,o===xt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),d===0?null:(X_(o,d,s),mS(o,ct()),o.callbackNode!=null&&o.callbackNode===l?gS.bind(null,o):null)}function yS(o,s){if(vf())return null;X_(o,s,!0)}function _z(){zz(function(){(ut&6)!==0?Pe(Jn,kz):pS()})}function Wg(){if(Go===0){var o=va;o===0&&(o=Ws,Ws<<=1,(Ws&261888)===0&&(Ws=256)),Go=o}return Go}function bS(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ad(""+o)}function vS(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 Sz(o,s,l,d,y){if(s==="submit"&&l&&l.stateNode===y){var b=bS((y[He]||null).action),j=d.submitter;j&&(s=(s=j[He]||null)?bS(s.formAction):j.getAttribute("formAction"),s!==null&&(b=s,j=null));var M=new Rd("action","action",null,d,y);o.push({event:M,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Go!==0){var V=j?vS(y,j):new FormData(y);bg(l,{pending:!0,data:V,method:y.method,action:b},null,V)}}else typeof b=="function"&&(M.preventDefault(),V=j?vS(y,j):new FormData(y),bg(l,{pending:!0,data:V,method:y.method,action:b},b,V))},currentTarget:y}]})}}for(var Jg=0;Jg<zm.length;Jg++){var ey=zm[Jg],Ez=ey.toLowerCase(),jz=ey[0].toUpperCase()+ey.slice(1);mr(Ez,"on"+jz)}mr(Q1,"onAnimationEnd"),mr(X1,"onAnimationIteration"),mr(W1,"onAnimationStart"),mr("dblclick","onDoubleClick"),mr("focusin","onFocus"),mr("focusout","onBlur"),mr(B3,"onTransitionRun"),mr(H3,"onTransitionStart"),mr(q3,"onTransitionCancel"),mr(J1,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mc="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(" "),Oz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mc));function wS(o,s){s=(s&4)!==0;for(var l=0;l<o.length;l++){var d=o[l],y=d.event;d=d.listeners;e:{var b=void 0;if(s)for(var j=d.length-1;0<=j;j--){var M=d[j],V=M.instance,oe=M.currentTarget;if(M=M.listener,V!==b&&y.isPropagationStopped())break e;b=M,y.currentTarget=oe;try{b(y)}catch(he){zd(he)}y.currentTarget=null,b=V}else for(j=0;j<d.length;j++){if(M=d[j],V=M.instance,oe=M.currentTarget,M=M.listener,V!==b&&y.isPropagationStopped())break e;b=M,y.currentTarget=oe;try{b(y)}catch(he){zd(he)}y.currentTarget=null,b=V}}}}function Je(o,s){var l=s[Fr];l===void 0&&(l=s[Fr]=new Set);var d=o+"__bubble";l.has(d)||(xS(s,o,2,!1),l.add(d))}function ty(o,s,l){var d=0;s&&(d|=4),xS(l,o,d,s)}var kf="_reactListening"+Math.random().toString(36).slice(2);function ny(o){if(!o[kf]){o[kf]=!0,p1.forEach(function(l){l!=="selectionchange"&&(Oz.has(l)||ty(l,!1,o),ty(l,!0,o))});var s=o.nodeType===9?o:o.ownerDocument;s===null||s[kf]||(s[kf]=!0,ty("selectionchange",!1,s))}}function xS(o,s,l,d){switch(QS(s)){case 2:var y=tD;break;case 8:y=nD;break;default:y=yy}l=y.bind(null,s,l,o),y=void 0,!km||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),d?y!==void 0?o.addEventListener(s,l,{capture:!0,passive:y}):o.addEventListener(s,l,!0):y!==void 0?o.addEventListener(s,l,{passive:y}):o.addEventListener(s,l,!1)}function ry(o,s,l,d,y){var b=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var M=d.stateNode.containerInfo;if(M===y)break;if(j===4)for(j=d.return;j!==null;){var V=j.tag;if((V===3||V===4)&&j.stateNode.containerInfo===y)return;j=j.return}for(;M!==null;){if(j=na(M),j===null)return;if(V=j.tag,V===5||V===6||V===26||V===27){d=b=j;continue e}M=M.parentNode}}d=d.return}j1(function(){var oe=b,he=wm(l),ve=[];e:{var ae=ek.get(o);if(ae!==void 0){var ue=Rd,Ne=o;switch(o){case"keypress":if(Nd(l)===0)break e;case"keydown":case"keyup":ue=w3;break;case"focusin":Ne="focus",ue=jm;break;case"focusout":Ne="blur",ue=jm;break;case"beforeblur":case"afterblur":ue=jm;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=C1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=l3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=_3;break;case Q1:case X1:case W1:ue=d3;break;case J1:ue=E3;break;case"scroll":case"scrollend":ue=s3;break;case"wheel":ue=O3;break;case"copy":case"cut":case"paste":ue=h3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=M1;break;case"toggle":case"beforetoggle":ue=C3}var Ue=(s&4)!==0,bt=!Ue&&(o==="scroll"||o==="scrollend"),ee=Ue?ae!==null?ae+"Capture":null:ae;Ue=[];for(var X=oe,re;X!==null;){var ge=X;if(re=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||re===null||ee===null||(ge=Jl(X,ee),ge!=null&&Ue.push(Rc(X,ge,re))),bt)break;X=X.return}0<Ue.length&&(ae=new ue(ae,Ne,null,l,he),ve.push({event:ae,listeners:Ue}))}}if((s&7)===0){e:{if(ae=o==="mouseover"||o==="pointerover",ue=o==="mouseout"||o==="pointerout",ae&&l!==vm&&(Ne=l.relatedTarget||l.fromElement)&&(na(Ne)||Ne[Er]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(Ne=l.relatedTarget||l.toElement,ue=oe,Ne=Ne?na(Ne):null,Ne!==null&&(bt=a(Ne),Ue=Ne.tag,Ne!==bt||Ue!==5&&Ue!==27&&Ue!==6)&&(Ne=null)):(ue=null,Ne=oe),ue!==Ne)){if(Ue=C1,ge="onMouseLeave",ee="onMouseEnter",X="mouse",(o==="pointerout"||o==="pointerover")&&(Ue=M1,ge="onPointerLeave",ee="onPointerEnter",X="pointer"),bt=ue==null?ae:Wl(ue),re=Ne==null?ae:Wl(Ne),ae=new Ue(ge,X+"leave",ue,l,he),ae.target=bt,ae.relatedTarget=re,ge=null,na(he)===oe&&(Ue=new Ue(ee,X+"enter",Ne,l,he),Ue.target=re,Ue.relatedTarget=bt,ge=Ue),bt=ge,ue&&Ne)t:{for(Ue=Az,ee=ue,X=Ne,re=0,ge=ee;ge;ge=Ue(ge))re++;ge=0;for(var ze=X;ze;ze=Ue(ze))ge++;for(;0<re-ge;)ee=Ue(ee),re--;for(;0<ge-re;)X=Ue(X),ge--;for(;re--;){if(ee===X||X!==null&&ee===X.alternate){Ue=ee;break t}ee=Ue(ee),X=Ue(X)}Ue=null}else Ue=null;ue!==null&&kS(ve,ae,ue,Ue,!1),Ne!==null&&bt!==null&&kS(ve,bt,Ne,Ue,!0)}}e:{if(ae=oe?Wl(oe):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var st=U1;else if(L1(ae))if(P1)st=U3;else{st=L3;var Te=D3}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&bm(oe.elementType)&&(st=U1):st=I3;if(st&&(st=st(o,oe))){I1(ve,st,l,he);break e}Te&&Te(o,ae,oe),o==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&ym(ae,"number",ae.value)}switch(Te=oe?Wl(oe):window,o){case"focusin":(L1(Te)||Te.contentEditable==="true")&&(da=Te,Rm=oe,ac=null);break;case"focusout":ac=Rm=da=null;break;case"mousedown":Tm=!0;break;case"contextmenu":case"mouseup":case"dragend":Tm=!1,G1(ve,l,he);break;case"selectionchange":if(F3)break;case"keydown":case"keyup":G1(ve,l,he)}var Ge;if(Am)e:{switch(o){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else ua?z1(o,l)&&(tt="onCompositionEnd"):o==="keydown"&&l.keyCode===229&&(tt="onCompositionStart");tt&&(R1&&l.locale!=="ko"&&(ua||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&ua&&(Ge=O1()):(Ro=he,_m="value"in Ro?Ro.value:Ro.textContent,ua=!0)),Te=_f(oe,tt),0<Te.length&&(tt=new N1(tt,o,null,l,he),ve.push({event:tt,listeners:Te}),Ge?tt.data=Ge:(Ge=D1(l),Ge!==null&&(tt.data=Ge)))),(Ge=M3?R3(o,l):T3(o,l))&&(tt=_f(oe,"onBeforeInput"),0<tt.length&&(Te=new N1("onBeforeInput","beforeinput",null,l,he),ve.push({event:Te,listeners:tt}),Te.data=Ge)),Sz(ve,o,oe,l,he)}wS(ve,s)})}function Rc(o,s,l){return{instance:o,listener:s,currentTarget:l}}function _f(o,s){for(var l=s+"Capture",d=[];o!==null;){var y=o,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Jl(o,l),y!=null&&d.unshift(Rc(o,y,b)),y=Jl(o,s),y!=null&&d.push(Rc(o,y,b))),o.tag===3)return d;o=o.return}return[]}function Az(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function kS(o,s,l,d,y){for(var b=s._reactName,j=[];l!==null&&l!==d;){var M=l,V=M.alternate,oe=M.stateNode;if(M=M.tag,V!==null&&V===d)break;M!==5&&M!==26&&M!==27||oe===null||(V=oe,y?(oe=Jl(l,b),oe!=null&&j.unshift(Rc(l,oe,V))):y||(oe=Jl(l,b),oe!=null&&j.push(Rc(l,oe,V)))),l=l.return}j.length!==0&&o.push({event:s,listeners:j})}var Cz=/\r\n?/g,Nz=/\u0000|\uFFFD/g;function _S(o){return(typeof o=="string"?o:""+o).replace(Cz,`
|
|
49
|
+
`).replace(Nz,"")}function SS(o,s){return s=_S(s),_S(o)===s}function yt(o,s,l,d,y,b){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||aa(o,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&aa(o,""+d);break;case"className":jd(o,"class",d);break;case"tabIndex":jd(o,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":jd(o,l,d);break;case"style":S1(o,d,b);break;case"data":if(s!=="object"){jd(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=Ad(""+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"&&yt(o,s,"name",y.name,y,null),yt(o,s,"formEncType",y.formEncType,y,null),yt(o,s,"formMethod",y.formMethod,y,null),yt(o,s,"formTarget",y.formTarget,y,null)):(yt(o,s,"encType",y.encType,y,null),yt(o,s,"method",y.method,y,null),yt(o,s,"target",y.target,y,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){o.removeAttribute(l);break}d=Ad(""+d),o.setAttribute(l,d);break;case"onClick":d!=null&&(o.onclick=Hr);break;case"onScroll":d!=null&&Je("scroll",o);break;case"onScrollEnd":d!=null&&Je("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(y.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=Ad(""+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":Je("beforetoggle",o),Je("toggle",o),Ed(o,"popover",d);break;case"xlinkActuate":Br(o,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Br(o,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Br(o,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Br(o,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Br(o,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Br(o,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Br(o,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Br(o,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Br(o,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ed(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=o3.get(l)||l,Ed(o,l,d))}}function oy(o,s,l,d,y,b){switch(l){case"style":S1(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(y.children!=null)throw Error(r(60));o.innerHTML=l}}break;case"children":typeof d=="string"?aa(o,d):(typeof d=="number"||typeof d=="bigint")&&aa(o,""+d);break;case"onScroll":d!=null&&Je("scroll",o);break;case"onScrollEnd":d!=null&&Je("scrollend",o);break;case"onClick":d!=null&&(o.onclick=Hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!m1.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(y=l.endsWith("Capture"),s=l.slice(2,y?l.length-7:void 0),b=o[He]||null,b=b!=null?b[l]:null,typeof b=="function"&&o.removeEventListener(s,b,y),typeof d=="function")){typeof b!="function"&&b!==null&&(l in o?o[l]=null:o.hasAttribute(l)&&o.removeAttribute(l)),o.addEventListener(s,d,y);break e}l in o?o[l]=d:d===!0?o.setAttribute(l,""):Ed(o,l,d)}}}function ln(o,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",o),Je("load",o);var d=!1,y=!1,b;for(b in l)if(l.hasOwnProperty(b)){var j=l[b];if(j!=null)switch(b){case"src":d=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:yt(o,s,b,j,l,null)}}y&&yt(o,s,"srcSet",l.srcSet,l,null),d&&yt(o,s,"src",l.src,l,null);return;case"input":Je("invalid",o);var M=b=j=y=null,V=null,oe=null;for(d in l)if(l.hasOwnProperty(d)){var he=l[d];if(he!=null)switch(d){case"name":y=he;break;case"type":j=he;break;case"checked":V=he;break;case"defaultChecked":oe=he;break;case"value":b=he;break;case"defaultValue":M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,s));break;default:yt(o,s,d,he,l,null)}}w1(o,b,M,V,oe,j,y,!1);return;case"select":Je("invalid",o),d=j=b=null;for(y in l)if(l.hasOwnProperty(y)&&(M=l[y],M!=null))switch(y){case"value":b=M;break;case"defaultValue":j=M;break;case"multiple":d=M;default:yt(o,s,y,M,l,null)}s=b,l=j,o.multiple=!!d,s!=null?sa(o,!!d,s,!1):l!=null&&sa(o,!!d,l,!0);return;case"textarea":Je("invalid",o),b=y=d=null;for(j in l)if(l.hasOwnProperty(j)&&(M=l[j],M!=null))switch(j){case"value":d=M;break;case"defaultValue":y=M;break;case"children":b=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:yt(o,s,j,M,l,null)}k1(o,d,y,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:yt(o,s,V,d,l,null)}return;case"dialog":Je("beforetoggle",o),Je("toggle",o),Je("cancel",o),Je("close",o);break;case"iframe":case"object":Je("load",o);break;case"video":case"audio":for(d=0;d<Mc.length;d++)Je(Mc[d],o);break;case"image":Je("error",o),Je("load",o);break;case"details":Je("toggle",o);break;case"embed":case"source":case"link":Je("error",o),Je("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:yt(o,s,oe,d,l,null)}return;default:if(bm(s)){for(he in l)l.hasOwnProperty(he)&&(d=l[he],d!==void 0&&oy(o,s,he,d,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(d=l[M],d!=null&&yt(o,s,M,d,l,null))}function Mz(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 y=null,b=null,j=null,M=null,V=null,oe=null,he=null;for(ue in l){var ve=l[ue];if(l.hasOwnProperty(ue)&&ve!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":V=ve;default:d.hasOwnProperty(ue)||yt(o,s,ue,null,d,ve)}}for(var ae in d){var ue=d[ae];if(ve=l[ae],d.hasOwnProperty(ae)&&(ue!=null||ve!=null))switch(ae){case"type":b=ue;break;case"name":y=ue;break;case"checked":oe=ue;break;case"defaultChecked":he=ue;break;case"value":j=ue;break;case"defaultValue":M=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:ue!==ve&&yt(o,s,ae,ue,d,ve)}}gm(o,j,M,V,oe,he,b,y);return;case"select":ue=j=M=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)||yt(o,s,b,null,d,V)}for(y in d)if(b=d[y],V=l[y],d.hasOwnProperty(y)&&(b!=null||V!=null))switch(y){case"value":ae=b;break;case"defaultValue":M=b;break;case"multiple":j=b;default:b!==V&&yt(o,s,y,b,d,V)}s=M,l=j,d=ue,ae!=null?sa(o,!!l,ae,!1):!!d!=!!l&&(s!=null?sa(o,!!l,s,!0):sa(o,!!l,l?[]:"",!1));return;case"textarea":ue=ae=null;for(M in l)if(y=l[M],l.hasOwnProperty(M)&&y!=null&&!d.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:yt(o,s,M,null,d,y)}for(j in d)if(y=d[j],b=l[j],d.hasOwnProperty(j)&&(y!=null||b!=null))switch(j){case"value":ae=y;break;case"defaultValue":ue=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==b&&yt(o,s,j,y,d,b)}x1(o,ae,ue);return;case"option":for(var Ne in l)if(ae=l[Ne],l.hasOwnProperty(Ne)&&ae!=null&&!d.hasOwnProperty(Ne))switch(Ne){case"selected":o.selected=!1;break;default:yt(o,s,Ne,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:yt(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 Ue in l)ae=l[Ue],l.hasOwnProperty(Ue)&&ae!=null&&!d.hasOwnProperty(Ue)&&yt(o,s,Ue,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:yt(o,s,oe,ae,d,ue)}return;default:if(bm(s)){for(var bt in l)ae=l[bt],l.hasOwnProperty(bt)&&ae!==void 0&&!d.hasOwnProperty(bt)&&oy(o,s,bt,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||oy(o,s,he,ae,d,ue);return}}for(var ee in l)ae=l[ee],l.hasOwnProperty(ee)&&ae!=null&&!d.hasOwnProperty(ee)&&yt(o,s,ee,null,d,ae);for(ve in d)ae=d[ve],ue=l[ve],!d.hasOwnProperty(ve)||ae===ue||ae==null&&ue==null||yt(o,s,ve,ae,d,ue)}function ES(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rz(){if(typeof performance.getEntriesByType=="function"){for(var o=0,s=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var y=l[d],b=y.transferSize,j=y.initiatorType,M=y.duration;if(b&&M&&ES(j)){for(j=0,M=y.responseEnd,d+=1;d<l.length;d++){var V=l[d],oe=V.startTime;if(oe>M)break;var he=V.transferSize,ve=V.initiatorType;he&&ES(ve)&&(V=V.responseEnd,j+=he*(V<M?1:(M-oe)/(V-oe)))}if(--d,s+=8*(b+j)/(y.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 iy=null,sy=null;function Sf(o){return o.nodeType===9?o:o.ownerDocument}function jS(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 OS(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 ay(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 ly=null;function Tz(){var o=window.event;return o&&o.type==="popstate"?o===ly?!1:(ly=o,!0):(ly=null,!1)}var AS=typeof setTimeout=="function"?setTimeout:void 0,$z=typeof clearTimeout=="function"?clearTimeout:void 0,CS=typeof Promise=="function"?Promise:void 0,zz=typeof queueMicrotask=="function"?queueMicrotask:typeof CS<"u"?function(o){return CS.resolve(null).then(o).catch(Dz)}:AS;function Dz(o){setTimeout(function(){throw o})}function Yo(o){return o==="head"}function NS(o,s){var l=s,d=0;do{var y=l.nextSibling;if(o.removeChild(l),y&&y.nodeType===8)if(l=y.data,l==="/$"||l==="/&"){if(d===0){o.removeChild(y),Ia(s);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Tc(o.ownerDocument.documentElement);else if(l==="head"){l=o.ownerDocument.head,Tc(l);for(var b=l.firstChild;b;){var j=b.nextSibling,M=b.nodeName;b[Xl]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=j}}else l==="body"&&Tc(o.ownerDocument.body);l=y}while(l);Ia(s)}function MS(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 cy(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":cy(l),pm(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}o.removeChild(l)}}function Lz(o,s,l,d){for(;o.nodeType===1;){var y=l;if(o.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(d){if(!o[Xl])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!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(b=o.getAttribute("src"),(b!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(s==="input"&&o.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===b)return o}else return o;if(o=lr(o.nextSibling),o===null)break}return null}function Iz(o,s,l){if(s==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=lr(o.nextSibling),o===null))return null;return o}function RS(o,s){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!s||(o=lr(o.nextSibling),o===null))return null;return o}function uy(o){return o.data==="$?"||o.data==="$~"}function dy(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function Uz(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 lr(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 fy=null;function TS(o){o=o.nextSibling;for(var s=0;o;){if(o.nodeType===8){var l=o.data;if(l==="/$"||l==="/&"){if(s===0)return lr(o.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}o=o.nextSibling}return null}function $S(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 zS(o,s,l){switch(s=Sf(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 Tc(o){for(var s=o.attributes;s.length;)o.removeAttributeNode(s[0]);pm(o)}var cr=new Map,DS=new Set;function Ef(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var io=B.d;B.d={f:Pz,r:Fz,D:Bz,C:Hz,L:qz,m:Vz,X:Kz,S:Zz,M:Gz};function Pz(){var o=io.f(),s=gf();return o||s}function Fz(o){var s=ra(o);s!==null&&s.tag===5&&s.type==="form"?Jk(s):io.r(o)}var za=typeof document>"u"?null:document;function LS(o,s,l){var d=za;if(d&&typeof s=="string"&&s){var y=tr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof l=="string"&&(y+='[crossorigin="'+l+'"]'),DS.has(y)||(DS.add(y),o={rel:o,crossOrigin:l,href:s},d.querySelector(y)===null&&(s=d.createElement("link"),ln(s,"link",o),Wt(s),d.head.appendChild(s)))}}function Bz(o){io.D(o),LS("dns-prefetch",o,null)}function Hz(o,s){io.C(o,s),LS("preconnect",o,s)}function qz(o,s,l){io.L(o,s,l);var d=za;if(d&&o&&s){var y='link[rel="preload"][as="'+tr(s)+'"]';s==="image"&&l&&l.imageSrcSet?(y+='[imagesrcset="'+tr(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(y+='[imagesizes="'+tr(l.imageSizes)+'"]')):y+='[href="'+tr(o)+'"]';var b=y;switch(s){case"style":b=Da(o);break;case"script":b=La(o)}cr.has(b)||(o=m({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:o,as:s},l),cr.set(b,o),d.querySelector(y)!==null||s==="style"&&d.querySelector($c(b))||s==="script"&&d.querySelector(zc(b))||(s=d.createElement("link"),ln(s,"link",o),Wt(s),d.head.appendChild(s)))}}function Vz(o,s){io.m(o,s);var l=za;if(l&&o){var d=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+tr(d)+'"][href="'+tr(o)+'"]',b=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=La(o)}if(!cr.has(b)&&(o=m({rel:"modulepreload",href:o},s),cr.set(b,o),l.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(zc(b)))return}d=l.createElement("link"),ln(d,"link",o),Wt(d),l.head.appendChild(d)}}}function Zz(o,s,l){io.S(o,s,l);var d=za;if(d&&o){var y=oa(d).hoistableStyles,b=Da(o);s=s||"default";var j=y.get(b);if(!j){var M={loading:0,preload:null};if(j=d.querySelector($c(b)))M.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":s},l),(l=cr.get(b))&&hy(o,l);var V=j=d.createElement("link");Wt(V),ln(V,"link",o),V._p=new Promise(function(oe,he){V.onload=oe,V.onerror=he}),V.addEventListener("load",function(){M.loading|=1}),V.addEventListener("error",function(){M.loading|=2}),M.loading|=4,jf(j,s,d)}j={type:"stylesheet",instance:j,count:1,state:M},y.set(b,j)}}}function Kz(o,s){io.X(o,s);var l=za;if(l&&o){var d=oa(l).hoistableScripts,y=La(o),b=d.get(y);b||(b=l.querySelector(zc(y)),b||(o=m({src:o,async:!0},s),(s=cr.get(y))&&py(o,s),b=l.createElement("script"),Wt(b),ln(b,"link",o),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function Gz(o,s){io.M(o,s);var l=za;if(l&&o){var d=oa(l).hoistableScripts,y=La(o),b=d.get(y);b||(b=l.querySelector(zc(y)),b||(o=m({src:o,async:!0,type:"module"},s),(s=cr.get(y))&&py(o,s),b=l.createElement("script"),Wt(b),ln(b,"link",o),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function IS(o,s,l,d){var y=(y=de.current)?Ef(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Da(l.href),l=oa(y).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=Da(l.href);var b=oa(y).hoistableStyles,j=b.get(o);if(j||(y=y.ownerDocument||y,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(o,j),(b=y.querySelector($c(o)))&&!b._p&&(j.instance=b,j.state.loading=5),cr.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},cr.set(o,l),b||Yz(y,o,l,j.state))),s&&d===null)throw Error(r(528,""));return j}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=La(l),l=oa(y).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 Da(o){return'href="'+tr(o)+'"'}function $c(o){return'link[rel="stylesheet"]['+o+"]"}function US(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function Yz(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}),ln(s,"link",l),Wt(s),o.head.appendChild(s))}function La(o){return'[src="'+tr(o)+'"]'}function zc(o){return"script[async]"+o}function PS(o,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=o.querySelector('style[data-href~="'+tr(l.href)+'"]');if(d)return s.instance=d,Wt(d),d;var y=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(o.ownerDocument||o).createElement("style"),Wt(d),ln(d,"style",y),jf(d,l.precedence,o),s.instance=d;case"stylesheet":y=Da(l.href);var b=o.querySelector($c(y));if(b)return s.state.loading|=4,s.instance=b,Wt(b),b;d=US(l),(y=cr.get(y))&&hy(d,y),b=(o.ownerDocument||o).createElement("link"),Wt(b);var j=b;return j._p=new Promise(function(M,V){j.onload=M,j.onerror=V}),ln(b,"link",d),s.state.loading|=4,jf(b,l.precedence,o),s.instance=b;case"script":return b=La(l.src),(y=o.querySelector(zc(b)))?(s.instance=y,Wt(y),y):(d=l,(y=cr.get(b))&&(d=m({},l),py(d,y)),o=o.ownerDocument||o,y=o.createElement("script"),Wt(y),ln(y,"link",d),o.head.appendChild(y),s.instance=y);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,jf(d,l.precedence,o));return s.instance}function jf(o,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,b=y,j=0;j<d.length;j++){var M=d[j];if(M.dataset.precedence===s)b=M;else if(b!==y)break}b?b.parentNode.insertBefore(o,b.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(o,s.firstChild))}function hy(o,s){o.crossOrigin==null&&(o.crossOrigin=s.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=s.referrerPolicy),o.title==null&&(o.title=s.title)}function py(o,s){o.crossOrigin==null&&(o.crossOrigin=s.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=s.referrerPolicy),o.integrity==null&&(o.integrity=s.integrity)}var Of=null;function FS(o,s,l){if(Of===null){var d=new Map,y=Of=new Map;y.set(l,d)}else y=Of,d=y.get(l),d||(d=new Map,y.set(l,d));if(d.has(o))return d;for(d.set(o,null),l=l.getElementsByTagName(o),y=0;y<l.length;y++){var b=l[y];if(!(b[Xl]||b[Xe]||o==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var j=b.getAttribute(s)||"";j=o+j;var M=d.get(j);M?M.push(b):d.set(j,[b])}}return d}function BS(o,s,l){o=o.ownerDocument||o,o.head.insertBefore(l,s==="title"?o.querySelector("head > title"):null)}function Qz(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 HS(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function Xz(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 y=Da(d.href),b=s.querySelector($c(y));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(o.count++,o=Af.bind(o),s.then(o,o)),l.state.loading|=4,l.instance=b,Wt(b);return}b=s.ownerDocument||s,d=US(d),(y=cr.get(y))&&hy(d,y),b=b.createElement("link"),Wt(b);var j=b;j._p=new Promise(function(M,V){j.onload=M,j.onerror=V}),ln(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=Af.bind(o),s.addEventListener("load",l),s.addEventListener("error",l))}}var my=0;function Wz(o,s){return o.stylesheets&&o.count===0&&Nf(o,o.stylesheets),0<o.count||0<o.imgCount?function(l){var d=setTimeout(function(){if(o.stylesheets&&Nf(o,o.stylesheets),o.unsuspend){var b=o.unsuspend;o.unsuspend=null,b()}},6e4+s);0<o.imgBytes&&my===0&&(my=62500*Rz());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Nf(o,o.stylesheets),o.unsuspend)){var b=o.unsuspend;o.unsuspend=null,b()}},(o.imgBytes>my?50:800)+s);return o.unsuspend=l,function(){o.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function Af(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nf(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Cf=null;function Nf(o,s){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Cf=new Map,s.forEach(Jz,o),Cf=null,Af.call(o))}function Jz(o,s){if(!(s.state.loading&4)){var l=Cf.get(o);if(l)var d=l.get(null);else{l=new Map,Cf.set(o,l);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var j=y[b];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),d=j)}d&&l.set(null,d)}y=s.instance,j=y.getAttribute("data-precedence"),b=l.get(j)||d,b===d&&l.set(null,y),l.set(j,y),this.count++,d=Af.bind(this),y.addEventListener("load",d),y.addEventListener("error",d),b?b.parentNode.insertBefore(y,b.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),s.state.loading|=4}}var Dc={$$typeof:A,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function eD(o,s,l,d,y,b,j,M,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=Zl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zl(0),this.hiddenUpdates=Zl(null),this.identifierPrefix=d,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function qS(o,s,l,d,y,b,j,M,V,oe,he,ve){return o=new eD(o,s,l,j,V,oe,he,ve,M),s=1,b===!0&&(s|=24),b=Fn(3,null,null,s),o.current=b,b.stateNode=o,s=Gm(),s.refCount++,o.pooledCache=s,s.refCount++,b.memoizedState={element:d,isDehydrated:l,cache:s},Wm(b),o}function VS(o){return o?(o=pa,o):pa}function ZS(o,s,l,d,y,b){y=VS(y),d.context===null?d.context=y:d.pendingContext=y,d=Io(s),d.payload={element:l},b=b===void 0?null:b,b!==null&&(d.callback=b),l=Uo(o,d,s),l!==null&&(Mn(l,o,s),pc(l,o,s))}function KS(o,s){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var l=o.retryLane;o.retryLane=l!==0&&l<s?l:s}}function gy(o,s){KS(o,s),(o=o.alternate)&&KS(o,s)}function GS(o){if(o.tag===13||o.tag===31){var s=Vi(o,67108864);s!==null&&Mn(s,o,67108864),gy(o,67108864)}}function YS(o){if(o.tag===13||o.tag===31){var s=Zn();s=Yl(s);var l=Vi(o,s);l!==null&&Mn(l,o,s),gy(o,s)}}var Mf=!0;function tD(o,s,l,d){var y=N.T;N.T=null;var b=B.p;try{B.p=2,yy(o,s,l,d)}finally{B.p=b,N.T=y}}function nD(o,s,l,d){var y=N.T;N.T=null;var b=B.p;try{B.p=8,yy(o,s,l,d)}finally{B.p=b,N.T=y}}function yy(o,s,l,d){if(Mf){var y=by(d);if(y===null)ry(o,s,d,Rf,l),XS(o,d);else if(oD(y,o,s,l,d))d.stopPropagation();else if(XS(o,d),s&4&&-1<rD.indexOf(o)){for(;y!==null;){var b=ra(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var j=Sr(b.pendingLanes);if(j!==0){var M=b;for(M.pendingLanes|=2,M.entangledLanes|=2;j;){var V=1<<31-hn(j);M.entanglements[1]|=V,j&=~V}Cr(b),(ut&6)===0&&(pf=ct()+500,Nc(0))}}break;case 31:case 13:M=Vi(b,2),M!==null&&Mn(M,b,2),gf(),gy(b,2)}if(b=by(d),b===null&&ry(o,s,d,Rf,l),b===y)break;y=b}y!==null&&d.stopPropagation()}else ry(o,s,d,null,l)}}function by(o){return o=wm(o),vy(o)}var Rf=null;function vy(o){if(Rf=null,o=na(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 Rf=o,null}function QS(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(Wn()){case Jn:return 2;case Nt:return 8;case ke:case Ce:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var wy=!1,Qo=null,Xo=null,Wo=null,Lc=new Map,Ic=new Map,Jo=[],rD="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 XS(o,s){switch(o){case"focusin":case"focusout":Qo=null;break;case"dragenter":case"dragleave":Xo=null;break;case"mouseover":case"mouseout":Wo=null;break;case"pointerover":case"pointerout":Lc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ic.delete(s.pointerId)}}function Uc(o,s,l,d,y,b){return o===null||o.nativeEvent!==b?(o={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:b,targetContainers:[y]},s!==null&&(s=ra(s),s!==null&&GS(s)),o):(o.eventSystemFlags|=d,s=o.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),o)}function oD(o,s,l,d,y){switch(s){case"focusin":return Qo=Uc(Qo,o,s,l,d,y),!0;case"dragenter":return Xo=Uc(Xo,o,s,l,d,y),!0;case"mouseover":return Wo=Uc(Wo,o,s,l,d,y),!0;case"pointerover":var b=y.pointerId;return Lc.set(b,Uc(Lc.get(b)||null,o,s,l,d,y)),!0;case"gotpointercapture":return b=y.pointerId,Ic.set(b,Uc(Ic.get(b)||null,o,s,l,d,y)),!0}return!1}function WS(o){var s=na(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,Ee(o.priority,function(){YS(l)});return}}else if(s===31){if(s=u(l),s!==null){o.blockedOn=s,Ee(o.priority,function(){YS(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 Tf(o){if(o.blockedOn!==null)return!1;for(var s=o.targetContainers;0<s.length;){var l=by(o.nativeEvent);if(l===null){l=o.nativeEvent;var d=new l.constructor(l.type,l);vm=d,l.target.dispatchEvent(d),vm=null}else return s=ra(l),s!==null&&GS(s),o.blockedOn=l,!1;s.shift()}return!0}function JS(o,s,l){Tf(o)&&l.delete(s)}function iD(){wy=!1,Qo!==null&&Tf(Qo)&&(Qo=null),Xo!==null&&Tf(Xo)&&(Xo=null),Wo!==null&&Tf(Wo)&&(Wo=null),Lc.forEach(JS),Ic.forEach(JS)}function $f(o,s){o.blockedOn===s&&(o.blockedOn=null,wy||(wy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iD)))}var zf=null;function e2(o){zf!==o&&(zf=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){zf===o&&(zf=null);for(var s=0;s<o.length;s+=3){var l=o[s],d=o[s+1],y=o[s+2];if(typeof d!="function"){if(vy(d||l)===null)continue;break}var b=ra(l);b!==null&&(o.splice(s,3),s-=3,bg(b,{pending:!0,data:y,method:l.method,action:d},d,y))}}))}function Ia(o){function s(V){return $f(V,o)}Qo!==null&&$f(Qo,o),Xo!==null&&$f(Xo,o),Wo!==null&&$f(Wo,o),Lc.forEach(s),Ic.forEach(s);for(var l=0;l<Jo.length;l++){var d=Jo[l];d.blockedOn===o&&(d.blockedOn=null)}for(;0<Jo.length&&(l=Jo[0],l.blockedOn===null);)WS(l),l.blockedOn===null&&Jo.shift();if(l=(o.ownerDocument||o).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var y=l[d],b=l[d+1],j=y[He]||null;if(typeof b=="function")j||e2(l);else if(j){var M=null;if(b&&b.hasAttribute("formAction")){if(y=b,j=b[He]||null)M=j.formAction;else if(vy(y)!==null)continue}else M=j.action;typeof M=="function"?l[d+1]=M:(l.splice(d,3),d-=3),e2(l)}}}function t2(){function o(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(j){return y=j})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=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,y=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),y!==null&&(y(),y=null)}}}function xy(o){this._internalRoot=o}Df.prototype.render=xy.prototype.render=function(o){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,d=Zn();ZS(l,d,o,s,null,null)},Df.prototype.unmount=xy.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var s=o.containerInfo;ZS(o.current,2,null,o,null,null),gf(),s[Er]=null}};function Df(o){this._internalRoot=o}Df.prototype.unstable_scheduleHydration=function(o){if(o){var s=se();o={blockedOn:null,target:o,priority:s};for(var l=0;l<Jo.length&&s!==0&&s<Jo[l].priority;l++);Jo.splice(l,0,o),l===0&&WS(o)}};var n2=t.version;if(n2!=="19.2.6")throw Error(r(527,n2,"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?g(o):null,o=o===null?null:o.stateNode,o};var sD={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lf.isDisabled&&Lf.supportsFiber)try{Mt=Lf.inject(sD),wt=Lf}catch{}}return Fc.createRoot=function(o,s){if(!i(o))throw Error(r(299));var l=!1,d="",y=c_,b=u_,j=d_;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError)),s=qS(o,1,!1,null,null,l,d,null,y,b,j,t2),o[Er]=s.current,ny(o),new xy(s)},Fc.hydrateRoot=function(o,s,l){if(!i(o))throw Error(r(299));var d=!1,y="",b=c_,j=u_,M=d_,V=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(V=l.formState)),s=qS(o,1,!0,s,l??null,d,y,V,b,j,M,t2),s.context=VS(null),l=s.current,d=Zn(),d=Yl(d),y=Io(d),y.callback=null,Uo(l,y,d),l=d,s.current.lanes=l,Pi(s,l),Cr(s),o[Er]=s.current,ny(o),new Df(s)},Fc.version="19.2.6",Fc}var h2;function gD(){if(h2)return Ey.exports;h2=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(),Ey.exports=mD(),Ey.exports}var yD=gD();const bD=6,ls=12,vD=288,wD='[aria-modal="true"]',xD=".hp-sb-scroll";function Cs(e){var c,u;const t=window.innerWidth,n=window.innerHeight,r=(c=e.closest(wD))==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 Ml({rect:e,bounds:t,viewportHeight:n},{maxHeight:r=vD,minWidth:i=0,gap:a=bD,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-ls,f=e.top-t.top-a-ls,p=c??Math.min(r,220),g=u<p&&f>u,w=Math.max(0,Math.min(r,g?f:u)),v=Math.max(t.left+ls,Math.min(e.left,t.right-Math.max(e.width,i)-ls)),_={left:v,width:e.width,maxWidth:Math.max(e.width,i,t.right-v-ls),maxHeight:w};return g?{..._,bottom:n-e.top+a}:{..._,top:e.bottom+a}}function kD(e,t,n){const[r,i]=x.useState(null);return x.useEffect(()=>{if(!e)return;const a=()=>{const u=t.current;u&&i(Cs(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:Ml(r,n)}const AA=Symbol.for("@homepages/concrete:row:of"),CA=Symbol.for("@homepages/concrete:element:of");function i0(e){return typeof e=="object"&&e!==null&&e.kind==="sibling"&&In(e.of)}function _D(e,t){return e===t||Yt(e)&&Yt(t)&&e.key===t.key}function NA(e,t){const n=[...e];for(const r of t??[])n.some(i=>_D(i,r))||n.push(r);return n}function Bs(e){return typeof e=="object"&&e!==null&&"section"in e&&typeof e.section=="string"&&"slot"in e&&typeof e.slot=="string"}function s0(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="row"&&"field"in e&&typeof e.field=="string"}function Zu(e){if(!s0(e))return;const t=e[AA];return typeof t=="object"&&t!==null?t:void 0}function wo(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="element"}function SD(e){if(!wo(e))return;const t=e[CA];return typeof t=="object"&&t!==null?t:void 0}function Yt(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="home"&&"key"in e&&typeof e.key=="string"}function MA(e){return typeof e=="object"&&e!==null&&"head"in e&&typeof e.head=="object"&&"declaration"in e&&In(e.declaration)}function In(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}function ED(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 jD(e){return{kind:"section",section:e.section,slot:e.slot}}function OD(e){return Bs(e)?jD(e):s0(e)?ED(e):wo(e)?{kind:"element"}:{kind:"home",key:e.key}}function AD(e){return e.kind==="section"}function Cy(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:NA(e.reads,e.requires),requires:[...e.requires]}}function ki(e){return typeof e=="object"&&e!==null&&"kind"in e&&e.kind==="compute"&&"fn"in e&&typeof e.fn=="function"}function Ku(e){return typeof e=="object"&&e!==null&&e.kind==="compute"&&typeof e.fn=="function"}function CD(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 RA(e,t){return e.fn(...e.reads.map(n=>CD(n,t)))}function p2(e,t){return typeof e=="string"?e:RA(e,{facts:t})}function TA(e){return Ku(e.source)}const ND={write:new Set(["brief","reads","requires","none"]),pick:new Set(["brief","reads","requires","unique"]),find:new Set(["brief","reads","requires","none"])};function a0(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=ND[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=NA(i.reads??[],a)),i}function MD(e){return a0("write",e)}function RD(e){return a0("pick",e)}function TD(e){return a0("find",e)}const Lr={write:MD,pick:RD,find:TD};function Ai(e,t){if(Ns(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=>!Ns(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 gp(e){return Ns(e)||Array.isArray(e)&&e.length>0&&e.every(Ns)}function Ns(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 l0=Symbol.for("@homepages/concrete:fill:declaration");function $D(e){return gp(e)?{[l0]:Ns(e)?[e]:[...e]}:{}}const zD=Symbol.for("@homepages/concrete:fill:section");function DD(e){return e==null?void 0:e[zD]}function wr(e){if(!(typeof e!="object"||e===null))return e[l0]}const LD=["Basement","Ground","1st floor","2nd floor","3rd floor","4th floor","Penthouse"],m2=["id","slot","index","def","value","present","enclosing"],Eo=["image","video","tour","document"];function _n(e){return Eo.includes(e)}function xo(e){return e==="media"||_n(e)}const Ci={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:{}}},c0=Object.keys(Ci),ID=c0.filter(e=>Ci[e].site==="holder");c0.filter(e=>Ci[e].site==="kind");function UD(e){return typeof e=="string"&&Object.hasOwn(Ci,e)}function $A(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const{kind:t,verb:n}=e;return t==="process"&&UD(n)?e:null}function u0(e){const t=Ci[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 _i(e){const{type:t,kinds:n}=e;if(t==="media"){const r=Array.isArray(n)?n.filter(i=>typeof i=="string"&&_n(i)):[];return r.length>0?r:Eo}return typeof t=="string"&&_n(t)?[t]:[]}function zA(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"&&_n(a)))return`declares \`kinds\` ${JSON.stringify(t)} — a non-empty list of ${Eo.join(", ")}`}if(n===void 0)return null;const r=ID.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=$A(a);if(c===null)return`processes ${JSON.stringify(a)}, which is no process (${r})`;const{verb:u}=c,f=Ci[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=u0(c);if(p!==null)return`processes "${u}" with options that do not fit: ${p}`;const g=_i(e).filter(m=>!f.kinds.includes(m));if(g.length>0)return`processes "${u}", which applies to ${f.kinds.join(", ")} and not to ${g.join(", ")}`}return null}const PD=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 DA(e){const t=(e.split(";")[0]??"").trim().toLowerCase();return t.startsWith("image/")?"image":t.startsWith("video/")?"video":PD.has(t)?"document":null}function LA(e){const t=Gu(e);if(t===null)return null;const n=Ni[t].kind;return n==="tour"||n==="video"?n:null}const FD=["tour","video","social","listing","file","map"],Ni={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 Gu(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(Ni))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}function BD(e,t){const n=Gu(t);return n===null?!1:n===e?!0:FD.includes(e)&&Ni[n].kind===e}const HD=new Set(Eo.filter(e=>Object.values(Ni).some(t=>t.kind===e)));function d0(e){return e.filter(t=>HD.has(t))}function IA(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 qD(e){return typeof e=="string"&&/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/.test(e)}function VD(e){if(typeof e!="string"||!/^\+?[\d\s().-]+$/.test(e))return!1;const t=e.replace(/\D/g,"").length;return t>=7&&t<=15}function ZD(e){try{return new URL(e)}catch{return null}}function ou(e){const t=e.trim();return t&&(/^https?:\/\//i.test(t)?t:`https://${t}`)}function f0(e){const t=ZD(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 KD(e){const t=e.trim();if(!t)return null;const n=Gu(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&&GD.has(n)?t:null}const GD=new Set(["biganto","iguide","kuula","momento360","cloudpano","asteroom","zillow3d"]);function h0(e,t){return[e,t].map(n=>(n??"").trim()).filter(n=>n!=="").join(", ")}const YD=["autocomplete","manual_pinned","resolved"],UA=["street","unit","city","state","postal"],yp=[...UA,"latitude","longitude"];function bp(e){return yp.includes(e)}function Bc(e){if(typeof e!="string")return null;const t=e.trim();return t===""?null:t}function g2(e,t){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<=t?e:null}function tn(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e,n=g2(t.latitude,90),r=g2(t.longitude,180),i=n!==null&&r!==null,a=t.source,c={street:Bc(t.street),unit:Bc(t.unit),city:Bc(t.city),state:Bc(t.state),postal:Bc(t.postal),latitude:i?n:null,longitude:i?r:null,source:typeof a=="string"&&YD.includes(a)?a:null};return i||UA.some(u=>c[u]!==null)?c:null}function QD(e){const t=tn(e);return t===null||t.latitude===null?!1:t.street!==null&&t.city!==null&&t.state!==null&&t.postal!==null}function p0(e){var t;return((t=/^\s*(\d{5})-?\d{4}\s*$/.exec(e))==null?void 0:t[1])??e}function XD(e){const t=h0(e.street,e.unit),n=[e.state,e.postal===null?null:p0(e.postal)].filter(i=>i!==null).join(" "),r=[t,e.city??"",n].filter(i=>i!=="").join(", ");return r===""?null:r}function WD(e,t){const n=tn(e);return n===null?null:n[t]}const PA=["crop","cutout","mask_white","mask_black"],JD=["master","crop","cutout","mask_white","mask_black","poster","encode"];function Hs(e){return e!==null&&!(e.x<=0&&e.y<=0&&e.width>=1&&e.height>=1)}function eL(e,t=e){return{id:t,file:e,crop:null,name:null,renditions:{crop:null,cutout:null,mask_white:null,mask_black:null}}}function tL(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 nL(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:tL(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 rL(e){const{id:t,file:n,crop:r,name:i,renditions:a,...c}=e,{crop:u,cutout:f,mask_white:p,mask_black:g,...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:g}}}}function m0(e,t){return nL(e,t)}function oL(e){return e.url===null?"upload":"link"}function ko(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function vp(e){if(!ko(e))return!1;const{id:t,kind:n,renditions:r}=e;return typeof t=="string"&&typeof n=="string"&&_n(n)&&ko(r)}function Yu(e){return ko(e)&&typeof e.id=="string"&&typeof e.file=="string"&&ko(e.renditions)&&!("kind"in e)&&!("picked"in e)}function FA(e){return ko(e)&&typeof e.file=="string"&&e.file!==""&&!Yu(e)&&!vp(e)}function jo(e){return ko(e)&&typeof e.media=="string"&&e.media!==""}function Qn(e){if(ko(e)){if(jo(e))return e.media;if(Yu(e)||vp(e))return e.id;if(FA(e))return e.picked??e.file}}function iL(e){if(jo(e))return e.media;if(FA(e))return e.file}function xb(e,t){if(Array.isArray(e))for(const n of e)xb(n,t);else if(Yu(e))t.has(e.id)||t.set(e.id,e);else if(ko(e)&&!vp(e))for(const n of Object.values(e))xb(n,t)}function Rl(e){const t=new Map;for(const[n,r]of Object.entries(e))n!=="files"&&xb(r,t);return t}function sL(e){return Object.hasOwn(e,"crop")||e.renditions!==void 0}function aL(e,t){const n=Object.hasOwn(t,"crop"),r=t.renditions??{},i=n?null:e.renditions,a=Object.fromEntries(PA.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 wp(e,t){return sL(t)?{...e,...aL({crop:e.crop,renditions:e.renditions},t)}:e}function _h(e){if(Array.isArray(e))return e.map(_h);if(!ko(e))return e;if(vp(e)||Yu(e))return{media:e.id};if(jo(e)){const{crop:n,renditions:r,...i}=e;return i}const t={};for(const[n,r]of Object.entries(e))t[n]=_h(r);return t}const Sh="property.uploads";function Oo(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 gu(e){const t=_i(e);if(t.length===0)return null;const n=Oo(e.from);return n===void 0?{kinds:t}:{kinds:t,from:n}}function yu(e){return{kinds:e.kinds,from:Oo(e.from)??[Sh]}}function BA(e){return yu(e).from[0]}function kb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function lL(e){if(Qn(e)!==void 0||!kb(e))return e;for(const t of Object.values(e))if(Qn(t)!==void 0)return t}function HA(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=>kb(c)&&c.id===a):kb(i)&&Object.hasOwn(i,a)?i[a]:void 0,i===void 0)return null;return Array.isArray(i)?i.flatMap(a=>{const c=lL(a),u=Qn(c);return u===void 0?[]:[{id:u,value:c}]}):null}function cL(e,t){const n=Rl(e),r=new Set,i=[];for(const a of Oo(t.from)??[])for(const{id:c,value:u}of HA(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 g=jo(u)?wp(f,u):f;i.push({id:c,value:g,file:p,list:a})}return i}function uL(e,t){const n={uploads:(e[Sh]??t.map(r=>r.id)).map(r=>eL(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!==Sh&&(n[c]=i.map(f=>({media:f})))}return{...n,files:Object.fromEntries(t.map(r=>[r.id,r]))}}function dL(e,t){const n=new Map(t.map(a=>[a.id,rL(a)])),r=uL(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 fL(e){if(e===null||typeof e!="object")return null;const t=e;return t.type!=="media"||t.kinds===void 0||zA({type:"media",kinds:t.kinds})!==null||t.from!==void 0&&(!Array.isArray(t.from)||Oo(t.from)===void 0)?null:gu(t)}function hL(e){return{type:"media",kinds:[...e.kinds],...e.from===void 0?{}:{from:[...e.from]}}}function pL(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 Za=new Map;function qA(e){Za.set(e.home,e)}function g0(e){const t=Za.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 VA=new Set(["text","select","email","phone","url","date"]);function Qu(e){switch(e.type){case"number":case"image":case"address":return e.type;case"list":return mL(e.element);default:return VA.has(e.type)?"text":null}}function mL(e){return e.type==="object"?"row_list":e.type==="image"?"image_list":e.type==="number"?"number_list":VA.has(e.type)?"text_list":null}function _b(e){if(e.type==="list"){const n=e.element;if(n.type!=="object")return _b(n);for(const r of Object.values(n.fields)){const i=_b(r);if(i!==void 0)return i}return}const t=e.from===void 0?null:gu(e);return(t==null?void 0:t.from)===void 0?void 0:t}function gL(e){if(e.type!=="list")return!1;const t=e.element.type;return _n(t)||t==="media"}function yL(e){return Object.entries(e.pages).flatMap(([t,n])=>gL(n.declaration)?[`${e.home}.${t}`]:[])}function bL(e){return Ku(e.source)}const y2=new WeakMap;function ZA(e){let t=y2.get(e);return t===void 0&&(t=vL(e),y2.set(e,t)),t}function vL(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 yp)t.set(`${a}.${c}`,{declaration:i,value_type:KA(c)});continue}t.set(a,{declaration:i,value_type:wL(a,i)})}return t}function wL(e,t){if(t.type==="image")return"image";if(_n(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 KA(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 Ny;function GA(){if(Ny!==void 0)return Ny;g0("library");const e=new Map;for(const t of Za.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 Za.has("property")&&Za.has("library")&&(Ny=e),e}function y0(){return[...new Set(GA().values())]}function Xt(e){return typeof e=="string"?GA().get(e)??null:null}function Xu(e){return(e==null?void 0:e.kind)==="home"?Xt(e.key):null}function kL(e){return Xu(e.source)}function bi(e){for(const t of Za.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 dl(e){return`property.${e}`}function _L(e){return`${bi(e)}.${e}`}function YA(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 QA(e){return YA(g0(bi(e)),e)}function XA(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Wu(e,t){const n=XA(QA(e),t);return n===void 0?void 0:Qu(n)}function SL(e){if(typeof e!="string")return null;const t=e.lastIndexOf(".");if(t<=0)return null;const n=Xt(e.slice(0,t));if(n===null)return null;const r=e.slice(t+1);return Wu(n,r)==="row_list"?{table:n,member:r}:null}function EL(e){if(typeof e!="string")return null;const t=e.lastIndexOf(".");if(t<=0)return null;const n=e.slice(0,t),r=Xt(n);if(r===null)return null;const i=e.slice(t+1);return Wu(r,i)===void 0?null:{table:r,tableKey:n,member:i}}const b0=["type","label","from","source","locked","when"],b2=new Set(b0),v0=Symbol.for("@homepages/concrete:table-of");function WA(e,t){return Object.defineProperty(e,v0,{value:t,enumerable:!1})}function w0(e){if(typeof e!="object"||e===null)return null;const t=e[v0];return typeof t=="string"?t:null}function jL(e){return Object.keys(QA(e))}function bu(e,t){return Object.freeze({kind:"row",field:t,[AA]:e})}function OL(e,t){return new Proxy(bu(e,t),{get(n,r,i){return typeof r=="string"&&!(r in n)&&bp(r)?bu(e,`${t}.${r}`):Reflect.get(n,r,i)}})}const JA=Symbol.for("@homepages/concrete:row:definition");function $r(e){const t=e[JA];return typeof t=="object"&&t!==null?t:e}const AL=new Set(["then","toJSON","$$typeof","asymmetricMatch","nodeType","tagName","@@iterator"]);function CL(e,t,n=[]){const r=t===null?null:new Set(jL(t)),i=new Proxy(e,{get(a,c,u){if(c===JA)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:Wu(m,c));if(p.every(m=>m===void 0))return Reflect.get(a,c,u);const g=p.findIndex(m=>m===void 0||m!==p[0]);if(g===-1)return p[0]==="address"?OL(i,c):bu(i,c);if(c in a||b2.has(c))return Reflect.get(a,c,u);throw new Error(`row: "${String(a.label)}" reads the member "${c}", which its \`from\` table ${f[g]} ${p[g]===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||b2.has(c)?Reflect.get(a,c,u):AL.has(c)?void 0:bu(i,c)}});return i}function NL(e){const t=new Proxy(e,{get(n,r,i){return typeof r=="string"&&!(r in n)&&bp(r)?bu(t,r):Reflect.get(n,r,i)}});return t}function v2(e,t){const n=e.map(t);return n.some((r,i)=>r!==e[i])?n:void 0}function w2(e,t){const n=e.reads===void 0?void 0:v2(e.reads,t),r=e.requires===void 0?void 0:v2(e.requires,t);return n===void 0&&r===void 0?e:{...e,...n===void 0?{}:{reads:n},...r===void 0?{}:{requires:r}}}function fl(e,t){const n=$r(e);let r;const i=n.source;if(i!==void 0)if(ki(i)){const c=w2(i,t);c!==i&&(r={...n,source:c})}else{const c=t(i);c!==i&&(r={...n,source:c})}const a=wr(n);if(a!==void 0){let c=!1;const u=a.map(f=>{const p=w2(f,t);return p!==f&&(c=!0),p});c&&(r={...r??n,[l0]:u})}return r??n}function ML(e){return t=>{const n=Zu(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 eC=new Set(["row","address"]);function RL(e){const t=new Map;for(const[n,r]of Object.entries(e))typeof r=="object"&&r!==null&&eC.has(r.type)&&t.set(r,n);return t}function TL(e,t,n){const r=[e.source];fl(e,i=>(r.push(i),i));for(const[i,a]of t)if(!(i===e||a===n))for(const c of b0){const u=i[c];if(u!==void 0&&r.includes(u))return`${a}.${c}`}}function $L(e){const t=e.slice(e.indexOf(".")+1);return`reads \`${e}\`, which is the row's own \`${t}\`, not a member — a row's ${b0.map(n=>`\`${n}\``).join(", ")} are its slot definition's, and its table has no member named \`${t}\`.`}function vu(e){return eC.has(e.type)?{...$r(e)}:e}function x0(e,t){for(const n of Ai(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 zL(e){return Bs(e)?{kind:"section",section:e.section,slot:e.slot}:In(e)?{kind:"sibling",of:e}:Yt(e)?{kind:"home",key:e.key}:e}function kr(e){return k0(e,zL)}function DL(e,t,n){if(!(t!==!0||n===void 0)){if(ki(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(Bs(n)||In(n)||i0(n))throw new Error(`${e} is \`required\` and mirrors another slot — a mirror requires its upstream; mark that slot \`required\` instead.`)}}function k0(e,t){const n=e.source;DL(e.label??"a slot",e.required,n);const r=n!==void 0&&Ai(n,e.label??"a slot")===void 0;return{...e.locked===!0?{locked:!0}:{},...e.required===!0?{required:!0}:{},...r?{source:t(n)}:{},...$D(n),...e.label!==void 0?{label:e.label}:{},...e.placeholder!==void 0?{placeholder:e.placeholder}:{},...e.when!==void 0?{when:e.when}:{}}}function My(e){return t=>({type:"text",size:e,...kr(t),...t.cap!==void 0?{cap:t.cap}:{}})}const kn={short:My("short"),medium:My("medium"),long:My("long")};function un(e){return{type:"number",...kr(e),...e.thousandsSep!==void 0?{thousandsSep:e.thousandsSep}:{},...e.decimals!==void 0?{decimals:e.decimals}:{},...e.maxDigits!==void 0?{maxDigits:e.maxDigits}:{}}}function LL(e){return{type:"select",...kr(e),...e.creatable!==void 0?{creatable:e.creatable}:{}}}function IL(e){if(Yt(e.source))throw new Error(`select: "${e.label}" declares both \`from\` and a fact \`source\` — a select takes exactly one set of choices.`);return x0(`select: "${e.label}"`,e.source),{type:"select",...kr(e),values:[...e.from],...e.creatable!==void 0?{creatable:e.creatable}:{}}}function UL(e,t){if(Ns(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 x0("select: a display entry",t.source),{cases:[...e],...t.locked===!0?{locked:!0}:{},...t.source!==void 0?{source:t.source}:{}}}function PL(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)?UL(e.from,e):e.from!==void 0?IL(e):LL(e)}const Eh=PL;function Fa(e){return{type:"url",...kr(e),...e.accepts!==void 0?{accepts:e.accepts}:{}}}function tC(e){return{type:"date",...kr(e)}}function FL(e){return{type:"email",...kr(e)}}function BL(e){return{type:"phone",...kr(e)}}function _0(e={}){return NL({type:"address",...kr(e)})}function nC(e,t){const n=`${e}: "${t.label??e}"`;x0(n,t.source);const r=zA({type:e,kinds:t.kinds,process:t.process});if(r!==null)throw new Error(`${n} ${r}.`);const i=Ai(t.source,n),a=t.source!==void 0&&i===void 0&&!ki(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||ki(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=HL(n,e,t.kinds,t.from),u=c==null?void 0:c.map(f=>Yt(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 HL(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=_i({type:t,kinds:n}),c=new Set;for(const u of i){const f=typeof u=="object"&&u!==null&&!Yt(u),p=Yt(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 g=_i(p.element);if(g.length>0&&!a.some(m=>g.includes(m)))throw new Error(`${e} picks \`from\` a list of ${g.join(", ")}, whose items can never be ${a.join(" or ")} — each list it picks from holds items of its kinds.`)}return i}function vi(e={}){return{type:"image",...kr(e),...e.crop!==void 0?{crop:e.crop}:{},...nC("image",e)}}function S0(e={}){return{type:"media",...kr(e),...e.kinds!==void 0?{kinds:[...e.kinds]}:{},...nC("media",e)}}const E0=Symbol.for("@homepages/concrete:object:declared-fields");function Tl(e){return e[E0]}function rC(e,t){const n=Tl(t);return n!==void 0&&Object.defineProperty(e,E0,{value:n,enumerable:!1}),e}const oC="a label is a source, as a text slot takes one",Sb="`label: text.short({ cap: 60, source: fill.write({ reads, brief }) })`",qL=new Set(["type","size","cap","locked"]);function VL(e,t,n){if(typeof t=="string")throw new Error(`${e} declares the label ${JSON.stringify(t)} — ${oC}: write \`label: compute(() => ${JSON.stringify(t)})\`.`);if(In(t)){const r=Object.entries(n).find(([,i])=>i===t);if(r===void 0)return ZL(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(gp(t)){const r=Ns(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: ${Sb}.`)}return kn.short({locked:!0,source:t})}function ZL(e,t){const n=wr(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 — ${oC}: write what that slot read as the label (\`label: comp.address.street\`, \`label: compute(() => "Listing agent")\`), a written label as ${Sb}; a title the user edits is a field, which the label names by its const.`);const r=Object.keys(t).filter(c=>!qL.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: ${Sb}; a title the user edits is a field, which the label names by its const.`);const{size:i,cap:a}=t;return kn[i]({locked:!0,source:n.length===1?n[0]:n,...a!==void 0?{cap:a}:{}})}function KL(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 GL(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 iu="declare the list at the top level instead";function GL(e){const t=wr(e);if(t!==void 0&&t.some(i=>i.verb!=="pick")||t===void 0&&gp(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; ${iu}`;const n=e.source;if(Yt(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; ${iu}`;if(Bs(n)||i0(n)||In(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; ${iu}`;const r=e.element.fields;for(const[i,a]of Object.entries(r)){const c=YL(a,r);if(c!==void 0)return`a list of objects whose item field "${i}" is ${c}`}}function YL(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(wr(e)!==void 0)return`filled — no fill writes into a list inside an object; ${iu}`;const n=e.source;if(n===void 0)return;if(ki(n))return`a \`compute()\` — an item of a list inside an object reads its element, or a row \`from\` its member; ${iu}`;const{kind:r,slot:i}=n;if(r==="element"&&e.type==="row"&&Xt(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 Ju(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=m2.find(g=>Object.hasOwn(e.fields,g));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 ${m2.map(g=>`\`${g}\``).join(", ")}. Rename the field.`);const r=e.label===void 0?void 0:VL(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[g,m]of Object.entries(a)){const w=KL(m);if(w!==void 0)throw new Error(`${t} field "${g}" is ${w}.`);if(g!=="label"&&m.label===void 0)throw new Error(`${t} field "${g}" declares no \`label\` — every field of an object states the name the editor shows it by.`)}const c=RL(a);for(const[g,m]of Object.entries(a)){const w=TL(m,c);if(w!==void 0)throw new Error(`${t} field "${g}" ${$L(w)}`)}const u=ML(c),f={};for(const[g,m]of Object.entries(a))f[g]=vu(fl(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,E0,{value:a,enumerable:!1}),p}const QL=new Set(["text","select","url","date","email","phone"]);function XL(e){if(typeof e=="string")return Xt(e)??e}function WL(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 JL(e){if(e.fields!==void 0||e.element===void 0)return;const t=WL(e.element);return t===void 0?void 0:jh(t)}function jh(e){const t=e.type??"unknown";if(QL.has(t))return"string";if(t==="row"){const n=XL(e.from);return n===void 0?void 0:`row<${n}>`}if(t==="list"){const n=JL(e);return n===void 0?void 0:`list<${n}>`}return t==="object"?`{ ${Object.entries(e.fields??{}).map(([r,i])=>`${r}: ${jh(i)??"unknown"}`).sort().join("; ")} }`:t}function Oh(e){const t=e.indexOf("/");return t===-1?e:e.slice(t+1)}function e6(e,t=[]){const n=new Map;for(const c of e)for(const u of c.sections){const f=Oh(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(g=>g.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===Oh(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 iC(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 x2=e=>e.type==="row"||e.type==="list"?e.type:"value";function t6(e,t){if(x2(e)!==x2(t))return!1;const n=jh(e),r=jh(t);return n===void 0||r===void 0||n===r}function sC(e,t,n){const r=iC(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"}:t6(n.def,a.def)?{kind:"upstream",address:i,def:a.def}:{kind:"none"}}function n6(e,t){const n=e.slotAt(t),r=n===void 0?void 0:sC(e,t,n);return(r==null?void 0:r.kind)==="upstream"?r.address:null}function r6(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=sC(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 ed=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function xp(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"||!ed(r.fields))return;const i=t.slice(n+1);return Object.hasOwn(r.fields,i)?r.fields[i]:void 0}function aC(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=xp(e,n);return r===void 0?void 0:{path:n,def:r,sibling:!1}}function o6(e){return e==="row"||e==="address"}function lC(e,t,n){const r=aC(e,t,n);if(!(r===void 0||!o6(r.def.type)))return{...r,kind:r.def.type}}function i6(e){return Xt(e.from)}function wu(e){if(!Array.isArray(e.from)){const t=i6(e);return t===null?[]:[t]}return e.from.flatMap(t=>Xt(t)??[])}function cC(e,t){const n=new Set,r=[];for(const i of t){const a=e[i];for(const c of a){const u=Ah(c.id);u===null||n.has(u)||(n.add(u),r.push({id:u,table:i}))}}return r}function kp(e,t,n){if(t.length>1&&n!==null){const r=cC(e,t).find(i=>i.id===n);if(r!==void 0)return r.table}return t[0]??null}function uC(e){if(e===void 0)return;if(k2(e.source))return e;if(e.type!=="object"||!ed(e.fields))return;const t=Object.values(e.fields).filter(n=>k2(n.source));return t.length===1?t[0]:void 0}function dC(e){const t=uC(e);return(t==null?void 0:t.type)==="row"?wu(t):[]}function k2(e){return ed(e)&&e.kind==="element"}function s6(e,t){return fC(e,e.section,e.slots,t,new Set)}function _2(e,t,n,r,i){const a=`${t??""}\0${r}`;if(i.has(a))return[];i.add(a);const c=xp(n,r);return(c==null?void 0:c.type)==="row"?wu(c):(c==null?void 0:c.type)==="list"?fC(e,t,n,c,i):[]}function fC(e,t,n,r,i){var m;const a=ed(r.source)?r.source:void 0;if(a===void 0||a.kind==="authored"||a.kind==="derived")return dC(r.element);const c=Xu(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 _2(e,t,n,p,i);const g=(m=e.sectionSlots)==null?void 0:m.call(e,f);return g===void 0?[]:_2(e,f,g,p,i)}const Ah=e=>typeof e=="string"&&e!==""?e:null;function j0(e,t=null){if(typeof e=="string")return t===null?null:Ah(e);const n=a6(e);return n===null?null:Ah(e[n])}function a6(e){return ed(e)?["id","media","file"].find(t=>Ah(e[t])!==null)??null:null}function l6(e,t){if(Yt(e)){if(Xt(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(Bs(e))return{kind:"section",section:e.section,slot:e.slot};if(In(e))return{kind:"sibling",of:e};if(Zu(e)!==void 0||ki(e))return e;throw new Error(`list: "${t}" declares a source that is no list.`)}function hC(e){return Yt(e)?Xt(e.key):In(e)&&e.type==="list"?w0(e):null}const c6=new Set(["label","locked","placeholder","when","source"]);function u6(e){const t={};for(const[n,r]of Object.entries(e))c6.has(n)||(t[n]=r);return t}function d6(e,t){if(Yt(e)&&Xt(e.key)!==null)return{type:"row",from:e.key,source:{kind:"element"}};for(const r of Ai(e,`list: "${t}"`)??[]){if(r.verb==="write")throw new Error(pC(t,"declares no `item`"));if(r.verb==="pick")throw new Error(Eb(t,"declares no `item`"))}if(gp(e))return{type:"poi"};if(In(e)&&e.type==="list")return f6(e,t);const n=Zu(e);if(n!==void 0){const r=w0(n);if(r!==null&&Wu(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 pC(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 mC(e){if(typeof e!="object"||e===null||e.type!=="object")return!1;const t=e.fields??{};return!Object.values(t).some(n=>wo(n.source))}function S2(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(pC(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 f6(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"}}:u6(n)}function Eb(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 jb(e){const t=$r(e);return t.type==="row"?typeof t.from=="string":t.type==="select"?Array.isArray(t.values):typeof t.type=="string"&&(_n(t.type)||t.type==="media")&&t.from!==void 0}function Ob(e){return $r(e).source===void 0&&wr(e)===void 0}function gC(e,t){if(e.type!=="object")return jb(e)&&Ob(e)?null:void 0;const n=Tl(e)??e.fields??{},r=Object.entries(n).filter(([,c])=>typeof c=="object"&&c!==null&&jb(c)&&Ob(c)),i=r.filter(([,c])=>$r(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 E2(e){return{...vu(e),source:{kind:"element"}}}function Ry(e,t){if(t===void 0)return null;const n=t===null?e:(Tl(e)??e.fields)[t],r=$r(n);return r.type==="row"?Xt(r.from):null}function h6(e,t){if(t===null)return E2(e);const n=e,r=(Tl(e)??n.fields)[t],i=c=>c===r||typeof c=="object"&&c!==null&&$r(c)===$r(r)?{kind:"element"}:c,a={};for(const[c,u]of Object.entries(n.fields))a[c]=c===t?E2(u):fl(u,i);return rC({...n,fields:a},n)}function p6(e,t,n){const r=a=>{if(!wo(a))return a;if(SD(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]=vu(fl(p,r)),c[f]!==p&&(u=!0);return u?rC({...a,fields:c},a):a}return vu(fl(e,r))}function yC(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 m6(e,t){if(e.item===void 0)return d6(e.source,t);const n=new Set((Ai(e.source,`list: "${t}"`)??[]).map(f=>f.verb));if(n.has("pick")){const f=g6(e.item,t);return n.has("write")&&S2(f,t),f}const r={},i=Object.freeze({kind:"element",[CA]:r,[v0]:hC(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"&&wr(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.`);yC(a,t);const c=p6(a,r,t);if(n.has("write")&&!mC(e.item)&&S2(c,t),c.type==="object"||c.type==="row")return c;const u={...c};return delete u.locked,u}function g6(e,t){if(typeof e=="function")throw new Error(Eb(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=gC(e,t);if(n===void 0)throw new Error(Eb(t,"its item declares no field with `from` and no source"));yC(e,t);const r=h6(e,n);if(r.type==="object"||r.type==="row")return r;const i={...r};return delete i.locked,i}function y6(e,t){const n=e.source;if(!(n===void 0||(Ai(n,"list")??[]).some(a=>a.verb==="pick"))||typeof e.item!="object"||e.item===null)return hC(n);const i=e.item;if(n===void 0){if(i.type!=="object")return Ry(i,jb(i)?null:void 0);const a=Object.entries(Tl(i)??{}).filter(([,c])=>$r(c).type==="row"&&Ob(c));return a.length===1?Ry(i,a[0][0]):null}return Ry(i,gC(i,t))}function fr(e){const t=e.label??"list",n=e.source,r=Ai(n,`list: "${t}"`),i=mC(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",...k0(e,p=>l6(p,t)),element:m6(e,t),...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}},u=ki(n)?dC(c.element):void 0,f=u===void 0?y6(e,t):u.length===1?u[0]:null;return WA(c,f)}function _p(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=u0(n);if(r!==null)throw new Error(`process.${e}(): ${r}.`);return n}function b6(e){return _p("cutout",e)}function v6(e){return _p("autocrop",e)}function Ao(e,t){return _p(e,t)}function w6(e){return Ao("probe",e)}function x6(e){return Ao("understand",e)}function k6(e){return Ao("preview",e)}function _6(e){return Ao("ladder",e)}function S6(e){return Ao("transcode",e)}function E6(e){return Ao("poster",e)}function j6(e){return Ao("rasterize",e)}function O6(e){return Ao("fetch",e)}function A6(e){return Ao("tour_details",e)}function C6(e){return _p("crop",e)}const N6={cutout:b6,autocrop:v6},jt={...N6,probe:w6,understand:x6,preview:k6,ladder:_6,transcode:S6,poster:E6,rasterize:j6,fetch:O6,tour_details:A6,crop:C6};function M6(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 R6(e,t){if(Yt(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(Bs(e))return{kind:"section",section:e.section,slot:e.slot};if(In(e))return{kind:"sibling",of:e};if(wo(e)||ki(e))return Object.freeze({...e});throw new Error(`row: "${t}" declares a source that is no element, slot, compute or pick.`)}function T6(e,t){if(Array.isArray(e))return $6(e,t);const n=Yt(e)?Xt(e.key):null;if(n!==null)return{key:e.key,tables:[n]};const r=Zu(e);if(r!==void 0){const i=`${String($r(r).from)}.${e.field}`;if(SL(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 ${Yt(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 $6(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=Yt(i)?Xt(i.key):null;if(a===null)throw new Error(`row: "${t}"'s \`from\` lists ${Yt(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 z6(e,t,n){const r=w0(In(e)||wo(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 D6(e){const{key:t,tables:n}=T6(e.from,e.label),r=n[0]??null;if(r===null&&!wo(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(In(e.source)&&e.source.type==="list")throw new Error(M6(`row: "${e.label}"`));const i=Ai(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&&z6(e.source,n,e.label);const a=k0(e,u=>R6(u,e.label)),c=WA({type:"row",from:t,...a},r);return CL(c,r,n.slice(1))}const bC=["property","library"];function _o(e){const t=e.indexOf("."),n=t===-1?"":e.slice(0,t);if(!bC.includes(n))throw new Error(`fact registry: "${e}" names no home's list fact`);return{home:n,key:e.slice(t+1)}}function O0(e){return e.type==="row"?e:null}function vC(e){if(e.type!=="object")return null;for(const[t,n]of Object.entries(e.fields)){const r=n.source;if(_n(n.type)&&typeof r=="object"&&r!==null&&r.kind==="element")return t}return null}function Sp(e){return(Array.isArray(e.from)?e.from:[e.from]).filter(n=>typeof n=="string")}function Ch(e){const t=wC(e);return t===null?null:t.label??null}function wC(e){const t=_o(e),n=t.home==="library"?_r.pages:dt.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 Ms(e){const t=[];let n=e;for(;n!==void 0&&!t.includes(n);){const r=wC(n);if(r===null)break;t.push(n),n=xC(r.element)}return t}function xC(e){const t=O0(e);if(t!==null)return Sp(t)[0];const n=e.type==="object"?vC(e):null,r=e.type==="object"&&n!==null?e.fields[n]:e;if(!_n(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 L6(e){const t=typeof e=="string"?[e]:[...e],n=t[0];return n===void 0?[]:[...Ms(n).slice(1).filter(i=>!t.includes(i)).reverse().map(i=>[i]),t]}function Ep(e){return e.head!==null}function Co(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 I6=new Set(["home","item"]);function Ab(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(MA(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=i0(t)?t.of:t;if(In(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(Yt(t)&&[...n.pages.values()].some(c=>t.key===`${n.home}.${c}`))return{kind:"home",key:t.key};if(Yt(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(Bs(t))throw new Error(`${e} reads a section's slot — a registry reads no section.`);if(wo(t)&&n.picked===!0)return{kind:"element"};if(wo(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(Zu(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(s0(t)&&typeof t.slot=="string")return{kind:"row",slot:t.slot,field:t.field};if(typeof t=="object"&&t!==null&&I6.has(String(t.kind)))return t;throw new Error(`${e} declares a read a registry cannot answer.`)}function U6(e,t,n){return Array.isArray(t)?t.length===1?Ty(e,t[0],n):t.map(r=>Ty(e,r,n)):Ty(e,t,n)}function Ty(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 Cb(e,t,n){const r=t.reads.map(i=>Ab(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=>Ab(e,i,n))}}function P6(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 F6(e,t,n){const r=wr(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 B6(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 H6(e){const t=new Map,n=e.fields;for(const r of[n,Tl(e)??{}])for(const[i,a]of Object.entries(r))typeof a=="object"&&a!==null&&t.set(a,i);return t}function Nb(e,t,n){var i;P6(e,t),F6(e,n.home,t);let r=vu(fl(t,a=>Ab(e,a,n)));switch(r.from!==void 0&&(_n(String(r.type))||r.type==="media")&&(r={...r,from:U6(e,t.from,n)}),r.type){case"object":{const a={},c={...n,fields:H6(r)};for(const[u,f]of Object.entries(r.fields))a[u]=Nb(`${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=wr(t))==null?void 0:i.some(p=>p.verb==="pick"))===!0,f=Nb(`${e}[]`,r.element,u?{...c,picked:!0}:c);B6(`${e}[]`,f),r={...r,element:f,...Ku(a)?{max:Cb(`${e}.max`,a,c)}:{}};break}}return r}function q6(e,t,n,r){const i=`${e}.${t}`,a=Nb(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:Cb(`${i}.title`,c,r),description:typeof u=="string"?u:Cb(`${i}.description`,u,r)},declaration:a}}const V6=["home","pages"];function Z6(e){return"head"in e&&"declaration"in e}function K6(e){const t=e.element;return e.type==="list"&&typeof(t==null?void 0:t.type)=="string"&&(_n(t.type)||t.type==="media")}function kC(e,t){if(!bC.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(V6.includes(f))throw new Error(`fact registry: ${e} declares a page keyed "${f}", a registry's own key`);n.set(p,f);const g=Z6(p)?p:{head:null,declaration:p};i[f]=g,K6(g.declaration)&&r.add(`${e}.${f}`)}const a={home:e,pages:n,mediaLists:r},c={};for(const[f,p]of Object.entries(i))c[f]=q6(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 Mi(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 G6=[{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."}],Y6=["sold","active"],Q6=["total","monthly"];function X6(e){return e==null?"active":"sold"}function W6(e){return e==="for_rent"?"monthly":"total"}const J6=6371e3;function e8(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*J6*Math.asin(Math.sqrt(u))}function t8(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(e8(t.latitude,t.longitude,e.latitude,e.longitude))}const n8=Co({title:"Your contacts",description:"The people your listings name, with the headshots and logos they carry."},fr({label:"Contacts",item:()=>{const e=kn.short({label:"Name",cap:256});return Ju({label:e,fields:{headshot:vi({label:"Headshot"}),name:e,title:kn.short({label:"Title",cap:128}),org_name:kn.short({label:"Organization",cap:256}),email:FL({label:"Email"}),phone:BL({label:"Phone"}),website:Fa({label:"Website"}),address:_0({label:"Address"}),bio:kn.long({label:"Bio",cap:4e3}),logo_dark:vi({label:"Logo for light backgrounds",process:[jt.cutout()]}),logo_light:vi({label:"Logo for dark backgrounds",process:[jt.cutout()]}),instagram:Fa({label:"Instagram"}),linkedin:Fa({label:"LinkedIn"}),x:Fa({label:"X"}),facebook:Fa({label:"Facebook"})}})}})),_r=kC("library",{contacts:n8});qA(_r);const Mb=Co({title:"What’s the address?",description:"We’ll build your map and neighborhood details from this."},_0({label:"Address"})),_C=Co({title:"For sale or for rent?",description:"This adjusts the pricing details we ask for."},Eh({label:"Listing intent",from:[...G6]})),Ri=Co({title:"Add photos, docs, and links",description:"Everything you add helps fill and enrich your website."},fr({label:"Uploads",item:S0()})),A0=fr({label:"Media",item:S0({kinds:["image","video","tour"],from:Ri}),source:Lr.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."})}),SC=fr({label:"Floor plans",item:vi({label:"Floor plan",from:Ri,process:[jt.cutout({enclosed:"keep"})]}),source:Lr.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."})}),r8=fr({label:"Documents",item:S0({kinds:["document","image","video"],from:Ri}),source:Lr.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."})}),o8=vi({label:"Hero",from:A0,source:Lr.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."})}),i8=Fa({label:"Website"}),EC={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 jC(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 (${EC[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 OC(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 (${EC[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 s8=jC("unit"),a8=OC("unit"),l8=[`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
|
+
`),Uf=kn.short({label:"Unit"}),c8=un({label:"Beds"}),u8=un({label:"Baths",decimals:!0}),AC=un({label:"Sq ft",thousandsSep:!0}),CC=kn.short({label:"Price",cap:40}),NC=kn.short({label:"Building floor(s)",cap:20}),MC=un({label:"Parking spaces"}),RC=fr({label:"Amenities",max:12,item:kn.short({cap:40})});function TC(e,t){return fr({label:"Floor plans",source:Lr.pick({reads:[e],brief:t}),item:Ju({fields:{image:vi({label:"Floor plan",from:SC}),floor:Eh({label:"Floor",from:[...LD],creatable:!0})}})})}function $C(e,t){return fr({label:"Photos",source:Lr.pick({reads:[e],brief:t}),item:vi({label:"Photo",from:A0})})}const d8=Co({title:"Tell us about the units",description:"Add each unit’s details and floor plans so they appear on your website."},fr({label:"Units",source:Lr.write({reads:[Ri],brief:l8}),item:Ju({label:Uf,fields:{label:Uf,beds:c8,baths:u8,sqft:AC,price:CC,floor:NC,hoa_monthly:un({label:"Monthly HOA fee"}),parking:MC,lot_sqft:un({label:"Lot sq ft",thousandsSep:!0}),amenities:RC,floor_plans:TC(Uf,s8),photos:$C(Uf,a8)}})})),f8=jC("space"),h8=OC("space"),p8=["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
|
+
`),Pf=kn.short({label:"Space"}),m8=Co({title:"Tell us about the commercial spaces",description:"Add each space’s details and floor plans so they appear on your website."},fr({label:"Commercial spaces",source:Lr.write({reads:[Ri],brief:p8}),item:Ju({label:Pf,fields:{label:Pf,use:kn.short({label:"Use",cap:40}),sqft:AC,price:CC,floor:NC,parking:MC,amenities:RC,floor_plans:TC(Pf,f8),photos:$C(Pf,h8)}})})),g8="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.",$y=_0({label:"Address"}),j2=tC({label:"Sale date"}),y8=Co({title:"Which properties compare?",description:"Recently sold or listed homes like this one shape the pricing story."},fr({label:"Comparables",max:50,source:Lr.write({reads:[Ri,Mb],brief:g8}),item:Ju({label:$y,fields:{address:$y,price:un({label:"Price"}),sale_date:j2,beds:un({label:"Beds"}),baths:un({label:"Baths",decimals:!0}),sqft:un({label:"Sq ft"}),photo:vi({label:"Photo"}),year_built:un({label:"Year built"}),lot_sqft:un({label:"Lot sq ft"}),stories:un({label:"Stories",decimals:!0}),units:un({label:"Units"}),hoa_monthly:un({label:"HOA per month"}),list_price:un({label:"List price"}),listed_date:tC({label:"Listed date"}),mls_number:kn.short({label:"MLS number"}),description:kn.long({label:"Description"}),status:Eh({label:"Status",from:[...Y6],locked:!0,source:Cy({reads:[j2]},e=>X6(e))}),distance_m:un({label:"Distance (m)",locked:!0,source:Cy({reads:[$y,Mb]},(e,t)=>t8(e,t))}),price_period:Eh({label:"Price period",from:[...Q6],locked:!0,source:Cy({reads:[_C]},e=>W6(e))})}})})),b8=Co({title:"Who’s on this listing?",description:"Add the contacts for this property, and drag them into the order your marketing shows them."},fr({label:"Contacts",min:1,max:12,source:Lr.pick({reads:[Ri],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:D6({label:"Contact",from:_r.contacts})})),dt=kC("property",{address:Mb,listing_intent:_C,description:Co({title:"Describe the property",description:"Talk it up like you would to a buyer, and our AI writes your website copy."},kn.long({label:"Description"})),uploads:Ri,property_media:A0,floor_plans:SC,property_documents:r8,hero:o8,site_url:i8,units:d8,commercial_spaces:m8,contacts:b8,comparables:y8});qA(dt);const v8=["text","number","select","url","email","phone","date"],w8=new Set(v8);function C0(e){return w8.has(e)}function zC(e){return e.type===void 0||!C0(e.type)?!1:e.type!=="text"||e.size===void 0||e.size==="short"}const Rb=new Set(["image","video","tour","document"]);function DC(e){return!(e!==null&&typeof e=="object"&&e.locked===!0)}function N0(e){const t=Object.values(e).filter(DC).map(i=>i!==null&&typeof i=="object"?i:{}),n=t.filter(i=>i.type!==void 0&&Rb.has(i.type)),r=t.filter(i=>!(i.type!==void 0&&Rb.has(i.type)));return n.length===1&&r.length<=2&&r.every(zC)}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 LC(e,t){var i,a;const n=x8(e);if(n!==null)return N0(n)?"annotated-media":"object";const r=(i=e.element)==null?void 0:i.type;return r!==void 0&&Rb.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 k8={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 IC(e,t,n){const r=LC(e,n),i=r==="object"||r==="annotated-media"?"item":"unit";return{itemKind:r,view:k8[r][t],granularity:i}}function _8(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 UC(e){return/^[A-Z][A-Z]/.test(e)?e:e.charAt(0).toLowerCase()+e.slice(1)}function Ir(e){const t=UC((e??"").trim());if(t==="")return{singular:"item",plural:"items"};const n=t.search(/\S+$/);return{singular:t.slice(0,n)+_8(t.slice(n)),plural:t}}function td(e){return e.charAt(0).toUpperCase()+e.slice(1)}const S8=["verb","unique","brief","none","reads"];new Set(S8);function O2(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function E8(e){return!O2(e)||!Array.isArray(e.fills)?[]:e.fills.filter(O2).map(t=>({...t,kind:"fill"}))}function M0(e){return e!==null&&typeof e=="object"?e:null}function qs(e){const t=M0(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 R0(e){return Object.entries(e??{}).filter(([,t])=>{var n;return t.type==="row"&&((n=M0(t.source))==null?void 0:n.kind)==="element"}).map(([t])=>t)}function PC(e){const t=new Set(R0(e)),n={};for(const[r,i]of Object.entries(e??{})){const a=qs(i.source);a!==null&&t.has(a.slot)&&(n[r]=a.field)}return n}function Nh(e){var t;if(((t=e.element)==null?void 0:t.type)==="object")return e.element.fields}function j8(e){return Nh(e)!==void 0}function O8(e){const t=M0(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=Xt(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 Rs(e){return ZA(dt).has(e)}function FC(e){const t=ZA(dt).get(e);if(t===void 0)throw new Error(`fact registry: "${e}" names no property fact`);return t}function T0(e){return FC(e).value_type}function A8(){return yL(dt)}function C8(e){return typeof e=="string"&&A8().includes(e)}function N8(e){if(!Rs(e))return;const t=FC(e).declaration;return t.type==="select"?t.values:void 0}function M8(e){return typeof e=="string"?e:null}function R8(e){const t=Qn(e);return t===void 0?null:{media:t}}function T8(e,t){const[,n="",r]=e.split("."),i=t[n];switch(T0(`property.${n}`)){case"address":{const a=tn(i);return r===void 0?a:a===null?null:a[r]}case"image":return R8(i);case"number":return typeof i=="number"?i:null;case"text":return M8(i)}}function jp(e){return YA(bi(e)==="library"?_r:dt,e)}function $0(e,t){return XA(jp(e),t)}function A2(e){return Object.keys(jp(e))}function z0(e,t){if(t==="id")return{kind:"identity"};const n=t.indexOf("."),r=n===-1?t:t.slice(0,n),i=Wu(e,r)??null;if(i===null)return{kind:"unknown",offers:A2(e)};if(n!==-1){const a=t.slice(n+1);return i!=="address"?{kind:"unknown",offers:A2(e)}:bp(a)?{kind:"member",value_type:KA(a),storable:Mh(e,t)}:{kind:"unknown",offers:yp.map(c=>`${r}.${c}`)}}return{kind:"member",value_type:i,storable:Mh(e,t)}}function Mh(e,t){if(t===void 0){if(Xt(e)!==null)return!0;if(!Rs(e))return!1;const r=e.slice(0,e.lastIndexOf("."));return!(Rs(r)&&T0(r)==="address")}if(!y0().includes(e))return!1;const n=$0(e,t);return n!==void 0&&!bL(n)}function $8(e,t){const n=t.source;return(n==null?void 0:n.kind)!=="row"||typeof n.field!="string"||z0(e,n.field).kind==="unknown"?null:n.field}function D0(e,t){if(t==null)return null;const n=$8(t,e);if(n===null)return null;const r=$0(t,n),i=r===void 0?null:Qu(r);if(r===void 0||i==null)return null;const a=_b(r);return{table:t,member:n,value_type:i,...a!==void 0?{filter:a}:{}}}const Op={kind:"owned"};function C2(e){return e===null?Op:{kind:"picked",filter:e}}function hl(e,t){if(e.from!==void 0)return C2(gu(e));const n=D0(e,t);return n===null?null:n.filter===void 0?Op:C2(gu({type:e.type,from:n.filter.from}))}function Ap(e,t){return hl(e,t)??Op}function z8(e,t,n){return hl(t,n)??hl({...t,source:e.source},n)}function D8(e,t,n){var i;const r=hl(t,n.itemTable);return r!==null?r:n.picksBy!==null&&((i=t.source)==null?void 0:i.kind)==="element"?{kind:"picked",filter:n.picksBy}:hl({...t,source:e.source},n.listTable)??Op}const N2=1e-6;function L8(e,t){return e.w/e.h>t?{w:e.h*t,h:e.h}:{w:e.w,h:e.w/t}}function I8(e,t){const n=Math.max(e.w,e.h*t);return{w:n,h:n/t}}function U8(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 M2(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 P8(e,t,n,r){const i=I8(e,r);return i.w<=n.width+N2&&i.h<=n.height+N2?M2(U8(i,n),{x:e.x+e.w/2,y:e.y+e.h/2},n):M2(L8({w:n.width,h:n.height},r),t,n)}const R2=16/10;function Ba(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 BC(e){var a;if(e===null||typeof e!="object")return{mode:"free",aspect:R2};const t=e,n=typeof t.aspect=="number"&&t.aspect>0?t.aspect:R2,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 Ts(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 F8(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=P8(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 Ts(u,{x:0,y:0,width:1,height:1})?null:u}function T2(e,t,n){return e===null||n===null?e:t===null?null:F8(e,t,n)}function HC(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 Ts(i,{x:0,y:0,width:1,height:1})?null:i}function B8(e,t,n){var c,u;const r=Rl(e).get(n);if(r===void 0)return;const i=Oo(t)??[Sh],a=[...i,...Ms(i[0]).slice(1).filter(f=>!i.includes(f))];for(const f of a){const p=(u=(c=HA(e,f))==null?void 0:c.find(({id:g})=>g===n))==null?void 0:u.value;if(p!==void 0)return jo(p)?wp(r,p):r}return r}function H8(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=T2(e.crop,r,n.mode==="free"?null:n.aspect),a=i===null||n.mobileAspect===void 0?null:T2(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 L0(e){var i;const{mode:t,aspect:n,mobileAspect:r}=BC(e.crop);return{mode:t,aspect:n,aspectLabel:(i=e.crop)==null?void 0:i.aspectLabel,mobileAspect:r}}function pl(e){return e==null?null:{nx:e.x,ny:e.y,nw:e.width,nh:e.height}}function Tb(e){return q8(e)?null:{x:e.nx,y:e.ny,width:e.nw,height:e.nh}}function Rh(e,t,n){if(e==="free")return{nx:0,ny:0,nw:1,nh:1};const r=HC(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 $2(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 q8(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 V8(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}:Rh(t,n,r)}const ri=52,Z8=1,K8=6,G8=.94,cn=(e,t,n)=>n<t?t:Math.max(t,Math.min(n,e));function Ff(e,t,n,r,i,a,c){e=Math.max(ri,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(ri,e),h:Math.max(ri,e/t)}}function Y8({src:e,mode:t,aspect:n,seed:r}){const i=x.useRef(null),[,a]=x.useReducer(U=>U+1,0),c=x.useRef(null),u=x.useRef({w:0,h:0}),f=x.useRef({z:1,icx:0,icy:0}),p=x.useRef({x:0,y:0,w:0,h:0}),g=x.useRef(!1),m=x.useRef(r??null),[w,v]=x.useState(null),_=()=>{const U=c.current,z=u.current;if(!U||!z.w)return{w:0,h:0};const K=Math.min(z.w/U.w,z.h/U.h)*G8;return{w:U.w*K,h:U.h*K}},k=()=>{const U=_(),z=f.current,K=U.w*z.z,N=U.h*z.z;return{l:z.icx-K/2,t:z.icy-N/2,r:z.icx+K/2,b:z.icy+N/2,w:K,h:N}},S=()=>{const U=k(),z=u.current;return{l:Math.max(U.l,0),t:Math.max(U.t,0),r:Math.min(U.r,z.w),b:Math.min(U.b,z.h)}},E=()=>{const U=k(),z=p.current,K=f.current,N=U.w/2,B=U.h/2;U.w>=z.w&&(K.icx=cn(K.icx,z.x+z.w-N,z.x+N)),U.h>=z.h&&(K.icy=cn(K.icy,z.y+z.h-B,z.y+B))},O=()=>{const U=p.current,z=S(),K=z.r-z.l,N=z.b-z.t;if(t==="locked"){let B=Math.min(U.w,K),Y=B/n;Y>N&&(Y=N,B=Y*n),U.w=B,U.h=Y}else U.w=Math.min(U.w,K),U.h=Math.min(U.h,N);U.x=cn(U.x,z.l,z.r-U.w),U.y=cn(U.y,z.t,z.b-U.h)},A=()=>{O(),E(),O()},R=U=>{const z=u.current;if(!z.w||!c.current)return;f.current={z:1,icx:z.w/2,icy:z.h/2};const K=k(),N=c.current.w/c.current.h,B=U?V8(m.current,t,N,n):Rh(t,N,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(),g.current=!0,a()};x.useEffect(()=>{g.current=!1,c.current=null,a();const U=new Image;U.onload=()=>{c.current={w:U.naturalWidth||1,h:U.naturalHeight||1},R(!0)},U.src=e},[e]),x.useEffect(()=>{m.current=r??null},[r]),x.useEffect(()=>{c.current&&R(!1)},[t,n]),x.useLayoutEffect(()=>{const U=i.current;if(!U)return;const z=()=>{const N=U.getBoundingClientRect(),B=u.current.w;u.current={w:N.width,h:N.height},!B&&c.current?R(!0):B&&(A(),a())};z();const K=new ResizeObserver(z);return K.observe(U),()=>K.disconnect()},[]);const C=U=>{const z=i.current.getBoundingClientRect();return{x:U.clientX-z.left,y:U.clientY-z.top}},I=U=>{var Y,ie;if(U.button)return;U.stopPropagation(),(ie=(Y=U.currentTarget).setPointerCapture)==null||ie.call(Y,U.pointerId),v("move");const z=C(U),K={...p.current},N=J=>{const L=C(J),Q=S(),D=p.current;D.x=cn(K.x+(L.x-z.x),Q.l,Q.r-D.w),D.y=cn(K.y+(L.y-z.y),Q.t,Q.b-D.h),a()},B=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),v(null)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B)},$=U=>z=>{var J,L;if(z.button)return;z.stopPropagation(),(L=(J=z.currentTarget).setPointerCapture)==null||L.call(J,z.pointerId),v(U);const K=p.current,N={l:K.x,t:K.y,r:K.x+K.w,b:K.y+K.h},B=C(z),Y=Q=>{const D=C(Q),Z=S(),te=D.x-B.x,de=D.y-B.y;let fe=N.l,pe=N.t,P=N.r,ce=N.b;if(t==="free")U.includes("w")&&(fe=cn(N.l+te,Z.l,P-ri)),U.includes("e")&&(P=cn(N.r+te,fe+ri,Z.r)),U.includes("n")&&(pe=cn(N.t+de,Z.t,ce-ri)),U.includes("s")&&(ce=cn(N.b+de,pe+ri,Z.b));else{const me=n;if(U==="se"){const Se=Ff(N.r+te-N.l,me,N.l,N.t,1,1,Z);fe=N.l,pe=N.t,P=fe+Se.w,ce=pe+Se.h}else if(U==="nw"){const Se=Ff(N.r-(N.l+te),me,N.r,N.b,-1,-1,Z);P=N.r,ce=N.b,fe=P-Se.w,pe=ce-Se.h}else if(U==="ne"){const Se=Ff(N.r+te-N.l,me,N.l,N.b,1,-1,Z);fe=N.l,ce=N.b,P=fe+Se.w,pe=ce-Se.h}else if(U==="sw"){const Se=Ff(N.r-(N.l+te),me,N.r,N.t,-1,1,Z);P=N.r,pe=N.t,fe=P-Se.w,ce=pe+Se.h}else{const Se=(N.l+N.r)/2,$e=(N.t+N.b)/2;let Ie=K.w,xe=K.h;U==="e"?Ie=(N.r+te-Se)*2:U==="w"?Ie=(Se-(N.l+te))*2:U==="s"?(xe=(N.b+de-$e)*2,Ie=xe*me):U==="n"&&(xe=($e-(N.t+de))*2,Ie=xe*me),Ie=Math.max(ri,Ie),xe=Ie/me,Ie=Math.min(Ie,Z.r-Z.l),xe=Ie/me,xe>Z.b-Z.t&&(xe=Z.b-Z.t,Ie=xe*me),fe=cn(Se-Ie/2,Z.l,Z.r-Ie),pe=cn($e-xe/2,Z.t,Z.b-xe),P=fe+Ie,ce=pe+xe}}p.current={x:fe,y:pe,w:P-fe,h:ce-pe},a()},ie=()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",ie),window.removeEventListener("pointercancel",ie),v(null)};window.addEventListener("pointermove",Y),window.addEventListener("pointerup",ie),window.addEventListener("pointercancel",ie)},T=(U,z,K)=>{const N=f.current;U=cn(U,Z8,K8);const B=U/N.z;N.icx=z+(N.icx-z)*B,N.icy=K+(N.icy-K)*B,N.z=U,A(),a()},F=U=>{const z=u.current;T(f.current.z*U,z.w/2,z.h/2)},W=x.useRef(()=>{});W.current=U=>{U.preventDefault();const z=u.current,K=Math.exp(-U.deltaY*.0015*(U.ctrlKey?2.6:1));T(f.current.z*K,z.w/2,z.h/2)},x.useEffect(()=>{const U=i.current;if(!U)return;const z=K=>W.current(K);return U.addEventListener("wheel",z,{passive:!1}),()=>U.removeEventListener("wheel",z)},[]);const G=()=>R(!1),H=()=>{const U=k(),z=p.current;return U.w?{nx:cn((z.x-U.l)/U.w,0,1),ny:cn((z.y-U.t)/U.h,0,1),nw:cn(z.w/U.w,0,1),nh:cn(z.h/U.h,0,1)}:{nx:0,ny:0,nw:1,nh:1}};return{stageRef:i,ready:g.current,activeHandle:w,imgRect:k,box:p.current,view:f.current,onBoxDown:I,onHandleDown:$,zoomBy:F,reset:G,cropValue:H,natAspect:c.current?c.current.w/c.current.h:null}}function Q8({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 X8=["n","s","e","w"],W8=["nw","ne","sw","se"];function J8({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",{})]}),X8.map(u=>h.jsx("div",{"data-crop-handle":u,className:`we-cs-h edge ${u}`,onPointerDown:e.onHandleDown(u)},u)),W8.map(u=>h.jsx("div",{"data-crop-handle":u,className:`we-cs-h corner ${u}`,onPointerDown:e.onHandleDown(u)},u))]})]})})}const eI=x.forwardRef(function({chrome:t,src:n,mode:r,aspect:i,seed:a,stageClassName:c="h-[412px]",footerActions:u,onUserEdit:f},p){const g=Y8({src:n,mode:r,aspect:i,seed:a});x.useImperativeHandle(p,()=>({cropValue:()=>g.cropValue(),natAspect:()=>g.natAspect}),[g]);const m=Math.round(g.view.z*100)+"%",w=x.useRef(!1),v=x.useRef(!1),_=()=>{v.current=!0},k=()=>{v.current&&!w.current&&(w.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(J8,{cr:g,mode:r,src:n,stageClassName:c})}),h.jsx(Q8,{chrome:t,pct:m,onZoomOut:()=>g.zoomBy(1/1.25),onZoomIn:()=>g.zoomBy(1.25),resetSlot:h.jsx("button",{type:"button",className:t.buttonLink,onClick:g.reset,children:"Reset"}),children:u})]})});function qC(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=qC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Cp(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qC(e))&&(r&&(r+=" "),r+=t);return r}const tI=(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},nI=(e,t)=>({classGroupId:e,validator:t}),VC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Th="-",z2=[],rI="arbitrary..",oI=e=>{const t=sI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return iI(c);const u=c.split(Th),f=u[0]===""&&u.length>1?1:0;return ZC(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],p=n[c];return f?p?tI(p,f):f:p||z2}return n[c]||z2}}},ZC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=ZC(e,t+1,a);if(p)return p}const c=n.validators;if(c===null)return;const u=t===0?e.join(Th):e.slice(t).join(Th),f=c.length;for(let p=0;p<f;p++){const g=c[p];if(g.validator(u))return g.classGroupId}},iI=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?rI+r:void 0})(),sI=e=>{const{theme:t,classGroups:n}=e;return aI(n,t)},aI=(e,t)=>{const n=VC();for(const r in e){const i=e[r];I0(i,n,r,t)}return n},I0=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const c=e[a];lI(c,t,n,r)}},lI=(e,t,n,r)=>{if(typeof e=="string"){cI(e,t,n);return}if(typeof e=="function"){uI(e,t,n,r);return}dI(e,t,n,r)},cI=(e,t,n)=>{const r=e===""?t:KC(t,e);r.classGroupId=n},uI=(e,t,n,r)=>{if(fI(e)){I0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nI(n,e))},dI=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let c=0;c<a;c++){const[u,f]=i[c];I0(f,KC(t,u),n,r)}},KC=(e,t)=>{let n=e;const r=t.split(Th),i=r.length;for(let a=0;a<i;a++){const c=r[a];let u=n.nextPart.get(c);u||(u=VC(),n.nextPart.set(c,u)),n=u}return n},fI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hI=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)}}},$b="!",D2=":",pI=[],L2=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),mI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let c=0,u=0,f=0,p;const g=i.length;for(let k=0;k<g;k++){const S=i[k];if(c===0&&u===0){if(S===D2){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 w=m,v=!1;m.endsWith($b)?(w=m.slice(0,-1),v=!0):m.startsWith($b)&&(w=m.slice(1),v=!0);const _=p&&p>f?p-f:void 0;return L2(a,v,w,_)};if(t){const i=t+D2,a=r;r=c=>c.startsWith(i)?a(c.slice(i.length)):L2(pI,!1,c,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},gI=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}},yI=e=>({cache:hI(e.cacheSize),parseClassName:mI(e),sortModifiers:gI(e),postfixLookupClassGroupIds:bI(e),...oI(e)}),bI=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},vI=/\s+/,wI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:c}=t,u=[],f=e.trim().split(vI);let p="";for(let g=f.length-1;g>=0;g-=1){const m=f[g],{isExternal:w,modifiers:v,hasImportantModifier:_,baseClassName:k,maybePostfixModifierPosition:S}=n(m);if(w){p=m+(p.length>0?" "+p:p);continue}let E=!!S,O;if(E){const $=k.substring(0,S);O=r($);const T=O&&c[O]?r(k):void 0;T&&T!==O&&(O=T,E=!1)}else O=r(k);if(!O){if(!E){p=m+(p.length>0?" "+p:p);continue}if(O=r(k),!O){p=m+(p.length>0?" "+p:p);continue}E=!1}const A=v.length===0?"":v.length===1?v[0]:a(v).join(":"),R=_?A+$b:A,C=R+O;if(u.indexOf(C)>-1)continue;u.push(C);const I=i(O,E);for(let $=0;$<I.length;++$){const T=I[$];u.push(R+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=GC(n))&&(i&&(i+=" "),i+=r);return i},GC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=GC(e[r]))&&(n&&(n+=" "),n+=t);return n},kI=(e,...t)=>{let n,r,i,a;const c=f=>{const p=t.reduce((g,m)=>m(g),e());return n=yI(p),r=n.cache.get,i=n.cache.set,a=u,u(f)},u=f=>{const p=r(f);if(p)return p;const g=wI(f,n);return i(f,g),g};return a=c,(...f)=>a(xI(...f))},_I=[],Gt=e=>{const t=n=>n[e]||_I;return t.isThemeGetter=!0,t},YC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,EI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jI=/\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$/,OI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ti=e=>SI.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Nr=e=>!!e&&Number.isInteger(Number(e)),zy=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),so=e=>EI.test(e),XC=()=>!0,NI=e=>jI.test(e)&&!OI.test(e),U0=()=>!1,MI=e=>AI.test(e),RI=e=>CI.test(e),TI=e=>!Oe(e)&&!Ae(e),$I=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)),zI=e=>Ti(e,eN,U0),Oe=e=>YC.test(e),os=e=>Ti(e,tN,NI),I2=e=>Ti(e,HI,Qe),DI=e=>Ti(e,rN,XC),LI=e=>Ti(e,nN,U0),U2=e=>Ti(e,WC,U0),II=e=>Ti(e,JC,RI),Bf=e=>Ti(e,oN,MI),Ae=e=>QC.test(e),Hc=e=>Vs(e,tN),UI=e=>Vs(e,nN),P2=e=>Vs(e,WC),PI=e=>Vs(e,eN),FI=e=>Vs(e,JC),Hf=e=>Vs(e,oN,!0),BI=e=>Vs(e,rN,!0),Ti=(e,t,n)=>{const r=YC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Vs=(e,t,n=!1)=>{const r=QC.exec(e);return r?r[1]?t(r[1]):n:!1},WC=e=>e==="position"||e==="percentage",JC=e=>e==="image"||e==="url",eN=e=>e==="length"||e==="size"||e==="bg-size",tN=e=>e==="length",HI=e=>e==="number",nN=e=>e==="family-name",rN=e=>e==="number"||e==="weight",oN=e=>e==="shadow",qI=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),r=Gt("font-weight"),i=Gt("tracking"),a=Gt("leading"),c=Gt("breakpoint"),u=Gt("container"),f=Gt("spacing"),p=Gt("radius"),g=Gt("shadow"),m=Gt("inset-shadow"),w=Gt("text-shadow"),v=Gt("drop-shadow"),_=Gt("blur"),k=Gt("perspective"),S=Gt("aspect"),E=Gt("ease"),O=Gt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...R(),Ae,Oe],I=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],T=()=>[Ae,Oe,f],F=()=>[ti,"full","auto",...T()],W=()=>[Nr,"none","subgrid",Ae,Oe],G=()=>["auto",{span:["full",Nr,Ae,Oe]},Nr,Ae,Oe],H=()=>[Nr,"auto",Ae,Oe],U=()=>["auto","min","max","fr",Ae,Oe],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...T()],B=()=>[ti,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],Y=()=>[ti,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ie=()=>[ti,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],J=()=>[e,Ae,Oe],L=()=>[...R(),P2,U2,{position:[Ae,Oe]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",PI,zI,{size:[Ae,Oe]}],Z=()=>[zy,Hc,os],te=()=>["","none","full",p,Ae,Oe],de=()=>["",Qe,Hc,os],fe=()=>["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"],P=()=>[Qe,zy,P2,U2],ce=()=>["","none",_,Ae,Oe],me=()=>["none",Qe,Ae,Oe],Se=()=>["none",Qe,Ae,Oe],$e=()=>[Qe,Ae,Oe],Ie=()=>[ti,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[so],breakpoint:[so],color:[XC],container:[so],"drop-shadow":[so],ease:["in","out","in-out"],font:[TI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[so],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[so],shadow:[so],spacing:["px",Qe],text:[so],"text-shadow":[so],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ti,Oe,Ae,S]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,Oe]}],"container-named":[$I],columns:[{columns:[Qe,Oe,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:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],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:[Nr,"auto",Ae,Oe]}],basis:[{basis:[ti,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,ti,"auto","initial","none",Oe]}],grow:[{grow:["",Qe,Ae,Oe]}],shrink:[{shrink:["",Qe,Ae,Oe]}],order:[{order:[Nr,"first","last","none",Ae,Oe]}],"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:[...z(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"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:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"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",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...ie()]}],"min-block-size":[{"min-block":["auto",...ie()]}],"max-block-size":[{"max-block":["none",...ie()]}],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,Hc,os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,BI,DI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zy,Oe]}],"font-family":[{font:[UI,LI,t]}],"font-features":[{"font-features":[Oe]}],"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,Oe]}],"line-clamp":[{"line-clamp":[Qe,"none",Ae,I2]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",Ae,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Oe]}],"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:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ae,os]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ae,Oe]}],"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:[Nr,Ae,Oe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Oe]}],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,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nr,Ae,Oe],radial:["",Ae,Oe],conic:[Nr,Ae,Oe]},FI,II]}],"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:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"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:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ae,Oe]}],"outline-w":[{outline:["",Qe,Hc,os]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",g,Hf,Bf]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",m,Hf,Bf]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Qe,os]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",w,Hf,Bf]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Qe,Ae,Oe]}],"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":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"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":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"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":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"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":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"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":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"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":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"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":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[Ae,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"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:L()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Oe]}],filter:[{filter:["","none",Ae,Oe]}],blur:[{blur:ce()}],brightness:[{brightness:[Qe,Ae,Oe]}],contrast:[{contrast:[Qe,Ae,Oe]}],"drop-shadow":[{"drop-shadow":["","none",v,Hf,Bf]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Qe,Ae,Oe]}],"hue-rotate":[{"hue-rotate":[Qe,Ae,Oe]}],invert:[{invert:["",Qe,Ae,Oe]}],saturate:[{saturate:[Qe,Ae,Oe]}],sepia:[{sepia:["",Qe,Ae,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Oe]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ae,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ae,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ae,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ae,Oe]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ae,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ae,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ae,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ae,Oe]}],"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,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ae,Oe]}],ease:[{ease:["linear","initial",E,Ae,Oe]}],delay:[{delay:[Qe,Ae,Oe]}],animate:[{animate:["none",O,Ae,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ae,Oe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[Ae,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],zoom:[{zoom:[Nr,Ae,Oe]}],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,Oe]}],"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,Oe]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Qe,Hc,os,I2]}],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"]}},Np=kI(qI);function F2(...e){return Np(Cp(e))}function VI({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:F2("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:F2("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 ZI=(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 P0({chrome:e,open:t=!0,src:n,mode:r,aspect:i,mobileAspect:a,seed:c,mobileSeed:u,onApply:f,onClose:p,title:g="Crop photo",subtitle:m,variant:w="crop",stageClassName:v="h-[412px]"}){const[_]=x.useState(n),k=a!=null&&Math.abs(a-i)>1e-4,[S,E]=x.useState("desktop"),[O,A]=x.useState({desktop:(c==null?void 0:c.rect)??null,mobile:(u==null?void 0:u.rect)??null}),R=x.useRef(!(u!=null&&u.rect)),C=x.useRef(null),I=z=>z==="mobile"?a??i:i,$=()=>{var z;return((z=C.current)==null?void 0:z.natAspect())??i},T=z=>!(c!=null&&c.rect)&&(z===null||ZI(z,Rh(r,$(),i))),F=z=>({rect:z==="desktop"?O.desktop:O.mobile}),W=()=>{var z;return((z=C.current)==null?void 0:z.cropValue())??null},G=z=>{if(z===S)return;const K=W();A(N=>{const B={...N,[S]:K??N[S]};if(S==="desktop"&&R.current){const Y=B.desktop??K;B.mobile=Y&&!T(Y)?$2(Y,a??i,$()):null}return B}),E(z)},H=()=>{S==="mobile"&&(R.current=!1)},U=()=>{const z=W(),K=$(),N=(S==="desktop"?z:O.desktop)??z??{nx:0,ny:0,nw:1,nh:1};let B={rect:N,ar:K};if(k){let Y=S==="mobile"?z:O.mobile;Y||(Y=T(N)?Rh(r,K,a??i):$2(N,a??i,K)),B={...B,mobile:{rect:Y,derived:R.current}}}f(B)};return h.jsxs(e.Shell,{open:t,variant:w,onClose:p,children:[h.jsxs("div",{className:e.head,children:[h.jsxs("div",{className:e.titles,children:[h.jsx("h2",{className:e.title,children:g}),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(VI,{view:S,onChange:G,className:"absolute right-3 top-3 z-10"}),h.jsx(eI,{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 B2=e=>{let t;const n=new Set,r=(p,g)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const w=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,w))}},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},KI=(e=>e?B2(e):B2),GI=e=>e;function iN(e,t=GI){const n=pi.useSyncExternalStore(e.subscribe,pi.useCallback(()=>t(e.getState()),[e,t]),pi.useCallback(()=>t(e.getInitialState()),[e,t]));return pi.useDebugValue(n),n}const H2=e=>{const t=KI(e),n=r=>iN(t,r);return Object.assign(n,t),n},F0=(e=>e?H2(e):H2),su=F0(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 YI(e,t,n){return`${e}#${t}#${n}`}function QI(e){return su(t=>t.noticeByKey[e])}const XI=12e4;function po(e){return`${e.holder}#${e.mediaId}`}const eu=F0((e,t)=>({byPlace:{},start:(n,r,i)=>{const a=po(n),c={propertyId:r,place:n,crop:i};e(u=>({byPlace:{...u.byPlace,[a]:c}})),setTimeout(()=>{t().byPlace[a]===c&&t().settle(n)},XI)},settle:n=>e(r=>{const i=po(n);if(!(i in r.byPlace))return r;const a={...r.byPlace};return delete a[i],{byPlace:a}})})),ch={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}},sN={opacity:ch.dimOpacity,filter:`grayscale(${ch.grayscale})`,transition:`opacity ${ch.transitionMs}ms`};function WI(){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 B0({label:e="Re-cropping…"}={}){WI();const t=ch.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 $l=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(){}},hs,ii,Qa,gA,JI=(gA=class extends $l{constructor(){super();Me(this,hs);Me(this,ii);Me(this,Qa);_e(this,Qa,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,ii)||this.setEventListener(q(this,Qa))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ii))==null||t.call(this),_e(this,ii,void 0))}setEventListener(t){var n;_e(this,Qa,t),(n=q(this,ii))==null||n.call(this),_e(this,ii,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){q(this,hs)!==t&&(_e(this,hs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof q(this,hs)=="boolean"?q(this,hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hs=new WeakMap,ii=new WeakMap,Qa=new WeakMap,gA),H0=new JI,eU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},si,r0,yA,tU=(yA=class{constructor(){Me(this,si,eU);Me(this,r0,!1)}setTimeoutProvider(e){_e(this,si,e)}setTimeout(e,t){return q(this,si).setTimeout(e,t)}clearTimeout(e){q(this,si).clearTimeout(e)}setInterval(e,t){return q(this,si).setInterval(e,t)}clearInterval(e){q(this,si).clearInterval(e)}},si=new WeakMap,r0=new WeakMap,yA),cs=new tU;function nU(e){setTimeout(e,0)}var rU=typeof window>"u"||"Deno"in globalThis;function xn(){}function oU(e,t){return typeof e=="function"?e(t):e}function zb(e){return typeof e=="number"&&e>=0&&e!==1/0}function aN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wi(e,t){return typeof e=="function"?e(t):e}function Yn(e,t){return typeof e=="function"?e(t):e}function q2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:c,stale:u}=e;if(c){if(r){if(t.queryHash!==q0(c,t.options))return!1}else if(!gl(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 V2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ml(t.options.mutationKey)!==ml(a))return!1}else if(!gl(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function q0(e,t){return((t==null?void 0:t.queryKeyHashFn)||ml)(e)}function ml(e){return JSON.stringify(e,(t,n)=>Db(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function gl(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(!gl(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!gl(e[r],t[r]))return!1;return!0}return!1}var iU=Object.prototype.hasOwnProperty;function V0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Z2(e)&&Z2(t);if(!r&&!(Db(e)&&Db(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 g=0;g<u;g++){const m=r?g:c[g],w=e[m],v=t[m];if(w===v){f[m]=w,(r?g<a:iU.call(e,m))&&p++;continue}if(w===null||v===null||typeof w!="object"||typeof v!="object"){f[m]=v;continue}const _=V0(w,v,n+1);f[m]=_,_===w&&p++}return a===u&&p===a?e:f}function $h(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 Z2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Db(e){if(!K2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!K2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function K2(e){return Object.prototype.toString.call(e)==="[object Object]"}function sU(e){return new Promise(t=>{cs.setTimeout(t,e)})}function Lb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?V0(e,t):t}function aU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Z0=Symbol();function lN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Z0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cN(e,t){return typeof e=="function"?e(...t):!!e}function cU(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=()=>rU;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ib(){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 uU=nU;function dU(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=uU;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 Zt=dU(),Xa,ai,Wa,bA,fU=(bA=class extends $l{constructor(){super();Me(this,Xa,!0);Me(this,ai);Me(this,Wa);_e(this,Wa,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,ai)||this.setEventListener(q(this,Wa))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ai))==null||t.call(this),_e(this,ai,void 0))}setEventListener(t){var n;_e(this,Wa,t),(n=q(this,ai))==null||n.call(this),_e(this,ai,t(this.setOnline.bind(this)))}setOnline(t){q(this,Xa)!==t&&(_e(this,Xa,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return q(this,Xa)}},Xa=new WeakMap,ai=new WeakMap,Wa=new WeakMap,bA),zh=new fU;function hU(e){return Math.min(1e3*2**e,3e4)}function uN(e){return(e??"online")==="online"?zh.isOnline():!0}var Ub=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dN(e){let t=!1,n=0,r;const i=Ib(),a=()=>i.status!=="pending",c=k=>{var S;if(!a()){const E=new Ub(k);w(E),(S=e.onCancel)==null||S.call(e,E)}},u=()=>{t=!0},f=()=>{t=!1},p=()=>H0.isFocused()&&(e.networkMode==="always"||zh.isOnline())&&e.canRun(),g=()=>uN(e.networkMode)&&e.canRun(),m=k=>{a()||(r==null||r(),i.resolve(k))},w=k=>{a()||(r==null||r(),i.reject(k))},v=()=>new Promise(k=>{var S;r=E=>{(a()||p())&&k(E)},(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(E){k=Promise.reject(E)}Promise.resolve(k).then(m).catch(E=>{var I;if(a())return;const O=e.retry??(xu.isServer()?0:3),A=e.retryDelay??hU,R=typeof A=="function"?A(n,E):A,C=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,E);if(t||!C){w(E);return}n++,(I=e.onFail)==null||I.call(e,n,E),sU(R).then(()=>p()?void 0:v()).then(()=>{t?w(E):_()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?_():v().then(_),i)}}var ps,vA,fN=(vA=class{constructor(){Me(this,ps)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zb(this.gcTime)&&_e(this,ps,cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xu.isServer()?1/0:300*1e3))}clearGcTimeout(){q(this,ps)!==void 0&&(cs.clearTimeout(q(this,ps)),_e(this,ps,void 0))}},ps=new WeakMap,vA);function pU(e){return{onFetch:(t,n)=>{var g,m,w,v,_;const r=t.options,i=(w=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:w.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=>{cU(A,()=>t.signal,()=>k=!0)},E=lN(t.options,t.fetchOptions),O=async(A,R,C)=>{if(k)return Promise.reject(t.signal.reason);if(R==null&&A.pages.length)return Promise.resolve(A);const $=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};return S(G),G})(),T=await E($),{maxPages:F}=t.options,W=C?lU:aU;return{pages:W(A.pages,T,F),pageParams:W(A.pageParams,R,F)}};if(i&&a.length){const A=i==="backward",R=A?mU:G2,C={pages:a,pageParams:c},I=R(r,C);u=await O(C,I,A)}else{const A=e??a.length;do{const R=f===0?c[0]??r.initialPageParam:G2(r,u);if(f>0&&R==null)break;u=await O(u,R),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 G2(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 mU(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 Ja,ms,el,ur,gs,en,Lu,ys,Gn,hN,lo,wA,gU=(wA=class extends fN{constructor(t){super();Me(this,Gn);Me(this,Ja);Me(this,ms);Me(this,el);Me(this,ur);Me(this,gs);Me(this,en);Me(this,Lu);Me(this,ys);_e(this,ys,!1),_e(this,Lu,t.defaultOptions),this.setOptions(t.options),this.observers=[],_e(this,gs,t.client),_e(this,ur,q(this,gs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,ms,Q2(this.options)),this.state=t.state??q(this,ms),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,Ja)}get promise(){var t;return(t=q(this,en))==null?void 0:t.promise}setOptions(t){if(this.options={...q(this,Lu),...t},t!=null&&t._type&&_e(this,Ja,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Q2(this.options);n.data!==void 0&&(this.setState(Y2(n.data,n.dataUpdatedAt)),_e(this,ms,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,ur).remove(this)}setData(t,n){const r=Lb(this.state.data,t,this.options);return Fe(this,Gn,lo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Fe(this,Gn,lo).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=q(this,en))==null?void 0:r.promise;return(i=q(this,en))==null||i.cancel(t),n?n.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,ms)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Yn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Z0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wi(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:!aN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,en))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,en))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),q(this,ur).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,en)&&(q(this,ys)||Fe(this,Gn,hN).call(this)?q(this,en).cancel({revert:!0}):q(this,en).cancelRetry()),this.scheduleGc()),q(this,ur).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fe(this,Gn,lo).call(this,{type:"invalidate"})}async fetch(t,n){var p,g,m,w,v,_,k,S,E,O,A;if(this.state.fetchStatus!=="idle"&&((p=q(this,en))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,en))return q(this,en).continueRetry(),q(this,en).promise}if(t&&this.setOptions(t),!this.options.queryFn){const R=this.observers.find(C=>C.options.queryFn);R&&this.setOptions(R.options)}const r=new AbortController,i=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(_e(this,ys,!0),r.signal)})},a=()=>{const R=lN(this.options,n),I=(()=>{const $={client:q(this,gs),queryKey:this.queryKey,meta:this.meta};return i($),$})();return _e(this,ys,!1),this.options.persister?this.options.persister(R,I,this):R(I)},u=(()=>{const R={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,gs),state:this.state,fetchFn:a};return i(R),R})(),f=q(this,Ja)==="infinite"?pU(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),_e(this,el,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&Fe(this,Gn,lo).call(this,{type:"fetch",meta:(m=u.fetchOptions)==null?void 0:m.meta}),_e(this,en,dN({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:R=>{R instanceof Ub&&R.revert&&this.setState({...q(this,el),fetchStatus:"idle"}),r.abort()},onFail:(R,C)=>{Fe(this,Gn,lo).call(this,{type:"failed",failureCount:R,error:C})},onPause:()=>{Fe(this,Gn,lo).call(this,{type:"pause"})},onContinue:()=>{Fe(this,Gn,lo).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const R=await q(this,en).start();if(R===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(R),(v=(w=q(this,ur).config).onSuccess)==null||v.call(w,R,this),(k=(_=q(this,ur).config).onSettled)==null||k.call(_,R,this.state.error,this),R}catch(R){if(R instanceof Ub){if(R.silent)return q(this,en).promise;if(R.revert){if(this.state.data===void 0)throw R;return this.state.data}}throw Fe(this,Gn,lo).call(this,{type:"error",error:R}),(E=(S=q(this,ur).config).onError)==null||E.call(S,R,this),(A=(O=q(this,ur).config).onSettled)==null||A.call(O,this.state.data,R,this),R}finally{this.scheduleGc()}}},Ja=new WeakMap,ms=new WeakMap,el=new WeakMap,ur=new WeakMap,gs=new WeakMap,en=new WeakMap,Lu=new WeakMap,ys=new WeakMap,Gn=new WeakSet,hN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},lo=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,...pN(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...Y2(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return _e(this,el,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),Zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),q(this,ur).notify({query:this,type:"updated",action:t})})},wA);function pN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Y2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Q2(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 Rn,rt,Iu,wn,bs,tl,fo,li,Uu,nl,rl,vs,ws,ci,ol,ft,tu,Pb,Fb,Bb,Hb,qb,Vb,Zb,mN,xA,K0=(xA=class extends $l{constructor(t,n){super();Me(this,ft);Me(this,Rn);Me(this,rt);Me(this,Iu);Me(this,wn);Me(this,bs);Me(this,tl);Me(this,fo);Me(this,li);Me(this,Uu);Me(this,nl);Me(this,rl);Me(this,vs);Me(this,ws);Me(this,ci);Me(this,ol,new Set);this.options=n,_e(this,Rn,t),_e(this,li,null),_e(this,fo,Ib()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,rt).addObserver(this),X2(q(this,rt),this.options)?Fe(this,ft,tu).call(this):this.updateResult(),Fe(this,ft,Hb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kb(q(this,rt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kb(q(this,rt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fe(this,ft,qb).call(this),Fe(this,ft,Vb).call(this),q(this,rt).removeObserver(this)}setOptions(t){const n=this.options,r=q(this,rt);if(this.options=q(this,Rn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yn(this.options.enabled,q(this,rt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fe(this,ft,Zb).call(this),q(this,rt).setOptions(this.options),n._defaulted&&!$h(this.options,n)&&q(this,Rn).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,rt),observer:this});const i=this.hasListeners();i&&W2(q(this,rt),r,this.options,n)&&Fe(this,ft,tu).call(this),this.updateResult(),i&&(q(this,rt)!==r||Yn(this.options.enabled,q(this,rt))!==Yn(n.enabled,q(this,rt))||wi(this.options.staleTime,q(this,rt))!==wi(n.staleTime,q(this,rt)))&&Fe(this,ft,Pb).call(this);const a=Fe(this,ft,Fb).call(this);i&&(q(this,rt)!==r||Yn(this.options.enabled,q(this,rt))!==Yn(n.enabled,q(this,rt))||a!==q(this,ci))&&Fe(this,ft,Bb).call(this,a)}getOptimisticResult(t){const n=q(this,Rn).getQueryCache().build(q(this,Rn),t),r=this.createResult(n,t);return bU(this,r)&&(_e(this,wn,r),_e(this,tl,this.options),_e(this,bs,q(this,rt).state)),r}getCurrentResult(){return q(this,wn)}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,fo).status==="pending"&&q(this,fo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){q(this,ol).add(t)}getCurrentQuery(){return q(this,rt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=q(this,Rn).defaultQueryOptions(t),r=q(this,Rn).getQueryCache().build(q(this,Rn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Fe(this,ft,tu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,wn)))}createResult(t,n){var F;const r=q(this,rt),i=this.options,a=q(this,wn),c=q(this,bs),u=q(this,tl),p=t!==r?t.state:q(this,Iu),{state:g}=t;let m={...g},w=!1,v;if(n._optimisticResults){const W=this.hasListeners(),G=!W&&X2(t,n),H=W&&W2(t,r,n,i);(G||H)&&(m={...m,...pN(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:_,errorUpdatedAt:k,status:S}=m;v=m.data;let E=!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,E=!0):W=typeof n.placeholderData=="function"?n.placeholderData((F=q(this,rl))==null?void 0:F.state.data,q(this,rl)):n.placeholderData,W!==void 0&&(S="success",v=Lb(a==null?void 0:a.data,W,n),w=!0)}if(n.select&&v!==void 0&&!E)if(a&&v===(c==null?void 0:c.data)&&n.select===q(this,Uu))v=q(this,nl);else try{_e(this,Uu,n.select),v=n.select(v),v=Lb(a==null?void 0:a.data,v,n),_e(this,nl,v),_e(this,li,null)}catch(W){_e(this,li,W)}q(this,li)&&(_=q(this,li),v=q(this,nl),k=Date.now(),S="error");const O=m.fetchStatus==="fetching",A=S==="pending",R=S==="error",C=A&&O,I=v!==void 0,T={status:S,fetchStatus:m.fetchStatus,isPending:A,isSuccess:S==="success",isError:R,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:R&&!I,isPaused:m.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:R&&I,isStale:G0(t,n),refetch:this.refetch,promise:q(this,fo),isEnabled:Yn(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=_e(this,fo,T.promise=Ib());H(K)},z=q(this,fo);switch(z.status){case"pending":t.queryHash===r.queryHash&&H(z);break;case"fulfilled":(G||T.data!==z.value)&&U();break;case"rejected":(!G||T.error!==z.reason)&&U();break}}return T}updateResult(){const t=q(this,wn),n=this.createResult(q(this,rt),this.options);if(_e(this,bs,q(this,rt).state),_e(this,tl,this.options),q(this,bs).data!==void 0&&_e(this,rl,q(this,rt)),$h(n,t))return;_e(this,wn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!q(this,ol).size)return!0;const c=new Set(a??q(this,ol));return this.options.throwOnError&&c.add("error"),Object.keys(q(this,wn)).some(u=>{const f=u;return q(this,wn)[f]!==t[f]&&c.has(f)})};Fe(this,ft,mN).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fe(this,ft,Hb).call(this)}},Rn=new WeakMap,rt=new WeakMap,Iu=new WeakMap,wn=new WeakMap,bs=new WeakMap,tl=new WeakMap,fo=new WeakMap,li=new WeakMap,Uu=new WeakMap,nl=new WeakMap,rl=new WeakMap,vs=new WeakMap,ws=new WeakMap,ci=new WeakMap,ol=new WeakMap,ft=new WeakSet,tu=function(t){Fe(this,ft,Zb).call(this);let n=q(this,rt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xn)),n},Pb=function(){Fe(this,ft,qb).call(this);const t=wi(this.options.staleTime,q(this,rt));if(xu.isServer()||q(this,wn).isStale||!zb(t))return;const r=aN(q(this,wn).dataUpdatedAt,t)+1;_e(this,vs,cs.setTimeout(()=>{q(this,wn).isStale||this.updateResult()},r))},Fb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(q(this,rt)):this.options.refetchInterval)??!1},Bb=function(t){Fe(this,ft,Vb).call(this),_e(this,ci,t),!(xu.isServer()||Yn(this.options.enabled,q(this,rt))===!1||!zb(q(this,ci))||q(this,ci)===0)&&_e(this,ws,cs.setInterval(()=>{(this.options.refetchIntervalInBackground||H0.isFocused())&&Fe(this,ft,tu).call(this)},q(this,ci)))},Hb=function(){Fe(this,ft,Pb).call(this),Fe(this,ft,Bb).call(this,Fe(this,ft,Fb).call(this))},qb=function(){q(this,vs)!==void 0&&(cs.clearTimeout(q(this,vs)),_e(this,vs,void 0))},Vb=function(){q(this,ws)!==void 0&&(cs.clearInterval(q(this,ws)),_e(this,ws,void 0))},Zb=function(){const t=q(this,Rn).getQueryCache().build(q(this,Rn),this.options);if(t===q(this,rt))return;const n=q(this,rt);_e(this,rt,t),_e(this,Iu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},mN=function(t){Zt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(q(this,wn))}),q(this,Rn).getQueryCache().notify({query:q(this,rt),type:"observerResultsUpdated"})})},xA);function yU(e,t){return Yn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Yn(t.retryOnMount,e)===!1)}function X2(e,t){return yU(e,t)||e.state.data!==void 0&&Kb(e,t,t.refetchOnMount)}function Kb(e,t,n){if(Yn(t.enabled,e)!==!1&&wi(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&G0(e,t)}return!1}function W2(e,t,n,r){return(e!==t||Yn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&G0(e,n)}function G0(e,t){return Yn(t.enabled,e)!==!1&&e.isStaleByTime(wi(t.staleTime,e))}function bU(e,t){return!$h(e.getCurrentResult(),t)}var Pu,Mr,mn,xs,Rr,ni,kA,vU=(kA=class extends fN{constructor(t){super();Me(this,Rr);Me(this,Pu);Me(this,Mr);Me(this,mn);Me(this,xs);_e(this,Pu,t.client),this.mutationId=t.mutationId,_e(this,mn,t.mutationCache),_e(this,Mr,[]),this.state=t.state||wU(),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,Mr).includes(t)||(q(this,Mr).push(t),this.clearGcTimeout(),q(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,Mr,q(this,Mr).filter(n=>n!==t)),this.scheduleGc(),q(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){q(this,Mr).length||(this.state.status==="pending"?this.scheduleGc():q(this,mn).remove(this))}continue(){var t;return((t=q(this,xs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,u,f,p,g,m,w,v,_,k,S,E,O,A,R,C,I,$;const n=()=>{Fe(this,Rr,ni).call(this,{type:"continue"})},r={client:q(this,Pu),meta:this.options.meta,mutationKey:this.options.mutationKey};_e(this,xs,dN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,F)=>{Fe(this,Rr,ni).call(this,{type:"failed",failureCount:T,error:F})},onPause:()=>{Fe(this,Rr,ni).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,mn).canRun(this)}));const i=this.state.status==="pending",a=!q(this,xs).canStart();try{if(i)n();else{Fe(this,Rr,ni).call(this,{type:"pending",variables:t,isPaused:a}),q(this,mn).config.onMutate&&await q(this,mn).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&&Fe(this,Rr,ni).call(this,{type:"pending",context:F,variables:t,isPaused:a})}const T=await q(this,xs).start();return await((p=(f=q(this,mn).config).onSuccess)==null?void 0:p.call(f,T,t,this.state.context,this,r)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,T,t,this.state.context,r)),await((v=(w=q(this,mn).config).onSettled)==null?void 0:v.call(w,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)),Fe(this,Rr,ni).call(this,{type:"success",data:T}),T}catch(T){try{await((E=(S=q(this,mn).config).onError)==null?void 0:E.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=(R=q(this,mn).config).onSettled)==null?void 0:C.call(R,void 0,T,this.state.variables,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await(($=(I=this.options).onSettled)==null?void 0:$.call(I,void 0,T,t,this.state.context,r))}catch(F){Promise.reject(F)}throw Fe(this,Rr,ni).call(this,{type:"error",error:T}),T}finally{q(this,mn).runNext(this)}}},Pu=new WeakMap,Mr=new WeakMap,mn=new WeakMap,xs=new WeakMap,Rr=new WeakSet,ni=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),Zt.batch(()=>{q(this,Mr).forEach(r=>{r.onMutationUpdate(t)}),q(this,mn).notify({mutation:this,type:"updated",action:t})})},kA);function wU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ho,vr,Fu,_A,xU=(_A=class extends $l{constructor(t={}){super();Me(this,ho);Me(this,vr);Me(this,Fu);this.config=t,_e(this,ho,new Set),_e(this,vr,new Map),_e(this,Fu,0)}build(t,n,r){const i=new vU({client:t,mutationCache:this,mutationId:++If(this,Fu)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){q(this,ho).add(t);const n=qf(t);if(typeof n=="string"){const r=q(this,vr).get(n);r?r.push(t):q(this,vr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(q(this,ho).delete(t)){const n=qf(t);if(typeof n=="string"){const r=q(this,vr).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,vr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qf(t);if(typeof n=="string"){const r=q(this,vr).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=qf(t);if(typeof n=="string"){const i=(r=q(this,vr).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(){Zt.batch(()=>{q(this,ho).forEach(t=>{this.notify({type:"removed",mutation:t})}),q(this,ho).clear(),q(this,vr).clear()})}getAll(){return Array.from(q(this,ho))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>V2(n,r))}findAll(t={}){return this.getAll().filter(n=>V2(t,n))}notify(t){Zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Zt.batch(()=>Promise.all(t.map(n=>n.continue().catch(xn))))}},ho=new WeakMap,vr=new WeakMap,Fu=new WeakMap,_A);function qf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function J2(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function kU(e,t,n){const r=e.slice(0);return r[t]=n,r}var il,Tn,sl,ks,Kn,ui,Bu,Hu,qu,Vu,Qt,Gb,Yb,gN,Qb,Xb,Wb,SA,_U=(SA=class extends $l{constructor(t,n,r){super();Me(this,Qt);Me(this,il);Me(this,Tn);Me(this,sl);Me(this,ks);Me(this,Kn);Me(this,ui);Me(this,Bu);Me(this,Hu);Me(this,qu);Me(this,Vu,[]);_e(this,il,t),_e(this,ks,r),_e(this,sl,[]),_e(this,Kn,[]),_e(this,Tn,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&q(this,Kn).forEach(t=>{t.subscribe(n=>{Fe(this,Qt,Xb).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,q(this,Kn).forEach(t=>{t.destroy()})}setQueries(t,n){_e(this,sl,t),_e(this,ks,n),Zt.batch(()=>{const r=q(this,Kn),i=Fe(this,Qt,Qb).call(this,q(this,sl));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,w)=>m!==r[w]),p=u||f,g=p?!0:c.some((m,w)=>{const v=q(this,Tn)[w];return!v||!$h(m,v)});!p&&!g||(p&&(_e(this,Vu,i),_e(this,Kn,a)),_e(this,Tn,c),this.hasListeners()&&(p&&(J2(r,a).forEach(m=>{m.destroy()}),J2(a,r).forEach(m=>{m.subscribe(w=>{Fe(this,Qt,Xb).call(this,m,w)})})),Fe(this,Qt,Wb).call(this)))})}getCurrentResult(){return q(this,Tn)}getQueries(){return q(this,Kn).map(t=>t.getCurrentQuery())}getObservers(){return q(this,Kn)}getOptimisticResult(t,n){const r=Fe(this,Qt,Qb).call(this,t),i=r.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),a=r.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>Fe(this,Qt,Yb).call(this,c??i,n,a),()=>Fe(this,Qt,Gb).call(this,i,r)]}},il=new WeakMap,Tn=new WeakMap,sl=new WeakMap,ks=new WeakMap,Kn=new WeakMap,ui=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,qu=new WeakMap,Vu=new WeakMap,Qt=new WeakSet,Gb=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)})})})},Yb=function(t,n,r){if(n){const i=q(this,qu),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((c,u)=>c!==i[u]));return(!q(this,ui)||q(this,Tn)!==q(this,Hu)||a||n!==q(this,Bu))&&(_e(this,Bu,n),_e(this,Hu,q(this,Tn)),r!==void 0&&_e(this,qu,r),_e(this,ui,V0(q(this,ui),n(t)))),q(this,ui)}return t},gN=function(){var t;return((t=q(this,ks))==null?void 0:t.combine)!==void 0&&q(this,Kn).some((n,r)=>{var i;return n.options.suspense&&((i=q(this,Tn)[r])==null?void 0:i.data)===void 0})},Qb=function(t){const n=new Map;q(this,Kn).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,il).defaultQueryOptions(i),u=((f=n.get(a.queryHash))==null?void 0:f.shift())??new K0(q(this,il),a);r.push({defaultedQueryOptions:a,observer:u})}),r},Xb=function(t,n){const r=q(this,Kn).indexOf(t);r!==-1&&(_e(this,Tn,kU(q(this,Tn),r,n)),Fe(this,Qt,Wb).call(this))},Wb=function(){var t;if(this.hasListeners()){const n=Fe(this,Qt,Gb).call(this,q(this,Tn),q(this,Vu)),r=Fe(this,Qt,gN).call(this),i=q(this,ui),a=r?i:Fe(this,Qt,Yb).call(this,n,(t=q(this,ks))==null?void 0:t.combine);(r||i!==a)&&Zt.batch(()=>{this.listeners.forEach(c=>{c(q(this,Tn))})})}},SA),Tr,EA,SU=(EA=class extends $l{constructor(t={}){super();Me(this,Tr);this.config=t,_e(this,Tr,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??q0(i,n);let c=this.get(a);return c||(c=new gU({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){q(this,Tr).has(t.queryHash)||(q(this,Tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=q(this,Tr).get(t.queryHash);n&&(t.destroy(),n===t&&q(this,Tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return q(this,Tr).get(t)}getAll(){return[...q(this,Tr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>q2(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>q2(t,r)):n}notify(t){Zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tr=new WeakMap,EA),$t,di,fi,al,ll,hi,cl,ul,jA,yN=(jA=class{constructor(e={}){Me(this,$t);Me(this,di);Me(this,fi);Me(this,al);Me(this,ll);Me(this,hi);Me(this,cl);Me(this,ul);_e(this,$t,e.queryCache||new SU),_e(this,di,e.mutationCache||new xU),_e(this,fi,e.defaultOptions||{}),_e(this,al,new Map),_e(this,ll,new Map),_e(this,hi,0)}mount(){If(this,hi)._++,q(this,hi)===1&&(_e(this,cl,H0.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,$t).onFocus())})),_e(this,ul,zh.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,$t).onOnline())})))}unmount(){var e,t;If(this,hi)._--,q(this,hi)===0&&((e=q(this,cl))==null||e.call(this),_e(this,cl,void 0),(t=q(this,ul))==null||t.call(this),_e(this,ul,void 0))}isFetching(e){return q(this,$t).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return q(this,di).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,$t).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=q(this,$t).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return q(this,$t).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,$t).get(r.queryHash),a=i==null?void 0:i.state.data,c=oU(t,a);if(c!==void 0)return q(this,$t).build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Zt.batch(()=>q(this,$t).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,$t).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=q(this,$t);Zt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=q(this,$t);return Zt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zt.batch(()=>q(this,$t).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(xn).catch(xn)}invalidateQueries(e,t={}){return Zt.batch(()=>(q(this,$t).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=Zt.batch(()=>q(this,$t).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(xn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(xn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=q(this,$t).build(this,t);return n.isStaleByTime(wi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return zh.isOnline()?q(this,di).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,$t)}getMutationCache(){return q(this,di)}getDefaultOptions(){return q(this,fi)}setDefaultOptions(e){_e(this,fi,e)}setQueryDefaults(e,t){q(this,al).set(ml(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...q(this,al).values()],n={};return t.forEach(r=>{gl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){q(this,ll).set(ml(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...q(this,ll).values()],n={};return t.forEach(r=>{gl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...q(this,fi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=q0(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===Z0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...q(this,fi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){q(this,$t).clear(),q(this,di).clear()}},$t=new WeakMap,di=new WeakMap,fi=new WeakMap,al=new WeakMap,ll=new WeakMap,hi=new WeakMap,cl=new WeakMap,ul=new WeakMap,jA),bN=x.createContext(void 0),No=e=>{const t=x.useContext(bN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vN=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(bN.Provider,{value:e,children:t})),wN=x.createContext(!1),xN=()=>x.useContext(wN);wN.Provider;function EU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jU=x.createContext(EU()),kN=()=>x.useContext(jU),_N=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?cN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SN=e=>{x.useEffect(()=>{e.clearReset()},[e])},EN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||cN(n,[e.error,r])),jN=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))}},OU=(e,t)=>e.isLoading&&e.isFetching&&!t,Jb=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ev=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ON({queries:e,...t},n){const r=No(),i=xN(),a=kN(),c=x.useMemo(()=>e.map(k=>{const S=r.defaultQueryOptions(k);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);c.forEach(k=>{jN(k);const S=r.getQueryCache().get(k.queryHash);_N(k,a,S)}),SN(a);const[u]=x.useState(()=>new _U(r,c,t)),[f,p,g]=u.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(k=>m?u.subscribe(Zt.batchCalls(k)):xn,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(c,t)},[c,t,u]);const v=f.some((k,S)=>Jb(c[S],k))?f.flatMap((k,S)=>{const E=c[S];if(E&&Jb(E,k)){const O=new K0(r,E);return ev(E,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const _=f.find((k,S)=>{const E=c[S];return E&&EN({result:k,errorResetBoundary:a,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(_!=null&&_.error)throw _.error;return p(g())}function AU(e,t,n){var v,_,k,S;const r=xN(),i=kN(),a=No(),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,jN(c),_N(c,i,u),SN(i);const p=!a.getQueryCache().get(c.queryHash),[g]=x.useState(()=>new t(a,c)),m=g.getOptimisticResult(c),w=!r&&f;if(x.useSyncExternalStore(x.useCallback(E=>{const O=w?g.subscribe(Zt.batchCalls(E)):xn;return g.updateResult(),O},[g,w]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),x.useEffect(()=>{g.setOptions(c)},[c,g]),Jb(c,m))throw ev(c,g,i);if(EN({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()&&OU(m,r)){const E=p?ev(c,g,i):u==null?void 0:u.promise;E==null||E.catch(xn).finally(()=>{g.updateResult()})}return c.notifyOnChangeProps?m:g.trackResult(m)}function zn(e,t){return AU(e,K0)}const CU=600*1e3,AN=(e,t,n)=>({queryKey:["crop-url",e,t],queryFn:()=>n(e,t),staleTime:CU});function CN(e,t,n){const r=x.useMemo(()=>[...new Set(t.filter(a=>!!a))],[t]),i=ON({queries:r.map(a=>({...AN(e,a,n),enabled:!!e}))});return x.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 NU(e,t,n,r){return e.fetchQuery(AN(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 NN=(...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 MU=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 RU=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 eE=e=>{const t=RU(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 Dy={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 TU=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},$U=x.createContext({}),zU=()=>x.useContext($U),DU=x.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:c,...u},f)=>{const{size:p=24,strokeWidth:g=2,absoluteStrokeWidth:m=!1,color:w="currentColor",className:v=""}=zU()??{},_=r??m?Number(n??g)*24/Number(t??p):n??g;return x.createElement("svg",{ref:f,...Dy,width:t??p??Dy.width,height:t??p??Dy.height,stroke:e??w,strokeWidth:_,className:NN("lucide",v,i),...!a&&!TU(u)&&{"aria-hidden":"true"},...u},[...c.map(([k,S])=>x.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 we=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(DU,{ref:a,iconNode:t,className:NN(`lucide-${MU(eE(e))}`,`lucide-${e}`,r),...i}));return n.displayName=eE(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 LU=[["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"}]],IU=we("activity",LU);/**
|
|
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 UU=[["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"}]],PU=we("archive",UU);/**
|
|
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 FU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],BU=we("arrow-down",FU);/**
|
|
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 HU=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],qU=we("arrow-left",HU);/**
|
|
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 VU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ZU=we("arrow-right",VU);/**
|
|
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 KU=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],MN=we("arrow-up-right",KU);/**
|
|
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 GU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],YU=we("arrow-up",GU);/**
|
|
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 QU=[["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"}]],XU=we("book-open",QU);/**
|
|
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 WU=[["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"}]],Y0=we("box",WU);/**
|
|
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 JU=[["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"}]],eP=we("building-2",JU);/**
|
|
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 tP=[["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"}]],nP=we("building",tP);/**
|
|
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 rP=[["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"}]],oP=we("calendar-days",rP);/**
|
|
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 iP=[["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"}]],sP=we("calendar",iP);/**
|
|
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 aP=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],lP=we("chart-line",aP);/**
|
|
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 cP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Si=we("check",cP);/**
|
|
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 uP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Q0=we("chevron-down",uP);/**
|
|
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 dP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Mp=we("chevron-left",dP);/**
|
|
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 fP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rp=we("chevron-right",fP);/**
|
|
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 hP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],pP=we("chevrons-up-down",hP);/**
|
|
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 mP=[["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"}]],gP=we("circle-question-mark",mP);/**
|
|
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 yP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],bP=we("clock",yP);/**
|
|
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 vP=[["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"}]],X0=we("cloud-upload",vP);/**
|
|
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 wP=[["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=we("copy",wP);/**
|
|
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 kP=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],_P=we("credit-card",kP);/**
|
|
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 SP=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],EP=we("crop",SP);/**
|
|
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 jP=[["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"}]],OP=we("database",jP);/**
|
|
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 AP=[["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"}]],RN=we("download",AP);/**
|
|
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 CP=[["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"}]],NP=we("ellipsis-vertical",CP);/**
|
|
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 MP=[["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"}]],RP=we("ellipsis",MP);/**
|
|
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 TP=[["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"}]],TN=we("external-link",TP);/**
|
|
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 $P=[["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"}]],zP=we("eye-off",$P);/**
|
|
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 DP=[["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"}]],$N=we("eye",DP);/**
|
|
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 LP=[["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"}]],IP=we("file-pen-line",LP);/**
|
|
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 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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],zN=we("file-spreadsheet",UP);/**
|
|
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 PP=[["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"}]],Tp=we("file-text",PP);/**
|
|
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 FP=[["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"}]],Ly=we("files",FP);/**
|
|
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 BP=[["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"}]],HP=we("file",BP);/**
|
|
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 qP=[["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"}]],VP=we("film",qP);/**
|
|
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 ZP=[["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"}]],KP=we("globe",ZP);/**
|
|
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 GP=[["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"}]],W0=we("grip-vertical",GP);/**
|
|
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 YP=[["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"}]],QP=we("house",YP);/**
|
|
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 XP=[["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"}]],$p=we("image",XP);/**
|
|
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 WP=[["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"}]],tv=we("images",WP);/**
|
|
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 JP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],e9=we("info",JP);/**
|
|
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 t9=[["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"}]],n9=we("key-round",t9);/**
|
|
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 r9=[["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"}]],DN=we("layout-grid",r9);/**
|
|
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 o9=[["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"}]],i9=we("layout-template",o9);/**
|
|
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 s9=[["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"}]],a9=we("library-big",s9);/**
|
|
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 l9=[["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"}]],J0=we("link-2",l9);/**
|
|
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 c9=[["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"}]],u9=we("link",c9);/**
|
|
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 d9=[["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"}]],LN=we("list",d9);/**
|
|
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 f9=[["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"}]],h9=we("lock",f9);/**
|
|
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 p9=[["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"}]],m9=we("log-out",p9);/**
|
|
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 g9=[["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"}]],y9=we("mail",g9);/**
|
|
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 b9=[["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"}]],v9=we("map-pin-house",b9);/**
|
|
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 w9=[["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"}]],IN=we("map-pin",w9);/**
|
|
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"}]],k9=we("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 _9=[["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"}]],S9=we("maximize-2",_9);/**
|
|
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 E9=[["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"}]],j9=we("mic",E9);/**
|
|
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 O9=[["path",{d:"M5 12h14",key:"1ays0h"}]],UN=we("minus",O9);/**
|
|
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 A9=[["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"}]],C9=we("mouse-pointer-click",A9);/**
|
|
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 N9=[["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"}]],M9=we("newspaper",N9);/**
|
|
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 R9=[["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"}]],T9=we("palette",R9);/**
|
|
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 $9=[["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"}]],ew=we("pencil",$9);/**
|
|
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 z9=[["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"}]],D9=we("phone",z9);/**
|
|
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 L9=[["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"}]],PN=we("play",L9);/**
|
|
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 I9=[["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"}]],U9=we("plug",I9);/**
|
|
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 P9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],nd=we("plus",P9);/**
|
|
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 F9=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],B9=we("power",F9);/**
|
|
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 H9=[["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"}]],tw=we("presentation",H9);/**
|
|
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 q9=[["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"}]],V9=we("redo-2",q9);/**
|
|
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 Z9=[["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"}]],nw=we("rotate-3d",Z9);/**
|
|
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 K9=[["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"}]],G9=we("rotate-cw",K9);/**
|
|
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 Y9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],rw=we("search",Y9);/**
|
|
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 Q9=[["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"}]],X9=we("settings",Q9);/**
|
|
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 W9=[["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"}]],J9=we("share",W9);/**
|
|
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 e7=[["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"}]],t7=we("sparkles",e7);/**
|
|
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 n7=[["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"}]],r7=we("tag",n7);/**
|
|
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 o7=[["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"}]],zl=we("trash-2",o7);/**
|
|
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 i7=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],s7=we("trending-up",i7);/**
|
|
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 a7=[["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"}]],ow=we("triangle-alert",a7);/**
|
|
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 l7=[["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"}]],c7=we("type",l7);/**
|
|
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 u7=[["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"}]],d7=we("undo-2",u7);/**
|
|
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 f7=[["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"}]],zp=we("upload",f7);/**
|
|
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 h7=[["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"}]],p7=we("user-plus",h7);/**
|
|
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 m7=[["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"}]],g7=we("user",m7);/**
|
|
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 y7=[["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"}]],b7=we("users",y7);/**
|
|
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 v7=[["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"}]],iw=we("video",v7);/**
|
|
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 w7=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dp=we("x",w7);function le(...e){return Np(Cp(e))}const x7="flex flex-col gap-3.5 pt-1",$s="flex flex-col gap-1",FN="text-[length:calc(11*var(--content))] font-medium text-ink-4 pl-0.5",Dl="m-0 text-caption leading-[1.4] text-danger",BN="bg-[repeating-linear-gradient(135deg,rgba(20,18,13,0.05)_0_1px,transparent_1px_9px)]",kt="appearance-none cursor-pointer border-0 bg-transparent p-0 m-0 outline-none",k7="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)]",_7="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",Ll=le("data-[attention=required]:border-danger data-[attention=required]:bg-danger-soft","data-[attention=invalid]:border-danger data-[attention=invalid]:bg-danger-soft");function Il(e,t){return e===null||e==="required"&&!t?{}:{"data-attention":e}}const HN="flex items-center text-[length:calc(12.5*var(--content))] text-ink-4",S7=le(kt,"min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink-4"),E7="py-2.25",j7="text-[length:calc(13.5*var(--content))]",qN=le(E7,j7),VN="font-mono text-[length:calc(10.5*var(--content))] [font-feature-settings:'tnum'] shrink-0",ZN="text-[#7a5a14]";function O7(e,t){const n=le(VN,"text-ink-4");return t==null?n:e>t?le(n,"text-danger"):e>=t*.9?le(n,ZN):n}function A7({children:e}){return h.jsx("span",{className:FN,children:e})}function C7({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:le(S7,c),value:e,placeholder:n,inputMode:r,maxLength:i,spellCheck:a,"aria-label":u,onChange:p=>t(p.target.value)})}function bn(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 zt={trash:bn(zl,11),plus:bn(nd,14),up:bn(zp,15),link:bn(u9,13),play:({size:e=20}={})=>h.jsx(PN,{size:e,strokeWidth:0,fill:"currentColor",style:{width:`calc(${e} * var(--content))`,height:`calc(${e} * var(--content))`}}),tour:bn(nw,18),search:bn(rw,14),x:bn(Dp,15),check:bn(Si,13),minus:bn(UN,16),external:bn(TN,11),grip:bn(W0,13,1.8),calendar:bn(oP,14),chevL:bn(Mp,15),chevR:bn(Rp,15),chevD:bn(Q0,13)},rd=x.createContext(null);function KN({ports:e,children:t}){return h.jsx(rd.Provider,{value:e,children:t})}function nn(){const e=x.useContext(rd);if(!e)throw new Error("useSlotEditorPorts: missing SlotEditorPortsProvider");return e}function N7(){var e;return(e=x.useContext(rd))==null?void 0:e.fillMark}function M7(){var e;return(e=x.useContext(rd))==null?void 0:e.isMediaProcessing}function R7(){var e;return(e=x.useContext(rd))==null?void 0:e.cropFailedAt}function xi(e){return nn().useEditorStore(e)}const T7="size-[calc(6*var(--content))] shrink-0 rounded-full bg-honey-ink";function yl(e,t){const n=j0(t);return e===void 0||n===null?void 0:`${e}.${n}`}function ku(e,t){return e===void 0?void 0:`${e}.${t}`}function GN(e){return e==="list"||e==="media"||_n(e)}function $7(e){const t=N7();return t===void 0||e===void 0?null:t(e)}function z7({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:T7,"aria-hidden":"true"}),e]})}var Ur=OA();function D7(...e){return Np(Cp(e))}const Lp=1e3,Ei=Lp+200,L7=Lp+500;let I7=0;const ji=[];let YN="",QN="";function U7(){if(ji.length!==1||typeof document>"u")return;const e=document.body;YN=e.style.overflow,QN=e.style.paddingRight;const t=window.innerWidth-document.documentElement.clientWidth;e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`)}function P7(){ji.length===0&&(typeof document>"u"||(document.body.style.overflow=YN,document.body.style.paddingRight=QN))}function XN(){const e=++I7;return ji.push(e),U7(),e}function nv(e){const t=ji.indexOf(e);t!==-1&&ji.splice(t,1),P7()}function WN(e){const t=ji.indexOf(e);return Lp+(t===-1?0:t)*10}function tE(e){return ji[ji.length-1]===e}const F7="(prefers-reduced-motion: reduce)";function B7(){const[e,t]=x.useState(!1);return x.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(F7);t(n.matches);const r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const H7={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)]"},q7='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function sw({open:e,onClose:t,className:n,size:r,closeOnBackdrop:i=!0,closeOnEsc:a=!0,labelledBy:c,ariaLabel:u,children:f}){const[p,g]=x.useState("closed"),m=x.useRef(null),w=x.useRef(null),v=x.useRef(null),[_,k]=x.useState(1e3),S=B7(),[E,O]=x.useState(f);e&&E!==f&&O(f),x.useEffect(()=>{e&&p==="closed"?g("open"):!e&&p==="open"&&g(S?"closed":"closing")},[e,p,S]),x.useEffect(()=>{var C;if(p==="open"&&m.current===null){v.current=document.activeElement??null;const I=XN();m.current=I,k(WN(I)),(C=w.current)==null||C.focus()}},[p]),x.useEffect(()=>{var C,I;p==="closed"&&m.current!==null&&(nv(m.current),m.current=null,(I=(C=v.current)==null?void 0:C.focus)==null||I.call(C),v.current=null)},[p]),x.useEffect(()=>()=>{m.current!==null&&(nv(m.current),m.current=null)},[]),x.useEffect(()=>{if(p!=="closing")return;const C=setTimeout(()=>g("closed"),400);return()=>clearTimeout(C)},[p]),x.useEffect(()=>{if(p!=="open"||!a)return;const C=I=>{I.key!=="Escape"||I.defaultPrevented||m.current===null||!tE(m.current)||(I.preventDefault(),t())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[p,a,t]),x.useEffect(()=>{if(p!=="open")return;const C=I=>{if(I.key!=="Tab"||m.current===null||!tE(m.current))return;const $=w.current;if(!$)return;const T=$.querySelectorAll(q7);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=x.useCallback(C=>{C.target===C.currentTarget&&p==="closing"&&g("closed")},[p]);if(p==="closed"||typeof document>"u")return null;const R=p==="closing"?"closing":"open";return Ur.createPortal(h.jsx("div",{className:"hp-modal-backdrop","data-state":R,inert:R==="closing",style:{zIndex:_},onMouseDown:i?t:void 0,children:h.jsx("div",{ref:w,className:D7("hp-modal-panel",r?H7[r]:void 0,n),"data-state":R,role:"dialog","aria-modal":"true","aria-labelledby":c,"aria-label":u,tabIndex:-1,onMouseDown:C=>C.stopPropagation(),onAnimationEnd:A,children:e?f:E})}),document.body)}function JN(){const[e,t]=x.useState(Lp);return x.useEffect(()=>{const n=XN();return t(WN(n)),()=>nv(n)},[]),e}const V7={youtube:"video",vimeo:"video"};function eM(e){const t=Gu(e.startsWith("http")?e:`https://${e}`);if(t!==null){const n=Ni[t],r=n.kind==="tour"||n.kind==="video"?n.kind:void 0;return{key:t,name:n.label,kind:V7[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 aw="bg-[#f7f6f2]",$n="bg-[#eceae3]",Z7="[mask-image:var(--fade-down)]",K7="[background-image:var(--wash-soft)]";function od({className:e,children:t}){return h.jsx("div",{"aria-hidden":"true",className:le("pointer-events-none absolute inset-0 select-none overflow-hidden",Z7,e),children:t})}function Dh({icon:e,headline:t,line:n,lifted:r=!1}){return h.jsx("div",{className:le("absolute inset-0 flex items-center justify-center-safe overflow-y-auto px-6 py-8",K7),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 lw="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",cw="border-line bg-canvas text-ink-2 hover:bg-[#f6f5f1] hover:text-ink",Ip="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)]",tM="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",nE=le(lw,cw,"font-semibold text-ink focus-visible:bg-[#f6f5f1] aria-expanded:bg-[#f6f5f1]"),G7={large:nE,compact:le(nE,"h-8")},Y7="size-[calc(15*var(--content))] shrink-0";function Lh({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:G7[t],onClick:n,children:[h.jsx(e.icon,{"aria-hidden":"true",strokeWidth:2.4,className:Y7}),e.label]})}function id({size:e,add:t,onAdd:n,newChip:r,choose:i}){const a=i!==void 0?h.jsx(Lh,{add:i.choose,size:e,onClick:i.onChoose}):r??(n!==null?h.jsx(Lh,{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 nM=x.createContext(null);function rM({api:e,children:t}){return h.jsx(nM.Provider,{value:e,children:t})}function uw(){const e=x.useContext(nM);if(!e)throw new Error("useMediaLibraryApi: missing MediaLibraryApiProvider");return e}async function Q7(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 X7="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.",W7=new Set([".heic",".heif"]),J7=new Set(["image/heic","image/heif","image/heic-sequence","image/heif-sequence"]);function eF(e,t){return W7.has(e)||J7.has(t)}const tF=new Set(["text/plain","text/csv"]);[...tF];const rE=500*1024*1024,Ih=[{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"}],oM=new Set(Ih.map(e=>e.extension)),iM=new Set(Ih.flatMap(e=>e.mimeTypes));function sd(e){const t=e.indexOf(";");return(t===-1?e:e.slice(0,t)).trim().toLowerCase()}function Up(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 nF(e){return sd(e).startsWith("image/")}function rF(e){return sd(e).startsWith("video/")}function oF(e,t){return oM.has(Up(e))&&iM.has(sd(t))}function iF(e,t){return sM(e,t)!==null?!1:nF(t)||rF(t)||oF(e,t)}function sM(e,t){return eF(Up(e),sd(t))?X7:null}function sF(e,t){const n=Up(e),r=Ih.find(c=>c.extension===n);if(r)return r.family;const i=sd(t),a=Ih.find(c=>c.mimeTypes.includes(i));return a?a.family:null}const aF=[...iM,...oM].join(","),lF="an image, a video, or a document (PDF, Word, Excel .xlsx, PowerPoint .pptx, CSV, or text)";function cF(e){return e.replace(/^https?:\/\//i,"").replace(/\/$/,"")}function uF(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 aM(e,t){const n=sF(e,t),{glyph:r,typeNoun:i}=n===null?{glyph:"doc",typeNoun:"File"}:uF(n);return{glyph:r,typeNoun:i,extension:Up(e).replace(".","").toUpperCase()}}function dF(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1048576).toFixed(1)} MB`}function Uh(e){var t;return((t=e.renditions.poster)==null?void 0:t.url)??(e.kind==="image"?e.file_url:null)}function fF(e){var t;return e.kind!=="image"?Uh(e):(Hs(e.crop)?(t=e.renditions.crop)==null?void 0:t.url:void 0)??Uh(e)}function lM(e){if(e.kind!=="image"||e.state==="failed")return!1;const{crop:t,cutout:n}=e.renditions;return t!==null&&Hs(e.crop)&&!Ts(t.over.crop,e.crop)?!0:n!==null&&!Ts(n.over.crop,e.crop)}function hF(e){return e.url!==null||e.renditions.encode!==null}function cM(e){return e.url!==null&&KD(e.url)!==null}function Pp({renditions:e={},...t}){const n=new Set(PA),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(JD.map(i=>[i,r(i)]))}}function uM(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)??Uh(e)??""};case"video":return{id:e.id,kind:"video",name:e.name,size:"",src:((n=e.renditions.poster)==null?void 0:n.url)??"",ready:hF(e),durationMs:e.renditions.encode===null?null:e.duration_ms,videoSource:oL(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:cM(e),provider:e.provider??""};case"document":return{id:e.id,kind:"document",name:e.name,size:e.bytes!==null&&e.bytes>0?dF(e.bytes):"",src:((i=e.renditions.poster)==null?void 0:i.url)??"",mime:e.mime??""}}}function pF(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 mF=5;function oE(e){return`${Math.round(e/(1024*1024))} MB`}function gF(e){return e.size>rE?{ok:!1,message:`This file is ${oE(e.size)}. The maximum upload size is ${oE(rE)}.`}:iF(e.name,e.type)?{ok:!0}:{ok:!1,message:sM(e.name,e.type)??`This file type (${e.type||"unknown"}) isn't supported. Upload ${lF}.`}}function yF(e){return e.attempt?{kind:"resume",attempt:e.attempt}:{kind:"fresh"}}function Fp(e){const{mediaFactsQuery:t}=uw(),n=t(e??"");return zn({...n,select:r=>r.facts,enabled:!!e}).data}async function rv(e,t,n){await e.invalidateQueries({queryKey:t.mediaFactsQuery(n).queryKey})}const bF=new Map;function vF(e){if(e===void 0)return bF;const t=new Map;for(const[n,r]of Rl(e)){if(!Object.hasOwn(e.files,r.file))continue;const i=e.files[r.file];"renditions"in i&&t.set(n,m0(i,r))}return t}function Ul(e){const t=Fp(e===""?null:e);return x.useMemo(()=>vF(t),[t])}const wF={search:rw,chevd:Q0,chevr:Rp,chevl:Mp,grid:DN,list:LN,plus:nd,choose:MN,cloud:X0,dots:NP,trash:zl,down:RN,x:Dp,check:Si,warn:ow,recheck:G9,play:PN,eye:$N,pencil:ew,crop:EP,image:$p,doc:Tp,spreadsheet:zN,presentation:tw,file:HP,video:iw,tour:Y0,upload:zp};function ot({name:e,size:t=14,stroke:n=1.8}){const r=wF[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 dw={image:{process:[jt.probe(),jt.understand(),jt.preview(),jt.ladder()],gates:["probe","understand"],publishes:["preview","ladder"]},video:{process:[jt.probe(),jt.transcode(),jt.poster(),jt.understand(),jt.preview(),jt.ladder(),jt.fetch()],gates:["probe","understand"],publishes:["transcode","poster","preview","ladder"]},document:{process:[jt.probe(),jt.understand(),jt.poster(),jt.rasterize(),jt.preview(),jt.ladder()],gates:["probe","understand"],publishes:["poster","preview","ladder"]},tour:{process:[jt.fetch(),jt.tour_details(),jt.understand()],gates:["understand"],publishes:[]}};function xF(e){for(const t of Eo){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=$A(i);if(a===null||typeof i!="object")return`${t}'s row lists ${JSON.stringify(i)}, which is no process binding`;const c=Ci[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=u0(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 iE=xF(dw);if(iE!==null)throw new Error(`KIND_TABLE ${iE}.`);const kF={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},_F={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 SF(e,t){const n=_F[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 ov={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 Eo){const t=dw[e].process.map(n=>n.verb);for(const{before:n,after:r}of ov[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 sE=new Map,EF={image:[jt.crop()],video:[],document:[],tour:[]};for(const e of Eo)for(const t of EF[e]){const n=Ci[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 jF(e){const t=sE.get(e);if(t!==void 0)return t;const n=dw[e],r=[...n.gates,...ov[e].filter(c=>n.gates.includes(c.after)).map(c=>c.before)],i=n.process.map(c=>{const u=SF(c.verb,e);return{verb:c.verb,binding:c,input:u,present:kF[u],gates:n.gates.includes(c.verb),publishes:n.publishes.includes(c.verb),reads:r.includes(c.verb)}}),a={kind:e,entries:i,edges:ov[e],gates:n.gates};return sE.set(e,a),a}const ad={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]"}},Ph=Object.keys(ad);function gn(e){return"send"in e}function dM(e){return gn(e)?e.id:e.record.id}function OF(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":jF(e.kind).entries.some(n=>n.verb==="poster"&&n.present(e))}function AF(e){return e.url!==null&&e.state==="failed"}function au(e){return e.url!==null}function fM(e){return LA(/^https?:\/\//i.test(e)?e:`https://${e}`)}const CF=()=>0;function NF({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:fF(e),addedAt:Date.parse(e.added_at),previewPending:OF(e),linkUnreachable:AF(e),inFlight:!1,error:null,list:t,tier:n??i,upstream:i>0}}function MF(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 RF(e,t=CF){return gn(e)?MF(e):NF(e,t)}function aE(e){return e.kind===null?Ph.length:Ph.indexOf(e.kind)}const TF={name:(e,t)=>e.name.localeCompare(t.name),kind:(e,t)=>aE(e)-aE(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 $F(e,t,n){const r=t==="all"?[...e]:e.filter(a=>a.kind===t),i=TF[n];return r.sort((a,c)=>a.tier-c.tier||i(a,c))}function zF(e){const t={all:e.length};for(const n of Ph)t[n]=0;for(const n of e)n.kind&&(t[n.kind]+=1);return t}function hM(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 pM(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 DF(e){const[t,n]=x.useState(e);return(e===null||t===null)&&t!==e&&n(e),x.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 LF="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]",IF={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 zs({kind:e,size:t="mark",glyph:n,decorative:r=!1}){const i=ad[e],a=IF[t];return h.jsx("span",{className:le("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(ot,{name:n??i.icon,size:a.glyph,stroke:2})})}function mM({file:e}){if(e.kind===null)return null;const t=ad[e.kind];return h.jsxs("span",{className:le(LF,t.soft),children:[h.jsx(ot,{name:t.icon,size:10,stroke:2.2}),t.label]})}function UF(e){const t=e.url!==null?eM(e.url).name:e.bytes!==null?hM(e.bytes):"",n=pM(e.addedAt);return t?`${t} · ${n}`:n}function PF(e){return aM(e.name,e.mime??"").glyph}function FF(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 BF={row:"thumb",card:"logo",lightbox:"hero"};function fw({file:e,face:t="card"}){const n=DF(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 ${FF(t==="lightbox")}`,children:h.jsx(ot,{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"?PF(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(ot,{name:"file",size:t==="row"?16:32,stroke:1.6})}):h.jsx(zs,{kind:e.kind,size:BF[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 Vf="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]",gM="Can’t be reached",iv="We couldn’t load this link. It may be private, unpublished, or mistyped. Fix it at the provider, then re-check.",Zf="absolute inset-0 z-[2] flex items-center justify-center bg-[rgba(252,252,250,0.82)] px-1";function yM({file:e,compact:t=!1,onRetry:n,onRecheck:r}){if(e.state==="uploading"){const i=e.progress??0;return h.jsx("div",{className:t?Zf:Vf,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?Zf:Vf,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:`${Zf} text-danger`,title:e.error??void 0,children:h.jsx(ot,{name:"warn",size:13})}):e.state==="failed"?h.jsxs("div",{className:`${Vf} text-[length:calc(11.5*var(--content))] font-semibold text-danger`,children:[h.jsx(ot,{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:`${Zf} text-warn`,title:iv,children:h.jsx(ot,{name:"warn",size:13})}):e.linkUnreachable?h.jsxs("div",{className:`${Vf} text-[length:calc(11.5*var(--content))] font-semibold text-warn`,title:iv,children:[h.jsx(ot,{name:"warn",size:15}),h.jsx("span",{className:"max-w-[90%]",children:gM}),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(ot,{name:"recheck",size:11}),"Re-check"]}):null]}):null}function ld(e,t,n,r){x.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 bM({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 Fh(e,t="or"){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} ${t} ${e.at(-1)}`}const vM=["tour","video"],HF={tour:"3D tour",video:"video"};function hw(e){return vM.filter(t=>e.includes(t)).flatMap(t=>HF[t]??[])}function qF(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 ${Fh(i)} anywhere here`}if(!t.onLink)return null;const r=hw(e);return r.length===0?null:`Paste a link to a ${Fh(r)}`}function VF(e,t){const n=e.trim();if(!n)return{state:"empty"};const r=fM(n);return r===null||!t.includes(r)?{state:"refused"}:{state:"ok",kind:r,provider:eM(n).name}}function ZF(e,t,n){const[r,i]=x.useState(""),a=VF(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 KF({verdict:e,kinds:t,className:n}){return h.jsx("div",{className:le("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(zs,{kind:e.kind,decorative:!0}),h.jsxs("span",{className:"font-medium text-ink-2",children:[e.provider," ",ad[e.kind].label.toLowerCase()]})]}):e.state==="refused"?h.jsxs("span",{className:"text-warn",children:["Only ",Fh(hw(t),"and")," links can be added."]}):null})}const GF="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 YF({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(J0,{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 ${Fh(hw(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:le(GF,"h-8 rounded-md px-3 text-[length:calc(12.5*var(--content))]"),children:"New link"})]})}function QF({add:e,kinds:t,dragging:n}){if(e===null)return h.jsx(Dh,{icon:h.jsx(tv,{size:25,strokeWidth:1.8}),headline:"Nothing here yet"});const r=qF(t,e);return h.jsx(Dh,{icon:e.accept!==null?h.jsx(X0,{size:25,strokeWidth:1.8}):h.jsx(J0,{size:24,strokeWidth:1.8}),headline:n?"Drop to upload":"Nothing uploaded yet",...r!==null?{line:r}:{},lifted:n})}function XF({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(X0,{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 WF({onAdd:e,disabled:t,kinds:n}){const r=ZF(e,t,n);return h.jsxs("div",{className:"flex flex-col gap-2 px-1 pb-1",children:[h.jsx(YF,{draft:r}),h.jsx(KF,{verdict:r.verdict,kinds:n,className:"px-0.5 empty:hidden"})]})}function wM({add:e,onBrowse:t,onLinked:n,uploadDetail:r}){return h.jsxs(h.Fragment,{children:[e.accept!==null?h.jsx(XF,{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(WF,{onAdd:i=>{e.onLink(i),n()},disabled:e.disabled,kinds:e.linkKinds??vM})]})}function JF({add:e,verb:t}){const{accept:n,onFiles:r,onLink:i,disabled:a}=e,[c,u]=x.useState(!1),f=x.useRef(null),p=x.useRef(null),g=x.useCallback(()=>u(!1),[]);ld(f,c,g);const m=()=>{var v;g(),(v=p.current)==null||v.click()},w=()=>{c?g():i?u(!0):m()};return h.jsxs("div",{className:"relative",ref:f,onClick:v=>v.stopPropagation(),children:[n!==null?h.jsx(bM,{inputRef:p,accept:n,onFiles:r,disabled:a}):null,h.jsx(Lh,{add:t,size:"large",onClick:w,...i?{expanded:c}:{}}),c&&i?h.jsx("div",{className:`${Ip} 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(wM,{add:{...e,onLink:i},onBrowse:m,onLinked:g,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]=x.useState(!1),[g,m]=x.useState(null),w=x.useRef(null),v=x.useRef(null),_=x.useCallback(()=>{p(!1),m(null)},[]);ld(n,f,_,w),x.useLayoutEffect(()=>{if(!f)return;const E=()=>{const O=n.current,A=w.current;if(!O||!A)return;const R=A.offsetHeight,C=Ml(Cs(O),{height:R,maxHeight:R,minWidth:A.offsetWidth});m(C?{left:C.left,top:C.top,bottom:C.bottom}:null)};return E(),window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[f,n]);const k=()=>{var E;_(),(E=v.current)==null||E.click()},S=h.jsxs(h.Fragment,{children:[i!==null?h.jsx(bM,{inputRef:v,accept:i,onFiles:a,disabled:u,multiple:r}):null,f&&c?Ur.createPortal(h.jsx("div",{ref:w,className:`we-no-drag ${Ip} flex w-[calc(360*var(--frame))] flex-col gap-1.5 p-1.5`,style:g?{position:"fixed",...g,zIndex:Ei}:{position:"fixed",top:0,left:0,zIndex:Ei,opacity:0,pointerEvents:"none"},role:"dialog","aria-label":t,onClick:E=>E.stopPropagation(),children:h.jsx(wM,{add:{...e,onLink:c},onBrowse:k,onLinked:_})}),document.body):null]});return{start:()=>{c?f?_():p(!0):k()},...c?{expanded:f}:{},node:S}}function eB({add:e,intake:t,trigger:n}){const r=x.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 tB="relative cursor-grab touch-none select-none",nB="relative grid grid-cols-[repeat(auto-fill,minmax(calc(150*var(--frame)),1fr))] gap-2.5",rB={compact:"flex flex-col gap-2.5",large:"flex flex-col gap-3"},lE=new Set;function pw(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 Pl(e,t,n,r,i){const a=new Set(t.map(p=>p.id)),c=e.filter(p=>{const g=n(p.value);return g===null||a.has(g)}),u=new Set(c.map(p=>n(p.value)));return[...t.filter(p=>!u.has(p.id)).map(p=>i(r(p))),...c]}function mw({engine:e,label:t,noun:n,size:r,onAdd:i,add:a,choose:c,renderTile:u,tileActions:f,onRemove:p,children:g}){const{rows:m,canAdd:w,canRemove:v}=e,{containerRef:_,getItemProps:k}=e.drag,[S,E]=x.useState(lE),O=m.filter(F=>S.has(F.key)),A=O.map(F=>F.key),R=F=>E(W=>{const G=new Set(W);return G.has(F)?G.delete(F):G.add(F),G}),C=()=>E(lE),I=F=>{p?p(F):e.removeMany(F.map(W=>W.key)),C()},$=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=w?h.jsx(id,{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(eB,{add:a,intake:i.intake,trigger:F=>h.jsx(Lh,{add:a,size:r,...F})})}:{},choose:c}):null;return h.jsxs("div",{className:$s,children:[h.jsxs("div",{className:rB[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:nB,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=$(F),H={selected:S.has(F.key),onToggleSelect:()=>R(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:tB,children:u(F,W,H)},F.key)})})})]}),g]})}const oB="data-drag-clone",cE="0 16px 38px -8px rgba(20,18,13,0.5)",iB=["id","for","name","data-dragid","data-drag-scope"];function uh(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 sB(e){for(let t=e;t;t=t.parentElement){const n=getComputedStyle(t).backgroundColor;if(uh(n))return n}return"#fff"}function uE(e){for(let t=e;t;){const n=getComputedStyle(t).borderRadius;if(aB(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 aB(e){return e!==""&&!/^(0(px)?\s*)+$/.test(e)}function lB(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 iB)i.removeAttribute(a);return t.setAttribute(oB,""),t.setAttribute("aria-hidden","true"),t.inert=!0,t}function cB(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 kM="data-drag-scope";function Iy(e){return Array.from(e.querySelectorAll("[data-dragid]")).filter(t=>t.closest(`[${kM}]`)===e)}function uB(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 dE=190,fE=220,Uy="cubic-bezier(.2,.7,.3,1)",dB="0.4",fB="0",hB="1",pB="2",mB="60",Bh="data-drag-active",hE="hp-drag-reorder-active",gB=`html[${Bh}], html[${Bh}] * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }`;function Py(e){const t=document.documentElement;if(!e){t.removeAttribute(Bh);return}if(!document.getElementById(hE)){const n=document.createElement("style");n.id=hE,n.textContent=gB,document.head.appendChild(n)}t.setAttribute(Bh,"")}function pE(e){return!e||typeof e.animate!="function"?!1:!(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}function yB(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 bB="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 vB(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 wB(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 _M({items:e,getKey:t,onReorder:n,onDrop:r,axis:i="xy",threshold:a=4,ignoreSelector:c=".we-no-drag"}){const[u,f]=x.useState(null),p=x.useRef(null),g=x.useRef({}),m=x.useRef({grabX:0,grabY:0,scale:1,originLeft:0}),w=x.useRef({x:0,y:0}),v=x.useRef(null),_=x.useRef(null),k=x.useRef(null),S=x.useRef(null),E=x.useRef("#fff"),O=x.useRef(new Set),A=x.useRef(new Map),R=x.useRef(new WeakMap),C=x.useRef(null),I=x.useRef(null),$=x.useRef(e),T=x.useRef(t),F=x.useRef({onReorder:n,onDrop:r});x.useLayoutEffect(()=>{F.current={onReorder:n,onDrop:r}}),x.useEffect(()=>()=>{var te;const D=C.current;C.current=null,D&&F.current.onDrop(D);const Z=I.current;Z&&(window.removeEventListener("pointermove",Z.move),window.removeEventListener("pointerup",Z.end),window.removeEventListener("pointercancel",Z.end)),(te=S.current)==null||te.remove(),k.current&&Py(!1)},[]);function W(D){const Z=D.getBoundingClientRect(),te=m.current.scale||1;return{x:(w.current.x-Z.left)/te-D.clientLeft,y:(w.current.y-Z.top)/te-D.clientTop}}function G(){const D=S.current,Z=p.current;if(!D||!Z)return;const te=W(Z);D.style.left=`${i==="y"?m.current.originLeft:te.x-m.current.grabX}px`,D.style.top=`${te.y-m.current.grabY}px`}function H(){const D=p.current,{x:Z,y:te}=W(D),de=$.current;let fe=0,pe=1/0;return Iy(D).forEach(P=>{const ce=de.findIndex(Ie=>T.current(Ie)===P.dataset.dragid);if(ce<0)return;const me=P.offsetLeft+P.offsetWidth/2,Se=P.offsetTop+P.offsetHeight/2,$e=(Z-me)**2+(te-Se)**2;$e<pe&&(pe=$e,fe=ce)}),Math.max(0,Math.min(de.length-1,fe))}function U(D,Z,te){const de=!A.current.has(D),fe=A.current.get(D)??{position:D.style.position,zIndex:D.style.zIndex,opacity:D.style.opacity,borderRadius:D.style.borderRadius};A.current.set(D,fe),getComputedStyle(D).position==="static"&&(D.style.position="relative"),de&&(D.style.borderRadius=uE(D)??fe.borderRadius),D.style.zIndex=Z,D.style.opacity=te?dB:fe.opacity,te?D.setAttribute("data-ghost",""):D.removeAttribute("data-ghost")}function z(D){const Z=A.current.get(D);Z&&(D.style.position=Z.position,D.style.zIndex=Z.zIndex,D.style.opacity=Z.opacity,D.style.borderRadius=Z.borderRadius,D.removeAttribute("data-ghost"),A.current.delete(D))}function K(D,Z){var P;E.current=sB(D);const te=getComputedStyle(Z).backgroundColor,de=uE(Z),fe=lB(Z);de&&(fe.style.borderRadius=de),Object.assign(fe.style,{position:"absolute",left:"0px",top:"0px",width:`${Z.offsetWidth}px`,margin:"0",zIndex:mB,pointerEvents:"none",transform:"none",opacity:"1",transition:"none",animation:"none",boxShadow:cE,backgroundColor:uh(te)?te:E.current}),m.current.originLeft=Z.offsetLeft;const pe=((P=_.current)==null?void 0:P.length)??1;if(pe>1){const ce=document.createElement("span");ce.className=bB,ce.textContent=String(pe),fe.appendChild(ce)}D.appendChild(fe),S.current=fe}function N(D,Z,te,de){if(Z.left===te.left&&Z.top===te.top)return;const fe=R.current.get(D),pe=(fe==null?void 0:fe.playState)==="running"?uB(getComputedStyle(D).transform):{x:0,y:0};fe==null||fe.cancel();const P=Z.left+pe.x-te.left,ce=Z.top+pe.y-te.top;if(!P&&!ce)return;R.current.set(D,D.animate([{transform:`translate(${P}px,${ce}px)`},{transform:"none"}],{duration:dE,easing:Uy}));const me=E.current;de&&!uh(getComputedStyle(D).backgroundColor)&&D.animate([{backgroundColor:me},{backgroundColor:me}],{duration:dE})}function B(D,Z,te){var Se;(Se=R.current.get(D))==null||Se.cancel();const de=Z.left-te.left,fe=Z.top-te.top;if(!de&&!fe)return;const pe=getComputedStyle(D),P=uh(pe.backgroundColor)?pe.backgroundColor:E.current;U(D,pB,!1);const ce=D.animate([{transform:`translate(${de}px,${fe}px)`},{transform:"none"}],{duration:fE,easing:Uy});D.animate([{boxShadow:cE,backgroundColor:P},{boxShadow:pe.boxShadow,backgroundColor:P}],{duration:fE,easing:Uy}),R.current.set(D,ce);const me=()=>{k.current||z(D)};ce.onfinish=me,ce.oncancel=me}x.useLayoutEffect(()=>{const D=p.current;if(!D)return;D.setAttribute(kM,"");const Z=k.current,te=O.current;O.current=new Set;const de=Iy(D);if(Z&&!S.current){const ce=de.find(me=>me.dataset.dragid===Z);ce&&K(D,ce)}if(!Z)for(const ce of[...A.current.keys()])z(ce);const fe=pE(D),pe=g.current,P={};de.forEach(ce=>{const me=ce.dataset.dragid,Se={left:ce.offsetLeft,top:ce.offsetTop};P[me]=Se,Z&&U(ce,me===Z?fB:hB,me===Z);const $e=pe[me];!$e||!fe||(te.has(me)?B(ce,$e,Se):N(ce,$e,Se,Z!==null&&me!==Z))}),g.current=P,Z&&G()});function Y(){const D=C.current;C.current=null,D&&F.current.onDrop(D)}function ie(D,Z,te){var me,Se,$e,Ie,xe;Y();const de=p.current,fe=Iy(de).find(Le=>Le.dataset.dragid===D)??null;if(!fe)return;const pe=fe.getBoundingClientRect(),P=de.getBoundingClientRect().width/de.offsetWidth||1;m.current={grabX:(te.clientX-pe.left)/P,grabY:(te.clientY-pe.top)/P,scale:P,originLeft:fe.offsetLeft},(Se=(me=document.activeElement)==null?void 0:me.blur)==null||Se.call(me),(xe=(Ie=($e=window.getSelection)==null?void 0:$e.call(window))==null?void 0:Ie.removeAllRanges)==null||xe.call(Ie),Py(!0),w.current={x:te.clientX,y:te.clientY},$.current=e,T.current=t,_.current=null;let ce=D;if(Z&&Z.length>1&&Z.includes(D)){const{collapsed:Le,members:ne}=vB(e,t,new Set(Z)),be=ne[0];ne.length>1&&be!==void 0&&(_.current=ne,ce=t(be),$.current=Le,F.current.onReorder(Le))}k.current=ce,f(ce)}function J(D,Z,te){D.button===0&&(D.target.closest(c)||(v.current={key:Z,x:D.clientX,y:D.clientY,group:te},I.current={move:L,end:Q},window.addEventListener("pointermove",L),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q)))}function L(D){const Z=v.current;if(!Z)return;if(!k.current){if(Math.hypot(D.clientX-Z.x,D.clientY-Z.y)<a)return;ie(Z.key,Z.group,D)}w.current={x:D.clientX,y:D.clientY},G();const te=H(),de=$.current,fe=de.findIndex(P=>T.current(P)===k.current);if(fe<0||fe===te)return;const pe=cB(de,fe,te);$.current=pe,F.current.onReorder(pe)}function Q(){window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q),I.current=null,v.current=null;const D=k.current;if(!D)return;const Z=_.current;_.current=null;const te=Z?Z.map(fe=>T.current(fe)):[D];if(Z){const fe=wB($.current,Z);$.current=fe,F.current.onReorder(fe)}const de=S.current;if(de){for(const fe of te)g.current[fe]={left:de.offsetLeft,top:de.offsetTop};O.current=new Set(te),de.remove(),S.current=null}yB(p.current),k.current=null,Py(!1),f(null),C.current=$.current,pE(p.current)?requestAnimationFrame(()=>setTimeout(Y,0)):Y()}return{containerRef:p,getItemProps:(D,Z)=>({"data-dragid":D,onPointerDown:te=>J(te,D,Z)}),draggingKey:u}}let xB=0;function kB(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`li-${(xB++).toString(36)}`}function Hh(e,t){return{key:(t==null?void 0:t(e))??kB(),value:e}}function _B(e,t){return e.map(n=>Hh(n,t))}function SB(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}:Hh(r,n)})}function Fy(e){return JSON.stringify(e)}function $i({items:e,identityOf:t,fixed:n=!1,axis:r="y",commit:i,onCommitted:a}){const[c,u]=x.useState(()=>_B(e,t)),[f,p]=x.useState(()=>Fy(e)),g=x.useRef(c);x.useEffect(()=>{g.current=c},[c]);function m(S){g.current=S,u(S)}function w(S,E){m(S),p(Fy(S.map(O=>O.value))),i(S,E),a==null||a(S,E)}const v=_M({items:c,getKey:S=>S.key,onReorder:m,onDrop:S=>w(S,"reorder"),axis:r,threshold:5});if(!v.draggingKey){const S=Fy(e);S!==f&&(p(S),u(SB(c,e,t)))}function _(S,E){const O=g.current;O.some(A=>A.key===S)&&w(O.map(A=>A.key===S?{...A,value:E(A.value)}:A),"edit")}function k(S,E=0){if(n)return;const O=g.current,A=Math.min(Math.max(E,0),O.length);w([...O.slice(0,A),S,...O.slice(A)],"add")}return{rows:c,drag:v,canAdd:!n,canRemove:!n,add:(S,E)=>k(Hh(S,t),E),insert:k,remove:S=>{n||w(g.current.filter(E=>E.key!==S),"remove")},removeMany:S=>{const E=g.current,O=E.filter(A=>!S.includes(A.key));n||O.length===E.length||w(O,"remove")},setValue:(S,E)=>_(S,()=>E),updateValue:_,replace:S=>w(S,"replace"),mint:S=>Hh(S,t),indexOf:S=>c.findIndex(E=>E.key===S),keyAt:S=>{var E;return((E=c[S])==null?void 0:E.key)??null},latestRows:()=>g.current}}function zi(e,t,n,r){return e.isEmpty(n)?r?"required":null:e.isInvalid(n,t)?"invalid":null}const EB={failed:"Crop failed. The image is unchanged. Try cropping again."};function SM(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 gw({storeKey:e="",holderPath:t,mediaId:n,cropped:r,cropFailedAt:i,className:a}){const c=QI(e),u=su(k=>k.clearNotice),f=su(k=>k.dismissFailure),p=R7(),g=i??p,m=!r||t===void 0||n===""?null:(g==null?void 0:g(t,n))??null,w=m===null?null:YI(t,n,m),v=su(k=>w!==null&&k.dismissedFailures[w]===!0),_=c??(w!==null&&!v?"failed":void 0);return _?h.jsxs("p",{role:"alert","data-crop-notice":_,className:le(Dl,"flex items-center justify-between gap-2",a),onClick:k=>k.stopPropagation(),onDoubleClick:k=>k.stopPropagation(),children:[h.jsx("span",{children:EB[_]}),h.jsx("button",{type:"button",className:le(kt,"shrink-0 underline"),onClick:()=>{u(e),w!==null&&f(w)},children:"Dismiss"})]}):null}function Dn(e){if(typeof e!="object"||e===null)return null;const t=iL(e)??Qn(e);return t===void 0||t===""?null:t}function cd(e){const t=Dn(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 bl(e){if(typeof e!="object"||e===null)return;const t=e.picked;return typeof t=="string"||t===null?t:jo(e)?e.media:void 0}function zr(e){if(typeof e!="object"||e===null)return!1;const t=e;return["file","media"].some(n=>typeof t[n]=="string")||Qn(e)!==void 0}function EM(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const t=cd(e),n=bl(e);if(t!==null)return{file:t,...n===void 0?{}:{picked:n}}}return{file:""}}function jB(e){return e.map(EM).filter(t=>t.file!=="")}function jM(e){switch(e.kind){case"document":return aM(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 OB(e){return[jM(e).typeNoun,e.size].filter(Boolean).join(" · ")}function AB(e){const t=Ul(e);return n=>{const r=t.get(n);return r===void 0?void 0:uM(r)}}const CB={page:"expanded",panel:"compact",cell:"compact"};function NB(e){return CB[e]}const OM=x.createContext(null);function ud({place:e,children:t}){return h.jsx(OM.Provider,{value:e,children:t})}function yw(){const e=x.useContext(OM);if(e===null)throw new Error("[slot-editors] a slot editor was drawn outside a place: its container mounts <SlotPlaceProvider>.");return e}const AM=x.createContext(!1);function MB({shown:e,children:t}){return h.jsx(AM.Provider,{value:e,children:t})}function Fl(){return x.useContext(AM)}const RB=le("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)]",Ll),TB="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",$B=le("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)]",Ll),CM={"data-card-fields":""},zB="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",DB={page:{frame:le($s,"gap-1.5"),shell:RB,inner:TB,adornEnd:"pr-3.5",multiline:"resize-none leading-[1.5]",inline:!1},panel:{frame:$s,shell:le(k7,Ll),inner:_7,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:$B,inner:zB,adornEnd:"pr-2.5",multiline:"resize-none overflow-hidden whitespace-nowrap",inline:!0}};function Di(){return NM(yw())}function NM(e){return{place:e,...DB[e]}}function LB({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)?ZN:"text-ink-4"}}const IB=le("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"),UB="pointer-events-none absolute inset-y-0 right-0 flex items-center",PB=le("flex h-0 basis-full items-end justify-end overflow-hidden","transition-[height] duration-200 ease-out motion-reduce:transition-none"),FB={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 Ds({attention:e,count:t,className:n,ref:r,children:i}){const a=Di(),c=Fl(),[u,f]=x.useState(!1),p=t!==void 0&&!a.inline,g=p&&u?LB(t):null,m=p&&t.multiline,w=g!==null&&h.jsxs("span",{"data-field-count":"",className:le(VN,g.tone,"leading-none transition-[opacity,transform] duration-200 ease-out starting:translate-y-1 starting:opacity-0 motion-reduce:transition-none"),children:[g.left,h.jsx("span",{className:"sr-only",children:" characters left"})]});return h.jsxs("div",{ref:r,className:le(a.shell,p&&IB,n),...Il(e,c),"data-count-room":p?m?"band":"end":void 0,"data-count-open":g!==null?"":void 0,onFocus:p?()=>f(!0):void 0,onBlur:p?()=>f(!1):void 0,children:[i,m?h.jsx("div",{className:le(PB,FB[a.place],a.adornEnd),"data-open":g!==null?"":void 0,children:w}):g!==null&&h.jsx("div",{className:le(UB,a.adornEnd),children:w})]})}function MM({attention:e,message:t}){const n=Di();return e!=="invalid"||n.inline?null:h.jsx("p",{className:Dl,children:t})}const RM="h-[var(--list-display-h,clamp(280px,calc(100cqh-var(--list-display-clear,32px)),calc(560*var(--frame))))]",Bl="h-[var(--list-display-h,clamp(280px,calc(100cqh-var(--list-display-clear,32px)),calc(480*var(--frame))))]",bw="data-upstream:opacity-55 data-upstream:hover:opacity-100 data-upstream:focus-within:opacity-100",BB="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)]",TM="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))]",HB=`${TM} text-ink-2 hover:bg-accent-soft hover:text-ink`,$M="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)]",zM="select-none";function qB(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}),au(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 DM({file:e,handlers:t,shown:n=!1}){return h.jsx(IM,{name:e.name,actions:qB(e,t),shown:n})}function LM(e){return{plain:e.filter(t=>!t.foot&&!t.danger),foot:[...e.filter(t=>t.foot&&!t.danger),...e.filter(t=>t.danger)]}}const mE=4;function IM({name:e,actions:t,shown:n=!1,scale:r="card"}){const[i,a]=x.useState(!1),c=x.useRef(null),u=x.useRef(null),f=x.useRef(null),[p,g]=x.useState(null),m=x.useCallback(()=>{a(!1),g(null)},[]);ld(c,i,m,f),x.useLayoutEffect(()=>{if(!i)return;const k=()=>{const S=u.current,E=f.current;if(!S||!E)return;const O=Cs(S),A=E.offsetHeight,R=Ml(O,{height:A,maxHeight:A,gap:mE});if(!R){g(null);return}const C=document.documentElement.clientWidth-O.rect.right;if(R.maxHeight>=A){g({top:R.top,bottom:R.bottom,right:C});return}const{rect:I,bounds:$}=O,T=$.bottom-ls-A,F=Math.max($.top+ls,Math.min(I.bottom+mE,T));g({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:w,foot:v}=LM(t),_=k=>h.jsxs("button",{type:"button",role:"menuitem",className:k.danger?`${TM} text-danger hover:bg-accent-soft`:HB,onClick:()=>{m(),k.onSelect()},children:[h.jsx(ot,{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(ot,{name:"dots",size:r==="compact"?13:14})}),i?Ur.createPortal(h.jsxs("div",{ref:f,className:`we-no-drag ${BB} w-[calc(188*var(--frame))] p-1.25`,style:p?{position:"fixed",...p,zIndex:Ei}:{position:"fixed",top:0,right:0,zIndex:Ei,visibility:"hidden"},role:"menu",onClick:k=>k.stopPropagation(),onDoubleClick:k=>k.stopPropagation(),children:[w.map(_),v.length>0?h.jsxs(h.Fragment,{children:[w.length>0?h.jsx("div",{className:"mx-0 my-1 h-px bg-line-soft"}):null,v.map(_)]}):null]}),document.body):null]})}function UM({name:e,onCommit:t}){const[n,r]=x.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 PM(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 _s={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"}},VB="we-no-drag flex cursor-auto flex-col gap-2 px-2 pt-2";function FM({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(ot,{name:"file",size:c?13:16})}):h.jsx(zs,{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(ot,{name:"check",size:c?10:12,stroke:2.6})})]})}function ZB({file:e,selected:t,renaming:n,onClick:r,onDoubleClick:i,onToggleSelect:a,select:c,listChip:u,onRetry:f,onRecheck:p,onRenameCommit:g,handlers:m,drag:w,beneath:v,notice:_}){return h.jsxs("div",{...w,role:"option","aria-selected":t,"aria-disabled":c.disabled||void 0,"data-upstream":e.upstream||void 0,tabIndex:0,className:`${PM(t)} ${bw} ${w?zM:""}`,onClick:r,onDoubleClick:i,onKeyDown:k=>{k.target===k.currentTarget&&k.key==="Enter"&&(k.stopPropagation(),m.onPreview())},children:[h.jsxs("div",{className:_s.card.bar,children:[h.jsx(FM,{kind:e.kind,name:e.name,selected:t,select:c,onToggleSelect:a}),n?h.jsx(UM,{name:e.name,onCommit:g}):h.jsx("span",{className:_s.card.name,title:e.name,children:e.name}),h.jsx(DM,{file:e,handlers:m,shown:!0})]}),h.jsxs("div",{className:_s.card.thumb,children:[h.jsx(fw,{file:e}),h.jsx(yM,{file:e,onRetry:f,onRecheck:p}),u!==null?h.jsx("span",{className:`absolute right-2 top-2 z-[3] max-w-[calc(100%-16px)] ${$M}`,"data-list-chip":"",children:u}):null]}),v?h.jsx("div",{className:VB,...CM,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:UF(e)})})]})}function KB(){return h.jsxs("div",{className:`flex flex-col rounded-2xl ${aw}`,children:[h.jsxs("div",{className:_s.card.bar,children:[h.jsx("span",{className:`h-4.5 w-4.5 shrink-0 rounded-md ${$n}`}),h.jsx("span",{className:"min-w-0 flex-1",children:h.jsx("span",{className:`block h-2.5 w-3/5 rounded-full ${$n}`})}),h.jsx("span",{className:`mr-1.5 h-1.5 w-4 shrink-0 rounded-full ${$n}`})]}),h.jsx("div",{className:le(_s.card.thumb,$n)}),h.jsx("div",{className:"flex h-11 items-center px-3.5",children:h.jsx("span",{className:`h-2 w-2/5 rounded-full ${$n}`})})]})}const BM="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",gE="flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[length:calc(11.5*var(--content))] font-medium";function GB(){return h.jsxs("div",{role:"row",className:`${BM} 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 YB({file:e,onRetry:t,onRecheck:n}){return e.state==="failed"?h.jsxs("span",{className:`${gE} 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:`${gE} text-warn`,title:iv,children:[gM,n?h.jsx("button",{type:"button",className:"font-semibold text-ink underline",onClick:r=>{r.stopPropagation(),n()},children:"Re-check"}):null]}):null}function QB({file:e,selected:t,renaming:n,onClick:r,onDoubleClick:i,onToggleSelect:a,select:c,listChip:u,onRetry:f,onRecheck:p,onRenameCommit:g,handlers:m,drag:w}){return h.jsxs("div",{...w,role:"row","aria-selected":t,"aria-disabled":c.disabled||void 0,"data-upstream":e.upstream||void 0,className:`group ${BM} ${bw} 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]"} ${w?zM:""}`,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(ot,{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(fw,{file:e,face:"row"}),h.jsx(yM,{file:e,compact:!0})]}),h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n?h.jsx(UM,{name:e.name,onCommit:g}):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(YB,{file:e,onRetry:f,onRecheck:p}),u!==null?h.jsx("span",{className:`shrink-0 ${$M}`,"data-list-chip":"",children:u}):null]}),h.jsx("span",{className:"inline-flex",children:h.jsx(mM,{file:e})}),h.jsx("span",{className:"whitespace-nowrap text-xs text-ink-3",children:hM(e.bytes)}),h.jsx("span",{className:"whitespace-nowrap text-xs text-ink-3",children:pM(e.addedAt)}),h.jsx(DM,{file:e,handlers:m})]})}const XB={control:"checkbox",disabled:!1},{bar:WB,name:JB,thumb:eH}=_s.compact,tH="we-no-drag flex cursor-auto flex-col gap-1.5 px-1.5 pt-1.5";function nH({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:PM(c,"compact"),onClick:u,onKeyDown:p=>{p.target===p.currentTarget&&(p.key===" "||p.key==="Enter")&&(p.preventDefault(),u())},children:[h.jsxs("div",{className:WB,children:[h.jsx(FM,{kind:e,name:t,selected:c,select:XB,onToggleSelect:u,scale:"compact"}),h.jsx("span",{className:JB,title:t,children:t}),f.length>0&&h.jsx(IM,{name:t,actions:f,shown:!0,scale:"compact"})]}),h.jsx("div",{className:eH,"data-thumb":!0,"data-media-tile":e,children:r}),i,a?h.jsx("div",{className:tH,...CM,onClick:p=>p.stopPropagation(),children:a}):null,h.jsx("div",{className:"h-1.5"})]})}function vw(e,t){const n=e!=null&&e.cut?e.derivativeUrl:t,[r,i]=x.useState(n);return n!==void 0&&n!==r&&i(n),n??r??t}const ww="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)]",rH="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",oH=le(ww,rH),iH="max-h-[min(calc(100vh-120px),max(680px,72vh))] w-[clamp(560px,38vw,960px)] max-w-full max-md:w-full",HM="px-[clamp(18px,1.4vw,40px)]",xw="px-[clamp(20px,1.75vw,36px)]",sH=le("flex flex-shrink-0 items-center gap-[14px] pb-3 pt-[clamp(18px,1.6vw,30px)]",xw),aH=le("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",xw),kw="mr-auto flex min-w-0 flex-col gap-0.5",_w="m-0 text-[16px] font-semibold tracking-[-0.01em]",lH="text-[12px] text-ink-3",Sw=le(kt,"grid size-8 flex-shrink-0 place-items-center rounded-[8px] text-ink-3 hover:bg-[#f1f0ea] hover:text-ink"),qM="px-[18px] py-[13px]",cH=le("flex flex-shrink-0 items-center gap-[14px]",qM),uH=le("flex flex-shrink-0 items-center justify-between gap-3 border-t border-line-soft",qM),dH="ml-auto flex gap-2",VM=le(kt,"inline-flex h-9 items-center gap-1.5 rounded-[9px] border border-transparent px-4 text-[13px] font-semibold"),fH=le(VM,"border-line bg-white text-ink hover:bg-[#faf9f6]"),hH=le(VM,"border-honey-2 bg-honey text-honey-ink hover:bg-honey-2 disabled:cursor-default disabled:opacity-45"),pH=le(kt,"inline-flex h-9 items-center px-1 font-medium text-ink-2 hover:text-ink"),mH={page:"max-w-[920px]",crop:"max-w-[680px]"};function gH({open:e=!0,variant:t,onClose:n,children:r}){return h.jsx(sw,{open:e,onClose:n,className:le(ww,mH[t]),children:r})}const Ew={Shell:gH,head:cH,titles:kw,title:_w,subtitle:lH,close:Sw,CloseIcon:zt.x,foot:uH,actions:dH,buttonGhost:fH,buttonPrimary:hH,buttonLink:pH,ZoomOutIcon:zt.minus,ZoomInIcon:zt.plus},yE=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function dh(e){return e.slice(e.indexOf(".")+1)}function ZM(e,t){let n=e;for(const r of t.holder.split("."))Array.isArray(n)?n=n.find(i=>yE(i)&&i.id===r):n=yE(n)?n[r]:void 0;return Array.isArray(n)?n.find(r=>Qn(r)===t.mediaId):Qn(n)===t.mediaId?n:void 0}function yH(e,t,n){if(e===void 0)return;const r=ZM(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=jo(r)?wp(i,r):i;return m0(a,c)}function KM(e,t,n){const r=ZM(e,n),i=t.get(n.mediaId);if(!jo(r)||i===void 0)return!1;const a=wp(i,r);return Ts(a.crop,i.crop)&&(i.renditions.crop===null||a.renditions.crop!==null)}const bH=16/10;function bE(e,t){return e.state==="failed"?!0:!Ts(e.crop,t)||lM(e)?!1:!Hs(t)||e.renditions.crop!==null}function GM({propertyId:e,recordAt:t,inheritsCrop:n,write:r,onFailed:i,onArrived:a}){const c=eu(v=>v.byPlace),[u,f]=x.useState(null),p=v=>{const _=t(v),k=c[po(v)];return k!==void 0?_===void 0||!bE(_,k.crop):_!==void 0&&lM(_)};x.useEffect(()=>{const v=Object.values(c).filter(_=>{const k=_.propertyId===e?t(_.place):void 0;return k!==void 0&&bE(k,_.crop)});if(v.length!==0){for(const _ of v)eu.getState().settle(_.place);a==null||a()}},[c,t,e,a]);const g=async(v,_,k)=>{if(f(null),r===void 0)return;const S=Tb(k);if(!Ts(S,_.crop)){eu.getState().start(v,e,S);try{await r(v,pl(S))}catch(E){eu.getState().settle(v),i==null||i(v),console.error("[media] home crop failed",{place:v,err:E})}}},m=u===null?void 0:t(u),w=(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&&w!==null,recropping:p,cropped:v=>{var _;return!n(v)&&Hs(((_=t(v))==null?void 0:_.crop)??null)},modal:u!==null&&m!==void 0&&w!==null?h.jsx(P0,{chrome:Ew,src:w,mode:"free",aspect:bH,seed:{rect:pl(m.crop)},onClose:()=>f(null),onApply:v=>void g(u,m,v.rect)}):null}}const vH=1500;function wH(e){const t=Fp(e===""?null:e);return x.useMemo(()=>{const n=t===void 0?new Map:Rl(t);return{recordAt:r=>yH(t,n,r),inheritsCrop:r=>t!==void 0&&KM(t,n,r)}},[t])}function YM(e,t){const n=uw(),r=No(),{recordAt:i,inheritsCrop:a}=wH(e),{cropMedia:c}=n,u=x.useMemo(()=>c===void 0?void 0:async(w,v)=>{await c(e,w.mediaId,v,w.holder),await rv(r,n,e)},[c,e,r,n]),f=x.useMemo(()=>()=>void rv(r,n,e),[r,n,e]),p=GM({propertyId:e,recordAt:i,inheritsCrop:a,write:u,onFailed:t,onArrived:f}),g=eu(w=>w.byPlace),m=Object.values(g).some(w=>w.propertyId===e&&p.recropping(w.place));return zn({...n.mediaFactsQuery(e),enabled:e!==""&&m,refetchInterval:m?vH:!1}),p}function QM(e,t){var i;const n=Tb(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:Tb(t.mobile.rect),derived:t.mobile.derived,...r}:e.mobile??null}}function XM(e,t){return e.crop?Hs(e.crop):(t==null?void 0:t.mode)!=="locked"?!1:WM(e,t.aspect)}function WM(e,t){return typeof e.ar!="number"||HC(e.ar,t)!==null}function JM(e,t){var n;return XM(e,t)?!0:(n=e.mobile)!=null&&n.crop?Hs(e.mobile.crop):t.mode==="locked"&&t.mobileAspect!==void 0&&WM(e,t.mobileAspect)}function sv(e,t){var i,a,c,u;if(!XM(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 vl(e){var t;return((t=e.renditions.cutout)==null?void 0:t.url)??Uh(e)??""}function jw(e,t,n,r,i){const a=vl(e);if(e.file===t.file)return{...t,url:a};const c=n===void 0?void 0:B8(n,i,e.id);return c===void 0||n===void 0?{file:e.file,url:a,alt:t.alt,picked:e.id}:{...H8(c,xH(n.files[c.file]),r),url:a,alt:t.alt}}const eR={New:nd,Choose:MN,Upload:zp};function _u(e,t){return`${e} ${t}`}function Ow(e,t,n){const r=Ir(t),i=n&&e==="New"?r.singular:r.plural;return{verb:e,icon:eR[e],label:_u(e,i),empty:`No ${r.plural} yet`}}function kH(e,t,n,r){const i=n.flatMap(c=>{const u=tR(c,r);return u===null?[]:[Ir(u)[t?"plural":"singular"]]}),a=Ow("Choose",e,t);return i.length===0?a:{...a,label:_u("Choose",[...new Set(i)].join(" or "))}}const _H={property:"Property",library:"Library"};function tR(e,t){if(!/^(?:property|library)\./.test(e))return null;const n=Ch(e);if(n===null)return null;const{home:r}=_o(e);return r===t?n:`${_H[r]} ${n.charAt(0).toLowerCase()}${n.slice(1)}`}function Bp(e,t={}){return e.locked===!0||!SH(e)?null:Aw(e,t)}function SH(e){const t=e.type;return t==="list"||t==="row"||xo(e.type)}function Aw(e,t={}){const n=e.type==="list",r=jH(e,t);return{add:Ow(!n&&xo(e.type)?"Upload":"New",e.label,n),choose:r===null?null:kH(e.label,n,r.lists,r.home)}}function EH(e){const[t]=e,n=e.length===1&&t!==void 0?Ch(t)??void 0:void 0;return Ow("New",n,!0)}function nR(e){return e.choose??e.add}function jH(e,t){const n=AH(e,t.table);if(n!==null&&Ms(n).length>0){const a=Ms(n)[1];return a===void 0?null:{lists:[a],home:_o(n).home}}const r=OH(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=>dl(c)):us(i.filter.from);return{lists:r!==null&&r.length>0?r:a,home:"property"}}return r===null?null:{lists:r,home:"property"}}function OH(e,t){if(e.type==="list")return e.element===void 0?null:NH(e.element);if(e.type==="row")return us(e.from);if(!xo(e.type))return null;const n=hl(e,t.table);return(n==null?void 0:n.kind)==="picked"?us(n.filter.from):null}function us(e){return Sp({from:e}).filter(t=>/^(?:property|library)\./.test(t))}function AH(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:`${dl(t)}.${CH}.${r}`}const CH="_";function NH(e){const t=e.fields??{};if(xC(e)!==void 0)return e.from!==void 0?us(e.from):Object.values(t).flatMap(i=>us(i.from));if(e.type!=="object")return null;const n=uC(e);if((n==null?void 0:n.type)==="row"&&n.from!==void 0)return us(n.from);if(!N0(t))return null;const r=Object.values(t).filter(i=>xo(i.type)&&i.locked!==!0&&i.from!==void 0);return r.length===0?null:r.flatMap(i=>us(i.from))}const Cw={image:"image/*",video:"video/*",tour:null,document:aF};function Nw(e){const t=e.flatMap(n=>Cw[n]??[]);return t.length===0?null:t.join(",")}function dd(e){return[...Nw(e)!==null?["file"]:[],...d0(e).length>0?["link"]:[]]}const MH=we("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"}]]),RH=we("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"fb-f"}]]),TH=we("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"}]]),$H=we("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"}]]),zH={home:QP,building:eP,apartments:nP,trendUp:s7,tag:r7,key:n9,template:i9,palette:T9,filePen:IP,library:a9,plug:U9,helpCircle:gP,lock:h9,creditCard:_P,settings:X9,power:B9,user:g7,plus:nd,globe:KP,image:$p,fileText:Tp,users:b7,eye:$N,eyeOff:zP,pulse:IU,search:rw,chart:lP,layout:DN,chevDown:Q0,chevRight:Rp,chevSelector:pP,pencil:ew,dots:RP,grip:W0,external:TN,copy:xP,trash:zl,archive:PU,sparkle:t7,arrowUp:YU,arrowDown:BU,arrowLeft:qU,arrowRight:ZU,undo:d7,redo:V9,logout:m9,check:Si,x:Dp,clock:bP,calendar:sP,mapPin:IN,userPlus:p7,mail:y9,phone:D9,share:J9,upload:zp,bookOpen:XU,newspaper:M9,presentation:tw,instagram:MH,facebook:RH,linkedin:TH,xLogo:$H};function At({name:e,size:t=18,stroke:n=2,fill:r,color:i,className:a,style:c}){const u=zH[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 Mw(){const e=x.useRef(0),t=x.useRef(!1),[n,r]=x.useState("idle"),[i,a]=x.useState(()=>Date.now()),c=x.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 DH(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 By="inline-flex flex-shrink-0 items-center gap-1.5 whitespace-nowrap p-1 text-[length:calc(12.5*var(--content))] font-medium";function Rw({status:e}){const[,t]=x.useReducer(n=>n+1,0);return x.useEffect(()=>{const n=setInterval(t,15e3);return()=>clearInterval(n)},[]),e.state==="saving"?h.jsxs("div",{className:le(By,"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:le(By,"text-ink-2"),children:[h.jsx(At,{name:"x",size:13,stroke:2.4,className:"text-danger"}),h.jsx("span",{children:"Not saved"})]}):h.jsxs("div",{className:le(By,"text-ink-3"),children:[h.jsx(At,{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:DH(e.savedAt)})]})]})}const rR=x.createContext(null);function Hp({status:e,children:t}){return h.jsx(rR.Provider,{value:e,children:t})}function oR(){const e=x.useContext(rR);return e===null?null:h.jsx(Rw,{status:e})}function Tw({open:e=!0,onClose:t,title:n,notice:r,children:i}){return h.jsxs(sw,{open:e,onClose:t,ariaLabel:n,className:oH,children:[h.jsxs("div",{className:sH,children:[h.jsx("div",{className:kw,children:h.jsx("h2",{className:le(_w,"truncate"),children:n})}),h.jsx(oR,{}),h.jsx("button",{type:"button",className:Sw,onClick:t,"aria-label":"Close",children:h.jsx(zt.x,{})})]}),r,h.jsx("div",{className:aH,children:i})]})}function LH(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=zn({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=JN(),u=e.ids.length;return Ur.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 Kf="grid h-8 w-8 place-items-center rounded-full text-white/85 hover:bg-white/[0.12] hover:text-white",vE="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 IH({file:e,index:t,total:n,onClose:r,onPrev:i,onNext:a,onDownload:c,onDelete:u,onCrop:f}){const p=e.thumbnailUrl!==null,g=JN();return Ur.createPortal(h.jsxs("div",{className:"fixed inset-0 flex flex-col bg-black/80",style:{zIndex:g},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(mM,{file:e}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[f?h.jsx("button",{type:"button",className:Kf,title:"Crop","aria-label":`Crop ${e.name}`,onClick:m=>{m.stopPropagation(),f()},children:h.jsx(ot,{name:"crop",size:15})}):null,c&&!au(e)?h.jsx("button",{type:"button",className:Kf,title:"Download",onClick:m=>{m.stopPropagation(),c()},children:h.jsx(ot,{name:"down",size:15})}):null,u?h.jsx("button",{type:"button",className:Kf,title:"Delete",onClick:m=>{m.stopPropagation(),u()},children:h.jsx(ot,{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:Kf,title:"Close","aria-label":"Close preview",onClick:r,children:h.jsx(ot,{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:`${vE} left-5`,"aria-label":"Previous",onClick:m=>{m.stopPropagation(),i()},children:h.jsx(ot,{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(ot,{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(fw,{file:e,face:"lightbox"})}),n>1?h.jsx("button",{type:"button",className:`${vE} right-5`,"aria-label":"Next",onClick:m=>{m.stopPropagation(),a()},children:h.jsx(ot,{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 UH(e){return[{id:"all",label:"All"},...Ph.filter(t=>e.includes(t)).map(t=>({id:t,label:ad[t].plural}))]}const wE=[{id:"custom",label:"Custom"},{id:"date",label:"Date added"},{id:"name",label:"Name"},{id:"kind",label:"Kind"},{id:"size",label:"Size"}],PH="ml-auto inline-flex text-ink-3";function FH({filter:e,setFilter:t,counts:n,kinds:r}){const i=UH(r),[a,c]=x.useState(!1),u=x.useRef(null),f=x.useCallback(()=>c(!1),[]);ld(u,a,f);const p=e!=="all",g=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:`${lw} ${p?"border-accent bg-accent-soft text-accent-ink":cw}`,children:[e==="all"?null:h.jsx(zs,{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:g.label}),h.jsx("span",{className:`inline-flex ${p?"text-accent-ink":"text-ink-3"}`,children:h.jsx(ot,{name:"chevd",size:13})})]}),a?h.jsx("div",{className:`${Ip} 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:tM,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(ot,{name:"grid",size:13})}):h.jsx(zs,{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(ot,{name:"check",size:12,stroke:2.4})})]},m.id))}):null]})}function BH({sort:e,setSort:t}){var u;const[n,r]=x.useState(!1),i=x.useRef(null),a=x.useCallback(()=>r(!1),[]);ld(i,n,a);const c=((u=wE.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:`${lw} ${cw}`,"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(ot,{name:"chevd",size:13})})]}),n?h.jsx("div",{className:`${Ip} right-0 top-[calc(100%+6*var(--content))] w-[calc(170*var(--frame))] p-1.5`,role:"menu",children:wE.map(f=>h.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===f.id,className:tM,onClick:()=>{t(f.id),r(!1)},children:[f.label,e===f.id?h.jsx("span",{className:PH,children:h.jsx(ot,{name:"check",size:12,stroke:2.4})}):null]},f.id))}):null]})}function HH({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(ot,{name:"check",size:13,stroke:2.4}):null,h.jsx(ot,{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 qH({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:g=>g.stopPropagation(),children:[e,t,h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h.jsx(FH,{filter:n,setFilter:r,counts:i,kinds:a}),h.jsx(BH,{sort:c,setSort:u}),h.jsx(HH,{view:f,setView:p})]})]})}function VH({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(ot,{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(ot,{name:"down",size:13}),"Download"]}),r?h.jsxs("button",{type:"button",className:`${i} text-danger`,onClick:r,children:[h.jsx(ot,{name:"trash",size:13}),"Delete"]}):null]})}function qp(e,t,n=new Set){const r=e.includes(t);return{checked:r,disabled:!r&&n.has(t)}}function $w(e,t,n,r){const{checked:i,disabled:a}=qp(e,t,r);return n==="radio"?i||a?e:[t]:i?e.filter(c=>c!==t):a?e:[t,...e]}const xE="hp-uploads-view",ZH=new Set;function KH({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 GH=le(RM,"flex flex-col gap-3"),YH="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",QH=le(RM,"flex flex-col rounded-2xl border border-line bg-canvas items-center justify-center text-center text-body text-ink-3"),kE="grid grid-cols-[repeat(auto-fill,minmax(calc(200*var(--frame)),1fr))] gap-4 p-4",XH=8;function iR({filter:e,selection:t,host:n,beneathOf:r,tiers:i}){const{capabilities:a,preparing:c}=n,{kinds:u,from:f}=yu(e),p=x.useMemo(()=>{const se=new Map((i??[]).flatMap((Ee,Be)=>Ee.map(Xe=>[Xe,Be])));return Ee=>se.get(Ee)??0},[i]),g=(i==null?void 0:i.flat())??f,m=a.upload?Nw(u):null,w=(a.link??a.upload)&&d0(u).length>0,v=x.useRef(null),_=x.useRef(new Set),k=se=>{t.mode!=="all"&&(v.current??(v.current=Date.now())),n.addFiles(se)},S=se=>{t.mode!=="all"&&(v.current??(v.current=Date.now())),n.addLink(se)},E=EH(f),O=m!==null||w?{accept:m,onFiles:k,...w?{onLink:S}:{},disabled:c}:null,[A,R]=x.useState(()=>new Set),[C,I]=x.useState(()=>t.mode==="multi"?t.selectedIds:[]),[$,T]=x.useState("all"),[F,W]=x.useState("custom"),[G,H]=x.useState(null),[U,z]=x.useState(null),[K,N]=x.useState(()=>{if(typeof window>"u")return"grid";try{return window.localStorage.getItem(xE)==="list"?"list":"grid"}catch{return"grid"}}),[B,Y]=x.useState(null),[ie,J]=x.useState(null),[L,Q]=x.useState(!1),[D,Z]=x.useState(null),[te,de]=x.useState(null),fe=x.useRef(0),pe=x.useRef(null);x.useEffect(()=>{try{window.localStorage.setItem(xE,K)}catch{}},[K]),x.useEffect(()=>()=>{pe.current&&clearTimeout(pe.current)},[]);const P=x.useCallback(se=>{Z(se),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Z(null),2400)},[]),ce=x.useMemo(()=>new Map(n.items.flatMap(se=>gn(se)?[]:[[se.record.id,se.record]])),[n.items]),me=x.useMemo(()=>new Map(n.items.flatMap(se=>gn(se)?[]:[[po({holder:dh(se.list),mediaId:se.record.id}),se.record]])),[n.items]),Se=x.useCallback(se=>me.get(po(se)),[me]),$e=x.useMemo(()=>new Set(n.items.flatMap(se=>!gn(se)&&se.inheritsCrop===!0?[po({holder:dh(se.list),mediaId:se.record.id})]:[])),[n.items]),Ie=x.useCallback(se=>$e.has(po(se)),[$e]),xe=GM({propertyId:t.mode==="all"?n.scope:"",recordAt:Se,inheritsCrop:Ie,write:n.crop,onFailed:()=>P("Couldn't crop")}),Le=se=>({holder:dh(se.list),mediaId:se.id}),ne=se=>t.mode==="all"&&a.manage&&se.kind==="image"&&!se.inFlight&&xe.offers(Le(se))?{onCrop:()=>xe.open(Le(se))}:{},be=n.items.filter(se=>{const Ee=gn(se)?se.kind:se.record.kind;return g.includes(se.list)&&(Ee===null||u.includes(Ee))}).map(se=>RF(se,p)).map(se=>se.state==="ready"&&xe.recropping(Le(se))?{...se,state:"processing"}:se),Re=x.useMemo(()=>new Set(n.items.filter(gn).map(dM)),[n.items]),Pe=zF(be),ht=G===null?be:[...be].sort((se,Ee)=>G.indexOf(se.id)-G.indexOf(Ee.id)),Ke=$F(ht,$,F),[En]=f,ct=n.reorder,Wn=t.mode==="all"&&a.manage&&ct!==void 0&&F==="custom"&&f.length===1&&B===null,Jn=Wn?Ke.filter(se=>!se.inFlight):[],Nt=se=>{z(null);const Ee=se.map(He=>He.id),Be=ht.filter(He=>!He.inFlight).map(He=>He.id),Xe=pL(Be,Ee);ct===void 0||En===void 0||Xe.every((He,Er)=>He===Be[Er])||(H(Xe),ct(En,Ee).then(()=>H(null),()=>{H(null),P("Couldn't reorder")}))},{containerRef:ke,getItemProps:Ce}=_M({items:Jn,getKey:se=>se.id,onReorder:z,onDrop:Nt,axis:K==="list"?"y":"xy",threshold:5}),Ve=U===null?Ke:[...Ke.filter(se=>se.inFlight),...U],it=x.useCallback(()=>R(new Set),[]),Ye=x.useMemo(()=>t.mode==="all"?ZH:new Set([...t.disabledIds??[],...Re]),[t,Re]),Mt=t.mode==="single"?t.selectedId===null?[]:[t.selectedId]:C,wt=se=>{if(t.mode==="all")return;if(t.mode==="single"){const Be=Ye.has(se)?void 0:ce.get(se);Be&&t.onPick(Be);return}const Ee=$w(Mt,se,"checkbox",Ye);Ee!==Mt&&(I(Ee),t.onChange(Ee.flatMap(Be=>ce.get(Be)??[])))};x.useEffect(()=>{const se=v.current;if(se===null||t.mode==="all")return;for(const He of n.items)gn(He)&&He.addedAt>=se&&_.current.add(He.id);const Ee=[..._.current].filter(He=>ce.has(He)&&!Ye.has(He)),[Be]=Ee;if(Be===void 0)return;for(const He of Ee)_.current.delete(He);if(t.mode==="single"){wt(Be);return}const Xe=[...Ee.filter(He=>!Mt.includes(He)),...Mt];Xe.length!==Mt.length&&(I(Xe),t.onChange(Xe.flatMap(He=>ce.get(He)??[])))},[n.items]);const rn=se=>{if(t.mode==="all")return{selected:A.has(se),control:"checkbox",disabled:!1};const{checked:Ee,disabled:Be}=qp(Mt,se,Ye);return{selected:Ee,control:t.mode==="single"?"radio":"checkbox",disabled:Be}},hn=se=>{if(t.mode!=="all"){wt(se);return}R(Ee=>{const Be=new Set(Ee);return Be.has(se)?Be.delete(se):Be.add(se),Be})},Qs=Ke.findIndex(se=>se.id===ie),Pr=Qs>=0?Ke[Qs]:void 0,Xs=se=>{var Be;if(Ke.length===0)return;const Ee=(Math.max(Qs,0)+se+Ke.length)%Ke.length;J(((Be=Ke[Ee])==null?void 0:Be.id)??null)},Ws=se=>{if(!ie||!se.includes(ie))return;const Ee=Ke.findIndex(He=>He.id===ie),Xe=[...Ke.slice(Ee+1),...Ke.slice(0,Math.max(Ee,0))].find(He=>!se.includes(He.id));J(Xe?Xe.id:null)};x.useEffect(()=>{const se=Ee=>{if(xe.isOpen)return;const Be=Ee.target instanceof HTMLElement?Ee.target.tagName:"";if(!(Be==="INPUT"||Be==="TEXTAREA")){if(te){Ee.key==="Escape"&&de(null),(Ee.key==="Escape"||Ee.key==="Enter")&&Ee.preventDefault();return}if(Ee.key==="Escape"){if(ie)J(null);else if(A.size>0)it();else return;Ee.preventDefault()}else ie&&Ee.key==="ArrowRight"?Xs(1):ie&&Ee.key==="ArrowLeft"?Xs(-1):ie&&Ee.key==="Enter"&&Ee.preventDefault()}};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)});const Js=se=>{Ws(se),R(Ee=>{const Be=new Set(Ee);return se.forEach(Xe=>Be.delete(Xe)),Be}),n.remove(se).then(Ee=>{Ee>0?P(`Couldn't delete ${Ee}`):P(`Deleted ${se.length} object${se.length===1?"":"s"}`)})},ea=()=>{te&&(de(null),Js(te))},Sr=se=>{au(se)||se.inFlight||(P("Preparing download…"),n.download(se.id).catch(()=>P("Couldn't download")))},ta=()=>{const se=be.filter(Ee=>A.has(Ee.id)&&!au(Ee)&&!Ee.inFlight);se.length!==0&&(P("Preparing download…"),se.forEach(Ee=>void n.download(Ee.id).catch(()=>P("Couldn't download"))))},Ui=(se,Ee)=>{Y(null),!(Ee===null||!Ee||Ee===se.name)&&n.rename(se.id,Ee).catch(()=>P("Couldn't rename"))},kd=m!==null&&!c,_d=se=>{se.preventDefault(),!(!kd||!Array.from(se.dataTransfer.types).includes("Files"))&&(fe.current+=1,Q(!0))},Zl=se=>{se.preventDefault(),fe.current-=1,fe.current<=0&&(fe.current=0,Q(!1))},Pi=se=>{se.preventDefault(),fe.current=0,Q(!1),kd&&se.dataTransfer.files.length>0&&k(Array.from(se.dataTransfer.files))},hm=se=>t.mode==="all"&&A.has(se)&&A.size>1?Ke.filter(Ee=>A.has(Ee.id)).map(Ee=>Ee.id):null,Kl=(se,Ee)=>t.mode==="all"&&se.kind==="image"&&!se.inFlight?h.jsx(gw,{holderPath:Le(se).holder,mediaId:se.id,cropped:xe.cropped(Le(se)),cropFailedAt:n.cropFailedAt,className:Ee}):null,Gl=se=>{const{selected:Ee,control:Be,disabled:Xe}=rn(se.id),He=hm(se.id),Er=He==null?void 0:He.filter(Fr=>!Re.has(Fr));return{file:se,selected:Ee,select:{control:Be,disabled:Xe},listChip:f.length<2||se.upstream?null:Ch(se.list)??se.list,renaming:B===se.id,onClick:Fr=>{Fr.stopPropagation(),hn(se.id)},onDoubleClick:()=>t.mode==="single"?wt(se.id):J(se.id),onToggleSelect:()=>hn(se.id),...se.state==="failed"&&n.canRetry(se.id)?{onRetry:()=>n.retry(se.id)}:{},...se.linkUnreachable?{onRecheck:()=>void n.recheck(se.id)}:{},onRenameCommit:Fr=>Ui(se,Fr),handlers:{onPreview:()=>J(se.id),onDownload:()=>Sr(se),...ne(se),...a.manage&&(a.rename??!0)?{onRenameStart:()=>Y(se.id)}:{},...a.manage?{onDelete:()=>de(He??[se.id]),...He!==null?{deleteLabel:`Delete ${He.length} objects`}:{}}:{}},...Wn&&!se.inFlight?{drag:Ce(se.id,Er)}:{}}},Sd=se=>{const Ee=new Set(be.filter(Xe=>se.includes(Xe.id)).map(Xe=>Xe.list)),[Be]=Ee;return Ee.size!==1||Be===void 0||Ms(Be).at(-1)===Be?{}:{removeFrom:Ch(Be)??Be}},Yl=[...A],Ql=be.length===0;return h.jsxs("div",{className:"flex flex-col",onClick:it,onDragEnter:_d,onDragOver:se=>se.preventDefault(),onDragLeave:Zl,onDrop:Pi,children:[n.loading?h.jsx("div",{className:QH,children:"Loading…"}):h.jsxs("div",{className:GH,children:[h.jsx(qH,{lead:h.jsx(id,{size:"large",add:E,onAdd:null,...O!==null?{newChip:h.jsx(JF,{add:O,verb:E})}:{}}),selectionPill:A.size>0?h.jsx(VH,{count:A.size,onClear:it,onDownload:ta,...a.manage?{onDelete:()=>de(Yl)}:{}}):null,filter:$,setFilter:T,counts:Pe,kinds:u,sort:F,setSort:W,view:K,setView:N}),h.jsx("div",{className:YH,"data-dragging":L||void 0,children:Ql?h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx(od,{children:h.jsx("div",{className:kE,children:Array.from({length:XH},(se,Ee)=>h.jsx(KB,{},Ee))})}),h.jsx(QF,{add:O,kinds:u,dragging:L})]}):Ke.length===0?h.jsx(KH,{onReset:()=>T("all")}):h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:K==="grid"?h.jsx("div",{ref:ke,className:le("relative",kE),role:"listbox","aria-multiselectable":t.mode!=="single","aria-label":"Uploaded objects",children:Ve.map(se=>h.jsx(ZB,{...Gl(se),beneath:r==null?void 0:r(se),notice:Kl(se,"we-no-drag mx-3.5 mt-2")},se.id))}):h.jsxs("div",{ref:ke,className:"relative pt-1",role:"table","aria-label":"Uploaded objects",children:[h.jsx(GB,{}),Ve.map(se=>h.jsxs(x.Fragment,{children:[h.jsx(QB,{...Gl(se)}),Kl(se,"px-3.5 pb-2")]},se.id))]})})})]}),Pr?h.jsx(IH,{file:Pr,index:Qs,total:Ke.length,onClose:()=>J(null),onPrev:()=>Xs(-1),onNext:()=>Xs(1),...!au(Pr)&&!Pr.inFlight?{onDownload:()=>Sr(Pr)}:{},...a.manage?{onDelete:()=>de([Pr.id])}:{},...ne(Pr)}):null,xe.modal,te&&!c?h.jsx(LH,{scope:n.scope,ids:te,inFlightIds:Re,holders:n.holders,...Sd(te),onCancel:()=>de(null),onConfirm:ea}):null,D?h.jsx("div",{role:"status",style:{zIndex:L7},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:D}):null]})}function zw(){return nn()}function sR(e){const t=_o(e[0]).home;return L6(e).flatMap(n=>{const[r,...i]=n;return r===void 0?[]:[{lists:[r,...i],label:n.map(a=>tR(a,t)??_o(a).key).join(" + ")}]}).reverse()}const av=new Map,fh=new Map,lv=new Set,cv=[],hh=new Map,_E=new Set,wl=new Map;function WH(e,t){var n;(n=wl.get(e))==null||n.onStored(t),wl.delete(e)}function Hy(e,t){var n;(n=wl.get(e))==null||n.onFailed(t),wl.delete(e)}function aR(){for(const e of lv)e()}function lR(e){return lv.add(e),()=>{lv.delete(e)}}function Dw(e,t){t.length===0?av.delete(e):av.set(e,t),aR()}function Ss(e){return av.get(e)??cv}function SE(e,t){t.length!==0&&Dw(e,[...t,...Ss(e)])}function uv(e,t,n){const r=Ss(e);r.some(i=>i.inFlight.id===t)&&Dw(e,r.map(i=>i.inFlight.id===t?n(i):i))}function EE(e,t){var a;const n=new Set(t),r=Ss(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);Dw(e,r.filter(c=>!n.has(c.inFlight.id)))}}function jE(e,t,n,r){const i=fh.get(e)??hh,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?fh.delete(e):fh.set(e,c),aR()}function JH(e){return x.useSyncExternalStore(lR,()=>e===null?cv:Ss(e),()=>cv)}function eq(e){return x.useSyncExternalStore(lR,()=>e===null?hh:fh.get(e)??hh,()=>hh)}function tq(e,t,n){const r=e.get(t);if(r===void 0)return!1;const i=Ms(n).at(-1)??n;return r.includes(n)||r.includes(i)}function nq(e,t,n){return e.flatMap(({inFlight:r})=>{if(n.has(r.id))return[];const i=Ms(r.list),a=t.find(c=>i.includes(c));return a===void 0?[]:[{...r,list:a}]})}const cR="local-",uR=()=>`${cR}${Math.random().toString(36).slice(2,10)}`,rq=e=>e.startsWith(cR);function OE(e,t){return e instanceof Error&&"problem"in e&&e.message!==""?e.message:t}function oq(e,t){const n=gF(t);return{inFlight:{id:uR(),list:e,kind:DA(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 qc(e,t,n){uv(e,t,r=>({...r,inFlight:{...r.inFlight,send:n}}))}function iq(e,t,n){const{postListUploadWithProgress:r,postListLink:i,withdrawListItem:a,holdListItem:c}=e,u=O=>rv(t,e,O),f=async(O,A,R)=>{jE(O,R,A,!0);try{await a(O,A,R)}catch(C){throw jE(O,R,A,!1),u(O),C}u(O)},p=async(O,A,R,C)=>{if(_E.delete(A)){Hy(A,"Removed while sending"),f(O,C,R).catch(()=>{});return}uv(O,A,I=>({...I,inFlight:{...I.inFlight,id:R,send:{state:"saving"}}})),await u(O),EE(O,[R]),WH(A,R)},g=async(O,A,R,C,I)=>{let $;try{$=(await r(O,R,C,F=>qc(O,A,{state:"uploading",progress:F}),{attempt:I,onAttempt:F=>uv(O,A,W=>({...W,baggage:{...W.baggage,attempt:F??void 0}}))})).id}catch(T){console.error("media.upload.failed",{itemId:A,propertyId:O,into:R,name:C.name,size:C.size,mime:C.type,error:T});const F=OE(T,"Upload failed");qc(O,A,{state:"failed",error:F}),Hy(A,F);return}await p(O,A,$,R)},m=async(O,A,R,C,I)=>{let $;try{$=(await i(O,R,C,I)).id}catch(T){console.error("media.link.create_failed",{itemId:A,propertyId:O,into:R,url:C,error:T});const F=OE(T,"Couldn’t add link");qc(O,A,{state:"failed",error:F}),Hy(A,F);return}await p(O,A,$,R)},w=(O,A,R)=>{if(n===null)return;const C=O.filter(Boolean).map($=>oq(A,$));SE(n,C);for(const $ of C){if(R===void 0)continue;const{send:T}=$.inFlight;T.state==="failed"?R.onFailed(T.error):wl.set($.inFlight.id,R)}const I=C.filter($=>$.inFlight.send.state==="uploading");Q7(I,mF,async $=>{$.baggage.file&&await g(n,$.inFlight.id,A,$.baggage.file)})},v=(O,A,R)=>{if(n===null)return;const C=/^https?:\/\//i.test(O)?O:`https://${O}`,I=crypto.randomUUID(),$={inFlight:{id:uR(),list:A,kind:fM(C),name:cF(C),bytes:null,mime:null,url:C,addedAt:Date.now(),preview:null,send:{state:"saving"}},baggage:{link:{url:C,idempotencyKey:I}}};SE(n,[$]),R!==void 0&&wl.set($.inFlight.id,R),m(n,$.inFlight.id,A,C,I)},_=O=>{if(n===null)return!1;const A=Ss(n).find(R=>R.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=Ss(n).find(C=>C.inFlight.id===O);if(A===void 0)return;const R=A.inFlight.list;if(A.baggage.link){const{url:C,idempotencyKey:I}=A.baggage.link;qc(n,O,{state:"saving"}),m(n,O,R,C,I);return}if(A.baggage.file){const C=yF({attempt:A.baggage.attempt});qc(n,O,{state:"uploading",progress:0}),g(n,O,R,A.baggage.file,C.kind==="resume"?C.attempt:void 0)}},S=async(O,A)=>{if(n===null)return 0;const R=new Set(O);for(const $ of Ss(n))R.has($.inFlight.id)&&$.inFlight.send.state==="uploading"&&_E.add($.inFlight.id);EE(n,O);const C=O.filter($=>!rq($));return(await Promise.allSettled(C.map($=>f(n,A,$)))).filter($=>$.status==="rejected").length},E=c===void 0||n===null?void 0:async(O,A)=>{await c(n,A,O),await u(n)};return{addFiles:w,addLink:v,canRetry:_,retry:k,remove:S,...E!==void 0?{hold:E}:{}}}function sq(e){const t=uw(),n=No();return x.useMemo(()=>iq(t,n,e),[t,n,e])}function aq(e,t,n,r){const i=yu(t),a=e===void 0?[]:cL(e,i).filter(({id:p,list:g})=>!tq(r,p,g)),c=e===void 0?new Map:Rl(e),u=a.map(({id:p,value:g,file:m,list:w})=>({record:m0(m,g),list:w,...e!==void 0&&KM(e,c,{holder:dh(w),mediaId:p})?{inheritsCrop:!0}:{}}));return[...nq(n,i.from,new Set(a.map(({id:p})=>p))),...u]}function lq(e,t,n,r){const i=JH(e),a=eq(e),c=sq(e),u=x.useMemo(()=>aq(n,t,i,a),[n,t,i,a]),f=r??BA(t),p=x.useCallback(_=>c.addFiles(_,f),[c,f]),g=x.useCallback(_=>c.addLink(_,f),[c,f]),m=x.useCallback(async _=>{const k=new Map;for(const E of u){const O=dM(E);_.includes(O)&&k.set(E.list,[...k.get(E.list)??[],O])}return(await Promise.all([...k].map(([E,O])=>c.remove(O,E)))).reduce((E,O)=>E+O,0)},[u,c]),{hold:w}=c,v=x.useMemo(()=>w===void 0||r===void 0?void 0:_=>w(_,r),[w,r]);return{items:u,sent:i,deleting:a,addFiles:p,addLink:g,remove:m,canRetry:c.canRetry,retry:c.retry,...v!==void 0?{land:v}:{}}}function fd(e){const{MediaPicker:t}=zw();return h.jsx(t,{...e})}function cq(e){return new Set(e.flatMap(t=>{if(gn(t))return[];const{record:n}=t;return n.state!=="ready"||n.kind==="tour"&&!cM(n)?[n.id]:[]}))}const AE=le("m-0 py-1 text-caption text-ink-3",xw);function dR({useHost:e,filter:t,propertyId:n,...r}){var U;const{onClose:i}=r,a=x.useMemo(()=>sR(yu(t).from),[t]),c=x.useMemo(()=>a.map(({lists:z})=>z),[a]),u=x.useMemo(()=>({kinds:t.kinds,from:[...yu(t).from,...c.slice(1).flat()]}),[t,c]),f=e(n,u,BA(t)),{land:p}=f,g=x.useMemo(()=>new Map(c.flatMap((z,K)=>z.map(N=>[N,K]))),[c]),[m,w]=x.useState(()=>new Set),v=x.useRef(null),_=x.useMemo(()=>{if(f.loading)return f.items;const z=new Map;for(const Y of f.items){if(gn(Y)||m.has(Y.record.id))continue;const ie=z.get(Y.record.id);(ie===void 0||(g.get(Y.list)??0)<(g.get(ie.list)??0))&&z.set(Y.record.id,Y)}const K=[...z.values()],N=v.current??(v.current=new Map(K.map((Y,ie)=>[Y.record.id,{tier:g.get(Y.list)??0,rank:ie}])));for(const Y of K)N.has(Y.record.id)||N.set(Y.record.id,{tier:g.get(Y.list)??0,rank:-N.size});const B=Y=>N.get(Y.record.id)??{tier:0,rank:0};return[...f.items.filter(gn),...K.map(Y=>({...Y,tier:B(Y).tier})).sort((Y,ie)=>B(Y).rank-B(ie).rank)]},[f.items,f.loading,g,m]),{remove:k}=f,S=x.useMemo(()=>({...f,items:_,remove:async K=>{const N=K.filter(Y=>_.some(ie=>!gn(ie)&&ie.record.id===Y&&(g.get(ie.list)??0)===0)),B=await k(K);return B===0&&N.length>0&&w(Y=>new Set([...Y,...N])),B}}),[f,_,k,g]),E=x.useMemo(()=>cq(_),[_]),O=x.useMemo(()=>new Set(_.flatMap(z=>!gn(z)&&(g.get(z.list)??0)>0?[z.record.id]:[])),[_,g]),[A,R]=x.useState("idle"),[C,I]=x.useState(0),$=x.useRef(Promise.resolve()),T=x.useRef(0),F=x.useRef(new Set);if(t.kinds.length===0)return null;const W=(z,K)=>{const N=p===void 0?[]:z.filter(B=>O.has(B)&&!F.current.has(B));if(N.length===0&&T.current===0){K();return}T.current+=1,$.current=$.current.then(async()=>{try{if(p===void 0||N.length===0){K();return}R("landing");try{for(const B of N)await p(B),F.current.add(B)}catch{R("failed"),I(B=>B+1);return}R("idle"),K()}finally{T.current-=1}})},G=r.mode==="single"?{mode:"single",selectedId:r.currentId??null,disabledIds:E,onPick:z=>W([z.id],()=>r.onPick(z))}:{mode:"multi",selectedIds:r.selectedIds.filter(Boolean),disabledIds:E,onChange:z=>{const K=r.selectedIds;W(z.filter(({id:N})=>!K.includes(N)).map(({id:N})=>N),()=>r.onChange(z))}},H=((U=a[0])==null?void 0:U.label)??"";return h.jsx(Tw,{onClose:i,title:H,notice:A==="landing"?h.jsxs("p",{role:"status",className:AE,children:["Adding to ",H,"…"]}):A==="failed"?h.jsxs("p",{role:"alert",className:le(AE,"text-danger"),children:["Couldn't add it to ",H,". Try again."]}):null,children:h.jsx(iR,{filter:t,selection:G,host:S,...p!==void 0?{tiers:c}:{}},C)})}function fR(e){const t={...e,rename:!1};return function(r,i,a){const c=Fp(r),u=lq(r,i,c,a),{items:f}=u,p=x.useCallback(g=>{const m=f.find(v=>!gn(v)&&v.record.id===g),w=m===void 0||gn(m)?null:m.record.file_url;return w&&window.open(w,"_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 uq({capabilities:e,...t}){const{upload:n,link:r,manage:i}=e,a=x.useMemo(()=>fR({upload:n,manage:i,...r===void 0?{}:{link:r}}),[n,r,i]);return h.jsx(dR,{...t,useHost:a})}function Lw(e,t){const n=M7();return e!==void 0&&t!==""&&n!==void 0&&n(e,t)}const Vp=le(kt,"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"),Iw="hover:bg-[#fbe6e2] hover:text-danger",dq="size-[calc(13*var(--content))]",fq="we-no-drag h-[calc(36*var(--content))] shrink-0",hR="flex shrink-0 items-center";function Zp({icon:e,label:t,title:n,tone:r="neutral",onClick:i}){return h.jsx("button",{type:"button",className:le(Vp,fq,r==="remove"&&Iw),"aria-label":t,title:n,onClick:i,children:pi.createElement(e,{className:dq})})}const hq={card:"rounded-2xl",compact:"rounded-xl"},pq={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}},mq="text-ink-3",gq={card:"mx-2 rounded-xl",compact:"mx-1.5 rounded-lg"},yq=le("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]",BN),bq="border-honey-2 bg-honey-soft";function CE({kind:e,name:t,empty:n,scale:r,actions:i,attention:a,drop:c,children:u}){const f=Fl(),p=_s[r],g=pq[r],{plain:m,foot:w}=LM(i),v=(c==null?void 0:c.over)??!1;return h.jsxs("div",{"data-media-slot-card":"",className:le("relative flex flex-col border border-transparent bg-[#f3f2ed] transition-[background-color,box-shadow] duration-[140ms]",hq[r],Ll,v&&!n&&"ring-2 ring-honey-2"),...Il(a,f),...c==null?void 0:c.handlers,"data-media-drop":c?"":void 0,children:[h.jsxs("div",{className:g.bar,children:[h.jsx("span",{className:le("grid shrink-0 place-items-center",g.mark),children:h.jsx(zs,{kind:e,size:r==="compact"?"mark":"lead"})}),h.jsx("span",{className:le(g.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,...w].map(_=>h.jsx("button",{type:"button",className:le(Vp,mq,g.button,_.danger&&Iw),"aria-label":_.label,title:_.label,onClick:_.onSelect,children:h.jsx(ot,{name:_.glyph,size:g.glyph})},_.label))})]}),n?h.jsx("div",{className:le(yq,gq[r],v&&bq),"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 dv(e){var t;return e===void 0?"Link":((t=Ni[e])==null?void 0:t.label)??"Link"}function vq(e){return e.kind==="tour"?dv(e.provider):e.kind!=="video"?"":e.videoSource==="link"?dv(e.provider):e.ready===!1?"Processing…":pF(e.durationMs)||"Video"}function wq({kind:e,size:t}){return e==="tour"?h.jsx(zt.tour,{size:t}):h.jsx(zt.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",kq={doc:Tp,spreadsheet:zN,presentation:tw,image:$p,video:iw};function _q({glyph:e,extension:t,size:n=16,className:r}){const i=kq[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 Sq=new Set(["image","video","tour","document","media"]);function Eq(e){return _i(e).length>0}function Uw(e,t){const n=D0(e,t);return n!==null?!Sq.has(n.value_type)||n.filter!==void 0?null:{holder:"home",table:n.table,field:n.member}:!Eq(e)||typeof e.from=="string"||e.source!==void 0&&e.source.kind!=="authored"?null:{holder:"section"}}function jq(e,t){const n=Uw(e,t);return(n==null?void 0:n.holder)==="home"?n:null}function pR(){return`tmp_${globalThis.crypto.randomUUID()}`}function xl(e){return typeof e=="string"&&e.startsWith("tmp_")}function Oq(e,t,n,r){const i=bi(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 mR(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 Aq(e,t){return e?e.itemId??null:t??null}function gR({props:e,table:t,ownerSlot:n,mediaId:r,inLibrary:i}){const{slot:a,propertyId:c,instanceId:u,recordContext:f,boundRowId:p,onUpload:g}=e,{api:m,useEditorStore:w}=nn(),v=w($=>$.session.deliverable_id),_=g===void 0?Uw(n??a,t):null,k=(_==null?void 0:_.holder)==="home"?_:null,S=k===null?null:Aq(f,p),E=xl(S),O=k===null||E?null:S;let A=null;k!==null&&O!==null&&(A=Oq(m,c,k,O)),((_==null?void 0:_.holder)==="section"||E)&&v!==void 0&&(A=mR(m,c,{deliverableId:v,instanceId:u,slotId:yR(e)}));const R=zn({queryKey:["owned-media-url",A==null?void 0:A.place,r],queryFn:()=>A.presign(r),enabled:A!==null&&r!==""&&!i,retry:!1}),C=x.useRef(null);return{upload:A===null?null:async $=>{const T=await A.take($),F=C.current;return C.current=T.media_id,A.discard!==null&&F!==null&&F!==T.media_id&&A.discard(F).catch(()=>{}),bR(T,$)},previewUrl:R.data}}function yR(e){var n;const t=(n=e.recordContext)==null?void 0:n.fieldKey;return t?`${e.slotId}.${t}`:e.slotId}function bR(e,t){const n=e.provider??("link"in t?Gu(e.url)??void 0:void 0);return n===void 0?e:{...e,provider:n}}function Pw(e,t){var c;const{api:n,useEditorStore:r}=nn(),i=r(u=>u.session.deliverable_id);if(i===void 0||((c=Uw(e))==null?void 0:c.holder)!=="section")return null;const a=mR(n,t.propertyId,{deliverableId:i,instanceId:t.instanceId,slotId:t.slotId});return async u=>bR(await a.take(u),u)}function Ha(e,t){return e===void 0||e===""||t===""?null:{holder:e,mediaId:t}}function vR(e,t){const{capabilities:n}=zw(),r=n.framingCrop!==!1,i=!r&&t==="image",a=x.useRef(new Map),c=YM(i?e:"",u=>{const f=a.current.get(po(u));f!==void 0&&su.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(po(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 wR(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:pl(t.crop),inherited:!1};const u=(i==null?void 0:i.kind)==="image"&&n!=="locked"?i.crop:null;return u===null||!Hs(u)?{src:c,seed:null,inherited:!1}:{src:c,seed:pl(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 Cq({value:e,onChange:t,propertyId:n,cropCfg:r}){const{api:i}=nn(),a=Ul(n),[c,u]=x.useState(!1),f=sv(e,r),p=CN(n,[f],i.getCropDerivativeUrl),g=f?p.get(f):void 0,m=w=>{var _;if(!c)return null;const v=wR(a,e,r.mode,w);return v.src?h.jsx(P0,{chrome:Ew,src:v.src,mode:r.mode,aspect:r.aspect,aspectLabel:r.aspectLabel,mobileAspect:r.mobileAspect,seed:{rect:v.seed},mobileSeed:{rect:pl((_=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=QM(e,k);S!==null&&t(S)}}):null};return{cropCfg:r,ar:e.ar??null,cut:f,derivativeUrl:g,open:()=>u(!0),modal:m}}function Fw({propertyId:e,children:t}){return h.jsx(h.Fragment,{children:t(Fp(e))})}function Bw(e,t){const n=Ul(t).get(e);return n===void 0?void 0:uM(n)}function Nq(e){return e==null||e===""?void 0:e}function NE(e){return{file:e.file,url:e.url,alt:e.alt}}const Mq={noun:"image",takes:dd(["image"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>e.file===t.file?{...t,url:vl(e)}:{...NE(t),file:e.file,url:vl(e),alt:t.alt,picked:e.id},fromUploaded:(e,t)=>({...NE(t),file:e.media_id,url:e.url,picked:null}),cleared:{file:"",url:"",alt:""},usePreview:function(t,n){const r=Bw(t.file,n);return{src:(r==null?void 0:r.src)||t.url,name:Nq(t.name)??(r==null?void 0:r.name)}}},Rq={noun:"video",takes:dd(["video"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>({...t,file:e.file,url:"",poster:vl(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=Bw(t.file,n);return{src:(r==null?void 0:r.src)||t.poster,name:r==null?void 0:r.name,detail:r?vq(r):void 0}}},Tq={noun:"tour",takes:dd(["tour"]),fileIdOf:e=>e.file,fromPicked:(e,t)=>({...t,file:e.file,url:"",poster:vl(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=Bw(t.file,n);return{src:(r==null?void 0:r.src)||t.poster,name:r==null?void 0:r.name,detail:t.file?dv((r==null?void 0:r.provider)??t.provider):void 0}}},$q={noun:"document",takes:dd(["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=AB(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:OB(a),attachment:jM(a)}:{src:"",name:"Document unavailable"}}},zq={image:Mq,video:Rq,tour:Tq,document:$q};function Xn(e){return zq[e]}function kl(e){return e.recordContext?e.recordContext.table??null:e.boundRowTable??null}const Dq="text-[length:calc(11.5*var(--content))] text-ink-3",Lq=le(kt,"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"),Iq="flex w-full max-w-90 items-center gap-1.5",Uq="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",Pq=le(kt,"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",Ll);function ME(e){return e.kind==="image"?h.jsx(Fq,{...e}):h.jsx(kR,{...e})}function kR(e){const t=Xn(e.kind),n=gR({props:e.props,table:kl(e.props),mediaId:t.fileIdOf(e.props.value),inLibrary:!0});return h.jsx(jR,{...e,extras:{crop:null,pick:null,ownerUpload:n.upload,ownerPreview:void 0}})}function _R(e){const{slot:t,value:n,onChange:r,propertyId:i,factPath:a}=e,c=L0(t),u=Cq({value:n,onChange:r,propertyId:i,cropCfg:c}),f=zw().capabilities.framingCrop===!1,p=YM(f?i:"");if(!f)return{...u,offered:!0,recropping:!1,cropped:JM(n,c)};const g=Ha(a,n.file);return{...u,cut:null,derivativeUrl:void 0,open:()=>{g!==null&&p.open(g)},modal:()=>p.modal,offered:g!==null&&p.offers(g),recropping:g!==null&&p.recropping(g),cropped:g!==null&&p.cropped(g)}}function Fq(e){const t=_R(e.props),n=Ul(e.props.propertyId),r=e.props.value.file,i=(c,u,f)=>{e.props.onChange(jw(c,e.props.value,u,t.cropCfg,f))},a=gR({props:e.props,table:kl(e.props),mediaId:r,inLibrary:r!==""&&n.has(r)});return h.jsx(jR,{...e,extras:{crop:t,pick:i,ownerUpload:a.upload,ownerPreview:a.previewUrl}})}function SR(e){return e.kind==="image"?h.jsx(Bq,{...e}):h.jsx(ER,{...e,crop:null})}function Bq(e){return h.jsx(ER,{...e,crop:_R(e.props)})}function ER({kind:e,model:t,props:n,onOpen:r,crop:i}){const{slot:a,value:c,propertyId:u,required:f}=n,p=Xn(e),g=p.usePreview(c,u),m=Ap(a,kl(n)),w=Bp(a,{table:kl(n)}),v=Lw(n.factPath,p.fileIdOf(c));return h.jsx(Vq,{kind:e,offer:m.kind,noun:p.noun,label:a.label,emptyName:w===null?a.label:nR(w).label,preview:g,empty:t.isEmpty(c),crop:i,processing:v,attention:zi(t,a,c,f??!1),onOpen:r})}function jR({kind:e,face:t,model:n,props:r,extras:i,open:a}){var fe,pe;const{slot:c,value:u,onChange:f,propertyId:p,onUpload:g,required:m}=r,{crop:w,pick:v,ownerUpload:_,ownerPreview:k}=i,S=Xn(e),E=S.usePreview(u,p),O=k?{...E,src:k}:E,A=g!==void 0?{kind:"owned"}:Ap(c,kl(r)),R=n.isEmpty(u),C=zi(n,c,u,m??!1),I=Lw(r.factPath,S.fileIdOf(u))||((w==null?void 0:w.recropping)??!1),[$,T]=x.useState(!1),F=g??_??void 0,W=Hq(F,(P,ce)=>a?a.onUploaded(P,ce):f(S.fromUploaded(P,u))),G=x.useRef(null),H=a?a.accept:Cw[e]??void 0,U=a&&R?a.noun:S.noun,z=((pe=(fe=Bp(c,{table:kl(r)}))==null?void 0:fe.choose)==null?void 0:pe.label)??_u("Choose",U),K=(a==null?void 0:a.takes)??S.takes,N=A.kind==="owned"&&F!==void 0,B=(P,ce)=>{a?a.onPicked(P):v?v(P,ce,A.kind==="picked"?A.filter.from:void 0):f(S.fromPicked(P,u))},Y=W,ie=N&&K.includes("file"),J=N&&K.includes("link"),L=_u("Upload",U),Q=xM({accept:ie?H??"":null,onFiles:([P])=>{P&&Y.takeFile(P)},...J?{onLink:Y.takeLink,...a?{}:{linkKinds:[e]}}:{},disabled:Y.busy},L,G,!1),D=ie||J,Z=A.kind==="picked"?[{label:z,glyph:"choose",run:()=>T(!0)}]:D?[{label:L,glyph:"upload",run:Q.start}]:[],te=w!=null&&w.offered&&!R&&O.src?w.open:null,de=R?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(qq,{scale:t==="expanded"?"card":"compact",kind:e,noun:U,label:c.label,preview:O,empty:R,crop:w,sources:Z,onCrop:te,onRemove:de,drop:ie?Y.takeFile:null,link:J?Y.takeLink:null,busy:Y.busy,processing:I,attention:C}),w&&h.jsx(gw,{holderPath:r.factPath,mediaId:S.fileIdOf(u),cropped:w.cropped}),Y.error&&h.jsx("p",{className:Dl,children:Y.error}),Q.node,$&&A.kind==="picked"&&h.jsx(Fw,{propertyId:p,children:P=>h.jsx(fd,{mode:"single",propertyId:p,filter:A.filter,currentId:S.fileIdOf(u)||void 0,onClose:()=>T(!1),onPick:ce=>B(ce,P)})}),w==null?void 0:w.modal(k)]})}function Hq(e,t){const[n,r]=x.useState(!1),[i,a]=x.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 OR({kind:e,preview:t,size:n}){var r,i;return e==="document"?h.jsx(_q,{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(wq,{kind:e,size:n}):h.jsx(zt.up,{})}function qq({scale:e,kind:t,noun:n,label:r,preview:i,empty:a,crop:c,sources:u,onCrop:f,onRemove:p,drop:g,link:m,busy:w,processing:v,attention:_}){const[k,S]=x.useState(!1),[E,O]=x.useState(""),A=vw(c,i.src),R=g?{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 $=(T=I.dataTransfer.files)==null?void 0:T[0];$&&g($)}}}:null,C=[];if(f&&C.push({label:"Crop",glyph:"crop",onSelect:f}),!w)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(CE,{kind:t,name:`No ${n}`,empty:!0,scale:e,actions:C,attention:_,drop:R,children:[h.jsx("span",{className:"text-ink-4",children:h.jsx(OR,{kind:t,preview:i,size:24})}),(w||g)&&h.jsx("span",{className:Dq,children:w?"Uploading…":k?`Drop to add this ${n}`:"Drop a file here"}),m&&h.jsxs("form",{className:Iq,onSubmit:I=>{I.preventDefault(),E.trim()&&m(E.trim()),O("")},children:[h.jsx("input",{className:Uq,value:E,onChange:I=>O(I.target.value),placeholder:`Paste a ${n} link`,"aria-label":`${r} link`}),h.jsxs("button",{type:"submit",className:Lq,disabled:w||!E.trim(),children:[h.jsx(zt.link,{})," Add"]})]})]}):h.jsx(CE,{kind:t,name:i.name??`Untitled ${n}`,empty:!1,scale:e,actions:C,attention:_,drop:R,children:h.jsx(AR,{kind:t,src:A,preview:i,dimmed:w||v,children:w?h.jsx(B0,{label:"Uploading…"}):v&&h.jsx(Hw,{})})})}function Hw(){return h.jsx(B0,{label:"Processing…"})}function Vq({kind:e,offer:t,noun:n,label:r,emptyName:i,preview:a,empty:c,crop:u,processing:f,attention:p,onOpen:g}){const m=Fl(),w=vw(u,a.src),v=e==="image"?null:a.name??(c?null:`Untitled ${n}`),_=w?h.jsx("img",{className:"absolute inset-0 size-full object-cover object-top",src:w,alt:"",draggable:!1,style:f?sN:void 0}):c?h.jsx(zt.plus,{}):h.jsx(OR,{kind:e,preview:a,size:16});return h.jsxs("button",{type:"button",className:Pq,"data-media-summary":"","data-media-kind":e,"data-media-offer":t,"data-empty":c?"":void 0,...Il(p,m),"aria-label":c?i:`${r}: ${v??n}`,disabled:g===void 0,onClick:g,children:[_,f&&h.jsx(Hw,{})]})}const Zq="block size-full object-cover object-top",Kq="flex size-full items-center justify-center bg-canvas",Gq="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",Yq="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 AR({kind:e,src:t,preview:n,dimmed:r,children:i}){return h.jsxs(h.Fragment,{children:[t?h.jsx("img",{className:Zq,src:t,alt:"",draggable:!1,style:r?sN:void 0}):h.jsx("span",{className:Kq,children:h.jsx(zs,{kind:e,size:"logo",decorative:!0,...e==="document"&&n.attachment?{glyph:n.attachment.glyph}:{}})}),e==="video"&&t&&h.jsx("span",{className:Yq,children:h.jsx(ot,{name:"play",size:14})}),i,n.detail&&h.jsx("span",{className:Gq,children:n.detail})]})}function qw({kind:e,value:t,propertyId:n,frame:r,holderPath:i}){const a=Xn(e),c=a.usePreview(t,n),u=Lw(i,a.fileIdOf(t)),{chrome:f,crop:p,beneath:g}=r,m=vw(p,c.src),w=(p==null?void 0:p.cropping)??!1,v=c.name??(a.fileIdOf(t)?`Untitled ${a.noun}`:`No ${a.noun}`);return h.jsx(nH,{kind:e,name:v,chrome:f,thumb:h.jsx(AR,{kind:e,src:m,preview:c,dimmed:w||u,children:w?h.jsx(B0,{}):u&&h.jsx(Hw,{})}),below:p&&h.jsx(gw,{storeKey:p.storeKey,holderPath:i,mediaId:a.fileIdOf(t),cropped:p.cropped}),beneath:g})}function Kp(e,t){function n(i){return h.jsx(ME,{kind:e,face:"expanded",model:t.model,props:i})}n.displayName=`MediaExpandedFace(${e})`;function r(i){return h.jsx(ME,{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 Qq(e,t){const n=Ul(t).get(e);return n===void 0?null:n.kind}function Vw(e,t,n){const r=Qq((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 Gp(e,t){return t===null||Xn(e).fileIdOf(t)===""?null:{...t,kind:e}}function RE(e,t,n,r){const i=Xn(e),a=t===e?n:i.cleared;return Gp(e,r(i,a))}function Xq(e){const t=e.map(n=>Cw[n]).filter(n=>n!==null);return{takes:dd(e),accept:t.length>0?t.join(","):void 0}}function ph(e){return"file"in e?DA(e.file.type):LA(e.link)}function Wq(e){const{kind:t}=e;return Gp(t,Xn(t).fromPicked(e,Xn(t).cleared))}function Jq(e,t,n,r){return{noun:e.length===1?Xn(t).noun:"media",...Xq(e),onPicked:i=>r(RE(i.kind,t,n,(a,c)=>a.fromPicked(i,c))),onUploaded:(i,a)=>{const c=ph(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(RE(c,t,n,(u,f)=>u.fromUploaded(i,f)))}}}function TE({face:e,models:t,props:n}){const r=_i(n.slot),i=Vw(n.value,r,n.propertyId);return h.jsx(eV,{kind:i,kinds:r,face:e,models:t,props:n},i)}function CR(e,t,n){const r=n.value===null?Xn(e).cleared:t.coerce(n.value);return{...n,value:r,onChange:i=>n.onChange(Gp(e,i))}}function eV({kind:e,kinds:t,face:n,models:r,props:i}){const a=r[e],c=CR(e,a,i);return h.jsx(kR,{kind:e,face:n,model:a,props:c,open:Jq(t,e,c.value,i.onChange)})}function tV({models:e,props:t,onOpen:n}){const r=Vw(t.value,_i(t.slot),t.propertyId);return h.jsx(nV,{kind:r,models:e,props:t,onOpen:n},r)}function nV({kind:e,models:t,props:n,onOpen:r}){const i=t[e];return h.jsx(SR,{kind:e,model:i,onOpen:r,props:CR(e,i,n)})}function rV(e){function t(r){return h.jsx(TE,{face:"expanded",models:e.models(),props:r})}function n(r){return h.jsx(TE,{face:"compact",models:e.models(),props:r})}return{model:e.model,faces:{expanded:t,compact:n},applyOptimistic:null}}function oV(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 NR(e){if(e&&typeof e=="object"){const t=e,n=Ba(t.crop),r=bl(e);return{file:cd(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"&&Ba(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 MR=Kp("image",{model:{defaultValue:{file:"",url:"",alt:""},coerce:NR,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:oV});function iV(e,t){const n=e.matches("img")?e:e.querySelector("img");n&&t.poster&&n.setAttribute("src",t.poster)}function RR(e){if(e&&typeof e=="object"){const t=e;return{file:cd(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}:{},...bl(e)===void 0?{}:{picked:bl(e)}}}return{file:"",url:"",poster:"",alt:""}}const TR=Kp("tour",{model:{defaultValue:{file:"",url:"",poster:"",alt:""},coerce:RR,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:iV});function $R({engine:e,lens:t,propertyId:n,instanceId:r,slotId:i,cropCfg:a}){const{api:c}=nn(),u=Ul(n),{rows:f}=e,[p,g]=x.useState(null),m=E=>`${n}:${r}:${i}:${E}`,w=E=>t.get(E.value),v=CN(n,f.map(E=>{const O=w(E);return O===null?null:sv(O,a)}),c.getCropDerivativeUrl),_=(E,O)=>{const A=p;g(null),A&&(!O.mobile&&xR(E,O.rect)||e.updateValue(A,R=>{const C=t.get(R);if(C===null||!C.file)return R;const I=QM(C,O);return I===null?R:t.set(R,I)}))},k=()=>{var R;const E=p?f.find(C=>C.key===p):null,O=E?w(E):null;if(!E||!O)return null;const A=wR(u,O,a.mode);return A.src?h.jsx(P0,{chrome:Ew,src:A.src,mode:a.mode,aspect:a.aspect,aspectLabel:a.aspectLabel,mobileAspect:a.mobileAspect,seed:{rect:A.seed},mobileSeed:{rect:pl((R=O.mobile)==null?void 0:R.crop)},onApply:C=>_(A,C),onClose:()=>g(null)}):null},S=E=>{const O=w(E);return O===null?null:sv(O,a)};return{keyOf:m,cutOf:S,derivativeOf:E=>{const O=S(E);return O?v.get(O):void 0},cropped:E=>{const O=w(E);return O!==null&&JM(O,a)},open:g,modal:k}}function $E(e,t){return e.matches(t)?e:e.querySelector(t)}function sV(e,t){const n=$E(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=$E(e,"img");r&&t.poster&&r.setAttribute("src",t.poster)}function zR(e){if(e&&typeof e=="object"){const t=e;return{file:cd(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}:{},...bl(e)===void 0?{}:{picked:bl(e)}}}return{file:"",url:"",poster:"",alt:""}}const DR=Kp("video",{model:{defaultValue:{file:"",url:"",poster:"",alt:""},coerce:zR,isEmpty:e=>e.file===""&&e.url==="",isInvalid:()=>!1},applyOptimistic:sV});function aV(e,t){switch(e){case"image":return t.map(NR);case"video":return t.map(zR);case"tour":return t.map(RR);case"document":return jB(t)}}function lV(e){return{get:t=>e==="image"?t:null,set:(t,n)=>n}}function cV({kind:e,label:t,itemSlot:n,offer:r,verbs:i,fixed:a,instanceId:c,slotId:u,ownerSlotId:f=u,value:p,propertyId:g,commit:m,onUpload:w,factPath:v,size:_}){const k=Xn(e),S=L0(n),E=x.useMemo(()=>aV(e,p),[e,p]),[O,A]=x.useState(!1),R=$i({items:E,fixed:a,axis:"xy",commit:m}),{rows:C}=R,I=x.useMemo(()=>lV(e),[e]),$=$R({engine:R,lens:I,propertyId:g,instanceId:c,slotId:u,cropCfg:S}),T=vR(g,e),F=Pw(n,{propertyId:g,instanceId:c,slotId:f}),W=w??F??void 0,G=LR(W,ie=>R.add(k.fromUploaded(ie,k.cleared))),H=r.kind==="owned"&&W!==void 0,U=(ie,J)=>e==="image"?jw(ie,k.cleared,J,S,r.kind==="picked"?r.filter.from:void 0):k.fromPicked(ie,k.cleared),z=(ie,J)=>{R.replace(Pl(C,ie,k.fileIdOf,L=>U(L,J),R.mint))},{add:K,onAdd:N,choose:B}=pw(i,r.kind==="picked"?()=>A(!0):null,r.kind==="owned"&&H?Zw([e],G):null),Y=G.error;return h.jsxs(mw,{engine:R,label:t,noun:k.noun,size:_,onAdd:N,add:K,choose:B,renderTile:(ie,J,L)=>h.jsx(qw,{kind:e,value:ie.value,propertyId:g,holderPath:v,frame:{chrome:L,crop:e==="image"?{cfg:S,cut:$.cutOf(ie),derivativeUrl:$.derivativeOf(ie),cropping:T.recropping(Ha(v,k.fileIdOf(ie.value))),cropped:T.framing?$.cropped(ie):T.cropped(Ha(v,k.fileIdOf(ie.value))),storeKey:$.keyOf(ie.key)}:null}}),tileActions:ie=>e==="image"&&T.offers(Ha(v,k.fileIdOf(ie.value)))?[{label:"Crop",glyph:"crop",onSelect:()=>T.framing?$.open(ie.key):T.recrop(Ha(v,k.fileIdOf(ie.value)),$.keyOf(ie.key))}]:[],children:[Y&&h.jsx("p",{className:Dl,children:Y}),O&&r.kind==="picked"&&h.jsx(Fw,{propertyId:g,children:ie=>h.jsx(fd,{mode:"multi",propertyId:g,filter:r.filter,selectedIds:C.map(J=>k.fileIdOf(J.value)),onChange:J=>z(J,ie),onClose:()=>A(!1)})}),T.framing&&$.modal(),T.modal]})}function LR(e,t){const[n,r]=x.useState(!1),[i,a]=x.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 Zw(e,t){const n=d0(e);return{accept:Nw(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 zE="label";function mh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Hl(e){var a;const t=mh(e);if((t==null?void 0:t.type)!=="object")return null;const n=mh(t.fields);if(n===null)return null;const r=(a=mh(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 Ln(e){return Hl(e.element)}function Zs(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 Dr(e,t){return e.labelField!==void 0&&e.fields[e.labelField]?{kind:"field",field:e.labelField}:e.fields[zE]?{kind:"field",field:zE}:{kind:"text",text:t}}function Ks(e,t,n){var c;if(e.kind==="text")return e.text;const r=(c=mh(n))==null?void 0:c[e.field],i=t.fields[e.field];if((i==null?void 0:i.type)==="address"){const u=tn(r);return(u===null?null:XD(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 Kw(e){const t=Ln(e);return t?Zs(t):[]}function uV(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 Ka(e){const t={};for(const[n,r]of e)t[n]=uV(r);return t}const dV=["street","unit","city","state","postal"],IR={street:null,unit:null,city:null,state:null,postal:null,latitude:null,longitude:null,source:null};function fV(e,t){const n=e??IR,r=tn({...n,...t}),i=dV.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:tn({...r,latitude:null,longitude:null,source:null})}function DE(e,t,n){return fV(e,{[t]:n})}function hV(e){return tn({...e,source:"autocomplete"})}function pV(e,t){return tn({...e??IR,...t,source:"manual_pinned"})}function UR(e){return e!==null&&e.latitude!==null&&e.longitude!==null}function PR(e){return e!==null&&!UR(e)}function mV(e,t,n){const r=n===void 0||n.size===0?t!=="unit":n.has(t);return e!==null&&r&&e[t]===null}function gV(e){return PR(e)||(e==null?void 0:e.source)==="manual_pinned"}const FR={defaultValue:null,coerce:tn,isEmpty:e=>e===null,isInvalid:()=>!1},fv=[{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 Gf(e){const t=e.trim().toLowerCase();if(t==="")return[...fv];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 fv.map(r=>({state:r,rank:n(r)})).filter(({rank:r})=>r>=0).sort((r,i)=>r.rank-i.rank).map(({state:r})=>r)}function yV(e){const t=e.trim().toLowerCase();return t===""?null:fv.find(n=>n.code.toLowerCase()===t||n.name.toLowerCase()===t)??null}const bV="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)]",vV=le(kt,"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"),wV="ml-auto text-caption font-medium text-ink-4",xV=4,kV=280,LE=220;function _V({value:e,onCommit:t,ariaLabel:n,placeholder:r,shellClassName:i,attention:a,inputClassName:c}){const u=e??"",[f,p]=x.useState(null),[g,m]=x.useState(0),[w,v]=x.useState(null),_=x.useId(),k=x.useRef(null),S=x.useRef(null),E=f!==null,O=E&&f!==u,A=Gf(O?f:""),R=x.useCallback(()=>{k.current&&v(Cs(k.current))},[]);x.useEffect(()=>{if(E)return window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[E,R]),x.useEffect(()=>{var G,H;(H=(G=S.current)==null?void 0:G.querySelector('[data-active="true"]'))==null||H.scrollIntoView({block:"nearest"})},[g,E]);function C(){R(),p(u);const G=Gf("").findIndex(H=>H.code===u);m(Math.max(0,G))}function I(){p(null),v(null)}function $(G){I(),G!==e&&t(G)}function T(G){if(G===u)return I();if(G.trim()==="")return $(null);const H=yV(G);if(H)return $(H.code);const U=Gf(G);if(U.length===1)return $(U[0].code);I()}function F(G){if(!E){(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[g];H?$(H.code):T(f);return}case"Tab":{const H=O?A[g]:void 0;H?$(H.code):T(f);return}case"Escape":G.preventDefault(),I();return}}const W=w?Ml(w,{maxHeight:kV,minWidth:LE,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":E,"aria-controls":_,"aria-autocomplete":"list",autoComplete:"address-level1",placeholder:r,value:E?f:u,onFocus:G=>{C(),G.currentTarget.select()},onChange:G=>{E||R(),p(G.target.value),m(0)},onKeyDown:F,onBlur:()=>{E&&T(f)}}),E&&W&&A.length>0&&typeof document<"u"&&Ur.createPortal(h.jsx("div",{ref:S,id:_,role:"listbox","aria-label":`${n} options`,className:bV,style:{left:W.left,top:W.top,bottom:W.bottom,maxHeight:W.maxHeight,minWidth:Math.max(W.width,LE),zIndex:Ei},children:A.map((G,H)=>h.jsxs("button",{type:"button",role:"option",tabIndex:-1,"aria-selected":G.code===u,"data-active":H===g,"data-state-option":G.code,className:vV,onMouseEnter:()=>m(H),onMouseDown:U=>{U.preventDefault(),$(G.code)},children:[h.jsx("span",{className:"truncate",children:G.name}),h.jsx("span",{className:wV,children:G.code})]},G.code))}),document.body)]})}const BR=x.createContext(null);function SV({factPath:e,fields:t,children:n}){return h.jsx(BR.Provider,{value:{factPath:e,fields:t},children:n})}function Gw(e){const t=x.useContext(BR);return t!==null&&e!==void 0&&t.factPath===e?t.fields:void 0}const EV={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"}},jV={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}},OV=250,AV=2e3;function CV(e){const t=gV(e),[n,r]=x.useState(!1),[i,a]=x.useState(t);!n&&i!==t&&a(t);const c=x.useRef(null),u=x.useCallback(()=>{c.current!==null&&clearTimeout(c.current),c.current=null},[]);x.useEffect(()=>u,[u]);const f=x.useCallback(()=>{u(),r(!1)},[u]),p=x.useCallback(()=>{u(),r(!0),c.current=setTimeout(()=>{c.current=null,r(!1)},AV)},[u]);return{show:n?i:t,hold:p,settle:f}}function NV(){const[e,t]=x.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 MV(e){const t=nn().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 RV({value:e,onPin:t,place:n}){const r=nn().address;if(!r)return null;const i=UR(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 TV({value:e,show:t,onChange:n,place:r}){const[i,a]=x.useState(t);return t&&!i&&a(!0),x.useEffect(()=>{if(t)return;const c=setTimeout(()=>a(!1),OV);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(RV,{value:e,onPin:c=>n(pV(e,c)),place:r})})})}):null}function $V({value:e,onChange:t,place:n,fields:r,hold:i}){const a=NV(),c=Fl(),u=NM(n),f=jV[n],p=le(u.inner,"w-full"),g=m=>{const w=EV[m],v=Il(mV(e,m,r==null?void 0:r.required)?"required":null,c),_=f.labelled?w.placeholder:w.panelPlaceholder,k=(e==null?void 0:e[m])??"",S=m==="postal"?p0(k):k,E=A=>{a.type(m,A),i.hold(),t(DE(e,m,A))};let O;return m==="street"?O=h.jsx("div",{className:u.shell,...v,children:h.jsx(MV,{className:p,value:a.shown(m,S),placeholder:_,ariaLabel:w.label,onChange:E,onPick:A=>{a.settleAll(),i.settle(),t(hV(A))},onBlur:()=>a.settle(m)})}):m==="state"?O=h.jsx(_V,{value:(e==null?void 0:e.state)??null,onCommit:A=>{i.hold(),t(DE(e,"state",A??""))},ariaLabel:w.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":w.label,autoComplete:"off",inputMode:m==="postal"?"numeric":void 0,maxLength:m==="postal"?10:void 0,onChange:A=>E(A.target.value),onBlur:()=>a.settle(m)})}),h.jsxs("label",{className:le(u.frame,"min-w-0",f.span[m]),children:[f.labelled&&h.jsx("span",{className:FN,children:w.label}),O]},m)};return h.jsx("div",{className:f.grid,children:zV.filter(m=>r===void 0||r.used.has(m)).map(g)})}const zV=["street","unit","city","state","postal"];function DV(e){return e===void 0||e.used.has("latitude")||e.used.has("longitude")}function HR({slot:e,value:t,onChange:n,factPath:r,place:i}){const a=Gw(r)??void 0,c=CV(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($V,{value:t,onChange:n,place:i,fields:a,hold:c}),DV(a)&&h.jsx(TV,{value:t,show:c.show,onChange:f,place:i})]})}function LV(e){return h.jsx(HR,{...e,place:"page"})}function IV(e){return h.jsx(HR,{...e,place:"panel"})}const UV={model:FR,faces:{expanded:LV,compact:IV},applyOptimistic:null},IE=["January","February","March","April","May","June","July","August","September","October","November","December"],PV=["Su","Mo","Tu","We","Th","Fr","Sa"],UE=e=>String(e).padStart(2,"0");function qR(e,t,n){return`${String(e).padStart(4,"0")}-${UE(t+1)}-${UE(n)}`}function FV(e=new Date){return qR(e.getFullYear(),e.getMonth(),e.getDate())}function PE(e){return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7))-1}}function BV(e,t){const n=e.year*12+e.month+t;return{year:Math.floor(n/12),month:(n%12+12)%12}}function HV(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:qR(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),inMonth:i.getUTCMonth()===e.month,day:i.getUTCDate()}})}const qV="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)]",FE=le(kt,"grid size-[calc(28*var(--content))] place-items-center rounded-[calc(7*var(--content))] text-ink-3 hover:bg-accent-soft hover:text-ink"),VV=le(kt,"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"),VR=le(kt,"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"),BE=le(VR,"h-[calc(40*var(--content))]"),HE=12,ZV=4,KV=4;function GV({anchorRef:e,ownerRef:t,value:n,label:r,onPick:i,onClose:a}){const[c,u]=x.useState(()=>PE(n??FV())),[f,p]=x.useState("days"),[g,m]=x.useState(0),[w,v]=x.useState(null),_=x.useRef(null),[k,S]=x.useState(n);n!==k&&(S(n),n!==null&&u(PE(n))),x.useLayoutEffect(()=>{const C=()=>{const I=e.current,$=_.current;!I||!$||v(Ml(Cs(I),{height:$.offsetHeight,minWidth:$.offsetWidth,gap:KV}))};return C(),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[e,f]),x.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(),$=T=>{T.key!=="Escape"||T.defaultPrevented||(T.preventDefault(),a())};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",$),window.addEventListener("blur",I),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",$),window.removeEventListener("blur",I)}},[t,a]);const E=C=>{C==="years"&&m(c.year-ZV),p(f===C?"days":C)},O=C=>{f==="years"?m(g+C*HE):u(BV(c,C))},A=f==="years"?"years":"month",R=(C,I,$)=>h.jsxs("button",{type:"button",className:VV,"aria-label":$,"aria-expanded":f===C,"data-open":f===C,onClick:()=>E(C),children:[I,h.jsx("span",{className:le("text-ink-4 transition-transform",f===C&&"rotate-180"),children:h.jsx(zt.chevD,{})})]});return Ur.createPortal(h.jsxs("div",{ref:_,role:"dialog","aria-label":`${r} calendar`,className:qV,style:{left:(w==null?void 0:w.left)??0,top:w?w.top:0,bottom:w==null?void 0:w.bottom,visibility:w?void 0:"hidden",zIndex:Ei},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:[R("months",IE[c.month]??"","Choose month"),R("years",String(c.year),"Choose year")]}),f!=="months"&&h.jsxs("div",{className:"flex items-center",children:[h.jsx("button",{type:"button",className:FE,"aria-label":`Previous ${A}`,onClick:()=>O(-1),children:h.jsx(zt.chevL,{})}),h.jsx("button",{type:"button",className:FE,"aria-label":`Next ${A}`,onClick:()=>O(1),children:h.jsx(zt.chevR,{})})]})]}),f==="days"?h.jsxs("div",{className:"grid grid-cols-7 gap-0.5",children:[PV.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)),HV(c).map(C=>h.jsx("button",{type:"button",className:VR,"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:IE.map((C,I)=>h.jsx("button",{type:"button",className:BE,"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:HE},(C,I)=>g+I).map(C=>h.jsx("button",{type:"button",className:BE,"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 ZR={defaultValue:null,coerce:e=>typeof e=="string"&&e!==""?e:null,isEmpty:e=>e===null,isInvalid:e=>!IA(e)};function qE({slot:e,value:t,onChange:n,required:r=!1}){const[i,a]=x.useState(!1),[c,u]=x.useState(!1),f=x.useRef(null),p=x.useRef(null),g=x.useRef(null),m=i||t!==null,w=zi(ZR,e,t,r),v=Di(),_=t!==null&&IA(t)?t:null;x.useEffect(()=>{var E;i&&((E=f.current)==null||E.focus())},[i]);const k=x.useCallback(()=>{var E;u(!1),document.activeElement!==f.current&&((E=f.current)==null?void 0:E.value)===""&&a(!1)},[]),S=m?h.jsxs(Ds,{attention:w,className:c?"border-accent":void 0,ref:g,children:[h.jsx("input",{ref:f,className:le(v.inner,"[font-variant-numeric:tabular-nums] [&::-webkit-calendar-picker-indicator]:hidden"),type:"date","aria-label":e.label,"aria-invalid":w==="invalid"||void 0,value:_??"",onFocus:()=>a(!0),onChange:E=>n(E.target.value===""?null:E.target.value),onBlur:E=>{u(!1),E.target.value===""&&a(!1)}}),h.jsx("span",{className:le(HN,v.adornEnd),children:h.jsx("button",{type:"button",className:le(kt,"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:E=>E.preventDefault(),onClick:()=>c?k():u(!0),children:h.jsx(zt.calendar,{})})})]}):h.jsx(Ds,{attention:w,children:h.jsx("button",{type:"button",className:le(kt,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(GV,{anchorRef:g,ownerRef:p,value:_,label:e.label,onPick:E=>{var O;n(E),u(!1),(O=f.current)==null||O.focus()},onClose:k}),h.jsx(MM,{attention:w,message:"Not a real date. Pick one"})]})}const YV={model:ZR,faces:{expanded:qE,compact:qE},applyOptimistic:null},KR=Kp("document",{model:{defaultValue:{file:""},coerce:EM,isEmpty:e=>e===null||e.file==="",isInvalid:()=>!1},applyOptimistic:null}),qh="data-slot-id",VE="data-slot-text-leaf",QV="data-slot-group",GR="data-slot-item",Yw="data-slot-field",YR="data-slot-unselectable",co="data-section-instance-id";function QR(e,t){const n=[];e.hasAttribute(VE)&&n.push(e),n.push(...Array.from(e.querySelectorAll(`[${VE}]`))),n.length!==0&&n.forEach(r=>{XV(r,t)})}function XV(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 hd(e){return typeof e=="string"?e:e==null?"":typeof e=="number"||typeof e=="boolean"?String(e):""}function WV(e){const[t,n]=x.useState(e),[r,i]=x.useState(e);return e!==r&&(i(e),n(e)),[t,n]}function Qw({kind:e,slot:t,value:n,onChange:r,required:i=!1}){var w;const a=n??"",[c,u]=WV(a),f=zi(e.model,t,c,i),p=e.invalidMessage(c,t),g=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=Di();return h.jsxs("div",{className:m.frame,children:[h.jsxs(Ds,{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=>g(v.target.value)}),!m.inline&&((w=e.adornment)==null?void 0:w.call(e,c))]}),h.jsx(MM,{attention:f,message:p})]})}const XR={model:{defaultValue:"",coerce:hd,isEmpty:e=>e.trim()==="",isInvalid:e=>!qD(e.trim())},normalize:e=>e.trim(),invalidMessage:()=>"Not a valid email address",inputType:"email",inputMode:"email",autoComplete:"email",placeholder:"name@example.com"};function ZE(e){return h.jsx(Qw,{kind:XR,...e})}const JV={model:XR.model,faces:{expanded:ZE,compact:ZE},applyOptimistic:null},WR="section";function JR(e,t){const{itemKind:n,view:r,granularity:i}=IC(e,t,WR),a=n==="object"||n==="annotated-media"?{kind:"record",entries:Kw(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 hv(e,t){const n=Dn(e),r=Dn(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)=>hv(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=>hv(i[u],a[u]))}return KE(e)===KE(t)}function KE(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):null}function eZ(e,t,n,r,i){const a=xi(u=>u.markSlotOverridden),c=!i&&!j8(e);return function(f,p){c&&a(t,n,{kind:"scalar"}),r(f.map(g=>g.value))}}function Su(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function tZ(e){var t;return((t=Su(e.element))==null?void 0:t.type)==="row"}function Xw(e,t){var r;const n=(r=Su(e))==null?void 0:r.decisions;if(Array.isArray(n))return n.find(i=>{var c;const a=(c=Su(i))==null?void 0:c.produces;return Array.isArray(a)&&a[0]===t})}function Ww(e,t,n){const r=Su(t),i=E8(r).some(g=>g.verb==="pick")||tZ(e),a=s6({slots:{},...n===void 0?{}:{sectionSlots:n}},e);switch(O8(e).kind){case"table":{const g=Xu(e.source);return g===null?{kind:"owned"}:{kind:"table",table:g}}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=fL(r==null?void 0:r.of);return p===null?{kind:"owned"}:{kind:"pick-media",filter:p}}function Jw(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 eT(e){const t=Jw(e);return t.length===1?t[0]:null}const pd="id";function tT(e){const[t,...n]=[...new Set(e)];return t===void 0?null:[t,...n]}function ex(e){return tT(Jw(e))}const nZ=()=>null;function md(e){const t=tT(wu(e));return t===null?{kind:"none"}:e.source===void 0?{kind:"table",tables:t}:{kind:"table",tables:t,inert:!0}}function pv(e,t,n){const r=ex(t);if(r!==null)return{kind:"table",tables:r};const i=Su(e.source);return t.kind==="follows"&&(i==null?void 0:i.kind)==="section"?rZ(i,n):{kind:"none"}}function rZ(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}))??nZ}}function Vh(e,t){const n=e[t];return typeof n=="string"&&n!==""?n:null}function nT({instanceId:e,slotId:t,membership:n,itemBaseline:r,insideRecord:i}){const a=xi(w=>w.markSlotOverridden),c=xi(w=>w.relinkSlot),u=pd,f=eT(n)===null&&n.kind!=="follows",p=n.kind==="table"||n.kind==="follows",g=w=>Vh(w,u),m=w=>g(w.value)??(f?w.key:null);return{identityKey:u,identityOf:g,stamp:w=>f?w.map(v=>g(v.value)===null?{key:v.key,value:{...v.value,[u]:v.key}}:v):w,markerIdentity:m,markFields:(w,v)=>{if(i)return;const _=m(w);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&&hv(v[S],k[S])?c(e,t,{kind:"item",item_id:_,field:S}):a(e,t,{kind:"item",item_id:_,field:S}))},markRemoved:w=>{if(i||n.kind!=="table")return;const v=g(w.value);v!==null&&!xl(v)&&a(e,t,{kind:"item_removed",item_id:v})},markOrder:w=>{if(i||!p||r===void 0)return;const v=w.map(O=>g(O.value)).filter(O=>O!==null),_=new Set(v),k=r.map(O=>Vh(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 oZ(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 rT(e,t,n){return e(`/properties/${t}/poi/${encodeURIComponent(n)}`)}async function iZ(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 oT(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 Zh=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Vc=e=>typeof e=="string"&&e!==""?e:void 0;function sZ(e){const t={},n=Zh(e.rating);n!==void 0&&(t.rating=n);const r=Zh(e.review_count);r!==void 0&&(t.review_count=r);const i=Vc(e.type_label);i!==void 0&&(t.type_label=i);const a=Vc(e.price_level);a!==void 0&&(t.price_level=a);const c=Vc(e.website_uri);c!==void 0&&(t.website_uri=c);const u=Vc(e.google_maps_uri);u!==void 0&&(t.google_maps_uri=u);const f=Vc(e.summary);f!==void 0&&(t.summary=f);const p=aZ(e.photo);return p!==void 0&&(t.photo=p),t}function aZ(e){if(!e||typeof e!="object")return;const t=e,n=Zh(t.width),r=Zh(t.height),i=t.attribution;if(!(n===void 0||r===void 0||typeof i!="string"))return{width:n,height:r,attribution:i}}function tx(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,...sZ(t)}}function lZ(e){return e.map(tx).filter(t=>t!==null)}function cZ(e){return[e.rating===void 0?null:`★ ${e.rating.toFixed(1)}${e.review_count===void 0?"":` (${e.review_count.toLocaleString()})`}`,e.type_label,oT(e.distance_m),e.address].filter(Boolean).join(" · ")}const nx="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]",rx="grid w-5 flex-shrink-0 place-items-center text-ink-4",ox="flex min-w-0 flex-1 flex-col gap-px",ix="truncate text-[length:calc(13.5*var(--content))] text-ink",sx="truncate text-caption text-ink-3",uZ="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",iT="text-caption text-danger",sT="opacity-70",aT="size-[calc(14*var(--content))] flex-shrink-0 animate-[we-ml-spin_.7s_linear_infinite] rounded-full border-2 border-[#d9d5c9] border-t-accent",dZ="size-[calc(26*var(--content))] flex-shrink-0 rounded-[calc(5*var(--content))] object-cover bg-[#f1f0ea]",fZ="we-no-drag flex flex-shrink-0 items-center gap-0.75",hZ="flex items-center gap-0.75 opacity-0 transition-opacity duration-[120ms] group-hover/row:opacity-100",pZ="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",mZ=()=>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 lT(e,t){const{apiFetch:n}=nn().api,[r,i]=x.useState({}),a=t.filter(u=>u.photo).map(u=>u.place_id).sort().join(","),c=x.useRef(new Set);return x.useEffect(()=>{const f=(a===""?[]:a.split(",")).filter(p=>!c.current.has(p));f.length!==0&&(f.forEach(p=>c.current.add(p)),iZ(n,e,f).then(p=>{i(g=>({...g,...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 cT({row:e,photoUrl:t,onPhotoError:n,onRemove:r,dragProps:i,flashNew:a}){const c=cZ(e);return h.jsxs("div",{...i,className:le(nx,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:dZ,src:t,alt:"",draggable:!1,onError:n}):h.jsx("span",{className:rx,children:h.jsx(mZ,{})}),h.jsxs("div",{className:ox,children:[h.jsx("span",{className:ix,children:e.name}),c&&h.jsx("span",{className:sx,children:c})]}),r&&h.jsx("div",{className:fZ,children:h.jsx("span",{className:hZ,children:h.jsx("button",{type:"button",className:le(pZ,"hover:bg-[#fbecea] hover:text-danger"),title:"Remove",onClick:r,children:h.jsx(zt.trash,{})})})})]})}const gZ="relative flex flex-col",yZ="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)]",bZ="grid flex-shrink-0 place-items-center text-ink-4",vZ="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",wZ="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)]",kZ="m-0 min-h-0 list-none overflow-y-auto p-1",_Z={maxHeight:264,gap:4},SZ=le(kt,"flex w-full flex-col gap-px rounded-md px-2 py-1.75 text-left"),EZ="bg-accent-soft",jZ="cursor-default opacity-55",OZ="flex items-center gap-1.5 truncate text-[length:calc(13.5*var(--content))] text-ink",AZ="truncate text-caption text-ink-3",qy="px-3 py-3 text-center text-[length:calc(12.5*var(--content))] text-ink-4",CZ="inline-flex flex-shrink-0 items-center gap-1 text-good",NZ=2,MZ=300;function uT({propertyId:e,placeholder:t,addedIds:n,disabled:r=!1,disabledHint:i,onSelect:a}){const{apiFetch:c}=nn().api,[u,f]=x.useState(""),[p,g]=x.useState([]),[m,w]=x.useState("idle"),[v,_]=x.useState(0),[k,S]=x.useState(0),E=x.useRef(0),O=x.useId(),A=x.useRef(null),R=x.useRef(null);x.useEffect(()=>{const F=u.trim();if(F.length<NZ){++E.current,w("idle"),g([]);return}const W=++E.current;w("loading");const G=setTimeout(()=>{oZ(c,e,F).then(H=>{W===E.current&&(g(H),_(0),w(H.length?"results":"empty"))}).catch(()=>{W===E.current&&w("error")})},MZ);return()=>clearTimeout(G)},[u,e,k,c]);function C(F){n.has(F.place_id)||(a(F),f(""),g([]),w("idle"))}function I(F){if(F.key==="Escape"){m!=="idle"&&F.preventDefault(),w("idle"),g([]);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 $=m!=="idle",T=kD($,A,_Z);return h.jsxs("div",{className:gZ,onBlur:F=>{var G;const W=F.relatedTarget;!F.currentTarget.contains(W)&&!((G=R.current)!=null&&G.contains(W))&&w("idle")},children:[h.jsxs("div",{ref:A,className:le(yZ,r&&"opacity-55"),role:"combobox","aria-expanded":$,"aria-haspopup":"listbox","aria-controls":O,children:[h.jsx("span",{className:bZ,children:h.jsx(zt.search,{})}),h.jsx("input",{className:vZ,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:wZ})]}),$&&T&&Ur.createPortal(h.jsxs("div",{ref:R,className:xZ,style:{left:T.left,top:T.top,bottom:T.bottom,width:T.width,maxHeight:T.maxHeight,zIndex:Ei},onMouseDown:F=>F.preventDefault(),children:[m==="loading"&&h.jsx("div",{className:qy,children:"Searching…"}),m==="empty"&&h.jsxs("div",{className:qy,children:["No places found for “",u.trim(),"”."]}),m==="error"&&h.jsxs("div",{className:qy,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:kZ,role:"listbox",id:O,children:p.map((F,W)=>{const G=n.has(F.place_id),H=[oT(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:le(SZ,W===v&&!G&&EZ,G&&jZ),onMouseEnter:()=>_(W),onClick:()=>C(F),children:[h.jsxs("span",{className:OZ,children:[G&&h.jsxs("span",{className:CZ,children:[h.jsx(zt.check,{size:12})," Added ·"]}),h.jsx("span",{className:"truncate",children:F.name})]}),H&&h.jsx("span",{className:AZ,children:H})]})},F.place_id)})})]}),document.body)]})}const RZ="flex flex-col gap-2.75",TZ="relative flex flex-col gap-1.75",$Z=400;function zZ({slot:e,fixed:t,value:n,propertyId:r,commit:i}){const{apiFetch:a}=nn().api,c=x.useMemo(()=>lZ(n),[n]),[u,f]=x.useState(null),[p,g]=x.useState(null),[m,w]=x.useState({}),v=x.useRef({});x.useEffect(()=>()=>{Object.values(v.current).forEach(clearTimeout)},[]);const _=$i({items:c,identityOf:$=>$.id,fixed:t,axis:"y",commit:i}),{rows:k}=_,{urls:S,dropUrl:E}=lT(r,c);function O($){w(T=>({...T,[$]:!0})),clearTimeout(v.current[$]),v.current[$]=setTimeout(()=>w(T=>{const F={...T};return delete F[$],F}),$Z)}async function A($){if(f(null),!!_.canAdd&&!_.latestRows().some(T=>T.value.place_id===$.place_id)){g($);try{let T;try{T=await rT(a,r,$.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{g(null)}}}const{containerRef:R,getItemProps:C}=_.drag,I=new Set(k.map($=>$.value.place_id));return h.jsxs("div",{className:RZ,role:"group","aria-label":e.label,children:[h.jsx(uT,{propertyId:r,placeholder:e.placeholder??"Search nearby…",addedIds:I,disabled:!_.canAdd,disabledHint:"Set by its source",onSelect:$=>void A($)}),u&&h.jsx("span",{className:iT,children:u}),(k.length>0||p)&&h.jsxs("div",{className:TZ,ref:R,children:[p&&h.jsxs("div",{className:le(nx,sT),"aria-live":"polite",children:[h.jsx("span",{className:rx,children:h.jsx("span",{className:aT})}),h.jsxs("div",{className:ox,children:[h.jsx("span",{className:ix,children:p.name}),h.jsx("span",{className:sx,children:"Adding…"})]})]}),k.map($=>h.jsx(cT,{row:$.value,photoUrl:S[$.value.place_id],onPhotoError:()=>E($.value.place_id),onRemove:_.canRemove?()=>_.remove($.key):void 0,dragProps:C($.key),flashNew:m[$.value.id]===!0},$.key))]})]})}const DZ={property:"this property's",library:"your"},LZ={property:dt.pages,library:_r.pages};function Zc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function GE(e){return Sp({from:e.from??[]}).filter(t=>t!=="")}function IZ(e){var r;const t=Zc(e.source);if(Xu(t)!==null)return[String(t==null?void 0:t.key)];const n=Zc(e.element);if(n===null)return[];if(n.type==="row"||n.type==="media"||typeof n.type=="string"&&xo(n.type))return GE(n);for(const i of Object.values(Zc(n.fields)??{})){const a=Zc(i);if(a!==null&&((r=Zc(a.source))==null?void 0:r.kind)==="element")return GE(a)}return[]}function UZ(e){const t=e.indexOf("."),n=e.slice(0,t);if(n!=="property"&&n!=="library")return null;const r=LZ[n],i=e.slice(t+1),a=Object.hasOwn(r,i)?r[i]:null;return a!==null&&Ep(a)&&a.declaration.type==="list"?{home:n,label:Mi(a)}:null}function dT(e){const t=[...new Set(IZ(e))],n=t.length===1?UZ(t[0]):null;return n===null?null:`From ${DZ[n.home]} ${Ir(n.label).plural}`}function PZ(e,t){var n;return((n=e==null?void 0:e.order)==null?void 0:n[t])===!0}function ax(e,t){var n;return((n=e==null?void 0:e.scalar)==null?void 0:n[t])===!0}function gd(e,t){return`${e}.${t}`}function Mo(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 Dt(e,t){const n=Mo(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 FZ(e,t,n){const r=Mo(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 BZ(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 HZ(e,t){var n;return{...((n=e==null?void 0:e.items)==null?void 0:n[t])??{}}}function fT(e,t){var n;return{...((n=e==null?void 0:e.items_removed)==null?void 0:n[t])??{}}}function qZ(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}const lx=e=>{var t;return(t=qZ(e))==null?void 0:t.source};function VZ(e,t){return Object.entries(e).flatMap(([n,r])=>{const i=qs(lx(r));return i!==null&&i.slot===t?[{key:n,member:i.field}]:[]})}function ZZ(e,t){const n=e,r=[],i=(a,c,u)=>{var p;const f=qs(lx(c));f!==null&&((p=lC(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=Hl(c);if(u===null){i(a,c,{});continue}const f=u.fields;for(const[p,g]of Object.entries(u.fields))i(gd(a,p),g,{container:a,siblings:f})}return r}function KZ(e,t){var i;const n=qs(lx(e));if(n===null)return!1;const r=t.fields===void 0?{}:{siblings:t.fields};return((i=aC(t.slots??{},r,n.slot))==null?void 0:i.def.type)==="address"}function _l(e){var t;return((t=e.source)==null?void 0:t.kind)==="element"}function hT(e){return e.type==="row"}function pT(e,t,n){const r={};for(const i of VZ(Object.fromEntries(e),t))Object.hasOwn(n,i.member)&&(r[i.key]=n[i.member]);return r}function cx(e,t,n,r){const i=Ka(e);for(const[a,c]of e)_l(c)&&(i[a]=n,r&&Object.assign(i,pT(e,a,r)));return i[t]=n,i}function mT(e,t,n){var a;const r=(a=t.find(([,c])=>hT(c)&&_l(c)))==null?void 0:a[0],i=r!==void 0?e[r]:void 0;return typeof i=="string"&&i!==""?i:Vh(e,n)}function Kh(e,t,n){return e.flatMap(r=>mT(r,t,n)??[])}function GZ(e,t){return e.map(n=>{const r=t.get(n);return r===void 0?{id:n}:{id:n,members:r}})}function gT(e,t,n,r,i,a){return Pl(e,GZ(r,i),c=>mT(c,t,n),c=>cx(t,n,c.id,c.members),a)}function YZ(e,t,n,r,i){const a=e.map((u,f)=>({key:String(f),value:u}));return gT(a,t,n,r,i,u=>({key:"",value:u})).map(u=>u.value)}const QZ=new Set(["text","select","date"]),XZ=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function WZ(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:XZ.format(a)}return Ks({kind:"field",field:r},t,n)}function JZ(e,t,n){const r=Dr(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=tn(t[r.field]),u=h0((c==null?void 0:c.street)??null,(c==null?void 0:c.unit)??null);return u!==""?u:n}const a=Ks(r,e,t);return a==="Untitled"?n:a}function eK(e,t,n){const r=Ln(e);if(r===null)return{title:n,supporting:null,image:null};const i=Dr(r,n),a=i.kind==="field"?i.field:null,c=Zs(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),g=m=>{for(const[w,v]of p){if(!m(v.type))continue;const _=WZ(v,r,t,w);if(_!==null)return _}return null};return{title:JZ(r,t,n),supporting:g(m=>QZ.has(m))??g(m=>m==="number"),image:u===void 0?null:{field:u[0],value:t[u[0]]??null}}}function tK(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 nK="flex min-w-0 flex-1 items-center gap-[calc(12*var(--content))]",rK={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))]"},yT={bar:"text-[length:calc(15*var(--content))]",cell:"text-[length:calc(12.5*var(--content))]"},oK={bar:"text-[length:calc(13.5*var(--content))]",cell:"text-[length:calc(12*var(--content))]"};function gh({face:e,imageUrl:t,size:n="bar"}){return h.jsxs("span",{className:nK,"data-row-face":"",children:[e.image!==null&&h.jsx("span",{className:le("relative grid shrink-0 place-items-center overflow-hidden bg-line-soft font-semibold text-ink-3",rK[n]),"data-row-face-thumb":"",children:t?h.jsx("img",{src:t,alt:"",className:"absolute inset-0 size-full object-cover object-top"}):tK(e.title)}),h.jsxs("span",{className:"flex min-w-0 items-baseline gap-[calc(8*var(--content))]",children:[h.jsx("span",{className:le("min-w-0 shrink truncate font-medium text-ink",yT[n]),children:e.title}),e.supporting!==null&&h.jsx("span",{className:le("min-w-0 shrink-[2] truncate text-ink-3",oK[n]),children:e.supporting})]})]})}function go({children:e,size:t="bar"}){return h.jsx("span",{className:le("min-w-0 flex-1 truncate text-ink-4",yT[t]),children:e})}const iK="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",YE={contacts:"Contact",units:"Unit",comparables:"Comparable",commercial_spaces:"Commercial space"};function Eu(e){return typeof e=="string"&&e!==""?e:null}function sK(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=Eu(n[t]);return i===null?[]:[i]})}function aK({slot:e,value:t,onChange:n,onRowPick:r,recordContext:i,...a}){var _;const{TablePicker:c}=nn(),[u,f]=x.useState(null),p=a.rowTable??md(e),g=p.kind==="table"&&p.inert!==!0?p.tables:null,m=!_l(e),w=(k,S)=>{k!==t&&(r?r(k,S):n(k))},v=UC(e.label);return h.jsxs("div",{className:$s,role:"group","aria-label":e.label,children:[h.jsxs("div",{className:iK,children:[h.jsx(ux,{rowTable:p,value:t}),g!==null&&c!==void 0&&h.jsxs("span",{className:hR,children:[t!==null&&!xl(t)&&h.jsx(bT,{label:`Edit ${v}`,onClick:()=>f("record")}),m&&h.jsx(lK,{label:((_=Aw(e).choose)==null?void 0:_.label)??_u("Choose",v),onClick:()=>f("pick")}),m&&t!==null&&h.jsx(Zp,{icon:zl,label:`Remove ${v}`,title:"Remove",tone:"remove",onClick:()=>w(null,{})})]})]}),u==="record"&&t!==null&&g!==null&&c!==void 0&&h.jsx(c,{open:!0,mode:"record",tables:g,rowId:t,onClose:()=>f(null)}),u==="pick"&&g!==null&&c!==void 0&&h.jsx(c,{open:!0,mode:"single",tables:g,selectedId:t,disabledIds:sK(i),onPick:w,onClose:()=>f(null)})]})}function bT({label:e,onClick:t}){return h.jsx(Zp,{icon:ew,label:e,title:"Edit",onClick:t})}function lK({label:e,onClick:t}){return h.jsx(Zp,{icon:eR.Choose,label:e,title:"Choose",onClick:t})}function ux({rowTable:e,value:t,size:n="bar"}){const{TableRowSummary:r}=nn();switch(e.kind){case"table":{if(xl(t))return h.jsx(gh,{face:{title:`New ${YE[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=YE[e.tables[0]];return t===null?h.jsxs(go,{size:n,children:["No ",i.toLowerCase()," chosen"]}):h.jsx(gh,{face:{title:i,supporting:null,image:null},size:n})}case"content":return t===null?h.jsx(go,{size:n,children:"None"}):h.jsx(gh,{face:{title:e.labelOf(t)??"Untitled",supporting:null,image:null},size:n});case"none":return h.jsx(go,{size:n,children:"Set automatically"})}}const cK={model:{defaultValue:null,coerce:Eu,isEmpty:e=>e===null,isInvalid:()=>!1},faces:{compact:aK},applyOptimistic:null};function uK(e){var t,n,r,i;switch(LC(e,WR)){case"media":return((t=e.element)==null?void 0:t.type)==="media"?Ly:((n=e.element)==null?void 0:n.type)==="video"?VP:((r=e.element)==null?void 0:r.type)==="tour"?nw:((i=e.element)==null?void 0:i.type)==="document"?Ly:tv;case"upload":return Ly;case"poi":return k9;case"annotated-media":return tv;case"object":case"row":return OP;case"scalar":return LN}}function Yp(e){switch(e.type){case"text":return c7;case"url":return J0;case"image":case"media":return $p;case"video":return iw;case"tour":return nw;case"poi":return IN;case"address":return v9;case"document":return Tp;case"select":return C9;case"list":return uK(e);default:return Y0}}function vT(e){const t=new Set(e.map(Yp));return t.size===1?[...t][0]:Y0}const dK="relative flex flex-col gap-2",fK={large:"gap-3",compact:"gap-2"},hK="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",pK={field:"cursor-text",bar:"cursor-grab pr-2"},mK=le(kt,"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 gK(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 dx({engine:e,itemKind:t="field",label:n,add:r,choose:i,size:a,renderControl:c,renderActions:u,onAdd:f,renderAdd:p,addUnbound:g=!1,empty:m}){const{rows:w,drag:v}=e,{containerRef:_,getItemProps:k}=v,S=p==null?void 0:p(e.add),E=w.length===0&&m!==void 0&&S==null;return h.jsx("div",{className:$s,role:"group","aria-label":n,children:h.jsxs("div",{className:le("flex flex-col",fK[a]),children:[e.canAdd&&h.jsx(id,{size:a,add:r,onAdd:g?null:()=>f(e.add),choose:i}),E&&m,S,w.length>0&&h.jsx("div",{className:dK,ref:_,children:w.map(O=>h.jsxs("label",{htmlFor:O.key,onClick:gK,...k(O.key),className:le(hK,pK[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(zt.grip,{})}),c({id:O.key,value:O.value,onChange:A=>e.setValue(O.key,A)}),t==="bar"&&h.jsxs("span",{className:hR,children:[u==null?void 0:u({id:O.key,value:O.value}),e.canRemove&&h.jsx(Zp,{icon:zl,label:`Remove ${Ir(n).singular}`,title:"Remove",tone:"remove",onClick:()=>e.remove(O.key)})]}),e.canRemove&&t==="field"&&h.jsx("button",{type:"button",className:mK,title:"Remove",onClick:()=>e.remove(O.key),children:h.jsx(zt.trash,{})})]},O.key))})]})})}function yK({engine:e,label:t,add:n,placeholder:r="List item",maxLength:i,size:a}){return h.jsx(dx,{engine:e,label:t,add:n,size:a,renderControl:({id:c,value:u,onChange:f})=>h.jsx(C7,{id:c,value:u,onChange:f,placeholder:r,ariaLabel:r,maxLength:i,className:le("cursor-[inherit]",qN)}),onAdd:c=>c("")})}const bK="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",vK="relative h-[calc(280*var(--frame))]",wK=5,xK=le("flex items-center gap-2 rounded-[calc(8*var(--content))] px-2.75 py-[calc(7*var(--content))] pr-2",aw),kK=le("block size-[calc(13*var(--content))] rounded-[calc(3*var(--content))]",$n),QE=["w-[28%]","w-[22%]","w-[34%]"];function _K({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:le("block h-[calc(14*var(--content))] w-[calc(6*var(--content))] rounded-full",$n)})}),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:le("block size-[calc(32*var(--content))] shrink-0 rounded-[calc(7*var(--content))]",$n)}),h.jsx("span",{className:le("block h-[calc(10*var(--content))] rounded-full",$n,QE[e%QE.length])}),h.jsx("span",{className:le("block h-[calc(8*var(--content))] w-[16%] rounded-full",$n)})]}),[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:kK})},t))]})}function SK(e){return Eu(typeof e=="object"&&e!==null?e.id:e)}function EK({slot:e,face:t,rowTable:n,verbs:r,fixed:i,value:a,commit:c}){const{TablePicker:u,TableCreate:f}=nn(),p=$i({items:a.map(SK),fixed:i,axis:"y",commit:c}),[g,m]=x.useState(!1),[w,v]=x.useState(!1),[_,k]=x.useState(null),S=n.kind==="table"&&n.inert!==!0?n.tables:null,E=S!==null?u:void 0,O=S!==null?f:void 0,A=Ir(e.label).singular,R=()=>m(!0),C=E!==void 0&&r.choose!==null?{choose:r.choose,onChoose:R}:void 0,I=r.add,$=()=>v(!0),T=O!==void 0,F=p.rows.flatMap(G=>G.value!==null?[G.value]:[]),W=t==="expanded"&&p.rows.length===0?dT(e):null;return h.jsxs(h.Fragment,{children:[h.jsx(dx,{engine:p,itemKind:"bar",label:e.label,add:I,...C!==void 0?{choose:C}:{},size:t==="expanded"?"large":"compact",addUnbound:!T,onAdd:$,...t==="expanded"?{empty:h.jsxs("div",{className:vK,children:[h.jsx(od,{className:"flex flex-col gap-2",children:Array.from({length:wK},(G,H)=>h.jsx(_K,{position:H},H))}),h.jsx(Dh,{icon:pi.createElement(Yp(e),{size:25,strokeWidth:1.8}),headline:I.empty,...W!==null?{line:W}:{}})]})}:{},renderControl:({id:G,value:H})=>h.jsx("div",{id:G,className:bK,children:h.jsx(ux,{rowTable:n,value:H})}),renderActions:({value:G})=>E!==void 0&&G!==null&&h.jsx(bT,{label:`Edit ${A}`,onClick:()=>k(G)})}),_!==null&&E!==void 0&&S!==null&&h.jsx(E,{open:!0,mode:"record",tables:S,rowId:_,onClose:()=>k(null)}),w&&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)}),g&&E!==void 0&&S!==null&&h.jsx(E,{open:!0,mode:"multi",tables:S,selectedIds:F,onChange:G=>p.replace(Pl(p.rows,G.map(H=>({id:H})),H=>H,H=>H.id,p.mint)),onClose:()=>m(!1)})]})}const jK=12;function OK(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 AK({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(At,{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(CK,{open:i})]})}function CK({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(At,{name:"chevDown",size:14,stroke:1.8})})}const Kc=new WeakSet;function wT({open:e,onToggle:t,icon:n,title:r,subtitle:i,scrollKey:a,dragId:c,dragHandleProps:u,adornment:f,children:p}){const g=x.useRef(null);return x.useEffect(()=>{if(!e)return;const m=g.current,w=m==null?void 0:m.closest(".hp-sb-scroll");if(!m||!w||Array.from(m.querySelectorAll(".we-acc")).some(O=>Kc.has(O)))return;Kc.add(m);const v=window.matchMedia("(prefers-reduced-motion: reduce)").matches,_=()=>{Kc.delete(m);const O=m.getBoundingClientRect(),A=w.getBoundingClientRect(),R=OK({top:O.top-A.top,bottom:O.bottom-A.top,height:O.height},w.clientHeight,w.scrollTop,jK);R!=null&&w.scrollTo({top:R,behavior:v?"auto":"smooth"})};if(v){const O=requestAnimationFrame(_);return()=>{cancelAnimationFrame(O),Kc.delete(m)}}const k=new AbortController,S=()=>{k.abort(),window.clearTimeout(E),_()};m.addEventListener("transitionend",O=>{O.propertyName==="grid-template-rows"&&O.target instanceof Node&&O.target.parentNode===m&&S()},{signal:k.signal});const E=window.setTimeout(S,280);return()=>{k.abort(),window.clearTimeout(E),Kc.delete(m)}},[e,a]),h.jsxs("div",{ref:g,"data-open":e,"data-dragid":c,className:le("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:le("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(AK,{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 XE(e){return zC(e)}function NK(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n+1];XE(e[n])&&r!==void 0&&XE(r)?(t.push({kind:"pair",indices:[n,n+1]}),n++):t.push({kind:"single",index:n})}return t}function MK({items:e,rows:t}){const n=r=>r&&h.jsxs("div",{className:`${$s} min-w-0`,...r.attrs,children:[r.label!==null?h.jsx(A7,{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 RK='input, textarea, select, button, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]',Gh="data-field-name",fx="data-field-scope";function TK(e,t){var r;const n=(r=e.parentElement)==null?void 0:r.closest(`[${fx}]`);return n==null||n===t||!t.contains(n)}function xT(e,t){var r;const n=Array.from(e.querySelectorAll(`[${Gh}]`)).find(i=>i.getAttribute(Gh)===t&&TK(i,e));n&&(n.scrollIntoView({block:"nearest"}),(r=n.querySelector(RK))==null||r.focus({preventScroll:!0}))}function $K(e){const t={fields:Object.fromEntries(e)};return e.filter(([,n])=>Sl(n,t)&&!TA(n))}const zK="data-object-fields";function hx({fields:e,lone:t=!1,reveal:n,renderField:r}){const i=yw(),a=$K(e),c=x.useRef(null);return x.useEffect(()=>{if(!n)return;const u=requestAnimationFrame(()=>{c.current&&xT(c.current,n)});return()=>cancelAnimationFrame(u)},[n]),h.jsx("div",{ref:c,[zK]:i,[fx]:"",children:h.jsx(MK,{rows:NK(a.map(([,u])=>u)),items:a.map(([u,f])=>({key:u,label:t?null:f.label||u,attrs:{[Gh]:u},node:r(u,f)}))})})}function ql({slot:e,instanceId:t,slotId:n,value:r,propertyId:i,onChange:a,required:c,overridden:u,selectedItemIndex:f,selectedFieldName:p,itemBaseline:g,boundRowId:m,boundRowTable:w,membership:v,rowTable:_,onRowPick:k,onUpload:S,recordContext:E,factPath:O}){const A=yw(),R=$7(e.type==="list"?void 0:O),C=Gs(e.type);if(!C)return null;const I=NB(A),$=C.faces[I];if(!$)return null;const T=C.model.coerce(r),F=h.jsx($,{slot:e,instanceId:t,slotId:n,value:T,onChange:a,required:c,propertyId:i,selectedItemIndex:f,selectedFieldName:p,overridden:u,itemBaseline:g,boundRowId:m,boundRowTable:w,membership:v,rowTable:_,onRowPick:k,onUpload:S,recordContext:E,factPath:O});return R===null?F:h.jsxs("div",{className:"flex flex-col gap-[calc(6*var(--content))]",children:[F,h.jsx(z7,{mark:R})]})}const DK=le(kt,"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"),LK="relative flex flex-col gap-3";function IK(e,t){return _l(e)?t:md(e)}function UK({slot:e,entries:t,fixed:n,instanceId:r,slotId:i,value:a,commit:c,membership:u,verbs:f,selectedItemIndex:p,selectedFieldName:g,itemBaseline:m,rowTable:w,insideRecord:v=!1,factPath:_}){var Nt;const{TablePicker:k,TableCreate:S}=nn(),E=vT(t.map(([,ke])=>ke)),O=xi(ke=>ke.session.property_id),A=xi(ke=>ke.select),R=xi(ke=>{var Ce,Ve;return(Ve=(Ce=ke.content_doc)==null?void 0:Ce.instances.find(it=>it.instance_id===r))==null?void 0:Ve.slot_overrides}),C=u.kind==="table"?u.table:null,I=nT({instanceId:r,slotId:i,membership:u,itemBaseline:m,insideRecord:v}),{identityKey:$}=I,T=Ln(e)??{fields:Object.fromEntries(t)},F=td(Ir(e.label).singular),{add:W}=f,G=(ke,Ce)=>Ks(Dr(T,`${F} ${Ce+1}`),T,ke),H=Dr(T,""),U=H.kind==="field"?H.field:void 0,[z,K]=x.useState(!1),[N,B]=x.useState(!1),[Y,ie]=x.useState(null);function J(ke){A({kind:"slot",instance_id:r,slot_id:i,item_index:ke})}const L=x.useRef(null),Q=$i({items:a,identityOf:I.identityOf,fixed:n,axis:"y",commit:(ke,Ce)=>{I.markOrder(ke),c(I.stamp(ke),Ce)},onCommitted:(ke,Ce)=>{const Ve=L.current;if(v||Ce!=="reorder"&&Ce!=="replace"||Ve==null)return;const it=ke.findIndex(Ye=>Ye.key===Ve);it<0?A({kind:"slot",instance_id:r,slot_id:i}):(Ce==="reorder"||it!==Q.indexOf(Ve))&&J(it)}}),{rows:D}=Q,Z=v?Y:p!=null?Q.keyAt(p):null,te=Z!=null?Q.indexOf(Z):-1;x.useEffect(()=>{L.current=Z},[Z]);function de(ke){if(v){ie(ke);return}const Ce=Q.indexOf(ke);Ce<0||J(Ce)}function fe(){v?ie(null):A({kind:"slot",instance_id:r,slot_id:i})}function pe(ke){Z===ke?fe():de(ke)}const P=u.kind==="pick-row"||u.kind==="table"?ex(u):null,ce=Q.canAdd&&(u.kind!=="pick-row"||S!==void 0),me=f.choose!==null&&Q.canAdd&&(P!==null&&k!==void 0||u.kind==="pick-media"),Se=(Nt=t.find(([,ke])=>_l(ke)))==null?void 0:Nt[0];function $e(ke){const Ce=Q.mint(ke);Q.insert(Ce),v?ie(Ce.key):J(0)}function Ie(){me&&K(!0)}function xe(){if(ce){if(u.kind==="pick-row"){B(!0);return}if(u.kind==="pick-media"){K(!0);return}$e(C?{...Ka(t),[$]:pR()}:Ka(t))}}function Le(ke,Ce){Q.replace(gT(D,t,$,ke,Ce,Q.mint))}function ne(ke,Ce){const Ve=Ka(t);for(const[it,Ye]of t)_l(Ye)&&(Ve[it]=Ye.type==="image"?jw(ke,{file:"",url:"",alt:""},Ce,BC(Ye.crop),u.kind==="pick-media"?u.filter.from:void 0):{file:ke.file,url:vl(ke),alt:""});return Ve}function be(ke){var Ve;const Ce=Se===void 0||(Ve=ke[Se])==null?void 0:Ve.file;return typeof Ce=="string"&&Ce!==""?Ce:null}function Re(ke,Ce){const Ve=Pl(D,ke,be,Ye=>ne(Ye,Ce),Q.mint),it=new Set(Ve.map(Ye=>Ye.key));for(const Ye of D)it.has(Ye.key)||I.markRemoved(Ye);Q.replace(Ve)}function Pe(ke){if(!Q.canRemove)return;const Ce=D.find(it=>it.key===ke);Ce&&I.markRemoved(Ce);const Ve=Q.indexOf(ke);Q.remove(ke),Z===ke?fe():!v&&te>=0&&Ve>=0&&Ve<te&&J(te-1)}function ht(ke,Ce,Ve={}){const it=D.find(Ye=>Ye.key===ke);it!=null&&(I.markFields(it,Ce),Q.setValue(ke,{...it.value,...Ve,...Ce}))}function Ke(ke,Ce,Ve,it){const Ye=D.find(rn=>rn.key===ke);if(Ye==null)return;const Mt=I.markerIdentity(Ye),wt=Ve===null?{}:pT(t,Ce,it);if(Mt!==null)for(const rn of Object.keys(wt))BZ(R,i,Mt,rn)&&delete wt[rn];ht(ke,{[Ce]:Ve},wt)}const{containerRef:En,getItemProps:ct,draggingKey:Wn}=Q.drag,Jn=me&&f.choose!==null?{choose:f.choose,onChoose:Ie}:void 0;return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(id,{size:"compact",add:W,onAdd:ce?xe:null,choose:Jn}),D.length>0&&h.jsx("div",{ref:En,className:LK,children:D.map((ke,Ce)=>{const Ve=G(ke.value,Ce),it=Z===ke.key;return h.jsx("div",{children:h.jsx(wT,{open:Wn==null&&it,onToggle:()=>pe(ke.key),icon:h.jsx(E,{size:14}),title:Ve,scrollKey:ke.key,dragId:ke.key,dragHandleProps:{onPointerDown:ct(ke.key).onPointerDown},children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsx(hx,{fields:t,reveal:!v&&it?g:void 0,renderField:(Ye,Mt)=>h.jsx(ql,{slot:Mt,instanceId:r,slotId:i,value:ke.value[Ye],propertyId:O,onChange:wt=>ht(ke.key,{[Ye]:wt}),...GN(Mt.type)?{factPath:ku(yl(_,ke.value),Ye)}:{},...hT(Mt)?{rowTable:IK(Mt,w),onRowPick:(wt,rn)=>Ke(ke.key,Ye,wt,rn)}:{},recordContext:{...C?{itemId:Vh(ke.value,$)??void 0}:{},itemIndex:Ce,siblingRecords:D.map(wt=>wt.value),fieldKey:Ye,table:C,...U?{titleKey:U}:{},membership:u}})}),it&&Q.canRemove&&h.jsxs("button",{type:"button",className:le(DK,"max-w-full"),onClick:()=>Pe(ke.key),children:[h.jsx("span",{className:"inline-flex shrink-0",children:h.jsx(zt.trash,{size:13})}),h.jsxs("span",{className:"min-w-0 truncate",children:["Delete ",Ve]})]})]})})},ke.key)})}),N&&P!==null&&S!==void 0&&h.jsx(S,{tables:P,onCreated:(ke,Ce)=>{B(!1),Kh(D.map(Ve=>Ve.value),t,$).includes(ke)||$e(cx(t,$,ke,Ce))},onClose:()=>B(!1)}),z&&P!==null&&k&&h.jsx(k,{open:!0,mode:"multi",tables:P,selectedIds:Kh(D.map(ke=>ke.value),t,$),onChange:Le,onClose:()=>K(!1)}),z&&u.kind==="pick-media"&&h.jsx(Fw,{propertyId:O,children:ke=>h.jsx(fd,{mode:"multi",propertyId:O,filter:u.filter,selectedIds:D.flatMap(Ce=>be(Ce.value)??[]),onChange:Ce=>Re(Ce,ke),onClose:()=>K(!1)})})]})}function WE(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 kT(e){var n;if(e.values)return e.values.map(WE);const t=((n=e.source)==null?void 0:n.kind)==="home"?e.source.key:void 0;return t===void 0?[]:(N8(t)??[]).map(WE)}function lu(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}const _T=["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"],PK=new Set(_T);function ST(e){return typeof e=="string"&&PK.has(e)}const FK="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)]",ET=le(kt,"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"),BK=le(ET,"text-accent"),HK=4,JE=160,ej=240,qK=le(kt,qN,"min-w-0 flex-1 cursor-text bg-transparent text-left text-ink outline-none placeholder:text-ink-4");function tj({open:e,className:t,onMouseDown:n}){return h.jsx("span",{className:le("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 VK(){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 ZK({option:e}){const t=ST(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(At,{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 KK(e,t){const n=t.toLowerCase().trim();return n?e.filter(r=>r.label.toLowerCase().includes(n)):e}function GK(e,t){const n=lu(t);if(n.length!==0)return e.find(r=>lu(r.value)===n||lu(r.label)===n)}function mv({label:e,value:t,options:n,onChange:r,placeholder:i,bare:a=!1,autoOpen:c=!1,onDismiss:u,id:f,creatable:p=!1,canCreate:g,attention:m=null}){const w=Di(),[v,_]=x.useState(c),[k,S]=x.useState(0),[E,O]=x.useState(null),[A,R]=x.useState(""),C=x.useId(),I=x.useRef(null),$=x.useRef(null),T=x.useRef(null),F=n.findIndex(P=>P.value===t),W=F>=0?n[F]:void 0,G=KK(n,v?A:""),H=A.trim(),U=v?GK(n,A):void 0,z=U&&!G.some(P=>P.value===U.value)?[...G,U]:G,K=p&&H.length>0&&!U&&((g==null?void 0:g(H))??!0),N=z.length+(K?1:0);function B(){T.current&&O(Cs(T.current)),S(Math.max(0,F)),_(!0)}const Y=x.useCallback(()=>{_(!1),R(""),u==null||u()},[u]);function ie(P){var ce;P.value!==t&&r(P.value),_(!1),R(""),(ce=$.current)==null||ce.focus()}function J(P){var ce;r(P),_(!1),R(""),(ce=$.current)==null||ce.focus()}function L(P){var ce;if(!v){(P.key==="ArrowDown"||P.key==="Enter"||P.key===" ")&&(P.preventDefault(),B());return}if(P.key==="Escape")P.preventDefault(),(ce=$.current)==null||ce.focus(),Y();else if(P.key==="ArrowDown")P.preventDefault(),S(me=>Math.min(N-1,me+1));else if(P.key==="ArrowUp")P.preventDefault(),S(me=>Math.max(0,me-1));else if(P.key==="Enter")if(P.preventDefault(),k<z.length){const me=z[k];me&&ie(me)}else K&&J(H)}const Q=x.useCallback(P=>{var Se,$e;const ce=(Se=I.current)==null?void 0:Se.contains(P),me=($e=document.getElementById(C))==null?void 0:$e.contains(P);return!ce&&!me},[C]);function D(P){v&&Q(P.relatedTarget)&&Y()}x.useEffect(()=>{var P;c&&((P=$.current)==null||P.focus())},[c]),x.useEffect(()=>{if(!v)return;const P=()=>{T.current&&O(Cs(T.current))};return P(),window.addEventListener("scroll",P,!0),window.addEventListener("resize",P),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P)}},[v]),x.useEffect(()=>{if(!v)return;const P=ce=>{Q(ce.target)&&Y()};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[v,Q,Y]);const Z=P=>{P.preventDefault(),v||B()},te=h.jsx("input",{ref:$,id:f,className:a?qK:le(w.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:P=>{R(P.target.value),v||B(),S(0)},onKeyDown:L}),de=a?h.jsxs(h.Fragment,{children:[te,h.jsx(tj,{open:v,className:"pl-2",onMouseDown:Z})]}):h.jsxs(h.Fragment,{children:[te,h.jsx(tj,{open:v,className:"pl-1 pr-2.75",onMouseDown:Z})]}),fe=v&&E?Ml(E,{maxHeight:ej*2,minWidth:JE,gap:HK}):null,pe=v&&fe&&N>0?Ur.createPortal(h.jsxs("div",{className:FK,id:C,role:"listbox",style:{left:fe.left,top:fe.top,bottom:fe.bottom,minWidth:Math.max(fe.width,JE),maxHeight:`min(${fe.maxHeight}px, calc(${ej}*var(--content)))`,zIndex:Ei},children:[z.map((P,ce)=>h.jsxs("button",{type:"button",role:"option","aria-selected":P.value===t,"data-active":ce===k,className:ET,onMouseEnter:()=>S(ce),onMouseDown:me=>me.preventDefault(),onClick:()=>ie(P),children:[h.jsx(ZK,{option:P}),P.value===t&&h.jsx(VK,{})]},P.value)),K&&h.jsx("button",{type:"button",role:"option","aria-selected":k===z.length,"data-active":k===z.length,className:BK,onMouseEnter:()=>S(z.length),onMouseDown:P=>P.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:P=>{I.current=P,T.current=P},onBlurCapture:D,children:[de,pe]}):h.jsxs("div",{className:w.frame,ref:I,onBlurCapture:D,children:[h.jsx(Ds,{attention:m,className:v?"border-accent":void 0,ref:T,children:de}),pe]})}function YK({engine:e,label:t,add:n,options:r,unique:i=!1,creatable:a=!1,size:c}){const[u,f]=x.useState(!1),p=e.rows.map(_=>_.value),g=_=>i?r.filter(k=>k.value===_||!p.includes(k.value)):r,m=g(null),w=_=>!i||!p.some(k=>lu(k)===lu(_)),v=m.length>0?m:r;return h.jsx(dx,{engine:e,label:t,add:n,size:c,renderControl:({id:_,value:k,onChange:S})=>h.jsx(mv,{bare:!0,id:_,label:t,value:k,options:g(k),onChange:S,creatable:a,canCreate:w}),onAdd:()=>f(!0),renderAdd:_=>u?h.jsx(mv,{bare:!0,autoOpen:!0,label:n.label,value:"",placeholder:"Choose one",options:v,onDismiss:()=>f(!1),onChange:k=>{f(!1),w(k)&&_(k)},creatable:a,canCreate:w}):null})}function QK({slot:e,itemSlot:t,add:n,fixed:r,value:i,commit:a,size:c}){const u=$i({items:i,fixed:r,axis:"y",commit:a});return t.type==="select"?h.jsx(YK,{engine:u,label:e.label,add:n,options:kT(t),creatable:t.creatable===!0,unique:e.unique===!0,size:c}):h.jsx(yK,{engine:u,label:e.label,add:n,maxLength:t.cap,size:c})}const nj="grid size-[calc(18*var(--content))] shrink-0 place-items-center border-[1.5px] bg-canvas transition-[border-color,background-color] duration-[120ms]";function XK({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:le(kt,"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:le(nj,"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:le(nj,"rounded-[calc(5*var(--content))]",t.checked?"border-ink bg-ink text-canvas":"border-ink-4 text-transparent"),children:h.jsx(Si,{className:"size-[calc(11*var(--content))]",strokeWidth:3})})})}function WK(e){return e.derived!==void 0}const JK=new Set(["image","video","tour","document","media"]);function eG(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 tG(e){const t=eG(e),n=JK.has(e.type),r=`calc(${t}*var(--content))`;return{track:n?r:`minmax(${r},${t/100}fr)`,minPx:t}}function nG(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 jT(e,t,n){const r=a=>new Set(a.map(c=>nG(e,c)).filter(c=>c!==null)),i=r(n);return{used:new Set([...r(t),...i]),required:i}}function px(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 OT(e){return e.reduce((t,n)=>t+n.minPx,0)}function rG(e,t,n=Number.POSITIVE_INFINITY){const r=Ln(e);if(r===null)return[];const i=Dr(r,""),a=i.kind==="field"?i.field:null,c=[];for(const[g,m]of Zs(r)){if(WK(m)||m.locked===!0||!t.used.has(g))continue;const w=g===a,v=t.required.has(g),_={key:g,slot:m,header:m.label||g,required:v,title:w,...tG(m)};c.push({column:_,pinned:w||v})}let u=n-OT(c.filter(g=>g.pinned).map(g=>g.column)),f=!1;const p=[];for(const{column:g,pinned:m}of c)m?p.push(g):!f&&g.minPx<=u?(u-=g.minPx,p.push(g)):f=!0;return p}function AT(e){if(e===null||typeof e!="object")return null;const t=cd(e);if(t===null||t==="")return null;if(Yu(e)||jo(e))return{file:t,picked:t};const{kind:n,id:r,...i}=e;return{...i,file:t,...typeof n=="string"&&_n(n)?{kind:n}:{}}}function mx(){return{image:MR.model,video:DR.model,tour:TR.model,document:KR.model}}const oG=rV({model:{defaultValue:null,coerce:AT,isEmpty:e=>e===null||e.file==="",isInvalid:()=>!1},models:mx}),iG=le(kt,"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",Ll),sG="inline-flex size-[calc(16*var(--content))] shrink-0 items-center justify-center opacity-80",aG="min-w-0 truncate";function Qp({slot:e,reading:t,readingText:n,attention:r,scope:i,onOpen:a}){const c=Fl(),u=t===null,f=u?Bp(e,i):null,p=f!==null?nR(f):null,g=p!==null?p.label:n!==void 0?`${e.label}: ${n}`:`Open ${e.label}`;return h.jsxs("button",{type:"button",className:iG,"data-summary-pill":e.type,"data-empty":u?"":void 0,...Il(r,c),"aria-label":g,disabled:a===void 0,onClick:a,children:[h.jsx("span",{className:sG,children:pi.createElement(p!==null?p.icon:Yp(e),{size:14})}),h.jsx("span",{className:aG,children:u?e.label:t})]})}function Xp({slot:e,value:t,required:n}){const r=Gs(e.type);return r===null?null:zi(r.model,e,r.model.coerce(t),n??!1)}function lG(e){var n;const t=Array.isArray(e.value)?e.value.length:0;return h.jsx(Qp,{slot:e.slot,reading:t===0?null:`${t} ${e.slot.label}`,readingText:String(t),attention:Xp(e),scope:{table:((n=e.recordContext)==null?void 0:n.table)??null},onOpen:e.onOpen})}function cG(e){const t=FR.coerce(e.value),n=h0((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:p0(t.postal)].filter(Boolean).join(", "),i=n!==""?n:r!==""?r:null;return h.jsx(Qp,{slot:e.slot,reading:i,readingText:i??void 0,attention:Xp(e)??(PR(t)?"required":null),onOpen:e.onOpen})}function uG(e){const t=tx(e.value);return h.jsx(Qp,{slot:e.slot,reading:(t==null?void 0:t.name)??null,readingText:t==null?void 0:t.name,attention:Xp(e),onOpen:e.onOpen})}function dG(e){const t=Eu(e.value);return h.jsx(Qp,{slot:e.slot,reading:t===null?null:h.jsx(ux,{rowTable:md(e.slot),value:t,size:"cell"}),attention:Xp(e),onOpen:e.onOpen})}function Yf(e){const t=e.slot.type,n=Gs(t).model;return h.jsx(SR,{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 fG(e){const t=Gs("media").model;return h.jsx(tV,{models:mx(),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 hG={list:lG,image:Yf,video:Yf,tour:Yf,document:Yf,media:fG,address:cG,poi:uG,row:dG};function pG(e){const n=hG[e.slot.type];return n?h.jsx(n,{...e}):null}const gx=24,CT=36,mG=36,gG=8,Vy=e=>`calc(${e}*var(--content))`,NT=le(Bl,"flex flex-col gap-3"),MT="flex min-h-0 flex-1 flex-col overflow-hidden rounded-[calc(12*var(--content))] border border-line bg-canvas",yG="-mb-px min-h-0 flex-1 overflow-auto",bG="transition-[background-color,opacity] duration-100 hover:bg-[#fbfaf6] focus-within:bg-[#faf8f1]",yx="h-[calc(44*var(--content))]",is="flex min-w-0 items-stretch p-[calc(4*var(--content))]",vG=le(Vp,Iw),wG="[data-table-cell] > *, input, textarea, select, button, a, [contenteditable], [role='button'], [role='checkbox'], [role='radio'], [tabindex]:not([tabindex='-1'])",bx="[:where(&)_:where([data-table-cell]>*,input,textarea,select,button,a,[contenteditable],[role=button],[role=checkbox],[role=radio],[tabindex]:not([tabindex='-1']))]:cursor-auto",xG=le("cursor-grab",bx),kG=le("cursor-pointer",bx),rj=e=>e.closest(wG)!==null,RT=11,Yh=["w-3/5","w-2/5","w-1/2","w-[70%]"],TT=le("block h-[calc(9*var(--content))] rounded-full",$n),_G=le("block h-[calc(22*var(--content))] w-[calc(76*var(--content))] rounded-full",$n),SG=le("block size-[calc(13*var(--content))] rounded-[calc(3*var(--content))]",$n);function $T(e){return gG+mG*(e?2:1)}function zT(e,t){return gx+(e?CT:0)+$T(t)}function EG(e,t,n){const r=$T(n),i=[Vy(gx),...t?[Vy(CT)]:[],...e.map(c=>c.track),Vy(r)],a=zT(t,n)+OT(e);return{style:{gridTemplateColumns:i.join(" "),minWidth:a},selection:t,actionsPx:r}}function jG({columns:e,layout:t,position:n,marks:r}){return h.jsxs("div",{className:le("grid items-center border-b border-line-soft",yx),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:C0(i.slot.type)?le(TT,Yh[(n+a)%Yh.length]):_G})},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:SG})},a))})]})}const OG=3,AG=le("grid items-center border-b border-line-soft","grid-cols-[calc(24*var(--content))_repeat(3,minmax(0,1fr))_calc(44*var(--content))]",yx);function CG(){return h.jsx("div",{className:NT,"data-table-pending":"",children:h.jsx("div",{className:MT,children:h.jsx("div",{className:"relative min-h-0 flex-1",children:h.jsx(od,{children:Array.from({length:RT},(e,t)=>h.jsxs("div",{className:AG,children:[h.jsx("span",{}),Array.from({length:OG},(n,r)=>h.jsx("span",{className:"min-w-0 px-[calc(18*var(--content))]",children:h.jsx("span",{className:le(TT,Yh[(t+r)%Yh.length])})},r)),h.jsx("span",{})]},t))})})})})}function NG(){const e=x.useRef(null),t=x.useRef(null),[n,r]=x.useState(Number.POSITIVE_INFINITY);return x.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/gx))};a();const c=new ResizeObserver(a);return c.observe(i),()=>c.disconnect()},[]),{box:e,grip:t,widthPx:n}}const oj=new Set;function MG(e,t){const n=e[t];return typeof n=="string"&&n!==""?n:null}function Zy(e,t,n){return e.rowId?e.rowId(t,n):MG(t,e.idKey)}function RG(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}const TG="input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])";function DT(e){return e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement?!["button","checkbox","radio","submit","reset","file","image","color","range"].includes(e.type):!1}function ij(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 $G(e,t){if(!DT(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 zG(e){const{fields:t}=e;return t===null?h.jsx(CG,{}):h.jsx(DG,{...e,fields:t})}function DG({declaration:e,value:t,onChange:n,propertyId:r,instanceId:i="",slotId:a="",selection:c,onOpenRecord:u,onAdd:f,newRowStamp:p,fixed:g=!1,orderable:m=!0,add:w=Aw(e).add,choose:v,factPath:_,fields:k}){const S=e,{itemContent:E}=JR(S,"expanded"),O=E.kind==="record"?E.entries:[],{box:A,grip:R,widthPx:C}=NG(),I=rG(S,k,C-zT(c!==void 0,u!==void 0)),$=Ln(S),T=$?Dr($,""):null,F=(T==null?void 0:T.kind)==="field"?T.field:void 0,W=EG(I,c!==void 0,u!==void 0),G=Array.isArray(t)?t.map(RG):[],H=$i({items:G,fixed:g,axis:"y",commit:(P,ce)=>n(P.map(me=>me.value),ce)}),{drag:U}=H,z=H.rows,K=f!==null&&H.canAdd,N=z.map(P=>({key:P.key,index:H.indexOf(P.key),value:P.value})),B=N.length===0,Y=B?dT(S):null,ie=x.useRef(null);x.useLayoutEffect(()=>{const P=ie.current;P&&(ie.current=null,J(P.row,P.col))});function J(P,ce){var $e;const me=U.containerRef.current,Se=me==null?void 0:me.querySelector(`[data-table-cell][data-row="${P}"][data-col="${ce}"]`);($e=Se==null?void 0:Se.querySelector(TG))==null||$e.focus()}function L(P,ce="top"){if(f){f();return}const me=ce==="top"?0:H.rows.length;ie.current={row:me,col:P},H.add({...Ka(O),...p==null?void 0:p()},me)}function Q(P,ce,me){H.updateValue(P,Se=>({...Se,[ce]:me}))}function D(P){if(P.defaultPrevented||P.altKey||P.ctrlKey||P.metaKey||P.nativeEvent.isComposing)return;const ce=P.target,me=ce.closest("[data-table-cell]");if(!me)return;const Se=Number(me.dataset.row),$e=Number(me.dataset.col),Ie=N.length-1;switch(P.key){case"Enter":{if(P.shiftKey||!DT(ce))return;P.preventDefault(),Se<Ie?J(Se+1,$e):K&&L($e,"below");return}case"ArrowDown":case"ArrowUp":{if(ij(ce))return;const xe=P.key==="ArrowDown"?Se+1:Se-1;if(xe<0||xe>Ie)return;P.preventDefault(),J(xe,$e);return}case"ArrowLeft":case"ArrowRight":{if(ij(ce))return;const xe=P.key==="ArrowLeft",Le=xe?$e-1:$e+1;if(Le<0||Le>=I.length||!$G(ce,xe?"start":"end"))return;P.preventDefault(),J(Se,Le);return}}}function Z(P){const ce=`${td(Ir(e.label).singular)} ${P.index+1}`;if(!$||(T==null?void 0:T.kind)!=="field")return ce;const me=Ks(T,$,P.value);return me==="Untitled"?ce:me}const te=c?c.control:null;function de(P){if(!c)return null;const ce=Zy(c,P.value,P.index);return ce===null?{checked:!1,disabled:!0}:qp(c.ids,ce,c.held??oj)}function fe(P){const ce=c?Zy(c,P.value,P.index):null;if(!c||ce===null)return;const me=$w(c.ids,ce,c.control,c.held??oj);me!==c.ids&&c.onChange(me)}function pe(P,ce){var ne;const me=de(P),Se=U.getItemProps(P.key),$e=Z(P),Ie=yl(_,P.value),xe=me!==null&&!me.disabled,Le=c?Zy(c,P.value,P.index):null;return h.jsxs("div",{role:"row","data-dragid":Se["data-dragid"],"data-disabled":(me==null?void 0:me.disabled)||void 0,"data-upstream":Le!==null&&((ne=c==null?void 0:c.upstream)==null?void 0:ne.has(Le))||void 0,onPointerDown:m?be=>{rj(be.target)||Se.onPointerDown(be)}:void 0,onClick:xe?be=>{rj(be.target)||fe(P)}:void 0,className:le("group/row grid items-stretch border-b border-line-soft data-[disabled=true]:opacity-50 data-[disabled=true]:focus-within:opacity-100",bw,yx,bG,xe?kG:m?xG:bx),style:W.style,children:[h.jsx("div",{role:"cell",className:le(is,"items-center justify-center"),children:m&&h.jsx("span",{"aria-hidden":"true",className:le("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(W0,{className:"size-[calc(14*var(--content))]",strokeWidth:1.8})})}),te&&h.jsx("div",{role:"cell",className:is,children:me&&h.jsx(XK,{control:te,state:me,label:`Select ${$e}`,onToggle:()=>fe(P)})}),I.map((be,Re)=>h.jsx("div",{role:"cell","data-table-cell":"","data-row":ce,"data-col":Re,"data-field":be.key,className:is,children:C0(be.slot.type)?h.jsx(ql,{slot:be.slot,instanceId:i,slotId:a,propertyId:r,value:P.value[be.key],required:be.required,onChange:Pe=>Q(P.key,be.key,Pe),recordContext:{itemIndex:P.index,fieldKey:be.key,...F?{titleKey:F}:{}}}):h.jsx(pG,{slot:be.slot,instanceId:i,slotId:a,propertyId:r,value:P.value[be.key],required:be.required,onChange:Pe=>Q(P.key,be.key,Pe),recordContext:{itemIndex:P.index,fieldKey:be.key,...F?{titleKey:F}:{}},factPath:ku(Ie,be.key),onOpen:u?()=>u(P.index,be.key):void 0})},be.key)),h.jsxs("div",{role:"cell",className:le(is,"justify-end"),children:[u&&h.jsx("button",{type:"button",className:Vp,"aria-label":`Open ${$e}`,onClick:()=>u(P.index),children:h.jsx(S9,{className:"size-[calc(13*var(--content))]"})}),H.canRemove&&h.jsx("button",{type:"button",className:vG,"aria-label":`Remove ${$e}`,onClick:()=>H.remove(P.key),children:h.jsx(zl,{className:"size-[calc(13*var(--content))]"})})]})]},P.key)}return h.jsxs("div",{className:NT,children:[H.canAdd&&h.jsx(id,{size:"large",add:w,onAdd:K?()=>L(0):null,choose:v}),h.jsx("div",{className:MT,children:h.jsxs("div",{ref:A,className:le(yG,B&&"flex flex-col"),role:"table","aria-rowcount":N.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:R,role:"columnheader",className:is}),W.selection&&h.jsx("div",{role:"columnheader",className:is}),I.map(P=>h.jsx("div",{role:"columnheader","data-field":P.key,className:"min-w-0 px-[calc(14*var(--content))] py-[calc(10*var(--content))]",children:h.jsx("span",{className:"block truncate",children:P.header})},P.key)),h.jsx("div",{role:"columnheader",className:is})]}),h.jsx("div",{ref:U.containerRef,className:"relative",onKeyDown:D,children:h.jsx(ud,{place:"cell",children:N.map((P,ce)=>pe(P,ce))})}),B&&h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx(od,{children:Array.from({length:RT},(P,ce)=>h.jsx(jG,{columns:I,layout:W,position:ce,marks:(u?1:0)+(H.canRemove?1:0)},ce))}),h.jsx(Dh,{icon:pi.createElement(Yp(S),{size:25,strokeWidth:1.8}),headline:w.empty,...Y!==null?{line:Y}:{}})]})]})})]})}function LT(e,t){const{max:n}=e;if(typeof n=="number")return n;if(Ku(n)){const r=RA(n,{facts:t});return typeof r=="number"?r:null}return null}function LG(e,t){return LT(e,t)===1}function IT({object:e,row:t,reveal:n,withRecordContext:r=!1,onField:i,host:a,fieldProps:c}){const{fields:u}=a;return u===null?h.jsx(FG,{}):h.jsx(hx,{fields:Zs(e).filter(([f])=>u.used.has(f)),reveal:n,renderField:(f,p)=>h.jsx(ql,{slot:p,instanceId:a.instanceId,slotId:`${a.slotId}.${f}`,propertyId:a.propertyId,value:t[f],required:u.required.has(f),onChange:g=>i(f,g),...GN(p.type)?{factPath:ku(a.factPath,f)}:{},...r?{recordContext:{fieldKey:f}}:{},...c==null?void 0:c(f,p)})})}const IG=5,UG=le("block h-[calc(9*var(--content))] w-1/4 rounded-full",$n),PG=le("block h-[calc(40*var(--content))] w-full rounded-[calc(10*var(--content))]",aw);function FG(){return h.jsx("div",{className:"relative h-[calc(360*var(--content))]","data-record-pending":"",children:h.jsx(od,{className:"flex flex-col gap-[calc(20*var(--content))]",children:Array.from({length:IG},(e,t)=>h.jsxs("span",{className:"flex flex-col gap-[calc(8*var(--content))]",children:[h.jsx("span",{className:UG}),h.jsx("span",{className:PG})]},t))})})}const BG=le("relative z-[1] flex flex-shrink-0 items-center gap-[14px] py-3",HM);function HG(e){const{open:t,onClose:n}=e;return h.jsx(sw,{open:t,onClose:n,ariaLabel:e.fallbackTitle,className:le(ww,iH),children:t?h.jsx(qG,{...e}):null})}function qG({object:e,row:t,fallbackTitle:n,onChange:r,onClose:i,propertyId:a,instanceId:c,slotId:u,factPath:f,fields:p,revealFieldName:g,fieldProps:m}){const w=Dr(e,n),v=Ks(w,e,t),_=v==="Untitled"?n:v,k=x.useRef(t);x.useEffect(()=>{k.current=t},[t]);const S=(E,O)=>{k.current={...k.current,[E]:O},r(k.current)};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:BG,children:[h.jsx("div",{className:kw,children:h.jsx("h2",{className:le(_w,"truncate"),children:_})}),h.jsx(oR,{}),h.jsx("button",{type:"button",className:Sw,"aria-label":"Close",onClick:i,children:h.jsx(zt.x,{size:14})})]}),h.jsx("div",{className:le("min-h-0 flex-1 overflow-y-auto py-[clamp(16px,1.2vw,28px)]",HM),children:h.jsx(ud,{place:"panel",children:h.jsx(IT,{object:e,row:t,reveal:g,withRecordContext:!0,onField:S,host:{propertyId:a,instanceId:c,slotId:u,factPath:f,fields:p},fieldProps:m})})})]})}function VG({object:e,row:t,onChange:n,propertyId:r,instanceId:i,slotId:a,factPath:c,fields:u}){return h.jsx(IT,{object:e,row:t,onField:(f,p)=>n({...t,[f]:p}),host:{propertyId:r,instanceId:i,slotId:a,factPath:c,fields:u}})}function ZG({object:e,rows:t,onChange:n,factPath:r,...i}){const a=Gw(r),c=a!==void 0?a:px(e);return h.jsx(VG,{object:e,row:t[0]??{},onChange:u=>n([u,...t.slice(1)]),factPath:yl(r,t[0]),fields:c,...i})}const KG=new Set(["image","video","tour","document"]);function GG(e){var t;return((t=e.source)==null?void 0:t.kind)==="row"}function UT(e){return KG.has(e.type)&&Ap(e).kind==="owned"}function YG(e,t){return Zs(e).some(([n,r])=>UT(r)&&!GG(r)&&t.required.has(n))}function cu({slot:e,value:t,onChange:n,propertyId:r,instanceId:i,slotId:a,selection:c,onRecordAdded:u,onAdd:f,newRowStamp:p,fixed:g,orderable:m,add:w,choose:v,factPath:_,record:k,fields:S}){const[E,O]=x.useState(null),A=k!==void 0?{index:k.index,added:k.added===!0}:E,{ownedUpload:R}=nn(),C=Ln(e),I=t,$=A===null?void 0:I[A.index]??{},T=C!==null&&S!==null&&YG(C,S),F=x.useRef({open:A,rows:I});x.useEffect(()=>{F.current={open:A,rows:I}});const W=()=>{const N=F.current.rows,B=[(p==null?void 0:p())??{},...N],Y={index:0,added:!0};F.current={open:Y,rows:B},n(B,"add"),O(Y)},G=N=>{const{open:B,rows:Y}=F.current;if(B===null)return;const ie=Y.map((J,L)=>L===B.index?N:J);F.current={open:B,rows:ie},n(ie,"edit")},H=()=>{if(k!==void 0){k.onClose();return}(A==null?void 0:A.added)===!0&&(u==null||u(A.index)),O(null)},U=(N,B)=>{const Y=F.current.open;return!R||Y===null?Promise.reject(new Error("list-table-view: no record is open")):R({slotId:a,itemIndex:Y.index,field:N},B)},z=R&&A!==null?(N,B)=>UT(B)?{onUpload:Y=>U(N,Y)}:{}:void 0,K=Ir(e.label).singular;return h.jsxs(h.Fragment,{children:[k===void 0&&h.jsx(zG,{declaration:e,value:t,onChange:(N,B)=>n(N,B),propertyId:r,instanceId:i,slotId:a,selection:c,...w!==void 0?{add:w}:{},...v!==void 0?{choose:v}:{},...g!==void 0?{fixed:g}:{},...m!==void 0?{orderable:m}:{},onOpenRecord:C?(N,B)=>O({index:N,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(HG,{open:$!==void 0,object:C,row:$??{},fallbackTitle:(A==null?void 0:A.added)===!0?`New ${K}`:`${td(K)} ${((A==null?void 0:A.index)??0)+1}`,propertyId:r,instanceId:i,slotId:a,fieldProps:z,factPath:yl(_,$),fields:S,revealFieldName:A==null?void 0:A.field,onChange:G,onClose:H})]})}function QG(e){return e.map(AT).filter(t=>t!==null)}function XG({label:e,itemSlot:t,offer:n,verbs:r,fixed:i,instanceId:a,slotId:c,ownerSlotId:u=c,value:f,propertyId:p,commit:g,onUpload:m,factPath:w,size:v}){const _=_i(t),k=x.useMemo(()=>QG(f),[f]),[S,E]=x.useState(!1),O=$i({items:k,fixed:i,axis:"xy",commit:g}),{rows:A}=O,R=Pw(t,{propertyId:p,instanceId:a,slotId:u}),C=n.kind==="owned"?m??R??void 0:void 0,I=JG(C,_,O.add),{add:$,onAdd:T,choose:F}=pw(r,n.kind==="picked"?()=>E(!0):null,C!==void 0?Zw(_,I):null),W=I.error;return h.jsxs(mw,{engine:O,label:e,noun:"item",size:v,onAdd:T,add:$,choose:F,renderTile:(G,H,U)=>h.jsx(eY,{value:G.value,kinds:_,propertyId:p,holderPath:w,frame:{chrome:U,crop:null}}),children:[W&&h.jsx("p",{className:Dl,children:W}),S&&n.kind==="picked"&&h.jsx(fd,{mode:"multi",propertyId:p,filter:n.filter,selectedIds:A.map(G=>G.value.file),onChange:G=>O.replace(Pl(A,G,H=>H.file,WG,O.mint)),onClose:()=>E(!1)})]})}function WG(e){return Wq(e)??{file:e.file}}function JG(e,t,n){const[r,i]=x.useState(!1),[a,c]=x.useState(null);return{busy:r,error:a,take:f=>{if(!e||f.length===0)return;const p=f.filter(m=>!sj(t,ph(m)));c(p.length>0?`Only ${t.join(", ")} can be added here.`:null);const g=f.filter(m=>sj(t,ph(m)));g.length!==0&&(i(!0),(async()=>{try{for(const m of g){const w=ph(m),v=Xn(w),_=Gp(w,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 sj(e,t){return t!==null&&e.includes(t)}function eY({value:e,kinds:t,propertyId:n,frame:r,holderPath:i}){const a=Vw(e,t,n);return h.jsx(qw,{kind:a,value:tY(a,e),propertyId:n,frame:r,holderPath:i},a)}function tY(e,t){return mx()[e].coerce(t)}function PT({face:e,...t}){const{slot:n,instanceId:r,slotId:i,value:a,onChange:c,recordContext:u}=t,f=JR(n,e),p=eZ(n,r,i,c,u!=null),g=t.membership??Ww(n,void 0),m=Array.isArray(a)?a:[],w=yR({slotId:i,recordContext:u}),v=u?u.table??null:qs(n.source)!==null?t.boundRowTable??null:null,_=x.useMemo(()=>f.view==="gallery"?e4(n,v):null,[f.view,n,v]),k=g.kind==="follows",{itemContent:S}=f,E=e==="compact"?"compact":"large",O=Bp(n,{table:v,membership:g});if(O===null)return null;switch(f.view){case"table":return h.jsx(rY,{slot:n,items:m,onChange:c,membership:g,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"?WT(S.entries):null;return A===null?null:h.jsx(oY,{list:n,label:n.label,face:e,annotated:A,listTable:v,membership:g,verbs:O,itemBaseline:t.itemBaseline,insideRecord:u!=null,fixed:k,instanceId:r,slotId:i,mediaSlotId:`${w}.${A.mediaKey}`,value:m,propertyId:t.propertyId,table:(u==null?void 0:u.table)??eT(g),selectedItemIndex:t.selectedItemIndex,selectedFieldName:t.selectedFieldName,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:E})}case"accordion":return S.kind!=="record"?null:h.jsx(UK,{slot:n,entries:S.entries,fixed:k,instanceId:r,slotId:i,value:a,commit:p,membership:g,verbs:O,rowTable:t.rowTable??pv(n,g),selectedItemIndex:t.selectedItemIndex,selectedFieldName:t.selectedFieldName,itemBaseline:t.itemBaseline,insideRecord:u!=null,factPath:t.factPath});case"gallery":{if(S.kind!=="single"||!xo(S.slot.type))return null;if(_!==null)return h.jsx(iY,{label:n.label,member:_,verbs:O,fixed:k,instanceId:r,slotId:i,mediaSlotId:w,value:a,propertyId:t.propertyId,selectedItemIndex:t.selectedItemIndex,commit:p,onUpload:t.onUpload,size:E});const A=S.slot,R=S.slot.type,C=z8(n,A,v)??{kind:"owned"};if(R==="media")return h.jsx(XG,{label:n.label,itemSlot:A,offer:C,verbs:O,fixed:k,instanceId:r,slotId:i,ownerSlotId:w,value:m,propertyId:t.propertyId,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:E});const I=R;return h.jsx(cV,{kind:I,label:n.label,itemSlot:A,offer:C,verbs:O,fixed:k,instanceId:r,slotId:i,ownerSlotId:w,value:m,propertyId:t.propertyId,commit:p,onUpload:t.onUpload,factPath:t.factPath,size:E},I)}case"media-manager":return null;case"poi-curation":return h.jsx(zZ,{slot:n,fixed:k,value:a,propertyId:t.propertyId,commit:p});case"bullet-list":return S.kind!=="single"?null:h.jsx(QK,{slot:n,itemSlot:S.slot,add:O.add,fixed:k,value:a,commit:p,size:E});case"row-bar":{const A=pv(n,g),R=S.kind==="single"?md(S.slot):nY,C=t.rowTable??(A.kind!=="none"?A:R);return h.jsx(EK,{slot:n,face:e,rowTable:g.kind==="follows"&&C.kind==="table"?{...C,inert:!0}:C,verbs:O,fixed:k,value:m,commit:p})}}}const nY={kind:"none"};function rY({slot:e,items:t,onChange:n,membership:r,verbs:i,entries:a,fixed:c,propertyId:u,instanceId:f,slotId:p,factPath:g}){const{TablePicker:m,TableCreate:w}=nn(),v=Gw(g),_=v!==void 0?v:px(Ln(e)??{fields:{}}),[k,S]=x.useState(!1),[E,O]=x.useState(!1),A=r.kind==="pick-row"&&a!==null?ex(r):null,R=pd,C=t,I=x.useRef(C);x.useEffect(()=>{I.current=C});const $=m===void 0?null:()=>S(!0),T=A!==null&&$!==null&&i.choose!==null?{choose:i.choose,onChoose:$}:void 0,F=A===null?void 0:w===void 0?null:()=>O(!0),W=r.kind==="table"?()=>({[R]:pR()}):void 0;return h.jsxs(h.Fragment,{children:[h.jsx(cu,{slot:e,value:t,onChange:G=>n(G),propertyId:u,instanceId:f,slotId:p,factPath:g,fields:_,fixed:c,...F!==void 0?{onAdd:F}:{},...W!==void 0?{newRowStamp:W}:{},add:i.add,...T!==void 0?{choose:T}:{}}),E&&A!==null&&a!==null&&w!==void 0&&h.jsx(w,{tables:A,onCreated:(G,H)=>{if(O(!1),Kh(I.current,a,R).includes(G))return;const U=[cx(a,R,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:Kh(C,a,R),onChange:(G,H)=>{const U=YZ(I.current,a,R,G,H);I.current=U,n(U)},onClose:()=>S(!1)})]})}function oY({list:e,face:t,annotated:n,listTable:r,membership:i,itemBaseline:a,insideRecord:c,table:u,...f}){const p=nT({instanceId:f.instanceId,slotId:f.slotId,membership:i,itemBaseline:a,insideRecord:c});return h.jsx(JT,{...f,annotated:n,offer:D8(e,n.mediaSlot,{itemTable:u,listTable:r,picksBy:i.kind==="pick-media"?i.filter:null}),markers:t==="compact"?p:null,table:u})}function iY({member:e,value:t,commit:n,...r}){const i=x.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(JT,{...r,annotated:e.annotated,offer:Ap(e.annotated.mediaSlot,null),markers:null,value:i,table:null,commit:a})}function sY(e){return h.jsx(PT,{face:"expanded",...e})}function aY(e){return h.jsx(PT,{face:"compact",...e})}const lY={model:{defaultValue:[],coerce:e=>Array.isArray(e)?e:[],isEmpty:e=>e.length===0,isInvalid:()=>!1},faces:{expanded:sY,compact:aY},applyOptimistic:null};function cY(e,t){return e.toLocaleString("en-US",{useGrouping:t.thousandsSep===!0,maximumFractionDigits:t.decimals===!0?20:0})}function uY(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 dY(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 aj(e,t,n){e.value=t,e.setSelectionRange(n,n)}function lj(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 fY({label:e,value:t,onChange:n,group:r,decimals:i,maxDigits:a,placeholder:c,onBlur:u,attention:f=null}){const p=w=>r?uY(w):w,g=p(t),m=Di();return h.jsx("div",{className:m.frame,children:h.jsx(Ds,{attention:f,children:h.jsx("input",{className:le(m.inner,"[font-variant-numeric:tabular-nums]"),"aria-label":e,inputMode:i?"decimal":"numeric",value:g,placeholder:c??"0",onBlur:u,onChange:w=>{var A;const v=w.currentTarget,_=v.value,k=v.selectionStart??_.length,S=lj(_,{decimals:i,maxDigits:a});if(S==null){const R=k-(_.length-g.length);aj(v,g,Math.min(Math.max(R,0),g.length));return}const E=p(S),O=((A=lj(_.slice(0,k),{decimals:i}))==null?void 0:A.length)??0;aj(v,E,dY(E,O)),n(S)}})})})}function Ky(e){return e==null?"":String(e)}function gv(e){const t=e.trim();if(t==="")return null;const n=Number(t);return Number.isFinite(n)?n:null}const FT={defaultValue:null,coerce:e=>typeof e=="number"?e:gv(typeof e=="string"?e:""),isEmpty:e=>e===null,isInvalid:()=>!1};function cj({slot:e,value:t,onChange:n,required:r=!1}){const[i,a]=x.useState(()=>Ky(t)),c=gv(i)===t?i:Ky(t);return h.jsx(fY,{attention:zi(FT,e,t,r),label:e.label,value:c,onChange:u=>{a(u);const f=gv(u);f!==t&&n(f)},onBlur:()=>a(Ky(t)),group:e.thousandsSep,decimals:e.decimals,maxDigits:e.maxDigits,placeholder:e.placeholder})}const hY={model:FT,faces:{expanded:cj,compact:cj},applyOptimistic:(e,t,n)=>QR(e,t==null?"":cY(t,n))},BT={model:{defaultValue:"",coerce:hd,isEmpty:e=>e.trim()==="",isInvalid:e=>!VD(e.trim())},normalize:e=>e.trim(),invalidMessage:()=>"Not a valid phone number",inputType:"tel",inputMode:"tel",autoComplete:"tel",placeholder:"(555) 555-0100"};function uj(e){return h.jsx(Qw,{kind:BT,...e})}const pY={model:BT.model,faces:{expanded:uj,compact:uj},applyOptimistic:null},mY="flex flex-col gap-2";function gY({slot:e,value:t,onChange:n,propertyId:r}){const{apiFetch:i}=nn().api,[a,c]=x.useState(null),[u,f]=x.useState(null),p=x.useMemo(()=>t?[t]:[],[t]),{urls:g,dropUrl:m}=lT(r,p);async function w(v){if(c(null),(t==null?void 0:t.place_id)!==v.place_id){f(v);try{const _=await rT(i,r,v.place_id);n(_)}catch{c("Couldn't add that place. Try again.")}finally{f(null)}}}return h.jsxs("div",{className:mY,children:[h.jsx(uT,{propertyId:r,placeholder:e.placeholder??"Search nearby…",addedIds:t?new Set([t.place_id]):new Set,onSelect:v=>void w(v)}),a&&h.jsx("span",{className:iT,children:a}),u?h.jsxs("div",{className:le(nx,sT),"aria-live":"polite",children:[h.jsx("span",{className:rx,children:h.jsx("span",{className:aT})}),h.jsxs("div",{className:ox,children:[h.jsx("span",{className:ix,children:u.name}),h.jsx("span",{className:sx,children:"Adding…"})]})]}):t?h.jsx(cT,{row:t,photoUrl:g[t.place_id],onPhotoError:()=>m(t.place_id),onRemove:()=>n(null)}):h.jsx("div",{className:uZ,children:"No place yet. Search above to choose one."})]})}const yY={model:{defaultValue:null,coerce:tx,isEmpty:e=>e===null,isInvalid:()=>!1},faces:{compact:gY},applyOptimistic:null},bY=le(kt,"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"),vY=le("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 wY(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=Fl();return h.jsx("div",{className:le($s,"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=ST(c.icon)?c.icon:null;return h.jsxs("button",{type:"button",role:"radio","aria-checked":c.value===t,className:bY,...Il(i,a),onClick:()=>{c.value!==t&&r(c.value)},children:[u!==null&&h.jsx("span",{className:vY,children:h.jsx(At,{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 HT={defaultValue:null,coerce:e=>typeof e=="string"?e:null,isEmpty:e=>e===null||e==="",isInvalid:()=>!1};function qT({cards:e,slot:t,value:n,onChange:r,required:i=!1}){const a=kT(t),c=t.creatable??!1,u=zi(HT,t,n,i);return e&&!c&&wY(a)?h.jsx(xY,{label:t.label,value:n,options:a,onChange:r,attention:u}):h.jsx(mv,{attention:u,label:t.label,value:n??"",options:a,creatable:c,placeholder:"Choose one",onChange:r})}function kY(e){return h.jsx(qT,{cards:!0,...e})}function _Y(e){return h.jsx(qT,{cards:!1,...e})}const SY={model:HT,faces:{expanded:kY,compact:_Y},applyOptimistic:null};function VT(){const e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}function EY(){return x.useSyncExternalStore(()=>()=>{},()=>VT()!==null,()=>!1)}function jY({value:e,onChange:t,recording:n,onRecordingChange:r,onEnd:i}){const a=EY(),[c,u]=x.useState(0),f=x.useRef(null),p=x.useRef(""),g=x.useRef(""),m=x.useRef(t),w=x.useRef(i);x.useEffect(()=>{m.current=t,w.current=i},[t,i]),x.useEffect(()=>{if(!n)return;const k=setInterval(()=>u(S=>S+1),1e3);return()=>clearInterval(k)},[n]),x.useEffect(()=>()=>{var k;(k=f.current)==null||k.abort(),f.current=null},[]);const v=x.useCallback(()=>{const k=VT();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,g.current="",S.onresult=E=>{let O="",A="";for(let $=E.resultIndex;$<E.results.length;$++){const T=E.results[$];if(T===void 0)continue;const F=T[0].transcript;T.isFinal?O+=F:A+=F}O&&(g.current+=O);const R=g.current+A,C=p.current,I=!C||/\s$/.test(C)||/^\s/.test(R)?"":" ";m.current(C+I+R)},S.onerror=()=>{},S.onend=()=>{var E;f.current=null,r(!1),u(0),(E=w.current)==null||E.call(w)},f.current=S,u(0),r(!0);try{S.start()}catch{f.current=null,r(!1)}},[r,e]),_=x.useCallback(()=>{var k;(k=f.current)==null||k.stop()},[]);return{canDictate:a,seconds:c,start:v,stop:_}}function OY(e){return`${String(Math.floor(e/60)).padStart(2,"0")}:${String(Math.floor(e%60)).padStart(2,"0")}`}const AY={short:120,medium:240,long:2e3};function CY(e){return AY[e]}const ZT={defaultValue:"",coerce:hd,isEmpty:e=>e.trim()==="",isInvalid:()=>!1};function KT(e){const t=e.slot.size??"short";return{size:t,cap:typeof e.slot.cap=="number"?e.slot.cap:CY(t)}}function GT({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 YT({slot:e,value:t,required:n=!1}){return zi(ZT,e,t,n)}const NY={medium:2,long:5};function QT(e){const{slot:t,value:n,onChange:r}=e,{size:i,cap:a}=KT(e),c=Di(),u={value:n,maxLength:a,placeholder:GT(e),"aria-label":t.label};return h.jsx("div",{className:c.frame,children:h.jsx(Ds,{attention:YT(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:le(c.inner,c.multiline),rows:c.inline?1:NY[i],...u,onChange:f=>r(f.target.value)})})})}function MY(e){return KT(e).size==="long"?h.jsx(RY,{...e,cap:typeof e.slot.cap=="number"?e.slot.cap:null}):h.jsx(QT,{...e})}function RY(e){const{slot:t,value:n,onChange:r,cap:i}=e,a=Di(),c=x.useRef(null),[u,f]=x.useState(!1),p=x.useCallback(()=>requestAnimationFrame(()=>{var v;return(v=c.current)==null?void 0:v.focus()}),[]),g=x.useCallback(v=>r(i===null?v:v.slice(0,i)),[r,i]),m=jY({value:n,onChange:g,recording:u,onRecordingChange:f,onEnd:p}),w=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(Ds,{attention:YT(e),className:"flex-col overflow-hidden",children:[h.jsx("textarea",{ref:c,className:le(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:GT(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:OY(m.seconds)}),"Listening…"]}):h.jsx("span",{className:le(O7(n.length,i??void 0),"font-sans text-caption"),children:w}),m.canDictate&&h.jsx("button",{type:"button",className:le(kt,"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(j9,{size:16})})]})]})})}const TY={model:ZT,faces:{expanded:MY,compact:QT},applyOptimistic:(e,t)=>QR(e,hd(t))};function $Y(e){if(e===void 0)return"Not a valid URL";const t=Object.entries(Ni).find(([r])=>r===e);if(t)return`Needs a ${t[1].label} link`;const n=zY(e);return n.length>0?`Needs a ${e} link (${n.join(", ")})`:`Needs a ${e} link`}function zY(e){return Object.values(Ni).filter(t=>t.kind===e).map(t=>t.label)}function DY(e,t){const n=ou(e);return n===""?!1:f0(n)?t.accepts!==void 0&&!BD(t.accepts,n):!0}const XT={model:{defaultValue:"",coerce:hd,isEmpty:e=>ou(e)==="",isInvalid:DY},normalize:ou,invalidMessage:(e,t)=>f0(ou(e))?$Y(t.accepts):"Not a valid URL",inputType:"text",inputMode:"url",autoComplete:"url",placeholder:"https://",adornment:e=>h.jsx(LY,{draft:e})};function LY({draft:e}){const t=ou(e);return h.jsx("span",{className:le(HN,"pr-2.75"),children:f0(t)?h.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:le(kt,"flex items-center text-ink-4 hover:text-accent transition-colors duration-[120ms]"),"aria-label":"Open URL in new tab",children:h.jsx(zt.external,{})}):h.jsx("span",{className:"flex items-center text-ink-4 opacity-30",children:h.jsx(zt.external,{})})})}function dj(e){return h.jsx(Qw,{kind:XT,...e})}const IY={model:XT.model,faces:{expanded:dj,compact:dj},applyOptimistic:null};let fj=null;function UY(){return fj??(fj={text:TY,number:hY,select:SY,url:IY,email:JV,phone:pY,date:YV,image:MR,list:lY,poi:yY,video:DR,tour:TR,document:KR,media:oG,address:UV}),fj}function PY(){return cK}function Gs(e){if(e==="row")return PY();const n=UY()[e];return n===void 0?null:n}function Sl(e,t={}){const n=Hl(e);if(n!==null){const i={...t,fields:n.fields};return e.locked!==!0&&Object.values(n.fields).some(a=>Sl(a,i))}if(KZ(e,t))return!1;const r=Gs(e.type);return r?r.isEditable?r.isEditable(e):e.locked!==!0:!1}function WT(e){const t=e.filter(([,r])=>DC(r)),n=t.find(([,r])=>_n(r.type));return n?{mediaKey:n[0],mediaSlot:n[1],fields:t.filter(([r])=>r!==n[0])}:null}const FY="flex flex-col gap-1.5",BY="flex flex-col";function JT({label:e,annotated:t,offer:n,verbs:r,markers:i,fixed:a,instanceId:c,slotId:u,mediaSlotId:f,value:p,propertyId:g,table:m,selectedItemIndex:w,selectedFieldName:v,commit:_,onUpload:k,factPath:S,size:E}){const{mediaKey:O,mediaSlot:A,fields:R}=t,C=f??`${u}.${O}`,I=A.type,$=Xn(I),T=L0(A),F=x.useMemo(()=>[[O,A],...R],[O,A,R]),W=x.useMemo(()=>p.map(xe=>xe!==null&&typeof xe=="object"?{...xe}:{}),[p]),G=$i({items:W,...i?{identityOf:i.identityOf}:{},fixed:a,axis:"xy",commit:(xe,Le)=>{i==null||i.markOrder(xe),_(i?i.stamp(xe):xe,Le)}}),{rows:H}=G,U=xe=>{var Le;return((Le=Gs(I))==null?void 0:Le.model.coerce(xe[O]))??$.cleared},z=(xe,Le)=>({...xe,[O]:Le}),K=(xe,Le,ne)=>{const be=H.find(Re=>Re.key===xe);be&&(i==null||i.markFields(be,{[Le]:ne(be.value)}),G.updateValue(xe,Re=>({...Re,[Le]:ne(Re)})))},N=xe=>{for(const Le of xe)i==null||i.markRemoved(Le);G.removeMany(xe.map(Le=>Le.key))},B=xe=>z(Ka(F),xe),Y=x.useMemo(()=>({get:xe=>I==="image"?U(xe):null,set:(xe,Le)=>z(xe,Le)}),[I,O]),ie=v!==void 0&&v!==O,J=$R({engine:G,lens:Y,propertyId:g,instanceId:c,slotId:u,cropCfg:T}),L=vR(g,I),Q=xe=>Ha(ku(yl(S,xe),O),$.fileIdOf(U(xe))),D=x.useRef(null);x.useEffect(()=>{ie&&D.current&&xT(D.current,v)},[ie,v,w]);const[Z,te]=x.useState(!1),de=Pw(A,{propertyId:g,instanceId:c,slotId:C}),fe=k??de??void 0,pe=n.kind==="owned"&&fe!==void 0,P=LR(fe,xe=>G.add(B($.fromUploaded(xe,$.cleared)))),ce=xe=>{const Le=Pl(H,xe,be=>$.fileIdOf(U(be)),be=>B($.fromPicked(be,$.cleared)),G.mint),ne=new Set(Le.map(be=>be.key));for(const be of H)ne.has(be.key)||i==null||i.markRemoved(be);G.replace(Le)},{add:me,onAdd:Se,choose:$e}=pw(r,n.kind==="picked"?()=>te(!0):null,n.kind==="owned"&&pe?Zw([I],P):null),Ie=P.error;return h.jsxs(mw,{engine:G,label:e,noun:$.noun,size:E,onAdd:Se,add:me,choose:$e,renderTile:(xe,Le,ne)=>h.jsx("div",{className:BY,"data-annotated-item":Le,children:h.jsx(qw,{kind:I,value:U(xe.value),propertyId:g,holderPath:ku(yl(S,xe.value),O),frame:{chrome:ne,beneath:R.length>0&&h.jsx("div",{className:FY,ref:Le===w?D:void 0,[fx]:"",children:h.jsx(ud,{place:"cell",children:R.map(([be,Re])=>h.jsx("div",{[Gh]:be,children:h.jsx(ql,{slot:Re,instanceId:c,slotId:u,value:xe.value[be],propertyId:g,onChange:Pe=>K(xe.key,be,()=>Pe),recordContext:{itemIndex:Le,fieldKey:be,table:m}})},be))})}),crop:I==="image"?{cfg:T,cut:J.cutOf(xe),derivativeUrl:J.derivativeOf(xe),cropping:L.recropping(Q(xe.value)),cropped:L.framing?J.cropped(xe):L.cropped(Q(xe.value)),storeKey:J.keyOf(xe.key)}:null}})}),onRemove:N,tileActions:xe=>{const Le=Q(xe.value),ne=[];return L.offers(Le)&&ne.push({label:"Crop",glyph:"crop",onSelect:()=>L.framing?J.open(xe.key):L.recrop(Le,J.keyOf(xe.key))}),ne},children:[Ie&&h.jsx("p",{className:Dl,children:Ie}),Z&&n.kind==="picked"&&h.jsx(fd,{mode:"multi",propertyId:g,filter:n.filter,selectedIds:H.map(xe=>$.fileIdOf(U(xe.value))),onChange:ce,onClose:()=>te(!1)}),L.framing&&J.modal(),L.modal]})}function HY(e){const n={..._r.pages,...dt.pages}[e];return n?n.declaration:null}function e4(e,t){const n=D0(e,t);if(n===null)return null;const r=HY(n.table),i=r?Ln(r):null,a=i==null?void 0:i.fields[n.member],c=a?Ln(a):null;if(!c||!N0(c.fields))return null;const u=WT(Zs(c));if(u===null)return null;const{mediaKey:f,fields:p}=u,g=new Set(p.map(([m])=>m));return{annotated:u,toItem:m=>{const w=m!==null&&typeof m=="object"?m:{},v={};for(const[k,S]of Object.entries(w))g.has(k)||(v[k]=S);const _={[f]:v};for(const[k]of p)_[k]=w[k]??null;return _},toStored:m=>{const w=m[f],v=w!==null&&typeof w=="object"?{...w}:{};for(const[_]of p){const k=m[_];v[_]=typeof k=="string"&&k.trim()===""?null:k??null}return v}}}const qY=le(kt,"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");le(qY,"text-accent");le("absolute inset-0 grid place-items-center font-mono text-[12px] text-ink-3",BN);le(kt,"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 ju(e,t){const n=e.variant;return!n||t==null?!0:n.cases.includes(t)}const hj=new WeakMap;function yv(e,t){const n=e.element;if((n==null?void 0:n.fields)===void 0)return e;const r=hj.get(e)??new Map;hj.set(e,r);const i=r.get(t);if(i!==void 0)return i;const a=VY(n.fields,t),c=a===n.fields?e:{...e,element:{...n,fields:a}};return r.set(t,c),c}function VY(e,t){let n=!1;const r={};for(const[i,a]of Object.entries(e)){if(!ju(a,t)){n=!0;continue}const c=yv(a,t);c!==a&&(n=!0),r[i]=c}return n?r:e}function pj(e,t,n,r,i=!1){return{kind:"object",key:e,header:t,Icon:vT(n.map(a=>a.slot)),fields:n,selectSlotId:r,lone:i}}function vx(e,t){const n=[];for(const r of e.slot_order){const i=e.slots[r];if(!ju(i,t)||!Sl(i,{slots:e.slots}))continue;const a=Hl(i);if(a!==null){const c={slots:e.slots,fields:a.fields},u=Zs(a).filter(([,f])=>Sl(f,c)&&ju(f,t)).map(([f,p])=>({slotId:gd(r,f),slot:yv(p,t)}));if(u.length===0)continue;n.push(pj(r,Dr(a,r),u,r));continue}n.push(pj(r,{kind:"text",text:i.label},[{slotId:r,slot:yv(i,t)}],r,!0))}return n}function ZY(e,t,n){if(e.header.kind==="text")return e.header.text;const r=Hl(t.slots[e.key]);return r===null?e.key:Ks(e.header,r,n(e.key))}function mj(e){var t;return((t=Mo(e.slotId))==null?void 0:t.field)??e.slotId}function KY(e,t){return e.key===t||e.fields.some(n=>n.slotId===t)}function t4(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 GY(e,t,n){const r=[];for(const i of vx(e,t))for(const{slotId:a,slot:c}of i.fields)c.variant&&t4(n(a))&&r.push(a);return r}function Qh(e,t){const n=Object.entries(jp(e)).filter(([,i])=>Qu(i)==="address").map(([i])=>i);return t[e].map(i=>{const a={...i};for(const c of n)a[c]=tn(i[c]);return a})}function bv(e,t,n){const r=z0(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 bp(a)?WD(t[n.slice(0,i)],a):null}function YY(e,t,n){return Qh(e,n).find(r=>r.id===t)}function QY(e,t,n,r){const i=YY(e,t,r);return i===void 0?null:bv(e,i,n)}function vv(e,t,n,r={},i){const a=R0(n);return XY(e,t,PC(n),a,r)}function XY(e,t,n,r,i,a){return Qh(e,t).map(u=>{const f={id:u.id};for(const p of r)f[p]=u.id;for(const[p,g]of Object.entries(n))f[p]=bv(e,u,g);for(const[p,g]of Object.entries(i))f[p]=g(m=>bv(e,u,m),u.id);return f})}function WY(e,t){if(Rs(t))return T8(t,e);if(C8(t))return e[t.slice(9)];const n=Xt(t);if(n!==null)return Qh(n,e);const r=EL(t);if(r!==null)return Qh(r.table,e).map(i=>i[r.member]??null)}function JY(e,t,n,r){const i=Xt(e);return _h(i!==null?vv(i,t,n,r):WY(t,e)??null)}function wx(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 JY(n.key,a,Nh(e));if(n.kind==="member"){const c=i(n.holder);if(typeof c!="string"||c==="")return;const u=kp(a,n.tables,c);return u===null?void 0:QY(u,c,n.member,a)}}}function n4(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(eQ):void 0}const{facts:i}=r;if(i!==null){if(n.kind==="fact")return n.table===null?void 0:vv(n.table,i,Nh(e));if(n.kind==="rows")return n.tables.flatMap(a=>vv(a,i,Nh(e)))}}function eQ(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function tQ(){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(At,{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 nQ(e){const t=e.source;return t==null?void 0:t.kind}function gj(e,t,n,r,i){const a=r.type;if(a==="row")return{kind:"row",tables:wu(r)};const c=qs(r.source);if(c!==null){const f=lC(e,t,c.slot);return(f==null?void 0:f.kind)==="row"?{kind:"member",holder:f.path,tables:wu(f.def),member:c.field}:null}if(a==="list"){const f=Xw(i.fillSpec,n),p=Ww(r,f,i.sectionSlots),[g,...m]=p.kind==="table"?[]:Jw(p);if(g!==void 0)return{kind:"rows",tables:[g,...m]}}if(iC(r)!==null)return{kind:"slot"};const u=nQ(r);if(u==="home"){const f=r.source.key;return typeof f=="string"&&f!==""?{kind:"fact",key:f,table:Xt(f)}:null}return u==="derived"?{kind:"computed"}:null}function r4(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 g=gd(r,f),m=gj(e,u,g,p,t);m!==null&&n.push([g,m])}continue}const a=gj(e,{},r,i,t);a!==null&&n.push([r,a])}return n}function rQ(e,t,n={}){var r;return((r=r4(e,n).find(([i])=>i===t))==null?void 0:r[1])??null}function o4(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"?bj(e)===bj(t):yj(e)===yj(t)}function yj(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e)??""}function bj(e){const t=tn(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 vj(e){return Mi(dt.pages[e])}const Gy=2.5,oQ=1;function Qf(e){return e?e.closest(".we-acc-head"):null}function Gc(e){return e.closest(".we-acc")}function wj(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 iQ(e){e.style.removeProperty("--gx"),e.style.removeProperty("--gy")}function sQ(){x.useEffect(()=>{var p;if(typeof window>"u"||(p=window.matchMedia)!=null&&p.call(window,"(prefers-reduced-motion: reduce)").matches)return;let e=null,t=Gy;const n=typeof ResizeObserver<"u"?new ResizeObserver(()=>{e&&wj(e,t)}):null,r=(g,m)=>{g&&(e&&e!==g&&i(e),e=g,t=m,wj(g,m),n==null||n.observe(g))},i=g=>{g&&(n==null||n.unobserve(g),iQ(g),e===g&&(e=null))},a=g=>{const m=Qf(g.target);m&&r(Gc(m),Gy)},c=g=>{const m=Qf(g.target);if(!m)return;const w=g.relatedTarget;w&&m.contains(w)||i(Gc(m))},u=g=>{const m=Qf(g.target);m&&r(Gc(m),oQ)},f=g=>{const m=Qf(g.target);m&&(m.matches(":hover")?r(Gc(m),Gy):i(Gc(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 wv(e){return bi(e)}function aQ(e){return!Rs(e)||!Mh(e)?null:{home:"property",path:e.slice(9)}}function i4(e,t,n){return{home:wv(e),path:`${e}.${t}.${n}`}}function Yy(e,t){const[n,,r]=e.path.split("."),i=`property.${e.path}`;if(e.home==="property"&&Rs(i)&&T0(i)==="address")return tn(t);if(n===void 0||r===void 0||!y0().includes(n))return t;const a=$0(n,r),c=a===void 0?null:Qu(a);if(c==="address")return tn(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=>xj(u,p))}return xj(c,t)}function xj(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 lQ(e){return e.kind==="picks"?{kind:"picks",media_ids:e.mediaIds}:e}function xv(e,t){return e===t?!0:Array.isArray(e)?e.some(n=>xv(n,t)):e!==null&&typeof e=="object"&&Object.values(e).some(n=>xv(n,t))}function cQ(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 g=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[_]=Yy(i4(p,g,_),k))}const w=wv(p);r.push({op:"add_row",home:w,path:p,value:m,temp_id:g}),w==="library"&&r.push({op:"pick",path:p,id:g});for(const{ownerSlot:v,mediaId:_}of f.ownedMedia??[])r.push({op:"adopt_media",instance_id:t,slot:v,media_id:_,row_id:g});c.push(g)}if(c.length>0)for(const[f,p]of Object.entries(e.readSlots(t)))c.some(g=>xv(p,g))&&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 g=f.item_id;r.push(wv(p)==="library"?{op:"unpick",path:p,id:g}:{op:"remove_row",home:"property",path:`${p}.${g}`}),i(f.slotId,{kind:"item_removed",item_id:g})}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:Yy(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:lQ(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:Yy(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 g=(u=f.ownedMedia)==null?void 0:u[0],m=Dn(e.readValue(f));g!==void 0?r.push({op:"adopt_media",instance_id:t,slot:g.ownerSlot,media_id:g.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 uQ(e,t,n){const r=cQ(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,dQ(a.target,i))}function dQ(e,t){return"item_id"in e&&Object.hasOwn(t,e.item_id)?{...e,item_id:t[e.item_id]}:e}const dr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Ou(e,t,n=[]){const r=i=>{const a=Dn(i);a!==null&&dr(i)&&n.push({holder:t,mediaId:a,value:i})};if(zr(e))r(e);else if(Array.isArray(e))for(const i of e){if(zr(i)){r(i);continue}const a=dr(i)?j0(i):null;if(!(a===null||!dr(i)))for(const[c,u]of Object.entries(i))Ou(u,`${t}.${a}.${c}`,n)}else if(dr(e))for(const[i,a]of Object.entries(e))Ou(a,`${t}.${i}`,n);return n}const Xh=e=>`${e.holder}\0${e.mediaId}`;function Wh(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 kj(e,t){if(!dr(e))return;const n=e.cutout,r=e.crop,i=dr(n)&&typeof n.key=="string"&&n.key.startsWith(`processed/cutout/${t}/`)?n:r;if(!dr(i)||!dr(i.over))return;const a=i.over.crop;return dr(a)?a:null}function s4(e,t){const n=e.crop===null||Wh(kj(t.renditions,e.mediaId),e.crop),r=t.mobile,i=dr(r)?r.renditions:void 0;return n&&(e.mobileCrop===null||Wh(kj(i,e.mediaId),e.mobileCrop))}function fQ(e,t,n,r,i){const a=`${e}.${t}`,c=new Map(Ou(n,a).map(f=>[Xh(f),f.value])),u=[];for(const f of Ou(r,a)){const p=c.get(Xh(f));if(p===void 0)continue;const g=Ba(f.value.crop),m=Ba(dr(f.value.mobile)?f.value.mobile.crop:void 0),w=Ba(dr(p.mobile)?p.mobile.crop:void 0);if(Wh(g,Ba(p.crop))&&Wh(m,w))continue;const v={instanceId:e,slotId:t,holder:f.holder,mediaId:f.mediaId,crop:g,mobileCrop:m,editMark:i,ackSeq:null};g===null&&m===null||s4(v,f.value)||u.push(v)}return u}function hQ(e,t){var i;const n=e.instances.find(a=>a.instance_id===t.instanceId);if(!n)return null;const r=Xh(t);return((i=Ou(Dt(n.slots,t.slotId),`${t.instanceId}.${t.slotId}`).find(a=>Xh(a)===r))==null?void 0:i.value)??null}function xx(e,t,n){return e.holder===t&&e.mediaId===n}const Ua=96,Yc=72,pQ=25.4,mQ=/^(\d+(?:\.\d+)?)(in|mm)$/;function Qy(e){const t=mQ.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/pQ:i}function kx(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/Ua*Yc,pointHeight:e.height/Ua*Yc,bleedPoints:0};const t=e,n=Qy(t.width),r=Qy(t.height),i=t.bleed===void 0?0:Qy(t.bleed),a=n*Ua,c=r*Ua,u=i*Ua,f=a+2*u,p=c+2*u,g=t.dpi/Ua;return{frameWidth:a,frameHeight:c,bleed:u,viewportWidth:f,viewportHeight:p,deviceScaleFactor:g,pixelWidth:Math.round(f*g),pixelHeight:Math.round(p*g),pointWidth:(n+2*i)*Yc,pointHeight:(r+2*i)*Yc,bleedPoints:i*Yc}}const kv="concrete-frame";function a4(e){const t=kx(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}const gQ={sectionInstanceId:co,slotId:qh,slotGroup:QV,slotItem:GR,slotField:Yw,slotUnselectable:YR};function l4(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 yQ(e){const t=l4(e);if(!t)return;const n=kx(t);return{formatId:e.id,width:n.viewportWidth,height:n.viewportHeight,tokens:{...a4(t)}}}function bQ(e){const t=l4(e);return t===null?0:kx(t).bleed}function vQ(e,t,n){return{markers:gQ,assets:e,isSlotEditable:t,...n?{pageBox:n}:{}}}const c4="absolute bottom-4.5 z-[5]",u4="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)]",Jh="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",d4="text-[length:calc(13*var(--content))]",qa=15,ep="h-[calc(15*var(--content))] w-[calc(15*var(--content))]",_x=x.createContext(null);function wQ({store:e,children:t}){return h.jsx(_x.Provider,{value:e,children:t})}function je(e){const t=x.useContext(_x);if(!t)throw new Error("useEditorStore: missing EditorStoreProvider");return iN(t,e)}function hr(){const e=x.useContext(_x);if(!e)throw new Error("useEditorStoreApi: missing EditorStoreProvider");return e}function xQ(){const e=je(v=>v.session.pages),t=je(v=>v.session.canvases),n=je(v=>v.currentCanvasId),r=je(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=x.useRef(null),f=x.useRef(new Map),[p,g]=x.useState({left:!1,right:!1}),m=x.useCallback(()=>{const v=u.current;if(!v)return;const _=v.scrollWidth-v.clientWidth;g(_>1?{left:v.scrollLeft>1,right:v.scrollLeft<_-1}:{left:!1,right:!1})},[]);x.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]),x.useEffect(()=>{var v;(v=f.current.get(n))==null||v.scrollIntoView({block:"nearest",inline:"nearest"})},[n]);const w=v=>{var _;(_=u.current)==null||_.scrollBy({left:v*160,behavior:"smooth"})};return t.length<2?null:h.jsx("div",{className:le(c4,"pointer-events-none left-0 right-[calc(var(--we-panel-w,436px)+20px)] flex justify-center"),children:h.jsxs("div",{className:le(u4,"pointer-events-auto min-w-0 max-w-[min(calc(560*var(--frame)),calc(100%-430*var(--content)))]"),children:[p.left&&h.jsx(_j,{dir:-1,onClick:()=>w(-1),children:h.jsx(Mp,{size:qa,className:ep})}),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(kQ,{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(_j,{dir:1,onClick:()=>w(1),children:h.jsx(Rp,{size:qa,className:ep})})]})})}function _j({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:Jh,children:n})}function kQ({ref:e,label:t,active:n,struck:r,onClick:i}){const[a,c]=x.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:le(d4,"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 f4(e,t){var n;return((n=e.parentElement)==null?void 0:n.closest(`[${t.slotId}],[${t.slotField}]`))??null}function yo(e,t){return!e.hasAttribute(t.slotUnselectable)}function h4(e,t,n,r){const i=[];for(const a of Array.from(e.querySelectorAll(t)))f4(a,r)===n&&i.push(a);return i}function Sx(e,t,n){return h4(e,`[${n.slotItem}="${String(t)}"]`,e,n)}function Sj(e,t,n,r){var a;let i=e.closest(`[${t}]`);for(;i&&n.contains(i);){if(yo(i,r)&&f4(i,r)===n)return i;i=((a=i.parentElement)==null?void 0:a.closest(`[${t}]`))??null}return null}const ss=1,_Q=12,SQ=8,EQ=8;function jQ(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 OQ(e){const t=yd(e);return t.width<=0||t.height<=0?!1:!AQ(e,t)}function Ej(e){return e==="hidden"||e==="scroll"||e==="auto"||e==="clip"}function AQ(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 g=n.getComputedStyle(p),m=Ej(g.overflowX||g.overflow),w=Ej(g.overflowY||g.overflow);if(!m&&!w)continue;const v=p.getBoundingClientRect();m&&(i=Math.max(i,v.left),a=Math.min(a,v.right)),w&&(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 yd(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=yd(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 _v(e,t,n,r){if(!e)return;if(!t){Sv(e);return}const i=jQ(yd(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 jj(e,t){e.removeAttribute("data-kind"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.setAttribute("data-kind",t)})})}function Sv(e){e&&(e.removeAttribute("data-active"),e.removeAttribute("data-kind"))}function Qc(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)=>_v(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 Oj(e,t,n){if(!e)return;if(!t||!n){yh(e);return}const r=yd(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",`${_Q}px`);const c=r.top<SQ?CQ(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 CQ(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+EQ:0}function yh(e){e&&(e.removeAttribute("data-active"),e.textContent="")}function bo(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,t=>`\\${t}`)}function Ex(e){const t=e.filter(n=>OQ(n));return t.length>0?t:e.slice(0,1)}function p4(e,t,n){const r=Array.from(e.querySelectorAll(`[${n.slotId}="${bo(t)}"]`)).filter(i=>yo(i,n));return Ex(r)}function NQ(e,t,n){if(!t||t.kind!=="slot"||t.item_index==null)return[];const r=[];for(const i of e)r.push(...Sx(i,t.item_index,n).filter(a=>yo(a,n)));return Ex(r)}function m4(e,t,n){if(!t)return[];const r=e.querySelector(`[${n.sectionInstanceId}="${bo(t.instance_id)}"]`);if(!r)return[];if(t.kind==="section")return[r];const i=p4(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}="${bo(t.field_name)}"]`:null,c=[];for(const u of i){let f=[u];if(!(t.item_index!=null&&(f=Sx(u,t.item_index,n).filter(p=>yo(p,n)),f.length===0)))for(const p of f)if(a){const g=h4(p,a,u,n).filter(m=>yo(m,n));if(g.length>0){c.push(...g);continue}p!==u&&c.push(p)}else c.push(p)}if(c.length>0)return Ex(c)}return i.map(a=>{const c=a.closest(`[${n.slotGroup}]`);return c&&yo(c,n)?c:a})}function MQ(e,t,n){return m4(e,t,n)[0]??null}const Aj="we-enh-shield",Cj="we-enh-shield--item",ds="data-we-live";function RQ(e,t,n){if(!t||t.kind!=="slot"||t.item_index==null)return[];const r=[];for(const i of g4(e,t,n))r.push(...Sx(i,t.item_index,n).filter(a=>yo(a,n)));return r}function g4(e,t,n){if(!t||t.kind!=="slot")return[];const r=e.querySelector(`[${n.sectionInstanceId}="${bo(t.instance_id)}"]`);return r?Array.from(r.querySelectorAll(`[${n.slotId}="${bo(t.slot_id)}"]`)):[]}function y4(e,t,n){if(e.querySelectorAll(`[${ds}]`).forEach(i=>i.removeAttribute(ds)),!t)return;const r=e.querySelector(`[${n.sectionInstanceId}="${bo(t.instance_id)}"]`);if(r)if(t.kind==="section")r.setAttribute(ds,"true");else{const i=RQ(e,t,n),a=i.length>0?i:g4(e,t,n).filter(c=>yo(c,n));for(const c of a)c.setAttribute(ds,"true")}}const Es=1440,Nj=Math.round(Es*9/16),b4=14,jx="we-frame-defaults";function TQ(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 $Q(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 ${jx} {
|
|
623
|
+
[${e}] > .we-section-body > * { flex-shrink: 0; }
|
|
624
|
+
}`}function zQ(e,t){const n=t?`#we-page {
|
|
625
|
+
padding: 0;
|
|
626
|
+
}`:`#we-page {
|
|
627
|
+
width: ${Es}px;
|
|
628
|
+
min-height: ${Nj}px;
|
|
629
|
+
overflow: hidden;
|
|
630
|
+
border-radius: ${b4}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: ${Nj}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 ${jx} {
|
|
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?$Q(e.sectionInstanceId):TQ(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
|
+
.${Aj} {
|
|
737
|
+
position: absolute;
|
|
738
|
+
inset: 0;
|
|
739
|
+
z-index: 1;
|
|
740
|
+
cursor: pointer;
|
|
741
|
+
background: transparent;
|
|
742
|
+
}
|
|
743
|
+
.${Cj} { z-index: 2; }
|
|
744
|
+
[${ds}] .${Aj} { 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
|
+
[${ds}]:has(> .${Cj}) { 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([${ds}]) .tr-slider__nav { pointer-events: none; }
|
|
760
|
+
`}function DQ(e,t){const r=e/Es,i=Number.POSITIVE_INFINITY;return Math.max(.05,Math.min(.9,.72*r,.1926*r+.54,i))}const LQ=420,Mj=.92;function IQ(e,t,n){if(!n)return e;const r=Math.max(e,LQ/n.width),i=Math.min(.9,e*Es/n.width,Mj*t.availableWidthPx/n.width,Mj*t.availableHeightPx/n.height);return Math.max(.05,Math.min(r,i))}function Rj(e,t,n){var i;let r=e.closest(`[${t}]`);for(;r&&!yo(r,n);)r=((i=r.parentElement)==null?void 0:i.closest(`[${t}]`))??null;return r}function UQ(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 PQ(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=Rj(e,n.markers.slotGroup,n.markers);if(u&&r.contains(u)){const S=UQ(u,i,n);return S?{selection:{kind:"slot",instance_id:i,slot_id:S},element:u}:c}const f=Rj(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 g=Sj(e,n.markers.slotItem,f,n.markers),m=g?Number(g.getAttribute(n.markers.slotItem)):NaN,w=Number.isInteger(m)?m:void 0,v=Sj(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,...w!==void 0?{item_index:w}:{},...k?{field_name:k}:{}},element:(k?v:null)??g??f}}function mi(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 v4(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 w4(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 FQ(e,t,n){const r=t.createElement("div");r.setAttribute(n.sectionInstanceId,e.instance_id),r.setAttribute("data-section-label",mi(e)),r.dataset.renderKey=e.render_key,r.dataset.htmlHash=v4(e.html);const i=t.createElement("div");return i.className="we-section-body",e.render_error||e.html===null?i.appendChild(w4(e,t)):i.innerHTML=e.html,r.appendChild(i),r}const BQ=`(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 lt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function El(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function HQ(e,t="column"){return x4(e.id,{...a4(e)},t)}function x4(e,t,n="column"){const r=Object.entries(t).map(([i,a])=>`${i}:${a}`).join(";");return{class:kv,dataFormat:e,style:r,...n==="row"?{dataDirection:"row"}:{}}}function Tj(e,t,n="column"){const r=HQ(e,n),i=r.dataDirection===void 0?"":`data-direction="${r.dataDirection}" `;return`<div class="${lt(r.class)}" data-format="${lt(r.dataFormat)}" ${i}style="${lt(r.style)}">${t.join("")}</div>`}function qQ(e){switch(e.destination){case"published":return GQ(e);case"capture":return YQ(e);case"canvas":return QQ(e)}}function VQ(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${BQ}<\/script>`]}const ZQ="html, body { margin: 0; padding: 0; }";function KQ(e){const t=[`rel="${e.rel}"`,`href="${lt(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${lt(e.sizes)}"`),e.type!==void 0&&t.push(`type="${lt(e.type)}"`),`<link ${t.join(" ")} />`}function GQ(e){const{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${lt(t.title)}</title>`,`<meta name="description" content="${lt(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${lt(t.canonical)}" />`);for(const i of t.icons??[])n.push(KQ(i));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${lt(t.siteName)}" />`),n.push(`<meta property="og:title" content="${lt(t.title)}" />`),n.push(`<meta property="og:description" content="${lt(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${lt(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${lt(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="${lt(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${lt(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${lt(t.title)}" />`),n.push(`<meta name="twitter:description" content="${lt(t.description)}" />`),n.push(`<meta name="twitter:image" content="${lt(t.ogImage)}" />`)),n.push(..._4(e.stylesheets)),n.push(...S4(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${El({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}<\/script>`);const r=e.siteConfig?`
|
|
809
|
+
<script type="application/json" id="concrete-site-config">${El(e.siteConfig)}<\/script>`:"";return k4({lang:t.lang??"en",head:n,body:` <body class="concrete-root">
|
|
810
|
+
${e.root.bodyHtml}${r}${E4(e.islands,"viewport")}
|
|
811
|
+
`+(e.analyticsJs===void 0?"":` <script type="module" src="${lt(e.analyticsJs.url)}"><\/script>
|
|
812
|
+
`)+" </body>"})}function YQ(e){const t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${lt(e.title)}</title>`),t.push(..._4(e.stylesheets));const n=[ZQ,...eX(e.root)];return t.push(tX(n)),t.push(...VQ(e.islands)),t.push(...S4(e.islands)),k4({lang:"en",head:t,body:` <body>${JQ(e.root)}${E4(e.islands,"eager")}</body>`})}function QQ(e){const t=e.stylesheets.hrefs.map(n=>`<link rel="stylesheet" href="${lt(n)}">`).join("");return`<!doctype html>
|
|
813
|
+
<html>
|
|
814
|
+
<head>
|
|
815
|
+
<meta charset="utf-8">
|
|
816
|
+
<base href="${lt(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}${WQ(e.islands)}
|
|
823
|
+
<style>${e.frameCss}</style>
|
|
824
|
+
</head>
|
|
825
|
+
<body>
|
|
826
|
+
<div id="${lt(e.root.id)}"${XQ(e.root)}></div>
|
|
827
|
+
</body>
|
|
828
|
+
</html>`}function XQ(e){if(!e.pageBox)return"";const t=x4(e.pageBox.formatId,e.pageBox.tokens,e.pageBox.direction);return` class="${lt(t.class)}" data-format="${lt(t.dataFormat)}"`+(t.dataDirection===void 0?"":` data-direction="${t.dataDirection}"`)+` style="${lt(t.style)}"`}function WQ(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="${lt(e.hostScriptSrc)}"><\/script>`:"";return`${Object.keys(e.importMap).length===0?"":`
|
|
830
|
+
<script type="importmap">${El({imports:e.importMap})}<\/script>`}
|
|
831
|
+
<script>window.__TR_ISLAND_MAP=${El(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 k4(e){const t=e.head.map(n=>` ${n}`).join(`
|
|
835
|
+
`);return`<!doctype html>
|
|
836
|
+
<html lang="${lt(e.lang)}">
|
|
837
|
+
<head>
|
|
838
|
+
${t}
|
|
839
|
+
</head>
|
|
840
|
+
${e.body}
|
|
841
|
+
</html>
|
|
842
|
+
`}function JQ(e){return e.kind==="frame"?Tj(e.format,e.sectionHtml,e.direction):e.pages.map(t=>Tj(e.format,t.sectionHtml,t.direction)).join(`
|
|
843
|
+
`)}function eX(e){return e.kind!=="frameStack"?[]:[`body > .${kv} { break-after: page; }`,`body > .${kv}:last-child { break-after: auto; }`]}function _4(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${lt(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function tX(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 S4(e){if(e.kind!=="bundles"||Object.keys(e.islandMap).length===0)return[];const t=[`<script type="importmap">${El({imports:e.reactVendorMap})}<\/script>`];for(const n of[e.runtime.url,...Object.values(e.reactVendorMap),e.reactVendorCore.url])t.push(`<link rel="modulepreload" href="${lt(n)}" />`);return t}function E4(e,t){return e.kind==="none"||Object.keys(e.islandMap).length===0?"":`
|
|
847
|
+
<script>window.__TR_ISLAND_MAP=${El(e.islandMap)};${t==="eager"?' window.__TR_ISLAND_SCHEDULE = "eager";':""}<\/script>
|
|
848
|
+
<script type="module" src="${lt(e.runtime.url)}"><\/script>`}function nX(e){return Object.keys(e.islandMap).length===0?{kind:"none"}:{kind:"editorHost",islandMap:e.islandMap,importMap:e.importMap,hostScriptSrc:e.hostScriptSrc}}function rX(e,t,n){return qQ({destination:"canvas",root:{kind:"canvas",id:"we-page",...n?{pageBox:{formatId:n.formatId,tokens:n.tokens,...n.direction===void 0?{}:{direction:n.direction}}}:{}},islands:nX(e),stylesheets:{kind:"links",hrefs:e.stylesheets},base:e.basePath,defaultsLayer:jx,frameCss:zQ(t,n)})}function oX(e){return!!(e!=null&&e.getElementById("we-page"))}function iX(e){return{srcdoc:(t=e.pageBox)=>rX(e.assets,e.markers,t),buildSectionWrapper:(t,n)=>FQ(t,n,e.markers),buildErrorPlaceholder:w4,resolveTarget:(t,n)=>PQ(t,n,e),resolveSelectionEl:(t,n)=>MQ(t,n,e.markers),resolveSelectionEls:(t,n)=>m4(t,n,e.markers),resolveVisibleSlotEls:(t,n)=>p4(t,n,e.markers),resolveItemEls:(t,n)=>NQ(t,n,e.markers),setLiveOwner:(t,n)=>y4(t,n,e.markers)}}const j4=(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 O4(e){return j4(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 A4(e){return j4(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 sX=42,C4=16;function aX(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 lX=O4("we-htab-eye-off"),cX=A4("we-htab-eye-on"),Ev=new WeakMap;function uX(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">${lX}${cX}</span><span class="we-htab-name"></span>`;const a=i.querySelector(".we-htab-name");return a&&(a.textContent=n),Ev.set(i,r),i.addEventListener("click",c=>{var u;c.stopPropagation(),(u=Ev.get(i))==null||u()}),i}function dX(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=uX(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}`),Ev.set(f,()=>r(u.instanceId))}a.add(u.instanceId),c.push(f)}return i.forEach((u,f)=>{a.has(f)||u.remove()}),c}function $j(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=aX(r,sX);e.forEach((a,c)=>{a.style.top=`${i[c]}px`,a.style.left=`${C4-a.offsetWidth}px`})}const fX=48,hX=30,N4=`
|
|
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, ${Es}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(${fX}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 ${Es}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, ${Es}px);
|
|
1019
|
+
height: var(--we-page-h, 0px);
|
|
1020
|
+
border-radius: var(--we-page-radius, ${b4}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+C4} * 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
|
+
`,pX='<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>',jv="we-canvas-frame",Ov="we-frame-titlebar",zj="we-canvas-frame-label",Dj="we-htabs",Lj="we-chrome-overlay";function Xy(e,t,n){const r=e.querySelector(t);if(r)return r;const i=n();return e.appendChild(i),i}function M4(e,t){const n=e.querySelector(`:scope > .${Ov}`);if(n)return n;const r=t.createElement("div");return r.className=Ov,e.insertBefore(r,e.firstChild),r}function mX(e){for(let t=e.nextElementSibling;t;t=t.nextElementSibling)if(t.classList.contains(jv))return t;return null}function gX(e,t){const n=e.ownerDocument,r=M4(e,n),i=t.label??"",a=r.querySelector(`:scope > .${zj}`);if(i==="")a==null||a.remove();else{const g=a??r.insertBefore(n.createElement("div"),r.firstChild);g.className=zj,g.textContent!==i&&(g.textContent=i)}const c=Xy(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=Xy(e,`:scope > .${Dj}`,()=>{const g=n.createElement("div");return g.className=Dj,g}),f=Xy(e,`:scope > .${Lj}`,()=>{const g=n.createElement("div");return g.className=Lj,g.setAttribute("aria-hidden","true"),g});f.childElementCount===0&&(f.innerHTML=pX);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 yX(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 bX(e,t){const n=e.ownerDocument,r=new Map;for(const f of Array.from(e.querySelectorAll(`:scope > .${jv}`))){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=jv,p.dataset.frameKey=f.key);const g=gX(p,f);i.push(p),c.add(f.key),a.push(yX(p,f.key,g))}let u=null;for(let f=i.length-1;f>=0;f--){const p=i[f];p&&((p.parentNode!==e||mX(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",`${hX}px`):e.style.removeProperty("--we-frame-label-lane"),a}function vX(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 Ij="we-frame-toggle",Uj=new WeakMap;function wX(e,t,n,r){e.dataset.pageHidden=n.hidden?"true":"false";let i=e.querySelector(`:scope > .${Ov} > .${Ij}`);if(!n.toggleable){i==null||i.remove();return}i||(i=t.createElement("button"),i.type="button",i.className=Ij,i.addEventListener("click",p=>{var g;p.stopPropagation(),(g=Uj.get(i))==null||g()}),M4(e,t).appendChild(i)),Uj.set(i,r);const a=n.hidden?"hidden":"visible";i.dataset.pageVisibility!==a&&(i.dataset.pageVisibility=a,i.innerHTML=n.hidden?O4("we-frame-toggle-glyph"):A4("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 kX=24;function _X(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 Pj="__trEditorBridge",SX=1,R4=new WeakMap;function EX(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 jX(e){const t=e[Pj];if(t)return t;const n=new Set,r={protocol:SX,selection:null,subscribe(i){return n.add(i),()=>{n.delete(i)}}};return R4.set(r,n),e[Pj]=r,r}function OX(e,t,n){if(!e||!t)return;const i=jX(e);i.selection=EX(n);for(const a of[...R4.get(i)??[]])a()}function T4({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 $4({children:e}){return h.jsxs(T4,{children:[h.jsx("div",{className:"we-canvas-stage absolute inset-0","aria-hidden":"true",children:h.jsx("style",{children:N4})}),h.jsx("div",{className:"absolute inset-0 grid place-items-center p-6",children:e})]})}const AX={},CX=[];function NX({ports:e,children:t}){const n=je(c=>c.session.fill_holders.processing??AX),r=je(c=>c.session.fill_holders.failed_crops??CX),i=je(c=>c.awaitedCuts),a=x.useMemo(()=>({...e,isMediaProcessing:(c,u)=>Object.hasOwn(n,c)&&(n[c]??[]).includes(u)||i.some(f=>xx(f,c,u)),cropFailedAt:(c,u)=>SM(r,c,u)}),[e,n,r,i]);return h.jsx(KN,{ports:a,children:t})}function tp(e){return(e==null?void 0:e.kind)==="section-settings"?{kind:"section",instance_id:e.instance_id}:e}function z4(e,t){return e.find(n=>n.page_ids.includes(t))}function MX(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 bh(e,t){const n=t.find(r=>r.path==="/");return(n?z4(e,n.id):void 0)??e[0]}function Au(e,t){const n=new Set(t);return e.filter(r=>n.has(r.id)).flatMap(r=>r.page_ids)}const RX={sectionInstanceId:co,slotId:qh,slotItem:GR,slotField:Yw,slotUnselectable:YR};function np(e){return(e==null?void 0:e.__trIslands)??null}function TX(e,t,n){const r=()=>{};if(!e||!t)return r;if(np(e))return n(),r;const i=t.getElementById("tr-island-host");if(!i)return r;const a=()=>{np(e)&&n()},c=()=>{i.removeEventListener("load",a),i.removeEventListener("error",c)};return i.addEventListener("load",a),i.addEventListener("error",c),c}function Fj(e,t){var n;(n=np(e))==null||n.hydrateSection(t)}function Av(e,t){var n;(n=np(e))==null||n.unmountSection(t)}function $X(e,t){t.querySelectorAll(".we-section-body").forEach(n=>Av(e,n)),t.remove()}function Wy(e,t){y4(e,tp(t),RX)}function zX(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 DX(e,t){const n=new DOMParser().parseFromString(t,"text/html"),r=Array.from(n.querySelectorAll("img")).filter(i=>Bj.test(i.getAttribute("src")??"")||Bj.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 Bj=/(^|[\s,])https?:\/\//;function D4(e,t){return new Promise(n=>{const r=setTimeout(n,t);e.then(()=>{clearTimeout(r),n()},()=>{clearTimeout(r),n()})})}const LX=4e3,Xf=new WeakMap;function IX(e,t,n,r){const i=e.ownerDocument.defaultView;if(t.render_error||t.html===null){Xf.delete(e),Av(i,e),e.innerHTML="",e.appendChild(n.buildErrorPlaceholder(t,e.ownerDocument));return}const a=zX(e.ownerDocument,t.html),c={};Xf.set(e,c);const u=()=>Xf.get(e)!==c?!1:(Xf.delete(e),Av(i,e),e.replaceChildren(...Array.from(a.holder.childNodes)),!0);if(a.loaded){u();return}D4(a.ready,LX).then(()=>{u()&&r()})}function UX(e,t){return typeof e=="string"&&e!==t}function Hj(e){const t=new Map;if(e===null)return t;const n=e;for(const[r,i]of Rl(n))t.set(r,JSON.stringify([i,n.files[i.file]??null]));return t}function PX(e,t){const n=Hj(e),r=Hj(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 Cv(e,t){if(Array.isArray(e))return e.some(r=>Cv(r,t));if(typeof e!="object"||e===null)return!1;const n=Qn(e);return n!==void 0&&t.has(n)?!0:Object.values(e).some(r=>Cv(r,t))}function FX(e,t){return t.size===0?[]:e.instances.filter(n=>Cv(n.slots,t)).map(n=>n.instance_id)}function rp(e){return`slots.${e}`}function BX(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 g=i.get(p.instance_id);if(!g)return p;const m=HX(p,g,w=>r(p.instance_id,w));return m===p?p:(a.push(p.instance_id),m)}),u=Nv(Jy(t),Jy(n),p=>r(null,p));return{doc:a.length===0&&u===null?t:{...u??Jy(t),instances:c},changedInstanceIds:a}}function HX(e,t,n){const r=Nv(e.slots,t.slots,a=>n(rp(a))),i=Nv(eb(e),eb(t),n);return r===null&&i===null?e:{...i??eb(e),slots:r??e.slots}}function Nv(e,t,n){let r=null;const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const a of i)js(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 Jy(e){const{instances:t,...n}=e;return n}function eb(e){const{slots:t,...n}=e;return n}function js(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)=>js(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=>js(n[c],r[c]))}const Ox=async({storeApi:e,renders:t})=>{const n=e.getState().iframeDocs;await Promise.all(t.flatMap(r=>n.map(i=>DX(i,r.html))))};function qX(e,t){return async({storeApi:n,local:r,incoming:i,changedInstanceIds:a})=>{const c=n.getState().session.property_id,u=qj(r,a),f=[...qj(i,a)].filter(p=>!u.has(p));await Promise.all(f.map(async p=>{try{const g=await NU(e,c,p,t);await ZX(g)}catch{}}))}}function VX(...e){return async t=>{await Promise.all(e.map(n=>n(t)))}}const tb=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function qj(e,t){const n=new Set,r=i=>{if(Array.isArray(i)){i.forEach(r);return}if(!tb(i))return;const a=i.renditions;if(tb(a))for(const c of["crop","cutout"]){const u=a[c],f=tb(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 ZX(e){const t=new Image;return t.src=e,typeof t.decode=="function"?t.decode().catch(()=>{}):Promise.resolve()}const Vj=100;function Mv(e){return structuredClone(e)}function KX(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 nb(e){return{entries:[{doc:Mv(e),target:null}],index:0}}function L4(e){return e.index>0}function I4(e){return e.index<e.entries.length-1}function GX(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&&KX(a.target,t)){const f=i.slice(0,-1).concat({doc:Mv(n),target:t});return{entries:f,index:f.length-1}}let c=i.concat({doc:Mv(n),target:t}),u=c.length-1;return c.length>Vj&&(c=c.slice(c.length-Vj),u=c.length-1),{entries:c,index:u}}function YX(e){if(!L4(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 QX(e){if(!I4(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 U4(e){const t=e.variant_select;return!t||t.locked||t.cases.length<2?null:t.cases}function Wp(e,t){return(t==null?void 0:t.variant)??e.variant}function XX(e,t,n){return GY(e.schema,t,r=>n?Dt(n.slots,r):void 0)}function WX(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"||JX(i,r,e)?e:{kind:"section",instance_id:e.instance_id}}function JX(e,t,n){var u;const r=Wp(e,t),i=Mo(n.slot_id),a=e.schema.slots[(i==null?void 0:i.object)??n.slot_id];if(a===void 0||!ju(a,r))return!1;if(i!==null){const f=(u=Hl(a))==null?void 0:u.fields[i.field];if(f===void 0||!ju(f,r))return!1}const c=Dt(t.slots,n.slot_id);return t4(c)?!1:n.item_index===void 0||Array.isArray(c)&&n.item_index<c.length}const vh={pending:[],processing:{},failed:[],failed_crops:[],waiting:{},evaluating:!1};function eW(e){return e.pending.length>0||e.evaluating}function Zj(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=>xx(u,r,c)));a.length>0&&(n[r]=a)}return n}function Rv(e){return eW(e.session.fill_holders)||e.awaitedCuts.length>0}function rb(e,t,n){const r=new Set(bh(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 tW(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 So(e,t){return e.getState().backend===t}const nW=.5,rW=2;function oW(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 iW(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 sW(e){const t={};for(const n of e){const r=n.section_key.split("/").pop();t[r]=`#${n.schema.anchor}`}return t}function aW(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 Tv(e,t,n){if(e===t)return n;if(Array.isArray(e)){const r=e.map(i=>Tv(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,Tv(c,t,n)]);return i.some(([,a],c)=>a!==r[c][1])?Object.fromEntries(i):e}return e}function lW(e){const t=bh(e.bootstrap.canvases,e.bootstrap.pages).id;let n=0,r=0;const i=new Map,a=(p,g)=>`${p??""} ${g}`,c=(p,g)=>{i.set(a(p,g),++n)};let u=[];const f=(p,g)=>{if(g.length===0)return g;const m=g.filter(w=>{const v=hQ(p,w);return v===null?!1:s4(w,v)?(u.push(w),!1):!0});return m.length===g.length?g:m};return F0((p,g)=>({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??vh,content_fingerprint:e.bootstrap.content_fingerprint??null},content_doc:e.bootstrap.deliverable.content_doc,history:nb(e.bootstrap.deliverable.content_doc),selection:null,currentCanvasId:t,visitedCanvasIds:[t],page_renders:rb(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(nW,Math.min(rW,m))}),attachFrameDoc:m=>p(w=>w.iframeDocs.includes(m)?{}:{iframeDocs:[...w.iframeDocs,m]}),detachFrameDoc:m=>p(w=>w.iframeDocs.includes(m)?{iframeDocs:w.iframeDocs.filter(v=>v!==m)}:{}),mountFrameDoc:m=>p(w=>w.mountedFrameDocs.includes(m)?{}:{mountedFrameDocs:[...w.mountedFrameDocs,m]}),unmountFrameDoc:m=>p(w=>w.mountedFrameDocs.includes(m)?{mountedFrameDocs:w.mountedFrameDocs.filter(v=>v!==m)}:{}),setCurrentCanvas:m=>{p(w=>m===w.currentCanvasId?{}:w.session.canvases.some(v=>v.id===m)?{currentCanvasId:m,visitedCanvasIds:w.visitedCanvasIds.includes(m)?w.visitedCanvasIds:[...w.visitedCanvasIds,m],selection:null}:{})},setPendingPageScroll:m=>p({pendingPageScroll:m}),setSectionEnabled:(m,w)=>{c(m,"enabled"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>_.instance_id===m?{..._,enabled:w}:_)},hasChanges:!0}))},setPageEnabled:(m,w)=>{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:w}:S)},content_doc:{...v.content_doc,page_state:k?_.map(S=>S.page_id===m?{...S,enabled:w}:S):[..._,{page_id:m,enabled:w}]},hasChanges:!0}})},setSectionVariant:(m,w)=>{c(m,"variant"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>{if(_.instance_id!==m)return _;if(w===void 0){const{variant:k,...S}=_;return S}return{..._,variant:w}})},hasChanges:!0}))},setSlotValue:(m,w,v)=>{var _;c(m,rp(((_=Mo(w))==null?void 0:_.object)??w)),p(k=>{const S={...k.content_doc,instances:k.content_doc.instances.map(E=>E.instance_id===m?{...E,slots:FZ(E.slots,w,v)}:E)};return{content_doc:S,awaitedCuts:f(S,k.awaitedCuts),hasChanges:!0}})},markSlotOverridden:(m,w,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??{},[w]:!0};else if(v.kind==="item"){const E={...S.items??{}},O={...E[w]??{}},A={...O[v.item_id]??{}};A[v.field]=!0,O[v.item_id]=A,E[w]=O,S.items=E}else if(v.kind==="item_removed"){const E={...S.items_removed??{}},O={...E[w]??{}};O[v.item_id]=!0,E[w]=O,S.items_removed=E}else v.kind==="order"&&(S.order={...S.order??{},[w]:!0});return{...k,slot_overrides:S}})},hasChanges:!0}))},relinkSlot:(m,w,v)=>{c(m,"slot_overrides"),p(_=>({content_doc:{..._.content_doc,instances:_.content_doc.instances.map(k=>{var E;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[w],Object.keys(O).length===0?delete S.scalar:S.scalar=O}else if(v.kind==="item")oW(S,w,v.item_id,v.field);else if(v.kind==="item_removed")iW(S,w,v.item_id);else if(v.kind==="order"){if(((E=S.order)==null?void 0:E[w])!==!0)return k;const O={...S.order};delete O[w],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,w)=>{c(m,"slot_overrides"),p(v=>({content_doc:{...v.content_doc,instances:v.content_doc.instances.map(_=>{if(_.instance_id!==m)return _;if(w===void 0){const{slot_overrides:k,...S}=_;return S}return{..._,slot_overrides:w}})}}))},rewriteTempId:(m,w,v)=>{const _=g().content_doc.instances.find(E=>E.instance_id===m);if(_===void 0)return[];const k={},S=[];for(const[E,O]of Object.entries(_.slots)){const A=Tv(O,w,v);k[E]=A,A!==O&&S.push(E)}if(S.length===0)return[];for(const E of S)c(m,rp(E));return p(E=>({content_doc:{...E.content_doc,instances:E.content_doc.instances.map(O=>O.instance_id===m?{...O,slots:k}:O)}})),S},replaceSectionHtml:(m,w,v,_=null)=>{p(k=>({page_renders:{...k.page_renders,[m]:{...k.page_renders[m]??{},[w]:{html:v,render_error:_}}}}))},applyBootstrap:m=>{p(w=>{const{pages:v,canvases:_}=m,k=new Set(_.map(O=>O.id)),S=w.visitedCanvasIds.filter(O=>k.has(O)),E=bh(_,v);return{content_doc:m.deliverable.content_doc,awaitedCuts:f(m.deliverable.content_doc,w.awaitedCuts),session:{...w.session,template:m.template,bases:m.bases,format:m.format,sections:m.sections,pages:v,canvases:_,facts:m.facts,fill_holders:m.fill_holders??vh,content_fingerprint:m.content_fingerprint??null},currentCanvasId:k.has(w.currentCanvasId)?w.currentCanvasId:E.id,visitedCanvasIds:S.includes(E.id)?S:[E.id,...S],page_renders:rb(v,_,m.sections),history:nb(m.deliverable.content_doc),hasChanges:!1,saveState:"saved",savedAt:Date.now()}})},openDeliverable:m=>{const{bootstrap:w}=m;i.clear(),u=[],p(v=>{const{pages:_,canvases:k}=w,S=new Set(k.map(T=>T.id)),E=S.has(v.currentCanvasId),O=bh(k,_),A=E?v.currentCanvasId:O.id,R=v.visitedCanvasIds.filter(T=>S.has(T)),C=R.includes(A)?R:[...R,A],I=w.deliverable.content_doc,$=E?WX(v.selection,w.sections,I):null;return{backend:m.backend,session:{deliverable_id:w.deliverable.id,property_id:m.property_id,listing_intent:m.listing_intent,template:w.template,bases:w.bases,format:w.format,sections:w.sections,pages:_,canvases:k,facts:w.facts,fill_holders:w.fill_holders??vh,content_fingerprint:w.content_fingerprint??null},content_doc:I,history:nb(I),selection:$,currentCanvasId:A,visitedCanvasIds:C,page_renders:tW(rb(_,k,w.sections),v.page_renders,new Set(Au(k,C))),pendingPageScroll:null,revealSelection:$!==null&&!js(w.format,v.session.format),awaitedCuts:[],hasChanges:!1,saveState:"saved",savedAt:Date.now()}})},noteSelectionRevealed:()=>p(m=>m.revealSelection?{revealSelection:!1}:{}),editMark:()=>n,mergeRefreshedDoc:(m,w,v)=>{const{doc:_,changedInstanceIds:k}=g().planRefreshMerge(m,w,v);return _!==g().content_doc&&p({content_doc:_,awaitedCuts:f(_,g().awaitedCuts)}),k},planRefreshMerge:(m,w,v)=>BX({local:g().content_doc,server:m,isProtected:(_,k)=>(i.get(a(_,k))??0)>w||v(_,k)}),commitLanding:({server:m,sinceMark:w,isWritePending:v,at:_,facts:k,rerender:S,ready:E})=>{var G;const O=g(),{doc:A,changedInstanceIds:R}=O.planRefreshMerge(m,w,v),C=[];let I=O.page_renders;for(const H of new Set([...R,...S])){const U=E.get(H),z=(G=A.instances.find(K=>K.instance_id===H))==null?void 0:G.slots;if(U===void 0||!js(z,U.slots)){C.push(H);continue}for(const{pageId:K,html:N}of U.pages)I={...I,[K]:{...I[K]??{},[H]:{html:N,render_error:null}}}}const $=u.length,T=A===O.content_doc?O.awaitedCuts:f(A,O.awaitedCuts),F=u.slice($),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:Zj(W.processing,F)}}}),C},noteContentWritten:(m,w)=>p(v=>m!==null&&w!==null&&v.session.content_fingerprint===m?{session:{...v.session,content_fingerprint:w}}:{}),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(w=>w.fill_failure?{...w,fill_failure:null}:w)}}))},expectMark:()=>r,noteFillStatus:(m,w)=>p(v=>{const _=new Map(m.fill_failures.map(F=>[F.instance_id,F])),k=u;u=[];const S={...m.fill_holders,processing:Zj(m.fill_holders.processing,k),evaluating:m.fill_holders.evaluating||r>w},E=new Set(m.fill_holders.pending),O=new Set(m.fill_holders.failed),A=F=>F.ackSeq!==null&&w>=F.ackSeq&&!m.fill_holders.evaluating&&!E.has(F.holder),R=v.awaitedCuts.filter(F=>!O.has(F.holder)&&!A(F)),C=R.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 aW(F.fill_failure,G)?F:{...F,fill_failure:G}}),$=I.some((F,W)=>F!==v.session.sections[W]),T=!js(S,v.session.fill_holders);return!$&&!T&&!C?v:{session:{...v.session,fill_holders:T?S:v.session.fill_holders,sections:$?I:v.session.sections},awaitedCuts:C?R:v.awaitedCuts}}),awaitCuts:m=>{m.length!==0&&(r+=1,p(w=>({awaitedCuts:[...w.awaitedCuts.filter(v=>!m.some(_=>xx(v,_.holder,_.mediaId))),...m],session:{...w.session,fill_holders:{...w.session.fill_holders,evaluating:!0}}})))},ackAwaitedCuts:(m,w,v)=>p(_=>{const k=S=>S.ackSeq===null&&S.instanceId===m&&S.slotId===w&&S.editMark<=v;return _.awaitedCuts.some(k)?{awaitedCuts:_.awaitedCuts.map(S=>k(S)?{...S,ackSeq:r}:S)}:_}),dropAwaitedCuts:(m,w,v)=>p(_=>{const k=_.awaitedCuts.filter(S=>!(S.instanceId===m&&S.slotId===w&&S.editMark<=v));return k.length===_.awaitedCuts.length?_:{awaitedCuts:k}}),beginSave:()=>p(m=>({saveState:"saving",pendingSaves:m.pendingSaves+1})),finishSave:m=>p(w=>{const v=Math.max(0,w.pendingSaves-1);return v>0?{pendingSaves:v}:{pendingSaves:0,saveState:m?"saved":"error",savedAt:m?Date.now():w.savedAt}}),recordEdit:m=>p(w=>({history:GX(w.history,{...m,canvasId:w.currentCanvasId},w.content_doc)})),undo:()=>{const m=YX(g().history);return m?(p({history:m.next}),m.step):null},redo:()=>{const m=QX(g().history);return m?(p({history:m.next}),m.step):null}}))}function cW(e,t){const n=new Set(Au(e.session.canvases,e.visitedCanvasIds)),r=new Set(Au(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 Ax(e,t,n){const r=e.getState();await P4(r,r.content_doc,t,n,(i,a)=>{So(e,r.backend)&&e.getState().replaceSectionHtml(i,t,a,null)})}async function uW(e,t,n){const r=[];return await P4(e,t,n,void 0,(i,a)=>r.push({pageId:i,instanceId:n,html:a})),r}async function P4(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:sW(e.session.sections.filter(p=>{var g;return((g=t.instances.find(m=>m.instance_id===p.instance_id))==null?void 0:g.enabled)!==!1}))},instance_id:n,variant:r});i(u,f);return}await Promise.all(cW(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 Kj=new WeakMap;function bd(e){let t=Kj.get(e);return t||(t={timers:new Map,inFlight:new Map},Kj.set(e,t)),t}function Cx(e,t){return`${e} ${t}`}function F4(e){const{timers:t}=bd(e),n=[...t.values()];t.clear();for(const{timer:r,send:i}of n)clearTimeout(r),i()}function dW(e,t,n){const{inFlight:r}=bd(e),i=Cx(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 fW(e,t,n){const{timers:r,inFlight:i}=bd(e),a=Cx(t,n),c=`${a}.`,u=f=>f===a||f.startsWith(c);return[...r.keys()].some(u)||[...i.keys()].some(u)}function hW(e,t){const{timers:n,inFlight:r}=bd(e),i=`${t} `;for(const a of[...n.keys(),...r.keys()])if(a.startsWith(i))return!0;return!1}const Gj=rp(""),pW=4e3,mW=350,gW=e=>new Promise(t=>setTimeout(t,e));async function op(e,t,n,r=Ox){const{backend:i}=e.getState(),a=t.deliverable.content_doc,c=(_,k)=>_===null?!1:k==="slot_overrides"?hW(e,_):k.startsWith(Gj)&&fW(e,_,k.slice(Gj.length)),u=t.facts??null,f=e.getState().content_doc,p=e.getState().planRefreshMerge(a,n,c),g=FX(p.doc,PX(e.getState().session.facts,u)),m=[...new Set([...p.changedInstanceIds,...g])],w=new Map;if(m.length>0&&(await Promise.all(m.map(async _=>{try{const k=await uW(e.getState(),p.doc,_);w.set(_,{slots:yW(p.doc,_),pages:k})}catch(k){console.error("[editor] dependent re-render failed",{instanceId:_,err:k})}})),await D4(r({storeApi:e,local:f,incoming:p.doc,changedInstanceIds:m,renders:[...w.values()].flatMap(_=>_.pages)}),pW)),!So(e,i))return;const v=e.getState().commitLanding({server:a,sinceMark:n,isWritePending:c,at:t.content_fingerprint??null,facts:u,rerender:g,ready:w});await Promise.all(v.map(_=>Ax(e,_).catch(k=>{console.error("[editor] dependent re-render failed",{instanceId:_,err:k})})))}function yW(e,t){var n;return(n=e.instances.find(r=>r.instance_id===t))==null?void 0:n.slots}async function bW(e){const{storeApi:t,signal:n,wait:r=gW,intervalMs:i=mW,prepare:a=Ox}=e,{backend:c}=t.getState(),u=c.fills;if(!u)return;const f=()=>(n==null?void 0:n.aborted)===!0||!So(t,c);for(;!f();){const p=t.getState(),g=p.editMark(),m=p.expectMark(),w=await u.status();if(f())return;const v=UX(w.content_fingerprint,t.getState().session.content_fingerprint),_=v&&t.getState().pendingSaves>0;if(v&&!_){const k=await c.bootstrap();if(f())return;await op(t,k,g,a)}if(t.getState().noteFillStatus({fill_holders:w.fill_holders??vh,fill_failures:w.fill_failures},m),!_&&!Rv(t.getState()))return;await r(i)}}async function Jp(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(!So(e,r))return;await op(e,i,n)}catch(i){console.error("[editor] dependents refresh failed",{err:i})}}function em(e,t){e.getState().noteContentWritten(t.prior_content_fingerprint??null,t.content_fingerprint??null)}async function B4(e,t){const n=e.getState(),r=new Set(Au(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),g=i.get(f);!p||!g||c.push(n.backend.render({section_key:p.section_key,slots:g.slots,nav:{selfAnchor:p.schema.anchor},page_id:u.id,instance_id:f}).then(({html:m})=>{So(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 H4(e,t,n){e.getState().setPageEnabled(t,n),wW(e,t,n)}function vW(){const e=hr();return x.useCallback((t,n)=>{H4(e,t,n),e.getState().recordEdit({kind:"page",pageId:t})},[e])}async function wW(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}]);em(e,i),e.getState().finishSave(!0),e.getState().session.pages.length>1&&await B4(e,"page"),Jp(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 q4(e,t,n){e.getState().setSectionEnabled(t,n),xW(e,t,n)}function V4(){const e=hr();return x.useCallback((t,n)=>{q4(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}]);em(e,i),e.getState().finishSave(!0),await B4(e,"section"),Jp(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 kW=0;function _W({frameHandle:e,pageId:t,frame:n,isCurrent:r,declaredHeight:i,scale:a,stage:c,onFollowLink:u}){const[f,p]=x.useState(null),[g,m]=x.useState(null),w=g!==null&&g===f,v=x.useRef(w);x.useEffect(()=>{v.current=w},[w]);const _=x.useRef(null),k=hr(),S=je(H=>H.session.sections),E=je(H=>H.session.pages.find(U=>U.id===t)),O=je(H=>H.page_renders[t]),A=je(H=>H.content_doc.instances),R=je(H=>H.selection),C=x.useMemo(()=>tp(R),[R]),I=V4(),$=vW(),T=x.useMemo(()=>{if(!E)return[];const H=new Map(S.map(z=>[z.instance_id,z])),U=[];for(const z of E.instance_ids){const K=H.get(z),N=O==null?void 0:O[z];!K||N===void 0||U.push({...K,html:N.html,render_error:N.render_error})}return U},[E,S,O]),F=E!=null&&E.instance_ids.some(H=>(O==null?void 0:O[H])===void 0),W=x.useCallback(H=>{const U=H.target;if(!U)return;const z=U.closest("a"),{select:K}=k.getState(),N=n.resolveTarget(U,k.getState().session.sections)??null;if(z){if(H.preventDefault(),(N==null?void 0:N.selection.kind)==="slot"){const B=k.getState().selection,Y=N.selection,ie=(B==null?void 0:B.kind)==="slot"&&B.instance_id===Y.instance_id&&B.slot_id===Y.slot_id&&(B.item_index??void 0)===(Y.item_index??void 0);K(Y),ie&&u(z,e);return}u(z,e);return}K(N?N.selection:null)},[k,n,u,e]);x.useEffect(()=>{const H=e.iframe;function U(){const z=H.contentDocument;!z||!oX(z)||_.current!==z&&(z.body.addEventListener("click",W),_.current=z,p(z))}return H.addEventListener("load",U),U(),()=>{H.removeEventListener("load",U)}},[e,W]),x.useEffect(()=>()=>{var H;(H=_.current)==null||H.body.removeEventListener("click",W),_.current=null},[W]),x.useEffect(()=>{if(!f||i)return;const H=f.getElementById("we-page");if(!H)return;const U=()=>e.setPageHeight(H.getBoundingClientRect().height);U();const z=new ResizeObserver(U);return z.observe(H),()=>z.disconnect()},[f,i,e]),x.useEffect(()=>{if(f)return TX(f.defaultView,f,()=>m(f))},[f]),x.useEffect(()=>{if(!f||!r)return;const H=f;return k.getState().attachFrameDoc(H),()=>k.getState().detachFrameDoc(H)},[f,r,k]),x.useEffect(()=>{if(!f)return;const H=f;return k.getState().mountFrameDoc(H),()=>k.getState().unmountFrameDoc(H)},[f,k]),x.useEffect(()=>{const H=f;if(!H)return;const U=H.getElementById("we-page");if(!U)return;const z=H.defaultView,K=new Map;Array.from(U.children).forEach(B=>{const Y=B.getAttribute(co);Y&&K.set(Y,B)});const N=[];for(const B of T){let Y=K.get(B.instance_id);if(!Y)Y=n.buildSectionWrapper(B,H);else{Y.setAttribute("data-section-label",mi(B));const ie=v4(B.html),J=Y.dataset.renderKey!==B.render_key,L=Y.dataset.htmlHash!==ie;if(J||L){const Q=Y.querySelector(":scope > .we-section-body");Q&&IX(Q,B,n,()=>{v.current&&(Fj(z,Q),Wy(H,k.getState().selection))}),Y.dataset.renderKey=B.render_key,Y.dataset.htmlHash=ie}}N.push(Y),K.delete(B.instance_id)}K.forEach(B=>$X(z,B)),N.forEach((B,Y)=>{U.children[Y]!==B&&U.insertBefore(B,U.children[Y]??null)}),w&&(U.querySelectorAll(".we-section-body").forEach(B=>Fj(z,B)),Wy(H,k.getState().selection))},[f,T,w,k,n]);const G=je(H=>H.pendingPageScroll);return x.useEffect(()=>{!f||!r||F||!G||G.pageId!==t||(k.getState().setPendingPageScroll(null),wh(G.anchor,e,c,a))},[f,r,F,G,t,k,e,c]),x.useEffect(()=>{!f||!w||!r||OX(f.defaultView,f,C)},[f,w,C,T,r]),x.useEffect(()=>{E&&wX(e.wrapper,document,{toggleable:E.optional,hidden:!E.enabled,label:E.label},()=>{const H=k.getState().session.pages.find(U=>U.id===t);H&&$(t,!H.enabled)})},[E,t,e,$,k]),x.useEffect(()=>{const H=f;if(!H)return;const U=new Map(A.map(z=>[z.instance_id,z.enabled]));for(const z of T){const K=H.querySelector(`[${co}="${bo(z.instance_id)}"]`);K&&K.setAttribute("data-hidden",U.get(z.instance_id)===!0?"false":"true")}},[f,A,T]),x.useEffect(()=>{const H=f;if(!H)return;const U=e.tabLayer,z=new Map(A.map(J=>[J.instance_id,J.enabled])),K=T.filter(J=>z.get(J.instance_id)===!1).map(J=>({instanceId:J.instance_id,label:mi(J)})),N=dX(U,document,K,J=>{I(J,!0),k.getState().select({kind:"section",instance_id:J})}),B=J=>H.querySelector(`[${co}="${bo(J)}"]`);$j(N,B,a);const Y=H.getElementById("we-page"),ie=new ResizeObserver(()=>$j(N,B,a));return Y&&ie.observe(Y),()=>ie.disconnect()},[f,A,T,a,I,k,e]),x.useEffect(()=>{if(!r)return;const H=f;if(!H)return;const U=e.overlay;H.querySelectorAll(`[${co}][data-selected]`).forEach(ie=>ie.removeAttribute("data-selected")),H.querySelectorAll(`[${co}][data-slot-selected-inside]`).forEach(ie=>ie.removeAttribute("data-slot-selected-inside"));const z=U.querySelector(".we-chrome-label")??null;if(!C){Qc(U,[],ss),yh(z);return}const K=A.find(ie=>ie.instance_id===C.instance_id);if(K&&!K.enabled){Qc(U,[],ss),yh(z);return}const N=T.find(ie=>ie.instance_id===C.instance_id),B=H.querySelector(`[${co}="${bo(C.instance_id)}"]`);B==null||B.setAttribute("data-selected","true");const Y=n.resolveSelectionEls(H,C);if(C.kind==="section"){const ie=Qc(U,Y,ss,"section");for(const J of ie)jj(J,"section");Oj(z,Y[0]??null,N?mi(N):"")}else{B==null||B.setAttribute("data-slot-selected-inside","true");const ie=Qc(U,Y,ss,"slot");for(const J of ie)jj(J,"slot");yh(z)}Wy(H,C)},[f,C,T,A,n,r,e]),x.useEffect(()=>{if(!f||!C||!r)return;const H=A.find(D=>D.instance_id===C.instance_id);if(H&&!H.enabled)return;const U=f;if(!U)return;const z=e.overlay,K=z.querySelector(".we-chrome-label")??null,N=n.resolveSelectionEls(U,C);if(N.length===0)return;const B=T.find(D=>D.instance_id===C.instance_id),Y=C.kind==="section"?"section":"slot",ie=C.kind==="section"&&B?mi(B):"",J=()=>{Qc(z,N,ss,Y),C.kind==="section"&&Oj(K,N[0]??null,ie)},L=new ResizeObserver(J);for(const D of N)L.observe(D);const Q=U.getElementById("we-page");return Q&&L.observe(Q),()=>L.disconnect()},[f,C,A,T,n,r,e]),x.useEffect(()=>{const H=f;if(!H)return;const U=e.overlay.querySelector(".we-chrome-ring--hover");if(!U)return;let z=null,K=null,N=null;function B(){z&&(clearTimeout(z),z=null)}function Y(){B(),K=null,N=null,Sv(U??null)}function ie(D,Z){N=D,K=null,_v(U??null,D,ss,Z)}function J(D,Z){if(D===N){_v(U??null,D,ss,Z);return}D===K&&z||(B(),K=D,Sv(U??null),N=null,z=setTimeout(()=>{z=null,K===D&&ie(D,Z)},kW))}function L(D){const Z=n.resolveTarget(D.target,k.getState().session.sections)??null;if(!Z){Y();return}const te=tp(k.getState().selection),de=Z.selection;if(de.kind==="section"&&(te==null?void 0:te.kind)==="section"&&te.instance_id===de.instance_id||de.kind==="slot"&&(te==null?void 0:te.kind)==="slot"&&te.instance_id===de.instance_id&&te.slot_id===de.slot_id&&(te.item_index??void 0)===(de.item_index??void 0)){Y();return}J(Z.element,Z.selection.kind)}function Q(){Y()}return H.body.addEventListener("mouseover",L),H.body.addEventListener("mouseleave",Q),()=>{Y(),H.body.removeEventListener("mouseover",L),H.body.removeEventListener("mouseleave",Q)}},[f,k,n,e]),x.useEffect(()=>{const H=f;if(!H)return;const U=z=>{z.key==="Escape"&&k.getState().selection&&k.getState().select(null)};return H.addEventListener("keydown",U),()=>H.removeEventListener("keydown",U)},[f,k]),null}function wh(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 SW=/^([a-z0-9-]+)?\/?(?:#(.*))?$/;function EW(e,t,n,r){const i=r.endsWith("/")?r:`${r}/`;if(!n.startsWith(i))return null;const a=SW.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=z4(t,u.id);return f?{pageId:u.id,canvasId:f.id,anchor:a[2]?a[2]:null}:null}function jW({canvasId:e,isCurrent:t,guides:n=!1}){const r=x.useRef(null),[i,a]=x.useState(null),c=x.useCallback(D=>{r.current=D,a(D)},[]),[u,f]=x.useState([]),[p,g]=x.useState(1),m=hr(),w=je(D=>D.session.canvases.find(Z=>Z.id===e)),v=je(D=>D.session.pages),_=je(D=>D.selection),k=x.useMemo(()=>tp(_),[_]),S=je(D=>D.zoom),E=je(D=>D.session.format),O=x.useMemo(()=>yQ(E),[E]),A=x.useMemo(()=>MX(v,w),[v,w]),R=p*S,C=x.useRef(R);x.useEffect(()=>{C.current=R},[R]);const I=je(D=>D.session.template),$=je(D=>D.session.bases.build),T=je(D=>D.backend),F=x.useMemo(()=>T.canvasAssets(I,$),[T,I,$]),W=x.useCallback((D,Z,te)=>{var ce,me;const de=(ce=m.getState().session.sections.find(Se=>Se.instance_id===D))==null?void 0:ce.schema.slots,fe=de==null?void 0:de[Z];if(!fe||!Sl(fe,{slots:de}))return!1;const pe=(me=Ln(fe))==null?void 0:me.fields,P=te===void 0||pe==null?void 0:pe[te];return P?Sl(P,{slots:de,fields:pe}):!0},[m]),G=x.useMemo(()=>iX(vQ(F,W,O)),[F,W,O]),H=G.srcdoc(),U=x.useMemo(()=>O?{...O,direction:"row"}:void 0,[O]),z=U?G.srcdoc(U):H;x.useEffect(()=>{const D=r.current;if(!D)return;const Z=A.map(te=>({key:te.id,srcdoc:te.direction==="row"?z:H,label:te.label,title:`${te.label} canvas`,pageBox:te.direction==="row"?U:O,sandbox:"allow-same-origin allow-scripts"}));f(bX(D,Z))},[A,H,z,O,U]);const K=x.useMemo(()=>bQ(E),[E]);x.useEffect(()=>{for(const D of u)xX(D.overlay,n&&K>0?K:null)},[u,n,K]),x.useEffect(()=>{const D=r.current;if(!D)return;const Z=new ResizeObserver(te=>{var fe;const de=(fe=te[0])==null?void 0:fe.contentRect;de!=null&&de.width&&g(IQ(DQ(de.width),{availableWidthPx:de.width,availableHeightPx:de.height},O&&{width:O.width,height:O.height}))});return Z.observe(D),()=>Z.disconnect()},[O]),x.useEffect(()=>{var D;(D=r.current)==null||D.style.setProperty("--we-scale",String(R))},[R]);const N=x.useCallback((D,Z)=>{const te=D.getAttribute("href")??"";if(!te||te==="#")return;const de=r.current;if(te.startsWith("#")){wh(te.slice(1),Z,de,C.current);return}const fe=m.getState(),pe=EW(fe.session.pages,fe.session.canvases,te,fe.session.bases.content);if(!pe){window.open(te,"_blank","noopener,noreferrer");return}if(pe.canvasId===fe.currentCanvasId){const P=u.find(ce=>ce.key===pe.pageId);if(!P)return;pe.anchor?wh(pe.anchor,P,de,C.current):P!==Z&&wh("we-page",P,de,C.current);return}fe.setCurrentCanvas(pe.canvasId),pe.anchor&&fe.setPendingPageScroll({pageId:pe.pageId,anchor:pe.anchor})},[m,u]),B=x.useCallback(D=>{const Z=D.target,te=Z===r.current,de=u.some(fe=>fe.wrapper===Z);(te||de)&&m.getState().select(null)},[m,u]),Y=x.useCallback(D=>{const Z=r.current;if(!Z)return null;const te=P=>{const ce=vX(u,G,P)[0],me=ce==null?void 0:ce.els[0];return ce&&me?{wrapper:ce.handle.wrapper,el:me}:null},de=te(D),fe=D.kind==="slot"?te({kind:"section",instance_id:D.instance_id}):null;if(!de&&!fe)return null;const pe=requestAnimationFrame(()=>{const P=C.current,ce=Re=>{if(!Re)return null;const Pe=yd(Re.el);return Pe.width>0&&Pe.height>0?{wrapper:Re.wrapper,rect:Pe}:null},me=ce(de)??ce(fe);if(!me)return;const{wrapper:Se,rect:$e}=me,Ie=Se.offsetTop+$e.top*P-Z.scrollTop,xe=$e.height*P,Le={top:Ie,bottom:Ie+xe,height:xe},ne=_X(Le,Z.clientHeight,Z.scrollTop,kX);if(ne==null)return;const be=window.matchMedia("(prefers-reduced-motion: reduce)").matches;Z.scrollTo({top:ne,behavior:be?"auto":"smooth"})});return()=>cancelAnimationFrame(pe)},[G,u]),ie=x.useRef({backend:T,selection:void 0});x.useEffect(()=>{if(ie.current.backend!==T&&(ie.current={backend:T,selection:k}),!(!t||!k||k===ie.current.selection))return Y(k)??void 0},[k,t,Y,T]);const J=je(D=>D.revealSelection),L=je(D=>D.mountedFrameDocs),Q=je(D=>D.page_renders);return x.useEffect(()=>{if(!(!J||!t)){if(!k){m.getState().noteSelectionRevealed();return}Y(k)!==null&&m.getState().noteSelectionRevealed()}},[J,t,k,Y,L,Q,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:N4}),u.map(D=>h.jsx(_W,{frameHandle:D,pageId:D.key,frame:G,isCurrent:t,declaredHeight:O!==void 0,scale:R,stage:i,onFollowLink:N},D.key))]})}function OW({guides:e=!1}){const t=je(r=>r.visitedCanvasIds),n=je(r=>r.currentCanvasId);return h.jsx(h.Fragment,{children:t.map(r=>h.jsx(jW,{canvasId:r,isCurrent:r===n,guides:e},r))})}function Z4(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),CW(e,t,n,r)}function AW(){const e=hr();return x.useCallback((t,n)=>{Z4(e,t,n),e.getState().recordEdit({kind:"section-variant",instanceId:t})},[e])}async function CW(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}]);em(e,f),await Ax(e,t,c),e.getState().finishSave(!0),Jp(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 K4(e,t){var i,a;const n=e.schema.slots??{};if(Object.hasOwn(n,t))return n[t];const r=Mo(t);return r===null||(a=(i=n[r.object])==null?void 0:i.fields)==null?void 0:a[r.field]}function G4(e){return Object.entries(e.schema.slots??{}).flatMap(([t,n])=>MW(n)?Object.entries(n.fields??{}).map(([r,i])=>[gd(t,r),i]):[[t,n]])}function Y4(e){const t=new Map(e.sections.map(n=>[n.instance_id,n.section_key]));return e6(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 Q4(e){const t=new Map(e.sections.map(n=>[n.instance_id,n]));return{placement:Y4(e),slotAt:n=>{const r=t.get(n.instanceId),i=r===void 0?void 0:K4(r,n.slot);return r===void 0||i===void 0?void 0:{section:r.section_key,def:i}}}}const X4=e=>({layer:"section",instanceId:e.instanceId,slot:e.slotId});function tm(e,t){const n=r6(Q4(e),X4(t)),r=n===null?void 0:e.sections.find(a=>a.instance_id===n.root.instanceId),i=n===null||r===void 0?void 0:K4(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 NW(e,t){const n=Q4(e),r=new Map;for(const u of e.sections)for(const[f]of G4(u)){const p={instanceId:u.instance_id,slotId:f},g=n6(n,X4(p));if(g===null)continue;const m=Wf({instanceId:g.instanceId,slotId:g.slot});r.set(m,[...r.get(m)??[],p])}const i=[],a=new Set([Wf(t)]),c=[t];for(let u=c.shift();u!==void 0;u=c.shift())for(const f of r.get(Wf(u))??[]){const p=Wf(f);a.has(p)||(a.add(p),i.push(f),c.push(f))}return i}function MW(e){return e.type==="object"}function Wf(e){return`${e.instanceId} ${e.slotId}`}function RW(e,t,n){const r=TW(e.sections),i=Y4(e);return a=>{var w;const c=r(a),u=(c==null?void 0:c.slot.type)==="list"?Ln(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=(w=t.find(v=>v.instance_id===f.instanceId))==null?void 0:w.slots,g=p===void 0?void 0:Dt(p,a.slot),m=Dr(u,"");return v=>{const _=Array.isArray(g)?g.find(k=>k[pd]===v):void 0;return _===void 0?null:Ks(m,u,_)}}}function TW(e){return t=>{const n=e.find(i=>Oh(i.section_key)===t.section);if(n===void 0)return null;const r=xp(n.schema.slots??{},t.slot);return r===void 0?null:{slot:r,decision:Xw(n.fill_spec,t.slot)}}}function Nx(e){return t=>{var n;return(n=e.find(r=>Oh(r.section_key)===t))==null?void 0:n.schema.slots}}function Cu(e,t,n){return rQ(e.schema.slots??{},n,{fillSpec:e.fill_spec,sectionSlots:Nx(t)})}function $W(e,t,n,r,i){const a=Cu(e,t,i),c=xp(e.schema.slots??{},i);if(!(a===null||c===void 0))return wx(c,i,a,{facts:n,computed:e.computed},u=>Dt(r,u))}const zW=200;function W4(e,t,n,r){const i=J4(e,t,n);$v(e,t,n,r);for(const c of Mx(e,{instanceId:t,slotId:n}))$v(e,c.instanceId,c.slotId,r);const a=e.getState();a.awaitCuts(fQ(t,n,i,r,a.editMark())),e5(e,t,n)}function J4(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?Dt(r,n):void 0}const DW=new Set(["crop","ar","mobile","renditions","url"]);function LW(e,t){if(!zr(e)||!zr(t)||Dn(e)!==Dn(t))return!1;const n=r=>Object.fromEntries(Object.entries(r).filter(([i])=>!DW.has(i)));return js(n(e),n(t))}function Mx(e,t){const n=e.getState();return NW(n.session,t)}function $v(e,t,n,r){var u,f;const i=e.getState(),a=J4(e,t,n);if(i.setSlotValue(t,n,r),LW(a,r))return;const c=i.session.sections.find(p=>p.instance_id===t);if(c){const p=Mo(n),g=c.schema.slots,m=p?(f=(u=g[p.object])==null?void 0:u.fields)==null?void 0:f[p.field]:g[n],w=`[${co}="${eh(t)}"]`,v=p?`${w} [${qh}="${eh(p.object)}"] [${Yw}="${eh(p.field)}"]`:`${w} [${qh}="${eh(n)}"]`;if(m){const _=Gs(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 e5(e,t,n){const r=bd(e),i=Cx(t,n),a=r.timers.get(i);a&&clearTimeout(a.timer);const c=()=>void FW(e,t,n),u=setTimeout(()=>{r.timers.delete(i),c()},zW);r.timers.set(i,{timer:u,send:c})}function t5(){const e=hr();return x.useCallback((t,n,r)=>{var f;const i=e.getState(),a=tm(i.session,{instanceId:t,slotId:n});if(a===null){Yj(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=ax(c,n);u&&i.relinkSlot(t,n,{kind:"scalar"}),Yj(e,a.instanceId,a.slotId,r),u&&e5(e,t,n)},[e])}function Yj(e,t,n,r){var p,g;const i=e.getState(),a=i.session.sections.find(m=>m.instance_id===t),c=a!=null&&Cu(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?Dt(u,n):void 0;if(W4(e,t,n,r),c&&!Array.isArray(r)&&PW(f,r)){const m=e.getState(),w=((g=m.content_doc.instances.find(k=>k.instance_id===t))==null?void 0:g.slots)??{},v=$W(a,m.session.sections,m.session.facts,w,n);v!==void 0&&IW(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 IW(e,t){return zr(e)||zr(t)?!1:Jf(e)||Jf(t)?Jf(e)&&Jf(t)&&UW(e,t):String(e)===String(t)}function Jf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function UW(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>(e[r]??null)===(t[r]??null))}function PW(e,t){return zr(t)&&zr(e)?Dn(t)!==Dn(e):!0}async function FW(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=Dt(i.slots,n),u=ax(i.slot_overrides,n),f=Cu(a,r.session.sections,n)!==null,p={op:"set_slot",section_instance_id:t,slot_id:n,value:c,...u?{override:{kind:"scalar"}}:{}},g=HZ(i.slot_overrides,n),m=[];for(const[O,A]of Object.entries(g))for(const R 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:R}});const w=fT(i.slot_overrides,n),v=[];for(const O of Object.keys(w))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=PZ(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=dW(e,t,n),E=e.getState().editMark();try{const O=await e.getState().backend.write([p,...m,...v,..._?[_]:[],...k?[k]:[]]).finally(S);em(e,O);const A=new Set(Mx(e,{instanceId:t,slotId:n}).map(R=>R.instanceId));A.delete(t),await Promise.all([t,...A].map(R=>Ax(e,R))),e.getState().finishSave(!0),Jp(e,O,E),e.getState().ackAwaitedCuts(t,n,E)}catch(O){e.getState().dropAwaitedCuts(t,n,E),console.error("[editor] slot flush failed",{instanceId:t,slotId:n,err:O}),e.getState().finishSave(!1)}}function eh(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,t=>`\\${t}`)}function n5(){const e=hr(),t=je(c=>L4(c.history)),n=je(c=>I4(c.history)),r=x.useCallback(c=>{var g,m;const{target:u,doc:f}=c;if(u.canvasId&&e.getState().setCurrentCanvas(u.canvasId),u.kind==="page"){if(!u.pageId)return;const w=((m=(g=f.page_state)==null?void 0:g.find(v=>v.page_id===u.pageId))==null?void 0:m.enabled)??!0;H4(e,u.pageId,w);return}if(!u.instanceId)return;const p=f.instances.find(w=>w.instance_id===u.instanceId);p&&(u.kind==="slot"&&u.slotId?(W4(e,u.instanceId,u.slotId,Dt(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"?(Z4(e,u.instanceId,p.variant),e.getState().select({kind:"section-settings",instance_id:u.instanceId})):(q4(e,u.instanceId,p.enabled),e.getState().select({kind:"section",instance_id:u.instanceId})))},[e]),i=x.useCallback(()=>{const c=e.getState().undo();c&&r(c)},[e,r]),a=x.useCallback(()=>{const c=e.getState().redo();c&&r(c)},[e,r]);return{undo:i,redo:a,canUndo:t,canRedo:n}}function BW(){const e=je(p=>p.zoom),t=je(p=>p.setZoom),{undo:n,redo:r,canUndo:i,canRedo:a}=n5(),c=()=>t(Number((e-.1).toFixed(2))),u=()=>t(Number((e+.1).toFixed(2))),f=()=>t(1);return h.jsx("div",{className:le(c4,"left-4.5"),children:h.jsxs("div",{className:u4,children:[h.jsx("button",{type:"button",onClick:n,disabled:!i,title:"Undo","aria-label":"Undo",className:le(Jh,Qj),children:h.jsx(At,{name:"undo",size:qa,stroke:1.7})}),h.jsx("button",{type:"button",onClick:r,disabled:!a,title:"Redo","aria-label":"Redo",className:le(Jh,Qj),children:h.jsx(At,{name:"redo",size:qa,stroke:1.7})}),h.jsx("div",{className:"mx-1 w-px self-stretch my-0.5 bg-line"}),h.jsx(Xj,{onClick:c,label:"Zoom out",children:h.jsx(UN,{size:qa,className:ep})}),h.jsxs("button",{type:"button",onClick:f,title:"Fit to canvas",className:le(d4,"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(Xj,{onClick:u,label:"Zoom in",children:h.jsx(nd,{size:qa,className:ep})})]})})}const Qj="disabled:cursor-not-allowed disabled:text-ink-4 disabled:hover:bg-transparent";function Xj({onClick:e,label:t,children:n}){return h.jsx("button",{type:"button",onClick:e,"aria-label":t,title:t,className:Jh,children:n})}function uu(...e){return Np(Cp(e))}const HW="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)]",qW="flex flex-1 min-w-0 items-start gap-[12px] transition-opacity ease-settle motion-reduce:transition-none",VW="delay-[60ms] duration-[320ms]",ZW="opacity-0 duration-[120ms]",KW="w-[28px] h-[28px] rounded-[8px] grid place-items-center flex-shrink-0",GW="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",YW="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",QW={danger:"bg-[#fdeeeb] border-danger",good:"bg-good-soft border-good/40",neutral:"bg-canvas border-line"},XW={danger:"bg-danger text-white",good:"bg-good text-white",neutral:"bg-line-soft text-ink-3"},WW={danger:h.jsx(ow,{size:15}),good:h.jsx(Si,{size:15,strokeWidth:2.5}),neutral:h.jsx(e9,{size:15})},JW="cursor-pointer font-semibold text-ink underline underline-offset-2 hover:text-danger",r5=x.createContext(!1);function eJ({onClick:e,children:t}){return x.use(r5)?t:h.jsx("button",{type:"button",onClick:e,className:JW,children:t})}function tJ({tone:e,icon:t,headline:n,action:r,onDismiss:i,edge:a=!1,className:c,...u}){return h.jsx("div",{className:uu(HW,QW[e],c),...u,children:h.jsxs("div",{className:uu(qW,a?ZW:VW),children:[h.jsx("span",{className:uu(KW,XW[e]),"aria-hidden":"true",children:t??WW[e]}),h.jsx("strong",{className:"flex-1 min-w-0 pt-[4px] text-[14px] leading-[1.45] font-semibold text-ink",children:h.jsx(r5,{value:a,children:n})}),r?h.jsx("button",{className:GW,type:"button",inert:a,onClick:r.onClick,disabled:r.disabled,children:r.label}):null,h.jsx("button",{className:YW,type:"button",inert:a,"aria-label":"Dismiss",onClick:i,children:h.jsx(Dp,{size:15})})]})})}const ip="dismissed",Rx=new Map,Nu=new Map,zv=new Set;function du(e,t){return`hp-notice-dismissed:${e}:${t}`}function o5(e){const t=Rx.get(e);if(t!==void 0)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function ob(e,t){Rx.set(e,t);try{window.sessionStorage.setItem(e,t)}catch{}}function nJ(e){Rx.delete(e);try{window.sessionStorage.removeItem(e)}catch{}}function i5(){for(const e of zv)e()}function rJ(e){return zv.add(e),()=>zv.delete(e)}function oJ(e,{id:t,hold:n}){var i;const r=(a,c)=>o5(du(e,a))===c;switch(n.kind){case"page":return((i=Nu.get(e))==null?void 0:i.has(t))??!1;case"condition":return r(t,n.says);case"session":return r(t,ip);case"each":return n.ids.every(a=>r(a,ip))}}function iJ(e,{id:t,hold:n}){switch(n.kind){case"page":Nu.set(e,new Set(Nu.get(e)).add(t));break;case"condition":ob(du(e,t),n.says);break;case"session":ob(du(e,t),ip);break;case"each":for(const r of n.ids)ob(du(e,r),ip);break}i5()}function sJ(e,t){let n=!1;const r=Nu.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=du(e,i),u=o5(c);u===null||u===a.says||(nJ(c),n=!0)}n&&i5()}function aJ(e,t){const n=x.useSyncExternalStore(rJ,()=>JSON.stringify(t.filter(r=>oJ(e,r)).map(r=>r.id)),()=>"[]");return x.useEffect(()=>sJ(e,t)),x.useEffect(()=>()=>void Nu.delete(e),[e]),new Set(JSON.parse(n))}const lJ=420,cJ=160,uJ="(prefers-reduced-motion: reduce)",Wj={height:0,marginTop:"0px",marginBottom:"0px"};function Jj({height:e,marginTop:t,marginBottom:n}){return{height:`${e}px`,marginTop:t,marginBottom:n}}function Dv(e){return[...e.querySelectorAll(":scope > [data-notice-layer]")]}function s5(e){const{marginTop:t,marginBottom:n}=getComputedStyle(e);return{height:e.getBoundingClientRect().height,marginTop:t,marginBottom:n}}function dJ(e){const t=new Map;for(const n of Dv(e)){const{width:r,height:i}=n.getBoundingClientRect();t.set(n.dataset.noticeLayer??"",{width:r,height:i})}return{stack:s5(e),layers:t}}function fJ(e){return e!==null&&typeof e.animate=="function"&&!window.matchMedia(uJ).matches}function hJ(e,t,n){for(const u of[e,...Dv(e)])for(const f of u.getAnimations())f.cancel();const r=getComputedStyle(e).getPropertyValue("--ease-settle").trim()||"ease-out",i={duration:lJ,easing:r},a=n?Wj:s5(e),c=[e.animate([Jj((t==null?void 0:t.stack)??Wj),Jj(a)],{...i,fill:n?"forwards":"none"})];for(const u of Dv(e)){if(u.dataset.noticeLeaving!==void 0){c.push(u.animate([{opacity:1},{opacity:0}],{duration:cJ,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 pJ(e){const t=x.useRef(null),n=x.useRef([]),r=x.useRef(0),i=JSON.stringify(e.map(p=>p.id)),[a,c]=x.useState({order:i,first:null,moved:!1,emptied:!1}),[u,f]=x.useState([]);if(a.order!==i){const p=t.current===null?null:dJ(t.current);c({order:i,first:p,moved:!0,emptied:e.length===0});const g=({notice:m})=>e.some(({id:w})=>w===m.id);f(m=>{const w=n.current.filter(_=>!g(_));return[...m.filter(_=>!g(_)&&!w.some(({notice:k})=>k.id===_.notice.id)),...w]})}return x.useLayoutEffect(()=>{n.current=e.map((p,g)=>({notice:p,depth:g}))}),x.useLayoutEffect(()=>{if(!a.moved)return;r.current+=1;const p=r.current,g=t.current;if(!fJ(g)){f([]);return}const m=hJ(g,a.first,a.emptied);Promise.allSettled(m.map(w=>w.finished)).then(()=>{p===r.current&&f([])})},[a]),{stackRef:t,leaving:u}}const eO=["result","fault","required","status"];function mJ(e,t){return{id:"load-failed",rank:"fault",hold:{kind:"page"},tone:"danger",role:"alert",headline:e,action:t}}function gJ(e,t){return{id:e,rank:"result",hold:{kind:"page"},tone:"danger",role:"alert",headline:t}}const a5=3,yJ=8,tO="pointer-events-none absolute top-0",bJ='[data-notice-layer]:not([inert]) button[aria-label="Dismiss"]:not([inert])';function xh(e){return`calc(${e*yJ} * var(--content))`}function vJ(e){return[...e].sort((t,n)=>eO.indexOf(t.rank)-eO.indexOf(n.rank))}function wJ({depth:e,leaving:t},n,r){if(e===0&&!t)return{className:"relative",style:{zIndex:r}};if(e===0)return{className:uu(tO,"inset-x-0"),style:{zIndex:r+1}};const i=Math.min(e,a5);return{className:tO,style:{left:xh(i),right:xh(i),bottom:xh(n-i),zIndex:t?0:r-e}}}function Ls({surface:e,notices:t,className:n}){var w;const r=aJ(e,t),i=vJ(t.filter(v=>!r.has(v.id))),{stackRef:a,leaving:c}=pJ(i),u=x.useRef(!1),f=(w=i[0])==null?void 0:w.id;if(x.useLayoutEffect(()=>{var v,_;u.current&&(u.current=!1,(_=(v=a.current)==null?void 0:v.querySelector(bJ))==null||_.focus())},[f,a]),i.length===0&&c.length===0)return null;const p=Math.max(0,Math.min(i.length-1,a5)),g=v=>{var _,k;u.current=((_=a.current)==null?void 0:_.contains(document.activeElement))??!1,iJ(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:uu("relative isolate",n),style:{paddingBottom:xh(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,...wJ(v,p,i.length),children:h.jsx(tJ,{tone:_.tone,icon:_.icon,headline:_.headline,action:_.action,role:_.role,onDismiss:()=>g(_),edge:k>0,className:"h-full overflow-hidden"})},_.id)})})}const nO="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…"},kJ={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…"},rO={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))]"},oO={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 _J({phase:e,disabledReason:t,onClick:n,variant:r}){const i=h.jsx(RN,{size:oO[r].px,className:oO[r].className});if(t!==null)return h.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:t,"aria-label":`Download: ${t}`,className:`${nO} ${rO[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=kJ[e]??"Download";return h.jsxs("button",{type:"button",onClick:n,disabled:a,"aria-disabled":a,title:u,"aria-live":a?"polite":void 0,className:`${nO} ${rO[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 SJ=900;function EJ(e,t){return e==="publishing"&&t==="published"}function jJ({state:e,isPending:t,hasOutstandingChanges:n,onClick:r}){const i=x.useRef(null),[a,c]=x.useState(!1);x.useEffect(()=>{const m=i.current;if(EJ(m,e)){c(!0);const w=setTimeout(()=>c(!1),SJ);return i.current=e,()=>clearTimeout(w)}i.current=e},[e]);const u=e==="publishing"||t,f=e==="published"&&!n&&!a,p=u?"Publishing…":"Publish",g=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(Si,{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(Si,{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:g,"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 iO;function ye(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,g=Object.keys(p);for(let m=0;m<g.length;m++){const w=g[m];w in u||(u[w]=p[w].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 g of p._zod.deferred)g();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 Ga extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class l5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(iO=globalThis).__zod_globalConfig??(iO.__zod_globalConfig={});const Tx=globalThis.__zod_globalConfig;function Is(e){return Tx}function c5(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 Lv(e,t){return typeof t=="bigint"?t.toString():t}function $x(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function zx(e){return e==null}function Dx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function OJ(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 sO=Symbol("evaluating");function vt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==sO)return r===void 0&&(r=sO,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Ys(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Li(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function aO(e){return JSON.stringify(e)}function AJ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const u5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const CJ=$x(()=>{var e;if(Tx.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 Mu(e){if(sp(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(sp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function d5(e){return Mu(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const NJ=new Set(["string","number","symbol"]);function jl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ii(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 De(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 MJ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const RJ={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 TJ(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=Li(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 Ys(this,"shape",c),c},checks:[]});return Ii(e,a)}function $J(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=Li(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 Ys(this,"shape",c),c},checks:[]});return Ii(e,a)}function zJ(e,t){if(!Mu(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=Li(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ys(this,"shape",a),a}});return Ii(e,i)}function DJ(e,t){if(!Mu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Li(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Ys(this,"shape",r),r}});return Ii(e,n)}function LJ(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=Li(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Ys(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ii(e,n)}function IJ(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=Li(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 Ys(this,"shape",f),f},checks:[]});return Ii(t,c)}function UJ(e,t,n){const r=Li(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 Ys(this,"shape",a),a}});return Ii(t,r)}function Va(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 PJ(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 f5(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function th(e){return typeof e=="string"?e:e==null?void 0:e.message}function Us(e,t,n){var f,p,g,m,w,v;const r=e.message?e.message:th((g=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:g.call(p,e))??th((m=t==null?void 0:t.error)==null?void 0:m.call(t,e))??th((w=n.customError)==null?void 0:w.call(n,e))??th((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 Lx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ru(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const h5=(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,Lv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},p5=ye("$ZodError",h5),m5=ye("$ZodError",h5,{Parent:Error});function FJ(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 BJ(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 g=u[p];p===u.length-1?(f[g]=f[g]||{_errors:[]},f[g]._errors.push(t(c))):f[g]=f[g]||{_errors:[]},f=f[g],p++}}}};return r(e),n}const Ix=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 Ga;if(c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(f=>Us(f,a,Is())));throw u5(u,i==null?void 0:i.callee),u}return c.value},Ux=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=>Us(f,a,Is())));throw u5(u,i==null?void 0:i.callee),u}return c.value},nm=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 Ga;return a.issues.length?{success:!1,error:new(e??p5)(a.issues.map(c=>Us(c,i,Is())))}:{success:!0,data:a.value}},HJ=nm(m5),rm=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=>Us(c,i,Is())))}:{success:!0,data:a.value}},qJ=rm(m5),VJ=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Ix(e)(t,n,i)},ZJ=e=>(t,n,r)=>Ix(e)(t,n,r),KJ=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Ux(e)(t,n,i)},GJ=e=>async(t,n,r)=>Ux(e)(t,n,r),YJ=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return nm(e)(t,n,i)},QJ=e=>(t,n,r)=>nm(e)(t,n,r),XJ=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return rm(e)(t,n,i)},WJ=e=>async(t,n,r)=>rm(e)(t,n,r),JJ=/^[cC][0-9a-z]{6,}$/,eee=/^[0-9a-z]+$/,tee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nee=/^[0-9a-vA-V]{20}$/,ree=/^[A-Za-z0-9]{27}$/,oee=/^[a-zA-Z0-9_-]{21}$/,iee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,see=/^([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})$/,lO=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)$/,aee=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lee="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cee(){return new RegExp(lee,"u")}const uee=/^(?:(?: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])$/,dee=/^(([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}|:))$/,fee=/^((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])$/,hee=/^(([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])$/,pee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,g5=/^[A-Za-z0-9_-]*$/,mee=/^https?$/,gee=/^\+[1-9]\d{6,14}$/,y5="(?:(?:\\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])))",yee=new RegExp(`^${y5}$`);function b5(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 bee(e){return new RegExp(`^${b5(e)}$`)}function vee(e){const t=b5({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(`^${y5}T(?:${r})$`)}const wee=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+$/,kee=/^-?\d+(?:\.\d+)?$/,_ee=/^(?:true|false)$/i,See=/^[^A-Z]*$/,Eee=/^[^a-z]*$/,Un=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),v5={number:"number",bigint:"bigint",object:"date"},w5=ye("$ZodCheckLessThan",(e,t)=>{Un.init(e,t);const n=v5[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=ye("$ZodCheckGreaterThan",(e,t)=>{Un.init(e,t);const n=v5[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})}}),jee=ye("$ZodCheckMultipleOf",(e,t)=>{Un.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):OJ(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})}}),Oee=ye("$ZodCheckNumberFormat",(e,t)=>{var c;Un.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]=RJ[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})}}),Aee=ye("$ZodCheckMaxLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!zx(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=Lx(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Cee=ye("$ZodCheckMinLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!zx(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=Lx(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Nee=ye("$ZodCheckLengthEquals",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!zx(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=Lx(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})}}),om=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;Un.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=()=>{})}),Mee=ye("$ZodCheckRegex",(e,t)=>{om.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})}}),Ree=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=See),om.init(e,t)}),Tee=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Eee),om.init(e,t)}),$ee=ye("$ZodCheckIncludes",(e,t)=>{Un.init(e,t);const n=jl(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})}}),zee=ye("$ZodCheckStartsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`^${jl(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})}}),Dee=ye("$ZodCheckEndsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`.*${jl(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})}}),Lee=ye("$ZodCheckOverwrite",(e,t)=>{Un.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Iee{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 Uee={major:4,minor:4,patch:3},Lt=ye("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Uee;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 g=Va(u),m;for(const w of f){if(w._zod.def.when){if(PJ(u)||!w._zod.def.when(u))continue}else if(g)continue;const v=u.issues.length,_=w._zod.check(u);if(_ instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Ga;if(m||_ instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await _,u.issues.length!==v&&(g||(g=Va(u,v)))});else{if(u.issues.length===v)continue;g||(g=Va(u,v))}}return m?m.then(()=>u):u},c=(u,f,p)=>{if(Va(u))return u.aborted=!0,u;const g=a(f,r,p);if(g instanceof Promise){if(p.async===!1)throw new Ga;return g.then(m=>e._zod.parse(m,p))}return e._zod.parse(g,p)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const g=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return g instanceof Promise?g.then(m=>c(m,u,f)):c(g,u,f)}const p=e._zod.parse(u,f);if(p instanceof Promise){if(f.async===!1)throw new Ga;return p.then(g=>a(g,r,f))}return a(p,r,f)}}vt(e,"~standard",()=>({validate:a=>{var c;try{const u=HJ(e,a);return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}}catch{return qJ(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}))}),Px=ye("$ZodString",(e,t)=>{var n;Lt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??wee(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}}),Ot=ye("$ZodStringFormat",(e,t)=>{om.init(e,t),Px.init(e,t)}),Pee=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=see),Ot.init(e,t)}),Fee=ye("$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=lO(r))}else t.pattern??(t.pattern=lO());Ot.init(e,t)}),Bee=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=aee),Ot.init(e,t)}),Hee=ye("$ZodURL",(e,t)=>{Ot.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)===mee.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})}}}),qee=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cee()),Ot.init(e,t)}),Vee=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=oee),Ot.init(e,t)}),Zee=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=JJ),Ot.init(e,t)}),Kee=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eee),Ot.init(e,t)}),Gee=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tee),Ot.init(e,t)}),Yee=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nee),Ot.init(e,t)}),Qee=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ree),Ot.init(e,t)}),Xee=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=vee(t)),Ot.init(e,t)}),Wee=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yee),Ot.init(e,t)}),Jee=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bee(t)),Ot.init(e,t)}),ete=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=iee),Ot.init(e,t)}),tte=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uee),Ot.init(e,t),e._zod.bag.format="ipv4"}),nte=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dee),Ot.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})}}}),rte=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fee),Ot.init(e,t)}),ote=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=hee),Ot.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 k5(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ite=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=pee),Ot.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{k5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ste(e){if(!g5.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return k5(n)}const ate=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=g5),Ot.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ste(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),lte=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gee),Ot.init(e,t)});function cte(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 ute=ye("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{cte(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),_5=ye("$ZodNumber",(e,t)=>{Lt.init(e,t),e._zod.pattern=e._zod.bag.pattern??kee,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}}),dte=ye("$ZodNumberFormat",(e,t)=>{Oee.init(e,t),_5.init(e,t)}),fte=ye("$ZodBoolean",(e,t)=>{Lt.init(e,t),e._zod.pattern=_ee,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}}),hte=ye("$ZodUnknown",(e,t)=>{Lt.init(e,t),e._zod.parse=n=>n}),pte=ye("$ZodNever",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function cO(e,t,n){e.issues.length&&t.issues.push(...f5(n,e.issues)),t.value[n]=e.value}const mte=ye("$ZodArray",(e,t)=>{Lt.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=>cO(p,n,c))):cO(f,n,c)}return a.length?Promise.all(a).then(()=>n):n}});function ap(e,t,n,r,i,a){const c=n in r;if(e.issues.length){if(i&&a&&!c)return;t.issues.push(...f5(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 S5(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=MJ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function E5(e,t,n,r,i,a){const c=[],u=i.keySet,f=i.catchall._zod,p=f.def.type,g=f.optin==="optional",m=f.optout==="optional";for(const w in t){if(w==="__proto__"||u.has(w))continue;if(p==="never"){c.push(w);continue}const v=f.run({value:t[w],issues:[]},r);v instanceof Promise?e.push(v.then(_=>ap(_,n,w,t,g,m))):ap(v,n,w,t,g,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 gte=ye("$ZodObject",(e,t)=>{Lt.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=$x(()=>S5(t));vt(e._zod,"propValues",()=>{const u=t.shape,f={};for(const p in u){const g=u[p]._zod;if(g.values){f[p]??(f[p]=new Set);for(const m of g.values)f[p].add(m)}}return f});const i=sp,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 g=[],m=c.shape;for(const w of c.keys){const v=m[w],_=v._zod.optin==="optional",k=v._zod.optout==="optional",S=v._zod.run({value:p[w],issues:[]},f);S instanceof Promise?g.push(S.then(E=>ap(E,u,w,p,_,k))):ap(S,u,w,p,_,k)}return a?E5(g,p,u,f,r.value,e):g.length?Promise.all(g).then(()=>u):u}}),yte=ye("$ZodObjectJIT",(e,t)=>{gte.init(e,t);const n=e._zod.parse,r=$x(()=>S5(t)),i=w=>{var A,R;const v=new Iee(["shape","payload","ctx"]),_=r.value,k=C=>{const I=aO(C);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};v.write("const input = payload.value;");const S=Object.create(null);let E=0;for(const C of _.keys)S[C]=`key_${E++}`;v.write("const newResult = {};");for(const C of _.keys){const I=S[C],$=aO(C),T=w[C],F=((A=T==null?void 0:T._zod)==null?void 0:A.optin)==="optional",W=((R=T==null?void 0:T._zod)==null?void 0:R.optout)==="optional";v.write(`const ${I} = ${k(C)};`),F&&W?v.write(`
|
|
1271
|
+
if (${I}.issues.length) {
|
|
1272
|
+
if (${$} in input) {
|
|
1273
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
1274
|
+
...iss,
|
|
1275
|
+
path: iss.path ? [${$}, ...iss.path] : [${$}]
|
|
1276
|
+
})));
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
if (${I}.value === undefined) {
|
|
1281
|
+
if (${$} in input) {
|
|
1282
|
+
newResult[${$}] = undefined;
|
|
1283
|
+
}
|
|
1284
|
+
} else {
|
|
1285
|
+
newResult[${$}] = ${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 ? [${$}, ...iss.path] : [${$}]
|
|
1293
|
+
})));
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
if (${I}.value === undefined) {
|
|
1297
|
+
if (${$} in input) {
|
|
1298
|
+
newResult[${$}] = undefined;
|
|
1299
|
+
}
|
|
1300
|
+
} else {
|
|
1301
|
+
newResult[${$}] = ${I}.value;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
`):v.write(`
|
|
1305
|
+
const ${I}_present = ${$} in input;
|
|
1306
|
+
if (${I}.issues.length) {
|
|
1307
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
1308
|
+
...iss,
|
|
1309
|
+
path: iss.path ? [${$}, ...iss.path] : [${$}]
|
|
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: [${$}]
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
if (${I}_present) {
|
|
1322
|
+
if (${I}.value === undefined) {
|
|
1323
|
+
newResult[${$}] = undefined;
|
|
1324
|
+
} else {
|
|
1325
|
+
newResult[${$}] = ${I}.value;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(C,I)=>O(w,C,I)};let a;const c=sp,u=!Tx.jitless,p=u&&CJ.value,g=t.catchall;let m;e._zod.parse=(w,v)=>{m??(m=r.value);const _=w.value;return c(_)?u&&p&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(a||(a=i(t.shape)),w=a(w,v),g?E5([],_,w,v,m,e):w):n(w,v):(w.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),w)}});function uO(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=>!Va(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=>Us(c,r,Is())))}),t)}const bte=ye("$ZodUnion",(e,t)=>{Lt.init(e,t),vt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),vt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),vt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),vt(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=>Dx(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=>uO(u,r,e,i)):uO(c,r,e,i)}}),vte=ye("$ZodIntersection",(e,t)=>{Lt.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])=>dO(n,f,p)):dO(n,a,c)}});function Iv(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(Mu(e)&&Mu(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=Iv(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=Iv(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 dO(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}),Va(e))return e;const c=Iv(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 wte=ye("$ZodEnum",(e,t)=>{Lt.init(e,t);const n=c5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>NJ.has(typeof i)).map(i=>typeof i=="string"?jl(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=ye("$ZodLiteral",(e,t)=>{if(Lt.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"?jl(r):r?jl(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}}),kte=ye("$ZodTransform",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new l5(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 Ga;return n.value=i,n.fallback=!0,n}});function fO(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const j5=ye("$ZodOptional",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Dx(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=>fO(c,i)):fO(a,i)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),_te=ye("$ZodExactOptional",(e,t)=>{j5.init(e,t),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Ste=ye("$ZodNullable",(e,t)=>{Lt.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Dx(n.source)}|null)$`):void 0}),vt(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)}),Ete=ye("$ZodDefault",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",vt(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=>hO(a,t)):hO(i,t)}});function hO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const jte=ye("$ZodPrefault",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",vt(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))}),Ote=ye("$ZodNonOptional",(e,t)=>{Lt.init(e,t),vt(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=>pO(a,e)):pO(i,e)}});function pO(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 Ate=ye("$ZodCatch",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(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=>Us(c,r,Is()))},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=>Us(a,r,Is()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Cte=ye("$ZodPipe",(e,t)=>{Lt.init(e,t),vt(e._zod,"values",()=>t.in._zod.values),vt(e._zod,"optin",()=>t.in._zod.optin),vt(e._zod,"optout",()=>t.out._zod.optout),vt(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=>nh(c,t.in,r)):nh(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>nh(a,t.out,r)):nh(i,t.out,r)}});function nh(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 Nte=ye("$ZodReadonly",(e,t)=>{Lt.init(e,t),vt(e._zod,"propValues",()=>t.innerType._zod.propValues),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),vt(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(mO):mO(i)}});function mO(e){return e.value=Object.freeze(e.value),e}const Mte=ye("$ZodCustom",(e,t)=>{Un.init(e,t),Lt.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=>gO(a,n,r,e));gO(i,n,r,e)}});function gO(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(Ru(i))}}var yO;class Rte{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 Tte(){return new Rte}(yO=globalThis).__zod_globalRegistry??(yO.__zod_globalRegistry=Tte());const nu=globalThis.__zod_globalRegistry;function $te(e,t){return new e({type:"string",...De(t)})}function zte(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function bO(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function Dte(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function Lte(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function Ite(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function Ute(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function Pte(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function Fte(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function Bte(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function Hte(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function qte(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function Vte(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function Zte(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function Kte(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function Gte(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function Yte(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function Qte(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function Xte(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function Wte(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function Jte(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function ene(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function tne(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function nne(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function rne(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function one(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function ine(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function sne(e,t){return new e({type:"number",checks:[],...De(t)})}function ane(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function lne(e,t){return new e({type:"boolean",...De(t)})}function cne(e){return new e({type:"unknown"})}function une(e,t){return new e({type:"never",...De(t)})}function vO(e,t){return new w5({check:"less_than",...De(t),value:e,inclusive:!1})}function ib(e,t){return new w5({check:"less_than",...De(t),value:e,inclusive:!0})}function wO(e,t){return new x5({check:"greater_than",...De(t),value:e,inclusive:!1})}function sb(e,t){return new x5({check:"greater_than",...De(t),value:e,inclusive:!0})}function xO(e,t){return new jee({check:"multiple_of",...De(t),value:e})}function O5(e,t){return new Aee({check:"max_length",...De(t),maximum:e})}function lp(e,t){return new Cee({check:"min_length",...De(t),minimum:e})}function A5(e,t){return new Nee({check:"length_equals",...De(t),length:e})}function dne(e,t){return new Mee({check:"string_format",format:"regex",...De(t),pattern:e})}function fne(e){return new Ree({check:"string_format",format:"lowercase",...De(e)})}function hne(e){return new Tee({check:"string_format",format:"uppercase",...De(e)})}function pne(e,t){return new $ee({check:"string_format",format:"includes",...De(t),includes:e})}function mne(e,t){return new zee({check:"string_format",format:"starts_with",...De(t),prefix:e})}function gne(e,t){return new Dee({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Vl(e){return new Lee({check:"overwrite",tx:e})}function yne(e){return Vl(t=>t.normalize(e))}function bne(){return Vl(e=>e.trim())}function vne(){return Vl(e=>e.toLowerCase())}function wne(){return Vl(e=>e.toUpperCase())}function xne(){return Vl(e=>AJ(e))}function kne(e,t,n){return new e({type:"array",element:t,...De(n)})}function _ne(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function Sne(e,t){const n=Ene(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Ru(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(Ru(a))}},e(r.value,r)),t);return n}function Ene(e,t){const n=new Un({check:"custom",...De(t)});return n._zod.check=e,n}function C5(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)??nu,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 fn(e,t,n={path:[],schemaPath:[]}){var g,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=(g=e._zod).toJSONSchema)==null?void 0:m.call(g);if(u)c.schema=u;else{const w={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,w);else{const _=c.schema,k=t.processors[i.type];if(!k)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);k(e,t,_,w)}const v=e._zod.parent;v&&(c.ref||(c.ref=v),fn(v,t,w),t.seen.get(v).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(c.schema,f),t.io==="input"&&vn(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 N5(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 g of e.seen.entries()){const m=(c=e.metadataRegistry.get(g[0]))==null?void 0:c.id;if(m){const w=r.get(m);if(w&&w!==g[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,g[0])}}const i=g=>{var k;const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=(k=e.external.registry.get(g[0]))==null?void 0:k.id,E=e.external.uri??(A=>A);if(S)return{ref:E(S)};const O=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=O,{defId:O,ref:`${E("__shared")}#/${m}/${O}`}}if(g[1]===n)return{ref:"#"};const v=`#/${m}/`,_=g[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:v+_}},a=g=>{if(g[1].schema.$ref)return;const m=g[1],{ref:w,defId:v}=i(g);m.def={...m.schema},v&&(m.defId=v);const _=m.schema;for(const k in _)delete _[k];_.$ref=w};if(e.cycles==="throw")for(const g of e.seen.entries()){const m=g[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 g of e.seen.entries()){const m=g[1];if(t===g[0]){a(g);continue}if(e.external){const v=(f=e.external.registry.get(g[0]))==null?void 0:f.id;if(t!==g[0]&&v){a(g);continue}}if((p=e.metadataRegistry.get(g[0]))==null?void 0:p.id){a(g);continue}if(m.cycle){a(g);continue}if(m.count>1&&e.reused==="ref"){a(g);continue}}}function M5(e,t){var u,f,p,g;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=m=>{const w=e.seen.get(m);if(w.ref===null)return;const v=w.def??w.schema,_={...v},k=w.ref;if(w.ref=null,k){r(k);const E=e.seen.get(k),O=E.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 R in v)R==="$ref"||R==="allOf"||R in _||delete v[R];if(O.$ref&&E.def)for(const R in v)R==="$ref"||R==="allOf"||R in E.def&&JSON.stringify(v[R])===JSON.stringify(E.def[R])&&delete v[R]}const S=m._zod.parent;if(S&&S!==k){r(S);const E=e.seen.get(S);if(E!=null&&E.schema.$ref&&(v.$ref=E.schema.$ref,E.def))for(const O in v)O==="$ref"||O==="allOf"||O in E.def&&JSON.stringify(v[O])===JSON.stringify(E.def[O])&&delete v[O]}e.override({zodSchema:m,jsonSchema:v,path:w.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=((g=e.external)==null?void 0:g.defs)??{};for(const m of e.seen.entries()){const w=m[1];w.def&&w.defId&&(w.def.id===w.defId&&delete w.def.id,c[w.defId]=w.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:cp(t,"input",e.processors),output:cp(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function vn(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 vn(r.element,n);if(r.type==="set")return vn(r.valueType,n);if(r.type==="lazy")return vn(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 vn(r.innerType,n);if(r.type==="intersection")return vn(r.left,n)||vn(r.right,n);if(r.type==="record"||r.type==="map")return vn(r.keyType,n)||vn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:vn(r.in,n)||vn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(vn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(vn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(vn(i,n))return!0;return!!(r.rest&&vn(r.rest,n))}return!1}const jne=(e,t={})=>n=>{const r=C5({...n,processors:t});return fn(e,r),N5(r,e),M5(r,e)},cp=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},c=C5({...i??{},target:a,io:t,processors:n});return fn(e,c),N5(c,e),M5(c,e)},One={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ane=(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=One[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),p&&(i.contentEncoding=p),f&&f.size>0){const g=[...f];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Cne=(e,t,n,r)=>{const i=n,{minimum:a,maximum:c,format:u,multipleOf:f,exclusiveMaximum:p,exclusiveMinimum:g}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number";const m=typeof g=="number"&&g>=(a??Number.NEGATIVE_INFINITY),w=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";m?v?(i.minimum=g,i.exclusiveMinimum=!0):i.exclusiveMinimum=g:typeof a=="number"&&(i.minimum=a),w?v?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p:typeof c=="number"&&(i.maximum=c),typeof f=="number"&&(i.multipleOf=f)},Nne=(e,t,n,r)=>{n.type="boolean"},Mne=(e,t,n,r)=>{n.not={}},Rne=(e,t,n,r)=>{},Tne=(e,t,n,r)=>{const i=e._zod.def,a=c5(i.entries);a.every(c=>typeof c=="number")&&(n.type="number"),a.every(c=>typeof c=="string")&&(n.type="string"),n.enum=a},$ne=(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},zne=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Dne=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Lne=(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=fn(a.element,t,{...r,path:[...r.path,"items"]})},Ine=(e,t,n,r)=>{var p;const i=n,a=e._zod.def;i.type="object",i.properties={};const c=a.shape;for(const g in c)i.properties[g]=fn(c[g],t,{...r,path:[...r.path,"properties",g]});const u=new Set(Object.keys(c)),f=new Set([...u].filter(g=>{const m=a.shape[g]._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=fn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Une=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,c=i.options.map((u,f)=>fn(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",f]}));a?n.oneOf=c:n.anyOf=c},Pne=(e,t,n,r)=>{const i=e._zod.def,a=fn(i.left,t,{...r,path:[...r.path,"allOf",0]}),c=fn(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},Fne=(e,t,n,r)=>{const i=e._zod.def,a=fn(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"}]},Bne=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},Hne=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},qne=(e,t,n,r)=>{const i=e._zod.def;fn(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)))},Vne=(e,t,n,r)=>{const i=e._zod.def;fn(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},Zne=(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;fn(c,t,r);const u=t.seen.get(e);u.ref=c},Kne=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},R5=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},Gne=ye("ZodISODateTime",(e,t)=>{Xee.init(e,t),Ct.init(e,t)});function Yne(e){return nne(Gne,e)}const Qne=ye("ZodISODate",(e,t)=>{Wee.init(e,t),Ct.init(e,t)});function Xne(e){return rne(Qne,e)}const Wne=ye("ZodISOTime",(e,t)=>{Jee.init(e,t),Ct.init(e,t)});function Jne(e){return one(Wne,e)}const ere=ye("ZodISODuration",(e,t)=>{ete.init(e,t),Ct.init(e,t)});function tre(e){return ine(ere,e)}const nre=(e,t)=>{p5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>BJ(e,n)},flatten:{value:n=>FJ(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Lv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Lv,2)}},isEmpty:{get(){return e.issues.length===0}}})},pr=ye("ZodError",nre,{Parent:Error}),rre=Ix(pr),ore=Ux(pr),ire=nm(pr),sre=rm(pr),are=VJ(pr),lre=ZJ(pr),cre=KJ(pr),ure=GJ(pr),dre=YJ(pr),fre=QJ(pr),hre=XJ(pr),pre=WJ(pr),kO=new WeakMap;function vd(e,t,n){const r=Object.getPrototypeOf(e);let i=kO.get(r);if(i||(i=new Set,kO.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 It=ye("ZodType",(e,t)=>(Lt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:cp(e,"input"),output:cp(e,"output")}}),e.toJSONSchema=jne(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>rre(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>ire(e,n,r),e.parseAsync=async(n,r)=>ore(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>sre(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>are(e,n,r),e.decode=(n,r)=>lre(e,n,r),e.encodeAsync=async(n,r)=>cre(e,n,r),e.decodeAsync=async(n,r)=>ure(e,n,r),e.safeEncode=(n,r)=>dre(e,n,r),e.safeDecode=(n,r)=>fre(e,n,r),e.safeEncodeAsync=async(n,r)=>hre(e,n,r),e.safeDecodeAsync=async(n,r)=>pre(e,n,r),vd(e,"ZodType",{check(...n){const r=this.def;return this.clone(Li(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 Ii(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(aoe(n,r))},superRefine(n,r){return this.check(loe(n,r))},overwrite(n){return this.check(Vl(n))},optional(){return EO(this)},exactOptional(){return Gre(this)},nullable(){return jO(this)},nullish(){return EO(jO(this))},nonoptional(n){return eoe(this,n)},array(){return Tu(this)},or(n){return Fx([this,n])},and(n){return Bre(this,n)},transform(n){return OO(this,Zre(n))},default(n){return Xre(this,n)},prefault(n){return Jre(this,n)},catch(n){return noe(this,n)},pipe(n){return OO(this,n)},readonly(){return ioe(this)},describe(n){const r=this.clone();return nu.add(r,{description:n}),r},meta(...n){if(n.length===0)return nu.get(this);const r=this.clone();return nu.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=nu.get(e))==null?void 0:n.description},configurable:!0}),e)),T5=ye("_ZodString",(e,t)=>{Px.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,i,a)=>Ane(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,vd(e,"_ZodString",{regex(...r){return this.check(dne(...r))},includes(...r){return this.check(pne(...r))},startsWith(...r){return this.check(mne(...r))},endsWith(...r){return this.check(gne(...r))},min(...r){return this.check(lp(...r))},max(...r){return this.check(O5(...r))},length(...r){return this.check(A5(...r))},nonempty(...r){return this.check(lp(1,...r))},lowercase(r){return this.check(fne(r))},uppercase(r){return this.check(hne(r))},trim(){return this.check(bne())},normalize(...r){return this.check(yne(...r))},toLowerCase(){return this.check(vne())},toUpperCase(){return this.check(wne())},slugify(){return this.check(xne())}})}),mre=ye("ZodString",(e,t)=>{Px.init(e,t),T5.init(e,t),e.email=n=>e.check(zte(gre,n)),e.url=n=>e.check(Pte(yre,n)),e.jwt=n=>e.check(tne(Rre,n)),e.emoji=n=>e.check(Fte(bre,n)),e.guid=n=>e.check(bO(_O,n)),e.uuid=n=>e.check(Dte(rh,n)),e.uuidv4=n=>e.check(Lte(rh,n)),e.uuidv6=n=>e.check(Ite(rh,n)),e.uuidv7=n=>e.check(Ute(rh,n)),e.nanoid=n=>e.check(Bte(vre,n)),e.guid=n=>e.check(bO(_O,n)),e.cuid=n=>e.check(Hte(wre,n)),e.cuid2=n=>e.check(qte(xre,n)),e.ulid=n=>e.check(Vte(kre,n)),e.base64=n=>e.check(Wte(Cre,n)),e.base64url=n=>e.check(Jte(Nre,n)),e.xid=n=>e.check(Zte(_re,n)),e.ksuid=n=>e.check(Kte(Sre,n)),e.ipv4=n=>e.check(Gte(Ere,n)),e.ipv6=n=>e.check(Yte(jre,n)),e.cidrv4=n=>e.check(Qte(Ore,n)),e.cidrv6=n=>e.check(Xte(Are,n)),e.e164=n=>e.check(ene(Mre,n)),e.datetime=n=>e.check(Yne(n)),e.date=n=>e.check(Xne(n)),e.time=n=>e.check(Jne(n)),e.duration=n=>e.check(tre(n))});function uo(e){return $te(mre,e)}const Ct=ye("ZodStringFormat",(e,t)=>{Ot.init(e,t),T5.init(e,t)}),gre=ye("ZodEmail",(e,t)=>{Bee.init(e,t),Ct.init(e,t)}),_O=ye("ZodGUID",(e,t)=>{Pee.init(e,t),Ct.init(e,t)}),rh=ye("ZodUUID",(e,t)=>{Fee.init(e,t),Ct.init(e,t)}),yre=ye("ZodURL",(e,t)=>{Hee.init(e,t),Ct.init(e,t)}),bre=ye("ZodEmoji",(e,t)=>{qee.init(e,t),Ct.init(e,t)}),vre=ye("ZodNanoID",(e,t)=>{Vee.init(e,t),Ct.init(e,t)}),wre=ye("ZodCUID",(e,t)=>{Zee.init(e,t),Ct.init(e,t)}),xre=ye("ZodCUID2",(e,t)=>{Kee.init(e,t),Ct.init(e,t)}),kre=ye("ZodULID",(e,t)=>{Gee.init(e,t),Ct.init(e,t)}),_re=ye("ZodXID",(e,t)=>{Yee.init(e,t),Ct.init(e,t)}),Sre=ye("ZodKSUID",(e,t)=>{Qee.init(e,t),Ct.init(e,t)}),Ere=ye("ZodIPv4",(e,t)=>{tte.init(e,t),Ct.init(e,t)}),jre=ye("ZodIPv6",(e,t)=>{nte.init(e,t),Ct.init(e,t)}),Ore=ye("ZodCIDRv4",(e,t)=>{rte.init(e,t),Ct.init(e,t)}),Are=ye("ZodCIDRv6",(e,t)=>{ote.init(e,t),Ct.init(e,t)}),Cre=ye("ZodBase64",(e,t)=>{ite.init(e,t),Ct.init(e,t)}),Nre=ye("ZodBase64URL",(e,t)=>{ate.init(e,t),Ct.init(e,t)}),Mre=ye("ZodE164",(e,t)=>{lte.init(e,t),Ct.init(e,t)}),Rre=ye("ZodJWT",(e,t)=>{ute.init(e,t),Ct.init(e,t)}),$5=ye("ZodNumber",(e,t)=>{_5.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,i,a)=>Cne(e,r,i),vd(e,"ZodNumber",{gt(r,i){return this.check(wO(r,i))},gte(r,i){return this.check(sb(r,i))},min(r,i){return this.check(sb(r,i))},lt(r,i){return this.check(vO(r,i))},lte(r,i){return this.check(ib(r,i))},max(r,i){return this.check(ib(r,i))},int(r){return this.check(SO(r))},safe(r){return this.check(SO(r))},positive(r){return this.check(wO(0,r))},nonnegative(r){return this.check(sb(0,r))},negative(r){return this.check(vO(0,r))},nonpositive(r){return this.check(ib(0,r))},multipleOf(r,i){return this.check(xO(r,i))},step(r,i){return this.check(xO(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 fs(e){return sne($5,e)}const Tre=ye("ZodNumberFormat",(e,t)=>{dte.init(e,t),$5.init(e,t)});function SO(e){return ane(Tre,e)}const $re=ye("ZodBoolean",(e,t)=>{fte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Nne(e,n,r)});function oi(e){return lne($re,e)}const zre=ye("ZodUnknown",(e,t)=>{hte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Rne()});function Uv(){return cne(zre)}const Dre=ye("ZodNever",(e,t)=>{pte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Mne(e,n,r)});function Lre(e){return une(Dre,e)}const Ire=ye("ZodArray",(e,t)=>{mte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Lne(e,n,r,i),e.element=t.element,vd(e,"ZodArray",{min(n,r){return this.check(lp(n,r))},nonempty(n){return this.check(lp(1,n))},max(n,r){return this.check(O5(n,r))},length(n,r){return this.check(A5(n,r))},unwrap(){return this.element}})});function Tu(e,t){return kne(Ire,e,t)}const Ure=ye("ZodObject",(e,t)=>{yte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ine(e,n,r,i),vt(e,"shape",()=>t.shape),vd(e,"ZodObject",{keyof(){return Os(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Uv()})},loose(){return this.clone({...this._zod.def,catchall:Uv()})},strict(){return this.clone({...this._zod.def,catchall:Lre()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return zJ(this,n)},safeExtend(n){return DJ(this,n)},merge(n){return LJ(this,n)},pick(n){return TJ(this,n)},omit(n){return $J(this,n)},partial(...n){return IJ(z5,this,n[0])},required(...n){return UJ(D5,this,n[0])}})});function Ol(e,t){const n={type:"object",shape:e??{},...De(t)};return new Ure(n)}const Pre=ye("ZodUnion",(e,t)=>{bte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Une(e,n,r,i),e.options=t.options});function Fx(e,t){return new Pre({type:"union",options:e,...De(t)})}const Fre=ye("ZodIntersection",(e,t)=>{vte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Pne(e,n,r,i)});function Bre(e,t){return new Fre({type:"intersection",left:e,right:t})}const Pv=ye("ZodEnum",(e,t)=>{wte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,i,a)=>Tne(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 Pv({...t,checks:[],...De(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 Pv({...t,checks:[],...De(i),entries:a})}});function Os(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Pv({type:"enum",entries:n,...De(t)})}const Hre=ye("ZodLiteral",(e,t)=>{xte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$ne(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 qre(e,t){return new Hre({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const Vre=ye("ZodTransform",(e,t)=>{kte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Dne(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new l5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ru(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(Ru(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 Zre(e){return new Vre({type:"transform",transform:e})}const z5=ye("ZodOptional",(e,t)=>{j5.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>R5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function EO(e){return new z5({type:"optional",innerType:e})}const Kre=ye("ZodExactOptional",(e,t)=>{_te.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>R5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Gre(e){return new Kre({type:"optional",innerType:e})}const Yre=ye("ZodNullable",(e,t)=>{Ste.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Fne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jO(e){return new Yre({type:"nullable",innerType:e})}const Qre=ye("ZodDefault",(e,t)=>{Ete.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Xre(e,t){return new Qre({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():d5(t)}})}const Wre=ye("ZodPrefault",(e,t)=>{jte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Jre(e,t){return new Wre({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():d5(t)}})}const D5=ye("ZodNonOptional",(e,t)=>{Ote.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Bne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function eoe(e,t){return new D5({type:"nonoptional",innerType:e,...De(t)})}const toe=ye("ZodCatch",(e,t)=>{Ate.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Vne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function noe(e,t){return new toe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const roe=ye("ZodPipe",(e,t)=>{Cte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zne(e,n,r,i),e.in=t.in,e.out=t.out});function OO(e,t){return new roe({type:"pipe",in:e,out:t})}const ooe=ye("ZodReadonly",(e,t)=>{Nte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Kne(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ioe(e){return new ooe({type:"readonly",innerType:e})}const soe=ye("ZodCustom",(e,t)=>{Mte.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zne(e,n)});function aoe(e,t={}){return _ne(soe,e,t)}function loe(e,t){return Sne(e,t)}const coe={crop:Ol({mode:Os(["locked","free"]),aspect:fs().positive().optional(),aspectLabel:uo().optional(),mobile:Ol({aspect:fs().positive(),breakpoint:fs().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()},uoe={playback:Ol({autoplay:oi().optional(),loop:oi().optional(),muted:oi().optional(),controls:oi().optional(),playsinline:oi().optional(),preload:Os(["none","metadata","auto"]).optional()}).strict().refine(e=>e.autoplay!==!0||e.muted===!0,{message:"autoplay requires muted (browsers block unmuted autoplay)"}).optional()},doe=Ol({kind:qre("process"),verb:Os(c0)}).catchall(Uv()),Xc={from:Fx([uo().min(1),Tu(uo().min(1)).min(2)]).optional(),process:Tu(doe).nonempty().optional()},Pa=e=>e==null||typeof e=="string"&&e.trim()==="",ab=e=>e==null,oh=e=>e==null||typeof e=="object"&&Object.values(e).every(t=>t==null||t===""),AO={text:{shape:{size:Os(["short","medium","long"]).optional(),cap:fs().int().positive().optional()},default:()=>"",isEmpty:Pa},number:{shape:{thousandsSep:oi().optional(),decimals:oi().optional(),maxDigits:fs().int().positive().optional()},default:()=>null,isEmpty:ab},select:{shape:{values:Tu(Fx([uo(),Ol({value:uo(),label:uo(),icon:Os(_T).optional(),description:uo().min(1).optional()}).strict()])).optional(),options:Ol({source:uo()}).strict().optional(),creatable:oi().optional()},default:()=>null,isEmpty:Pa},image:{shape:{...coe,...Xc},default:()=>({url:"",alt:""}),isEmpty:oh},video:{shape:{...uoe,...Xc},default:()=>({url:"",poster:"",alt:""}),isEmpty:oh},tour:{shape:{...Xc},default:()=>({id:"",url:"",poster:"",alt:""}),isEmpty:oh},list:{shape:{min:fs().int().nonnegative().optional(),max:fs().int().positive().optional()},default:()=>[],isEmpty:e=>e==null||Array.isArray(e)&&e.length===0},poi:{shape:{},default:()=>null,isEmpty:ab},url:{shape:{accepts:uo().optional()},default:()=>"",isEmpty:Pa},date:{shape:{},default:()=>null,isEmpty:Pa},email:{shape:{},default:()=>"",isEmpty:Pa},phone:{shape:{},default:()=>"",isEmpty:Pa},address:{shape:{},default:()=>null,isEmpty:e=>tn(e)===null},document:{shape:{...Xc},default:()=>null,isEmpty:ab},media:{shape:{kinds:Tu(Os(Eo)).nonempty().optional(),...Xc},default:()=>null,isEmpty:oh}},L5=["poi","address"];function kh(e){return typeof e=="string"&&L5.includes(e)}const foe=["url","date","email","phone"];function I5(e){return foe.includes(e)}const hoe=["image","video","tour","document","media"];function CO(e){return hoe.includes(e.type??"")?e.type:void 0}function poe(e){var t;if(e.type==="list"){const n=(t=e.element)==null?void 0:t.type;return n==="select"?"select":kh(n)||n==="object"||n==="row"?void 0:CO({type:n})!==void 0?"mediaList":"list"}return e.type==="text"||I5(e.type)?"text":e.type==="select"?"choice":CO(e)}function moe(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 NO=new Set(["select","image","video","tour","document","media","row"]);function Bx(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"&&goe(i,t.element),r==="find"&&!kh(p))throw new Error(`${i} is filled by \`fill.find\`, but only ${yoe} are found — it sources ${boe} or a list whose item is one.`);if(r!=="find"&&kh(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\`.`);MO(i,n);return}if(kh(t.type)){if(r==="find")return;throw new Error(`${i} is filled by \`fill.${r}\`, but ${lb(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"||I5(t.type);if(r==="write"&&c)return;if(r==="pick"&&NO.has(t.type??"")){MO(i,n);return}const u=String(t.type);throw new Error(c?`${i} is filled by \`fill.${r}\`, but ${lb(u)} is written — \`fill.write\`.`:NO.has(t.type??"")?`${i} is filled by \`fill.${r}\`, but ${lb(u)} holds a value that exists — \`fill.pick\`.`:`${i} is filled, but no fill produces that type.`)}function MO(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 goe(e,t){var r;const n=t!==void 0&&xo(t.type??"")?"a list of media":(r=Object.entries((t==null?void 0:t.type)==="object"?t.fields??{}:{}).find(([,i])=>{var a;return xo(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 yoe="places and addresses",boe=L5.map(e=>`\`${e}()\``).join(", ");function lb(e){return`${/^[aeiou]/.test(e)&&e!=="url"?"an":"a"} ${e}`}function U5(e,t){if(t.type==="list")return U5(e,voe(e,t));if(t.type==="row"){const r=Oo(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=gu(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 hL(n)}function RO(e){var t;return((t=e.source)==null?void 0:t.kind)!=="element"?!1:e.type==="row"?Oo(e.from)!==void 0:e.type==="select"?Array.isArray(e.values):xo(e.type??"")&&e.from!==void 0}function voe(e,t){const n=t.element;if(n!==void 0&&n.type!=="object"&&RO(n))return n;const r=Object.values((n==null?void 0:n.fields)??{}).filter(RO);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 Hx(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=Fv(i.reads);f.length>0&&(a.reads=f);const p=Fv(i.requires);return p.length>0&&(a.requires=p),a});return n.some(i=>i.verb==="pick")?{of:U5(e,t),fills:r}:{fills:r}}function Fv(e){return(e??[]).map(t=>{if(typeof t=="object"&&t!==null&&t.kind==="item")return t;if(In(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(MA(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 OD(t)})}function Bv(e,t,n){for(const r of t??[]){const i=DD(r);for(const a of Fv(r.reads))a.kind==="home"?e.facts.add(a.key):AD(a)&&a.section!==i&&e.slots.set(`${a.section} ${a.slot}`,a)}for(const r of Array.isArray(n)?n:[n])Yt(r)&&Xt(r.key)!==null&&e.facts.add(r.key)}function woe(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)Bx(e,t,a);woe(e,t);const{of:r,fills:i}=Hx(e,t,n);return{id:e,kind:moe(t),...r===void 0?{}:{of:r},produces:[e],fills:i}}function koe(e,t,n,r){for(const u of n)Bx(e,t,u);if(!(t.type==="list"&&n.every(u=>u.verb==="pick"))&&t.type!=="row"&&poe(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}=Hx(e,t,n);return{...a===void 0?{}:{of:a},fills:c}}function _oe(e,t,n,r){var g;const i=wr(t),a=((g=t.element)==null?void 0:g.type)==="object"?t.element.fields??{}:void 0,c={};for(const[m,w]of Object.entries(a??{})){const v=wr(w);v!==void 0&&(c[m]=koe(`${e}.${m}`,w,v),Bv(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)Bx(e,t,m);const{of:f,fills:p}=Hx(e,t,i);return Bv(n,i,f),{id:e,kind:"list",...f===void 0?{}:{of:f},produces:[e],fills:p,...u}}function TO(e,t,n,r){if(t.type==="list")return _oe(e,t,n);const i=wr(t);if(i===void 0)return;const a=xoe(e,t,i);return Bv(n,i,a.of),a}function Soe(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])=>TO(`${r}.${u}`,f,t)):[TO(r,a,t)];for(const u of c)u!==void 0&&n.push(u)}return n}function Eoe(){return{facts:new Set,slots:new Map}}function joe(e){const t=Eoe(),n=e.pages,r={slots:Object.fromEntries(Object.entries(n).map(([a,c])=>[`${e.home}.${a}`,c.declaration]))},i=Soe(r,t);return{reads:[...t.facts].sort(),slot_reads:[],decisions:i}}const Ooe={property:["property.hero"],library:[]};function P5(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 Wc(e,t){return Ku(e)?P5(e.reads,t):[]}function cb(e){const t=e.from;return t===void 0||e.type==="row"?[]:[...Oo(t)??[]]}function $O(e,t){const n=e==null?void 0:e.of,r=(n==null?void 0:n.type)==="media"?[...Oo(n.from)??[]]:[];return[...((e==null?void 0:e.fills)??[]).flatMap(i=>P5(i.reads,t)),...r]}function zO(e){return[...new Set(e)]}function Aoe(e){var c;if(e.type==="object")return{fields:e.fields,rowsOf:null};const t=O0(e);if(t===null)return null;const n=Sp(t)[0];if(n===void 0)return null;const{home:r,key:i}=_o(n),a=(c=g0(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 Coe(e,t,n){const r=e.pages[t],i=r.declaration,a=`${e.home}.${t}`,c=n.get(a),u=r.head,f=[...$O(c,a),...Wc(i.source,null),...cb(i),...u===null?[]:[...Wc(u.title,null),...Wc(u.description,null)],...i.type==="list"?[...Wc(i.max,null),...cb(i.element)]:[]],p=i.type==="list"?Aoe(i.element):null;let g;return p!==null?g=Object.entries(p.fields).map(([m,w])=>{var v;return{path:`${a}[].${m}`,declaration:w,reads:zO([...Wc(w.source,a),...$O((v=c==null?void 0:c.fields)==null?void 0:v[m],a),...cb(w)])}}):i.type==="address"?g=yp.map(m=>({path:`${a}.${m}`,declaration:null,reads:[]})):g=[{path:a,declaration:i,reads:[]}],{home:e.home,key:t,path:a,declaration:i,paged:Ep(r),rowsOf:(p==null?void 0:p.rowsOf)??null,fields:g,reads:zO(f.filter(m=>m!==a))}}const DO=new WeakMap;function F5(e){const t=DO.get(e);if(t!==void 0)return t;const n=new Map;for(const i of joe(e).decisions)i.id!==void 0&&n.set(i.id,i);const r={home:e.home,facts:Object.keys(e.pages).map(i=>Coe(e,i,n)),platformReads:Ooe[e.home]};return DO.set(e,r),r}const Noe=/^([a-z]+\.[a-z_]+)(?:(\[\]|\[0\])\.([a-z_]+))?(?:\.([a-z_]+))?$/;function Moe(e){const t=e.map(F5),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 Roe(e,t){const n=Noe.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 gi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LO(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!gi(t);case"row":return t==null;case"media":return AO.image.isEmpty(t);default:return((n=AO[e.type])==null?void 0:n.isEmpty(t))??t==null}}function IO(e,t){const n=tn(e);return n===null||n[t]===null}function Toe(e){if(typeof e=="string")return e;if(!gi(e))return null;const t=e.id??e.row_id;return typeof t=="string"?t:null}function $oe(e,t,n,r,i){if(e.rowsOf===null)return gi(n)?n[r]:void 0;const a=_o(e.rowsOf),c=t[a.home],u=Toe(n),f=c==null?void 0:c[a.key],p=Array.isArray(f)&&u!==null?f.find(g=>gi(g)&&g.id===u):void 0;if(gi(p))return p[r];if(gi(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 zoe(e,t,n){var m,w;const{fact:r,rows:i,member:a,part:c}=Roe(e,n),u=((m=t[r.home])==null?void 0:m[r.key])??null;if(a===void 0)return c===void 0?!LO(r.declaration,u):!IO(u,c);const f=((w=e.fields.get(`${r.path}[].${a}`))==null?void 0:w.declaration)??null,p=v=>{const _=$oe(r,t,v,a,n);return c===void 0?!LO(f,_):!IO(_,c)},g=Array.isArray(u)?u:[];return i==="first"?g.length>0&&p(g[0]):g.every(p)}function Doe(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.length===0:gi(e)?Object.keys(e).length===0:!1}function B5(e,t){const[n,...r]=t.split("[]"),i=n.indexOf("."),a=i<0?e[n]:e[gd(n.slice(0,i),n.slice(i+1))]??H5(e[n.slice(0,i)],n.slice(i+1));return q5(a,r)}function H5(e,t){let n=e;for(const r of t.split(".").filter(i=>i!==""))n=gi(n)?n[r]:void 0;return n}function q5(e,t){if(t.length===0)return Doe(e);if(!Array.isArray(e))return!1;const[n,...r]=t;return e.some(i=>q5(H5(i,n),r))}const Loe=[dt,_r];function Ioe(e,t,n=Loe){const r=Moe(n);return e.filter(i=>!zoe(r,t,i))}function Uoe(e){return e.split("[]")[0].split(".").slice(0,2).join(".")}function Poe(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 B5(r,n.slot)?[{instanceId:n.instance_id,pageId:n.page_id,path:n.slot,slotId:Uoe(n.slot)}]:[]})}function Foe(e,t,n){return e.some(r=>r.instanceId===t&&r.path===n)}function Boe(e,t,n){var i;const r=t.instances.find(a=>a.instance_id===e.instance_id);for(const a of vx(e.schema,Wp(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 Hoe(e,t){var n;return((n=e.find(r=>r.page_ids.includes(t)))==null?void 0:n.id)??null}const qoe=400,qx=x.createContext({empty:[],noteSubmitAttempt:()=>{}});function Voe({children:e}){var O;const t=No(),n=je(A=>A.backend.requirements),r=n.queryKey,i=zn({queryKey:r,queryFn:()=>n.read(),retry:!1}),a=je(A=>A.content_doc),c=je(A=>A.pendingSaves),u=x.useRef(a);x.useEffect(()=>{if(c>0||a===u.current)return;const A=setTimeout(()=>{t.invalidateQueries({queryKey:r})},qoe);return()=>clearTimeout(A)},[a,c,t,r]);const f=(O=i.data)==null?void 0:O.empty_content,p=x.useMemo(()=>f?Poe(f,a):[],[f,a]),[g,m]=x.useState(!1),w=p.length>0,v=i.status!=="pending",[_,k]=x.useState(!1);_&&v&&(k(!1),w&&m(!0));const S=x.useCallback(()=>{v?w&&m(!0):k(!0)},[v,w]),E=x.useMemo(()=>({empty:p,noteSubmitAttempt:S}),[p,S]);return h.jsx(qx.Provider,{value:E,children:h.jsx(MB,{shown:g,children:e})})}function V5(){return x.useContext(qx).empty}function Zoe(){return x.useContext(qx).noteSubmitAttempt}const UO="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 Koe({actions:e}){const{viewLive:t,download:n,publish:r}=e,i=je(g=>g.session.deliverable_id),a=Zoe(),c=r?()=>{a(),r.start()}:null,u=x.useRef(!1),f=(r==null?void 0:r.pressOnArrival)===!0;x.useEffect(()=>{!f||u.current||c===null||(u.current=!0,c())},[f]);const p=[t,n,r].filter(g=>g!==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(Ls,{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(Goe,{answer:t}):null,n?h.jsx(_J,{phase:n.phase,disabledReason:n.disabledReason,onClick:()=>{a(),n.start()},variant:"footer"}):null,r&&c?h.jsx(jJ,{state:r.state,isPending:r.isPending,hasOutstandingChanges:r.hasOutstandingChanges,onClick:c}):null]})]})}function Goe({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 ${UO} 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(At,{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:`${UO} 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(At,{name:"external",size:12,stroke:1.6})}),h.jsx("span",{children:"View live"})]})}const PO=new Set(["image","video","tour","document","media"]);function Yoe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Qoe(e,t){var a;const r=(a=dt.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 Xoe(e){return e===void 0||e===""?null:e}function FO(e,t,n,r){const i=Qoe(t,n);if(i===null)return null;const a=Array.isArray(r)?r:[];if(PO.has(i.type))return{kind:"picks",mediaIds:a.map(Dn).filter(p=>p!==null)};if(i.type!=="object")return null;const c=Object.entries(i.fields),u=e4(e,t);return{kind:"items",items:a.flatMap(p=>{const g=Yoe(p);if(g===null)return[];const m=zr(g)&&u!==null?u.toItem(g):g,w={};for(const[_,k]of c)w[_]=PO.has(k.type)?Dn(m[_]):Xoe(m[_]);const v=zr(g)?null:g.id;return[{id:typeof v=="string"&&v!==""?v:null,fields:w}]})}}function Woe(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 Z5(e){return e===null||typeof e!="object"||e.picked!==null?null:Dn(e)}const Joe=new Set(["image","video","tour","document","media"]),eie=new Set(["image_list","row_list"]),tie=new Set(["text_list","number_list"]);function Vx(e,t,n){const r=jq(t,e);if(r!==null)return{kind:"owned_media",member:r.field};if(n===void 0)return null;const i=z0(e,n);return i.kind!=="member"||!i.storable?null:eie.has(i.value_type)?{kind:"nested_list",member:n}:Joe.has(i.value_type)?null:{kind:"value",member:n,list:tie.has(i.value_type)}}function nie(e,t=Xu(e.source)){return t===null?[]:Zx(e).flatMap(({key:n,slot:r,member:i})=>{const a=Vx(t,r,i);return(a==null?void 0:a.kind)==="value"?[{key:n,member:a.member}]:[]})}function Zx(e){const t=Kw(e),n=PC(Object.fromEntries(t));return t.map(([r,i])=>({key:r,slot:i,member:n[r]}))}function rie(e){return Rs(e)&&Mh(e)}function K5(e,t,n,r){const i=n.table;return r.flatMap(a=>{const c=Vx(n.table,a.slot,a.member);if(c===null)return[];let u,f=null;if(c.kind==="owned_media"){if(Dn(a.current)===Dn(a.baseline))return[];f=Z5(a.current)}else if(c.kind==="nested_list"){const m=FO(a.slot,i,c.member,a.current),w=FO(a.slot,i,c.member,a.baseline);if(m===null||w===null||Woe(m,w))return[];u=m}else if(Array.isArray(a.current)&&!c.list||o4(a.current,a.baseline))return[];const p=c.kind!=="value"?c.kind:a.key===void 0?"scalar":"item_field",g=a.key??(c.kind==="value"?c.member:void 0);return[{id:`${e}:${p}:${n.identity}:${g??""}`,kind:p,label:t,slotId:e,...g!==void 0?{field:g}:{},fact:i4(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 oie(e,t,n,r,i,a){const c=Dt(a.slots,n.holder);if(typeof c!="string"||c===""||i.facts===null)return[];const u=kp(i.facts,n.tables,c);if(u===null)return[];const f=Dt(a.slots,e),p=wx(t,e,n,i,g=>Dt(a.slots,g));return K5(e,r,{table:u,rowId:c,identity:c},[{slot:t,member:n.member,current:f,baseline:p}])}function iie(e,t){var r,i;if(e===void 0)return;if(Object.hasOwn(e,t))return e[t];const n=Mo(t);return n===null||(i=(r=e[n.object])==null?void 0:r.fields)==null?void 0:i[n.field]}function sie(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 G5(e){const t=Ln(e),n=t?Dr(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 Y5(e,t,n,r,i){const a=G5(t),c=Zx(t);return r.flatMap(({listItem:u,identity:f,rowId:p})=>{const g=i.get(p);if(!g)return[];const m=c.map(({key:w,slot:v,member:_})=>({key:w,slot:v,member:_,current:u[w],baseline:g[w]}));return K5(e,a(u,f),{table:n,rowId:p,identity:f},m)})}function Q5(e){return Array.isArray(e)?e:[]}function aie(e,t,n,r,i,a){const c=[],u=pd,f=Q5(Dt(i.slots,e)),p=fT(i.slot_overrides,e),g=new Map(r.map(E=>[String(E[u]),E])),m=G5(t),w=cie(e,t,a);for(const E of f){const O=E[u];if(xl(O)){const A=w(E);c.push({id:`${e}:item_create:${String(O)}:`,kind:"item_create",label:m(E,"New item"),slotId:e,item_id:String(O),table:a,...A.length>0?{ownedMedia:A}:{}})}}for(const E of Object.keys(p))c.push({id:`${e}:item_remove:${E}:`,kind:"item_remove",label:m(g.get(E),E),slotId:e,item_id:E,table:a});const v=f.flatMap(E=>{const O=E[u];return xl(O)||typeof O!="string"||p[O]?[]:[{listItem:E,identity:O,rowId:O}]});c.push(...Y5(e,t,a,v,g));const _=v.map(E=>E.identity),k=r.map(E=>String(E[u])).filter(E=>!p[E]),S=sie(_,k,e,n,a);return S&&c.push(S),c}function lie(e,t,n,r,i,a){const c=pd,u=R0(Object.fromEntries(Kw(t)))[0],f=new Map(n.map(p=>[String(p[c]),p]));return Q5(Dt(r.slots,e)).flatMap(p=>{const g=p[c];if(typeof g!="string"||g==="")return[];const m=u===void 0?void 0:p[u],w=typeof m=="string"&&m!==""?m:g,v=kp(a,i,w);return v===null?[]:Y5(e,t,v,[{listItem:p,identity:g,rowId:w}],f)})}function cie(e,t,n){const r=Zx(t).filter(({slot:i,member:a})=>{var c;return((c=Vx(n,i,a))==null?void 0:c.kind)==="owned_media"});return i=>r.flatMap(({key:a})=>{const c=Z5(i[a]);return c===null?[]:[{ownerSlot:`${e}.${a}`,mediaId:c}]})}function uie(e,t){const n=e.schema.slots??{};return r4(n,{fillSpec:e.fill_spec,sectionSlots:Nx(t)}).flatMap(([r,i])=>{const a=iie(n,r);return a===void 0?[]:[{slotId:r,sourcing:i,schemaSlot:a,label:a.label}]})}function die(e,t){return e.kind==="fact"&&t.type==="list"?e.table:null}function BO(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=>Dt(n.slots,f),u=[];for(const{slotId:f,sourcing:p,schemaSlot:g,label:m}of uie(r,e.session.sections)){if(p.kind==="row"||p.kind==="slot"||p.kind==="computed")continue;if(p.kind==="member"){u.push(...oie(f,g,p,m,a,n));continue}const w=n4(g,f,p,a)??[];if(p.kind==="rows"){g.type==="list"&&u.push(...lie(f,g,w,n,p.tables,i));continue}const v=die(p,g);if(v!==null){u.push(...aie(f,g,m,w,n,v));continue}const _=Dt(n.slots,f),k=wx(g,f,p,a,c),S=rie(p.key)?aQ(p.key):null;S!==null&&(Array.isArray(_)||o4(_,k)||u.push({id:`${f}:scalar::`,kind:"scalar",label:m,slotId:f,fact:S}))}return u}function fie(e,t){const n=BO(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 G4(r)){const u=tm(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])=>BO(e,c).filter(f=>u.has(f.slotId)).map(f=>({...f,id:`${c}/${f.id}`,instanceId:c})));return[...n,...a]}function hie(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function HO(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 pie(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 qO(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 mie({items:e,onApply:t}){const n=e??[],r=n.length,i=n.map(W=>W.id).join("|"),[a,c]=x.useState(!1),[u,f]=x.useState("idle"),[p,g]=x.useState(!1),[m,w]=x.useState(0),v=x.useRef(null),_=x.useRef(null),k=x.useRef(null),S=x.useRef(null),E=x.useRef(n),O=x.useRef(!0);x.useLayoutEffect(()=>{E.current=n});const A=x.useRef(hie()).current,R=x.useCallback(W=>{const G=v.current;if(A||document.hidden||G==null||typeof G.animate!="function"){g(!1),c(!1),f("idle"),W==null||W();return}g(!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=()=>{g(!1),c(!1),f("idle"),W==null||W()}},[A]);x.useEffect(()=>(_.current!=null&&clearTimeout(_.current),r>0&&u==="idle"?i!==S.current&&!a&&(_.current=setTimeout(()=>{c(!0)},550)):r===0&&a&&!p&&u==="idle"&&R(),()=>{_.current!=null&&clearTimeout(_.current)}),[r,i,a,u,p,R]),x.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]),x.useEffect(()=>{if(u!=="applying")return;const W=G=>{G.preventDefault(),G.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[u]),x.useEffect(()=>(O.current=!0,()=>{O.current=!1,_.current!=null&&clearTimeout(_.current),k.current!=null&&clearTimeout(k.current)}),[]);const C=()=>{const W=E.current;w(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(()=>{R(()=>{S.current=null})},1200)}catch{if(!O.current)return;f("error")}})()},I=()=>{S.current=i,R()};if(!a&&u!=="success"&&!p)return null;const $=u==="applying",T=$?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(pie,{})}),"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(qO,{})})]}),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(HO,{})]})]}):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:$,"aria-label":"Dismiss",children:h.jsx(qO,{})})]}),h.jsx("button",{type:"button","data-action":"apply",disabled:$,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:$?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(HO,{})]})})]})})})})}function gie(){const e=hr(),t=t5();return x.useCallback((n,r,i,a)=>{const c=e.getState(),u=tm(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,...Mx(e,f)])yie(e,p,a);c.markSlotOverridden(f.instanceId,f.slotId,{kind:"scalar"}),t(n,r,i)},[e,t])}function yie(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 ZZ((i==null?void 0:i.schema.slots)??{},t.slotId))!Object.hasOwn(n,u.member)||ax(a,u.key)||$v(e,t.instanceId,u.key,n[u.member])}function bie({instanceId:e,selectedSlotId:t,notices:n,cardAdornment:r}){const i=je(A=>A.session),a=je(A=>A.select),c=V4(),u=je(A=>A.content_doc),f=x.useMemo(()=>fie({content_doc:u,session:i},e),[u,i,e]),p=f.length>0,g=hr(),m=x.useCallback(async A=>{const{rewriteTempId:R,relinkSlot:C,applyBootstrap:I,backend:$}=g.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=>g.getState().content_doc.instances.find(z=>z.instance_id===U);await uQ({send:U=>$.updateEverywhere(U),readValue:U=>{const z=H(W);if(!z)return;if(U.kind==="scalar"||U.kind==="owned_media"&&U.field==null)return Dt(z.slots,U.slotId);const K=z.slots[U.slotId];if(!U.table||!Array.isArray(K))return;const N=K.find(B=>B.id===U.item_id);return N==null?void 0:N[U.field??""]},readSlots:U=>{var z;return((z=H(U))==null?void 0:z.slots)??{}},rewriteTempId:R,relinkSlot:C,readSlotOrder:U=>{var Y,ie,J;const K=(ie=(Y=g.getState().session.sections.find(L=>L.instance_id===W))==null?void 0:Y.schema.slots)==null?void 0:ie[U],N=K?kL(K):null,B=(J=H(W))==null?void 0:J.slots[U];return!Array.isArray(B)||!N?[]:B.map(L=>L.id).filter(L=>typeof L=="string")},writableItemFields:U=>{var N;const z=g.getState().session.sections.find(B=>B.instance_id===W),K=(N=z==null?void 0:z.schema.slots)==null?void 0:N[U];return K?nie(K):[]}},W,G)}const F=await $.bootstrap();if(!So(g,$))return;I(F),$.refresh()}catch(T){throw console.error("[editor] Update-everywhere failed",{instanceId:e,err:T}),T}},[g,e]),w=i.sections.find(A=>A.instance_id===e);if(!w)return null;const v=u.instances.find(A=>A.instance_id===e),_=!(v!=null&&v.enabled),S=w.required&&!_,E=mi(w),O=vx(w.schema,Wp(w,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:E})}),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(At,{name:_?"eyeOff":"eye",size:15,stroke:1.8})}),U4(w)&&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(At,{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:le("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(vie,{card:A,instanceId:e,instance:v,entry:w,focused:t!=null&&KY(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(mie,{items:f,onApply:m})]})]})}function vie({card:e,instanceId:t,instance:n,entry:r,focused:i,onFocus:a,onBlur:c,cardAdornment:u}){const f=je(g=>{var m;return((m=g.selection)==null?void 0:m.kind)==="slot"&&g.selection.instance_id===t&&g.selection.slot_id===e.key?g.selection.field_name:void 0}),p=(n==null?void 0:n.slots)??{};return h.jsx(wT,{open:i,onToggle:i?c:a,icon:e.Icon?h.jsx(e.Icon,{size:14}):null,title:ZY(e,r.schema,g=>p[g]),scrollKey:e.key,adornment:u==null?void 0:u({instanceId:t,slotIds:e.fields.map(g=>g.slotId)}),children:h.jsx(ud,{place:"panel",children:h.jsx(hx,{fields:e.fields.map(g=>[mj(g),g.slot]),lone:e.lone,reveal:i?f:void 0,renderField:(g,m)=>{const w=e.fields.find(v=>mj(v)===g).slotId;return h.jsx(wie,{slotId:w,slot:m,instanceId:t,value:Dt(p,w),entry:r})}})})})}const VO="m-0 px-0.5 text-caption leading-[1.4] text-ink-4";function wie({slot:e,slotId:t,instanceId:n,value:r,entry:i}){const a=je(N=>N.session.sections),c=je(N=>N.session.pages),u=x.useMemo(()=>tm({sections:a,pages:c},{instanceId:n,slotId:t}),[a,c,n,t]),f=u??{instanceId:n,slotId:t,entry:i,slot:e},p=je(N=>N.session.facts),g=x.useMemo(()=>{const N=Cu(f.entry,a,f.slotId);return N===null?void 0:n4(f.slot,f.slotId,N,{facts:p,computed:f.entry.computed})},[f.entry,f.slot,f.slotId,a,p]),m=je(N=>N.content_doc.instances),w=Xw(f.entry.fill_spec,f.slotId),v=e.type==="list"?Ww(f.slot,w,Nx(a)):void 0,_=e.type==="row",k=RW({sections:a,pages:c},m,{instanceId:n,section:i.section_key}),S=_?md(f.slot):v!==void 0?pv(e,v,k):void 0,E=gie(),O=t5(),A=je(N=>N.session.property_id),R=je(N=>N.selection),C=je(N=>{var Y;if(u===null)return r;const B=(Y=N.content_doc.instances.find(ie=>ie.instance_id===u.instanceId))==null?void 0:Y.slots;return B?Dt(B,u.slotId):void 0}),I=x.useMemo(()=>{if(qs(f.slot.source)===null)return null;const N=Cu(f.entry,a,f.slotId);return(N==null?void 0:N.kind)==="member"?N:null},[f.slot,f.entry,a,f.slotId]),$=je(N=>{var ie;if(I===null)return;const B=(ie=N.content_doc.instances.find(J=>J.instance_id===f.instanceId))==null?void 0:ie.slots,Y=B?Dt(B,I.holder):void 0;return typeof Y=="string"&&Y!==""?Y:null}),T=I===null||p===null?void 0:kp(p,I.tables,$??null)??void 0,F=je(N=>{var B,Y,ie;return((ie=(Y=(B=N.content_doc.instances.find(J=>J.instance_id===f.instanceId))==null?void 0:B.slot_overrides)==null?void 0:Y.scalar)==null?void 0:ie[f.slotId])===!0}),W=V5(),G=Foe(W,f.instanceId,f.slotId),H=u===null?null:`${mi(u.entry)}’s ${u.slot.label}`;if((u==null?void 0:u.locked)===!0)return h.jsxs("p",{className:VO,children:["Can’t be edited here: it shows ",H,", which is locked."]});const U=(R==null?void 0:R.kind)==="slot"&&R.instance_id===n&&R.slot_id===t?R:void 0,z=U==null?void 0:U.item_index,K=U==null?void 0:U.field_name;return h.jsxs(h.Fragment,{children:[h.jsx(ql,{slot:e,instanceId:f.instanceId,slotId:f.slotId,value:C,propertyId:A,onChange:N=>O(n,t,N),overridden:F,required:G,selectedItemIndex:z,selectedFieldName:K,itemBaseline:g,boundRowId:$,boundRowTable:T,membership:v,rowTable:S,onRowPick:_?(N,B)=>E(n,t,N,B):void 0,factPath:`${f.instanceId}.${f.slotId}`}),H!==null&&h.jsxs("p",{className:VO,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(At,{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 kie=le("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 _ie({instanceId:e,notices:t}){const n=je(m=>m.session),r=je(m=>m.content_doc),i=je(m=>m.select),a=AW(),c=n.sections.find(m=>m.instance_id===e);if(!c)return null;const u=r.instances.find(m=>m.instance_id===e),f=U4(c),p=Wp(c,u),g=XX(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:mi(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:kie,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))}),g>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:[g===1?"1 empty field in this variation":`${g} 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 Sie(){const e=hr(),t=V5(),n=je(f=>f.session.sections),r=je(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:Boe(a,r,i.slotId),u=()=>{const f=e.getState(),p=Hoe(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(eJ,{onClick:u,children:c})]})}}function Eie(e){return`editor:${e}`}function jie(){return je(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 Oie={};function Aie({slots:e=Oie,actions:t}){const n=x.useRef(null);return sQ(),x.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(Voe,{children:[h.jsx(Cie,{slots:e}),t?h.jsx(Koe,{actions:t}):null]})})}function Cie({slots:e}){const t=je(f=>f.selection),n=je(f=>f.session.deliverable_id),r=jie(),i=Eie(n),a=Sie(),c=a===null?[...e.notices??[]]:[...e.notices??[],a];if(t===null||r===null)return h.jsxs(h.Fragment,{children:[h.jsx(tQ,{}),h.jsx(Ls,{surface:i,notices:c,className:"mx-3 mt-3 flex-shrink-0"})]});const u=h.jsx(Ls,{surface:i,notices:c});return t.kind==="section-settings"?h.jsx(_ie,{instanceId:r,notices:u}):h.jsx(bie,{instanceId:r,selectedSlotId:t.kind==="slot"?t.slot_id:null,notices:u,cardAdornment:e.cardAdornment})}function Nie(){return document.querySelector('[role="dialog"][aria-modal="true"]')!==null}function ZO(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||Nie()||(n.preventDefault(),a?e():t())}}function Mie(e=!0){const{undo:t,redo:n}=n5(),r=je(i=>i.iframeDocs);x.useEffect(()=>{if(!e)return;const i=ZO(t,n);return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,t,n]),x.useEffect(()=>{const i=ZO(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 Rie=3e3;function Tie({storeApi:e,signal:t,doc:n=document,restingMs:r=Rie}){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=>{Rv(p)&&c()});n.addEventListener("visibilitychange",u),t.addEventListener("abort",c),t.aborted||Rv(e.getState())?c():n.visibilityState!=="hidden"&&(a=setTimeout(c,r))})}const $ie=5e3;function zie(e){const t=hr(),n=No();x.useEffect(()=>{const r=new AbortController,{signal:i}=r,a=VX(Ox,qX(n,e));return(async()=>{for(;!i.aborted;)try{if(await Tie({storeApi:t,signal:i}),i.aborted)return;await bW({storeApi:t,signal:i,prepare:a})}catch(c){console.error("[editor] fill poll failed; resuming",{err:c}),await new Promise(u=>setTimeout(u,$ie))}})(),()=>r.abort()},[t,n,e])}function Die(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 KO=new WeakMap;function Lie(e){let t=KO.get(e);return t||(t=new Set,KO.set(e,t)),t}function Iie(e,t){return`${e} ${t}`}function Uie(){const e=hr(),t=je(c=>c.session.pages),n=je(c=>c.session.canvases),r=je(c=>c.visitedCanvasIds),i=je(c=>c.page_renders),a=x.useMemo(()=>Au(n,r),[n,r]);x.useEffect(()=>{const c=Die(t,a,i);if(c.length===0)return;const u=e.getState(),{backend:f}=u,p=Lie(f),g=new Map(u.session.sections.map(m=>[m.instance_id,m]));for(const{pageId:m,instanceId:w}of c){const v=Iie(m,w);if(p.has(v))continue;const _=g.get(w),k=u.content_doc.instances.find(S=>S.instance_id===w);!_||!k||(p.add(v),f.render({section_key:_.section_key,slots:k.slots,nav:{selfAnchor:_.schema.anchor},page_id:m,instance_id:w}).then(({html:S})=>{So(e,f)&&e.getState().replaceSectionHtml(m,w,S,null)}).catch(S=>{So(e,f)&&(console.error("[editor] page section render failed",{pageId:m,instanceId:w,err:S}),e.getState().replaceSectionHtml(m,w,null,{code:"render_failed",message:"This section failed to render."}))}).finally(()=>{p.delete(v)}))}},[e,t,a,i])}function Pie({ports:e,slots:t,actions:n,guides:r=!1,beneath:i=!1}){return Mie(!i),Uie(),zie(e.api.getCropDerivativeUrl),h.jsx(NX,{ports:e,children:h.jsxs(T4,{children:[h.jsx(OW,{guides:r}),h.jsx(Aie,{slots:t,actions:n}),h.jsx(BW,{}),h.jsx(xQ,{})]})})}function X5(){const e=je(n=>n.saveState),t=je(n=>n.savedAt);return{state:e,savedAt:t}}function Fie(){return h.jsx(Rw,{status:X5()})}function Bie({children:e}){return h.jsx(Hp,{status:X5(),children:e})}const GO=12e4;function Hie(){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 qie(e,t){return{id:"fill-applied",rank:"status",hold:{kind:"condition",says:`${e}:${t??""}`},tone:"good",icon:h.jsx(Si,{size:15,strokeWidth:2.5}),headline:e}}function Vie(e,t){const[n]=x.useState(()=>Date.now()),[r,i]=x.useState(null);x.useEffect(()=>{if(e===null)return;const c=(t??Date.now())+GO-Date.now(),u=setTimeout(()=>i(e),Math.max(0,c));return()=>clearTimeout(u)},[e,t]);const a=t!==null&&n>=t+GO;return e!==null&&r!==e&&!a}function Zie(e,t){return{id:"fill-failed",rank:"fault",hold:{kind:"each",ids:t},tone:"danger",role:"alert",icon:h.jsx(ow,{size:15}),headline:`We couldn’t fill in the ${e} automatically.`}}const W5=x.createContext(null);function J5({backend:e,children:t}){return h.jsx(W5.Provider,{value:e,children:t})}function Sn(){const e=x.useContext(W5);if(e===null)throw new Error("useFactsBackend: a fact surface rendered outside FactsBackendProvider");return e}const im={home:"library"};function Kx(e){return{home:"property",propertyId:e}}function Kie(e,t){return e==="library"?im:Kx(t)}function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ih(e){return xr(e)&&typeof e.id=="string"?e.id:null}const yi=e=>e==null||e==="";function vo(e,t){return yi(e)||yi(t)?yi(e)&&yi(t):Array.isArray(e)||Array.isArray(t)?!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>vo(n,t[r])):xr(e)&&xr(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(n=>vo(e[n],t[n])):e===t}function Gx(e){return TA(e)}const e$=new Set(["image","video","tour","document","media"]),Gie=new Set(["text","number","select","url","email","phone","date"]);function wd(e){return e$.has(e.type)&&"from"in e&&e.from!==void 0}function sm(e){return e$.has(e.type)&&e.type!=="media"&&!wd(e)}function Oi(e){const t=xr(e)?e.media_id:void 0,n=typeof t=="string"?t:Qn(e);return n!==void 0&&n!==""?{media_id:n}:null}function Yx(e){const t=e.element;return t.type==="row"||wd(t)}function Yie(e){return Yx(e)||e.element.type==="object"}function As(e,t,n){var c,u;if(vo(t,n))return!0;if(sm(e)||wd(e))return(((c=Oi(t))==null?void 0:c.media_id)??null)===(((u=Oi(n))==null?void 0:u.media_id)??null);if(e.type==="object"){const f=xr(t)?t:{},p=xr(n)?n:{};return Object.entries(e.fields).every(([g,m])=>Gx(m)||As(m,f[g],p[g]))}if(e.type!=="list")return!1;const r=Array.isArray(t)?t:[],i=Array.isArray(n)?n:[];if(Yx(e))return vo(r.map(dn),i.map(dn));if(e.element.type!=="object")return vo(r.filter(f=>!yi(f)),i.filter(f=>!yi(f)));const a=e.element;return r.length===i.length&&r.every((f,p)=>As(a,f,i[p]))}function dn(e){if(typeof e=="string")return e;if(!xr(e))return null;const t=e.id??Qn(e);return typeof t=="string"?t:null}function fu(e,t){var r;const n=vC(e);return n!==null&&xr(t)?((r=Oi(t[n]))==null?void 0:r.media_id)??null:null}async function t$(e,t,n,r,i,a){var c;if(vo(r,i))return r;if(sm(t))return Qie(e,n,r,i);if(wd(t)){const u=Oi(i);return((c=Oi(r))==null?void 0:c.media_id)!==(u==null?void 0:u.media_id)&&await e.setValue(n,u),i}return t.type==="list"?Wie(e,t,n,r,i,a):t.type==="object"?n$(e,t,n,xr(r)?r:{},xr(i)?i:{},a):(await e.setValue(n,i??null),i)}async function Qie(e,t,n,r){var c,u;const i=((c=Oi(n))==null?void 0:c.media_id)??null,a=((u=Oi(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(Gx(f))continue;const p=await t$(e,f,`${n}.${u}`,r[u],i[u],a);p!==void 0&&(c[u]=p)}return c}function Xie(e,t){const n={};for(const[r,i]of Object.entries(e.fields))Gx(i)||i.type==="list"||sm(i)||yi(t[r])||(n[r]=wd(i)?Oi(t[r]):t[r]);return n}async function Wie(e,t,n,r,i,a){const c=Array.isArray(r)?r:[],u=Array.isArray(i)?i:[];if(Yx(t)){const C=u.map(dn).filter($=>$!==null),I=c.map(dn).filter($=>$!==null);return vo(I,C)||await e.setSelection(n,C,I),[...u]}const f=t.element;if(Gie.has(f.type)){const C=u.filter(I=>!yi(I));return vo(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=>ih(C)!==null?[[ih(C),C]]:[])),g=new Set(u.map(ih).filter(C=>C!==null&&p.has(C))),m=new Map;for(const[C,I]of p){const $=fu(f,I);!g.has(C)&&$!==null&&!m.has($)&&m.set($,C)}const w=u.map(C=>{const I=ih(C);if(I!==null&&p.has(I))return I;const $=fu(f,C),T=$!==null?m.get($):void 0;return T===void 0?null:(m.delete($),g.add(T),T)}),v=[...p.keys()].filter(C=>!g.has(C)&&a.has(C));for(const C of w.keys())w[C]??(w[C]=v.shift()??null);const _=new Set(w.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 $=xr(I)?I:{};let T=w[C]??null,F=T!==null?p.get(T)??{}:{};if(T===null){const W=Xie(f,$);T=(await e.addRow(n,W)).row_id,fu(f,W)!==null&&(S=!0),a.add(T),F=W}k.push({...await n$(e,f,`${n}.${T}`,F,$,a),id:T})}const E=[...p.keys()].filter(C=>_.has(C)),A=[...k.map(C=>C.id).filter(C=>!p.has(C)).reverse(),...E],R=k.map(C=>C.id);return(S&&R.length>1||!vo(A,R))&&await e.reorder(n,R),k}function up(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function r$(e){const t=Qn(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])=>sm(c)?[a]:[]);return i.length>0?[[t,i]]:[]})}function Jie(e,t){return o$(e).flatMap(([n,r])=>(Array.isArray(t[n])?t[n]:[]).flatMap(a=>!up(a)||typeof a.id!="string"?[]:r.flatMap(c=>{const u=a[c],f=r$(u);return f===null||up(u)&&typeof u.url=="string"&&u.url!==""?[]:[{path:`${n}.${a.id}.${c}`,mediaId:f,home:e.home}]})))}function ese(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(!up(p))return p;let g=p;for(const m of a){const w=p[m],v=n.get(r$(w)??"");v===void 0||!up(w)||w.url===v||(g={...g,[m]:{...w,url:v}},u=!0)}return g});u&&(r??(r={...t}),r[i]=f)}return r??t}function i$(e,t,n,r,i){return e.mediaUrl(Kie(t,n),r,i)}const s$=(e,t,n)=>["fact-media-url",e,t,n],a$=10*6e4;function tse(e,t,n,r=e){var c;const i=Sn();return((c=zn({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 nse(e,t,n){const r=Sn(),i=x.useMemo(()=>Jie(e,n),[e,n]),a=ON({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=x.useMemo(()=>{const u=new Map;return i.forEach((f,p)=>{const g=a[p];g!=null&&u.set(f.mediaId,g)}),u},[i,a]);return x.useMemo(()=>ese(e,n,c),[e,n,c])}function mo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function l$(e){const t=e.element;return t.type!=="object"?[]:Object.entries(t.fields).flatMap(([n,r])=>r.type==="list"?[[n,r]]:[])}function c$(e,t,n,r,i,a){if(!Array.isArray(i)||!Array.isArray(r))return{edited:n,stored:r};if(!Yie(e))return As(e,r,i)||!As(e,r,n)?{edited:n,stored:r}:{edited:i,stored:i};if(!Array.isArray(n))return{edited:n,stored:r};const c=e.element,u=new Map;for(const[_,k]of i.entries()){const S=dn(k);S!==null&&u.set(S,_)}const f=[...n],p=[];let g=!1;for(const _ of r){const k=dn(_),S=k===null?void 0:u.get(k);if(k===null||S===void 0&&a.minted.has(k)){p.push(_);continue}const E=f.findIndex(C=>dn(C)===k);if(S===void 0){if(g=!0,E<0||c.type==="object"&&!As(c,_,f[E]))continue;f.splice(E,1),a.forget(t,k);continue}const O=i[S];if(c.type!=="object"||E<0||!mo(_)||!mo(O)||!mo(f[E])){p.push(_);continue}const A=f[E],R=rse(c,`${t}.${k}`,A,_,O,a);(R.edited!==A||R.stored!==_)&&(g=!0),f[E]=R.edited,p.push(R.stored)}const m=new Set(p.map(dn));for(const _ of i){const k=dn(_);k!==null&&a.minted.has(k)&&!m.has(k)&&(p.push(_),g=!0)}const w=_=>u.get(dn(_)??"")??Number.MAX_SAFE_INTEGER,v=[...p].sort((_,k)=>w(_)-w(k));return v.some((_,k)=>_!==r[k])&&(g=!0),g?{edited:f,stored:v}:{edited:n,stored:r}}function rse(e,t,n,r,i,a){let c=n,u=r;for(const[f,p]of Object.entries(e.fields)){if(p.type==="list"){const g=c$(p,`${t}.${f}`,n[f],r[f],i[f],a);g.edited!==n[f]&&(c={...c,[f]:g.edited}),g.stored!==r[f]&&(u={...u,[f]:g.stored});continue}As(p,r[f],i[f])||!As(p,r[f],n[f])||(c={...c,[f]:i[f]},u={...u,[f]:i[f]})}return{edited:c,stored:u}}const ose=600,ise=2500,Al=e=>["property-facts",e],u$="library",Ps=["library-facts"];function ao(e){return e.home==="library"?Ps:Al(e.propertyId)}function sse(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,i)=>e.setSelection(t.propertyId,n,r,i):(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 as(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e.id;return typeof t=="string"?t:null}function YO(e){return Array.isArray(e)?e.map(dn).filter(t=>t!==null):[]}function ase(e,t){return Array.isArray(e)?e.filter(n=>{const r=dn(n);return r!==null&&!t.has(r)}):[]}const lse="not_found";function Hv(e,t,n,r){if(!Array.isArray(n))return;const i=l$(t);for(const a of n){const c=dn(a);if(c!==null&&(r(e).add(c),!!mo(a)))for(const[u,f]of i)Hv(`${e}.${c}.${u}`,f,a[u],r)}}function qv(e,t,n){return e.map((r,i)=>i===t?n:r)}function cse(e,t,n){const r=fu(e.element,n),i=dn(n);if(r===null||i===null)return null;const a=t.findIndex(c=>mo(c)&&as(c)===null&&fu(e.element,c)===r);return a<0?null:qv(t,a,{...t[a],id:i})}function d$(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[...YO(n),...YO(r),...c])u.add(v);const f=ase(i,u);let p=Array.isArray(n)?n:[],g=Array.isArray(r)?r:void 0,m=!1;for(const v of f)p=cse(t,p,v)??[...p,v],g!==void 0&&(g=[...g,v]),m=!0;const w=l$(t);if(w.length>0)for(const v of i){const _=dn(v);if(_===null||!mo(v))continue;const k=p.findIndex(E=>dn(E)===_),S=(g==null?void 0:g.findIndex(E=>dn(E)===_))??-1;for(const[E,O]of w){const A=p[k];if(!mo(A))break;const R=g==null?void 0:g[S],C=d$(`${e}.${_}.${E}`,O,A[E],mo(R)?R[E]:void 0,v[E],a,c);C.changed&&(p=qv(p,k,{...A,[E]:C.edited}),g!==void 0&&mo(R)&&(g=qv(g,S,{...R,[E]:C.stored})),m=!0)}}return m?{edited:p,stored:g??r,changed:m}:{edited:n,stored:r,changed:m}}function am(e,t,{enabled:n,onSaveBegin:r,poll:i=!1}){var Le;const a=No(),c=Sn(),u=x.useCallback(ne=>e.home==="library"?{home:"library"}:{home:"property",propertyId:ne},[e.home]),f=x.useCallback(ne=>sse(c,u(ne)),[c,u]),p=zn({queryKey:ao(u(t??"")),queryFn:()=>f(t??"").read(),enabled:n&&t!==null,refetchInterval:i?ise:!1}),[g,m]=x.useState({}),[w,v]=x.useState({}),[_,k]=x.useState({}),S=x.useRef({}),E=x.useRef({}),O=x.useRef({}),A=x.useRef(new Set),R=x.useRef(new Set),C=x.useRef(new Set),I=x.useRef(new Map),$=x.useRef(new Map),T=x.useRef(0),F=x.useRef({}),W=x.useRef(new WeakMap),G=x.useRef({propertyId:t,onSaveBegin:r});x.useEffect(()=>{G.current={propertyId:t,onSaveBegin:r}});const H=x.useCallback(ne=>{var be;return(be=O.current)[ne]??(be[ne]=new Set),O.current[ne]},[]),U=ml(ao(u(t??"")));x.useEffect(()=>{let ne=null;return a.getQueryCache().subscribe(be=>{if(!(be.type!=="updated"||be.query.queryHash!==U)){if(be.action.type==="fetch")ne={at:++T.current,saving:new Set(C.current)};else if(be.action.type==="success"&&!be.action.manual&&ne!==null){const Re=be.action.data;typeof Re=="object"&&Re!==null&&W.current.set(Re,ne),ne=null}}})},[a,U]);const z=x.useCallback((ne,be)=>{const Re=be===void 0?void 0:W.current.get(be);return Re!==void 0&&!Re.saving.has(ne)&&Re.at>(F.current[ne]??0)},[]),K=x.useCallback(ne=>{F.current[ne]=++T.current},[]),N=x.useCallback(ne=>{const be=Object.hasOwn(e.pages,ne)?e.pages[ne]:void 0;return(be==null?void 0:be.declaration.type)==="list"?be.declaration:void 0},[e]),B=x.useCallback((ne,be)=>{const Re=N(ne);if(Re===void 0)return;const Pe=Object.hasOwn(S.current,ne)?S.current[ne]:void 0;if(Pe!==void 0&&Array.isArray(be)){const ht=Object.hasOwn(E.current,ne)?E.current[ne]:void 0,Ke=d$(ne,Re,Pe,ht,be,H,A.current);Ke.changed&&(S.current={...S.current,[ne]:Ke.edited},ht!==void 0&&(E.current[ne]=Ke.stored),m(S.current))}Hv(ne,Re,be,H)},[N,H]),Y=x.useCallback((ne,be)=>{const Re=N(ne);if(Re===void 0||!Object.hasOwn(S.current,ne)||!Object.hasOwn(E.current,ne))return;const Pe=S.current[ne],ht=c$(Re,ne,Pe,E.current[ne],be,{minted:A.current,forget:(Ke,En)=>{var ct;return(ct=O.current[Ke])==null?void 0:ct.delete(En)}});E.current[ne]=ht.stored,ht.edited!==Pe&&(S.current={...S.current,[ne]:ht.edited},m(S.current))},[N]),ie=x.useCallback((ne,be,Re)=>{B(ne,be.facts[ne]),Re&&Y(ne,be.facts[ne])},[B,Y]),J=x.useCallback(async(ne,be)=>{const Re=ao(u(be));await a.cancelQueries({queryKey:Re,exact:!0});const Pe=await a.fetchQuery({queryKey:Re,queryFn:()=>f(be).read(),staleTime:0});return B(ne,Pe.facts[ne]),Object.hasOwn(E.current,ne)?Y(ne,Pe.facts[ne]):E.current[ne]=Pe.facts[ne],Pe},[a,u,f,B,Y]);x.useEffect(()=>{const ne=p.data;if(ne!==void 0)for(const be of Object.keys(e.pages))C.current.has(be)||ie(be,ne,z(be,ne))},[p.data,e,ie,z]);const L=x.useCallback((ne,be)=>{const Re=async()=>{var Jn,Nt,ke;const Ke=be??G.current.propertyId,En=Object.hasOwn(e.pages,ne)?e.pages[ne]:void 0;if(Ke===null||En===void 0||!R.current.has(ne))return;const ct=(Nt=(Jn=G.current).onSaveBegin)==null?void 0:Nt.call(Jn);C.current.add(ne);const Wn=async({facts:Ce})=>{const Ve=S.current[ne],it=Object.hasOwn(E.current,ne)?E.current[ne]:Ce[ne];return E.current[ne]=await t$(f(Ke).writer,En.declaration,ne,it,Ve,A.current),Ve};try{const Ce=await a.ensureQueryData({queryKey:ao(u(Ke)),queryFn:()=>f(Ke).read()});ie(ne,Ce,z(ne,Ce));let Ve;try{Ve=await Wn(Ce)}catch(Ye){if(c.refusalCode(Ye)!==lse)throw Ye;Ve=await Wn(await J(ne,Ke))}const it=N(ne);if(it!==void 0&&Hv(ne,it,E.current[ne],H),S.current[ne]===Ve){R.current.delete(ne);const Ye=Array.isArray(E.current[ne])?E.current[ne].map(as):[];k(Mt=>({...Mt,[ne]:Ye}))}v(Ye=>Ye[ne]?{...Ye,[ne]:!1}:Ye),e.home==="library"&&a.invalidateQueries({queryKey:Ps}),ct==null||ct(!0)}catch(Ce){throw v(Ve=>({...Ve,[ne]:!0})),ct==null||ct(!1),await J(ne,Ke).catch(()=>{}),Ce}finally{C.current.delete(ne),K(ne);const Ce=(ke=a.getQueryData(ao(u(Ke))))==null?void 0:ke.facts;Ce!==void 0&&B(ne,Ce[ne])}},ht=($.current.get(ne)??Promise.resolve()).then(Re);return $.current.set(ne,ht.catch(()=>{})),ht},[a,e,u,f,c,B,ie,z,K,J,N,H]),Q=x.useCallback(ne=>{const be=I.current.get(ne);be!==void 0&&clearTimeout(be),I.current.delete(ne)},[]),D=x.useCallback((ne,be)=>{var Re;if(N(ne)!==void 0&&!Object.hasOwn(E.current,ne)&&G.current.propertyId!==null){const Pe=(Re=a.getQueryData(ao(u(G.current.propertyId))))==null?void 0:Re.facts;Pe!==void 0&&Object.hasOwn(Pe,ne)&&(E.current[ne]=Pe[ne])}S.current={...S.current,[ne]:be},R.current.add(ne),m(S.current),k(Pe=>{if(!Object.hasOwn(Pe,ne))return Pe;const{[ne]:ht,...Ke}=Pe;return Ke}),Q(ne),I.current.set(ne,setTimeout(()=>{I.current.delete(ne),L(ne).catch(()=>{})},ose))},[Q,L,a,u,N]),Z=x.useCallback((ne,be)=>(Q(ne),L(ne,be)),[Q,L]),te=x.useCallback(async ne=>{await Promise.all([...R.current].map(be=>Z(be,ne)))},[Z]),de=x.useRef(te);x.useEffect(()=>{de.current=te}),x.useEffect(()=>()=>{de.current().catch(()=>{})},[]);const fe=x.useCallback(ne=>({failed:w[ne]===!0,retry:()=>{L(ne).catch(()=>{})}}),[w,L]),pe=(Le=p.data)==null?void 0:Le.facts,P=x.useMemo(()=>({...pe,...g}),[pe,g]),ce=nse(e,t,P),me=x.useCallback(({key:ne,index:be})=>{var Pe;const Re=ce[ne];return((Pe=_[ne])==null?void 0:Pe[be])??(Array.isArray(Re)?as(Re[be]):null)},[ce,_]),Se=x.useCallback(async({key:ne,index:be})=>{var ht;await Z(ne);const Re=Object.hasOwn(S.current,ne)?S.current[ne]:void 0;if(Re===void 0){const Ke=(ht=a.getQueryData(ao(u(G.current.propertyId??""))))==null?void 0:ht.facts[ne];return Array.isArray(Ke)?as(Ke[be]):null}const Pe=E.current[ne];return(Array.isArray(Pe)?as(Pe[be]):null)??(Array.isArray(Re)?as(Re[be]):null)},[Z,a,u]),$e=x.useCallback(async(ne,be,Re)=>{const Pe=await Se(ne),ht=G.current.propertyId;if(Pe===null||ht===null)throw new Error(`use-facts-draft: ${ne.key} row ${ne.index} is not stored, so nothing can own media in it`);return f(ht).stage(`${ne.key}.${Pe}.${be}`,Re)},[Se,f]),Ie=x.useCallback(async({key:ne,index:be})=>{var Jn;const Re=G.current.propertyId,Pe=await Se({key:ne,index:be}),ht=()=>{var Nt;return Object.hasOwn(S.current,ne)?S.current[ne]:(Nt=a.getQueryData(ao(u(Re??""))))==null?void 0:Nt.facts[ne]},Ke=ht(),En=Array.isArray(Ke)?Ke:[],ct=En[be];if(S.current={...S.current,[ne]:En.filter((Nt,ke)=>ke!==be)},m(S.current),Pe===null||Re===null)return;try{await f(Re).writer.removeRow(`${ne}.${Pe}`),K(ne)}catch(Nt){const ke=ht(),Ce=Array.isArray(ke)?[...ke]:[];throw Ce.splice(Math.min(be,Ce.length),0,ct),S.current={...S.current,[ne]:Ce},m(S.current),Nt}const Wn=Object.hasOwn(E.current,ne)?E.current[ne]:(Jn=a.getQueryData(ao(u(Re))))==null?void 0:Jn.facts[ne];Array.isArray(Wn)&&(E.current[ne]=Wn.filter(Nt=>as(Nt)!==Pe)),k(Nt=>{if(!Object.hasOwn(Nt,ne))return Nt;const{[ne]:ke,...Ce}=Nt;return Ce}),e.home==="library"&&a.invalidateQueries({queryKey:Ps})},[Se,a,u,f,e,K]),xe=x.useCallback(()=>void p.refetch(),[p]);return{facts:ce,ready:pe!==void 0,readFailed:p.isError&&pe===void 0,retryRead:xe,set:D,saveState:fe,flush:te,rowId:me,storedRowId:Se,stageMedia:$e,removeRow:Ie}}function QO(e,t){const n=e==null?void 0:e[t];return Array.isArray(n)?n:[]}function Qx(e){const t=je(g=>g.session.property_id),n=Sn(),r=e.some(g=>bi(g)==="library"),i=e.some(g=>bi(g)==="property"),a=zn({queryKey:Al(t),queryFn:()=>n.read(Kx(t)),enabled:i}),c=zn({queryKey:Ps,queryFn:()=>n.read(im),enabled:r}),u=g=>{var m,w;return bi(g)==="library"?(m=c.data)==null?void 0:m.facts:(w=a.data)==null?void 0:w.facts},f=Object.fromEntries(y0().map(g=>[g,QO(u(g),g)]));return{rows:cC(f,e),rowOf:({id:g,table:m})=>{const w=QO(u(m),m),v=w.findIndex(_=>_.id===g);return v<0?void 0:{row:w[v],index:v}},pending:i&&a.isPending||r&&c.isPending}}const f$={contacts:_r.pages.contacts.declaration,units:dt.pages.units.declaration,comparables:dt.pages.comparables.declaration,commercial_spaces:dt.pages.commercial_spaces.declaration},Xx=e=>Ir(f$[e].label).singular;function h$({tables:e,rowId:t,size:n}){return t===null?h.jsxs(go,{size:n,children:["No ",Xx(e[0])," chosen"]}):h.jsx(use,{tables:e,rowId:t,size:n})}function use({tables:e,rowId:t,size:n}){const r=je(g=>g.session.property_id),{rows:i,rowOf:a,pending:c}=Qx(e),u=i.find(g=>g.id===t),f=u===void 0?void 0:a(u);if(c)return h.jsx(go,{size:n,children:"Loading…"});if(u===void 0||f===void 0)return h.jsxs(go,{size:n,children:[td(Xx(e[0]))," not found"]});const p=u.table;return h.jsx(p$,{table:p,row:f.row,index:f.index,size:n,homeId:p==="contacts"?"library":r})}function dse({rowId:e,size:t}){var c;const n=Sn(),r=zn({queryKey:Ps,queryFn:()=>n.read(im)}),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(go,{size:t,children:"Loading…"}):a<0?h.jsx(go,{size:t,children:"Contact not found"}):h.jsx(p$,{table:"contacts",row:i[a],index:a,size:t,homeId:"library"})}function p$({table:e,row:t,index:n,size:r,homeId:i}){var g,m;const a=eK(f$[e],t,`${td(Xx(e))} ${n+1}`),c=(g=a.image)==null?void 0:g.value,u=typeof c=="object"&&c!==null&&typeof c.url=="string"?c.url:"",f=a.image===null||u!==""?null:Qn(c)??null,p=tse(e==="contacts"?"library":"property",`${e}.${String(t.id)}.${((m=a.image)==null?void 0:m.field)??""}`,f,i);return h.jsx(gh,{face:a,imageUrl:u!==""?u:p,size:r})}const m$=x.createContext(null);function fse(e){const t=x.useContext(m$);if(!t)throw new Error("fact-page-ports: an expanded face rendered outside FactPagePorts");return e(t)}const g$=x.createContext(null);function hse(e){const t=x.useContext(g$),{PinMap:n}=Sn().address;return h.jsx(n,{...e,postal:e.postal??t})}function pse(e){const{useMediaListHost:t}=Sn();return h.jsx(dR,{...e,useHost:t})}function mse({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(go,{size:n,children:"No contact chosen"}):h.jsx(dse,{rowId:t,size:n})}const gse={useEditorStore:fse,capabilities:{framingCrop:!1},MediaPicker:pse,TableRowSummary:mse},ub=()=>{};function yse(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 hu({propertyId:e,listingIntent:t,stageMedia:n,nearPostal:r=null,tablePicker:i,tableCreate:a,marks:c,isMediaProcessing:u,cropFailedAt:f,children:p}){const g=c==null?void 0:c.markFor,{api:m,address:w}=Sn(),v=x.useMemo(()=>({session:{property_id:e,listing_intent:t},select:ub,markSlotOverridden:ub,relinkSlot:ub}),[e,t]),_=x.useMemo(()=>({...gse,api:m,address:{Input:w.Input,PinMap:hse},...n?{ownedUpload:yse(n)}:{},...i?{TablePicker:i}:{},...a?{TableCreate:a}:{},...g?{fillMark:g}:{},...u?{isMediaProcessing:u}:{},...f?{cropFailedAt:f}:{}}),[m,w,n,i,a,g,u,f]);return h.jsx(m$.Provider,{value:v,children:h.jsx(g$.Provider,{value:r,children:h.jsx(KN,{ports:_,children:p})})})}function y$(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 jT(`${t.home}.${n}`,r.used,r.required);const i=Object.hasOwn(t.pages,n)?t.pages[n]:void 0,a=i===void 0?null:Ln(i.declaration);return px(a??{fields:{}})}function b$(e){const{requirements:t}=Sn(),n=zn({queryKey:t.queryKey(e??""),queryFn:()=>t.read(e??""),enabled:e!==null&&e!==""});return{answer:n.data,failed:n.isError,retry:()=>void n.refetch()}}function v$(e){return b$(e).answer}function w$(e){const t=sR(e);return{table:t.at(-1).lists[0],title:t[0].label,landsIn:t.slice(0,-1).map(({lists:r})=>r[0])}}function Wx(e){const t=e.join(`
|
|
1332
|
+
`);return x.useMemo(()=>w$(t.split(`
|
|
1333
|
+
`)),[t])}function db(e){const{home:t,key:n}=_o(e);if(t!=="property")throw new Error(`A row lands on the picking property; "${e}" is no property list.`);return n}const bse=e=>{const t=typeof e=="object"&&e!==null?e.id:void 0;return typeof t=="string"?t:null};function lm({propertyId:e,lists:t,onSaveBegin:n}){const r=am(dt,e,{enabled:t.length>0,onSaveBegin:n}),[i,a]=x.useState(null),[c,u]=x.useState(()=>new Set),f=_=>{const k=r.facts[_];return Array.isArray(k)?k:[]},p=_=>f(_).flatMap(k=>bse(k)??[]),[g,m]=x.useState(null);if(g===null&&r.ready&&t.length>0){const _=[...new Set(t.flatMap(k=>p(db(k))))];m({ordered:_,holder:new Set(p(db(t[0])))})}return{tiers:x.useMemo(()=>g===null?null:{ordered:g.ordered,holder:new Set([...g.holder,...c])},[g,c]),land:async(_,k)=>{a(null);const S=t.map(db).filter(E=>!p(E).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 E of S)r.set(E,[k,...f(E)]);return await r.flush(),u(E=>new Set([...E,_])),!0},refusal:i,setRefusal:a}}function vse(e,t){const n=e.pages[t];return n!==void 0&&Ep(n)&&Zv(n.declaration)?[t]:[]}function Vv(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}function wse(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 xse(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=>j0(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 B5({value:c},"value")}function Zv(e){const t=e;return t.source!==void 0||Array.isArray(t.process)&&t.process.length>0?!0:e.type==="list"?Zv(e.element):e.type==="object"?Object.values(e.fields).some(Zv):!1}const dp="Filled in from your uploads",kse="Picked from your uploads";function _se(e){if(e===null)return null;switch(e.verb){case"pick":return kse;case"write":case"find":return dp}}const Sse={forPage:()=>null,markFor:()=>null,noteUserEdit:()=>{},isMediaProcessing:()=>!1,cropFailedAt:()=>null},Ese=2500,jse=1e4,Ose={comparables:Al,contacts:Al},XO=e=>["fill-status",e],WO=new Map;function Ase(e){let t=WO.get(e);return t===void 0&&(t=new Set(vse(dt,e)),WO.set(e,t)),t}function cm(e){const t=No(),n=Sn(),r=zn({queryKey:XO(e??""),queryFn:async()=>{const w=e,v=t.getQueryData(XO(w)),_=await n.fillStatus(w);return w!==u$&&await Cse(t,w,v,_),_},enabled:!!e,refetchInterval:w=>{const v=w.state.data;return(v==null?void 0:v.evaluating)===!0||Object.values((v==null?void 0:v.paths)??{}).some(k=>k.pending)?Ese:jse}}),[i,a]=x.useState(()=>new Set),c=x.useCallback(w=>{a(v=>v.has(w)?v:new Set(v).add(w))},[]),u=x.useCallback((w,v)=>v.owner!=="job"||v.absent||i.has(Vv(w))?null:_se(v.fill??null),[i]),f=x.useCallback(w=>{var k;const v=Ase(w),_=Object.entries(((k=r.data)==null?void 0:k.paths)??{}).filter(([S])=>v.has(Vv(S))).sort(([S],[E])=>S<E?-1:S>E?1:0);return _.length===0?null:Nse(w,_,i.has(w),u)},[r.data,i,u]),p=x.useCallback(w=>{var _;const v=(_=r.data)==null?void 0:_.paths[w];return v===void 0?null:u(w,v)},[r.data,u]),g=x.useCallback((w,v)=>{var _,k;return(((k=(_=r.data)==null?void 0:_.paths[w])==null?void 0:k.processing)??[]).includes(v)},[r.data]),m=x.useCallback((w,v)=>{var _;return SM(((_=r.data)==null?void 0:_.failed_crops)??[],w,v)},[r.data]);return e?{forPage:f,markFor:p,noteUserEdit:c,isMediaProcessing:g,cropFailedAt:m}:Sse}function JO(e,t){return Object.entries(e.paths).filter(([n])=>Vv(n)===t)}async function Cse(e,t,n,r){if(n===void 0)return;const i=Object.entries(Ose).filter(([a])=>{const c=JO(r,a);return c.some(([,u])=>u.pending)?!1:JSON.stringify(c)!==JSON.stringify(JO(n,a))}).map(([,a])=>e.refetchQueries({queryKey:a(t),exact:!0,type:"active"}));await Promise.all(i)}function Nse(e,t,n,r){const i=t.filter(([,g])=>g.pending).map(([g])=>g),a=t.filter(([,g])=>g.failed).map(([g])=>g),c=t.filter(([,g])=>g.owner==="job"&&!g.absent),u=!n&&c.length>0,f=new Set(c.map(([g,m])=>r(g,m)??dp)),p=c.flatMap(([,g])=>{const m=Date.parse(g.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]:dp:null,filledAt:u&&p.length>0?Math.max(...p):null}}function pu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Kv(e){return pu(e)?Object.entries(e).every(([t,n])=>t==="id"||n==null||n===""||(Array.isArray(n)?n.length===0:pu(n)&&Kv(n))):!0}function Mse(e,t){const n=e.findIndex((r,i)=>t[i]!==r);return n<0?e.length-1:n}function Rse(e,t){const n=_o(e);return n.home==="library"?{registry:_r,homeId:u$,key:n.key}:{registry:dt,homeId:t,key:n.key}}function $u({from:e,selection:t,record:n,create:r,propertyId:i,onSaveBegin:a,tiers:c}){const{registry:u,homeId:f,key:p}=Rse(e,i),{refusalCode:g}=Sn(),m=am(u,f,{enabled:!0,onSaveBegin:a}),{isMediaProcessing:w,cropFailedAt:v}=cm(f===""?null:f),_=y$(v$(i),u,p),[k,S]=x.useState(null),E=u.pages,O=Object.hasOwn(E,p)?E[p]:void 0,A=m.facts[p],R=Array.isArray(A)?A:[],[C,I]=x.useState(null),$=R.map((pe,P)=>m.rowId({key:p,index:P})),[T,F]=x.useState(null);T===null&&c!==void 0&&m.ready&&F(new Set($.flatMap(pe=>pe??[])));const W=c===void 0||T===null?R.map((pe,P)=>P):Tse($,c.ordered,T),G=W.map(pe=>R[pe]),H=c===void 0||T===null?void 0:new Set($.flatMap(pe=>pe!==null&&T.has(pe)&&!c.holder.has(pe)?[pe]:[])),U=x.useRef({rows:R,selection:t,draft:m});x.useEffect(()=>{U.current={rows:R,selection:t,draft:m}});const z=n===void 0?-1:W.findIndex(pe=>m.rowId({key:p,index:pe})===n.rowId),K=n!==void 0&&m.ready&&z<0;x.useEffect(()=>{K&&n.onClose()},[K,n]);const N=x.useRef(!1),[B,Y]=x.useState(!1),ie=r!==void 0,J=m.ready;x.useEffect(()=>{if(!ie||!J||N.current)return;const{rows:pe,draft:P}=U.current;N.current=!0,P.set(p,[{},...pe]),I(0)},[ie,J,p]);const L=()=>{const pe=new Map;return U.current.rows.forEach((P,ce)=>{const me=U.current.draft.rowId({key:p,index:ce});me!==null&&pu(P)&&pe.set(me,{...P,id:me})}),pe};if(O===void 0)return null;const Q=O.declaration,D=Ir(Q.label).singular,Z=t&&{ids:t.ids,control:t.control,idKey:"id",rowId:(pe,P)=>{const ce=W[P];return ce===void 0?null:m.rowId({key:p,index:ce})},held:t.held,...H!==void 0?{upstream:H}:{},onChange:pe=>t.onChange(pe,L())},te=(pe,P)=>{if(S(null),P!=="remove"){if(c===void 0){m.set(p,pe);return}if(pe.length>W.length){const Se=new Set(G);m.set(p,[...pe.filter($e=>!Se.has($e)),...R]);return}const me=[...R];W.forEach((Se,$e)=>{me[Se]=pe[$e]}),m.set(p,me);return}const ce=W[Mse(G,pe)];ce!==void 0&&m.removeRow({key:p,index:ce}).catch(me=>{S(g(me)==="row_picked"?`This ${D} is on a property, so it stays in your library. Take it off every property first.`:`Couldn’t remove this ${D}. Try again.`)})},de=pe=>{const P=W[pe];if(P!==void 0){if(Kv(U.current.rows[P])){m.removeRow({key:p,index:P}).catch(ce=>{console.error("[intake] a blank new row was not discarded",{from:e,error:ce})});return}(t==null?void 0:t.pickAdded)===!0&&m.storedRowId({key:p,index:P}).then(ce=>{const me=U.current.selection;if(me===void 0||ce===null||me.ids.includes(ce))return;const Se=L(),$e=U.current.rows[P];!Se.has(ce)&&pu($e)&&Se.set(ce,{...$e,id:ce}),me.onChange([ce,...me.ids],Se)})}},fe=m.saveState(p);if(r!==void 0){if(C===null||B)return null;const pe=()=>{Y(!0);const P=C;(async()=>{const me=U.current.rows[P];if(Kv(me)){await m.removeRow({key:p,index:P});return}const Se=await m.storedRowId({key:p,index:P});Se!==null&&pu(me)&&await r.onCreated(Se,{...me,id:Se})})().catch(me=>console.error("[intake] a new row was not added",{from:e,error:me})).finally(r.onClose)};return h.jsx(hu,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:w,cropFailedAt:v,children:h.jsx(cu,{slot:Q,value:G,onChange:te,propertyId:i,instanceId:`facts:${u.home}`,slotId:p,factPath:p,fields:_,record:{index:C,onClose:pe,added:!0}})})}return n!==void 0?z<0?null:h.jsx(hu,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:w,cropFailedAt:v,children:h.jsx(cu,{slot:Q,value:G,onChange:te,propertyId:i,instanceId:`facts:${u.home}`,slotId:p,factPath:p,fields:_,record:{index:z,onClose:n.onClose}})}):h.jsx(hu,{propertyId:i,listingIntent:null,stageMedia:m.stageMedia,isMediaProcessing:w,cropFailedAt:v,children:h.jsxs("div",{className:"flex flex-col gap-[12px]","data-from-table":e,children:[h.jsx(cu,{slot:Q,value:G,onChange:te,onRecordAdded:de,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}),fe.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 ${Mi(O).toLowerCase()}.`}),h.jsx("button",{type:"button",onClick:fe.retry,className:"cursor-pointer font-medium underline underline-offset-2",children:"Retry"})]})]})})}function Tse(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 Jx(e){return _L(e)}function $se(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 zse(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 Dse({propertyId:e,onSaveBegin:t,...n}){const{tables:r,onClose:i}=n,[a]=r,c=Wx([Jx(a)]),u=lm({propertyId:e,lists:c.landsIn,onSaveBegin:t}),f=$se(n),p=c.landsIn.length>0;return h.jsxs(Tw,{onClose:i,title:c.title,children:[p&&u.tiers===null?h.jsx("div",{className:Bl,"aria-hidden":"true"}):h.jsx($u,{from:c.table,propertyId:e,onSaveBegin:t,selection:p?zse(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 e1=x.createContext(void 0);function Lse({onSaveBegin:e,children:t}){return h.jsx(e1.Provider,{value:e,children:t})}function Ise({tables:e,onCreated:t,onClose:n}){const r=xi(f=>f.session.property_id),i=x.useContext(e1),[a]=e,c=Wx([Jx(a)]),u=lm({propertyId:r,lists:c.landsIn,onSaveBegin:i});return h.jsx($u,{from:c.table,propertyId:r,onSaveBegin:i,create:{onCreated:async(f,p)=>{await u.land(f,p)&&t(f,p)},onClose:n}})}function Use(e){const t=xi(r=>r.session.property_id),n=x.useContext(e1);if(!e.open)return null;if(e.mode==="record"){const[r]=e.tables;return h.jsx($u,{from:Jx(r),propertyId:t,onSaveBegin:n,record:{rowId:e.rowId,onClose:e.onClose}})}return h.jsx(Dse,{...e,propertyId:t,onSaveBegin:n})}function x$(e,t,n){return`${e}:${t??"new"}:${n}`}function k$({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,g=p!==void 0&&u!==null?Hse(e,p,n,u):null,m=(g==null?void 0:g.filled)??null,w=Vie(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?Bse(c):Fse(p,r):null;return[...v?[{...gJ("refused",v.headline),onDismiss:a}]:[],...f!=null&&f.failed?[Pse(f.retry)]:[],...g!==null&&g.failed.length>0?[Zie(t1(g.failed),g.failedPaths)]:[],...g!=null&&g.pending?[Hie()]:[],...m!==null&&w?[qie(m.mark,m.filledAt)]:[]]}function Pse(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 Fse(e,t){const n=t.missing.filter(r=>Vse(r)!==null);return n.length>0?{headline:`Add the ${t1(S$(n))} to continue.`}:{headline:`${Gse(e)} to continue.`}}function Bse(e){return e.length===0?null:{headline:`Complete the ${t1(S$(e))} to generate.`}}function Hse(e,t,n,r){const i=eA(e,r.pendingPaths).length>0,a=r.failedPaths.filter(f=>xse(e,n,f)),c=eA(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??dp,filledAt:r.filledAt??null}:null}}function eA(e,t){const n=t.map(r=>wse(e,r));return[...new Set(n.filter(r=>r!==null))]}const _$=/^([a-z]+)\.([a-z_]+)(\[0?\])?(?:\.([a-z_]+))?$/,qse={property:dt,library:_r};function Vse(e){var t;return((t=_$.exec(e))==null?void 0:t[4])??null}const Zse={street:"Street address",city:"City",state:"State",postal:"ZIP",pin:"Map pin"};function Kse(e){var g,m;const t=_$.exec(e);if(t===null)return e;const[,n,r,i,a]=t,c=qse[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 Mi(u);if(i===void 0)return Zse[a==="latitude"||a==="longitude"?"pin":a]??a;const f=(m=(g=F5(c).facts.find(w=>w.key===r))==null?void 0:g.fields.find(w=>w.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 S$(e){return[...new Set(e.map(Kse))]}function Gse(e){const{declaration:t}=e,n=j$(Mi(e));return t.type==="list"?`Add ${n}`:t.type==="select"?`Choose the ${n}`:`Add the ${n}`}const fb=4;function t1(e){return E$(e.map(j$))}function E$(e){const t=e.length>fb?[...e.slice(0,fb-1),`${e.length-(fb-1)} more`]:e,n=t.at(-1)??"";return t.length>1?`${t.slice(0,-1).join(", ")} and ${n}`:n}function j$(e){const t=e.charAt(1);return t!==""&&t===t.toUpperCase()&&t!==t.toLowerCase()?e:e.charAt(0).toLowerCase()+e.slice(1)}function Yse(e){return e.flatMap(t=>{if(gn(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 Qse(e){return`We can’t read ${E$(e)}, please upload ${e.length===1?"a new copy":"new copies"}.`}function Xse(e){const t=Yse(e);return t.length===0?null:{id:"unread-files",rank:"fault",hold:{kind:"condition",says:JSON.stringify([...t].sort())},tone:"danger",role:"alert",headline:Qse(t)}}function Wse(e){return{kinds:Eo,from:[`property.${e}`]}}const Jse={mode:"all"};function eae({propertyId:e,path:t,noticeSurface:n,notices:r}){const i=x.useMemo(()=>Wse(t),[t]),{useMediaListHost:a}=Sn(),c=a(e,i),{cropFailedAt:u}=cm(e),f=Xse(c.items);return h.jsxs(h.Fragment,{children:[h.jsx(Ls,{surface:n,notices:f===null?r:[...r,f]}),h.jsx(iR,{filter:i,selection:Jse,host:{...c,cropFailedAt:u}})]})}function tae(e,t,n=dt,r){if(e.length===0)return[];const i=n.home==="property"?_r:dt;return Ioe(e,{[n.home]:t,...r===void 0?{}:{[i.home]:r}},[n,i])}function nae(e,t=dt){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"&&O0(i.element)!==null})}function O$(e,t,n=dt,r){return e===void 0?{missing:[]}:{missing:tae(e.required,t,n,r)}}const rae={};function oae(e,t=dt){var a;const n=t.home==="property"&&nae(e,t),r=Sn(),i=zn({queryKey:Ps,queryFn:()=>r.read(im),enabled:n});if(n)return((a=i.data)==null?void 0:a.facts)??rae}function iae(e){return e.type==="list"&&IC(e,"expanded","home").view==="media-manager"}const sae=()=>{};function aae({registry:e,pageKey:t,facts:n,answer:r,onChange:i,propertyId:a,noticeHost:c,hostNotices:u=[],refused:f=!1,onDismissRefusal:p=sae,generateMissing:g,autofill:m=null,marks:w,isMediaProcessing:v,cropFailedAt:_,save:k=null,stageMedia:S,onLibrarySaveBegin:E}){var F;const O=oae((r==null?void 0:r.required)??[],e),A=k$({registry:e,pageKey:t,facts:n,answer:O$(r,n,e,O),refused:f,onDismissRefusal:p,generateMissing:g,autofill:m,save:k}),R=Object.hasOwn(e.pages,t)?e.pages[t]:void 0;if(R===void 0)return null;const C=n[t],I=n.listing_intent,$=x$(c,a,t),T=[...A,...u];return h.jsx("div",{className:"flex flex-col gap-[12px]","data-fact-page":t,children:iae(R.declaration)?h.jsx(eae,{propertyId:a,path:t,noticeSurface:$,notices:T}):h.jsxs(Lse,{onSaveBegin:E,children:[h.jsx(Ls,{surface:$,notices:T}),h.jsx(hu,{propertyId:a??"",listingIntent:I==="for_sale"||I==="for_rent"?I:null,stageMedia:S,nearPostal:((F=tn(n.address))==null?void 0:F.postal)??null,tablePicker:Use,tableCreate:Ise,marks:w,isMediaProcessing:v,cropFailedAt:_,children:h.jsx(SV,{factPath:t,fields:r===void 0?null:jT(`${e.home}.${t}`,r.used,r.required),children:h.jsx(lae,{declaration:R.declaration,required:r!==void 0&&r.required.length>0,label:Mi(R),slotId:t,instanceId:`facts:${e.home}`,value:C,facts:n,onChange:i,propertyId:a??""})})})]})})}function A$(e,t,n){if(e.type!=="list")return{label:t,...e};const{max:r,...i}=e,a=LT(e,n);return{label:t,...i,...a!==null?{max:a}:{}}}function lae({declaration:e,required:t,label:n,slotId:r,instanceId:i,value:a,facts:c,onChange:u,propertyId:f}){const p=A$(e,n,c),g=e.type==="list"&&LG(e,c)?Ln(p):null;return h.jsx(ud,{place:"page",children:g?h.jsx(ZG,{object:g,rows:Array.isArray(a)?a:[],onChange:u,propertyId:f,instanceId:i,slotId:r,factPath:r}):h.jsx(ql,{slot:p,instanceId:i,slotId:r,value:a,onChange:u,required:t,propertyId:f,factPath:r})})}function cae(e,t=dt){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 Ep(r)?[{kind:"fact",key:n.key,declared:r,answer:n}]:[]})}function uae(e,t){return{title:p2(e.head.title,t),description:p2(e.head.description,t)}}const dae=.3;function fae(e){const t=Math.max(0,e.viewportHeight-e.topOffset),n=dae*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,g)=>{p<=u&&(f=g)}),f}function hae(e,t){const n=e.join("|"),[r,i]=x.useState(e[0]??""),a=x.useRef(null),c=x.useRef(0);x.useEffect(()=>{let f=null;const p=()=>{if(f=null,a.current)return;const v=fae({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]??"")},g=()=>{f==null&&(f=requestAnimationFrame(p))},m=()=>{var v;(v=a.current)!=null&&v.landed&&(a.current=null),g()},w=()=>{a.current&&(a.current=null,c.current++,g())};return p(),window.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",g),window.addEventListener("wheel",w,{passive:!0}),window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("keydown",w),()=>{window.removeEventListener("scroll",m),window.removeEventListener("resize",g),window.removeEventListener("wheel",w),window.removeEventListener("touchstart",w),window.removeEventListener("keydown",w),f&&cancelAnimationFrame(f)}},[n]);const u=x.useCallback(f=>{const p=document.getElementById("sec-"+f);if(!p)return;const g=++c.current;a.current={id:f,landed:!1},i(f);const m=()=>requestAnimationFrame(()=>{var w;c.current===g&&((w=a.current)==null?void 0:w.id)===f&&(a.current.landed=!0)});pae(p,t(),()=>c.current===g,m)},[t]);return{active:r,jump:u}}function pae(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),g=m=>{if(!n())return;const w=Math.min(1,(m-f)/u);window.scrollTo(0,Math.round(a+c*p(w))),w<1&&requestAnimationFrame(g)};requestAnimationFrame(g),setTimeout(()=>{n()&&(Math.abs(window.scrollY-i)>2&&window.scrollTo(0,i),r())},u+90)}const tA=200,nA=320,mae="cubic-bezier(0.22, 1, 0.36, 1)";function gae({sections:e,navLabel:t,clearance:n}){const r=x.useRef(n);x.useLayoutEffect(()=>{r.current=n},[n]);const i=x.useCallback(()=>r.current(),[]),a=x.useMemo(()=>e.map(k=>k.id),[e]),{active:c,jump:u}=hae(a,i),f=x.useRef(null),p=x.useRef(null),g=x.useRef(null),m=x.useRef(null),w=x.useRef(c);x.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=x.useCallback(k=>{const S=g.current,E=p.current,O=E==null?void 0:E.querySelector(`[data-section="${CSS.escape(w.current)}"]`);if(!S||!E||!O)return;const A=E.getBoundingClientRect(),R=O.getBoundingClientRect(),C=R.top-A.top,I=A.bottom-R.bottom,$=m.current;m.current={top:C,bottom:I};const T=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(k&&$&&$.top!==C&&!T){const F=C>$.top;S.style.transitionProperty="top, bottom",S.style.transitionTimingFunction=mae,S.style.transitionDuration=F?`${nA.toString()}ms, ${tA.toString()}ms`:`${tA.toString()}ms, ${nA.toString()}ms`}else S.style.transitionProperty="none";S.style.top=`${C.toString()}px`,S.style.bottom=`${I.toString()}px`,S.style.opacity="1"},[]);x.useLayoutEffect(()=>{w.current=c,v(!0)},[c,v]),x.useEffect(()=>{const k=p.current;if(!k)return;const S=()=>v(!1),E=new ResizeObserver(S);return E.observe(k),"fonts"in document&&document.fonts.ready.then(S),()=>E.disconnect()},[v]);const _=x.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:g,"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 yae({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 bae({propertyId:e,saveCycle:t,onFactsSaved:n,clearance:r,afterFacts:i}){const a=b$(e),c=cae(a.answer),{forPage:u,noteUserEdit:f,markFor:p,isMediaProcessing:g,cropFailedAt:m}=cm(e),w=am(dt,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=w.facts,_=a.answer===void 0||!w.ready,k=a.failed&&a.answer===void 0||w.readFailed,S=()=>{a.failed&&a.retry(),w.readFailed&&w.retryRead()},E=c.map(O=>{const A=uae(O.declared,v);return{id:O.key,label:Mi(O.declared),content:h.jsxs("div",{children:[h.jsx(yae,{title:A.title,sub:A.description}),h.jsx(aae,{registry:dt,pageKey:O.key,facts:v,answer:O.answer,onChange:R=>{f(O.key),w.set(O.key,R)},propertyId:e,noticeHost:"details",autofill:u(O.key),marks:{markFor:p},isMediaProcessing:g,cropFailedAt:m,save:w.saveState(O.key),stageMedia:w.stageMedia,onLibrarySaveBegin:t.begin})]})}});return i!==null&&E.push(i),h.jsxs(h.Fragment,{children:[h.jsx(Ls,{surface:`details:${e}`,notices:k?[mJ("We couldn’t load this property’s details.",{label:"Try again",onClick:S})]:[]}),k||_?null:h.jsx(gae,{navLabel:"Property details sections",sections:E,clearance:r})]})}function vae(e){return F4(e),e.getState().pendingSaves===0?Promise.resolve():new Promise(t=>{const n=e.subscribe(r=>{r.pendingSaves>0||(n(),t())})})}const wae="\0added";function n1(e,t){const n=x.useRef(e);x.useEffect(()=>{n.current=e});const r=x.useRef(!1),i=e.mode==="multi"?e.selectedIds:e.selectedId===null?[]:[e.selectedId],a=(u,f)=>{const p=n.current,g=u.find(v=>!i.includes(v)),m=i.filter(v=>!u.includes(v)),w=v=>v.filter(_=>!m.includes(_));if(g===void 0){p.mode==="multi"&&m.length>0&&p.onChange(w(p.selectedIds),new Map);return}r.current||(r.current=!0,f(g).then(v=>{if(v===null)return;const _=n.current;if(_.mode==="single"){_.onPick(v.id,v.members);return}const k=w(_.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([wae,...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 xae=new Set(["text","number","text_list","number_list","address"]);function fp(e,t,n){const r=typeof n=="object"&&n!==null?n:{},i={id:t};for(const[a,c]of Object.entries(jp(e))){const u=Qu(c);u!==null&&xae.has(u)&&Object.hasOwn(r,a)&&(i[a]=r[a])}return i}function hb(e){const t=dt.pages[e];function n({property:r,saveCycle:i,pick:a,record:c}){const u=Sn(),f=am(dt,r.id,{enabled:!0,onSaveBegin:i.begin}),p=f.facts,g=p[e],m=Array.isArray(g)?g:[],w=x.useRef(m);x.useEffect(()=>{w.current=m});const v=x.useRef(f.flush);x.useEffect(()=>{v.current=f.flush}),x.useEffect(()=>()=>{v.current().catch(()=>{}).finally(()=>u.propertyChanged(r.id))},[r.id,u]);const{cropFailedAt:_}=cm(r.id),k=n1(a),S=v$(r.id),E=y$(S,dt,e),O=S==null?void 0:S.pages.find(G=>G.home==="property"&&G.key===e),A=k$({registry:dt,pageKey:e,facts:p,answer:O$(O,p),refused:!1,onDismissRefusal:()=>{},save:f.saveState(e)});if(!f.ready)return h.jsx("div",{className:Bl,"aria-hidden":"true"});const R=A$(t.declaration,Mi(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:fp(e,U,m[H])}},$=c===void 0?-1:C(c.rowId);if(c!==void 0&&$<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(w.current);if(f.set(e,G),H!=="add")return;const z=G.findIndex(K=>!U.has(K));z<0||k.onAdded(async()=>{const K=await f.storedRowId({key:e,index:z});return K===null?null:{id:K,members:fp(e,K,w.current[z])}})},W=h.jsx(hu,{propertyId:r.id,listingIntent:r.listingIntent,stageMedia:f.stageMedia,nearPostal:r.postal,cropFailedAt:_,children:h.jsx(cu,{slot:R,value:m,onChange:F,propertyId:r.id,instanceId:`facts:${dt.home}`,slotId:e,fields:E,...c!==void 0?{record:{index:$,onClose:c.onClose}}:{selection:T}})});return c!==void 0?W:h.jsxs("div",{className:"flex flex-col gap-[12px]",children:[h.jsx(Ls,{surface:x$("editor-table",r.id,e),notices:A}),W]})}return n.displayName=`RegistryTableBody(${e})`,n}const pb=w$([dl("contacts")]);function kae({property:e,saveCycle:t,pick:n,record:r}){const i=lm({propertyId:e.id,lists:pb.landsIn,onSaveBegin:t.begin}),a=n1(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:fp("contacts",f,p)}};return r!==void 0?h.jsx($u,{from:pb.table,propertyId:e.id,onSaveBegin:t.begin,record:r}):i.tiers===null?h.jsx("div",{className:Bl,"aria-hidden":"true"}):h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx($u,{from:pb.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 _ae="flex flex-col gap-1.5",Sae="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",Eae="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",jae="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",Oae=[dl("contacts")],Aae="shrink-0 rounded-full bg-line-soft px-2 py-0.5 text-caption font-medium text-ink-3";function Cae({tables:e,property:t,saveCycle:n,pick:r}){const{rows:i,rowOf:a,pending:c}=Qx(e),{land:u,refusal:f,setRefusal:p}=lm({propertyId:t.id,lists:Oae,onSaveBegin:n.begin}),g=n1(r,()=>p("Couldn’t choose this row. Try again.")),{control:m}=g,w=async _=>{const k=i.find(E=>E.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:fp(k.table,k.id,S.row)}},v=_=>{const k=$w(g.ids,_.id,m,g.held);k!==g.ids&&g.onChange(k,w)};return c?h.jsx("div",{className:Bl,"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(vj).join(" or ").toLowerCase()} on the Details tab.`}):h.jsx(h.Fragment,{children:h.jsx("div",{role:m==="radio"?"radiogroup":"group",className:_ae,children:i.map(_=>{const k=qp(g.ids,_.id,g.held);return h.jsxs("button",{type:"button",role:m,"aria-checked":k.checked,"data-checked":k.checked?"":void 0,disabled:k.disabled,className:`group ${Sae}`,onClick:()=>v(_),children:[h.jsx("span",{className:m==="radio"?Eae:jae,"aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:h.jsx(h$,{tables:[_.table],rowId:_.id,size:"bar"})}),h.jsx("span",{className:Aae,children:vj(_.table)})]},_.id)})})}),f!==null&&h.jsx("p",{role:"alert",className:"text-body text-danger",children:f})]})}const C$={units:hb("units"),comparables:hb("comparables"),contacts:kae,commercial_spaces:hb("commercial_spaces")};function Nae(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 Mae(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:QD(r)&&((i=tn(r))==null?void 0:i.postal)||null}}function N$(){const e=je(a=>a.session.property_id),t=Sn(),n=No(),r=zn({queryKey:Al(e),queryFn:()=>t.read(Kx(e)),staleTime:0});return x.useEffect(()=>()=>{t.propertyChanged(e),n.invalidateQueries({queryKey:Al(e)}),n.invalidateQueries({queryKey:Ps})},[e,n,t]),{property:r.isFetchedAfterMount&&r.data!==void 0?Mae(e,r.data.facts):void 0,isError:r.isError}}function Rae(e){return e.mode==="record"?e.open?h.jsx($ae,{tables:e.tables,rowId:e.rowId,onClose:e.onClose}):null:h.jsx(zae,{...e})}const Tae={mode:"single",selectedId:null,disabledIds:[],onPick:()=>{}};function $ae({tables:e,rowId:t,onClose:n}){const r=N$(),i=Mw(),{rows:a,pending:c}=Qx(e),u=a.find(g=>g.id===t),f=!c&&u===void 0;if(x.useEffect(()=>{f&&n()},[f,n]),u===void 0||r.property===void 0)return null;const p=C$[u.table];return h.jsx(Hp,{status:i,children:h.jsx(p,{property:r.property,saveCycle:i,pick:Tae,record:{rowId:t,onClose:n}})})}function zae(e){const{open:t,tables:n,onClose:r}=e,i=Mw(),a=N$(),[c]=n,u=n.length>1,{title:f}=Wx([dl(c),...n.slice(1).map(m=>dl(m))]),p=C$[c],g=Nae(e);return h.jsx(Hp,{status:i,children:h.jsx(Tw,{open:t,onClose:r,title:f,children:a.property!==void 0?u?h.jsx(Cae,{tables:n,property:a.property,saveCycle:i,pick:g}):h.jsx(p,{property:a.property,saveCycle:i,pick:g}):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:Bl,"aria-hidden":"true"})})})}function Dae(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 xd="flex flex-col gap-1 px-3 py-1.5",r1="text-[length:calc(11.5*var(--content))] font-medium text-ink-3",Cl="text-[length:calc(13*var(--content))] text-ink",um="text-[length:calc(11.5*var(--content))]",Lae=`${um} text-ink-3`,Fs="cursor-pointer rounded-md transition-colors hover:bg-line-soft";function Iae({label:e,children:t}){return h.jsxs("div",{className:xd,children:[e===void 0?null:h.jsx("span",{className:r1,children:e}),t]})}const M$=e=>e.replaceAll(" ","-"),Uae={new:"Create",rename:"Rename",duplicate:"Duplicate"};function o1({label:e,entries:t,value:n,onChoose:r,testId:i,placeholder:a="Choose…",changes:c}){const[u,f]=x.useState(!1),[p,g]=x.useState(null),m=x.useId(),w=t.find(E=>E.id===n)??null,v=E=>{E.key!=="Escape"||!u||(E.stopPropagation(),p!==null?g(null):f(!1))},_=E=>{g(O=>O===null||O.kind==="menu"?O:{...O,busy:!0,error:null}),E.then(()=>{g(null),f(!1)},O=>g(A=>A===null||A.kind==="menu"?A:{...A,busy:!1,error:O instanceof Error?O.message:String(O)}))},k=E=>{if(c===void 0||E.busy)return;const O=M$(E.value.trim());E.action==="new"?_(c.onNew(O)):E.action==="rename"?_(c.onRename(E.id,O)):_(c.onDuplicate(E.id,O))},S=E=>h.jsx(Vae,{editing:E,onValue:O=>g({...E,value:O,error:null}),onSubmit:()=>k(E),onCancel:()=>g(null)},`${E.action}-${E.id??""}`);return h.jsxs("div",{className:xd,onKeyDown:v,children:[h.jsx("span",{className:r1,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 ${Cl} ${Fs}`,onClick:()=>{g(null),f(E=>!E)},children:[h.jsx("span",{className:"min-w-0 truncate",children:(w==null?void 0:w.name)??a}),h.jsx(At,{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(E=>{const O=E.id===n,A=p!==null&&p.id===E.id;if(A&&(p==null?void 0:p.kind)==="name"&&p.action==="rename")return S(p);const R=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(qae,{entry:E,selected:O,actions:c===void 0?null:Pae,mode:R,deleteQuestion:(c==null?void 0:c.deleteQuestion(E.id))??"",busy:(C==null?void 0:C.busy)??!1,onChoose:()=>{f(!1),g(null),O||r(E.id)},onActions:()=>g(R==="actions"?null:{kind:"menu",id:E.id}),onDelete:()=>c!==void 0&&_(c.onDelete(E.id)),onCancel:()=>g(null),onAction:I=>{g(I==="rename"?{kind:"name",action:"rename",id:E.id,value:E.name,error:null,busy:!1}:I==="duplicate"?{kind:"name",action:"duplicate",id:E.id,value:`${E.name}-copy`,error:null,busy:!1}:{kind:"confirm",id:E.id,error:null,busy:!1})}}),C===null?null:h.jsx(R$,{error:C.error}),A&&(p==null?void 0:p.kind)==="name"&&p.action==="duplicate"?S(p):null]},E.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 ${Cl} ${Fs}`,onClick:()=>g({kind:"name",action:"new",id:null,value:"",error:null,busy:!1}),children:[h.jsx(At,{name:"plus",size:14}),c.newLabel]})]}):null]})}const Pae=[{action:"rename",icon:"pencil",label:"Rename"},{action:"duplicate",icon:"copy",label:"Duplicate"},{action:"delete",icon:"trash",label:"Delete"}],sh="transition-[translate,rotate,opacity] duration-300 ease-settle motion-reduce:transition-none",Fae=35,Bae=90,hp=`group/tip flex size-7 flex-shrink-0 items-center justify-center text-ink-3 hover:text-ink disabled:cursor-default disabled:opacity-50 ${Fs}`,Hae=`h-8 min-w-0 flex-1 rounded-md border border-line bg-canvas px-2 ${Cl} transition-colors focus:border-accent disabled:opacity-60`,rA=`group/tip relative flex h-7 flex-shrink-0 items-center rounded-md px-2.5 ${um} font-medium cursor-pointer transition-colors disabled:cursor-default disabled:opacity-60`;function mu({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 ${um} 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 qae({entry:e,selected:t,actions:n,mode:r,deleteQuestion:i,busy:a,onChoose:c,onActions:u,onAction:f,onDelete:p,onCancel:g}){const m=(n==null?void 0:n.length)??0,w=r!=="closed",v=r==="actions",_=r==="confirm",k=x.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":w,className:`flex h-8 min-w-0 flex-1 items-center gap-2 px-2 text-left ${Fs} ${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 ${Cl} ${t?"font-semibold":""}`,children:e.name}),e.mark===void 0?null:h.jsx("span",{className:`flex-shrink-0 ${Lae}`,"data-testid":"entry-mark",children:e.mark}),t?h.jsx(At,{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:E,label:O},A)=>h.jsxs("button",{type:"button",role:"menuitem","aria-label":O,"data-action":S,"data-open":v,className:`${hp} ${sh} 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)*Fae)}ms`},onClick:()=>f(S),children:[h.jsx(At,{name:E,size:14}),h.jsx(mu,{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 ${sh} translate-x-3 opacity-0 data-[open=true]:translate-x-0 data-[open=true]:opacity-100`,style:{transitionDelay:`${String(_?Bae:0)}ms`},children:[h.jsxs("button",{type:"button","data-testid":"entry-delete","aria-describedby":k,disabled:a,className:`${rA} bg-danger text-canvas hover:bg-[color-mix(in_oklab,var(--color-danger)_88%,black)]`,onClick:p,children:["Delete",h.jsx(mu,{label:i,align:"end",id:k,testId:"entry-delete-question"})]}),h.jsx("button",{type:"button","data-testid":"entry-cancel",disabled:a,className:`${rA} text-ink-2 hover:bg-line-soft hover:text-ink`,onClick:g,children:"Cancel"})]}),h.jsxs("button",{type:"button","aria-label":`Actions for ${e.name}`,"aria-expanded":v,inert:_,"data-testid":"entry-menu","data-open":w,"data-confirming":_,className:`${hp} ${sh} 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(Mp,{"aria-hidden":"true",strokeWidth:2,className:`size-[calc(15*var(--content))] ${sh} group-data-[open=true]/tip:rotate-180`}),h.jsx(mu,{label:v?"Close":"Actions",align:"end"})]})]})]})}function R$({error:e}){return e===null?null:h.jsx("p",{role:"alert","data-testid":"entry-error",className:`px-2 ${um} whitespace-pre-wrap text-danger`,children:e})}function Vae({editing:e,onValue:t,onSubmit:n,onCancel:r}){const i=c=>{c.key==="Enter"?(c.preventDefault(),n()):c.key==="Escape"&&(c.stopPropagation(),r())},a=Uae[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:`${Hae} mr-0.5 placeholder:text-ink-4 aria-[invalid=true]:border-danger`,onChange:c=>t(M$(c.target.value)),onKeyDown:i}),h.jsxs("button",{type:"submit","aria-label":a,"data-testid":"entry-name-submit",disabled:e.busy,className:`${hp} relative`,children:[h.jsx(At,{name:"check",size:15,stroke:2.2,className:"text-accent"}),h.jsx(mu,{label:a})]}),h.jsxs("button",{type:"button","aria-label":"Cancel",disabled:e.busy,className:`${hp} relative`,onClick:r,children:[h.jsx(At,{name:"x",size:15}),h.jsx(mu,{label:"Cancel",align:"end"})]})]}),h.jsx(R$,{error:e.error})]})}function Zae({label:e,on:t,onChange:n,testId:r}){return h.jsx("div",{className:xd,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 ${Cl} ${Fs}`,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 Kae({label:e,entries:t,value:n,onChoose:r,testId:i}){return h.jsxs("div",{className:xd,children:[h.jsx("span",{className:r1,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 Gae({title:e,count:t,onOpen:n}){return h.jsx("div",{className:xd,children:h.jsxs("button",{type:"button",className:`-mx-1 flex items-center justify-between gap-3 px-1 py-0.5 text-left ${Cl} ${Fs}`,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:`${T$} bg-line-soft text-ink-2`,children:t})]}),h.jsx(At,{name:"chevRight",size:14,className:"text-ink-3"})]})})}const T$="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 Yae({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 ${Fs}`,onClick:t,children:h.jsx(At,{name:"arrowLeft",size:15})}),h.jsx("h2",{className:"text-[length:calc(13*var(--content))] font-semibold text-ink",children:e})]}),n]})}const mb={corner:"top-left",open:!1},pp=40,ah=16,$$="concrete-playground:control",Qae=["top-left","top-right","bottom-left","bottom-right"];function oA(){try{return window.localStorage}catch{return null}}function Xae(e){try{const t=e==null?void 0:e.getItem($$);if(!t)return mb;const n=JSON.parse(t);return{corner:Qae.find(i=>i===n.corner)??mb.corner,open:n.open===!0}}catch{return mb}}function Wae(e,t){try{e==null||e.setItem($$,JSON.stringify(t))}catch{}}function Jae(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 iA(e,t){const n=r=>Math.max(ah,r-ah-pp);return{x:e.endsWith("left")?ah:n(t.width),y:e.startsWith("top")?ah:n(t.height)}}function sA(e,t){const n=(r,i)=>Math.min(Math.max(0,r),Math.max(0,i-pp));return{x:n(e.x,t.width),y:n(e.y,t.height)}}const ele=100,aA=500;function tle(e,t){const n=e.find(i=>t.at-i.at<=ele&&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 nle(e,t,n){return Jae({x:e.x+t.x*aA,y:e.y+t.y*aA},n)}const rle=4,z$="fixed z-40",ole={"top-left":"left-[16px] top-[64px]","top-right":"right-[16px] top-[64px]","bottom-left":"left-[16px] bottom-[64px]","bottom-right":"right-[16px] bottom-[64px]"},ile="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)]",sle=[`${z$} 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(" "),ale=8;function lA(){return{width:window.innerWidth,height:window.innerHeight}}function lle(){const[e,t]=x.useState(lA);return x.useEffect(()=>{const n=()=>t(lA());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function cle(e,t,n){x.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 ule({sections:e,context:t}){const[n,r]=x.useState(()=>Xae(oA())),[i,a]=x.useState(null),[c,u]=x.useState(!1),[f,p]=x.useState(null),g=lle(),m=x.useRef(null),w=x.useRef(!1),v=x.useRef(null),_=x.useRef(null),k=x.useId();x.useEffect(()=>Wae(oA(),n),[n]);const S=z=>r(K=>({...K,open:z})),E=x.useCallback(()=>r(z=>z.open?{...z,open:!1}:z),[]);cle(n.open,_,E);const O=i??iA(n.corner,g),A=(z,K)=>({x:z.clientX-K.pointer.x,y:z.clientY-K.pointer.y}),R=z=>({x:z.clientX,y:z.clientY,at:z.timeStamp}),C=z=>{var K,N;z.button===0&&(w.current=!1,u(!0),m.current={pointer:{x:z.clientX,y:z.clientY},origin:iA(n.corner,g),moved:!1,samples:[R(z)]},(N=(K=z.currentTarget).setPointerCapture)==null||N.call(K,z.pointerId))},I=z=>{const K=m.current;if(K===null)return;const N=A(z,K);K.samples=[...K.samples.slice(1-ale),R(z)],!(!K.moved&&Math.hypot(N.x,N.y)<rle)&&(K.moved=!0,a(sA({x:K.origin.x+N.x,y:K.origin.y+N.y},g)))},$=z=>{const K=m.current;if(m.current=null,u(!1),K===null||!K.moved)return;w.current=!0;const N=A(z,K),B=sA({x:K.origin.x+N.x,y:K.origin.y+N.y},g),Y=nle({x:B.x+pp/2,y:B.y+pp/2},tle(K.samples,R(z)),g);r(ie=>({...ie,corner:Y})),a(null)},T=()=>{m.current=null,u(!1),a(null)},F=z=>{if(w.current&&z.detail!==0){w.current=!1;return}S(!n.open)},W=z=>{var K;z.key!=="Escape"||!n.open||(S(!1),(K=v.current)==null||K.focus())},G=Dae(e,t),H=t.problems.length,U=G.find(z=>z.shape==="page"&&z.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:sle,style:{translate:`${String(O.x)}px ${String(O.y)}px`},onPointerDown:C,onPointerMove:I,onPointerUp:$,onPointerCancel:T,onClick:F,children:[h.jsx(At,{name:"settings",size:18,stroke:1.7}),H===0?null:h.jsx("span",{"data-testid":"control-count",className:`${T$} 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:`${z$} ${ole[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 ${ile}`,children:U!==null?h.jsx(Yae,{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(z=>{var K;return h.jsx("div",{"data-control-section":z.id,children:z.shape==="row"?h.jsx(z.Row,{context:t}):h.jsx(Gae,{title:z.title,count:(K=z.count)==null?void 0:K.call(z,t),onOpen:()=>p(z.id)})},z.id)})})}):null]})}const Gv={refused:null,also:[]};function D$(){let e=Gv;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(Gv),subscribe:i=>(t.add(i),()=>t.delete(i)),current:()=>e}}const dle={subscribe:()=>()=>{},current:()=>Gv};function Yv(e){const t=e??dle;return x.useSyncExternalStore(t.subscribe,t.current)}function fle(e){return`${e.what}${e.file===null?"":`: ${e.file}`}
|
|
1334
|
+
${e.message}`}function hle(e){return e.map(fle).join(`
|
|
1335
|
+
|
|
1336
|
+
`)}function ple(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 mle(e,t){const[n,r]=x.useState([]);return x.useEffect(()=>{if(t===null)return;let i=!0;return e.problems().then(a=>{i&&r(a.problems.map(ple))},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 gle(e,t,n){const r=mle(e,t),{canvas:i,facts:a}=n,{refused:c}=Yv(i),{refused:u}=Yv(a),[f,p]=x.useState(new Map),g=x.useCallback((w,v)=>{p(_=>{if(v.length===0&&!_.has(w))return _;const k=new Map(_);return v.length===0?k.delete(w):k.set(w,v),k})},[]);return{problems:x.useMemo(()=>{const w=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(E=>({...E,source:k})));return[...r,...w,...v,..._]},[r,c,i,u,a,f]),report:g}}const cA=7,yle="ladder";function br(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 zu={site:"site",download:"download"};function ble(e){const[t,n,r,i,a,...c]=e.split("/");if(t!=="properties"||r!=="content"||n===void 0||n===""||i===void 0||i===""||a!==zu.site&&a!==zu.download)return null;try{return{property:decodeURIComponent(n),fixture:decodeURIComponent(i),output:a,rest:c.map(decodeURIComponent)}}catch{return null}}const Vt={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${br({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${br({property:e})}`,owned:e=>`api/owned${br({fixture:e})}`,bootstrap:(e,t)=>`api/bootstrap${br({fixture:e,format:t})}`,requirements:e=>`api/requirements${br({fixture:e})}`,propertyRequirements:e=>`api/requirements${br({property:e})}`,facts:(e,t)=>`api/facts${br({property:e,home:t})}`,canvas:(e,t,n,r)=>`properties/${encodeURIComponent(e)}/content/${encodeURIComponent(t)}/${n===null?"canvas":`canvas/${encodeURIComponent(n)}`}${br({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"?zu.site:zu.download}/`,download:(e,t,n={})=>`${Vt.output(e,t,"image").slice(0,-1)}${n.page===void 0||n.page===null?"":`/${encodeURIComponent(n.page)}.png`}${br({format:n.format})}`,site:(e,t,n)=>`${Vt.output(e,t,"website")}${n==="/"?"":`${n.slice(1)}/`}`,build:"build/",jobs:"api/jobs",job:(e,t)=>`api/jobs/${encodeURIComponent(e)}${br({wait:t===void 0?null:String(t)})}`,probe:e=>`api/probe${br({fixture:e})}`,verify:"api/verify",changes:"__changes"},gb={files:"files",job:"job"};function i1(e){return(e==null?void 0:e.page)==="canvas"||(e==null?void 0:e.page)==="live"}function L$(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 vle(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 ru(e){const t=`properties/${encodeURIComponent(e.property)}`;return i1(e)?e.page==="live"?Vt.live(e.property,e.fixture,e.pagePath):Vt.canvas(e.property,e.fixture,e.canvasId,e.format):e.page==="facts"?`${t}/facts`:t}function Ya(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 Du(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"?Ya(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 yb=e=>e.map(t=>t.name).join(", ")||"none";function wle(e,t){const{properties:n}=t;if(e===null){const c=n[0];return c===void 0?{kind:"none"}:{kind:"replace",view:Du(c,t)}}const r=n.find(c=>c.name===e.property);if(!i1(e))return r===void 0?{kind:"unknown",message:`There is no property "${e.property}" (have: ${yb(n)}).`}:e.page==="property"?{kind:"replace",view:Du(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=xle(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: ${yb(n)}).`}:{kind:"unknown",message:`There is no content fixture "${e.fixture}" on "${r.name}" (have: ${yb(r.content)}).`}}function xle(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 Qv(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 kle(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 Ya(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:Du(c,r,a)}function _le(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&&Sle(e,n)?e:n:e!==null&&e.property===n.property?e:null}function Sle(e,t){return e.property===t.property&&e.fixture===t.fixture&&e.canvasId===t.canvasId&&e.format===t.format}function I$({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 U$({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 P$({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 Ele({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 jle({context:e}){const{catalog:t,view:n,page:r,opened:i,onView:a}=e,c=P$(e),u=r==="canvas"||r==="live"||r==="facts"?r:null,f=p=>{var m,w;if(t===null||n===null||p===u)return;const{template:g}=t;if(p==="facts")a({page:"facts",property:n.property});else if(n.page==="canvas"&&p==="live"){const v=Qv(g,(i==null?void 0:i.store.getState().currentCanvasId)??n.canvasId);a(Ya(n.property,n.fixture,{page:"live",pagePath:v}))}else if(n.page==="live"&&p==="canvas"){const v=(m=g.pages.find(k=>k.path===n.pagePath))==null?void 0:m.id,_=((w=g.canvases.find(k=>v!==void 0&&k.pages.includes(v)))==null?void 0:w.id)??null;a(Ya(n.property,n.fixture,{page:"canvas",canvasId:_,format:null}))}else if(n.page==="property"||n.page==="facts"){const v=Ele(e,n.property),_=t.properties.find(k=>k.name===n.property);v!==null&&p==="canvas"?a(v):v!==null&&p==="live"?a(Ya(v.property,v.fixture,{page:"live",pagePath:Qv(g,v.canvasId)})):_!==void 0&&a(Du(_,t,p==="live"?{page:"live",pagePath:"/"}:void 0))}};return h.jsx(Kae,{label:"Page",testId:"page-switch",entries:c,value:u,onChoose:f})}function Ole(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 Ale({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(g=>g.name===f);return p===void 0?`Delete ${f}?`:Ole(p)}};return h.jsx(o1,{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(g=>g.name===f);p===void 0||t===null||r((n==null?void 0:n.page)==="facts"?{page:"facts",property:p.name}:Du(p,t,U$(e)))},...u===void 0?{}:{changes:u}})}function Cle({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(o1,{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(Ya(a.name,f,U$(e)))},...u===void 0?{}:{changes:u}})}function Nle({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(o1,{label:"Format",testId:"format-switcher",entries:a,value:((c=I$(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 Mle({context:{guides:e,onGuides:t}}){return h.jsx(Zae,{label:"Trim & bleed guides",testId:"guides-toggle",on:e,onChange:t})}function Rle({context:{page:e,opened:t,factsSave:n}}){const r=e==="facts",i=Yv(r?n.notes:(t==null?void 0:t.notes)??null);return!r&&t===null?null:h.jsx(Iae,{children:h.jsxs("div",{className:"flex flex-col gap-1","data-testid":"save-status",children:[r?h.jsx(Rw,{status:n.status}):h.jsx(Fie,{}),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 Tle({context:{problems:e}}){const[t,n]=x.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(hle(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 F$({catalog:e}){return e!==null&&e.error===void 0&&e.capabilities.save}const uA=e=>{var t;return F$(e)&&(((t=e.catalog)==null?void 0:t.properties.length)??0)>0},$le=[{id:"problems",shape:"page",title:"Problems",pages:["canvas","facts","live","message"],applies:({problems:e})=>e.length>0,count:({problems:e})=>e.length,Page:Tle},{id:"page-switch",shape:"row",pages:["canvas","facts","live","message"],applies:e=>uA(e)&&P$(e).length>0,Row:jle},{id:"property",shape:"row",pages:["canvas","facts","live","message"],applies:F$,Row:Ale},{id:"content",shape:"row",pages:["canvas","facts","live","message"],applies:uA,Row:Cle},{id:"format",shape:"row",pages:["canvas"],applies:({catalog:e})=>((e==null?void 0:e.template.formats.length)??0)>1,Row:Nle},{id:"guides",shape:"row",pages:["canvas"],applies:e=>{var t;return(((t=I$(e))==null?void 0:t.bleed)??0)>0},Row:Mle},{id:"save-status",shape:"row",pages:["canvas","facts"],applies:({page:e,opened:t})=>e==="facts"||t!==null,Row:Rle}];function zle(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 lh(e,t){const n=(await t.text().catch(()=>"")).trim();return new Error(n===""?`${e}: HTTP ${t.status}`:n)}function Dle(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 lh(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 lh(a,u);return await u.json()};return{base:e,async catalog(){const a=await r(Vt.catalog);if(a.wire!==cA)throw new Error(`This playground speaks wire ${cA}, and its host answered with wire ${String(a.wire)}.`);return a},problems:()=>r(Vt.problems),bootstrap:(a,c)=>r(Vt.bootstrap(a,c)),requirements:a=>r(Vt.requirements(a)),propertyRequirements:a=>r(Vt.propertyRequirements(a)),facts:(a,c)=>r(Vt.facts(a,c)),render:a=>i(Vt.render,a),save:a=>i(Vt.save,a),library:a=>i(Vt.library,a),fixtures:a=>i(Vt.fixtures,a),async upload(a,c){const u=Vt.upload(a),f=await t(n(u),{method:"POST",headers:{"content-type":c.type||"application/octet-stream"},body:c});if(!f.ok)throw await lh(u,f);return await f.json()},media:a=>r(Vt.media(a)),owned:a=>r(Vt.owned(a)),async download(a,c,u){var p;const f=Vt.download(a,c,{format:u});for(;;){const g=await t(n(f));if(g.status===202){await((p=g.body)==null?void 0:p.cancel());continue}if(!g.ok)throw await lh(f,g);return{name:zle(g.headers.get("content-disposition"))??"download",file:await g.blob()}}},liveHref:(a,c,u)=>n(Vt.site(a,c,u)),subscribe(a){let c;try{c=new EventSource(n(Vt.changes))}catch{return()=>{}}const u=Object.keys(gb).flatMap(f=>{const p=a[f];if(p===void 0)return[];const g=m=>p(JSON.parse(m.data));return c.addEventListener(gb[f],g),[()=>c.removeEventListener(gb[f],g)]});return()=>{for(const f of u)f();c.close()}}}}let Xv=null;function Lle(e){Xv=e}function dm(){if(Xv===null)throw new Error("The playground's host is not installed yet.");return Xv}let B$=()=>{};function bb(e){B$=e??(()=>{})}async function s1(e){const t=dm(),n=e.kind==="library"?await t.library(e.request):await t.upload(e.request,e.file);return B$(n),n}let H$=null;function vb(e){H$=e}function q$(){return H$}const fm="2026-01-01T00:00:00.000Z",Wv=new Map,Jv=new Map;function a1(e){let t=Wv.get(e);return t===void 0&&(t=dm().media(e).catch(()=>({items:[],contacts:[],lists:{}})),Wv.set(e,t)),t}function Ile(e){let t=Jv.get(e);return t===void 0&&(t=dm().owned(e).catch(()=>({owned:{}})),Jv.set(e,t)),t}async function V$(e){const{items:t,lists:n}=await a1(e);return dL(n,Ule(t))}function Ule(e){return[...Ble(e),...Hle(e),...qle(e),...Vle(e)]}async function Ple(e){return(await a1(e)).contacts}async function Fle(e,t){var a;const{items:n,contacts:r}=await a1(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 Z$(e,t){return(await Ile(e)).owned[t]}function Nl(){Wv.clear(),Jv.clear()}function Ble(e){return e.filter(t=>t.kind==="photo").map(t=>Pp({id:t.id,kind:"image",name:t.name,added_at:fm,file_url:t.src}))}function Hle(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 Pp({id:t.id,kind:"video",name:t.name,added_at:fm,duration_ms:t.durationMs??null,url:n?"":null,provider:t.provider??null,renditions:{...r,...i}})})}function qle(e){return e.filter(t=>t.kind==="tour").map(t=>Pp({id:t.id,kind:"tour",name:t.name,added_at:fm,url:t.url??"",provider:t.provider??null,renditions:t.src===""?{}:{poster:t.src}}))}function Vle(e){return e.filter(t=>t.kind==="document").map(t=>Pp({id:t.id,kind:"document",name:t.name,added_at:fm,mime:t.mime??null,bytes:t.sizeBytes??null,renditions:t.src===""?{}:{poster:t.src}}))}function Zle(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 Kle(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 Gle(e,t,n=document){const r=await Kle(e,n),{sx:i,sy:a,sw:c,sh:u}=Zle(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 g=await new Promise(m=>f.toBlob(m));if(!g)throw new Error("Canvas produced no blob; cannot crop.");return URL.createObjectURL(g)}async function l1(e,t){const n=await s1({kind:"library",request:{kind:"link",url:t,...e}});if(Nl(),n.media===void 0)throw new Error("The link was saved, but the host named no media for it.");return{id:n.media}}function Yle(e){return V$(e)}function Qle(e,t,n){return l1({property:e,list:t},n)}const Xle=/^processed\/crops\/([^/]+)\/(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)_(-?[\d.e-]+)$/,dA=new Map;function Wle(e,t){const n=Xle.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=dA.get(t);return p||(p=Fle(e,r).then(g=>{if(!g)throw new Error(`The fixture's property has no media ${r} to crop.`);return Gle(g,f)}),dA.set(t,p)),p}async function c1(e,t){const n=await s1({kind:"upload",request:{target:e,name:t.name},file:t});if(Nl(),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,dm().base).href}}async function Jle(e,t,n){await s1({kind:"library",request:{kind:"remove",property:e,list:t,media:n}}),Nl()}const K$={async postListUploadWithProgress(e,t,n,r){const{id:i}=await c1({property:e,list:t},n);return r(100),{id:i}},postListLink:(e,t,n)=>l1({property:e,list:t},n),withdrawListItem:(e,t,n)=>Jle(e,t,n),mediaFactsQuery:e=>({queryKey:["media-facts",e],queryFn:async()=>({facts:await Yle(e)})})},ece=/^\/properties\/[^/]+\/poi\/search$/,tce=/^\/properties\/[^/]+\/poi\/([^/]+)$/,e0=[{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 nce(e){const t=typeof e=="object"&&e!==null?e.query:void 0,n=typeof t=="string"?t.trim().toLowerCase():"";return n?{results:e0.filter(r=>{var i;return r.name.toLowerCase().includes(n)||(((i=r.address)==null?void 0:i.toLowerCase().includes(n))??!1)})}:{results:e0}}let rce=0;function oce(e,t={}){const n=(t.method??"GET").toUpperCase();if(n==="POST"&&ece.test(e))return Promise.resolve(nce(t.json));const r=n==="GET"?tce.exec(e):null;if(r){const i=decodeURIComponent(r[1]),a=e0.find(c=>c.place_id===i);if(a)return Promise.resolve({...a,id:`pg-row-${++rce}`})}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 ice=[{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 t0(e){return`${[e.street,e.unit].filter(n=>n!==null).join(", ")}, ${e.city??""}, ${e.state??""} ${e.postal??""}`.trim()}function sce(e){const t=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return ice.filter(n=>{const r=t0(n).toLowerCase();return t.every(i=>r.includes(i))})}const ace=1e3;function lce({value:e,onChange:t,onPick:n,onBlur:r,className:i,placeholder:a,ariaLabel:c}){const u=x.useRef(null),[f,p]=x.useState(!1),[g,m]=x.useState(0),[w,v]=x.useState(null),_=sce(e),k=f&&_.length>0;x.useLayoutEffect(()=>{if(!k)return;const E=()=>{var O;return v(((O=u.current)==null?void 0:O.getBoundingClientRect())??null)};return E(),window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[k]);const S=E=>{const O=_[E];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:E=>{t(E.target.value),m(0),p(!0)},onFocus:()=>p(!0),onBlur:()=>{p(!1),r==null||r()},onKeyDown:E=>{if(k)if(E.key==="ArrowDown"||E.key==="ArrowUp"){E.preventDefault();const O=E.key==="ArrowDown"?1:-1;m(A=>(A+O+_.length)%_.length)}else E.key==="Enter"?(E.preventDefault(),E.stopPropagation(),S(g)):E.key==="Escape"&&(E.stopPropagation(),p(!1))}}),k&&w!==null?Ur.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:w.left,top:w.bottom+4,minWidth:w.width,zIndex:ace},children:_.map((E,O)=>h.jsx("button",{type:"button",role:"option","aria-selected":O===g,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===g?"bg-[#f3f1ea]":""}`,children:t0(E)},t0(E)))}),document.body):null]})}const fA=.004;function cce({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*fA,longitude:r.longitude+c*2*fA})},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 u1={Input:lce,PinMap:cce},n0=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function uce(e,t){let n=e;for(const r of t.split("."))if(Array.isArray(n))n=n.find(i=>n0(i)&&i.id===r);else if(n0(n))n=n[r];else return[];return Array.isArray(n)?n:[]}function dce(e){if(!n0(e))return null;const t=e.media??e.id;return typeof t=="string"?t:null}function fce(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 hce=0;function G$(e){const{host:t,property:n}=e,r=new Map,i=async f=>{const[p,g]=await Promise.all([t.facts(n,f.home),V$(n)]),m={...p.facts.files,...g.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=fR({upload:!0,manage:!0,link:!0});return{read:i,async setValue(f,p,g){await c([{op:"set_value",home:f.home,path:p,value:g}])},async addRow(f,p,g){var k;const m=`pg-row-${String(++hce)}`,v=(k=(await c([{op:"add_row",home:f.home,path:p,...g===void 0?{}:{value:g},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 _=uce((await i(f)).facts,p).findIndex(S=>dce(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,g){return await c([{op:"order",home:f.home,path:p,ids:[...g]}]),{rows:g.map((m,w)=>({row_id:m,position:w}))}},async setSelection(f,p,g,m){await c(fce(m,p,g))},async stageMedia(f,p,g){const m=await a(t.upload({target:{property:n,owner:p},name:g.name},g));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 w=new URL(m.url,t.base).href;return r.set(m.media,w),{media_id:m.media,url:w}},async commitMedia(f,p,g){await c([{op:"commit_media",home:f.home,path:p,media_id:g}])},async withdrawMedia(f,p){await c([{op:"clear_media",home:f.home,path:p}])},async mediaUrl(f,p,g){var _;const m=r.get(g);if(m!==void 0)return{url:m};const w=await t.media(n),v=w.contacts.map(k=>k.images[g]).find(k=>k!==void 0)??((_=w.items.find(k=>k.id===g))==null?void 0:_.src);if(v==null)throw new Error(`The property holds no media "${g}".`);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,g)=>u(f??n,p,g??"")}}async function pce(e,t,n){var p;const r=q$(),i=(r==null?void 0:r.fixture)==null?void 0:await Z$(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 Ple(r.property)).find(g=>g.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 d1(){const e=q$();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 mce(e,t,n){if(!("file"in n))throw new Error("A row's own image is a file; upload one.");const r=d1(),i=e.home==="property"?e.propertyId:r.property,{id:a,url:c}=await c1({property:i,owner:t,fixture:r.fixture},n.file);return{media_id:a,url:c}}function gce(e,t,n){return Promise.resolve()}async function yce(e,t,n){const r={fixture:d1().fixture,instance:t.instanceId,slot:t.slotId};if("link"in n){const{id:c}=await l1(r,n.link);return{media_id:c,url:n.link}}const{id:i,url:a}=await c1(r,n.file);return{media_id:i,url:a}}async function bce(e,t,n){const r=await Z$(d1().fixture,n);if(r===void 0)throw new Error(`The fixture owns no media ${n}.`);return r}const f1={apiFetch:oce,getCropDerivativeUrl:Wle,postLink:Qle,stageOwnedMedia:mce,ownedMediaUrl:pce,discardStagedMedia:gce,uploadContentMedia:yce,contentMediaUrl:bce},vce={upload:!0,link:!0,manage:!0};function wce(e){return x.createElement(uq,{...e,capabilities:vce})}const xce={useEditorStore:je,capabilities:{},api:f1,MediaPicker:wce,TablePicker:Rae,TableRowSummary:h$,address:u1},kce="mx-auto w-[max(90%,calc(720*var(--frame)))] max-w-[calc(1200*var(--frame))] [--list-display-clear:48px]",_ce=22,Sce=()=>_ce;function Ece({host:e,property:t,queryClient:n,saveCycle:r,notes:i,scroll:a,onSaved:c,onPropertyChanged:u}){const f=x.useRef(c),p=x.useRef(u);x.useLayoutEffect(()=>{f.current=c,p.current=u},[c,u]);const g=x.useMemo(()=>G$({host:e,property:t,api:f1,address:u1,onSaved:m=>{i.saved("",m.changed),Nl(),f.current(m),p.current()},onRefused:i.refused,onPropertyChanged:()=>p.current()}),[e,t,i]);return x.useEffect(()=>e.subscribe({files:m=>{m.fixtures&&(Nl(),n.invalidateQueries())}}),[e,n]),jce(t,a),h.jsx(vN,{client:n,children:h.jsx(rM,{api:K$,children:h.jsx(J5,{backend:g,children:h.jsx(Hp,{status:r,children:h.jsx("div",{className:"playground-facts","data-testid":"facts-page",children:h.jsx("div",{className:kce,"data-property-id":t,children:h.jsx(bae,{propertyId:t,saveCycle:r,clearance:Sce,afterFacts:null})})})})})})})}function jce(e,t){const n=x.useRef(null);x.useLayoutEffect(()=>{n.current=t.current>0?t.current:null,n.current===null&&window.scrollTo(0,0)},[e,t]),x.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 hA="download";function Oce({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 Ace(e){const{host:t,catalog:n,property:r,fixture:i}=e,a=je(f=>f.currentCanvasId),c=Cce(e),{template:u}=n;return u.output==="website"?{viewLive:{href:new URL(ru({page:"live",property:r,fixture:i,pagePath:Qv(u,a)}),t.base).href,title:`Open this page as it would publish: ${u.name}`}}:n.capabilities.download?{download:c}:{}}function Cce({host:e,catalog:t,property:n,fixture:r,format:i,reportProblems:a}){const[c,u]=x.useState(!1),[f,p]=x.useState(null),g=x.useRef(0),m=`${n}\0${r}\0${i??""}`,w=x.useCallback(()=>{p(null),a(hA,[])},[a]);return x.useEffect(()=>{g.current+=1,u(!1),w()},[m,w]),{start:()=>{var k;const _=++g.current;u(!0),w(),e.download(n,r,i??((k=t.template.formats[0])==null?void 0:k.id)??null).then(S=>{_===g.current&&(u(!1),Oce(S))},S=>{if(_!==g.current)return;const E=S instanceof Error?S.message:String(S);u(!1),p(E),a(hA,[{what:"Download",file:null,message:`${r}: ${E}`}])})},phase:c?"preparing":"idle",disabledReason:null,error:f,clearError:w}}function Nce(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=Mo(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 Mce={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 Rce({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] ${Mce[t.kind]}`,children:t.kind},t.kind))})}const Tce=(e,t)=>JSON.stringify(e??null)===JSON.stringify(t??null);function $ce({card:e,latest:t}){var u,f;const n=je(p=>{var g;return(g=p.content_doc.instances.find(m=>m.instance_id===e.instanceId))==null?void 0:g.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=>!Tce(Dt(n??{},p),Dt(a,p));return h.jsx(Rce,{chips:Nce(e.slotIds,r==null?void 0:r.provenance[e.instanceId],c)})}function zce(e){return function(n){return h.jsx($ce,{card:n,latest:e})}}function Dce({host:e,catalog:t,opened:n,onView:r,onSaved:i,guides:a,beneath:c,reportProblems:u}){const{property:f,fixture:p,format:g,store:m,backend:w,notes:v,queryClient:_}=n;x.useEffect(()=>m.subscribe((A,R)=>{A.currentCanvasId!==R.currentCanvasId&&r({page:"canvas",property:f,fixture:p,format:g,canvasId:A.currentCanvasId})}),[m,f,p,g,r]);const k=x.useMemo(()=>G$({host:e,property:f,api:f1,address:u1,onSaved:A=>{v.saved(p,A.changed),i(A)},onRefused:v.refused,onPropertyChanged:()=>w.refresh()}),[e,f,p,w,v,i]),S=x.useMemo(()=>zce(w.latest),[w]),E=Ace({host:e,catalog:t,property:f,fixture:p,format:g,reportProblems:u}),O=Object.keys(E).length>0;return h.jsx(vN,{client:_,children:h.jsx(rM,{api:K$,children:h.jsx(J5,{backend:k,children:h.jsx(Pie,{ports:xce,guides:a,beneath:c,slots:{cardAdornment:S},...O?{actions:E}:{}})})})})}const Lce="max-w-[calc(440*var(--frame))] text-center text-[length:calc(13*var(--content))] text-ink-3",Ice="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 Uce({children:e}){return h.jsx("div",{className:"playground-shell",children:h.jsx($4,{children:e})})}function mp({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 Pce({testId:e,children:t}){return h.jsx("p",{"data-testid":e,className:Lce,children:t})}function Jc({testId:e,children:t}){return h.jsx("div",{role:"alert","data-testid":e,className:Ice,children:t})}function Fce(e,t){const n=L$(e,t),r=n===null?null:ble(n);if(r===null||r.output!==zu.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 Bce=2e3;function Hce({host:e,view:t,onFollow:n}){const r=x.useRef(null),i=x.useRef(null),a=e.liveHref(t.property,t.fixture,t.pagePath),c=x.useRef(a),u=x.useRef(a),[f,p]=x.useState(!1),g=x.useRef({view:t,onFollow:n});g.current={view:t,onFollow:n},x.useEffect(()=>{var v;const w=(v=r.current)==null?void 0:v.contentWindow;!w||u.current===a||(u.current=a,w.location.replace(a))},[a]),x.useEffect(()=>{const w=()=>{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)&&w()},job:k=>{k.operation!==yle||k.state!=="done"||v!==null||(v=setTimeout(()=>{v=null,w()},Bce))}});return()=>{_(),v!==null&&clearTimeout(v)}},[e]);const m=()=>{var E;p(!0);const w=(E=r.current)==null?void 0:E.contentWindow;if(!w)return;const v=Fce(w.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}=_;w.scrollTo(0,O),w.requestAnimationFrame(()=>w.scrollTo(0,O))}else i.current={pagePath:v.pagePath,scrollY:0};w.addEventListener("scroll",()=>{i.current={pagePath:v.pagePath,scrollY:w.scrollY}});const{view:k,onFollow:S}=g.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(mp,{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 pA(e,t,n){let r;try{r=await t}catch(i){throw e.onRefused(i),i}return e.onSaved(r),n(r)}function qce(e,t){return t===0?e:`${e}${e.includes("?")?"&":"?"}v=${String(t)}`}function Vce(e,t,n){return{basePath:t,stylesheets:e.stylesheets.map(r=>qce(r,n)),importMap:e.islands.importMap,islandMap:e.islands.map,hostScriptSrc:e.islands.hostScript}}function Zce(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 Kce={dependents_rederiving:!1,fills_evaluating:!1,prior_content_fingerprint:null,content_fingerprint:null},Gce={dependents_rederiving:!0,fills_evaluating:!1,prior_content_fingerprint:null,content_fingerprint:null};function Yce(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),Zce(f)},render:g=>e.render({fixture:a,section_key:g.section_key,slots:g.slots,...g.instance_id===void 0?{}:{instance_id:g.instance_id},...g.page_id===void 0?{}:{page_id:g.page_id},...g.variant===void 0?{}:{variant:g.variant}}),write:g=>pA(n,e.save({fixture:a,batch:"content",ops:g}),m=>m.changed.length===0?Kce:Gce),updateEverywhere:g=>pA(n,e.save({property:i,fixture:a,batch:"everywhere",ops:g}),m=>({row_ids:{...m.row_ids}})),requirements:{queryKey:["playground",a,"requirements"],read:()=>e.requirements(a)},refresh:n.onRefresh,canvasAssets(g){const m=p.get(g);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 w=Vce(f,u,r.value);return p.set(g,w),w}}}const Qce={state:"opening"};function wb(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=>So(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 Xce({host:e,catalog:t,view:n,onSaved:r}){const[i,a]=x.useState(null),c=x.useRef(null),u=x.useRef({value:0}),f=(n==null?void 0:n.property)??null,p=(n==null?void 0:n.fixture)??null,g=(n==null?void 0:n.format)??null;x.useEffect(()=>{var $;if(p===null||f===null){c.current=null,a(null),bb(null);return}a(T=>(T==null?void 0:T.state)==="open"?T:Qce);let w=!0;const v=D$(),_=new yN({defaultOptions:{queries:{retry:!1}}}),k=(($=t==null?void 0:t.properties.find(T=>T.name===f))==null?void 0:$.summary.listingIntent)??null,S=k==="for_sale"||k==="for_rent"?k:null,E=T=>{v.saved(p,T.changed),r(T),Nl(),_.invalidateQueries({queryKey:["media-facts"]})};let O=()=>{};const A=Yce(e,{property:f,fixture:p,format:g},{onSaved:E,onRefused:v.refused,onRefresh:()=>{_.invalidateQueries(),O()}},u.current),R=c.current,C=(n==null?void 0:n.canvasId)??null;return(async()=>{R!==null&&await vae(R);const T=await A.bootstrap();if(!w)return;const F={backend:A,property_id:f,listing_intent:S,bootstrap:T};let W;R===null?W=lW(F):(F4(R),R.getState().openDeliverable(F),W=R),c.current=W,O=wb(W,A,(G,H)=>op(W,G,H)),C!==null&&T.canvases.some(G=>G.id===C)&&W.getState().setCurrentCanvas(C),bb(G=>{E(G),O()}),a({state:"open",opened:{property:f,fixture:p,format:g,store:W,backend:A,notes:v,queryClient:_}})})().catch(T=>{w&&a({state:"failed",message:T instanceof Error?T.message:String(T)})}),()=>{w=!1}},[e,f,p,g]),x.useEffect(()=>()=>{bb(null)},[]);const m=(i==null?void 0:i.state)==="open"?i.opened:null;return x.useEffect(()=>{if(m===null)return;const{store:w,backend:v}=m,_=wb(w,v,(S,E)=>op(w,S,E)),k=wb(w,v,S=>w.getState().applyBootstrap(S));return e.subscribe({files:S=>{S.stylesheet&&v.bumpStylesheets(),S.source||S.stylesheet?k():S.fixtures&&_()}})},[e,m]),i}function mA(e){const t=L$(window.location.pathname,e.base);return t===null?null:vle(t,window.location.search)}function Wce({host:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),a=x.useRef(()=>{}),[c,u]=x.useState(()=>mA(e));x.useEffect(()=>{let J=!0,L=!1,Q=!1;const D=()=>{if(L){Q=!0;return}L=!0,e.catalog().then(Z=>{J&&(n(Z),i(null))},Z=>{J&&i(Z instanceof Error?Z.message:String(Z))}).finally(()=>{L=!1,!(!J||!Q)&&(Q=!1,D())})};return a.current=D,D(),()=>{J=!1,a.current=()=>{}}},[e]);const f=t==null?void 0:t.template.name;x.useEffect(()=>{f&&(document.title=`${f} - Playground`)},[f]),x.useEffect(()=>{const J=()=>a.current();return e.subscribe({files:L=>L.source||L.fixtures?J():void 0,job:J})},[e]),x.useEffect(()=>{const J=()=>u(mA(e));return window.addEventListener("popstate",J),()=>window.removeEventListener("popstate",J)},[e]);const p=x.useMemo(()=>t===null||t.error!==void 0?null:wle(c,t),[c,t]);x.useEffect(()=>{(p==null?void 0:p.kind)==="replace"&&(window.history.replaceState({},"",new URL(ru(p.view),e.base).href),u(p.view))},[p,e]);const g=x.useCallback(J=>{window.history.pushState({},"",new URL(ru(J),e.base).href),u(J)},[e]),m=x.useCallback(J=>{window.history.replaceState({},"",new URL(ru(J),e.base).href),u(J)},[e]),w=x.useCallback(J=>{if(J.properties.length===0)return;const L=new Map(J.properties.map(Q=>[Q.name,Q]));n(Q=>Q===null?Q:{...Q,properties:Q.properties.map(D=>L.get(D.name)??D)})},[]),v=(t==null?void 0:t.capabilities.save)===!0,_=t==null?void 0:t.template,k=x.useCallback(async J=>{const L=await e.fixtures(J);n(D=>D===null?D:{...D,properties:L.properties});const Q=_===void 0?null:kle(J,L,c,{template:_});window.history.pushState({},"",Q===null?e.base:new URL(ru(Q),e.base).href),u(Q)},[e,_,c]),[S,E]=x.useState(!1),O=(p==null?void 0:p.kind)==="view"?p.view:null,[A,R]=x.useState(null),C=_le(A,p);C!==A&&R(C);const I=(t==null?void 0:t.capabilities.save)===!0?C:null,$=Xce({host:e,catalog:t,view:I,onSaved:w}),T=($==null?void 0:$.state)==="open"?$.opened:null,F=Mw(),[W]=x.useState(D$),[G]=x.useState(()=>new yN({defaultOptions:{queries:{retry:!1}}})),H=x.useRef(0),U=x.useMemo(()=>({status:{state:F.state,savedAt:F.savedAt},notes:W}),[F.state,F.savedAt,W]),{problems:z,report:K}=gle(e,t,{canvas:(T==null?void 0:T.notes)??null,facts:W}),N=Jce({host:e,catalog:t,catalogError:r,resolved:p,opening:$,onReplaceView:m,onSaved:w,facts:{cycle:F,notes:W,queryClient:G,scroll:H,kept:T}}),B=eue({host:e,catalog:t,opening:$,onReplaceView:m,onSaved:w,guides:S,onView:N.kind==="canvas",reportProblems:K}),Y=N.kind==="facts"&&O!==null?O.property:null;x.useEffect(()=>{vb(Y!==null?{property:Y,fixture:null}:T===null?null:{property:T.property,fixture:T.fixture})},[Y,T]),x.useEffect(()=>()=>vb(null),[]);const ie={page:N.kind,catalog:t,view:O,opened:T,factsSave:U,guides:S,onGuides:E,onView:g,problems:z,reportProblems:K,onFixtures:v?k:null};return h.jsxs(wQ,{store:(T==null?void 0:T.store)??null,children:[h.jsx(ule,{sections:$le,context:ie}),B,N.node]})}function Jce({host:e,catalog:t,catalogError:n,resolved:r,opening:i,onReplaceView:a,onSaved:c,facts:u}){const f=g=>({kind:"message",node:h.jsx(Uce,{children:g})});if(n)return f(h.jsxs(Jc,{children:["The playground could not load its catalog — ",n,`
|
|
1338
|
+
`,"Is the server still starting? Try refreshing."]}));if(!t)return f(h.jsx(mp,{label:"Loading the playground…"}));if(t.error!==void 0)return f(h.jsx(Jc,{testId:"catalog-error",children:t.error}));if(!t.capabilities.save)return f(h.jsx(Jc,{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(Pce,{testId:"no-fixtures",children:"There are no fixtures. Make a property from the control."}));if(r.kind==="replace")return f(h.jsx(mp,{label:"Opening the page…"}));if(r.kind==="unknown")return f(h.jsx(Jc,{testId:"unknown-fixture",children:r.message}));const{view:p}=r;if(p.page==="live")return{kind:"live",node:h.jsx(Hce,{host:e,view:p,onFollow:a})};if(!i1(p)){const{kept:g}=u;return{kind:"facts",node:h.jsx(Ece,{host:e,property:p.property,queryClient:u.queryClient,saveCycle:u.cycle,notes:u.notes,scroll:u.scroll,onSaved:c,onPropertyChanged:()=>g==null?void 0:g.backend.refresh()})}}return(i==null?void 0:i.state)==="failed"?f(h.jsxs(Jc,{testId:"bootstrap-error",children:['The fixture "',p.fixture,'" could not be opened: ',i.message]})):{kind:"canvas",node:null}}function eue({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(Bie,{children:h.jsx(Dce,{host:e,catalog:t,opened:n.opened,onView:r,onSaved:i,guides:a,beneath:!c,reportProblems:u})}):h.jsx($4,{children:h.jsx(mp,{label:"Opening the canvas…"})})})}const Y$=document.getElementById("root");if(!Y$)throw new Error("playground: #root missing from index.html");const Q$=Dle(document.baseURI);Lle(Q$);yD.createRoot(Y$).render(h.jsx(x.StrictMode,{children:h.jsx(Wce,{host:Q$})}));
|