?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/wdp/wp-content/plugins/extendify/public/build/



?? Go up: /home/webdevt/www/wdp/wp-content/plugins/extendify/public

?? Viewing: extendify-draft-54ac23342021f1a73f14.js

!function(){var t={184:function(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var t=[],e=0;e<arguments.length;e++){var n=arguments[e];if(n){var o=typeof n;if("string"===o||"number"===o)t.push(n);else if(Array.isArray(n)){if(n.length){var i=s.apply(null,n);i&&t.push(i)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){t.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&t.push(a)}}}return t.join(" ")}t.exports?(s.default=s,t.exports=s):void 0===(n=function(){return s}.apply(e,[]))||(t.exports=n)}()}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=window.wp.element,e=window.wp.components,r=window.wp.editPost,s=window.wp.hooks,o=window.wp.i18n,i=window.wp.plugins,a=window.wp.data;function l(t,e){return function(){return t.apply(e,arguments)}}const{toString:c}=Object.prototype,{getPrototypeOf:u}=Object,h=(d=Object.create(null),t=>{const e=c.call(t);return d[e]||(d[e]=e.slice(8,-1).toLowerCase())});var d;const p=t=>(t=t.toLowerCase(),e=>h(e)===t),m=t=>e=>typeof e===t,{isArray:f}=Array,g=m("undefined"),y=p("ArrayBuffer"),v=m("string"),x=m("function"),w=m("number"),E=t=>null!==t&&"object"==typeof t,b=t=>{if("object"!==h(t))return!1;const e=u(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},P=p("Date"),S=p("File"),T=p("Blob"),C=p("FileList"),A=p("URLSearchParams");function L(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,s;if("object"!=typeof t&&(t=[t]),f(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let i;for(r=0;r<o;r++)i=s[r],e.call(null,t[i],i,t)}}function M(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,s=n.length;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,R=t=>!g(t)&&t!==k,V=(D="undefined"!=typeof Uint8Array&&u(Uint8Array),t=>D&&t instanceof D);var D;const O=p("HTMLFormElement"),B=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),j=p("RegExp"),N=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};L(n,((n,s)=>{let o;!1!==(o=e(n,s,t))&&(r[s]=o||n)})),Object.defineProperties(t,r)},F="abcdefghijklmnopqrstuvwxyz",I="0123456789",_={DIGIT:I,ALPHA:F,ALPHA_DIGIT:F+F.toUpperCase()+I},U=p("AsyncFunction");var H={isArray:f,isArrayBuffer:y,isBuffer:function(t){return null!==t&&!g(t)&&null!==t.constructor&&!g(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||x(t.append)&&("formdata"===(e=h(t))||"object"===e&&x(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&y(t.buffer),e},isString:v,isNumber:w,isBoolean:t=>!0===t||!1===t,isObject:E,isPlainObject:b,isUndefined:g,isDate:P,isFile:S,isBlob:T,isRegExp:j,isFunction:x,isStream:t=>E(t)&&x(t.pipe),isURLSearchParams:A,isTypedArray:V,isFileList:C,forEach:L,merge:function t(){const{caseless:e}=R(this)&&this||{},n={},r=(r,s)=>{const o=e&&M(n,s)||s;b(n[o])&&b(r)?n[o]=t(n[o],r):b(r)?n[o]=t({},r):f(r)?n[o]=r.slice():n[o]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&L(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(L(e,((e,r)=>{n&&x(e)?t[r]=l(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let s,o,i;const a={};if(e=e||{},null==t)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)i=s[o],r&&!r(i,t,e)||a[i]||(e[i]=t[i],a[i]=!0);t=!1!==n&&u(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:h,kindOfTest:p,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(f(t))return t;let e=t.length;if(!w(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:O,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:N,freezeMethods:t=>{N(t,((e,n)=>{if(x(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];x(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return f(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:M,global:k,isContextDefined:R,ALPHABET:_,generateString:(t=16,e=_.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&x(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(E(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const s=f(t)?[]:{};return L(t,((t,e)=>{const o=n(t,r+1);!g(o)&&(s[e]=o)})),e[r]=void 0,s}}return t};return n(t,0)},isAsyncFn:U,isThenable:t=>t&&(E(t)||x(t))&&x(t.then)&&x(t.catch)};function z(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}H.inherits(z,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const $=z.prototype,W={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{W[t]={value:t}})),Object.defineProperties(z,W),Object.defineProperty($,"isAxiosError",{value:!0}),z.from=(t,e,n,r,s,o)=>{const i=Object.create($);return H.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),z.call(i,t.message,e,n,r,s),i.cause=t,i.name=t.name,o&&Object.assign(i,o),i};var Z=z;function q(t){return H.isPlainObject(t)||H.isArray(t)}function G(t){return H.endsWith(t,"[]")?t.slice(0,-2):t}function K(t,e,n){return t?t.concat(e).map((function(t,e){return t=G(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const X=H.toFlatObject(H,{},null,(function(t){return/^is[A-Z]/.test(t)}));var Y=function(t,e,n){if(!H.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!H.isUndefined(e[t])}))).metaTokens,s=n.visitor||c,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&H.isSpecCompliantForm(e);if(!H.isFunction(s))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(H.isDate(t))return t.toISOString();if(!a&&H.isBlob(t))throw new Z("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(t)||H.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,s){let a=t;if(t&&!s&&"object"==typeof t)if(H.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(H.isArray(t)&&function(t){return H.isArray(t)&&!t.some(q)}(t)||(H.isFileList(t)||H.endsWith(n,"[]"))&&(a=H.toArray(t)))return n=G(n),a.forEach((function(t,r){!H.isUndefined(t)&&null!==t&&e.append(!0===i?K([n],r,o):null===i?n:n+"[]",l(t))})),!1;return!!q(t)||(e.append(K(s,n,o),l(t)),!1)}const u=[],h=Object.assign(X,{defaultVisitor:c,convertValue:l,isVisitable:q});if(!H.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!H.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),H.forEach(n,(function(n,o){!0===(!(H.isUndefined(n)||null===n)&&s.call(e,n,H.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),u.pop()}}(t),e};function J(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Q(t,e){this._pairs=[],t&&Y(t,this,e)}const tt=Q.prototype;tt.append=function(t,e){this._pairs.push([t,e])},tt.toString=function(t){const e=t?function(e){return t.call(this,e,J)}:J;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var et=Q;function nt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function rt(t,e,n){if(!e)return t;const r=n&&n.encode||nt,s=n&&n.serialize;let o;if(o=s?s(e,n):H.isURLSearchParams(e)?e.toString():new et(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}var st=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){H.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},it={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:et,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},at=function(t){function e(t,n,r,s){let o=t[s++];const i=Number.isFinite(+o),a=s>=t.length;return o=!o&&H.isArray(r)?r.length:o,a?(H.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i):(r[o]&&H.isObject(r[o])||(r[o]=[]),e(t,n,r[o],s)&&H.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=t[o];return e}(r[o])),!i)}if(H.isFormData(t)&&H.isFunction(t.entries)){const n={};return H.forEachEntry(t,((t,r)=>{e(function(t){return H.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null};const lt={transitional:ot,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,s=H.isObject(t);if(s&&H.isHTMLForm(t)&&(t=new FormData(t)),H.isFormData(t))return r&&r?JSON.stringify(at(t)):t;if(H.isArrayBuffer(t)||H.isBuffer(t)||H.isStream(t)||H.isFile(t)||H.isBlob(t))return t;if(H.isArrayBufferView(t))return t.buffer;if(H.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Y(t,new it.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return it.isNode&&H.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((o=H.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Y(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),function(t,e,n){if(H.isString(t))try{return(0,JSON.parse)(t),H.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||lt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&H.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw Z.from(t,Z.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:it.classes.FormData,Blob:it.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],(t=>{lt.headers[t]={}}));var ct=lt;const ut=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ht=Symbol("internals");function dt(t){return t&&String(t).trim().toLowerCase()}function pt(t){return!1===t||null==t?t:H.isArray(t)?t.map(pt):String(t)}function mt(t,e,n,r,s){return H.isFunction(r)?r.call(this,e,n):(s&&(e=n),H.isString(e)?H.isString(r)?-1!==e.indexOf(r):H.isRegExp(r)?r.test(e):void 0:void 0)}class ft{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(t,e,n){const s=dt(e);if(!s)throw new Error("header name must be a non-empty string");const o=H.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=pt(t))}const o=(t,e)=>H.forEach(t,((t,n)=>s(t,n,e)));return H.isPlainObject(t)||t instanceof this.constructor?o(t,e):H.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?o((t=>{const e={};let n,r,s;return t&&t.split("\n").forEach((function(t){s=t.indexOf(":"),n=t.substring(0,s).trim().toLowerCase(),r=t.substring(s+1).trim(),!n||e[n]&&ut[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&s(e,t,n),this}get(t,e){if(t=dt(t)){const n=H.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(H.isFunction(e))return e.call(this,t,n);if(H.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=dt(t)){const n=H.findKey(this,t);return!(!n||void 0===this[n]||e&&!mt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function s(t){if(t=dt(t)){const s=H.findKey(n,t);!s||e&&!mt(0,n[s],s,e)||(delete n[s],r=!0)}}return H.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const s=e[n];t&&!mt(0,this[s],s,t,!0)||(delete this[s],r=!0)}return r}normalize(t){const e=this,n={};return H.forEach(this,((r,s)=>{const o=H.findKey(n,s);if(o)return e[o]=pt(r),void delete e[s];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(s):String(s).trim();i!==s&&delete e[s],e[i]=pt(r),n[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return H.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&H.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[ht]=this[ht]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=dt(t);e[r]||(function(t,e){const n=H.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,s){return this[r].call(this,e,t,n,s)},configurable:!0})}))}(n,t),e[r]=!0)}return H.isArray(t)?t.forEach(r):r(t),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),H.reduceDescriptors(ft.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),H.freezeMethods(ft);var gt=ft;function yt(t,e){const n=this||ct,r=e||n,s=gt.from(r.headers);let o=r.data;return H.forEach(t,(function(t){o=t.call(n,o,s.normalize(),e?e.status:void 0)})),s.normalize(),o}function vt(t){return!(!t||!t.__CANCEL__)}function xt(t,e,n){Z.call(this,null==t?"canceled":t,Z.ERR_CANCELED,e,n),this.name="CanceledError"}H.inherits(xt,Z,{__CANCEL__:!0});var wt=xt,Et=it.isStandardBrowserEnv?{write:function(t,e,n,r,s,o){const i=[];i.push(t+"="+encodeURIComponent(e)),H.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),H.isString(r)&&i.push("path="+r),H.isString(s)&&i.push("domain="+s),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function bt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var Pt=it.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=H.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0};function St(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s,o=0,i=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),c=r[i];s||(s=l),n[o]=a,r[o]=l;let u=i,h=0;for(;u!==o;)h+=n[u++],u%=t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s<e)return;const d=c&&l-c;return d?Math.round(1e3*h/d):void 0}}(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,a=o-n,l=r(a);n=o;const c={loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&o<=i?(i-o)/l:void 0,event:s};c[e?"download":"upload"]=!0,t(c)}}const Tt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const s=gt.from(t.headers).normalize(),o=t.responseType;let i,a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}H.isFormData(r)&&(it.isStandardBrowserEnv||it.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.getContentType(/^\s*multipart\/form-data/)?H.isString(a=s.getContentType())&&s.setContentType(a.replace(/^\s*(multipart\/form-data);+/,"$1")):s.setContentType("multipart/form-data"));let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(e+":"+n))}const u=bt(t.baseURL,t.url);function h(){if(!c)return;const r=gt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Z("Request failed with status code "+n.status,[Z.ERR_BAD_REQUEST,Z.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),l()}),(function(t){n(t),l()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),rt(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(n(new Z("Request aborted",Z.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new Z("Network Error",Z.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||ot;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new Z(e,r.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,t,c)),c=null},it.isStandardBrowserEnv){const e=(t.withCredentials||Pt(u))&&t.xsrfCookieName&&Et.read(t.xsrfCookieName);e&&s.set(t.xsrfHeaderName,e)}void 0===r&&s.setContentType(null),"setRequestHeader"in c&&H.forEach(s.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),H.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&"json"!==o&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",St(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",St(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{c&&(n(!e||e.type?new wt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const d=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);d&&-1===it.protocols.indexOf(d)?n(new Z("Unsupported protocol "+d+":",Z.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};H.forEach(Tt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ct=t=>`- ${t}`,At=t=>H.isFunction(t)||null===t||!1===t;var Lt=t=>{t=H.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let o=0;o<e;o++){let e;if(n=t[o],r=n,!At(n)&&(r=Tt[(e=String(n)).toLowerCase()],void 0===r))throw new Z(`Unknown adapter '${e}'`);if(r)break;s[e||"#"+o]=r}if(!r){const t=Object.entries(s).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(Ct).join("\n"):" "+Ct(t[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Mt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new wt(null,t)}function kt(t){return Mt(t),t.headers=gt.from(t.headers),t.data=yt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Lt(t.adapter||ct.adapter)(t).then((function(e){return Mt(t),e.data=yt.call(t,t.transformResponse,e),e.headers=gt.from(e.headers),e}),(function(e){return vt(e)||(Mt(t),e&&e.response&&(e.response.data=yt.call(t,t.transformResponse,e.response),e.response.headers=gt.from(e.response.headers))),Promise.reject(e)}))}const Rt=t=>t instanceof gt?t.toJSON():t;function Vt(t,e){e=e||{};const n={};function r(t,e,n){return H.isPlainObject(t)&&H.isPlainObject(e)?H.merge.call({caseless:n},t,e):H.isPlainObject(e)?H.merge({},e):H.isArray(e)?e.slice():e}function s(t,e,n){return H.isUndefined(e)?H.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function o(t,e){if(!H.isUndefined(e))return r(void 0,e)}function i(t,e){return H.isUndefined(e)?H.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,s,o){return o in e?r(n,s):o in t?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e)=>s(Rt(t),Rt(e),!0)};return H.forEach(Object.keys(Object.assign({},t,e)),(function(r){const o=l[r]||s,i=o(t[r],e[r],r);H.isUndefined(i)&&o!==a||(n[r]=i)})),n}const Dt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Dt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Ot={};Dt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.5.1] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,s,o)=>{if(!1===t)throw new Z(r(s," has been removed"+(e?" in "+e:"")),Z.ERR_DEPRECATED);return e&&!Ot[s]&&(Ot[s]=!0,console.warn(r(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,s,o)}};var Bt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const e=t[o],n=void 0===e||i(e,o,t);if(!0!==n)throw new Z("option "+o+" must be "+n,Z.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Z("Unknown option "+o,Z.ERR_BAD_OPTION)}},validators:Dt};const jt=Bt.validators;class Nt{constructor(t){this.defaults=t,this.interceptors={request:new st,response:new st}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Vt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;void 0!==n&&Bt.assertOptions(n,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),null!=r&&(H.isFunction(r)?e.paramsSerializer={serialize:r}:Bt.assertOptions(r,{encode:jt.function,serialize:jt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=s&&H.merge(s.common,s[e.method]);s&&H.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete s[t]})),e.headers=gt.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));let u,h=0;if(!a){const t=[kt.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,l),u=t.length,c=Promise.resolve(e);h<u;)c=c.then(t[h++],t[h++]);return c}u=i.length;let d=e;for(h=0;h<u;){const t=i[h++],e=i[h++];try{d=t(d)}catch(t){e.call(this,t);break}}try{c=kt.call(this,d)}catch(t){return Promise.reject(t)}for(h=0,u=l.length;h<u;)c=c.then(l[h++],l[h++]);return c}getUri(t){return rt(bt((t=Vt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}H.forEach(["delete","get","head","options"],(function(t){Nt.prototype[t]=function(e,n){return this.request(Vt(n||{},{method:t,url:e,data:(n||{}).data}))}})),H.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,s){return this.request(Vt(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Nt.prototype[t]=e(),Nt.prototype[t+"Form"]=e(!0)}));var Ft=Nt;class It{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,s){n.reason||(n.reason=new wt(t,r,s),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new It((function(e){t=e})),cancel:t}}}var _t=It;const Ut={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ut).forEach((([t,e])=>{Ut[e]=t}));var Ht=Ut;const zt=function t(e){const n=new Ft(e),r=l(Ft.prototype.request,n);return H.extend(r,Ft.prototype,n,{allOwnKeys:!0}),H.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Vt(e,n))},r}(ct);zt.Axios=Ft,zt.CanceledError=wt,zt.CancelToken=_t,zt.isCancel=vt,zt.VERSION="1.5.1",zt.toFormData=Y,zt.AxiosError=Z,zt.Cancel=zt.CanceledError,zt.all=function(t){return Promise.all(t)},zt.spread=function(t){return function(e){return t.apply(null,e)}},zt.isAxiosError=function(t){return H.isObject(t)&&!0===t.isAxiosError},zt.mergeConfig=Vt,zt.AxiosHeaders=gt,zt.formToJSON=t=>at(H.isHTMLForm(t)?new FormData(t):t),zt.getAdapter=Lt,zt.HttpStatusCode=Ht,zt.default=zt;const $t=zt.create({baseURL:window.extDraftData.root,headers:{"X-WP-Nonce":window.extDraftData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify-Draft":!0,"X-Extendify":!0}});$t.interceptors.request.use((t=>Wt(t)),(t=>console.log(t)||t)),$t.interceptors.response.use((t=>Object.prototype.hasOwnProperty.call(t,"data")?t.data:t),(t=>console.log(t)||t));const Wt=t=>(t.headers["X-Extendify-Assist-Dev-Mode"]=window.location.search.indexOf("DEVMODE")>-1,t.headers["X-Extendify-Assist-Local-Mode"]=window.location.search.indexOf("LOCALMODE")>-1,t);var Zt=window.wp.blocks;const qt=({completion:e})=>{const n=(0,Zt.pasteHandler)({plainText:e}),r=(0,t.useRef)();return(0,t.createElement)("div",{ref:r,style:{fontSize:"clamp(1em 1em 1em)"},className:"completion relative px-5 pt-4 break-words max-h-60 overflow-y-auto"},Array.isArray(n)?(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:(0,Zt.serialize)(n)}}):(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:n}}))};var Gt=(0,t.forwardRef)((function({icon:e,size:n=24,...r},s){return(0,t.cloneElement)(e,{width:n,height:n,...r,ref:s})})),Kt=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M8.79508 15.8769L4.62508 11.7069L3.20508 13.1169L8.79508 18.7069L20.7951 6.70687L19.3851 5.29688L8.79508 15.8769Z"})),Xt=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M14 17H4V19H14V17ZM20 9H4V11H20V9ZM4 15H20V13H4V15ZM4 5V7H20V5H4Z"})),Yt=(0,t.createElement)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M19 9L20.25 6.25L23 5L20.25 3.75L19 1L17.75 3.75L15 5L17.75 6.25L19 9Z"}),(0,t.createElement)("path",{d:"M19 15L17.75 17.75L15 19L17.75 20.25L19 23L20.25 20.25L23 19L20.25 17.75L19 15Z"}),(0,t.createElement)("path",{d:"M11.5 9.5L9 4L6.5 9.5L1 12L6.5 14.5L9 20L11.5 14.5L17 12L11.5 9.5ZM9.99 12.99L9 15.17L8.01 12.99L5.83 12L8.01 11.01L9 8.83L9.99 11.01L12.17 12L9.99 12.99Z"}));(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M12 14.5C13.66 14.5 15 13.16 15 11.5V5.5C15 3.84 13.66 2.5 12 2.5C10.34 2.5 9 3.84 9 5.5V11.5C9 13.16 10.34 14.5 12 14.5Z"}),(0,t.createElement)("path",{d:"M17 11.5C17 14.26 14.76 16.5 12 16.5C9.24 16.5 7 14.26 7 11.5H5C5 15.03 7.61 17.93 11 18.42V21.5H13V18.42C16.39 17.93 19 15.03 19 11.5H17Z"}));var Jt=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M2.99902 21.0025H6.74902L17.809 9.9425L14.059 6.1925L2.99902 17.2525V21.0025ZM4.99902 18.0825L14.059 9.0225L14.979 9.9425L5.91902 19.0025H4.99902V18.0825Z"}),(0,t.createElement)("path",{d:"M18.369 3.2925C17.979 2.9025 17.349 2.9025 16.959 3.2925L15.129 5.1225L18.879 8.8725L20.709 7.0425C21.099 6.6525 21.099 6.0225 20.709 5.6325L18.369 3.2925Z"})),Qt=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M4 9H20V11H4V9ZM4 13H14V15H4V13Z"})),te=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M19.5005 7.5L20.4405 5.44L22.5005 4.5L20.4405 3.56L19.5005 1.5L18.5605 3.56L16.5005 4.5L18.5605 5.44L19.5005 7.5Z"}),(0,t.createElement)("path",{d:"M8.00055 7.5L8.94055 5.44L11.0005 4.5L8.94055 3.56L8.00055 1.5L7.06055 3.56L5.00055 4.5L7.06055 5.44L8.00055 7.5Z"}),(0,t.createElement)("path",{d:"M19.5005 13L18.5605 15.06L16.5005 16L18.5605 16.94L19.5005 19L20.4405 16.94L22.5005 16L20.4405 15.06L19.5005 13Z"}),(0,t.createElement)("path",{d:"M17.2105 9.62L14.3805 6.79C14.1805 6.6 13.9305 6.5 13.6705 6.5C13.4105 6.5 13.1605 6.6 12.9605 6.79L1.79055 17.96C1.40055 18.35 1.40055 18.98 1.79055 19.37L4.62055 22.2C4.82055 22.4 5.07055 22.5 5.33055 22.5C5.59055 22.5 5.84055 22.4 6.04055 22.21L17.2105 11.04C17.6005 10.65 17.6005 10.01 17.2105 9.62ZM13.6705 8.92L15.0805 10.33L13.9105 11.5L12.5005 10.09L13.6705 8.92ZM5.33055 20.09L3.92055 18.68L11.0905 11.5L12.5005 12.91L5.33055 20.09Z"})),ee=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M3.5,10.5C3.5,12.95 5.26,14.97 7.58,15.41L6.09,13.92L7.5,12.5L11.5,16.51L7.5,20.5L6.09,19.09L7.67,17.51L7.67,17.45C4.2,17.04 1.5,14.08 1.5,10.5C1.5,6.63 4.63,3.5 8.5,3.5L11.5,3.5L11.5,5.5L8.5,5.5C5.74,5.5 3.5,7.74 3.5,10.5Z"}),(0,t.createElement)("path",{d:"M22.5,10.5L22.5,3.5L13.5,3.5L13.5,10.5L22.5,10.5ZM20.5,8.5L15.5,8.5L15.5,5.5L20.5,5.5L20.5,8.5Z"}),(0,t.createElement)("rect",{x:"13.5",y:"12.5",width:"9",height:"7"})),ne=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M18.6 19.5008H21V21.5008H15V15.5008H17V18.2308C18.83 16.7608 20 14.5208 20 12.0008C20 7.93078 16.94 4.56078 13 4.07078V2.05078C18.05 2.55078 22 6.81078 22 12.0008C22 14.9908 20.68 17.6708 18.6 19.5008ZM4 12.0008C4 9.48078 5.17 7.23078 7 5.77078V8.50078H9V2.50078H3V4.50078H5.4C3.32 6.33078 2 9.01078 2 12.0008C2 17.1908 5.95 21.4508 11 21.9508V19.9308C7.06 19.4408 4 16.0708 4 12.0008ZM16.24 8.11078L10.58 13.7708L7.75 10.9408L6.34 12.3508L10.58 16.5908L17.65 9.52078L16.24 8.11078Z"})),re=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M12 6V2L7 7L12 12V8C15.31 8 18 10.69 18 14C18 17.31 15.31 20 12 20C8.69 20 6 17.31 6 14H4C4 18.42 7.58 22 12 22C16.42 22 20 18.42 20 14C20 9.58 16.42 6 12 6Z"})),se=(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M16 9V19H8V9H16ZM14.5 3H9.5L8.5 4H5V6H19V4H15.5L14.5 3ZM18 7H6V19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V7Z"})),oe=(0,t.createElement)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},(0,t.createElement)(e.Path,{d:"M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z"}));const ie=({disabled:n,setInputText:r,setReady:s})=>{const i=t=>{r(t),s(!1)};return(0,t.createElement)(e.MenuGroup,null,(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write a blog post about","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Blog post…","extendify-local"))),(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write an outline for","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Outline…","extendify-local"))),(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write a poem about","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Poem…","extendify-local"))),(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write a press release for","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Press release…","extendify-local"))),(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write a pros and cons list for","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Pros and cons list…","extendify-local"))),(0,t.createElement)(e.MenuItem,{disabled:n,onClick:()=>i((0,o.__)("Write a job description for","extendify-local")+" "),className:"group"},(0,t.createElement)(Gt,{icon:Jt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Job description…","extendify-local"))))},ae=()=>{const{getBlockInsertionPoint:t}=(0,a.useSelect)((t=>t("core/block-editor")),[]),{toggleBlockHighlight:e,showInsertionPoint:n,hideInsertionPoint:r}=(0,a.useDispatch)("core/block-editor");return{toggleHighlight:(t,{isHighlighted:n})=>{e(t[0],n)},toggleInsertionPoint:({isVisible:e})=>{if(!e)return void r();const{rootClientId:s,index:o}=t();n(s,o)}}},le=({disabled:n,setPrompt:r})=>{const{toggleHighlight:s}=ae(),i=(0,a.useSelect)((t=>t("core/block-editor").getSelectedBlockClientIds()),[]),{getBlocksByClientId:l}=(0,a.useSelect)((t=>t("core/block-editor")),[]);(0,t.useEffect)((()=>()=>{s(i,{isHighlighted:!1})}),[i,s]);const c=t=>{r({text:u(),promptType:t,systemMessageKey:"edit"})},u=()=>l(i).map((({attributes:t})=>t.content)).join("\n\n");return(0,t.createElement)(e.MenuGroup,null,(0,t.createElement)(e.MenuItem,{onClick:()=>c("improve-writing"),onMouseEnter:()=>s(i,{isHighlighted:!0}),onMouseLeave:()=>s(i,{isHighlighted:!1}),disabled:n,className:"group"},(0,t.createElement)(Gt,{icon:te,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Improve writing","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>c("fix-spelling-grammar"),onMouseEnter:()=>s(i,{isHighlighted:!0}),onMouseLeave:()=>s(i,{isHighlighted:!1}),disabled:n,className:"group"},(0,t.createElement)(Gt,{icon:Kt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Fix spelling & grammar","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>c("make-shorter"),onMouseEnter:()=>s(i,{isHighlighted:!0}),onMouseLeave:()=>s(i,{isHighlighted:!1}),disabled:n,className:"group"},(0,t.createElement)(Gt,{icon:Qt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Make shorter","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>c("make-longer"),onMouseEnter:()=>s(i,{isHighlighted:!0}),onMouseLeave:()=>s(i,{isHighlighted:!1}),disabled:n,className:"group"},(0,t.createElement)(Gt,{icon:Xt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Make longer","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>c("simplify-language"),onMouseEnter:()=>s(i,{isHighlighted:!0}),onMouseLeave:()=>s(i,{isHighlighted:!1}),disabled:n,className:"group"},(0,t.createElement)(Gt,{icon:Yt,className:"shrink-0 group-hover:text-current text-design-main fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Simplify language","extendify-local"))))};var ce=window.wp.primitives,ue=(0,t.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(ce.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),he=n(184),de=n.n(he),pe=window.React;const me="undefined"!=typeof document,fe=me?pe.useLayoutEffect:pe.useEffect;function ge(){const t=(0,pe.useRef)(!1);return fe((()=>(t.current=!0,()=>{t.current=!1})),[]),t}const ye=t=>t;class ve{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 xe=["prepare","read","update","preRender","render","postRender"],{schedule:we,cancel:Ee,state:be,steps:Pe}=function(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=xe.reduce(((t,e)=>(t[e]=function(t){let e=new ve,n=new ve,r=0,s=!1,o=!1;const i=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&s,c=l?e:n;return o&&i.add(t),c.add(t)&&l&&s&&(r=e.order.length),t},cancel:t=>{n.remove(t),i.delete(t)},process:l=>{if(s)o=!0;else{if(s=!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),i.has(r)&&(a.schedule(r),t())}s=!1,o&&(o=!1,a.process(l))}}};return a}((()=>n=!0)),t)),{}),i=t=>o[t].process(s),a=()=>{const e=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(e-s.timestamp,40),1),s.timestamp=e,s.isProcessing=!0,xe.forEach(i),s.isProcessing=!1,n&&(r=!1,t(a))};return{schedule:xe.reduce(((e,i)=>{const l=o[i];return e[i]=(e,o=!1,i=!1)=>(n||(n=!0,r=!0,s.isProcessing||t(a)),l.schedule(e,o,i)),e}),{}),cancel:t=>xe.forEach((e=>o[e].cancel(t))),state:s,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ye),Se=(0,pe.createContext)(null);function Te(t){const e=(0,pe.useRef)(null);return null===e.current&&(e.current=t()),e.current}class Ce extends pe.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ae({children:t,isPresent:e}){const n=(0,pe.useId)(),r=(0,pe.useRef)(null),s=(0,pe.useRef)({width:0,height:0,top:0,left:0});return(0,pe.useInsertionEffect)((()=>{const{width:t,height:o,top:i,left:a}=s.current;if(e||!r.current||!t||!o)return;r.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n          [data-motion-pop-id="${n}"] {\n            position: absolute !important;\n            width: ${t}px !important;\n            height: ${o}px !important;\n            top: ${i}px !important;\n            left: ${a}px !important;\n          }\n        `),()=>{document.head.removeChild(l)}}),[e]),pe.createElement(Ce,{isPresent:e,childRef:r,sizeRef:s},pe.cloneElement(t,{ref:r}))}const Le=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i})=>{const a=Te(Me),l=(0,pe.useId)(),c=(0,pe.useMemo)((()=>({id:l,initial:e,isPresent:n,custom:s,onExitComplete:t=>{a.set(t,!0);for(const t of a.values())if(!t)return;r&&r()},register:t=>(a.set(t,!1),()=>a.delete(t))})),o?void 0:[n]);return(0,pe.useMemo)((()=>{a.forEach(((t,e)=>a.set(e,!1)))}),[n]),pe.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===i&&(t=pe.createElement(Ae,{isPresent:n},t)),pe.createElement(Se.Provider,{value:c},t)};function Me(){return new Map}const ke=(0,pe.createContext)({});let Re=ye,Ve=ye;const De=t=>t.key||"",Oe=({children:t,custom:e,initial:n=!0,onExitComplete:r,exitBeforeEnter:s,presenceAffectsLayout:o=!0,mode:i="sync"})=>{Ve(!s,"Replace exitBeforeEnter with mode='wait'");const a=(0,pe.useContext)(ke).forceRender||function(){const t=ge(),[e,n]=(0,pe.useState)(0),r=(0,pe.useCallback)((()=>{t.current&&n(e+1)}),[e]);return[(0,pe.useCallback)((()=>we.postRender(r)),[r]),e]}()[0],l=ge(),c=function(t){const e=[];return pe.Children.forEach(t,(t=>{(0,pe.isValidElement)(t)&&e.push(t)})),e}(t);let u=c;const h=(0,pe.useRef)(new Map).current,d=(0,pe.useRef)(u),p=(0,pe.useRef)(new Map).current,m=(0,pe.useRef)(!0);var f;if(fe((()=>{m.current=!1,function(t,e){t.forEach((t=>{const n=De(t);e.set(n,t)}))}(c,p),d.current=u})),f=()=>{m.current=!0,p.clear(),h.clear()},(0,pe.useEffect)((()=>()=>f()),[]),m.current)return pe.createElement(pe.Fragment,null,u.map((t=>pe.createElement(Le,{key:De(t),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:o,mode:i},t))));u=[...u];const g=d.current.map(De),y=c.map(De),v=g.length;for(let t=0;t<v;t++){const e=g[t];-1!==y.indexOf(e)||h.has(e)||h.set(e,void 0)}return"wait"===i&&h.size&&(u=[]),h.forEach(((t,n)=>{if(-1!==y.indexOf(n))return;const s=p.get(n);if(!s)return;const m=g.indexOf(n);let f=t;if(!f){const t=()=>{p.delete(n),h.delete(n);const t=d.current.findIndex((t=>t.key===n));if(d.current.splice(t,1),!h.size){if(d.current=c,!1===l.current)return;a(),r&&r()}};f=pe.createElement(Le,{key:De(s),isPresent:!1,onExitComplete:t,custom:e,presenceAffectsLayout:o,mode:i},s),h.set(n,f)}u.splice(m,0,f)})),u=u.map((t=>{const e=t.key;return h.has(e)?t:pe.createElement(Le,{key:De(t),isPresent:!0,presenceAffectsLayout:o,mode:i},t)})),pe.createElement(pe.Fragment,null,h.size?u:u.map((t=>(0,pe.cloneElement)(t))))},Be=(0,pe.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),je=(0,pe.createContext)({}),Ne=(0,pe.createContext)({strict:!1});function Fe(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ie(t){return"string"==typeof t||Array.isArray(t)}function _e(t){return"object"==typeof t&&"function"==typeof t.start}const Ue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],He=["initial",...Ue];function ze(t){return _e(t.animate)||He.some((e=>Ie(t[e])))}function $e(t){return Boolean(ze(t)||t.variants)}function We(t){return Array.isArray(t)?t.join(" "):t}const Ze={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"]},qe={};for(const t in Ze)qe[t]={isEnabled:e=>Ze[t].some((t=>!!e[t]))};const Ge=(0,pe.createContext)({}),Ke=Symbol.for("motionComponentSymbol");function Xe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&function(t){for(const e in t)qe[e]={...qe[e],...t[e]}}(t);const o=(0,pe.forwardRef)((function(o,i){let a;const l={...(0,pe.useContext)(Be),...o,layoutId:Ye(o)},{isStatic:c}=l,u=function(t){const{initial:e,animate:n}=function(t,e){if(ze(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ie(e)?e:void 0,animate:Ie(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,pe.useContext)(je));return(0,pe.useMemo)((()=>({initial:e,animate:n})),[We(e),We(n)])}(o),h=r(o,c);if(!c&&me){u.visualElement=function(t,e,n,r){const{visualElement:s}=(0,pe.useContext)(je),o=(0,pe.useContext)(Ne),i=(0,pe.useContext)(Se),a=(0,pe.useContext)(Be).reducedMotion,l=(0,pe.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:s,props:n,presenceContext:i,blockInitialAnimation:!!i&&!1===i.initial,reducedMotionConfig:a}));const c=l.current;(0,pe.useInsertionEffect)((()=>{c&&c.update(n,i)}));const u=(0,pe.useRef)(Boolean(window.HandoffAppearAnimations));return fe((()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())})),(0,pe.useEffect)((()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,u.current=!1)})),c}(s,h,l,e);const n=(0,pe.useContext)(Ge),r=(0,pe.useContext)(Ne).strict;u.visualElement&&(a=u.visualElement.loadFeatures(l,r,t,n))}return pe.createElement(je.Provider,{value:u},a&&u.visualElement?pe.createElement(a,{visualElement:u.visualElement,...l}):null,n(s,o,function(t,e,n){return(0,pe.useCallback)((r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Fe(n)&&(n.current=r))}),[e])}(h,u.visualElement,i),h,c,u.visualElement))}));return o[Ke]=s,o}function Ye({layoutId:t}){const e=(0,pe.useContext)(ke).id;return e&&void 0!==t?e+"-"+t:t}function Je(t){function e(e,n={}){return Xe(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 Qe=["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 tn(t){return"string"==typeof t&&!t.includes("-")&&!!(Qe.indexOf(t)>-1||/[A-Z]/.test(t))}const en={},nn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],rn=new Set(nn);function sn(t,{layout:e,layoutId:n}){return rn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!en[t]||"opacity"===t)}const on=t=>Boolean(t&&t.getVelocity),an={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ln=nn.length,cn=t=>e=>"string"==typeof e&&e.startsWith(t),un=cn("--"),hn=cn("var(--"),dn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,pn=(t,e,n)=>Math.min(Math.max(n,t),e),mn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},fn={...mn,transform:t=>pn(0,1,t)},gn={...mn,default:1},yn=t=>Math.round(1e5*t)/1e5,vn=/(-)?([\d]*\.?[\d])+/g,xn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,wn=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function En(t){return"string"==typeof t}const bn=t=>({test:e=>En(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Pn=bn("deg"),Sn=bn("%"),Tn=bn("px"),Cn=bn("vh"),An=bn("vw"),Ln={...Sn,parse:t=>Sn.parse(t)/100,transform:t=>Sn.transform(100*t)},Mn={...mn,transform:Math.round},kn={borderWidth:Tn,borderTopWidth:Tn,borderRightWidth:Tn,borderBottomWidth:Tn,borderLeftWidth:Tn,borderRadius:Tn,radius:Tn,borderTopLeftRadius:Tn,borderTopRightRadius:Tn,borderBottomRightRadius:Tn,borderBottomLeftRadius:Tn,width:Tn,maxWidth:Tn,height:Tn,maxHeight:Tn,size:Tn,top:Tn,right:Tn,bottom:Tn,left:Tn,padding:Tn,paddingTop:Tn,paddingRight:Tn,paddingBottom:Tn,paddingLeft:Tn,margin:Tn,marginTop:Tn,marginRight:Tn,marginBottom:Tn,marginLeft:Tn,rotate:Pn,rotateX:Pn,rotateY:Pn,rotateZ:Pn,scale:gn,scaleX:gn,scaleY:gn,scaleZ:gn,skew:Pn,skewX:Pn,skewY:Pn,distance:Tn,translateX:Tn,translateY:Tn,translateZ:Tn,x:Tn,y:Tn,z:Tn,perspective:Tn,transformPerspective:Tn,opacity:fn,originX:Ln,originY:Ln,originZ:Tn,zIndex:Mn,fillOpacity:fn,strokeOpacity:fn,numOctaves:Mn};function Rn(t,e,n,r){const{style:s,vars:o,transform:i,transformOrigin:a}=t;let l=!1,c=!1,u=!0;for(const t in e){const n=e[t];if(un(t)){o[t]=n;continue}const r=kn[t],h=dn(n,r);if(rn.has(t)){if(l=!0,i[t]=h,!u)continue;n!==(r.default||0)&&(u=!1)}else t.startsWith("origin")?(c=!0,a[t]=h):s[t]=h}if(e.transform||(l||r?s.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let o="";for(let e=0;e<ln;e++){const n=nn[e];void 0!==t[n]&&(o+=`${an[n]||n}(${t[n]}) `)}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,r?"":o):n&&r&&(o="none"),o}(t.transform,n,u,r):s.transform&&(s.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;s.transformOrigin=`${t} ${e} ${n}`}}const Vn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Dn(t,e,n){for(const r in e)on(e[r])||sn(r,n)||(t[r]=e[r])}function On(t,e,n){const r={},s=function(t,e,n){const r={};return Dn(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,pe.useMemo)((()=>{const r=Vn();return Rn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)}),[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}const Bn=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 jn(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Bn.has(t)}let Nn=t=>!jn(t);try{(Fn=require("@emotion/is-prop-valid").default)&&(Nn=t=>t.startsWith("on")?!jn(t):Fn(t))}catch(t){}var Fn;function In(t,e,n){return"string"==typeof t?t:Tn.transform(e+n*t)}const Un={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hn={offset:"strokeDashoffset",array:"strokeDasharray"};function zn(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,h,d){if(Rn(t,c,u,d),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:f}=t;p.transform&&(f&&(m.transform=p.transform),delete p.transform),f&&(void 0!==s||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${In(e,t.x,t.width)} ${In(n,t.y,t.height)}`}(f,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==i&&function(t,e,n=1,r=0,s=!0){t.pathLength=1;const o=s?Un:Hn;t[o.offset]=Tn.transform(-r);const i=Tn.transform(e),a=Tn.transform(n);t[o.array]=`${i} ${a}`}(p,i,a,l,!1)}const $n=()=>({...Vn(),attrs:{}}),Wn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Zn(t,e,n,r){const s=(0,pe.useMemo)((()=>{const n=$n();return zn(n,e,{enableHardwareAcceleration:!1},Wn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}}),[e]);if(t.style){const e={};Dn(e,t.style,t),s.style={...e,...s.style}}return s}function qn(t=!1){return(e,n,r,{latestValues:s},o)=>{const i=(tn(e)?Zn:On)(n,s,o,e),a=function(t,e,n){const r={};for(const s in t)"values"===s&&"object"==typeof t.values||(Nn(s)||!0===n&&jn(s)||!e&&!jn(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}(n,"string"==typeof e,t),l={...a,...i,ref:r},{children:c}=n,u=(0,pe.useMemo)((()=>on(c)?c.get():c),[c]);return(0,pe.createElement)(e,{...l,children:u})}}const Gn=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Kn(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const Xn=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 Yn(t,e,n,r){Kn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Xn.has(n)?n:Gn(n),e.attrs[n])}function Jn(t,e){const{style:n}=t,r={};for(const s in n)(on(n[s])||e.style&&on(e.style[s])||sn(s,t))&&(r[s]=n[s]);return r}function Qn(t,e){const n=Jn(t,e);for(const r in t)(on(t[r])||on(e[r]))&&(n[-1!==nn.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function tr(t,e,n,r={},s={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,s)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,s)),e}const er=t=>Array.isArray(t),nr=t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue),rr=t=>er(t)?t[t.length-1]||0:t;function sr(t){const e=on(t)?t.get():t;return nr(e)?e.toValue():e}const or=t=>(e,n)=>{const r=(0,pe.useContext)(je),s=(0,pe.useContext)(Se),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,o){const i={latestValues:ir(r,s,o,t),renderState:e()};return n&&(i.mount=t=>n(r,t,i)),i}(t,e,r,s);return n?o():Te(o)};function ir(t,e,n,r){const s={},o=r(t,{});for(const t in o)s[t]=sr(o[t]);let{initial:i,animate:a}=t;const l=ze(t),c=$e(t);e&&c&&!l&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const h=u?a:i;return h&&"boolean"!=typeof h&&!_e(h)&&(Array.isArray(h)?h:[h]).forEach((e=>{const n=tr(t,e);if(!n)return;const{transitionEnd:r,transition:o,...i}=n;for(const t in i){let e=i[t];Array.isArray(e)&&(e=e[u?e.length-1:0]),null!==e&&(s[t]=e)}for(const t in r)s[t]=r[t]})),s}const ar={useVisualState:or({scrapeMotionValuesFromProps:Qn,createRenderState:$n,onMount:(t,e,{renderState:n,latestValues:r})=>{we.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),we.render((()=>{zn(n,r,{enableHardwareAcceleration:!1},Wn(e.tagName),t.transformTemplate),Yn(e,n)}))}})},lr={useVisualState:or({scrapeMotionValuesFromProps:Jn,createRenderState:Vn})};function cr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const ur=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function hr(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const dr=t=>e=>ur(e)&&t(e,hr(e));function pr(t,e,n,r){return cr(t,e,dr(n),r)}const mr=(t,e)=>n=>e(t(n)),fr=(...t)=>t.reduce(mr);function gr(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const yr=gr("dragHorizontal"),vr=gr("dragVertical");function xr(t){let e=!1;if("y"===t)e=vr();else if("x"===t)e=yr();else{const t=yr(),n=vr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function wr(){const t=xr(!0);return!t||(t(),!1)}class Er{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 pr(t.current,n,((n,s)=>{if("touch"===n.type||wr())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[r]&&we.update((()=>o[r](n,s)))}),{passive:!t.getProps()[r]})}const Pr=(t,e)=>!!e&&(t===e||Pr(t,e.parentElement));function Sr(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,hr(n))}const Tr=new WeakMap,Cr=new WeakMap,Ar=t=>{const e=Tr.get(t.target);e&&e(t)},Lr=t=>{t.forEach(Ar)};const Mr={some:0,all:1},kr={inView:{Feature:class extends Er{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:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Mr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Cr.has(n)||Cr.set(n,{});const r=Cr.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Lr,{root:t,...e})),r[s]}(e);return Tr.set(t,n),r.observe(t),()=>{Tr.delete(t),r.unobserve(t)}}(this.node.current,o,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!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(),o=e?n:r;o&&o(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 Er{constructor(){super(...arguments),this.removeStartListeners=ye,this.removeEndListeners=ye,this.removeAccessibleListeners=ye,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),r=pr(window,"pointerup",((t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r}=this.node.getProps();we.update((()=>{Pr(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)}))}),{passive:!(n.onTap||n.onPointerUp)}),s=pr(window,"pointercancel",((t,e)=>this.cancelPress(t,e)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=fr(r,s),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=cr(this.node.current,"keydown",(t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=cr(this.node.current,"keyup",(t=>{"Enter"===t.key&&this.checkPressEnd()&&Sr("up",((t,e)=>{const{onTap:n}=this.node.getProps();n&&we.update((()=>n(t,e)))}))})),Sr("down",((t,e)=>{this.startPress(t,e)})))})),e=cr(this.node.current,"blur",(()=>{this.isPressing&&Sr("cancel",((t,e)=>this.cancelPress(t,e)))}));this.removeAccessibleListeners=fr(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&&we.update((()=>n(t,e)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!wr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&we.update((()=>n(t,e)))}mount(){const t=this.node.getProps(),e=pr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=cr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=fr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Er{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=fr(cr(this.node.current,"focus",(()=>this.onFocus())),cr(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Er{mount(){this.unmount=fr(br(this.node,!0),br(this.node,!1))}unmount(){}}}};function Rr(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 Vr(t,e,n){const r=t.getProps();return tr(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 Dr="data-"+Gn("framerAppearId"),Or=t=>1e3*t,Br=t=>t/1e3,jr=t=>Array.isArray(t)&&"number"==typeof t[0];function Nr(t){return Boolean(!t||"string"==typeof t&&Ir[t]||jr(t)||Array.isArray(t)&&t.every(Nr))}const Fr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Ir={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Fr([0,.65,.55,1]),circOut:Fr([.55,0,1,.45]),backIn:Fr([.31,.01,.66,-.59]),backOut:Fr([.33,1.53,.69,.99])};function _r(t){if(t)return jr(t)?Fr(t):Array.isArray(t)?t.map(_r):Ir[t]}const Ur=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Hr(t,e,n,r){if(t===e&&n===r)return ye;return s=>0===s||1===s?s:Ur(function(t,e,n,r,s){let o,i,a=0;do{i=e+(n-e)/2,o=Ur(i,r,s)-t,o>0?n=i:e=i}while(Math.abs(o)>1e-7&&++a<12);return i}(s,0,1,t,n),e,r)}const zr=Hr(.42,0,1,1),$r=Hr(0,0,.58,1),Wr=Hr(.42,0,.58,1),Zr=t=>Array.isArray(t)&&"number"!=typeof t[0],qr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Gr=t=>e=>1-t(1-e),Kr=t=>1-Math.sin(Math.acos(t)),Xr=Gr(Kr),Yr=qr(Xr),Jr=Hr(.33,1.53,.69,.99),Qr=Gr(Jr),ts=qr(Qr),es={linear:ye,easeIn:zr,easeInOut:Wr,easeOut:$r,circIn:Kr,circInOut:Yr,circOut:Xr,backIn:Qr,backInOut:ts,backOut:Jr,anticipate:t=>(t*=2)<1?.5*Qr(t):.5*(2-Math.pow(2,-10*(t-1)))},ns=t=>{if(Array.isArray(t)){Ve(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,s]=t;return Hr(e,n,r,s)}return"string"==typeof t?(Ve(void 0!==es[t],`Invalid easing type '${t}'`),es[t]):t},rs=(t,e)=>n=>Boolean(En(n)&&wn.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ss=(t,e,n)=>r=>{if(!En(r))return r;const[s,o,i,a]=r.match(vn);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},os={...mn,transform:t=>Math.round((t=>pn(0,255,t))(t))},is={test:rs("rgb","red"),parse:ss("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+os.transform(t)+", "+os.transform(e)+", "+os.transform(n)+", "+yn(fn.transform(r))+")"},as={test:rs("#"),parse:function(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:is.transform},ls={test:rs("hsl","hue"),parse:ss("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Sn.transform(yn(e))+", "+Sn.transform(yn(n))+", "+yn(fn.transform(r))+")"},cs={test:t=>is.test(t)||as.test(t)||ls.test(t),parse:t=>is.test(t)?is.parse(t):ls.test(t)?ls.parse(t):as.parse(t),transform:t=>En(t)?t:t.hasOwnProperty("red")?is.transform(t):ls.transform(t)},us=(t,e,n)=>-n*t+n*e+t;function hs(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 ds=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},ps=[as,is,ls];function ms(t){const e=(n=t,ps.find((t=>t.test(n))));var n;Ve(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let r=e.parse(t);return e===ls&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let s=0,o=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;s=hs(a,r,t+1/3),o=hs(a,r,t),i=hs(a,r,t-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(r)),r}const fs=(t,e)=>{const n=ms(t),r=ms(e),s={...n};return t=>(s.red=ds(n.red,r.red,t),s.green=ds(n.green,r.green,t),s.blue=ds(n.blue,r.blue,t),s.alpha=us(n.alpha,r.alpha,t),is.transform(s))},gs={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:ye},ys={regex:xn,countKey:"Colors",token:"${c}",parse:cs.parse},vs={regex:vn,countKey:"Numbers",token:"${n}",parse:mn.parse};function xs(t,{regex:e,countKey:n,token:r,parse:s}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...o.map(s)))}function ws(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&xs(n,gs),xs(n,ys),xs(n,vs),n}function Es(t){return ws(t).values}function bs(t){const{values:e,numColors:n,numVars:r,tokenised:s}=ws(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=s<r?e.replace(gs.token,t[s]):s<r+n?e.replace(ys.token,cs.transform(t[s])):e.replace(vs.token,yn(t[s]));return e}}const Ps=t=>"number"==typeof t?0:t,Ss={test:function(t){var e,n;return isNaN(t)&&En(t)&&((null===(e=t.match(vn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(xn))||void 0===n?void 0:n.length)||0)>0},parse:Es,createTransformer:bs,getAnimatableNone:function(t){const e=Es(t);return bs(t)(e.map(Ps))}},Ts=(t,e)=>n=>`${n>0?e:t}`;function Cs(t,e){return"number"==typeof t?n=>us(t,e,n):cs.test(t)?fs(t,e):t.startsWith("var(")?Ts(t,e):Ms(t,e)}const As=(t,e)=>{const n=[...t],r=n.length,s=t.map(((t,n)=>Cs(t,e[n])));return t=>{for(let e=0;e<r;e++)n[e]=s[e](t);return n}},Ls=(t,e)=>{const n={...t,...e},r={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(r[s]=Cs(t[s],e[s]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Ms=(t,e)=>{const n=Ss.createTransformer(e),r=ws(t),s=ws(e);return r.numVars===s.numVars&&r.numColors===s.numColors&&r.numNumbers>=s.numNumbers?fr(As(r.values,s.values),n):(Re(!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.`),Ts(t,e))},ks=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Rs=(t,e)=>n=>us(t,e,n);function Vs(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const o=t.length;if(Ve(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=function(t,e,n){const r=[],s=n||("number"==typeof(o=t[0])?Rs:"string"==typeof o?cs.test(o)?fs:Ms:Array.isArray(o)?As:"object"==typeof o?Ls:Rs);var o;const i=t.length-1;for(let n=0;n<i;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||ye:e;o=fr(t,o)}r.push(o)}return r}(e,r,s),a=i.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=ks(t[n],t[n+1],e);return i[n](r)};return n?e=>l(pn(t[0],t[o-1],e)):l}function Ds({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Zr(r)?r.map(ns):ns(r),o={done:!1,value:e[0]},i=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 s=ks(0,e,r);t.push(us(n,1,s))}}(e,t.length-1),e}(e),t),a=Vs(i,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map((()=>c||Wr)).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}function Os(t,e){return e?t*(1e3/e):0}const Bs=5;function js(t,e,n){const r=Math.max(e-Bs,0);return Os(n-t(r),e-r)}const Ns=.001,Fs=.01,Is=10,_s=.05,Us=1;const Hs=12;function zs(t,e){return t*Math.sqrt(1-e*e)}const $s=["duration","bounce"],Ws=["stiffness","damping","mass"];function Zs(t,e){return e.some((e=>void 0!==t[e]))}function qs({keyframes:t,restDelta:e,restSpeed:n,...r}){const s=t[0],o=t[t.length-1],i={done:!1,value:s},{stiffness:a,damping:l,mass:c,velocity:u,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Zs(t,Ws)&&Zs(t,$s)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,o;Re(t<=Or(Is),"Spring duration must be 10 seconds or less");let i=1-e;i=pn(_s,Us,i),t=pn(Fs,Is,Br(t)),i<1?(s=e=>{const r=e*i,s=r*t,o=r-n,a=zs(e,i),l=Math.exp(-s);return Ns-o/a*l},o=e=>{const r=e*i*t,o=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,l=Math.exp(-r),c=zs(Math.pow(e,2),i);return(-s(e)+Ns>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-Ns,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Hs;n++)r-=t(r)/e(r);return r}(s,o,5/t);if(t=Or(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r),p=u?-Br(u):0,m=l/(2*Math.sqrt(a*c)),f=o-s,g=Br(Math.sqrt(a/c)),y=Math.abs(f)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),m<1){const t=zs(g,m);v=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)v=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);v=e=>{const n=Math.exp(-m*g*e),r=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(r)+t*f*Math.cosh(r))/t}}return{calculatedDuration:d&&h||null,next:t=>{const r=v(t);if(d)i.done=t>=h;else{let s=p;0!==t&&(s=m<1?js(v,t,r):0);const a=Math.abs(s)<=n,l=Math.abs(o-r)<=e;i.done=a&&l}return i.value=i.done?o:r,i}}}function Gs({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===i?f:i(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/r),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,E;const b=t=>{var e;e=d.value,(void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,E=qs({keyframes:[d.value,p(d.value)],velocity:js(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return E||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>w?E.next(t-w):(!e&&x(t),d)}}}const Ks=t=>{const e=({timestamp:e})=>t(e);return{start:()=>we.update(e,!0),stop:()=>Ee(e),now:()=>be.isProcessing?be.timestamp:performance.now()}},Xs=2e4;function Ys(t){let e=0,n=t.next(e);for(;!n.done&&e<Xs;)e+=50,n=t.next(e);return e>=Xs?1/0:e}const Js={decay:Gs,inertia:Gs,tween:Ds,keyframes:Ds,spring:qs};function Qs({autoplay:t=!0,delay:e=0,driver:n=Ks,keyframes:r,type:s="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:h,...d}){let p,m,f=1,g=!1;const y=()=>{m=new Promise((t=>{p=t}))};let v;y();const x=Js[s]||Ds;let w;x!==Ds&&"number"!=typeof r[0]&&(w=Vs([0,100],r,{clamp:!1}),r=[0,100]);const E=x({...d,keyframes:r});let b;"mirror"===a&&(b=x({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let P="idle",S=null,T=null,C=null;null===E.calculatedDuration&&o&&(E.calculatedDuration=Ys(E));const{calculatedDuration:A}=E;let L=1/0,M=1/0;null!==A&&(L=A+i,M=L*(o+1)-i);let k=0;const R=t=>{if(null===T)return;f>0&&(T=Math.min(T,t)),f<0&&(T=Math.min(t-M/f,T)),k=null!==S?S:Math.round(t-T)*f;const n=k-e*(f>=0?1:-1),s=f>=0?n<0:n>M;k=Math.max(n,0),"finished"===P&&null===S&&(k=M);let l=k,c=E;if(o){const t=k/L;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,o+1);const r=Boolean(e%2);r&&("reverse"===a?(n=1-n,i&&(n-=i/L)):"mirror"===a&&(c=b));let s=pn(0,1,n);k>M&&(s="reverse"===a&&r?1:0),l=s*L}const u=s?{done:!1,value:r[0]}:c.next(l);w&&(u.value=w(u.value));let{done:d}=u;s||null===A||(d=f>=0?k>=M:k<=0);const p=null===S&&("finished"===P||"running"===P&&d);return h&&h(u.value),p&&O(),u},V=()=>{v&&v.stop(),v=void 0},D=()=>{P="idle",V(),p(),y(),T=C=null},O=()=>{P="finished",u&&u(),V(),p()},B=()=>{if(g)return;v||(v=n(R));const t=v.now();l&&l(),null!==S?T=t-S:T&&"finished"!==P||(T=t),"finished"===P&&y(),C=T,S=null,P="running",v.start()};t&&B();const j={then(t,e){return m.then(t,e)},get time(){return Br(k)},set time(t){t=Or(t),k=t,null===S&&v&&0!==f?T=v.now()-t/f:S=t},get duration(){const t=null===E.calculatedDuration?Ys(E):E.calculatedDuration;return Br(t)},get speed(){return f},set speed(t){t!==f&&v&&(f=t,j.time=Br(k))},get state(){return P},play:B,pause:()=>{P="paused",S=k},stop:()=>{g=!0,"idle"!==P&&(P="idle",c&&c(),D())},cancel:()=>{null!==C&&R(C),D()},complete:()=>{P="finished"},sample:t=>(T=0,R(t))};return j}const to=function(t){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),eo=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const no={type:"spring",stiffness:500,damping:25,restSpeed:10},ro={type:"keyframes",duration:.8},so={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oo=(t,{keyframes:e})=>e.length>2?ro:rn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:no:so,io=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ss.test(e)&&"0"!==e||e.startsWith("url("))),ao=new Set(["brightness","contrast","saturate","opacity"]);function lo(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(vn)||[];if(!r)return t;const s=n.replace(r,"");let o=ao.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+s+")"}const co=/([a-z-]*)\(.*?\)/g,uo={...Ss,getAnimatableNone:t=>{const e=t.match(co);return e?e.map(lo).join(" "):t}},ho={...kn,color:cs,backgroundColor:cs,outlineColor:cs,fill:cs,stroke:cs,borderColor:cs,borderTopColor:cs,borderRightColor:cs,borderBottomColor:cs,borderLeftColor:cs,filter:uo,WebkitFilter:uo},po=t=>ho[t];function mo(t,e){let n=po(t);return n!==uo&&(n=Ss),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const fo=t=>/^0[^.\s]+$/.test(t);function go(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||fo(t):void 0}function yo(t,e){return t[e]||t.default||t}const vo=(t,e,n,r={})=>s=>{const o=yo(r,t)||{},i=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Or(i);const l=function(t,e,n,r){const s=io(e,n);let o;o=Array.isArray(n)?[...n]:[null,n];const i=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<o.length;t++)null===o[t]&&(o[t]=0===t?i:o[t-1]),go(o[t])&&l.push(t),"string"==typeof o[t]&&"none"!==o[t]&&"0"!==o[t]&&(a=o[t]);if(s&&l.length&&a)for(let t=0;t<l.length;t++)o[l[t]]=mo(e,a);return o}(e,t,n,o),c=l[0],u=l[l.length-1],h=io(t,c),d=io(t,u);Re(h===d,`You are trying to animate ${t} from "${c}" to "${u}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${u} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{s(),o.onComplete&&o.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(p={...p,...oo(t,p)}),p.duration&&(p.duration=Or(p.duration)),p.repeatDelay&&(p.repeatDelay=Or(p.repeatDelay)),!h||!d||!1===o.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const s=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:ye,pause:ye,stop:ye,then:t=>(t(),Promise.resolve()),cancel:ye,complete:ye});return e?Qs({keyframes:[0,1],duration:0,delay:e,onComplete:s}):s()}(p);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...s}){if(!to()||!eo.has(e)||s.repeatDelay||"mirror"===s.repeatType||0===s.damping||"inertia"===s.type)return!1;let o,i,a=!1;const l=()=>{i=new Promise((t=>{o=t}))};l();let{keyframes:c,duration:u=300,ease:h,times:d}=s;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Nr(e.ease))(e,s)){const t=Qs({...s,repeat:0,delay:0});let e={done:!1,value:c[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;d=void 0,c=n,u=r-10,h="linear"}const p=function(t,e,n,{delay:r=0,duration:s,repeat:o=0,repeatType:i="loop",ease:a,times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=_r(a);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===i?"alternate":"normal"})}(t.owner.current,e,c,{...s,duration:u,ease:h,times:d});s.syncStart&&(p.startTime=be.isProcessing?be.timestamp:document.timeline?document.timeline.currentTime:performance.now());const m=()=>p.cancel(),f=()=>{we.update(m),o(),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]}(c,s)),r&&r(),f()},{then(t,e){return i.then(t,e)},attachTimeline(t){return p.timeline=t,p.onfinish=null,ye},get time(){return Br(p.currentTime||0)},set time(t){p.currentTime=Or(t)},get speed(){return p.playbackRate},set speed(t){p.playbackRate=t},get duration(){return Br(u)},play:()=>{a||(p.play(),Ee(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,"idle"===p.playState)return;const{currentTime:e}=p;if(e){const n=Qs({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}f()},complete:()=>p.finish(),cancel:f}}(e,t,p);if(n)return n}return Qs(p)};function xo(t){return Boolean(on(t)&&t.add)}const wo=t=>/^\-?\d*\.?\d+$/.test(t);function Eo(t,e){-1===t.indexOf(e)&&t.push(e)}function bo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Po{constructor(){this.subscriptions=[]}add(t){return Eo(this.subscriptions,t),()=>bo(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 s=0;s<r;s++){const r=this.subscriptions[s];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const So={current:void 0};class To{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}=be;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,we.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=()=>we.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 Po);const n=this.events[t].add(e);return"change"===t?()=>{n(),we.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 So.current&&So.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Os(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 Co(t,e){return new To(t,e)}const Ao=t=>e=>e.test(t),Lo=[mn,Tn,Sn,Pn,An,Cn,{test:t=>"auto"===t,parse:t=>t}],Mo=t=>Lo.find(Ao(t)),ko=[...Lo,cs,Ss];function Ro(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Co(n))}function Vo(t,e){if(e)return(e[t]||e.default||e).from}function Do({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Oo(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:i,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(o=r);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const r=t.getValue(e),s=a[e];if(!r||void 0===s||u&&Do(u,e))continue;const i={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!r.hasAnimated){const n=t.getProps()[Dr];n&&(i.elapsed=window.HandoffAppearAnimations(n,e,r,we),i.syncStart=!0)}r.start(vo(e,r,s,t.shouldReduceMotion&&rn.has(e)?{type:!1}:i));const h=r.animation;xo(l)&&(l.add(e),h.then((()=>l.remove(e)))),c.push(h)}return i&&Promise.all(c).then((()=>{i&&function(t,e){const n=Vr(t,e);let{transitionEnd:r={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o)Ro(t,e,rr(o[e]))}(t,i)})),c}function Bo(t,e,n={}){const r=Vr(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(Oo(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,s=1,o){const i=[],a=(t.variantChildren.size-1)*r,l=1===s?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(jo).forEach(((t,r)=>{t.notify("AnimationStart",e),i.push(Bo(t,e,{...o,delay:n+l(r)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,i]:[i,o];return t().then((()=>e()))}return Promise.all([o(),i(n.delay)])}function jo(t,e){return t.sortNodePosition(e)}const No=[...Ue].reverse(),Fo=Ue.length;function Io(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 s=e.map((e=>Bo(t,e,n)));r=Promise.all(s)}else if("string"==typeof e)r=Bo(t,e,n);else{const s="function"==typeof e?Vr(t,e,n.custom):e;r=Promise.all(Oo(t,s,n))}return r.then((()=>t.notify("AnimationComplete",e)))}(t,e,n))))}(t);const n={animate:_o(!0),whileInView:_o(),whileHover:_o(),whileTap:_o(),whileDrag:_o(),whileFocus:_o(),exit:_o()};let r=!0;const s=(e,n)=>{const r=Vr(t,n);if(r){const{transition:t,transitionEnd:n,...s}=r;e={...e,...s,...n}}return e};function o(o,i){const a=t.getProps(),l=t.getVariantContext(!0)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Fo;e++){const f=No[e],g=n[f],y=void 0!==a[f]?a[f]:l[f],v=Ie(y),x=f===i?g.isActive:null;!1===x&&(d=e);let w=y===l[f]&&y!==a[f]&&v;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),g.protectedKeys={...h},!g.isActive&&null===x||!y&&!g.prevProp||_e(y)||"boolean"==typeof y)continue;const E=(p=g.prevProp,"string"==typeof(m=y)?m!==p:!!Array.isArray(m)&&!Rr(m,p));let b=E||f===i&&g.isActive&&!w&&v||e>d&&v;const P=Array.isArray(y)?y:[y];let S=P.reduce(s,{});!1===x&&(S={});const{prevResolvedValues:T={}}=g,C={...T,...S},A=t=>{b=!0,u.delete(t),g.needsAnimating[t]=!0};for(const t in C){const e=S[t],n=T[t];h.hasOwnProperty(t)||(e!==n?er(e)&&er(n)?!Rr(e,n)||E?A(t):g.protectedKeys[t]=!0:void 0!==e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=S,g.isActive&&(h={...h,...S}),r&&t.blockInitialAnimation&&(b=!1),b&&!w&&c.push(...P.map((t=>({animation:t,options:{type:f,...o}}))))}var p,m;if(u.size){const e={};u.forEach((n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)})),c.push({animation:e})}let f=Boolean(c.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(c):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,s){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)})),n[e].isActive=r;const a=o(s,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function _o(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Uo=0;const Ho={animation:{Feature:class extends Er{constructor(t){super(t),t.animationState||(t.animationState=Io(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),_e(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 Er{constructor(){super(...arguments),this.id=Uo++}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 s=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&s.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},zo=(t,e)=>Math.abs(t-e);class $o{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=qo(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=zo(t.x,e.x),r=zo(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:s}=be;this.history.push({...r,timestamp:s});const{onStart:o,onMove:i}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Wo(e,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:r}=this.handlers,s=qo("pointercancel"===t.type?this.lastMoveEventInfo:Wo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),r&&r(t,s)},!ur(t))return;this.handlers=e,this.transformPagePoint=n;const r=Wo(hr(t),this.transformPagePoint),{point:s}=r,{timestamp:o}=be;this.history=[{...s,timestamp:o}];const{onSessionStart:i}=e;i&&i(t,qo(r,this.history)),this.removeListeners=fr(pr(window,"pointermove",this.handlePointerMove),pr(window,"pointerup",this.handlePointerUp),pr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ee(this.updatePoint)}}function Wo(t,e){return e?{point:e(t.point)}:t}function Zo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qo({point:t},e){return{point:t,delta:Zo(t,Ko(e)),offset:Zo(t,Go(e)),velocity:Xo(e,.1)}}function Go(t){return t[0]}function Ko(t){return t[t.length-1]}function Xo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=Ko(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Or(e)));)n--;if(!r)return{x:0,y:0};const o=Br(s.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Yo(t){return t.max-t.min}function Jo(t,e=0,n=.01){return Math.abs(t-e)<=n}function Qo(t,e,n,r=.5){t.origin=r,t.originPoint=us(e.min,e.max,t.origin),t.scale=Yo(n)/Yo(e),(Jo(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=us(n.min,n.max,t.origin)-t.originPoint,(Jo(t.translate)||isNaN(t.translate))&&(t.translate=0)}function ti(t,e,n,r){Qo(t.x,e.x,n.x,r?r.originX:void 0),Qo(t.y,e.y,n.y,r?r.originY:void 0)}function ei(t,e,n){t.min=n.min+e.min,t.max=t.min+Yo(e)}function ni(t,e,n){t.min=e.min-n.min,t.max=t.min+Yo(e)}function ri(t,e,n){ni(t.x,e.x,n.x),ni(t.y,e.y,n.y)}function si(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 oi(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 ii=.35;function ai(t,e,n){return{min:li(t,e),max:li(t,n)}}function li(t,e){return"number"==typeof t?t:t[e]||0}const ci=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ui=()=>({x:{min:0,max:0},y:{min:0,max:0}});function hi(t){return[t("x"),t("y")]}function di({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function pi(t){return void 0===t||1===t}function mi({scale:t,scaleX:e,scaleY:n}){return!pi(t)||!pi(e)||!pi(n)}function fi(t){return mi(t)||gi(t)||t.z||t.rotate||t.rotateX||t.rotateY}function gi(t){return yi(t.x)||yi(t.y)}function yi(t){return t&&"0%"!==t}function vi(t,e,n){return n+e*(t-n)}function xi(t,e,n,r,s){return void 0!==s&&(t=vi(t,s,r)),vi(t,n,r)+e}function wi(t,e=0,n=1,r,s){t.min=xi(t.min,e,n,r,s),t.max=xi(t.max,e,n,r,s)}function Ei(t,{x:e,y:n}){wi(t.x,e.translate,e.scale,e.originPoint),wi(t.y,n.translate,n.scale,n.originPoint)}function bi(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Pi(t,e){t.min=t.min+e,t.max=t.max+e}function Si(t,e,[n,r,s]){const o=void 0!==e[s]?e[s]:.5,i=us(t.min,t.max,o);wi(t,e[n],e[r],i,e.scale)}const Ti=["x","scaleX","originX"],Ci=["y","scaleY","originY"];function Ai(t,e){Si(t.x,e,Ti),Si(t.y,e,Ci)}function Li(t,e){return di(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 Mi=new WeakMap;class ki{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=ui(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;n&&!1===n.isPresent||(this.panSession=new $o(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(hr(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:s}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=xr(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),hi((t=>{let e=this.getAxisMotionValue(t).get()||0;if(Sn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Yo(r)*(parseFloat(e)/100))}}this.originPoint[t]=e})),s&&we.update((()=>s(t,e)),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:i}=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}(i),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,i),this.updateAxis("y",e.point,i),this.visualElement.render(),o&&o(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:s}=this.getProps();s&&we.update((()=>s(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||!Ri(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?us(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?us(n,t,r.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;t&&Fe(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:r,right:s}){return{x:si(t.x,n,s),y:si(t.y,e,r)}}(n.layoutBox,t),this.elastic=function(t=ii){return!1===t?t=0:!0===t&&(t=ii),{x:ai(t,"left","right"),y:ai(t,"top","bottom")}}(e),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&hi((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||!Fe(t))return!1;const n=t.current;Ve(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 s=function(t,e,n){const r=Li(t,n),{scroll:s}=e;return s&&(Pi(r.x,s.offset.x),Pi(r.y,s.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:oi(t.x,e.x),y:oi(t.y,e.y)}}(r.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=di(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:i}=this.getProps(),a=this.constraints||{},l=hi((i=>{if(!Ri(i,e,this.currentDirection))return;let l=a&&a[i]||{};o&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,h={type:"inertia",velocity:n?t[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(i,h)}));return Promise.all(l).then(i)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(vo(t,n,0,e))}stopAnimation(){hi((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){hi((e=>{const{drag:n}=this.getProps();if(!Ri(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[e];s.set(t[e]-us(n,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Fe(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};hi((t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Yo(t),s=Yo(e);return s>r?n=ks(e.min,e.max-r,t.min):r>s&&(n=ks(t.min,t.max-s,e.min)),pn(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),hi((e=>{if(!Ri(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(us(s,o,r[e]))}))}addListeners(){if(!this.visualElement.current)return;Mi.set(this.visualElement,this);const t=pr(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();Fe(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 s=cr(window,"resize",(()=>this.scalePositionWithinConstraints())),o=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(hi((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{s(),t(),r(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=ii,dragMomentum:i=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:i}}}function Ri(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Vi=t=>(e,n)=>{t&&we.update((()=>t(e,n)))},Di={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Oi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Bi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Tn.test(t))return t;t=parseFloat(t)}return`${Oi(t,e.target.x)}% ${Oi(t,e.target.y)}%`}},ji={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ss.parse(t);if(s.length>5)return r;const o=Ss.createTransformer(t),i="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+i]/=a,s[1+i]/=l;const c=us(a,l,.5);return"number"==typeof s[2+i]&&(s[2+i]/=c),"number"==typeof s[3+i]&&(s[3+i]/=c),o(s)}};class Ni extends pe.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:s}=t;var o;o=Ii,Object.assign(en,o),s&&(e.group&&e.group.add(s),n&&n.register&&r&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(()=>{this.safeToRemove()})),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Di.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,r||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||we.postRender((()=>{const t=o.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 Fi(t){const[e,n]=function(){const t=(0,pe.useContext)(Se);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=(0,pe.useId)();return(0,pe.useEffect)((()=>r(s)),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}(),r=(0,pe.useContext)(ke);return pe.createElement(Ni,{...t,layoutGroup:r,switchLayoutGroup:(0,pe.useContext)(Ge),isPresent:e,safeToRemove:n})}const Ii={borderRadius:{...Bi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Bi,borderTopRightRadius:Bi,borderBottomLeftRadius:Bi,borderBottomRightRadius:Bi,boxShadow:ji},_i=["TopLeft","TopRight","BottomLeft","BottomRight"],Ui=_i.length,Hi=t=>"string"==typeof t?parseFloat(t):t,zi=t=>"number"==typeof t||Tn.test(t);function $i(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Wi=qi(0,.5,Xr),Zi=qi(.5,.95,ye);function qi(t,e,n){return r=>r<t?0:r>e?1:n(ks(t,e,r))}function Gi(t,e){t.min=e.min,t.max=e.max}function Ki(t,e){Gi(t.x,e.x),Gi(t.y,e.y)}function Xi(t,e,n,r,s){return t=vi(t-=e,1/n,r),void 0!==s&&(t=vi(t,1/s,r)),t}function Yi(t,e,[n,r,s],o,i){!function(t,e=0,n=1,r=.5,s,o=t,i=t){if(Sn.test(e)&&(e=parseFloat(e),e=us(i.min,i.max,e/100)-i.min),"number"!=typeof e)return;let a=us(o.min,o.max,r);t===o&&(a-=e),t.min=Xi(t.min,e,n,a,s),t.max=Xi(t.max,e,n,a,s)}(t,e[n],e[r],e[s],e.scale,o,i)}const Ji=["x","scaleX","originX"],Qi=["y","scaleY","originY"];function ta(t,e,n,r){Yi(t.x,e,Ji,n?n.x:void 0,r?r.x:void 0),Yi(t.y,e,Qi,n?n.y:void 0,r?r.y:void 0)}function ea(t){return 0===t.translate&&1===t.scale}function na(t){return ea(t.x)&&ea(t.y)}function ra(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 sa(t){return Yo(t.x)/Yo(t.y)}class oa{constructor(){this.members=[]}add(t){Eo(this.members,t),t.scheduleRender()}remove(t){if(bo(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 ia(t,e,n){let r="";const s=t.x.translate/e.x,o=t.y.translate/e.y;if((s||o)&&(r=`translate3d(${s}px, ${o}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:s}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),s&&(r+=`rotateY(${s}deg) `)}const i=t.x.scale*e.x,a=t.y.scale*e.y;return 1===i&&1===a||(r+=`scale(${i}, ${a})`),r||"none"}const aa=(t,e)=>t.depth-e.depth;class la{constructor(){this.children=[],this.isDirty=!1}add(t){Eo(this.children,t),this.isDirty=!0}remove(t){bo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aa),this.isDirty=!1,this.children.forEach(t)}}const ca=["","X","Y","Z"];let ua=0;const ha={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function da({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ua++,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(fa),this.nodes.forEach(ba),this.nodes.forEach(Pa),this.nodes.forEach(ga),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 la)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Po),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:s,layout:o,visualElement:i}=this.options;if(i&&!i.current&&i.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(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 s=e-n;s>=250&&(Ee(r),t(s-250))};return we.read(r,!0),()=>Ee(r)}(r),Di.hasAnimatedSinceResize&&(Di.hasAnimatedSinceResize=!1,this.nodes.forEach(Ea))}))}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&i&&(s||o)&&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 s=this.options.transition||i.getDefaultTransition()||Ma,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=i.getProps(),l=!this.targetLayout||!ra(this.targetLayout,r)||n,c=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,c);const e={...yo(s,"layout"),onPlay:o,onComplete:a};(i.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,Ee(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(Sa),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(va);this.isUpdating||this.nodes.forEach(xa),this.isUpdating=!1,this.nodes.forEach(wa),this.nodes.forEach(pa),this.nodes.forEach(ma),this.clearAllSnapshots();const t=performance.now();be.delta=pn(0,1e3/60,t-be.timestamp),be.timestamp=t,be.isProcessing=!0,Pe.update.process(be),Pe.preRender.process(be),Pe.render.process(be),be.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask((()=>this.update())))}clearAllSnapshots(){this.nodes.forEach(ya),this.sharedNodes.forEach(Ta)}scheduleUpdateProjection(){we.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){we.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=ui(),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(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!na(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;t&&(e||fi(this.latestValues)||o)&&(s(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 ui();const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Pi(e.x,n.offset.x),Pi(e.y,n.offset.y)),e}removeElementScroll(t){const e=ui();Ki(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:s,options:o}=r;if(r!==this.root&&s&&o.layoutScroll){if(s.isRoot){Ki(e,t);const{scroll:n}=this.root;n&&(Pi(e.x,-n.offset.x),Pi(e.y,-n.offset.y))}Pi(e.x,s.offset.x),Pi(e.y,s.offset.y)}}return e}applyTransform(t,e=!1){const n=ui();Ki(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&&Ai(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fi(r.latestValues)&&Ai(n,r.latestValues)}return fi(this.latestValues)&&Ai(n,this.latestValues),n}removeTransform(t){const e=ui();Ki(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fi(n.latestValues))continue;mi(n.latestValues)&&n.updateSnapshot();const r=ui();Ki(r,n.measurePageBox()),ta(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fi(this.latestValues)&&ta(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!==be.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:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=be.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ui(),this.relativeTargetOrigin=ui(),ri(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Ki(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,a,l;if(this.target||(this.target=ui(),this.targetWithTransforms=ui()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),i=this.target,a=this.relativeTarget,l=this.relativeParent.target,ei(i.x,a.x,l.x),ei(i.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ki(this.target,this.layout.layoutBox),Ei(this.target,this.targetDelta)):Ki(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=ui(),this.relativeTargetOrigin=ui(),ri(this.relativeTargetOrigin,this.target,t.target),Ki(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ha.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!mi(this.parent.latestValues)&&!gi(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===be.timestamp&&(r=!1),r)return;const{layout:s,layoutId:o}=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||!s&&!o)return;Ki(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const s=n.length;if(!s)return;let o,i;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const s=o.instance;s&&s.style&&"contents"===s.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ai(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(e.x*=i.x.scale,e.y*=i.y.scale,Ei(t,i)),r&&fi(o.latestValues)&&Ai(t,o.latestValues))}e.x=bi(e.x),e.y=bi(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=ci(),this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta=ci(),this.projectionDeltaWithTransform=ci());const c=this.projectionTransform;ti(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=ia(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===i&&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:{},s={...this.latestValues},o=ci();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const i=ui(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(La));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,g;Ca(o.x,t.x,n),Ca(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ri(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=i,g=n,Aa(p.x,m.x,f.x,g),Aa(p.y,m.y,f.y,g),h&&(l=this.relativeTarget,d=h,l.x.min===d.x.min&&l.x.max===d.x.max&&l.y.min===d.y.min&&l.y.max===d.y.max)&&(this.isProjectionDirty=!1),h||(h=ui()),Ki(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,r,s,o){s?(t.opacity=us(0,void 0!==n.opacity?n.opacity:1,Wi(r)),t.opacityExit=us(void 0!==e.opacity?e.opacity:1,0,Zi(r))):o&&(t.opacity=us(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<Ui;s++){const o=`border${_i[s]}Radius`;let i=$i(e,o),a=$i(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||zi(i)===zi(a)?(t[o]=Math.max(us(Hi(i),Hi(a),r),0),(Sn.test(a)||Sn.test(i))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=us(e.rotate||0,n.rotate||0,r))}(s,r,this.latestValues,n,u,c)),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&&(Ee(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update((()=>{Di.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=on(0)?0:Co(0);return r.start(vo("",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:s}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&Da(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||ui();const e=Yo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Yo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Ki(e,n),Ai(e,s),ti(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new oa),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 s="rotate"+ca[e];n[s]&&(r[s]=n[s],t.setStaticValue(s,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 s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=sr(t.pointerEvents)||"",r.transform=s?s(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=sr(t.pointerEvents)||""),this.hasProjected&&!fi(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const i=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=ia(this.projectionDeltaWithTransform,this.treeScale,i),s&&(r.transform=s(i,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(e=i.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r.opacity=o===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const t in en){if(void 0===i[t])continue;const{correct:e,applyTo:n}=en[t],s="none"===r.transform?i[t]:e(i[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=s}else r[t]=s}return this.options.layoutId&&(r.pointerEvents=o===this?sr(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(va),this.root.sharedNodes.clear()}}}function pa(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:s}=t.options,o=n.source!==t.layout.source;"size"===s?hi((t=>{const r=o?n.measuredBox[t]:n.layoutBox[t],s=Yo(r);r.min=e[t].min,r.max=r.min+s})):Da(s,n.layoutBox,e)&&hi((r=>{const s=o?n.measuredBox[r]:n.layoutBox[r],i=Yo(e[r]);s.max=s.min+i,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+i)}));const i=ci();ti(i,e,n.layoutBox);const a=ci();o?ti(a,t.applyTransform(r,!0),n.measuredBox):ti(a,e,n.layoutBox);const l=!na(i);let c=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:s,layout:o}=r;if(s&&o){const i=ui();ri(i,n.layoutBox,s.layoutBox);const a=ui();ri(a,e,o.layoutBox),ra(i,a)||(c=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=i,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function fa(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 ga(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ya(t){t.clearSnapshot()}function va(t){t.clearMeasurements()}function xa(t){t.isLayoutDirty=!1}function wa(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 ba(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function Sa(t){t.resetRotation()}function Ta(t){t.removeLeadSnapshot()}function Ca(t,e,n){t.translate=us(e.translate,0,n),t.scale=us(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Aa(t,e,n,r){t.min=us(e.min,n.min,r),t.max=us(e.max,n.max,r)}function La(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ma={duration:.45,ease:[.4,0,.1,1]},ka=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),Ra=ka("applewebkit/")&&!ka("chrome/")?Math.round:ye;function Va(t){t.min=Ra(t.min),t.max=Ra(t.max)}function Da(t,e,n){return"position"===t||"preserve-aspect"===t&&!Jo(sa(e),sa(n),.2)}const Oa=da({attachResizeListener:(t,e)=>cr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ba={current:void 0},ja=da({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ba.current){const t=new Oa({});t.mount(window),t.setOptions({layoutScroll:!0}),Ba.current=t}return Ba.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Na={pan:{Feature:class extends Er{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new $o(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Vi(t),onStart:Vi(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&we.update((()=>r(t,e)))}}}mount(){this.removePointerDownListener=pr(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 Er{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new ki(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ja,MeasureLayout:Fi}},Fa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ia(t,e,n=1){Ve(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=function(t){const e=Fa.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const t=o.trim();return wo(t)?parseFloat(t):t}return hn(s)?Ia(s,e,n+1):s}const _a=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ua=t=>_a.has(t),Ha=t=>t===mn||t===Tn,za=(t,e)=>parseFloat(t.split(", ")[e]),$a=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/);if(s)return za(s[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?za(e[1],t):0}},Wa=new Set(["x","y","z"]),Za=nn.filter((t=>!Wa.has(t))),qa={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:$a(4,13),y:$a(5,14)};qa.translateX=qa.x,qa.translateY=qa.y;function Ga(t,e,n,r){return(t=>Object.keys(t).some(Ua))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const s=Object.keys(e).filter(Ua);let o=[],i=!1;const a=[];if(s.forEach((s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let c=n[s],u=Mo(c);const h=e[s];let d;if(er(h)){const t=h.length,e=null===h[0]?1:0;c=h[e],u=Mo(c);for(let n=e;n<t&&null!==h[n];n++)d?Ve(Mo(h[n])===d,"All keyframes must be of the same type"):(d=Mo(h[n]),Ve(d===u||Ha(u)&&Ha(d),"Keyframes must be of the same dimension as the current value"))}else d=Mo(h);if(u!==d)if(Ha(u)&&Ha(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&d===Tn&&(e[s]=h.map(parseFloat))}else(null==u?void 0:u.transform)&&(null==d?void 0:d.transform)&&(0===c||0===h)?0===c?l.set(d.transform(c)):e[s]=u.transform(h):(i||(o=function(t){const e=[];return Za.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),i=!0),a.push(s),r[s]=void 0!==r[s]?r[s]:e[s],l.jump(h))})),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,s=((t,e,n)=>{const r=e.measureViewportBox(),s=e.current,o=getComputedStyle(s),{display:i}=o,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach((t=>{a[t]=qa[t](r,o)})),e.render();const l=e.measureViewportBox();return n.forEach((n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=qa[n](l,o)})),t})(e,t,a);return o.length&&o.forEach((([e,n])=>{t.getValue(e).set(n)})),t.render(),me&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ka={current:null},Xa={current:!1},Ya=new WeakMap,Ja=Object.keys(qe),Qa=Ja.length,tl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],el=He.length;class nl{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:s},o={}){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=()=>we.render(this.render,!1,!0);const{latestValues:i,renderState:a}=s;this.latestValues=i,this.baseTarget={...i},this.initialValues=e.initial?{...i}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ze(e),this.isVariantNode=$e(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(e,{});for(const t in c){const e=c[t];void 0!==i[t]&&on(e)&&(e.set(i[t],!1),xo(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Ya.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))),Xa.current||function(){if(Xa.current=!0,me)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(){Ya.delete(this.current),this.projection&&this.projection.unmount(),Ee(this.notifyUpdate),Ee(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=rn.has(t),r=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&we.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)})),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,(()=>{r(),s()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,s){let o,i;for(let t=0;t<Qa;t++){const n=Ja[t],{isEnabled:r,Feature:s,ProjectionNode:a,MeasureLayout:l}=qe[n];a&&(o=a),r(e)&&(!this.features[n]&&s&&(this.features[n]=new s(this)),l&&(i=l))}if(!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:i,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||i&&Fe(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:a,layoutRoot:l})}return i}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):ui()}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<tl.length;e++){const n=tl[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 s in e){const o=e[s],i=n[s];if(on(o))t.addValue(s,o),xo(r)&&r.add(s);else if(on(i))t.addValue(s,Co(o,{owner:t})),xo(r)&&r.remove(s);else if(i!==o)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(s);t.addValue(s,Co(void 0!==e?e:o,{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<el;t++){const n=He[t],r=this.props[n];(Ie(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=Co(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=tr(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||on(s)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new Po),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class rl extends nl{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},s){let o=function(t,e,n){const r={};for(const s in t){const t=Vo(s,e);if(void 0!==t)r[s]=t;else{const t=n.getValue(s);t&&(r[s]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),s){!function(t,e,n){var r,s;const o=Object.keys(e).filter((e=>!t.hasValue(e))),i=o.length;var a;if(i)for(let l=0;l<i;l++){const i=o[l],c=e[i];let u=null;Array.isArray(c)&&(u=c[0]),null===u&&(u=null!==(s=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==s?s:e[i]),null!=u&&("string"==typeof u&&(wo(u)||fo(u))?u=parseFloat(u):(a=u,!ko.find(Ao(a))&&Ss.test(c)&&(u=mo(i,c))),t.addValue(i,Co(u,{owner:t})),void 0===n[i]&&(n[i]=u),null!==u&&t.setBaseTarget(i,u))}}(this,n,o);const t=((t,e,n,r)=>{const s=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(!hn(e))return;const n=Ia(e,r);n&&t.set(n)}));for(const t in e){const s=e[t];if(!hn(s))continue;const o=Ia(s,r);o&&(e[t]=o,n||(n={}),void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,r);return Ga(t,e=s.target,n,r=s.transitionEnd)})(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class sl extends rl{readValueFromInstance(t,e){if(rn.has(e)){const t=po(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),s=(un(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Li(t,e)}build(t,e,n,r){Rn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Jn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;on(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}renderInstance(t,e,n,r){Kn(t,e,n,r)}}class ol extends rl{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(rn.has(e)){const t=po(e);return t&&t.default||0}return e=Xn.has(e)?e:Gn(e),t.getAttribute(e)}measureInstanceViewportBox(){return ui()}scrapeMotionValuesFromProps(t,e){return Qn(t,e)}build(t,e,n,r){zn(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Yn(t,e,0,r)}mount(t){this.isSVGTag=Wn(t.tagName),super.mount(t)}}const il=(t,e)=>tn(t)?new ol(e,{enableHardwareAcceleration:!1}):new sl(e,{enableHardwareAcceleration:!0}),al={...Ho,...kr,...Na,layout:{ProjectionNode:ja,MeasureLayout:Fi}},ll=Je(((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...tn(t)?ar:lr,preloadedFeatures:n,useRender:qn(e),createVisualElement:r,Component:t}}(t,e,al,il))),cl=({value:e,className:n,onChange:r,onKeyDown:s,disabled:o,placeholder:i})=>{const a=(0,t.useRef)(null),[l,c]=(0,t.useState)("auto");return(0,t.useLayoutEffect)((()=>{const t=document.createElement("textarea");t.value=e||i,t.rows=1;const n=window.getComputedStyle(a.current);["paddingTop","paddingBottom","paddingLeft","paddingRight","width","fontFamily","fontSize","borderWidth"].forEach((e=>t.style[e]=n[e])),Object.assign(t.style,{position:"absolute",left:"-9999px"}),document.body.appendChild(t),c(`${t.scrollHeight}px`),document.body.removeChild(t)}),[e,i]),(0,t.useEffect)((()=>{const t=a.current;if(!t)return;if(document.activeElement===t)return;const e=t.value.length;t.focus(),t.setSelectionRange(e,e)}),[e]),(0,t.createElement)(Oe,null,(0,t.createElement)(ll.div,{key:"input",animate:{height:l},transition:{duration:.2},style:{lineHeight:0}},(0,t.createElement)("label",{htmlFor:"draft-ai-textarea",className:"sr-only"},i),(0,t.createElement)("textarea",{ref:a,id:"draft-ai-textarea",disabled:o,className:n,value:e,rows:1,onChange:r,onKeyDown:s,onScroll:t=>{t.target.scrollTop=0},placeholder:i})))},ul=({inputText:n,setInputText:r,ready:s,setReady:i,setPrompt:a,loading:l})=>{const c=t=>{t.preventDefault(),s&&!l&&(a({text:n,promptType:"create",systemMessageKey:"generate"}),r(""),i(!1))};return(0,t.createElement)("form",{className:"relative flex items-start",onSubmit:c},(0,t.createElement)(Gt,{icon:Yt,className:"text-design-main fill-current w-5 h-5 absolute left-2 top-3"}),(0,t.createElement)(cl,{disabled:l,placeholder:l?(0,o.__)("AI is writing...","extendify-local"):(0,o.__)("Ask AI to generate text","extendify-local"),value:n,className:"bg-transparent border-none shadow-none w-full h-full px-10 py-3 overflow-hidden resize-none",onChange:t=>{r(t.target.value),i(t.target.value.length>0)},onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||(t.preventDefault(),c(t))}}),l&&(0,t.createElement)("div",{className:"text-gray-700 absolute right-4 w-4 h-4 p-1 mt-2.5"},(0,t.createElement)(e.Spinner,{style:{margin:"0"}})),!l&&(0,t.createElement)("button",{type:"submit",disabled:!s,"aria-label":(0,o.__)("Submit","extendify-local"),className:de()("bg-transparent border-none absolute right-2 p-0 mt-2.5",{"cursor-pointer text-gray-700 hover:text-design-main":s,"text-gray-500":!s})},(0,t.createElement)(Gt,{icon:ue,onClick:c,className:"fill-current w-6 h-6"})))},hl=({prompt:n,completion:r,loading:s,setPrompt:i,setInputText:l})=>{const{toggleHighlight:c,toggleInsertionPoint:u}=ae(),{insertBlocks:h,replaceBlocks:d}=(0,a.useDispatch)("core/block-editor"),p=(0,a.useSelect)((t=>t("core/block-editor").getSelectedBlock()),[]),m=(0,a.useSelect)((t=>t("core/block-editor").getSelectedBlockClientIds()),[]),{getBlockRootClientId:f,getBlockIndex:g,getBlock:y}=(0,a.useSelect)((t=>t("core/block-editor")),[]),v=(t,e)=>{const n=y(e);return t.map((t=>({...t,name:n.name,attributes:{...n.attributes,content:t.attributes.content}})))},x=({replaceContent:t=!1})=>{i({text:"",promptType:"",systemMessageKey:""});const e=p?p?.clientId:m[0];let n=(t=>{let e=(0,Zt.pasteHandler)({plainText:t});return Array.isArray(e)||(e=[(0,Zt.createBlock)("core/paragraph",{content:e})]),e})(r);if(p&&""===p?.attributes?.content&&(t=!0),t)n=v(n,e),d(m,n);else if(e){const t=f(e),r=g(m.at(-1),t);t&&(n=v(n,e)),h(n,r+1,t)}else h(n)},w=t=>{l(""),i({text:r,promptType:t,systemMessageKey:"edit"})};return(0,t.useEffect)((()=>()=>{c(m,{isHighlighted:!1})}),[m,c]),(0,t.createElement)(e.MenuGroup,null,(0,t.createElement)(e.MenuItem,{onClick:()=>x({replaceContent:!0}),onMouseEnter:()=>c(m,{isHighlighted:!0}),onMouseLeave:()=>c(m,{isHighlighted:!1}),disabled:s||(()=>{const t=p||y(m[0]);return!t||void 0===t?.attributes?.content})()},(0,t.createElement)(Gt,{icon:ne,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Replace selected block text","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>x({replaceContent:!1}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),disabled:s},(0,t.createElement)(Gt,{icon:ee,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Insert below","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>w("make-shorter"),disabled:s,className:"group"},(0,t.createElement)(Gt,{icon:Qt,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,o.__)("Make shorter","extendify-local")),(0,t.createElement)(e.MenuItem,{onClick:()=>w("make-longer"),disabled:s,className:"group"},(0,t.createElement)(Gt,{icon:Xt,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Make longer","extendify-local"))),(0,t.createElement)(e.__experimentalDivider,null),(0,t.createElement)(e.MenuItem,{onClick:()=>{l(""),i({text:"",promptType:"",systemMessageKey:""}),setTimeout((()=>i(n)))},disabled:s},(0,t.createElement)(Gt,{icon:re,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Try again","extendify-local"))),(0,t.createElement)(e.MenuItem,{onClick:()=>{l(""),i({text:"",promptType:"",systemMessageKey:""})},disabled:s},(0,t.createElement)(Gt,{icon:se,className:"shrink-0 fill-current w-5 h-5 mr-2"}),(0,t.createElement)("span",{className:"whitespace-normal text-left"},(0,o.__)("Discard","extendify-local"))))},dl=["nonce","api"],pl={...Object.fromEntries(Object.entries(window.extDraftData).filter((([t])=>!dl.includes(t))))},ml=()=>{var n;const[r,s]=(0,t.useState)(""),[i,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)({text:"",promptType:"",systemMessageKey:""}),{completion:h,loading:d,error:p}=((e,n,r)=>{const[s,i]=(0,t.useState)(""),[a,l]=(0,t.useState)(null),[c,u]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{let t,s=!1;const a=new TextDecoder;return e?((async()=>{i(""),l(!1),u(!0);const c=await(async(t,e,n)=>{const r=await fetch("https://ai.extendify.com/api/draft/completion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,promptType:e,systemMessageKey:n,...pl})});if(!r.ok){if(429===r.status)throw new Error((0,o.__)("Service temporarily unavailable","extendify-local"));throw new Error(`Server error: ${r.status}`)}return r})(e,n,r);t=c.body.getReader();let h=!1;for(;!h;){const{value:e,done:n}=await t.read();if(h=n,e&&!s){const t=a.decode(e);i((e=>e+t))}}})().finally((()=>{s||u(!1)})).catch((t=>{s||l(t)})),()=>{s=!0,t&&t.cancel()}):(u(!1),i(""),void(s=!0))}),[e,r,n]),{completion:s,error:a,loading:c}})(c.text,c.promptType,c.systemMessageKey),m=(0,a.useSelect)((t=>t("core/block-editor").getSelectedBlockClientIds()),[]),{getBlock:f}=(0,a.useSelect)((t=>t("core/block-editor")),[]),{userId:g,showAIConsent:y,consentTermsUrl:v,userGaveConsent:x}=window.extDraftData,[w,E]=(0,t.useState)("1"===x),b=y&&!w;(0,t.useEffect)((()=>{const t=t=>{b||u(t.detail)};return window.addEventListener("extendify-draft:set-prompt",t),()=>window.removeEventListener("extendify-draft:set-prompt",t)}),[b]),(0,t.useEffect)((()=>{p&&s(c.text)}),[p,c.text]);const P=()=>{if(0===m.length)return!1;const t=f(m[0]);return!!t&&void 0!==t?.attributes?.content&&""!==t?.attributes?.content};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(e.Panel,null,(0,t.createElement)(e.PanelBody,null,(0,t.createElement)("div",{className:"rounded-sm border-none bg-gray-100 overflow-hidden mb-4"},(0,t.createElement)(ul,{inputText:r,setInputText:s,ready:i,setReady:l,setPrompt:u,loading:d}),h&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("hr",{className:"mx-5 my-0 border-gray-300"}),(0,t.createElement)(qt,{completion:h})),p&&(0,t.createElement)("div",{className:"px-4 mb-4 mt-2"},(0,t.createElement)("p",{className:"m-0 text-xs font-semibold text-red-500"},p.message))),(h||d)&&!p&&(0,t.createElement)(hl,{prompt:c,completion:h,setPrompt:u,setInputText:s,loading:d}),!d&&!h&&P()&&(0,t.createElement)(e.BaseControl,{label:(0,o.__)("Edit or review","extendify-local")},(0,t.createElement)(le,{completion:h,disabled:d,setInputText:s,setPrompt:u})),!d&&!h&&!P()&&(0,t.createElement)(e.BaseControl,{label:(0,o.__)("Draft with AI","extendify-local")},(0,t.createElement)(ie,{disabled:d,setInputText:s,setReady:l})),b&&(0,t.createElement)("div",{className:"bg-black/75 rounded w-full h-full p-6 absolute inset-0 items-center justify-center"},(0,t.createElement)("div",{className:"bg-white p-4 rounded"},(0,t.createElement)("h2",{className:"text-lg mt-0 mb-2"},(0,o.__)("Terms of Use","extendify-local")),(0,t.createElement)("p",{className:"m-0"},
// translators: at the end of the sentence, there is a link to the terms of use
(0,o.__)("In order to use the AI-powered content drafting tool, you must agree to the terms of use. For more information, click on this link:","extendify-local")," ",(0,t.createElement)("a",{href:v,target:"_blank",rel:"noreferrer"},(0,o.__)("Terms of Use","extendify-local"))),(0,t.createElement)("button",{className:"mt-4 bg-wp-theme-500 text-white rounded px-4 py-2 border-0 text-center w-full cursor-pointer",type:"button",onClick:()=>(async()=>{var t;E(!0),window.extDraftData.userGaveConsent="1",await(t=g,$t.post("draft/update-user-meta",{user:t,option:"extendify_ai_consent",value:!0}))})()},(0,o.__)("Accept","extendify-local")))))),window.extendifyData?.devbuild&&(0,t.createElement)(e.Panel,null,(0,t.createElement)(e.PanelBody,{title:"Debug",initialOpen:!1},(0,t.createElement)("label",null,"prompt text:"),(0,t.createElement)("pre",{className:"whitespace-pre-wrap"},c.text),(0,t.createElement)("label",null,"prompt system message:"),(0,t.createElement)("pre",{className:"whitespace-pre-wrap"},c.systemMessageKey),(0,t.createElement)("label",null,"completion:"),(0,t.createElement)("pre",{className:"whitespace-pre-wrap"},h),(0,t.createElement)("label",null,"error:"),(0,t.createElement)("pre",{className:"whitespace-pre-wrap"},null!==(n=p?.message)&&void 0!==n?n:""),(0,t.createElement)("label",null,"loading: ",d?(0,t.createElement)("span",null,"true"):(0,t.createElement)("span",null,"false")))))};var fl=window.wp.blockEditor,gl=(0,t.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(ce.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})),yl=(0,t.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(ce.Path,{d:"M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"})),vl=(0,t.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(ce.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})),xl=(0,t.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(ce.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"}));const wl=["core/paragraph","core/list-item","core/verse","core/preformatted","core/heading"],El=(n,s)=>{const{clientId:i}=s,{getBlockName:l,getBlock:c}=(0,a.useSelect)((t=>t(fl.store))),{getActiveGeneralSidebarName:u}=(0,a.useSelect)((t=>t(r.store))),{openGeneralSidebar:h}=(0,a.useDispatch)(r.store);if(!wl.includes(l(i)))return(0,t.createElement)(n,{...s});const d=c(i)?.attributes?.content||"",p=()=>h("extendify-draft/draft"),m=t=>window.dispatchEvent(new CustomEvent("extendify-draft:set-prompt",{detail:t}));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n,{...s}),(0,t.createElement)(fl.BlockControls,null,(0,t.createElement)(e.ToolbarGroup,{className:"extendify-draft"},(0,t.createElement)(e.Dropdown,{renderContent:({onClose:e})=>(0,t.createElement)(bl,{text:d,closePopup:e,openDraft:p,updatePrompt:m}),renderToggle:({isOpen:n,onToggle:r})=>(0,t.createElement)(e.Button,{onClick:()=>{if(!d)return"extendify-draft/draft"===u()?h("edit-post/block"):p();r()},"aria-expanded":n,"aria-haspopup":"true",icon:Yt},(0,o.__)("Ask AI","extendify-local"))}))))},bl=({text:n,closePopup:r,openDraft:s,updatePrompt:i})=>{const a=[{label:(0,o.__)("Improve writing","extendify-local"),promptType:"improve-writing",systemMessageKey:"edit",icon:(0,t.createElement)(Gt,{icon:gl}),disabled:()=>!1},{label:(0,o.__)("Fix spelling & grammar","extendify-local"),promptType:"fix-spelling-grammar",systemMessageKey:"edit",icon:(0,t.createElement)(Gt,{icon:yl}),disabled:()=>!1},{label:(0,o.__)("Simplify language","extendify-local"),promptType:"simplify-language",systemMessageKey:"edit",icon:(0,t.createElement)(Gt,{icon:vl}),disabled:()=>!1},{label:(0,o.__)("Make shorter","extendify-local"),promptType:"make-shorter",systemMessageKey:"edit",icon:(0,t.createElement)(Gt,{icon:oe}),disabled:()=>!1},{label:(0,o.__)("Make longer","extendify-local"),promptType:"make-longer",systemMessageKey:"edit",icon:(0,t.createElement)(Gt,{icon:xl}),disabled:()=>!1}];return(0,t.createElement)(e.NavigableMenu,{orientation:"vertical",role:"menu",style:{minWidth:"200px"}},(0,t.createElement)(e.MenuGroup,{className:"extendify-draft",label:(0,t.createElement)("div",{className:"flex items-center gap-2"},(0,t.createElement)(Gt,{className:"fill-gray-900",size:16,icon:Yt}),(0,o.__)("Prompt AI to...","extendify-local"))},a.map((({label:o,promptType:a,systemMessageKey:l,disabled:c,icon:u})=>(0,t.createElement)(e.MenuItem,{key:`${a}-${a}-${l}`,style:{width:"100%"},isSelected:!1,disabled:c(),iconPosition:"left",icon:u,variant:void 0,onClick:()=>{s?.(),r?.(),window.requestAnimationFrame((()=>window.requestAnimationFrame((()=>i({text:n,promptType:a,systemMessageKey:l})))))}},o)))))};(0,i.registerPlugin)("extendify-draft",{render:()=>(0,t.createElement)(Pl,null,(0,t.createElement)(r.PluginSidebarMoreMenuItem,{target:"draft"},(0,o.__)("Draft","extendify-local")),(0,t.createElement)(r.PluginSidebar,{name:"draft",icon:Yt,title:(0,o.__)("AI Tools","extendify-local"),className:"extendify-draft h-full"},(0,t.createElement)(e.Flex,{direction:"column",expanded:!0,justify:"space-between"},(0,t.createElement)(e.FlexBlock,null,(0,t.createElement)(ml,null)))))});const Pl=({children:t})=>t;(0,s.addFilter)("editor.BlockEdit","extendify-draft/draft",(t=>e=>El(t,e)))}()}();


??

??