AlkantarClanX12
| Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/popup-maker/dist/packages/ |
| Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/popup-maker/dist/packages/cta-admin.js |
(()=>{"use strict";var e,t,a={163(e,t){Object.prototype.toString},679(e){var t={decodeValues:!0,map:!1,silent:!1};function a(e){return"string"!=typeof e||e in{}}function r(){return Object.create(null)}function n(e){return"string"==typeof e&&!!e.trim()}function o(e,o){var i=e.split(";").filter(n),s=function(e){var t="",a="",r=e.split("=");return r.length>1?(t=r.shift(),a=r.join("=")):a=e,{name:t,value:a}}(i.shift()),l=s.name,u=s.value;if(o=o?Object.assign({},t,o):t,a(l))return null;try{u=o.decodeValues?decodeURIComponent(u):u}catch(e){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",e)}var c=r();return c.name=l,c.value=u,i.forEach(function(e){var t=e.split("="),r=t.shift().trimLeft().toLowerCase();if(!a(r)){var n=t.join("=");if("expires"===r)c.expires=new Date(n);else if("max-age"===r){var o=parseInt(n,10);Number.isNaN(o)||(c.maxAge=o)}else"secure"===r?c.secure=!0:"httponly"===r?c.httpOnly=!0:"samesite"===r?c.sameSite=n:"partitioned"===r?c.partitioned=!0:r&&(c[r]=n)}}),c}function i(e,i){if(i=i?Object.assign({},t,i):t,!e)return i.map?r():[];if(e.headers)if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var s=e.headers[Object.keys(e.headers).find(function(e){return"set-cookie"===e.toLowerCase()})];s||!e.headers.cookie||i.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=s}if(Array.isArray(e)||(e=[e]),i.map){var l=r();return e.filter(n).reduce(function(e,t){var r=o(t,i);return r&&!a(r.name)&&(e[r.name]=r),e},l)}return e.filter(n).map(function(e){return o(e,i)}).filter(Boolean)}e.exports=i,e.exports.parse=i,e.exports.parseString=o,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,a,r,n,o,i=[],s=0;function l(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}function u(){return"="!==(a=e.charAt(s))&&";"!==a&&","!==a}for(;s<e.length;){for(t=s,o=!1;l();)if(","===(a=e.charAt(s))){for(r=s,s+=1,l(),n=s;s<e.length&&u();)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=n,i.push(e.substring(t,r)),t=s):s=r+1}else s+=1;(!o||s>=e.length)&&i.push(e.substring(t,e.length))}return i}}},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return a[e](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(a,r){if(1&r&&(a=this(a)),8&r)return a;if("object"==typeof a&&a){if(4&r&&a.__esModule)return a;if(16&r&&"function"==typeof a.then)return a}var o=Object.create(null);n.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&a;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,n.d(o,i),o},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{ListBulkActionsRegistry:()=>Qt,ListConsumer:()=>Wt,ListFiltersRegistry:()=>ra,ListOptionsRegistry:()=>la,ListProvider:()=>Ut,ListQuickActionsRegistry:()=>Kt,getGlobalVars:()=>ya,getListBulkActions:()=>Yt,getListFilters:()=>sa,getListOptions:()=>pa,getListQuickActions:()=>aa,init:()=>Oa,registerListBulkAction:()=>Zt,registerListBulkActionGroup:()=>qt,registerListFilter:()=>oa,registerListFilterGroup:()=>ia,registerListOption:()=>ca,registerListOptionGroup:()=>ha,registerListQuickAction:()=>ea,registerListQuickActionGroup:()=>ta,useList:()=>Ht,useListBulkActions:()=>Jt,useListFilters:()=>na,useListOptions:()=>ua,useListQuickActions:()=>Xt});var i={};n.r(i),n.d(i,{deleteBulkAction:()=>Ca,disableBulkAction:()=>ba,enableBulkAction:()=>Ga,exportBulkAction:()=>ja,trashBulkAction:()=>ka});var s={};n.r(s),n.d(s,{statusFilter:()=>Ra,typeFilter:()=>Ea});var l={};n.r(l),n.d(l,{exportListOption:()=>Aa,importListOption:()=>Ta});var u={};n.r(u),n.d(u,{deleteQuickAction:()=>Na,editQuickAction:()=>La,trashQuickAction:()=>Ma});const c=window.React;var h=n.t(c,2),p=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,d=/^[\\/]{2}/;var m="popstate";function f(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function g(e={}){return function(e,t,a,r={}){let{window:n=document.defaultView,v5Compat:o=!1}=r,i=n.history,s="POP",l=null,u=c();function c(){return(i.state||{idx:null}).idx}function h(){s="POP";let e=c(),t=null==e?null:e-u;u=e,l&&l({action:s,location:g.location,delta:t})}function p(e){return function(e,t,a=!1){let r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),S(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof t?t:y(t);return n=n.replace(/ $/,"%20"),!a&&d.test(n)&&(n=r+n),new URL(n,r)}(n,e)}null==u&&(u=0,i.replaceState({...i.state,idx:u},""));let g={get action(){return s},get location(){return e(n,i)},listen(e){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(m,h),l=e,()=>{n.removeEventListener(m,h),l=null}},createHref:e=>t(n,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=f(e)?e:x(g.location,e,t);a&&a(r,e),u=c()+1;let h=P(r,u),p=g.createHref(r.mask||r);try{i.pushState(h,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;n.location.assign(p)}o&&l&&l({action:s,location:g.location,delta:1})},replace:function(e,t){s="REPLACE";let r=f(e)?e:x(g.location,e,t);a&&a(r,e),u=c();let n=P(r,u),h=g.createHref(r.mask||r);i.replaceState(n,"",h),o&&l&&l({action:s,location:g.location,delta:0})},go:e=>i.go(e)};return g}(function(e,t){let a=t.state?.masked,{pathname:r,search:n,hash:o}=a||e.location;return x("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",a?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:y(t)},null,e)}function S(e,t){if(!1===e||null==e)throw new Error(t)}function v(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function P(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function x(e,t,a=null,r,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?w(t):t,state:a,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:n}}function y({pathname:e="/",search:t="",hash:a=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function w(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function V(e,t,a="/"){return G(e,t,a,!1)}function G(e,t,a,r,n){let o=$(("string"==typeof t?w(t):t).pathname||"/",a);if(null==o)return null;let i=n??function(e){let t=b(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,a)=>e===t[a])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}(e),s=null,l=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return v(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let e=0;null==s&&e<i.length;++e)s=M(i[e],l,r);return s}function b(e,t=[],a=[],r="",n=!1){let o=(e,o,i=n,s)=>{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&i)return;S(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=H([r,l.relativePath]),c=a.concat(l);e.children&&e.children.length>0&&(S(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),b(e.children,t,c,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:L(u,e.index),routesMeta:c.map((e,t)=>{let[a,r]=D(e.relativePath,e.caseSensitive,t===c.length-1);return{...e,matcher:a,compiledParams:r}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let a of k(e.path))o(e,t,!0,a);else o(e,t)}),t}function k(e){let t=e.split("/");if(0===t.length)return[];let[a,...r]=t,n=a.endsWith("?"),o=a.replace(/\?$/,"");if(0===r.length)return n?[o,""]:[o];let i=k(r.join("/")),s=[];return s.push(...i.map(e=>""===e?o:[o,e].join("/"))),n&&s.push(...i),s.map(t=>e.startsWith("/")&&""===t?"/":t)}new WeakMap;var C=/^:[\w-]+$/,j=3,_=2,R=1,E=10,T=-2,A=e=>"*"===e;function L(e,t){let a=e.split("/"),r=a.length;return a.some(A)&&(r+=T),t&&(r+=_),a.filter(e=>!A(e)).reduce((e,t)=>e+(C.test(t)?j:""===t?R:E),r)}function M(e,t,a=!1){let{routesMeta:r}=e,n={},o="/",i=[];for(let e=0;e<r.length;++e){let s=r[e],l=e===r.length-1,u="/"===o?t:t.slice(o.length)||"/",c={path:s.relativePath,caseSensitive:s.caseSensitive,end:l},h=s.matcher&&s.compiledParams?O(c,u,s.matcher,s.compiledParams):N(c,u),p=s.route;if(!h&&l&&a&&!r[r.length-1].route.index&&(h=N({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},u)),!h)return null;Object.assign(n,h.params),i.push({params:n,pathname:H([o,h.pathname]),pathnameBase:Q(H([o,h.pathnameBase])),route:p}),"/"!==h.pathnameBase&&(o=H([o,h.pathnameBase]))}return i}function N(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=D(e.path,e.caseSensitive,e.end);return O(e,t,a,r)}function O(e,t,a,r){let n=t.match(a);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:a},r)=>{if("*"===t){let e=s[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const n=s[r];return e[t]=a&&!n?void 0:(n||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function D(e,t=!1,a=!0){v("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,a,n,o)=>{if(r.push({paramName:t,isOptional:null!=a}),a){let t=o.charAt(n+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),n+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?n+="\\/*$":""!==e&&"/"!==e&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),r]}function $(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&"/"!==r?null:e.slice(a)||"/"}function B(e,t){let a=z(t).split("/");return e.split("/").forEach(e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)}),a.length>1?a.join("/"):"/"}function F(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function I(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)}function W(e,t,a,r=!1){let n;"string"==typeof e?n=w(e):(n={...e},S(!n.pathname||!n.pathname.includes("?"),F("?","pathname","search",n)),S(!n.pathname||!n.pathname.includes("#"),F("#","pathname","hash",n)),S(!n.search||!n.search.includes("#"),F("#","search","hash",n)));let o,i=""===e||""===n.pathname,s=i?"/":n.pathname;if(null==s)o=a;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let a,{pathname:r,search:n="",hash:o=""}="string"==typeof e?w(e):e;return r?(r=U(r),a=r.startsWith("/")?B(r.substring(1),"/"):B(r,t)):a=t,{pathname:a,search:J(n),hash:Z(o)}}(n,o),u=s&&"/"!==s&&s.endsWith("/"),c=(i||"."===s)&&a.endsWith("/");return l.pathname.endsWith("/")||!u&&!c||(l.pathname+="/"),l}var U=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>U(e.join("/")),z=e=>e.replace(/\/+$/,""),Q=e=>z(e).replace(/^\/*/,"/"),J=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Z=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",q=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function K(e){let t=e.map(e=>e.route.path).filter(Boolean);return H(t)||"/"}var X="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ee(e,t){let a=e;if("string"!=typeof a||!p.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,n=!1;if(X)try{let e=new URL(window.location.href),r=d.test(a)?new URL((o=a,e.protocol+o.replace(/\\/g,"/"))):new URL(a),i=$(r.pathname,t);r.origin===e.origin&&null!=i?a=i+r.search+r.hash:n=!0}catch(e){v(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}var o;return{absoluteURL:r,isExternal:n,to:a}}Symbol("Uninstrumented"),Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var te=["POST","PUT","PATCH","DELETE"],ae=(new Set(te),["GET",...te]);new Set(ae),Symbol("ResetLoaderData"),new WeakMap,new WeakMap,new WeakMap,new WeakMap;var re=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];var ne=c.createContext(null);ne.displayName="DataRouter";var oe=c.createContext(null);oe.displayName="DataRouterState";var ie=c.createContext(!1);function se(){return c.useContext(ie)}var le=c.createContext({isTransitioning:!1});le.displayName="ViewTransition",c.createContext(new Map).displayName="Fetchers",c.createContext(null).displayName="Await";var ue=c.createContext(null);ue.displayName="Navigation";var ce=c.createContext(null);ce.displayName="Location";var he=c.createContext({outlet:null,matches:[],isDataRoute:!1});he.displayName="Route";var pe=c.createContext(null);pe.displayName="RouteError";var de="REACT_ROUTER_ERROR";function me(){return null!=c.useContext(ce)}function fe(){return S(me(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(ce).location}var ge="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Se(e){c.useContext(ue).static||c.useLayoutEffect(e)}function ve(){let{isDataRoute:e}=c.useContext(he);return e?function(){let{router:e}=function(e){let t=c.useContext(ne);return S(t,Ce(e)),t}("useNavigate"),t=je("useNavigate"),a=c.useRef(!1);Se(()=>{a.current=!0});let r=c.useCallback(async(r,n={})=>{v(a.current,ge),a.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...n}))},[e,t]);return r}():function(){S(me(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(ne),{basename:t,navigator:a}=c.useContext(ue),{matches:r}=c.useContext(he),{pathname:n}=fe(),o=JSON.stringify(I(r)),i=c.useRef(!1);Se(()=>{i.current=!0});let s=c.useCallback((r,s={})=>{if(v(i.current,ge),!i.current)return;if("number"==typeof r)return void a.go(r);let l=W(r,JSON.parse(o),n,"path"===s.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:H([t,l.pathname])),(s.replace?a.replace:a.push)(l,s.state,s)},[t,a,o,n,e]);return s}()}function Pe(e,{relative:t}={}){let{matches:a}=c.useContext(he),{pathname:r}=fe(),n=JSON.stringify(I(a));return c.useMemo(()=>W(e,JSON.parse(n),r,"path"===t),[e,n,r,t])}function xe(e,t,a){S(me(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=c.useContext(ue),{matches:n}=c.useContext(he),o=n[n.length-1],i=o?o.params:{},s=o?o.pathname:"/",l=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";Re(s,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let h,p=fe();if(t){let e="string"==typeof t?w(t):t;S("/"===l||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),h=e}else h=p;let d=h.pathname||"/",m=d;if("/"!==l){let e=l.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(e.length).join("/")}let f=a&&a.state.matches.length?a.state.matches.map(e=>Object.assign(e,{route:a.manifest[e.route.id]||e.route})):V(e,{pathname:m});v(u||null!=f,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),v(null==f||void 0!==f[f.length-1].route.element||void 0!==f[f.length-1].route.Component||void 0!==f[f.length-1].route.lazy,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=function(e,t=[],a){let r=a?.state;if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let n=e,o=r?.errors;if(null!=o){let e=n.findIndex(e=>e.route.id&&void 0!==o?.[e.route.id]);S(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,e+1))}let i=!1,s=-1;if(a&&r){i=r.renderFallback;for(let e=0;e<n.length;e++){let t=n[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:o}=r,l=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!o||void 0===o[t.route.id]);if(t.route.lazy||l){a.isStatic&&(i=!0),n=s>=0?n.slice(0,s+1):[n[0]];break}}}}let l=a?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:K(r.matches),errorInfo:t})}:void 0;return n.reduceRight((e,a,l)=>{let h,p=!1,d=null,m=null;r&&(h=o&&a.route.id?o[a.route.id]:void 0,d=a.route.errorElement||we,i&&(s<0&&0===l?(Re("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):s===l&&(p=!0,m=a.route.hydrateFallbackElement||null)));let f=t.concat(n.slice(0,l+1)),g=()=>{let t;return t=h?d:p?m:a.route.Component?c.createElement(a.route.Component,null):a.route.element?a.route.element:e,c.createElement(ke,{match:a,routeContext:{outlet:e,matches:f,isDataRoute:null!=r},children:t})};return r&&(a.route.ErrorBoundary||a.route.errorElement||0===l)?c.createElement(Ve,{location:r.location,revalidation:r.revalidation,component:d,error:h,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:u}):g()},null)}(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:H([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:H([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),n,a);return t&&g?c.createElement(ce.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},g):g}function ye(){let e=function(){let e=c.useContext(pe),t=function(e){let t=c.useContext(oe);return S(t,Ce(e)),t}("useRouteError"),a=je("useRouteError");return void 0!==e?e:t.errors?.[a]}(),t=Y(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:o},"ErrorBoundary")," or"," ",c.createElement("code",{style:o},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),a?c.createElement("pre",{style:n},a):null,i)}c.createContext(null);var we=c.createElement(ye,null),Ve=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${de}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new q(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?c.createElement(he.Provider,{value:this.props.routeContext},c.createElement(pe.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?c.createElement(be,{error:e},t):t}};Ve.contextType=ie;var Ge=new WeakMap;function be({children:e,error:t}){let{basename:a}=c.useContext(ue);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${de}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=Ge.get(t);if(r)throw r;let n=ee(e.location,a),o=n.absoluteURL||n.to;if(function(e){try{return re.includes(new URL(e).protocol)}catch{return!1}}(o))throw new Error("Invalid redirect location");if(X&&!Ge.get(t)){if(!n.isExternal&&!e.reloadDocument){const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(n.to,{replace:e.replace}));throw Ge.set(t,a),a}window.location.href=o}return c.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o}`})}}return e}function ke({routeContext:e,match:t,children:a}){let r=c.useContext(ne);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(he.Provider,{value:e},a)}function Ce(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function je(e){let t=function(e){let t=c.useContext(he);return S(t,Ce(e)),t}(e),a=t.matches[t.matches.length-1];return S(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}var _e={};function Re(e,t,a){t||_e[e]||(_e[e]=!0,v(!1,a))}function Ee({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:n,static:o=!1,useTransitions:i}){S(!me(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:s,navigator:n,static:o,useTransitions:i,future:{}}),[s,n,o,i]);"string"==typeof a&&(a=w(a));let{pathname:u="/",search:h="",hash:p="",state:d=null,key:m="default",mask:f}=a,g=c.useMemo(()=>{let e=$(u,s);return null==e?null:{location:{pathname:e,search:h,hash:p,state:d,key:m,mask:f},navigationType:r}},[s,u,h,p,d,m,r,f]);return v(null!=g,`<Router basename="${s}"> is not able to match the URL "${u}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==g?null:c.createElement(ue.Provider,{value:l},c.createElement(ce.Provider,{children:t,value:g}))}h.useOptimistic,c.memo(function({routes:e,manifest:t,future:a,state:r,isStatic:n,onError:o}){return xe(e,void 0,{manifest:t,state:r,isStatic:n,onError:o,future:a})}),c.Component;var Te="get",Ae="application/x-www-form-urlencoded";function Le(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Me=null,Ne=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Oe(e){return null==e||Ne.has(e)?e:(v(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ae}"`),null)}function De(e,t){if(!1===e||null==e)throw new Error(t)}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis,Symbol("SingleFetchRedirect");function $e(e,t,a,r){let n="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return a?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${r}`:n.pathname=`${n.pathname}.${r}`:"/"===n.pathname?n.pathname=`_root.${r}`:t&&"/"===$(n.pathname,t)?n.pathname=`${z(t)}/_root.${r}`:n.pathname=`${z(n.pathname)}.${r}`,n}function Be(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Fe(e,t,a,r,n,o){let i=(e,t)=>!a[t]||e.route.id!==a[t].route.id,s=(e,t)=>a[t].pathname!==e.pathname||a[t].route.path?.endsWith("*")&&a[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||s(e,t)):"data"===o?t.filter((t,o)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,o)||s(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function Ie(e,t,{includeHydrateFallback:a}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let n=[r.module];return r.clientActionModule&&(n=n.concat(r.clientActionModule)),r.clientLoaderModule&&(n=n.concat(r.clientLoaderModule)),a&&r.hydrateFallbackModule&&(n=n.concat(r.hydrateFallbackModule)),r.imports&&(n=n.concat(r.imports)),n}).flat(1),[...new Set(r)];var r}function We(){let e=c.useContext(ne);return De(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ue(){let e=c.useContext(oe);return De(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var He=c.createContext(void 0);function ze(){let e=c.useContext(He);return De(e,"You must render this element inside a <HydratedRouter> element"),e}function Qe(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function Je({page:e,...t}){let a=se(),{nonce:r}=ze(),{router:n}=We(),o=c.useMemo(()=>V(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(null==t.nonce&&r&&(t={...t,nonce:r}),a?c.createElement(qe,{page:e,matches:o,...t}):c.createElement(Ye,{page:e,matches:o,...t})):null}function Ze(e){let{manifest:t,routeModules:a}=ze(),[r,n]=c.useState([]);return c.useEffect(()=>{let r=!1;return async function(e,t,a){return function(e,t){let a=new Set,r=new Set(t);return e.reduce((e,n)=>{if(t&&(null==(o=n)||"string"!=typeof o.page)&&"script"===n.as&&n.href&&r.has(n.href))return e;var o;let i=JSON.stringify(function(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}(n));return a.has(i)||(a.add(i),e.push({key:i,link:n})),e},[])}((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,a);return e.links?e.links():[]}return[]}))).flat(1).filter(Be).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,a).then(e=>{r||n(e)}),()=>{r=!0}},[e,t,a]),r}function qe({page:e,matches:t,...a}){let r=fe(),{future:n}=ze(),{basename:o}=We(),i=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let a=$e(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),i=!1,s=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?i=!0:s.push(e.route.id);return i&&s.length>0&&a.searchParams.set("_routes",s.join(",")),[a.pathname+a.search]},[o,n.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,i.map(e=>c.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...a})))}function Ye({page:e,matches:t,...a}){let r=fe(),{future:n,manifest:o,routeModules:i}=ze(),{basename:s}=We(),{loaderData:l,matches:u}=Ue(),h=c.useMemo(()=>Fe(e,t,u,o,r,"data"),[e,t,u,o,r]),p=c.useMemo(()=>Fe(e,t,u,o,r,"assets"),[e,t,u,o,r]),d=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let a=new Set,u=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!h.some(t=>t.route.id===e.route.id)&&e.route.id in l&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?u=!0:a.add(e.route.id))}),0===a.size)return[];let c=$e(e,s,n.v8_trailingSlashAwareDataRequests,"data");return u&&a.size>0&&c.searchParams.set("_routes",t.filter(e=>a.has(e.route.id)).map(e=>e.route.id).join(",")),[c.pathname+c.search]},[s,n.v8_trailingSlashAwareDataRequests,l,r,o,h,t,e,i]),m=c.useMemo(()=>Ie(p,o),[p,o]),f=Ze(p);return c.createElement(c.Fragment,null,d.map(e=>c.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...a})),m.map(e=>c.createElement("link",{key:e,rel:"modulepreload",href:e,...a})),f.map(({key:e,link:t})=>c.createElement("link",{key:e,nonce:a.nonce,...t,crossOrigin:t.crossOrigin??a.crossOrigin})))}He.displayName="FrameworkContext";function Ke(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}c.Component;var Xe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Xe&&(window.__reactRouterVersion="7.18.0")}catch(e){}function et({basename:e,children:t,useTransitions:a,window:r}){let n=c.useRef();null==n.current&&(n.current=g({window:r,v5Compat:!0}));let o=n.current,[i,s]=c.useState({action:o.action,location:o.location}),l=c.useCallback(e=>{!1===a?s(e):c.startTransition(()=>s(e))},[a]);return c.useLayoutEffect(()=>o.listen(l),[o,l]),c.createElement(Ee,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:a})}var tt=c.forwardRef(function({onClick:e,discover:t="render",prefetch:a="none",relative:r,reloadDocument:n,replace:o,mask:i,state:s,target:l,to:u,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:m,...f},g){let{basename:v,navigator:P,useTransitions:x}=c.useContext(ue),w="string"==typeof u&&p.test(u),V=ee(u,v),G=function(e,{relative:t}={}){S(me(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=c.useContext(ue),{hash:n,pathname:o,search:i}=Pe(e,{relative:t}),s=o;return"/"!==a&&(s="/"===o?a:H([a,o])),r.createHref({pathname:s,search:i,hash:n})}(u=V.to,{relative:r}),b=fe(),k=null;if(i){let e=W(i,[],b.mask?b.mask.pathname:"/",!0);"/"!==v&&(e.pathname="/"===e.pathname?v:H([v,e.pathname])),k=P.createHref(e)}let[C,j,_]=function(e,t){let a=c.useContext(He),[r,n]=c.useState(!1),[o,i]=c.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:h,onTouchStart:p}=t,d=c.useRef(null);c.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return d.current&&e.observe(d.current),()=>{e.disconnect()}}},[e]),c.useEffect(()=>{if(r){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{n(!0)},f=()=>{n(!1),i(!1)};return a?"intent"!==e?[o,d,{}]:[o,d,{onFocus:Qe(s,m),onBlur:Qe(l,f),onMouseEnter:Qe(u,m),onMouseLeave:Qe(h,f),onTouchStart:Qe(p,m)}]:[!1,d,{}]}(a,f),R=function(e,{target:t,replace:a,mask:r,state:n,preventScrollReset:o,relative:i,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let h=ve(),p=fe(),d=Pe(e,{relative:i});return c.useCallback(m=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(m,t)){m.preventDefault();let t=void 0!==a?a:y(p)===y(d),f=()=>h(e,{replace:t,mask:r,state:n,preventScrollReset:o,relative:i,viewTransition:s,defaultShouldRevalidate:l});u?c.startTransition(()=>f()):f()}},[p,h,d,a,r,n,t,e,o,i,s,l,u])}(u,{replace:o,mask:i,state:s,target:l,preventScrollReset:h,relative:r,viewTransition:d,defaultShouldRevalidate:m,useTransitions:x}),E=!(V.isExternal||n),T=c.createElement("a",{...f,..._,href:(E?k:void 0)||V.absoluteURL||G,onClick:E?function(t){e&&e(t),t.defaultPrevented||R(t)}:e,ref:Ke(g,j),target:l,"data-discover":w||"render"!==t?void 0:"true"});return C&&!w?c.createElement(c.Fragment,null,T,c.createElement(Je,{page:G})):T});tt.displayName="Link",c.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:a="",end:r=!1,style:n,to:o,viewTransition:i,children:s,...l},u){let h=Pe(o,{relative:l.relative}),p=fe(),d=c.useContext(oe),{navigator:m,basename:f}=c.useContext(ue),g=null!=d&&function(e,{relative:t}={}){let a=c.useContext(le);S(null!=a,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=rt("useViewTransitionState"),n=Pe(e,{relative:t});if(!a.isTransitioning)return!1;let o=$(a.currentLocation.pathname,r)||a.currentLocation.pathname,i=$(a.nextLocation.pathname,r)||a.nextLocation.pathname;return null!=N(n.pathname,i)||null!=N(n.pathname,o)}(h)&&!0===i,v=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,P=p.pathname,x=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;t||(P=P.toLowerCase(),x=x?x.toLowerCase():null,v=v.toLowerCase()),x&&f&&(x=$(x,f)||x);const y="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,V=P===v||!r&&P.startsWith(v)&&"/"===P.charAt(y),G=null!=x&&(x===v||!r&&x.startsWith(v)&&"/"===x.charAt(v.length)),b={isActive:V,isPending:G,isTransitioning:g},k=V?e:void 0;w="function"==typeof a?a(b):[a,V?"active":null,G?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof n?n(b):n;return c.createElement(tt,{...l,"aria-current":k,className:w,ref:u,style:C,to:o,viewTransition:i},"function"==typeof s?s(b):s)}).displayName="NavLink";var at=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:n,state:o,method:i=Te,action:s,onSubmit:l,relative:u,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:m,...f},g)=>{let{useTransitions:v}=c.useContext(ue),P=function(){let{router:e}=rt("useSubmit"),{basename:t}=c.useContext(ue),a=je("useRouteId"),r=e.fetch,n=e.navigate;return c.useCallback(async(e,o={})=>{let{action:i,method:s,encType:l,formData:u,body:c}=function(e,t){let a,r,n,o,i;if(Le(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?$(i,t):null,a=e.getAttribute("method")||Te,n=Oe(e.getAttribute("enctype"))||Ae,o=new FormData(e)}else if(function(e){return Le(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Le(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(r=s?$(s,t):null,a=e.getAttribute("formmethod")||i.getAttribute("method")||Te,n=Oe(e.getAttribute("formenctype"))||Oe(i.getAttribute("enctype"))||Ae,o=new FormData(i,e),!function(){if(null===Me)try{new FormData(document.createElement("form"),0),Me=!1}catch(e){Me=!0}return Me}()){let{name:t,type:a,value:r}=e;if("image"===a){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else{if(Le(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Te,r=null,n=Ae,i=e}var s;return o&&"text/plain"===n&&(i=o,o=void 0),{action:r,method:a.toLowerCase(),encType:n,formData:o,body:i}}(e,t);if(!1===o.navigate){let e=o.fetcherKey||ot();await r(e,a,o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||s,formEncType:o.encType||l,flushSync:o.flushSync})}else await n(o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||s,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,n,t,a])}(),x=function(e,{relative:t}={}){let{basename:a}=c.useContext(ue),r=c.useContext(he);S(r,"useFormAction must be used inside a RouteContext");let[n]=r.matches.slice(-1),o={...Pe(e||".",{relative:t})},i=fe();if(null==e){o.search=i.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let a=e.toString();o.search=a?`?${a}`:""}}return e&&"."!==e||!n.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),"/"!==a&&(o.pathname="/"===o.pathname?a:H([a,o.pathname])),y(o)}(s,{relative:u}),w="get"===i.toLowerCase()?"get":"post",V="string"==typeof s&&p.test(s);return c.createElement("form",{ref:g,method:w,action:x,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute("formmethod")||i,p=()=>P(r||e.currentTarget,{fetcherKey:t,method:s,navigate:a,replace:n,state:o,relative:u,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:m});v&&!1!==a?c.startTransition(()=>p()):p()},...f,"data-discover":V||"render"!==e?void 0:"true"})});function rt(e){let t=c.useContext(ne);return S(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}at.displayName="Form";var nt=0,ot=()=>`__${String(++nt)}__`;n(163),n(679),new TextEncoder,c.Component,h.use,window.ReactDOM;const it=window.popupMaker.useQueryParams,st=({children:e})=>{var t;const{navigator:a}=(0,c.useContext)(ue),r=ve(),n=null==(t=(0,c.useContext)(ne))?void 0:t.router,o=fe();return e({replace(e){r(e.search||"?",{replace:!0,state:e.state})},push(e){r(e.search||"?",{replace:!1,state:e.state})},get location(){var e,t,r;return null!=(r=null!=(t=null==(e=null==n?void 0:n.state)?void 0:e.location)?t:null==a?void 0:a.location)?r:o}})},lt=window.wp.domReady;var ut=n.n(lt);const ct=window.wp.hooks,ht=window.wp.element,pt=window.wp.data,dt=window.popupMaker.data;function mt(e){var t,a,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(a=mt(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}const ft=function(){for(var e,t,a=0,r="",n=arguments.length;a<n;a++)(e=arguments[a])&&(t=mt(e))&&(r&&(r+=" "),r+=t);return r},gt=window.popupMaker.i18n,St=window.wp.components,vt=window.popupMaker.layout,Pt=((0,ht.forwardRef)(({icon:e,size:t=24,...a},r)=>(0,ht.cloneElement)(e,{width:t,height:t,...a,ref:r})),window.wp.primitives),xt=window.ReactJSXR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,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,(0,xt.jsx)(Pt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xt.jsx)(Pt.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})})),Ct=(0,xt.jsx)(Pt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xt.jsx)(Pt.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),jt=(Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path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Path,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.Path,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,(0,xt.jsx)(Pt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xt.jsx)(Pt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})})),Et=(Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,(0,xt.jsx)(Pt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xt.jsx)(Pt.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})})),Tt=(Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,Pt.SVG,Pt.Path,window.wp.htmlEntities),At=window.popupMaker.utils,Lt=window.popupMaker.icons,Mt=window.popupMaker.ctaEditor,Nt=window.popupMaker.components,Ot=window.popupMaker.coreData,Dt=()=>{},$t={callToActions:[],filteredCallToActions:[],bulkSelection:[],setBulkSelection:()=>{},updateCallToAction:(e,t)=>Promise.resolve(!1),deleteCallToAction:(e,t=!1)=>Promise.resolve(!1),isLoading:!1,isDeleting:!1,filters:{status:"all",searchText:"",type:"all"},setFilters:Dt,sortConfig:{orderby:"id",order:Nt.SortDirection.ASC},setSortConfig:Dt},Bt=(0,ht.createContext)($t),Ft=Bt,It=Ft.Provider,Wt=Ft.Consumer,Ut=({value:e={},children:t})=>{const[a,r]=(0,ht.useState)([]),[n,o]=(0,it.useQueryParams)({orderby:(0,it.withDefault)(it.StringParam,"id"),order:(0,it.withDefault)(it.StringParam,Nt.SortDirection.ASC)}),[i,s]=(0,it.useQueryParams)({status:(0,it.withDefault)(it.StringParam,"all"),searchText:(0,it.withDefault)(it.StringParam,""),type:(0,it.withDefault)(it.StringParam,"all")}),l=()=>s({status:void 0,searchText:void 0,type:void 0});(0,ht.useEffect)(()=>l,[]);const u=(0,pt.useSelect)(e=>e(Ot.callToActionStore).getCallToActions(),[]),c=(0,pt.useSelect)(e=>e(Ot.callToActionStore).isResolving("getCallToActions"),[]),h=(0,pt.useSelect)(e=>e(Ot.callToActionStore).isResolving("deleteCallToAction"),[]),{updateCallToAction:p,deleteCallToAction:d}=(0,pt.useDispatch)(Ot.callToActionStore),m=(0,ht.useMemo)(()=>{if(!u)return[];const e=u.filter(e=>"all"===i.status||i.status===e.status).filter(e=>!i.searchText||!i.searchText.length||e.title.rendered.toLowerCase().indexOf(i.searchText.toLowerCase())>=0||e.excerpt.rendered&&e.excerpt.rendered.toLowerCase().indexOf(i.searchText.toLowerCase())>=0).filter(e=>"all"===i.type||i.type===e.settings.type);return null!==n&&e.sort((e,t)=>{const a="type"===n.orderby?e.settings.type:e.title.rendered.toLowerCase(),r="type"===n.orderby?t.settings.type:t.title.rendered.toLowerCase();return a<r?n.order===Nt.SortDirection.ASC?-1:1:a>r?n.order===Nt.SortDirection.ASC?1:-1:0}),e},[u,i,n]);return(0,xt.jsx)(It,{value:{...e,bulkSelection:a,setBulkSelection:r,filters:i,setFilters:s,callToActions:u,filteredCallToActions:m,isLoading:c,isDeleting:h,updateCallToAction:p,deleteCallToAction:d,sortConfig:n,setSortConfig:o},children:t})},Ht=()=>(0,ht.useContext)(Bt),zt=window.popupMaker.registry,Qt=(0,zt.createRegistry)({name:"cta-editor/list-bulk-actions",groups:{status:{priority:10,label:"Status"},trash:{priority:20,label:"Trash"},export:{priority:30,label:"Export"}}}),Jt=()=>Qt.useItems(),Zt=Qt.register,qt=Qt.registerGroup,Yt=()=>Qt.getItems(),Kt=(0,zt.createRegistry)({name:"cta-editor/list-quick-actions",groups:{general:{priority:10},trash:{priority:20}}}),Xt=()=>Kt.useItems(),ea=Kt.register,ta=Kt.registerGroup,aa=()=>Kt.getItems(),ra=(0,zt.createRegistry)({name:"cta-editor/list-filters",groups:{core:{priority:10,label:"Core"},advanced:{priority:20,label:"Advanced"}},defaultGroup:"core"}),na=()=>ra.useItems(),oa=ra.register,ia=ra.registerGroup,sa=()=>ra.getItems(),la=(0,zt.createRegistry)({name:"cta-editor/list-options",groups:{import:{priority:10,label:"Import"}}}),ua=()=>la.useItems(),ca=la.register,ha=la.registerGroup,pa=()=>la.getItems(),da=()=>{const e=(0,ht.useRef)(void 0),t=(0,ht.useRef)(),[a,r]=(0,ht.useState)(!1),n=Jt(),{bulkSelection:o=[]}=Ht(),i={};if(0===o.length)return null;const s=({group:t})=>{if(!t||t===e.current)return null;const a=e.current;return e.current=t,a?(0,xt.jsx)("hr",{}):null};return(0,xt.jsx)(xt.Fragment,{children:(0,xt.jsx)(St.Dropdown,{className:"list-table-bulk-actions",contentClassName:"list-table-bulk-actions__popover",placement:"bottom left",focusOnMount:"firstElement",open:a,popoverProps:{noArrow:!1,anchor:{getBoundingClientRect:()=>t.current?.getBoundingClientRect()||new DOMRect},onClose:()=>{r(!1)},onFocusOutside:()=>{r(!1)}},renderToggle:()=>(0,xt.jsxs)(St.Flex,{children:[(0,xt.jsx)("span",{className:"selected-items",children:(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt._n)("%d item selected","%d items selected",o.length,"popup-maker"),o.length)}),(0,xt.jsxs)(St.Button,{className:"popover-toggle",ref:e=>{t.current=e},"aria-label":(0,gt.__)("Bulk Actions","popup-maker"),variant:"secondary",onClick:()=>r(!a),"aria-expanded":a,icon:Lt.CheckAll,iconSize:20,children:[(0,gt.__)("Bulk Actions","popup-maker"),(0,xt.jsx)(St.Icon,{className:"toggle-icon",icon:a?Vt:wt})]})]}),renderContent:({onClose:t})=>(e.current=void 0,(0,xt.jsx)(St.NavigableMenu,{orientation:"vertical",children:n.map(({id:e,group:a,render:r})=>(0,xt.jsxs)(ht.Fragment,{children:[(0,xt.jsx)(s,{group:a}),(0,xt.jsx)(r,{...i,onClose:t})]},e))}))})})},ma=({values:e})=>{const t=(0,ht.useRef)(void 0),a=Xt(),r={values:e};if(0===a.length)return null;const n=({group:e})=>{if(!e||e===t.current)return null;const a=t.current;return t.current=e,a?(0,xt.jsx)("span",{children:"|"}):null};return(0,xt.jsx)("div",{className:"item-actions",children:(t.current=void 0,(0,xt.jsx)(xt.Fragment,{children:a.map(({id:e,group:t,render:a})=>(0,xt.jsxs)(ht.Fragment,{children:[(0,xt.jsx)(n,{group:t}),(0,xt.jsx)(a,{...r})]},e))}))})},fa=()=>{const{filters:e={},setFilters:t,callToActions:a=[],filteredCallToActions:r=[]}=Ht(),n=na(),o=(0,ht.useRef)(void 0),i=(0,ht.useCallback)(({group:e})=>e&&e!==o.current?(o.current,o.current=e,null):null,[]),s=(0,ht.useCallback)(()=>(o.current=void 0,(0,xt.jsx)(xt.Fragment,{children:n.map(({id:n,group:o,render:s})=>(0,xt.jsxs)(ht.Fragment,{children:[(0,xt.jsx)(i,{group:o}),(0,xt.jsx)(s,{filters:e,setFilters:t,onClose:()=>{},items:a,filteredItems:r})]},n))})),[n,e,t,a,r,i]);return 0===n.length?null:(0,xt.jsx)("div",{className:"list-table-filters",children:s()})},ga=()=>{const e=(0,ht.useRef)(),t=(0,ht.useRef)(void 0),[a,r]=(0,ht.useState)(!1),n=ua(),o={};if(0===n.length)return null;const i=({group:e})=>{if(!e||e===t.current)return null;const a=t.current;return t.current=e,a?(0,xt.jsx)("hr",{}):null};return(0,xt.jsx)(St.Dropdown,{className:"list-table-options-menu",contentClassName:"list-table-options-menu__popover",placement:"bottom left",focusOnMount:"firstElement",open:a,popoverProps:{noArrow:!1,anchor:{getBoundingClientRect:()=>e.current?.getBoundingClientRect()||new DOMRect},onClose:()=>{r(!1)},onFocusOutside:()=>{r(!1)}},renderToggle:()=>(0,xt.jsx)(St.Button,{className:"popover-toggle","aria-label":(0,gt.__)("Additional options","popup-maker"),icon:jt,onClick:()=>r(!a),"aria-expanded":a,ref:t=>{e.current=t}}),renderContent:({onClose:e})=>(t.current=void 0,(0,xt.jsx)(St.NavigableMenu,{orientation:"vertical",children:n.map(({id:t,group:a,render:r})=>(0,xt.jsxs)(ht.Fragment,{children:[(0,xt.jsx)(i,{group:a}),(0,xt.jsx)(r,{...o,onClose:e})]},t))}))})},{cta_types:Sa}=window.popupMakerCtaAdmin,va=()=>{const{setEditorId:e}=(0,Mt.useEditor)(),[t,a]=(0,ht.useState)(!1),[r,n]=(0,ht.useState)(),o=()=>n(void 0);return(0,xt.jsx)(Ut,{children:(0,xt.jsx)(Wt,{children:({isLoading:n,bulkSelection:i=[],setBulkSelection:s=At.noop,filteredCallToActions:l=[],updateCallToAction:u=At.noop,filters:{searchText:c=""},setFilters:h,sortConfig:p,setSortConfig:d})=>(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(Nt.ConfirmDialogue,{...r,onClose:o}),(0,xt.jsxs)("div",{className:"list-table-container",children:[n&&(0,xt.jsx)("div",{className:"is-loading",children:(0,xt.jsx)(St.Spinner,{})}),(0,xt.jsxs)("div",{className:"list-table-header",children:[(0,xt.jsxs)("div",{className:"list-search",children:[(0,xt.jsx)(St.Icon,{icon:_t}),(0,xt.jsx)(St.TextControl,{placeholder:(0,gt.__)("Search Call to Actions…","popup-maker"),value:c??"",onChange:e=>h({searchText:""!==e?e:void 0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]}),(0,xt.jsx)(da,{}),0===i.length&&(0,xt.jsx)(St.Button,{className:"filters-toggle",variant:"secondary",onClick:()=>{a(!t)},"aria-expanded":t,icon:Lt.FilterLines,iconSize:20,text:t?(0,gt.__)("Hide Filters","popup-maker"):(0,gt.__)("Filters","popup-maker")}),(0,xt.jsx)(ga,{})]}),t&&(0,xt.jsx)(fa,{}),(0,xt.jsx)(Nt.ListTable,{selectedItems:i,onSelectItems:e=>s(e),items:n?[]:l,columns:{enabled:()=>(0,xt.jsx)(St.Tooltip,{text:(0,gt.__)("Enable or disable the call to action","popup-maker"),placement:"top-end",children:(0,xt.jsx)("span",{children:(0,xt.jsx)(St.Icon,{icon:bt})})}),title:(0,gt.__)("Name","popup-maker"),description:(0,gt.__)("Description","popup-maker"),type:(0,gt.__)("Type","popup-maker"),conversions:(0,gt.__)("Conversions","popup-maker"),status:(0,gt.__)("Status","popup-maker")},sortableColumns:["type","title","conversions"],onSort:(e,t)=>{d({orderby:e,order:t})},initialSort:p,rowClasses:e=>[`call-to-action-${e.id}`,`status-${e.status}`],renderCell:(t,a)=>{const r=a.status,n="trash"===r,o="publish"===r;switch(t){case"enabled":return(0,xt.jsx)(St.ToggleControl,{label:"","aria-label":(0,gt.__)("Enable or disable the call to action","popup-maker"),checked:o,disabled:n,onChange:e=>{u({id:a.id,status:e?"publish":"draft"})},__nextHasNoMarginBottom:!0});case"status":return n?(0,xt.jsx)(St.Icon,{"aria-label":(0,gt.__)("In Trash","popup-maker"),icon:Rt,size:20}):(0,xt.jsx)("span",{children:o?(0,gt.__)("Enabled","popup-maker"):(0,gt.__)("Disabled","popup-maker")});case"title":return(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(St.Button,{variant:"link",onClick:()=>e(a.id),children:(0,Tt.decodeEntities)(a.title.rendered)}),(0,xt.jsx)(ma,{values:a})]});case"conversions":return a.stats?.conversions??0;case"type":return(e=>{const t=Object.values(Sa).find(({key:t})=>t===e);return t?.label??""})(a.settings.type);case"description":return(0,Tt.decodeEntities)(a.excerpt?.raw||"");default:return a[t]??a.settings[t]??""}}})]})]})})})},Pa=()=>{const{setEditorId:e}=(0,Mt.useEditor)(),t=(0,pt.useSelect)(e=>e(Ot.callToActionStore).getCallToActions(),[]),a=(0,pt.useSelect)(e=>e(Ot.callToActionStore).isResolving("getCallToActions"),[]),{createCallToAction:r}=(0,pt.useDispatch)(Ot.callToActionStore),n=t?.length??0;return(0,xt.jsxs)("header",{className:"popup-maker-call-to-actions-view__header",children:[(0,xt.jsx)("h1",{className:"view-title wp-heading-inline",children:(0,gt.__)("Call to Actions","popup-maker")}),(0,xt.jsx)("span",{className:"item-count",children:a?(0,xt.jsx)(St.Spinner,{}):(0,gt.sprintf)(/* translators: %d: number of items. */ /* translators: %d: number of items. */
(0,gt._n)("%d item","%d items",n,"popup-maker"),n)}),(0,xt.jsx)(St.Button,{className:"add-call-to-action",onClick:async()=>{const t=await r({title:(0,gt.__)("New Call to Action","popup-maker")});t&&e(t.id)},variant:"primary",children:(0,gt.__)("Add Call to Action","popup-maker")})]})},xa=()=>{const e=(0,ht.useRef)({}),{notices:t,isEditorActive:a}=(0,pt.useSelect)(e=>({notices:e(Ot.callToActionStore).getNotices(),isEditorActive:e(Ot.callToActionStore).isEditorActive()}),[]),{removeNotice:r}=(0,pt.useDispatch)(Ot.callToActionStore),n=(0,ht.useCallback)(t=>{e.current[t]&&(clearTimeout(e.current[t]),delete e.current[t]),r(t)},[r]);return(0,ht.useLayoutEffect)(()=>{t.forEach(t=>{if(e.current[t.id])return;const a=t.id?.startsWith("field-error-");a||Mt.DEBUG_MODE||(e.current[t.id]=setTimeout(()=>{n(t.id)},3e3))})},[t,n]),!t.length||a?null:(0,xt.jsx)("div",{className:"notices",children:t.map(e=>(0,xt.jsx)(St.Notice,{status:e.status,isDismissible:e.isDismissible,onRemove:()=>n(e.id),children:e.content},e.id))})},ya=()=>"undefined"!=typeof window&&window.popupMaker.globalVars?window.popupMaker.globalVars:{version:"1.0.0",wpVersion:6.5,pluginUrl:"",assetsUrl:"",adminUrl:"",nonce:"",permissions:{edit_ctas:!1,edit_popups:!1,edit_popup_themes:!1,mange_settings:!1}},wa=()=>{const{permissions:e={edit_ctas:!1}}=ya(),{edit_ctas:t}=e;if(!t)return(0,xt.jsxs)("div",{className:"call-to-action-list permission-denied",children:[(0,xt.jsx)(xa,{}),(0,xt.jsx)("h3",{children:(0,gt.__)("Permission Denied","popup-maker")}),(0,xt.jsx)("p",{children:(0,xt.jsx)("strong",{children:(0,gt.__)("You do not have permission to manage Call To Actions.","popup-maker")})})]});const a=(0,Mt.withQueryParams)((0,Mt.withModal)(Mt.Editor));return(0,xt.jsxs)("div",{className:"call-to-action-list",children:[(0,xt.jsx)(xa,{}),(0,xt.jsx)(Pa,{}),(0,xt.jsx)(va,{}),(0,xt.jsx)(a,{})]})},Va=()=>{const{permissions:e={edit_ctas:!1}}=ya(),{edit_ctas:t}=e,[{view:a="call-to-actions"},r]=(0,it.useQueryParams)({tab:it.StringParam,view:it.StringParam}),n=(0,ht.useMemo)(()=>{let e=[];return t&&e.push({name:"call-to-actions",title:(0,gt.__)("Call to Actions","popup-maker"),className:"call-to-actions",pageTitle:(0,gt.__)("Popup Maker - Call to Actions","popup-maker"),heading:(0,gt.__)("Popup Maker - Call to Actions","popup-maker"),comp:wa}),e=(0,ct.applyFilters)("popupMaker.callToActionEditor.views",[...e],{view:a,setParams:r}),e},[a,r,t]),o=n.find(e=>e.name===a),i=o?.comp?o.comp:()=>(0,xt.jsx)(xt.Fragment,{});return(0,ht.useEffect)(()=>{document.title=n.find(e=>e.name===a)?.pageTitle??(0,gt.__)("Popup Maker","popup-maker")},[a,n]),(0,xt.jsxs)(vt.AppLayout,{className:ft(["popup-maker-call-to-actions-page",`view-${a}`]),children:[(0,xt.jsx)(vt.AppHeader,{navTabId:"call-to-actions",tabs:n,currentTab:a??void 0,onTabChange:e=>r({view:e})}),(0,xt.jsx)(vt.AppContent,{children:(0,xt.jsx)(i,{})}),(0,xt.jsx)(St.Popover.Slot,{})]})},Ga={id:"enable",group:"status",priority:5,render:()=>{const e=(0,pt.useRegistry)(),{bulkSelection:t=[],setBulkSelection:a}=Ht(),{getCallToAction:r}=(0,pt.useSelect)(e=>({getCallToAction:e(Ot.callToActionStore).getCallToAction}),[]),{createNotice:n,updateCallToAction:o}=(0,pt.useDispatch)(Ot.callToActionStore);return 0===t.length?null:t.some(e=>{const t=r(e);return"publish"!==t?.status})?(0,xt.jsx)(St.Button,{icon:kt,text:(0,gt.__)("Enable","popup-maker"),onClick:()=>{e.batch(()=>{const e=t.length;t.forEach(e=>{const t=r(e);t?.id===e&&o({id:e,status:"publish"},!1,!1)}),a([]),n("success",(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt._n)("%d call to action enabled.","%d call to actions enabled.",e,"popup-maker"),e),{id:"bulk-enable"})})}}):null}},ba={id:"disable",group:"status",priority:6,render:()=>{const{bulkSelection:e=[],setBulkSelection:t}=Ht(),a=(0,pt.useRegistry)(),{getCallToAction:r}=(0,pt.useSelect)(e=>({getCallToAction:e(Ot.callToActionStore).getCallToAction}),[]),{createNotice:n,updateCallToAction:o}=(0,pt.useDispatch)(Ot.callToActionStore);return 0===e.length?null:e.some(e=>{const t=r(e);return"draft"!==t?.status})?(0,xt.jsx)(xt.Fragment,{children:(0,xt.jsx)(St.Button,{icon:Ct,text:(0,gt.__)("Disable","popup-maker"),onClick:()=>{a.batch(()=>{const a=e.length;e.forEach(e=>{const t=r(e);t?.id===e&&o({id:e,status:"draft"},!1,!1)}),t([]),n("success",(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt._n)("%d call to action disabled.","%d call to actions disabled.",a,"popup-maker"),a),{id:"bulk-disable"})})}})}):null}},ka={id:"trash",group:"trash",priority:5,render:()=>{const[e,t]=(0,ht.useState)(),{bulkSelection:a=[],setBulkSelection:r,deleteCallToAction:n}=Ht(),o=(0,pt.useRegistry)(),{getCallToAction:i}=(0,pt.useSelect)(e=>({getCallToAction:e(Ot.callToActionStore).getCallToAction}),[]),{createNotice:s}=(0,pt.useDispatch)(Ot.callToActionStore);return 0===a.length?null:a.some(e=>{const t=i(e);return"trash"!==t?.status})?(0,xt.jsxs)(xt.Fragment,{children:[e&&(0,xt.jsx)(Nt.ConfirmDialogue,{...e,onClose:()=>t(void 0)}),(0,xt.jsx)(St.Button,{text:(0,gt.__)("Trash","popup-maker"),icon:Rt,onClick:()=>{t({isDestructive:!0,message:(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt.__)("Are you sure you want to trash %d items?","popup-maker"),a.length),callback:()=>{o.batch(()=>{const e=a.length;a.forEach(e=>n(e,!1,!1)),r([]),s("success",(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt._n)("%d call to action moved to trash.","%d call to actions moved to trash.",e,"popup-maker"),e),{id:"bulk-trash"})})}})}})]}):null}},Ca={id:"delete",group:"trash",priority:6,render:()=>{const[e,t]=(0,ht.useState)(),{bulkSelection:a=[],setBulkSelection:r}=Ht(),n=(0,pt.useRegistry)(),{createNotice:o,deleteCallToAction:i}=(0,pt.useDispatch)(Ot.callToActionStore);return 0===a.length?null:(0,xt.jsxs)(xt.Fragment,{children:[e&&(0,xt.jsx)(Nt.ConfirmDialogue,{...e,onClose:()=>t(void 0)}),(0,xt.jsx)(St.Button,{text:(0,gt.__)("Delete Permanently","popup-maker"),icon:yt,isDestructive:!0,onClick:()=>{t({isDestructive:!0,message:(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt.__)("Are you sure you want to premanently delete %d items?","popup-maker"),a.length),callback:()=>{n.batch(()=>{const e=a.length;a.forEach(e=>i(e,!0,!1)),r([]),o("success",(0,gt.sprintf)(
// translators: %d: number of items.
// translators: %d: number of items.
(0,gt._n)("%d call to action deleted.","%d call to actions deleted.",e,"popup-maker"),e),{id:"bulk-delete"})})}})}})]})}},ja={id:"export",group:"export",priority:5,render:()=>{const[e,t]=(0,ht.useState)(!1),a=(0,ht.useRef)(null);return(0,xt.jsxs)(xt.Fragment,{children:[e&&(0,xt.jsx)(St.Popover,{anchor:a.current,onClose:()=>t(!1),children:(0,xt.jsxs)(St.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",className:"pmp-popover-content",style:{padding:"16px",minWidth:"350px"},children:[(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:28}),(0,xt.jsx)("h3",{style:{margin:0},children:(0,gt.__)("Quick exports with Popup Maker Pro","popup-maker")}),(0,xt.jsx)("p",{style:{margin:0},children:(0,gt.__)("Popup Maker Pro gives you the power to import & export your call to actions to a JSON file in seconds.","popup-maker")}),(0,xt.jsx)(St.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=export-cta",target:"_blank",children:(0,gt.__)("Learn more or upgrade today","popup-maker")})]})}),(0,xt.jsxs)(St.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>t(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,xt.jsx)(St.Button,{icon:Gt,text:(0,gt.__)("Export","popup-maker"),disabled:!0,showTooltip:!0,label:(0,gt.__)("Export is available with Popup Maker Pro","popup-maker"),ref:a}),(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:14})]})]})}},_a={all:(0,gt.__)("All","popup-maker"),publish:(0,gt.__)("Enabled","popup-maker"),draft:(0,gt.__)("Disabled","popup-maker"),pending:(0,gt.__)("Pending","popup-maker"),trash:(0,gt.__)("Trash","popup-maker"),future:(0,gt.__)("Future","popup-maker"),private:(0,gt.__)("Private","popup-maker")},Ra={id:"status",priority:10,group:"core",render:({filters:e,setFilters:t,onClose:a,items:r,filteredItems:n})=>{const[o,i]=(0,ht.useState)(!1),s=(0,ht.useRef)(null),l=(0,ht.useMemo)(()=>r.reduce((e,t)=>(e[t.status]=(e[t.status]??0)+1,e.all++,e),{all:0}),[r]),u=(0,ht.useMemo)(()=>n.reduce((e,t)=>(e[t.status]=(e[t.status]??0)+1,e.all++,e),{all:0}),[n]),c=e?.status??"all";return(0,xt.jsxs)("div",{className:ft(["list-table-filter list-table-filter--status",o?"is-active":""]),children:[(0,xt.jsxs)(St.Button,{className:"filter-button",onClick:()=>i(!o),ref:s,children:[(0,xt.jsxs)("span",{className:"filter-label",children:[(0,gt.__)("Status","popup-maker"),":"]})," ",(0,xt.jsx)("span",{className:"filter-selection",children:_a[c]}),(0,xt.jsx)(St.Icon,{className:"filter-icon",icon:o?Vt:wt})]}),o&&s.current&&(0,xt.jsx)(St.Popover,{className:"list-table-filters__popover",anchor:s.current,onClose:()=>{i(!1),a()},position:"bottom right",onFocusOutside:()=>{i(!1),a()},children:(0,xt.jsx)(St.RadioControl,{label:(0,gt.__)("Status","popup-maker"),hideLabelFromVision:!0,selected:c,options:Object.entries(_a).filter(([e])=>{return(l[c]??0)>0?(t=e,Boolean(u?.[t])):(l[e]??0)>0;var t}).map(([e,t])=>({label:`${t} (${u[e]??0})`,value:e})),onChange:e=>{t({status:e}),i(!1),a()}})})]})}},Ea={id:"type",group:"core",render:({filters:e,setFilters:t,onClose:a,items:r,filteredItems:n})=>{const[o,i]=(0,ht.useState)(!1),s=(0,ht.useRef)(null),l=(0,ht.useMemo)(()=>{const{cta_types:e}=window.popupMakerCtaAdmin;return Object.values(e).reduce((e,{key:t,label:a})=>({...e,[t]:a}),{all:(0,gt.__)("All","popup-maker")})},[]),u=(0,ht.useMemo)(()=>r.reduce((e,t)=>{const a=t.settings.type;return e[a]=(e[a]??0)+1,e.all++,e},{all:0}),[r]),c=(0,ht.useMemo)(()=>n.reduce((e,t)=>{const a=t.settings.type;return e[a]=(e[a]??0)+1,e.all++,e},{all:0}),[n]);return(0,xt.jsxs)("div",{className:ft(["list-table-filter list-table-filter--type",o?"is-active":""]),children:[(0,xt.jsxs)(St.Button,{className:"filter-button",onClick:()=>i(!o),ref:s,children:[(0,xt.jsxs)("span",{className:"filter-label",children:[(0,gt.__)("Type","popup-maker"),":"]})," ",(0,xt.jsx)("span",{className:"filter-selection",children:l[e?.type??"all"]}),(0,xt.jsx)(St.Icon,{className:"filter-icon",icon:o?Vt:wt})]}),o&&s.current&&(0,xt.jsx)(St.Popover,{className:"list-table-filters__popover",anchor:s.current,onClose:()=>{i(!1),a()},position:"bottom right",onFocusOutside:()=>{i(!1),a()},children:(0,xt.jsx)(St.RadioControl,{label:(0,gt.__)("Type","popup-maker"),hideLabelFromVision:!0,selected:e?.type??"all",options:Object.entries(l).filter(([t])=>(u[e?.type??"all"]??0)>0?(e=>Boolean(c?.[e]))(t):(u[t]??0)>0).map(([e,t])=>({label:`${t} (${c[e]??0})`,value:e})),onChange:e=>{t({type:"all"===e?void 0:e}),i(!1),a()}})})]})}},Ta={id:"import",group:"export",render:()=>{const[e,t]=(0,ht.useState)(!1),a=(0,ht.useRef)(null);return(0,xt.jsxs)(xt.Fragment,{children:[e&&(0,xt.jsx)(St.Popover,{anchor:a.current,onClose:()=>t(!1),children:(0,xt.jsxs)(St.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",style:{padding:"16px",minWidth:"350px"},children:[(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:28}),(0,xt.jsx)("h3",{style:{margin:0},children:(0,gt.__)("Quick imports with Popup Maker Pro","popup-maker")}),(0,xt.jsx)("p",{style:{margin:0},children:(0,gt.__)("Popup Maker Pro gives you the power to import your call to actions from a JSON file in seconds.","popup-maker")}),(0,xt.jsx)(St.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=import-cta",target:"_blank",children:(0,gt.__)("Learn more or upgrade today","popup-maker")})]})}),(0,xt.jsxs)(St.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>t(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,xt.jsx)(St.Button,{icon:Et,text:(0,gt.__)("Import","popup-maker"),disabled:!0,showTooltip:!0,label:(0,gt.__)("Import is available with Popup Maker Pro","popup-maker"),ref:a}),(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:14})]})]})}},Aa={id:"export",group:"export",render:()=>{const[e,t]=(0,ht.useState)(!1),a=(0,ht.useRef)(null);return(0,xt.jsxs)(xt.Fragment,{children:[e&&(0,xt.jsx)(St.Popover,{anchor:a.current,onClose:()=>t(!1),children:(0,xt.jsxs)(St.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",className:"pmp-popover-content",style:{padding:"16px",minWidth:"350px"},children:[(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:28}),(0,xt.jsx)("h3",{style:{margin:0},children:(0,gt.__)("Quick exports with Popup Maker Pro","popup-maker")}),(0,xt.jsx)("p",{style:{margin:0},children:(0,gt.__)("Popup Maker Pro gives you the power to import & export your call to actions to a JSON file in seconds.","popup-maker")}),(0,xt.jsx)(St.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=export-cta",target:"_blank",children:(0,gt.__)("Learn more or upgrade today","popup-maker")})]})}),(0,xt.jsxs)(St.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>t(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,xt.jsx)(St.Button,{icon:Gt,text:(0,gt.__)("Export","popup-maker"),disabled:!0,showTooltip:!0,label:(0,gt.__)("Export is available with Popup Maker Pro","popup-maker"),ref:a}),(0,xt.jsx)(St.Icon,{icon:Lt.Mark,size:14})]})]})}},La={id:"edit",group:"general",priority:-1,render:({values:e})=>{const{setEditorId:t}=(0,Mt.useEditor)();return(0,xt.jsxs)(xt.Fragment,{children:[`${(0,gt.__)("ID","popup-maker")}: ${e.id}`,(0,xt.jsx)(St.Button,{text:(0,gt.__)("Edit","popup-maker"),variant:"link",onClick:()=>t(e.id)})]})}},Ma={id:"trash",group:"trash",priority:11,render:({values:e})=>{const[t,a]=(0,ht.useState)(),r=(0,pt.useSelect)(e=>e(Ot.callToActionStore).isResolving("deleteCallToAction"),[]),{deleteCallToAction:n,updateCallToAction:o}=(0,pt.useDispatch)(Ot.callToActionStore),i="trash"===e.status;return(0,xt.jsxs)(xt.Fragment,{children:[t&&(0,xt.jsx)(Nt.ConfirmDialogue,{...t,onClose:()=>a(void 0)}),(0,xt.jsx)(St.Button,{text:i?(0,gt.__)("Untrash","popup-maker"):(0,gt.__)("Trash","popup-maker"),variant:"link",isDestructive:!0,isBusy:!!r,onClick:()=>i?o({id:e.id,status:"draft"}):n(e.id)})]})}},Na={id:"delete",group:"trash",priority:12,render:({values:e})=>{const[t,a]=(0,ht.useState)(),r=(0,pt.useSelect)(e=>e(Ot.callToActionStore).isResolving("deleteCallToAction"),[]),{deleteCallToAction:n}=(0,pt.useDispatch)(Ot.callToActionStore);return"trash"===e.status?(0,xt.jsxs)(xt.Fragment,{children:[t&&(0,xt.jsx)(Nt.ConfirmDialogue,{...t,onClose:()=>a(void 0)}),(0,xt.jsx)(St.Button,{text:(0,gt.__)("Delete Permanently","popup-maker"),variant:"link",isDestructive:!0,isBusy:!!r,onClick:()=>a({message:(0,gt.__)("Are you sure you want to premanently delete this call to action?","popup-maker"),callback:()=>{n(e.id,!0)},isDestructive:!0})})]}):null}},Oa=()=>{const e=document.getElementById("popup-maker-call-to-actions-root-container");e&&(Object.values(i).forEach(e=>{Zt(e)}),Object.values(l).forEach(e=>{ca(e)}),Object.values(u).forEach(e=>{ea(e)}),Object.values(s).forEach(e=>{oa(e)}),(0,ct.doAction)("popupMaker.ctaAdmin.init"),(0,ht.createRoot)(e).render((0,xt.jsx)(et,{children:(0,xt.jsx)(it.QueryParamProvider,{adapter:st,children:(0,xt.jsx)(pt.RegistryProvider,{value:dt.registry,children:(0,xt.jsx)(Va,{})})})})))};ut()(Oa),(window.popupMaker=window.popupMaker||{}).ctaAdmin=o})();