(function(ne,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(ne=typeof globalThis<"u"?globalThis:ne||self,N(ne.Editor={},ne.React))})(this,function(ne,N){"use strict";function nt(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const B=nt(N);function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Me={exports:{}},he={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ir;function st(){if(ir)return he;ir=1;var e=N,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,c,u){var f,p={},g=null,y=null;u!==void 0&&(g=""+u),c.key!==void 0&&(g=""+c.key),c.ref!==void 0&&(y=c.ref);for(f in c)n.call(c,f)&&!s.hasOwnProperty(f)&&(p[f]=c[f]);if(l&&l.defaultProps)for(f in c=l.defaultProps,c)p[f]===void 0&&(p[f]=c[f]);return{$$typeof:r,type:l,key:g,ref:y,props:p,_owner:a.current}}return he.Fragment=t,he.jsx=i,he.jsxs=i,he}var ve={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lr;function at(){return lr||(lr=1,process.env.NODE_ENV!=="production"&&function(){var e=N,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),E=Symbol.iterator,h="@@iterator";function m(o){if(o===null||typeof o!="object")return null;var d=E&&o[E]||o[h];return typeof d=="function"?d:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(o){{for(var d=arguments.length,b=new Array(d>1?d-1:0),S=1;S=1&&F>=0&&C[z]!==$[F];)F--;for(;z>=1&&F>=0;z--,F--)if(C[z]!==$[F]){if(z!==1||F!==1)do if(z--,F--,F<0||C[z]!==$[F]){var q=` `+C[z].replace(" at new "," at ");return o.displayName&&q.includes("")&&(q=q.replace("",o.displayName)),typeof o=="function"&&Ae.set(o,q),q}while(z>=1&&F>=0);break}}}finally{er=!1,Ze.current=A,Mn(),Error.prepareStackTrace=T}var ge=o?o.displayName||o.name:"",le=ge?Te(ge):"";return typeof o=="function"&&Ae.set(o,le),le}function Nn(o,d,b){return Ur(o,!1)}function zn(o){var d=o.prototype;return!!(d&&d.isReactComponent)}function Ie(o,d,b){if(o==null)return"";if(typeof o=="function")return Ur(o,zn(o));if(typeof o=="string")return Te(o);switch(o){case u:return Te("Suspense");case f:return Te("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case c:return Nn(o.render);case p:return Ie(o.type,d,b);case g:{var S=o,T=S._payload,A=S._init;try{return Ie(A(T),d,b)}catch{}}}return""}var Ee=Object.prototype.hasOwnProperty,$r={},Br=x.ReactDebugCurrentFrame;function De(o){if(o){var d=o._owner,b=Ie(o.type,o._source,d?d.type:null);Br.setExtraStackFrame(b)}else Br.setExtraStackFrame(null)}function Wn(o,d,b,S,T){{var A=Function.call.bind(Ee);for(var k in o)if(A(o,k)){var C=void 0;try{if(typeof o[k]!="function"){var $=Error((S||"React class")+": "+b+" type `"+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[k]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $.name="Invariant Violation",$}C=o[k](d,k,S,b,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(z){C=z}C&&!(C instanceof Error)&&(De(T),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",S||"React class",b,k,typeof C),De(null)),C instanceof Error&&!(C.message in $r)&&($r[C.message]=!0,De(T),v("Failed %s type: %s",b,C.message),De(null))}}}var Fn=Array.isArray;function rr(o){return Fn(o)}function Vn(o){{var d=typeof Symbol=="function"&&Symbol.toStringTag,b=d&&o[Symbol.toStringTag]||o.constructor.name||"Object";return b}}function Gn(o){try{return Hr(o),!1}catch{return!0}}function Hr(o){return""+o}function Yr(o){if(Gn(o))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Vn(o)),Hr(o)}var _e=x.ReactCurrentOwner,Un={key:!0,ref:!0,__self:!0,__source:!0},qr,Kr,tr;tr={};function $n(o){if(Ee.call(o,"ref")){var d=Object.getOwnPropertyDescriptor(o,"ref").get;if(d&&d.isReactWarning)return!1}return o.ref!==void 0}function Bn(o){if(Ee.call(o,"key")){var d=Object.getOwnPropertyDescriptor(o,"key").get;if(d&&d.isReactWarning)return!1}return o.key!==void 0}function Hn(o,d){if(typeof o.ref=="string"&&_e.current&&d&&_e.current.stateNode!==d){var b=V(_e.current.type);tr[b]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',V(_e.current.type),o.ref),tr[b]=!0)}}function Yn(o,d){{var b=function(){qr||(qr=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};b.isReactWarning=!0,Object.defineProperty(o,"key",{get:b,configurable:!0})}}function qn(o,d){{var b=function(){Kr||(Kr=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};b.isReactWarning=!0,Object.defineProperty(o,"ref",{get:b,configurable:!0})}}var Kn=function(o,d,b,S,T,A,k){var C={$$typeof:r,type:o,key:d,ref:b,props:k,_owner:A};return C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(C,"_self",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.defineProperty(C,"_source",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C};function Jn(o,d,b,S,T){{var A,k={},C=null,$=null;b!==void 0&&(Yr(b),C=""+b),Bn(d)&&(Yr(d.key),C=""+d.key),$n(d)&&($=d.ref,Hn(d,T));for(A in d)Ee.call(d,A)&&!Un.hasOwnProperty(A)&&(k[A]=d[A]);if(o&&o.defaultProps){var z=o.defaultProps;for(A in z)k[A]===void 0&&(k[A]=z[A])}if(C||$){var F=typeof o=="function"?o.displayName||o.name||"Unknown":o;C&&Yn(k,F),$&&qn(k,F)}return Kn(o,C,$,T,S,_e.current,k)}}var nr=x.ReactCurrentOwner,Jr=x.ReactDebugCurrentFrame;function me(o){if(o){var d=o._owner,b=Ie(o.type,o._source,d?d.type:null);Jr.setExtraStackFrame(b)}else Jr.setExtraStackFrame(null)}var or;or=!1;function sr(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}function Xr(){{if(nr.current){var o=V(nr.current.type);if(o)return` Check the render method of \``+o+"`."}return""}}function Xn(o){return""}var Zr={};function Zn(o){{var d=Xr();if(!d){var b=typeof o=="string"?o:o.displayName||o.name;b&&(d=` Check the top-level render call using <`+b+">.")}return d}}function Qr(o,d){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var b=Zn(d);if(Zr[b])return;Zr[b]=!0;var S="";o&&o._owner&&o._owner!==nr.current&&(S=" It was passed a child from "+V(o._owner.type)+"."),me(o),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,S),me(null)}}function et(o,d){{if(typeof o!="object")return;if(rr(o))for(var b=0;b",C=" Did you accidentally export a JSX literal instead of a component?"):z=typeof o,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",z,C)}var F=Jn(o,d,b,T,A);if(F==null)return F;if(k){var q=d.children;if(q!==void 0)if(S)if(rr(q)){for(var ge=0;ge0?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}";if(!rt[le+ar]){var so=H.length>0?"{"+H.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,ar,le,so,le),rt[le+ar]=!0}}return o===n?eo(F):Qn(F),F}}function ro(o,d,b){return tt(o,d,b,!0)}function to(o,d,b){return tt(o,d,b,!1)}var no=to,oo=ro;ve.Fragment=n,ve.jsx=no,ve.jsxs=oo}()),ve}process.env.NODE_ENV==="production"?Me.exports=st():Me.exports=at();var w=Me.exports;function it(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function lt(...e){return r=>e.forEach(t=>it(t,r))}var cr=B.forwardRef((e,r)=>{const{children:t,...n}=e,a=B.Children.toArray(t),s=a.find(ut);if(s){const i=s.props.children,l=a.map(c=>c===s?B.Children.count(i)>1?B.Children.only(null):B.isValidElement(i)?i.props.children:null:c);return w.jsx(Le,{...n,ref:r,children:B.isValidElement(i)?B.cloneElement(i,void 0,l):null})}return w.jsx(Le,{...n,ref:r,children:t})});cr.displayName="Slot";var Le=B.forwardRef((e,r)=>{const{children:t,...n}=e;if(B.isValidElement(t)){const a=ft(t);return B.cloneElement(t,{...dt(n,t.props),ref:r?lt(r,a):a})}return B.Children.count(t)>1?B.Children.only(null):null});Le.displayName="SlotClone";var ct=({children:e})=>w.jsx(w.Fragment,{children:e});function ut(e){return B.isValidElement(e)&&e.type===ct}function dt(e,r){const t={...r};for(const n in r){const a=e[n],s=r[n];/^on[A-Z]/.test(n)?a&&s?t[n]=(...l)=>{s(...l),a(...l)}:a&&(t[n]=a):n==="style"?t[n]={...a,...s}:n==="className"&&(t[n]=[a,s].filter(Boolean).join(" "))}return{...e,...t}}function ft(e){var n,a;let r=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}function ur(e){var r,t,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;rtypeof e=="boolean"?"".concat(e):e===0?"0":e,fr=pt,mt=(e,r)=>t=>{var n;if((r==null?void 0:r.variants)==null)return fr(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:a,defaultVariants:s}=r,i=Object.keys(a).map(u=>{const f=t==null?void 0:t[u],p=s==null?void 0:s[u];if(f===null)return null;const g=dr(f)||dr(p);return a[u][g]}),l=t&&Object.entries(t).reduce((u,f)=>{let[p,g]=f;return g===void 0||(u[p]=g),u},{}),c=r==null||(n=r.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:p,className:g,...y}=f;return Object.entries(y).every(E=>{let[h,m]=E;return Array.isArray(m)?m.includes({...s,...l}[h]):{...s,...l}[h]===m})?[...u,p,g]:u},[]);return fr(e,i,c,t==null?void 0:t.class,t==null?void 0:t.className)};function pr(e){var r,t,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(r=0;r{const r=bt(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const l=i.split(Ne);return l[0]===""&&l.length!==1&&l.shift(),mr(l,r)||vt(i)},getConflictingClassGroupIds:(i,l)=>{const c=t[i]||[];return l&&n[i]?[...c,...n[i]]:c}}},mr=(e,r)=>{var i;if(e.length===0)return r.classGroupId;const t=e[0],n=r.nextPart.get(t),a=n?mr(e.slice(1),n):void 0;if(a)return a;if(r.validators.length===0)return;const s=e.join(Ne);return(i=r.validators.find(({validator:l})=>l(s)))==null?void 0:i.classGroupId},gr=/^\[(.+)\]$/,vt=e=>{if(gr.test(e)){const r=gr.exec(e)[1],t=r==null?void 0:r.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},bt=e=>{const{theme:r,prefix:t}=e,n={nextPart:new Map,validators:[]};return wt(Object.entries(e.classGroups),t).forEach(([s,i])=>{ze(i,n,s,r)}),n},ze=(e,r,t,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?r:hr(r,a);s.classGroupId=t;return}if(typeof a=="function"){if(yt(a)){ze(a(n),r,t,n);return}r.validators.push({validator:a,classGroupId:t});return}Object.entries(a).forEach(([s,i])=>{ze(i,hr(r,s),t,n)})})},hr=(e,r)=>{let t=e;return r.split(Ne).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},yt=e=>e.isThemeGetter,wt=(e,r)=>r?e.map(([t,n])=>{const a=n.map(s=>typeof s=="string"?r+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[r+i,l])):s);return[t,a]}):e,xt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,n=new Map;const a=(s,i)=>{t.set(s,i),r++,r>e&&(r=0,n=t,t=new Map)};return{get(s){let i=t.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return a(s,i),i},set(s,i){t.has(s)?t.set(s,i):a(s,i)}}},vr="!",St=e=>{const{separator:r,experimentalParseClassName:t}=e,n=r.length===1,a=r[0],s=r.length,i=l=>{const c=[];let u=0,f=0,p;for(let m=0;mf?p-f:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:E,maybePostfixModifierPosition:h}};return t?l=>t({className:l,parseClassName:i}):i},Et=e=>{if(e.length<=1)return e;const r=[];let t=[];return e.forEach(n=>{n[0]==="["?(r.push(...t.sort(),n),t=[]):t.push(n)}),r.push(...t.sort()),r},_t=e=>({cache:xt(e.cacheSize),parseClassName:St(e),...ht(e)}),Ot=/\s+/,Rt=(e,r)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:a}=r,s=[],i=e.trim().split(Ot);let l="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=t(u);let E=!!y,h=n(E?g.substring(0,y):g);if(!h){if(!E){l=u+(l.length>0?" "+l:l);continue}if(h=n(g),!h){l=u+(l.length>0?" "+l:l);continue}E=!1}const m=Et(f).join(":"),x=p?m+vr:m,v=x+h;if(s.includes(v))continue;s.push(v);const _=a(h,E);for(let O=0;O<_.length;++O){const M=_[O];s.push(x+M)}l=u+(l.length>0?" "+l:l)}return l};function Ct(){let e=0,r,t,n="";for(;e{if(typeof e=="string")return e;let r,t="";for(let n=0;np(f),e());return t=_t(u),n=t.cache.get,a=t.cache.set,s=l,l(c)}function l(c){const u=n(c);if(u)return u;const f=Rt(c,t);return a(c,f),f}return function(){return s(Ct.apply(null,arguments))}}const D=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},yr=/^\[(?:([a-z-]+):)?(.+)\]$/i,jt=/^\d+\/\d+$/,Pt=new Set(["px","full","screen"]),Tt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,At=/\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$/,It=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Dt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Z=e=>ce(e)||Pt.has(e)||jt.test(e),oe=e=>ue(e,"length",Ut),ce=e=>!!e&&!Number.isNaN(Number(e)),We=e=>ue(e,"number",ce),be=e=>!!e&&Number.isInteger(Number(e)),Lt=e=>e.endsWith("%")&&ce(e.slice(0,-1)),R=e=>yr.test(e),se=e=>Tt.test(e),Nt=new Set(["length","size","percentage"]),zt=e=>ue(e,Nt,wr),Wt=e=>ue(e,"position",wr),Ft=new Set(["image","url"]),Vt=e=>ue(e,Ft,Bt),Gt=e=>ue(e,"",$t),ye=()=>!0,ue=(e,r,t)=>{const n=yr.exec(e);return n?n[1]?typeof r=="string"?n[1]===r:r.has(n[1]):t(n[2]):!1},Ut=e=>At.test(e)&&!It.test(e),wr=()=>!1,$t=e=>Dt.test(e),Bt=e=>Mt.test(e),Ht=kt(()=>{const e=D("colors"),r=D("spacing"),t=D("blur"),n=D("brightness"),a=D("borderColor"),s=D("borderRadius"),i=D("borderSpacing"),l=D("borderWidth"),c=D("contrast"),u=D("grayscale"),f=D("hueRotate"),p=D("invert"),g=D("gap"),y=D("gradientColorStops"),E=D("gradientColorStopPositions"),h=D("inset"),m=D("margin"),x=D("opacity"),v=D("padding"),_=D("saturate"),O=D("scale"),M=D("sepia"),j=D("skew"),L=D("space"),G=D("translate"),W=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],re=()=>["auto",R,r],P=()=>[R,r],V=()=>["",Z,oe],U=()=>["auto",ce,R],X=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",R],Se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[ce,R];return{cacheSize:500,separator:":",theme:{colors:[ye],spacing:[Z,oe],blur:["none","",se,R],brightness:Y(),borderColor:[e],borderRadius:["none","","full",se,R],borderSpacing:P(),borderWidth:V(),contrast:Y(),grayscale:ae(),hueRotate:Y(),invert:ae(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Lt,oe],inset:re(),margin:re(),opacity:Y(),padding:P(),saturate:Y(),scale:Y(),sepia:ae(),skew:Y(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[se]}],"break-after":[{"break-after":Se()}],"break-before":[{"break-before":Se()}],"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"],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:[...X(),R]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,R]}],basis:[{basis:re()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",be,R]}],"grid-cols":[{"grid-cols":[ye]}],"col-start-end":[{col:["auto",{span:["full",be,R]},R]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ye]}],"row-start-end":[{row:["auto",{span:[be,R]},R]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,r]}],"min-w":[{"min-w":[R,r,"min","max","fit"]}],"max-w":[{"max-w":[R,r,"none","full","min","max","fit","prose",{screen:[se]},se]}],h:[{h:[R,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,r,"auto","min","max","fit"]}],"font-size":[{text:["base",se,oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",We]}],"font-family":[{font:[ye]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",ce,We]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Z,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Z,oe]}],"underline-offset":[{"underline-offset":["auto",Z,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...X(),Wt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Vt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:J()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Z,R]}],"outline-w":[{outline:[Z,oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Z,oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",se,Gt]}],"shadow-color":[{shadow:[ye]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",se,R]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[be,R]}],"translate-x":[{"translate-x":[G]}],"translate-y":[{"translate-y":[G]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Z,oe,We]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function Q(...e){return Ht(gt(e))}const Fe=qt(1,2,3,4);function Yt(e){return{Procedural:Ve(4,Fe),ProceduralPersonal:Uint8Array.from([0,0,0,0,0,0,0,...Ve(1,Fe)]),ProceduralAccount:Ve(32,Fe)}[e]}function we(e){return e.join(",")}function de(e){const r=Yt(e),t=new Map;for(t.set(we(r),r);t.size<16;){const n=new Uint8Array(r);if(e==="ProceduralPersonal"){const s=r.slice(-4);xr(Math.floor(Math.random()*3)+1)(s),n.set(s,n.length-4)}else xr(Math.floor(Math.random()*3)+1)(n);t.has(we(n))||t.set(we(n),n)}return[...t.values()]}function Ve(e,r){const t=new Uint8Array(e);for(let n=0;n>>9,r=t+(t<<3)|0,t=t<<21|t>>>11,t=t+a|0,(a>>>0)/4294967296}}function xr(e){return r=>{for(let t=0;t{const i=n?cr:"button";return w.jsx(i,{className:Q(Kt({variant:r,size:t,className:e})),ref:s,...a})});ee.displayName="Button";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */const Sr=Symbol("Comlink.proxy"),Jt=Symbol("Comlink.endpoint"),Xt=Symbol("Comlink.releaseProxy"),Ge=Symbol("Comlink.finalizer"),Oe=Symbol("Comlink.thrown"),Er=e=>typeof e=="object"&&e!==null||typeof e=="function",Zt={canHandle:e=>Er(e)&&e[Sr],serialize(e){const{port1:r,port2:t}=new MessageChannel;return Or(e,r),[t,[t]]},deserialize(e){return e.start(),Cr(e)}},Qt={canHandle:e=>Er(e)&&Oe in e,serialize({value:e}){let r;return e instanceof Error?r={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:r={isError:!1,value:e},[r,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},_r=new Map([["proxy",Zt],["throw",Qt]]);function en(e,r){for(const t of e)if(r===t||t==="*"||t instanceof RegExp&&t.test(r))return!0;return!1}function Or(e,r=globalThis,t=["*"]){r.addEventListener("message",function n(a){if(!a||!a.data)return;if(!en(t,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:s,type:i,path:l}=Object.assign({path:[]},a.data),c=(a.data.argumentList||[]).map(ie);let u;try{const f=l.slice(0,-1).reduce((g,y)=>g[y],e),p=l.reduce((g,y)=>g[y],e);switch(i){case"GET":u=p;break;case"SET":f[l.slice(-1)[0]]=ie(a.data.value),u=!0;break;case"APPLY":u=p.apply(f,c);break;case"CONSTRUCT":{const g=new p(...c);u=sn(g)}break;case"ENDPOINT":{const{port1:g,port2:y}=new MessageChannel;Or(e,y),u=Tr(g,[g])}break;case"RELEASE":u=void 0;break;default:return}}catch(f){u={value:f,[Oe]:0}}Promise.resolve(u).catch(f=>({value:f,[Oe]:0})).then(f=>{const[p,g]=je(f);r.postMessage(Object.assign(Object.assign({},p),{id:s}),g),i==="RELEASE"&&(r.removeEventListener("message",n),Rr(r),Ge in e&&typeof e[Ge]=="function"&&e[Ge]())}).catch(f=>{const[p,g]=je({value:new TypeError("Unserializable return value"),[Oe]:0});r.postMessage(Object.assign(Object.assign({},p),{id:s}),g)})}),r.start&&r.start()}function rn(e){return e.constructor.name==="MessagePort"}function Rr(e){rn(e)&&e.close()}function Cr(e,r){return Ue(e,[],r)}function Re(e){if(e)throw new Error("Proxy has been released and is not useable")}function kr(e){return fe(e,{type:"RELEASE"}).then(()=>{Rr(e)})}const Ce=new WeakMap,ke="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const r=(Ce.get(e)||0)-1;Ce.set(e,r),r===0&&kr(e)});function tn(e,r){const t=(Ce.get(r)||0)+1;Ce.set(r,t),ke&&ke.register(e,r,e)}function nn(e){ke&&ke.unregister(e)}function Ue(e,r=[],t=function(){}){let n=!1;const a=new Proxy(t,{get(s,i){if(Re(n),i===Xt)return()=>{nn(a),kr(e),n=!0};if(i==="then"){if(r.length===0)return{then:()=>a};const l=fe(e,{type:"GET",path:r.map(c=>c.toString())}).then(ie);return l.then.bind(l)}return Ue(e,[...r,i])},set(s,i,l){Re(n);const[c,u]=je(l);return fe(e,{type:"SET",path:[...r,i].map(f=>f.toString()),value:c},u).then(ie)},apply(s,i,l){Re(n);const c=r[r.length-1];if(c===Jt)return fe(e,{type:"ENDPOINT"}).then(ie);if(c==="bind")return Ue(e,r.slice(0,-1));const[u,f]=jr(l);return fe(e,{type:"APPLY",path:r.map(p=>p.toString()),argumentList:u},f).then(ie)},construct(s,i){Re(n);const[l,c]=jr(i);return fe(e,{type:"CONSTRUCT",path:r.map(u=>u.toString()),argumentList:l},c).then(ie)}});return tn(a,e),a}function on(e){return Array.prototype.concat.apply([],e)}function jr(e){const r=e.map(je);return[r.map(t=>t[0]),on(r.map(t=>t[1]))]}const Pr=new WeakMap;function Tr(e,r){return Pr.set(e,r),e}function sn(e){return Object.assign(e,{[Sr]:!0})}function je(e){for(const[r,t]of _r)if(t.canHandle(e)){const[n,a]=t.serialize(e);return[{type:"HANDLER",name:r,value:n},a]}return[{type:"RAW",value:e},Pr.get(e)||[]]}function ie(e){switch(e.type){case"HANDLER":return _r.get(e.name).deserialize(e.value);case"RAW":return e.value}}function fe(e,r,t){return new Promise(n=>{const a=an();e.addEventListener("message",function s(i){!i.data||!i.data.id||i.data.id!==a||(e.removeEventListener("message",s),n(i.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},r),t)})}function an(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const ln={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Ar=e=>{let r;const t=new Set,n=(f,p)=>{const g=typeof f=="function"?f(r):f;if(!Object.is(g,r)){const y=r;r=p??(typeof g!="object"||g===null)?g:Object.assign({},r,g),t.forEach(E=>E(r,y))}},a=()=>r,c={setState:n,getState:a,getInitialState:()=>u,subscribe:f=>(t.add(f),()=>t.delete(f)),destroy:()=>{(ln?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=r=e(n,a,c);return c},cn=e=>e?Ar(e):Ar;var $e={exports:{}},Be={},Pe={exports:{}},He={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ir;function un(){if(Ir)return He;Ir=1;var e=N;function r(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var t=typeof Object.is=="function"?Object.is:r,n=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(p,g){var y=g(),E=n({inst:{value:y,getSnapshot:g}}),h=E[0].inst,m=E[1];return s(function(){h.value=y,h.getSnapshot=g,c(h)&&m({inst:h})},[p,y,g]),a(function(){return c(h)&&m({inst:h}),p(function(){c(h)&&m({inst:h})})},[p]),i(y),y}function c(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!t(p,y)}catch{return!0}}function u(p,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return He.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,He}var Ye={};/** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dr;function dn(){return Dr||(Dr=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=N,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(_){{for(var O=arguments.length,M=new Array(O>1?O-1:0),j=1;je;function yn(e,r=bn,t){(Wr?"production":void 0)!=="production"&&t&&!Fr&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Fr=!0);const n=vn(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,t);return hn(n),n}const wn=e=>{(Wr?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const r=typeof e=="function"?cn(e):e,t=(n,a)=>yn(r,n,a);return Object.assign(t,r),t},xn=e=>wn,Sn={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function En(e,r){let t;try{t=e()}catch{return}return{getItem:a=>{var s;const i=c=>c===null?null:JSON.parse(c,void 0),l=(s=t.getItem(a))!=null?s:null;return l instanceof Promise?l.then(i):i(l)},setItem:(a,s)=>t.setItem(a,JSON.stringify(s,void 0)),removeItem:a=>t.removeItem(a)}}const xe=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(n){return xe(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return xe(n)(t)}}}},_n=(e,r)=>(t,n,a)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:m=>m,version:0,merge:(m,x)=>({...x,...m}),...r},i=!1;const l=new Set,c=new Set;let u;try{u=s.getStorage()}catch{}if(!u)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...m)},n,a);const f=xe(s.serialize),p=()=>{const m=s.partialize({...n()});let x;const v=f({state:m,version:s.version}).then(_=>u.setItem(s.name,_)).catch(_=>{x=_});if(x)throw x;return v},g=a.setState;a.setState=(m,x)=>{g(m,x),p()};const y=e((...m)=>{t(...m),p()},n,a);let E;const h=()=>{var m;if(!u)return;i=!1,l.forEach(v=>v(n()));const x=((m=s.onRehydrateStorage)==null?void 0:m.call(s,n()))||void 0;return xe(u.getItem.bind(u))(s.name).then(v=>{if(v)return s.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return s.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var _;return E=s.merge(v,(_=n())!=null?_:y),t(E,!0),p()}).then(()=>{x==null||x(E,void 0),i=!0,c.forEach(v=>v(E))}).catch(v=>{x==null||x(void 0,v)})};return a.persist={setOptions:m=>{s={...s,...m},m.getStorage&&(u=m.getStorage())},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>h(),hasHydrated:()=>i,onHydrate:m=>(l.add(m),()=>{l.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},h(),E||y},On=(e,r)=>(t,n,a)=>{let s={storage:En(()=>localStorage),partialize:h=>h,version:0,merge:(h,m)=>({...m,...h}),...r},i=!1;const l=new Set,c=new Set;let u=s.storage;if(!u)return e((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...h)},n,a);const f=()=>{const h=s.partialize({...n()});return u.setItem(s.name,{state:h,version:s.version})},p=a.setState;a.setState=(h,m)=>{p(h,m),f()};const g=e((...h)=>{t(...h),f()},n,a);a.getInitialState=()=>g;let y;const E=()=>{var h,m;if(!u)return;i=!1,l.forEach(v=>{var _;return v((_=n())!=null?_:g)});const x=((m=s.onRehydrateStorage)==null?void 0:m.call(s,(h=n())!=null?h:g))||void 0;return xe(u.getItem.bind(u))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return[!0,s.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var _;const[O,M]=v;if(y=s.merge(M,(_=n())!=null?_:g),t(y,!0),O)return f()}).then(()=>{x==null||x(y,void 0),y=n(),i=!0,c.forEach(v=>v(y))}).catch(v=>{x==null||x(void 0,v)})};return a.persist={setOptions:h=>{s={...s,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>i,onHydrate:h=>(l.add(h),()=>{l.delete(h)}),onFinishHydration:h=>(c.add(h),()=>{c.delete(h)})},s.skipHydration||E(),y||g},Rn=(e,r)=>"getStorage"in r||"serialize"in r||"deserialize"in r?((Sn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_n(e,r)):On(e,r),Ke=["horizontal","vertical","grid","single","families"],I=xn()(Rn((e,r)=>{const t=Array(8).fill(1),n={Procedural:t.map(()=>de("Procedural")),ProceduralPersonal:t.map(()=>de("ProceduralPersonal")),ProceduralAccount:t.map(()=>de("ProceduralAccount"))};return{worker:null,schema:null,schemas:[],showControls:!0,seeds:n,showDetails:!1,focus:[0,0],familyIndex:0,focusIndex:0,toggleDetails(){e({showDetails:!r().showDetails})},setFocus(a,s){e({familyIndex:a,focusIndex:s})},refreshSeeds(){e({seeds:{Procedural:t.map(()=>de("Procedural")),ProceduralPersonal:t.map(()=>de("ProceduralPersonal")),ProceduralAccount:t.map(()=>de("ProceduralAccount"))}})},toggleControls(){e({showControls:!r().showControls})},async init(a){const s=Cr(a),i=await s.init();if(i.length===0)throw new Error("No schemas found");const l=r().schema;l&&i.find(c=>c.name===l.name)?e({schema:l}):e({schema:i[0]}),e({worker:s,schemas:i})},setSchema(a){const s=r().schemas.find(i=>i.name===a);e({schema:s})},mode:"horizontal",cycleMode(){const a=r().mode,i=(Ke.indexOf(a)+1)%Ke.length;e({mode:Ke[i]})}}},{name:"entropretty-editor-state",partialize:e=>({mode:e.mode,showControls:e.showControls,schema:e.schema,showDetails:e.showDetails,focusIndex:e.focusIndex,familyIndex:e.familyIndex})})),Cn=()=>{const e=I(c=>c.cycleMode),r=I(c=>c.mode),t=I(c=>c.schema),n=I(c=>c.showControls),a=I(c=>c.toggleControls),s=I(c=>c.refreshSeeds),i=I(c=>c.toggleDetails),l=N.useCallback(()=>{const c=document.getElementById("focus-canvas");if(!c)return;const u=document.createElement("a");u.href=c.toDataURL("image/png"),u.download=((t==null?void 0:t.name)||"entropretty")+".png",u.click()},[t==null?void 0:t.name]);return N.useEffect(()=>{const c=u=>{u.key==="q"&&e(),u.key==="w"&&a(),u.key==="r"&&location.reload(),u.key==="d"&&i()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[e,a,i]),t?w.jsxs(w.Fragment,{children:[w.jsxs("nav",{className:Q("bg-background/95 supports-[backdrop-filter]:bg-background/30 fixed bottom-4 left-4 flex flex-row items-center justify-center overflow-hidden rounded-md border text-sm backdrop-blur transition-all duration-300 ease-in-out",{hidden:!n}),children:[w.jsx("div",{className:Q("flex h-10 w-fit flex-row items-center justify-center rounded-r-md px-4",{"bg-yellow-400":t.kind==="Procedural","bg-blue-400":t.kind==="ProceduralAccount","bg-red-400":t.kind==="ProceduralPersonal"}),children:t==null?void 0:t.kind}),w.jsxs("div",{className:"flex flex-row px-[2px]",children:[w.jsx(ee,{variant:"ghost",className:"w-36",onClick:e,children:`(q) ${r}`}),w.jsx(ee,{variant:"ghost",onClick:a,children:"(w) hide"}),w.jsx(ee,{variant:"ghost",children:"(r) reload"}),w.jsx(ee,{variant:"ghost",onMouseDown:i,children:"(d) details"}),w.jsx(ee,{variant:"ghost",onMouseDown:s,children:"new seeds"}),w.jsx(ee,{disabled:["families","grid"].includes(r),variant:"ghost",onMouseDown:l,children:"download"})]})]}),!n&&w.jsx(ee,{variant:"ghost",onMouseDown:a,className:"text-muted-foreground fixed bottom-4 left-4 h-10 text-sm",children:"show"})]}):null},Je=({seed:e,schema:r,size:t,scale:n=2,id:a})=>{const[s,i]=N.useState(!1),l=N.useRef(null),c=I(f=>f.worker),u=N.useMemo(()=>t*n,[t,n]);return N.useEffect(()=>{l.current!==null&&c.drawTransfer(r,e,u).then(f=>{const p=l.current.getContext("2d");p.clearRect(0,0,u,u),p.drawImage(f,0,0,u,u),i(!0)})},[e,r,t,c,u]),w.jsx("canvas",{id:a,className:Q("cursor-pointer",{hidden:!s}),ref:l,width:u,height:u,style:{width:t,height:t}})},Xe=({familyIndex:e,seedIndex:r,seed:t})=>{const[n,a]=I(u=>[u.familyIndex,u.focusIndex]),s=I(u=>u.schema),i=I(u=>u.setFocus),l=I(u=>u.showDetails),c=N.useCallback(()=>{i(e,r)},[e,r,i]);return w.jsxs(w.Fragment,{children:[l&&w.jsxs("div",{className:"bg-background/50 absolute bottom-0 left-0 flex h-full w-full whitespace-normal border text-[9px]",children:["[",t.join(", "),"]"]}),l&&w.jsx("div",{className:"absolute left-0 top-0 flex h-full w-full items-center justify-center",children:"×"}),w.jsx("div",{title:t.join(","),className:Q("absolute bottom-0 h-full w-full cursor-pointer border-b-4",{"opacity-0":e!==n||r!==a,"border-b-yellow-400":(s==null?void 0:s.kind)==="Procedural","border-b-blue-400":(s==null?void 0:s.kind)==="ProceduralAccount","border-b-red-400":(s==null?void 0:s.kind)==="ProceduralPersonal"}),onClick:c})]})},kn=({familyIndex:e})=>{const[r]=I(n=>[n.familyIndex]),t=I(n=>n.schema);return w.jsx(w.Fragment,{children:w.jsx("div",{className:Q("pointer-events-none absolute h-full w-full rounded-md border",{"opacity-0":e!==r,"border-yellow-400":(t==null?void 0:t.kind)==="Procedural","border-blue-400":(t==null?void 0:t.kind)==="ProceduralAccount","border-red-400":(t==null?void 0:t.kind)==="ProceduralPersonal"})})})};function jn({schema:e}){const r=I(i=>i.seeds[e.kind]),[t]=I(i=>[i.familyIndex]),n=I(i=>i.mode),[a,s]=N.useMemo(()=>{const i=window.innerWidth||1e3,l=window.innerHeight||1e3,c={horizontal:i/2,vertical:l/2,grid:0,single:lw.jsx("div",{children:w.jsxs("div",{className:"grid-cols-16 relative grid",children:[i.map((c,u)=>w.jsxs("div",{className:"relative overflow-hidden",children:[w.jsx(Je,{schema:e.name,seed:c,size:s}),w.jsx(Xe,{familyIndex:l,seedIndex:u,seed:c})]},we(c))),w.jsx(kn,{familyIndex:l})]})},i.toString())),r&&n!=="families"&&w.jsxs("div",{className:Q("flex items-start justify-start",{"flex-row":n==="horizontal","flex-col":n==="vertical"}),children:[w.jsx(Pn,{schema:e,size:a}),n!=="single"&&w.jsx("div",{className:"grid grid-cols-4",children:r[t].map((i,l)=>w.jsxs("div",{className:"relative",children:[w.jsx(Je,{schema:e.name,seed:i,size:s}),w.jsx(Xe,{familyIndex:t,seedIndex:l,seed:i})]},we(i)))})]})]})}function Pn({schema:e,size:r}){const t=I(s=>s.seeds[e.kind]),[n,a]=I(s=>[s.familyIndex,s.focusIndex]);return w.jsxs("div",{className:"relative overflow-hidden",children:[w.jsx(Je,{id:"focus-canvas",schema:e.name,seed:t[n][a],size:r}),w.jsx(Xe,{familyIndex:n,seedIndex:a,seed:t[n][a]})]})}const Tn=()=>{const e=I(a=>a.schemas),r=I(a=>a.schema),t=I(a=>a.setSchema),n=I(a=>a.showControls);return w.jsx("aside",{className:Q("bg-background/95 supports-[backdrop-filter]:bg-background/30 fixed left-4 top-4 flex h-10 flex-row items-center justify-center rounded-md border backdrop-blur transition-all duration-300 ease-in-out",{hidden:!n||e.length<=1}),children:e.map(a=>w.jsx(ee,{className:Q({underline:(r==null?void 0:r.name)===a.name}),variant:(r==null?void 0:r.name)===a.name?"link":"ghost",onClick:()=>t(a.name),children:`${a.name}`},a.name))})},An=({worker:e})=>{const r=I(a=>a.init),t=I(a=>a.worker),n=I(a=>a.schema);return N.useEffect(()=>{r(e)},[r,e]),t?w.jsxs("main",{className:"flex h-screen w-screen flex-col items-center justify-center",children:[n&&w.jsx(jn,{schema:n}),w.jsx(Cn,{}),w.jsx(Tn,{})]}):(console.info("Worker not set"),w.jsx("div",{children:"Loading..."}))},In=e=>{const r=new Map;let t=!1;return{init:async()=>{const n=[];return await Promise.all(Object.values(e).map(async a=>{try{const i=(await a()).schema;r.set(i.name,i);const{draw:l,...c}=i;c.kind===void 0&&(console.warn(`Schema kind for '${c.name}' not defined, defaulting to 'Procedural'`),c.kind="Procedural"),n.push(c)}catch(s){console.log({e:s})}})),t=!0,Array.from(n).sort((a,s)=>a.name.localeCompare(s.name))},isInitialized:()=>t,hasSchema:n=>r.has(n),drawTransfer:async(n,a,s)=>{const i=new OffscreenCanvas(s,s),l=i.getContext("2d");if(!l)throw"Unable to get Context from OffscreenCanvas in Worker";const c=r.get(n);if(c===void 0)throw"Schema not loaded, try adding it before drawing";l.clearRect(0,0,i.width,i.height),l.scale(i.width/100,i.width/100),l.lineWidth=1,l.lineCap="butt",l.lineJoin="miter",l.strokeStyle="black",l.fillStyle="black",l.textAlign="center",l.textBaseline="bottom";try{c.draw(l,a)}catch(f){console.error("Error drawing",n),console.info(f)}const u=i.transferToImageBitmap();return Tr(u,[u])}}};ne.EntroprettyEditor=An,ne.createWorker=In,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});