OwlCyberSecurity - MANAGER
Edit File: extendify-library-4c69fcb3b8215b8834a9.js
(()=>{var t,e,n={250:(t,e,n)=>{"use strict";var r=n(196),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!o(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=i({inst:{value:n,getSnapshot:e}}),o=r[0].inst,c=r[1];return a((function(){o.value=n,o.getSnapshot=e,u(o)&&c({inst:o})}),[t,n,e]),s((function(){return u(o)&&c({inst:o}),t((function(){u(o)&&c({inst:o})}))}),[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},139:(t,e,n)=>{"use strict";var r=n(196),o=n(688),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=o.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,o){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u((function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==o&&h.hasValue){var e=h.value;if(o(e,t))return a=e}return a=t}if(e=a,i(s,t))return e;var n=r(t);return void 0!==o&&o(e,n)?e:(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]}),[e,n,r,o]);var p=s(t,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),c(p),p}},688:(t,e,n)=>{"use strict";t.exports=n(250)},798:(t,e,n)=>{"use strict";t.exports=n(139)},196:t=>{"use strict";t.exports=window.React},967:(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,i(n)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)r.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(n=function(){return o}.apply(e,[]))||(t.exports=n)}()}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;"object"==typeof a&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach((t=>s[t]=()=>n[t]));return s.default=()=>n,o.d(i,s),i},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=o(196),e=o.t(t,2),n=o.n(t);const r=window.wp.element,i=window.wp.plugins,s=window.wp.i18n,a=(0,r.forwardRef)((function({icon:t,size:e=24,...n},o){return(0,r.cloneElement)(t,{width:e,height:e,...n,ref:o})})),l=(0,t.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{clipRule:"evenodd",d:"m13.505 4h3.3044c.936 0 1.2747.10161 1.6171.29127.3424.19042.6102.46965.7934.82489.1831.356.2801.70824.2801 1.6814v3.43584c0 .9731-.0977 1.3254-.2801 1.6814-.1832.356-.4517.6344-.7934.8248-.153.0852-.3057.1552-.5112.2054v2.7344c0 1.503-.151 2.047-.4327 2.5968-.2828.5498-.6976.9799-1.2252 1.274-.5288.294-1.052.4498-2.4975.4498h-5.10341c-1.44549 0-1.96869-.1569-2.49747-.4498-.52878-.2941-.94242-.7254-1.22526-1.274-.28284-.5487-.43376-1.0938-.43376-2.5968v-5.3051c0-1.50301.15092-2.04701.43264-2.59682.28284-.54981.6976-.98106 1.22638-1.27514.52767-.29293 1.05198-.44985 2.49747-.44985h2.18511c.041-.44652.1265-.69015.2522-.93557.1832-.356.4517-.63523.7941-.82565.3417-.18966.6812-.29127 1.6171-.29127zm-1.6984 2.18698c0-.63769.4973-1.15464 1.1106-1.15464h4.4793c.6133 0 1.1106.51695 1.1106 1.15464v4.65692c0 .6377-.4973 1.1547-1.1106 1.1547h-4.4793c-.6133 0-1.1106-.517-1.1106-1.1547z",fill:"currentColor",fillRule:"evenodd"})),u=t=>{let e;const n=new Set,r=(t,r)=>{const o="function"==typeof t?t(e):t;if(!Object.is(o,e)){const t=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),n.forEach((n=>n(e,t)))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{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."),n.clear()}},s=e=t(r,o,i);return i};var c=o(798);const{useDebugValue:d}=t,{useSyncExternalStoreWithSelector:h}=c;let p=!1;const f=t=>t,m=t=>{"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?u(t):u)(t):t,n=(t,n)=>function(t,e=f,n){n&&!p&&(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"),p=!0);const r=h(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return d(r),r}(e,t,n);return Object.assign(n,e),n},g=t=>t?m(t):m,y=new Map,v=t=>{const e=y.get(t);return e?Object.fromEntries(Object.entries(e.stores).map((([t,e])=>[t,e.getState()]))):{}},w=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function b(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const o=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),i=null!=(r=n.getItem(t))?r:null;return i instanceof Promise?i.then(o):o(i)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const x=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then:t=>x(t)(n),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>x(e)(t)}}},E=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch(t){}if(!u)return t(((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...t)}),r,o);const c=x(i.serialize),d=()=>{const t=i.partialize({...r()});let e;const n=c({state:t,version:i.version}).then((t=>u.setItem(i.name,t))).catch((t=>{e=t}));if(e)throw e;return n},h=o.setState;o.setState=(t,e)=>{h(t,e),d()};const p=t(((...t)=>{n(...t),d()}),r,o);let f;const m=()=>{var t;if(!u)return;s=!1,a.forEach((t=>t(r())));const e=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,r()))||void 0;return x(u.getItem.bind(u))(i.name).then((t=>{if(t)return i.deserialize(t)})).then((t=>{if(t){if("number"!=typeof t.version||t.version===i.version)return t.state;if(i.migrate)return i.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((t=>{var e;return f=i.merge(t,null!=(e=r())?e:p),n(f,!0),d()})).then((()=>{null==e||e(f,void 0),s=!0,l.forEach((t=>t(f)))})).catch((t=>{null==e||e(void 0,t)}))};return o.persist={setOptions:t=>{i={...i,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},m(),f||p})(t,e)):((t,e)=>(n,r,o)=>{let i={storage:b((()=>localStorage)),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return t(((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...t)}),r,o);const c=()=>{const t=i.partialize({...r()});return u.setItem(i.name,{state:t,version:i.version})},d=o.setState;o.setState=(t,e)=>{d(t,e),c()};const h=t(((...t)=>{n(...t),c()}),r,o);let p;o.getInitialState=()=>h;const f=()=>{var t,e;if(!u)return;s=!1,a.forEach((t=>{var e;return t(null!=(e=r())?e:h)}));const o=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,null!=(t=r())?t:h))||void 0;return x(u.getItem.bind(u))(i.name).then((t=>{if(t){if("number"!=typeof t.version||t.version===i.version)return t.state;if(i.migrate)return i.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((t=>{var e;return p=i.merge(t,null!=(e=r())?e:h),n(p,!0),c()})).then((()=>{null==o||o(p,void 0),p=r(),s=!0,l.forEach((t=>t(p)))})).catch((t=>{null==o||o(void 0,t)}))};return o.persist={setOptions:t=>{i={...i,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},i.skipHydration||f(),p||h})(t,e),S=g(((t,e={})=>(n,r,o)=>{const{enabled:i,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null==i||i)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,o);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=y.get(n.name);if(r)return{type:"tracked",store:t,...r};const o={connection:e.connect(n),stores:{}};return y.set(n.name,o),{type:"tracked",store:t,...o}})(a,u,l);let h=!0;o.setState=(t,e,i)=>{const u=n(t,e);if(!h)return u;const d=void 0===i?{type:s||"anonymous"}:"string"==typeof i?{type:i}:i;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...v(l.name),[a]:o.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},f=t(o.setState,r,o);if("untracked"===d.type?null==c||c.init(f):(d.stores[d.store]=o,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map((([t,e])=>[t,t===d.store?f:e.getState()]))))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let t=!1;const e=o.dispatch;o.dispatch=(...n)=>{"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe((t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):w(t.payload,(t=>{if("__setState"!==t.type)o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(t);else{if(void 0===a)return void p(t.state);1!==Object.keys(t.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const e=t.state[a];if(null==e)return;JSON.stringify(o.getState())!==JSON.stringify(e)&&p(e)}}));case"DISPATCH":switch(t.payload.type){case"RESET":return p(f),void 0===a?null==c?void 0:c.init(o.getState()):null==c?void 0:c.init(v(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(o.getState())):null==c?void 0:c.init(v(l.name));case"ROLLBACK":return w(t.state,(t=>{if(void 0===a)return p(t),void(null==c||c.init(o.getState()));p(t[a]),null==c||c.init(v(l.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return w(t.state,(t=>{void 0!==a?JSON.stringify(o.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)}));case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}})),f})((t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t((t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]}))})),{name:"Extendify Library Globals"})),P=()=>{const{setOpen:e}=S();return(0,t.createElement)("div",{role:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),e(!0)},className:"components-button has-icon is-primary cursor-pointer h-8 xs:h-9 px-1 min-w-0 xs:pl-2 xs:pr-3 sm:ml-2"},(0,t.createElement)(a,{icon:l,size:24}),(0,t.createElement)("span",{className:"hidden xs:inline ml-1"},(0,s.__)("Design Library","extendify-local")))},T=window.wp.data;function C(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch((t=>setTimeout((()=>{throw t}))))}function A(){let t=[],e={addEventListener:(t,n,r,o)=>(t.addEventListener(n,r,o),e.add((()=>t.removeEventListener(n,r,o)))),requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add((()=>cancelAnimationFrame(n)))},nextFrame:(...t)=>e.requestAnimationFrame((()=>e.requestAnimationFrame(...t))),setTimeout(...t){let n=setTimeout(...t);return e.add((()=>clearTimeout(n)))},microTask(...t){let n={current:!0};return C((()=>{n.current&&t[0]()})),e.add((()=>{n.current=!1}))},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add((()=>{Object.assign(t.style,{[e]:r})}))},group(t){let e=A();return t(e),this.add((()=>e.dispose()))},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}var D=Object.defineProperty,k=(t,e,n)=>(((t,e,n)=>{e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let O=new class{constructor(){k(this,"current",this.detect()),k(this,"handoffState","pending"),k(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},L=(e,n)=>{O.isServer?(0,t.useEffect)(e,n):(0,t.useLayoutEffect)(e,n)};function R(e){let n=(0,t.useRef)(e);return L((()=>{n.current=e}),[e]),n}let V=function(e){let n=R(e);return t.useCallback(((...t)=>n.current(...t)),[n])};function M(e,n,r,o){let i=R(r);(0,t.useEffect)((()=>{function t(t){i.current(t)}return(e=null!=e?e:window).addEventListener(n,t,o),()=>e.removeEventListener(n,t,o)}),[e,n,o])}function F(){let e=(0,t.useRef)(!1);return L((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function j(e){let n=V(e),r=(0,t.useRef)(!1);(0,t.useEffect)((()=>(r.current=!1,()=>{r.current=!0,C((()=>{r.current&&n()}))})),[n])}function N(t){return O.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function I(...e){return(0,t.useMemo)((()=>N(...e)),[...e])}function B(){let n=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in e&&e.useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!t))}(),[r,o]=t.useState(O.isHandoffComplete);return r&&!1===O.isHandoffComplete&&o(!1),t.useEffect((()=>{!0!==r&&o(!0)}),[r]),t.useEffect((()=>O.handoff()),[]),!n&&r}let _=Symbol();function U(...e){let n=(0,t.useRef)(e);(0,t.useEffect)((()=>{n.current=e}),[e]);let r=V((t=>{for(let e of n.current)null!=e&&("function"==typeof e?e(t):e.current=t)}));return e.every((t=>null==t||(null==t?void 0:t[_])))?void 0:r}function $(e,n,r){let o=R(n);(0,t.useEffect)((()=>{function t(t){o.current(t)}return window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)}),[e,r])}var H=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(H||{});function z(e,n){let r=(0,t.useRef)([]),o=V(e);(0,t.useEffect)((()=>{let t=[...r.current];for(let[e,i]of n.entries())if(r.current[e]!==i){let e=o(n,t);return r.current=n,e}}),[o,...n])}function W(...t){return Array.from(new Set(t.flatMap((t=>"string"==typeof t?t.split(" "):[])))).filter(Boolean).join(" ")}function q(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map((t=>`"${t}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,q),r}var Y=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(Y||{}),G=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(G||{});function X({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=null!=a?a:J;let l=Z(e,t);if(i)return K(l,n,r,s,a);let u=null!=o?o:0;if(2&u){let{static:t=!1,...e}=l;if(t)return K(e,n,r,s,a)}if(1&u){let{unmount:t=!0,...e}=l;return q(t?0:1,{0:()=>null,1:()=>K({...e,hidden:!0,style:{display:"none"}},n,r,s,a)})}return K(l,n,r,s,a)}function K(e,n={},r,o,i){let{as:s=r,children:a,refName:l="ref",...u}=et(e,["unmount","static"]),c=void 0!==e.ref?{[l]:e.ref}:{},d="function"==typeof a?a(n):a;"className"in u&&u.className&&"function"==typeof u.className&&(u.className=u.className(n));let h={};if(n){let t=!1,e=[];for(let[r,o]of Object.entries(n))"boolean"==typeof o&&(t=!0),!0===o&&e.push(r);t&&(h["data-headlessui-state"]=e.join(" "))}if(s===t.Fragment&&Object.keys(tt(u)).length>0){if(!(0,t.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${o} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map((t=>` - ${t}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((t=>` - ${t}`)).join("\n")].join("\n"));let e=d.props,n="function"==typeof(null==e?void 0:e.className)?(...t)=>W(null==e?void 0:e.className(...t),u.className):W(null==e?void 0:e.className,u.className),r=n?{className:n}:{};return(0,t.cloneElement)(d,Object.assign({},Z(d.props,tt(et(u,["ref"]))),h,c,{ref:i(d.ref,c.ref)},r))}return(0,t.createElement)(s,Object.assign({},et(u,["ref"]),s!==t.Fragment&&c,s!==t.Fragment&&h),d)}function J(...t){return t.every((t=>null==t))?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function Z(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map((t=>[t,void 0]))));for(let t in n)Object.assign(e,{[t](e,...r){let o=n[t];for(let t of o){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function Q(e){var n;return Object.assign((0,t.forwardRef)(e),{displayName:null!=(n=e.displayName)?n:e.name})}function tt(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function et(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var nt=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(nt||{});let rt=Q((function(t,e){var n;let{features:r=1,...o}=t;return X({ourProps:{ref:e,"aria-hidden":2==(2&r)||(null!=(n=o["aria-hidden"])?n:void 0),style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&r)&&2!=(2&r)&&{display:"none"}}},theirProps:o,slot:{},defaultTag:"div",name:"Hidden"})})),ot=[];!function(t){function e(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&ot[0]!==t.target&&(ot.unshift(t.target),ot=ot.filter((t=>null!=t&&t.isConnected)),ot.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",e))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",e),e())}();let it=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((t=>`${t}:not([tabindex='-1'])`)).join(",");var st,at,lt=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(lt||{}),ut=((at=ut||{})[at.Error=0]="Error",at[at.Overflow=1]="Overflow",at[at.Success=2]="Success",at[at.Underflow=3]="Underflow",at),ct=((st=ct||{})[st.Previous=-1]="Previous",st[st.Next=1]="Next",st);var dt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(dt||{});var ht=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(ht||{});function pt(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));let ft=["textarea","input"].join(",");function mt(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=(t=>t)){return t.slice().sort(((t,n)=>{let r=e(t),o=e(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(it)).sort(((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER))))}(t);o.length>0&&s.length>1&&(s=s.filter((t=>!o.includes(t)))),r=null!=r?r:i.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==i.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,ft))&&n}(a)&&a.select(),2}function gt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var yt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(yt||{});let vt=Q((function(e,n){let r=(0,t.useRef)(null),o=U(r,n),{initialFocus:i,containers:s,features:a=30,...l}=e;B()||(a=1);let u=I(r);bt({ownerDocument:u},Boolean(16&a));let c=function({ownerDocument:e,container:n,initialFocus:r},o){let i=(0,t.useRef)(null),s=F();return z((()=>{if(!o)return;let t=n.current;t&&C((()=>{if(!s.current)return;let n=null==e?void 0:e.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===n)return void(i.current=n)}else if(t.contains(n))return void(i.current=n);null!=r&&r.current?pt(r.current):mt(t,lt.First)===ut.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement}))}),[o]),i}({ownerDocument:u,container:r,initialFocus:i},Boolean(2&a));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},o){let i=F();M(null==t?void 0:t.defaultView,"focus",(t=>{if(!o||!i.current)return;let s=gt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?xt(s,l)?(r.current=l,pt(l)):(t.preventDefault(),t.stopPropagation(),pt(a)):pt(r.current)}),!0)}({ownerDocument:u,container:r,containers:s,previousActiveElement:c},Boolean(8&a));let d=function(){let e=(0,t.useRef)(0);return $("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}(),h=V((t=>{let e=r.current;e&&q(d.current,{[H.Forwards]:()=>{mt(e,lt.First,{skipElements:[t.relatedTarget]})},[H.Backwards]:()=>{mt(e,lt.Last,{skipElements:[t.relatedTarget]})}})})),p=function(){let[e]=(0,t.useState)(A);return(0,t.useEffect)((()=>()=>e.dispose()),[e]),e}(),f=(0,t.useRef)(!1),m={ref:o,onKeyDown(t){"Tab"==t.key&&(f.current=!0,p.requestAnimationFrame((()=>{f.current=!1})))},onBlur(t){let e=gt(s);r.current instanceof HTMLElement&&e.add(r.current);let n=t.relatedTarget;n instanceof HTMLElement&&"true"!==n.dataset.headlessuiFocusGuard&&(xt(e,n)||(f.current?mt(r.current,q(d.current,{[H.Forwards]:()=>lt.Next,[H.Backwards]:()=>lt.Previous})|lt.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&pt(t.target)))}};return t.createElement(t.Fragment,null,Boolean(4&a)&&t.createElement(rt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:nt.Focusable}),X({ourProps:m,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&a)&&t.createElement(rt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:nt.Focusable}))})),wt=Object.assign(vt,{features:yt});function bt({ownerDocument:e},n){let r=function(e=!0){let n=(0,t.useRef)(ot.slice());return z((([t],[e])=>{!0===e&&!1===t&&C((()=>{n.current.splice(0)})),!1===e&&!0===t&&(n.current=ot.slice())}),[e,ot,n]),V((()=>{var t;return null!=(t=n.current.find((t=>null!=t&&t.isConnected)))?t:null}))}(n);z((()=>{n||(null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&pt(r())}),[n]),j((()=>{n&&pt(r())}))}function xt(t,e){for(let n of t)if(n.contains(e))return!0;return!1}const Et=window.ReactDOM;let St=(0,t.createContext)(!1);function Pt(){return(0,t.useContext)(St)}function Tt(e){return t.createElement(St.Provider,{value:e.force},e.children)}let Ct=t.Fragment,At=t.Fragment,Dt=(0,t.createContext)(null),kt=(0,t.createContext)(null),Ot=Q((function(e,n){let r=e,o=(0,t.useRef)(null),i=U(function(t,e=!0){return Object.assign(t,{[_]:e})}((t=>{o.current=t})),n),s=I(o),a=function(e){let n=Pt(),r=(0,t.useContext)(Dt),o=I(e),[i,s]=(0,t.useState)((()=>{if(!n&&null!==r||O.isServer)return null;let t=null==o?void 0:o.getElementById("headlessui-portal-root");if(t)return t;if(null===o)return null;let e=o.createElement("div");return e.setAttribute("id","headlessui-portal-root"),o.body.appendChild(e)}));return(0,t.useEffect)((()=>{null!==i&&(null!=o&&o.body.contains(i)||null==o||o.body.appendChild(i))}),[i,o]),(0,t.useEffect)((()=>{n||null!==r&&s(r.current)}),[r,s,n]),i}(o),[l]=(0,t.useState)((()=>{var t;return O.isServer?null:null!=(t=null==s?void 0:s.createElement("div"))?t:null})),u=(0,t.useContext)(kt),c=B();return L((()=>{!a||!l||a.contains(l)||(l.setAttribute("data-headlessui-portal",""),a.appendChild(l))}),[a,l]),L((()=>{if(l&&u)return u.register(l)}),[u,l]),j((()=>{var t;!a||!l||(l instanceof Node&&a.contains(l)&&a.removeChild(l),a.childNodes.length<=0&&(null==(t=a.parentElement)||t.removeChild(a)))})),c&&a&&l?(0,Et.createPortal)(X({ourProps:{ref:i},theirProps:r,defaultTag:Ct,name:"Portal"}),l):null})),Lt=Q((function(e,n){let{target:r,...o}=e,i={ref:U(n)};return t.createElement(Dt.Provider,{value:r},X({ourProps:i,theirProps:o,defaultTag:At,name:"Popover.Group"}))})),Rt=Object.assign(Ot,{Group:Lt});const Vt="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:Mt,useEffect:Ft,useLayoutEffect:jt,useDebugValue:Nt}=e;function It(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Vt(n,t)}catch{return!0}}const Bt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:o},i]=Mt({inst:{value:r,getSnapshot:e}});return jt((()=>{o.value=r,o.getSnapshot=e,It(o)&&i({inst:o})}),[t,r,e]),Ft((()=>(It(o)&&i({inst:o}),t((()=>{It(o)&&i({inst:o})})))),[t]),Nt(r),r},_t="useSyncExternalStore"in e?(t=>t.useSyncExternalStore)(e):Bt;function Ut(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,o=r.clientWidth-r.offsetWidth,i=t-o;n.style(r,"paddingRight",`${i}px`)}}}function $t(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ht(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let zt=function(t,e){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:t=>(r.add(t),()=>r.delete(t)),dispatch(t,...o){let i=e[t].call(n,...o);i&&(n=i,r.forEach((t=>t())))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:A(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:Ht(n)},o=[$t()?{before({doc:t,d:e,meta:n}){function r(t){return n.containers.flatMap((t=>t())).some((e=>e.contains(t)))}e.microTask((()=>{var n;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let n=A();n.style(t.documentElement,"scrollBehavior","auto"),e.add((()=>e.microTask((()=>n.dispose()))))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,i=null;e.addEventListener(t,"click",(e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),s=t.querySelector(o);s&&!r(s)&&(i=s)}catch{}}),!0),e.addEventListener(t,"touchstart",(t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let n=t.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")})),e.addEventListener(t,"touchmove",(t=>{if(t.target instanceof HTMLElement)if(r(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.headlessuiPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.headlessuiPortal&&t.preventDefault()}else t.preventDefault()}),{passive:!1}),e.add((()=>{var t;let e=null!=(t=window.scrollY)?t:window.pageYOffset;o!==e&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)}))}))}}:{},Ut(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];o.forEach((({before:t})=>null==t?void 0:t(r))),o.forEach((({after:t})=>null==t?void 0:t(r)))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});function Wt(t,e,n){let r=function(t){return _t(t.subscribe,t.getSnapshot,t.getSnapshot)}(zt),o=t?r.get(t):void 0,i=!!o&&o.count>0;return L((()=>{if(t&&e)return zt.dispatch("PUSH",t,n),()=>zt.dispatch("POP",t,n)}),[e,t]),i}var qt;zt.subscribe((()=>{let t=zt.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&zt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&zt.dispatch("TEARDOWN",n)}}));let Yt=null!=(qt=t.useId)?qt:function(){let e=B(),[n,r]=t.useState(e?()=>O.nextId():null);return L((()=>{null===n&&r(O.nextId())}),[n]),null!=n?""+n:void 0},Gt=new Map,Xt=new Map;function Kt(t,e=!0){L((()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let o=null!=(n=Xt.get(r))?n:0;return Xt.set(r,o+1),0!==o||(Gt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=Xt.get(r))?t:1;if(1===e?Xt.delete(r):Xt.set(r,e-1),1!==e)return;let n=Gt.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,Gt.delete(r))}}),[t,e])}function Jt(e,n,r){let o=R(n);(0,t.useEffect)((()=>{function t(t){o.current(t)}return document.addEventListener(e,t,r),()=>document.removeEventListener(e,t,r)}),[e,r])}function Zt(e,n,r=!0){let o=(0,t.useRef)(!1);function i(t,r){if(!o.current||t.defaultPrevented)return;let i=r(t);if(null===i||!i.getRootNode().contains(i)||!i.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(e);for(let e of s){if(null===e)continue;let n=e instanceof HTMLElement?e:e.current;if(null!=n&&n.contains(i)||t.composed&&t.composedPath().includes(n))return}return!function(t,e=0){var n;return t!==(null==(n=N(t))?void 0:n.body)&&q(e,{0:()=>t.matches(it),1(){let e=t;for(;null!==e;){if(e.matches(it))return!0;e=e.parentElement}return!1}})}(i,dt.Loose)&&-1!==i.tabIndex&&t.preventDefault(),n(t,i)}(0,t.useEffect)((()=>{requestAnimationFrame((()=>{o.current=r}))}),[r]);let s=(0,t.useRef)(null);Jt("pointerdown",(t=>{var e,n;o.current&&(s.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)}),!0),Jt("mousedown",(t=>{var e,n;o.current&&(s.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)}),!0),Jt("click",(t=>{$t()||/Android/gi.test(window.navigator.userAgent)||s.current&&(i(t,(()=>s.current)),s.current=null)}),!0),Jt("touchend",(t=>i(t,(()=>t.target instanceof HTMLElement?t.target:null))),!0),$("blur",(t=>i(t,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}let Qt=(0,t.createContext)(null);Qt.displayName="OpenClosedContext";var te=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(te||{});let ee=(0,t.createContext)((()=>{}));ee.displayName="StackContext";var ne=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(ne||{});function re({children:e,onUpdate:n,type:r,element:o,enabled:i}){let s=(0,t.useContext)(ee),a=V(((...t)=>{null==n||n(...t),s(...t)}));return L((()=>{let t=void 0===i||!0===i;return t&&a(0,r,o),()=>{t&&a(1,r,o)}}),[a,r,o,i]),t.createElement(ee.Provider,{value:a},e)}let oe=(0,t.createContext)(null);function ie(){let e=(0,t.useContext)(oe);if(null===e){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ie),t}return e}let se=Q((function(t,e){let n=Yt(),{id:r=`headlessui-description-${n}`,...o}=t,i=ie(),s=U(e);return L((()=>i.register(r)),[r,i.register]),X({ourProps:{ref:s,...i.props,id:r},theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})})),ae=Object.assign(se,{});var le=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(le||{}),ue=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(ue||{}),ce=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(ce||{});let de={0:(t,e)=>t.titleId===e.id?t:{...t,titleId:e.id}},he=(0,t.createContext)(null);function pe(e){let n=(0,t.useContext)(he);if(null===n){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,pe),t}return n}function fe(t,e){return q(e.type,de,t,e)}he.displayName="DialogContext";let me=Y.RenderStrategy|Y.Static,ge=Q((function(e,n){let r=Yt(),{id:o=`headlessui-dialog-${r}`,open:i,onClose:s,initialFocus:a,role:l="dialog",__demoMode:u=!1,...c}=e,[d,h]=(0,t.useState)(0),p=(0,t.useRef)(!1);l="dialog"===l||"alertdialog"===l?l:(p.current||(p.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let f=(0,t.useContext)(Qt);void 0===i&&null!==f&&(i=(f&te.Open)===te.Open);let m=(0,t.useRef)(null),g=U(m,n),y=I(m),v=e.hasOwnProperty("open")||null!==f,w=e.hasOwnProperty("onClose");if(!v&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof s)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);let b=i?0:1,[x,E]=(0,t.useReducer)(fe,{titleId:null,descriptionId:null,panelRef:(0,t.createRef)()}),S=V((()=>s(!1))),P=V((t=>E({type:0,id:t}))),T=!!B()&&!u&&0===b,C=d>1,A=null!==(0,t.useContext)(he),[D,k]=function(){let e=(0,t.useContext)(kt),n=(0,t.useRef)([]),r=V((t=>(n.current.push(t),e&&e.register(t),()=>o(t)))),o=V((t=>{let r=n.current.indexOf(t);-1!==r&&n.current.splice(r,1),e&&e.unregister(t)})),i=(0,t.useMemo)((()=>({register:r,unregister:o,portals:n})),[r,o,n]);return[n,(0,t.useMemo)((()=>function({children:e}){return t.createElement(kt.Provider,{value:i},e)}),[i])]}(),O={get current(){var t;return null!=(t=x.panelRef.current)?t:m.current}},{resolveContainers:L,mainTreeNodeRef:R,MainTreeNode:F}=function({defaultContainers:e=[],portals:n,mainTreeNodeRef:r}={}){var o;let i=(0,t.useRef)(null!=(o=null==r?void 0:r.current)?o:null),s=I(i),a=V((()=>{var t,r,o;let a=[];for(let t of e)null!==t&&(t instanceof HTMLElement?a.push(t):"current"in t&&t.current instanceof HTMLElement&&a.push(t.current));if(null!=n&&n.current)for(let t of n.current)a.push(t);for(let e of null!=(t=null==s?void 0:s.querySelectorAll("html > *, body > *"))?t:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(e.contains(i.current)||e.contains(null==(o=null==(r=i.current)?void 0:r.getRootNode())?void 0:o.host)||a.some((t=>e.contains(t)))||a.push(e));return a}));return{resolveContainers:a,contains:V((t=>a().some((e=>e.contains(t))))),mainTreeNodeRef:i,MainTreeNode:(0,t.useMemo)((()=>function(){return null!=r?null:t.createElement(rt,{features:nt.Hidden,ref:i})}),[i,r])}}({portals:D,defaultContainers:[O]}),j=C?"parent":"leaf",N=null!==f&&(f&te.Closing)===te.Closing,_=!A&&!N&&T,$=(0,t.useCallback)((()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("body > *"))?t:[]).find((t=>"headlessui-portal-root"!==t.id&&t.contains(R.current)&&t instanceof HTMLElement)))?e:null}),[R]);Kt($,_);let H=!!C||T,z=(0,t.useCallback)((()=>{var t,e;return null!=(e=Array.from(null!=(t=null==y?void 0:y.querySelectorAll("[data-headlessui-portal]"))?t:[]).find((t=>t.contains(R.current)&&t instanceof HTMLElement)))?e:null}),[R]);Kt(z,H),Zt(L,S,!(!T||C));let W=!(C||0!==b);M(null==y?void 0:y.defaultView,"keydown",(t=>{W&&(t.defaultPrevented||t.key===le.Escape&&(t.preventDefault(),t.stopPropagation(),S()))})),function(t,e,n=(()=>[document.body])){Wt(t,e,(t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}}))}(y,!(N||0!==b||A),L),(0,t.useEffect)((()=>{if(0!==b||!m.current)return;let t=new ResizeObserver((t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&S()}}));return t.observe(m.current),()=>t.disconnect()}),[b,m,S]);let[Y,G]=function(){let[e,n]=(0,t.useState)([]);return[e.length>0?e.join(" "):void 0,(0,t.useMemo)((()=>function(e){let r=V((t=>(n((e=>[...e,t])),()=>n((e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))))),o=(0,t.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t.createElement(oe.Provider,{value:o},e.children)}),[n])]}(),K=(0,t.useMemo)((()=>[{dialogState:b,close:S,setTitleId:P},x]),[b,x,S,P]),J=(0,t.useMemo)((()=>({open:0===b})),[b]),Z={ref:g,id:o,role:l,"aria-modal":0===b||void 0,"aria-labelledby":x.titleId,"aria-describedby":Y};return t.createElement(re,{type:"Dialog",enabled:0===b,element:m,onUpdate:V(((t,e)=>{"Dialog"===e&&q(t,{[ne.Add]:()=>h((t=>t+1)),[ne.Remove]:()=>h((t=>t-1))})}))},t.createElement(Tt,{force:!0},t.createElement(Rt,null,t.createElement(he.Provider,{value:K},t.createElement(Rt.Group,{target:m},t.createElement(Tt,{force:!1},t.createElement(G,{slot:J,name:"Dialog.Description"},t.createElement(wt,{initialFocus:a,containers:L,features:T?q(j,{parent:wt.features.RestoreFocus,leaf:wt.features.All&~wt.features.FocusLock}):wt.features.None},t.createElement(k,null,X({ourProps:Z,theirProps:c,slot:J,defaultTag:"div",features:me,visible:0===b,name:"Dialog"}))))))))),t.createElement(F,null))})),ye=Q((function(e,n){let r=Yt(),{id:o=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:s},a]=pe("Dialog.Backdrop"),l=U(n);(0,t.useEffect)((()=>{if(null===a.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[a.panelRef]);let u=(0,t.useMemo)((()=>({open:0===s})),[s]);return t.createElement(Tt,{force:!0},t.createElement(Rt,null,X({ourProps:{ref:l,id:o,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:"div",name:"Dialog.Backdrop"})))})),ve=Q((function(e,n){let r=Yt(),{id:o=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:s},a]=pe("Dialog.Panel"),l=U(n,a.panelRef),u=(0,t.useMemo)((()=>({open:0===s})),[s]),c=V((t=>{t.stopPropagation()}));return X({ourProps:{ref:l,id:o,onClick:c},theirProps:i,slot:u,defaultTag:"div",name:"Dialog.Panel"})})),we=Q((function(e,n){let r=Yt(),{id:o=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:s,close:a}]=pe("Dialog.Overlay"),l=U(n),u=V((t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),a()}}));return X({ourProps:{ref:l,id:o,"aria-hidden":!0,onClick:u},theirProps:i,slot:(0,t.useMemo)((()=>({open:0===s})),[s]),defaultTag:"div",name:"Dialog.Overlay"})})),be=Q((function(e,n){let r=Yt(),{id:o=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:s,setTitleId:a}]=pe("Dialog.Title"),l=U(n);(0,t.useEffect)((()=>(a(o),()=>a(null))),[o,a]);let u=(0,t.useMemo)((()=>({open:0===s})),[s]);return X({ourProps:{ref:l,id:o},theirProps:i,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),xe=Object.assign(ge,{Backdrop:ye,Panel:ve,Overlay:we,Title:be,Description:ae});const Ee=(0,t.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Se=(0,t.createContext)({}),Pe=(0,t.createContext)(null),Te="undefined"!=typeof document,Ce=Te?t.useLayoutEffect:t.useEffect,Ae=(0,t.createContext)({strict:!1});function De(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function ke(t){return"string"==typeof t||Array.isArray(t)}function Oe(t){return"object"==typeof t&&"function"==typeof t.start}const Le=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Re=["initial",...Le];function Ve(t){return Oe(t.animate)||Re.some((e=>ke(t[e])))}function Me(t){return Boolean(Ve(t)||t.variants)}function Fe(t){return Array.isArray(t)?t.join(" "):t}const je={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ne={};for(const t in je)Ne[t]={isEnabled:e=>je[t].some((t=>!!e[t]))};const Ie=(0,t.createContext)({}),Be=(0,t.createContext)({}),_e=Symbol.for("motionComponentSymbol");function Ue({preloadedFeatures:e,createVisualElement:n,useRender:r,useVisualState:o,Component:i}){e&&function(t){for(const e in t)Ne[e]={...Ne[e],...t[e]}}(e);const s=(0,t.forwardRef)((function(s,a){let l;const u={...(0,t.useContext)(Ee),...s,layoutId:$e(s)},{isStatic:c}=u,d=function(e){const{initial:n,animate:r}=function(t,e){if(Ve(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ke(e)?e:void 0,animate:ke(n)?n:void 0}}return!1!==t.inherit?e:{}}(e,(0,t.useContext)(Se));return(0,t.useMemo)((()=>({initial:n,animate:r})),[Fe(n),Fe(r)])}(s),h=o(s,c);if(!c&&Te){d.visualElement=function(e,n,r,o){const{visualElement:i}=(0,t.useContext)(Se),s=(0,t.useContext)(Ae),a=(0,t.useContext)(Pe),l=(0,t.useContext)(Ee).reducedMotion,u=(0,t.useRef)();o=o||s.renderer,!u.current&&o&&(u.current=o(e,{visualState:n,parent:i,props:r,presenceContext:a,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:l}));const c=u.current;(0,t.useInsertionEffect)((()=>{c&&c.update(r,a)}));const d=(0,t.useRef)(Boolean(window.HandoffAppearAnimations));return Ce((()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())})),(0,t.useEffect)((()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,d.current=!1)})),c}(i,h,u,n);const r=(0,t.useContext)(Be),o=(0,t.useContext)(Ae).strict;d.visualElement&&(l=d.visualElement.loadFeatures(u,o,e,r))}return t.createElement(Se.Provider,{value:d},l&&d.visualElement?t.createElement(l,{visualElement:d.visualElement,...u}):null,r(i,s,function(e,n,r){return(0,t.useCallback)((t=>{t&&e.mount&&e.mount(t),n&&(t?n.mount(t):n.unmount()),r&&("function"==typeof r?r(t):De(r)&&(r.current=t))}),[n])}(h,d.visualElement,a),h,c,d.visualElement))}));return s[_e]=i,s}function $e({layoutId:e}){const n=(0,t.useContext)(Ie).id;return n&&void 0!==e?n+"-"+e:e}function He(t){function e(e,n={}){return Ue(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function We(t){return"string"==typeof t&&!t.includes("-")&&!!(ze.indexOf(t)>-1||/[A-Z]/.test(t))}const qe={},Ye=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ge=new Set(Ye);function Xe(t,{layout:e,layoutId:n}){return Ge.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!qe[t]||"opacity"===t)}const Ke=t=>Boolean(t&&t.getVelocity),Je={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ze=Ye.length,Qe=t=>e=>"string"==typeof e&&e.startsWith(t),tn=Qe("--"),en=Qe("var(--"),nn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,rn=(t,e,n)=>Math.min(Math.max(n,t),e),on={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},sn={...on,transform:t=>rn(0,1,t)},an={...on,default:1},ln=t=>Math.round(1e5*t)/1e5,un=/(-)?([\d]*\.?[\d])+/g,cn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,dn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function hn(t){return"string"==typeof t}const pn=t=>({test:e=>hn(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),fn=pn("deg"),mn=pn("%"),gn=pn("px"),yn=pn("vh"),vn=pn("vw"),wn={...mn,parse:t=>mn.parse(t)/100,transform:t=>mn.transform(100*t)},bn={...on,transform:Math.round},xn={borderWidth:gn,borderTopWidth:gn,borderRightWidth:gn,borderBottomWidth:gn,borderLeftWidth:gn,borderRadius:gn,radius:gn,borderTopLeftRadius:gn,borderTopRightRadius:gn,borderBottomRightRadius:gn,borderBottomLeftRadius:gn,width:gn,maxWidth:gn,height:gn,maxHeight:gn,size:gn,top:gn,right:gn,bottom:gn,left:gn,padding:gn,paddingTop:gn,paddingRight:gn,paddingBottom:gn,paddingLeft:gn,margin:gn,marginTop:gn,marginRight:gn,marginBottom:gn,marginLeft:gn,rotate:fn,rotateX:fn,rotateY:fn,rotateZ:fn,scale:an,scaleX:an,scaleY:an,scaleZ:an,skew:fn,skewX:fn,skewY:fn,distance:gn,translateX:gn,translateY:gn,translateZ:gn,x:gn,y:gn,z:gn,perspective:gn,transformPerspective:gn,opacity:sn,originX:wn,originY:wn,originZ:gn,zIndex:bn,fillOpacity:sn,strokeOpacity:sn,numOctaves:bn};function En(t,e,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(tn(t)){i[t]=n;continue}const r=xn[t],d=nn(n,r);if(Ge.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):o[t]=d}if(e.transform||(l||r?o.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,o){let i="";for(let e=0;e<Ze;e++){const n=Ye[e];void 0!==t[n]&&(i+=`${Je[n]||n}(${t[n]}) `)}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),o?i=o(t,r?"":i):n&&r&&(i="none"),i}(t.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;o.transformOrigin=`${t} ${e} ${n}`}}const Sn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pn(t,e,n){for(const r in e)Ke(e[r])||Xe(r,n)||(t[r]=e[r])}function Tn(e,n,r){const o={},i=function(e,n,r){const o={};return Pn(o,e.style||{},e),Object.assign(o,function({transformTemplate:e},n,r){return(0,t.useMemo)((()=>{const t=Sn();return En(t,n,{enableHardwareAcceleration:!r},e),Object.assign({},t.vars,t.style)}),[n])}(e,n,r)),e.transformValues?e.transformValues(o):o}(e,n,r);return e.drag&&!1!==e.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(o.tabIndex=0),o.style=i,o}const Cn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function An(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Cn.has(t)}let Dn=t=>!An(t);try{(kn=require("@emotion/is-prop-valid").default)&&(Dn=t=>t.startsWith("on")?!An(t):kn(t))}catch(t){}var kn;function On(t,e,n){return"string"==typeof t?t:gn.transform(e+n*t)}const Ln={offset:"stroke-dashoffset",array:"stroke-dasharray"},Rn={offset:"strokeDashoffset",array:"strokeDasharray"};function Vn(t,{attrX:e,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(En(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==o||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${On(e,t.x,t.width)} ${On(n,t.y,t.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const i=o?Ln:Rn;t[i.offset]=gn.transform(-r);const s=gn.transform(e),a=gn.transform(n);t[i.array]=`${s} ${a}`}(p,s,a,l,!1)}const Mn=()=>({...Sn(),attrs:{}}),Fn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function jn(e,n,r,o){const i=(0,t.useMemo)((()=>{const t=Mn();return Vn(t,n,{enableHardwareAcceleration:!1},Fn(o),e.transformTemplate),{...t.attrs,style:{...t.style}}}),[n]);if(e.style){const t={};Pn(t,e.style,e),i.style={...t,...i.style}}return i}function Nn(e=!1){return(n,r,o,{latestValues:i},s)=>{const a=(We(n)?jn:Tn)(r,i,s,n),l=function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(Dn(o)||!0===n&&An(o)||!e&&!An(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(r,"string"==typeof n,e),u={...l,...a,ref:o},{children:c}=r,d=(0,t.useMemo)((()=>Ke(c)?c.get():c),[c]);return(0,t.createElement)(n,{...u,children:d})}}const In=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Bn(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Un=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function $n(t,e,n,r){Bn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Un.has(n)?n:In(n),e.attrs[n])}function Hn(t,e){const{style:n}=t,r={};for(const o in n)(Ke(n[o])||e.style&&Ke(e.style[o])||Xe(o,t))&&(r[o]=n[o]);return r}function zn(t,e){const n=Hn(t,e);for(const r in t)(Ke(t[r])||Ke(e[r]))&&(n[-1!==Ye.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function Wn(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}const qn=t=>Array.isArray(t),Yn=t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue),Gn=t=>qn(t)?t[t.length-1]||0:t;function Xn(t){const e=Ke(t)?t.get():t;return Yn(e)?e.toValue():e}const Kn=e=>(n,r)=>{const o=(0,t.useContext)(Se),i=(0,t.useContext)(Pe),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,i){const s={latestValues:Jn(r,o,i,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(e,n,o,i);return r?s():function(e){const n=(0,t.useRef)(null);return null===n.current&&(n.current=e()),n.current}(s)};function Jn(t,e,n,r){const o={},i=r(t,{});for(const t in i)o[t]=Xn(i[t]);let{initial:s,animate:a}=t;const l=Ve(t),u=Me(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!Oe(d)&&(Array.isArray(d)?d:[d]).forEach((e=>{const n=Wn(t,e);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})),o}const Zn=t=>t;class Qn{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const tr=["prepare","read","update","preRender","render","postRender"],{schedule:er,cancel:nr,state:rr,steps:or}=function(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=tr.reduce(((t,e)=>(t[e]=function(t){let e=new Qn,n=new Qn,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&o,u=l?e:n;return i&&s.add(t),u.add(t)&&l&&o&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(o)i=!0;else{if(o=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}o=!1,i&&(i=!1,a.process(l))}}};return a}((()=>n=!0)),t)),{}),s=t=>i[t].process(o),a=()=>{const e=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(e-o.timestamp,40),1),o.timestamp=e,o.isProcessing=!0,tr.forEach(s),o.isProcessing=!1,n&&(r=!1,t(a))};return{schedule:tr.reduce(((e,s)=>{const l=i[s];return e[s]=(e,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||t(a)),l.schedule(e,i,s)),e}),{}),cancel:t=>tr.forEach((e=>i[e].cancel(t))),state:o,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Zn),ir={useVisualState:Kn({scrapeMotionValuesFromProps:zn,createRenderState:Mn,onMount:(t,e,{renderState:n,latestValues:r})=>{er.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),er.render((()=>{Vn(n,r,{enableHardwareAcceleration:!1},Fn(e.tagName),t.transformTemplate),$n(e,n)}))}})},sr={useVisualState:Kn({scrapeMotionValuesFromProps:Hn,createRenderState:Sn})};function ar(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const lr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function ur(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const cr=t=>e=>lr(e)&&t(e,ur(e));function dr(t,e,n,r){return ar(t,e,cr(n),r)}const hr=(t,e)=>n=>e(t(n)),pr=(...t)=>t.reduce(hr);function fr(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const mr=fr("dragHorizontal"),gr=fr("dragVertical");function yr(t){let e=!1;if("y"===t)e=gr();else if("x"===t)e=mr();else{const t=mr(),n=gr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function vr(){const t=yr(!0);return!t||(t(),!1)}class wr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function br(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return dr(t.current,n,((n,o)=>{if("touch"===n.type||vr())return;const i=t.getProps();t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",e),i[r]&&er.update((()=>i[r](n,o)))}),{passive:!t.getProps()[r]})}const xr=(t,e)=>!!e&&(t===e||xr(t,e.parentElement));function Er(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,ur(n))}const Sr=new WeakMap,Pr=new WeakMap,Tr=t=>{const e=Sr.get(t.target);e&&e(t)},Cr=t=>{t.forEach(Tr)};const Ar={some:0,all:1},Dr={inView:{Feature:class extends wr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:o}=t,i={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ar[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Pr.has(n)||Pr.set(n,{});const r=Pr.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Cr,{root:t,...e})),r[o]}(e);return Sr.set(t,n),r.observe(t),()=>{Sr.delete(t),r.unobserve(t)}}(this.node.current,i,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=e?n:r;i&&i(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends wr{constructor(){super(...arguments),this.removeStartListeners=Zn,this.removeEndListeners=Zn,this.removeAccessibleListeners=Zn,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),r=dr(window,"pointerup",((t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r}=this.node.getProps();er.update((()=>{xr(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)}))}),{passive:!(n.onTap||n.onPointerUp)}),o=dr(window,"pointercancel",((t,e)=>this.cancelPress(t,e)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=pr(r,o),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=ar(this.node.current,"keydown",(t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ar(this.node.current,"keyup",(t=>{"Enter"===t.key&&this.checkPressEnd()&&Er("up",((t,e)=>{const{onTap:n}=this.node.getProps();n&&er.update((()=>n(t,e)))}))})),Er("down",((t,e)=>{this.startPress(t,e)})))})),e=ar(this.node.current,"blur",(()=>{this.isPressing&&Er("cancel",((t,e)=>this.cancelPress(t,e)))}));this.removeAccessibleListeners=pr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&er.update((()=>n(t,e)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!vr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&er.update((()=>n(t,e)))}mount(){const t=this.node.getProps(),e=dr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=ar(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends wr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pr(ar(this.node.current,"focus",(()=>this.onFocus())),ar(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends wr{mount(){this.unmount=pr(br(this.node,!0),br(this.node,!1))}unmount(){}}}};function kr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Or(t,e,n){const r=t.getProps();return Wn(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach(((t,n)=>e[n]=t.get())),e}(t),function(t){const e={};return t.values.forEach(((t,n)=>e[n]=t.getVelocity())),e}(t))}const Lr="data-"+In("framerAppearId");let Rr=Zn,Vr=Zn;const Mr=t=>1e3*t,Fr=t=>t/1e3,jr=t=>Array.isArray(t)&&"number"==typeof t[0];function Nr(t){return Boolean(!t||"string"==typeof t&&Br[t]||jr(t)||Array.isArray(t)&&t.every(Nr))}const Ir=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Br={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ir([0,.65,.55,1]),circOut:Ir([.55,0,1,.45]),backIn:Ir([.31,.01,.66,-.59]),backOut:Ir([.33,1.53,.69,.99])};function _r(t){if(t)return jr(t)?Ir(t):Array.isArray(t)?t.map(_r):Br[t]}const Ur=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $r(t,e,n,r){if(t===e&&n===r)return Zn;return o=>0===o||1===o?o:Ur(function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=Ur(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,t,n),e,r)}const Hr=$r(.42,0,1,1),zr=$r(0,0,.58,1),Wr=$r(.42,0,.58,1),qr=t=>Array.isArray(t)&&"number"!=typeof t[0],Yr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Gr=t=>e=>1-t(1-e),Xr=t=>1-Math.sin(Math.acos(t)),Kr=Gr(Xr),Jr=Yr(Kr),Zr=$r(.33,1.53,.69,.99),Qr=Gr(Zr),to=Yr(Qr),eo={linear:Zn,easeIn:Hr,easeInOut:Wr,easeOut:zr,circIn:Xr,circInOut:Jr,circOut:Kr,backIn:Qr,backInOut:to,backOut:Zr,anticipate:t=>(t*=2)<1?.5*Qr(t):.5*(2-Math.pow(2,-10*(t-1)))},no=t=>{if(Array.isArray(t)){Vr(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,o]=t;return $r(e,n,r,o)}return"string"==typeof t?(Vr(void 0!==eo[t],`Invalid easing type '${t}'`),eo[t]):t},ro=(t,e)=>n=>Boolean(hn(n)&&dn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),oo=(t,e,n)=>r=>{if(!hn(r))return r;const[o,i,s,a]=r.match(un);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},io={...on,transform:t=>Math.round((t=>rn(0,255,t))(t))},so={test:ro("rgb","red"),parse:oo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+io.transform(t)+", "+io.transform(e)+", "+io.transform(n)+", "+ln(sn.transform(r))+")"},ao={test:ro("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:so.transform},lo={test:ro("hsl","hue"),parse:oo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+mn.transform(ln(e))+", "+mn.transform(ln(n))+", "+ln(sn.transform(r))+")"},uo={test:t=>so.test(t)||ao.test(t)||lo.test(t),parse:t=>so.test(t)?so.parse(t):lo.test(t)?lo.parse(t):ao.parse(t),transform:t=>hn(t)?t:t.hasOwnProperty("red")?so.transform(t):lo.transform(t)},co=(t,e,n)=>-n*t+n*e+t;function ho(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const po=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},fo=[ao,so,lo];function mo(t){const e=(t=>fo.find((e=>e.test(t))))(t);Vr(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===lo&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,i=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=ho(a,r,t+1/3),i=ho(a,r,t),s=ho(a,r,t-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const go=(t,e)=>{const n=mo(t),r=mo(e),o={...n};return t=>(o.red=po(n.red,r.red,t),o.green=po(n.green,r.green,t),o.blue=po(n.blue,r.blue,t),o.alpha=co(n.alpha,r.alpha,t),so.transform(o))},yo={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:Zn},vo={regex:cn,countKey:"Colors",token:"${c}",parse:uo.parse},wo={regex:un,countKey:"Numbers",token:"${n}",parse:on.parse};function bo(t,{regex:e,countKey:n,token:r,parse:o}){const i=t.tokenised.match(e);i&&(t["num"+n]=i.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...i.map(o)))}function xo(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&bo(n,yo),bo(n,vo),bo(n,wo),n}function Eo(t){return xo(t).values}function So(t){const{values:e,numColors:n,numVars:r,tokenised:o}=xo(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=o<r?e.replace(yo.token,t[o]):o<r+n?e.replace(vo.token,uo.transform(t[o])):e.replace(wo.token,ln(t[o]));return e}}const Po=t=>"number"==typeof t?0:t,To={test:function(t){var e,n;return isNaN(t)&&hn(t)&&((null===(e=t.match(un))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(cn))||void 0===n?void 0:n.length)||0)>0},parse:Eo,createTransformer:So,getAnimatableNone:function(t){const e=Eo(t);return So(t)(e.map(Po))}},Co=(t,e)=>n=>`${n>0?e:t}`;function Ao(t,e){return"number"==typeof t?n=>co(t,e,n):uo.test(t)?go(t,e):t.startsWith("var(")?Co(t,e):Oo(t,e)}const Do=(t,e)=>{const n=[...t],r=n.length,o=t.map(((t,n)=>Ao(t,e[n])));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},ko=(t,e)=>{const n={...t,...e},r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Ao(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Oo=(t,e)=>{const n=To.createTransformer(e),r=xo(t),o=xo(e);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?pr(Do(r.values,o.values),n):(Rr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Co(t,e))},Lo=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Ro=(t,e)=>n=>co(t,e,n);function Vo(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const i=t.length;if(Vr(i===e.length,"Both input and output ranges must be the same length"),1===i)return()=>e[0];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],o=n||function(t){return"number"==typeof t?Ro:"string"==typeof t?uo.test(t)?go:Oo:Array.isArray(t)?Do:"object"==typeof t?ko:Ro}(t[0]),i=t.length-1;for(let n=0;n<i;n++){let i=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||Zn:e;i=pr(t,i)}r.push(i)}return r}(e,r,o),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=Lo(t[n],t[n+1],e);return s[n](r)};return n?e=>l(rn(t[0],t[i-1],e)):l}function Mo({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=qr(r)?r.map(no):no(r),i={done:!1,value:e[0]},s=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Lo(0,e,r);t.push(co(n,1,o))}}(e,t.length-1),e}(e),t),a=Vo(s,e,{ease:Array.isArray(o)?o:(l=e,u=o,l.map((()=>u||Wr)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}function Fo(t,e){return e?t*(1e3/e):0}const jo=5;function No(t,e,n){const r=Math.max(e-jo,0);return Fo(n-t(r),e-r)}const Io=.001,Bo=.01,_o=10,Uo=.05,$o=1;const Ho=12;function zo(t,e){return t*Math.sqrt(1-e*e)}const Wo=["duration","bounce"],qo=["stiffness","damping","mass"];function Yo(t,e){return e.some((e=>void 0!==t[e]))}function Go({keyframes:t,restDelta:e,restSpeed:n,...r}){const o=t[0],i=t[t.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Yo(t,qo)&&Yo(t,Wo)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,i;Rr(t<=Mr(_o),"Spring duration must be 10 seconds or less");let s=1-e;s=rn(Uo,$o,s),t=rn(Bo,_o,Fr(t)),s<1?(o=e=>{const r=e*s,o=r*t,i=r-n,a=zo(e,s),l=Math.exp(-o);return Io-i/a*l},i=e=>{const r=e*s*t,i=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=zo(Math.pow(e,2),s);return(-o(e)+Io>0?-1:1)*((i-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-Io,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Ho;n++)r-=t(r)/e(r);return r}(o,i,5/t);if(t=Mr(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r),p=c?-Fr(c):0,f=l/(2*Math.sqrt(a*u)),m=i-o,g=Fr(Math.sqrt(a/u)),y=Math.abs(m)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),f<1){const t=zo(g,f);v=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)v=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);v=e=>{const n=Math.exp(-f*g*e),r=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(r)+t*m*Math.cosh(r))/t}}return{calculatedDuration:h&&d||null,next:t=>{const r=v(t);if(h)s.done=t>=d;else{let o=p;0!==t&&(o=f<1?No(v,t,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=e;s.done=a&&l}return s.value=s.done?i:r,s}}}function Xo({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=d+f,g=void 0===s?m:s(m);g!==m&&(f=g-d);const y=t=>-f*Math.exp(-t/r),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let b,x;const E=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(b=t,x=Go({keyframes:[h.value,p(h.value)],velocity:No(v,t,h.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),E(t)),void 0!==b&&t>b?x.next(t-b):(!e&&w(t),h)}}}const Ko=t=>{const e=({timestamp:e})=>t(e);return{start:()=>er.update(e,!0),stop:()=>nr(e),now:()=>rr.isProcessing?rr.timestamp:performance.now()}},Jo=2e4;function Zo(t){let e=0,n=t.next(e);for(;!n.done&&e<Jo;)e+=50,n=t.next(e);return e>=Jo?1/0:e}const Qo={decay:Xo,inertia:Xo,tween:Mo,keyframes:Mo,spring:Go};function ti({autoplay:t=!0,delay:e=0,driver:n=Ko,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,f,m=1,g=!1;const y=()=>{f=new Promise((t=>{p=t}))};let v;y();const w=Qo[o]||Mo;let b;w!==Mo&&"number"!=typeof r[0]&&(b=Vo([0,100],r,{clamp:!1}),r=[0,100]);const x=w({...h,keyframes:r});let E;"mirror"===a&&(E=w({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let S="idle",P=null,T=null,C=null;null===x.calculatedDuration&&i&&(x.calculatedDuration=Zo(x));const{calculatedDuration:A}=x;let D=1/0,k=1/0;null!==A&&(D=A+s,k=D*(i+1)-s);let O=0;const L=t=>{if(null===T)return;m>0&&(T=Math.min(T,t)),m<0&&(T=Math.min(t-k/m,T)),O=null!==P?P:Math.round(t-T)*m;const n=O-e*(m>=0?1:-1),o=m>=0?n<0:n>k;O=Math.max(n,0),"finished"===S&&null===P&&(O=k);let l=O,u=x;if(i){const t=O/D;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,i+1);const r=Boolean(e%2);r&&("reverse"===a?(n=1-n,s&&(n-=s/D)):"mirror"===a&&(u=E));let o=rn(0,1,n);O>k&&(o="reverse"===a&&r?1:0),l=o*D}const c=o?{done:!1,value:r[0]}:u.next(l);b&&(c.value=b(c.value));let{done:h}=c;o||null===A||(h=m>=0?O>=k:O<=0);const p=null===P&&("finished"===S||"running"===S&&h);return d&&d(c.value),p&&M(),c},R=()=>{v&&v.stop(),v=void 0},V=()=>{S="idle",R(),p(),y(),T=C=null},M=()=>{S="finished",c&&c(),R(),p()},F=()=>{if(g)return;v||(v=n(L));const t=v.now();l&&l(),null!==P?T=t-P:T&&"finished"!==S||(T=t),"finished"===S&&y(),C=T,P=null,S="running",v.start()};t&&F();const j={then:(t,e)=>f.then(t,e),get time(){return Fr(O)},set time(t){t=Mr(t),O=t,null===P&&v&&0!==m?T=v.now()-t/m:P=t},get duration(){const t=null===x.calculatedDuration?Zo(x):x.calculatedDuration;return Fr(t)},get speed(){return m},set speed(t){t!==m&&v&&(m=t,j.time=Fr(O))},get state(){return S},play:F,pause:()=>{S="paused",P=O},stop:()=>{g=!0,"idle"!==S&&(S="idle",u&&u(),V())},cancel:()=>{null!==C&&L(C),V()},complete:()=>{S="finished"},sample:t=>(T=0,L(t))};return j}const ei=function(t){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),ni=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const ri={type:"spring",stiffness:500,damping:25,restSpeed:10},oi={type:"keyframes",duration:.8},ii={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},si=(t,{keyframes:e})=>e.length>2?oi:Ge.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ri:ii,ai=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!To.test(e)&&"0"!==e||e.startsWith("url("))),li=new Set(["brightness","contrast","saturate","opacity"]);function ui(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(un)||[];if(!r)return t;const o=n.replace(r,"");let i=li.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+o+")"}const ci=/([a-z-]*)\(.*?\)/g,di={...To,getAnimatableNone:t=>{const e=t.match(ci);return e?e.map(ui).join(" "):t}},hi={...xn,color:uo,backgroundColor:uo,outlineColor:uo,fill:uo,stroke:uo,borderColor:uo,borderTopColor:uo,borderRightColor:uo,borderBottomColor:uo,borderLeftColor:uo,filter:di,WebkitFilter:di},pi=t=>hi[t];function fi(t,e){let n=pi(t);return n!==di&&(n=To),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const mi=t=>/^0[^.\s]+$/.test(t);function gi(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||mi(t):void 0}function yi(t,e){return t[e]||t.default||t}const vi=(t,e,n,r={})=>o=>{const i=yi(r,t)||{},s=i.delay||r.delay||0;let{elapsed:a=0}=r;a-=Mr(s);const l=function(t,e,n,r){const o=ai(e,n);let i;i=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<i.length;t++)null===i[t]&&(i[t]=0===t?s:i[t-1]),gi(i[t])&&l.push(t),"string"==typeof i[t]&&"none"!==i[t]&&"0"!==i[t]&&(a=i[t]);if(o&&l.length&&a)for(let t=0;t<l.length;t++)i[l[t]]=fi(e,a);return i}(e,t,n,i),u=l[0],c=l[l.length-1],d=ai(t,u),h=ai(t,c);Rr(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:t=>{e.set(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(i)||(p={...p,...si(t,p)}),p.duration&&(p.duration=Mr(p.duration)),p.repeatDelay&&(p.repeatDelay=Mr(p.repeatDelay)),!d||!h||!1===i.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const o=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Zn,pause:Zn,stop:Zn,then:t=>(t(),Promise.resolve()),cancel:Zn,complete:Zn});return e?ti({keyframes:[0,1],duration:0,delay:e,onComplete:o}):o()}(p);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...o}){if(!ei()||!ni.has(e)||o.repeatDelay||"mirror"===o.repeatType||0===o.damping||"inertia"===o.type)return!1;let i,s,a=!1;const l=()=>{s=new Promise((t=>{i=t}))};l();let{keyframes:u,duration:c=300,ease:d,times:h}=o;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Nr(e.ease))(e,o)){const t=ti({...o,repeat:0,delay:0});let e={done:!1,value:u[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;h=void 0,u=n,c=r-10,d="linear"}const p=function(t,e,n,{delay:r=0,duration:o,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=_r(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,u,{...o,duration:c,ease:d,times:h});o.syncStart&&(p.startTime=rr.isProcessing?rr.timestamp:document.timeline?document.timeline.currentTime:performance.now());const f=()=>p.cancel(),m=()=>{er.update(f),i(),l()};return p.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(u,o)),r&&r(),m()},{then:(t,e)=>s.then(t,e),attachTimeline:t=>(p.timeline=t,p.onfinish=null,Zn),get time(){return Fr(p.currentTime||0)},set time(t){p.currentTime=Mr(t)},get speed(){return p.playbackRate},set speed(t){p.playbackRate=t},get duration(){return Fr(c)},play:()=>{a||(p.play(),nr(f))},pause:()=>p.pause(),stop:()=>{if(a=!0,"idle"===p.playState)return;const{currentTime:e}=p;if(e){const n=ti({...o,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}m()},complete:()=>p.finish(),cancel:m}}(e,t,p);if(n)return n}return ti(p)};function wi(t){return Boolean(Ke(t)&&t.add)}const bi=t=>/^\-?\d*\.?\d+$/.test(t);function xi(t,e){-1===t.indexOf(e)&&t.push(e)}function Ei(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Si{constructor(){this.subscriptions=[]}add(t){return xi(this.subscriptions,t),()=>Ei(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pi={current:void 0};class Ti{constructor(t,e={}){var n;this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=rr;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,er.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>er.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Si);const n=this.events[t].add(e);return"change"===t?()=>{n(),er.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Pi.current&&Pi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Fo(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ci(t,e){return new Ti(t,e)}const Ai=t=>e=>e.test(t),Di=[on,gn,mn,fn,vn,yn,{test:t=>"auto"===t,parse:t=>t}],ki=t=>Di.find(Ai(t)),Oi=[...Di,uo,To],Li=t=>Oi.find(Ai(t));function Ri(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ci(n))}function Vi(t,e){if(e)return(e[t]||e.default||e).from}function Mi({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Fi(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const u=[],c=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const r=t.getValue(e),o=a[e];if(!r||void 0===o||c&&Mi(c,e))continue;const s={delay:n,elapsed:0,...i};if(window.HandoffAppearAnimations&&!r.hasAnimated){const n=t.getProps()[Lr];n&&(s.elapsed=window.HandoffAppearAnimations(n,e,r,er),s.syncStart=!0)}r.start(vi(e,r,o,t.shouldReduceMotion&&Ge.has(e)?{type:!1}:s));const d=r.animation;wi(l)&&(l.add(e),d.then((()=>l.remove(e)))),u.push(d)}return s&&Promise.all(u).then((()=>{s&&function(t,e){const n=Or(t,e);let{transitionEnd:r={},transition:o={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const e in i)Ri(t,e,Gn(i[e]))}(t,s)})),u}function ji(t,e,n={}){const r=Or(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Fi(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=o;return function(t,e,n=0,r=0,o=1,i){const s=[],a=(t.variantChildren.size-1)*r,l=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Ni).forEach(((t,r)=>{t.notify("AnimationStart",e),s.push(ji(t,e,{...i,delay:n+l(r)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(s)}(t,e,i+r,s,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[i,s]:[s,i];return t().then((()=>e()))}return Promise.all([i(),s(n.delay)])}function Ni(t,e){return t.sortNodePosition(e)}const Ii=[...Le].reverse(),Bi=Le.length;function _i(t){let e=function(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map((e=>ji(t,e,n)));r=Promise.all(o)}else if("string"==typeof e)r=ji(t,e,n);else{const o="function"==typeof e?Or(t,e,n.custom):e;r=Promise.all(Fi(t,o,n))}return r.then((()=>t.notify("AnimationComplete",e)))}(t,e,n))))}(t);const n={animate:Ui(!0),whileInView:Ui(),whileHover:Ui(),whileTap:Ui(),whileDrag:Ui(),whileFocus:Ui(),exit:Ui()};let r=!0;const o=(e,n)=>{const r=Or(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function i(i,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Bi;e++){const m=Ii[e],g=n[m],y=void 0!==a[m]?a[m]:l[m],v=ke(y),w=m===s?g.isActive:null;!1===w&&(h=e);let b=y===l[m]&&y!==a[m]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),g.protectedKeys={...d},!g.isActive&&null===w||!y&&!g.prevProp||Oe(y)||"boolean"==typeof y)continue;const x=(p=g.prevProp,"string"==typeof(f=y)?f!==p:!!Array.isArray(f)&&!kr(f,p));let E=x||m===s&&g.isActive&&!b&&v||e>h&&v;const S=Array.isArray(y)?y:[y];let P=S.reduce(o,{});!1===w&&(P={});const{prevResolvedValues:T={}}=g,C={...T,...P},A=t=>{E=!0,c.delete(t),g.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];d.hasOwnProperty(t)||(e!==n?qn(e)&&qn(n)?!kr(e,n)||x?A(t):g.protectedKeys[t]=!0:void 0!==e?A(t):c.add(t):void 0!==e&&c.has(t)?A(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=P,g.isActive&&(d={...d,...P}),r&&t.blockInitialAnimation&&(E=!1),E&&!b&&u.push(...S.map((t=>({animation:t,options:{type:m,...i}}))))}var p,f;if(c.size){const e={};c.forEach((n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)})),u.push({animation:e})}let m=Boolean(u.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(u):Promise.resolve()}return{animateChanges:i,setActive:function(e,r,o){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)})),n[e].isActive=r;const a=i(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Ui(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $i=0;const Hi={animation:{Feature:class extends wr{constructor(t){super(t),t.animationState||(t.animationState=_i(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Oe(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends wr{constructor(){super(...arguments),this.id=$i++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&o.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},zi=(t,e)=>Math.abs(t-e);class Wi{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Gi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=zi(t.x,e.x),r=zi(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:o}=rr;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=qi(e,this.transformPagePoint),er.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:r}=this.handlers,o=Gi("pointercancel"===t.type?this.lastMoveEventInfo:qi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!lr(t))return;this.handlers=e,this.transformPagePoint=n;const r=qi(ur(t),this.transformPagePoint),{point:o}=r,{timestamp:i}=rr;this.history=[{...o,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,Gi(r,this.history)),this.removeListeners=pr(dr(window,"pointermove",this.handlePointerMove),dr(window,"pointerup",this.handlePointerUp),dr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),nr(this.updatePoint)}}function qi(t,e){return e?{point:e(t.point)}:t}function Yi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Gi({point:t},e){return{point:t,delta:Yi(t,Ki(e)),offset:Yi(t,Xi(e)),velocity:Ji(e,.1)}}function Xi(t){return t[0]}function Ki(t){return t[t.length-1]}function Ji(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=Ki(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Mr(e)));)n--;if(!r)return{x:0,y:0};const i=Fr(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Zi(t){return t.max-t.min}function Qi(t,e=0,n=.01){return Math.abs(t-e)<=n}function ts(t,e,n,r=.5){t.origin=r,t.originPoint=co(e.min,e.max,t.origin),t.scale=Zi(n)/Zi(e),(Qi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=co(n.min,n.max,t.origin)-t.originPoint,(Qi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function es(t,e,n,r){ts(t.x,e.x,n.x,r?r.originX:void 0),ts(t.y,e.y,n.y,r?r.originY:void 0)}function ns(t,e,n){t.min=n.min+e.min,t.max=t.min+Zi(e)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+Zi(e)}function os(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function is(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ss(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const as=.35;function ls(t,e,n){return{min:us(t,e),max:us(t,n)}}function us(t,e){return"number"==typeof t?t:t[e]||0}const cs=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ds=()=>({x:{min:0,max:0},y:{min:0,max:0}});function hs(t){return[t("x"),t("y")]}function ps({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function fs(t){return void 0===t||1===t}function ms({scale:t,scaleX:e,scaleY:n}){return!fs(t)||!fs(e)||!fs(n)}function gs(t){return ms(t)||ys(t)||t.z||t.rotate||t.rotateX||t.rotateY}function ys(t){return vs(t.x)||vs(t.y)}function vs(t){return t&&"0%"!==t}function ws(t,e,n){return n+e*(t-n)}function bs(t,e,n,r,o){return void 0!==o&&(t=ws(t,o,r)),ws(t,n,r)+e}function xs(t,e=0,n=1,r,o){t.min=bs(t.min,e,n,r,o),t.max=bs(t.max,e,n,r,o)}function Es(t,{x:e,y:n}){xs(t.x,e.translate,e.scale,e.originPoint),xs(t.y,n.translate,n.scale,n.originPoint)}function Ss(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Ps(t,e){t.min=t.min+e,t.max=t.max+e}function Ts(t,e,[n,r,o]){const i=void 0!==e[o]?e[o]:.5,s=co(t.min,t.max,i);xs(t,e[n],e[r],s,e.scale)}const Cs=["x","scaleX","originX"],As=["y","scaleY","originY"];function Ds(t,e){Ts(t.x,e,Cs),Ts(t.y,e,As)}function ks(t,e){return ps(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const Os=new WeakMap;class Ls{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ds(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;n&&!1===n.isPresent||(this.panSession=new Wi(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(ur(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=yr(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hs((t=>{let e=this.getAxisMotionValue(t).get()||0;if(mn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Zi(r)*(parseFloat(e)/100))}}this.originPoint[t]=e})),o&&er.update((()=>o(t,e)),!1,!0);const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),i&&i(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()}))}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&er.update((()=>o(t,e)))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Rs(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?co(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?co(n,t,r.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;t&&De(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:r,right:o}){return{x:is(t.x,n,o),y:is(t.y,e,r)}}(n.layoutBox,t),this.elastic=function(t=as){return!1===t?t=0:!0===t&&(t=as),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}(e),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&hs((t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!De(t))return!1;const n=t.current;Vr(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(t,e,n){const r=ks(t,n),{scroll:o}=e;return o&&(Ps(r.x,o.offset.x),Ps(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:ss(t.x,e.x),y:ss(t.y,e.y)}}(r.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=ps(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=hs((s=>{if(!Rs(s,e,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(vi(t,n,0,e))}stopAnimation(){hs((t=>this.getAxisMotionValue(t).stop()))}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){hs((e=>{const{drag:n}=this.getProps();if(!Rs(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[e];o.set(t[e]-co(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!De(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};hs((t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Zi(t),o=Zi(e);return o>r?n=Lo(e.min,e.max-r,t.min):r>o&&(n=Lo(t.min,t.max-o,e.min)),rn(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),hs((e=>{if(!Rs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:i}=this.constraints[e];n.set(co(o,i,r[e]))}))}addListeners(){if(!this.visualElement.current)return;Os.set(this.visualElement,this);const t=dr(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();De(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const o=ar(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(hs((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{o(),t(),r(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=as,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Rs(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Vs=t=>(e,n)=>{t&&er.update((()=>t(e,n)))},Ms={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Fs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const js={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!gn.test(t))return t;t=parseFloat(t)}return`${Fs(t,e.target.x)}% ${Fs(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=To.parse(t);if(o.length>5)return r;const i=To.createTransformer(t),s="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+s]/=a,o[1+s]/=l;const u=co(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),i(o)}};class Is extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=t;var i;i=_s,Object.assign(qe,i),o&&(e.group&&e.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Ms.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||er.postRender((()=>{const t=i.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Bs(e){const[n,r]=function(){const e=(0,t.useContext)(Pe);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,i=(0,t.useId)();return(0,t.useEffect)((()=>o(i)),[]),!n&&r?[!1,()=>r&&r(i)]:[!0]}(),o=(0,t.useContext)(Ie);return t.createElement(Is,{...e,layoutGroup:o,switchLayoutGroup:(0,t.useContext)(Be),isPresent:n,safeToRemove:r})}const _s={borderRadius:{...js,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:js,borderTopRightRadius:js,borderBottomLeftRadius:js,borderBottomRightRadius:js,boxShadow:Ns},Us=["TopLeft","TopRight","BottomLeft","BottomRight"],$s=Us.length,Hs=t=>"string"==typeof t?parseFloat(t):t,zs=t=>"number"==typeof t||gn.test(t);function Ws(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const qs=Gs(0,.5,Kr),Ys=Gs(.5,.95,Zn);function Gs(t,e,n){return r=>r<t?0:r>e?1:n(Lo(t,e,r))}function Xs(t,e){t.min=e.min,t.max=e.max}function Ks(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Js(t,e,n,r,o){return t=ws(t-=e,1/n,r),void 0!==o&&(t=ws(t,1/o,r)),t}function Zs(t,e,[n,r,o],i,s){!function(t,e=0,n=1,r=.5,o,i=t,s=t){if(mn.test(e)&&(e=parseFloat(e),e=co(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=co(i.min,i.max,r);t===i&&(a-=e),t.min=Js(t.min,e,n,a,o),t.max=Js(t.max,e,n,a,o)}(t,e[n],e[r],e[o],e.scale,i,s)}const Qs=["x","scaleX","originX"],ta=["y","scaleY","originY"];function ea(t,e,n,r){Zs(t.x,e,Qs,n?n.x:void 0,r?r.x:void 0),Zs(t.y,e,ta,n?n.y:void 0,r?r.y:void 0)}function na(t){return 0===t.translate&&1===t.scale}function ra(t){return na(t.x)&&na(t.y)}function oa(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function ia(t){return Zi(t.x)/Zi(t.y)}class sa{constructor(){this.members=[]}add(t){xi(this.members,t),t.scheduleRender()}remove(t){if(Ei(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function aa(t,e,n){let r="";const o=t.x.translate/e.x,i=t.y.translate/e.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),o&&(r+=`rotateY(${o}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const la=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){xi(this.children,t),this.isDirty=!0}remove(t){Ei(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(la),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"];let da=0;const ha={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function pa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=da++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;ha.totalNodes=ha.resolvedTargetDeltas=ha.recalculatedProjection=0,this.nodes.forEach(ga),this.nodes.forEach(Sa),this.nodes.forEach(Pa),this.nodes.forEach(ya),t=ha,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ua)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Si),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=performance.now(),r=({timestamp:e})=>{const o=e-n;o>=250&&(nr(r),t(o-250))};return er.read(r,!0),()=>nr(r)}(r),Ms.hasAnimatedSinceResize&&(Ms.hasAnimatedSinceResize=!1,this.nodes.forEach(Ea))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Oa,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!oa(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...yi(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Ea(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,nr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ta),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(wa);this.isUpdating||this.nodes.forEach(ba),this.isUpdating=!1,this.nodes.forEach(xa),this.nodes.forEach(fa),this.nodes.forEach(ma),this.clearAllSnapshots();const t=performance.now();rr.delta=rn(0,1e3/60,t-rr.timestamp),rr.timestamp=t,rr.isProcessing=!0,or.update.process(rr),or.preRender.process(rr),or.render.process(rr),rr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask((()=>this.update())))}clearAllSnapshots(){this.nodes.forEach(va),this.sharedNodes.forEach(Ca)}scheduleUpdateProjection(){er.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){er.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ds(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ra(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;t&&(e||gs(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Va((r=n).x),Va(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return ds();const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Ps(e.x,n.offset.x),Ps(e.y,n.offset.y)),e}removeElementScroll(t){const e=ds();Ks(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:o,options:i}=r;if(r!==this.root&&o&&i.layoutScroll){if(o.isRoot){Ks(e,t);const{scroll:n}=this.root;n&&(Ps(e.x,-n.offset.x),Ps(e.y,-n.offset.y))}Ps(e.x,o.offset.x),Ps(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n=ds();Ks(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ds(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),gs(r.latestValues)&&Ds(n,r.latestValues)}return gs(this.latestValues)&&Ds(n,this.latestValues),n}removeTransform(t){const e=ds();Ks(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!gs(n.latestValues))continue;ms(n.latestValues)&&n.updateSnapshot();const r=ds();Ks(r,n.measurePageBox()),ea(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return gs(this.latestValues)&&ea(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=rr.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ds(),this.relativeTargetOrigin=ds(),os(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Ks(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target=ds(),this.targetWithTransforms=ds()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ns(s.x,a.x,l.x),ns(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ks(this.target,this.layout.layoutBox),Es(this.target,this.targetDelta)):Ks(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ds(),this.relativeTargetOrigin=ds(),os(this.relativeTargetOrigin,this.target,t.target),Ks(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ha.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ms(this.parent.latestValues)&&!ys(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===rr.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;Ks(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const o=n.length;if(!o)return;let i,s;e.x=e.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const o=i.instance;o&&o.style&&"contents"===o.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ds(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,Es(t,s)),r&&gs(i.latestValues)&&Ds(t,i.latestValues))}e.x=Ss(e.x),e.y=Ss(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta=cs(),this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta=cs(),this.projectionDeltaWithTransform=cs());const u=this.projectionTransform;es(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=aa(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),ha.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=cs();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s=ds(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(ka));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,p,f;Aa(i.x,t.x,n),Aa(i.y,t.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(os(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,h=this.relativeTargetOrigin,p=s,f=n,Da(l.x,h.x,p.x,f),Da(l.y,h.y,p.y,f),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d=ds()),Ks(d,this.relativeTarget)),a&&(this.animationValues=o,function(t,e,n,r,o,i){o?(t.opacity=co(0,void 0!==n.opacity?n.opacity:1,qs(r)),t.opacityExit=co(void 0!==e.opacity?e.opacity:1,0,Ys(r))):i&&(t.opacity=co(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<$s;o++){const i=`border${Us[o]}Radius`;let s=Ws(e,i),a=Ws(n,i);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||zs(s)===zs(a)?(t[i]=Math.max(co(Hs(s),Hs(a),r),0),(mn.test(a)||mn.test(s))&&(t[i]+="%")):t[i]=a)}(e.rotate||n.rotate)&&(t.rotate=co(e.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=er.update((()=>{Ms.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=Ke(0)?0:Ci(0);return r.start(vi("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:o}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&Ma(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||ds();const e=Zi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Zi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Ks(e,n),Ds(e,o),es(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<ca.length;e++){const o="rotate"+ca[e];n[o]&&(r[o]=n[o],t.setStaticValue(o,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Xn(t.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Xn(t.pointerEvents)||""),this.hasProjected&&!gs(this.latestValues)&&(e.transform=o?o({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=aa(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,i.animationValues?r.opacity=i===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in qe){if(void 0===s[t])continue;const{correct:e,applyTo:n}=qe[t],o="none"===r.transform?s[t]:e(s[t],i);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Xn(t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()})),this.root.nodes.forEach(wa),this.root.sharedNodes.clear()}}}function fa(t){t.updateLayout()}function ma(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:o}=t.options,i=n.source!==t.layout.source;"size"===o?hs((t=>{const r=i?n.measuredBox[t]:n.layoutBox[t],o=Zi(r);r.min=e[t].min,r.max=r.min+o})):Ma(o,n.layoutBox,e)&&hs((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Zi(e[r]);o.max=o.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)}));const s=cs();es(s,e,n.layoutBox);const a=cs();i?es(a,t.applyTransform(r,!0),n.measuredBox):es(a,e,n.layoutBox);const l=!ra(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=ds();os(s,n.layoutBox,o.layoutBox);const a=ds();os(a,e,i.layoutBox),oa(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ga(t){ha.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ya(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function va(t){t.clearSnapshot()}function wa(t){t.clearMeasurements()}function ba(t){t.isLayoutDirty=!1}function xa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ea(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Sa(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function Ta(t){t.resetRotation()}function Ca(t){t.removeLeadSnapshot()}function Aa(t,e,n){t.translate=co(e.translate,0,n),t.scale=co(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Da(t,e,n,r){t.min=co(e.min,n.min,r),t.max=co(e.max,n.max,r)}function ka(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Oa={duration:.45,ease:[.4,0,.1,1]},La=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=La("applewebkit/")&&!La("chrome/")?Math.round:Zn;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function Ma(t,e,n){return"position"===t||"preserve-aspect"===t&&!Qi(ia(e),ia(n),.2)}const Fa=pa({attachResizeListener:(t,e)=>ar(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ja={current:void 0},Na=pa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ja.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),ja.current=t}return ja.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ia={pan:{Feature:class extends wr{constructor(){super(...arguments),this.removePointerDownListener=Zn}onPointerDown(t){this.session=new Wi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Vs(t),onStart:Vs(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&er.update((()=>r(t,e)))}}}mount(){this.removePointerDownListener=dr(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends wr{constructor(t){super(t),this.removeGroupControls=Zn,this.removeListeners=Zn,this.controls=new Ls(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zn}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Na,MeasureLayout:Bs}},Ba=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function _a(t,e,n=1){Vr(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,o]=function(t){const e=Ba.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const t=i.trim();return bi(t)?parseFloat(t):t}return en(o)?_a(o,e,n+1):o}const Ua=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),$a=t=>Ua.has(t),Ha=t=>t===on||t===gn,za=(t,e)=>parseFloat(t.split(", ")[e]),Wa=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return za(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},qa=new Set(["x","y","z"]),Ya=Ye.filter((t=>!qa.has(t))),Ga={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Wa(4,13),y:Wa(5,14)};Ga.translateX=Ga.x,Ga.translateY=Ga.y;function Xa(t,e,n,r){return(t=>Object.keys(t).some($a))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter($a);let i=[],s=!1;const a=[];if(o.forEach((o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=ki(u);const d=e[o];let h;if(qn(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=ki(u);for(let n=e;n<t&&null!==d[n];n++)h?Vr(ki(d[n])===h,"All keyframes must be of the same type"):(h=ki(d[n]),Vr(h===c||Ha(c)&&Ha(h),"Keyframes must be of the same dimension as the current value"))}else h=ki(d);if(c!==h)if(Ha(c)&&Ha(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[o]=parseFloat(d):Array.isArray(d)&&h===gn&&(e[o]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[o]=c.transform(d):(s||(i=function(t){const e=[];return Ya.forEach((n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),e.length&&t.render(),e}(t),s=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],l.jump(d))})),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,i=getComputedStyle(o),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach((t=>{a[t]=Ga[t](r,i)})),e.render();const l=e.measureViewportBox();return n.forEach((n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=Ga[n](l,i)})),t})(e,t,a);return i.length&&i.forEach((([e,n])=>{t.getValue(e).set(n)})),t.render(),Te&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ka={current:null},Ja={current:!1},Za=new WeakMap,Qa=Object.keys(Ne),tl=Qa.length,el=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],nl=Re.length;class rl{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>er.render(this.render,!1,!0);const{latestValues:s,renderState:a}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=i,this.isControllingVariants=Ve(e),this.isVariantNode=Me(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&Ke(e)&&(e.set(s[t],!1),wi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Za.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Ja.current||function(){if(Ja.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ka.current=t.matches;t.addListener(e),e()}else Ka.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ka.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Za.delete(this.current),this.projection&&this.projection.unmount(),nr(this.notifyUpdate),nr(this.render),this.valueSubscriptions.forEach((t=>t())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=Ge.has(t),r=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&er.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,(()=>{r(),o()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,o){let i,s;for(let t=0;t<tl;t++){const n=Qa[t],{isEnabled:r,Feature:o,ProjectionNode:a,MeasureLayout:l}=Ne[n];a&&(i=a),r(e)&&(!this.features[n]&&o&&(this.features[n]=new o(this)),l&&(s=l))}if(!this.projection&&i){this.projection=new i(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&De(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ds()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<el.length;e++){const n=el[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const i=e[o],s=n[o];if(Ke(i))t.addValue(o,i),wi(r)&&r.add(o);else if(Ke(s))t.addValue(o,Ci(i,{owner:t})),wi(r)&&r.remove(o);else if(s!==i)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(o);t.addValue(o,Ci(void 0!==e?e:i,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<nl;t++){const n=Re[t],r=this.props[n];(ke(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ci(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=Wn(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||Ke(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Si),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ol extends rl{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let i=function(t,e,n){const r={};for(const o in t){const t=Vi(o,e);if(void 0!==t)r[o]=t;else{const t=n.getValue(o);t&&(r[o]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),i&&(i=r(i))),o){!function(t,e,n){var r,o;const i=Object.keys(e).filter((e=>!t.hasValue(e))),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==o?o:e[s]),null!=u&&("string"==typeof u&&(bi(u)||mi(u))?u=parseFloat(u):!Li(u)&&To.test(l)&&(u=fi(s,l)),t.addValue(s,Ci(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,i);const t=((t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach((t=>{const e=t.get();if(!en(e))return;const n=_a(e,r);n&&t.set(n)}));for(const t in e){const o=e[t];if(!en(o))continue;const i=_a(o,r);i&&(e[t]=i,n||(n={}),void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return Xa(t,e=o.target,n,r=o.transitionEnd)})(this,n,i,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class il extends ol{readValueFromInstance(t,e){if(Ge.has(e)){const t=pi(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(tn(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ks(t,e)}build(t,e,n,r){En(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Hn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ke(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}renderInstance(t,e,n,r){Bn(t,e,n,r)}}class sl extends ol{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ge.has(e)){const t=pi(e);return t&&t.default||0}return e=Un.has(e)?e:In(e),t.getAttribute(e)}measureInstanceViewportBox(){return ds()}scrapeMotionValuesFromProps(t,e){return zn(t,e)}build(t,e,n,r){Vn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){$n(t,e,0,r)}mount(t){this.isSVGTag=Fn(t.tagName),super.mount(t)}}const al=(t,e)=>We(t)?new sl(e,{enableHardwareAcceleration:!1}):new il(e,{enableHardwareAcceleration:!0}),ll={...Hi,...Dr,...Ia,layout:{ProjectionNode:Na,MeasureLayout:Bs}},ul=He(((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...We(t)?ir:sr,preloadedFeatures:n,useRender:Nn(e),createVisualElement:r,Component:t}}(t,e,ll,al))),cl=window.wp.apiFetch;var dl=o.n(cl);const hl="/extendify/v1/library/settings",pl={getItem:async()=>await dl()({path:hl}),setItem:async(t,e)=>await dl()({path:hl,method:"POST",data:{state:e}})},fl={siteType:{},category:"",totalImports:0},ml=(t=>{try{return JSON.parse(t)}catch(t){return{}}})(window.extLibraryData.siteInfo),gl=g(E((t=>{var e,n,r;return{...fl,...null!==(e=ml?.state)&&void 0!==e?e:{},siteType:null!==(n=null!==(r=window.extSharedData?.siteType)&&void 0!==r?r:ml.siteType)&&void 0!==n?n:{},setSiteType:async e=>{t({siteType:e}),await dl()({path:`${hl}/single`,method:"POST",data:{key:"siteType",value:e}})},setCategory:e=>t({category:e}),incrementImports:()=>t((t=>({totalImports:t.totalImports+1})))}}),{name:"extendify_library_site_data",storage:b((()=>pl)),skipHydration:!0})),yl=t=>{try{return JSON.parse(t)}catch(t){return{}}},vl={getItem:async()=>await dl()({path:"/wp/v2/users/me"}),setItem:async(t,e)=>await dl()({path:"/wp/v2/users/me",method:"PUT",data:{extendify_library_user:e}})},wl=g(E(((t,e)=>{var n;return{openOnNewPage:!0,updateUserOption:(n,r)=>{Object.keys(e()).includes(n)&&t({[n]:r})},...null!==(n=yl(window.extLibraryData.userInfo)?.state)&&void 0!==n?n:{}}}),{name:"extendify_library_user",storage:b((()=>vl)),partialize:t=>({...t,ready:!1}),skipHydration:!0})),bl={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"},xl=window.wp.components;Object.defineProperty;var El=new Map,Sl=new WeakMap,Pl=0;function Tl(t,e,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const o=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:o,observer:i,elements:s}=function(t){const e=function(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(n=t.root,n?(Sl.has(n)||(Pl+=1,Sl.set(n,Pl.toString())),Sl.get(n)):"0"):t[e]}`;var n})).toString()}(t);let n=El.get(e);if(!n){const r=new Map;let o;const i=new IntersectionObserver((e=>{e.forEach((e=>{var n;const i=e.isIntersecting&&o.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=i),null==(n=r.get(e.target))||n.forEach((t=>{t(i,e)}))}))}),t);o=i.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:i,elements:r},El.set(e,n)}return n}(n),a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),i.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),i.unobserve(t)),0===s.size&&(i.disconnect(),El.delete(o))}}function Cl(){return Cl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Cl.apply(this,arguments)}function Al(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Al(Object(n),!0).forEach((function(e){kl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function kl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.Component;class Ol extends n().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame((()=>{this.reCalculateColumnCount()}))):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let o in e){const i=parseInt(o);i>0&&t<=i&&i<n&&(n=i,r=e[o])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),r=n().Children.toArray(this.props.children);for(let n=0;n<r.length;n++){const o=n%t;e[o]||(e[o]=[]),e[o].push(r[n])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:r}=this.props,o=this.itemsInColumns(),i=100/o.length+"%";let s=r;s&&"string"!=typeof s&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===s&&(s="my-masonry-grid_column"));const a=Dl(Dl(Dl({},t),e),{},{style:Dl(Dl({},e.style),{},{width:i}),className:s});return o.map(((t,e)=>n().createElement("div",Cl({},a,{key:e}),t)))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:r,columnClassName:o,columnAttrs:i,column:s,className:a}=t,l=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let u=a;return"string"!=typeof a&&(this.logDeprecated('The property "className" requires a string'),void 0===a&&(u="my-masonry-grid")),n().createElement("div",Cl({},l,{className:u}),this.renderColumns())}}Ol.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const Ll=Ol;var Rl=o(688);const Vl=()=>{},Ml=Vl(),Fl=Object,jl=t=>t===Ml,Nl=t=>"function"==typeof t,Il=(t,e)=>({...t,...e}),Bl=new WeakMap;let _l=0;const Ul=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let o,i;if(Fl(t)!==t||r||n==RegExp)o=r?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(o=Bl.get(t),o)return o;if(o=++_l+"~",Bl.set(t,o),n==Array){for(o="@",i=0;i<t.length;i++)o+=Ul(t[i])+",";Bl.set(t,o)}if(n==Fl){o="#";const e=Fl.keys(t).sort();for(;!jl(i=e.pop());)jl(t[i])||(o+=i+":"+Ul(t[i])+",");Bl.set(t,o)}}return o},$l=new WeakMap,Hl={},zl={},Wl="undefined",ql=typeof window!=Wl,Yl=typeof document!=Wl,Gl=(t,e)=>{const n=$l.get(t);return[()=>!jl(e)&&t.get(e)||Hl,r=>{if(!jl(e)){const o=t.get(e);e in zl||(zl[e]=o),n[5](e,Il(o,r),o||Hl)}},n[6],()=>!jl(e)&&e in zl?zl[e]:!jl(e)&&t.get(e)||Hl]};let Xl=!0;const[Kl,Jl]=ql&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Vl,Vl],Zl={isOnline:()=>Xl,isVisible:()=>{const t=Yl&&document.visibilityState;return jl(t)||"hidden"!==t}},Ql={initFocus:t=>(Yl&&document.addEventListener("visibilitychange",t),Kl("focus",t),()=>{Yl&&document.removeEventListener("visibilitychange",t),Jl("focus",t)}),initReconnect:t=>{const e=()=>{Xl=!0,t()},n=()=>{Xl=!1};return Kl("online",e),Kl("offline",n),()=>{Jl("online",e),Jl("offline",n)}}},tu=!t.useId,eu=!ql||"Deno"in window,nu=t=>ql&&typeof window.requestAnimationFrame!=Wl?window.requestAnimationFrame(t):setTimeout(t,1),ru=eu?t.useEffect:t.useLayoutEffect,ou="undefined"!=typeof navigator&&navigator.connection,iu=!eu&&ou&&(["slow-2g","2g"].includes(ou.effectiveType)||ou.saveData),su=t=>{if(Nl(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Ul(t):"",e]};let au=0;const lu=()=>++au;async function uu(...t){const[e,n,r,o]=t,i=Il({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const u=i.throwOnError;if(Nl(n)){const t=n,r=[],o=e.keys();for(const n of o)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(c))}return c(n);async function c(n){const[o]=su(n);if(!o)return;const[c,d]=Gl(e,o),[h,p,f,m]=$l.get(e),g=()=>{const t=h[o];return(Nl(i.revalidate)?i.revalidate(c().data,n):!1!==i.revalidate)&&(delete f[o],delete m[o],t&&t[0])?t[0](2).then((()=>c().data)):c().data};if(t.length<3)return g();let y,v=r;const w=lu();p[o]=[w,0];const b=!jl(l),x=c(),E=x.data,S=x._c,P=jl(S)?E:S;if(b&&(l=Nl(l)?l(P,E):l,d({data:l,_c:P})),Nl(v))try{v=v(P)}catch(t){y=t}if(v&&(t=>Nl(t.then))(v)){if(v=await v.catch((t=>{y=t})),w!==p[o][0]){if(y)throw y;return v}y&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Ml}))}if(s&&!y)if(Nl(s)){const t=s(v,P);d({data:t,error:Ml,_c:Ml})}else d({data:v,error:Ml,_c:Ml});if(p[o][1]=lu(),Promise.resolve(g()).then((()=>{d({_c:Ml})})),!y)return v;if(u)throw y}}const cu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},du=(t,e)=>{if(!$l.has(t)){const n=Il(Ql,e),r={},o=uu.bind(Ml,t);let i=Vl;const s={},a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const o=s[e];if(o)for(const t of o)t(n,r)},u=()=>{if(!$l.has(t)&&($l.set(t,[r,{},{},{},o,l,a]),!eu)){const e=n.initFocus(setTimeout.bind(Ml,cu.bind(Ml,r,0))),o=n.initReconnect(setTimeout.bind(Ml,cu.bind(Ml,r,1)));i=()=>{e&&e(),o&&o(),$l.delete(t)}}};return u(),[t,o,u,i]}return[t,$l.get(t)[4]]},[hu,pu]=du(new Map),fu=Il({onLoadingSlow:Vl,onSuccess:Vl,onError:Vl,onErrorRetry:(t,__,e,n,r)=>{const o=e.errorRetryCount,i=r.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*e.errorRetryInterval;!jl(o)&&i>o||setTimeout(n,s,r)},onDiscarded:Vl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:iu?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:iu?5e3:3e3,compare:(t,e)=>Ul(t)==Ul(e),isPaused:()=>!1,cache:hu,mutate:pu,fallback:{}},Zl),mu=(t,e)=>{const n=Il(t,e);if(e){const{use:r,fallback:o}=t,{use:i,fallback:s}=e;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Il(o,s))}return n},gu=(0,t.createContext)({}),yu=e=>{const{value:n}=e,r=(0,t.useContext)(gu),o=Nl(n),i=(0,t.useMemo)((()=>o?n(r):n),[o,r,n]),s=(0,t.useMemo)((()=>o?i:mu(r,i)),[o,r,i]),a=i&&i.provider,l=(0,t.useRef)(Ml);a&&!l.current&&(l.current=du(a(s.cache||hu),i));const u=l.current;return u&&(s.cache=u[0],s.mutate=u[1]),ru((()=>{if(u)return u[2]&&u[2](),u[3]}),[]),(0,t.createElement)(gu.Provider,Il(e,{value:s}))},vu="$inf$",wu=ql&&window.__SWR_DEVTOOLS_USE__,bu=wu?window.__SWR_DEVTOOLS_USE__:[],xu=t=>Nl(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],Eu=bu.concat((t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=su(e),[,,,o]=$l.get(hu);if(r.startsWith(vu))return n(...t);const i=o[r];return jl(i)?n(...t):(delete o[r],i)}),r))),Su=e=>function(...n){const r=Il(fu,(0,t.useContext)(gu)),[o,i,s]=xu(n),a=mu(r,s);let l=e;const{use:u}=a,c=(u||[]).concat(Eu);for(let t=c.length;t--;)l=c[t](l);return l(o,i||a.fetcher||null,a)},Pu=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}},Tu=(t,e)=>(...n)=>{const[r,o,i]=xu(n),s=(i.use||[]).concat(e);return t(r,o,{...i,use:s})};wu&&(window.__SWR_DEVTOOLS_REACT__=t);const Cu=t.use||(t=>{if("pending"===t.status)throw t;if("fulfilled"===t.status)return t.value;throw"rejected"===t.status?t.reason:(t.status="pending",t.then((e=>{t.status="fulfilled",t.value=e}),(e=>{t.status="rejected",t.reason=e})),t)}),Au={dedupe:!0};Fl.defineProperty(yu,"defaultValue",{value:fu});const Du=Su(((e,n,r)=>{const{cache:o,compare:i,suspense:s,fallbackData:a,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p}=r,[f,m,g,y]=$l.get(o),[v,w]=su(e),b=(0,t.useRef)(!1),x=(0,t.useRef)(!1),E=(0,t.useRef)(v),S=(0,t.useRef)(n),P=(0,t.useRef)(r),T=()=>P.current,C=()=>T().isVisible()&&T().isOnline(),[A,D,k,O]=Gl(o,v),L=(0,t.useRef)({}).current,R=jl(a)?r.fallback[v]:a,V=(t,e)=>{for(const n in L){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!jl(t[r]))return!1;if(!i($,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},M=(0,t.useMemo)((()=>{const t=!!v&&!!n&&(jl(l)?!T().isPaused()&&!s&&(!!jl(u)||u):l),e=e=>{const n=Il(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),o=O(),i=e(r),a=r===o?i:e(o);let c=i;return[()=>{const t=e(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>a]}),[o,v]),F=(0,Rl.useSyncExternalStore)((0,t.useCallback)((t=>k(v,((e,n)=>{V(n,e)||t()}))),[o,v]),M[0],M[1]),j=!b.current,N=f[v]&&f[v].length>0,I=F.data,B=jl(I)?R:I,_=F.error,U=(0,t.useRef)(B),$=p?jl(I)?U.current:I:B,H=!(N&&!jl(_))&&(j&&!jl(l)?l:!T().isPaused()&&(s?!jl(B)&&u:jl(B)||u)),z=!!(v&&n&&j&&H),W=jl(F.isValidating)?z:F.isValidating,q=jl(F.isLoading)?z:F.isLoading,Y=(0,t.useCallback)((async t=>{const e=S.current;if(!v||!e||x.current||T().isPaused())return!1;let n,o,s=!0;const a=t||{},l=!g[v]||!a.dedupe,u=()=>tu?!x.current&&v===E.current&&b.current:v===E.current,c={isValidating:!1,isLoading:!1},d=()=>{D(c)},h=()=>{const t=g[v];t&&t[1]===o&&delete g[v]},p={isValidating:!0};jl(A().data)&&(p.isLoading=!0);try{if(l&&(D(p),r.loadingTimeout&&jl(A().data)&&setTimeout((()=>{s&&u()&&T().onLoadingSlow(v,r)}),r.loadingTimeout),g[v]=[e(w),lu()]),[n,o]=g[v],n=await n,l&&setTimeout(h,r.dedupingInterval),!g[v]||g[v][1]!==o)return l&&u()&&T().onDiscarded(v),!1;c.error=Ml;const t=m[v];if(!jl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&T().onDiscarded(v),!1;const a=A().data;c.data=i(a,n)?a:n,l&&u()&&T().onSuccess(n,v,r)}catch(t){h();const e=T(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,v,e),(!0===n||Nl(n)&&n(t))&&(T().revalidateOnFocus&&T().revalidateOnReconnect&&!C()||e.onErrorRetry(t,v,e,(t=>{const e=f[v];e&&e[0]&&e[0](3,t)}),{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0}),[v,o]),G=(0,t.useCallback)(((...t)=>uu(o,E.current,...t)),[]);if(ru((()=>{S.current=n,P.current=r,jl(I)||(U.current=I)})),ru((()=>{if(!v)return;const t=Y.bind(Ml,Au);let e=0;const n=Pu(v,f,((n,r={})=>{if(0==n){const n=Date.now();T().revalidateOnFocus&&n>e&&C()&&(e=n+T().focusThrottleInterval,t())}else if(1==n)T().revalidateOnReconnect&&C()&&t();else{if(2==n)return Y();if(3==n)return Y(r)}}));return x.current=!1,E.current=v,b.current=!0,D({_k:w}),H&&(jl(B)||eu?t():nu(t)),()=>{x.current=!0,n()}}),[v]),ru((()=>{let t;function e(){const e=Nl(c)?c(A().data):c;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!T().isVisible()||!h&&!T().isOnline()?e():Y(Au).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}}),[c,d,h,v]),(0,t.useDebugValue)($),s&&jl(B)&&v){if(!tu&&eu)throw new Error("Fallback data is required when using suspense in SSR.");S.current=n,P.current=r,x.current=!1;const t=y[v];if(!jl(t)){const e=G(t);Cu(e)}if(!jl(_))throw _;{const t=Y(Au);jl($)||(t.status="fulfilled",t.value=!0),Cu(t)}}return{mutate:G,get data(){return L.data=!0,$},get error(){return L.error=!0,_},get isValidating(){return L.isValidating=!0,W},get isLoading(){return L.isLoading=!0,q}}})),ku=Promise.resolve(),Ou=Tu(Du,(e=>(n,r,o)=>{const i=(0,t.useRef)(!1),{cache:s,initialSize:a=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:h=!1}=o,[,,,p]=$l.get(hu);let f;try{f=(t=>su(t?t(0,null):null)[0])(n),f&&(f=vu+f)}catch(t){}const[m,g,y]=Gl(s,f),v=(0,t.useCallback)((()=>jl(m()._l)?a:m()._l),[s,f,a]);(0,Rl.useSyncExternalStore)((0,t.useCallback)((t=>f?y(f,(()=>{t()})):()=>{}),[s,f]),v,v);const w=(0,t.useCallback)((()=>{const t=m()._l;return jl(t)?a:t}),[f,a]),b=(0,t.useRef)(w());ru((()=>{i.current?f&&g({_l:u?b.current:w()}):i.current=!0}),[f,s]);const x=d&&!i.current,E=e(f,(async t=>{const e=m()._i,i=m()._r;g({_r:Ml});const a=[],u=w(),[d]=Gl(s,t),f=d().data,y=[];let v=null;for(let t=0;t<u;++t){const[u,d]=su(n(t,h?null:v));if(!u)break;const[m,g]=Gl(s,u);let w=m().data;const b=l||e||jl(w)||c&&!t&&!jl(f)||x||f&&!jl(f[t])&&!o.compare(f[t],w);if(r&&("function"==typeof i?i(w,d):b)){const e=async()=>{if(u in p){const t=p[u];delete p[u],w=await t}else w=await r(d);g({data:w,_k:d}),a[t]=w};h?y.push(e):await e()}else a[t]=w;h||(v=w)}return h&&await Promise.all(y.map((t=>t()))),g({_i:Ml}),a}),o),S=(0,t.useCallback)((function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return f?(r&&(jl(t)?g({_i:!0,_r:n.revalidate}):g({_i:!1,_r:n.revalidate})),arguments.length?E.mutate(t,{...n,revalidate:r}):E.mutate()):ku}),[f,s]),P=(0,t.useCallback)((t=>{if(!f)return ku;const[,e]=Gl(s,f);let r;if(Nl(t)?r=t(w()):"number"==typeof t&&(r=t),"number"!=typeof r)return ku;e({_l:r}),b.current=r;const o=[],[i]=Gl(s,f);let a=null;for(let t=0;t<r;++t){const[e]=su(n(t,a)),[r]=Gl(s,e),l=e?r().data:Ml;if(jl(l))return S(i().data);o.push(l),a=l}return S(o)}),[f,s,S,w]);return{size:w(),setSize:P,mutate:S,get data(){return E.data},get error(){return E.error},get isValidating(){return E.isValidating},get isLoading(){return E.isLoading}}})),Lu="https://patterns.extendify.com",Ru=t=>fetch(t).then((t=>t.json())),Vu=window.wp.blockEditor,Mu=window.wp.blocks;var Fu=o(967),ju=o.n(Fu);const Nu=window.lodash,Iu=(t,e=[])=>Array.from(e).some((e=>!!e.style&&Array.from(e.style).some((e=>e&&e.includes(t))))),Bu=new WeakMap,_u=({insertPattern:e,code:n})=>{const[o,i]=(0,r.useState)(!1),a=(0,r.useRef)(),l=(0,r.useMemo)((()=>(0,Mu.rawHandler)({HTML:Uu(n)})),[n]),{ready:u}=(({container:t,onIFrameLoaded:e,ready:n,loadDelay:o})=>{const i=(()=>{const t=(0,r.useRef)(!1);return(0,r.useEffect)((()=>(t.current=!0,()=>t.current=!1))),t})(),[s,a]=(0,r.useState)(0),[l,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(!1),h=(0,r.useRef)(!1),{addMissingCSSVar:p}=S(),f=(0,r.useCallback)((t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in bl)e.getPropertyValue(r)||Array.from(n).filter((t=>{try{return t.cssRules}catch(t){return!1}})).some((t=>Iu(r,t.cssRules)))||(p(r),t.contentDocument.documentElement.style.setProperty(r,bl[r]))}),[p]),m=(0,r.useCallback)((async(t,e)=>{var n;if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let r=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];r=r?parseFloat(r):null;const o=e.offsetHeight/(null!==(n=r)&&void 0!==n?n:1);t.style.setProperty("max-height",`${o}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)Bu.has(t)||Bu.set(t,t.style.minHeight),t.style.minHeight=Bu.get(t);e.offsetHeight,await new Promise((t=>requestAnimationFrame(t))),await new Promise((t=>requestAnimationFrame(t)));for(const e of i){if(!t.contentDocument?.defaultView)return;const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1}),[]);return(0,r.useEffect)((()=>{if(!n)return;const r=setTimeout((()=>{if(l)return;const n=t?.querySelector("iframe[title]");if(!n)return a((t=>t+1));u(n),requestAnimationFrame((()=>e(n,t)))}),100);return()=>clearTimeout(r)}),[l,n,s,t,e]),(0,r.useEffect)((()=>{if(d(!1),!l?.contentDocument)return;const e={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame((()=>n(l,t)));const n=(0,Nu.debounce)((async()=>{i.current&&!h.current&&(r.disconnect(),await m(l,t),"extendable"!==window.extSharedData.themeSlug&&await f(l,t),setTimeout((()=>d(!0)),o),i.current&&r.observe(l.contentDocument,e))}),300),r=new MutationObserver(n);return r.observe(l.contentDocument,e),()=>{n.cancel(),r?.disconnect()}}),[l,t,i,n,m,f,o]),{loading:!l,ready:c}})({container:a.current,ready:o,onIFrameLoaded:()=>{},loadDelay:50});return(0,r.useEffect)((()=>i(!0)),[]),(0,t.createElement)("button",{ref:a,type:"button","aria-label":(0,s.__)("Insert Pattern","extendify-local"),className:ju()("library-pattern mb-8 inline-block w-full bg-transparent p-0 m-0 focus:ring-design-main focus:ring-wp focus:ring-offset-2 focus:ring-offset-[#FAFAFA] focus:shadow-sm border focus:outline-none relative z-10 cursor-pointer",{"opacity-0 border-transparent":!u,"opacity-100 border-gray-400":u}),onClick:()=>e(l)},(0,t.createElement)(Vu.BlockPreview,{blocks:l,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }'}]}))},Uu=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),$u=({insertPattern:e,siteType:n,category:o})=>{const{data:i,isLoading:a,setSize:l}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.extSharedData.wpVersion,lang:window.extSharedData.wpLanguage||null,showLocalizedCopy:window.extSharedData.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:o,isValidating:i,mutate:s,size:a,setSize:l}=Ou(((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter((([,t])=>void 0!==t)).forEach((([t,e])=>{r.append(t,e)})),`${Lu}/api/patterns?${r.toString()}`}),Ru,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:o,isValidating:i,mutate:s,size:a,setSize:l}})({siteType:n?.slug,category:o}),[u,c]=(0,r.useState)(!0),[d,h]=function({threshold:e,delay:n,trackVisibility:r,rootMargin:o,root:i,triggerOnce:s,skip:a,initialInView:l,fallbackInView:u,onChange:c}={}){var d;const[h,p]=t.useState(null),f=t.useRef(),[m,g]=t.useState({inView:!!l,entry:void 0});f.current=c,t.useEffect((()=>{if(a||!h)return;let t;return t=Tl(h,((e,n)=>{g({inView:e,entry:n}),f.current&&f.current(e,n),n.isIntersecting&&s&&t&&(t(),t=void 0)}),{root:i,rootMargin:o,threshold:e,trackVisibility:r,delay:n},u),()=>{t&&t()}}),[Array.isArray(e)?e.toString():e,h,i,o,s,a,r,u,n]);const y=null==(d=m.entry)?void 0:d.target,v=t.useRef();h||!y||s||a||v.current===y||(v.current=y,g({inView:!!l,entry:void 0}));const w=[p,m.inView,m.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}(),p=i?.at(-1)?.length<9;return(0,r.useEffect)((()=>{if(a)return c(!0);const t=setTimeout((()=>{c(!1)}),750);return()=>clearTimeout(t)}),[a]),(0,r.useEffect)((()=>{h&&!a&&l((t=>t+1))}),[h,a,l]),a||!i?.length?(0,t.createElement)("div",{className:"text-center absolute inset-0 flex flex-col items-center justify-center"},(0,t.createElement)(xl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,s.__)("Loading Patterns...","extendify-local"))):(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ll,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"w-full relative p-8 pt-2 flex gap-6"},i.map((n=>n.map((({id:n,code:r})=>(0,t.createElement)(_u,{key:n,insertPattern:e,code:r})))))),u?(0,t.createElement)("div",{className:"text-center absolute inset-0 flex flex-col items-center justify-center z-0"},(0,t.createElement)(xl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,s.__)("Loading Patterns...","extendify-local"))):null,u||p?null:(0,t.createElement)("div",{ref:d,className:"mt-6 md:mt-2 mb-6 flex w-full justify-center"},(0,t.createElement)(xl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,s.__)("Loading more patterns...","extendify-local"))))},Hu=t.use||(t=>{if("pending"===t.status)throw t;if("fulfilled"===t.status)return t.value;throw"rejected"===t.status?t.reason:(t.status="pending",t.then((e=>{t.status="fulfilled",t.value=e}),(e=>{t.status="rejected",t.reason=e})),t)}),zu={dedupe:!0};Fl.defineProperty(yu,"defaultValue",{value:fu});const Wu=Su(((e,n,r)=>{const{cache:o,compare:i,suspense:s,fallbackData:a,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p}=r,[f,m,g,y]=$l.get(o),[v,w]=su(e),b=(0,t.useRef)(!1),x=(0,t.useRef)(!1),E=(0,t.useRef)(v),S=(0,t.useRef)(n),P=(0,t.useRef)(r),T=()=>P.current,C=()=>T().isVisible()&&T().isOnline(),[A,D,k,O]=Gl(o,v),L=(0,t.useRef)({}).current,R=jl(a)?r.fallback[v]:a,V=(t,e)=>{for(const n in L){const r=n;if("data"===r){if(!i(t[r],e[r])){if(!jl(t[r]))return!1;if(!i($,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},M=(0,t.useMemo)((()=>{const t=!!v&&!!n&&(jl(l)?!T().isPaused()&&!s&&(!!jl(u)||u):l),e=e=>{const n=Il(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),o=O(),i=e(r),a=r===o?i:e(o);let c=i;return[()=>{const t=e(A());return V(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>a]}),[o,v]),F=(0,Rl.useSyncExternalStore)((0,t.useCallback)((t=>k(v,((e,n)=>{V(n,e)||t()}))),[o,v]),M[0],M[1]),j=!b.current,N=f[v]&&f[v].length>0,I=F.data,B=jl(I)?R:I,_=F.error,U=(0,t.useRef)(B),$=p?jl(I)?U.current:I:B,H=!(N&&!jl(_))&&(j&&!jl(l)?l:!T().isPaused()&&(s?!jl(B)&&u:jl(B)||u)),z=!!(v&&n&&j&&H),W=jl(F.isValidating)?z:F.isValidating,q=jl(F.isLoading)?z:F.isLoading,Y=(0,t.useCallback)((async t=>{const e=S.current;if(!v||!e||x.current||T().isPaused())return!1;let n,o,s=!0;const a=t||{},l=!g[v]||!a.dedupe,u=()=>tu?!x.current&&v===E.current&&b.current:v===E.current,c={isValidating:!1,isLoading:!1},d=()=>{D(c)},h=()=>{const t=g[v];t&&t[1]===o&&delete g[v]},p={isValidating:!0};jl(A().data)&&(p.isLoading=!0);try{if(l&&(D(p),r.loadingTimeout&&jl(A().data)&&setTimeout((()=>{s&&u()&&T().onLoadingSlow(v,r)}),r.loadingTimeout),g[v]=[e(w),lu()]),[n,o]=g[v],n=await n,l&&setTimeout(h,r.dedupingInterval),!g[v]||g[v][1]!==o)return l&&u()&&T().onDiscarded(v),!1;c.error=Ml;const t=m[v];if(!jl(t)&&(o<=t[0]||o<=t[1]||0===t[1]))return d(),l&&u()&&T().onDiscarded(v),!1;const a=A().data;c.data=i(a,n)?a:n,l&&u()&&T().onSuccess(n,v,r)}catch(t){h();const e=T(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,v,e),(!0===n||Nl(n)&&n(t))&&(T().revalidateOnFocus&&T().revalidateOnReconnect&&!C()||e.onErrorRetry(t,v,e,(t=>{const e=f[v];e&&e[0]&&e[0](3,t)}),{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return s=!1,d(),!0}),[v,o]),G=(0,t.useCallback)(((...t)=>uu(o,E.current,...t)),[]);if(ru((()=>{S.current=n,P.current=r,jl(I)||(U.current=I)})),ru((()=>{if(!v)return;const t=Y.bind(Ml,zu);let e=0;const n=Pu(v,f,((n,r={})=>{if(0==n){const n=Date.now();T().revalidateOnFocus&&n>e&&C()&&(e=n+T().focusThrottleInterval,t())}else if(1==n)T().revalidateOnReconnect&&C()&&t();else{if(2==n)return Y();if(3==n)return Y(r)}}));return x.current=!1,E.current=v,b.current=!0,D({_k:w}),H&&(jl(B)||eu?t():nu(t)),()=>{x.current=!0,n()}}),[v]),ru((()=>{let t;function e(){const e=Nl(c)?c(A().data):c;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!T().isVisible()||!h&&!T().isOnline()?e():Y(zu).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}}),[c,d,h,v]),(0,t.useDebugValue)($),s&&jl(B)&&v){if(!tu&&eu)throw new Error("Fallback data is required when using suspense in SSR.");S.current=n,P.current=r,x.current=!1;const t=y[v];if(!jl(t)){const e=G(t);Hu(e)}if(!jl(_))throw _;{const t=Y(zu);jl($)||(t.status="fulfilled",t.value=!0),Hu(t)}}return{mutate:G,get data(){return L.data=!0,$},get error(){return L.error=!0,_},get isValidating(){return L.isValidating=!0,W},get isLoading(){return L.isLoading=!0,q}}})),qu=Tu(Wu,(t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r)))),Yu=async()=>{const t=new URLSearchParams({wpVersion:window.extSharedData.wpVersion||null,lang:window.extSharedData.wpLanguage||null});return await fetch(`${Lu}/api/categories?${t.toString()}`).then((t=>t.json()))},Gu=g(E((t=>({categories:[],setCategories:e=>t({categories:e})})),{name:"extendify-library-cache"})),Xu=()=>{const{category:e,siteType:n,setCategory:o}=gl(),{data:i,isLoading:a,errorCount:l}=(()=>{var t;const[e,n]=(0,r.useState)(0),o=null!==(t=window.extSharedData?.wpLanguage)&&void 0!==t?t:"en_US",{data:i,error:s,isLoading:a}=qu(`categories-${o}`,Yu,{onError:()=>n((t=>t+1)),onSuccess:()=>n(0)});return{data:i,errorCount:e>1?e:s?1:0,isLoading:a}})(),{categories:u,setCategories:c}=Gu();return(0,r.useEffect)((()=>{a||l||c(i)}),[i,a,c,l]),(0,r.useEffect)((()=>{const t=t=>n?.name&&document.querySelector(`#extendify-library-category-${t}`)?.focus();if(u?.length){if(e){if("all"===e)return t("all");if(u?.find((({slug:t})=>t===e)))return t(e)}o("all"),t("all")}}),[e,o,u,n?.name]),(0,t.createElement)(xl.PanelBody,{title:(0,s.__)("Design Type","extendify-local"),className:"ext-type-control p-0",initialOpen:!!n?.name},(0,t.createElement)(xl.PanelRow,null,(0,t.createElement)(Ku,{categories:u,errorCount:l,current:e,setCurrent:o})))},Ku=({categories:e,errorCount:n,current:r,setCurrent:o})=>{const i=t=>ju()("text-sm w-full text-left px-3 py-1 mb-0.5 block cursor-pointer rounded",{"bg-design-main text-design-text":r===t,"bg-transparent text-gray-900 hover:bg-gray-100":r!==t});return e?.length?(0,t.createElement)("ul",{className:"m-0 w-full py-2 px-1 border border-gray-300 overflow-y-auto max-h-half -mt-1.5 rounded-b"},(0,t.createElement)("li",{className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:"extendify-library-category-all",onClick:()=>o("all"),className:i("all")},(0,s.__)("All","extendify-local"))),e.map((({slug:e,id:n,name:r})=>(0,t.createElement)("li",{key:n,className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:`extendify-library-category-${e}`,onClick:()=>o(e),className:i(e)},r))))):n>1?(0,t.createElement)("div",{className:"flex flex-col w-full justify-center items-center gap-2 border-t border-gray-300 -mt-1 p-2"},(0,t.createElement)("span",null,(0,s.__)("Retrying...","extendify-local")),(0,t.createElement)(xl.Spinner,null)):(0,t.createElement)("div",{className:"flex w-full justify-center border-t border-gray-300 -mt-1 p-2"},(0,t.createElement)("span",{className:"sr-only"},(0,s.__)("Fetching...","extendify-local")),(0,t.createElement)(xl.Spinner,null))},Ju=()=>{const{siteType:e,setSiteType:n}=gl(),o=!!e?.name,[i,a]=(0,r.useState)(!o),[l,u]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),{data:f,loading:m}=(t=>{const{data:e,error:n}=qu(t||"cold-boot",(async()=>{const{wpLanguage:e}=window.extSharedData,n=performance.now(),r=new URL(`${Lu}/api/site-types`);t&&r.searchParams.append("search",t),t||r.searchParams.append("boot","true"),e&&r.searchParams.append("lang",e);const o=await fetch(r.toString(),{headers:{"Content-Type":"application/json"}});if(!t)return;if(!o.ok)throw new Error("Bad response from server");const i=await o.json();if(!Array.isArray(i))throw new Error("Bad response from server");return{siteTypes:i,time:((performance.now()-n)/1e3).toFixed(4)}}));return{data:e,error:n,loading:!e&&!n}})(c),g=(0,r.useRef)();return(0,r.useEffect)((()=>{i&&(u(""),g.current?.focus())}),[i]),(0,r.useEffect)((()=>{if(!f&&!m)return p(!1);p(m)}),[m,f]),(0,r.useEffect)((()=>{if(!l)return p(!1);p(!0);const t=setTimeout((()=>d(l)),300);return()=>clearTimeout(t)}),[l]),(0,t.createElement)(xl.PanelBody,{title:o?(0,s.sprintf)( // translators: %s is the site type name (0,s.__)("Site Type: %s","extendify-local"),e.name):(0,s.__)("Site Type","extendify-local"),className:"ext-type-control p-0",onToggle:a,opened:i,initialOpen:i},(0,t.createElement)(xl.PanelRow,{className:"m-0 w-full p-4 border border-gray-300 overflow-y-auto max-h-half -mt-1.5 rounded-b flex flex-col gap-2"},(0,t.createElement)(xl.SearchControl,{ref:g,className:"w-full",label:(0,s.__)("Search for your site type","extendify-local"),placeholder:(0,s.__)("Search for your site type","extendify-local"),value:l,onChange:u}),h&&(0,t.createElement)("div",{className:"flex w-full justify-center p-2"},(0,t.createElement)("span",{className:"sr-only"},(0,s.__)("Fetching...","extendify-local")),(0,t.createElement)(xl.Spinner,null)),f?.siteTypes?.length>0&&!h&&(0,t.createElement)("ul",{className:"m-0 w-full pb-2 px-0 overflow-y-auto"},f.siteTypes.slice(0,5).map((e=>(0,t.createElement)("li",{key:e.id,className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:`site-type-${e.id}`,onClick:()=>{n(e),u(""),a(!1)},className:"text-sm w-full text-left px-3 py-1 mb-0.5 block cursor-pointer rounded bg-transparent text-gray-900 hover:bg-gray-100"},e.name)))))))},{partnerLogo:Zu,partnerName:Qu}=window.extSharedData,tc=()=>(0,t.createElement)("div",{className:"md:w-80 gap-6 flex-shrink-0 hidden md:flex flex-col"},Zu?(0,t.createElement)("div",{className:"bg-banner-main p-6 py-0 flex justify-center"},(0,t.createElement)("div",{className:"flex h-20 py-3 items-center justify-center w-40"},(0,t.createElement)("img",{className:"max-h-full max-w-full",src:Zu,alt:Qu}))):(0,t.createElement)("div",{className:"hidden py-3 px-5 text-extendify-black sm:flex sm:pt-5 -mb-5"},(0,t.createElement)(a,{icon:l,size:40})),(0,t.createElement)("div",{className:"overflow-y-auto pb-16 flex flex-col gap-4"},(0,t.createElement)("div",{className:"hidden md:flex flex-col px-4 overflow-x-hidden"},(0,t.createElement)(Ju,null)),(0,t.createElement)("div",{id:"extendify-library-category-control","data-test":"category-control",className:"hidden md:flex flex-col px-4 overflow-x-hidden"},(0,t.createElement)(Xu,null)))),ec=({onClose:e})=>(0,t.createElement)("button",{className:"block w-6 h-6 p-px bg-transparent cursor-pointer outline-none focus:shadow-none focus:ring-wp focus:ring-design-main text-inherit",type:"button",onClick:e,"data-test":"modal-close-button","aria-label":(0,s.__)("Close","extendify-local")},(0,t.createElement)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))),nc=({openOnNewPage:e,updateUserOption:n,onClose:r})=>(0,t.createElement)("div",{className:"flex gap-6 items-center justify-end px-8 h-16 mb-2 flex-shrink-0"},(0,t.createElement)("label",{className:"flex gap-2 items-center mt-4",htmlFor:"extendify-open-on-new-pages",title:(0,s.sprintf)( // translators: %s: Extendify Library term (0,s.__)("Toggle %s on new pages","extendify-local"),"Extendify Library")},(0,t.createElement)("input",{id:"extendify-open-on-new-pages",className:"border border-solid border-gray-900 rounded-sm m-0",type:"checkbox",checked:e,onChange:t=>n("openOnNewPage",t.target.checked)}),(0,t.createElement)("span",null,(0,s.__)("Open for new pages","extendify-local"))),(0,t.createElement)("div",{className:"mt-4"},(0,t.createElement)(ec,{onClose:r}))),rc=window?.location?.pathname?.includes("post-new.php"),oc=()=>{const{open:e,setOpen:n}=S(),{updateUserOption:o,openOnNewPage:i}=wl(),{category:a,siteType:l,incrementImports:u}=gl(),{createNotice:c}=(0,T.dispatch)("core/notices"),d=()=>n(!1);return(0,r.useLayoutEffect)((()=>{if(i&&rc)return window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),void n(!0);new URLSearchParams(window.location.search).has("ext-open")&&n(!0)}),[i,n]),(0,r.useEffect)((()=>{const t=()=>n(!0),e=()=>n(!1);return window.addEventListener("extendify::open-library",t),window.addEventListener("extendify::close-library",e),()=>{window.removeEventListener("extendify::open-library",t),window.removeEventListener("extendify::close-library",e)}}),[n,e]),e?(0,t.createElement)(xe,{className:"extendify-library extendify-library-modal",open:e,static:!0,onClose:()=>{}},(0,t.createElement)("div",{className:"absolute mx-auto w-full h-full md:p-8"},(0,t.createElement)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,t.createElement)(ul.div,{key:"library-modal",initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"sm:flex h-full w-full relative shadow-2xl sm:overflow-hidden mx-auto bg-white max-w-screen-3xl"},(0,t.createElement)(xe.Title,{className:"sr-only"},(0,s.__)("Design Patterns","extendify-local")),(0,t.createElement)(tc,null),(0,t.createElement)("div",{className:"flex flex-col w-full relative bg-[#FAFAFA]"},(0,t.createElement)(nc,{openOnNewPage:i,updateUserOption:o,onClose:d}),(0,t.createElement)("div",{id:"extendify-library-patterns-list",className:"overflow-y-auto flex-grow"},(0,t.createElement)($u,{insertPattern:async t=>{await(async t=>{const{insertBlocks:e,replaceBlock:n}=(0,T.dispatch)("core/block-editor"),{getSelectedBlock:r,getBlockHierarchyRootClientId:o,getBlockIndex:i,getGlobalBlockCount:s}=(0,T.select)("core/block-editor"),{clientId:a,name:l,attributes:u}=r()||{},c=a?o(a):"",d=(c?i(c):s())+1,{missingCSSVars:h}=S.getState();return h.forEach((t=>{document?.documentElement?.style?.setProperty(t,bl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,bl[t])})),h.length&&(async t=>{var e;const n=window.extSharedData.globalStylesPostID,{styles:r,settings:o}=await dl()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter((t=>!r?.css?.includes(`${t}:`)))).length)return;const i=t.reduce(((t,e)=>t+`${e}: ${bl[e]};\n`),":root {\n")+"\n}";dl()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:o,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+i}}})})(h),"core/paragraph"===l&&""===u?.content?await n(a,t):await e(t,d)})(t),u(),d(),c("info",(0,s.__)("Pattern added","extendify-local"),{isDismissible:!0,type:"snackbar"})},category:a,siteType:l})))))):null};(0,i.registerPlugin)("extendify-library",{render:()=>{if("function"!=typeof r.createRoot)return;const e="extendify-library-btn",n="extendify-library",o=".edit-post-header-toolbar",i=".edit-site-header-edit-mode__start";(document.querySelector(o)||document.querySelector(i))&&requestAnimationFrame((()=>{if(document.getElementById(e))return;const s=document.createElement("div"),a=Object.assign(s,{id:e,className:n});document.querySelector(o)?.append(a),document.querySelector(i)?.append(a),(0,r.createRoot)(a).render((0,t.createElement)(P,null));const l="extendify-library-modal";if(document.getElementById(l))return;const u=document.createElement("div"),c=Object.assign(u,{id:l,className:n});document.body.append(c),(0,r.createRoot)(c).render((0,t.createElement)(oc,null))}))}})})()})();