Edit file File name : index.js Content :/*! For license information please see index.js.LICENSE.txt */ (()=>{var e={841:(e,t,a)=>{"use strict";a.d(t,{qw:()=>Ka,Dv:()=>Ya,bZ:()=>Ja,iO:()=>Qa,$n:()=>Ie,Y9:()=>M,so:()=>we,oz:()=>Me,OL:()=>be});var n={};a.r(n),a.d(n,{getSettingsBox:()=>q,getSettingsButton:()=>W,getSettingsDisplay:()=>F,getSettingsScheme:()=>G,getSettingsSettings:()=>U,getSettingsWoocommerce:()=>H});var r={};a.r(r),a.d(r,{saveBoxSettings:()=>re,saveButtonSettings:()=>ne,saveDisplaySettings:()=>le,saveSchemeSettings:()=>se,saveSettings:()=>ae,saveSettingsSettings:()=>oe,saveWoocommerceSettings:()=>ie,setSettingsBox:()=>J,setSettingsButton:()=>Q,setSettingsContact:()=>K,setSettingsDisplay:()=>Z,setSettingsScheme:()=>$,setSettingsSettings:()=>ee,setSettingsWoocommerce:()=>te});var l={};a.r(l),a.d(l,{getSettingsBox:()=>ue,getSettingsButton:()=>ce,getSettingsDisplay:()=>pe,getSettingsScheme:()=>me,getSettingsSettings:()=>de,getSettingsWoocommerce:()=>he});var s={};a.r(s),a.d(s,{getContacts:()=>He});var o={};a.r(o),a.d(o,{createContact:()=>Qe,deleteContact:()=>Je,editContact:()=>Ze,saveContacts:()=>Ke,saveSettings:()=>$e,setContacts:()=>Ye});var i={};a.r(i),a.d(i,{getContacts:()=>et});var c=a(87);const u=window.wp.editor;var p=a(723);const m=window.wp.hooks;var d=a(746),h=(a(455),a(692)),f=a(143);const{WP_VERSION:g,QLWAPP_PLUGIN_NAME:w,QLWAPP_PLUGIN_VERSION:v,QLWAPP_PLUGIN_FILE:y,QLWAPP_PLUGIN_DIR:E,QLWAPP_WORDPRESS_URL:b,QLWAPP_REVIEW_URL:_,QLWAPP_DEMO_URL:A,QLWAPP_SUPPORT_URL:S,QLWAPP_PREMIUM_SELL_URL:x,QLWAPP_DOCUMENTATION_URL:C,QLWAPP_GROUP_URL:P,QLWAPP_DEVELOPER:N,QLWAPP_PLUGIN_URL:T,QLWAPP_TIMEZONE_OPTIONS:k,QLWAPP_MESSAGE_REPLACEMENTS:O}=qlwappHelpers;function I(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e).sort(),n=Object.keys(t).sort();if(a.length!==n.length)return!1;for(let e=0;e<a.length;e++)if(a[e]!==n[e])return!1;for(const n of a){const a=e[n],r=t[n];if("object"==typeof a&&null!==a&&"object"==typeof r&&null!==r){if(!I(a,r))return!1}else if(a!==r)return!1}return!0}function R(e,t){const a={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach((n=>{e.hasOwnProperty(n)&&t.hasOwnProperty(n)?!function(e){const t=typeof e;return null!=e&&("object"==t||"function"==t)}(e[n])||Array.isArray(e[n])?a[n]=t[n]:a[n]=R(e[n],t[n]):e.hasOwnProperty(n)?a[n]=e[n]:t.hasOwnProperty(n)&&(a[n]=t[n])})),a}const M=()=>(0,c.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,c.createElement)("h1",null,w),(0,c.createElement)("p",{className:"about-text"},(0,p.sprintf)((0,p.__)("Thanks for using %s! We will do our best to offer you the best and improved communication experience with your users.","wp-whatsapp-chat!"),w)),(0,c.createElement)("p",{className:"about-text"},(0,c.createElement)("a",{href:x,target:"__blank"},(0,p.__)("Premium","wp-whatsapp-chat")),"|",(0,c.createElement)("a",{href:A,target:"__blank"},(0,p.__)("Demo","wp-whatsapp-chat")),"|",(0,c.createElement)("a",{href:C,target:"__blank"},(0,p.__)("Documentation","wp-whatsapp-chat"))),(0,c.createElement)("a",{href:"https://quadlayers.com/?utm_source=qlwapp_admin",target:"_blank",rel:"noreferrer"},(0,c.createElement)("div",{style:{backgroundImage:`url(${T+"/assets/backend/img/quadlayers.jpg"})`},className:"wp-badge qlwapp_quadlayers__logo"},"QuadLayers")));var D=a(500),L=a.n(D);const j="qlwapp/menu/store",B={button:{layout:"yes",box:"no",position:"bottom-right",text:"",message:"",icon:"",type:"phone",phone:"",group:"",developer:"no",rounded:"yes",timefrom:"00:00",timeto:"00:00",timedays:[],timezone:"",visibility:"readonly",timeout:"readonly",animation_name:"",animation_delay:0},box:{auto_open:"yes",auto_delay_open:1e3,lazy_load:"yes",header:"",footer:"",response:""},display:{devices:"all",target:{include:1,ids:[]},entries:{post:{include:1,ids:[]},page:{include:1,ids:[]}},taxonomies:{category:{include:1,ids:[]},tags:{include:1,ids:[]},product_cat:{include:1,ids:[]}}},scheme:{font_family:"inherit",font_size:"",brand:"",text:"",icon_size:"",icon_font_size:"",role_color:"#f00",name_color:"#f00",availability_color:"#f00"},settings:{googleAnalytics:"disable",googleAnalyticsScript:"no",googleAnalyticsV3Id:"",googleAnalyticsV4Id:"",googleAnalyticsLabel:"",googleAnalyticsCategory:""},woocommerce:{position:"none",text:"",message:"",icon:"",phone:"",rounded:"yes",timefrom:"00:00",timeto:"00:00",timedays:[],timezone:"",position_priority:10}},W=e=>e.button,q=e=>e.box,F=e=>e.display,G=e=>e.scheme,U=e=>e.settings,H=e=>e.woocommerce,z=window.wp.url,{QLWAPP_API_REST_ROUTES:V}=qlwappApiAdminMenu,X=({method:e,data:t,route:a}={})=>{const n="GET"===e?(0,z.addQueryArgs)(V[a],t):V[a];return(0,d.apiFetch)({path:n,method:e,data:t})};function Y(){const{setSettingsButton:e,saveButtonSettings:t}=(0,f.useDispatch)(j),{settingsButton:a,isResolvingSettingsButton:n,hasResolvedSettingsButton:r}=(0,f.useSelect)((e=>{const{getSettingsButton:t,isResolving:a,hasFinishedResolution:n}=e(j);return{settingsButton:t(),isResolvingSettingsButton:a("getSettingsButton"),hasResolvedSettingsButton:n("getSettingsButton")}}),[]);return{settingsButton:a,isResolvingSettingsButton:n,hasResolvedSettingsButton:r,hasSettingsButton:!(!r||!Object.keys(a)?.length),saveButtonSettings:t,setSettingsButton:e}}const Q=e=>({type:"SET_BUTTON",payload:t=>R(t,e)}),J=e=>({type:"SET_BOX",payload:t=>R(t,e)}),K=e=>({type:"SET_CONTACT",payload:t=>R(t,e)}),Z=e=>({type:"SET_DISPLAY",payload:t=>R(t,e)}),$=e=>({type:"SET_SCHEME",payload:t=>R(t,e)}),ee=e=>({type:"SET_SETTINGS",payload:t=>R(t,e)}),te=e=>({type:"SET_WOOCOMMERCE",payload:t=>R(t,e)}),ae=(e,t)=>async({registry:a,dispatch:n})=>{if(!t)throw new Error("Route is required.");const r=t.charAt(0).toUpperCase()+t.slice(1),l=await X({method:"POST",data:e,route:t});return l?.code?(a.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",l.code,l.message),{type:"snackbar"}),!1):(n[r?`setSettings${r}`:"setSettingsModules"]({...e}),a.dispatch(h.store).createSuccessNotice((0,p.sprintf)((0,p.__)("%s settings saved.","wp-whatsapp-chat"),r),{type:"snackbar"}),!0)},ne=e=>ae(e,"button"),re=e=>ae(e,"box"),le=e=>ae(e,"display"),se=e=>ae(e,"scheme"),oe=e=>ae(e,"settings"),ie=e=>ae(e,"woocommerce"),ce=async()=>{try{const e=await X({route:"button"});return Q(e)}catch(e){console.error(e)}},ue=async()=>{try{const e=await X({route:"box"});return J(e)}catch(e){console.error(e)}},pe=async()=>{try{const e=await X({route:"display"});return Z(e)}catch(e){console.error(e)}},me=async()=>{try{const e=await X({route:"scheme"});return $(e)}catch(e){console.error(e)}},de=async()=>{try{const e=await X({route:"settings"});return ee(e)}catch(e){console.error(e)}},he=async()=>{try{const e=await X({route:"woocommerce"});return te(e)}catch(e){console.error(e)}},fe=(0,f.combineReducers)({button:function(e=B.button,t){return"SET_BUTTON"===t.type?t.payload(e):e},box:function(e=B.box,t){return"SET_BOX"===t.type?t.payload(e):e},contact:function(e=B.contact,t){return"SET_CONTACT"===t.type?t.payload(e):e},display:function(e=B.display,t){return"SET_DISPLAY"===t.type?t.payload(e):e},scheme:function(e=B.scheme,t){return"SET_SCHEME"===t.type?t.payload(e):e},settings:function(e=B.settings,t){return"SET_SETTINGS"===t.type?t.payload(e):e},woocommerce:function(e=B.woocommerce,t){return"SET_WOOCOMMERCE"===t.type?t.payload(e):e}}),ge=(0,f.createReduxStore)(j,{reducer:fe,actions:r,selectors:n,resolvers:l});(0,f.register)((0,d.isVersionLessThan)(d.WP_VERSION,d.FIRST_WP_VERSION_WITH_THUNK_SUPPORT)?(0,d.applyThunkMiddleware)(ge):ge);const we=function(){const{currentTab:e,setCurrentTab:t,tabs:a}=Va(),{settingsButton:n}=Y();return(0,c.useEffect)((()=>{(e=>{const t=Array.from(document.querySelector("#toplevel_page_wp-whatsapp-chat .wp-submenu").children),a=e[0].toUpperCase()+e.slice(1).toLowerCase();t.forEach((e=>{e.innerText.trim()===a?e.classList.add("current"):e.classList.remove("current")}))})(e)}),[e]),(0,c.useEffect)((()=>{((e={})=>{Array.from(document.querySelector("#toplevel_page_wp-whatsapp-chat .wp-submenu").children).forEach((t=>{const a=t.innerText.trim().toLowerCase();["box","contacts"].includes(a)&&("no"===e.box?t.style.display="none":t.style.display="block")}))})(n)}),[n]),(0,c.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,c.createElement)("ul",{className:"nav-tab-wrapper"},a.filter((({name:e})=>!["box","contacts"].includes(e)||"yes"===n.box)).map((({label:a,name:n})=>(0,c.createElement)("li",{key:n,className:"qlwapp__nav-tab-li",onClick:e=>{e.preventDefault(),e.stopPropagation(),t(n)}},(0,c.createElement)("a",{href:"#",className:L()("nav-tab",e===n&&"nav-tab-active"),onClick:e=>{e.preventDefault()}},a))))))},ve=window.wp.components,ye=window.wp.compose,Ee=(0,c.createContext)({Slot:{Header:({children:e})=>e||null,Footer:({children:e})=>e||null,Content:({children:e})=>e||null,Aside:({children:e})=>e||null,Navigation:({children:e})=>e||null},Fill:{Header:({children:e})=>e||null,Footer:({children:e})=>e||null,Content:({children:e})=>e||null,Aside:({children:e})=>e||null,Navigation:({children:e})=>e||null}}),be=()=>(0,c.useContext)(Ee),_e=e=>{const t=(0,c.useRef)(),{children:a}=e,n=`wp-whatsapp-chat.admin.Control.Slot.${(0,ye.useInstanceId)(_e)}`,r={},l={},{Fill:s,Slot:o}=(0,c.useCallback)((0,ve.createSlotFill)(`${n}.header`),[n]),{Fill:i,Slot:u}=(0,c.useCallback)((0,ve.createSlotFill)(`${n}.navigation`),[n]),{Fill:p,Slot:m}=(0,c.useCallback)((0,ve.createSlotFill)(`${n}content`),[n]),{Fill:d,Slot:h}=(0,c.useCallback)((0,ve.createSlotFill)(`${n}.aside`),[n]),{Fill:f,Slot:g}=(0,c.useCallback)((0,ve.createSlotFill)(`${n}.footer`),[n]);return r.Header=o,l.Header=s,r.Navigation=u,l.Navigation=i,r.Content=m,l.Content=p,r.Aside=h,l.Aside=d,r.Footer=g,l.Footer=f,(0,c.createElement)(ve.SlotFillProvider,null,(0,c.createElement)(Ee.Provider,{value:{Slot:r,Fill:l,containerRef:t}},a))},Ae=Ee.Consumer,Se=({isSecondary:e,href:t,title:a,target:n="_self",tagName:r="a",className:l,children:s})=>{const o=r;return(0,c.createElement)(o,{className:L()("qlwapp__button",e&&"qlwapp__button--secondary",l),href:t,target:n,title:a},s)},xe=()=>(0,c.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,c.createElement)("div",{className:"has-2-columns is-wider-left"},(0,c.createElement)("div",{className:"column"},(0,c.createElement)("div",{className:"welcome-header"},(0,c.createElement)("h1",null,d.QLWAPP_PLUGIN_NAME,(0,c.createElement)("span",{style:{marginLeft:10,fontSize:"24px",color:"#555"}},"v",d.QLWAPP_PLUGIN_VERSION)),(0,c.createElement)("div",{className:"about-text"},(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("Hello we're QuadLayers! We've recently acquired this plugin and this is the first update. We have worked very much and very hard to release it, and we will do our absolute best to support it and fix all the issues.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)))),(0,c.createElement)("hr",null),(0,c.createElement)("div",{className:"feature-section"},(0,c.createElement)("h3",null,(0,p.__)("Premium","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("Thank you for choosing our %s plugin for WordPress! Here you can see our demo and test the features we offer in the premium version.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)),(0,c.createElement)(Se,{href:d.QLWAPP_PREMIUM_SELL_URL,target:"_blank"},(0,p.__)("Purchase Now","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section"},(0,c.createElement)("h3",null,(0,p.__)("Community","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("If you want to get in touch with other %s users or be aware of our promotional discounts join our community now.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)),(0,c.createElement)(Se,{href:d.QLWAPP_SUPPORT_URL,target:"_blank"},(0,p.__)("Get Support","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section"},(0,c.createElement)("h3",null,(0,p.__)("Demo","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("Thank you for choosing our %s plugin for WordPress! Here you can see our demo and a description about the features we offer in the premium version.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)),(0,c.createElement)(Se,{isSecondary:!0,href:d.QLWAPP_SUPPORT_URL,target:"_blank"},(0,p.__)("View Demo","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section"},(0,c.createElement)("h3",null,(0,p.__)("Support","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("If you have any doubt or you find any issue don't hesitate to contact us through our ticket system or join our community to meet other %s users.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)),(0,c.createElement)(Se,{isPrimary:!0,href:d.QLWAPP_SUPPORT_URL,target:"_blank"},(0,p.__)("Get Support","wp-whatsapp-chat")))),(0,c.createElement)("div",{className:"column"},(0,c.createElement)("img",{alt:d.QLWAPP_PLUGIN_NAME,src:(0,d.getPluginURL)("/assets/backend/img/box1.png")})))),Ce=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(xe,null)))},Pe=()=>(0,c.createElement)("div",{className:"wrap about-wrap full-width-layout qlwrap"},(0,c.createElement)("div",{className:"has-2-columns is-wider-left",style:{maxWidth:"100%"}},(0,c.createElement)("div",{className:"column"},(0,c.createElement)("div",{className:"welcome-header"},(0,c.createElement)("h1",null,(0,p.__)("Premium","wp-whatsapp-chat")),(0,c.createElement)("div",{className:"about-description"},(0,p.sprintf)((0,p.__)("Unlock the power of our premium %s plugin which allows you to include unlimited agent accounts with their names and labels inside the box to provide direct contact to the different support areas of your site.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME)),(0,c.createElement)("br",null),(0,c.createElement)(Se,{target:"_blank",href:d.QLWAPP_PREMIUM_SELL_URL},(0,p.__)("Purchase Now","wp-whatsapp-chat")),(0,c.createElement)(Se,{target:"_blank",href:d.QLWAPP_SUPPORT_URL},(0,p.__)("Get Support","wp-whatsapp-chat"))),(0,c.createElement)("hr",null),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Multiple agents","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.sprintf)((0,p.__)("%s allows you to include unlimited agent accounts with their names and labels inside the box to provide direct contact to the different support areas of your site.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME))),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Customize colors","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.__)("Customize the colors to match your site theme through the WordPress live customizer interface.","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Custom icons","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.__)("Our plugin allows you to select between more than forty icons to include in your Whatsapp button.","wp-whatsapp-chat")))),(0,c.createElement)("div",{className:"column"},(0,c.createElement)("img",{alt:(0,p.__)("Premium","wp-whatsapp-chat"),src:(0,d.getPluginURL)("/assets/backend/img/box1.png")}))),(0,c.createElement)("br",null),(0,c.createElement)("br",null),(0,c.createElement)("div",{className:"has-2-columns is-wider-right",style:{maxWidth:"100%"}},(0,c.createElement)("div",{className:"column"},(0,c.createElement)("img",{alt:(0,p.__)("Chatbox interface","wp-whatsapp-chat"),src:(0,d.getPluginURL)("/assets/backend/img/box2.png")})),(0,c.createElement)("div",{className:"column"},(0,c.createElement)("br",null),(0,c.createElement)("div",{className:"welcome-header"},(0,c.createElement)("h1",null,(0,p.__)("Chatbox interface","wp-whatsapp-chat")),(0,c.createElement)("div",{className:"about-description"},(0,p.sprintf)((0,p.__)("%s for WordPress allows you to include a chatbox for each agent where your users can type their first message.","wp-whatsapp-chat"),d.QLWAPP_PLUGIN_NAME))),(0,c.createElement)("hr",null),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Custom agent message","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.__)("Allow you to set a custom message for each agent that will be displayed on the chatbox.","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Custom user message","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.__)("You can choose the predefined user message that will be sent to the agent phone number.","wp-whatsapp-chat"))),(0,c.createElement)("div",{className:"feature-section",style:{margin:"15px 0"}},(0,c.createElement)("h3",null,(0,p.__)("Type user message","wp-whatsapp-chat")),(0,c.createElement)("p",null,(0,p.__)("Allow your users to type their own messages before sending it to the agent phone number.","wp-whatsapp-chat")))))),Ne=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(Pe,null)))};function Te(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}const ke=(0,ve.withFilters)("wp-whatsapp-chat.ButtonAddIcon")((function({value:e,onChange:t,isOpen:a,setIsOpen:n}){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("input",{type:"text",name:"icon",placeholder:e,value:e,className:"qlwapp-input",onChange:t}),(0,c.createElement)("button",{type:"button button-secondary",className:"button",onClick:e=>{e.preventDefault(),n(!0)}},(0,p.__)("Add Icon","wp-whatsapp-chat")),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))})),Oe=[{value:"0",label:(0,p.__)("Sunday","wp-whatsapp-chat")},{value:"1",label:(0,p.__)("Monday","wp-whatsapp-chat")},{value:"2",label:(0,p.__)("Tuesday","wp-whatsapp-chat")},{value:"3",label:(0,p.__)("Wednesday","wp-whatsapp-chat")},{value:"4",label:(0,p.__)("Thursday","wp-whatsapp-chat")},{value:"5",label:(0,p.__)("Friday","wp-whatsapp-chat")},{value:"6",label:(0,p.__)("Saturday","wp-whatsapp-chat")}],Ie=({onChange:e,settings:t})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Layout","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"layout",value:t.layout,onChange:e},(0,c.createElement)("option",{value:"button"},(0,p.__)("Button","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"bubble"},(0,p.__)("Bubble","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,p.__)("Switch to change the button layout.","wp-whatsapp-chat")))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Rounded","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"rounded",value:t.rounded,onChange:e},(0,c.createElement)("option",{value:"yes"},(0,p.__)("Add rounded border","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"no"},(0,p.__)("Remove rounded border","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,p.__)("Add rounded border to the settings.","wp-whatsapp-chat")))),(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Icon","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(ke,{value:t.icon,onChange:e}))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Text","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{type:"text",name:"text",placeholder:t.text,value:t.text,className:"qlwapp-input",onChange:e}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Customize your button text.","wp-whatsapp-chat"))))))),(0,c.createElement)("hr",null),(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Timezone","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"timezone","aria-describedby":"timezone-description",value:t.timezone,onChange:e},d.QLWAPP_TIMEZONE_OPTIONS.map((e=>(0,c.createElement)("option",{value:e.value},e.value)))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Available Hours","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("b",null,(0,p.__)("From","wp-whatsapp-chat")," "),(0,c.createElement)("input",{type:"time",name:"timefrom",placeholder:t.timefrom,value:t.timefrom,onChange:e}),(0,c.createElement)("b",null," ",(0,p.__)("To","wp-whatsapp-chat")," "),(0,c.createElement)("input",{type:"time",name:"timeto",placeholder:t.timeto,value:t.timeto,onChange:e}),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Available Days","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"timedays[]",multiple:!0,style:{height:"100px;"},value:t.timedays,onChange:t=>{const a=Array.from(t.target.selectedOptions).map((e=>e.value));e({...t,target:{...t.target,name:"timedays",value:a}})}},Oe.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Visibility","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"visibility",value:t.visibility,onChange:e},(0,c.createElement)("option",{value:"readonly"},(0,p.__)("Show the button as readonly","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"hidden"},(0,p.__)("Do not show the button","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Hide or block the button if the user is out of the available hours.","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))))),(0,c.createElement)("hr",null),(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Type","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"type",value:t.type,readOnly:"yes"===t.box,onChange:e},(0,c.createElement)("option",{value:"phone"},(0,p.__)("Phone","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"group"},(0,p.__)("Group","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"phone"===t.type&&(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Phone","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{type:"number",name:"phone",value:t.phone,className:"qlwapp-input",readOnly:"yes"===t.box,onChange:e,required:!0,pattern:"\\d[0-9]{6,15}$",placeholder:"+1234567890"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Full phone number in international format. Only numbers.","wp-whatsapp-chat"))))),"group"===t.type&&(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Link","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{type:"text",name:"group",value:t.group,className:"qlwapp-input",readOnly:"yes"===t.box,onChange:e,required:!0,placeholder:"https://chat.whatsapp.com/...",pattern:"https?://chat.whatsapp.com/.+"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"group"!==t.type&&(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Message","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("textarea",{name:"message",value:Te(t.message),onChange:e,className:"qlwapp-input",maxLength:"500",readOnly:"yes"===t.box,style:{width:"75%",height:"50px",padding:"8px"}}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.sprintf)((0,p.__)("Welcome message sent to the user in the chat box. You can use this vars: %s","wp-whatsapp-chat"),d.QLWAPP_MESSAGE_REPLACEMENTS)))))))),Re=({onChange:e,settings:t})=>{const{setCurrentTab:a}=Va();return(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Box","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"box",value:t.box,onChange:e},(0,c.createElement)("option",{value:"yes"},(0,p.__)("Enable contact box","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"no"},(0,p.__)("Disable contact box","wp-whatsapp-chat"))))),"yes"===t.box&&(0,c.createElement)("tr",{className:"qlwapp-phone-alert"},(0,c.createElement)("th",{scope:"row"}),(0,c.createElement)("td",null,(0,c.createElement)("p",{className:"notice-error"},(0,c.createInterpolateElement)((0,p.__)("Contact box is enabled. Please set the contact phone number in the <a>contacts tab</a>.","wp-whatsapp-chat"),{a:(0,c.createElement)("a",{href:"",target:"_blank",rel:"noreferrer",onClick:e=>{e.preventDefault(),a("contacts")}})})))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Position","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"position",value:t.position,onChange:e},(0,c.createElement)("option",{value:"middle-left"},(0,p.__)("Middle Left","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"middle-right"},(0,p.__)("Middle Right","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"bottom-left"},(0,p.__)("Bottom Left","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"bottom-right"},(0,p.__)("Bottom Right","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,p.__)("Switch to change the button position.","wp-whatsapp-chat")))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Animation","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"animation_name",value:t.animation_name,onChange:e},(0,c.createElement)("option",{value:"none"},(0,p.__)("None","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"bounce"},(0,p.__)("Bounce","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"flash"},(0,p.__)("Flash","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"pulse"},(0,p.__)("Pulse","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"shakeY"},(0,p.__)("Shake Vertical","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"shakeX"},(0,p.__)("Shake Horizontal","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"none"!==t.animation_name&&(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Animation Delay","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"number",min:0,name:"animation_delay",placeholder:t.animation_delay,value:t.animation_delay,onChange:e}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Eg. Add 1 for 1 second delay.","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat")))))))},Me=(0,c.memo)((e=>{const[t,a]=(0,c.useState)(!1),{children:n,className:r,onSubmit:l,settings:s}=e,o=(0,ye.usePrevious)(s),i=(0,c.useMemo)((()=>!!o&&!I(s,o)),[s,o]);return(0,c.createElement)("div",{className:"wrap about-wrap full-width-layout qlwrap"},(0,c.createElement)("form",{onSubmit:async e=>{e.preventDefault(),a(!0),await l(),a(!1)}},n,(0,c.createElement)("p",{className:"submit"},(0,c.createElement)("button",{type:"submit",className:"button button-primary",disabled:!i},(0,p.__)("Save","wp-whatsapp-chat")),(0,c.createElement)("span",{className:"settings-save-status"},t&&(0,c.createElement)(ve.Spinner,null)))))})),De=()=>{const{setSettingsButton:e,settingsButton:t,saveButtonSettings:a}=Y(),n=n=>{const{name:r,value:l}=n.target;"box"===r?(e({[r]:l}),a({...t,[r]:l})):e({[r]:l})};return(0,c.createElement)(Me,{settings:t,onSubmit:async()=>await a(t)},(0,c.createElement)(Re,{settings:t,onChange:n}),(0,c.createElement)("hr",null),(0,c.createElement)(Ie,{settings:t,onChange:n}))},Le=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(De,null)))},je=window.lodash,Be=function(e){const{value:t,onChange:a,mediaButtons:n=!0,quicktags:r=!0,tinymce:l={toolbar1:"formatselect,styleselect,bold,italic,bullist,numlist,link,alignleft,aligncenter,alignright,wp_adv",toolbar2:"strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",style_formats_merge:!0,style_formats:[]}}=e,s=(0,c.useRef)((0,je.uniqueId)("wp-tinymce-gutenberg__")).current,o=(0,c.useRef)(t);o.current=t;const i=(0,c.useCallback)((e=>{const t=window.tinymce.get(s).getContent();t!==o.current&&a(t)}),[s,t]);return(0,c.useEffect)((()=>(wp.editor.initialize(s,{quicktags:r,mediaButtons:n,tinymce:l,setup:e=>{e.on("init",(()=>{t&&e.setContent(t)})),e.on("change keyup",i)}}),window.tinymce.editors[s]?.on("change keyup",i),()=>{window.tinymce.editors[s]?.off("change keyup",i),wp.editor.remove(s)})),[s]),(0,c.useEffect)((()=>{const e=window.tinymce.editors[s],a=e.getContent();t&&t!==a&&e.setContent(t)}),[t]),(0,c.createElement)("textarea",{id:s,defaultValue:t})},We=()=>{const{setSettingsBox:e,settingsBox:t,saveBoxSettings:a}=function(){const{setSettingsBox:e,saveBoxSettings:t}=(0,f.useDispatch)(j),{settingsBox:a,isResolvingSettingsBox:n,hasResolvedSettingsBox:r}=(0,f.useSelect)((e=>{const{getSettingsBox:t,isResolving:a,hasFinishedResolution:n}=e(j);return{settingsBox:t(),isResolvingSettingsBox:a("getSettingsBox"),hasResolvedSettingsBox:n("getSettingsBox")}}),[]);return{settingsBox:a,isResolvingSettingsBox:n,hasResolvedSettingsBox:r,hasSettingsBox:!(!r||!Object.keys(a)?.length),saveBoxSettings:t,setSettingsBox:e}}(),n=t=>{const{name:a,value:n}=t.target;e({[a]:n})};return(0,c.createElement)(Me,{settings:t,onSubmit:async()=>await a(t)},(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Auto open","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"auto_open",className:"qlwapp-select2",value:t.auto_open,onChange:n},(0,c.createElement)("option",{value:"yes"},(0,p.__)("Enable auto open","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"no"},(0,p.__)("Disable auto open","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Delay","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"number",step:"100",name:"auto_delay_open",placeholder:t.auto_delay_open,value:t.auto_delay_open,onChange:n}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("In miliseconds","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Images","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{name:"lazy_load",className:"qlwapp-select2",value:t.lazy_load,onChange:n},(0,c.createElement)("option",{value:"yes"},(0,p.__)("Enable lazy load","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"no"},(0,p.__)("Disable lazy load","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Header","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Be,{value:t.header,onChange:t=>{e({header:t})}}))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Footer","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Be,{value:t.footer,onChange:t=>{e({footer:t})}}))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Response","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{type:"text",name:"response",placeholder:t.response,value:t.response,className:"qlwapp-input",onChange:n}),(0,c.createElement)("p",{className:"description hidden"},(0,p.__)("Write a response text.","wp-whatsapp-chat")))))))},qe=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(We,null)))},Fe=[{label:(0,p.__)("Contact","wp-whatsapp-chat"),name:"contact"},{label:(0,p.__)("Visibility","wp-whatsapp-chat"),name:"visibility"}],Ge="qlwapp/menu/contacts",Ue={contacts:[]},He=e=>e.contacts,{QLWAPP_API_REST_ROUTES:ze}=qlwappApiAdminMenu,Ve=({method:e,data:t}={})=>(0,d.apiFetch)({path:ze.contacts,method:e,data:t});function Xe(){const{createContact:e,editContact:t,deleteContact:a,saveContacts:n}=(0,f.useDispatch)(Ge),{contacts:r=[],isResolvingContacts:l,hasResolvedContacts:s}=(0,f.useSelect)((e=>{const{isResolving:t,hasFinishedResolution:a,getContacts:n}=e(Ge);return{contacts:n(),isResolvingContacts:t("getContacts"),hasResolvedContacts:a("getContacts")}}),[]);return{contacts:r,isResolvingContacts:l,hasResolvedContacts:s,hasContacts:!(!s||!r?.length),createContact:e,editContact:t,deleteContact:a,saveContacts:n}}const Ye=e=>({type:"SET_CONTACTS",payload:e}),Qe=e=>async({registry:t,dispatch:a,select:n})=>{const r=await Ve({method:"POST",data:e});if(void 0!==r?.code)return t.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",r.code,r.message),{type:"snackbar"}),!1;const l=n.getContacts();return l.push(r),a.setContacts([...l]),t.dispatch(h.store).createSuccessNotice((0,p.__)("The contact has been created successfully.","wp-whatsapp-chat"),{type:"snackbar"}),r.id},Je=e=>async({registry:t,dispatch:a,select:n})=>{const r=await Ve({method:"DELETE",data:{id:e}});if(void 0!==r?.code)return t.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",r.code,r.message),{type:"snackbar"}),!1;const l=n.getContacts().filter((t=>parseInt(t.id)!==parseInt(e)));return a.setContacts([...l]),t.dispatch(h.store).createSuccessNotice((0,p.sprintf)((0,p.__)("The contact %s has been deleted.","wp-whatsapp-chat"),e),{type:"snackbar"}),l},Ke=e=>async({registry:t,dispatch:a,select:n})=>{const r=await Ve({method:"PATCH",data:e});return void 0!==r?.code?(t.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",r.code,r.message),{type:"snackbar"}),!1):(a.setContacts(e),t.dispatch(h.store).createSuccessNotice((0,p.__)("The contact has been updated successfully.","wp-whatsapp-chat"),{type:"snackbar"}),!0)},Ze=e=>async({registry:t,dispatch:a,select:n})=>{const r=await Ve({method:"PATCH",data:e});if(void 0!==r?.code)return t.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",r.code,r.message),{type:"snackbar"}),!1;const l=n.getContacts();return a.setContacts([...l.map((t=>t.id==e.id?e:t))]),t.dispatch(h.store).createSuccessNotice((0,p.__)("The contact has been updated successfully.","wp-whatsapp-chat"),{type:"snackbar"}),!0},$e=(e,t)=>async({registry:a,dispatch:n})=>{if(!t)throw new Error("Route is required.");const r=t.charAt(0).toUpperCase()+t.slice(1),l=await Ve({method:"POST",data:e,route:t});return l?.code?(a.dispatch(h.store).createSuccessNotice((0,p.sprintf)("%s: %s",l.code,l.message),{type:"snackbar"}),!1):(n[r?`setSettings${r}`:"setSettingsModules"]({...e}),a.dispatch(h.store).createSuccessNotice((0,p.__)("Settings saved.","wp-whatsapp-chat"),{type:"snackbar"}),!0)},et=async()=>{try{const e=await Ve({method:"GET"});return Array.isArray(e)?Ye(e):Ye([])}catch(e){console.error(e)}},tt=(0,f.createReduxStore)(Ge,{reducer:function(e=Ue,t){return"SET_CONTACTS"===t.type?{...e,contacts:t.payload}:e},actions:o,selectors:s,resolvers:i});(0,f.register)((0,d.isVersionLessThan)(d.WP_VERSION,d.FIRST_WP_VERSION_WITH_THUNK_SUPPORT)?(0,d.applyThunkMiddleware)(tt):tt);const at={currentContactIndex:null,currentTab:Fe[0].name,prevPanel:null,currentContactFormData:{id:void 0,firstname:"",lastname:"",type:"phone",phone:"",group:"",label:"",timefrom:"00:00",timeto:"00:00",timezone:"",visibility:"readonly",timedays:[],message:"",chat:1,avatar:"https://www.gravatar.com/avatar/00000000000000000000000000000000",display:{devices:"all",target:{include:1,ids:[]},entries:{post:{include:1,ids:[]},page:{include:1,ids:[]}},taxonomies:{category:{include:1,ids:[]}}}}},nt=(0,c.createContext)({}),rt=()=>(0,c.useContext)(nt),lt=(e,t)=>{switch(t.type){case"SET_CURRENT_TAB":case"SET_CURRENT_CONTACT":case"SET_CURRENT_CONTACT_FORM_DATA":return{...e,...t.payload}}return e},st=e=>{const{children:t}=e,[a,n]=(0,c.useReducer)(lt,at),{contacts:r,createContact:l,editContact:s}=Xe(),o=r[a.currentContactIndex],i=(0,je.isEqual)(o,a.currentContactFormData);return(0,c.createElement)(nt.Provider,{value:{...a,setCurrentTab:e=>{a.currentTab!=e&&n({type:"SET_CURRENT_TAB",payload:{currentTab:e}})},setCurrentContactIndex:(e=null)=>{n({type:"SET_CURRENT_CONTACT",payload:{currentContactIndex:e,currentContactFormData:r?.[e]||at.currentContactFormData}})},setCurrentContactFormData:e=>{const t=R(a.currentContactFormData,e);n({type:"SET_CURRENT_CONTACT_FORM_DATA",payload:{currentContactFormData:void 0===t?"":t}})},contacts:r,createContact:l,editContact:s,isCurrentContactDataModified:i}},t)};function ot({setIsOpen:e,isLoading:t}){const{isCurrentContactDataModified:a}=rt(),n=t||a;return(0,c.createElement)("div",{className:"media-frame-toolbar",style:{left:0}},(0,c.createElement)("div",{className:"media-toolbar"},(0,c.createElement)("div",{className:"media-toolbar-secondary"},(0,c.createElement)("span",{className:"settings-save-status media-button",style:{float:"left"}},t&&(0,c.createElement)("span",{style:{visibility:"visible"},className:"spinner"}))),(0,c.createElement)("div",{className:"media-toolbar-primary search-form"},(0,c.createElement)("button",{type:"submit",className:"media-modal-submit button button-primary media-button button-large ",disabled:n},(0,p.__)("Save","wp-whatsapp-chat")),(0,c.createElement)("button",{type:"button",className:"media-modal-close button button-secondary media-button button-large",style:{height:"auto",float:"none",position:"inherit",padding:"inherit"},onClick:()=>e(!1)},(0,p.__)("Close","wp-whatsapp-chat")))))}function it({setIsOpen:e,isNewContact:t,contact:a}){const{contacts:n,currentContactIndex:r,setCurrentContactIndex:l}=rt(),s=r-1,o=r+1;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"edit-media-header"},!t&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)("button",{type:"button",className:"left",disabled:!n[s],onClick:()=>{l(s)}},(0,c.createElement)("span",{className:"screen-reader-text"},(0,p.__)("Edit previous media item","wp-whatsapp-chat"))),(0,c.createElement)("button",{type:"button",className:"right",disabled:!n[o],onClick:()=>{l(o)}},(0,c.createElement)("span",{className:"screen-reader-text"},(0,p.__)("Edit next media item","wp-whatsapp-chat")))),(0,c.createElement)("button",{type:"button",className:"media-modal-close",onClick:()=>e(!1)},(0,c.createElement)("span",{className:"media-modal-icon"},(0,c.createElement)("span",{className:"screen-reader-text"},(0,p.__)("Close dialog","wp-whatsapp-chat"))))),(0,c.createElement)("div",{className:"media-frame-title"},(0,c.createElement)("h1",null,(0,p.sprintf)((0,p.__)("Edit contact # %s","wp-whatsapp-chat"),t?(0,p.__)("New","wp-whatsapp-chat"):`${a.firstname} - ${a.phone}`))))}function ct(){const{currentContactFormData:e,setCurrentContactFormData:t}=rt(),a=[{value:"0",label:(0,p.__)("Sunday","wp-whatsapp-chat")},{value:"1",label:(0,p.__)("Monday","wp-whatsapp-chat")},{value:"2",label:(0,p.__)("Tuesday","wp-whatsapp-chat")},{value:"3",label:(0,p.__)("Wednesday","wp-whatsapp-chat")},{value:"4",label:(0,p.__)("Thursday","wp-whatsapp-chat")},{value:"5",label:(0,p.__)("Friday","wp-whatsapp-chat")},{value:"6",label:(0,p.__)("Saturday","wp-whatsapp-chat")}];return(0,c.createElement)("div",{className:"wp-whatsapp-chat__modal__panel"},(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Firstname","wp-whatsapp-chat")),(0,c.createElement)("input",{required:!0,type:"text",placeholder:"John",value:e?.firstname,onChange:e=>{t({firstname:e.target.value})}})),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Lastname","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"text",placeholder:"Doe",value:e?.lastname,onChange:e=>{t({lastname:e.target.value})}}))),(0,c.createElement)("div",{className:"options_group qlwapp-premium-field"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Type","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("input",{type:"radio",className:"media-modal-change media-modal-subview2",value:"phone",checked:"phone"===e?.type,onChange:e=>{t({type:e.target.value})}}),(0,c.createElement)("label",null,(0,p.__)("Phone","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"radio",className:"media-modal-change media-modal-subview2",value:"group",checked:"group"===e?.type,onChange:e=>{t({type:e.target.value})},required:!0}),(0,c.createElement)("label",null,(0,p.__)("Group","wp-whatsapp-chat")),(0,c.createElement)("span",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("div",{className:"options_group"},"phone"===e?.type?(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Phone","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"text",placeholder:"+1234567890",value:e?.phone,pattern:"\\d[0-9]{6,15}$",onChange:e=>{t({phone:e.target.value})},required:!0})):(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Link","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"text",placeholder:"https://chat.whatsapp.com/...",value:e?.group,onChange:e=>{t({group:e.target.value})},pattern:"https?://chat.whatsapp.com/.+",required:!0})),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Label","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"text",placeholder:"Support",value:e?.label,onChange:e=>{t({label:e.target.value})}}))),(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Timezone","wp-whatsapp-chat")),(0,c.createElement)("select",{"aria-describedby":"timezone-description",value:e?.timezone,onChange:e=>{t({timezone:e.target.value})}},d.QLWAPP_TIMEZONE_OPTIONS.map((e=>(0,c.createElement)("option",{value:e.value},e.value))))),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",{style:{display:"block"}},(0,p.__)("Available Hours","wp-whatsapp-chat")),(0,c.createElement)("div",{style:{display:"flex",gap:"1em"}},(0,c.createElement)("input",{style:{minWidth:20},type:"time",placeholder:"08:00",value:e?.timefrom,onChange:e=>{t({timefrom:e.target.value})}}),(0,c.createElement)("span",null,(0,p.__)("To","wp-whatsapp-chat")),(0,c.createElement)("input",{style:{minWidth:20},type:"time",placeholder:"17:00",value:e?.timeto,onChange:e=>{t({timeto:e.target.value})}})))),(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Available Days","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("select",{multiple:!0,style:{height:"100px;"},value:e.timedays,onChange:e=>{const a=Array.from(e.target.selectedOptions).map((e=>e.value));t({timedays:a})}},a.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))))),(0,c.createElement)("div",{className:"options_group qlwapp-premium-field"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Visibility","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("select",{value:e?.visibility,onChange:e=>{t({visibility:e.target.value})}},(0,c.createElement)("option",{value:"readonly",selected:"readonly"===e?.visibility},(0,p.__)("Show the contact as readonly","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"hidden",selected:"hidden"===e?.visibility},(0,p.__)("Do not show the contact","wp-whatsapp-chat"))),(0,c.createElement)("span",{className:"description hidden"},(0,p.__)("This is a premium feature.","wp-whatsapp-chat")))),(0,c.createElement)("div",{className:"options_group qlwapp-premium-field"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Chat","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("input",{type:"radio",className:"media-modal-change media-modal-subview2",value:1,checked:1==e?.chat,onChange:e=>{t({chat:Number(e.target.value)})}}),(0,c.createElement)("label",null,(0,p.__)("Enabled","wp-whatsapp-chat")),(0,c.createElement)("input",{type:"radio",className:"media-modal-change media-modal-subview2",value:0,checked:0==e?.chat,onChange:e=>{t({chat:Number(e.target.value)})}}),(0,c.createElement)("label",null,(0,p.__)("Disabled","wp-whatsapp-chat")),(0,c.createElement)("span",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("div",{className:"options_group qlwapp-premium-field"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.sprintf)((0,p.__)("%s Message","wp-whatsapp-chat"),e?.chat?(0,p.__)("Contact","wp-whatsapp-chat"):(0,p.__)("User","wp-whatsapp-chat"))),(0,c.createElement)("textarea",{required:e?.chat,style:{width:"100%"},value:(0,d.decodeHTMLEntities)(e?.message),onChange:e=>{const a=e.target.value;""!==a&&""===a.trim()||t({message:a})}}),e?.chat?(0,c.createElement)("span",{className:"description"},(0,c.createElement)("small",null,(0,p.sprintf)((0,p.__)("Welcome message sent to the user in the chat box. You can use this vars: %s","wp-whatsapp-chat"),d.QLWAPP_MESSAGE_REPLACEMENTS))):(0,c.createElement)("span",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Default message sent to the contact number.","wp-whatsapp-chat"))))))}nt.Consumer;const ut=(0,c.memo)((({options:e=[],value:t,onChange:a,label:n="",multiple:r=!0,onInputChange:l,placeholder:s})=>{const o=t?.map((e=>isNaN(e)?e:parseInt(e))),i=e.filter((e=>!o?.includes(e.value))).map((e=>e.label)),u=e.map((e=>o?.includes(e.value)?e.label||e.value:null)).filter((e=>!!e));return(0,c.createElement)("div",{className:"qlwapp__multiple-selector"},(0,c.createElement)(ve.FormTokenField,{value:u,onChange:t=>{const n=e.map((e=>{if(t.includes(e.label))return e.value})).filter((e=>!!e));a(n)},suggestions:i,label:n,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,multiple:r,placeholder:s,onInputChange:l}))})),pt=window.wp.coreData,mt=({postType:e="page",limit:t=50,searchTerm:a,include:n,exclude:r}={})=>(0,f.useSelect)((l=>{const{getEntityRecords:s,isResolving:o}=l(pt.store),i={per_page:t};if(void 0!==a){if("string"!=typeof a||!a)return{postTypes:[],isResolvingPostTypes:!1,hasPostTypes:!1};i.search=a}if(void 0!==n){if(!Array.isArray(n)||!n?.length)return{postTypes:[],isResolvingPostTypes:!1,hasPostTypes:!1};i.include=n.join(",")}void 0!==r&&Array.isArray(r)&&r?.length&&(i.exclude=r.join(","));const c=["postType",e,i],u=s(...c),p=o("getEntityRecords",c);return{postTypes:u,isResolvingPostTypes:p,hasPostTypes:!p&&!!u?.length}}),[e,t,a,n,r]),dt=(0,c.memo)((({postType:e,settings:t,onChangeSettings:a})=>{const n=t.entries[e]?.ids,r=(0,c.useMemo)((()=>n?.filter((e=>"all"!==e))?.map((e=>parseInt(e)))),[e,t.entries]),{postTypes:l,isResolvingPostTypes:s,hasPostTypes:o}=mt({postType:e,include:r}),[i,u]=(0,c.useState)(""),[p,m]=(0,c.useState)(i),{postTypes:d,isResolvingPostTypes:h,hasPostTypes:f}=mt({postType:e,exclude:r,searchTerm:p}),g=(0,ye.useDebounce)((e=>{m(e)}),300);(0,c.useEffect)((()=>{g(i)}),[i,g]);const w=(0,c.useMemo)((()=>[{label:"All",value:"all"},...[...l||[],...d||[]].map((e=>({label:e.title?.rendered,value:parseInt(e.id)})))]),[l,d]);return(0,c.createElement)(ut,{options:w,value:n,onChange:t=>{a({entries:{[e]:{ids:t}}})},onInputChange:u})})),ht=({taxonomy:e,limit:t=50,searchTerm:a,include:n,exclude:r}={})=>(0,f.useSelect)((l=>{const{getEntityRecords:s,isResolving:o}=l(pt.store),i={per_page:t};if(void 0!==a){if("string"!=typeof a||!a)return{taxonomyTerms:[],isResolvingTaxonomyTerms:!1,hasTaxonomyTerms:!1};i.search=a}if(void 0!==n){if(!Array.isArray(n)||!n?.length)return{taxonomyTerms:[],isResolvingTaxonomyTerms:!1,hasTaxonomyTerms:!1};i.include=n.join(",")}void 0!==r&&Array.isArray(r)&&r?.length&&(i.exclude=r.join(","));const c=["taxonomy",e,i],u=s(...c),p=o("getEntityRecords",c);return{taxonomyTerms:u,isResolvingTaxonomyTerms:p,hasTaxonomyTerms:!p&&!!u?.length}}),[e,t,a,n,r]),ft=(0,c.memo)((({taxonomy:e,settings:t,onChangeSettings:a})=>{const n=t.taxonomies[e]?.ids,r=(0,c.useMemo)((()=>n?.filter((e=>"all"!==e))?.map((e=>parseInt(e)))),[e,t.taxonomies]),{taxonomyTerms:l,isResolvingTaxonomyTerms:s,hasTaxonomyTerms:o}=ht({taxonomy:e,include:r}),[i,u]=(0,c.useState)(""),[p,m]=(0,c.useState)(i),{taxonomyTerms:d,isResolvingTaxonomyTerms:h,hasTaxonomyTerms:f}=ht({taxonomy:e,exclude:r,searchTerm:p}),g=(0,ye.useDebounce)((e=>{m(e)}),300);(0,c.useEffect)((()=>{g(i)}),[i,g]);const w=(0,c.useMemo)((()=>[{label:"All",value:"all"},...[...l||[],...d||[]].map((e=>({label:e.name,value:parseInt(e.id)})))]),[l,d]);return(0,c.createElement)(ut,{options:w,value:n,onChange:t=>{a({taxonomies:{[e]:{ids:t}}})},onInputChange:u})})),{QLWAPP_DISPLAY_POST_TYPES:gt,QLWAPP_DISPLAY_TAXONOMIES:wt}=qlwappApiAdminMenu;function vt(){const{currentContactFormData:e,setCurrentContactFormData:t}=rt(),a=[{label:(0,p.__)("All","wp-whatsapp-chat"),value:"all"},{label:(0,p.__)("Home","wp-whatsapp-chat"),value:"home"},{label:(0,p.__)("Blog","wp-whatsapp-chat"),value:"blog"},{label:(0,p.__)("Search","wp-whatsapp-chat"),value:"search"},{label:(0,p.__)("404","wp-whatsapp-chat"),value:"error"}],n=[{value:"all",label:(0,p.__)("Show in all devices","wp-whatsapp-chat")},{value:"mobile",label:(0,p.__)("Show in mobile devices","wp-whatsapp-chat")},{value:"desktop",label:(0,p.__)("Show in desktop devices","wp-whatsapp-chat")},{value:"hide",label:(0,p.__)("Hide in all devices","wp-whatsapp-chat")}],r=[{value:1,label:(0,p.__)("Include","wp-whatsapp-chat")},{value:0,label:(0,p.__)("Exclude","wp-whatsapp-chat")}];return(0,c.createElement)("div",{className:"wp-whatsapp-chat__modal__panel"},(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Devices","wp-whatsapp-chat")),(0,c.createElement)("select",{style:{width:"350px"},"data-placeholder":(0,p.__)("Choose target…","wp-whatsapp-chat"),value:e.display?.devices,onChange:e=>{t({display:{devices:e.target.value}})}},n.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))))),(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,(0,p.__)("Target","wp-whatsapp-chat")),(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},value:e.display?.target?.include,onChange:e=>{t({display:{target:{include:e.target.value}}})}},r.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(ut,{options:a,value:e.display.target?.ids,onChange:e=>{t({display:{target:{ids:e}}})}})))),Object.values(gt).map(((a,n)=>(0,c.createElement)("div",{className:"options_group qlwapp-premium-field",key:n},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,a.label),(0,c.createElement)("div",null,(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},name:a.name?.include,value:e.display.entries?.[a.name]?.include,onChange:e=>{t({display:{entries:{[a.name]:{include:e.target.value}}}})}},r.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(dt,{key:a.name,label:a.label,postType:a.name,settings:e.display,onChangeSettings:e=>{t({display:e})}}))))))),Object.values(wt).map(((a,n)=>(0,c.createElement)("div",{className:"options_group qlwapp-premium-field",key:n},(0,c.createElement)("p",{className:"form-field"},(0,c.createElement)("label",null,a.label),(0,c.createElement)("div",null,(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},name:a.name?.include,value:e.display.taxonomies?.[a.name]?.include,onChange:e=>{t({display:{taxonomies:{[a.name]:{include:e.target.value}}}})}},r.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(ft,{key:a.name,label:a.label,taxonomy:a.name,settings:e.display,onChangeSettings:e=>{t({display:e})}}))))))))}function yt(){const{currentTab:e}=rt();switch(e){case"contact":return(0,c.createElement)(ct,null);case"visibility":return(0,c.createElement)(vt,null);default:return e}}function Et(){const{setCurrentTab:e,currentTab:t}=rt(),{currentContactFormData:a}=rt();return(0,c.createElement)("ul",{className:"wp-whatsapp-chat-modal__tabs"},Fe.map((({name:n,label:r})=>"carousel"!==n||["carousel"].includes(a.layout)?(0,c.createElement)("li",{key:n,className:L()("media-modal-tab",n==t&&"active")},(0,c.createElement)("a",{href:"#",onClick:t=>{t.preventDefault(),e(n)}},(0,c.createElement)("span",null,r))):null)).filter((e=>!!e)))}function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},bt.apply(null,arguments)}class _t extends c.Component{constructor(){super(...arguments),this.updateAttachmentInfo=this.updateAttachmentInfo.bind(this),this.params={height:250,width:250,flex_width:!0,flex_height:!0}}onChange(e){this.props.onChange({attachment_id:e.id,name:e.name,x:0,y:0,url:e.url,type:e.type})}initFrame(){document.querySelector(".media-modal-close"),this.frame=wp.media({button:{text:(0,p.__)("Select","wp-whatsapp-chat"),close:!1},states:[new wp.media.controller.Library({title:(0,p.__)("Select logo","wp-whatsapp-chat"),library:wp.media.query({type:this.props.allowedTypes||["image"]}),multiple:!1,date:!1,priority:20,suggestedWidth:(this.props.logo||{}).width,suggestedHeight:(this.props.logo||{}).height}),...(this.props.skipCrop,[])]}),this.frame.on("select",this.onSelect,this),this.frame.on("close",(()=>{this.props.onFrameClose&&this.props.onFrameClose()})),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)}openFrame(){this.initFrame(),this.frame.setState("library").open(),this.props.onFrameOpen&&this.props.onFrameOpen()}onSelect(){const e=this.frame.state().get("selection").first().toJSON();(this.props.logo||{}).width===e.width&&(this.props.logo||{}).height===e.height&&!(this.props.logo||{}).flex_width&&!(this.props.logo||{}).flex_height||this.props.skipCrop,this.setImageFromAttachment(e),this.frame.close()}onCropped(e){this.setImageFromAttachment(e)}calculateImageSelectOptions(e,t){const a=t.get("control"),n=!!parseInt((a.props.logo||{}).flex_width,10),r=!!parseInt((a.props.logo||{}).flex_height,10),l=e.get("width"),s=e.get("height");let o=parseInt((a.props.logo||{}).width,10),i=parseInt((a.props.logo||{}).height,10);const c=o/i,u=o,p=i;let m,d,h;return t.set("canSkipCrop",!a.mustBeCropped(n,r,o,i,l,s)),l/s>c?(i=s,o=i*c):(o=l,i=o/c),m=(l-o)/2,d=(s-i)/2,h={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:l,imageHeight:s,minWidth:u>o?o:u,minHeight:p>i?i:p,x1:m,y1:d,x2:o+m,y2:i+d},!1===r&&!1===n&&(h.aspectRatio=o+":"+i),!0===r&&(delete h.minHeight,h.maxWidth=l),!0===n&&(delete h.minWidth,h.maxHeight=s),h}mustBeCropped(e,t,a,n,r,l){return!(!0===e&&!0===t||!0===e&&n===l||!0===t&&a===r||a===r&&n===l||r<=a)}onSkippedCrop(){const e=this.frame.state().get("selection").first().toJSON();this.setImageFromAttachment(e)}setImageFromAttachment(e){this.onChange(e),this.updateAttachmentInfo()}updateAttachmentInfo(e=!1){const t=this.props.value?.attachment_id;t&&(this.detachListener(),wp.media.attachment(t).on("change",this.updateAttachmentInfo))}detachListener(){this.props.value?.attachment_id&&wp.media.attachment(this.props.value.attachment_id).off("change",this.updateAttachmentInfo)}componentDidMount(){this.updateAttachmentInfo()}componentWillUnmount(){this.detachListener()}render(){return(0,c.createElement)("div",bt({className:L()("wp-whatsapp-chat-control-media-upload__attachment",this.props.value?.attachment_id&&this.props.value&&"is-active")},this.props.attr||{}),(this.props.value?.attachment_id||this.props.value?.url)&&(0,c.createElement)("div",{className:"thumbnail thumbnail-image",onClick:()=>!this.props.allowPositionPicker&&this.openFrame()},!this.props.allowPositionPicker&&(0,c.createElement)("img",{className:"attachment-thumb",src:this.props.value?.url||"",draggable:"false",alt:""})),(0,c.createElement)("div",{className:"wp-whatsapp-chat-control-media-upload__attachment__actions"},this.props.value?.attachment_id||this.props.value?.url?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ve.Button,{disabled:!(Number(this.props.value?.attachment_id)>1)&&"function"!=typeof this.props.onRemove,onClick:()=>{"function"!=typeof this.props.onRemove?this.props.onChange():this.props.onRemove()}},(0,p.__)("Remove","wp-whatsapp-chat")),(0,c.createElement)(ve.Button,{isBordered:!0,onClick:()=>this.openFrame()},this.props.filledLabel||(0,p.__)("Change","wp-whatsapp-chat"))):(0,c.createElement)(ve.Button,{className:L()("wp-whatsapp-chat-control-media-upload__attachment__upload","upload_image_button button"),onClick:()=>this.openFrame(),style:{display:"inline-block"}},this.props.emptyLabel||(0,p.__)("Upload","wp-whatsapp-chat"))))}}const At=_t;function St(){const{currentContactFormData:e,setCurrentContactFormData:t}=rt(),a=e.avatar===at.currentContactFormData.avatar;return(0,c.createElement)("div",{className:"attachment-info options_group",style:{width:"30%"}},(0,c.createElement)("div",{className:"options_group"},(0,c.createElement)("div",{className:"details"},(0,c.createElement)("div",{className:"filename"},(0,c.createElement)("strong",null,(0,p.__)("Contact id:","wp-whatsapp-chat")),e.id)),(0,c.createElement)("div",{className:"avatar-panel-info"},(0,c.createElement)("div",{className:"avatar-panel-info__settings"},(0,c.createElement)("img",{alt:"avatar",className:"avatar-panel-info__img",src:e.avatar,width:"150",height:"150"}),(0,c.createElement)("div",{className:"avatar-panel-info__buttons"},(0,c.createElement)(At,{onChange:e=>{t({avatar:e.url})}}),(0,c.createElement)("button",{onClick:()=>{t({avatar:at.currentContactFormData.avatar})},className:"remove_image_button button",disabled:a},"×"))))))}function xt({isOpen:e,setIsOpen:t}){const{currentContactIndex:a,currentContactFormData:n,contacts:r,createContact:l,editContact:s}=rt(),[o,i]=(0,c.useState)(!1),u=r?.[a]?.id,p=void 0===u;return(0,c.createElement)("div",null,(0,c.createElement)("form",{className:"media-modal-form",onSubmit:async e=>{let a;e.preventDefault(),i(!0),a=p?await l(n):await s(n),i(!1),a&&t(!1)}},(0,c.createElement)("div",{className:"media-modal-content qlwapp-contact-modal"},(0,c.createElement)("div",{className:"edit-attachment-frame mode-select qlwapp-contact-modal-attachment-frame"},(0,c.createElement)(it,{isOpen:e,setIsOpen:t,isNewContact:p,currentContactId:u,contact:r?.[a]}),(0,c.createElement)("div",{className:"media-frame-content",style:{bottom:61}},(0,c.createElement)("div",{className:"attachment-details",style:{overflow:"hidden"}},(0,c.createElement)("div",{className:"attachment-media-view landscape"},(0,c.createElement)("div",{style:{height:"100%"}},(0,c.createElement)(Et,null),(0,c.createElement)("div",{className:"qlwapp-contact-modal__content-container",style:{height:"100%",overflowX:"hidden",overflowY:"auto",display:"flex"}},(0,c.createElement)(yt,null),(0,c.createElement)(St,null)))))),(0,c.createElement)(ot,{isOpen:e,setIsOpen:t,isLoading:o,setIsLoading:i})))))}function Ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function Pt(e,t){if(e){if("string"==typeof e)return Ct(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ct(e,t):void 0}}function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l,s,o=[],i=!0,c=!1;try{if(l=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;i=!1}else for(;!(i=(n=l.call(a)).done)&&(o.push(n.value),o.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{if(!i&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(c)throw r}}return o}}(e,t)||Pt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(e){return Tt="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},Tt(e)}function kt(e){var t=function(e){if("object"!=Tt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=Tt(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tt(t)?t:t+""}function Ot(e,t,a){return(t=kt(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function It(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.forEach((function(t){Ot(e,t,a[t])}))}return e}function Rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kt(n.key),n)}}function Dt(e,t,a){return t&&Mt(e.prototype,t),a&&Mt(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jt(e,t){if(t&&("object"==Tt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lt(e)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}function Wt(e,t){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wt(e,t)}function qt(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&&Wt(e,t)}var Ft=a(609);const Gt=window.ReactDOM;var Ut=a(597),Ht=a.n(Ut);var zt=a(736),Vt=a.n(zt),Xt=function(){function e(){Rt(this,e),Ot(this,"refs",{})}return Dt(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var a=this.getIndex(e,t);-1!==a&&this.refs[e].splice(a,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(Yt)}}]),e}();function Yt(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function Qt(e,t){return Object.keys(e).reduce((function(a,n){return-1===t.indexOf(n)&&(a[n]=e[n]),a}),{})}var Jt={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},Kt=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function Zt(e,t){Object.keys(t).forEach((function(a){e.style[a]=t[a]}))}function $t(e,t){e.style["".concat(Kt,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function ea(e,t){e.style["".concat(Kt,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function ta(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function aa(e,t,a){return Math.max(e,Math.min(a,t))}function na(e){return"px"===e.substr(-2)?parseFloat(e):0}function ra(e,t){var a=t.displayName||t.name;return a?"".concat(e,"(").concat(a,")"):e}function la(e,t){var a=e.getBoundingClientRect();return{top:a.top+t.top,left:a.left+t.left}}function sa(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function oa(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var n={left:a.left+e.offsetLeft,top:a.top+e.offsetTop};return e.parentNode===t?n:oa(e.parentNode,t,n)}}function ia(e){var t=e.lockOffset,a=e.width,n=e.height,r=t,l=t,s="px";if("string"==typeof t){var o=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);Ht()(null!==o,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),r=parseFloat(t),l=parseFloat(t),s=o[1]}return Ht()(isFinite(r)&&isFinite(l),"lockOffset value should be a finite. Given %s",t),"%"===s&&(r=r*a/100,l=l*n/100),{x:r,y:l}}function ca(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),a=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return a.test(t[e])}))}(e)?e:ca(e.parentNode):null}var ua="BUTTON",pa="INPUT",ma="OPTION",da="TEXTAREA",ha="SELECT";function fa(e){return null!=e.sortableHandle}var ga=function(){function e(t,a){Rt(this,e),this.container=t,this.onScrollCallback=a}return Dt(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,a=e.translate,n=e.minTranslate,r=e.maxTranslate,l=e.width,s=e.height,o={x:0,y:0},i={x:1,y:1},c=this.container,u=c.scrollTop,p=c.scrollLeft,m=c.scrollHeight,d=c.scrollWidth,h=0===u,f=m-u-c.clientHeight==0,g=0===p,w=d-p-c.clientWidth==0;a.y>=r.y-s/2&&!f?(o.y=1,i.y=10*Math.abs((r.y-s/2-a.y)/s)):a.x>=r.x-l/2&&!w?(o.x=1,i.x=10*Math.abs((r.x-l/2-a.x)/l)):a.y<=n.y+s/2&&!h?(o.y=-1,i.y=10*Math.abs((a.y-s/2-n.y)/s)):a.x<=n.x+l/2&&!g&&(o.x=-1,i.x=10*Math.abs((a.x-l/2-n.x)/l)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===o.x&&0===o.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:i.x*o.x,top:i.y*o.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),wa={axis:Vt().oneOf(["x","y","xy"]),contentWindow:Vt().any,disableAutoscroll:Vt().bool,distance:Vt().number,getContainer:Vt().func,getHelperDimensions:Vt().func,helperClass:Vt().string,helperContainer:Vt().oneOfType([Vt().func,"undefined"==typeof HTMLElement?Vt().any:Vt().instanceOf(HTMLElement)]),hideSortableGhost:Vt().bool,keyboardSortingTransitionDuration:Vt().number,lockAxis:Vt().string,lockOffset:Vt().oneOfType([Vt().number,Vt().string,Vt().arrayOf(Vt().oneOfType([Vt().number,Vt().string]))]),lockToContainerEdges:Vt().bool,onSortEnd:Vt().func,onSortMove:Vt().func,onSortOver:Vt().func,onSortStart:Vt().func,pressDelay:Vt().number,pressThreshold:Vt().number,keyCodes:Vt().shape({lift:Vt().arrayOf(Vt().number),drop:Vt().arrayOf(Vt().number),cancel:Vt().arrayOf(Vt().number),up:Vt().arrayOf(Vt().number),down:Vt().arrayOf(Vt().number)}),shouldCancelStart:Vt().func,transitionDuration:Vt().number,updateBeforeSortStart:Vt().func,useDragHandle:Vt().bool,useWindowAsScrollContainer:Vt().bool},va={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},ya={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:va,shouldCancelStart:function(e){return-1!==[pa,da,ha,ma,ua].indexOf(e.target.tagName)||!!ta(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},Ea=Object.keys(wa),ba=(0,Ft.createContext)({manager:{}}),_a={index:Vt().number.isRequired,collection:Vt().oneOfType([Vt().number,Vt().string]),disabled:Vt().bool},Aa=Object.keys(_a);const Sa=window.wp.primitives,xa=(0,Ft.createElement)(Sa.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ft.createElement)(Sa.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})),Ca=function(e){var t,a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return a=t=function(t){function a(){var e,t;Rt(this,a);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return Ot(Lt(Lt(t=jt(this,(e=Bt(a)).call.apply(e,[this].concat(r))))),"wrappedInstance",(0,Ft.createRef)()),t}return qt(a,t),Dt(a,[{key:"componentDidMount",value:function(){(0,Gt.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return Ht()(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=n.withRef?this.wrappedInstance:null;return(0,Ft.createElement)(e,bt({ref:t},this.props))}}]),a}(Ft.Component),Ot(t,"displayName",ra("sortableHandle",e)),a}((()=>(0,c.createElement)("span",null,xa))),Pa=function(e){var t,a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return a=t=function(t){function a(){var e,t;Rt(this,a);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return Ot(Lt(Lt(t=jt(this,(e=Bt(a)).call.apply(e,[this].concat(r))))),"wrappedInstance",(0,Ft.createRef)()),t}return qt(a,t),Dt(a,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,a=e.disabled,n=e.index,r=(0,Gt.findDOMNode)(this);r.sortableInfo={collection:t,disabled:a,index:n,manager:this.context.manager},this.node=r,this.ref={node:r},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return Ht()(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=n.withRef?this.wrappedInstance:null;return(0,Ft.createElement)(e,bt({ref:t},Qt(this.props,Aa)))}}]),a}(Ft.Component),Ot(t,"displayName",ra("sortableElement",e)),Ot(t,"contextType",ba),Ot(t,"propTypes",_a),Ot(t,"defaultProps",{collection:0}),a}((e=>{const{contact:t,contactIndex:a,setCurrentContactIndex:n,setIsOpen:r,loading:l,setLoading:s,deleteContact:o}=e,i=0===t.id;return(0,c.createElement)("tr",{className:a>0?"qlwapp-premium-field":""},(0,c.createElement)("td",{className:"ui-sortable-handle"},(0,c.createElement)(Ca,null)),(0,c.createElement)("td",null,(0,c.createElement)("img",{className:"qlwapp-avatar",src:t.avatar,alt:`${t.firstname}, ${t.lastname}`,width:"50",height:"50"})),(0,c.createElement)("td",null,t.phone),(0,c.createElement)("td",null,`${t.firstname}, ${t.lastname}`),(0,c.createElement)("td",null,t.label),(0,c.createElement)("td",null,(0,c.createElement)("i",{className:"dashicons dashicons-"+(t.chat?"yes":"no")})),(0,c.createElement)("td",null,(0,d.decodeHTMLEntities)(t.message)),(0,c.createElement)("td",null,(0,p.sprintf)("%s to %s",t.timefrom,t.timeto)),(0,c.createElement)("td",null,t.timezone),(0,c.createElement)("td",null,(0,c.createElement)("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"}},(0,c.createElement)("button",{className:"button",onClick:e=>{e.preventDefault(),n(a),r(!0)}},(0,p.__)("Edit","wp-whatsapp-chat")),(0,c.createElement)("span",{className:"button button-secondary",disabled:i,onClick:async e=>{e.preventDefault(),i||confirm((0,p.__)("You are about to delele this contact.","wp-whatsapp-chat"))&&(s({isloading:!0,currentContactId:t.id}),await o(t.id),s({isLoading:!1}))}},(0,p.__)("Delete","wp-whatsapp-chat")),l&&l.currentContactId===t.id&&(0,c.createElement)("span",{style:{visibility:"visible",position:"absolute"},className:"spinner"}))))})),Na=function(e){var t,a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return a=t=function(t){function a(e){var t;Rt(this,a),Ot(Lt(Lt(t=jt(this,Bt(a).call(this,e)))),"state",{}),Ot(Lt(Lt(t)),"handleStart",(function(e){var a=t.props,n=a.distance,r=a.shouldCancelStart;if(2!==e.button&&!r(e)){t.touched=!0,t.position=sa(e);var l=ta(e.target,(function(e){return null!=e.sortableInfo}));if(l&&l.sortableInfo&&t.nodeIsChild(l)&&!t.state.sorting){var s=t.props.useDragHandle,o=l.sortableInfo,i=o.index,c=o.collection;if(o.disabled)return;if(s&&!ta(e.target,fa))return;t.manager.active={collection:c,index:i},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||"A"!==e.target.tagName||e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),Ot(Lt(Lt(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),Ot(Lt(Lt(t)),"handleMove",(function(e){var a=t.props,n=a.distance,r=a.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var l=sa(e),s={x:t.position.x-l.x,y:t.position.y-l.y},o=Math.abs(s.x)+Math.abs(s.y);t.delta=s,n||r&&!(o>=r)?n&&o>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),Ot(Lt(Lt(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),Ot(Lt(Lt(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),Ot(Lt(Lt(t)),"handlePress",(function(e){try{var a=t.manager.getActive(),n=function(){if(a){var n=function(){var a,n,r,c,f,g,w,v=m.sortableInfo.index,y=(a=m,{bottom:na((n=window.getComputedStyle(a)).marginBottom),left:na(n.marginLeft),right:na(n.marginRight),top:na(n.marginTop)}),E=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:na(t.gridColumnGap),y:na(t.gridRowGap)}:{x:0,y:0}}(t.container),b=t.scrollContainer.getBoundingClientRect(),_=s({index:v,node:m,collection:d});if(t.node=m,t.margin=y,t.gridGap=E,t.width=_.width,t.height=_.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=m.getBoundingClientRect(),t.containerBoundingRect=b,t.index=v,t.newIndex=v,t.axis={x:l.indexOf("x")>=0,y:l.indexOf("y")>=0},t.offsetEdge=oa(m,t.container),t.initialOffset=sa(h?It({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((c="input, textarea, select, canvas, [contenteditable]",f=(r=m).querySelectorAll(c),(w=(g=r.cloneNode(!0)).querySelectorAll(c),function(e){if(Array.isArray(e))return Ct(e)}(w)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(w)||Pt(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e,t){"file"!==e.type&&(e.value=f[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&f[t].width>0&&f[t].height>0&&e.getContext("2d").drawImage(f[t],0,0)})),g)),Zt(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-y.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-y.top,"px"),width:"".concat(t.width,"px")}),h&&t.helper.focus(),i&&(t.sortableGhost=m,Zt(m,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},h){var A=p?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,S=A.top,x=A.left,C=A.width,P=S+A.height,N=x+C;t.axis.x&&(t.minTranslate.x=x-t.boundingClientRect.left,t.maxTranslate.x=N-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=S-t.boundingClientRect.top,t.maxTranslate.y=P-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(p?0:b.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(p?t.contentWindow.innerWidth:b.left+b.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(p?0:b.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(p?t.contentWindow.innerHeight:b.top+b.height)-t.boundingClientRect.top-t.height/2);o&&o.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,h?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(Jt.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),Jt.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:v}),u&&u({node:m,index:v,collection:d,isKeySorting:h,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),h&&t.keyMove(0)},r=t.props,l=r.axis,s=r.getHelperDimensions,o=r.helperClass,i=r.hideSortableGhost,c=r.updateBeforeSortStart,u=r.onSortStart,p=r.useWindowAsScrollContainer,m=a.node,d=a.collection,h=t.manager.isKeySorting,f=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var a=function(t,a){try{var n=(r=m.sortableInfo.index,Promise.resolve(c({collection:d,index:r,node:m,isKeySorting:h},e)).then((function(){})))}catch(e){return a(!0,e)}var r;return n&&n.then?n.then(a.bind(null,!1),a.bind(null,!0)):a(!1,value)}(0,(function(e,a){if(t._awaitingUpdateBeforeSortStart=!1,e)throw a;return a}));if(a&&a.then)return a.then((function(){}))}}();return f&&f.then?f.then(n):n()}}();return Promise.resolve(n&&n.then?n.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),Ot(Lt(Lt(t)),"handleSortMove",(function(e){var a=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),a&&a(e)})),Ot(Lt(Lt(t)),"handleSortEnd",(function(e){var a=t.props,n=a.hideSortableGhost,r=a.onSortEnd,l=t.manager,s=l.active.collection,o=l.isKeySorting,i=t.manager.getOrderedRefs();t.listenerNode&&(o?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(Jt.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),Jt.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&Zt(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,u=i.length;c<u;c++){var p=i[c],m=p.node;p.edgeOffset=null,p.boundingClientRect=null,$t(m,null),ea(m,null),p.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof r&&r({collection:s,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:o,nodes:i},e),t.touched=!1})),Ot(Lt(Lt(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,a=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(a){var n=It({},t.translate),r=0,l=0;return t.axis.x&&(n.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),r=t.translate.x-n.x),t.axis.y&&(n.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),l=t.translate.y-n.y),t.translate=n,$t(t.helper,t.translate),t.scrollContainer.scrollLeft+=r,void(t.scrollContainer.scrollTop+=l)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),Ot(Lt(Lt(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),Ot(Lt(Lt(t)),"handleKeyDown",(function(e){var a=e.keyCode,n=t.props,r=n.shouldCancelStart,l=n.keyCodes,s=It({},va,void 0===l?{}:l);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||s.lift.includes(a)&&!r(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),s.lift.includes(a)&&!t.manager.active?t.keyLift(e):s.drop.includes(a)&&t.manager.active?t.keyDrop(e):s.cancel.includes(a)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):s.up.includes(a)?t.keyMove(-1):s.down.includes(a)&&t.keyMove(1))})),Ot(Lt(Lt(t)),"keyLift",(function(e){var a=e.target,n=ta(a,(function(e){return null!=e.sortableInfo})).sortableInfo,r=n.index,l=n.collection;t.initialFocusedNode=a,t.manager.isKeySorting=!0,t.manager.active={index:r,collection:l},t.handlePress(e)})),Ot(Lt(Lt(t)),"keyMove",(function(e){var a=t.manager.getOrderedRefs(),n=a[a.length-1].node.sortableInfo.index,r=t.newIndex+e,l=t.newIndex;if(!(r<0||r>n)){t.prevIndex=l,t.newIndex=r;var s=function(e,t,a){return e<a&&e>t?e-1:e>a&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),o=a.find((function(e){return e.node.sortableInfo.index===s})),i=o.node,c=t.containerScrollDelta,u=o.boundingClientRect||la(i,c),p=o.translate||{x:0,y:0},m=u.top+p.y-c.top,d=u.left+p.x-c.left,h=l<r,f=h&&t.axis.x?i.offsetWidth-t.width:0,g=h&&t.axis.y?i.offsetHeight-t.height:0;t.handleSortMove({pageX:d+f,pageY:m+g,ignoreTransition:0===e})}})),Ot(Lt(Lt(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),Ot(Lt(Lt(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),Ot(Lt(Lt(t)),"isValidSortingTarget",(function(e){var a=t.props.useDragHandle,n=e.target,r=ta(n,(function(e){return null!=e.sortableInfo}));return r&&r.sortableInfo&&!r.sortableInfo.disabled&&(a?fa(n):n.sortableInfo)}));var n=new Xt;return function(e){Ht()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=n,t.wrappedInstance=(0,Ft.createRef)(),t.sortableContextValue={manager:n},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return qt(a,t),Dt(a,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,a=this.getContainer();Promise.resolve(a).then((function(a){e.container=a,e.document=e.container.ownerDocument||document;var n=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof n?n():n,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:ca(e.container)||e.container,e.autoScroller=new ga(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return Jt[t].forEach((function(a){return e.container.addEventListener(a,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return Jt[t].forEach((function(a){return e.container.removeEventListener(a,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,a=t.lockAxis,n=t.lockOffset,r=t.lockToContainerEdges,l=t.transitionDuration,s=t.keyboardSortingTransitionDuration,o=void 0===s?l:s,i=this.manager.isKeySorting,c=e.ignoreTransition,u=sa(e),p={x:u.x-this.initialOffset.x,y:u.y-this.initialOffset.y};if(p.y-=window.pageYOffset-this.initialWindowScroll.top,p.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=p,r){var m=function(e){var t=e.height,a=e.width,n=e.lockOffset,r=Array.isArray(n)?n:[n,n];Ht()(2===r.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",n);var l=Nt(r,2),s=l[0],o=l[1];return[ia({height:t,lockOffset:s,width:a}),ia({height:t,lockOffset:o,width:a})]}({height:this.height,lockOffset:n,width:this.width}),d=Nt(m,2),h=d[0],f=d[1],g={x:this.width/2-h.x,y:this.height/2-h.y},w={x:this.width/2-f.x,y:this.height/2-f.y};p.x=aa(this.minTranslate.x+g.x,this.maxTranslate.x-w.x,p.x),p.y=aa(this.minTranslate.y+g.y,this.maxTranslate.y-w.y,p.y)}"x"===a?p.y=0:"y"===a&&(p.x=0),i&&o&&!c&&ea(this.helper,o),$t(this.helper,p)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,a=e.hideSortableGhost,n=e.onSortOver,r=this.containerScrollDelta,l=this.windowScrollDelta,s=this.manager.getOrderedRefs(),o=this.offsetEdge.left+this.translate.x+r.left,i=this.offsetEdge.top+this.translate.y+r.top,c=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var p=0,m=s.length;p<m;p++){var d=s[p].node,h=d.sortableInfo.index,f=d.offsetWidth,g=d.offsetHeight,w={height:this.height>g?g/2:this.height/2,width:this.width>f?f/2:this.width/2},v=c&&h>this.index&&h<=u,y=c&&h<this.index&&h>=u,E={x:0,y:0},b=s[p].edgeOffset;b||(b=oa(d,this.container),s[p].edgeOffset=b,c&&(s[p].boundingClientRect=la(d,r)));var _=p<s.length-1&&s[p+1],A=p>0&&s[p-1];_&&!_.edgeOffset&&(_.edgeOffset=oa(_.node,this.container),c&&(_.boundingClientRect=la(_.node,r))),h!==this.index?(t&&ea(d,t),this.axis.x?this.axis.y?y||h<this.index&&(o+l.left-w.width<=b.left&&i+l.top<=b.top+w.height||i+l.top+w.height<=b.top)?(E.x=this.width+this.marginOffset.x,b.left+E.x>this.containerBoundingRect.width-w.width&&_&&(E.x=_.edgeOffset.left-b.left,E.y=_.edgeOffset.top-b.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(o+l.left+w.width>=b.left&&i+l.top+w.height>=b.top||i+l.top+w.height>=b.top+g))&&(E.x=-(this.width+this.marginOffset.x),b.left+E.x<this.containerBoundingRect.left+w.width&&A&&(E.x=A.edgeOffset.left-b.left,E.y=A.edgeOffset.top-b.top),this.newIndex=h):v||h>this.index&&o+l.left+w.width>=b.left?(E.x=-(this.width+this.marginOffset.x),this.newIndex=h):(y||h<this.index&&o+l.left<=b.left+w.width)&&(E.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=h)):this.axis.y&&(v||h>this.index&&i+l.top+w.height>=b.top?(E.y=-(this.height+this.marginOffset.y),this.newIndex=h):(y||h<this.index&&i+l.top<=b.top+w.height)&&(E.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=h))),$t(d,E),s[p].translate=E):a&&(this.sortableGhost=d,Zt(d,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=u);var S=c?this.prevIndex:u;n&&this.newIndex!==S&&n({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:S,isKeySorting:c,nodes:s,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return Ht()(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,Gt.findDOMNode)(this):e(n.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=n.withRef?this.wrappedInstance:null;return(0,Ft.createElement)(ba.Provider,{value:this.sortableContextValue},(0,Ft.createElement)(e,bt({ref:t},Qt(this.props,Ea))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),a}(Ft.Component),Ot(t,"displayName",ra("sortableList",e)),Ot(t,"defaultProps",ya),Ot(t,"propTypes",wa),a}((({children:e})=>(0,c.createElement)("tbody",null,e))),Ta=({setIsOpen:e})=>{const[t,a]=(0,c.useState)({currentContactId:null,isLoading:!1}),{setCurrentContactIndex:n}=rt(),{contacts:r=[],hasResolvedContacts:l,deleteContact:s,saveContacts:o}=Xe(),i=r.sort(((e,t)=>e.order-t.order));return l?(0,c.createElement)(Me,{settings:{},onSubmit:()=>{}},(0,c.createElement)("button",{className:"button-secondary qlwapp-premium-field",onClick:t=>{t.preventDefault(),n(),e(!0)}},(0,p.__)("+ Contact","wp-whatsapp-chat")),(0,c.createElement)("table",{className:"form-table widefat striped"},(0,c.createElement)("thead",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{style:{textAlign:"center"}},(0,p.__)("Order","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Avatar","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Phone","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Name","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Label","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Chat","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Message","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Availability","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Timezone","wp-whatsapp-chat")),(0,c.createElement)("th",null,(0,p.__)("Actions","wp-whatsapp-chat")))),(0,c.createElement)(Na,{onSortEnd:({oldIndex:e,newIndex:t})=>{var a,n,r;const l=(a=i,n=e,r=t,function(e,t,a){const n=t<0?e.length+t:t;if(n>=0&&n<e.length){const n=a<0?e.length+a:a,[r]=e.splice(t,1);e.splice(n,0,r)}}(a=[...a],n,r),a).map(((e,t)=>({...e,order:t})));o(l)},useDragHandle:!0},i.map(((r,l)=>(0,c.createElement)(Pa,{index:l,key:`item-${r.id}`,setIsOpen:e,loading:t,setLoading:a,setCurrentContactIndex:n,contactIndex:l,contact:r,deleteContact:s})))))):(0,c.createElement)(ve.Spinner,null)},ka=window.qlwapp.components,Oa=()=>{const{Fill:e}=be(),[t,a]=(0,c.useState)(!1);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(st,null,(0,c.createElement)(Ta,{isOpen:t,setIsOpen:a}),(0,c.createElement)(ka.Modal,{show:t,onClose:()=>a(!1),__experimentalHideHeader:!0},(0,c.createElement)(xt,{isOpen:t,setIsOpen:a})))))},{QLWAPP_DISPLAY_POST_TYPES:Ia,QLWAPP_DISPLAY_TAXONOMIES:Ra}=qlwappApiAdminMenu,Ma=()=>{const{setSettingsDisplay:e,settingsDisplay:t,saveDisplaySettings:a}=function(){const{setSettingsDisplay:e,saveDisplaySettings:t}=(0,f.useDispatch)(j),{settingsDisplay:a,isResolvingSettingsDisplay:n,hasResolvedSettingsDisplay:r}=(0,f.useSelect)((e=>{const{getSettingsDisplay:t,isResolving:a,hasFinishedResolution:n}=e(j);return{settingsDisplay:t(),isResolvingSettingsDisplay:a("getSettingsDisplay"),hasResolvedSettingsDisplay:n("getSettingsDisplay")}}),[]);return{settingsDisplay:a,isResolvingSettingsDisplay:n,hasResolvedSettingsDisplay:r,hasSettingsDisplay:!(!r||!Object.keys(a)?.length),saveDisplaySettings:t,setSettingsDisplay:e}}(),n=[{label:(0,p.__)("All","wp-whatsapp-chat"),value:"all"},{label:(0,p.__)("Home","wp-whatsapp-chat"),value:"home"},{label:(0,p.__)("Blog","wp-whatsapp-chat"),value:"blog"},{label:(0,p.__)("Search","wp-whatsapp-chat"),value:"search"},{label:(0,p.__)("404","wp-whatsapp-chat"),value:"error"}],r=[{value:"all",label:(0,p.__)("Show in all devices","wp-whatsapp-chat")},{value:"mobile",label:(0,p.__)("Show in mobile devices","wp-whatsapp-chat")},{value:"desktop",label:(0,p.__)("Show in desktop devices","wp-whatsapp-chat")},{value:"hide",label:(0,p.__)("Hide in all devices","wp-whatsapp-chat")}],l=[{value:1,label:(0,p.__)("Include","wp-whatsapp-chat")},{value:0,label:(0,p.__)("Exclude","wp-whatsapp-chat")}];return(0,c.createElement)(Me,{settings:t,onSubmit:async()=>await a(t)},(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Devices","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{style:{width:"350px"},"data-placeholder":(0,p.__)("Choose target…","wp-whatsapp-chat"),value:t.devices,onChange:t=>{e({devices:t.target.value})}},r.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Target","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},value:t.target.include,onChange:t=>{e({target:{include:t.target.value}})}},l.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(ut,{options:n,value:t.target.ids,onChange:t=>{e({target:{ids:t}})}})),(0,c.createElement)("p",{className:"description hidden"},(0,p.__)("If you select an option all the other will be excluded","wp-whatsapp-chat")))),Object.values(Ia).map(((a,n)=>(0,c.createElement)("tr",{key:a,className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},a.label),(0,c.createElement)("td",null,(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},name:a.name?.include,value:t.entries[a.name]?.include,onChange:t=>{e({entries:{[a.name]:{include:t.target.value}}})}},l.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(dt,{key:a.name,label:a.label,postType:a.name,settings:t,onChangeSettings:e})))))),Object.values(Ra).map(((a,n)=>(0,c.createElement)("tr",{key:a,className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},a.label),(0,c.createElement)("td",null,(0,c.createElement)("div",{style:{display:"flex",alignItems:"flex-start"}},(0,c.createElement)("select",{style:{width:"80px"},name:a.name?.include,value:t.taxonomies[a.name]?.include,onChange:t=>{e({taxonomies:{[a.name]:{include:t.target.value}}})}},l.map((e=>(0,c.createElement)("option",{key:e.value,value:e.value},e.label)))),(0,c.createElement)(ft,{key:a.name,label:a.label,taxonomy:a.name,settings:t,onChangeSettings:e})))))))))},Da=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(Ma,null)))},La=()=>{const{setSettingsSettings:e,settingsSettings:t,saveSettingsSettings:a}=function(){const{setSettingsSettings:e,saveSettingsSettings:t}=(0,f.useDispatch)(j),{settingsSettings:a,isResolvingSettingsSettings:n,hasResolvedSettingsSettings:r}=(0,f.useSelect)((e=>{const{getSettingsSettings:t,isResolving:a,hasFinishedResolution:n}=e(j);return{settingsSettings:t(),isResolvingSettingsSettings:a("getSettingsSettings"),hasResolvedSettingsSettings:n("getSettingsSettings")}}),[]);return{settingsSettings:a,isResolvingSettingsSettings:n,hasResolvedSettingsSettings:r,hasSettingsSettings:!(!r||!Object.keys(a)?.length),saveSettingsSettings:t,setSettingsSettings:e}}(),n=t=>{const{name:a,value:n}=t.target;e({[a]:n})};return(0,c.createElement)(Me,{settings:t,onSubmit:async()=>await a(t)},(0,c.createElement)("p",null,(0,c.createInterpolateElement)((0,p.__)("Check our documentation to understand how to configure Google Analytics correctly <a>here</a>","wp-whatsapp-chat"),{a:(0,c.createElement)("a",{href:C,target:"_blank",rel:"noreferrer"})})),(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Google Analytics","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"googleAnalytics",className:"qlwapp-select2",value:t.googleAnalytics,onChange:n},(0,c.createElement)("option",{value:"disable"},(0,p.__)("Disable","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"v3"},(0,p.__)("GAv3","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"v4"},(0,p.__)("GAv4","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Switch to change the button layout.","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",{className:`${"disable"===t.googleAnalytics&&"hidden"} googleEventContainer`},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Script","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"googleAnalyticsScript",className:"qlwapp-select2",value:t.googleAnalyticsScript,onChange:n},(0,c.createElement)("option",{value:"yes"},(0,p.__)("Yes","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"no"},(0,p.__)("No","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)('Select "No" if you have Google Analytics activated via plugin or theme to prevent double load.',"wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"disable"!==t.googleAnalytics&&(0,c.createElement)("tr",{className:"googleEventContainer"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Label","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"text",name:"googleAnalyticsLabel",placeholder:"",value:t.googleAnalyticsLabel,onChange:n,className:"qlwapp-input"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"disable"!==t.googleAnalytics&&(0,c.createElement)("tr",{className:"googleEventContainer"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Category","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"text",name:"googleAnalyticsCategory",placeholder:"",value:t.googleAnalyticsCategory,onChange:n,className:"qlwapp-input"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),"v3"===t.googleAnalytics&&(0,c.createElement)("tr",{className:"googlev3container"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Property Tracking ID ","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"text",name:"googleAnalyticsV3Id",placeholder:"UA-XXXXXXX-XX",value:t.googleAnalyticsV3Id,onChange:n,className:"qlwapp-input"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Google Analytics 3 sample property tracking ID: UA-XXXXXXX-XX","wp-whatsapp-chat"))))),"v4"===t.googleAnalytics&&(0,c.createElement)("tr",{className:"googlev4container"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Data Stream Measurement ID ","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("input",{type:"text",name:"googleAnalyticsV4Id",placeholder:"G-XXXXXXXXXX",value:t.googleAnalyticsV4Id,onChange:n,className:"qlwapp-input"}),(0,c.createElement)("p",{className:"description"},(0,c.createElement)("small",null,(0,p.__)("Google Analytics 4 sample data stream measurement ID: G-XXXXXXXXXX","wp-whatsapp-chat"))))))))},ja=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(La,null)))};function Ba(e){const{label:t}=e;return(0,c.createElement)("div",{className:"ql-color-palette-picker",onClick:e=>{e.preventDefault()}},(0,c.createElement)(ve.ColorPalette,bt({},e,{showTitle:!!t})))}const Wa=()=>{const{setSettingsScheme:e,settingsScheme:t,saveSchemeSettings:a}=function(){const{setSettingsScheme:e,saveSchemeSettings:t}=(0,f.useDispatch)(j),{settingsScheme:a,isResolvingSettingsScheme:n,hasResolvedSettingsScheme:r}=(0,f.useSelect)((e=>{const{getSettingsScheme:t,isResolving:a,hasFinishedResolution:n}=e(j);return{settingsScheme:t(),isResolvingSettingsScheme:a("getSettingsScheme"),hasResolvedSettingsScheme:n("getSettingsScheme")}}),[]);return{settingsScheme:a,isResolvingSettingsScheme:n,hasResolvedSettingsScheme:r,hasSettingsScheme:!(!r||!Object.keys(a)?.length),saveSchemeSettings:t,setSettingsScheme:e}}(),{settingsButton:n}=Y(),r=t=>{const{name:a,value:n}=t.target;e({[a]:n})};return(0,c.createElement)(Me,{settings:t,onSubmit:async()=>await a(t)},(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Font Family","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("select",{placeholder:(0,p.__)("Web Default","wp-whatsapp-chat"),name:"font_family",value:t.font_family,onChange:r},(0,c.createElement)("option",{value:"inherit"},(0,p.__)("Web Default","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Arial"},(0,p.__)("Arial (sans-serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Verdana"},(0,p.__)("Verdana (sans-serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Helvetica"},(0,p.__)("Helvetica (sans-serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Tahoma"},(0,p.__)("Tahoma (sans-serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Trebuchet MS"},(0,p.__)("Trebuchet MS (sans-serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Times New Roman"},(0,p.__)("Times New Roman (serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Georgia"},(0,p.__)("Georgia (serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Garamond"},(0,p.__)("Garamond (serif)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Courier New"},(0,p.__)("Courier New (monospace)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Brush Script MT"},(0,p.__)("Brush Script MT (cursive)","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"Calibri"},(0,p.__)("Calibri (sans-serif)","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Font Size","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{placeholder:(0,p.__)("In pixels","wp-whatsapp-chat"),type:"number",name:"font_size",value:t.font_size,onChange:r}))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Message","wp-whatsapp-chat")),(0,c.createElement)("td",{className:"qlwapp-premium-field"},(0,c.createElement)("select",{name:"box_message_word_break",className:"qlwapp-select2",value:t.box_message_word_break,onChange:r},(0,c.createElement)("option",{value:"break-all"},(0,p.__)("Break all","wp-whatsapp-chat")),(0,c.createElement)("option",{value:"break-word"},(0,p.__)("Break words","wp-whatsapp-chat"))),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Background","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Ba,{value:t.brand,color:t.brand,onChange:t=>e({brand:t}),disableCustomColors:!1}))),(0,c.createElement)("tr",null,(0,c.createElement)("th",{scope:"row"},(0,p.__)("Color","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Ba,{value:t.text,color:t.text,onChange:t=>e({text:t}),disableCustomColors:!1}))),"bubble"===n.layout&&(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Icon Size","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{placeholder:(0,p.__)("In pixels","wp-whatsapp-chat"),type:"number",name:"icon_size",value:t.icon_size,onChange:r}))),(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Icon Font Size","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)("input",{placeholder:(0,p.__)("In pixels","wp-whatsapp-chat"),type:"number",name:"icon_font_size",value:t.icon_font_size,onChange:r}))))),(0,c.createElement)("table",{className:"form-table"},(0,c.createElement)("tbody",null,(0,c.createElement)("tr",null,(0,c.createElement)("th",null,(0,p.__)("Contact settings","wp-whatsapp-chat"))),(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Role color","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Ba,{value:t.contact_role_color,color:t.contact_role_color,onChange:t=>e({contact_role_color:t}),disableCustomColors:!1}),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",{className:"qlwapp-premium-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Name color","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Ba,{value:t.contact_name_color,color:t.contact_name_color,onChange:t=>e({contact_name_color:t}),disableCustomColors:!1}),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))),(0,c.createElement)("tr",{className:"qlwapp-premium-field form-field"},(0,c.createElement)("th",{scope:"row"},(0,p.__)("Availability color","wp-whatsapp-chat")),(0,c.createElement)("td",null,(0,c.createElement)(Ba,{value:t.contact_availability_color,color:t.contact_availability_color,onChange:t=>e({contact_availability_color:t}),disableCustomColors:!1}),(0,c.createElement)("p",{className:"description hidden"},(0,c.createElement)("small",null,(0,p.__)("This is a premium feature.","wp-whatsapp-chat"))))))))},qa=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(Wa,null)))};var Fa=a(312);const Ga=()=>{const{Fill:e}=be();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e.Header,null,(0,c.createElement)(M,null)),(0,c.createElement)(e.Navigation,null,(0,c.createElement)(we,null)),(0,c.createElement)(e.Content,null,(0,c.createElement)(Fa.List,{authorName:"quadlayers",columns:"2"})))},{tabParam:Ua,setBrowserTabParam:Ha}=(0,d.handleBrowserParams)(),za=(0,c.createContext)({}),Va=()=>(0,c.useContext)(za),Xa=(e,t)=>"SET_CURRENT_TAB"===t.type?{...e,...t.payload,prevTab:e.currentTab}:e,Ya=({children:e})=>{const t=(0,m.applyFilters)("wp-whatsapp-chat.app.tabs",[{label:(0,p.__)("Welcome","wp-whatsapp-chat"),name:"welcome",content:Ce},{label:(0,c.createElement)(c.Fragment,null,(0,p.__)("Premium","wp-whatsapp-chat"),(0,c.createElement)("i",{style:{margin:"2px 0 0 5px",color:"#006cff"},className:"dashicons dashicons-awards"})),name:"premium",content:Ne},{label:(0,p.__)("Button","wp-whatsapp-chat"),name:"button",content:Le},{label:(0,p.__)("Box","wp-whatsapp-chat"),name:"box",content:qe},{label:(0,p.__)("Visibility","wp-whatsapp-chat"),name:"display",content:Da},{label:(0,p.__)("Contacts","wp-whatsapp-chat"),name:"contacts",content:Oa},{label:(0,p.__)("Settings","wp-whatsapp-chat"),name:"settings",content:ja},{label:(0,p.__)("Scheme","wp-whatsapp-chat"),name:"scheme",content:qa},{label:(0,p.__)("Suggestions","wp-whatsapp-chat"),name:"suggestions",content:Ga}]),[a,n]=(0,c.useReducer)(Xa,(({defaultTab:e})=>({currentTab:Ua||e,currentTabSection:"",prevTab:null,prevSubTab:null,user:!1}))({defaultTab:t[0].name}));return(0,c.createElement)(za.Provider,{value:{...a,setCurrentTab:e=>{a.currentTab!=e&&(Ha(e),n({type:"SET_CURRENT_TAB",payload:{currentTab:e}}))},tabs:t}},e)},Qa=(za.Consumer,()=>{const{currentTab:e,tabs:t}=Va(),a=t.find((({name:t})=>t==e));if(!a)return(0,c.createElement)(c.Fragment,null,e);const n=a.content;return(0,c.createElement)(n,null)}),Ja=({children:e})=>(0,c.createElement)(_e,null,(0,c.createElement)(Ae,null,(({Slot:t,containerRef:a})=>(0,c.createElement)("div",{ref:a},(0,c.createElement)("header",null,(0,c.createElement)(t.Header,null)),(0,c.createElement)("div",null,(0,c.createElement)("nav",null,(0,c.createElement)(t.Navigation,null)),(0,c.createElement)("div",null,(0,c.createElement)("div",null,(0,c.createElement)(t.Content,null)),(0,c.createElement)("aside",null,(0,c.createElement)(t.Aside,null))),(0,c.createElement)("footer",null,(0,c.createElement)(t.Footer,null))),e)))),Ka=()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Ya,null,(0,c.createElement)(Ja,null,(0,c.createElement)(Qa,null))),u.EditorSnackbars?(0,c.createElement)(u.EditorSnackbars,null):(0,c.createElement)(u.EditorNotices,null))},184:()=>{},35:(e,t,a)=>{"use strict";var n=a(959),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},l={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},o={};function i(e){return n.isMemo(e)?s:o[e.$$typeof]||r}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,a,n){if("string"!=typeof a){if(h){var r=d(a);r&&r!==h&&e(t,r,n)}var s=u(a);p&&(s=s.concat(p(a)));for(var o=i(t),f=i(a),g=0;g<s.length;++g){var w=s[g];if(!(l[w]||n&&n[w]||f&&f[w]||o&&o[w])){var v=m(a,w);try{c(t,w,v)}catch(e){}}}}return t}},597:e=>{"use strict";e.exports=function(e,t,a,n,r,l,s,o){if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[a,n,r,l,s,o],u=0;(i=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}},186:(e,t,a)=>{"use strict";var n=a(985);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,a,r,l,s){if(s!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return a.PropTypes=a,a}},736:(e,t,a)=>{e.exports=a(186)()},985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},843:(e,t)=>{"use strict";var a="function"==typeof Symbol&&Symbol.for,n=a?Symbol.for("react.element"):60103,r=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,s=a?Symbol.for("react.strict_mode"):60108,o=a?Symbol.for("react.profiler"):60114,i=a?Symbol.for("react.provider"):60109,c=a?Symbol.for("react.context"):60110,u=a?Symbol.for("react.async_mode"):60111,p=a?Symbol.for("react.concurrent_mode"):60111,m=a?Symbol.for("react.forward_ref"):60112,d=a?Symbol.for("react.suspense"):60113,h=a?Symbol.for("react.suspense_list"):60120,f=a?Symbol.for("react.memo"):60115,g=a?Symbol.for("react.lazy"):60116,w=a?Symbol.for("react.block"):60121,v=a?Symbol.for("react.fundamental"):60117,y=a?Symbol.for("react.responder"):60118,E=a?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case p:case l:case o:case s:case d:return e;default:switch(e=e&&e.$$typeof){case c:case m:case g:case f:case i:return e;default:return t}}case r:return t}}}function _(e){return b(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=i,t.Element=n,t.ForwardRef=m,t.Fragment=l,t.Lazy=g,t.Memo=f,t.Portal=r,t.Profiler=o,t.StrictMode=s,t.Suspense=d,t.isAsyncMode=function(e){return _(e)||b(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===i},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===m},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===f},t.isPortal=function(e){return b(e)===r},t.isProfiler=function(e){return b(e)===o},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===p||e===o||e===s||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===i||e.$$typeof===c||e.$$typeof===m||e.$$typeof===v||e.$$typeof===y||e.$$typeof===E||e.$$typeof===w)},t.typeOf=b},959:(e,t,a)=>{"use strict";e.exports=a(843)},945:e=>{e.exports=function(e,t,a,n){var r=a?a.call(n,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var l=Object.keys(e),s=Object.keys(t);if(l.length!==s.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),i=0;i<l.length;i++){var c=l[i];if(!o(c))return!1;var u=e[c],p=t[c];if(!1===(r=a?a.call(n,u,p,c):void 0)||void 0===r&&u!==p)return!1}return!0}},108:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ServerStyleSheet:()=>Ge,StyleSheetConsumer:()=>se,StyleSheetContext:()=>le,StyleSheetManager:()=>me,ThemeConsumer:()=>Me,ThemeContext:()=>Re,ThemeProvider:()=>De,__PRIVATE__:()=>ze,createGlobalStyle:()=>qe,css:()=>_e,default:()=>Ve,isStyledComponent:()=>_,keyframes:()=>Fe,useTheme:()=>He,version:()=>S,withTheme:()=>Ue});var n=a(959),r=a(609),l=a.n(r),s=a(945),o=a.n(s);const i=function(e){function t(e,n,i,c,m){for(var d,h,f,g,E,_=0,A=0,S=0,x=0,C=0,I=0,M=f=d=0,L=0,j=0,B=0,W=0,q=i.length,F=q-1,G="",U="",H="",z="";L<q;){if(h=i.charCodeAt(L),L===F&&0!==A+x+S+_&&(0!==A&&(h=47===A?10:47),x=S=_=0,q++,F++),0===A+x+S+_){if(L===F&&(0<j&&(G=G.replace(p,"")),0<G.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:G+=i.charAt(L)}h=59}switch(h){case 123:for(d=(G=G.trim()).charCodeAt(0),f=1,W=++L;L<q;){switch(h=i.charCodeAt(L)){case 123:f++;break;case 125:f--;break;case 47:switch(h=i.charCodeAt(L+1)){case 42:case 47:e:{for(M=L+1;M<F;++M)switch(i.charCodeAt(M)){case 47:if(42===h&&42===i.charCodeAt(M-1)&&L+2!==M){L=M+1;break e}break;case 10:if(47===h){L=M+1;break e}}L=M}}break;case 91:h++;case 40:h++;case 34:case 39:for(;L++<F&&i.charCodeAt(L)!==h;);}if(0===f)break;L++}if(f=i.substring(W,L),0===d&&(d=(G=G.replace(u,"").trim()).charCodeAt(0)),64===d){switch(0<j&&(G=G.replace(p,"")),h=G.charCodeAt(1)){case 100:case 109:case 115:case 45:j=n;break;default:j=O}if(W=(f=t(n,j,f,h,m+1)).length,0<R&&(E=o(3,f,j=a(O,G,B),n,N,P,W,h,m,c),G=j.join(""),void 0!==E&&0===(W=(f=E.trim()).length)&&(h=0,f="")),0<W)switch(h){case 115:G=G.replace(b,s);case 100:case 109:case 45:f=G+"{"+f+"}";break;case 107:f=(G=G.replace(w,"$1 $2"))+"{"+f+"}",f=1===k||2===k&&l("@"+f,3)?"@-webkit-"+f+"@"+f:"@"+f;break;default:f=G+f,112===c&&(U+=f,f="")}else f=""}else f=t(n,a(n,G,B),f,c,m+1);H+=f,f=B=j=M=d=0,G="",h=i.charCodeAt(++L);break;case 125:case 59:if(1<(W=(G=(0<j?G.replace(p,""):G).trim()).length))switch(0===M&&(d=G.charCodeAt(0),45===d||96<d&&123>d)&&(W=(G=G.replace(" ",":")).length),0<R&&void 0!==(E=o(1,G,n,e,N,P,U.length,c,m,c))&&0===(W=(G=E.trim()).length)&&(G="\0\0"),d=G.charCodeAt(0),h=G.charCodeAt(1),d){case 0:break;case 64:if(105===h||99===h){z+=G+i.charAt(L);break}default:58!==G.charCodeAt(W-1)&&(U+=r(G,d,h,G.charCodeAt(2)))}B=j=M=d=0,G="",h=i.charCodeAt(++L)}}switch(h){case 13:case 10:47===A?A=0:0===1+d&&107!==c&&0<G.length&&(j=1,G+="\0"),0<R*D&&o(0,G,n,e,N,P,U.length,c,m,c),P=1,N++;break;case 59:case 125:if(0===A+x+S+_){P++;break}default:switch(P++,g=i.charAt(L),h){case 9:case 32:if(0===x+_+A)switch(C){case 44:case 58:case 9:case 32:g="";break;default:32!==h&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===x+A+_&&(j=B=1,g="\f"+g);break;case 108:if(0===x+A+_+T&&0<M)switch(L-M){case 2:112===C&&58===i.charCodeAt(L-3)&&(T=C);case 8:111===I&&(T=I)}break;case 58:0===x+A+_&&(M=L);break;case 44:0===A+S+x+_&&(j=1,g+="\r");break;case 34:case 39:0===A&&(x=x===h?0:0===x?h:x);break;case 91:0===x+A+S&&_++;break;case 93:0===x+A+S&&_--;break;case 41:0===x+A+_&&S--;break;case 40:0===x+A+_&&(0===d&&(2*C+3*I==533||(d=1)),S++);break;case 64:0===A+S+x+_+M+f&&(f=1);break;case 42:case 47:if(!(0<x+_+S))switch(A){case 0:switch(2*h+3*i.charCodeAt(L+1)){case 235:A=47;break;case 220:W=L,A=42}break;case 42:47===h&&42===C&&W+2!==L&&(33===i.charCodeAt(W+2)&&(U+=i.substring(W,L+1)),g="",A=0)}}0===A&&(G+=g)}I=C,C=h,L++}if(0<(W=U.length)){if(j=n,0<R&&void 0!==(E=o(2,U,j,e,N,P,W,c,m,c))&&0===(U=E).length)return z+U+H;if(U=j.join(",")+"{"+U+"}",0!=k*T){switch(2!==k||l(U,2)||(T=0),T){case 111:U=U.replace(y,":-moz-$1")+U;break;case 112:U=U.replace(v,"::-webkit-input-$1")+U.replace(v,"::-moz-$1")+U.replace(v,":-ms-input-$1")+U}T=0}}return z+U+H}function a(e,t,a){var r=t.trim().split(f);t=r;var l=r.length,s=e.length;switch(s){case 0:case 1:var o=0;for(e=0===s?"":e[0]+" ";o<l;++o)t[o]=n(e,t[o],a).trim();break;default:var i=o=0;for(t=[];o<l;++o)for(var c=0;c<s;++c)t[i++]=n(e[c]+" ",r[o],a).trim()}return t}function n(e,t,a){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*a&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,a,n){var s=e+";",o=2*t+3*a+4*n;if(944===o){e=s.indexOf(":",9)+1;var i=s.substring(e,s.length-1).trim();return i=s.substring(0,e).trim()+i+";",1===k||2===k&&l(i,1)?"-webkit-"+i+i:i}if(0===k||2===k&&!l(s,1))return s;switch(o){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(C,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(i=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+i+s;case 1005:return d.test(s)?s.replace(m,":-webkit-")+s.replace(m,":-moz-")+s:s;case 1e3:switch(t=(i=s.substring(13).trim()).indexOf("-")+1,i.charCodeAt(0)+i.charCodeAt(t)){case 226:i=s.replace(E,"tb");break;case 232:i=s.replace(E,"tb-rl");break;case 220:i=s.replace(E,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+i+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(t=(s=e).length-10,o=(i=(33===s.charCodeAt(t)?s.substring(0,t):s).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|i.charCodeAt(7))){case 203:if(111>i.charCodeAt(8))break;case 115:s=s.replace(i,"-webkit-"+i)+";"+s;break;case 207:case 102:s=s.replace(i,"-webkit-"+(102<o?"inline-":"")+"box")+";"+s.replace(i,"-webkit-"+i)+";"+s.replace(i,"-ms-"+i+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return i=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+i+"-ms-flex-"+i+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(A,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(A,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===x.test(e))return 115===(i=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,a,n).replace(":fill-available",":stretch"):s.replace(i,"-webkit-"+i)+s.replace(i,"-moz-"+i.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===a+n&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(h,"$1-webkit-$2")+s}return s}function l(e,t){var a=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?a:10);return a=e.substring(a+1,e.length-1),M(2!==t?n:n.replace(S,"$1"),a,t)}function s(e,t){var a=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return a!==t+";"?a.replace(_," or ($1)").substring(4):"("+t+")"}function o(e,t,a,n,r,l,s,o,i,u){for(var p,m=0,d=t;m<R;++m)switch(p=I[m].call(c,e,d,a,n,r,l,s,o,i,u)){case void 0:case!1:case!0:case null:break;default:d=p}if(d!==t)return d}function i(e){return void 0!==(e=e.prefix)&&(M=null,e?"function"!=typeof e?k=1:(k=2,M=e):k=0),i}function c(e,a){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<R){var r=o(-1,a,n,n,N,P,0,0,0,0);void 0!==r&&"string"==typeof r&&(a=r)}var l=t(O,n,a,0,0);return 0<R&&void 0!==(r=o(-2,l,n,n,N,P,l.length,0,0,0))&&(l=r),T=0,P=N=1,l}var u=/^\0+/g,p=/[\0\r\f]/g,m=/: */g,d=/zoo|gra/,h=/([,: ])(transform)/g,f=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,w=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,y=/:(read-only)/g,E=/[svh]\w+-[tblr]{2}/,b=/\(\s*(.*)\s*\)/g,_=/([\s\S]*?);/g,A=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,x=/stretch|:\s*\w+\-(?:conte|avail)/,C=/([^-])(image-set\()/,P=1,N=1,T=0,k=1,O=[],I=[],R=0,M=null,D=0;return c.use=function e(t){switch(t){case void 0:case null:R=I.length=0;break;default:if("function"==typeof t)I[R++]=t;else if("object"==typeof t)for(var a=0,n=t.length;a<n;++a)e(t[a]);else D=0|!!t}return e},c.set=i,void 0!==e&&i(e),c},c={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function u(e){var t=Object.create(null);return function(a){return void 0===t[a]&&(t[a]=e(a)),t[a]}}var p=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,m=u((function(e){return p.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),d=a(35),h=a.n(d);function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}var g=function(e,t){for(var a=[e[0]],n=0,r=t.length;n<r;n+=1)a.push(t[n],e[n+1]);return a},w=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,n.typeOf)(e)},v=Object.freeze([]),y=Object.freeze({});function E(e){return"function"==typeof e}function b(e){return e.displayName||e.name||"Component"}function _(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="5.3.11",x="undefined"!=typeof window&&"HTMLElement"in window,C=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&(void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),P={};function N(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(a.length>0?" Args: "+a.join(", "):""))}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,a=0;a<e;a++)t+=this.groupSizes[a];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var a=this.groupSizes,n=a.length,r=n;e>=r;)(r<<=1)<0&&N(16,""+e);this.groupSizes=new Uint32Array(r),this.groupSizes.set(a),this.length=r;for(var l=n;l<r;l++)this.groupSizes[l]=0}for(var s=this.indexOfGroup(e+1),o=0,i=t.length;o<i;o++)this.tag.insertRule(s,t[o])&&(this.groupSizes[e]++,s++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],a=this.indexOfGroup(e),n=a+t;this.groupSizes[e]=0;for(var r=a;r<n;r++)this.tag.deleteRule(a)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var a=this.groupSizes[e],n=this.indexOfGroup(e),r=n+a,l=n;l<r;l++)t+=this.tag.getRule(l)+"/*!sc*/\n";return t},e}(),k=new Map,O=new Map,I=1,R=function(e){if(k.has(e))return k.get(e);for(;O.has(I);)I++;var t=I++;return k.set(e,t),O.set(t,e),t},M=function(e){return O.get(e)},D=function(e,t){t>=I&&(I=t+1),k.set(e,t),O.set(t,e)},L="style["+A+'][data-styled-version="5.3.11"]',j=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),B=function(e,t,a){for(var n,r=a.split(","),l=0,s=r.length;l<s;l++)(n=r[l])&&e.registerName(t,n)},W=function(e,t){for(var a=(t.textContent||"").split("/*!sc*/\n"),n=[],r=0,l=a.length;r<l;r++){var s=a[r].trim();if(s){var o=s.match(j);if(o){var i=0|parseInt(o[1],10),c=o[2];0!==i&&(D(c,i),B(e,c,o[3]),e.getTag().insertRules(i,n)),n.length=0}else n.push(s)}}},q=function(){return a.nc},F=function(e){var t=document.head,a=e||t,n=document.createElement("style"),r=function(e){for(var t=e.childNodes,a=t.length;a>=0;a--){var n=t[a];if(n&&1===n.nodeType&&n.hasAttribute(A))return n}}(a),l=void 0!==r?r.nextSibling:null;n.setAttribute(A,"active"),n.setAttribute("data-styled-version","5.3.11");var s=q();return s&&n.setAttribute("nonce",s),a.insertBefore(n,l),n},G=function(){function e(e){var t=this.element=F(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,a=0,n=t.length;a<n;a++){var r=t[a];if(r.ownerNode===e)return r}N(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),U=function(){function e(e){var t=this.element=F(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var a=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(a,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),H=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),z=x,V={isServer:!x,useCSSOMInjection:!C},X=function(){function e(e,t,a){void 0===e&&(e=y),void 0===t&&(t={}),this.options=f({},V,{},e),this.gs=t,this.names=new Map(a),this.server=!!e.isServer,!this.server&&x&&z&&(z=!1,function(e){for(var t=document.querySelectorAll(L),a=0,n=t.length;a<n;a++){var r=t[a];r&&"active"!==r.getAttribute(A)&&(W(e,r),r.parentNode&&r.parentNode.removeChild(r))}}(this))}e.registerId=function(e){return R(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,a){return void 0===a&&(a=!0),new e(f({},this.options,{},t),this.gs,a&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(a=(t=this.options).isServer,n=t.useCSSOMInjection,r=t.target,e=a?new H(r):n?new G(r):new U(r),new T(e)));var e,t,a,n,r},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(R(e),this.names.has(e))this.names.get(e).add(t);else{var a=new Set;a.add(t),this.names.set(e,a)}},t.insertRules=function(e,t,a){this.registerName(e,t),this.getTag().insertRules(R(e),a)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(R(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),a=t.length,n="",r=0;r<a;r++){var l=M(r);if(void 0!==l){var s=e.names.get(l),o=t.getGroup(r);if(s&&o&&s.size){var i=A+".g"+r+'[id="'+l+'"]',c="";void 0!==s&&s.forEach((function(e){e.length>0&&(c+=e+",")})),n+=""+o+i+'{content:"'+c+'"}/*!sc*/\n'}}}return n}(this)},e}(),Y=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function J(e){var t,a="";for(t=Math.abs(e);t>52;t=t/52|0)a=Q(t%52)+a;return(Q(t%52)+a).replace(Y,"$1-$2")}var K=function(e,t){for(var a=t.length;a;)e=33*e^t.charCodeAt(--a);return e},Z=function(e){return K(5381,e)};function $(e){for(var t=0;t<e.length;t+=1){var a=e[t];if(E(a)&&!_(a))return!1}return!0}var ee=Z("5.3.11"),te=function(){function e(e,t,a){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===a||a.isStatic)&&$(e),this.componentId=t,this.baseHash=K(ee,t),this.baseStyle=a,X.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,a){var n=this.componentId,r=[];if(this.baseStyle&&r.push(this.baseStyle.generateAndInjectStyles(e,t,a)),this.isStatic&&!a.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))r.push(this.staticRulesId);else{var l=Ee(this.rules,e,t,a).join(""),s=J(K(this.baseHash,l)>>>0);if(!t.hasNameForId(n,s)){var o=a(l,"."+s,void 0,n);t.insertRules(n,s,o)}r.push(s),this.staticRulesId=s}else{for(var i=this.rules.length,c=K(this.baseHash,a.hash),u="",p=0;p<i;p++){var m=this.rules[p];if("string"==typeof m)u+=m;else if(m){var d=Ee(m,e,t,a),h=Array.isArray(d)?d.join(""):d;c=K(c,h+p),u+=h}}if(u){var f=J(c>>>0);if(!t.hasNameForId(n,f)){var g=a(u,"."+f,void 0,n);t.insertRules(n,f,g)}r.push(f)}}return r.join(" ")},e}(),ae=/^\s*\/\/.*$/gm,ne=[":","[",".","#"];function re(e){var t,a,n,r,l=void 0===e?y:e,s=l.options,o=void 0===s?y:s,c=l.plugins,u=void 0===c?v:c,p=new i(o),m=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(a,n,r,l,s,o,i,c,u,p){switch(a){case 1:if(0===u&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===c)return n+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(r[0]+n),"";default:return n+(0===p?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){m.push(e)})),h=function(e,n,l){return 0===n&&-1!==ne.indexOf(l[a.length])||l.match(r)?e:"."+t};function f(e,l,s,o){void 0===o&&(o="&");var i=e.replace(ae,""),c=l&&s?s+" "+l+" { "+i+" }":i;return t=o,a=l,n=new RegExp("\\"+a+"\\b","g"),r=new RegExp("(\\"+a+"\\b){2,}"),p(s||!l?"":l,c)}return p.use([].concat(u,[function(e,t,r){2===e&&r.length&&r[0].lastIndexOf(a)>0&&(r[0]=r[0].replace(n,h))},d,function(e){if(-2===e){var t=m;return m=[],t}}])),f.hash=u.length?u.reduce((function(e,t){return t.name||N(15),K(e,t.name)}),5381).toString():"",f}var le=l().createContext(),se=le.Consumer,oe=l().createContext(),ie=(oe.Consumer,new X),ce=re();function ue(){return(0,r.useContext)(le)||ie}function pe(){return(0,r.useContext)(oe)||ce}function me(e){var t=(0,r.useState)(e.stylisPlugins),a=t[0],n=t[1],s=ue(),i=(0,r.useMemo)((function(){var t=s;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,r.useMemo)((function(){return re({options:{prefix:!e.disableVendorPrefixes},plugins:a})}),[e.disableVendorPrefixes,a]);return(0,r.useEffect)((function(){o()(a,e.stylisPlugins)||n(e.stylisPlugins)}),[e.stylisPlugins]),l().createElement(le.Provider,{value:i},l().createElement(oe.Provider,{value:c},e.children))}var de=function(){function e(e,t){var a=this;this.inject=function(e,t){void 0===t&&(t=ce);var n=a.name+t.hash;e.hasNameForId(a.id,n)||e.insertRules(a.id,n,t(a.rules,n,"@keyframes"))},this.toString=function(){return N(12,String(a.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ce),this.name+e.hash},e}(),he=/([A-Z])/,fe=/([A-Z])/g,ge=/^ms-/,we=function(e){return"-"+e.toLowerCase()};function ve(e){return he.test(e)?e.replace(fe,we).replace(ge,"-ms-"):e}var ye=function(e){return null==e||!1===e||""===e};function Ee(e,t,a,n){if(Array.isArray(e)){for(var r,l=[],s=0,o=e.length;s<o;s+=1)""!==(r=Ee(e[s],t,a,n))&&(Array.isArray(r)?l.push.apply(l,r):l.push(r));return l}return ye(e)?"":_(e)?"."+e.styledComponentId:E(e)?"function"!=typeof(i=e)||i.prototype&&i.prototype.isReactComponent||!t?e:Ee(e(t),t,a,n):e instanceof de?a?(e.inject(a,n),e.getName(n)):e:w(e)?function e(t,a){var n,r,l=[];for(var s in t)t.hasOwnProperty(s)&&!ye(t[s])&&(Array.isArray(t[s])&&t[s].isCss||E(t[s])?l.push(ve(s)+":",t[s],";"):w(t[s])?l.push.apply(l,e(t[s],s)):l.push(ve(s)+": "+(n=s,(null==(r=t[s])||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||n in c||n.startsWith("--")?String(r).trim():r+"px")+";")));return a?[a+" {"].concat(l,["}"]):l}(e):e.toString();var i}var be=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function _e(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return E(e)||w(e)?be(Ee(g(v,[e].concat(a)))):0===a.length&&1===e.length&&"string"==typeof e[0]?e:be(Ee(g(e,a)))}new Set;var Ae=function(e,t,a){return void 0===a&&(a=y),e.theme!==a.theme&&e.theme||t||a.theme},Se=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,xe=/(^-|-$)/g;function Ce(e){return e.replace(Se,"-").replace(xe,"")}var Pe=function(e){return J(Z(e)>>>0)};function Ne(e){return"string"==typeof e&&!0}var Te=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},ke=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Oe(e,t,a){var n=e[a];Te(t)&&Te(n)?Ie(n,t):e[a]=t}function Ie(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];for(var r=0,l=a;r<l.length;r++){var s=l[r];if(Te(s))for(var o in s)ke(o)&&Oe(e,s[o],o)}return e}var Re=l().createContext(),Me=Re.Consumer;function De(e){var t=(0,r.useContext)(Re),a=(0,r.useMemo)((function(){return function(e,t){return e?E(e)?e(t):Array.isArray(e)||"object"!=typeof e?N(8):t?f({},t,{},e):e:N(14)}(e.theme,t)}),[e.theme,t]);return e.children?l().createElement(Re.Provider,{value:a},e.children):null}var Le={};function je(e,t,a){var n=_(e),s=!Ne(e),o=t.attrs,i=void 0===o?v:o,c=t.componentId,u=void 0===c?function(e,t){var a="string"!=typeof e?"sc":Ce(e);Le[a]=(Le[a]||0)+1;var n=a+"-"+Pe("5.3.11"+a+Le[a]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):c,p=t.displayName,d=void 0===p?function(e){return Ne(e)?"styled."+e:"Styled("+b(e)+")"}(e):p,g=t.displayName&&t.componentId?Ce(t.displayName)+"-"+t.componentId:t.componentId||u,w=n&&e.attrs?Array.prototype.concat(e.attrs,i).filter(Boolean):i,A=t.shouldForwardProp;n&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(a,n,r){return e.shouldForwardProp(a,n,r)&&t.shouldForwardProp(a,n,r)}:e.shouldForwardProp);var S,x=new te(a,g,n?e.componentStyle:void 0),C=x.isStatic&&0===i.length,P=function(e,t){return function(e,t,a,n){var l=e.attrs,s=e.componentStyle,o=e.defaultProps,i=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,p=e.target,d=function(e,t,a){void 0===e&&(e=y);var n=f({},t,{theme:e}),r={};return a.forEach((function(e){var t,a,l,s=e;for(t in E(s)&&(s=s(n)),s)n[t]=r[t]="className"===t?(a=r[t],l=s[t],a&&l?a+" "+l:a||l):s[t]})),[n,r]}(Ae(t,(0,r.useContext)(Re),o)||y,t,l),h=d[0],g=d[1],w=function(e,t,a){var n=ue(),r=pe();return t?e.generateAndInjectStyles(y,n,r):e.generateAndInjectStyles(a,n,r)}(s,n,h),v=a,b=g.$as||t.$as||g.as||t.as||p,_=Ne(b),A=g!==t?f({},t,{},g):t,S={};for(var x in A)"$"!==x[0]&&"as"!==x&&("forwardedAs"===x?S.as=A[x]:(c?c(x,m,b):!_||m(x))&&(S[x]=A[x]));return t.style&&g.style!==t.style&&(S.style=f({},t.style,{},g.style)),S.className=Array.prototype.concat(i,u,w!==u?w:null,t.className,g.className).filter(Boolean).join(" "),S.ref=v,(0,r.createElement)(b,S)}(S,e,t,C)};return P.displayName=d,(S=l().forwardRef(P)).attrs=w,S.componentStyle=x,S.displayName=d,S.shouldForwardProp=A,S.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):v,S.styledComponentId=g,S.target=n?e.target:e,S.withComponent=function(e){var n=t.componentId,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(t,["componentId"]),l=n&&n+"-"+(Ne(e)?e:Ce(b(e)));return je(e,f({},r,{attrs:w,componentId:l}),a)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=n?Ie({},e.defaultProps,t):t}}),Object.defineProperty(S,"toString",{value:function(){return"."+S.styledComponentId}}),s&&h()(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var Be=function(e){return function e(t,a,r){if(void 0===r&&(r=y),!(0,n.isValidElementType)(a))return N(1,String(a));var l=function(){return t(a,r,_e.apply(void 0,arguments))};return l.withConfig=function(n){return e(t,a,f({},r,{},n))},l.attrs=function(n){return e(t,a,f({},r,{attrs:Array.prototype.concat(r.attrs,n).filter(Boolean)}))},l}(je,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Be[e]=Be(e)}));var We=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=$(e),X.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,a,n){var r=n(Ee(this.rules,t,a,n).join(""),""),l=this.componentId+e;a.insertRules(l,l,r)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,a,n){e>2&&X.registerId(this.componentId+e),this.removeStyles(e,a),this.createStyles(e,t,a,n)},e}();function qe(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];var s=_e.apply(void 0,[e].concat(a)),o="sc-global-"+Pe(JSON.stringify(s)),i=new We(s,o);function c(e){var t=ue(),a=pe(),n=(0,r.useContext)(Re),l=(0,r.useRef)(t.allocateGSInstance(o)).current;return t.server&&u(l,e,t,n,a),(0,r.useLayoutEffect)((function(){if(!t.server)return u(l,e,t,n,a),function(){return i.removeStyles(l,t)}}),[l,e,t,n,a]),null}function u(e,t,a,n,r){if(i.isStatic)i.renderStyles(e,P,a,r);else{var l=f({},t,{theme:Ae(t,n,c.defaultProps)});i.renderStyles(e,l,a,r)}}return l().memo(c)}function Fe(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];var r=_e.apply(void 0,[e].concat(a)).join(""),l=Pe(r);return new de(l,r)}var Ge=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var a=q();return"<style "+[a&&'nonce="'+a+'"',A+'="true"','data-styled-version="5.3.11"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?N(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return N(2);var a=((t={})[A]="",t["data-styled-version"]="5.3.11",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=q();return n&&(a.nonce=n),[l().createElement("style",f({},a,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new X({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?N(2):l().createElement(me,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return N(3)},e}(),Ue=function(e){var t=l().forwardRef((function(t,a){var n=(0,r.useContext)(Re),s=e.defaultProps,o=Ae(t,n,s);return l().createElement(e,f({},t,{theme:o,ref:a}))}));return h()(t,e),t.displayName="WithTheme("+b(e)+")",t},He=function(){return(0,r.useContext)(Re)},ze={StyleSheet:X,masterSheet:ie};const Ve=Be},103:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,l){function s(e){try{i(n.next(e))}catch(e){l(e)}}function o(e){try{i(n.throw(e))}catch(e){l(e)}}function i(e){e.done?r(e.value):function(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(s,o)}i((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=a(723),s=r(a(108)),o=r(a(609)),i=a(87),c=a(375),u=a(877),p=s.default.div` width: calc( ( 100% / ${e=>e.columns} ) - 20px ); display: flex; flex-direction: column; justify-content: space-between; @media ( min-width: 100rem ) { img { position: ${e=>3===e.columns?"initial":"absolute"} !important; } div.column-name { margin: ${e=>3===e.columns?"0px":"148px"} !important; } } @media ( max-width: 100rem ) { width: calc( ( 100% / 2 ) - 20px ); } @media ( max-width: 48.9375rem ) { width: calc( ( 100% / 1 ) - 20px ); } h3 { margin: 0 12px 12px 0; } img { width: 128px; } `;t.default=({author:e,author_profile:t,name:a=(0,l.__)("No name availabe","wp-plugin-suggestions"),slug:r="",placeholder:s=u.ImagePlaceholder,icons:m,homepage:d,short_description:h=(0,l.__)("No description availabe","wp-plugin-suggestions"),rating:f=0,num_ratings:g=0,active_installs:w=0,pluginStatus:v="install",installWordPressPlugin:y,activateSitePlugin:E,tested:b,last_updated:_,ShowName:A=!0,ShowLinks:S=!0,ShowDescription:x=!0,ShowCardFooter:C=!0,ShowRating:P=!0,ShowUpdated:N=!0,ShowDownloaded:T=!0,ShowCompatibility:k=!0,columns:O=3})=>{var I;const[R,M]=(0,i.useState)(v),[D,L]=(0,i.useState)(!1),{fullStars:j,halfStars:B,emptyStars:W}=(0,u.getStars)(f),q=e.replace(/<\/?a[^>]*>/g,"");return(0,i.useEffect)((()=>{M(v)}),[v]),o.default.createElement(p,{className:"plugin-card",columns:3},o.default.createElement("div",{className:"plugin-card-top"},o.default.createElement("div",{className:"name column-name"},o.default.createElement("img",{src:null!==(I=(null==m?void 0:m.default)||(null==m?void 0:m["1x"])||(null==m?void 0:m["2x"]))&&void 0!==I?I:s,className:"plugin-icon",alt:a}),A&&o.default.createElement("h3",null,a),x&&o.default.createElement("div",null,o.default.createElement("p",null,h),o.default.createElement("p",{className:"authors"},o.default.createElement("cite",null,(0,l.__)("By","wp-plugin-suggestions")," ",o.default.createElement("a",{target:"_blank",href:d||t,rel:"noreferrer"},q))))),S&&o.default.createElement("div",{className:"action-links"},o.default.createElement("ul",{className:"plugin-action-buttons"},o.default.createElement("li",null,D?o.default.createElement(c.Spinner,null):o.default.createElement("button",{disabled:"active"===R,className:"button button-primary",onClick:e=>{e.preventDefault(),n(void 0,void 0,void 0,(function*(){if("active"!==R){if(L(!0),"install"===R){const e=yield y(r);M(e.status)}else{const e=yield E(r);M(e.status)}L(!1)}}))},"aria-label":(0,l.sprintf)((0,l.__)("Install %s","wp-plugin-suggestions"),a)},u.LABELS[R])),o.default.createElement("li",null,o.default.createElement("a",{href:`https://wordpress.org/plugins/${r}`,"aria-label":(0,l.sprintf)((0,l.__)("More info %s","wp-plugin-suggestions"),a),target:"_blank",rel:"noreferrer"},(0,l.__)("More Details","wp-plugin-suggestions")))))),C&&o.default.createElement("div",{className:"plugin-card-bottom"},P&&o.default.createElement("div",{className:"vers column-rating"},o.default.createElement("div",{className:"star-rating"},o.default.createElement("span",{className:"screen-reader-text"},(0,l.sprintf)((0,l.__)("5.0 rating based on %s ratings","wp-plugin-suggestions"),g)),Array.from({length:j},((e,t)=>o.default.createElement("div",{key:`full_star_${t}`,className:"star star-full","aria-hidden":"true"}))),Array.from({length:B},((e,t)=>o.default.createElement("div",{key:`half_star_${t}`,className:"star star-half","aria-hidden":"true"}))),Array.from({length:W},((e,t)=>o.default.createElement("div",{key:`empty_star_${t}`,className:"star star-empty","aria-hidden":"true"})))),o.default.createElement("span",{className:"num-ratings","aria-hidden":"true"},"(",g,")")),N&&o.default.createElement("div",{className:"column-updated"},o.default.createElement("strong",null,(0,l.sprintf)((0,l.__)("Last Updated: %s","wp-plugin-suggestions"),(0,u.getLastUpdate)(_)))),T&&o.default.createElement("div",{className:"column-downloaded"},w.toLocaleString("ARG"),"+"," ",(0,l.__)("Active Installations","wp-plugin-suggestions")),k&&o.default.createElement("div",{className:"column-compatibility"},o.default.createElement("span",{className:"compatibility-compatible"},o.default.createElement("strong",null,(0,l.__)("Compatible","wp-plugin-suggestions")),(0,l.sprintf)((0,l.__)(" with the version %s","wp-plugin-suggestions"),b)))))}},585:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var r=Object.getOwnPropertyDescriptor(t,a);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,r)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),r=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||n(t,e,a)},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=l(a(108)),o=l(a(609)),i=l(a(103)),c=a(375),u=a(291);a(458);const p=a(877);r(a(458),t);const m=s.default.div` position: relative; max-width: 1200px; display: flex; flex-wrap: wrap; margin: 25px 40px 0px 20px; `,d=s.default.div` display: flex; justify-content: center; align-items: center; font-size: 1.25em; & svg { width: 50px; height: 50px; } h3 { margin: 1em 0 !important; } `;t.default=e=>{const t=e.authorName||"",{wordpressPlugins:a,isResolvingWordPressPlugins:n,installWordPressPlugin:r}=(0,u.useWordPressPlugins)(t),{isResolvingSitePlugins:l,sitePlugins:s,activateSitePlugin:h}=(0,u.useSitePlugins)();return n||l?o.default.createElement(c.Spinner,null):0!==a.length?o.default.createElement(m,{className:"wrap"},a.map((t=>{var a;const n=(null===(a=s.find((e=>e.name===t.slug)))||void 0===a?void 0:a.status)||"install";return o.default.createElement(i.default,Object.assign({key:t.slug},t,e,{installWordPressPlugin:r,pluginStatus:n,activateSitePlugin:h}))}))):o.default.createElement("div",{style:{maxWidth:"1200px"}},o.default.createElement(d,null,p.WordpressIcon,o.default.createElement("h3",null,"Plugins not found")))}},375:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;const r=a(723),l=n(a(609));t.Spinner=()=>l.default.createElement("p",null,l.default.createElement("span",{style:{visibility:"visible"},className:"spinner"}),(0,r.__)("Loading…","wp-plugin-suggestions"))},877:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,l){function s(e){try{i(n.next(e))}catch(e){l(e)}}function o(e){try{i(n.throw(e))}catch(e){l(e)}}function i(e){e.done?r(e.value):function(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(s,o)}i((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getStars=t.WordpressIcon=t.ImagePlaceholder=t.getWordPressDirectoryURL=t.getLastUpdate=t.LABELS=t.apiFetch=void 0;const l=r(a(609)),s=a(723),o=r(a(455));t.apiFetch=function(e){return n(this,void 0,void 0,(function*(){return yield(0,o.default)(e).then((e=>{if(e.code)throw new Error(`${e.code}: ${(null==e?void 0:e.message)||"Unknown"}`);return e})).catch((e=>{throw new Error(JSON.stringify(e))}))}))},t.LABELS={install:(0,s.__)("Install","wp-plugin-suggestions"),inactive:(0,s.__)("Active","wp-plugin-suggestions"),active:(0,s.__)("Active","wp-plugin-suggestions")},t.getLastUpdate=function(e){const t=new Date(e.split(" ")[0]),a=(new Date).getTime()-t.getTime(),n=Math.floor(a/864e5),r=parseInt(n.toString());return 0===r?(0,s.__)("Today","wp-plugin-suggestions"):r>30?(0,s.sprintf)((0,s.__)("%s Months Ago","wp-plugin-suggestions"),parseInt(Math.floor(r/30).toString())):(0,s.sprintf)((0,s.__)("%s Days Ago","wp-plugin-suggestions"),r)},t.getWordPressDirectoryURL=e=>`https://wordpress.org/plugin/${e}`,t.ImagePlaceholder="data:image/jpeg;base64,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",t.WordpressIcon=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},l.default.createElement("path",{fill:"currentColor",d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10s10-4.49 10-10S17.51 2 12 2zM3.01 12c0-1.3.28-2.54.78-3.66l4.29 11.75c-3-1.46-5.07-4.53-5.07-8.09zM12 20.99c-.88 0-1.73-.13-2.54-.37l2.7-7.84l2.76 7.57c.02.04.04.09.06.12c-.93.34-1.93.52-2.98.52zm1.24-13.21c.54-.03 1.03-.09 1.03-.09c.48-.06.43-.77-.06-.74c0 0-1.46.11-2.4.11c-.88 0-2.37-.11-2.37-.11c-.48-.02-.54.72-.05.75c0 0 .46.06.94.09l1.4 3.84l-1.97 5.9l-3.27-9.75c.54-.02 1.03-.08 1.03-.08c.48-.06.43-.77-.06-.74c0 0-1.46.11-2.4.11c-.17 0-.37 0-.58-.01C6.1 4.62 8.86 3.01 12 3.01c2.34 0 4.47.89 6.07 2.36c-.04 0-.08-.01-.12-.01c-.88 0-1.51.77-1.51 1.6c0 .74.43 1.37.88 2.11c.34.6.74 1.37.74 2.48c0 .77-.3 1.66-.68 2.91l-.9 3l-3.24-9.68zm6.65-.09a8.988 8.988 0 0 1-3.37 12.08l2.75-7.94c.51-1.28.68-2.31.68-3.22c0-.33-.02-.64-.06-.92z"})),t.getStars=e=>{const t=Math.floor(e/20),a=e%20>=10?1:0;return{fullStars:t,halfStars:a,emptyStars:5-t-a}}},312:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0;var r=a(585);Object.defineProperty(t,"List",{enumerable:!0,get:function(){return n(r).default}})},297:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,l){function s(e){try{i(n.next(e))}catch(e){l(e)}}function o(e){try{i(n.throw(e))}catch(e){l(e)}}function i(e){e.done?r(e.value):function(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(s,o)}i((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWordPressPlugins=t.fetchSitePlugins=t.activateSitePlugin=t.installWordPressPlugin=t.setSitePlugins=t.setWordPressPlugins=void 0;const r=a(723),l=a(692),s=a(291);t.setWordPressPlugins=e=>({type:"SET_WORDPRESS_PLUGINS",payload:e}),t.setSitePlugins=e=>({type:"SET_SITE_PLUGINS",payload:e}),t.installWordPressPlugin=e=>({registry:t,dispatch:a,select:o})=>n(void 0,void 0,void 0,(function*(){const n=o.getSitePlugins(),i=yield(0,s.apiFetch)({method:"POST",path:"wp/v2/plugins",data:{slug:e,status:"inactive"}});if(!(null==i?void 0:i.author))return t.dispatch(l.store).createErrorNotice((0,r.sprintf)((0,r.__)("%s: %s"),"Something","wrong"),{type:"snackbar"}),{name:e,status:"install"};const c={name:i.plugin.split("/")[1],status:i.status,url:i._links.self[0].href};return n.push(c),a.setSitePlugins(n),c})),t.activateSitePlugin=e=>({registry:t,dispatch:a,select:r})=>n(void 0,void 0,void 0,(function*(){const t=r.getSitePlugins(),n=t.find((t=>t.name===e));if(!(null==n?void 0:n.url))return{name:e,status:"install"};const{url:l}=n,o=yield(0,s.apiFetch)({method:"PUT",url:l,data:{status:"active"}}),i={name:o.plugin.split("/")[1],status:o.status,url:o._links.self[0].href};return a.setSitePlugins(t.map((e=>e.name==i.name?i:e))),i})),t.fetchSitePlugins=()=>n(void 0,void 0,void 0,(function*(){return(yield(0,s.apiFetch)({method:"GET",path:"wp/v2/plugins"})).map((e=>({name:e.plugin.split("/")[0],status:e.status,url:e._links.self[0].href})))})),t.fetchWordPressPlugins=e=>n(void 0,void 0,void 0,(function*(){const t=`https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[author]=${e}`,a=yield fetch(t);return yield a.json()}))},275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIAL_STATE=t.STORE_NAME=void 0,t.STORE_NAME="quadlayers/plugins",t.INITIAL_STATE={wordpressPlugins:[],sitePlugins:[]}},291:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,l){function s(e){try{i(n.next(e))}catch(e){l(e)}}function o(e){try{i(n.throw(e))}catch(e){l(e)}}function i(e){e.done?r(e.value):function(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(s,o)}i((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSitePlugins=t.useWordPressPlugins=t.apiFetch=void 0;const l=a(275),s=a(143),o=r(a(455));t.apiFetch=function(e){return n(this,void 0,void 0,(function*(){return yield(0,o.default)(e).then((e=>{if(e.code)throw new Error(`${e.code}: ${(null==e?void 0:e.message)||"Unknown"}`);return e})).catch((e=>{throw new Error(JSON.stringify(e))}))}))},t.useWordPressPlugins=function(e){const{installWordPressPlugin:t}=(0,s.useDispatch)(l.STORE_NAME),{wordpressPlugins:a,isResolvingWordPressPlugins:n,hasResolvedWordPressPlugins:r}=(0,s.useSelect)((t=>{const{isResolving:a,hasFinishedResolution:n,getWordPressPlugins:r}=t(l.STORE_NAME);return{wordpressPlugins:r(e),isResolvingWordPressPlugins:a("getWordPressPlugins"),hasResolvedWordPressPlugins:n("getWordPressPlugins",e)}}),[e]);return{wordpressPlugins:a,isResolvingWordPressPlugins:n,hasResolvedWordPressPlugins:r,hasWordPressPlugins:!(!r||!(null==a?void 0:a.length)),installWordPressPlugin:t}},t.useSitePlugins=function(){const{activateSitePlugin:e}=(0,s.useDispatch)(l.STORE_NAME),{sitePlugins:t,isResolvingSitePlugins:a,hasResolvedSitePlugins:n}=(0,s.useSelect)((e=>{const{isResolving:t,hasFinishedResolution:a,getSitePlugins:n}=e(l.STORE_NAME);return{isResolvingSitePlugins:t("getSitePlugins"),hasResolvedSitePlugins:a("getSitePlugins"),sitePlugins:n()}}),[]);return{sitePlugins:t,isResolvingSitePlugins:a,hasResolvedSitePlugins:n,hasSitePlugins:!(!n||!(null==t?void 0:t.length)),activateSitePlugin:e}}},458:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var r=Object.getOwnPropertyDescriptor(t,a);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,r)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.storeConfig=void 0;const o=a(143),i=a(275),c=s(a(438)),u=l(a(297)),p=l(a(576)),m=l(a(258));t.storeConfig={reducer:c.default,actions:u,selectors:p,resolvers:m};const d=(0,o.createReduxStore)(i.STORE_NAME,t.storeConfig);(0,o.register)(d)},438:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sitePlugins=t.wordpressPlugins=void 0;const n=a(143),r=a(275);function l(e=r.INITIAL_STATE.wordpressPlugins,t){return"SET_WORDPRESS_PLUGINS"===t.type?t.payload:e}function s(e=r.INITIAL_STATE.sitePlugins,t){return"SET_SITE_PLUGINS"===t.type?t.payload:e}t.wordpressPlugins=l,t.sitePlugins=s,t.default=(0,n.combineReducers)({wordpressPlugins:l,sitePlugins:s})},258:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var r=Object.getOwnPropertyDescriptor(t,a);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,r)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t},s=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(r,l){function s(e){try{i(n.next(e))}catch(e){l(e)}}function o(e){try{i(n.throw(e))}catch(e){l(e)}}function i(e){e.done?r(e.value):function(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(s,o)}i((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getSitePlugins=t.getWordPressPlugins=void 0;const o=l(a(297));t.getWordPressPlugins=e=>s(void 0,void 0,void 0,(function*(){const t=yield o.fetchWordPressPlugins(e);return(null==t?void 0:t.plugins)?o.setWordPressPlugins(null==t?void 0:t.plugins):{type:"SET_WORDPRESS_PLUGINS",payload:[]}})),t.getSitePlugins=()=>s(void 0,void 0,void 0,(function*(){const e=yield o.fetchSitePlugins();return o.setSitePlugins(e)}))},576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSitePlugins=t.getWordPressPlugins=void 0,t.getWordPressPlugins=e=>e.wordpressPlugins,t.getSitePlugins=(e,t)=>t?e.sitePlugins.find((({name:e})=>e===t)):e.sitePlugins},609:e=>{"use strict";e.exports=window.React},746:e=>{"use strict";e.exports=window.qlwapp.helpers},455:e=>{"use strict";e.exports=window.wp.apiFetch},143:e=>{"use strict";e.exports=window.wp.data},87:e=>{"use strict";e.exports=window.wp.element},723:e=>{"use strict";e.exports=window.wp.i18n},692:e=>{"use strict";e.exports=window.wp.notices},500:(e,t)=>{var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=s(e,l(a)))}return e}function l(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)n.call(e,a)&&e[a]&&(t=s(t,a));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(a=function(){return r}.apply(t,[]))||(e.exports=a)}()}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var l=t[n]={exports:{}};return e[n].call(l.exports,l,l.exports,a),l.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var n={};(()=>{"use strict";a.r(n),a.d(n,{App:()=>r.qw,AppProvider:()=>r.Dv,AppStructure:()=>r.bZ,AppTabSwitcher:()=>r.iO,Button:()=>r.$n,Header:()=>r.Y9,Nav:()=>r.so,Tab:()=>r.oz,useAppSlotContext:()=>r.OL});var e=a(87),t=a(746),r=a(841),l=a(184),s={};for(const e in l)["default","App","AppProvider","AppStructure","AppTabSwitcher","Button","Header","Nav","Tab","useAppSlotContext"].indexOf(e)<0&&(s[e]=()=>l[e]);a.d(n,s),(0,t.onDocumentLoaded)((()=>{const t=new URLSearchParams(window.location.search).get("page"),a=document.getElementById("wpbody-content");"wp-whatsapp-chat"===t&&(0,e.render)((0,e.createElement)(r.qw,null),a)}))})(),(window.qlwapp=window.qlwapp||{})["admin-menu"]=n})(); Save