/*! For license information please see edit.js.LICENSE.txt */ (self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[8739],{5750:function(e,t,n){"use strict";var o={};n.r(o),n.d(o,{hasBrowserEnv:function(){return he},hasStandardBrowserEnv:function(){return ge},hasStandardBrowserWebWorkerEnv:function(){return ve},navigator:function(){return me},origin:function(){return be}});var r=n(1609),i=n(5338),s=n(6942),a=n.n(s),c=window.wp.i18n,l=window.wp.url;function u(e,t){return function(){return e.apply(t,arguments)}}const{toString:d}=Object.prototype,{getPrototypeOf:p}=Object,f=(h=Object.create(null),e=>{const t=d.call(e);return h[t]||(h[t]=t.slice(8,-1).toLowerCase())});var h;const m=e=>(e=e.toLowerCase(),t=>f(t)===e),g=e=>t=>typeof t===e,{isArray:v}=Array,b=g("undefined"),y=m("ArrayBuffer"),w=g("string"),x=g("function"),S=g("number"),E=e=>null!==e&&"object"==typeof e,O=e=>{if("object"!==f(e))return!1;const t=p(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},_=m("Date"),C=m("File"),j=m("Blob"),k=m("FileList"),R=m("URLSearchParams"),[I,A,P,T]=["ReadableStream","Request","Response","Headers"].map(m);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),v(e))for(o=0,r=e.length;o0;)if(o=n[r],t===o.toLowerCase())return o;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,M=e=>!b(e)&&e!==L,F=(V="undefined"!=typeof Uint8Array&&p(Uint8Array),e=>V&&e instanceof V);var V;const U=m("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),H=m("RegExp"),$=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};N(n,((n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)})),Object.defineProperties(e,o)},z=m("AsyncFunction"),W=(q="function"==typeof setImmediate,G=x(L.postMessage),q?setImmediate:G?((e,t)=>(L.addEventListener("message",(({source:n,data:o})=>{n===L&&o===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),L.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var q,G;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||W;var K={isArray:v,isArrayBuffer:y,isBuffer:function(e){return null!==e&&!b(e)&&null!==e.constructor&&!b(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=f(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:w,isNumber:S,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:O,isReadableStream:I,isRequest:A,isResponse:P,isHeaders:T,isUndefined:b,isDate:_,isFile:C,isBlob:j,isRegExp:H,isFunction:x,isStream:e=>E(e)&&x(e.pipe),isURLSearchParams:R,isTypedArray:F,isFileList:k,forEach:N,merge:function e(){const{caseless:t}=M(this)&&this||{},n={},o=(o,r)=>{const i=t&&D(n,r)||r;O(n[i])&&O(o)?n[i]=e(n[i],o):O(o)?n[i]=e({},o):v(o)?n[i]=o.slice():n[i]=o};for(let e=0,t=arguments.length;e(N(t,((t,o)=>{n&&x(t)?e[o]=u(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,i,s;const a={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)s=r[i],o&&!o(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&p(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:m,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!S(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:U,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:$,freezeMethods:e=>{$(e,((t,n)=>{if(x(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];x(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return v(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:D,global:L,isContextDefined:M,isSpecCompliantForm:function(e){return!!(e&&x(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=v(e)?[]:{};return N(e,((e,t)=>{const i=n(e,o+1);!b(i)&&(r[t]=i)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn:z,isThenable:e=>e&&(E(e)||x(e))&&x(e.then)&&x(e.catch),setImmediate:W,asap:J};function X(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status?r.status:null)}K.inherits(X,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:K.toJSONObject(this.config),code:this.code,status:this.status}}});const Y=X.prototype,Z={};["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((e=>{Z[e]={value:e}})),Object.defineProperties(X,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),X.from=(e,t,n,o,r,i)=>{const s=Object.create(Y);return K.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),X.call(s,e.message,t,n,o,r),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};var Q=X;function ee(e){return K.isPlainObject(e)||K.isArray(e)}function te(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function ne(e,t,n){return e?e.concat(t).map((function(e,t){return e=te(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const oe=K.toFlatObject(K,{},null,(function(e){return/^is[A-Z]/.test(e)}));var re=function(e,t,n){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!K.isUndefined(t[e])}))).metaTokens,r=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(!a&&K.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(K.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(K.isArray(e)&&function(e){return K.isArray(e)&&!e.some(ee)}(e)||(K.isFileList(e)||K.endsWith(n,"[]"))&&(a=K.toArray(e)))return n=te(n),a.forEach((function(e,o){!K.isUndefined(e)&&null!==e&&t.append(!0===s?ne([n],o,i):null===s?n:n+"[]",c(e))})),!1;return!!ee(e)||(t.append(ne(r,n,i),c(e)),!1)}const u=[],d=Object.assign(oe,{defaultVisitor:l,convertValue:c,isVisitable:ee});if(!K.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!K.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),K.forEach(n,(function(n,i){!0===(!(K.isUndefined(n)||null===n)&&r.call(t,n,K.isString(i)?i.trim():i,o,d))&&e(n,o?o.concat(i):[i])})),u.pop()}}(e),t};function ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function se(e,t){this._pairs=[],e&&re(e,this,t)}const ae=se.prototype;ae.append=function(e,t){this._pairs.push([e,t])},ae.toString=function(e){const t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ce=se;function le(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ue(e,t,n){if(!t)return e;const o=n&&n.encode||le;K.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(i=r?r(t,n):K.isURLSearchParams(t)?t.toString():new ce(t,n).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}var de=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},pe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ce,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const he="undefined"!=typeof window&&"undefined"!=typeof document,me="object"==typeof navigator&&navigator||void 0,ge=he&&(!me||["ReactNative","NativeScript","NS"].indexOf(me.product)<0),ve="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,be=he&&window.location.href||"http://localhost";var ye={...o,...fe},we=function(e){function t(e,n,o,r){let i=e[r++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=r>=e.length;return i=!i&&K.isArray(o)?o.length:i,a?(K.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!s):(o[i]&&K.isObject(o[i])||(o[i]=[]),t(e,n,o[i],r)&&K.isArray(o[i])&&(o[i]=function(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o{t(function(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,n,0)})),n}return null};const xe={transitional:pe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=K.isObject(e);if(r&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return o?JSON.stringify(we(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return re(e,new ye.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return ye.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=K.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return re(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),function(e){if(K.isString(e))try{return(0,JSON.parse)(e),K.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||xe.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],(e=>{xe.headers[e]={}}));var Se=xe;const Ee=K.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"]),Oe=Symbol("internals");function _e(e){return e&&String(e).trim().toLowerCase()}function Ce(e){return!1===e||null==e?e:K.isArray(e)?e.map(Ce):String(e)}function je(e,t,n,o,r){return K.isFunction(o)?o.call(this,t,n):(r&&(t=n),K.isString(t)?K.isString(o)?-1!==t.indexOf(o):K.isRegExp(o)?o.test(t):void 0:void 0)}class ke{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=_e(t);if(!r)throw new Error("header name must be a non-empty string");const i=K.findKey(o,r);(!i||void 0===o[i]||!0===n||void 0===n&&!1!==o[i])&&(o[i||t]=Ce(e))}const i=(e,t)=>K.forEach(e,((e,n)=>r(e,n,t)));if(K.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(K.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&Ee[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t})(e),t);else if(K.isHeaders(e))for(const[t,o]of e.entries())r(o,t,n);else null!=e&&r(t,e,n);return this}get(e,t){if(e=_e(e)){const n=K.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=_e(e)){const n=K.findKey(this,e);return!(!n||void 0===this[n]||t&&!je(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=_e(e)){const r=K.findKey(n,e);!r||t&&!je(0,n[r],r,t)||(delete n[r],o=!0)}}return K.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!je(0,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return K.forEach(this,((o,r)=>{const i=K.findKey(n,r);if(i)return t[i]=Ce(o),void delete t[r];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();s!==r&&delete t[r],t[s]=Ce(o),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return K.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&K.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Oe]=this[Oe]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=_e(e);t[o]||(function(e,t){const n=K.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}(n,e),t[o]=!0)}return K.isArray(e)?e.forEach(o):o(e),this}}ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(ke.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),K.freezeMethods(ke);var Re=ke;function Ie(e,t){const n=this||Se,o=t||n,r=Re.from(o.headers);let i=o.data;return K.forEach(e,(function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)})),r.normalize(),i}function Ae(e){return!(!e||!e.__CANCEL__)}function Pe(e,t,n){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError"}K.inherits(Pe,Q,{__CANCEL__:!0});var Te=Pe;function Ne(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const De=(e,t,n=3)=>{let o=0;const r=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=o[s];r||(r=c),n[i]=a,o[i]=c;let u=s,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-r{r=i,n=null,o&&(clearTimeout(o),o=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-r;a>=i?s(e,t):(n=e,o||(o=setTimeout((()=>{o=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-o,c=r(a);o=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Le=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},Me=e=>(...t)=>K.asap((()=>e(...t)));var Fe=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Ve=ye.hasStandardBrowserEnv?{write(e,t,n,o,r,i){const s=[e+"="+encodeURIComponent(t)];K.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),K.isString(o)&&s.push("path="+o),K.isString(r)&&s.push("domain="+r),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ue(e,t,n){let o=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(o||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=e=>e instanceof Re?{...e}:e;function He(e,t){t=t||{};const n={};function o(e,t,n,o){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:o},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function r(e,t,n,r){return K.isUndefined(t)?K.isUndefined(e)?void 0:o(void 0,e,0,r):o(e,t,0,r)}function i(e,t){if(!K.isUndefined(t))return o(void 0,t)}function s(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function a(n,r,i){return i in t?o(n,r):i in e?o(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>r(Be(e),Be(t),0,!0)};return K.forEach(Object.keys(Object.assign({},e,t)),(function(o){const i=c[o]||r,s=i(e[o],t[o],o);K.isUndefined(s)&&i!==a||(n[o]=s)})),n}var $e=e=>{const t=He({},e);let n,{data:o,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=Re.from(a),t.url=ue(Ue(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),K.isFormData(o))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(ye.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(t)),r||!1!==r&&Fe(t.url))){const e=i&&s&&Ve.read(s);e&&a.set(i,e)}return t},ze="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const o=$e(e);let r=o.data;const i=Re.from(o.headers).normalize();let s,a,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=o;function h(){l&&l(),u&&u(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const o=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ne((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:o,config:e,request:m}),m=null}m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Q("Request aborted",Q.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Q("Network Error",Q.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const r=o.transitional||pe;o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new Q(t,r.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,m)),m=null},void 0===r&&i.setContentType(null),"setRequestHeader"in m&&K.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),K.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),d&&"json"!==d&&(m.responseType=o.responseType),f&&([c,u]=De(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,l]=De(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=t=>{m&&(n(!t||t.type?new Te(null,e,m):t),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(o.url);v&&-1===ye.protocols.indexOf(v)?n(new Q("Unsupported protocol "+v+":",Q.ERR_BAD_REQUEST,e)):m.send(r||null)}))},We=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController;const r=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;o.abort(t instanceof Q?t:new Te(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,r(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)})),e=null)};e.forEach((e=>e.addEventListener("abort",r)));const{signal:a}=o;return a.unsubscribe=()=>K.asap(s),a}};const qe=function*(e,t){let n=e.byteLength;if(!t||n{const r=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*qe(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await r.next();if(t)return a(),void e.close();let i=o.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw a(e),e}},cancel(e){return a(e),r.return()}},{highWaterMark:2})},Je="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ke=Je&&"function"==typeof ReadableStream,Xe=Je&&("function"==typeof TextEncoder?(Ye=new TextEncoder,e=>Ye.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Ye;const Ze=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Qe=Ke&&Ze((()=>{let e=!1;const t=new Request(ye.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),et=Ke&&Ze((()=>K.isReadableStream(new Response("").body))),tt={stream:et&&(e=>e.body)};var nt;Je&&(nt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!tt[e]&&(tt[e]=K.isFunction(nt[e])?t=>t[e]():(t,n)=>{throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})})));var ot=Je&&(async e=>{let{url:t,method:n,data:o,signal:r,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=$e(e);l=l?(l+"").toLowerCase():"text";let f,h=We([r,i&&i.toAbortSignal()],s);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(c&&Qe&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=K.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(K.isBlob(e))return e.size;if(K.isSpecCompliantForm(e)){const t=new Request(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e)?(await Xe(e)).byteLength:void 0)})(t):n})(u,o))){let e,n=new Request(t,{method:"POST",body:o,duplex:"half"});if(K.isFormData(o)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Le(g,De(Me(c)));o=Ge(n.body,65536,e,t)}}K.isString(d)||(d=d?"include":"omit");const r="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:o,duplex:"half",credentials:r?d:void 0});let i=await fetch(f);const s=et&&("stream"===l||"response"===l);if(et&&(a||s&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=K.toFiniteNumber(i.headers.get("content-length")),[n,o]=a&&Le(t,De(Me(a),!0))||[];i=new Response(Ge(i.body,65536,n,(()=>{o&&o(),m&&m()})),e)}l=l||"text";let v=await tt[K.findKey(tt,l)||"text"](i,e);return!s&&m&&m(),await new Promise(((t,n)=>{Ne(t,n,{data:v,headers:Re.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,f),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,f)}});const rt={http:null,xhr:ze,fetch:ot};K.forEach(rt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const it=e=>`- ${e}`,st=e=>K.isFunction(e)||null===e||!1===e;var at=e=>{e=K.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(it).join("\n"):" "+it(e[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return o};function ct(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function lt(e){return ct(e),e.headers=Re.from(e.headers),e.data=Ie.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),at(e.adapter||Se.adapter)(e).then((function(t){return ct(e),t.data=Ie.call(e,e.transformResponse,t),t.headers=Re.from(t.headers),t}),(function(t){return Ae(t)||(ct(e),t&&t.response&&(t.response.data=Ie.call(e,e.transformResponse,t.response),t.response.headers=Re.from(t.response.headers))),Promise.reject(t)}))}const ut={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ut[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const dt={};ut.transitional=function(e,t,n){function o(e,t){return"[Axios v1.8.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new Q(o(r," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!dt[r]&&(dt[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},ut.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var pt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new Q("option "+i+" must be "+n,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}},validators:ut};const ft=pt.validators;class ht{constructor(e){this.defaults=e,this.interceptors={request:new de,response:new de}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=He(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;void 0!==n&&pt.assertOptions(n,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),null!=o&&(K.isFunction(o)?t.paramsSerializer={serialize:o}:pt.assertOptions(o,{encode:ft.function,serialize:ft.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pt.assertOptions(t,{baseUrl:ft.spelling("baseURL"),withXsrfToken:ft.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=r&&K.merge(r.common,r[t.method]);r&&K.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=Re.concat(i,r);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[lt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new Te(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new gt((function(t){e=t})),cancel:e}}}var vt=gt;const bt={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(bt).forEach((([e,t])=>{bt[t]=e}));var yt=bt;const wt=function e(t){const n=new mt(t),o=u(mt.prototype.request,n);return K.extend(o,mt.prototype,n,{allOwnKeys:!0}),K.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(He(t,n))},o}(Se);wt.Axios=mt,wt.CanceledError=Te,wt.CancelToken=vt,wt.isCancel=Ae,wt.VERSION="1.8.4",wt.toFormData=re,wt.AxiosError=Q,wt.Cancel=wt.CanceledError,wt.all=function(e){return Promise.all(e)},wt.spread=function(e){return function(t){return e.apply(null,t)}},wt.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},wt.mergeConfig=He,wt.AxiosHeaders=Re,wt.formToJSON=e=>we(K.isHTMLForm(e)?new FormData(e):e),wt.getAdapter=at,wt.HttpStatusCode=yt,wt.default=wt;var xt=wt;const St=e=>{const t=(0,r.createContext)(void 0);return[t,()=>{const n=(0,r.useContext)(t);if(void 0===n)throw Error(`use${e} can only be used within a ${e} context provider.`);return n}]},Et=(e,t)=>t===e.charAt(e.length-1)?e.slice(0,-1):e;var Ot,_t;Et(null!==(Ot=window.CODE_SNIPPETS?.restAPI.base)&&void 0!==Ot?Ot:"","/");const Ct=Et(null!==(_t=window.CODE_SNIPPETS?.restAPI.snippets)&&void 0!==_t?_t:"","/"),jt={headers:{"X-WP-Nonce":window.CODE_SNIPPETS?.restAPI.nonce,"Access-Control":window.CODE_SNIPPETS?.restAPI.localToken}},kt={php:["global","admin","front-end","single-use"],html:["content","head-content","footer-content"],css:["admin-css","site-css"],js:["site-head-js","site-footer-js"],cond:["condition"]},Rt=()=>window.pagenow.endsWith("-network"),It=()=>null!==/mac/i.exec(window.navigator.userAgent),At=()=>!!window.CODE_SNIPPETS?.isLicensed,Pt={id:0,name:"",code:"",desc:"",scope:"global",modified:"",active:!1,network:Rt(),shared_network:null,priority:10,conditionId:0},Tt=e=>"number"==typeof e&&0(e=>{var t;const n={...Pt,tags:[]};return"object"!=typeof e||null===e?n:{...n,..."id"in e&&Tt(e.id)&&{id:e.id},..."name"in e&&"string"==typeof e.name&&{name:e.name},..."desc"in e&&"string"==typeof e.desc&&{desc:e.desc},..."code"in e&&"string"==typeof e.code&&{code:e.code},..."tags"in e&&{tags:null!==(r=e.tags,t=Array.isArray(r)?r.filter((e=>"string"==typeof e)):void 0)&&void 0!==t?t:n.tags},..."scope"in e&&(o=e.scope,"string"==typeof o&&Object.values(kt).some((e=>e.some((e=>e===o)))))&&{scope:e.scope},..."modified"in e&&"string"==typeof e.modified&&{modified:e.modified},..."active"in e&&"boolean"==typeof e.active&&{active:e.active},..."network"in e&&"boolean"==typeof e.network&&{network:e.network},..."shared_network"in e&&"boolean"==typeof e.shared_network&&{shared_network:e.shared_network},..."priority"in e&&"number"==typeof e.priority&&{priority:e.priority},..."condition_id"in e&&Tt(e.condition_id)&&{conditionId:e.condition_id}};var o,r})(e),Lt=({scope:e})=>{switch(!0){case e.endsWith("-css"):return"css";case e.endsWith("-js"):return"js";case e.endsWith("content"):return"html";case"condition"===e:return"cond";default:return"php"}},Mt=e=>"condition"===e.scope,Ft=e=>Nt.has(e),Vt=({id:e,network:t},n)=>(0,l.addQueryArgs)([Ct,e,n].filter(Boolean).join("/"),{network:!!t||void 0}),Ut=({name:e,desc:t,code:n,tags:o,scope:r,priority:i,active:s,network:a,shared_network:c,conditionId:l})=>({name:e,desc:t,code:n,tags:o,scope:r,priority:i,active:s,network:a,shared_network:c,condition_id:l});var Bt=n(4848);const Ht=async(e,t,n,o)=>{console.debug(`${e} ${t}`,...o?[o]:[]);const r=await n;return console.debug("Response",r),r.data},[$t,zt]=St("RestAPI"),Wt=({children:e})=>{const t=(0,r.useMemo)((()=>xt.create(jt)),[]),n=(0,r.useMemo)((()=>(e=>({get:t=>Ht("GET",t,e.get(t)),post:(t,n)=>Ht("POST",t,e.post(t,n),n),del:t=>Ht("DELETE",t,e.delete(t)),put:(t,n)=>Ht("PUT",t,e.put(t,n),n)}))(t)),[t]),o=(0,r.useMemo)((()=>(({get:e,post:t,del:n,put:o})=>({fetchAll:t=>e((0,l.addQueryArgs)(Ct,{network:t})).then((e=>e.map(Dt))),fetch:(t,n)=>e((0,l.addQueryArgs)(`${Ct}/${t}`,{network:n})).then(Dt),create:e=>t(Ct,Ut(e)).then(Dt),update:e=>t(e.id?Vt(e):Ct,Ut(e)).then(Dt),delete:e=>n(Vt(e)),activate:e=>t(Vt(e,"activate")).then(Dt),deactivate:e=>t(Vt(e,"deactivate")).then(Dt),export:t=>e(Vt(t,"export")),exportCode:t=>e(Vt(t,"export-code")),attach:e=>o(Vt(e,"attach"),{condition_id:e.conditionId}),detach:e=>o(Vt(e,"detach"))}))(n)),[n]),i={api:n,snippetsAPI:o,axiosInstance:t};return(0,Bt.jsx)($t.Provider,{value:i,children:e})},[qt,Gt]=St("SnippetsList"),Jt=({children:e})=>{const{snippetsAPI:{fetchAll:t}}=zt(),[n,o]=(0,r.useState)(),i=(0,r.useCallback)((async()=>{try{console.info("Fetching snippets list");const e=await t(Rt());o(e)}catch(e){console.error("Error fetching snippets list",e)}}),[t]);(0,r.useEffect)((()=>{i().catch((()=>{}))}),[i]);const s={snippetsList:n,refreshSnippetsList:i};return(0,Bt.jsx)(qt.Provider,{value:s,children:e})},{Axios:Kt,AxiosError:Xt,CanceledError:Yt,isCancel:Zt,CancelToken:Qt,VERSION:en,all:tn,Cancel:nn,isAxiosError:on,spread:rn,toFormData:sn,AxiosHeaders:an,HttpStatusCode:cn,formToJSON:ln,getAdapter:un,mergeConfig:dn}=xt,[pn,fn]=St("SnippetForm"),hn=({children:e,initialSnippet:t})=>{const[n,o]=(0,r.useState)(t),[i,s]=(0,r.useState)(!1),[a,c]=(0,r.useState)(),[l,u]=(0,r.useState)(),d=(0,r.useMemo)((()=>!At()&&(e=>Nt.has(Lt(e)))({scope:n.scope})),[n.scope]),p=(0,r.useCallback)(((e,t)=>{console.error("Request failed",e),s(!1),c(["error",[t,on(e)?e.message:""].filter(Boolean).join(" ")])}),[s,c]),f=(0,r.useCallback)((e=>{o((t=>{const n="object"==typeof e?e:e(t);return l?.codemirror.setValue(n.code),window.tinymce?.activeEditor.setContent(n.desc),n}))}),[l?.codemirror]),h={snippet:n,isWorking:i,isReadOnly:d,setSnippet:o,setIsWorking:s,updateSnippet:f,currentNotice:a,setCurrentNotice:c,codeEditorInstance:l,handleRequestError:p,setCodeEditorInstance:u};return(0,Bt.jsx)(pn.Provider,{value:h,children:e})},mn={addNew:(0,c.__)("Add New Snippet","code-snippets"),edit:(0,c.__)("Edit Snippet","code-snippets"),created:(0,c.__)("Snippet created.","code-snippets"),updated:(0,c.__)("Snippet updated.","code-snippets"),createdActivated:(0,c.__)("Snippet created and activated.","code-snippets"),updatedActivated:(0,c.__)("Snippet updated and activated.","code-snippets"),updatedDeactivated:(0,c.__)("Snippet updated and deactivated"),updatedExecuted:(0,c.__)("Snippet updated and executed.","code-snippets"),failedCreate:(0,c.__)("Could not create snippet.","code-snippets"),failedUpdate:(0,c.__)("Could not update snippet.","code-snippets")},gn=(0,c.__)("Condition created.","code-snippets"),vn=(0,c.__)("Condition updated.","code-snippets"),bn={addNew:(0,c.__)("Add New Condition","code-snippets"),edit:(0,c.__)("Edit Condition","code-snippets"),created:gn,updated:vn,createdActivated:gn,updatedActivated:vn,updatedDeactivated:vn,updatedExecuted:vn,failedCreate:(0,c.__)("Could not create condition.","code-snippets"),failedUpdate:(0,c.__)("Could not update condition.","code-snippets")};let yn=function(e){return e.SAVE="save_snippet",e.SAVE_AND_ACTIVATE="save_snippet_activate",e.SAVE_AND_EXECUTE="save_snippet_execute",e.SAVE_AND_DEACTIVATE="save_snippet_deactivate",e}({});const wn=(e,t,n)=>{const o="condition"===e.scope?bn:mn,r=0===e.id;switch(n){case yn.SAVE:return r?o.created:o.updated;case yn.SAVE_AND_EXECUTE:return o.updatedExecuted;case yn.SAVE_AND_ACTIVATE:return"single-use"===t.scope?o.updatedExecuted:r?o.createdActivated:o.updatedActivated;case yn.SAVE_AND_DEACTIVATE:return o.updatedDeactivated}},xn={[yn.SAVE]:{},[yn.SAVE_AND_ACTIVATE]:{active:!0},[yn.SAVE_AND_DEACTIVATE]:{active:!1},[yn.SAVE_AND_EXECUTE]:{active:!0}},Sn=()=>{const{snippetsAPI:e}=zt(),{setIsWorking:t,setCurrentNotice:n,snippet:o,setSnippet:i}=fn();return{submitSnippet:(0,r.useCallback)((async(r=yn.SAVE)=>{n(void 0);const s=await(async()=>{try{const n={...o,...xn[r]},i=await(0===n.id?e.create(n):e.update(n));return t(!1),i.id?i:void 0}catch(e){return t(!1),on(e)?e.message:void 0}})(),a=Mt(o)?bn:mn;if(void 0!==s&&"string"!=typeof s)return i(Dt(s)),n(["updated",wn(o,s,r)]),o.id&&s.id&&(window.document.title=window.document.title.replace(mn.addNew,a.edit),window.history.replaceState({},"",(0,l.addQueryArgs)(window.CODE_SNIPPETS?.urls.edit,{id:s.id}))),s;{const e=[o.id?a.failedUpdate:a.failedCreate,null!=s?s:(0,c.__)("The server did not send a valid response.","code-snippets")];n(["error",e.filter(Boolean).join(" ")])}}),[e,t,n,o,i])}},En=e=>{console.error(e)};var On=window.wp.components;const _n=({open:e,title:t,onConfirm:n,onCancel:o,children:r,confirmLabel:i=(0,c.__)("OK","code-snippets"),cancelLabel:s=(0,c.__)("Cancel","code-snippets"),confirmButtonClassName:a})=>e?(0,Bt.jsxs)(On.Modal,{title:t,onRequestClose:o,closeButtonLabel:s,isDismissible:!0,onKeyDown:e=>{"Enter"===e.key&&n?.()},children:[r,(0,Bt.jsxs)(On.Flex,{direction:"row",justify:"flex-end",children:[(0,Bt.jsx)(On.Button,{variant:"tertiary",onClick:o,children:s}),(0,Bt.jsx)(On.Button,{variant:"primary",onClick:n,className:a,children:i})]})]}):null;var Cn=window.wp.element;const jn=({isOpen:e,setIsOpen:t})=>e?(0,Bt.jsxs)(On.Modal,{title:"",className:"code-snippets-upsell-dialog",onRequestClose:()=>{t(!1)},children:[(0,Bt.jsx)("img",{src:`${window.CODE_SNIPPETS?.urls.plugin}/assets/icon.svg`,alt:(0,c.__)("Code Snippets logo","code-snippets")}),(0,Bt.jsx)("h1",{children:(0,Cn.createInterpolateElement)((0,c.__)("Unlock all cloud sync features and many more, with Code Snippets Pro","code-snippets"),{span:(0,Bt.jsx)("span",{})})}),(0,Bt.jsx)("p",{children:(0,Cn.createInterpolateElement)((0,c.__)("With Code Snippets Pro you can connect your WordPress sites to the code snippets cloud platform and be able to backup, synchronise, collaborate, and deploy your snippets from one central location.","code-snippets"),{strong:(0,Bt.jsx)("strong",{})})}),(0,Bt.jsx)("a",{href:"https://codesnippets.pro/pricing/",className:"button button-primary button-large",rel:"noreferrer",target:"_blank",children:(0,c.__)("Explore Code Snippets Pro","code-snippets")}),(0,Bt.jsx)("h2",{children:(0,c.__)("Here's what else you get with Pro:","code-snippets")}),(0,Bt.jsxs)("ul",{children:[(0,Bt.jsx)("li",{children:(0,c.__)("Create, explain and verify snippets with AI","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Control when snippets run with Conditions","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("CSS stylesheet snippets","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Minified JavaScript snippets","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Editor blocks and Elementor widgets","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Cloud sync and backup","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Cloud share and deploy","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("Cloud bundles and teams","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("WP-CLI commands","code-snippets")}),(0,Bt.jsx)("li",{children:(0,c.__)("And much more!","code-snippets")})]})]}):null,kn={cond:"randomize",cloud:"cloud",bundles:"screenoptions",cloud_search:"search"},Rn=({name:e,small:t,inverted:n,children:o})=>(0,Bt.jsx)("span",{className:a()("badge",`${e}-badge`,{"small-badge":t,"inverted-badge":n}),children:kn[e]?(0,Bt.jsx)("span",{className:`dashicons dashicons-${kn[e]}`}):null!=o?o:e}),In=({id:e,children:t,className:n,name:o,primary:r=!1,secondary:i=!1,small:s=!1,large:c=!1,link:l=!1,type:u="button",onClick:d,...p})=>(0,Bt.jsx)("button",{id:null!=e?e:o,name:o,type:u,...p,onClick:e=>{d&&(e.preventDefault(),d(e))},className:a()("button",n,{"button-primary":r,"button-secondary":i,"button-large":c,"button-small":s,"button-link":l}),children:t}),An=({setIsDialogOpen:e})=>{const{snippet:t,isReadOnly:n}=fn(),o=0!==t.conditionId;return(0,Bt.jsx)("div",{className:a()("conditions-editor-open block-form-field",o?"has-condition":"no-condition"),children:Mt(t)?null:(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsxs)("h4",{children:[(0,c.__)("Conditions","code-snippets"),(0,Bt.jsx)(Rn,{name:"beta",small:!0,children:(0,c.__)("beta","code-snippets")}),!At()&&(0,Bt.jsx)(Rn,{name:"pro",small:!0,children:(0,c.__)("Pro","code-snippets")})]}),(0,Bt.jsxs)(In,{large:!0,disabled:n,onClick:()=>e(!0),children:[(0,Bt.jsx)(Rn,{name:"cond",small:!0}),o?(0,c.__)("Edit Conditions","code-snippets"):(0,c.__)("Add Conditions","code-snippets")]})]})})};function Pn(e){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pn(e)}function Tn(e){var t=function(e){if("object"!=Pn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pn(t)?t:t+""}function Nn(e,t,n){return(t=Tn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ln(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0?to(po,--lo):0,ao--,10===uo&&(ao=1,so--),uo}function go(){return uo=lo2||wo(uo)>3?"":" "}function _o(e,t){for(;--t&&go()&&!(uo<48||uo>102||uo>57&&uo<65||uo>70&&uo<97););return yo(e,bo()+(t<6&&32==vo()&&32==go()))}function Co(e){for(;go();)switch(uo){case e:return lo;case 34:case 39:34!==e&&39!==e&&Co(uo);break;case 40:41===e&&Co(e);break;case 92:go()}return lo}function jo(e,t){for(;go()&&e+uo!==57&&(e+uo!==84||47!==vo()););return"/*"+yo(t,lo-1)+"*"+Xn(47===e?e:go())}function ko(e){for(;!wo(vo());)go();return yo(e,lo)}var Ro="-ms-",Io="-moz-",Ao="-webkit-",Po="comm",To="rule",No="decl",Do="@keyframes";function Lo(e,t){for(var n="",o=ro(e),r=0;r0&&oo(E)-d&&io(f>32?Ho(E+";",o,n,d-1):Ho(Qn(E," ","")+";",o,n,d-2),c);break;case 59:E+=";";default:if(io(S=Uo(E,t,n,l,u,r,a,y,w=[],x=[],d),i),123===b)if(0===u)Vo(E,t,S,S,w,i,d,a,x);else switch(99===p&&110===to(E,3)?100:p){case 100:case 108:case 109:case 115:Vo(e,S,S,o&&io(Uo(e,S,S,0,0,r,a,y,r,w=[],d),x),r,x,d,a,o?w:x);break;default:Vo(E,S,S,S,[""],x,0,a,x)}}l=u=f=0,m=v=1,y=E="",d=s;break;case 58:d=1+oo(E),f=h;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==mo())continue;switch(E+=Xn(b),b*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[l++]=(oo(E)-1)*v,v=1;break;case 64:45===vo()&&(E+=Eo(go())),p=vo(),u=d=oo(y=E+=ko(bo())),b++;break;case 45:45===h&&2==oo(E)&&(m=0)}}return i}function Uo(e,t,n,o,r,i,s,a,c,l,u){for(var d=r-1,p=0===r?i:[""],f=ro(p),h=0,m=0,g=0;h0?p[v]+" "+b:Qn(b,/&\f/g,p[v])))&&(c[g++]=y);return fo(e,t,n,0===r?To:a,c,l,u)}function Bo(e,t,n){return fo(e,t,n,Po,Xn(uo),no(e,2,-2),0)}function Ho(e,t,n,o){return fo(e,t,n,No,no(e,0,o),no(e,o+1,-1),o)}var $o=function(e,t,n){for(var o=0,r=0;o=r,r=vo(),38===o&&12===r&&(t[n]=1),!wo(r);)go();return yo(e,lo)},zo=new WeakMap,Wo=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||zo.get(n))&&!o){zo.set(e,!0);for(var r=[],i=function(e,t){return So(function(e,t){var n=-1,o=44;do{switch(wo(o)){case 0:38===o&&12===vo()&&(t[n]=1),e[n]+=$o(lo-1,t,n);break;case 2:e[n]+=Eo(o);break;case 4:if(44===o){e[++n]=58===vo()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Xn(o)}}while(o=go());return e}(xo(e),t))}(t,r),s=n.props,a=0,c=0;a6)switch(to(e,t+1)){case 109:if(45!==to(e,t+4))break;case 102:return Qn(e,/(.+:)(.+)-([^]+)/,"$1"+Ao+"$2-$3$1"+Io+(108==to(e,t+3)?"$3":"$2-$3"))+e;case 115:return~eo(e,"stretch")?Go(Qn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==to(e,t+1))break;case 6444:switch(to(e,oo(e)-3-(~eo(e,"!important")&&10))){case 107:return Qn(e,":",":"+Ao)+e;case 101:return Qn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ao+(45===to(e,14)?"inline-":"")+"box$3$1"+Ao+"$2$3$1"+Ro+"$2box$3")+e}break;case 5936:switch(to(e,t+11)){case 114:return Ao+e+Ro+Qn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ao+e+Ro+Qn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ao+e+Ro+Qn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ao+e+Ro+e+e}return e}var Jo=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case No:e.return=Go(e.value,e.length);break;case Do:return Lo([ho(e,{value:Qn(e.value,"@","@"+Ao)})],o);case To:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Lo([ho(e,{props:[Qn(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return Lo([ho(e,{props:[Qn(t,/:(plac\w+)/,":"+Ao+"input-$1")]}),ho(e,{props:[Qn(t,/:(plac\w+)/,":-moz-$1")]}),ho(e,{props:[Qn(t,/:(plac\w+)/,Ro+"input-$1")]})],o)}return""}))}}],Ko=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,r,i=e.stylisPlugins||Jo,s={},a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+c;return{name:l,styles:r,next:cr}}var dr,pr,fr=!!r.useInsertionEffect&&r.useInsertionEffect,hr=fr||function(e){return e()},mr=(fr||r.useLayoutEffect,r.createContext("undefined"!=typeof HTMLElement?Ko({key:"css"}):null)),gr=(mr.Provider,function(e){return(0,r.forwardRef)((function(t,n){var o=(0,r.useContext)(mr);return e(t,o,n)}))}),vr=r.createContext({}),br={}.hasOwnProperty,yr="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",wr=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Xo(t,n,o),hr((function(){return function(e,t,n){Xo(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)})),null},xr=gr((function(e,t,n){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var i=e[yr],s=[o],a="";"string"==typeof e.className?a=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(o+=n+" ")})),o}(t.registered,s,e.className):null!=e.className&&(a=e.className+" ");var c=ur(s,void 0,r.useContext(vr));a+=t.key+"-"+c.name;var l={};for(var u in e)br.call(e,u)&&"css"!==u&&u!==yr&&(l[u]=e[u]);return l.className=a,n&&(l.ref=n),r.createElement(r.Fragment,null,r.createElement(wr,{cache:t,serialized:c,isStringTag:"string"==typeof i}),r.createElement(i,l))})),Sr=xr,Er=(n(4146),function(e,t){var n=arguments;if(null==t||!br.call(t,"css"))return r.createElement.apply(void 0,n);var o=n.length,i=new Array(o);i[0]=Sr,i[1]=function(e,t){var n={};for(var o in t)br.call(t,o)&&(n[o]=t[o]);return n[yr]=e,n}(e,t);for(var s=2;s({x:e,y:e});function Ar(e){return Nr(e)?(e.nodeName||"").toLowerCase():"#document"}function Pr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Tr(e){var t;return null==(t=(Nr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Nr(e){return e instanceof Node||e instanceof Pr(e).Node}function Dr(e){return e instanceof Element||e instanceof Pr(e).Element}function Lr(e){return e instanceof HTMLElement||e instanceof Pr(e).HTMLElement}function Mr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Pr(e).ShadowRoot)}function Fr(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Vr(e){return Pr(e).getComputedStyle(e)}function Ur(e){const t=function(e){if("html"===Ar(e))return e;const t=e.assignedSlot||e.parentNode||Mr(e)&&e.host||Tr(e);return Mr(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(Ar(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lr(t)&&Fr(t)?t:Ur(t)}function Br(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Ur(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),s=Pr(r);return i?t.concat(s,s.visualViewport||[],Fr(r)?r:[],s.frameElement&&n?Br(s.frameElement):[]):t.concat(r,Br(r,[],n))}function Hr(e){return Dr(e)?e:e.contextElement}function $r(e){const t=Hr(e);if(!Lr(t))return Ir(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=function(e){const t=Vr(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Lr(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=kr(n)!==i||kr(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}(t);let s=(i?kr(n.width):n.width)/o,a=(i?kr(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const zr=Ir(0);function Wr(e){const t=Pr(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zr}function qr(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Hr(e);let s=Ir(1);t&&(o?Dr(o)&&(s=$r(o)):s=$r(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Pr(e))&&t}(i,n,o)?Wr(i):Ir(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const e=Pr(i),t=o&&Dr(o)?Pr(o):o;let n=e.frameElement;for(;n&&o&&t!==e;){const e=$r(n),t=n.getBoundingClientRect(),o=Vr(n),r=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=r,l+=i,n=Pr(n).frameElement}}return p={width:u,height:d,x:c,y:l},{...p,top:p.y,left:p.x,right:p.x+p.width,bottom:p.y+p.height};var p}var Gr=r.useLayoutEffect,Jr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Kr=function(){};function Xr(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Yr(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r-1}function ni(e){return ti(e)?window.pageYOffset:e.scrollTop}function oi(e,t){ti(e)?window.scrollTo(0,t):e.scrollTop=t}function ri(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Kr,r=ni(e),i=t-r,s=0;!function t(){var a,c=i*((a=(a=s+=10)/n-1)*a*a+1)+r;oi(e,c),sn.bottom?oi(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):o.top-r=h)return{placement:"bottom",maxHeight:t};if(O>=h&&!s)return i&&ri(c,_,j),{placement:"bottom",maxHeight:t};if(!s&&O>=o||s&&S>=o)return i&&ri(c,_,j),{placement:"bottom",maxHeight:s?S-y:O-y};if("auto"===r||s){var k=t,R=s?x:E;return R>=o&&(k=Math.min(R-y-a,t)),{placement:"top",maxHeight:k}}if("bottom"===r)return i&&oi(c,_),{placement:"bottom",maxHeight:t};break;case"top":if(x>=h)return{placement:"top",maxHeight:t};if(E>=h&&!s)return i&&ri(c,C,j),{placement:"top",maxHeight:t};if(!s&&E>=o||s&&x>=o){var I=t;return(!s&&E>=o||s&&x>=o)&&(I=s?x-w:E-w),i&&ri(c,C,j),{placement:"top",maxHeight:I}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return l}({maxHeight:o,menuEl:e,minHeight:n,placement:i,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:v});f(r.maxHeight),g(r.placement),null==l||l(r.placement)}}),[o,i,s,a,n,l,v]),t({ref:u,placerProps:Ln(Ln({},e),{},{placement:m||bi(i),maxHeight:p})})},xi=function(e,t){var n=e.theme,o=n.spacing.baseUnit,r=n.colors;return Ln({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*o,"px ").concat(3*o,"px")})},Si=xi,Ei=xi,Oi=["size"],_i=["innerProps","isRtl","size"],Ci={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ji=function(e){var t=e.size,n=Un(e,Oi);return Er("svg",Hn({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ci},n))},ki=function(e){return Er(ji,Hn({size:20},e),Er("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Ri=function(e){return Er(ji,Hn({size:20},e),Er("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Ii=function(e,t){var n=e.isFocused,o=e.theme,r=o.spacing.baseUnit,i=o.colors;return Ln({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*r,":hover":{color:n?i.neutral80:i.neutral40}})},Ai=Ii,Pi=Ii,Ti=function(){var e=Or.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(mi||(gi=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],vi||(vi=gi.slice(0)),mi=Object.freeze(Object.defineProperties(gi,{raw:{value:Object.freeze(vi)}})))),Ni=function(e){var t=e.delay,n=e.offset;return Er("span",{css:Or({animation:"".concat(Ti," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Di=["data"],Li=["innerRef","isDisabled","isHidden","inputClassName"],Mi={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Fi={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ln({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Mi)},Vi=function(e){return Ln({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Mi)},Ui=function(e){var t=e.children,n=e.innerProps;return Er("div",n,t)},Bi={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Er("div",Hn({},ei(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Er(ki,null))},Control:function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,r=e.innerRef,i=e.innerProps,s=e.menuIsOpen;return Er("div",Hn({ref:r},ei(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":o,"control--menu-is-open":s}),i,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Er("div",Hn({},ei(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Er(Ri,null))},DownChevron:Ri,CrossIcon:ki,Group:function(e){var t=e.children,n=e.cx,o=e.getStyles,r=e.getClassNames,i=e.Heading,s=e.headingProps,a=e.innerProps,c=e.label,l=e.theme,u=e.selectProps;return Er("div",Hn({},ei(e,"group",{group:!0}),a),Er(i,Hn({},s,{selectProps:u,theme:l,getStyles:o,getClassNames:r,cx:n}),c),Er("div",null,t))},GroupHeading:function(e){var t=Qr(e);t.data;var n=Un(t,Di);return Er("div",Hn({},ei(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Er("div",Hn({},ei(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Er("span",Hn({},t,ei(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,o=Qr(e),r=o.innerRef,i=o.isDisabled,s=o.isHidden,a=o.inputClassName,c=Un(o,Li);return Er("div",Hn({},ei(e,"input",{"input-container":!0}),{"data-value":n||""}),Er("input",Hn({className:t({input:!0},a),ref:r,style:Vi(s),disabled:i},c)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,o=e.size,r=void 0===o?4:o,i=Un(e,_i);return Er("div",Hn({},ei(Ln(Ln({},i),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Er(Ni,{delay:0,offset:n}),Er(Ni,{delay:160,offset:!0}),Er(Ni,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,o=e.innerProps;return Er("div",Hn({},ei(e,"menu",{menu:!0}),{ref:n},o),t)},MenuList:function(e){var t=e.children,n=e.innerProps,o=e.innerRef,r=e.isMulti;return Er("div",Hn({},ei(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:o},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,o=e.controlElement,i=e.innerProps,s=e.menuPlacement,a=e.menuPosition,c=(0,r.useRef)(null),l=(0,r.useRef)(null),u=Vn((0,r.useState)(bi(s)),2),d=u[0],p=u[1],f=(0,r.useMemo)((function(){return{setPortalPlacement:p}}),[]),h=Vn((0,r.useState)(null),2),m=h[0],g=h[1],v=(0,r.useCallback)((function(){if(o){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),t="fixed"===a?0:window.pageYOffset,n=e[d]+t;n===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||g({offset:n,rect:e})}}),[o,a,d,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);Gr((function(){v()}),[v]);var b=(0,r.useCallback)((function(){"function"==typeof l.current&&(l.current(),l.current=null),o&&c.current&&(l.current=function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=Hr(e),u=r||i?[...l?Br(l):[],...Br(t)]:[];u.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&a?function(e,t){let n,o=null;const r=Tr(e);function i(){clearTimeout(n),o&&o.disconnect(),o=null}return function s(a,c){void 0===a&&(a=!1),void 0===c&&(c=1),i();const{left:l,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-Rr(u)+"px "+-Rr(r.clientWidth-(l+d))+"px "+-Rr(r.clientHeight-(u+p))+"px "+-Rr(l)+"px",threshold:jr(0,Cr(1,c))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}h=!1}try{o=new IntersectionObserver(m,{...f,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(m,f)}o.observe(e)}(!0),i}(l,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{h&&h.observe(t)}))),n()})),l&&!c&&h.observe(l),h.observe(t));let m=c?qr(e):null;return c&&function t(){const o=qr(e);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||n(),m=o,p=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),d&&d(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}(o,c.current,v,{elementResize:"ResizeObserver"in window}))}),[o,v]);Gr((function(){b()}),[b]);var y=(0,r.useCallback)((function(e){c.current=e,b()}),[b]);if(!t&&"fixed"!==a||!m)return null;var w=Er("div",Hn({ref:y},ei(Ln(Ln({},e),{},{offset:m.offset,position:a,rect:m.rect}),"menuPortal",{"menu-portal":!0}),i),n);return Er(yi.Provider,{value:f},t?(0,_r.createPortal)(w,t):w)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,o=e.innerProps,r=Un(e,hi);return Er("div",Hn({},ei(Ln(Ln({},r),{},{children:n,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,o=e.innerProps,r=Un(e,fi);return Er("div",Hn({},ei(Ln(Ln({},r),{},{children:n,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),n)},MultiValue:function(e){var t=e.children,n=e.components,o=e.data,r=e.innerProps,i=e.isDisabled,s=e.removeProps,a=e.selectProps,c=n.Container,l=n.Label,u=n.Remove;return Er(c,{data:o,innerProps:Ln(Ln({},ei(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),r),selectProps:a},Er(l,{data:o,innerProps:Ln({},ei(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),Er(u,{data:o,innerProps:Ln(Ln({},ei(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:a}))},MultiValueContainer:Ui,MultiValueLabel:Ui,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Er("div",Hn({role:"button"},n),t||Er(ki,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,r=e.isSelected,i=e.innerRef,s=e.innerProps;return Er("div",Hn({},ei(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":o,"option--is-selected":r}),{ref:i,"aria-disabled":n},s),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Er("div",Hn({},ei(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,o=e.isDisabled,r=e.isRtl;return Er("div",Hn({},ei(e,"container",{"--is-disabled":o,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,o=e.innerProps;return Er("div",Hn({},ei(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),o),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,o=e.isMulti,r=e.hasValue;return Er("div",Hn({},ei(e,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":r}),n),t)}},Hi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function $i(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(o,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,o=e.options,r=e.label,i=void 0===r?"":r,s=e.selectValue,a=e.isDisabled,c=e.isSelected,l=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&s)return"value ".concat(i," focused, ").concat(u(s,n),".");if("menu"===t&&l){var d=a?" disabled":"",p="".concat(c?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(o,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Gi=function(e){var t=e.ariaSelection,n=e.focusedOption,o=e.focusedValue,i=e.focusableOptions,s=e.isFocused,a=e.selectValue,c=e.selectProps,l=e.id,u=e.isAppleDevice,d=c.ariaLiveMessages,p=c.getOptionLabel,f=c.inputValue,h=c.isMulti,m=c.isOptionDisabled,g=c.isSearchable,v=c.menuIsOpen,b=c.options,y=c.screenReaderStatus,w=c.tabSelectsValue,x=c.isLoading,S=c["aria-label"],E=c["aria-live"],O=(0,r.useMemo)((function(){return Ln(Ln({},qi),d||{})}),[d]),_=(0,r.useMemo)((function(){var e,n="";if(t&&O.onChange){var o=t.option,r=t.options,i=t.removedValue,s=t.removedValues,c=t.value,l=i||o||(e=c,Array.isArray(e)?null:e),u=l?p(l):"",d=r||s||void 0,f=d?d.map(p):[],h=Ln({isDisabled:l&&m(l,a),label:u,labels:f},t);n=O.onChange(h)}return n}),[t,O,m,a,p]),C=(0,r.useMemo)((function(){var e="",t=n||o,r=!!(n&&a&&a.includes(n));if(t&&O.onFocus){var s={focused:t,label:p(t),isDisabled:m(t,a),isSelected:r,options:i,context:t===n?"menu":"value",selectValue:a,isAppleDevice:u};e=O.onFocus(s)}return e}),[n,o,p,m,O,i,a,u]),j=(0,r.useMemo)((function(){var e="";if(v&&b.length&&!x&&O.onFilter){var t=y({count:i.length});e=O.onFilter({inputValue:f,resultsMessage:t})}return e}),[i,f,v,O,b,y,x]),k="initial-input-focus"===(null==t?void 0:t.action),R=(0,r.useMemo)((function(){var e="";if(O.guidance){var t=o?"value":v?"menu":"input";e=O.guidance({"aria-label":S,context:t,isDisabled:n&&m(n,a),isMulti:h,isSearchable:g,tabSelectsValue:w,isInitialFocus:k})}return e}),[S,n,o,h,m,g,v,O,a,w,k]),I=Er(r.Fragment,null,Er("span",{id:"aria-selection"},_),Er("span",{id:"aria-focused"},C),Er("span",{id:"aria-results"},j),Er("span",{id:"aria-guidance"},R));return Er(r.Fragment,null,Er(Wi,{id:l},k&&I),Er(Wi,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!k&&I))},Ji=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Ki=new RegExp("["+Ji.map((function(e){return e.letters})).join("")+"]","g"),Xi={},Yi=0;Yi1?t-1:0),o=1;o0,m=d-p-l,g=!1;m>t&&a.current&&(o&&o(e),a.current=!1),h&&c.current&&(s&&s(e),c.current=!1),h&&t>m?(n&&!a.current&&n(e),f.scrollTop=d,g=!0,a.current=!0):!h&&-t>l&&(i&&!c.current&&i(e),f.scrollTop=0,g=!0,c.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}}),[n,o,i,s]),p=(0,r.useCallback)((function(e){d(e,e.deltaY)}),[d]),f=(0,r.useCallback)((function(e){l.current=e.changedTouches[0].clientY}),[]),h=(0,r.useCallback)((function(e){var t=l.current-e.changedTouches[0].clientY;d(e,t)}),[d]),m=(0,r.useCallback)((function(e){if(e){var t=!!ui&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",h,t)}}),[h,f,p]),g=(0,r.useCallback)((function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",h,!1))}),[h,f,p]);return(0,r.useEffect)((function(){if(t){var e=u.current;return m(e),function(){g(e)}}}),[t,m,g]),function(e){u.current=e}}({isEnabled:void 0===o||o,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),s=function(e){var t=e.isEnabled,n=e.accountForScrollbars,o=void 0===n||n,i=(0,r.useRef)({}),s=(0,r.useRef)(null),a=(0,r.useCallback)((function(e){if(ps){var t=document.body,n=t&&t.style;if(o&&ss.forEach((function(e){var t=n&&n[e];i.current[e]=t})),o&&fs<1){var r=parseInt(i.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+r||0;Object.keys(as).forEach((function(e){var t=as[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&ds()&&(t.addEventListener("touchmove",cs,hs),e&&(e.addEventListener("touchstart",us,hs),e.addEventListener("touchmove",ls,hs))),fs+=1}}),[o]),c=(0,r.useCallback)((function(e){if(ps){var t=document.body,n=t&&t.style;fs=Math.max(fs-1,0),o&&fs<1&&ss.forEach((function(e){var t=i.current[e];n&&(n[e]=t)})),t&&ds()&&(t.removeEventListener("touchmove",cs,hs),e&&(e.removeEventListener("touchstart",us,hs),e.removeEventListener("touchmove",ls,hs)))}}),[o]);return(0,r.useEffect)((function(){if(t){var e=s.current;return a(e),function(){c(e)}}}),[t,a,c]),function(e){s.current=e}}({isEnabled:n});return Er(r.Fragment,null,n&&Er("div",{onClick:ms,css:gs}),t((function(e){i(e),s(e)})))}var bs={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ys=function(e){var t=e.name,n=e.onFocus;return Er("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:bs,value:"",onChange:function(){}})};function ws(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function xs(){return ws(/^Mac/i)}var Ss={clearIndicator:Pi,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,o=e.isFocused,r=e.theme,i=r.colors,s=r.borderRadius;return Ln({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:o?i.primary:i.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:o?i.primary:i.neutral30}})},dropdownIndicator:Ai,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,o=n.colors,r=n.spacing;return Ln({label:"group",cursor:"default",display:"block"},t?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,o=e.theme,r=o.spacing.baseUnit,i=o.colors;return Ln({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,o=e.value,r=e.theme,i=r.spacing,s=r.colors;return Ln(Ln({visibility:n?"hidden":"visible",transform:o?"translateZ(0)":""},Fi),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:s.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,o=e.size,r=e.theme,i=r.colors,s=r.spacing.baseUnit;return Ln({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*s})},loadingMessage:Ei,menu:function(e,t){var n,o=e.placement,r=e.theme,i=r.borderRadius,s=r.spacing,a=r.colors;return Ln((Nn(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(o),"100%"),Nn(n,"position","absolute"),Nn(n,"width","100%"),Nn(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var n=e.maxHeight,o=e.theme.spacing.baseUnit;return Ln({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:o,paddingTop:o})},menuPortal:function(e){var t=e.rect,n=e.offset,o=e.position;return{left:t.left,position:o,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,o=n.spacing,r=n.borderRadius,i=n.colors;return Ln({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:r/2,margin:o.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,o=n.borderRadius,r=n.colors,i=e.cropWithEllipsis;return Ln({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:o/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,o=n.spacing,r=n.borderRadius,i=n.colors,s=e.isFocused;return Ln({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:s?i.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:Si,option:function(e,t){var n=e.isDisabled,o=e.isFocused,r=e.isSelected,i=e.theme,s=i.spacing,a=i.colors;return Ln({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?a.primary:o?a.primary25:"transparent",color:n?a.neutral20:r?a.neutral0:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,o=n.spacing,r=n.colors;return Ln({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,o=e.theme,r=o.spacing,i=o.colors;return Ln({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,o=e.isMulti,r=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Ln({alignItems:"center",display:o&&r&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Es={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Os={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:si(),captureMenuScroll:!si(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=Ln({ignoreCase:!0,ignoreAccents:!0,stringify:os,trim:!0,matchFrom:"any"},undefined),o=n.ignoreCase,r=n.ignoreAccents,i=n.stringify,s=n.trim,a=n.matchFrom,c=s?ns(t):t,l=s?ns(i(e)):i(e);return o&&(c=c.toLowerCase(),l=l.toLowerCase()),r&&(c=ts(c),l=es(l)),"start"===a?l.substr(0,c.length)===c:l.indexOf(c)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function _s(e,t,n,o){return{type:"option",data:t,isDisabled:Ts(e,t,n),isSelected:Ns(e,t,n),label:As(e,t),value:Ps(e,t),index:o}}function Cs(e,t){return e.options.map((function(n,o){if("options"in n){var r=n.options.map((function(n,o){return _s(e,n,t,o)})).filter((function(t){return Rs(e,t)}));return r.length>0?{type:"group",data:n,options:r,index:o}:void 0}var i=_s(e,n,t,o);return Rs(e,i)?i:void 0})).filter(di)}function js(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Gn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function ks(e,t){return e.reduce((function(e,n){return"group"===n.type?e.push.apply(e,Gn(n.options.map((function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}})))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e}),[])}function Rs(e,t){var n=e.inputValue,o=void 0===n?"":n,r=t.data,i=t.isSelected,s=t.label,a=t.value;return(!Ls(e)||!i)&&Ds(e,{label:s,value:a,data:r},o)}var Is=function(e,t){var n;return(null===(n=e.find((function(e){return e.data===t})))||void 0===n?void 0:n.id)||null},As=function(e,t){return e.getOptionLabel(t)},Ps=function(e,t){return e.getOptionValue(t)};function Ts(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Ns(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var o=Ps(e,t);return n.some((function(t){return Ps(e,t)===o}))}function Ds(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ls=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Ms=1,Fs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zn(e,t)}(n,e);var t=function(e){var t=qn();return function(){var n,o=Wn(e);if(t){var r=Wn(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"==Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(o=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=xs()||ws(/^iPhone/i)||ws(/^iPad/i)||xs()&&navigator.maxTouchPoints>1,o.controlRef=null,o.getControlRef=function(e){o.controlRef=e},o.focusedOptionRef=null,o.getFocusedOptionRef=function(e){o.focusedOptionRef=e},o.menuListRef=null,o.getMenuListRef=function(e){o.menuListRef=e},o.inputRef=null,o.getInputRef=function(e){o.inputRef=e},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(e,t){var n=o.props,r=n.onChange,i=n.name;t.name=i,o.ariaOnChange(e,t),r(e,t)},o.setValue=function(e,t,n){var r=o.props,i=r.closeMenuOnSelect,s=r.isMulti,a=r.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:a}),i&&(o.setState({inputIsHiddenAfterUpdate:!s}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(e,{action:t,option:n})},o.selectOption=function(e){var t=o.props,n=t.blurInputOnSelect,r=t.isMulti,i=t.name,s=o.state.selectValue,a=r&&o.isOptionSelected(e,s),c=o.isOptionDisabled(e,s);if(a){var l=o.getOptionValue(e);o.setValue(s.filter((function(e){return o.getOptionValue(e)!==l})),"deselect-option",e)}else{if(c)return void o.ariaOnChange(e,{action:"select-option",option:e,name:i});r?o.setValue([].concat(Gn(s),[e]),"select-option",e):o.setValue(e,"select-option")}n&&o.blurInput()},o.removeValue=function(e){var t=o.props.isMulti,n=o.state.selectValue,r=o.getOptionValue(e),i=n.filter((function(e){return o.getOptionValue(e)!==r})),s=pi(t,i,i[0]||null);o.onChange(s,{action:"remove-value",removedValue:e}),o.focusInput()},o.clearValue=function(){var e=o.state.selectValue;o.onChange(pi(o.props.isMulti,[],null),{action:"clear",removedValues:e})},o.popValue=function(){var e=o.props.isMulti,t=o.state.selectValue,n=t[t.length-1],r=t.slice(0,t.length-1),i=pi(e,r,r[0]||null);n&&o.onChange(i,{action:"pop-value",removedValue:n})},o.getFocusedOptionId=function(e){return Is(o.state.focusableOptionsWithIds,e)},o.getFocusableOptionsWithIds=function(){return ks(Cs(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||i>5}},o.onTouchEnd=function(e){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(e.target)&&o.menuListRef&&!o.menuListRef.contains(e.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(e){o.userIsDragging||o.onControlMouseDown(e)},o.onClearIndicatorTouchEnd=function(e){o.userIsDragging||o.onClearIndicatorMouseDown(e)},o.onDropdownIndicatorTouchEnd=function(e){o.userIsDragging||o.onDropdownIndicatorMouseDown(e)},o.handleInputChange=function(e){var t=o.props.inputValue,n=e.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(n,{action:"input-change",prevInputValue:t}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(e){o.props.onFocus&&o.props.onFocus(e),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(e){var t=o.props.inputValue;o.menuListRef&&o.menuListRef.contains(document.activeElement)?o.inputRef.focus():(o.props.onBlur&&o.props.onBlur(e),o.onInputChange("",{action:"input-blur",prevInputValue:t}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1}))},o.onOptionHover=function(e){if(!o.blockOptionHover&&o.state.focusedOption!==e){var t=o.getFocusableOptions().indexOf(e);o.setState({focusedOption:e,focusedOptionId:t>-1?o.getFocusedOptionId(e):null})}},o.shouldHideSelectedOptions=function(){return Ls(o.props)},o.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),o.focus()},o.onKeyDown=function(e){var t=o.props,n=t.isMulti,r=t.backspaceRemovesValue,i=t.escapeClearsValue,s=t.inputValue,a=t.isClearable,c=t.isDisabled,l=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=o.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!(c||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(o.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||s)return;o.focusValue("previous");break;case"ArrowRight":if(!n||s)return;o.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(m)o.removeValue(m);else{if(!r)return;n?o.popValue():a&&o.clearValue()}break;case"Tab":if(o.isComposing)return;if(e.shiftKey||!l||!d||!h||p&&o.isOptionSelected(h,g))return;o.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(l){if(!h)return;if(o.isComposing)return;o.selectOption(h);break}return;case"Escape":l?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:s}),o.onMenuClose()):a&&i&&o.clearValue();break;case" ":if(s)return;if(!l){o.openMenu("first");break}if(!h)return;o.selectOption(h);break;case"ArrowUp":l?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":l?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!l)return;o.focusOption("pageup");break;case"PageDown":if(!l)return;o.focusOption("pagedown");break;case"Home":if(!l)return;o.focusOption("first");break;case"End":if(!l)return;o.focusOption("last");break;default:return}e.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++Ms),o.state.selectValue=Zr(e.value),e.menuIsOpen&&o.state.selectValue.length){var r=o.getFocusableOptionsWithIds(),i=o.buildFocusableOptions(),s=i.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=r,o.state.focusedOption=i[s],o.state.focusedOptionId=Is(r,i[s])}return o}return function(e,t,n){t&&$n(e.prototype,t),n&&$n(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ii(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,o=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&o&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ii(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,o=n.selectValue,r=n.isFocused,i=this.buildFocusableOptions(),s="first"===e?0:i.length-1;if(!this.props.isMulti){var a=i.indexOf(o[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[s],focusedOptionId:this.getFocusedOptionId(i[s])},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,o=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(o);o||(r=-1);var i=n.length-1,s=-1;if(n.length){switch(e){case"previous":s=0===r?0:-1===r?i:r-1;break;case"next":r>-1&&r0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,o=this.getFocusableOptions();if(o.length){var r=0,i=o.indexOf(n);n||(i=-1),"up"===e?r=i>0?i-1:o.length-1:"down"===e?r=(i+1)%o.length:"pageup"===e?(r=i-t)<0&&(r=0):"pagedown"===e?(r=i+t)>o.length-1&&(r=o.length-1):"last"===e&&(r=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(o[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Es):Ln(Ln({},Es),this.props.theme):Es}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,o=this.getClassNames,r=this.getValue,i=this.selectOption,s=this.setValue,a=this.props,c=a.isMulti,l=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:o,getValue:r,hasValue:this.hasValue(),isMulti:c,isRtl:l,options:u,selectOption:i,selectProps:a,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return Ts(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Ns(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Ds(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,o=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:o})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,o=e.inputId,i=e.inputValue,s=e.tabIndex,a=e.form,c=e.menuIsOpen,l=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,f=d.ariaSelection,h=this.commonProps,m=o||this.getElementId("input"),g=Ln(Ln(Ln({"aria-autocomplete":"list","aria-expanded":c,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":l,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},c&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?r.createElement(u,Hn({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:a,type:"text",value:i},g)):r.createElement(is,Hn({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Kr,onFocus:this.onInputFocus,disabled:t,tabIndex:s,inputMode:"none",form:a,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,o=t.MultiValueContainer,i=t.MultiValueLabel,s=t.MultiValueRemove,a=t.SingleValue,c=t.Placeholder,l=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,f=u.isMulti,h=u.inputValue,m=u.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return h?null:r.createElement(c,Hn({},l,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),m);if(f)return v.map((function(t,a){var c=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return r.createElement(n,Hn({},l,{components:{Container:o,Label:i,Remove:s},isFocused:c,isDisabled:p,key:u,index:a,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var w=v[0];return r.createElement(a,Hn({},l,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,i=n.isLoading,s=this.state.isFocused;if(!this.isClearable()||!e||o||!this.hasValue()||i)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return r.createElement(e,Hn({},t,{innerProps:a,isFocused:s}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,i=n.isLoading,s=this.state.isFocused;return e&&i?r.createElement(e,Hn({},t,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:s})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var o=this.commonProps,i=this.props.isDisabled,s=this.state.isFocused;return r.createElement(n,Hn({},o,{isDisabled:i,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,o=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return r.createElement(e,Hn({},t,{innerProps:i,isDisabled:n,isFocused:o}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,o=t.GroupHeading,i=t.Menu,s=t.MenuList,a=t.MenuPortal,c=t.LoadingMessage,l=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,f=this.props,h=f.captureMenuScroll,m=f.inputValue,g=f.isLoading,v=f.loadingMessage,b=f.minMenuHeight,y=f.maxMenuHeight,w=f.menuIsOpen,x=f.menuPlacement,S=f.menuPosition,E=f.menuPortalTarget,O=f.menuShouldBlockScroll,_=f.menuShouldScrollIntoView,C=f.noOptionsMessage,j=f.onMenuScrollToTop,k=f.onMenuScrollToBottom;if(!w)return null;var R,I=function(t,n){var o=t.type,i=t.data,s=t.isDisabled,a=t.isSelected,c=t.label,l=t.value,f=p===i,h=s?void 0:function(){return e.onOptionHover(i)},m=s?void 0:function(){return e.selectOption(i)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:m,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:a};return r.createElement(u,Hn({},d,{innerProps:v,data:i,isDisabled:s,isSelected:a,key:g,label:c,type:o,value:l,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())R=this.getCategorizedOptions().map((function(t){if("group"===t.type){var i=t.data,s=t.options,a=t.index,c="".concat(e.getElementId("group"),"-").concat(a),l="".concat(c,"-heading");return r.createElement(n,Hn({},d,{key:c,data:i,options:s,Heading:o,headingProps:{id:l,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return I(e,"".concat(a,"-").concat(e.index))})))}if("option"===t.type)return I(t,"".concat(t.index))}));else if(g){var A=v({inputValue:m});if(null===A)return null;R=r.createElement(c,d,A)}else{var P=C({inputValue:m});if(null===P)return null;R=r.createElement(l,d,P)}var T={minMenuHeight:b,maxMenuHeight:y,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:_},N=r.createElement(wi,Hn({},d,T),(function(t){var n=t.ref,o=t.placerProps,a=o.placement,c=o.maxHeight;return r.createElement(i,Hn({},d,T,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:a}),r.createElement(vs,{captureEnabled:h,onTopArrive:j,onBottomArrive:k,lockEnabled:O},(function(t){return r.createElement(s,Hn({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:c,focusedOption:p}),R)})))}));return E||"fixed"===S?r.createElement(a,Hn({},d,{appendTo:E,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),N):N}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,o=t.isDisabled,i=t.isMulti,s=t.name,a=t.required,c=this.state.selectValue;if(a&&!this.hasValue()&&!o)return r.createElement(ys,{name:s,onFocus:this.onValueInputFocus});if(s&&!o){if(i){if(n){var l=c.map((function(t){return e.getOptionValue(t)})).join(n);return r.createElement("input",{name:s,type:"hidden",value:l})}var u=c.length>0?c.map((function(t,n){return r.createElement("input",{key:"i-".concat(n),name:s,type:"hidden",value:e.getOptionValue(t)})})):r.createElement("input",{name:s,type:"hidden",value:""});return r.createElement("div",null,u)}var d=c[0]?this.getOptionValue(c[0]):"";return r.createElement("input",{name:s,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,o=t.focusedOption,i=t.focusedValue,s=t.isFocused,a=t.selectValue,c=this.getFocusableOptions();return r.createElement(Gi,Hn({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:o,focusedValue:i,isFocused:s,selectValue:a,focusableOptions:c,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,o=e.SelectContainer,i=e.ValueContainer,s=this.props,a=s.className,c=s.id,l=s.isDisabled,u=s.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return r.createElement(o,Hn({},p,{className:a,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:d}),this.renderLiveRegion(),r.createElement(t,Hn({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:d,menuIsOpen:u}),r.createElement(i,Hn({},p,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),r.createElement(n,Hn({},p,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,o=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,s=t.isFocused,a=t.prevWasFocused,c=t.instancePrefix,l=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,h=Zr(u),m={};if(n&&(u!==n.value||l!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return js(Cs(e,t))}(e,h):[],v=d?ks(Cs(e,h),"".concat(c,"-option")):[],b=o?function(e,t){var n=e.focusedValue,o=e.selectValue.indexOf(n);if(o>-1){if(t.indexOf(n)>-1)return n;if(o-1?n:t[0]}(t,g);m={selectValue:h,focusedOption:y,focusedOptionId:Is(v,y),focusableOptionsWithIds:v,focusedValue:b,clearFocusValueOnUpdate:!1}}var w=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},x=i,S=s&&a;return s&&!S&&(x={value:pi(f,h,h[0]||null),options:h,action:"initial-input-focus"},S=!a),"initial-input-focus"===(null==i?void 0:i.action)&&(x=null),Ln(Ln(Ln({},m),w),{},{prevProps:e,ariaSelection:x,prevWasFocused:S})}}]),n}(r.Component);Fs.defaultProps=Os;var Vs=(0,r.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,o=e.defaultMenuIsOpen,i=void 0!==o&&o,s=e.defaultValue,a=void 0===s?null:s,c=e.inputValue,l=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,f=e.onMenuOpen,h=e.value,m=Un(e,Bn),g=Vn((0,r.useState)(void 0!==c?c:n),2),v=g[0],b=g[1],y=Vn((0,r.useState)(void 0!==l?l:i),2),w=y[0],x=y[1],S=Vn((0,r.useState)(void 0!==h?h:a),2),E=S[0],O=S[1],_=(0,r.useCallback)((function(e,t){"function"==typeof u&&u(e,t),O(e)}),[u]),C=(0,r.useCallback)((function(e,t){var n;"function"==typeof d&&(n=d(e,t)),b(void 0!==n?n:e)}),[d]),j=(0,r.useCallback)((function(){"function"==typeof f&&f(),x(!0)}),[f]),k=(0,r.useCallback)((function(){"function"==typeof p&&p(),x(!1)}),[p]),R=void 0!==c?c:v,I=void 0!==l?l:w,A=void 0!==h?h:E;return Ln(Ln({},m),{},{inputValue:R,menuIsOpen:I,onChange:_,onInputChange:C,onMenuClose:k,onMenuOpen:j,value:A})}(e);return r.createElement(Fs,Hn({ref:t},n))})),Us=Vs;const Bs={global:"admin-site",admin:"admin-tools","front-end":"admin-appearance","single-use":"clock",content:"shortcode","head-content":"editor-code","footer-content":"editor-code","admin-css":"dashboard","site-css":"admin-customizer","site-head-js":"media-code","site-footer-js":"media-code"},Hs={global:(0,c.__)("Run everywhere","code-snippets"),admin:(0,c.__)("Only run in administration area","code-snippets"),"front-end":(0,c.__)("Only run on site front-end","code-snippets"),"single-use":(0,c.__)("Only run once","code-snippets"),content:(0,c.__)("Where inserted in editor","code-snippets"),"head-content":(0,c.__)("In site section","code-snippets"),"footer-content":(0,c.__)("In site footer (end of )","code-snippets"),"site-css":(0,c.__)("Site front-end","code-snippets"),"admin-css":(0,c.__)("Administration area","code-snippets"),"site-footer-js":(0,c.__)("In site footer (end of )","code-snippets"),"site-head-js":(0,c.__)("In site section","code-snippets")},$s=()=>{const{snippet:e,setSnippet:t,isReadOnly:n}=fn(),o=kt[Lt(e)].filter((e=>"condition"!==e)).map((e=>({key:e,value:e,label:Hs[e]})));return Mt(e)?null:(0,Bt.jsxs)("div",{className:"block-form-field",children:[(0,Bt.jsx)("h4",{children:(0,Bt.jsx)("label",{htmlFor:"snippet-location",children:(0,c.__)("Location","code-snippets")})}),(0,Bt.jsx)(Us,{inputId:"snippet-location",className:"code-snippets-select code-snippets-select-location",options:o,isDisabled:n,styles:{menu:e=>({...e,zIndex:9999}),input:e=>({...e,":focus":{boxShadow:"none"}})},value:o.find((t=>t.value===e.scope)),formatOptionLabel:({label:e,value:t})=>(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("span",{className:`dashicons dashicons-${Bs[t]}`}),` ${e}`]}),onChange:e=>e?.value&&t((t=>({...t,scope:e.value})))})]})},zs=({className:e,onDismiss:t,children:n})=>(0,Bt.jsxs)("div",{id:"message",className:a()("notice fade is-dismissible",e),children:[(0,Bt.jsx)(Bt.Fragment,{children:n}),(0,Bt.jsx)("button",{type:"button",className:"notice-dismiss",onClick:e=>{e.preventDefault(),t()},children:(0,Bt.jsx)("span",{className:"screen-reader-text",children:(0,c.__)("Dismiss notice.","code-snippets")})})]}),Ws=()=>{const{currentNotice:e,setCurrentNotice:t,snippet:n,setSnippet:o}=fn();return(0,Bt.jsxs)(Bt.Fragment,{children:[e?(0,Bt.jsx)(zs,{className:e[0],onDismiss:()=>t(void 0),children:(0,Bt.jsx)("p",{children:(0,Cn.createInterpolateElement)(e[1],{strong:(0,Bt.jsx)("strong",{})})})}):null,n.code_error?(0,Bt.jsx)(zs,{className:"notice-error",onDismiss:()=>o((e=>({...e,code_error:null}))),children:(0,Bt.jsxs)("p",{children:[(0,Bt.jsx)("strong",{children:(0,c.sprintf)((0,c.__)("Snippet automatically deactivated due to an error on line %d:","code-snippets"),n.code_error[1])}),(0,Bt.jsx)("blockquote",{children:n.code_error[0]})]})}):null]})},qs=()=>(0,Bt.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Bt.jsx)("path",{d:"M12 6V4.5C12 4.10218 11.842 3.72064 11.5607 3.43934C11.2794 3.15804 10.8978 3 10.5 3H4.5C4.10218 3 3.72064 3.15804 3.43934 3.43934C3.15804 3.72064 3 4.10218 3 4.5V10.5C3 10.8978 3.15804 11.2794 3.43934 11.5607C3.72064 11.842 4.10218 12 4.5 12H6M6 7.5C6 7.10218 6.15804 6.72065 6.43934 6.43934C6.72065 6.15804 7.10218 6 7.5 6H13.5C13.8978 6 14.2794 6.15804 14.5607 6.43934C14.842 6.72065 15 7.10218 15 7.5V13.5C15 13.8978 14.842 14.2794 14.5607 14.5607C14.2794 14.842 13.8978 15 13.5 15H7.5C7.10218 15 6.72065 14.842 6.43934 14.5607C6.15804 14.2794 6 13.8978 6 13.5V7.5Z",stroke:"#F0F0F0",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});var Gs=function(e){return e[e.INITIAL=0]="INITIAL",e[e.PROGRESSING=1]="PROGRESSING",e[e.SUCCESS=2]="SUCCESS",e[e.ERROR=3]="ERROR",e}(Gs||{});const Js=({status:e})=>{switch(e){case Gs.INITIAL:return(0,Bt.jsx)(qs,{});case Gs.PROGRESSING:return(0,Bt.jsx)("span",{className:"spinner-wrapper",children:(0,Bt.jsx)(On.Spinner,{})});case Gs.SUCCESS:return(0,Bt.jsx)("span",{className:"dashicons dashicons-yes"});case Gs.ERROR:return(0,Bt.jsx)("span",{className:"dashicons dashicons-warning"})}},Ks=({text:e,timeout:t=1500,...n})=>{const[o,i]=(0,r.useState)(Gs.INITIAL),s=window.navigator.clipboard;return s&&window.isSecureContext?(0,Bt.jsxs)(In,{className:"code-snippets-copy-text",onClick:()=>{i(Gs.PROGRESSING),s?.writeText(e).then((()=>{i(Gs.SUCCESS),setTimeout((()=>i(Gs.INITIAL)),t)})).catch((e=>{console.error("Failed to copy text to clipboard.",e),i(Gs.ERROR)}))},...n,children:[(0,Bt.jsx)(Js,{status:o}),(0,c.__)("Copy","code-snippets")]}):null},Xs=({options:e,checked:t,disabled:n,setChecked:o,optionLabels:r,optionDescriptions:i})=>(0,Bt.jsx)("ul",{children:e.map((e=>(0,Bt.jsx)("li",{children:(0,Bt.jsx)(On.CheckboxControl,{label:r[e],help:i[e],checked:t[e],disabled:n,onChange:t=>o((n=>({...n,[e]:t})))})},e)))}),Ys=()=>(0,Bt.jsxs)("p",{className:"description",children:[(0,c.__)("Copy the below shortcode to insert this snippet into a post, page, or other content.","code-snippets"),"\n",(0,c.__)("You can also use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).","code-snippets"),"\n",(0,Bt.jsx)(On.ExternalLink,{href:(0,c.__)("https://codesnippets.pro/doc/inserting-content-snippets/","code-snippets"),children:(0,c.__)("Learn more","code-snippets")})]}),Zs={php:(0,c.__)("Evaluate PHP code","code-snippets"),format:(0,c.__)("Add paragraphs and formatting","code-snippets"),shortcodes:(0,c.__)("Evaluate additional shortcode tags","code-snippets")},Qs={php:(0,c.__)("Run code within tags.","code-snippets"),format:(0,c.__)("Wrap output in paragraphs and apply formatting.","code-snippets"),shortcodes:(0,c.__)("Replace [shortcodes] embedded within the snippet.","code-snippets")},ea=()=>{const{snippet:e,isReadOnly:t}=fn(),[n,o]=(0,r.useState)((()=>({php:e.code.includes("Boolean(e))).map((([e,t])=>"boolean"==typeof t?e:`${e}=${JSON.stringify(t)}`))].filter(Boolean).join(" ")}]`);var s;return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(Ys,{}),(0,Bt.jsxs)("p",{className:"shortcode-tag-wrapper",children:[(0,Bt.jsx)("code",{className:"shortcode-tag",children:i}),(0,Bt.jsx)(Ks,{primary:!0,text:i})]}),(0,Bt.jsxs)("p",{children:[(0,Bt.jsx)("h4",{children:(0,c.__)("Shortcode Options","code-snippets")}),(0,Bt.jsx)(Xs,{options:["php","format","shortcodes"],checked:n,disabled:t,setChecked:o,optionLabels:Zs,optionDescriptions:Qs})]})]})},ta=()=>{const{snippet:e,isReadOnly:t}=fn(),[n,o]=(0,r.useState)(!1);return"content"===e.scope&&e.id?(0,Bt.jsxs)("div",{className:"inline-form-field",children:[(0,Bt.jsx)("h4",{children:(0,c.__)("Shortcode","code-snippets")}),(0,Bt.jsx)(In,{onClick:()=>o(!0),disabled:t,children:(0,c.__)("See options","code-snippets")}),n?(0,Bt.jsxs)(On.Modal,{size:"medium",className:"code-snippets-modal",title:(0,c.__)("Embed Snippet with Shortcode","code-snippets"),onRequestClose:()=>o(!1),children:[(0,Bt.jsx)("div",{className:"modal-content",children:(0,Bt.jsx)(ea,{})}),(0,Bt.jsx)("div",{className:"modal-footer",children:(0,Bt.jsx)(In,{link:!0,large:!0,onClick:()=>o(!1),children:(0,c.__)("Close Popup","code-snippets")})})]}):null]}):null},na=({block:e,inline:t,start:n,end:o,icon:r,className:i,children:s})=>(0,Bt.jsxs)("div",{className:a()("tooltip",{"tooltip-block":e,"tooltip-inline":t,"tooltip-start":n,"tooltip-end":o},i),children:[null!=r?r:(0,Bt.jsx)("span",{className:"dashicons dashicons-editor-help"}),(0,Bt.jsx)("div",{className:"tooltip-content",children:s})]}),oa=()=>{const{snippet:e,setSnippet:t,isReadOnly:n}=fn();return(0,Bt.jsxs)("div",{className:"inline-form-field activation-switch-container",children:[(0,Bt.jsx)("h4",{children:(0,c.__)("Share with Subsites","code-snippets")}),(0,Bt.jsx)(na,{inline:!0,start:!0,children:(0,c.__)("Instead of running on every site, allow this snippet to be activated on individual sites on the network.","code-snippets")}),(0,Bt.jsxs)("label",{children:[e.shared_network?(0,c.__)("Enabled","code-snippets"):(0,c.__)("Disabled","code-snippets"),(0,Bt.jsx)("input",{id:"snippet_sharing",name:"snippet_sharing",type:"checkbox",className:"switch",checked:!!e.shared_network,disabled:n,onChange:e=>t((t=>({...t,active:!1,shared_network:e.target.checked})))})]})]})},ra={php:["php","text/php"],html:["php","text/php"],css:["css","text/css"],js:["js","text/javascript"],cond:["json","application/json"],json:["json","application/json"]},ia=(e,t,n)=>{const o=document.createElement("a");o.download=t,o.href=URL.createObjectURL(new Blob([e],{type:n})),setTimeout((()=>URL.revokeObjectURL(o.href)),4e4),setTimeout((()=>o.click()),0)},sa=({name:e,label:t,makeRequest:n})=>{const{snippet:o,isWorking:r,setIsWorking:i,handleRequestError:s}=fn();return(0,Bt.jsx)(In,{name:e,onClick:()=>{i(!0),n(o).then((e=>((e,{id:t,name:n,scope:o},r)=>{const i=n.toLowerCase().replace(/[^\w-]+/g,"-").trim(),s=""===i?`snippet-${t}`:i;if("string"==typeof e){const[t,n]=ra[null!=r?r:Lt({scope:o})];ia(e,`${s}.code-snippets.${t}`,n)}else{const t=`${s}.code-snippets.json`;ia(JSON.stringify(e,void 0,2),t,"application/json")}})(e,o))).catch((e=>s(e,(0,c.__)("Could not download export file.","code-snippets")))).finally((()=>i(!1)))},disabled:r,children:t})},aa=()=>{const{snippetsAPI:e}=zt();return(0,Bt.jsxs)("div",{className:"snippet-export-buttons",children:[(0,Bt.jsx)(sa,{name:"export_snippet",label:(0,c.__)("Export","code-snippets"),makeRequest:e.export}),window.CODE_SNIPPETS_EDIT?.enableDownloads?(0,Bt.jsx)(sa,{name:"export_snippet_code",label:(0,c.__)("Export Code","code-snippets"),makeRequest:e.exportCode}):null]})},ca=({id:e,text:t,name:n="submit",primary:o,small:r,large:i,wrap:s,className:l,...u})=>{const d=(0,Bt.jsx)("input",{id:null!=e?e:n,type:"submit",name:n,value:null!=t?t:(0,c.__)("Save Changes","code-snippets"),className:a()("button",{"button-primary":o,"button-small":r,"button-large":i},l),...u});return s?(0,Bt.jsx)("p",{className:"submit",children:d}):d},la=e=>{const{snippet:t}=fn();return(0,Bt.jsx)(ca,{large:!0,name:yn.SAVE,text:Mt(t)?(0,c.__)("Save Condition","code-snippets"):(0,c.__)("Save Snippet","code-snippets"),...e})},ua=({primaryActivate:e})=>{const{snippet:t,isWorking:n}=fn();switch(!0){case Mt(t)||t.shared_network&&Rt():return null;case"single-use"===t.scope:return(0,Bt.jsx)(ca,{large:!0,name:yn.SAVE_AND_EXECUTE,disabled:n,text:(0,c.__)("Save and Execute Once","code-snippets")});case t.active:return(0,Bt.jsx)(ca,{name:yn.SAVE_AND_DEACTIVATE,disabled:n,large:!0,text:(0,c.__)("Save and Deactivate","code-snippets")});default:case!t.active:return(0,Bt.jsx)(ca,{name:yn.SAVE_AND_ACTIVATE,primary:e,disabled:n,large:!0,text:(0,c.__)("Save and Activate","code-snippets")})}},da=()=>{const{snippet:e}=fn(),t=!(!window.CODE_SNIPPETS_EDIT?.activateByDefault||e.active||"single-use"===e.scope||e.shared_network&&Rt());return(0,Bt.jsxs)(Bt.Fragment,{children:[t&&(0,Bt.jsx)(la,{primary:!t}),(0,Bt.jsx)(ua,{primaryActivate:t}),!t&&(0,Bt.jsx)(la,{primary:!0})]})},pa=()=>{const{snippet:e,isWorking:t}=fn(),{submitSnippet:n}=Sn();return(0,Bt.jsxs)("div",{className:"inline-form-field activation-switch-container",children:[(0,Bt.jsx)("h4",{children:(0,c.__)("Status")}),(0,Bt.jsxs)("label",{children:[e.active?(0,c.__)("Active","code-snippets"):(0,c.__)("Inactive","code-snippets"),(0,Bt.jsx)("input",{id:"activation-switch",type:"checkbox",checked:e.active,disabled:t||!!e.shared_network,className:"switch",onChange:()=>{n(e.active?yn.SAVE_AND_DEACTIVATE:yn.SAVE_AND_ACTIVATE).then((()=>{})).catch(En)}})]})]})},fa=()=>{const{snippetsAPI:e}=zt(),{snippet:t,setIsWorking:n,isWorking:o,handleRequestError:i}=fn(),[s,a]=(0,r.useState)(!1);return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(In,{id:"delete-snippet",className:"delete-button",disabled:o,onClick:()=>{a(!0)},children:(0,c.__)("Delete","code-snippets")}),(0,Bt.jsx)(_n,{open:s,title:(0,c.__)("Delete?","code-snippets"),confirmLabel:(0,c.__)("Delete","code-snippets"),confirmButtonClassName:"is-destructive",onCancel:()=>a(!1),onConfirm:()=>{a(!1),n(!0),e.delete(t).then((()=>{n(!1),window.location.replace((0,l.addQueryArgs)(window.CODE_SNIPPETS?.urls.manage,{result:"deleted"}))})).catch((e=>i(e,(0,c.__)("Could not delete snippet.","code-snippets"))))},children:(0,Bt.jsxs)("p",{style:{marginBlockStart:0},children:[(0,c.__)("You are about to delete this snippet.","code-snippets")," ",(0,c.__)("Are you sure?","code-snippets")]})})]})},ha=()=>{const{snippet:e,isReadOnly:t,setSnippet:n}=fn();return(0,Bt.jsxs)("div",{className:"snippet-priority inline-form-field",children:[(0,Bt.jsx)("h4",{children:(0,Bt.jsx)("label",{htmlFor:"snippet-priority",children:(0,c.__)("Priority","code-snippets")})}),(0,Bt.jsx)(na,{block:!0,end:!0,children:(0,c.__)("Snippets with a lower priority number will run before those with a higher number.","code-snippets")}),(0,Bt.jsx)("input",{type:"number",id:"snippet-priority",name:"snippet_priority",value:e.priority,disabled:t,onChange:e=>n((t=>({...t,priority:parseInt(e.target.value,10)})))})]})},ma=()=>{const{codeEditorInstance:e}=fn();return(0,Bt.jsxs)("div",{className:"inline-form-field",children:[(0,Bt.jsx)("h4",{children:(0,Bt.jsx)("label",{htmlFor:"snippet-code-direction",children:(0,c.__)("Code Direction","code-snippets")})}),(0,Bt.jsxs)("select",{id:"snippet-code-direction",onChange:t=>e?.codemirror.setOption("direction","rtl"===t.target.value?"rtl":"ltr"),children:[(0,Bt.jsx)("option",{value:"ltr",children:(0,c.__)("LTR","code-snippets")}),(0,Bt.jsx)("option",{value:"rtl",children:(0,c.__)("RTL","code-snippets")})]})]})},ga=({setIsUpgradeDialogOpen:e})=>{const{snippet:t,isWorking:n}=fn();return(0,Bt.jsxs)("div",{className:"snippet-editor-sidebar",children:[(0,Bt.jsxs)("div",{className:"box",children:[t.id&&!Mt(t)?(0,Bt.jsx)(pa,{}):null,Rt()?(0,Bt.jsx)(oa,{}):null,(0,c.isRTL)()?(0,Bt.jsx)(ma,{}):null,(0,Bt.jsx)(An,{setIsDialogOpen:e}),(0,Bt.jsx)($s,{}),(0,Bt.jsx)(ta,{}),(0,Bt.jsx)(ha,{}),t.id?(0,Bt.jsxs)("div",{className:"row-actions visible inline-form-field",children:[(0,Bt.jsx)(aa,{}),(0,Bt.jsx)(fa,{})]}):null]}),(0,Bt.jsxs)("p",{className:"submit",children:[(0,Bt.jsx)(da,{}),n?(0,Bt.jsx)(On.Spinner,{}):""]}),(0,Bt.jsx)(Ws,{})]})},va=()=>{const[e,t]=(0,r.useState)(!1);return e||At()||window.CODE_SNIPPETS_EDIT?.hideUpsell?null:(0,Bt.jsxs)("div",{className:"code-snippets-upsell-banner",children:[(0,Bt.jsx)("img",{src:`${window.CODE_SNIPPETS?.urls.plugin}/assets/icon.svg`,alt:(0,c.__)("Code Snippets logo","code-snippets"),height:"34"}),(0,Bt.jsx)("p",{children:(0,Cn.createInterpolateElement)((0,c.__)("Unlock cloud sync, snippet conditions, AI features and much more with Code Snippets Pro.","code-snippets"),{strong:(0,Bt.jsx)("strong",{})})}),(0,Bt.jsx)(On.ExternalLink,{className:"button button-primary button-large",href:"https://codesnippets.pro/pricing/",children:(0,c.__)("Get Started","code-snippets")}),(0,Bt.jsx)(In,{small:!0,link:!0,onClick:()=>t(!0),children:(0,Bt.jsx)("span",{className:"dashicons dashicons-no-alt"})})]})},ba={css:"text/css",js:"javascript",php:"text/x-php",html:"application/x-httpd-php"},ya=[{value:"php",label:(0,c.__)("Functions","code-snippets")},{value:"html",label:(0,c.__)("Content","code-snippets")},{value:"css",label:(0,c.__)("Styles","code-snippets")},{value:"js",label:(0,c.__)("Scripts","code-snippets")},{value:"cond",label:(0,c.__)("Conditions","code-snippets")}],wa=({option:{value:e,label:t},context:n})=>(0,Bt.jsxs)("div",{className:a()("snippet-type-option",{"inverted-badges":Ft(e)&&!At()}),children:["menu"===n?(0,Bt.jsxs)("div",{children:[t,Ft(e)&&!At()?(0,Bt.jsx)(Rn,{name:"pro",small:!0,children:(0,c._x)("Pro","Upgrade to Pro","code-snippets")}):null]}):null,(0,Bt.jsx)(Rn,{name:e})]}),xa=({setIsUpgradeDialogOpen:e})=>{const{snippet:t,setSnippet:n,codeEditorInstance:o,isReadOnly:i}=fn(),s=Lt(t);return(0,r.useEffect)((()=>{if(o){const e=o.codemirror;e.setOption("lint","php"===s||"css"===s),"cond"!==s&&ba[s]&&(e.setOption("mode",ba[s]),e.refresh())}}),[o,s]),(0,Bt.jsxs)("div",{className:"snippet-type-container",children:[(0,Bt.jsx)("label",{htmlFor:"snippet-type-select-input",className:"screen-reader-text",children:(0,c.__)("Snippet Type","code-snippets")}),(0,Bt.jsx)(Us,{inputId:"snippet-type-select-input",className:"code-snippets-select",isDisabled:i,options:0===t.id?ya:ya.filter((e=>"cond"!==e.value)),menuPlacement:"bottom",styles:{menu:e=>({...e,zIndex:9999,width:"max-content",minWidth:"100%"}),input:e=>({...e,boxShadow:"none"})},value:ya.find((e=>e.value===s)),formatOptionLabel:(e,t)=>(0,Bt.jsx)(wa,{option:e,context:t.context}),onChange:t=>{t&&Ft(t.value)&&!At()?e(!0):t&&n((e=>({...e,scope:kt[t.value][0]})))}})]})},Sa=window.CODE_SNIPPETS_EDIT?.tagOptions,Ea=()=>{const{snippet:e,setSnippet:t,isReadOnly:n}=fn();return Sa?.enabled?(0,Bt.jsxs)("div",{className:"snippet-tags-container",children:[(0,Bt.jsx)("h3",{children:(0,Bt.jsx)("label",{htmlFor:"components-form-token-input-0",children:(0,c.__)("Snippet Tags","code-snippets")})}),(0,Bt.jsx)(On.FormTokenField,{label:"",value:e.tags,disabled:n,suggestions:Sa.availableTags,tokenizeOnBlur:!0,tokenizeOnSpace:!Sa.allowSpaces,onChange:e=>{t((t=>({...t,tags:e.map((e=>"string"==typeof e?e:e.value))})))}})]}):null},Oa=()=>(0,Bt.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bt.jsx)("path",{d:"M12 3H15V6"}),(0,Bt.jsx)("path",{d:"M10.5 7.5L15 3L10.5 7.5Z"}),(0,Bt.jsx)("path",{d:"M6 15H3V12"}),(0,Bt.jsx)("path",{d:"M3 15L7.5 10.5L3 15Z"}),(0,Bt.jsx)("path",{d:"M12 15H15V12"}),(0,Bt.jsx)("path",{d:"M10.5 10.5L15 15L10.5 10.5Z"}),(0,Bt.jsx)("path",{d:"M6 3H3V6"}),(0,Bt.jsx)("path",{d:"M3 3L7.5 7.5L3 3Z"}),(0,Bt.jsx)("path",{d:"M12 3H15M15 3V6M15 3L10.5 7.5M6 15H3M3 15V12M3 15L7.5 10.5M12 15H15M15 15V12M15 15L10.5 10.5M6 3H3M3 3V6M3 3L7.5 7.5",stroke:"currentcolor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),_a=()=>(0,Bt.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bt.jsx)("path",{d:"M3.75 6.75H6.75V3.75"}),(0,Bt.jsx)("path",{d:"M2.25 2.25L6.75 6.75L2.25 2.25Z"}),(0,Bt.jsx)("path",{d:"M3.75 11.25H6.75V14.25"}),(0,Bt.jsx)("path",{d:"M2.25 15.75L6.75 11.25L2.25 15.75Z"}),(0,Bt.jsx)("path",{d:"M14.25 6.75H11.25V3.75"}),(0,Bt.jsx)("path",{d:"M11.25 6.75L15.75 2.25L11.25 6.75Z"}),(0,Bt.jsx)("path",{d:"M14.25 11.25H11.25V14.25"}),(0,Bt.jsx)("path",{d:"M11.25 11.25L15.75 15.75L11.25 11.25Z"}),(0,Bt.jsx)("path",{d:"M3.75 6.75H6.75M6.75 6.75V3.75M6.75 6.75L2.25 2.25M3.75 11.25H6.75M6.75 11.25V14.25M6.75 11.25L2.25 15.75M14.25 6.75H11.25M11.25 6.75V3.75M11.25 6.75L15.75 2.25M14.25 11.25H11.25M11.25 11.25V14.25M11.25 11.25L15.75 15.75",stroke:"currentcolor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ca={Cmd:(0,c._x)("Cmd","keyboard key","code-snippets"),Ctrl:(0,c._x)("Ctrl","keyboard key","code-snippets"),Shift:(0,c._x)("Shift","keyboard key","code-snippets"),Option:(0,c._x)("Option","keyboard key","code-snippets"),Alt:(0,c._x)("Alt","keyboard key","code-snippets"),Tab:(0,c._x)("Tab","keyboard key","code-snippets"),Up:(0,c._x)("Up","keyboard key","code-snippets"),Down:(0,c._x)("Down","keyboard key","code-snippets"),A:(0,c._x)("A","keyboard key","code-snippets"),D:(0,c._x)("D","keyboard key","code-snippets"),F:(0,c._x)("F","keyboard key","code-snippets"),G:(0,c._x)("G","keyboard key","code-snippets"),R:(0,c._x)("R","keyboard key","code-snippets"),S:(0,c._x)("S","keyboard key","code-snippets"),Y:(0,c._x)("Y","keyboard key","code-snippets"),Z:(0,c._x)("Z","keyboard key","code-snippets"),"/":(0,c._x)("/","keyboard key","code-snippets"),"[":(0,c._x)("]","keyboard key","code-snippets"),"]":(0,c._x)("]","keyboard key","code-snippets")},ja={saveChanges:{label:(0,c.__)("Save changes","code-snippets"),mod:"Cmd",key:"S"},selectAll:{label:(0,c.__)("Select all","code-snippets"),mod:"Cmd",key:"A"},beginSearch:{label:(0,c.__)("Begin searching","code-snippets"),mod:"Cmd",key:"F"},findNext:{label:(0,c.__)("Find next","code-snippets"),mod:"Cmd",key:"G"},findPrevious:{label:(0,c.__)("Find previous","code-snippets"),mod:["Shift","Cmd"],key:"G"},replace:{label:(0,c.__)("Replace","code-snippets"),mod:["Shift","Cmd"],key:"F"},replaceAll:{label:(0,c.__)("Replace all","code-snippets"),mod:["Shift","Cmd","Option"],key:"R"},search:{label:(0,c.__)("Persistent search","code-snippets"),mod:"Alt",key:"F"},toggleComment:{label:(0,c.__)("Toggle comment","code-snippets"),mod:"Cmd",key:"/"},swapLineUp:{label:(0,c.__)("Swap line up","code-snippets"),mod:"Option",key:"Up"},swapLineDown:{label:(0,c.__)("Swap line down","code-snippets"),mod:"Option",key:"Down"},autoIndent:{label:(0,c.__)("Auto-indent current line or selection","code-snippets"),mod:"Shift",key:"Tab"}},ka=(0,c._x)("-","keyboard shortcut separator","code-snippets"),Ra=({modifier:e})=>{switch(e){case"Ctrl":case"Cmd":return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("kbd",{className:"pc-key",children:Ca.Ctrl}),(0,Bt.jsx)("kbd",{className:"mac-key",children:Ca.Cmd}),ka]});case"Option":return(0,Bt.jsxs)("span",{className:"mac-key",children:[(0,Bt.jsx)("kbd",{className:"mac-key",children:Ca.Option}),ka]});default:return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("kbd",{children:Ca[e]}),ka]})}},Ia=({editorTheme:e})=>(0,Bt.jsxs)("div",{className:"snippet-editor-help tooltip tooltip-inline tooltip-start",children:[(0,Bt.jsx)("span",{className:`dashicons dashicons-editor-help cm-s-${e}`}),(0,Bt.jsx)("div",{className:a()("tooltip-content",{"platform-mac":It()}),children:(0,Bt.jsx)("table",{children:(0,Bt.jsx)("tbody",{children:Object.entries(ja).map((([e,{label:t,mod:n,key:o}])=>(0,Bt.jsxs)("tr",{children:[(0,Bt.jsx)("td",{children:t}),(0,Bt.jsxs)("td",{children:[(Array.isArray(n)?n:[n]).map((e=>(0,Bt.jsx)("span",{children:(0,Bt.jsx)(Ra,{modifier:e})},e))),(0,Bt.jsx)("kbd",{children:Ca[o]})]})]},e)))})})})]}),Aa=({textareaRef:e})=>{var t;const{snippet:n,setSnippet:o}=fn();return(0,Bt.jsxs)("div",{className:"snippet-editor",children:[(0,Bt.jsx)("textarea",{ref:e,id:"snippet-code",name:"snippet_code",value:n.code,rows:200,spellCheck:!1,onChange:e=>{o((t=>({...t,code:e.target.value})))}}),(0,Bt.jsx)(Ia,{editorTheme:null!==(t=window.CODE_SNIPPETS_EDIT?.editorTheme)&&void 0!==t?t:"default"})]})},Pa=({isExpanded:e,setIsExpanded:t})=>{const{snippet:n,setSnippet:o,codeEditorInstance:i,setCodeEditorInstance:s}=fn(),{submitSnippet:a}=Sn(),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{s((e=>(l.current&&!e&&(e=window.wp.codeEditor.initialize(l.current)).codemirror.on("changes",(e=>{o((t=>({...t,code:e.getValue()})))})),e)))}),[s,l,o]),(0,r.useEffect)((()=>{if(i){var e;const t=null!==(e=i.codemirror.getOption("extraKeys"))&&void 0!==e?e:{},n=It()?"Cmd":"Ctrl",o=()=>{a().then((()=>{})).catch(En)};i.codemirror.setOption("extraKeys",{..."object"==typeof t?t:void 0,[`${n}-S`]:o,[`${n}-Enter`]:o})}}),[a,i,n]),(0,Bt.jsxs)("div",{className:"snippet-code-container",children:[(0,Bt.jsxs)("div",{className:"above-snippet-code",children:[(0,Bt.jsx)("h2",{children:(0,Bt.jsx)("label",{htmlFor:"snippet-code",children:(0,c.__)("Snippet Content","code-snippets")})}),(0,Bt.jsxs)(In,{small:!0,className:"expand-editor-button",onClick:()=>t((e=>!e)),children:[e?(0,Bt.jsx)(_a,{}):(0,Bt.jsx)(Oa,{}),e?(0,c.__)("Minimize","code-snippets"):(0,c.__)("Expand","code-snippets")]})]}),(0,Bt.jsx)(Aa,{textareaRef:l})]})};var Ta=window.wp.domReady,Na=n.n(Ta);const Da="snippet_description",La=[["bold","italic","underline","strikethrough","blockquote","bullist","numlist","alignleft","aligncenter","alignright","link","wp_adv","code_snippets"],["formatselect","forecolor","pastetext","removeformat","charmap","outdent","indent","undo","redo","spellchecker"]],Ma=()=>{const{snippet:e,setSnippet:t,isReadOnly:n}=fn(),o=(0,r.useCallback)((e=>t((t=>({...t,desc:e})))),[t]);return(0,r.useEffect)((()=>{Na()((()=>{return e=o,void window.wp.editor?.initialize(Da,{mediaButtons:window.CODE_SNIPPETS_EDIT?.descEditorOptions.mediaButtons,quicktags:!0,tinymce:{toolbar:La.map((e=>e.join(" "))),setup:t=>{t.on("change",(()=>e(t.getContent())))}}});var e}))}),[o]),(0,Bt.jsx)("textarea",{id:Da,className:"wp-editor-area",onChange:e=>o(e.target.value),autoComplete:"off",disabled:n,rows:window.CODE_SNIPPETS_EDIT?.descEditorOptions.rows,cols:40,value:e.desc})},Fa=()=>window.CODE_SNIPPETS_EDIT?.enableDescription?(0,Bt.jsxs)("div",{className:"snippet-description-container",children:[(0,Bt.jsx)("h2",{children:(0,Bt.jsx)("label",{htmlFor:Da,children:(0,c.__)("Description","code-snippets")})}),(0,Bt.jsx)(Ma,{})]}):null,Va=()=>{const{snippet:e,setSnippet:t,isReadOnly:n}=fn();return(0,Bt.jsx)("div",{id:"titlediv",children:(0,Bt.jsxs)("div",{id:"titlewrap",children:[(0,Bt.jsx)("label",{htmlFor:"title",className:"screen-reader-text",children:(0,c.__)("Name","code-snippets")}),(0,Bt.jsx)("input",{id:"title",type:"text",name:"snippet_name",autoComplete:"off",value:e.name,disabled:n,placeholder:(0,c.__)("Enter snippet title","code-snippets"),onChange:e=>t((t=>({...t,name:e.target.value})))})]})})},Ua=window.CODE_SNIPPETS_EDIT,Ba=e=>"condition"===e.scope?(0,c.__)("Add New Condition","code-snippets"):(0,c.__)("Add New Snippet","code-snippets"),Ha=()=>{const{snippet:e,updateSnippet:t,setCurrentNotice:n}=fn();return(0,Bt.jsxs)("h1",{children:[e.id?(0,Bt.jsxs)(Bt.Fragment,{children:[`${"condition"===e.scope?(0,c.__)("Edit Condition","code-snippets"):(0,c.__)("Edit Snippet","code-snippets")} `,(0,Bt.jsx)("a",{href:window.CODE_SNIPPETS?.urls.addNew,className:"page-title-action",onClick:o=>{o.preventDefault(),t((({scope:e})=>Dt({scope:e}))),n(void 0),window.document.title=window.document.title.replace((0,c.__)("Edit Snippet","code-snippets"),Ba(e)).replace((0,c.__)("Edit Condition","code-snippets"),Ba(e)),window.history.pushState({},"",window.CODE_SNIPPETS?.urls.addNew)},children:(0,c._x)("Add New","snippet","code-snippets")})]}):Ba(e),Ua?.pageTitleActions&&Object.entries(Ua.pageTitleActions).map((([e,t])=>(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("a",{href:t,className:"page-title-action",children:e},e)," "]})))]})},$a=({snippet:e,isReadOnly:t,isExpanded:n})=>a()("snippet-form",n?"snippet-form-expanded":"snippet-form-collapsed",`${e.scope}-snippet`,`${Lt(e)}-snippet`,(e.id?"saved":"new")+"-snippet",(e.active?"active":"inactive")+"-snippet",{"erroneous-snippet":!!e.code_error,"read-only-snippet":t}),za=({doSubmit:e,submitAction:t,setSubmitAction:n,validationWarning:o,setValidationWarning:r})=>(0,Bt.jsx)(_n,{open:void 0!==o,title:(0,c.__)("Snippet incomplete","code-snippets"),confirmLabel:(0,c.__)("Continue","code-snippets"),onCancel:()=>{n(void 0),r(void 0)},onConfirm:()=>{e(t),n(void 0),r(void 0)},children:(0,Bt.jsx)("p",{children:`${o} ${(0,c.__)("Continue?","code-snippets")}`})}),Wa=({children:e,className:t})=>{const{submitSnippet:n}=Sn(),{snippet:o}=fn(),{refreshSnippetsList:i}=Gt(),[s,a]=(0,r.useState)(),[u,d]=(0,r.useState)(),p=e=>{n(e).then((e=>{if(e&&0!==e.id&&window.CODE_SNIPPETS&&window.location.href.toString().includes(window.CODE_SNIPPETS.urls.addNew)){document.title=document.title.replace((0,c.__)("Add New Snippet","code-snippets"),(0,c.__)("Edit Snippet","code-snippets")).replace((0,c.__)("Add New Condition","code-snippets"),(0,c.__)("Edit Condition","code-snippets"));const t=(0,l.addQueryArgs)(window.CODE_SNIPPETS.urls.edit,{id:e.id});window.history.pushState({},document.title,t)}})).then(i).catch(En)};return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("form",{id:"snippet-form",method:"post",onSubmit:e=>{e.preventDefault();const t=Object.values(yn).find((e=>e===document.activeElement?.getAttribute("name"))),n=(e=>{const t=""===e.name.trim(),n=""===e.code.trim();switch(!0){case n&&t:return(0,c.__)("This snippet has no code or title.","code-snippets");case n:return(0,c.__)("This snippet has no snippet code.","code-snippets");case t:return(0,c.__)("This snippet has no title.","code-snippets");default:return}})(o);n?(a(n),d(t)):p(t)},className:t,children:e}),(0,Bt.jsx)(za,{doSubmit:p,submitAction:u,setSubmitAction:d,validationWarning:s,setValidationWarning:a})]})},qa=()=>{const{snippet:e}=fn();return Mt(e)?(0,Bt.jsx)("div",{id:"snippet_conditions",className:"snippet-condition-editor-container",children:(0,Bt.jsx)("p",{children:(0,c.__)("This snippet type is not supported in this version of Code Snippets.")})}):null},Ga=()=>{const{snippet:e,isReadOnly:t}=fn(),[n,o]=(0,r.useState)(!1),[i,s]=(0,r.useState)(!1);return(0,Bt.jsxs)("div",{className:"wrap",children:[(0,Bt.jsx)("p",{children:(0,Bt.jsx)("small",{children:Mt(e)?(0,Bt.jsx)("a",{href:(0,l.addQueryArgs)(window.CODE_SNIPPETS?.urls.manage,{type:"cond"}),children:(0,c.__)("Back to all conditions","code-snippets")}):(0,Bt.jsx)("a",{href:window.CODE_SNIPPETS?.urls.manage,children:(0,c.__)("Back to all snippets","code-snippets")})})}),(0,Bt.jsx)(Ha,{}),(0,Bt.jsxs)(Wa,{className:$a({snippet:e,isReadOnly:t,isExpanded:n}),children:[(0,Bt.jsxs)("main",{className:"snippet-form-upper",children:[(0,Bt.jsxs)("div",{className:"snippet-name-wrapper",children:[(0,Bt.jsx)(Va,{}),(0,Bt.jsx)(xa,{setIsUpgradeDialogOpen:s})]}),(0,Bt.jsx)(Pa,{isExpanded:n,setIsExpanded:o}),(0,Bt.jsx)(qa,{})]}),(0,Bt.jsxs)("div",{className:"snippet-form-lower",children:[(0,Bt.jsx)(va,{}),(0,Bt.jsx)(Fa,{}),(0,Bt.jsx)(Ea,{})]}),(0,Bt.jsx)(ga,{setIsUpgradeDialogOpen:s})]}),(0,Bt.jsx)(jn,{isOpen:i,setIsOpen:s})]})},Ja=()=>(0,Bt.jsx)(Wt,{children:(0,Bt.jsx)(Jt,{children:(0,Bt.jsx)(hn,{initialSnippet:()=>Dt(window.CODE_SNIPPETS_EDIT?.snippet),children:(0,Bt.jsx)(Ga,{})})})}),Ka=document.getElementById("edit-snippet-form-container");Ka?(0,i.H)(Ka).render((0,Bt.jsx)(Ja,{})):console.error("Could not find snippet edit form container.")},4146:function(e,t,n){"use strict";var o=n(4363),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return o.isMemo(e)?s:a[e.$$typeof]||r}a[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[o.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,o){if("string"!=typeof n){if(h){var r=f(n);r&&r!==h&&e(t,r,o)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=c(t),m=c(n),g=0;g