Файловый менеджер - Редактировать - /var/www/xthruster/html/wp-content/plugins/optimole-wp/assets/build/dashboard/index.js
Назад
(()=>{var e,t={75:(e,t,a)=>{"use strict";var o=a(196);const s=window.wp.element,l={setAutoConnect:e=>({type:"SET_AUTO_CONNECT",autoConnect:e}),setAPIKey:e=>({type:"SET_API_KEY",apiKey:e}),setAvailableApps:e=>({type:"SET_AVAILABLE_APPS",availableApps:e}),setIsConnected:e=>({type:"SET_IS_CONNECTED",isConnected:e}),setIsConnecting:e=>({type:"SET_IS_CONNECTING",isConnecting:e}),setIsLoading:e=>({type:"SET_IS_LOADING",isLoading:e}),sethasDashboardLoaded:e=>({type:"SET_HAS_DASHBOARD_LOADED",hasDashboardLoaded:e}),setHasRestError:e=>({type:"SET_HAS_REST_ERROR",hasRestError:e}),setHasValidKey:e=>({type:"SET_HAS_VALID_KEY",hasValidKey:e}),setHasApplication:e=>({type:"SET_HAS_APPLICATION",hasApplication:e}),setUserData:e=>({type:"SET_USER_DATA",data:e}),setUserStatus:e=>({type:"SET_USER_STATUS",status:e}),setShowDisconnect:e=>({type:"SET_SHOW_DISCONNECT",showDisconnect:e}),setConflicts:e=>({type:"SET_CONFLICTS",conflicts:e}),setOptimizedImages:e=>({type:"SET_OPTIMIZED_IMAGES",optimizedImages:e}),setSiteSettings:e=>({type:"SET_SITE_SETTINGS",siteSettings:e}),setExtraVisits:e=>({type:"SET_EXTRA_VISITS",extraVisitsStatus:e}),setSampleRate:e=>({type:"SET_SAMPLE_RATE",sampleRate:e}),setTotalNumberOfImages:e=>({type:"SET_TOTAL_NUMBER_OF_IMAGES",totalNumberOfImages:e}),setProcessedImages:e=>({type:"SET_PROCESSED_IMAGES",processedImages:e}),setOffloadLibraryLink:e=>({type:"SET_OFFLOAD_LIBRARY_LINK",offloadLibraryLink:e}),setRollbackLibraryLink:e=>({type:"SET_ROLLBACK_LIBRARY_LINK",rollbackLibraryLink:e}),setLoadingRollback:e=>({type:"SET_LOADING_ROLLBACK",loadingRollback:e}),setLoadingSync:e=>({type:"SET_LOADING_SYNC",loadingSync:e}),setQueryArgs:e=>({type:"SET_QUERY_ARGS",queryArgs:e}),setErrorMedia:e=>({type:"SET_ERROR_MEDIA",errorMedia:e}),setEstimatedTime:e=>({type:"SET_ESTIMATED_TIME",estimatedTime:e}),setCheckedOffloadConflicts:e=>({type:"SET_CHECKED_OFFLOAD_CONFLICTS",checkedOffloadConflicts:e}),setOffloadConflicts:e=>({type:"SET_OFFLOAD_CONFLICTS",offloadConflicts:e}),setLogs:(e,t)=>({type:"SET_LOGS",logsType:e,logs:t}),setShowFinishNotice:e=>({type:"SET_SITE_SETTINGS",siteSettings:{show_offload_finish_notice:e}}),setOffloadLimitReached:e=>({type:"SET_SITE_SETTINGS",siteSettings:{offload_limit_reached:e}}),ensureOffloadingRollbackDisabled:()=>({type:"SET_SITE_SETTINGS",siteSettings:{offloading_status:"disabled",rollback_status:"disabled"}}),setOffloadLimit:e=>({type:"SET_OFFLOAD_LIMIT",offloadLimit:e})},n={autoConnect:optimoleDashboardApp.auto_connect,isConnected:"yes"===optimoleDashboardApp.connection_status,isConnecting:!1,isLoading:!1,hasRestError:!1,hasValidKey:!0,hasApplication:"yes"===optimoleDashboardApp.has_application,apiKey:optimoleDashboardApp.api_key?optimoleDashboardApp.api_key:"",userStatus:optimoleDashboardApp.user_status?optimoleDashboardApp.user_status:"inactive",userData:optimoleDashboardApp.user_data?optimoleDashboardApp.user_data:null,availableApps:optimoleDashboardApp.available_apps?optimoleDashboardApp.available_apps:null,hasDashboardLoaded:"yes"===optimoleDashboardApp.connection_status,showDisconnect:!1,conflicts:[],optimizedImages:[],siteSettings:optimoleDashboardApp.site_settings,sampleRate:{},totalNumberOfImages:0,processedImages:0,offloadLibraryLink:!1,rollbackLibraryLink:!1,loadingRollback:!1,loadingSync:!1,queryArgs:[],errorMedia:!1,checkedOffloadConflicts:!1,offloadConflicts:[],offloadLimit:optimoleDashboardApp.offload_limit||5e4,logs:{offload:"",rollback:""}},r=(e=n,t)=>{switch(t.type){case"SET_AUTO_CONNECT":return{...e,autoConnect:t.autoConnect};case"SET_HAS_REST_ERROR":case"SET_HAS_REST_ERROR":return{...e,hasRestError:t.hasRestError};case"SET_API_KEY":return{...e,apiKey:t.apiKey};case"SET_AVAILABLE_APPS":return{...e,availableApps:t.availableApps};case"SET_IS_CONNECTED":return{...e,isConnected:t.isConnected};case"SET_IS_CONNECTING":return{...e,isConnecting:t.isConnecting};case"SET_IS_LOADING":return{...e,isLoading:t.isLoading};case"SET_HAS_DASHBOARD_LOADED":return{...e,hasDashboardLoaded:t.hasDashboardLoaded};case"SET_HAS_VALID_KEY":return{...e,hasValidKey:t.hasValidKey};case"SET_HAS_APPLICATION":return{...e,hasApplication:t.hasApplication};case"SET_USER_DATA":let a="inactive";const{data:o}=t;if(o&&o.app_count&&1<=o.app_count&&o.cdn_key)for(let e of o.available_apps)e.key&&e.key===o.cdn_key&&e.status&&"active"===e.status&&(a="active");return{...e,userData:t.data,userStatus:a};case"SET_USER_STATUS":return{...e,userStatus:t.status};case"SET_SHOW_DISCONNECT":return{...e,showDisconnect:t.showDisconnect};case"SET_CONFLICTS":return{...e,conflicts:t.conflicts};case"SET_OPTIMIZED_IMAGES":return{...e,optimizedImages:t.optimizedImages};case"SET_SITE_SETTINGS":let{siteSettings:s}=e;for(let e in t.siteSettings)s[e]=t.siteSettings[e];return{...e,siteSettings:s};case"SET_EXTRA_VISITS":{let{siteSettings:a}=e;return a.banner_frontend=t.extraVisitsStatus?"enabled":"disabled",{...e,siteSettings:a}}case"SET_SAMPLE_RATE":return{...e,sampleRate:t.sampleRate};case"SET_TOTAL_NUMBER_OF_IMAGES":return{...e,totalNumberOfImages:t.totalNumberOfImages};case"SET_PROCESSED_IMAGES":return{...e,processedImages:t.processedImages};case"SET_OFFLOAD_LIBRARY_LINK":return{...e,offloadLibraryLink:t.offloadLibraryLink};case"SET_ROLLBACK_LIBRARY_LINK":return{...e,rollbackLibraryLink:t.rollbackLibraryLink};case"SET_LOADING_ROLLBACK":return Object.prototype.hasOwnProperty.call(e.queryArgs,"optimole_action")&&(e.rollbackLibraryLink=!t.loadingSync),{...e,loadingRollback:t.loadingRollback};case"SET_LOADING_SYNC":return Object.prototype.hasOwnProperty.call(e.queryArgs,"optimole_action")&&(e.offloadLibraryLink=!t.loadingSync),{...e,loadingSync:t.loadingSync};case"SET_QUERY_ARGS":return{...e,queryArgs:t.queryArgs};case"SET_ERROR_MEDIA":return{...e,errorMedia:t.errorMedia};case"SET_CHECKED_OFFLOAD_CONFLICTS":return{...e,checkedOffloadConflicts:t.checkedOffloadConflicts};case"SET_OFFLOAD_CONFLICTS":return{...e,offloadConflicts:t.offloadConflicts};case"SET_LOGS":let{logs:l}=e;return l[t.logsType]=t.logs,{...e,logs:l};case"SET_OFFLOAD_LIMIT":return{...e,offloadLimit:t.offloadLimit};default:return e}},i={getAutoConnect:e=>e.autoConnect,getAPIKey:e=>e.apiKey,getAvailableApps:e=>e.availableApps,hasRestError:e=>e.hasRestError,hasValidKey:e=>e.hasValidKey,hasApplication:e=>e.hasApplication,hasDashboardLoaded:e=>e.hasDashboardLoaded,getUserData:e=>e.userData,getUserStatus:e=>e.userStatus,isConnected:e=>e.isConnected,isConnecting:e=>e.isConnecting,isLoading:e=>e.isLoading,showDisconnect:e=>e.showDisconnect,getConflicts:e=>e.conflicts,getOptimizedImages:e=>e.optimizedImages,getSiteSettings:(e,t=void 0)=>t?void 0!==e.siteSettings[t]?e.siteSettings[t]:void 0:e.siteSettings,getSampleRate:e=>e.sampleRate,getTotalNumberOfImages:e=>e.totalNumberOfImages,getProcessedImages:e=>e.processedImages,getOffloadLibraryLink:e=>e.offloadLibraryLink,getRollbackLibraryLink:e=>e.rollbackLibraryLink,getLoadingRollback:e=>e.loadingRollback,getLoadingSync:e=>e.loadingSync,getQueryArgs:e=>e.queryArgs,getErrorMedia:e=>e.errorMedia,getCheckedOffloadConflicts:e=>e.checkedOffloadConflicts,getOffloadConflicts:e=>e.offloadConflicts,getOffloadLimit:e=>e.offloadLimit,getLogs:(e,t=void 0)=>t?void 0!==e.logs[t]?e.logs[t]:void 0:e.logs};if(void 0!==wp.data.createReduxStore){const e=wp.data.createReduxStore("optimole",{reducer:r,actions:l,selectors:i});wp.data.register(e)}else wp.data.registerStore("optimole",{reducer:r,actions:l,selectors:i});const c=window.wp.data;var d=a(184),p=a.n(d);const m=window.wp.primitives,g=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})),u=window.wp.components,h=()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},(0,o.createElement)("path",{d:"M17.357 2.92894C16.9664 2.53842 16.3333 2.53842 15.9427 2.92894C15.5522 3.31946 15.5522 3.95263 15.9427 4.34315L17.357 2.92894ZM16.6499 16.364L15.9427 17.0711H15.9427L16.6499 16.364ZM14.5285 5.75737C14.138 5.36684 13.5048 5.36684 13.1143 5.75737C12.7238 6.14789 12.7238 6.78106 13.1143 7.17158L14.5285 5.75737ZM13.8214 13.5355L13.1143 14.2426L13.1143 14.2427L13.8214 13.5355ZM6.04325 14.2427C6.43377 14.6332 7.06694 14.6332 7.45746 14.2427C7.84799 13.8521 7.84799 13.219 7.45746 12.8284L6.04325 14.2427ZM6.32586 10.5662C6.24822 10.0194 5.74201 9.63905 5.19521 9.71669C4.64841 9.79434 4.26808 10.3005 4.34573 10.8473L6.32586 10.5662ZM3.21482 17.0711C3.60535 17.4616 4.23851 17.4616 4.62903 17.0711C5.01956 16.6806 5.01956 16.0474 4.62903 15.6569L3.21482 17.0711ZM2.70292 7.44452C2.87885 6.921 2.59707 6.354 2.07355 6.17807C1.55004 6.00215 0.98303 6.28393 0.807105 6.80744L2.70292 7.44452ZM1.993 0.292893C1.60247 -0.0976311 0.969306 -0.0976311 0.578782 0.292893C0.188258 0.683417 0.188258 1.31658 0.578782 1.70711L1.993 0.292893ZM18.5788 19.7071C18.9693 20.0976 19.6025 20.0976 19.993 19.7071C20.3835 19.3166 20.3835 18.6834 19.993 18.2929L18.5788 19.7071ZM15.9427 4.34315C19.0669 7.46735 19.0669 12.5327 15.9427 15.6569L17.357 17.0711C21.2622 13.1658 21.2622 6.83418 17.357 2.92894L15.9427 4.34315ZM13.1143 7.17158C14.6764 8.73368 14.6764 11.2663 13.1143 12.8284L14.5285 14.2427C16.8717 11.8995 16.8717 8.10051 14.5285 5.75737L13.1143 7.17158ZM10.2859 10H12.2859C12.2859 8.89544 11.3905 8.00001 10.2859 8.00001V10ZM7.45746 12.8284C6.81978 12.1908 6.44341 11.394 6.32586 10.5662L4.34573 10.8473C4.52209 12.0894 5.08876 13.2882 6.04325 14.2427L7.45746 12.8284ZM4.62903 15.6569C2.40899 13.4368 1.76507 10.2354 2.70292 7.44452L0.807105 6.80744C-0.363267 10.2902 0.43743 14.2937 3.21482 17.0711L4.62903 15.6569ZM10.2859 10L10.2859 10V8.00001C9.73388 8.00001 9.23252 8.22496 8.87168 8.58578L10.2859 10ZM0.578782 1.70711L8.87168 10L10.2859 8.58579L1.993 0.292893L0.578782 1.70711ZM8.87168 10L10.2859 11.4142L11.7001 10L10.2859 8.58579L8.87168 10ZM10.2859 11.4142L13.1143 14.2426L14.5285 12.8284L11.7001 10L10.2859 11.4142ZM13.1143 14.2427L15.9427 17.0711L17.357 15.6569L14.5285 12.8284L13.1143 14.2427ZM15.9427 17.0711L18.5788 19.7071L19.993 18.2929L17.357 15.6569L15.9427 17.0711ZM10.2859 10L10.2859 10L11.7001 11.4142C12.0609 11.0534 12.2859 10.552 12.2859 10H10.2859Z",fill:"#E77777"})),b=()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"16",viewBox:"0 0 21 16",fill:"none"},(0,o.createElement)("path",{d:"M4.00127 14.3639C0.486555 10.8492 0.486555 5.15071 4.00127 1.63599M16.7292 1.63599C20.2439 5.15071 20.2439 10.8492 16.7292 14.3639M6.8297 11.5355C4.87708 9.58286 4.87708 6.41704 6.8297 4.46441M13.9008 4.46441C15.8534 6.41704 15.8534 9.58286 13.9008 11.5355M11.3652 7.99995C11.3652 8.55223 10.9175 8.99995 10.3652 8.99995C9.81295 8.99995 9.36523 8.55223 9.36523 7.99995C9.36523 7.44766 9.81295 6.99995 10.3652 6.99995C10.9175 6.99995 11.3652 7.44766 11.3652 7.99995Z",stroke:"#6D955A","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),_=()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55",height:"55",viewBox:"0 0 55 55",fill:"none"},(0,o.createElement)("path",{d:"M46.6215 21.757C44.6278 22.9074 43.5209 25.0684 43.5415 27.3692C43.5415 27.4128 43.5415 27.4563 43.5415 27.4999C43.5415 27.5434 43.5415 27.5892 43.5415 27.6328C43.5209 29.9336 44.6278 32.0947 46.6215 33.2451L46.6399 33.2565C47.9943 34.038 49.7565 33.2657 50.043 31.728C50.5678 28.9047 50.5426 26.0378 50.0178 23.2717C49.7268 21.7386 47.9713 20.9778 46.6215 21.757V21.757Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M19.8137 13.4291C19.6052 13.5437 19.3989 13.6629 19.195 13.7866C17.2906 14.9462 14.8958 14.9256 12.9639 13.8096C11.621 13.035 11.385 11.1421 12.5583 10.1291C14.701 8.27747 17.1875 6.8131 19.9145 5.85518C21.3812 5.33955 22.912 6.48997 22.912 8.04372V8.06205C22.912 10.2781 21.7547 12.3635 19.8137 13.4291V13.4291Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M19.8137 13.4291C19.6052 13.5437 19.3989 13.6629 19.195 13.7866C17.2906 14.9462 14.8958 14.9256 12.9639 13.8096C11.621 13.035 11.385 11.1421 12.5583 10.1291C14.701 8.27747 17.1875 6.8131 19.9145 5.85518C21.3812 5.33955 22.912 6.48997 22.912 8.04372V8.06205C22.912 10.2781 21.7547 12.3635 19.8137 13.4291V13.4291Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M35.2025 41.5616C35.4065 41.4493 35.6081 41.3325 35.8075 41.211C37.7119 40.0514 40.1067 40.0721 42.0386 41.1881C43.3815 41.9627 43.6175 43.8556 42.4442 44.8685C40.3015 46.7202 37.815 48.1846 35.0879 49.1448C33.6213 49.6627 32.0881 48.5123 32.0881 46.9562C32.0881 44.731 33.2523 42.6364 35.2025 41.5616V41.5616Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M8.37836 33.243C7.02857 34.0221 5.27315 33.2613 4.98211 31.7305C4.45732 28.9644 4.43211 26.0953 4.9569 23.2719C5.24336 21.7342 7.00336 20.9619 8.35773 21.7434L8.37836 21.7548C10.3721 22.9053 11.479 25.0663 11.4584 27.3671C11.4584 27.4107 11.4584 27.4565 11.4584 27.5001C11.4584 27.5436 11.4584 27.5871 11.4584 27.6307C11.479 29.9315 10.3721 32.0926 8.37836 33.243V33.243Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M8.37836 33.243C7.02857 34.0221 5.27315 33.2613 4.98211 31.7305C4.45732 28.9644 4.43211 26.0953 4.9569 23.2719C5.24336 21.7342 7.00336 20.9619 8.35773 21.7434L8.37836 21.7548C10.3721 22.9053 11.479 25.0663 11.4584 27.3671C11.4584 27.4107 11.4584 27.4565 11.4584 27.5001C11.4584 27.5436 11.4584 27.5871 11.4584 27.6307C11.479 29.9315 10.3721 32.0926 8.37836 33.243V33.243Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M32.0881 8.06439C32.0881 6.50605 33.6258 5.36709 35.0948 5.88043C37.7531 6.80855 40.2511 8.22022 42.435 10.0902C43.6221 11.1077 43.4113 13.0167 42.0569 13.7981L42.0363 13.8096C40.1044 14.9233 37.7119 14.9463 35.8075 13.7867C35.6036 13.6629 35.3973 13.5415 35.1865 13.4269C33.2454 12.3636 32.0881 10.2781 32.0881 8.06439V8.06439Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M32.0881 8.06439C32.0881 6.50605 33.6258 5.36709 35.0948 5.88043C37.7531 6.80855 40.2511 8.22022 42.435 10.0902C43.6221 11.1077 43.4113 13.0167 42.0569 13.7981L42.0363 13.8096C40.1044 14.9233 37.7119 14.9463 35.8075 13.7867C35.6036 13.6629 35.3973 13.5415 35.1865 13.4269C33.2454 12.3636 32.0881 10.2781 32.0881 8.06439V8.06439Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M22.9122 46.9357C22.9122 48.494 21.3745 49.633 19.9055 49.1196C17.2472 48.1915 14.7493 46.7798 12.5653 44.9098C11.3782 43.8923 11.5891 41.9834 12.9434 41.2019C14.8868 40.079 17.2953 40.0607 19.2157 41.2248C19.4128 41.344 19.6122 41.4609 19.8161 41.5709C21.7549 42.6365 22.9122 44.7219 22.9122 46.9357V46.9357Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M27.5 20.6256L34.3755 27.5011L27.5 34.3766L20.6245 27.5011L27.5 20.6256Z",stroke:"#577BF9","stroke-width":"1.91406","stroke-linecap":"round","stroke-linejoin":"round"})),f=(0,o.createElement)("svg",{width:"18",height:"16",viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.9581 0C13.5192 0 17.2136 3.58 17.2136 8C17.2136 12.42 13.5192 16 8.9581 16C4.39696 16 0.702637 12.42 0.702637 8C0.702637 3.58 4.39696 0 8.9581 0ZM10.6558 9L11.0219 3H7.92606L8.29211 9H10.6558ZM11.0219 11.5115C11.0219 11.9809 10.8811 12.3473 10.6213 12.6107C10.3507 12.874 9.97188 13 9.48478 13C8.99768 13 8.61882 12.874 8.33739 12.6107C8.06677 12.3473 7.92606 11.9809 7.92606 11.5115C7.92606 11.0305 8.05595 10.6641 8.32656 10.4008C8.59717 10.1374 8.97603 10 9.48478 10C9.99353 10 10.3724 10.1374 10.6322 10.4008C10.892 10.6641 11.0219 11.0305 11.0219 11.5115Z",fill:"#AF3535"})),E=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M17.25 8.25H21V4.5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M3 12C3 7.029 7.029 3 12 3C15.63 3 18.751 5.154 20.174 8.25",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M6.75 15.75H3V19.5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M21 12C21 16.971 16.971 21 12 21C8.37 21 5.249 18.846 3.826 15.75",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),v=(0,o.createElement)("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M35.8621 13.647L22.0095 27.4996L15.085 20.5733",fill:"none",stroke:"white","stroke-width":"2.75","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M38.5 22C38.5 31.1135 31.1135 38.5 22 38.5C12.8865 38.5 5.5 31.1135 5.5 22C5.5 12.8865 12.8865 5.5 22 5.5C24.6638 5.5 27.1718 6.14717 29.3993 7.26733",fill:"none",stroke:"white","stroke-width":"2.75","stroke-linecap":"round","stroke-linejoin":"round"})),y=(0,o.createElement)("svg",{width:"20",height:"22",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M5 15C2.79086 15 1 13.2091 1 11C1 9.09295 2.33457 7.4976 4.12071 7.09695C4.04169 6.74395 4 6.37684 4 6C4 3.23858 6.23858 1 9 1C11.4193 1 13.4373 2.71825 13.9002 5.00098C13.9334 5.00033 13.9666 5 14 5C16.7614 5 19 7.23858 19 10C19 12.419 17.2822 14.4367 15 14.9M13 12L10 9M10 9L7 12M10 9L10 21",stroke:"#577BF9","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),w=(0,o.createElement)("svg",{width:"20",height:"22",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M5 15C2.79086 15 1 13.2091 1 11C1 9.09295 2.33457 7.4976 4.12071 7.09695C4.04169 6.74395 4 6.37684 4 6C4 3.23858 6.23858 1 9 1C11.4193 1 13.4373 2.71825 13.9002 5.00098C13.9334 5.00033 13.9666 5 14 5C16.7614 5 19 7.23858 19 10C19 12.419 17.2822 14.4367 15 14.9M7 18L10 21M10 21L13 18M10 21V9",stroke:"#577BF9","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),x=(0,o.createElement)("svg",{width:"20",height:"18",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M10.0015 8V10M10.0015 14H10.0115M3.0733 18H16.9297C18.4693 18 19.4316 16.3333 18.6618 15L11.7336 3C10.9637 1.66667 9.03925 1.66667 8.26945 3L1.34125 15C0.571445 16.3333 1.5337 18 3.0733 18Z",stroke:"#DE9F0C","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),k=window.wp.apiFetch;var C=a.n(k);const S=window.wp.url,A=window.wp.notices,D=window.optimoleDashboardApp.submenu_links,L=(e=!0)=>{const t=document.querySelector("li#toplevel_page_optimole");let a=document.querySelector("li#toplevel_page_optimole .wp-submenu");a||(a=document.createElement("ul"),a.classList.add("wp-submenu","wp-submenu-wrap"),t.classList.add("wp-has-submenu","wp-has-current-submenu","wp-menu-open"),t.appendChild(a)),e?(D.forEach((e=>{if(document.querySelector(`li#toplevel_page_optimole a[href="${e.href}"]`))return;const t=document.createElement("li"),o=document.createElement("a");o.href=e.href,o.innerHTML=e.text,t.appendChild(o),e.hash&&e.hash===window.location.hash&&(t.classList.add("current"),o.classList.add("current")),a.appendChild(t)})),a.style.display="block"):a.style.display="none"},{setIsConnected:N,setIsConnecting:T,setIsLoading:M,setHasRestError:I,setHasValidKey:O,setHasApplication:j,setAPIKey:F,setUserData:B,setAvailableApps:H,sethasDashboardLoaded:z,setShowDisconnect:R,setConflicts:P,setOptimizedImages:V,setSiteSettings:Z,setSampleRate:q,setCheckedOffloadConflicts:G,setOffloadConflicts:$,setLoadingSync:K,setLoadingRollback:U,setTotalNumberOfImages:Y,setProcessedImages:Q,setErrorMedia:W,setOffloadLibraryLink:J,setRollbackLibraryLink:X,setExtraVisits:ee,setLogs:te,setShowFinishNotice:ae,setOffloadLimitReached:oe,ensureOffloadingRollbackDisabled:se,setOffloadLimit:le}=(0,c.dispatch)("optimole"),{getOptimizedImages:ne,getQueryArgs:re,getTotalNumberOfImages:ie,getSiteSettings:ce}=(0,c.select)("optimole"),{createNotice:de}=(0,c.dispatch)(A.store),pe=(e={})=>{e.offset=void 0!==e.offset?e.offset:0,C()({path:optimoleDashboardApp.routes.upload_onboard_images,method:"POST",data:e}).then((t=>{!1===t.data&&1e3>e.offset&&pe({offset:e.offset+100}),"success"===t.code&&console.log("%c Images Crawled.","color: #59B278")})).catch((e=>(console.log("Error while crawling images",e),e.data)))},me=(e,t=(()=>{}))=>{T(!0),M(!0),I(!1),C()({path:optimoleDashboardApp.routes.register_service,method:"POST",data:e,parse:!1}).then((e=>e.json())).then((e=>(T(!1),M(!1),"success"===e.code&&(N(!0),O(!0),j(!0),F(e.data.api_key),B(e.data),H(e.data),pe(),L(!0)),t&&t(e),e.data))).catch((e=>(T(!1),M(!1),I(!0),e.data)))},ge=()=>{M(!0),C()({path:optimoleDashboardApp.routes.disconnect,method:"GET",parse:!1}).then((e=>{M(!1),j(!1),F(""),B(null),H(null),e.ok?(N(!1),z(!1),R(!1),L(!1),console.log("%c Disconnected from OptiMole API.","color: #59B278")):console.error(e)}))},ue=()=>{M(!0),C()({path:optimoleDashboardApp.routes.request_update,method:"GET",parse:!1}).then((e=>200<=e.status&&300>e.status?e.json():(console.log(`%c Request failed with status ${e.status}`,"color: #E7602A"),Promise.resolve()))).then((e=>{M(!1),e&&(B(e.data),void 0!==e?.data?.extra_visits&&ee(e.data.extra_visits),"disconnected"===e.code&&(N(!1),z(!1),console.log("%c Disconnected from OptiMole API.","color: #59B278")))}))},he=(e=(()=>{}))=>{if(0<ne().length)return console.log("%c Images already exist.","color: #59B278"),e&&e(),!1;C()({path:optimoleDashboardApp.routes.poll_optimized_images,method:"GET"}).then((t=>{"success"===t.code?(V(t.data),console.log("%c Images Fetched.","color: #59B278")):console.log("%c No images available.","color: #E7602A"),e&&e(t)})).catch((e=>(console.log("Error while polling images",e),e.data)))},be=(e,t=!1,a=!1,o=(()=>{}))=>{M(!0),C()({path:optimoleDashboardApp.routes.update_option,method:"POST",data:{settings:e}}).then((e=>{M(!1),"success"===e.code&&(Z(e.data),a||ye(optimoleDashboardApp.strings.options_strings.settings_saved),console.log("%c Settings Saved.","color: #59B278"))})).then((()=>{t&&ue()})).then((()=>{o()})).catch((e=>(M(!1),ye(optimoleDashboardApp.strings.options_strings.settings_saved_error),console.log("Error while saving settings",e),e.data)))},_e=e=>{M(!0),C()({path:optimoleDashboardApp.routes.clear_cache_request,method:"POST",data:{type:e},parse:!1}).then((e=>(M(!1),200<=e.status&&300>e.status?(ye(optimoleDashboardApp.strings.options_strings.cache_cleared),void console.log("%c New cache token generated.","color: #59B278")):(ye(optimoleDashboardApp.strings.options_strings.cache_cleared_error),void console.log("%c Could not generate cache token.","color: #E7602A")))))},fe=(e,t=(()=>{}))=>{C()({path:(0,S.addQueryArgs)(optimoleDashboardApp.routes.get_sample_rate,{quality:e.quality,force:e?.force||"no"}),method:"POST"}).then((e=>{"success"===e.code&&q(e.data),t&&t(e)}))},Ee=(e=(()=>{}))=>{C()({path:optimoleDashboardApp.routes.get_offload_conflicts,method:"GET"}).then((t=>{G(!0),0!==t.data.length&&$(t.data),e&&e(t)}))},ve=e=>{const t=re();"offload_images"===e.action&&(Object.prototype.hasOwnProperty.call(t,"optimole_action")&&J(!1),K(!0)),"rollback_images"===e.action&&(Object.prototype.hasOwnProperty.call(t,"optimole_action")&&X(!1),U(!0)),M(!0);const a=void 0!==e.images?e.images:[];C()({path:optimoleDashboardApp.routes.number_of_images_and_pages,method:"POST",data:{action:e.action,refresh:e.refresh||!1,images:a},parse:!1}).then((t=>{if(200<=t.status&&300>t.status)return t.json();"offload_images"===e.action&&(K(!1),M(!1)),"rollback_images"===e.action&&(U(!1),M(!1))})).then((o=>{if(!o.data.count||0===o.data.count||!1===o.data.status)return console.log("%c No images available.","color: #E7602A"),K(!1),U(!1),M(!1),0===o.data.count&&(oe("disabled"),ae(o.data.action)),o.data.reached_limit&&oe(o.data.reached_limit?"enabled":"disabled"),o.data.offload_limit&&le(o.data.offload_limit),se(),be(ce(),!1),"offload_images"===e.action&&Object.prototype.hasOwnProperty.call(t,"optimole_action")&&J(!0),void("rollback_images"===e.action&&Object.prototype.hasOwnProperty.call(t,"optimole_action")&&X(!0));let s=ie();e.refresh?(Q(0!==s?Math.abs(s-o.data.count):0),0!==o.data.count&&0===s&&Y(o.data.count)):Y(o.data.count),setTimeout((()=>{ve({action:e.action,refresh:!0,images:a})}),1e4)})).finally((()=>{var t;t="offload_images"===e.action?"offload":"rollback",jQuery.ajax({type:"POST",url:window.ajaxurl,data:{action:"optml_fetch_logs",nonce:optimoleDashboardApp.nonce,type:t},success:e=>{te(t,e)}})})).catch((t=>{W(e.action),K(!1),U(!1)}))},ye=e=>{de("info",e,{isDismissible:!0,type:"snackbar"})},we=({tab:e,setTab:t})=>{const[a,l]=(0,s.useState)(!1),{setShowDisconnect:n}=(0,c.useDispatch)("optimole"),{isConnected:r,isLoading:i,hasApplication:d,hasDashboardLoaded:m,hasConflicts:_}=(0,c.useSelect)((e=>{const{isConnected:t,isLoading:a,hasApplication:o,hasDashboardLoaded:s,getConflicts:l}=e("optimole"),n=l();return{isConnected:t(),isLoading:a(),hasApplication:o(),hasDashboardLoaded:s(),hasConflicts:0<n.count||0}}));(0,s.useEffect)((()=>{_&&l(!0)}),[_]);const f=[{label:optimoleDashboardApp.strings.dashboard_menu_item,value:"dashboard"},{label:optimoleDashboardApp.strings.conflicts_menu_item,value:"conflicts",isDisabled:!a},{label:optimoleDashboardApp.strings.settings_menu_item,value:"settings"},{label:optimoleDashboardApp.strings.help_menu_item,value:"help"}],E=r&&d&&!m;return(0,o.createElement)("header",{className:"bg-white shadow-sm px-2.5 py-5 pb-0"},(0,o.createElement)("div",{className:"flex flex-col sm:flex-row justify-between items-center max-w-screen-xl mx-auto my-0 pb-5"},(0,o.createElement)("div",{className:"items-center flex justify-start cursor-default"},(0,o.createElement)("img",{className:"max-width-64 w-16 h-16 mr-3",src:`${optimoleDashboardApp.assets_url}/img/logo.png`,alt:optimoleDashboardApp.strings.optimole+" "+optimoleDashboardApp.strings.service_details,title:optimoleDashboardApp.strings.optimole+" "+optimoleDashboardApp.strings.service_details}),(0,o.createElement)("h3",{className:"text-gray-800 text-2 font-serif font-bold"},optimoleDashboardApp.strings.optimole)),(0,o.createElement)("div",{className:"flex items-center"},r?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.DropdownMenu,{icon:i||E?(0,o.createElement)(u.Icon,{icon:g,className:"animate-spin fill-success"}):(0,o.createElement)(u.Icon,{icon:b}),toggleProps:{className:"optml-header__dropdown uppercase font-bold text-xs text-success hover:text-success active:text-success focus:text-success mr-3 border border-gray-300 rounded-md border-solid gap-2",iconPosition:"right"},popoverProps:{className:"optml-header__dropdown__popover"},text:E?optimoleDashboardApp.strings.connecting:optimoleDashboardApp.strings.connected,controls:[{title:optimoleDashboardApp.strings.optimole+" "+optimoleDashboardApp.strings.dashboard_menu_item,onClick:()=>window.open(optimoleDashboardApp.optimoleDashHome,"_blank")},{title:optimoleDashboardApp.strings.refresh_stats_cta,onClick:ue,isDisabled:E},{title:optimoleDashboardApp.strings.disconnect_btn,onClick:()=>n(!0),isDisabled:E}]})):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"uppercase font-bold text-xs text-danger mr-3"},optimoleDashboardApp.strings.not_connected),(0,o.createElement)(u.Icon,{icon:h})))),r&&d&&m&&(0,o.createElement)("ul",{className:"flex gap-8 items-center max-w-screen-xl mx-auto my-0 justify-center sm:justify-normal"},f.filter((e=>!e?.isDisabled)).map((({label:a,value:s})=>(0,o.createElement)("li",{key:s,className:p()("cursor-pointer text-purple-gray font-bold text-lg m-0 py-2 px-3 transition-colors duration-200 ease-in-out border-0 border-b-4 border-b-white border-solid",{"text-black !border-b-info":e===s}),onClick:()=>t(s)},a)))))},xe=()=>{const{setShowDisconnect:e}=(0,c.useDispatch)("optimole"),{isLoading:t}=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}}));return(0,o.createElement)(u.Modal,{title:optimoleDashboardApp.strings.disconnect_title,className:"optml__modal",onRequestClose:()=>e(!1)},(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.disconnect_desc}}),(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)(u.Button,{variant:"default",className:"optml__button flex w-full justify-center rounded font-bold mt-4 min-h-40",onClick:()=>e(!1)},optimoleDashboardApp.strings.keep_connected),(0,o.createElement)(u.Button,{isDestructive:!0,className:"optml__button flex w-full justify-center rounded font-bold mt-4 min-h-40",isBusy:t,disabled:t,onClick:ge},optimoleDashboardApp.strings.disconnect_btn)))},ke=({setMethod:e})=>{const[t,a]=(0,s.useState)(""),[l,n]=(0,s.useState)({}),[r,i]=(0,s.useState)(0),{setShowDisconnect:d}=(0,c.useDispatch)("optimole"),{availableApps:p,hasValidKey:m,isConnected:g,isConnecting:h,isLoading:b}=(0,c.useSelect)((e=>{const{getAvailableApps:t,hasValidKey:a,isConnected:o,isConnecting:s,isLoading:l}=e("optimole");return{availableApps:t(),hasValidKey:a(),isConnected:o(),isConnecting:s(),isLoading:l()}}));return(0,o.createElement)("div",{className:"text-2 font-bold m-0 text-gray-700"},(0,o.createElement)("div",{className:"text-gray-800 font-serif leading-7"},optimoleDashboardApp.strings.connect_btn),(0,o.createElement)("p",{className:"text-xl font-normal text-gray-800",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.steps_connect_api_desc}}),(0,o.createElement)("div",{className:"flex flex-col gap-8 p-8 bg-light-blue border border-blue-300 rounded-md"},(0,o.createElement)("div",{className:"flex flex-col sm:flex-row gap-8 items-stretch sm:items-end"},(0,o.createElement)(u.TextControl,{label:g?optimoleDashboardApp.strings.your_api_key:optimoleDashboardApp.strings.add_api,placeholder:optimoleDashboardApp.strings.email,disabled:g,value:t,onChange:a,className:"optml__input basis-4/5"}),g?(0,o.createElement)(u.Button,{variant:"default",isBusy:b,disabled:b,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:d},optimoleDashboardApp.strings.disconnect_btn):(0,o.createElement)(u.Button,{variant:"primary",isBusy:h,disabled:h||0===t.length,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:()=>{n({}),((e,t=(()=>{}))=>{T(!0),M(!0),I(!1),C()({path:optimoleDashboardApp.routes.connect,method:"POST",data:e,parse:!1}).then((e=>e.json())).then((e=>(T(!1),M(!1),"success"===e.code?(N(!0),O(!0),F(e.data.api_key),void 0!==e.data.app_count&&1<e.data.app_count?H(e.data):(j(!0),B(e.data)),pe(),L(!0),console.log("%c OptiMole API connection successful.","color: #59B278")):(O(!1),console.log("%c Invalid API Key.","color: #E7602A")),t&&t(e),e.data))).catch((e=>(T(!1),M(!1),I(!0),e.data)))})({api_key:t},(e=>{"success"!==e.code&&n({error_connect:e.data})}))}},optimoleDashboardApp.strings.connect_btn)),p&&(0,o.createElement)("div",{className:"flex flex-col sm:flex-row gap-8 items-stretch sm:items-end"},(0,o.createElement)("div",{className:"basis-4/5"},(0,o.createElement)(u.SelectControl,{label:optimoleDashboardApp.strings.select+" "+optimoleDashboardApp.strings.your_domain,value:r,options:p.available_apps.map(((e,t)=>({label:e.domain,value:t}))),onChange:i,className:"optml__select has_large_title",__nextHasNoMarginBottom:!0})),(0,o.createElement)(u.Button,{variant:"primary",isBusy:h,disabled:h,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:()=>{((e,t=(()=>{}))=>{T(!0),I(!1),C()({path:optimoleDashboardApp.routes.select_application,method:"POST",data:e}).then((e=>{T(!1),M(!1),"success"===e.code?(O(!0),j(!0),F(e.data.api_key),B(e.data),H(e.data),console.log("%c OptiMole API connection successful.","color: #59B278")):(O(!1),console.log("%c Invalid API Key.","color: #E7602A")),t&&t(e)})).catch((e=>(T(!1),I(!0),e.data)))})({api_key:t,application:null!=p&&void 0!==p.available_apps?p.available_apps[r].key:""},(e=>{"success"!==e.code&&n({error_connect:e.data})}))}},optimoleDashboardApp.strings.select))),!m&&void 0!==l.error_connect&&(0,o.createElement)("p",{className:"block text-xs mt-1 text-danger",dangerouslySetInnerHTML:{__html:l.error_connect}}),(0,o.createElement)("div",{className:"text-center py-3"},(0,o.createElement)(u.Button,{variant:"link",onClick:()=>e("email")},optimoleDashboardApp.strings.back_to_connect)))},Ce="optml-connect flex flex-col justify-between max-w-screen-xl mt-8 mb-5 mx-auto p-0 transition-all ease-in-out duration-700 relative bg-white text-gray-700 border-0 rounded-lg shadow-md",Se="flex gap-8 p-8 flex-col md:flex-row",Ae=()=>(0,o.createElement)("div",{className:"bg-danger text-white rounded relative px-6 py-5 mb-0 m-12",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.notice_api_not_working}}),De=()=>{const[e,t]=(0,s.useState)(optimoleDashboardApp.current_user.email),[a,l]=(0,s.useState)("email"),[n,r]=(0,s.useState)({}),{setAutoConnect:i}=(0,c.useDispatch)("optimole"),{autoConnect:d,hasRestError:p,isConnecting:m}=(0,c.useSelect)((e=>{const{getAutoConnect:t,hasRestError:a,isConnecting:o}=e("optimole");return{autoConnect:t(),hasRestError:a(),isConnecting:o()}}));return(0,s.useEffect)((()=>{"no"!==d&&me({email:d,auto_connect:!0},(e=>{i("no"),"email_registered"!==e.code?"site_exists"!==e.code?"success"!==e.code&&e.message&&r({error_autoconnect:e.message}):r({site_exists:e.message}):r({email_registered:e.message})}))}),[]),(0,s.useEffect)((()=>{(0===e.length||(0,S.isEmail)(e))&&n.invalid_email&&(delete n.invalid_email,r(n))}),[e]),"key"===a?(0,o.createElement)("div",{className:Ce},p&&(0,o.createElement)(Ae,null),(0,o.createElement)("div",{className:Se},(0,o.createElement)(ke,{setMethod:l}))):(0,o.createElement)("div",{className:Ce},p&&(0,o.createElement)(Ae,null),(0,o.createElement)("div",{className:Se},(0,o.createElement)("div",{className:"optml-connect__content basis-8/12"},(0,o.createElement)("div",{className:"text-gray-700 font-serif text-2 font-bold leading-7 m-0"},optimoleDashboardApp.strings.account_needed_heading),(0,o.createElement)("p",{className:"text-xl font-normal text-gray-800",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.account_needed_title}}),(0,o.createElement)("div",{className:"flex py-3"},(0,o.createElement)(u.Icon,{icon:"yes-alt"}),(0,o.createElement)("p",{className:"text-base ml-3 m-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.account_needed_subtitle_1}})),(0,o.createElement)("div",{className:"flex py-3"},(0,o.createElement)(u.Icon,{icon:"yes-alt"}),(0,o.createElement)("p",{className:"text-base ml-3 m-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.account_needed_subtitle_2}}))),(0,o.createElement)("div",{className:"optml-connect__form basis-4/12 p-8 bg-light-blue border border-blue-300 rounded-md"},(0,o.createElement)(u.TextControl,{label:optimoleDashboardApp.strings.email_address_label,placeholder:optimoleDashboardApp.strings.email,value:e,onChange:t,className:"optml__input",onBlur:()=>{0===e.length||(0,S.isEmail)(e)||r({invalid_email:optimoleDashboardApp.strings.invalid_email})}}),0<Object.keys(n).length&&Object.keys(n).map((e=>(0,o.createElement)("p",{key:e,className:"block text-xs mt-1 text-danger",dangerouslySetInnerHTML:{__html:n[e]}})))||(0,o.createElement)("br",null),(0,o.createElement)(u.Button,{variant:"primary",isBusy:m,disabled:m||0===e.length||!(0,S.isEmail)(e),className:"optml__button flex w-full justify-center rounded font-bold min-h-40",onClick:()=>{r({}),me({email:e},(e=>{"email_registered"!==e.code?"site_exists"!==e.code?"domain_not_accessible"!==e.code?"success"!==e.code&&r({error_register:e.message}):r({domain_not_accessible:e.message}):r({site_exists:e.message}):r({email_registered:e.message})}))}},optimoleDashboardApp.strings.register_btn),(0,o.createElement)("br",null),(0,o.createElement)("br",null),(0,o.createElement)("div",{className:"base-control-label"},optimoleDashboardApp.strings.existing_user),(0,o.createElement)(u.Button,{variant:"secondary",className:"optml__button flex w-full justify-center rounded font-bold mt-4 min-h-40",onClick:()=>l("key")},optimoleDashboardApp.strings.api_exists),(0,o.createElement)("p",{className:"mb-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.signup_terms}}))),(0,o.createElement)("div",{className:"bg-grayish-blue text-gray-800 text-center font-bold uppercase p-2.5 rounded-b-lg"},(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.account_needed_footer}})))},Le=({value:e,max:t=100,className:a,...s})=>{const l=Math.round(e/t*100),n=(s.background,p()("w-full h-2.5 border rounded-md border-solid bg-white border-light-gray relative overflow-hidden",a));return(0,o.createElement)("div",{className:n,role:"progressbar","aria-valuemin":"0","aria-valuemax":t,"aria-valuenow":e,...s},(0,o.createElement)("div",{className:"absolute left-0 h-full bg-info",style:{width:`${l}%`}}))},Ne=[optimoleDashboardApp.strings.options_strings.connect_step_0,optimoleDashboardApp.strings.options_strings.connect_step_1,optimoleDashboardApp.strings.options_strings.connect_step_2,optimoleDashboardApp.strings.options_strings.connect_step_3],Te=()=>{const[e,t]=(0,s.useState)(0),[a,l]=(0,s.useState)(0),[n,r]=(0,s.useState)(0),{sethasDashboardLoaded:i}=(0,c.useDispatch)("optimole");(0,s.useEffect)((()=>{n<=25&&setTimeout((()=>{d()}),1e3)}),[n]);const d=()=>{if(r(n+1),n>=25)return i(!0),r(0),l(0),void t(0);t(Math.floor(n/25*100)),e>30*(a+1)&&l(a+1)};return(0,o.createElement)("div",{className:"optml-connecting flex flex-col justify-between max-w-screen-xl mt-8 mb-5 mx-auto p-0 transition-all ease-in-out duration-700 relative bg-white text-gray-700 border-0 rounded-lg shadow-md"},(0,o.createElement)("div",{className:"flex flex-col md:flex-row items-center justify-center gap-5 px-8 sm:px-0 py-24"},(0,o.createElement)("img",{className:"max-w-full",src:optimoleDashboardApp.assets_url+"img/connecting.png"}),(0,o.createElement)("div",{className:"text-center md:text-left"},(0,o.createElement)("div",{className:"font-bold text-2xl"},optimoleDashboardApp.strings.account_connecting_title),(0,o.createElement)("div",{className:"text-base"},optimoleDashboardApp.strings.account_connecting_subtitle),(0,o.createElement)(Le,{className:"mt-2.5 mb-1.5 mx-0 h-5 border-gray-200",value:n,max:25,background:"#e6e6e6"}),(0,o.createElement)("div",{className:"text-xs"},Ne[a]+" ("+e+"%)"))))},Me=function(){const[e,t]=(0,o.useState)(null),[a,s]=(0,o.useState)({width:0,height:0}),l=(0,o.useCallback)((()=>{s({width:(null==e?void 0:e.offsetWidth)||0,height:(null==e?void 0:e.offsetHeight)||0})}),[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]);return Ie("resize",l),Oe((()=>{l()}),[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]),[t,a]},Ie=function(e,t,a,s){const l=(0,o.useRef)(t);Oe((()=>{l.current=t}),[t]),(0,o.useEffect)((()=>{var t;const o=null!==(t=null==a?void 0:a.current)&&void 0!==t?t:window;if(!o||!o.addEventListener)return;const n=e=>l.current(e);return o.addEventListener(e,n,s),()=>{o.removeEventListener(e,n,s)}}),[e,a,s])},Oe="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,je="yes"!==optimoleDashboardApp.connection_status,Fe=({src:e,oldSize:t,newSize:a})=>{const[s,{width:l}]=Me();return(0,o.createElement)("div",{className:"basis-1/4"},(0,o.createElement)("img",{src:e,className:"w-full border border-slate-200 rounded-md border-solid",style:{height:l},ref:s}),(0,o.createElement)("p",{className:"optml__bullet w-full h-4"},(()=>{let e=(100*(1-a/t)).toFixed(1);return 1>e?"1":100<e?(Math.floor(e/10+10)/10).toFixed(1).toString():e.toString()})(),"% ",optimoleDashboardApp.strings.latest_images.saved," "))},Be=()=>{const[e,{width:t}]=Me();return(0,o.createElement)("div",{className:"basis-1/4"},(0,o.createElement)("div",{className:"optml__loader w-full rounded-md",style:{height:t},ref:e}),(0,o.createElement)("p",{className:"optml__loader w-full h-4"}))},He=()=>{const[e,t]=(0,s.useState)(!1),[a,l]=(0,s.useState)(0),[n,r]=(0,s.useState)(0),[i,d]=(0,s.useState)(0);(0,s.useEffect)((()=>{i<=20&&setTimeout((()=>{m()}),1e3)}),[i]);const{images:p}=(0,c.useSelect)((e=>{const{getOptimizedImages:t}=e("optimole");return{images:t()||[]}}));(0,s.useEffect)((()=>{8<=p.length?t(!0):e||je||he((()=>{t(!0)}))}),[]);const m=()=>{d(i+1),i>=20?he((()=>{t(!0),d(0),r(0),l(0),ue()})):(l(Math.floor(i/20*100)),a>30*(n+1)&&r(n+1))};return(0,o.createElement)("div",{className:"hidden lg:block pt-5 border-grayish-blue border-0 border-t-2 border-solid"},(0,o.createElement)("h3",{className:"text-base m-0"},optimoleDashboardApp.strings.latest_images.last," ",optimoleDashboardApp.strings.latest_images.optimized_images),je&&!e&&(0,o.createElement)("div",{className:"flex items-center flex-col py-2"},(0,o.createElement)("p",{className:"font-semibold"},optimoleDashboardApp.strings.latest_images.loading_latest_images),(0,o.createElement)(Le,{max:20,value:i})),!je&&!e&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex justify-between mt-5 gap-5"},[...Array(4)].map((()=>(0,o.createElement)(Be,null)))),(0,o.createElement)("div",{className:"flex justify-between mt-5 gap-5"},[...Array(4)].map((()=>(0,o.createElement)(Be,null))))),e&&4>p?.length&&(0,o.createElement)("div",{className:"text-center py-12"},(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.latest_images.no_images_found}})),e&&4<=p?.length&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex justify-between mt-5 gap-5"},[...Array(4)].map(((e,t)=>(0,o.createElement)(Fe,{src:p[t].url,oldSize:p[t].ex_size_raw,newSize:p[t].new_size_raw})))),8<=p?.length&&(0,o.createElement)("div",{className:"flex justify-between mt-5 gap-5"},[...Array(4)].map(((e,t)=>(t+=4,(0,o.createElement)(Fe,{src:p[t].url,oldSize:p[t].ex_size_raw,newSize:p[t].new_size_raw})))))))},ze="flex p-6 bg-light-blue border border-blue-300 rounded-md",Re=[{label:optimoleDashboardApp.strings.metrics.metricsTitle1,description:optimoleDashboardApp.strings.metrics.metricsSubtitle1,value:"images_number",icon:()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55",height:"55",viewBox:"0 0 55 55",fill:"none"},(0,o.createElement)("path",{d:"M42.0235 45.3568L45.0279 46.6928C46.5427 47.3666 48.25 46.2574 48.25 44.5982V10.402C48.25 8.74281 46.5427 7.63364 45.0279 8.30739L42.0235 9.64343C32.8569 13.718 22.3931 13.718 13.2265 9.64343L10.2221 8.30739C8.70729 7.63364 7 8.74281 7 10.402V44.5982C7 46.2574 8.70729 47.3666 10.2221 46.6928L13.2265 45.3568C22.3931 41.2845 32.8569 41.2845 42.0235 45.3568Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M34.5002 35.5209H20.7502C19.4852 35.5209 18.4585 34.4942 18.4585 33.2292V21.7709C18.4585 20.5059 19.4852 19.4792 20.7502 19.4792H34.5002C35.7652 19.4792 36.7918 20.5059 36.7918 21.7709V33.2292C36.7918 34.4942 35.7652 35.5209 34.5002 35.5209Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M30.9707 25.0939L36.7915 29.8376",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M30.9711 25.0939L26.0669 30.2043",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M26.0665 30.2043L23.3853 28.4167",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M23.3856 28.4167L18.4585 32.5647",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}))},{label:optimoleDashboardApp.strings.metrics.metricsTitle2,description:optimoleDashboardApp.strings.metrics.metricsSubtitle2,value:"saved_size",icon:()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"55",viewBox:"0 0 56 55",fill:"none"},(0,o.createElement)("path",{d:"M36.681 6.875H13.7643C8.70203 6.875 4.59766 10.9794 4.59766 16.0417C4.59766 21.104 8.70203 25.2083 13.7643 25.2083H36.681C41.7433 25.2083 45.8477 21.104 45.8477 16.0417C45.8477 10.9794 41.7433 6.875 36.681 6.875Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M13.7643 25.2084C8.70203 25.2084 4.59766 29.3127 4.59766 34.375C4.59766 39.4373 8.70203 43.5417 13.7643 43.5417H29.806",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M22.9307 16.0416H36.6807",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M13.845 15.9606C13.8898 16.0053 13.8898 16.0779 13.845 16.1226C13.8003 16.1674 13.7277 16.1674 13.683 16.1226C13.6382 16.0779 13.6382 16.0053 13.683 15.9606C13.7277 15.9158 13.8003 15.9158 13.845 15.9606Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M22.9307 34.375H27.7432",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M13.845 34.2938C13.8898 34.3386 13.8898 34.4111 13.845 34.4559C13.8003 34.5006 13.7277 34.5006 13.683 34.4559C13.6382 34.4111 13.6382 34.3386 13.683 34.2938C13.7277 34.2491 13.8003 34.2491 13.845 34.2938Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M38.9725 48.125C32.6452 48.125 27.5142 42.994 27.5142 36.6667C27.5142 30.3394 32.6452 25.2084 38.9725 25.2084C45.3021 25.2084 50.4308 30.3394 50.4308 36.6667C50.4308 42.994 45.3021 48.125 38.9725 48.125Z",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M40.2465 31.5745L36.4263 35.3924L41.5184 37.9407L37.6981 41.7586",stroke:"#577BF9","stroke-width":"1.875","stroke-linecap":"round","stroke-linejoin":"round"}))},{label:optimoleDashboardApp.strings.metrics.metricsTitle3,description:optimoleDashboardApp.strings.metrics.metricsSubtitle3,value:"compression_percentage",icon:()=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55",height:"55",viewBox:"0 0 55 55",fill:"none"},(0,o.createElement)("path",{d:"M43.5418 32.0833C41.0095 32.0833 38.9585 30.0323 38.9585 27.5C38.9585 24.9677 41.0095 22.9166 43.5418 22.9166C46.0741 22.9166 48.1252 24.9677 48.1252 27.5C48.1252 30.0323 46.0741 32.0833 43.5418 32.0833Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M32.0832 43.5417C32.0832 46.074 30.0321 48.1251 27.4998 48.1251C24.9675 48.1251 22.9165 46.074 22.9165 43.5417C22.9165 41.0094 24.9675 38.9584 27.4998 38.9584C30.0321 38.9584 32.0832 41.0094 32.0832 43.5417Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M43.5418 48.1251C41.0095 48.1251 38.9585 46.074 38.9585 43.5417C38.9585 41.0094 41.0095 38.9584 43.5418 38.9584C46.0741 38.9584 48.1252 41.0094 48.1252 43.5417C48.1252 46.074 46.0741 48.1251 43.5418 48.1251Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M27.4998 16.0417C24.9675 16.0417 22.9165 13.9906 22.9165 11.4583C22.9165 8.92604 24.9675 6.875 27.4998 6.875C30.0321 6.875 32.0832 8.92604 32.0832 11.4583C32.0832 13.9906 30.0321 16.0417 27.4998 16.0417Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M38.9585 11.4583C38.9585 8.92604 41.0095 6.875 43.5418 6.875C46.0741 6.875 48.1252 8.92604 48.1252 11.4583C48.1252 13.9906 46.0741 16.0417 43.5418 16.0417C41.0095 16.0417 38.9585 13.9906 38.9585 11.4583Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M30.7314 40.3104L40.3106 30.7312",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M14.6895 40.3104L24.2686 30.7312",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M30.7314 24.2687L40.3106 14.6896",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M22.9165 27.5C22.9165 24.9677 24.9675 22.9166 27.4998 22.9166C30.0321 22.9166 32.0832 24.9677 32.0832 27.5C32.0832 30.0323 30.0321 32.0833 27.4998 32.0833C24.9675 32.0833 22.9165 30.0323 22.9165 27.5Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M14.6895 24.2687L24.2686 14.6896",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M11.4583 32.0833C8.92604 32.0833 6.875 30.0323 6.875 27.5C6.875 24.9677 8.92604 22.9166 11.4583 22.9166C13.9906 22.9166 16.0417 24.9677 16.0417 27.5C16.0417 30.0323 13.9906 32.0833 11.4583 32.0833Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M16.0417 43.5417C16.0417 46.074 13.9906 48.1251 11.4583 48.1251C8.92604 48.1251 6.875 46.074 6.875 43.5417C6.875 41.0094 8.92604 38.9584 11.4583 38.9584C13.9906 38.9584 16.0417 41.0094 16.0417 43.5417Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{d:"M11.4583 16.0417C8.92604 16.0417 6.875 13.9906 6.875 11.4583C6.875 8.92604 8.92604 6.875 11.4583 6.875C13.9906 6.875 16.0417 8.92604 16.0417 11.4583C16.0417 13.9906 13.9906 16.0417 11.4583 16.0417Z",stroke:"#577BF9","stroke-width":"1.97917","stroke-linecap":"round","stroke-linejoin":"round"}))},{label:optimoleDashboardApp.strings.metrics.metricsTitle4,description:optimoleDashboardApp.strings.metrics.metricsSubtitle4,value:"traffic",icon:()=>(0,o.createElement)("svg",{width:"55",height:"55",viewBox:"0 0 64 64",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg","svg-inline":"",role:"presentation",focusable:"false"},(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 28c0 2.947-4.178 5.333-9.333 5.333S5.334 30.944 5.334 28",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 28c0 2.947-4.178 5.333-9.333 5.333S5.334 30.944 5.334 28",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 28c0 2.947-4.178 5.333-9.333 5.333S5.334 30.944 5.334 28",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M23.997 36c0 2.947-4.178 5.333-9.333 5.333S5.334 38.944 5.334 36",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M50.667 56H40a5.332 5.332 0 01-5.333-5.333V13.333A5.332 5.332 0 0140 8h10.667A5.332 5.332 0 0156 13.333v37.334A5.332 5.332 0 0150.667 56z",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M50.667 56H40a5.332 5.332 0 01-5.333-5.333V13.333A5.332 5.332 0 0140 8h10.667A5.332 5.332 0 0156 13.333v37.334A5.332 5.332 0 0150.667 56z",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M50.667 56H40a5.332 5.332 0 01-5.333-5.333V13.333A5.332 5.332 0 0140 8h10.667A5.332 5.332 0 0156 13.333v37.334A5.332 5.332 0 0150.667 56z",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M24 32h10.667M24 32h10.667",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M24 32h10.667",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 16H48M42.667 16H48",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 16H48",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 26.667H48M42.667 26.667H48",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 26.667H48",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 37.333H48M42.667 37.333H48",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 37.333H48",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 48H48M42.667 48H48",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M42.667 48H48",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c0 2.947 4.179 5.333 9.334 5.333C19.82 25.333 24 22.947 24 20",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c0 2.947 4.179 5.333 9.334 5.333C19.82 25.333 24 22.947 24 20",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c0 2.947 4.179 5.333 9.334 5.333C19.82 25.333 24 22.947 24 20",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c.003-2.944 4.182-5.333 9.334-5.333 5.152 0 9.333 2.386 9.33 5.333v24c0 2.947-4.178 5.333-9.333 5.333S5.334 46.944 5.334 44V20v0z",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c.003-2.944 4.182-5.333 9.334-5.333 5.152 0 9.333 2.386 9.33 5.333v24c0 2.947-4.178 5.333-9.333 5.333S5.334 46.944 5.334 44V20v0z",stroke:"#EDF0FF","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,o.createElement)("path",{"data-v-767b24d4":"",d:"M5.333 20c.003-2.944 4.182-5.333 9.334-5.333 5.152 0 9.333 2.386 9.33 5.333v24c0 2.947-4.178 5.333-9.333 5.333S5.334 46.944 5.334 44V20v0z",stroke:"#577BF9","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"}))}],Pe=()=>(0,o.createElement)("div",{className:"flex gap-2 bg-warning text-danger border border-solid border-danger rounded relative px-6 py-5 mb-5"},(0,o.createElement)(u.Icon,{icon:f}),(0,o.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.notice_disabled_account}})),Ve=()=>(0,o.createElement)("div",{className:"flex gap-2 bg-success text-white rounded relative px-6 py-5 mb-5"},(0,o.createElement)(u.Icon,{icon:"cloud-saved"}),(0,o.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.notice_just_activated}})),Ze=()=>{const{userData:e,userStatus:t}=(0,c.useSelect)((e=>{const{getUserData:t,getUserStatus:a}=e("optimole");return{userData:t(),userStatus:a()}})),a=(e.visitors/e.visitors_limit*100).toFixed(0);return(0,o.createElement)("div",{className:"bg-white p-8 border-0 rounded-lg shadow-md"},0<optimoleDashboardApp.strings.notice_just_activated.length&&"active"===t&&(0,o.createElement)(Ve,null),"inactive"===t&&(0,o.createElement)(Pe,null),(0,o.createElement)("div",{className:p()(ze,"gap-8 flex-col sm:flex-row items-start sm:items-center")},(0,o.createElement)(u.Icon,{icon:_}),(0,o.createElement)("div",{className:"flex w-full flex-col"},(0,o.createElement)("div",{className:"flex w-full justify-between"},(0,o.createElement)("div",{className:"text-gray-800 text-2xl font-bold"},e.visitors_pretty," / ",e.visitors_limit_pretty,(0,o.createElement)("span",{className:"text-gray-600 text-base font-normal ml-2"},optimoleDashboardApp.strings.quota)),70>a&&(0,o.createElement)(u.Button,{variant:"default",className:"optml__button rounded font-bold min-h-40",href:optimoleDashboardApp.optimoleDashBilling,target:"_blank"},optimoleDashboardApp.strings.upgrade.title)),(0,o.createElement)("div",null,(0,o.createElement)(Le,{className:"mt-2.5 mb-3 mx-0",value:e.visitors,max:e.visitors_limit}),(0,o.createElement)("div",{className:"optml__tooltip",style:{left:a+"%",marginLeft:15>a?"-15px":"-20px",display:100<a?"none":"block"}},(0,o.createElement)("span",null,a,"%"))))),(0,o.createElement)("div",{className:"flex py-5 gap-5 flex-col md:flex-row"},Re.map((t=>(0,o.createElement)("div",{key:t.value,className:p()(ze,"basis-1/4 flex-col items-start")},(0,o.createElement)(u.Icon,{icon:t.icon}),(0,o.createElement)("div",{className:"flex w-full flex-col"},(0,o.createElement)("div",{className:"not-italic font-bold text-xl py-2 text-gray-800"},(t=>{const a=(t=>void 0!==e[t]?e[t]:"saved_size"===t?Math.floor(2500*Math.random())+500:Math.floor(40*Math.random())+10)(t);return"saved_size"===t?(a/1e3).toFixed(2)+"MB":"compression_percentage"===t?a.toFixed(2)+"%":"traffic"===t?a.toFixed(2)+"MB":a})(t.value)),(0,o.createElement)("div",{className:"not-italic font-normal text-sm text-gray-800"},t.label),(0,o.createElement)("div",{className:"font-normal text-xs text-gray-600"},t.description)))))),"yes"!==optimoleDashboardApp.remove_latest_images&&(0,o.createElement)(He,null))},qe=({conflict:e})=>{const[t,a]=(0,s.useState)(!1);return(0,o.createElement)("div",{className:p()("flex gap-2 text-white rounded relative px-6 py-5 mb-5",{"bg-danger":"high"===e.severity,"bg-info":"medium"===e.severity,"bg-success":"high"!==e.severity&&"medium"!==e.severity})},(0,o.createElement)("p",{className:"m-0 text-white",dangerouslySetInnerHTML:{__html:e.message}}),(0,o.createElement)(u.Button,{icon:t?g:"no-alt",label:optimoleDashboardApp.strings.conflicts.conflict_close,disabled:t,className:p()("text-white hover:text-white",{"animate-spin":t}),onClick:()=>{a(!0),((e,t=(()=>{}))=>{M(!0),C()({path:optimoleDashboardApp.routes.dismiss_conflict,method:"POST",data:{conflictID:e}}).then((e=>{M(!1),"success"===e.code&&P(e.data),t&&t(e)}))})(e.id,(()=>{a(!1)}))}}))},Ge=()=>{const{conflicts:e}=(0,c.useSelect)((e=>{const{getConflicts:t}=e("optimole");return{conflicts:t().conflicts||[]}}));return(0,o.createElement)("div",{className:"bg-white p-8 border-0 rounded-lg shadow-md"},Boolean(e.length)&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,optimoleDashboardApp.strings.conflicts.title),e.map((e=>(0,o.createElement)(qe,{key:e.id,conflict:e})))),!Boolean(e.length)&&(0,o.createElement)("div",{className:"text-center py-12"},(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.conflicts.no_conflicts_found}})))},$e=(0,o.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(m.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Ke=(0,o.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(m.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),{strings:Ue}=optimoleDashboardApp,Ye=[{label:Ue.general_settings_menu_item,value:"general"},{label:Ue.advanced_settings_menu_item,value:"compression",children:[{label:Ue.settings_compression_menu_item,value:"compression"},{label:Ue.settings_resize_menu_item,value:"resize"},{label:Ue.lazyload_settings_menu_item,value:"lazyload"},{label:Ue.settings_exclusions_menu_item,value:"exclusions"}]},{label:Ue.cloud_library,value:"cloud_library"},{label:Ue.image_storage,value:"offload_media"}],Qe=({children:e,tab:t,settings:a,setTab:s})=>(0,o.createElement)("ul",{className:"flex flex-col gap-1 m-0 mt-1"},e.map((e=>{const{value:l,label:n}=e;if("lazyload"===e.value&&"disabled"===a.lazyload)return;const r=p()({"bg-light-blue hover:text-purple-gray":t===l,"bg-transparent hover:text-info":t!==l},"w-full text-left border-0 font-normal text-base text-purple-gray cursor-pointer rounded px-4 py-2 m-0 hover:text-info");return(0,o.createElement)("li",{key:l},(0,o.createElement)("button",{className:r,onClick:()=>s(l)},n))}))),We=({tab:e,settings:t,setTab:a})=>(0,o.createElement)("div",{className:"basis-1/5"},(0,o.createElement)("ul",{className:"grid m-0 gap-1"},Ye.map((s=>{const l=e===s.value||s.children&&s.children.some((t=>t.value===e)),n=p()({"!text-info":l},"w-full bg-transparent border-0 flex items-center appearance-none not-italic font-semibold text-base text-purple-gray cursor-pointer hover:text-info py-2");return(0,o.createElement)("li",{key:s.value,className:"m-0"},(0,o.createElement)("button",{className:n,onClick:()=>a(s.value)},s.label,s.children&&(0,o.createElement)(u.Icon,{icon:l?$e:Ke,className:"inline-block ml-2 fill-current"})),s.children&&l&&(0,o.createElement)(Qe,{children:s.children,tab:e,settings:t,setTab:a}))})))),Je=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(m.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),Xe=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),et=(0,o.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(m.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"})),tt=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),at=(0,s.forwardRef)((function({icon:e,size:t=24,...a},o){return(0,s.cloneElement)(e,{width:t,height:t,...a,ref:o})})),ot=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function st({text:e,title:t,disableIcon:a=!1,type:s="info",className:l="",smallTitle:n=!1,children:r,onDismiss:i}){const c=p()({"bg-yellow-50 text-yellow-700":"warning"===s,"bg-green-50 text-green-700":"success"===s,"bg-red-50 text-red-700":"error"===s,"bg-blue-50 text-blue-700":"info"===s,"bg-info text-white":"primary"===s},`rounded-md my-5 text-sm p-4 om-notice om-notice-${s} relative`),d=p()({"fill-yellow-500":"warning"===s,"fill-green-500":"success"===s,"fill-red-500":"error"===s,"fill-blue-500":"info"===s,"fill-white":"primary"===s,"h-6 w-6":"primary"!==s,"h-12 w-12":"primary"===s}),m=p()({"ml-3 mt-0.5":!a&&!t,"mt-2 mx-1.5":t}),g=p()({"text-yellow-800":"warning"===s,"text-green-800":"success"===s,"text-red-800":"error"===s,"text-blue-800":"info"===s,"font-bold text-base":"primary"!==s,"text-white text-sm":"primary"===s,"text-s":n},"m-0"),u={warning:Je,success:Xe,error:et,info:tt,primary:v};return(0,o.createElement)("div",{className:c},i&&(0,o.createElement)("button",{className:"flex items-center justify-center absolute bg-transparent text-current right-1 top-1 border-0 rounded-full p-0 cursor-pointer hover:bg-white transition-all hover:text-info",onClick:i},(0,o.createElement)(at,{className:"fill-current",icon:ot})),(0,o.createElement)("div",{className:t?"grid":"flex"},(0,o.createElement)("div",{className:p()("flex-shrink-0 flex gap-2",{"items-center":t})},!a&&(0,o.createElement)(at,{icon:u[s]||null,className:d}),t&&(0,o.createElement)("div",{className:g,dangerouslySetInnerHTML:{__html:t}})),r||e&&(0,o.createElement)("div",{className:m},e&&(0,o.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:e}}),r)))}const lt=({settings:e,setSettings:t,setCanSave:a})=>{const{isLoading:s}=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}})),l="disabled"!==e.image_replacer,n="disabled"!==e.lazyload,r="disabled"!==e.report_script,i="disabled"!==e.cdn,d="disabled"!==e.banner_frontend,m=(o,s)=>{a(!0);const l={...e};l[o]=s?"enabled":"disabled",t(l)};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_image_replace,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.replacer_desc}}),checked:l,disabled:s,className:p()({"is-disabled":s}),onChange:e=>m("image_replacer",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.toggle_lazyload,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.lazyload_desc}}),checked:n,disabled:!l||s,className:p()({"is-disabled":!l||s}),onChange:e=>m("lazyload",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_report_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_report_desc}}),checked:r,disabled:s,className:p()({"is-disabled":s}),onChange:e=>m("report_script",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_badge_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_badge_description}}),checked:d,disabled:s,className:p()({"is-disabled":s}),onChange:e=>m("banner_frontend",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.BaseControl,{label:optimoleDashboardApp.strings.options_strings.cache_title,className:p()({"is-disabled":s||!l})},(0,o.createElement)("p",{className:"components-base-control__help m-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.cache_desc}}),(0,o.createElement)("div",{className:"flex my-4 gap-3"},(0,o.createElement)(u.Button,{variant:"default",isBusy:s,disabled:s||!l,className:"optml__button flex justify-center rounded font-bold min-h-40",onClick:()=>_e()},optimoleDashboardApp.strings.options_strings.clear_cache_images),i&&(0,o.createElement)(u.Button,{variant:"default",isBusy:s,disabled:s||!l,className:"optml__button flex justify-center rounded font-bold min-h-40",onClick:()=>_e("assets")},optimoleDashboardApp.strings.options_strings.clear_cache_assets))),(0,o.createElement)(st,{type:"warning",text:optimoleDashboardApp.strings.options_strings.clear_cache_notice,disableIcon:!0}))};var nt=a(864),rt=a.n(nt);const it=({settings:e,setSettings:t,setCanSave:a,showSample:s,isSampleLoading:l,setIsSampleLoading:n})=>{const{sampleImages:r,isLoading:i}=(0,c.useSelect)((e=>{const{getSampleRate:t,isLoading:a}=e("optimole");return{sampleImages:t(),isLoading:a()}})),d="disabled"!==e.network_optimization,m="disabled"!==e.cdn,h="disabled"!==e.img_to_video,b="disabled"!==e.avif,_="disabled"!==e.strip_metadata,f="disabled"!==e.autoquality,E="disabled"!==e.best_format,v=(o,s)=>{a(!0);const l={...e};l[o]=s?"enabled":"disabled",t(l)},y=()=>r.optimized_size>r.original_size?Math.floor(60*Math.random())+10:(100*parseFloat(r.optimized_size/r.original_size)).toFixed(0);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.best_format_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.best_format_desc}}),checked:E,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("best_format",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_network_opt_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_network_opt_desc}}),checked:d,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("network_optimization",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.toggle_cdn,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.cdn_desc}}),checked:m,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("cdn",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_gif_replace_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.gif_replacer_desc}}),checked:h,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("img_to_video",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_avif_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_avif_desc}}),checked:b,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("avif",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.strip_meta_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.strip_meta_desc}}),checked:_,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("strip_metadata",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.BaseControl,{help:!f&&optimoleDashboardApp.strings.options_strings.quality_desc},(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.quality_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.ml_quality_desc}}),checked:f,disabled:i,className:p()({"is-disabled":i}),onChange:e=>v("autoquality",e)})),!f&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.RangeControl,{value:(w=e.quality,"number"==typeof w?w:"auto"===w||"high_c"===w?90:"medium_c"===w?75:"low_c"===w?55:90),min:50,max:100,step:1,withInputField:!1,marks:[{value:55,label:optimoleDashboardApp.strings.options_strings.low_q_title},{value:75,label:optimoleDashboardApp.strings.options_strings.medium_q_title},{value:90,label:optimoleDashboardApp.strings.options_strings.high_q_title}],onChange:o=>{a(!0);const s={...e};s.quality=o,t(s)}}),s&&(0,o.createElement)("div",{className:"flex justify-center w-full text-center"},l?(0,o.createElement)("div",{className:"flex items-center gap-5"},(0,o.createElement)("p",{className:"text-base"},optimoleDashboardApp.strings.options_strings.sample_image_loading),(0,o.createElement)(u.Icon,{icon:g,className:"animate-spin"})):(0,o.createElement)(o.Fragment,null,r.id&&0<r.original_size&&(0,o.createElement)("div",null,0<y()?(0,o.createElement)("p",{className:"text-base"},100-y(),"% ",optimoleDashboardApp.strings.latest_images.smaller):(0,o.createElement)("p",{className:"text-base"},optimoleDashboardApp.strings.latest_images.same_size),(0,o.createElement)(Le,{max:100,value:100-y()}),(0,o.createElement)("hr",{className:"my-4 border-grayish-blue"}),(0,o.createElement)(rt(),{leftImageLabel:optimoleDashboardApp.strings.options_strings.image_1_label,rightImageLabel:optimoleDashboardApp.strings.options_strings.image_2_label,leftImage:r.original,rightImage:r.optimized}),(0,o.createElement)(u.Button,{variant:"default",icon:g,className:"mt-2",onClick:()=>{n(!0),fe({quality:e.quality,force:"yes"},(()=>n(!1)))}}),(0,o.createElement)("p",{className:"text-base"},optimoleDashboardApp.strings.options_strings.quality_slider_desc)),!(r.id&&0<r.original_size)&&0>r.id&&(0,o.createElement)("div",{className:"flex items-center gap-5 text-center"},(0,o.createElement)("p",{className:"text-base"},optimoleDashboardApp.strings.options_strings.no_images_found))))));var w},ct=({settings:e,setSettings:t,setCanSave:a})=>{const{isLoading:l}=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}})),[n,r]=(0,s.useState)(""),[i,d]=(0,s.useState)(""),m="disabled"!==e.resize_smart,g="disabled"!==e.retina_images,h="disabled"!==e.limit_dimensions,b=(o,s)=>{a(!0);const l={...e};l[o]=s?"enabled":"disabled",t(l)},_=(o,s)=>{a(!0);const l={...e};l[o]=s,t(l)},f=Object.keys(e.defined_image_sizes).filter((t=>"object"==typeof e.defined_image_sizes[t]));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_resize_smart_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_resize_smart_desc}}),checked:m,disabled:l,className:p()({"is-disabled":l}),onChange:e=>b("resize_smart",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),"disabled"!==e.lazyload&&(0,o.createElement)(o.Fragment,null," ",(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_retina_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_retina_desc}}),checked:g,disabled:l,className:p()({"is-disabled":l}),onChange:e=>b("retina_images",e)})," ",(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"})," "),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_limit_dimensions_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_limit_dimensions_desc}}),checked:h,disabled:l,className:p()({"is-disabled":l}),onChange:e=>b("limit_dimensions",e)}),h&&(0,o.createElement)(u.BaseControl,null,(0,o.createElement)("div",{className:"flex gap-8"},(0,o.createElement)(u.__experimentalNumberControl,{label:optimoleDashboardApp.strings.options_strings.width_field,labelPosition:"side",value:e.limit_width,type:"number",min:100,max:1e4,className:"basis-1/2 sm:basis-1/4",onChange:e=>_("limit_width",e)}),(0,o.createElement)(u.__experimentalNumberControl,{label:optimoleDashboardApp.strings.options_strings.height_field,labelPosition:"side",value:e.limit_height,type:"number",min:100,max:1e4,className:"basis-1/2 sm:basis-1/4",onChange:e=>_("limit_height",e)})),(0,o.createElement)(st,{disableIcon:!0,type:"warning",text:optimoleDashboardApp.strings.options_strings.enable_limit_dimensions_notice})),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.BaseControl,{label:optimoleDashboardApp.strings.options_strings.add_image_size_desc},(0,o.createElement)("p",{className:"components-base-control__help mt-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.image_size_notice}}),(0,o.createElement)("div",{className:"flex flex-col sm:flex-row p-6 bg-light-blue border border-blue-300 rounded-md items-stretch sm:items-center gap-8"},(0,o.createElement)(u.TextControl,{label:optimoleDashboardApp.strings.options_strings.width_field,placeholder:optimoleDashboardApp.strings.options_strings.width_field,hideLabelFromVision:!0,type:"number",min:1,value:n,onChange:r,className:"optml__input sm:basis-2/5"}),(0,o.createElement)(u.TextControl,{label:optimoleDashboardApp.strings.options_strings.height_field,placeholder:optimoleDashboardApp.strings.options_strings.height_field,value:i,onChange:d,hideLabelFromVision:!0,type:"number",min:1,className:"optml__input sm:basis-2/5"}),(0,o.createElement)(u.Button,{variant:"primary",isBusy:l,disabled:l,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:()=>{if(!n||!i||isNaN(n)||isNaN(i))return;const o="optimole_"+n+"_"+i+"_crop",s={...e.defined_image_sizes,[o]:{width:n,height:i}};a(!0);const l={...e};l.defined_image_sizes=s,t(l),r(""),d("")}},optimoleDashboardApp.strings.options_strings.add_image_size_button))),0<f.length&&(0,o.createElement)(u.BaseControl,{label:optimoleDashboardApp.strings.options_strings.image_sizes_title,className:"pt-4"},f.map((s=>(0,o.createElement)("div",{key:s,className:"flex p-3 my-3 bg-light-blue border border-blue-300 rounded-md items-center justify-between gap-8"},(0,o.createElement)("div",{className:"flex flex-wrap items-center gap-2"},(0,o.createElement)("div",null,(0,o.createElement)("p",{className:"m-0 inline-block",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.name}})," ",s),(0,o.createElement)("p",{className:"m-0"},(0,o.createElement)("b",null,optimoleDashboardApp.strings.options_strings.width_field),": ",e.defined_image_sizes[s].width),(0,o.createElement)("p",{className:"m-0"},(0,o.createElement)("b",null,optimoleDashboardApp.strings.options_strings.height_field),": ",e.defined_image_sizes[s].height)),(0,o.createElement)(u.Button,{variant:"default",icon:"trash",disabled:l,onClick:()=>(o=>{const s={...e.defined_image_sizes,[o]:"remove"};a(!0);const l={...e};l.defined_image_sizes=s,t(l)})(s)}))))))},dt=({settings:e,setSettings:t,setCanSave:a})=>{const{isLoading:l}=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}})),n="disabled"!==e.lazyload_placeholder,r="disabled"!==e.native_lazyload,i="disabled"===e.scale,d="disabled"!==e.bg_replacer,m="disabled"!==e.video_lazyload,g="disabled"!==e.no_script,h=e.placeholder_color,[b,_]=(0,s.useState)(!1),f=(o,s)=>{a(!0);const l={...e};l[o]=s?"enabled":"disabled",t(l)},E=(o,s)=>{a(!0);const l={...e};l[o]=s,t(l)},v=e=>{E("placeholder_color",e)};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.BaseControl,null,(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_lazyload_placeholder_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_lazyload_placeholder_desc}}),checked:n,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("lazyload_placeholder",e)}),n&&(0,o.createElement)("div",{className:"relative inline-block"},(0,o.createElement)(u.Button,{disabled:l,className:"gap-3 mt-2 py-3 h-auto rounded text-inherit border-gray-400 border-2 border-solid font-medium",onClick:()=>{_(!b)}},(0,o.createElement)(u.ColorIndicator,{colorValue:h}),(0,o.createElement)("span",null,optimoleDashboardApp.strings.options_strings.lazyload_placeholder_color)),b&&(0,o.createElement)(u.Popover,{placement:"bottom",position:"middle center",variant:"unstyled",className:"shadow-md border-grayish-blue border border-solid rounded bg-white p-2",onFocusOutside:()=>_(!1)},(0,o.createElement)(u.ColorPicker,{color:h,onChange:v,enableAlpha:!0,defaultValue:""}),(0,o.createElement)(u.Button,{isDestructive:!0,className:"w-full text-center flex justify-center",variant:"secondary",onClick:()=>{v("")}},optimoleDashboardApp.strings.options_strings.clear)))),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.BaseControl,{label:optimoleDashboardApp.strings.options_strings.exclude_first_images_title},(0,o.createElement)("p",{className:"components-base-control__help mt-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.exclude_first_images_desc}}),(0,o.createElement)("div",{className:"flex gap-8"},(0,o.createElement)(u.__experimentalNumberControl,{label:optimoleDashboardApp.strings.options_strings.exclude_first,labelPosition:"side",value:e.skip_lazyload_images,type:"number",min:0,className:"basis-1/2 md:basis-1/3",onChange:e=>E("skip_lazyload_images",e)}))),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.toggle_native,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.native_desc}}),checked:r,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("native_lazyload",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.toggle_scale,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.scale_desc}}),checked:i,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("scale",!e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_video_lazyload_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_video_lazyload_desc}}),checked:m,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("video_lazyload",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_noscript_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_noscript_desc}}),checked:g,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("no_script",e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.ToggleControl,{label:optimoleDashboardApp.strings.options_strings.enable_bg_lazyload_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.enable_bg_lazyload_desc}}),checked:d,disabled:l,className:p()({"is-disabled":l}),onChange:e=>f("bg_replacer",e)}),d&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(u.BaseControl,{label:optimoleDashboardApp.strings.options_strings.watch_title_lazyload,id:"optml-css-watchers"},(0,o.createElement)("p",{className:"components-base-control__help mt-0",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.options_strings.watch_desc_lazyload}}),(0,o.createElement)(u.TextareaControl,{id:"optml-css-watchers",placeholder:optimoleDashboardApp.strings.options_strings.watch_placeholder_lazyload,value:e.watchers,onChange:e=>E("watchers",e)}))))},pt="extension",mt="page_url",gt="page_url_match",ut="filename",ht="class",bt=[{label:optimoleDashboardApp.strings.options_strings.filter_filename,value:ut},{label:optimoleDashboardApp.strings.options_strings.filter_ext,value:pt},{label:optimoleDashboardApp.strings.options_strings.filter_url,value:mt},{label:optimoleDashboardApp.strings.options_strings.filter_class,value:ht}],_t=[{label:optimoleDashboardApp.strings.options_strings.exclude_filename_desc,value:ut},{label:optimoleDashboardApp.strings.options_strings.exclude_ext_desc,value:pt},{label:optimoleDashboardApp.strings.options_strings.exclude_url_desc,value:mt},{label:optimoleDashboardApp.strings.options_strings.exclude_url_match_desc,value:gt},{label:optimoleDashboardApp.strings.options_strings.exclude_class_desc,value:ht}],ft=[{label:".SVG",value:"svg"},{label:".JPG",value:"jpg"},{label:".PNG",value:"png"},{label:".GIF",value:"gif"},{label:".WEBP",value:"webp"}],Et=({label:e,help:t,type:a,settings:l,setSettings:n,setCanSave:r})=>{const{isLoading:i}=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}})),[d,p]=(0,s.useState)(ut),[m,g]=(0,s.useState)(optimoleDashboardApp.strings.options_strings.filter_operator_contains),[h,b]=(0,s.useState)(""),[_,f]=(0,s.useState)(optimoleDashboardApp.strings.options_strings.filter_operator_contains),[E,v]=(0,s.useState)(!1),y=0<Object.keys(l.filters[a][pt]).length&&Object.values(l.filters[a][pt]).some((e=>!1!==e))||0<Object.keys(l.filters[a][ht]).length&&Object.values(l.filters[a][ht]).some((e=>!1!==e))||0<Object.keys(l.filters[a][mt]).length&&Object.values(l.filters[a][mt]).some((e=>!1!==e))||0<Object.keys(l.filters[a][gt]).length&&Object.values(l.filters[a][gt]).some((e=>!1!==e))||0<Object.keys(l.filters[a][ut]).length&&Object.values(l.filters[a][ut]).some((e=>!1!==e));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.BaseControl,{label:e,help:d===mt&&optimoleDashboardApp.strings.options_strings.filter_helper},(0,o.createElement)("p",{className:"components-base-control__help mt-0",dangerouslySetInnerHTML:{__html:t}}),(0,o.createElement)("div",{className:"flex flex-col md:flex-row p-6 my-3 bg-light-blue border border-blue-300 rounded-md items-center justify-between gap-8"},(0,o.createElement)("div",{className:"flex justify-start items-center gap-4"},(0,o.createElement)(u.SelectControl,{value:d,options:bt,onChange:e=>{let t="";e===pt&&(t="svg",g(optimoleDashboardApp.strings.options_strings.filter_operator_is)),e===ut&&g(optimoleDashboardApp.strings.options_strings.filter_operator_contains),e===ht&&g(optimoleDashboardApp.strings.options_strings.filter_operator_contains),v(!1),b(t),p(e)},className:"optml__select",__nextHasNoMarginBottom:!0}),d===mt?(0,o.createElement)(u.SelectControl,{value:_,options:[{label:optimoleDashboardApp.strings.options_strings.filter_operator_contains,value:optimoleDashboardApp.strings.options_strings.filter_operator_contains},{label:optimoleDashboardApp.strings.options_strings.filter_operator_matches,value:optimoleDashboardApp.strings.options_strings.filter_operator_matches}],onChange:f,className:"optml__select",__nextHasNoMarginBottom:!0}):(0,o.createElement)("p",{className:"m-0"},m),d===pt?(0,o.createElement)(u.SelectControl,{value:h,options:ft,onChange:b,className:"optml__select",__nextHasNoMarginBottom:!0}):(0,o.createElement)(u.TextControl,{value:h,placeholder:"matches"===_?"path":"word",onChange:e=>{b(e),v(!1)},className:"optml__input"})),(0,o.createElement)(u.Button,{variant:"primary",isBusy:i,disabled:i,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:()=>{if(3>h.length)return void v(!0);const e={...l.filters};let t=d;d===mt&&"matches"===_&&(t=gt),e[a]&&"object"==typeof e[a]||(e[a]={}),e[a][t]&&!Array.isArray(e[a][t])||(e[a][t]={}),e[a][t][h]=!0,n({...l,filters:e}),d!==pt&&b(""),r(!0)}},optimoleDashboardApp.strings.options_strings.add_filter)),E&&(0,o.createElement)("p",{className:"text-red-500 bg-red-100 p-2 rounded-md border border-solid border-red-200"},optimoleDashboardApp.strings.options_strings.filter_length_error)),y&&(0,o.createElement)(u.BaseControl,{label:"optimize"===a?optimoleDashboardApp.strings.options_strings.active_optimize_exclusions:optimoleDashboardApp.strings.options_strings.active_lazyload_exclusions,className:"py-4"},_t.map((e=>Object.keys(l.filters[a][e.value]).filter((t=>!1!==l.filters[a][e.value][t])).map((t=>(0,o.createElement)("div",{key:t,className:"flex p-3 my-3 bg-light-blue border border-blue-300 rounded-md items-center justify-between gap-8"},(0,o.createElement)("div",{className:"flex items-center gap-1"},(0,o.createElement)("p",{className:"m-0 inline-block",dangerouslySetInnerHTML:{__html:e.label}}),(0,o.createElement)("b",null,t)),(0,o.createElement)(u.Button,{variant:"default",icon:"trash",disabled:i,onClick:()=>((e,t)=>{const o={...l.filters};o[a][e][t]=!1,n({...l,filters:o}),r(!0)})(e.value,t)}))))))))},vt=({settings:e,setSettings:t,setCanSave:a})=>{const s="disabled"!==e.lazyload;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Et,{label:optimoleDashboardApp.strings.options_strings.exclude_title_optimize,help:optimoleDashboardApp.strings.options_strings.exclude_desc_optimize,type:"optimize",settings:e,setSettings:t,setCanSave:a}),s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)(Et,{label:optimoleDashboardApp.strings.options_strings.exclude_title_lazyload,help:optimoleDashboardApp.strings.options_strings.exclude_desc_lazyload,type:"lazyload",settings:e,setSettings:t,setCanSave:a})))};function yt({options:e,value:t,onChange:a,label:s,disabled:l=!1,className:n}){return p()({"opacity-50":l},"transition-all my-6 gap-6 grid opacity-100"),(0,o.createElement)("fieldset",{className:`my-6 gap-6 grid ${n}`,onChange:e=>{a(e.target.value)}},s&&(0,o.createElement)("legend",{className:"uppercase font-semibold text-s text-light-black mb-6"},s),e.map(((e,a)=>{const{title:s,value:n,description:r}=e,i=t===n,c=p()({"outline-info":i,"outline-transparent":!i},"flex gap-6 items-start bg-gray-50 rounded-md p-4 outline -outline-offset-3 outline-3 transition-all");return(0,o.createElement)("label",{htmlFor:n,key:n,className:c},(0,o.createElement)(wt,{isActive:i}),(0,o.createElement)("div",{className:"grid space-y-2"},s&&(0,o.createElement)("div",{className:"text-base font-medium text-gray-700"},s),r&&(0,o.createElement)("div",{className:"text-sm text-gray-500"},r)),(0,o.createElement)("input",{type:"radio",name:"label",value:n,id:n,className:"!opacity-0 !w-0 !h-0 !overflow-hidden !absolute !pointer-events-none",disabled:l}))})))}const wt=({isActive:e})=>{const t=p()({"bg-white outline-info":e,"bg-gray-200 outline-transparent":!e},"w-[24px] h-[24px] rounded-full flex items-center justify-center flex-shrink-0 outline outline-3 -outline-offset-3 transition-all"),a=p()({"bg-info":e},"w-[12px] h-[12px] rounded-full background-info transition-all");return(0,o.createElement)("div",{className:t},e&&(0,o.createElement)("div",{className:a}))};function xt({title:e,progress:t,description:a,onCancel:s,hideCancel:l=!1}){const{strings:n}=optimoleDashboardApp;return(0,o.createElement)("div",{className:"bg-gray-50 rounded-md p-4 space-y-4"},(0,o.createElement)("div",{className:"flex gap-3 items-center"},(0,o.createElement)(at,{icon:E,className:"text-info animate-spin -scale-y-100"}),e&&(0,o.createElement)("p",{className:"uppercase text-s font-semibold text-light-black m-0"},e),!l&&(0,o.createElement)("button",{onClick:s,className:"appearance-none border border-info text-info bg-transparent rounded px-4 py-2 ml-auto text-s hover:border-red-500 hover:bg-red-500 hover:text-white cursor-pointer"},n.cancel)),(0,o.createElement)(Le,{value:t}),a&&(0,o.createElement)("p",{className:"text-xs text-gray-500"},a))}const kt=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Ct=window.wp.compose;function St({icon:e,labels:t={},onRequestClose:a=(()=>{}),onConfirm:s=(()=>{}),variant:l="default"}){const n=(0,Ct.useViewportMatch)("small","<"),r=p()({"bg-stale-yellow":"warning"===l,"bg-light-blue":"default"===l},"p-3 rounded-full"),i=p()({"bg-mango-yellow":"warning"===l},"optml__button flex justify-center px-5 py-3 rounded font-bold min-h-40 basis-1/5");return(0,o.createElement)(u.Modal,{__experimentalHideHeader:!0,className:"max-w-xl antialiased",onRequestClose:a,isFullScreen:n},(0,o.createElement)(u.Button,{icon:kt,onClick:a,label:optimoleDashboardApp.strings.csat.close,className:"fixed right-3 top-3 cursor-pointer"}),(0,o.createElement)("div",{className:"flex flex-col items-center"},(0,o.createElement)(u.Icon,{icon:e,size:24,className:r}),(0,o.createElement)("h2",{className:"mb-0",dangerouslySetInnerHTML:{__html:t.title}}),(0,o.createElement)("p",{className:"text-center mx-0 my-4 text-gray-700",dangerouslySetInnerHTML:{__html:t.description}}),(0,o.createElement)(u.Button,{variant:"primary",className:i,onClick:s},t.action)))}const At=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})),Dt=({type:e})=>{const{logs:t}=(0,c.useSelect)((e=>{const{getLogs:t}=e("optimole");return{logs:t()}})),[a,l]=(0,s.useState)(!1),n=(0,s.useRef)(null);return(0,s.useEffect)((()=>{const a=setInterval((()=>{n.current&&(n.current.innerHTML=t[e],n.current.scrollTop=n.current.scrollHeight)}),15e3);return()=>clearInterval(a)}),[]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"w-full flex justify-end text-info my-2"},(0,o.createElement)(u.Button,{variant:"tertiary",className:"py-2 px-0",target:"_blank",href:`${window.ajaxurl}?action=optml_fetch_logs&nonce=${optimoleDashboardApp.nonce}&type=${e}`},optimoleDashboardApp.strings.options_strings.view_logs),(0,o.createElement)(u.Icon,{icon:At,className:"fill-info py-2"}),(0,o.createElement)(u.Button,{variant:"tertiary",className:"py-2 px-0",onClick:()=>l(!a)},a?optimoleDashboardApp.strings.options_strings.hide_logs:optimoleDashboardApp.strings.options_strings.show_logs)),a&&(0,o.createElement)("div",{className:"flex flex-col p-6 bg-light-blue border border-blue-300 rounded-md min-h-[200px] max-h-[200px] overflow-y-scroll",ref:n,dangerouslySetInnerHTML:{__html:t[e]}}))},Lt=({settings:e,canSave:t,setSettings:a,setCanSave:l})=>{const{strings:n,cron_disabled:r}=optimoleDashboardApp,{conflicts:i,options_strings:d}=n,m="offload",g="rollback",u="stopOffload",h="stopRollback",{offloadConflicts:b,errorMedia:_,offloadLibraryLink:f,isLoading:v,loadingSync:k,loadingRollback:C,rollbackLibraryLink:S,queryArgs:A,totalNumberOfImages:D,processedImages:L,offloadFinishNotice:N,offloadLimitReached:T,offloadLimit:M}=(0,c.useSelect)((e=>{const{getOffloadConflicts:t,getErrorMedia:a,getLoadingSync:o,getLoadingRollback:s,getOffloadLibraryLink:l,getRollbackLibraryLink:n,getTotalNumberOfImages:r,getProcessedImages:i,getQueryArgs:c,isLoading:d,getSiteSettings:p,getOffloadLimit:m}=e("optimole");return{offloadConflicts:t(),errorMedia:a(),offloadLibraryLink:l(),isLoading:d(),loadingSync:o(),loadingRollback:s(),rollbackLibraryLink:n(),queryArgs:c(),totalNumberOfImages:r(),processedImages:i(),offloadFinishNotice:p("show_offload_finish_notice"),offloadLimitReached:"enabled"===p("offload_limit_reached"),offloadLimit:m()}}),[]),{setErrorMedia:I,setCheckedOffloadConflicts:O,setOffloadConflicts:j,setProcessedImages:F,setOffloadLimitReached:B}=(0,c.useDispatch)("optimole"),[H,z]=(0,s.useState)(null),R="disabled"!==e.offloading_status,P="disabled"!==e.rollback_status;(0,s.useEffect)((()=>{A?.optimole_action&&A?.images&&("offload_images"===A.optimole_action&&V(A.images),"rollback_images"===A.optimole_action&&Z(A.images))}),[]),(0,s.useEffect)((()=>{R&&ve({action:"offload_images",refresh:!0}),P&&ve({action:"rollback_images",refresh:!0})}),[]);const V=(t=[])=>{const o={...e};o.show_offload_finish_notice="",o.offloading_status="enabled",a(o),be(o,!1,!0,(()=>{I(!1),F(0),B(!1),ve({action:"offload_images",images:t}),l(!1)}))},Z=(t=[])=>{O(!1),j([]),Ee((a=>{if(0===a.data.length){const a={...e};a.show_offload_finish_notice="",a.rollback_status="enabled",be(a,!1,!0,(()=>{I(!1),F(0),ve({action:"rollback_images",images:t}),l(!1)}))}}))},q=[{title:d.offload_radio_option_rollback_title,description:d.offload_radio_option_rollback_desc,value:"rollback"},{title:d.offload_radio_option_offload_title,description:d.offload_radio_option_offload_desc,value:"offload"}],G="enabled"===e.offload_media?"offload":"rollback",$=k||C;return(0,o.createElement)("div",null,(0,o.createElement)("h1",{className:"text-xl font-bold"},d.enable_offload_media_title),(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:d.enable_offload_media_desc}}),N&&(0,o.createElement)(st,{title:"offload"===N?d.offloading_success:d.rollback_success,type:"primary",onDismiss:()=>{be({show_offload_finish_notice:""},!1,!0)}}),r&&(0,o.createElement)(st,{type:"error",text:n.cron_error}),!$&&(0,o.createElement)(yt,{className:p()({"opacity-50 pointer-events-none":v||r}),label:d.offloading_radio_legend,options:q,value:G,onChange:t=>{const o="offload"===t,s={...e};s.offload_media=o?"enabled":"disabled",a(s),l(!0),z(o?m:g)}}),$&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(xt,{title:k?d.sync_media_progress:d.rollback_media_progress,progress:Math.round(L/D*100),onCancel:()=>{k&&z(u),C&&z(h)},description:0===D?d.calculating_estimated_time:d.images_processing}),(0,o.createElement)(Dt,{type:k?"offload":"rollback"})),"offload_images"===_&&(0,o.createElement)(st,{type:"error",smallTitle:!0,title:d.sync_media_error,text:d.sync_media_error_desc}),"rollback_images"===_&&(0,o.createElement)(st,{type:"error",smallTitle:!0,title:d.rollback_media_error,text:d.rollback_media_error_desc}),0<b.length&&(0,o.createElement)(st,{type:"warning",title:d.offload_conflicts_part_1},(0,o.createElement)("div",{className:"list-disc grid gap-3 mt-2"},(0,o.createElement)("ul",{className:"grid gap-1"},b.map((e=>(0,o.createElement)("li",{key:e,className:"font-semibold text-base m-0"},e)))),(0,o.createElement)("p",{className:"m-0 text-sm"},d.offload_conflicts_part_2),(0,o.createElement)("button",{disabled:v,className:p()({"opacity-50 pointer-events-none":v},"justify-self-start font-semibold flex items-center appearance-none border border-info text-info bg-white rounded px-4 py-2 text-sm hover:text-white hover:bg-info cursor-pointer"),onClick:()=>j([])},i.conflict_close))),!$&&(0,o.createElement)("button",{onClick:e=>{e.preventDefault(),"offload"===G&&z(m),"rollback"===G&&z(g)},disabled:v||r,className:p()({"opacity-50 pointer-events-none":v||r},"font-semibold flex items-center gap-2 appearance-none border border-info text-info bg-transparent rounded px-4 py-2 ml-auto text-sm hover:text-white hover:bg-info cursor-pointer")},(0,o.createElement)(at,{icon:E,className:"w-4 h-4"}),(0,o.createElement)("span",null,d.sync_media)),!$&&T&&(0,o.createElement)(st,{type:"warning",text:d.offload_limit_reached.replace("#offload_limit#",M)}),H&&(0,o.createElement)(St,{...(K=H,{onRequestClose:()=>z(null),...{[m]:{icon:y,onConfirm:()=>{V(),z(null)},labels:{title:d.offloading_start_title,description:d.offloading_start_description,action:d.offloading_start_action}},[g]:{icon:w,onConfirm:()=>{Z(),z(null)},labels:{title:d.rollback_start_title,description:d.rollback_start_description,action:d.rollback_start_action}},[u]:{variant:"warning",icon:x,onConfirm:()=>{z(null);const t=e;t.offloading_status="disabled",be(t)},labels:{title:d.offloading_stop_title,description:d.offloading_stop_description,action:d.offloading_stop_action}},[h]:{variant:"warning",icon:x,onConfirm:()=>{z(null);const t=e;t.rollback_status="disabled",be(t)},labels:{title:d.rollback_stop_title,description:d.rollback_stop_description,action:d.rollback_stop_action}}}[K]})}),f&&(0,o.createElement)("p",{className:"m-0"},d.sync_media_link," ",(0,o.createElement)("a",{href:A.url},d.here)),S&&(0,o.createElement)("p",{className:"m-0"},d.rollback_media_link," ",(0,o.createElement)("a",{href:A.url},optimoleDashboardApp.strings.options_strings.here)));var K};function Nt(e){const{user_data:t,strings:a}=optimoleDashboardApp,{options_strings:s}=a,{settings:l,setSettings:n,setCanSave:r}=e,i=(0,c.useSelect)((e=>{const{isLoading:t}=e("optimole");return{isLoading:t()}}),[]),{isLoading:d}=i,m="disabled"!==l.cloud_images,g=t.whitelist||[];return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.ToggleControl,{label:s.enable_cloud_images_title,help:()=>(0,o.createElement)("p",{dangerouslySetInnerHTML:{__html:s.enable_cloud_images_desc}}),checked:m,disabled:d,className:p()({"is-disabled":d}),onChange:e=>((e,t)=>{r(!0);const a={...l};a.cloud_images=t?"enabled":"disabled",n(a)})(0,e)}),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),m&&(0,o.createElement)(u.BaseControl,{label:s.cloud_site_title,help:s.cloud_site_desc},(0,o.createElement)("div",{className:"optml__token__base flex p-6 bg-light-blue border border-blue-300 rounded-md items-center gap-8"},(0,o.createElement)(u.FormTokenField,{value:Object.keys(l.cloud_sites).filter((e=>"all"!==e&&"false"!==l.cloud_sites[e])).map((e=>e))||[],suggestions:g,onChange:e=>{r(!0);const t={},a={...l};0===e.length?t.all="true":e.forEach((e=>{t[e]="true"})),Object.keys(a.cloud_sites).forEach((e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]="false")})),a.cloud_sites=t,n(a)},__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:e=>g.includes(e),className:"optml__token"}))))}const Tt=({tab:e,setTab:t,canSave:a,setCanSave:l,settings:n,setSettings:r})=>{const{siteSettings:i,isLoading:d,damEnabled:p}=(0,c.useSelect)((e=>{const{getSiteSettings:t,getQueryArgs:a,isLoading:o}=e("optimole"),s=t();return{siteSettings:s,damEnabled:s.cloud_images,isLoading:o(),queryArgs:a()}}),[]),[m,g]=(0,s.useState)(!1),[h,b]=(0,s.useState)(!1);(0,s.useEffect)((()=>{((e=!0)=>{const{dam_url:t,strings:a}=window.optimoleDashboardApp,{cloud_library:o}=a,s=document.querySelector('a[href*="page=optimole-dam"]');if(!e&&!s)return;if(!e){if(!s)return;return void(s.style.display="none")}if(s)return void(s.style={});const l=document.createElement("li"),n=document.createElement("a");l.appendChild(n),n.href=t,n.innerHTML=o;const r=document.querySelector("#toplevel_page_optimole ul");r&&r.insertBefore(l,r.firstChild)})("enabled"===p)}),[p]),(0,s.useEffect)((()=>{const e=localStorage.getItem("optimole_settings_visits");3<e||localStorage.setItem("optimole_settings_visits",e?parseInt(e)+1:1)}),[e]);const _=()=>{be(n,i.banner_frontend!==n.banner_frontend),l(!1)};return(0,o.createElement)("div",{className:"optml-settings flex flex-col sm:flex-row bg-white p-8 border-0 rounded-lg shadow-md gap-8"},(0,o.createElement)(We,{tab:e,setTab:t,settings:n}),(0,o.createElement)("div",{className:"basis-4/5"},"general"===e&&(0,o.createElement)(lt,{settings:n,setSettings:r,setCanSave:l}),"compression"===e&&(0,o.createElement)(it,{settings:n,setSettings:r,setCanSave:l,showSample:m,isSampleLoading:h,setIsSampleLoading:b}),"resize"===e&&(0,o.createElement)(ct,{settings:n,setSettings:r,setCanSave:l}),"lazyload"===e&&(0,o.createElement)(dt,{settings:n,setSettings:r,setCanSave:l}),"exclusions"===e&&(0,o.createElement)(vt,{settings:n,setSettings:r,setCanSave:l}),"cloud_library"===e&&(0,o.createElement)(Nt,{settings:n,canSave:a,setSettings:r,setCanSave:l,onSaveSettings:_}),"offload_media"===e&&(0,o.createElement)(Lt,{settings:n,canSave:a,setSettings:r,setCanSave:l,onSaveSettings:_}),(0,o.createElement)("div",{className:"flex justify-start items-center gap-5 mt-8"},(0,o.createElement)(u.Button,{variant:"primary",isBusy:d,disabled:!a,className:"optml__button flex w-full justify-center rounded font-bold min-h-40 basis-1/5",onClick:_},optimoleDashboardApp.strings.options_strings.save_changes),"disabled"===n.autoquality&&"compression"===e&&(0,o.createElement)(u.Button,{variant:"default",disabled:d,onClick:()=>{m||(b(!0),fe({quality:n.quality},(()=>b(!1)))),g(!m)}},optimoleDashboardApp.strings.options_strings.view_sample_image))))},Mt=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{fillRule:"evenodd",d:"M17.375 15.656A6.47 6.47 0 0018.5 12a6.47 6.47 0 00-.943-3.374l-1.262.813c.448.749.705 1.625.705 2.561a4.977 4.977 0 01-.887 2.844l1.262.813zm-1.951 1.87l-.813-1.261A4.976 4.976 0 0112 17c-.958 0-1.852-.27-2.613-.736l-.812 1.261A6.47 6.47 0 0012 18.5a6.47 6.47 0 003.424-.974zm-8.8-1.87A6.47 6.47 0 015.5 12c0-1.235.344-2.39.943-3.373l1.261.812A4.977 4.977 0 007 12c0 1.056.328 2.036.887 2.843l-1.262.813zm2.581-7.803A4.977 4.977 0 0112 7c1.035 0 1.996.314 2.794.853l.812-1.262A6.47 6.47 0 0012 5.5a6.47 6.47 0 00-3.607 1.092l.812 1.261zM12 20a8 8 0 100-16 8 8 0 000 16zm0-4.5a3.5 3.5 0 100-7 3.5 3.5 0 000 7z",clipRule:"evenodd"})),It=(0,o.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(m.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),Ot=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(m.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),jt=[{title:optimoleDashboardApp.strings.help.get_support_title,description:optimoleDashboardApp.strings.help.get_support_desc,cta:optimoleDashboardApp.strings.help.get_support_cta,link:"https://wordpress.org/support/plugin/optimole-wp/",icon:Mt},{title:optimoleDashboardApp.strings.help.feat_request_title,description:optimoleDashboardApp.strings.help.feat_request_desc,cta:optimoleDashboardApp.strings.help.feat_request_cta,link:"https://github.com/Codeinwp/optimole-wp/discussions",icon:It},{title:optimoleDashboardApp.strings.help.feedback_title,description:optimoleDashboardApp.strings.help.feedback_desc,cta:optimoleDashboardApp.strings.help.feedback_cta,link:"https://wordpress.org/plugins/optimole-wp/#developers",icon:Ot}],Ft=[{title:optimoleDashboardApp.strings.help.account_title,items:[{label:optimoleDashboardApp.strings.help.account_item_one,value:"https://docs.optimole.com/article/1134-how-optimole-counts-the-number-of-visitors"},{label:optimoleDashboardApp.strings.help.account_item_two,value:"https://docs.optimole.com/article/1008-what-happens-if-i-exceed-plan-limits"},{label:optimoleDashboardApp.strings.help.account_item_three,value:"https://docs.optimole.com/article/1133-visitors-based-plan"}]},{title:optimoleDashboardApp.strings.help.image_processing_title,items:[{label:optimoleDashboardApp.strings.help.image_processing_item_one,value:"https://docs.optimole.com/article/1173-how-to-get-started-with-optimole-in-just-3-steps"},{label:optimoleDashboardApp.strings.help.image_processing_item_two,value:"https://docs.optimole.com/article/1068-how-optimole-can-serve-webp-images"},{label:optimoleDashboardApp.strings.help.image_processing_item_three,value:"https://docs.optimole.com/article/1475-adding-watermarks-to-your-images"}]},{title:optimoleDashboardApp.strings.help.api_title,items:[{label:optimoleDashboardApp.strings.help.api_item_one,value:"https://docs.optimole.com/article/1323-cloud-library-browsing"},{label:optimoleDashboardApp.strings.help.api_item_two,value:"https://docs.optimole.com/article/1191-exclude-from-optimizing-or-lazy-loading"},{label:optimoleDashboardApp.strings.help.api_item_three,value:"https://docs.optimole.com/article/1307-custom-integration"}]}],Bt="flex p-6 border-2 border-solid border-grayish-blue rounded-md items-start gap-8 basis-1/3",Ht=()=>(0,o.createElement)("div",{className:"bg-white p-8 border-0 rounded-lg shadow-md"},(0,o.createElement)("p",{className:"font-bold text-base"},optimoleDashboardApp.strings.help.section_one_title),(0,o.createElement)("div",{className:"flex gap-5 flex-col md:flex-row"},jt.map(((e,t)=>(0,o.createElement)("div",{key:t,className:Bt},(0,o.createElement)("div",{className:"flex w-full flex-col gap-2"},(0,o.createElement)(u.Icon,{icon:e.icon,className:"fill-info",size:42}),(0,o.createElement)("div",{className:"font-bold text-base py-2 text-gray-800"},e.title),(0,o.createElement)("div",{className:"not-italic font-normal text-s text-gray-800"},e.description),(0,o.createElement)(u.ExternalLink,{href:e.link},e.cta)))))),(0,o.createElement)("hr",{className:"my-8 border-grayish-blue"}),(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)("p",{className:"font-bold text-base"},optimoleDashboardApp.strings.help.section_two_title),(0,o.createElement)(u.ExternalLink,{href:"https://docs.optimole.com/"},optimoleDashboardApp.strings.help.section_two_sub)),(0,o.createElement)("div",{className:"flex gap-5 flex-col md:flex-row"},Ft.map(((e,t)=>(0,o.createElement)("div",{key:t,className:Bt},(0,o.createElement)("div",{className:"flex w-full flex-col gap-2"},(0,o.createElement)("div",{className:"font-bold text-base py-2 text-gray-800"},e.title),e.items.map(((e,t)=>(0,o.createElement)("a",{key:t,href:e.value,target:"_blank"},e.label))))))))),zt=[optimoleDashboardApp.strings.upgrade.reason_1,optimoleDashboardApp.strings.upgrade.reason_2,optimoleDashboardApp.strings.upgrade.reason_3,optimoleDashboardApp.strings.upgrade.reason_4],Rt=()=>{const{name:e,domain:t,plan:a}=(0,c.useSelect)((e=>{const{getUserData:t}=e("optimole"),a=t();let o=a?.cdn_key+".i.optimole.com";return void 0!==a?.domain&&""!==a?.domain&&(o=a?.domain),{name:a?.display_name,domain:o,plan:a?.plan}}));return(0,o.createElement)("div",{className:"grid md:grid-cols-2 xl:flex xl:flex-col xl:mt-8 xl:mb-5 p-0 transition-all ease-in-out duration-700 gap-5 basis-4/12 2xl:basis-3/12"},(0,o.createElement)("div",{className:"bg-white gap-5 flex flex-col text-gray-700 border-0 rounded-lg shadow-md p-8"},(0,o.createElement)(u.TextControl,{label:optimoleDashboardApp.strings.logged_in_as,value:e,className:"optml__placeholder",disabled:!0}),(0,o.createElement)(u.TextControl,{label:optimoleDashboardApp.strings.private_cdn_url,value:t,className:"optml__placeholder",disabled:!0}),(0,o.createElement)("hr",{className:"m-0 border-grayish-blue"}),(0,o.createElement)("p",{className:"font-semibold text-xs text-light-black m-0"},optimoleDashboardApp.strings.looking_for_api_key),(0,o.createElement)("p",{className:"m-0 -mt-3",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.optml_dashboard}})),"free"===a?(0,o.createElement)("div",{className:"bg-info flex flex-col text-white border-0 rounded-lg overflow-hidden shadow-md bg-promo bg-no-repeat",style:{backgroundImage:`url( ${optimoleDashboardApp.assets_url}/img/logo2.png )`}},optimoleDashboardApp?.bf_notices?.sidebar&&(0,o.createElement)("a",{href:optimoleDashboardApp.bf_notices.sidebar.cta_link,className:"flex flex-col gap-3 p-3 bg-black !no-underline text-center cursor-pointer hover:opacity-90 transition-opacity",target:"_blank"},(0,o.createElement)("span",{className:"font-extrabold text-[17px] uppercase italic",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.bf_notices.sidebar.title}}),(0,o.createElement)("span",{className:"text-[11px] font-bold",dangerouslySetInnerHTML:{__html:optimoleDashboardApp.bf_notices.sidebar.subtitle}})),(0,o.createElement)("div",{className:"p-8 flex flex-col"},(0,o.createElement)("h3",{className:"mt-0 text-white text-lg"},optimoleDashboardApp.strings.upgrade.title_long),(0,o.createElement)("ul",null,zt.map(((e,t)=>(0,o.createElement)("li",{key:t,className:"flex items-center gap-2"},(0,o.createElement)(u.Icon,{icon:"yes-alt",className:"text-white"}),(0,o.createElement)("span",{className:"text-white font-normal text-base"},e))))),(0,o.createElement)(u.Button,{variant:"link",className:"optml__button flex w-full justify-center font-bold min-h-40 !no-underline !text-white !bg-opaque-black !rounded",href:optimoleDashboardApp.optimoleHome+"pricing",target:"_blank"},optimoleDashboardApp.strings.upgrade.cta))):(0,o.createElement)(u.Button,{variant:"default",className:"bg-white flex font-bold border-0 rounded-lg shadow-md p-8 text-sm justify-center",href:(0,S.addQueryArgs)(optimoleDashboardApp.optimoleHome+"contact/",{contact_name:window.optimoleDashboardApp.user_data.display_name,contact_email:optimoleDashboardApp.user_data.user_email,contact_website:optimoleDashboardApp.home_url}),target:"_blank"},optimoleDashboardApp.strings.premium_support))},Pt=({strings:e,onClose:t})=>(0,o.createElement)("div",{className:"flex justify-between px-8 pt-8"},(0,o.createElement)("p",{className:"text-purple-gray text-sm m-0 py-2"},e.title),(0,o.createElement)(u.Button,{label:e.close,icon:ot,onClick:t,className:"text-gray-950"}));window.optimoleCSAT={hasSubmitted:!1,data:{}};const Vt=({id:e,show:t=!1,strings:a={},pages:l=[],onDismiss:n=(()=>{})})=>{const[r,i]=(0,s.useState)(!1),[c,d]=(0,s.useState)(0),[p,m]=(0,s.useState)(!1),[g,h]=(0,s.useState)(!1),[b,_]=(0,s.useState)({});(0,s.useEffect)((()=>{const t=()=>{!window.optimoleCSAT.hasSubmitted&&window.optimoleCSAT.data?.score&&localStorage.setItem(`optimole_csat_data_${e}`,JSON.stringify(window.optimoleCSAT.data))};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[]),(0,s.useEffect)((()=>{t&&!p&&i(t)}),[t]),(0,s.useEffect)((()=>{window.optimoleCSAT={hasSubmitted:g,data:b}}),[g,b]);const f=(e=!1,t=b)=>{if(n(),g||!t?.score)return m(!0),null;const a={email:optimoleDashboardApp.user_data.user_email,product:"Optimole",site:optimoleDashboardApp.home_url,...t};try{fetch(`https://api.themeisle.com/tracking/csat/${t?.score}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, */*;q=0.1","Cache-Control":"no-cache"},body:JSON.stringify(a)})}catch(e){console.warn(e)}h(!0),d(l.length),e&&(i(!1),m(!0))};if((0,s.useEffect)((()=>{const t=localStorage.getItem(`optimole_csat_data_${e}`);t&&(f(!0,JSON.parse(t)),localStorage.removeItem(`optimole_csat_data_${e}`))}),[]),!r)return null;if(0===l.length)return null;const E=c<l.length,v=l[c]?.content;return(0,o.createElement)("div",{className:"bg-white fixed left-0 w-auto sm:right-0 sm:left-auto sm:w-full bottom-0 m-12 gap-2 max-w-lg flex flex-col text-gray-700 border-0 rounded-lg shadow-lg z-50"},l[c]&&(0,o.createElement)(o.Fragment,null,l[c]?.showHeader&&(0,o.createElement)(Pt,{onClose:()=>{i(!1),m(!0),f()},strings:a}),(0,o.createElement)(v,{data:b,changeData:(e,t=!1)=>{_({...b,...e}),t&&d(c+1)},onSubmit:f})),!E&&(0,o.createElement)("div",{className:"flex flex-col gap-5 p-8 items-center"},(0,o.createElement)(u.Icon,{icon:Xe,size:40,className:"bg-success rounded-full fill-white p-2"}),(0,o.createElement)("div",{className:"font-bold text-lg"},optimoleDashboardApp.strings.csat.heading_three),(0,o.createElement)("div",{className:"text-sm text-center"},optimoleDashboardApp.strings.csat.thank_you),(0,o.createElement)(u.Button,{variant:"primary",onClick:()=>i(!1),className:"optml__button basis-full justify-center rounded font-bold min-h-40"},optimoleDashboardApp.strings.csat.close)))},Zt=window.wp.api;var qt=a.n(Zt);const Gt=window.wp.i18n,$t=()=>{const[e,t]=(0,s.useState)(!1),[a,l,n]=(()=>{const[e,t]=(0,s.useState)({}),[a,o]=(0,s.useState)("loading"),l=()=>{qt().loadPromise.then((async()=>{try{const e=new(qt().models.Settings),a=await e.fetch();t(a)}catch(e){o("error")}finally{o("loaded")}}))};return(0,s.useEffect)((()=>{l()}),[]),[t=>e?.[t],(e,t,a=(0,Gt.__)("Settings saved.","textdomain"))=>{o("saving");const s=new(qt().models.Settings)({[e]:t}).save();s.success(((e,t)=>{"success"===t&&o("loaded"),"error"===t&&o("error"),l()})),s.error((e=>{o("error")}))},a]})(),r="loaded"===n&&void 0!==a("optml_csat")&&JSON.parse(a("optml_csat")),{hasImages:i,isFirstSite:d}=(0,c.useSelect)((e=>{const{getUserData:t}=e("optimole");return{hasImages:0<t()?.images_number,isFirstSite:1===t()?.whitelist?.length}})),p=localStorage.getItem("optimole_settings_visits");return(0,s.useEffect)((()=>{t(i&&d&&3<=parseInt(p)&&!1!==r&&!0!==r?.firstImpressions)}),[p,r]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Vt,{id:"first-impressions",show:e,onDismiss:()=>l("optml_csat",JSON.stringify({...r,firstImpressions:!0})),strings:{title:optimoleDashboardApp.strings.csat.title,close:optimoleDashboardApp.strings.csat.close},pages:[{showHeader:!0,content:e=>(0,o.createElement)("div",{className:"flex flex-col gap-5 px-8 pb-8"},(0,o.createElement)("div",{className:"font-bold text-lg"},optimoleDashboardApp.strings.csat.heading_one),(0,o.createElement)("div",{className:"flex gap-5"},[1,2,3,4,5].map((t=>(0,o.createElement)(u.Button,{key:t,onClick:()=>e.changeData({score:t},!0),className:"optml__button basis-full justify-center rounded font-bold min-h-40"},t)))),(0,o.createElement)("div",{className:"flex justify-between"},(0,o.createElement)("span",{className:"text-purple-gray text-sm"},optimoleDashboardApp.strings.csat.low),(0,o.createElement)("span",{className:"text-purple-gray text-sm"},optimoleDashboardApp.strings.csat.high)))},{showHeader:!0,content:e=>(0,o.createElement)("div",{className:"flex flex-col gap-5 px-8 pb-8"},(0,o.createElement)("div",{className:"font-bold text-lg"},optimoleDashboardApp.strings.csat.heading_two),(0,o.createElement)(u.TextareaControl,{label:optimoleDashboardApp.strings.csat.heading_two,hideLabelFromVision:!0,value:e.data?.feedback,placeholder:optimoleDashboardApp.strings.csat.feedback_placeholder,onChange:t=>e.changeData({feedback:t})}),(0,o.createElement)("div",{className:"flex justify-end"},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)(u.Button,{onClick:()=>e.onSubmit(),className:"optml__button basis-full justify-center rounded font-bold min-h-40"},optimoleDashboardApp.strings.csat.skip),(0,o.createElement)(u.Button,{variant:"primary",onClick:()=>e.onSubmit(),className:"optml__button basis-full justify-center rounded font-bold min-h-40"},optimoleDashboardApp.strings.csat.submit))))}]}))};async function Kt(e){if(!window.formbricks){const t=await fetch(`${e}/api/packages/app`);if(!t.ok)return{ok:!1,error:new Error("Failed to load Formbricks App SDK")};const a=await t.text(),o=document.createElement("script");o.innerHTML=a,document.head.appendChild(o);const s=async()=>new Promise(((e,t)=>{const a=setInterval((()=>{window.formbricks&&(clearInterval(a),e())}),100);setTimeout((()=>{clearInterval(a),t(new Error("Formbricks App SDK loading timed out"))}),1e4)}));try{return await s(),{ok:!0,data:void 0}}catch(e){return{ok:!1,error:new Error(e.message??"Failed to load Formbricks App SDK")}}}return{ok:!0,data:void 0}}const Ut=new Proxy({},{get:(e,t,a)=>async(...e)=>{if(!window.formbricks){if("init"!==t)return void console.error("🧱 Formbricks - Global error: You need to call formbricks.init before calling any other method");if(!e[0])return void console.error("🧱 Formbricks - Global error: You need to pass the apiHost as the first argument");const{apiHost:o}=e[0],s=await(a=Kt,async(...e)=>{try{return{ok:!0,data:await a(...e)}}catch(e){return{ok:!1,error:e}}})(o);if(!s.ok)return void console.error(`🧱 Formbricks - Global error: ${s.error.message}`)}var a;if(window.formbricks&&"function"!=typeof window.formbricks[t])console.error(`🧱 Formbricks - Global error: Formbricks App SDK does not support method ${String(t)}`);else try{return window.formbricks[t](...e)}catch(e){return void console.error(`Something went wrong: ${e}`)}}}),Yt=()=>{const{urgency:e,title:t,subtitle:a,cta_link:l,cta_text:n,dismiss_key:r}=optimoleDashboardApp.bf_notices.banner,[i,c]=(0,s.useState)(!0),[d,m]=(0,s.useState)(!0);(0,s.useEffect)((()=>{if(!i){const e=setTimeout((()=>{m(!1)}),300);return()=>clearTimeout(e)}}),[i]);const g=p()("relative flex flex-col items-center text-center xl:flex-row gap-5 justify-between xl:items-center bg-black text-white p-5 py-4 pr-7 box-border rounded-lg mt-5 bg-no-repeat transition-all duration-300",{"opacity-0":!i,"opacity-100":i});return d?(0,o.createElement)("div",{className:g,style:{backgroundImage:`url(${optimoleDashboardApp.assets_url}/img/bf-bg.jpg)`,backgroundPosition:"right 0",backgroundSize:"auto 100%"}},(0,o.createElement)(u.Button,{icon:kt,onClick:()=>{((e,t=(()=>{}))=>{C()({path:optimoleDashboardApp.routes.dismiss_notice,method:"POST",data:{key:e}}).then((e=>{"success"===e.code?t&&t(e):ye(e?.data?.error||optimoleDashboardApp.strings.options_strings.settings_saved_error)})).catch((e=>{ye(optimoleDashboardApp.strings.options_strings.settings_saved_error)}))})(r,(()=>{c(!1)}))},label:optimoleDashboardApp.strings.csat.close,className:"absolute right-1 top-1 cursor-pointer text-white hover:text-promo-orange"}),(0,o.createElement)("div",{className:"flex flex-col gap-3 xl:items-start items-center"},(0,o.createElement)("div",{className:"text-sm lg:text-base border-b border-0 border-dashed uppercase pb-1 font-semibold"},e),(0,o.createElement)("div",{className:"text-4xl lg:text-5xl italic uppercase font-extrabold",dangerouslySetInnerHTML:{__html:t}}),(0,o.createElement)("div",{className:"text-sm lg:text-base font-extrabold",dangerouslySetInnerHTML:{__html:a}})),(0,o.createElement)("a",{href:l,target:"_blank",className:"bg-promo-orange text-white px-7 py-3 uppercase text-base font-bold grow flex justify-center max-w-[150px] text-center cursor-pointer hover:bg-white hover:text-orange-400 transition-colors"},n)):null};function Qt(e,t=1){const a=Math.round(e/t);return 0===a||1===a?0:1<a&&8>a?7:8<=a&&31>a?30:30<a&&90>a?90:90<a?91:void 0}"undefined"!=typeof window&&optimoleDashboardApp.user_data.plan&&Ut.init({environmentId:"clo8wxwzj44orpm0gjchurujm",apiHost:"https://app.formbricks.com",userId:"optml_"+optimoleDashboardApp.user_data.id,attributes:{plan:optimoleDashboardApp.user_data.plan,status:optimoleDashboardApp.user_data.status,language:optimoleDashboardApp.language,cname_assigned:optimoleDashboardApp.user_data.is_cname_assigned||"no",connected_websites:optimoleDashboardApp.user_data.whitelist&&optimoleDashboardApp.user_data.whitelist.length.toString(),traffic:Qt(optimoleDashboardApp.user_data.traffic||0,500).toString(),images_number:Qt(optimoleDashboardApp.user_data.images_number||0,100).toString(),days_since_install:Qt(optimoleDashboardApp.days_since_install).toString()}});const Wt=({tab:e,setTab:t})=>{const{isConnected:a,hasApplication:l,hasConflicts:n,siteSettings:r,extraVisits:i}=(0,c.useSelect)((e=>{const{isConnected:t,hasApplication:a,getConflicts:o,getSiteSettings:s}=e("optimole"),l=o(),n=s();return{isConnected:t(),hasApplication:a(),hasConflicts:0<l.count||0,siteSettings:n,extraVisits:n.banner_frontend}})),{setQueryArgs:d}=(0,c.useDispatch)("optimole"),[p,m]=(0,s.useState)(!1),[g,u]=(0,s.useState)("general"),[h,b]=(0,s.useState)(!1),[_,f]=(0,s.useState)(r);return(0,s.useEffect)((()=>{const e=new URLSearchParams(window.location.search),a=Object.fromEntries(e.entries());let o=[];if(Object.prototype.hasOwnProperty.call(a,"optimole_action")){for(let e=0;20>e;e++)Object.prototype.hasOwnProperty.call(a,e)&&(isNaN(a[e])||(o[e]=parseInt(a[e],10)));a.images=o,a.url=window.location.href.split("?")[0]+(Object.prototype.hasOwnProperty.call(a,"paged")?"?paged="+a.paged:""),d(a),t("settings"),u("offload_media")}}),[]),(0,s.useEffect)((()=>{a&&l&&(M(!0),C()({path:optimoleDashboardApp.routes.poll_conflicts,method:"GET",parse:!1}).then((e=>200<=e.status&&300>e.status?e.json():(console.log(`%c Request failed with status ${e.status}`,"color: #E7602A"),Promise.resolve()))).then((e=>{M(!1),e&&P(e.data)})))}),[]),(0,s.useEffect)((()=>{n&&m(!0)}),[n]),(0,s.useEffect)((()=>{f({..._,banner_frontend:i})}),[i]),(0,s.useEffect)((()=>{window.onbeforeunload=h?()=>!0:null}),[h]),(0,o.createElement)("div",{className:"optml-connected 2xl:max-w-screen-xl max-w-screen px-4 mx-auto"},optimoleDashboardApp?.bf_notices?.banner&&(0,o.createElement)(Yt,null),(0,o.createElement)("div",{className:"flex flex-col xl:flex-row mx-auto gap-5"},(0,o.createElement)("div",{className:"flex flex-col justify-between mt-8 xl:mb-5 p-0 transition-all ease-in-out duration-700 relative text-gray-700 basis-8/12 2xl:basis-9/12"},"dashboard"===e&&(0,o.createElement)(Ze,null),"conflicts"===e&&p&&(0,o.createElement)(Ge,null),"settings"===e&&(0,o.createElement)(Tt,{tab:g,setTab:u,canSave:h,setCanSave:b,settings:_,setSettings:f}),"help"===e&&(0,o.createElement)(Ht,null)),(0,o.createElement)(Rt,null)),(0,o.createElement)($t,null))},Jt=[{label:optimoleDashboardApp.strings.optimole+" "+optimoleDashboardApp.strings.version,href:optimoleDashboardApp.optimoleHome},{label:optimoleDashboardApp.strings.terms_menu,href:optimoleDashboardApp.optimoleHome+"terms/"},{label:optimoleDashboardApp.strings.privacy_menu,href:optimoleDashboardApp.optimoleHome+"privacy-policy/"},{label:optimoleDashboardApp.strings.testdrive_menu,href:optimoleDashboardApp.optimoleHome+"test-drive?url="+optimoleDashboardApp.home_url}],Xt=()=>(0,o.createElement)("footer",{className:"max-w-screen-xl gap-3 md:gap-0 mx-auto my-5 flex justify-between text-base flex-col md:flex-row"},(0,o.createElement)("div",{dangerouslySetInnerHTML:{__html:optimoleDashboardApp.strings.account_needed_subtitle_3}}),(0,o.createElement)("nav",{className:"flex gap-0 sm:gap-3 flex-wrap md:flex-nowrap"},Jt.map(((e,t)=>(0,o.createElement)(u.ExternalLink,{key:t,href:e.href,className:"basis-1/2 sm:basis-auto"},e.label))))),ea=window.lodash;function ta(){const e=(0,c.useSelect)((e=>e(A.store).getNotices()),[]),{removeNotice:t}=(0,c.useDispatch)(A.store),a=(0,ea.filter)(e,{type:"snackbar"});return(0,o.createElement)(u.SnackbarList,{notices:a,className:"px-2 bottom-4 fixed",onRemove:t})}(0,s.render)((0,o.createElement)((()=>{const e=window.location.hash.replace("#","");let t=["dashboard","settings","help"].includes(e)?e:"dashboard";const[a,l]=(0,s.useState)(t),n=e=>{e.preventDefault(),l("settings")},r=e=>{e.preventDefault(),l("dashboard")},{showDisconnect:i,isConnected:d,hasApplication:p,hasDashboardLoaded:m}=(0,c.useSelect)((e=>{const{showDisconnect:t,isConnected:a,hasApplication:o,hasDashboardLoaded:s}=e("optimole");return{showDisconnect:t(),isConnected:a(),hasApplication:o(),hasDashboardLoaded:s()}}));return(0,s.useEffect)((()=>{d&&(window.location.hash=`#${a}`,D.forEach((e=>{const t=document.querySelector(`a[href="${e.href}"]`);if(!t)return;const a=t.parentNode;if(e.hash&&e.hash===window.location.hash)return t.classList.add("current"),void a.classList.add("current");t.classList.remove("current"),a.classList.remove("current")})))}),[a]),(0,s.useEffect)((()=>{if(!d)return;const e=document.querySelector('a[href*="page=optimole"]'),t=document.querySelector('a[href*="page=optimole#settings"]');return e&&t?(e.addEventListener("click",r),t.addEventListener("click",n),()=>{e&&t&&(e.removeEventListener("click",r),t.removeEventListener("click",n))}):void 0}),[]),(0,o.createElement)("div",{className:"antialiased"},(0,o.createElement)(we,{tab:a,setTab:l}),!(d&&p)&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(De,null),(0,o.createElement)(Xt,null)),d&&p&&!m&&(0,o.createElement)(Te,null),d&&i&&(0,o.createElement)(xe,null),d&&p&&m&&(0,o.createElement)(Wt,{tab:a,setTab:l}),(0,o.createElement)(ta,null))}),null),document.getElementById("optimole-app"))},184:(e,t)=>{var a;!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var l=typeof a;if("string"===l||"number"===l)e.push(a);else if(Array.isArray(a)){if(a.length){var n=s.apply(null,a);n&&e.push(n)}}else if("object"===l){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var r in a)o.call(a,r)&&a[r]&&e.push(r)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(a=function(){return s}.apply(t,[]))||(e.exports=a)}()},864:(e,t,a)=>{(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};t.r(o),t.d(o,{default:()=>c});const s=a(196);var l=t.n(s);function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?n(Object(a),!0).forEach((function(t){i(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const c=e=>{const{aspectRatio:t="taller",handle:a=null,handleSize:o=40,hover:n=!1,leftImage:i,leftImageAlt:c="",leftImageCss:d={},leftImageLabel:p=null,onSliderPositionChange:m=(()=>{}),rightImage:g,rightImageAlt:u="",rightImageCss:h={},rightImageLabel:b=null,skeleton:_=null,sliderLineColor:f="#ffffff",sliderLineWidth:E=2,sliderPositionPercentage:v=.5,vertical:y=!1}=e,w=!y,[x,k]=(0,s.useState)(v),[C,S]=(0,s.useState)(0),[A,D]=(0,s.useState)(0),[L,N]=(0,s.useState)(!1),[T,M]=(0,s.useState)(!1),[I,O]=(0,s.useState)(!1),j=(0,s.useRef)(null),F=(0,s.useRef)(null),B=(0,s.useRef)(null);(0,s.useEffect)((()=>{const e=j.current,t=new ResizeObserver((e=>{let[t,...a]=e;const o=t.target.getBoundingClientRect().width;S(o)}));return t.observe(e),()=>t.disconnect()}),[]),(0,s.useEffect)((()=>(B.current.complete&&N(!0),()=>{N(!1)})),[i]),(0,s.useEffect)((()=>(F.current.complete&&M(!0),()=>{M(!1)})),[g]);const H=T&&L;(0,s.useEffect)((()=>{const e=e=>{const t=e||window.event,a=t.touches?t.touches[0].pageX:t.pageX,o=t.touches?t.touches[0].pageY:t.pageY,s=a-window.pageXOffset,l=o-window.pageYOffset,n=F.current.getBoundingClientRect();let r=w?s-n.left:l-n.top;const i=0+E/2,c=w?C-E/2:A-E/2;r<i&&(r=i),r>c&&(r=c),k(w?r/C:r/A),m&&m(w?r/C:r/A)},a=t=>{O(!0),"touches"in t||t.preventDefault(),e(t),window.addEventListener("mousemove",e),window.addEventListener("touchmove",e)},o=()=>{O(!1),window.removeEventListener("mousemove",e),window.removeEventListener("touchmove",e)},s=j.current;if(H){s.addEventListener("touchstart",a),window.addEventListener("touchend",o),n?(s.addEventListener("mousemove",e),s.addEventListener("mouseleave",o)):(s.addEventListener("mousedown",a),window.addEventListener("mouseup",o));const l=B.current.naturalHeight/B.current.naturalWidth,r=F.current.naturalHeight/F.current.naturalWidth,i="taller"===t?Math.max(l,r):Math.min(l,r);D(C*i)}return()=>{s.removeEventListener("touchstart",a),window.removeEventListener("touchend",o),s.removeEventListener("mousemove",e),s.removeEventListener("mouseleave",o),s.removeEventListener("mousedown",a),window.removeEventListener("mouseup",o),window.removeEventListener("mousemove",e),window.removeEventListener("touchmove",e)}}),[H,t,A,C,w,n,E,y]);const z={container:{boxSizing:"border-box",position:"relative",width:"100%",height:`${A}px`,overflow:"hidden"},rightImage:r({clip:w?`rect(auto, auto, auto, ${C*x}px)`:`rect(${A*x}px, auto, auto, auto)`,display:"block",height:"100%",objectFit:"cover",position:"absolute",width:"100%"},h),leftImage:r({clip:w?`rect(auto, ${C*x}px, auto, auto)`:`rect(auto, auto, ${A*x}px, auto)`,display:"block",height:"100%",objectFit:"cover",position:"absolute",width:"100%"},d),slider:{alignItems:"center",cursor:!n&&w?"ew-resize":!n&&!w&&"ns-resize",display:"flex",flexDirection:w?"column":"row",height:w?"100%":`${o}px`,justifyContent:"center",left:w?C*x-o/2+"px":0,position:"absolute",top:w?0:A*x-o/2+"px",width:w?`${o}px`:"100%"},line:{background:f,boxShadow:"0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)",flex:"0 1 auto",height:w?"100%":`${E}px`,width:w?`${E}px`:"100%"},handleCustom:{alignItems:"center",boxSizing:"border-box",display:"flex",flex:"1 0 auto",height:"auto",justifyContent:"center",width:"auto"},handleDefault:{alignItems:"center",border:`${E}px solid ${f}`,borderRadius:"100%",boxShadow:"0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)",boxSizing:"border-box",display:"flex",flex:"1 0 auto",height:`${o}px`,justifyContent:"center",width:`${o}px`,transform:w?"none":"rotate(90deg)"},leftArrow:{border:`inset ${.15*o}px rgba(0,0,0,0)`,borderRight:`${.15*o}px solid ${f}`,height:"0px",marginLeft:`-${.25*o}px`,marginRight:.25*o+"px",width:"0px"},rightArrow:{border:`inset ${.15*o}px rgba(0,0,0,0)`,borderLeft:`${.15*o}px solid ${f}`,height:"0px",marginRight:`-${.25*o}px`,width:"0px"},leftLabel:{background:"rgba(0, 0, 0, 0.5)",color:"white",left:w?"5%":"50%",opacity:I?0:1,padding:"10px 20px",position:"absolute",top:w?"50%":"3%",transform:w?"translate(0,-50%)":"translate(-50%, 0)",transition:"opacity 0.1s ease-out"},rightLabel:{background:"rgba(0, 0, 0, 0.5)",color:"white",opacity:I?0:1,padding:"10px 20px",position:"absolute",left:w?null:"50%",right:w?"5%":null,top:w?"50%":null,bottom:w?null:"3%",transform:w?"translate(0,-50%)":"translate(-50%, 0)",transition:"opacity 0.1s ease-out"},leftLabelContainer:{clip:w?`rect(auto, ${C*x}px, auto, auto)`:`rect(auto, auto, ${A*x}px, auto)`,height:"100%",position:"absolute",width:"100%"},rightLabelContainer:{clip:w?`rect(auto, auto, auto, ${C*x}px)`:`rect(${A*x}px, auto, auto, auto)`,height:"100%",position:"absolute",width:"100%"}};return l().createElement(l().Fragment,null,_&&!H&&l().createElement("div",{style:r({},z.container)},_),l().createElement("div",{style:r(r({},z.container),{},{display:H?"block":"none"}),ref:j,"data-testid":"container"},l().createElement("img",{onLoad:()=>M(!0),alt:u,"data-testid":"right-image",ref:F,src:g,style:z.rightImage}),l().createElement("img",{onLoad:()=>N(!0),alt:c,"data-testid":"left-image",ref:B,src:i,style:z.leftImage}),l().createElement("div",{style:z.slider},l().createElement("div",{style:z.line}),a?l().createElement("div",{style:z.handleCustom},a):l().createElement("div",{style:z.handleDefault},l().createElement("div",{style:z.leftArrow}),l().createElement("div",{style:z.rightArrow})),l().createElement("div",{style:z.line})),p&&l().createElement("div",{style:z.leftLabelContainer},l().createElement("div",{style:z.leftLabel},p)),b&&l().createElement("div",{style:z.rightLabelContainer},l().createElement("div",{style:z.rightLabel},b))))};e.exports=o})()},196:e=>{"use strict";e.exports=window.React}},a={};function o(e){var s=a[e];if(void 0!==s)return s.exports;var l=a[e]={exports:{}};return t[e](l,l.exports,o),l.exports}o.m=t,e=[],o.O=(t,a,s,l)=>{if(!a){var n=1/0;for(d=0;d<e.length;d++){for(var[a,s,l]=e[d],r=!0,i=0;i<a.length;i++)(!1&l||n>=l)&&Object.keys(o.O).every((e=>o.O[e](a[i])))?a.splice(i--,1):(r=!1,l<n&&(n=l));if(r){e.splice(d--,1);var c=s();void 0!==c&&(t=c)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[a,s,l]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,431:0};o.O.j=t=>0===e[t];var t=(t,a)=>{var s,l,[n,r,i]=a,c=0;if(n.some((t=>0!==e[t]))){for(s in r)o.o(r,s)&&(o.m[s]=r[s]);if(i)var d=i(o)}for(t&&t(a);c<n.length;c++)l=n[c],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(d)},a=globalThis.webpackChunkoptimole_wp=globalThis.webpackChunkoptimole_wp||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var s=o.O(void 0,[431],(()=>o(75)));s=o.O(s)})();
| ver. 1.4 |
Github
|
.
| PHP 7.4.3-4ubuntu2.24 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка