!function(){"use strict";window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Monitoring=window.LiveScoreApp.Monitoring||{};const e={cacheWrites:[],cacheWriteFailures:[],maxBufferSize:500};window.LiveScoreApp.Monitoring.trackCacheWrite=function(t){try{e.cacheWrites.push({...t,timestamp:(new Date).toISOString()}),e.cacheWrites.length>e.maxBufferSize&&e.cacheWrites.shift(),e.cacheWrites.length>=100&&i("success",e.cacheWrites)}catch(e){}},window.LiveScoreApp.Monitoring.trackCacheWriteFailure=function(t){try{e.cacheWriteFailures.push({...t,timestamp:(new Date).toISOString()}),e.cacheWriteFailures.length>e.maxBufferSize&&e.cacheWriteFailures.shift(),e.cacheWriteFailures.length>=50&&i("failure",e.cacheWriteFailures)}catch(e){}},window.LiveScoreApp.Monitoring.trackResponseTime=function(t){try{e.responseTimes=e.responseTimes||[],e.responseTimes.push({...t,timestamp:(new Date).toISOString()}),e.responseTimes.length>e.maxBufferSize&&e.responseTimes.shift(),e.responseTimes.length>=100&&i("response_times",e.responseTimes)}catch(e){}},window.LiveScoreApp.Monitoring.getBuffers=function(){return{cacheWrites:e.cacheWrites.length,cacheWriteFailures:e.cacheWriteFailures.length,responseTimes:(e.responseTimes||[]).length}},window.LiveScoreApp.Monitoring.reset=function(){e.cacheWrites.length=0,e.cacheWriteFailures.length=0,e.responseTimes&&(e.responseTimes.length=0),window.LiveScoreApp.Monitoring._resetInProgress=!0};const t={},n=1e4;function i(e,i){if(0!==i.length){var a=Date.now();if(!(t[e]&&a-t[e]<n)){t[e]=a;var s=i.slice(),r=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",o=window.LiveScoresAjax&&window.LiveScoresAjax.monitoring_nonce||"",c="response_times"===e?e:"cache_"+e;if(navigator.sendBeacon)try{var l=new FormData;l.append("action","send_monitoring_metrics"),l.append("nonce",o),l.append("type",c),l.append("data",JSON.stringify(s)),navigator.sendBeacon(r,l),i.length=0}catch(e){}}}}setInterval(function(){e.cacheWrites.length>0&&i("success",e.cacheWrites),e.cacheWriteFailures.length>0&&i("failure",e.cacheWriteFailures),e.responseTimes&&e.responseTimes.length>0&&i("response_times",e.responseTimes)},6e4),window.addEventListener("beforeunload",()=>{if(!(window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&window.LiveScoreApp.Monitoring._resetInProgress)){var t=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",n=window.LiveScoresAjax&&window.LiveScoresAjax.monitoring_nonce||"";if(e.cacheWrites.length>0){var i=new FormData;i.append("action","send_monitoring_metrics"),i.append("nonce",n),i.append("type","cache_success"),i.append("data",JSON.stringify(e.cacheWrites)),navigator.sendBeacon(t,i)}if(e.cacheWriteFailures.length>0){var a=new FormData;a.append("action","send_monitoring_metrics"),a.append("nonce",n),a.append("type","cache_failure"),a.append("data",JSON.stringify(e.cacheWriteFailures)),navigator.sendBeacon(t,a)}if(e.responseTimes&&e.responseTimes.length>0){var s=new FormData;s.append("action","send_monitoring_metrics"),s.append("nonce",n),s.append("type","response_times"),s.append("data",JSON.stringify(e.responseTimes)),navigator.sendBeacon(t,s)}}})}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Monitoring=window.LiveScoreApp.Monitoring||{},window.APIMonitor=function(){"use strict";let e=null;try{const t=parseInt(localStorage.getItem("monitoringResetAt")||"0",10),n=localStorage.getItem("apiMonitorMetrics");if(n){const i=JSON.parse(n);i.startTime&&i.startTime>=t&&(e=i)}}catch(e){}const t={apiRequests:e?.apiRequests||[],cacheHits:e?.cacheHits||0,cacheMisses:e?.cacheMisses||0,requestsByType:e?.requestsByType||{},requestsByMinute:e?.requestsByMinute||{},ttlUsageByType:e?.ttlUsageByType||{},errors:e?.errors||[],startTime:e?.startTime||Date.now(),lastReportTime:Date.now()},n=window.fetch;if(window.fetch=function(...e){const i=e[0];if("string"==typeof i){if(-1!==i.indexOf("monitoring-api"))return n.apply(window,e);if(e[1]&&e[1].body instanceof FormData&&"send_monitoring_metrics"===e[1].body.get("action"))return n.apply(window,e);if(0===i.indexOf("http")&&-1===i.indexOf(location.hostname)&&-1===i.indexOf("admin-ajax.php")&&-1===i.indexOf("proxy.php"))return n.apply(window,e)}const a=Date.now(),s=Math.floor(a/6e4);let r=function(e,t){if(t&&t.body)try{if(t.body instanceof FormData){var n=t.body.get("action");if(n){var i=l(n);if(i)return i}}const e=JSON.parse(t.body);if(e&&e.dataType)return e.dataType;if(e&&e.action){var a=l(e.action);if(a)return a}}catch(e){if("string"==typeof t.body){var s=t.body.match(/(?:^|&)action=([^&]+)/);if(s){var r=l(s[1]);if(r)return r}}}const o=e.toLowerCase();if(o.includes("admin-ajax.php")){var c=e.match(/[?&]action=([^&]+)/);if(c){var p=l(c[1]);if(p)return p}}if(o.includes("proxy.php")){var d=e.match(/[?&]action=([^&]+)/);if(d){var u=d[1].toLowerCase();if(u.includes("jersey"))return"JERSEY";if(u.includes("player"))return"PLAYER_DATA";if(u.includes("lineup"))return"LINEUPS";if(u.includes("statistic"))return"STATISTICS";if(u.includes("incident"))return"MATCH_INCIDENTS";if(u.includes("momentum"))return"ATTACK_MOMENTUM";if(u.includes("match_details"))return"LIVE_SCORES"}}return o.includes("livescore")||o.includes("match")?"LIVE_SCORES":o.includes("incident")?"MATCH_INCIDENTS":o.includes("lineup")?"LINEUPS":o.includes("statistics")||o.includes("stats")?"STATISTICS":o.includes("standing")||o.includes("table")?"STANDINGS":o.includes("h2h")||o.includes("head")?"H2H":o.includes("player")?"PLAYER_DATA":o.includes("monitoring-api")?"MONITORING_API":o.includes(".json")?"LOCAL_CACHE":"OTHER"}(i,e[1]);t.apiRequests.push({url:i,type:r,timestamp:a,minute:s}),t.requestsByType[r]=(t.requestsByType[r]||0)+1,t.requestsByMinute[s]=(t.requestsByMinute[s]||0)+1;const o=Date.now();return n.apply(window,e).then(t=>{const n=Date.now()-o;let a="unknown";if("string"==typeof i)if(i.includes("?action="))a=i.match(/action=([^&]+)/)[1];else if(i.includes("wp-admin/admin-ajax.php")||i.includes("admin-ajax.php")){a="ajax_generic";try{if(e[1]&&e[1].body instanceof FormData){var s=e[1].body.get("action");s&&(a=s)}else if(e[1]&&e[1].body&&"undefined"!=typeof URLSearchParams&&e[1].body instanceof URLSearchParams){var r=e[1].body.get("action");r&&(a=r)}else if(e[1]&&"string"==typeof e[1].body){var c=e[1].body.match(/(?:^|&)action=([^&]+)/);if(c&&(a=c[1]),"ajax_generic"===a&&"{"===e[1].body.charAt(0))try{var l=JSON.parse(e[1].body);l.action&&(a=l.action)}catch(e){}}}catch(e){}if("ajax_generic"===a){var p=i.match(/[?&]action=([^&]+)/);p&&(a=p[1])}}return window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&n>0&&window.LiveScoreApp.Monitoring.trackResponseTime({endpoint:a,duration_ms:n,url:i,status:t.status}),t}).catch(e=>{throw t.errors.push({type:"FETCH_ERROR",message:e.message,timestamp:Date.now()}),t.errors.length>50&&(t.errors=t.errors.slice(-50)),e})},"undefined"!=typeof jQuery&&(jQuery(document).ajaxSend(function(e,n,i){if(!i.data||"string"!=typeof i.data||-1===i.data.indexOf("action=send_monitoring_metrics")){var a=i.url||"",s="OTHER";if(i.data&&"string"==typeof i.data){var r=i.data.match(/(?:^|&)action=([^&]+)/);r&&(s=l(r[1])||"OTHER")}else i.data&&"object"==typeof i.data&&i.data.action&&(s=l(i.data.action)||"OTHER");if("DEDUP_POLL"!==s&&"MONITORING_API"!==s&&"WP_SYSTEM"!==s){var o=Date.now(),c=Math.floor(o/6e4);t.apiRequests.push({url:a,type:s,timestamp:o,minute:c,transport:"jquery"}),t.requestsByType[s]=(t.requestsByType[s]||0)+1,t.requestsByMinute[c]=(t.requestsByMinute[c]||0)+1,n._monitorStartTime=o,n._monitorType=s}}}),jQuery(document).ajaxComplete(function(e,t,n){if(t._monitorStartTime){var i=Date.now()-t._monitorStartTime,a="ajax_generic";if(n.data&&"string"==typeof n.data){var s=n.data.match(/(?:^|&)action=([^&]+)/);s&&(a=s[1])}else n.data&&"object"==typeof n.data&&n.data.action&&(a=n.data.action);if("ajax_generic"===a&&n.url){var r=n.url.match(/[?&]action=([^&]+)/);r&&(a=r[1])}window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&i>0&&window.LiveScoreApp.Monitoring.trackResponseTime({endpoint:a,duration_ms:i,url:n.url||"",status:t.status,transport:"jquery"})}})),window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache){const e=window.LiveScoreApp.Utils.Cache.getFromCache;window.LiveScoreApp.Utils.Cache.getFromCache=function(n,i){if(e){const a=e.call(this,n,i);if(a&&void 0!==a.data&&null!==a.data){t.cacheHits++;const e=c(n);e&&(t.ttlUsageByType[e]||(t.ttlUsageByType[e]={hits:0,misses:0}),t.ttlUsageByType[e].hits++)}else{t.cacheMisses++;const e=c(n);e&&(t.ttlUsageByType[e]||(t.ttlUsageByType[e]={hits:0,misses:0}),t.ttlUsageByType[e].misses++)}return a}}}let i=0;function a(){if(!window.LiveScoreApp||!window.LiveScoreApp.Utils||!window.LiveScoreApp.Utils.Cache)return i++,void(i<50?setTimeout(a,200):"function"==typeof window.getCache&&o());i=0;const e=window.LiveScoreApp.Utils.Cache.getFromCacheByType;e&&"function"==typeof e&&(window.LiveScoreApp.Utils.Cache.getFromCacheByType=function(n,i){try{const s=e.call(this,n,i),r="string"!=typeof(a=i||"")?null:a.includes("liveScore")?"LIVE_SCORES":a.includes("incident")?"MATCH_INCIDENTS":a.includes("matchDetail")?"MATCH_DETAILS":a.includes("attack")||a.includes("momentum")?"ATTACK_MOMENTUM":a.includes("lineup")?"LINEUPS":a.includes("statistic")?"STATISTICS":a.includes("h2h")?"H2H":a.includes("standing")?"STANDINGS":a.includes("liveMinute")||a.includes("LIVE_TEXT")?"LIVE_TEXT":a.includes("player")?"PLAYER_DATA":null;return r&&(null!=s?(t.cacheHits++,t.ttlUsageByType[r]||(t.ttlUsageByType[r]={hits:0,misses:0}),t.ttlUsageByType[r].hits++):(t.cacheMisses++,t.ttlUsageByType[r]||(t.ttlUsageByType[r]={hits:0,misses:0}),t.ttlUsageByType[r].misses++)),s}catch(t){return e.call(this,n,i)}var a})}let s=0;function r(){if(!window.getCache||"function"!=typeof window.getCache)return s++,void(s<30&&setTimeout(r,300));o()}function o(){if(!window.getCache||"function"!=typeof window.getCache)return;const e=window.getCache;window.getCache=function(n){try{const i=e.apply(this,arguments);if(null!=i){t.cacheHits++;const e=c(n);e&&(t.ttlUsageByType[e]||(t.ttlUsageByType[e]={hits:0,misses:0}),t.ttlUsageByType[e].hits++)}else{t.cacheMisses++;const e=c(n);e&&(t.ttlUsageByType[e]||(t.ttlUsageByType[e]={hits:0,misses:0}),t.ttlUsageByType[e].misses++)}return i}catch(t){return e.apply(this,arguments)}}}function c(e){return e.includes("liveScore")||e.includes("LIVE_SCORES")?"LIVE_SCORES":e.includes("incident")?"MATCH_INCIDENTS":e.includes("matchDetail")?"MATCH_DETAILS":e.includes("attack")||e.includes("momentum")?"ATTACK_MOMENTUM":e.includes("lineup")?"LINEUPS":e.includes("statistic")?"STATISTICS":e.includes("h2h")?"H2H":e.includes("standing")?"STANDINGS":e.includes("LIVE_MINUTE")||e.includes("minute")?"LIVE_TEXT":e.includes("player")?"PLAYER_DATA":null}function l(e){return{get_live_scores:"LIVE_SCORES",get_match_details:"LIVE_SCORES",get_match_incidents:"MATCH_INCIDENTS",get_match_lineups:"LINEUPS",get_match_statistics:"STATISTICS",get_standings_data:"STANDINGS",get_cached_standings:"STANDINGS",get_h2h_data:"H2H",get_streaks_data:"H2H",get_team_performance:"STATISTICS",get_attack_momentum:"ATTACK_MOMENTUM",get_super_lig_next_matches:"SEO",check_dedup_cache:"DEDUP_POLL",send_monitoring_metrics:"MONITORING_API",sync_memcached_cleanup:"SYSTEM",heartbeat:"WP_SYSTEM",wp_ajax_heartbeat:"WP_SYSTEM",validate_cache_ttls:"SYSTEM"}[e]||null}function p(){const e=Date.now(),n=Math.round((e-t.startTime)/1e3),i=Math.round(n/60);let a=0;for(const e of Object.values(t.requestsByType))a+=e;0===a&&(a=t.apiRequests.length);const s=Math.floor(e/6e4)-1,r=t.requestsByMinute[s]||0;let o=i>0?+(a/i).toFixed(1):a;const c=t.ttlUsageByType.LIVE_SCORES||{hits:0,misses:0},l=t.cacheHits-c.hits,p=t.cacheMisses-c.misses,d=l+p,u=d>0?Math.round(l/d*100):0,m={};for(const[e,n]of Object.entries(t.requestsByType))m[e]={count:n,percentage:a>0?Math.round(n/a*100):0};const h={};for(const[e,n]of Object.entries(t.ttlUsageByType)){const t=n.hits+n.misses;h[e]={hits:n.hits,misses:n.misses,total:t,hitRate:t>0?Math.round(n.hits/t*100):0}}return{timestamp:new Date(e).toISOString(),uptime:{seconds:n,minutes:i},apiMetrics:{totalRequests:a,requestsPerMinute:o,lastMinuteRequests:r,targetRange:"8-12 req/min",status:o<=12?"✅ OK":"⚠️ HIGH"},cacheMetrics:{totalOperations:d,hits:l,misses:p,hitRate:u+"%",liveScoresExcluded:c.hits+c.misses,targetRange:"70-80%",status:u>=70&&u<=80?"✅ OK":u<70?"⚠️ LOW":"⚠️ HIGH"},requestsByType:m,ttlUsageByType:h,errors:{count:t.errors.length,recent:t.errors.slice(-5)}}}r(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){a()}):a(),window.addEventListener("load",function(){t.cacheHits||t.cacheMisses||(a(),r())});let d=!1;function u(){try{if(d)return;if(-1!==window.location.pathname.indexOf("monitoring-dashboard"))return;!function(){t.apiRequests.length>100&&(t.apiRequests=t.apiRequests.slice(-100)),t.errors.length>50&&(t.errors=t.errors.slice(-50));const e=Math.floor(Date.now()/6e4)-60;for(const n of Object.keys(t.requestsByMinute))parseInt(n)<e&&delete t.requestsByMinute[n]}(),function(){if(!d)try{localStorage.setItem("apiMonitorMetrics",JSON.stringify({apiRequests:t.apiRequests,cacheHits:t.cacheHits,cacheMisses:t.cacheMisses,requestsByType:t.requestsByType,requestsByMinute:t.requestsByMinute,ttlUsageByType:t.ttlUsageByType,errors:t.errors,startTime:t.startTime,lastReportTime:t.lastReportTime}))}catch(e){}}();const s=p();var e=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",i=window.LiveScoresAjax&&window.LiveScoresAjax.monitoring_nonce||"",a=new FormData;a.append("action","send_monitoring_metrics"),a.append("nonce",i),a.append("type","api"),a.append("data",JSON.stringify(s)),n(e,{method:"POST",body:a}).catch(function(){})}catch(e){}}return setTimeout(u,3e3),setInterval(function(){try{u()}catch(e){}},6e4),{getReport:p,reset:function(){d=!0,t.apiRequests=[],t.cacheHits=0,t.cacheMisses=0,t.requestsByType={},t.requestsByMinute={},t.ttlUsageByType={},t.errors=[],t.startTime=Date.now(),t.lastReportTime=Date.now();try{localStorage.removeItem("apiMonitorMetrics"),localStorage.setItem("monitoringResetAt",String(Date.now()))}catch(e){}},getMetrics:function(){return t}}}();try{window.APIMonitor&&window.APIMonitor.getReport}catch(e){}window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Monitoring=window.LiveScoreApp.Monitoring||{},window.ConsoleMonitor=function(){"use strict";let e=null;try{const t=parseInt(localStorage.getItem("monitoringResetAt")||"0",10),n=localStorage.getItem("consoleMonitorMetrics");if(n){const i=JSON.parse(n);i.startTime&&i.startTime>=t&&(e=i)}}catch(e){}const t={errors:e?.errors||[],warnings:e?.warnings||[],logs:e?.logs||[],jsErrors:e?.jsErrors||[],startTime:e?.startTime||Date.now(),performanceMetrics:e?.performanceMetrics||{documentReady:null,dataLoaded:null,firstPaint:null}},n=200;t.errors.length>n&&(t.errors=t.errors.slice(-200)),t.warnings.length>n&&(t.warnings=t.warnings.slice(-200)),t.logs.length>n&&(t.logs=t.logs.slice(-200)),t.jsErrors.length>n&&(t.jsErrors=t.jsErrors.slice(-200));const i=console.error,a=console.warn,s=console.log;console.error=function(...e){const n=Date.now();t.errors.push({timestamp:n,time:new Date(n).toLocaleTimeString(),message:e.join(" "),stack:(new Error).stack}),i.apply(console,e)},console.warn=function(...e){const n=Date.now();t.warnings.push({timestamp:n,time:new Date(n).toLocaleTimeString(),message:e.join(" ")}),a.apply(console,e)};const r=["API Monitor","Console Monitor","Cache"];function o(){"complete"!==document.readyState||t.performanceMetrics.documentReady||(t.performanceMetrics.documentReady=Date.now()),window.LiveScoreApp&&window.LiveScoreApp.Events&&window.LiveScoreApp.Events.DataLoaded&&!t.performanceMetrics.dataLoaded&&(t.performanceMetrics.dataLoaded=Date.now())}function c(){const e=Date.now(),n=Math.round((e-t.startTime)/1e3),i=t.errors.length+t.warnings.length+t.jsErrors.length;return{timestamp:new Date(e).toISOString(),uptime:{seconds:n,minutes:Math.round(n/60)},summary:{totalErrors:t.errors.length,totalWarnings:t.warnings.length,totalJSErrors:t.jsErrors.length,totalIssues:i,status:0===t.errors.length&&0===t.jsErrors.length?"✅ OK":"❌ ISSUES"},errors:t.errors,warnings:t.warnings,jsErrors:t.jsErrors,recentLogs:t.logs.slice(-10),performance:t.performanceMetrics}}console.log=function(...e){const n=e.join(" ");if(r.some(e=>n.includes(e))){const e=Date.now();t.logs.push({timestamp:e,time:new Date(e).toLocaleTimeString(),message:n})}s.apply(console,e)},window.addEventListener("error",function(e){const n=Date.now();t.jsErrors.push({timestamp:n,time:new Date(n).toLocaleTimeString(),type:"JavaScript Error",message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,stack:e.error?e.error.stack:"No stack trace"})}),window.addEventListener("unhandledrejection",function(e){const n=Date.now();t.jsErrors.push({timestamp:n,time:new Date(n).toLocaleTimeString(),type:"Unhandled Promise Rejection",message:e.reason?e.reason.toString():"Unknown",stack:e.reason&&e.reason.stack?e.reason.stack:"No stack trace"})}),document.addEventListener("DOMContentLoaded",o),window.addEventListener("load",o),setInterval(o,6e4);let l=!1;function p(){try{if(l)return;if(-1!==window.location.pathname.indexOf("monitoring-dashboard"))return;!function(){try{localStorage.setItem("consoleMonitorMetrics",JSON.stringify({errors:t.errors.slice(-200),warnings:t.warnings.slice(-200),logs:t.logs.slice(-50),jsErrors:t.jsErrors.slice(-200),startTime:t.startTime,performanceMetrics:t.performanceMetrics}))}catch(e){}}();const a=c();var e=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",n=window.LiveScoresAjax&&window.LiveScoresAjax.monitoring_nonce||"",i=new FormData;i.append("action","send_monitoring_metrics"),i.append("nonce",n),i.append("type","console"),i.append("data",JSON.stringify(a)),fetch(e,{method:"POST",body:i}).catch(function(){})}catch(e){}}return setTimeout(p,3e3),setInterval(function(){try{p()}catch(e){}},6e4),{getReport:c,reset:function(){l=!0,t.errors=[],t.warnings=[],t.logs=[],t.jsErrors=[],t.startTime=Date.now(),t.performanceMetrics={documentReady:null,dataLoaded:null,firstPaint:null};try{localStorage.removeItem("consoleMonitorMetrics"),localStorage.setItem("monitoringResetAt",String(Date.now()))}catch(e){}},getMetrics:function(){return t}}}();try{window.ConsoleMonitor&&window.ConsoleMonitor.getReport}catch(e){}window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Monitoring=window.LiveScoreApp.Monitoring||{},window.UserInteractionMonitor=function(){"use strict";const e={interactions:{matchCardsClicked:0,matchDetailsOpened:0,matchDetailsClosed:0,tabSwitches:{details:0,lineups:0,statistics:0,standings:0,h2h:0,incidents:0,history:0},totalTabSwitches:0},performance:{apiCallTimes:[],apiCallsByType:{},apiCallDetails:[],maxResponseTime:0,minResponseTime:1/0},cache:{writeAttempts:0,writeSuccesses:0,writeFailures:0,readAttempts:0,successRate:0},sessionStart:Date.now(),lastUpdated:Date.now(),webVitals:{ttfb:null,fcp:null,lcp:null,domReady:null,windowLoad:null,lazySectionLoad:null}};var t=!1;function n(){if(t)return!0;var n=window.LiveScoreApp&&window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails;if(!n)return!1;if(n.updateMatchDetails&&!n._uimOpenHooked){var i=n.updateMatchDetails;n.updateMatchDetails=function(t){return e.interactions.matchDetailsOpened++,l("DETAILS_OPENED",{matchId:t}),i.apply(this,arguments)},n._uimOpenHooked=!0}if(n.closeMatchDetails&&!n._uimCloseHooked){var a=n.closeMatchDetails;n.closeMatchDetails=function(){return e.interactions.matchDetailsClosed++,l("DETAILS_CLOSED"),a.apply(this,arguments)},n._uimCloseHooked=!0}return n._uimOpenHooked&&(t=!0),t}function i(e){return e?e.replace(/^tab-/,"").toLowerCase().trim():""}var a=0,s="";function r(t,n){if(t){var r=i(t);if(r){var o=Date.now();r===s&&o-a<200||(s=r,a=o,e.interactions.tabSwitches.hasOwnProperty(r)||(e.interactions.tabSwitches[r]=0),e.interactions.tabSwitches[r]++,e.interactions.totalTabSwitches++)}}}function o(e){return e&&{get_live_scores:"LIVE_SCORES",get_match_details:"LIVE_SCORES",get_match_incidents:"INCIDENTS",get_match_lineups:"LINEUPS",get_match_statistics:"STATISTICS",get_standings_data:"STANDINGS",get_cached_standings:"STANDINGS",get_h2h_data:"H2H",get_streaks_data:"H2H",get_team_performance:"STATISTICS",get_attack_momentum:"ATTACK_MOMENTUM",get_super_lig_next_matches:"SEO",check_dedup_cache:"DEDUP_POLL",send_monitoring_metrics:"MONITORING_API"}[e]||null}function c(){const t=e.performance.apiCallTimes.map(e=>e.duration);t.length>0&&(e.performance.avgResponseTime=Math.round(t.reduce((e,t)=>e+t)/t.length),e.performance.maxResponseTime=Math.round(Math.max(...t)),e.performance.minResponseTime=Math.round(Math.min(...t)))}function l(e,t={}){window.APIMonitor&&window.APIMonitor.recordEvent&&window.APIMonitor.recordEvent(e,t)}function p(){return e.cache.successRate=e.cache.writeAttempts>0?Math.round(e.cache.writeSuccesses/e.cache.writeAttempts*100):0,{...e,sessionDuration:Date.now()-e.sessionStart}}function d(){const t=p();return{title:"👥 User Interaction Report",summary:{sessionDuration:Math.round((Date.now()-e.sessionStart)/1e3)+"s",matchCardsClicked:t.interactions.matchCardsClicked,matchDetailsOpened:t.interactions.matchDetailsOpened,totalTabSwitches:t.interactions.totalTabSwitches,totalAPIcalls:t.performance.apiCallTimes.length,avgResponseTime:t.performance.avgResponseTime+"ms",cacheWriteSuccessRate:t.cache.successRate+"%"},tabBreakdown:t.interactions.tabSwitches,apiByType:t.performance.apiCallsByType,performanceMetrics:{avgResponseTime:t.performance.avgResponseTime,maxResponseTime:t.performance.maxResponseTime,minResponseTime:t.performance.minResponseTime}}}function u(t=null){const n=e.performance.apiCallDetails;return t?n.filter(e=>e.type===t||e.type.includes(t)):n}function m(){try{if(-1!==window.location.pathname.indexOf("monitoring-dashboard"))return;d();const t=e.performance.apiCallDetails.slice(0,20),n={type:"user_interactions",metrics:{interactions:e.interactions,performance:{avgResponseTime:e.performance.avgResponseTime,minResponseTime:e.performance.minResponseTime,maxResponseTime:e.performance.maxResponseTime,callCount:e.performance.apiCallTimes.length,callsByType:e.performance.apiCallsByType,recentCalls:t.map(e=>({type:e.type,method:e.method,duration:Math.round(e.duration),status:e.status||null,timestamp:e.timestamp,url:e.url,error:e.error||null}))},cache:{writeSuccessRate:e.cache.writeSuccessRate,writeAttempts:e.cache.writeAttempts,writeSuccesses:e.cache.writeSuccesses},session:{duration:Date.now()-e.sessionStart,startTime:e.sessionStart},webVitals:e.webVitals}},i=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",a=window.LiveScoresAjax&&window.LiveScoresAjax.monitoring_nonce||"",s=new FormData;s.append("action","send_monitoring_metrics"),s.append("nonce",a),s.append("type","user_interactions"),s.append("data",JSON.stringify(n.metrics)),fetch(i,{method:"POST",body:s,keepalive:!0}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);const t=e.headers.get("content-type");if(t&&t.includes("text/html"))throw new Error("Server returned HTML instead of JSON (Cloudflare error page)");return e.json()}).then(e=>{}).catch(e=>{})}catch(e){}}function h(){try{document.querySelectorAll('.live-scores-match, [data-match-id], .match-card, .match-item, [class*="match"]').length,document.addEventListener("click",function(t){let n=t.target.closest(".live-scores-match");n||(n=t.target.closest("[data-match-id]")),n||(n=t.target.closest(".match-card")),n||(n=t.target.closest(".match-item")),n||(n=t.target.closest('[class*="match"]')),n&&!t.target.closest("button")&&(e.interactions.matchCardsClicked++,l("MATCH_CARD_CLICKED"))})}catch(t){}try{n()||(setTimeout(n,1e3),setTimeout(n,3e3),setTimeout(n,5e3),setTimeout(n,1e4))}catch(a){}try{!function(){const e=window.switchTab||window.switchTabTo||function(){};window.switchTab=function(t,n){return n&&(r(n),l("TAB_SWITCHED",{from:t,to:n})),e.apply(this,arguments)},document.addEventListener("click",function(e){var t=e.target.closest('[data-tab], .match-details-tab, [role="tab"], .tab-button');if(t){var n=t.getAttribute("data-tab")||t.getAttribute("data-tab-id")||t.id||t.textContent.toLowerCase().trim();n&&(r(n),l("TAB_CLICKED",{tab:i(n)}))}})}()}catch(s){}try{!function(){const t=window.fetch;window.fetch=function(...n){const i=n[0],a=n[1]||{},s=a&&a.method||"GET",r=performance.now();let p=function(e,t){if(!e)return"UNKNOWN";t=t||{};const n=e.toString();if(n.includes("live_scores")||n.includes("matches"))return"LIVE_SCORES";if(n.includes("incidents")||n.includes("events"))return"INCIDENTS";if(n.includes("lineups")||n.includes("formation"))return"LINEUPS";if(n.includes("statistics")||n.includes("stats"))return"STATISTICS";if(n.includes("standings")||n.includes("table"))return"STANDINGS";if(n.includes("h2h")||n.includes("head"))return"H2H";if(n.includes("streak"))return"STREAKS";if(n.includes("admin-ajax.php")){if(t.body)try{if("undefined"!=typeof FormData&&t.body instanceof FormData){var i=t.body.get("action");if(i){var a=o(i);if(a)return a}}if("string"==typeof t.body&&"{"===t.body.charAt(0)){var s=JSON.parse(t.body);if(s.action){var r=o(s.action);if(r)return r}}if("string"==typeof t.body&&-1!==t.body.indexOf("action=")){var c=t.body.match(/(?:^|&)action=([^&]+)/);if(c){var l=o(c[1]);if(l)return l}}}catch(e){}try{const e=new URL(n,window.location.origin).searchParams.get("action");if(e)return o(e)||(e.includes("live_score")?"LIVE_SCORES":e.includes("incident")?"INCIDENTS":e.includes("statistic")?"STATISTICS":e.includes("lineup")?"LINEUPS":e.includes("standing")?"STANDINGS":e.includes("h2h")?"H2H":e.includes("monitoring")||e.includes("metric")?"MONITORING_API":"AJAX_"+e.toUpperCase())}catch(e){}return"AJAX_UNKNOWN"}if(n.includes("monitoring-api.php")){try{let e=t.body;if("string"==typeof e&&(e=JSON.parse(e)),e&&e.type)return"MONITORING_"+e.type.toUpperCase()}catch(e){}return"MONITORING_API"}if(n.includes("rapidapi.com")||n.includes("api.example.com")||n.includes("api.football")||n.includes("api.sports")){try{const e=new URL(n).hostname;if(e.includes("rapidapi"))return"RAPIDAPI_EXTERNAL";if(e.includes("football")||e.includes("sports"))return"SPORTS_API"}catch(e){}return"EXTERNAL_API"}if(n.includes("/wp-json/")||n.includes("/rest/"))return"WP_REST_API";if(n.match(/\.(js|css|jpg|jpeg|png|gif|svg|woff|woff2|ttf|eot)(\?|$)/i))return"STATIC_ASSET";try{const e=new URL(n,window.location.origin).pathname.toLowerCase();if(e.includes("/api/"))return"API_"+(e.split("/api/")[1]?.split("/")[0]?.toUpperCase()||"API");if(e.includes("/wp-content/"))return"PLUGIN_RESOURCE";if(e.includes("/wp-includes/"))return"WP_CORE_RESOURCE"}catch(e){}return n.length>100?"EXTERNAL_REQUEST":"LOCAL_REQUEST"}(i,a);if("MONITORING_API"===p||"string"==typeof p&&0===p.indexOf("MONITORING_"))return t.apply(this,n);const d=i.toString(),u=d.length>80?d.substring(0,77)+"...":d;return t.apply(this,n).then(t=>{const n=performance.now()-r,i={type:p,url:u,fullUrl:d,duration:n,status:t.status,timestamp:Date.now(),method:s};return e.performance.apiCallTimes.push({type:p,duration:n,status:t.status,timestamp:Date.now(),method:s}),e.performance.apiCallsByType[p]=(e.performance.apiCallsByType[p]||0)+1,e.performance.apiCallDetails.unshift(i),e.performance.apiCallDetails.length>50&&e.performance.apiCallDetails.pop(),c(),l("API_CALL",{type:p,duration:Math.round(n),status:t.status}),t}).catch(t=>{const n=performance.now()-r;throw e.performance.apiCallTimes.push({type:p,duration:n,error:t.message,timestamp:Date.now()}),e.performance.apiCallDetails.unshift({type:p,url:u,fullUrl:d,duration:n,error:t.message,timestamp:Date.now(),method:s}),e.performance.apiCallDetails.length>50&&e.performance.apiCallDetails.pop(),l("API_ERROR",{type:p,error:t.message}),t})},"undefined"!=typeof jQuery&&(jQuery(document).ajaxSend(function(e,t,n){if(!n.data||"string"!=typeof n.data||-1===n.data.indexOf("action=send_monitoring_metrics")){var i="OTHER";if(n.data&&"string"==typeof n.data){var a=n.data.match(/(?:^|&)action=([^&]+)/);a&&(i=o(a[1])||"OTHER")}else n.data&&"object"==typeof n.data&&n.data.action&&(i=o(n.data.action)||"OTHER");if("DEDUP_POLL"!==i&&"MONITORING_API"!==i){var s=n.url||"",r=s.length>80?s.substring(0,77)+"...":s;t._uimStartTime=performance.now(),t._uimType=i,t._uimDisplayUrl=r,t._uimFullUrl=s}}}),jQuery(document).ajaxComplete(function(t,n,i){if(n._uimStartTime){var a=performance.now()-n._uimStartTime,s=n._uimType||"OTHER",r={type:s,url:n._uimDisplayUrl||"",fullUrl:n._uimFullUrl||"",duration:a,status:n.status,timestamp:Date.now(),method:"POST",transport:"jquery"};e.performance.apiCallTimes.push({type:s,duration:a,status:n.status,timestamp:Date.now(),method:"POST",transport:"jquery"}),e.performance.apiCallsByType[s]=(e.performance.apiCallsByType[s]||0)+1,e.performance.apiCallDetails.unshift(r),e.performance.apiCallDetails.length>50&&e.performance.apiCallDetails.pop(),c(),l("API_CALL",{type:s,duration:Math.round(a),status:n.status,transport:"jquery"})}}))}()}catch(p){}try{!function(){const t=window.setCache||function(){},n=window.getCache||function(){};window.setCache=function(n,i,a){e.cache.writeAttempts++;try{const i=t.apply(this,arguments);return e.cache.writeSuccesses++,l("CACHE_WRITE_SUCCESS",{key:n}),i}catch(t){throw e.cache.writeFailures++,l("CACHE_WRITE_FAIL",{key:n,error:t.message}),t}},window.getCache=function(t,i){return e.cache.readAttempts++,l("CACHE_READ",{key:t}),n.apply(this,arguments)}}()}catch(d){}try{!function(){function t(){var t=performance.getEntriesByType&&performance.getEntriesByType("navigation"),n=t&&t.length>0?t[0]:null;if(n&&n.responseStart)e.webVitals.ttfb=Math.round(n.responseStart-n.requestStart),n.domContentLoadedEventEnd&&(e.webVitals.domReady=Math.round(n.domContentLoadedEventEnd-n.startTime)),n.loadEventEnd>0&&(e.webVitals.windowLoad=Math.round(n.loadEventEnd-n.startTime));else if(performance.timing&&performance.timing.responseStart){var i=performance.timing;e.webVitals.ttfb=i.responseStart-i.navigationStart,i.domContentLoadedEventEnd&&(e.webVitals.domReady=i.domContentLoadedEventEnd-i.navigationStart),i.loadEventEnd>0&&(e.webVitals.windowLoad=i.loadEventEnd-i.navigationStart)}}function n(){var t=performance.getEntriesByType&&performance.getEntriesByType("paint");if(t)for(var n=0;n<t.length;n++)"first-contentful-paint"===t[n].name&&(e.webVitals.fcp=Math.round(t[n].startTime))}if("undefined"!=typeof PerformanceObserver)try{new PerformanceObserver(function(t){var n=t.getEntries();n.length>0&&(e.webVitals.lcp=Math.round(n[n.length-1].startTime))}).observe({type:"largest-contentful-paint",buffered:!0})}catch(e){}"complete"===document.readyState?(t(),n()):window.addEventListener("load",function(){setTimeout(function(){t(),n()},100)})}()}catch(u){}try{function h(){setTimeout(m,2e3),window.UserInteractionMonitorInterval=setInterval(m,6e4)}"complete"===document.readyState?h():window.addEventListener("load",h)}catch(f){}try{window.addEventListener("beforeunload",function(){window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&window.LiveScoreApp.Monitoring._resetInProgress||m()})}catch(w){}window.UserInteractionMonitorReady=!0}try{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){h()}):h()}catch(e){}return{getMetrics:p,getReport:d,printReport:function(){d()},getAPICallDetails:u,printAPICallDetails:function(e=null){u(e).length},reset:function(){e.interactions.matchCardsClicked=0,e.interactions.matchDetailsOpened=0,e.interactions.matchDetailsClosed=0,Object.keys(e.interactions.tabSwitches).forEach(t=>{e.interactions.tabSwitches[t]=0}),e.interactions.totalTabSwitches=0,e.performance.apiCallTimes=[],e.performance.apiCallsByType={},e.performance.apiCallDetails=[],e.cache.writeAttempts=0,e.cache.writeSuccesses=0,e.cache.writeFailures=0,e.cache.readAttempts=0,e.webVitals.ttfb=null,e.webVitals.fcp=null,e.webVitals.lcp=null,e.webVitals.domReady=null,e.webVitals.windowLoad=null,e.webVitals.lazySectionLoad=null,e.sessionStart=Date.now()},init:h,sendMetrics:m,debugElementSelectors:function(){[".live-scores-match","[data-match-id]",".match-card",".match-item",'[class*="match"]'].forEach(e=>{document.querySelectorAll(e)}),["[data-tab]",".match-details-tab",'[role="tab"]',".tab-button",'[class*="tab"]'].forEach(e=>{document.querySelectorAll(e)})}}}();try{window.UserInteractionMonitor}catch(e){};
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
"undefined"===typeof window.tdcPostSettings&&(window.tdcPostSettings={tdbTemplateType:"all"});if(window.tdbVue&&"undefined"!==typeof window.tdbVue.router){var eventHub=new CloudLibraryVue;CloudLibraryVue.component("image-links",{template:'\n            <a :class="classes" :href="link">{{text}}</a>\n        ',props:{classes:[],link:"",text:""}});new CloudLibraryVue({el:"#tdb-modal",router:window.tdbVue.router})}
window.tdbVueManager&&"undefined"!==typeof window.tdbVueManager.router&&new CloudLibraryVue({el:"#tdb-modal-website-manager",router:window.tdbVueManager.router});
(function(){function m(a,b,c,d,f,g,h){var e=jQuery(".tdb-"+a+"-templates");e.length&&"undefined"===typeof e.data("tdb-templates")&&("undefined"!==typeof g&&g.call(),tdbGetMobileTemplates(a,b,e),g="","undefined"!==typeof tdcState&&(g=tdcState.isMobileComposer()?"1":""),g={action:"tdb_get_"+a+"_templates",mobile_templates:g,_nonce:window.tdb_globals.wpRestNonce},"cpt_tax"===a?g.data_id=b:g[a+"_id"]=b,jQuery.ajax({type:"POST",url:td_ajax_url,data:g,success:function(g,k,p){e.html("");g=jQuery.parseJSON(g);
k='<div class="tdb-templates-header"><div class="tdb-templates-header-item tdb-templates-header-item-name"><span>Cloud Templates</span></div>'+("undefined"!==typeof d&&!0===d?'<div class="tdb-templates-header-item tdb-templates-header-item-global"><span>Global</span></div>':"")+'<div class="tdb-templates-header-item tdb-templates-header-item-mobile" title="Optional - Create or assign a dedicated Mobile Template"><span>Mobile Template</span></div></div>';var l=p="",m=!1;_.isArray(g)&&g.length?(_.each(g,
function(e,g,h){h="";"true"===e.is_current.toString()&&(h=" tdb-current",m=!0);var k="";g="";switch(a){case "single":k=e.template_title+" - Set template for this post";break;case "category":k=e.template_title+" - Set template for this category";break;case "author":k=e.template_title+" - Set template for this author";break;case "tag":k=e.template_title+" - Set template for this tag";break;case "search":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type",g=
' data-cpt="'+e.cpt.name+'"'):k=e.template_title+" - Set this template for post search results";break;case "woo_product":k=e.template_title+" - Set template for this product";break;case "woo_archive":k=e.template_title+" - Set template for this product archive";break;case "cpt":k=e.template_title+" - Set template for this custom post type";break;case "cpt_tax":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type archive",g=' data-cpt="'+e.cpt.name+'"'):k=e.template_title+
" - Set template for this taxonomy"}h='<div class="tdb-template-el tdb-'+a+"-template-el"+h+'"  data-template-id="'+e.template_id+'"><div class="tdb-template-el-id tdb-'+a+'-template-id">'+e.template_id+'</div><div class="tdb-template-el-title" data-type="'+a+'" data-action="'+c+'" title="'+k+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"'+g+">"+e.template_title+'</div><div class="tdb-template-el-wrap"><div class="tdb-template-el-icon"><div class="tdb-template-el-options"><div title="Rename template" class="tdb-template-el-edit">Rename</div><div title="Duplicate template" class="tdb-template-el-duplicate">Duplicate</div><div title="Delete template" class="tdb-template-el-delete">Delete</div></div></div></div>';
"undefined"!==typeof d&&!0===d&&(k="","undefined"!==typeof f&&""!==f&&(k='data-global-action="'+f+'"'),h+='<div class="tdb-template-el-global tdb-'+a+'-template-global" title="Set as Global Template" data-type="'+a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'" '+k+g+'><input type="checkbox" class="tdb-template-el-global-input tdb-'+a+'-template-global-input" '+(!0===e.is_global?'checked="checked" ':"")+'><label></label><span class="tdb-template-el-global-checked tdb-'+a+'-template-global-checked">Global</span></div>');
h+='<div class="tdb-template-el-mobile-wrap tdb-'+a+'-template-mobile" data-type="'+a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"><span class="tdb-template-el-mobile">'+(""===e.mobile_template_title?"-":'<span class="tdb-template-el-mobile-active">Yes</span>')+'</span><div class="tdb-template-el-mobile-btns" data-mobile-template-id="'+e.mobile_template_id+'" data-template-id="'+e.template_id+'"><div title="Optional - New mobile template" class="'+a+"id-"+e.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-blank tdb-create-mobile-template" data-type="'+
a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"></div><div title="Load mobile template from TagDiv Cloud Library" class="'+a+"id-"+e.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-import tdb-load-mobile-template"></div></div></div>';l+=h+"</div>"}),"undefined"!==typeof d&&!0===d&&(p+='<div class="tdb-template-el tdb-'+a+"-template-el "+(m?"":"tdb-current")+'"><div class="tdb-template-el-id tdb-'+a+'-template-id"></div><div class="tdb-template-el-title" data-type="'+
a+'" data-action="'+c+'" title="Set as Global Template" data-'+a+'-id="'+b+'" data-template-id="">Global Template</div></div>'),e.append(p+k+l)):(e.append(k),e.append('<div class="tdb-templates-desc">No cloud templates. Please import one or more templates from <b>Cloud Library</b>.</div>'));e.data("tdb-templates",!0);"undefined"!==typeof h&&h.call()},error:function(a,b,c){}}))}function n(a,b,c){var d=jQuery(window);d.resize(function(){var f=d.width();a.offset().left+b.width()>f?b.hasClass(c)||b.addClass(c):
b.hasClass(c)&&b.removeClass(c)});d.resize()}jQuery(document).ready(function(){jQuery("#wp-admin-bar-tdb_template_builder_disabled a").click(function(a){a.preventDefault();alert("Please select tagDiv Builder Template from the theme panel or set a default template. The current page/post uses a template that is not editable.")});jQuery("#wp-admin-bar-new-tdb_templates").hide()});jQuery("body").on("click","#wp-admin-bar-tdb_template_load, .tdb-load-mobile-template",function(a){a.preventDefault();var b=
jQuery(this),c=b.attr("class");a="";var d=!1;b.hasClass("tdb-load-mobile-template")&&(d=!0);"undefined"!==typeof c&&(0===c.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=c.split(" ")[0].replace("singleid-",""),d?a.assign_mobile_to_template=b:a.assign_to_post=b):0===c.indexOf("categoryid-")?(a={wp_type:"category",templateType:"Category"},b=c.split(" ")[0].replace("categoryid-",""),d?a.assign_mobile_to_template=b:a.assign_to_category=b):0===c.indexOf("404")?(a={wp_type:"404",templateType:"404"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_404=b):0===c.indexOf("date")?(a={wp_type:"date",templateType:"Date"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_archive=b):0===c.indexOf("search")?(a={wp_type:"search",templateType:"Search"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_search=b,-1!==c.indexOf("cpt-")&&(c=c.split(" ")[1].replace("cpt-",""),a.assign_to_search_cpt=c)):0===c.indexOf("attachment")?(a={wp_type:"attachment",
templateType:"Attachment"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_attachment=b):0===c.indexOf("authorid")?(a={wp_type:"author",templateType:"Author"},b=c.split(" ")[0].replace("authorid-",""),d?a.assign_mobile_to_template=b:a.assign_to_author=b):0===c.indexOf("tagid")?(a={wp_type:"tag",templateType:"Tag"},b=c.split(" ")[0].replace("tagid-",""),d?a.assign_mobile_to_template=b:a.assign_to_tag=b):0===c.indexOf("pageid")?(a={wp_type:"page",templateType:"Pages"},b=c.split(" ")[0].replace("pageid-",
""),d&&(a.assign_mobile_to_template=b)):0===c.indexOf("woo_productid-")?(a={wp_type:"woo_product",templateType:"Woo Product"},b=c.split(" ")[0].replace("woo_productid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===c.indexOf("woo_archiveid-")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=c.split(" ")[0].replace("woo_archiveid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_archive=b):0===c.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_search_archive=b):0===c.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_shop_base=b):0===c.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=c.split(" ")[0].replace("cpt_taxid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt_tax=b):0===c.indexOf("cpt")&&(a={wp_type:"cpt",templateType:"Custom Post Type"},
b=c.split(" ")[0].replace("cptid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt=b),""!==a&&(a.hide_mobile_selector="hide",window.tdbVue.router.push({name:"loadRoute",params:a})))}).on("click",".tdb-create-mobile-template",function(a){var b=jQuery(this),c=b.data("template-id"),d=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===d?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),g=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:c,template_title:a.val(),template_type:d,copyContent:g.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),e=b.closest(".tdb-template-el"),e.length&&(f=e.find(".tdb-template-el-mobile:first"),e.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),f.html('<span class="tdb-template-el-mobile-active">Yes</span>')),
tdbGetMobileTemplates(d,c))},error:function(a,b,c){}})},htmlInfoContent:"Enter the mobile "+("page"===d?"page":"template")+' name: <input id="tdb-new-template-name" type="text" value=""onfocus="(function(e){ jQuery(e.target).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',
textYes:"Create",textNo:"Cancel"})}).on("click","#wp-admin-bar-tdb_template_single > a, #wp-admin-bar-tdb_template_category > a, #wp-admin-bar-tdb_template_404 > a, #wp-admin-bar-tdb_template_date > a, #wp-admin-bar-tdb_template_search > a, #wp-admin-bar-tdb_template_attachment > a, #wp-admin-bar-tdb_template_author > a, #wp-admin-bar-tdb_template_tag > a, #wp-admin-bar-tdb_template_woo_product > a, #wp-admin-bar-tdb_template_woo_archive > a, #wp-admin-bar-tdb_template_woo_shop_base > a, #wp-admin-bar-tdb_template_woo_search_archive > a, #wp-admin-bar-tdb_template_cpt > a, #wp-admin-bar-tdb_template_cpt_tax > a",
function(a){a.preventDefault();var b=jQuery(this),c=b.parent(),d=c.attr("class"),f="",g="",h="",e="";switch(c.attr("id")){case "wp-admin-bar-tdb_template_single":f="single";g="tdb_assign_single_template_to_post";h="tdb_assign_single_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_category":f="category";g="tdb_assign_cat_template_to_cat";h="tdb_assign_cat_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_404":f="404";g="tdb_assign_404_template_global";
h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_date":f="date";g="tdb_assign_date_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_search":f="search";g="tdb_assign_search_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_attachment":f="attachment";g="tdb_assign_attachment_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_author":f="author";g="tdb_assign_author_template_to_author";
h="tdb_assign_author_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_tag":f="tag";g="tdb_assign_tag_template_to_tag";h="tdb_assign_tag_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_product":f="woo_product";g="tdb_assign_woo_product_template_to_product";h="tdb_assign_woo_product_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_archive":f="woo_archive";g="tdb_assign_woo_archive_template_to_tax";h="tdb_assign_woo_archive_template_global";
e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_search_archive":f="woo_search_archive";g="tdb_assign_woo_search_archive_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_woo_shop_base":f="woo_shop_base";g="tdb_assign_woo_shop_base_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_cpt":f="cpt";g="tdb_assign_cpt_template_to_cpt";h="tdb_assign_cpt_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_cpt_tax":f=
"cpt_tax",g="tdb_assign_cpt_tax_template_to_tax",h="tdb_assign_cpt_tax_template_global",e=d.replace("templateid-","")}var l=jQuery(".tdb-"+f+"-templates");l.length?a.currentTarget===this&&jQuery(a.target).parent().attr("id")==="wp-admin-bar-tdb_template_"+f&&(l.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),l=jQuery('<div class="tdb-templates tdb-'+f+'-templates" data-type="'+f+'"></div>'),l.insertAfter(b),l.show());m(f,e,g,
""===h?!1:!0,h,void 0,function(){b.removeClass("tdb-templates-loading");b.addClass("tdb-templates-open");n(b,l,"tdb-templates-align-right")})}).on("click","#wp-admin-bar-tdc_page_mobile_template > a",function(a){a.preventDefault();var b=jQuery(this);a=b.parent().attr("class").replace("pageid-","");var c=jQuery("#tdb-mobile-templates");c.length?(c.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),b.addClass("tdb-templates-open"),
tdbGetMobileTemplates("page",a,b,void 0,function(){b.removeClass("tdb-templates-loading");jQuery("#tdb-mobile-templates").show();n(b,jQuery("#tdb-mobile-templates"),"tdb-mobile-templates-align-right")}))}).on("click","#wp-admin-bar-tdc_create_mobile_page",function(a){var b=jQuery(this).attr("class").split(" ")[0].replace("pageid-","");tdConfirm.modal({caption:"Create Mobile Page",objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),d=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:b,template_title:a.val(),template_type:"page",copyContent:d.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(c,d,h){"undefined"!==typeof jQuery.parseJSON(c).mobile_template_id&&(tdConfirm.close(),c=jQuery("#wp-admin-bar-tdc_page_mobile_template"),c.length&&c.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>'+a.val()),tdbGetMobileTemplates("page",b))},error:function(a,b,c){}})},
htmlInfoContent:'Enter the mobile page name: <input id="tdb-new-template-name" type="text" value="" onfocus="(function(e){ jQuery(e.target).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',textYes:"Create",textNo:"Cancel"})}).on("click",
".tdb-single-template-global label, .tdb-category-template-global label, .tdb-author-template-global label, .tdb-tag-template-global label, .tdb-woo_product-template-global label, .tdb-woo_archive-template-global label, .tdb-cpt-template-global label, .tdb-cpt_tax-template-global label ",function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-template-el-global");var c=a.data("type"),d=a.data("global-action"),f=b.parent().data(c+"-id"),g=b.parent().data("template-id"),h=jQuery(".tdb-templates");
b={action:d,template_id:g,_nonce:window.tdb_globals.wpRestNonce};switch(c){case "single":b.single_id=f;break;case "category":b.category_id=f;break;case "tag":b.tag_id=f;break;case "author":b.author_id=f;break;case "woo_product":b.woo_product_id=f;break;case "woo_archive":b.woo_term_id=f;break;case "cpt":b.cpt_id=f;b.option="single_tpl";break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=f,b.option="archive_tpl"):b.cpt_tax_id=f}jQuery.ajax({type:"POST",url:td_ajax_url,
data:b,success:function(a,b,d){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.global_template_id&&(h.find(".tdb-"+c+'-template-global > input[type="checkbox"]').removeAttr("checked"),h.find(".tdb-"+c+'-template-global[data-template-id="'+g+'"] > input[type="checkbox"]').attr("checked",!0))},error:function(a,b,c){}});return!1}).on("click",".tdb-template-el-title",function(a){a.preventDefault();if(a.target===a.currentTarget){a=jQuery(this);var b=
a.data("action"),c=a.data("type"),d=a.data(c+"-id"),f=a.data("template-id");b={action:b,template_id:f,_nonce:window.tdb_globals.wpRestNonce};"cpt"===c?b.cpt=a.data("cpt-id"):"cpt_tax"===c&&(b.cpt_tax=a.data("cpt_tax-id"));switch(c){case "single":b.single_id=d;break;case "category":b.category_id=d;break;case "author":b.author_id=d;break;case "tag":b.tag_id=d;break;case "woo_product":b.woo_product_id=d;break;case "woo_archive":b.woo_term_id=d;break;case "cpt":b.cpt_id=d;break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="archive_tpl"):b.cpt_tax_id=d;break;case "search":void 0!==a.data("cpt")&&(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="search_tpl")}jQuery.ajax({type:"POST",url:td_ajax_url,data:b,success:function(a,b,d){"undefined"===typeof jQuery.parseJSON(a).reload&&"cpt"!==c&&"cpt_tax"!==c&&"search"!==c||window.location.reload()},error:function(a,b,c){}});return!1}}).on("change",".tdb-template-el-title-input",function(a){a.preventDefault();
a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first");b.data("type");b=c.data("template-id");d.html();jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_change_template_name",template_id:b,template_title:a.val(),_nonce:window.tdb_globals.wpRestNonce},success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.template_id&&(d.html(a.template_title),d.removeData("title"))},error:function(a,b,c){}})}).on("click",".tdb-template-el-edit",
function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-templates");var c=b.closest(".tdb-template-el");b=c.find(".tdb-template-el-title:first");a.data("type");c.data("template-id");c=b.html();"undefined"===typeof b.data("title")&&(a.find(".tdb-template-el-title").each(function(a,b){a=jQuery(b);b=a.data("title");"undefined"!==typeof b&&(a.html(b),a.removeData("title"))}),b.data("title",b.html()),b.html('<input class="tdb-template-el-title-input" type="text" value="'+c+'">'),b.find("input").focus().select())}).on("click",
".tdb-template-el-duplicate",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first"),f=b.data("type");a=c.data("template-id");var g=d.html(),h=d.data(f+"-id"),e=d.data("action"),l="";0<="single category tag author woo_product woo_archive".split(" ").indexOf(f)&&(c=c.find(".tdb-template-el-global:first"),c.length&&(l=c.data("global-action")));tdbApi.run({wpNonce:window.tdb_globals.wpRestNonce,cloudEndPoint:"td-cloud-library/new_template",
post:{postId:a,templateType:f,templateName:g,duplicateTemplate:!0},done:function(a){b.removeData("tdb-templates");m(f,0<="single category tag author woo_product woo_archive cpt".split(" ").indexOf(f)?h:"",e,""===l?!1:!0,l)},error:function(a){console.log("td-cloud-library/new_template(duplicate template) - ERROR",a)}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("keyup",".tdb-template-el-title-input",function(a){27===a.keyCode&&jQuery(this).trigger("change")}).on("click",".tdb-template-el-delete",
function(a){a=jQuery(this);a.closest(".tdb-templates");var b=a.closest(".tdb-template-el");a=b.data("template-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.template_id&&b.remove()},error:function(a,b,f){}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("click",function(a){a=
jQuery(a.target);a.closest("#wp-admin-bar-tdb_template_single").length||a.closest("#wp-admin-bar-tdb_template_category").length||a.closest("#wp-admin-bar-tdb_template_404").length||a.closest("#wp-admin-bar-tdb_template_date").length||a.closest("#wp-admin-bar-tdb_template_search").length||a.closest("#wp-admin-bar-tdb_template_attachment").length||a.closest("#wp-admin-bar-tdb_template_author").length||a.closest("#wp-admin-bar-tdb_template_tag").length||a.closest("#wp-admin-bar-tdb_template_woo_product").length||
a.closest("#wp-admin-bar-tdb_template_woo_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_search_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_shop_base").length||a.closest("#wp-admin-bar-tdb_template_cpt").length||a.closest("#wp-admin-bar-tdb_template_cpt_tax").length||a.closest("#wp-admin-bar-tdc_page_mobile_template").length||(a=jQuery(".tdb-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close"),jQuery(".tdb-template-el-title-input").trigger("change")),
a=jQuery("#tdb-mobile-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close")))}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-el",function(a){var b=jQuery(this),c=jQuery("#tdb-mobile-templates");a=b.data("template-id");var d=b.data("mobile-template-id"),f=c.closest(".tdb-template-el-mobile-btns"),g=b.closest(".tdb-template-el-mobile-wrap"),h=b.closest("#wp-admin-bar-tdc_page_mobile_template");jQuery.ajax({type:"POST",url:td_ajax_url,
data:{action:"tdb_set_mobile_template",template_id:a,mobile_template_id:d,_nonce:window.tdb_globals.wpRestNonce},success:function(a,l,k){a=jQuery.parseJSON(a);_.isObject(a)&&!_.isUndefined(a.result)&&1===a.result&&(f.data("mobile-template-id",d),c.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),c.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+d+'"]').addClass("tdb-current"),g.length&&(a=g.find(".tdb-template-el-mobile:first"),""===d?a.html("-"):a.html('<span class="tdb-template-el-mobile-active">Yes</span>')),
h.length&&(h.find("a:first").html('<span class="td-mob-page-before" style="margin-right:10px;">Mobile page</span>'+b.find(".tdb-template-el-mobile-list-title:first").html()),"No mobile page"===b.find(".tdb-template-el-mobile-list-title:first").html()&&h.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>')))}})}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-edit",function(a){a.stopPropagation()}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-delete",
function(a){a.stopPropagation();a=jQuery(this);var b=a.data("type"),c=a.closest(".tdb-template-el-mobile-list-el"),d=c.data("template-id");a=c.data("mobile-template-id");var f=c.hasClass("tdb-current"),g=jQuery("#tdb-mobile-templates").closest(".tdb-template-el");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,l){"undefined"!==typeof jQuery.parseJSON(a).template_id&&tdbGetMobileTemplates(b,d,void 0,
function(){jQuery("#tdb-mobile-templates").addClass("loading")},function(){jQuery("#tdb-mobile-templates").removeClass("loading");if(f)if("page"===b){var a=jQuery("#wp-admin-bar-tdc_page_mobile_template");a.length&&a.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>No mobile page')}else c.remove(),g.length&&g.find(".tdb-template-el-mobile:first").html("-")})},error:function(a,b,c){}})}).on("mouseenter",".tdb-template-el-mobile-btns",function(a){a=jQuery(this);var b=a.data("mobile-template-id"),
c=a.data("template-id"),d=jQuery("#tdb-mobile-templates");d.find(".tdb-template-el-mobile-list-inner").is(":empty")||(d.appendTo(a).show(),d.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),d.find(".tdb-template-el-mobile-list-el").data("template-id",c),d.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+b+'"]').addClass("tdb-current"))}).on("mouseleave",".tdb-template-el-mobile-btns",function(a){a=jQuery(".tdb-templates");var b=jQuery("#tdb-mobile-templates");b.hide();
b.insertBefore(a);b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current")});jQuery(".tdb-templates");window.tdbGetMobileTemplates=function(a,b,c,d,f,g,h){var e=jQuery("#tdb-mobile-templates",g);e.length||(e=jQuery('<div id="tdb-mobile-templates" class="tdb-template-el-mobile-list"><div class="tdb-template-el-mobile-list-inner"></div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'),
e.hide());"undefined"!==typeof c&&e.insertAfter(c);c={action:"tdb_get_"+a+"_mobile_templates",_nonce:window.tdb_globals.wpRestNonce};c[a+"_id"]=b;"undefined"!==typeof window.tdbLoadDataFromId&&(c.tdbLoadDataFromId=window.tdbLoadDataFromId);"undefined"!==typeof d&&d.call();jQuery.ajax({type:"POST",url:td_ajax_url,data:c,success:function(c,d,g){var k="";g=jQuery.parseJSON(c);c='<li id="wp-admin-bar-tdb_template_load" class="pageid-'+b+' tdb-load-mobile-template tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Load mobile page from TagDiv Cloud Library"></div><span class="tdb-template-el-mobile-list-title">Load mobile page from Cloud Library</span></li><li id="wp-admin-bar-tdc_create_mobile_page" class="pageid-'+
b+' tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Create blank mobile page"></div><span class="tdb-template-el-mobile-list-title">Create blank mobile page</span></li>';if(_.isArray(g)&&g.length){var l=!1,m="template";d="";"page"===a&&(m="page",d=c+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div>');_.each(g,function(c,d,e){d="";_.isUndefined(c.is_current)||(d="tdb-current",l=!0);
k+='<div class="tdb-template-el-mobile-list-el '+d+'" data-mobile-template-id="'+c.template_id+'" data-template-id="'+b+'"><div class="tdb-template-el-mobile-list-title" title="'+c.template_title+'">'+c.template_title+'</div><a class="tdb-template-el-mobile-list-edit" title="Edit mobile '+m+' with Composer" href="'+c.template_url+'" target="_blank"></a><div class="tdb-template-el-mobile-list-delete" title="Delete mobile '+m+'" data-type="'+a+'"></div></div>'});""!==k&&(g="",l||(g="tdb-current",l=
!0),k=d+'<div class="tdb-template-el-mobile-list-el '+g+'" data-mobile-template-id="" data-template-id="'+b+'"><div class="tdb-template-el-mobile-list-title">No mobile '+m+"</div></div>"+k);""!==k&&(e.html('<div class="tdb-template-el-mobile-list-inner">'+k+'</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a>'),
d=e.parent(".tdb-template-el-mobile-btns"),!_.isUndefined(h)&&d.length&&(e.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),e.find(".tdb-template-el-mobile-list-el").data("template-id",b),e.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+h+'"]').addClass("tdb-current")),e.is(":visible")&&d.length?e.show():e.hide())}""===k&&("page"===a?e.html(c+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><div class="tdb-template-el-mobile-list-inner"><div class="tdb-template-el-mobile-list-no-el">No mobile page, please import or create a new mobile page.</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'):
e.html(""));"undefined"!==typeof f&&f.call()}})}})();
jQuery(window).on("load",function(){if("undefined"!==typeof window.tdReadingProgressBar){var m=!1;window.parent===window.top&&"undefined"!==typeof window.name&&"tdc-live-iframe"===window.name&&"undefined"!==typeof window.parent.tdcSidebar&&(m=!0);if(window.self===window.top||m)jQuery(".tdb_single_reading_progress").each(function(){var n=jQuery(this),a=n.data("td-block-uid");n=n.data("bar-position");var b=new tdReadingProgressBar.item;b.blockUid=a;b.barPosition=n;tdReadingProgressBar.addItem(b);m&&
tdReadingProgressBar.createFixedBar(b,0,30)}),m||tdReadingProgressBar.calculateBarsFill()}});