/home/nbcgowuy/kdosheleads.com/wp-content/plugins/getgenie/assets/dist/admin/js/wp-integrations.js
(()=>{var tT=Object.create;var vo=Object.defineProperty;var nT=Object.getOwnPropertyDescriptor;var iT=Object.getOwnPropertyNames;var sT=Object.getPrototypeOf,rT=Object.prototype.hasOwnProperty;var wo=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var O=(n,e)=>()=>(n&&(e=n(n=0)),e);var Re=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),xo=(n,e)=>{for(var t in e)vo(n,t,{get:e[t],enumerable:!0})},jf=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of iT(e))!rT.call(n,s)&&s!==t&&vo(n,s,{get:()=>e[s],enumerable:!(i=nT(e,s))||i.enumerable});return n};var oe=(n,e,t)=>(t=n!=null?tT(sT(n)):{},jf(e||!n||!n.__esModule?vo(t,"default",{value:n,enumerable:!0}):t,n)),Vf=n=>jf(vo({},"__esModule",{value:!0}),n);var Yf=Re((kc,Tc)=>{(function(n,e){typeof wo=="function"&&typeof kc=="object"&&typeof Tc=="object"?Tc.exports=e():typeof define=="function"&&define.amd?define(function(){return e()}):n.pluralize=e()})(kc,function(){var n=[],e=[],t={},i={},s={};function r(g){return typeof g=="string"?new RegExp("^"+g+"$","i"):g}function o(g,p){return g===p?p:g===g.toLowerCase()?p.toLowerCase():g===g.toUpperCase()?p.toUpperCase():g[0]===g[0].toUpperCase()?p.charAt(0).toUpperCase()+p.substr(1).toLowerCase():p.toLowerCase()}function a(g,p){return g.replace(/\$(\d{1,2})/g,function(v,x){return p[x]||""})}function c(g,p){return g.replace(p[0],function(v,x){var _=a(p[1],arguments);return o(v===""?g[x-1]:v,_)})}function d(g,p,v){if(!g.length||t.hasOwnProperty(g))return p;for(var x=v.length;x--;){var _=v[x];if(_[0].test(p))return c(p,_)}return p}function u(g,p,v){return function(x){var _=x.toLowerCase();return p.hasOwnProperty(_)?o(x,_):g.hasOwnProperty(_)?o(x,g[_]):d(_,x,v)}}function f(g,p,v,x){return function(_){var C=_.toLowerCase();return p.hasOwnProperty(C)?!0:g.hasOwnProperty(C)?!1:d(C,C,v)===C}}function y(g,p,v){var x=p===1?y.singular(g):y.plural(g);return(v?p+" ":"")+x}return y.plural=u(s,i,n),y.isPlural=f(s,i,n),y.singular=u(i,s,e),y.isSingular=f(i,s,e),y.addPluralRule=function(g,p){n.push([r(g),p])},y.addSingularRule=function(g,p){e.push([r(g),p])},y.addUncountableRule=function(g){if(typeof g=="string"){t[g.toLowerCase()]=!0;return}y.addPluralRule(g,"$0"),y.addSingularRule(g,"$0")},y.addIrregularRule=function(g,p){p=p.toLowerCase(),g=g.toLowerCase(),s[g]=p,i[p]=g},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(g){return y.addIrregularRule(g[0],g[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(g){return y.addPluralRule(g[0],g[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(g){return y.addSingularRule(g[0],g[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(y.addUncountableRule),y})});var Uf=Re((U5,oT)=>{oT.exports={"105":"i","192":"A","193":"A","194":"A","195":"A","196":"A","197":"A","199":"C","200":"E","201":"E","202":"E","203":"E","204":"I","205":"I","206":"I","207":"I","209":"N","210":"O","211":"O","212":"O","213":"O","214":"O","216":"O","217":"U","218":"U","219":"U","220":"U","221":"Y","224":"a","225":"a","226":"a","227":"a","228":"a","229":"a","231":"c","232":"e","233":"e","234":"e","235":"e","236":"i","237":"i","238":"i","239":"i","241":"n","242":"o","243":"o","244":"o","245":"o","246":"o","248":"o","249":"u","250":"u","251":"u","252":"u","253":"y","255":"y","256":"A","257":"a","258":"A","259":"a","260":"A","261":"a","262":"C","263":"c","264":"C","265":"c","266":"C","267":"c","268":"C","269":"c","270":"D","271":"d","272":"D","273":"d","274":"E","275":"e","276":"E","277":"e","278":"E","279":"e","280":"E","281":"e","282":"E","283":"e","284":"G","285":"g","286":"G","287":"g","288":"G","289":"g","290":"G","291":"g","292":"H","293":"h","294":"H","295":"h","296":"I","297":"i","298":"I","299":"i","300":"I","301":"i","302":"I","303":"i","304":"I","308":"J","309":"j","310":"K","311":"k","313":"L","314":"l","315":"L","316":"l","317":"L","318":"l","319":"L","320":"l","321":"L","322":"l","323":"N","324":"n","325":"N","326":"n","327":"N","328":"n","332":"O","333":"o","334":"O","335":"o","336":"O","337":"o","338":"O","339":"o","340":"R","341":"r","342":"R","343":"r","344":"R","345":"r","346":"S","347":"s","348":"S","349":"s","350":"S","351":"s","352":"S","353":"s","354":"T","355":"t","356":"T","357":"t","358":"T","359":"t","360":"U","361":"u","362":"U","363":"u","364":"U","365":"u","366":"U","367":"u","368":"U","369":"u","370":"U","371":"u","372":"W","373":"w","374":"Y","375":"y","376":"Y","377":"Z","378":"z","379":"Z","380":"z","381":"Z","382":"z","384":"b","385":"B","386":"B","387":"b","390":"O","391":"C","392":"c","393":"D","394":"D","395":"D","396":"d","398":"E","400":"E","401":"F","402":"f","403":"G","407":"I","408":"K","409":"k","410":"l","412":"M","413":"N","414":"n","415":"O","416":"O","417":"o","420":"P","421":"p","422":"R","427":"t","428":"T","429":"t","430":"T","431":"U","432":"u","434":"V","435":"Y","436":"y","437":"Z","438":"z","461":"A","462":"a","463":"I","464":"i","465":"O","466":"o","467":"U","468":"u","477":"e","484":"G","485":"g","486":"G","487":"g","488":"K","489":"k","490":"O","491":"o","500":"G","501":"g","504":"N","505":"n","512":"A","513":"a","514":"A","515":"a","516":"E","517":"e","518":"E","519":"e","520":"I","521":"i","522":"I","523":"i","524":"O","525":"o","526":"O","527":"o","528":"R","529":"r","530":"R","531":"r","532":"U","533":"u","534":"U","535":"u","536":"S","537":"s","538":"T","539":"t","542":"H","543":"h","544":"N","545":"d","548":"Z","549":"z","550":"A","551":"a","552":"E","553":"e","558":"O","559":"o","562":"Y","563":"y","564":"l","565":"n","566":"t","567":"j","570":"A","571":"C","572":"c","573":"L","574":"T","575":"s","576":"z","579":"B","580":"U","581":"V","582":"E","583":"e","584":"J","585":"j","586":"Q","587":"q","588":"R","589":"r","590":"Y","591":"y","592":"a","593":"a","595":"b","596":"o","597":"c","598":"d","599":"d","600":"e","603":"e","604":"e","605":"e","606":"e","607":"j","608":"g","609":"g","610":"g","613":"h","614":"h","616":"i","618":"i","619":"l","620":"l","621":"l","623":"m","624":"m","625":"m","626":"n","627":"n","628":"n","629":"o","633":"r","634":"r","635":"r","636":"r","637":"r","638":"r","639":"r","640":"r","641":"r","642":"s","647":"t","648":"t","649":"u","651":"v","652":"v","653":"w","654":"y","655":"y","656":"z","657":"z","663":"c","665":"b","666":"e","667":"g","668":"h","669":"j","670":"k","671":"l","672":"q","686":"h","688":"h","690":"j","691":"r","692":"r","694":"r","695":"w","696":"y","737":"l","738":"s","739":"x","780":"v","829":"x","851":"x","867":"a","868":"e","869":"i","870":"o","871":"u","872":"c","873":"d","874":"h","875":"m","876":"r","877":"t","878":"v","879":"x","7424":"a","7427":"b","7428":"c","7429":"d","7431":"e","7432":"e","7433":"i","7434":"j","7435":"k","7436":"l","7437":"m","7438":"n","7439":"o","7440":"o","7441":"o","7442":"o","7443":"o","7446":"o","7447":"o","7448":"p","7449":"r","7450":"r","7451":"t","7452":"u","7453":"u","7454":"u","7455":"m","7456":"v","7457":"w","7458":"z","7522":"i","7523":"r","7524":"u","7525":"v","7680":"A","7681":"a","7682":"B","7683":"b","7684":"B","7685":"b","7686":"B","7687":"b","7690":"D","7691":"d","7692":"D","7693":"d","7694":"D","7695":"d","7696":"D","7697":"d","7698":"D","7699":"d","7704":"E","7705":"e","7706":"E","7707":"e","7710":"F","7711":"f","7712":"G","7713":"g","7714":"H","7715":"h","7716":"H","7717":"h","7718":"H","7719":"h","7720":"H","7721":"h","7722":"H","7723":"h","7724":"I","7725":"i","7728":"K","7729":"k","7730":"K","7731":"k","7732":"K","7733":"k","7734":"L","7735":"l","7738":"L","7739":"l","7740":"L","7741":"l","7742":"M","7743":"m","7744":"M","7745":"m","7746":"M","7747":"m","7748":"N","7749":"n","7750":"N","7751":"n","7752":"N","7753":"n","7754":"N","7755":"n","7764":"P","7765":"p","7766":"P","7767":"p","7768":"R","7769":"r","7770":"R","7771":"r","7774":"R","7775":"r","7776":"S","7777":"s","7778":"S","7779":"s","7786":"T","7787":"t","7788":"T","7789":"t","7790":"T","7791":"t","7792":"T","7793":"t","7794":"U","7795":"u","7796":"U","7797":"u","7798":"U","7799":"u","7804":"V","7805":"v","7806":"V","7807":"v","7808":"W","7809":"w","7810":"W","7811":"w","7812":"W","7813":"w","7814":"W","7815":"w","7816":"W","7817":"w","7818":"X","7819":"x","7820":"X","7821":"x","7822":"Y","7823":"y","7824":"Z","7825":"z","7826":"Z","7827":"z","7828":"Z","7829":"z","7835":"s","7840":"A","7841":"a","7842":"A","7843":"a","7864":"E","7865":"e","7866":"E","7867":"e","7868":"E","7869":"e","7880":"I","7881":"i","7882":"I","7883":"i","7884":"O","7885":"o","7886":"O","7887":"o","7908":"U","7909":"u","7910":"U","7911":"u","7922":"Y","7923":"y","7924":"Y","7925":"y","7926":"Y","7927":"y","7928":"Y","7929":"y","8305":"i","8341":"h","8342":"k","8343":"l","8344":"m","8345":"n","8346":"p","8347":"s","8348":"t","8450":"c","8458":"g","8459":"h","8460":"h","8461":"h","8464":"i","8465":"i","8466":"l","8467":"l","8468":"l","8469":"n","8472":"p","8473":"p","8474":"q","8475":"r","8476":"r","8477":"r","8484":"z","8488":"z","8492":"b","8493":"c","8495":"e","8496":"e","8497":"f","8498":"F","8499":"m","8500":"o","8506":"q","8513":"g","8514":"l","8515":"l","8516":"y","8517":"d","8518":"d","8519":"e","8520":"i","8521":"j","8526":"f","8579":"C","8580":"c","8765":"s","8766":"s","8959":"z","8999":"x","9746":"x","9776":"i","9866":"i","10005":"x","10006":"x","10007":"x","10008":"x","10625":"z","10626":"z","11362":"L","11364":"R","11365":"a","11366":"t","11373":"A","11374":"M","11375":"A","11390":"S","11391":"Z","19904":"i","42893":"H","42922":"H","42923":"E","42924":"G","42925":"L","42928":"K","42929":"T","62937":"x"}});var Gf=Re(($f,_o)=>{(function(n,e){typeof define=="function"&&define.amd?define(function(){return e(n,n.document)}):typeof _o<"u"&&_o.exports?_o.exports=e(n,n.document):n.normalize=e(n,n.document)})(typeof window<"u"?window:$f,function(n,e){var t=Uf(),i=null,s,r;function o(c,d){return r=s,s=d||t,i=i&&r===s?i:a(s),c.replace(i,function(u){return s[u.charCodeAt(0)]||u})}function a(c){return new RegExp("["+Object.keys(c).map(function(d){return String.fromCharCode(d)}).join(" ")+"]","g")}return o})});var Ws,Kf=O(()=>{Ws={abalone:4,abare:3,abbruzzese:4,abed:2,aborigine:5,abruzzese:4,acreage:3,adame:3,adieu:2,adobe:3,anemone:4,anyone:3,apache:3,aphrodite:4,apostrophe:4,ariadne:4,cafe:2,calliope:4,catastrophe:4,chile:2,chloe:2,circe:2,coyote:3,daphne:2,epitome:4,eurydice:4,euterpe:3,every:2,everywhere:3,forever:3,gethsemane:4,guacamole:4,hermione:4,hyperbole:4,jesse:2,jukebox:2,karate:3,machete:3,maybe:2,naive:2,newlywed:3,penelope:4,people:2,persephone:4,phoebe:2,pulse:1,queue:1,recipe:3,riverbed:3,sesame:3,shoreline:2,simile:3,snuffleupagus:5,sometimes:2,syncope:3,tamale:3,waterbed:3,wednesday:2,yosemite:4,zoe:2}});function Jf(n){let e=(0,Zf.default)(String(n)).toLowerCase().replace(/['’]/g,"").split(/\b/g),t=-1,i=0;for(;++t<e.length;)i+=mT(e[t].replace(/[^a-z]/g,""));return i}function mT(n){let e=0;if(n.length===0)return e;if(n.length<3)return 1;if(qf.call(Ws,n))return Ws[n];let t=(0,Xf.default)(n,1);if(qf.call(Ws,t))return Ws[t];let i=c(1),s=c(-1);n=n.replace(gT,a(3)).replace(pT,a(2)).replace(fT,a(1));let r=n.split(/[^aeiouy]+/),o=-1;for(;++o<r.length;)r[o]!==""&&e++;return n.replace(aT,s).replace(lT,s),n.replace(cT,i).replace(dT,i).replace(uT,i).replace(hT,i),e||1;function a(d){return u;function u(){return e+=d,""}}function c(d){return u;function u(f){return e+=d,f}}}var Xf,Zf,qf,aT,lT,cT,dT,uT,hT,fT,pT,gT,Qf=O(()=>{Xf=oe(Yf(),1),Zf=oe(Gf(),1);Kf();qf={}.hasOwnProperty,aT=new RegExp(["awe($|d|so)","cia(?:l|$)","tia","cius","cious","[^aeiou]giu","[aeiouy][^aeiouy]ion","iou","sia$","eous$","[oa]gue$",".[^aeiuoycgltdb]{2,}ed$",".ely$","^jua","uai","eau","^busi$","(?:[aeiouy](?:"+["[bcfgklmnprsvwxyz]","ch","dg","g[hn]","lch","l[lv]","mm","nch","n[cgn]","r[bcnsv]","squ","s[chkls]","th"].join("|")+")ed$)","(?:[aeiouy](?:"+["[bdfklmnprstvy]","ch","g[hn]","lch","l[lv]","mm","nch","nn","r[nsv]","squ","s[cklst]","th"].join("|")+")es$)"].join("|"),"g"),lT=new RegExp("[aeiouy](?:"+["[bcdfgklmnprstvyz]","ch","dg","g[hn]","l[lv]","mm","n[cgns]","r[cnsv]","squ","s[cklst]","th"].join("|")+")e$","g"),cT=new RegExp("(?:"+["([^aeiouy])\\1l","[^aeiouy]ie(?:r|s?t)","[aeiouym]bl","eo","ism","asm","thm","dnt","snt","uity","dea","gean","oa","ua","react?","orbed","shred","eings?","[aeiouy]sh?e[rs]"].join("|")+")$","g"),dT=new RegExp(["creat(?!u)","[^gq]ua[^auieo]","[aeiou]{3}","^(?:ia|mc|coa[dglx].)","^re(app|es|im|us)","(th|d)eist"].join("|"),"g"),uT=new RegExp(["[^aeiou]y[ae]","[^l]lien","riet","dien","iu","io","ii","uen","[aeilotu]real","real[aeilotu]","iell","eo[^aeiou]","[aeiou]y[aeiou]"].join("|"),"g"),hT=/[^s]ia/,fT=new RegExp(["^(?:"+["un","fore","ware","none?","out","post","sub","pre","pro","dis","side","some"].join("|")+")","(?:"+["ly","less","some","ful","ers?","ness","cians?","ments?","ettes?","villes?","ships?","sides?","ports?","shires?","[gnst]ion(?:ed|s)?"].join("|")+")$"].join("|"),"g"),pT=new RegExp(["^(?:"+["above","anti","ante","counter","hyper","afore","agri","infra","intra","inter","over","semi","ultra","under","extra","dia","micro","mega","kilo","pico","nano","macro","somer"].join("|")+")","(?:fully|berry|woman|women|edly|union|((?:[bcdfghjklmnpqrstvwxz])|[aeiou])ye?ing)$"].join("|"),"g"),gT=/(creations?|ology|ologist|onomy|onomist)$/g});var ep,yT,bT,vT,wT,xT,_T,ST,So,Oc=O(()=>{Qf();ep=n=>{let e=[],t=n.trim().split(/[\s/]/);for(let i in t){let s=t[i].trim();s.length>0&&s!=="."&&(s.match(/[\w\d][.?!]$/)&&(s=s.replace(/[.?!]/,"")),e.push(s))}return e},yT=n=>(n=n.trim(),n.replace(/([.?!])\s+(?=\w)/g,"$1|").split("|").length),bT=n=>{let e=ep(n),t=0;for(let i in e)t+=vT(e[i]);return t},vT=n=>Jf(n),wT=n=>(n=n.replace(/\s(prof{1,2})\./g," professor"),n=n.replace(/\s(rev)\./g," reverend"),n=n.replace(/\s(rt\.\shon)\./g," right honorary"),n=n.replace(/\s(msgr)\./g," monsignor"),n.replace(/\s(dr|mr|mrs|jr|sr|esq|messrs|mmes)\./g," title")),xT=n=>(n=n.replace(/(\(|\)|;|:|,|-|—)/g,""),n=n.replace(/^\s*[\r\n]/gm,""),n),_T=(n,e,t)=>206.835-1.015*(n/e)-84.6*(t/n),ST=(n,e,t)=>.39*(n/e)+11.8*(t/n)-15.59,So=n=>{if(typeof n!="string")throw new Error("text is not of type string");if(!n.length)throw new Error("text must not be an empty string");n=n.toLowerCase().trim(),n=wT(n),n=xT(n);let t=ep(n).length,i=yT(n),s=bT(n);return{grade_level:parseFloat(ST(t,i,s).toFixed(2)),reading_ease:parseFloat(_T(t,i,s).toFixed(2)),word_count:t,syllable_count:s,sentence_count:i}}});var Ee,Zt=O(()=>{Ee=class{content="";constructor(e=""){this.content=e}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}findAllMatch(e=this.content,t=[]){let i=[];for(let s=0;s<t.length;s++){let r=t[s],o=this.findSingleMatch(e,r);i.push({keyword:r,count:o})}return i}findSingleMatch(e=this.content,t=""){let r=this.escapeRegExp(t).split(" ").join(String.raw`(\s+\w+\s+|\s+)`),o=e?.match(new RegExp(r,"gmi"));return o&&o.length>0?o.length:0}}});var Xn,tp=O(()=>{Oc();Zt();Xn=class{feedbacks={problems:[],results:[],improvements:[]};statistics={word:{},heading:{},focusKeyword:{score:{heading:0,content:0,metaDescription:0,metaTitle:0,imgAltText:0}},secondaryKeywords:{score:{heading:0,content:0}},keywords:{},image:{},internalLink:{},externalLink:{},imgAltText:{},nlp:{}};contentStats={totalScore:0,readabilityScore:0,readabilityTooltipText:""};constructor(e={},t={}){this.recommendation=t,this.url=e.url,this.title=e?.title||"",this.description=e?.description||"";let i=document.createElement("div");i.innerHTML=e.content,this.sourceContent=i.outerHTML}getStat=()=>!this.sourceContent||Object.keys(this.recommendation||{}).length===0?!1:(this.initScoreStats(),this.calculateTotalContent(),{statistics:this.statistics,feedbacks:this.feedbacks,contentStats:this.contentStats});getReadabilityText=e=>{let t=parseInt(e);switch(!0){case t>=90:return"Very easy to read. Easily understood by an average 11-year-old student.";case t>=80:return"Easy to read. Conversational English for consumers.";case t>=70:return"Fairly easy to read.";case t>=60:return"Plain English. Easily understood by 13- to 15-year-old students.";case t>=50:return"Fairly difficult to read.";case t>=30:return"Difficult to read.";case t>=0:return"Very difficult to read. Best understood by university graduates."}};initScoreStats=()=>{let e=So(this.sourceContent.replace(/<[^>]*>/gmi," "));this.contentStats.readabilityScore=Math.max(0,Math.ceil(e?.reading_ease)),this.contentStats.readabilityScore=Math.min(100,this.contentStats.readabilityScore),this.contentStats.readabilityTooltipText=this.getReadabilityText(this.contentStats.readabilityScore);let t=this.recommendation?.HtmlTagUsage,i=t?.wordUsage,s=t?.headingUsage,r=t?.imageUsage,o=t?.internalLinkUsage,a=t?.externalLinkUsage,c=this.sourceContent.match(/<img [^>]*src="[^"]*"[^>]*>/gi)?.length||0,d=e?.word_count||0,u=this.sourceContent.match(/<h[1-6][^>]*>/gm)?.length||0,f=0,y=0,g=this.sourceContent.match(/<a\s+(?:[^>]*?\s+)?href=(["'])(.*?)\1/gmi);g&&this.url&&(f=g.filter(v=>v.includes(this.url)).length,y=g.length-f);let p=[1,1];this.statistics.word={analyzedRecommendation:i||p,count:d,title:"Words"},this.statistics.heading={analyzedRecommendation:s||p,count:u||0,title:"Headings"},this.statistics.image={analyzedRecommendation:r||p,count:c||0,title:"Images"},this.statistics.internalLink={analyzedRecommendation:o||p,count:f||0,title:"Internal Links"},this.statistics.externalLink={analyzedRecommendation:a||p,count:y||0,title:"External Links"},this.statistics.imgAltText={analyzedRecommendation:p,count:0,title:"Img Alt Text"},this.statistics.nlp={analyzedRecommendation:p,count:0,scoreRecommendation:80,title:"NLP"},this.#e(),this.#t()};#e=()=>{let e=["secondaryKeywords","focusKeyword","keywords","imgAltText","nlp"];Object.keys(this.statistics).forEach(t=>{let i=this.statistics[t];if(e.indexOf(t)===-1){this.statistics[t]={...this.statistics[t],score:this.measureScore(i.analyzedRecommendation,i.count,["word","image"].includes(t))};let s=i?.analyzedRecommendation||[0,0],r=i?.count,o=s[0],a=s[1];this[t+"Callback"]&&this[t+"Callback"](r,o,a)}})};wordCallback=(e,t,i)=>{if(e<t){let s=`You need to write at least ${t} words to improve your content quality and the score`;this.addFeedback(s,"problems")}else if(e<=i){let s=`You have successfully covered ${e} number of words, according to the suggested range`;this.addFeedback(s,"results")}};paragraphCallback=(e,t,i)=>{if(e<t){let s=`You need to have at least ${t-e} paragraph in the content`;this.addFeedback(s,"problems")}if(e>=t&&e<=i){let s="Number of paragraphs matches recommendation to get good results";this.addFeedback(s,"results")}};imageCallback=(e,t,i)=>{if(e<t){let s=`Include at least ${t} images inside the content to improve the content score`;this.addFeedback(s,"problems")}else if(e<=i){let s=`You have successfully added ${e} number of images`;this.addFeedback(s,"results")}};internalLinkCallback=(e,t,i)=>{if(e<t){let s="Add internal links to improve the content score";this.addFeedback(s,"improvements")}if(e>t){let s=`You have successfully added ${e} internal link(s) inside your content`;this.addFeedback(s,"results")}};externalLinkCallback=(e,t,i)=>{if(e<1){let s="Add at least 1 external link to improve the content score";this.addFeedback(s,"improvements")}else{let s=`You have successfully added ${e} external link(s) inside your content`;this.addFeedback(s,"results")}};#t=()=>{let e=this.recommendation?.keywords||{},i=new DOMParser().parseFromString(this.sourceContent,"text/html"),s="h1, h2, h3, h4, h5, h6",r=jQuery(i).find(s),o=this.sourceContent.replace(/<h[1-6].*?>(.*?)<\/h[1-6]>/gm,"").replace(/<[^>]*>/gmi," "),a={count:0,score:{heading:0,content:0}};if(Object.keys(e)===0)return;let c=new Ee,d={},u=0,f=0,y=0,g=0,p={};for(let[_,C]of Object.entries(e)){let S=0,T=0,k=[];S=c.findSingleMatch(r.text(),_),T=c.findSingleMatch(o,_);let P=S+T,D={},M={heading:S,content:T,all:P};if(C?.heading&&(D.heading=C?.heading,k.push("heading")),C?.content&&(k.push("content"),D.content=C.content),C?.total&&(D.all=C.total),C?.type==="nlp"&&(g++,P>=C?.total?.[0]&&P<=C?.total?.[1]&&y++),C?.type==="focus"){M.metaTitle=c.findSingleMatch(this.title,_),M.metaDescription=c.findSingleMatch(this.description,_);let N=(this.sourceContent.match(/<img\s+(?:[^>]*?\s+)?alt=(["'])(.*?)\1/gi)||[]).join(" ");M.imgAltText=c.findSingleMatch(N,_),k.push("metaTitle"),D.metaTitle=C?.metaTitle||[1,1],k.push("metaDescription"),D.metaDescription=C?.metaDescription||[1,1],k.push("imgAltText"),D.imgAltText=C?.imgAltText||[1,1];let R={};R.heading=this.measureScore(D?.heading||[1,1],M.heading),R.content=this.measureScore(D?.content||[1,1],M.content),R.metaTitle=this.measureScore(D?.metaTitle,M.metaTitle),R.metaDescription=this.measureScore(D?.metaDescription,M.metaDescription),R.imgAltText=this.measureScore(D.imgAltText,M.imgAltText),this.statistics.imgAltText.analyzedRecommendation=D.imgAltText,this.statistics.imgAltText.count=M.imgAltText,this.statistics.focusKeyword={keyword:_,score:R},p={keyword:_,usage:M,recommendation:D}}else a.count++,D?.heading&&(u++,a.score.heading+=this.measureScore(D.heading,M.heading)),D?.content&&(f++,a.score.content+=this.measureScore(D.content,M.content));d[C?.type]||(d[C?.type]=[]),d[C?.type].push({keyword:_,usage:M,recommendation:D,foundIn:k})}let{usage:v,recommendation:x}=p;x?.heading&&(v.heading<x.heading?.[0]?this.addFeedback(`Include the focus keyword ${x.heading?.[0]} times in the headings to increase the score`,"problems"):v.heading>x.heading?.[1]?this.addFeedback(`You have overused the focus keyword inside the headings. Decrease the keywords to at most
${x.heading?.[1]-v.heading} number of keywords.`,"problems"):this.addFeedback(`You have successfully added the focus keyword ${v.heading} times inside your headings, well within the suggested range`,"results")),x?.content&&(v.content<x.content?.[0]?this.addFeedback(`Include the focus keyword ${x.content?.[0]} times in the content to increase the score`,"problems"):v.content>x.content?.[1]?this.addFeedback(`You have overused the focus keyword inside the content. Decrease the keywords to at most
${x.content?.[1]-v.content} number of keywords.`,"problems"):this.addFeedback(`You have successfully added the focus keyword ${v.content} times inside your content, well within the suggested range`,"results")),x?.metaTitle&&(v.metaTitle<1?this.addFeedback("Include the focus keyword at least once in your meta title to increase the score","problems"):this.addFeedback("You have successfully added the focus keyword in the meta title","results")),x?.metaDescription&&(v.metaDescription<1?this.addFeedback("Include the focus keyword at least once in your meta description to increase the score","problems"):this.addFeedback("You have successfully added the focus keyword in the meta description","results")),this.statistics.keywords=d,this.statistics.secondaryKeywords={count:a.count,score:{heading:Math.ceil(a.score.heading/u),content:Math.ceil(a.score.content/f)}},this.statistics.nlp.count=isNaN(y/g)||g==0?0:Math.ceil(y/g*100),this.statistics.nlp.count<this.statistics.nlp?.scoreRecommendation,this.addFeedback("Please utilize more NLP keywords according to the recommended usage to improve your content quality.","improvements")};addFeedback=(e,t)=>{if(!e||!t||!this.feedbacks?.[t])return!1;this.feedbacks[t].includes(e)||this.feedbacks[t].push(e)};calculateTotalContent=()=>{let e={word:15,image:10,internalLink:5,externalLink:2,focusKeywordInAltText:3,focusKeywordInMetaTitle:5,focusKeywordInMetaDescription:5,focusKeywordInHeading:10,focusKeywordInContent:12,secondaryKeywordsInHeading:10,secondaryKeywordsInContent:23},t={word:this.statistics.word.score,image:this.statistics.image.score,internalLink:this.statistics.internalLink.score,externalLink:this.statistics.externalLink.score,focusKeywordInAltText:this.statistics.focusKeyword.score.imgAltText,focusKeywordInMetaTitle:this.statistics.focusKeyword.score.metaTitle,focusKeywordInMetaDescription:this.statistics.focusKeyword.score.metaDescription,focusKeywordInHeading:this.statistics.focusKeyword.score.heading,focusKeywordInContent:this.statistics.focusKeyword.score.content,secondaryKeywordsInHeading:this.statistics.secondaryKeywords.score.heading,secondaryKeywordsInContent:this.statistics.secondaryKeywords.score.content},i=0;for(let[s,r]of Object.entries(e))i+=(t[s]||0)/100*r;this.contentStats.totalScore=Math.min(100,Math.ceil(i))};measureScore=(e,t=0,i=!1)=>{if(!e||e?.length!==2)return 0;let s=e[0]||0,r=e[1]||0,o=100;if(r===0&&t>=0)return 100;if(t<=r)o=t/(r*.8)*100;else if(t>r)if(i)o=100;else{let a=t/r;o=Math.abs(100-a)}return Math.min(100,o)}}});var zi={};xo(zi,{clearHistoryUrl:()=>kT,competitorData:()=>AT,contentFeedback:()=>HT,continueWriting:()=>IT,createHistoryUrl:()=>ip,expandOutline:()=>FT,filterNlpKeywordsUrl:()=>NT,genieChat:()=>KT,genieChatClear:()=>ZT,genieChatList:()=>XT,genieChatSave:()=>qT,genieImage:()=>$T,genieImageSave:()=>GT,genieMode:()=>BT,getLicenseToken:()=>jT,historyData:()=>CT,keywordsData:()=>RT,limitUsage:()=>YT,nlpKeywords:()=>iO,nlpKeywordsUrl:()=>PT,oneClickBlog:()=>zT,outlines:()=>MT,plagiarismData:()=>LT,relatedKeywords:()=>nO,removeLicenseToken:()=>VT,semanticKeywords:()=>sO,storeApiUrl:()=>WT,subscriptionUpdateUrl:()=>UT,topicalMap:()=>rO,updateUsageUrl:()=>TT,webviewDataCreate:()=>JT,webviewDataList:()=>eO,webviewDeletePost:()=>QT,webviewGetBlogWizardData:()=>tO,writeIntro:()=>DT,writeTemplates:()=>OT,writeTitle:()=>ET});var Be,Fe,np,CT,ip,kT,TT,OT,DT,ET,MT,PT,NT,RT,AT,LT,IT,FT,BT,zT,HT,WT,jT,VT,YT,UT,$T,GT,KT,qT,XT,ZT,JT,QT,eO,tO,nO,iO,sO,rO,sp=O(()=>{Be=window.getGenie.config,Fe=Be.parserApi,np=Be.licenseApi,CT=Be.historyApi+"list",ip=Be.historyApi+"create",kT=Be.historyApi+"clear",TT=Be.baseApi+"user_usage_log",OT=Fe+"writer-default/generate-templates-content",DT=Fe+"writer-wizard/generate-intro",ET=Fe+"writer-wizard/generate-title",MT=Fe+"writer-wizard/generate-outline",PT=Fe+"writer-wizard/keyword-cluster",NT=Fe+"writer-wizard/filter-nlp-keyword",RT=Fe+"writer-wizard/keyword-doctor",AT=Fe+"writer-wizard/serp-data",LT=Fe+"writer-wizard/plagiarism-checker",IT=Fe+"advanced-writing/continue-writing",FT=Fe+"advanced-writing/outline-expand",BT=Fe+"advanced-writing/genie-mode",zT=Fe+"writer-wizard/generate-one-click-blog",HT=Be.feedbackApi,WT=Be.storeApi+window.getGenie.blogWizardData?.post_id,jT=np+"get-token",VT=np+"remove-token",YT=Be.usageLimitStatsApi,UT=Be.subscriptionUpgradeUrlApi,$T=Fe+"genie-image/generate-image",GT=Be.baseApi+"genie-image/upload",KT=Fe+"chat/default",qT=Be.genieChatApi+"create",XT=Be.genieChatApi+"list",ZT=Be.genieChatApi+"clear",JT=Be.webviewBaseApi+"save",QT=Be.webviewBaseApi+"delete",eO=Be.webviewBaseApi+"list",tO=Be.webviewBaseApi+"doc_meta",nO=Fe+"writer-wizard/related-keywords",iO=Fe+"writer-wizard/nlp-keywords",sO=Fe+"writer-wizard/semantic-keywords",rO=Fe+"writer-wizard/topical-map"});var tF,rp=O(()=>{({notification:tF}=window.antd)});var sF,op=O(()=>{rp();({Modal:sF}=window.antd)});var Dc=O(()=>{sp();op()});var ap=Re((Ec,Hi)=>{(function(n,e){typeof Ec=="object"&&typeof Hi<"u"?Hi.exports=e():typeof define=="function"&&define.amd?define(e):n.moment=e()})(Ec,function(){"use strict";var n;function e(){return n.apply(null,arguments)}function t(l){n=l}function i(l){return l instanceof Array||Object.prototype.toString.call(l)==="[object Array]"}function s(l){return l!=null&&Object.prototype.toString.call(l)==="[object Object]"}function r(l,h){return Object.prototype.hasOwnProperty.call(l,h)}function o(l){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(l).length===0;var h;for(h in l)if(r(l,h))return!1;return!0}function a(l){return l===void 0}function c(l){return typeof l=="number"||Object.prototype.toString.call(l)==="[object Number]"}function d(l){return l instanceof Date||Object.prototype.toString.call(l)==="[object Date]"}function u(l,h){var m=[],b,w=l.length;for(b=0;b<w;++b)m.push(h(l[b],b));return m}function f(l,h){for(var m in h)r(h,m)&&(l[m]=h[m]);return r(h,"toString")&&(l.toString=h.toString),r(h,"valueOf")&&(l.valueOf=h.valueOf),l}function y(l,h,m,b){return wf(l,h,m,b,!0).utc()}function g(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function p(l){return l._pf==null&&(l._pf=g()),l._pf}var v;Array.prototype.some?v=Array.prototype.some:v=function(l){var h=Object(this),m=h.length>>>0,b;for(b=0;b<m;b++)if(b in h&&l.call(this,h[b],b,h))return!0;return!1};function x(l){if(l._isValid==null){var h=p(l),m=v.call(h.parsedDateParts,function(w){return w!=null}),b=!isNaN(l._d.getTime())&&h.overflow<0&&!h.empty&&!h.invalidEra&&!h.invalidMonth&&!h.invalidWeekday&&!h.weekdayMismatch&&!h.nullInput&&!h.invalidFormat&&!h.userInvalidated&&(!h.meridiem||h.meridiem&&m);if(l._strict&&(b=b&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(l))l._isValid=b;else return b}return l._isValid}function _(l){var h=y(NaN);return l!=null?f(p(h),l):p(h).userInvalidated=!0,h}var C=e.momentProperties=[],S=!1;function T(l,h){var m,b,w,E=C.length;if(a(h._isAMomentObject)||(l._isAMomentObject=h._isAMomentObject),a(h._i)||(l._i=h._i),a(h._f)||(l._f=h._f),a(h._l)||(l._l=h._l),a(h._strict)||(l._strict=h._strict),a(h._tzm)||(l._tzm=h._tzm),a(h._isUTC)||(l._isUTC=h._isUTC),a(h._offset)||(l._offset=h._offset),a(h._pf)||(l._pf=p(h)),a(h._locale)||(l._locale=h._locale),E>0)for(m=0;m<E;m++)b=C[m],w=h[b],a(w)||(l[b]=w);return l}function k(l){T(this,l),this._d=new Date(l._d!=null?l._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),S===!1&&(S=!0,e.updateOffset(this),S=!1)}function P(l){return l instanceof k||l!=null&&l._isAMomentObject!=null}function D(l){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+l)}function M(l,h){var m=!0;return f(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,l),m){var b=[],w,E,A,Z=arguments.length;for(E=0;E<Z;E++){if(w="",typeof arguments[E]=="object"){w+=`
[`+E+"] ";for(A in arguments[0])r(arguments[0],A)&&(w+=A+": "+arguments[0][A]+", ");w=w.slice(0,-2)}else w=arguments[E];b.push(w)}D(l+`
Arguments: `+Array.prototype.slice.call(b).join("")+`
`+new Error().stack),m=!1}return h.apply(this,arguments)},h)}var N={};function R(l,h){e.deprecationHandler!=null&&e.deprecationHandler(l,h),N[l]||(D(h),N[l]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function L(l){return typeof Function<"u"&&l instanceof Function||Object.prototype.toString.call(l)==="[object Function]"}function B(l){var h,m;for(m in l)r(l,m)&&(h=l[m],L(h)?this[m]=h:this["_"+m]=h);this._config=l,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function W(l,h){var m=f({},l),b;for(b in h)r(h,b)&&(s(l[b])&&s(h[b])?(m[b]={},f(m[b],l[b]),f(m[b],h[b])):h[b]!=null?m[b]=h[b]:delete m[b]);for(b in l)r(l,b)&&!r(h,b)&&s(l[b])&&(m[b]=f({},m[b]));return m}function I(l){l!=null&&this.set(l)}var F;Object.keys?F=Object.keys:F=function(l){var h,m=[];for(h in l)r(l,h)&&m.push(h);return m};var j={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function V(l,h,m){var b=this._calendar[l]||this._calendar.sameElse;return L(b)?b.call(h,m):b}function q(l,h,m){var b=""+Math.abs(l),w=h-b.length,E=l>=0;return(E?m?"+":"":"-")+Math.pow(10,Math.max(0,w)).toString().substr(1)+b}var $=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,K=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,U={},G={};function z(l,h,m,b){var w=b;typeof b=="string"&&(w=function(){return this[b]()}),l&&(G[l]=w),h&&(G[h[0]]=function(){return q(w.apply(this,arguments),h[1],h[2])}),m&&(G[m]=function(){return this.localeData().ordinal(w.apply(this,arguments),l)})}function de(l){return l.match(/\[[\s\S]/)?l.replace(/^\[|\]$/g,""):l.replace(/\\/g,"")}function be(l){var h=l.match($),m,b;for(m=0,b=h.length;m<b;m++)G[h[m]]?h[m]=G[h[m]]:h[m]=de(h[m]);return function(w){var E="",A;for(A=0;A<b;A++)E+=L(h[A])?h[A].call(w,l):h[A];return E}}function ve(l,h){return l.isValid()?(h=Ve(h,l.localeData()),U[h]=U[h]||be(h),U[h](l)):l.localeData().invalidDate()}function Ve(l,h){var m=5;function b(w){return h.longDateFormat(w)||w}for(K.lastIndex=0;m>=0&&K.test(l);)l=l.replace(K,b),K.lastIndex=0,m-=1;return l}var bn={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Pi(l){var h=this._longDateFormat[l],m=this._longDateFormat[l.toUpperCase()];return h||!m?h:(this._longDateFormat[l]=m.match($).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[l])}var Zr="Invalid date";function uS(){return this._invalidDate}var hS="%d",fS=/\d{1,2}/;function pS(l){return this._ordinal.replace("%d",l)}var gS={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function mS(l,h,m,b){var w=this._relativeTime[m];return L(w)?w(l,h,m,b):w.replace(/%d/i,l)}function yS(l,h){var m=this._relativeTime[l>0?"future":"past"];return L(m)?m(h):m.replace(/%s/i,h)}var Ns={};function Ue(l,h){var m=l.toLowerCase();Ns[m]=Ns[m+"s"]=Ns[h]=l}function gt(l){return typeof l=="string"?Ns[l]||Ns[l.toLowerCase()]:void 0}function sc(l){var h={},m,b;for(b in l)r(l,b)&&(m=gt(b),m&&(h[m]=l[b]));return h}var Jh={};function $e(l,h){Jh[l]=h}function bS(l){var h=[],m;for(m in l)r(l,m)&&h.push({unit:m,priority:Jh[m]});return h.sort(function(b,w){return b.priority-w.priority}),h}function Jr(l){return l%4===0&&l%100!==0||l%400===0}function mt(l){return l<0?Math.ceil(l)||0:Math.floor(l)}function ne(l){var h=+l,m=0;return h!==0&&isFinite(h)&&(m=mt(h)),m}function Ni(l,h){return function(m){return m!=null?(Qh(this,l,m),e.updateOffset(this,h),this):Qr(this,l)}}function Qr(l,h){return l.isValid()?l._d["get"+(l._isUTC?"UTC":"")+h]():NaN}function Qh(l,h,m){l.isValid()&&!isNaN(m)&&(h==="FullYear"&&Jr(l.year())&&l.month()===1&&l.date()===29?(m=ne(m),l._d["set"+(l._isUTC?"UTC":"")+h](m,l.month(),oo(m,l.month()))):l._d["set"+(l._isUTC?"UTC":"")+h](m))}function vS(l){return l=gt(l),L(this[l])?this[l]():this}function wS(l,h){if(typeof l=="object"){l=sc(l);var m=bS(l),b,w=m.length;for(b=0;b<w;b++)this[m[b].unit](l[m[b].unit])}else if(l=gt(l),L(this[l]))return this[l](h);return this}var ef=/\d/,st=/\d\d/,tf=/\d{3}/,rc=/\d{4}/,eo=/[+-]?\d{6}/,Se=/\d\d?/,nf=/\d\d\d\d?/,sf=/\d\d\d\d\d\d?/,to=/\d{1,3}/,oc=/\d{1,4}/,no=/[+-]?\d{1,6}/,Ri=/\d+/,io=/[+-]?\d+/,xS=/Z|[+-]\d\d:?\d\d/gi,so=/Z|[+-]\d\d(?::?\d\d)?/gi,_S=/[+-]?\d+(\.\d{1,3})?/,Rs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ro;ro={};function Y(l,h,m){ro[l]=L(h)?h:function(b,w){return b&&m?m:h}}function SS(l,h){return r(ro,l)?ro[l](h._strict,h._locale):new RegExp(CS(l))}function CS(l){return rt(l.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,m,b,w,E){return m||b||w||E}))}function rt(l){return l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ac={};function ge(l,h){var m,b=h,w;for(typeof l=="string"&&(l=[l]),c(h)&&(b=function(E,A){A[h]=ne(E)}),w=l.length,m=0;m<w;m++)ac[l[m]]=b}function As(l,h){ge(l,function(m,b,w,E){w._w=w._w||{},h(m,w._w,w,E)})}function kS(l,h,m){h!=null&&r(ac,l)&&ac[l](h,m._a,m,l)}var Ge=0,Vt=1,Rt=2,Ie=3,Tt=4,Yt=5,Gn=6,TS=7,OS=8;function DS(l,h){return(l%h+h)%h}var Ne;Array.prototype.indexOf?Ne=Array.prototype.indexOf:Ne=function(l){var h;for(h=0;h<this.length;++h)if(this[h]===l)return h;return-1};function oo(l,h){if(isNaN(l)||isNaN(h))return NaN;var m=DS(h,12);return l+=(h-m)/12,m===1?Jr(l)?29:28:31-m%7%2}z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(l){return this.localeData().monthsShort(this,l)}),z("MMMM",0,0,function(l){return this.localeData().months(this,l)}),Ue("month","M"),$e("month",8),Y("M",Se),Y("MM",Se,st),Y("MMM",function(l,h){return h.monthsShortRegex(l)}),Y("MMMM",function(l,h){return h.monthsRegex(l)}),ge(["M","MM"],function(l,h){h[Vt]=ne(l)-1}),ge(["MMM","MMMM"],function(l,h,m,b){var w=m._locale.monthsParse(l,b,m._strict);w!=null?h[Vt]=w:p(m).invalidMonth=l});var ES="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rf="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),of=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,MS=Rs,PS=Rs;function NS(l,h){return l?i(this._months)?this._months[l.month()]:this._months[(this._months.isFormat||of).test(h)?"format":"standalone"][l.month()]:i(this._months)?this._months:this._months.standalone}function RS(l,h){return l?i(this._monthsShort)?this._monthsShort[l.month()]:this._monthsShort[of.test(h)?"format":"standalone"][l.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function AS(l,h,m){var b,w,E,A=l.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)E=y([2e3,b]),this._shortMonthsParse[b]=this.monthsShort(E,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months(E,"").toLocaleLowerCase();return m?h==="MMM"?(w=Ne.call(this._shortMonthsParse,A),w!==-1?w:null):(w=Ne.call(this._longMonthsParse,A),w!==-1?w:null):h==="MMM"?(w=Ne.call(this._shortMonthsParse,A),w!==-1?w:(w=Ne.call(this._longMonthsParse,A),w!==-1?w:null)):(w=Ne.call(this._longMonthsParse,A),w!==-1?w:(w=Ne.call(this._shortMonthsParse,A),w!==-1?w:null))}function LS(l,h,m){var b,w,E;if(this._monthsParseExact)return AS.call(this,l,h,m);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(w=y([2e3,b]),m&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(w,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(w,"").replace(".","")+"$","i")),!m&&!this._monthsParse[b]&&(E="^"+this.months(w,"")+"|^"+this.monthsShort(w,""),this._monthsParse[b]=new RegExp(E.replace(".",""),"i")),m&&h==="MMMM"&&this._longMonthsParse[b].test(l))return b;if(m&&h==="MMM"&&this._shortMonthsParse[b].test(l))return b;if(!m&&this._monthsParse[b].test(l))return b}}function af(l,h){var m;if(!l.isValid())return l;if(typeof h=="string"){if(/^\d+$/.test(h))h=ne(h);else if(h=l.localeData().monthsParse(h),!c(h))return l}return m=Math.min(l.date(),oo(l.year(),h)),l._d["set"+(l._isUTC?"UTC":"")+"Month"](h,m),l}function lf(l){return l!=null?(af(this,l),e.updateOffset(this,!0),this):Qr(this,"Month")}function IS(){return oo(this.year(),this.month())}function FS(l){return this._monthsParseExact?(r(this,"_monthsRegex")||cf.call(this),l?this._monthsShortStrictRegex:this._monthsShortRegex):(r(this,"_monthsShortRegex")||(this._monthsShortRegex=MS),this._monthsShortStrictRegex&&l?this._monthsShortStrictRegex:this._monthsShortRegex)}function BS(l){return this._monthsParseExact?(r(this,"_monthsRegex")||cf.call(this),l?this._monthsStrictRegex:this._monthsRegex):(r(this,"_monthsRegex")||(this._monthsRegex=PS),this._monthsStrictRegex&&l?this._monthsStrictRegex:this._monthsRegex)}function cf(){function l(A,Z){return Z.length-A.length}var h=[],m=[],b=[],w,E;for(w=0;w<12;w++)E=y([2e3,w]),h.push(this.monthsShort(E,"")),m.push(this.months(E,"")),b.push(this.months(E,"")),b.push(this.monthsShort(E,""));for(h.sort(l),m.sort(l),b.sort(l),w=0;w<12;w++)h[w]=rt(h[w]),m[w]=rt(m[w]);for(w=0;w<24;w++)b[w]=rt(b[w]);this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+m.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}z("Y",0,0,function(){var l=this.year();return l<=9999?q(l,4):"+"+l}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),Ue("year","y"),$e("year",1),Y("Y",io),Y("YY",Se,st),Y("YYYY",oc,rc),Y("YYYYY",no,eo),Y("YYYYYY",no,eo),ge(["YYYYY","YYYYYY"],Ge),ge("YYYY",function(l,h){h[Ge]=l.length===2?e.parseTwoDigitYear(l):ne(l)}),ge("YY",function(l,h){h[Ge]=e.parseTwoDigitYear(l)}),ge("Y",function(l,h){h[Ge]=parseInt(l,10)});function Ls(l){return Jr(l)?366:365}e.parseTwoDigitYear=function(l){return ne(l)+(ne(l)>68?1900:2e3)};var df=Ni("FullYear",!0);function zS(){return Jr(this.year())}function HS(l,h,m,b,w,E,A){var Z;return l<100&&l>=0?(Z=new Date(l+400,h,m,b,w,E,A),isFinite(Z.getFullYear())&&Z.setFullYear(l)):Z=new Date(l,h,m,b,w,E,A),Z}function Is(l){var h,m;return l<100&&l>=0?(m=Array.prototype.slice.call(arguments),m[0]=l+400,h=new Date(Date.UTC.apply(null,m)),isFinite(h.getUTCFullYear())&&h.setUTCFullYear(l)):h=new Date(Date.UTC.apply(null,arguments)),h}function ao(l,h,m){var b=7+h-m,w=(7+Is(l,0,b).getUTCDay()-h)%7;return-w+b-1}function uf(l,h,m,b,w){var E=(7+m-b)%7,A=ao(l,b,w),Z=1+7*(h-1)+E+A,te,me;return Z<=0?(te=l-1,me=Ls(te)+Z):Z>Ls(l)?(te=l+1,me=Z-Ls(l)):(te=l,me=Z),{year:te,dayOfYear:me}}function Fs(l,h,m){var b=ao(l.year(),h,m),w=Math.floor((l.dayOfYear()-b-1)/7)+1,E,A;return w<1?(A=l.year()-1,E=w+Ut(A,h,m)):w>Ut(l.year(),h,m)?(E=w-Ut(l.year(),h,m),A=l.year()+1):(A=l.year(),E=w),{week:E,year:A}}function Ut(l,h,m){var b=ao(l,h,m),w=ao(l+1,h,m);return(Ls(l)-b+w)/7}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),Ue("week","w"),Ue("isoWeek","W"),$e("week",5),$e("isoWeek",5),Y("w",Se),Y("ww",Se,st),Y("W",Se),Y("WW",Se,st),As(["w","ww","W","WW"],function(l,h,m,b){h[b.substr(0,1)]=ne(l)});function WS(l){return Fs(l,this._week.dow,this._week.doy).week}var jS={dow:0,doy:6};function VS(){return this._week.dow}function YS(){return this._week.doy}function US(l){var h=this.localeData().week(this);return l==null?h:this.add((l-h)*7,"d")}function $S(l){var h=Fs(this,1,4).week;return l==null?h:this.add((l-h)*7,"d")}z("d",0,"do","day"),z("dd",0,0,function(l){return this.localeData().weekdaysMin(this,l)}),z("ddd",0,0,function(l){return this.localeData().weekdaysShort(this,l)}),z("dddd",0,0,function(l){return this.localeData().weekdays(this,l)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),Ue("day","d"),Ue("weekday","e"),Ue("isoWeekday","E"),$e("day",11),$e("weekday",11),$e("isoWeekday",11),Y("d",Se),Y("e",Se),Y("E",Se),Y("dd",function(l,h){return h.weekdaysMinRegex(l)}),Y("ddd",function(l,h){return h.weekdaysShortRegex(l)}),Y("dddd",function(l,h){return h.weekdaysRegex(l)}),As(["dd","ddd","dddd"],function(l,h,m,b){var w=m._locale.weekdaysParse(l,b,m._strict);w!=null?h.d=w:p(m).invalidWeekday=l}),As(["d","e","E"],function(l,h,m,b){h[b]=ne(l)});function GS(l,h){return typeof l!="string"?l:isNaN(l)?(l=h.weekdaysParse(l),typeof l=="number"?l:null):parseInt(l,10)}function KS(l,h){return typeof l=="string"?h.weekdaysParse(l)%7||7:isNaN(l)?null:l}function lc(l,h){return l.slice(h,7).concat(l.slice(0,h))}var qS="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),hf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),XS="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ZS=Rs,JS=Rs,QS=Rs;function eC(l,h){var m=i(this._weekdays)?this._weekdays:this._weekdays[l&&l!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return l===!0?lc(m,this._week.dow):l?m[l.day()]:m}function tC(l){return l===!0?lc(this._weekdaysShort,this._week.dow):l?this._weekdaysShort[l.day()]:this._weekdaysShort}function nC(l){return l===!0?lc(this._weekdaysMin,this._week.dow):l?this._weekdaysMin[l.day()]:this._weekdaysMin}function iC(l,h,m){var b,w,E,A=l.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)E=y([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin(E,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort(E,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays(E,"").toLocaleLowerCase();return m?h==="dddd"?(w=Ne.call(this._weekdaysParse,A),w!==-1?w:null):h==="ddd"?(w=Ne.call(this._shortWeekdaysParse,A),w!==-1?w:null):(w=Ne.call(this._minWeekdaysParse,A),w!==-1?w:null):h==="dddd"?(w=Ne.call(this._weekdaysParse,A),w!==-1||(w=Ne.call(this._shortWeekdaysParse,A),w!==-1)?w:(w=Ne.call(this._minWeekdaysParse,A),w!==-1?w:null)):h==="ddd"?(w=Ne.call(this._shortWeekdaysParse,A),w!==-1||(w=Ne.call(this._weekdaysParse,A),w!==-1)?w:(w=Ne.call(this._minWeekdaysParse,A),w!==-1?w:null)):(w=Ne.call(this._minWeekdaysParse,A),w!==-1||(w=Ne.call(this._weekdaysParse,A),w!==-1)?w:(w=Ne.call(this._shortWeekdaysParse,A),w!==-1?w:null))}function sC(l,h,m){var b,w,E;if(this._weekdaysParseExact)return iC.call(this,l,h,m);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(w=y([2e3,1]).day(b),m&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(w,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(w,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(w,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||(E="^"+this.weekdays(w,"")+"|^"+this.weekdaysShort(w,"")+"|^"+this.weekdaysMin(w,""),this._weekdaysParse[b]=new RegExp(E.replace(".",""),"i")),m&&h==="dddd"&&this._fullWeekdaysParse[b].test(l))return b;if(m&&h==="ddd"&&this._shortWeekdaysParse[b].test(l))return b;if(m&&h==="dd"&&this._minWeekdaysParse[b].test(l))return b;if(!m&&this._weekdaysParse[b].test(l))return b}}function rC(l){if(!this.isValid())return l!=null?this:NaN;var h=this._isUTC?this._d.getUTCDay():this._d.getDay();return l!=null?(l=GS(l,this.localeData()),this.add(l-h,"d")):h}function oC(l){if(!this.isValid())return l!=null?this:NaN;var h=(this.day()+7-this.localeData()._week.dow)%7;return l==null?h:this.add(l-h,"d")}function aC(l){if(!this.isValid())return l!=null?this:NaN;if(l!=null){var h=KS(l,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function lC(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||cc.call(this),l?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=ZS),this._weekdaysStrictRegex&&l?this._weekdaysStrictRegex:this._weekdaysRegex)}function cC(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||cc.call(this),l?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=JS),this._weekdaysShortStrictRegex&&l?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function dC(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||cc.call(this),l?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=QS),this._weekdaysMinStrictRegex&&l?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cc(){function l(Xe,Xt){return Xt.length-Xe.length}var h=[],m=[],b=[],w=[],E,A,Z,te,me;for(E=0;E<7;E++)A=y([2e3,1]).day(E),Z=rt(this.weekdaysMin(A,"")),te=rt(this.weekdaysShort(A,"")),me=rt(this.weekdays(A,"")),h.push(Z),m.push(te),b.push(me),w.push(Z),w.push(te),w.push(me);h.sort(l),m.sort(l),b.sort(l),w.sort(l),this._weekdaysRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function dc(){return this.hours()%12||12}function uC(){return this.hours()||24}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,dc),z("k",["kk",2],0,uC),z("hmm",0,0,function(){return""+dc.apply(this)+q(this.minutes(),2)}),z("hmmss",0,0,function(){return""+dc.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)});function ff(l,h){z(l,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}ff("a",!0),ff("A",!1),Ue("hour","h"),$e("hour",13);function pf(l,h){return h._meridiemParse}Y("a",pf),Y("A",pf),Y("H",Se),Y("h",Se),Y("k",Se),Y("HH",Se,st),Y("hh",Se,st),Y("kk",Se,st),Y("hmm",nf),Y("hmmss",sf),Y("Hmm",nf),Y("Hmmss",sf),ge(["H","HH"],Ie),ge(["k","kk"],function(l,h,m){var b=ne(l);h[Ie]=b===24?0:b}),ge(["a","A"],function(l,h,m){m._isPm=m._locale.isPM(l),m._meridiem=l}),ge(["h","hh"],function(l,h,m){h[Ie]=ne(l),p(m).bigHour=!0}),ge("hmm",function(l,h,m){var b=l.length-2;h[Ie]=ne(l.substr(0,b)),h[Tt]=ne(l.substr(b)),p(m).bigHour=!0}),ge("hmmss",function(l,h,m){var b=l.length-4,w=l.length-2;h[Ie]=ne(l.substr(0,b)),h[Tt]=ne(l.substr(b,2)),h[Yt]=ne(l.substr(w)),p(m).bigHour=!0}),ge("Hmm",function(l,h,m){var b=l.length-2;h[Ie]=ne(l.substr(0,b)),h[Tt]=ne(l.substr(b))}),ge("Hmmss",function(l,h,m){var b=l.length-4,w=l.length-2;h[Ie]=ne(l.substr(0,b)),h[Tt]=ne(l.substr(b,2)),h[Yt]=ne(l.substr(w))});function hC(l){return(l+"").toLowerCase().charAt(0)==="p"}var fC=/[ap]\.?m?\.?/i,pC=Ni("Hours",!0);function gC(l,h,m){return l>11?m?"pm":"PM":m?"am":"AM"}var gf={calendar:j,longDateFormat:bn,invalidDate:Zr,ordinal:hS,dayOfMonthOrdinalParse:fS,relativeTime:gS,months:ES,monthsShort:rf,week:jS,weekdays:qS,weekdaysMin:XS,weekdaysShort:hf,meridiemParse:fC},Te={},Bs={},zs;function mC(l,h){var m,b=Math.min(l.length,h.length);for(m=0;m<b;m+=1)if(l[m]!==h[m])return m;return b}function mf(l){return l&&l.toLowerCase().replace("_","-")}function yC(l){for(var h=0,m,b,w,E;h<l.length;){for(E=mf(l[h]).split("-"),m=E.length,b=mf(l[h+1]),b=b?b.split("-"):null;m>0;){if(w=lo(E.slice(0,m).join("-")),w)return w;if(b&&b.length>=m&&mC(E,b)>=m-1)break;m--}h++}return zs}function bC(l){return l.match("^[^/\\\\]*$")!=null}function lo(l){var h=null,m;if(Te[l]===void 0&&typeof Hi<"u"&&Hi&&Hi.exports&&bC(l))try{h=zs._abbr,m=wo,m("./locale/"+l),vn(h)}catch{Te[l]=null}return Te[l]}function vn(l,h){var m;return l&&(a(h)?m=$t(l):m=uc(l,h),m?zs=m:typeof console<"u"&&console.warn&&console.warn("Locale "+l+" not found. Did you forget to load it?")),zs._abbr}function uc(l,h){if(h!==null){var m,b=gf;if(h.abbr=l,Te[l]!=null)R("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=Te[l]._config;else if(h.parentLocale!=null)if(Te[h.parentLocale]!=null)b=Te[h.parentLocale]._config;else if(m=lo(h.parentLocale),m!=null)b=m._config;else return Bs[h.parentLocale]||(Bs[h.parentLocale]=[]),Bs[h.parentLocale].push({name:l,config:h}),null;return Te[l]=new I(W(b,h)),Bs[l]&&Bs[l].forEach(function(w){uc(w.name,w.config)}),vn(l),Te[l]}else return delete Te[l],null}function vC(l,h){if(h!=null){var m,b,w=gf;Te[l]!=null&&Te[l].parentLocale!=null?Te[l].set(W(Te[l]._config,h)):(b=lo(l),b!=null&&(w=b._config),h=W(w,h),b==null&&(h.abbr=l),m=new I(h),m.parentLocale=Te[l],Te[l]=m),vn(l)}else Te[l]!=null&&(Te[l].parentLocale!=null?(Te[l]=Te[l].parentLocale,l===vn()&&vn(l)):Te[l]!=null&&delete Te[l]);return Te[l]}function $t(l){var h;if(l&&l._locale&&l._locale._abbr&&(l=l._locale._abbr),!l)return zs;if(!i(l)){if(h=lo(l),h)return h;l=[l]}return yC(l)}function wC(){return F(Te)}function hc(l){var h,m=l._a;return m&&p(l).overflow===-2&&(h=m[Vt]<0||m[Vt]>11?Vt:m[Rt]<1||m[Rt]>oo(m[Ge],m[Vt])?Rt:m[Ie]<0||m[Ie]>24||m[Ie]===24&&(m[Tt]!==0||m[Yt]!==0||m[Gn]!==0)?Ie:m[Tt]<0||m[Tt]>59?Tt:m[Yt]<0||m[Yt]>59?Yt:m[Gn]<0||m[Gn]>999?Gn:-1,p(l)._overflowDayOfYear&&(h<Ge||h>Rt)&&(h=Rt),p(l)._overflowWeeks&&h===-1&&(h=TS),p(l)._overflowWeekday&&h===-1&&(h=OS),p(l).overflow=h),l}var xC=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_C=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,SC=/Z|[+-]\d\d(?::?\d\d)?/,co=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],fc=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],CC=/^\/?Date\((-?\d+)/i,kC=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,TC={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function yf(l){var h,m,b=l._i,w=xC.exec(b)||_C.exec(b),E,A,Z,te,me=co.length,Xe=fc.length;if(w){for(p(l).iso=!0,h=0,m=me;h<m;h++)if(co[h][1].exec(w[1])){A=co[h][0],E=co[h][2]!==!1;break}if(A==null){l._isValid=!1;return}if(w[3]){for(h=0,m=Xe;h<m;h++)if(fc[h][1].exec(w[3])){Z=(w[2]||" ")+fc[h][0];break}if(Z==null){l._isValid=!1;return}}if(!E&&Z!=null){l._isValid=!1;return}if(w[4])if(SC.exec(w[4]))te="Z";else{l._isValid=!1;return}l._f=A+(Z||"")+(te||""),gc(l)}else l._isValid=!1}function OC(l,h,m,b,w,E){var A=[DC(l),rf.indexOf(h),parseInt(m,10),parseInt(b,10),parseInt(w,10)];return E&&A.push(parseInt(E,10)),A}function DC(l){var h=parseInt(l,10);return h<=49?2e3+h:h<=999?1900+h:h}function EC(l){return l.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function MC(l,h,m){if(l){var b=hf.indexOf(l),w=new Date(h[0],h[1],h[2]).getDay();if(b!==w)return p(m).weekdayMismatch=!0,m._isValid=!1,!1}return!0}function PC(l,h,m){if(l)return TC[l];if(h)return 0;var b=parseInt(m,10),w=b%100,E=(b-w)/100;return E*60+w}function bf(l){var h=kC.exec(EC(l._i)),m;if(h){if(m=OC(h[4],h[3],h[2],h[5],h[6],h[7]),!MC(h[1],m,l))return;l._a=m,l._tzm=PC(h[8],h[9],h[10]),l._d=Is.apply(null,l._a),l._d.setUTCMinutes(l._d.getUTCMinutes()-l._tzm),p(l).rfc2822=!0}else l._isValid=!1}function NC(l){var h=CC.exec(l._i);if(h!==null){l._d=new Date(+h[1]);return}if(yf(l),l._isValid===!1)delete l._isValid;else return;if(bf(l),l._isValid===!1)delete l._isValid;else return;l._strict?l._isValid=!1:e.createFromInputFallback(l)}e.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(l){l._d=new Date(l._i+(l._useUTC?" UTC":""))});function Ai(l,h,m){return l??h??m}function RC(l){var h=new Date(e.now());return l._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function pc(l){var h,m,b=[],w,E,A;if(!l._d){for(w=RC(l),l._w&&l._a[Rt]==null&&l._a[Vt]==null&&AC(l),l._dayOfYear!=null&&(A=Ai(l._a[Ge],w[Ge]),(l._dayOfYear>Ls(A)||l._dayOfYear===0)&&(p(l)._overflowDayOfYear=!0),m=Is(A,0,l._dayOfYear),l._a[Vt]=m.getUTCMonth(),l._a[Rt]=m.getUTCDate()),h=0;h<3&&l._a[h]==null;++h)l._a[h]=b[h]=w[h];for(;h<7;h++)l._a[h]=b[h]=l._a[h]==null?h===2?1:0:l._a[h];l._a[Ie]===24&&l._a[Tt]===0&&l._a[Yt]===0&&l._a[Gn]===0&&(l._nextDay=!0,l._a[Ie]=0),l._d=(l._useUTC?Is:HS).apply(null,b),E=l._useUTC?l._d.getUTCDay():l._d.getDay(),l._tzm!=null&&l._d.setUTCMinutes(l._d.getUTCMinutes()-l._tzm),l._nextDay&&(l._a[Ie]=24),l._w&&typeof l._w.d<"u"&&l._w.d!==E&&(p(l).weekdayMismatch=!0)}}function AC(l){var h,m,b,w,E,A,Z,te,me;h=l._w,h.GG!=null||h.W!=null||h.E!=null?(E=1,A=4,m=Ai(h.GG,l._a[Ge],Fs(Ce(),1,4).year),b=Ai(h.W,1),w=Ai(h.E,1),(w<1||w>7)&&(te=!0)):(E=l._locale._week.dow,A=l._locale._week.doy,me=Fs(Ce(),E,A),m=Ai(h.gg,l._a[Ge],me.year),b=Ai(h.w,me.week),h.d!=null?(w=h.d,(w<0||w>6)&&(te=!0)):h.e!=null?(w=h.e+E,(h.e<0||h.e>6)&&(te=!0)):w=E),b<1||b>Ut(m,E,A)?p(l)._overflowWeeks=!0:te!=null?p(l)._overflowWeekday=!0:(Z=uf(m,b,w,E,A),l._a[Ge]=Z.year,l._dayOfYear=Z.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function gc(l){if(l._f===e.ISO_8601){yf(l);return}if(l._f===e.RFC_2822){bf(l);return}l._a=[],p(l).empty=!0;var h=""+l._i,m,b,w,E,A,Z=h.length,te=0,me,Xe;for(w=Ve(l._f,l._locale).match($)||[],Xe=w.length,m=0;m<Xe;m++)E=w[m],b=(h.match(SS(E,l))||[])[0],b&&(A=h.substr(0,h.indexOf(b)),A.length>0&&p(l).unusedInput.push(A),h=h.slice(h.indexOf(b)+b.length),te+=b.length),G[E]?(b?p(l).empty=!1:p(l).unusedTokens.push(E),kS(E,b,l)):l._strict&&!b&&p(l).unusedTokens.push(E);p(l).charsLeftOver=Z-te,h.length>0&&p(l).unusedInput.push(h),l._a[Ie]<=12&&p(l).bigHour===!0&&l._a[Ie]>0&&(p(l).bigHour=void 0),p(l).parsedDateParts=l._a.slice(0),p(l).meridiem=l._meridiem,l._a[Ie]=LC(l._locale,l._a[Ie],l._meridiem),me=p(l).era,me!==null&&(l._a[Ge]=l._locale.erasConvertYear(me,l._a[Ge])),pc(l),hc(l)}function LC(l,h,m){var b;return m==null?h:l.meridiemHour!=null?l.meridiemHour(h,m):(l.isPM!=null&&(b=l.isPM(m),b&&h<12&&(h+=12),!b&&h===12&&(h=0)),h)}function IC(l){var h,m,b,w,E,A,Z=!1,te=l._f.length;if(te===0){p(l).invalidFormat=!0,l._d=new Date(NaN);return}for(w=0;w<te;w++)E=0,A=!1,h=T({},l),l._useUTC!=null&&(h._useUTC=l._useUTC),h._f=l._f[w],gc(h),x(h)&&(A=!0),E+=p(h).charsLeftOver,E+=p(h).unusedTokens.length*10,p(h).score=E,Z?E<b&&(b=E,m=h):(b==null||E<b||A)&&(b=E,m=h,A&&(Z=!0));f(l,m||h)}function FC(l){if(!l._d){var h=sc(l._i),m=h.day===void 0?h.date:h.day;l._a=u([h.year,h.month,m,h.hour,h.minute,h.second,h.millisecond],function(b){return b&&parseInt(b,10)}),pc(l)}}function BC(l){var h=new k(hc(vf(l)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function vf(l){var h=l._i,m=l._f;return l._locale=l._locale||$t(l._l),h===null||m===void 0&&h===""?_({nullInput:!0}):(typeof h=="string"&&(l._i=h=l._locale.preparse(h)),P(h)?new k(hc(h)):(d(h)?l._d=h:i(m)?IC(l):m?gc(l):zC(l),x(l)||(l._d=null),l))}function zC(l){var h=l._i;a(h)?l._d=new Date(e.now()):d(h)?l._d=new Date(h.valueOf()):typeof h=="string"?NC(l):i(h)?(l._a=u(h.slice(0),function(m){return parseInt(m,10)}),pc(l)):s(h)?FC(l):c(h)?l._d=new Date(h):e.createFromInputFallback(l)}function wf(l,h,m,b,w){var E={};return(h===!0||h===!1)&&(b=h,h=void 0),(m===!0||m===!1)&&(b=m,m=void 0),(s(l)&&o(l)||i(l)&&l.length===0)&&(l=void 0),E._isAMomentObject=!0,E._useUTC=E._isUTC=w,E._l=m,E._i=l,E._f=h,E._strict=b,BC(E)}function Ce(l,h,m,b){return wf(l,h,m,b,!1)}var HC=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var l=Ce.apply(null,arguments);return this.isValid()&&l.isValid()?l<this?this:l:_()}),WC=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var l=Ce.apply(null,arguments);return this.isValid()&&l.isValid()?l>this?this:l:_()});function xf(l,h){var m,b;if(h.length===1&&i(h[0])&&(h=h[0]),!h.length)return Ce();for(m=h[0],b=1;b<h.length;++b)(!h[b].isValid()||h[b][l](m))&&(m=h[b]);return m}function jC(){var l=[].slice.call(arguments,0);return xf("isBefore",l)}function VC(){var l=[].slice.call(arguments,0);return xf("isAfter",l)}var YC=function(){return Date.now?Date.now():+new Date},Hs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function UC(l){var h,m=!1,b,w=Hs.length;for(h in l)if(r(l,h)&&!(Ne.call(Hs,h)!==-1&&(l[h]==null||!isNaN(l[h]))))return!1;for(b=0;b<w;++b)if(l[Hs[b]]){if(m)return!1;parseFloat(l[Hs[b]])!==ne(l[Hs[b]])&&(m=!0)}return!0}function $C(){return this._isValid}function GC(){return Ot(NaN)}function uo(l){var h=sc(l),m=h.year||0,b=h.quarter||0,w=h.month||0,E=h.week||h.isoWeek||0,A=h.day||0,Z=h.hour||0,te=h.minute||0,me=h.second||0,Xe=h.millisecond||0;this._isValid=UC(h),this._milliseconds=+Xe+me*1e3+te*6e4+Z*1e3*60*60,this._days=+A+E*7,this._months=+w+b*3+m*12,this._data={},this._locale=$t(),this._bubble()}function ho(l){return l instanceof uo}function mc(l){return l<0?Math.round(-1*l)*-1:Math.round(l)}function KC(l,h,m){var b=Math.min(l.length,h.length),w=Math.abs(l.length-h.length),E=0,A;for(A=0;A<b;A++)(m&&l[A]!==h[A]||!m&&ne(l[A])!==ne(h[A]))&&E++;return E+w}function _f(l,h){z(l,0,0,function(){var m=this.utcOffset(),b="+";return m<0&&(m=-m,b="-"),b+q(~~(m/60),2)+h+q(~~m%60,2)})}_f("Z",":"),_f("ZZ",""),Y("Z",so),Y("ZZ",so),ge(["Z","ZZ"],function(l,h,m){m._useUTC=!0,m._tzm=yc(so,l)});var qC=/([\+\-]|\d\d)/gi;function yc(l,h){var m=(h||"").match(l),b,w,E;return m===null?null:(b=m[m.length-1]||[],w=(b+"").match(qC)||["-",0,0],E=+(w[1]*60)+ne(w[2]),E===0?0:w[0]==="+"?E:-E)}function bc(l,h){var m,b;return h._isUTC?(m=h.clone(),b=(P(l)||d(l)?l.valueOf():Ce(l).valueOf())-m.valueOf(),m._d.setTime(m._d.valueOf()+b),e.updateOffset(m,!1),m):Ce(l).local()}function vc(l){return-Math.round(l._d.getTimezoneOffset())}e.updateOffset=function(){};function XC(l,h,m){var b=this._offset||0,w;if(!this.isValid())return l!=null?this:NaN;if(l!=null){if(typeof l=="string"){if(l=yc(so,l),l===null)return this}else Math.abs(l)<16&&!m&&(l=l*60);return!this._isUTC&&h&&(w=vc(this)),this._offset=l,this._isUTC=!0,w!=null&&this.add(w,"m"),b!==l&&(!h||this._changeInProgress?Tf(this,Ot(l-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:vc(this)}function ZC(l,h){return l!=null?(typeof l!="string"&&(l=-l),this.utcOffset(l,h),this):-this.utcOffset()}function JC(l){return this.utcOffset(0,l)}function QC(l){return this._isUTC&&(this.utcOffset(0,l),this._isUTC=!1,l&&this.subtract(vc(this),"m")),this}function e1(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var l=yc(xS,this._i);l!=null?this.utcOffset(l):this.utcOffset(0,!0)}return this}function t1(l){return this.isValid()?(l=l?Ce(l).utcOffset():0,(this.utcOffset()-l)%60===0):!1}function n1(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function i1(){if(!a(this._isDSTShifted))return this._isDSTShifted;var l={},h;return T(l,this),l=vf(l),l._a?(h=l._isUTC?y(l._a):Ce(l._a),this._isDSTShifted=this.isValid()&&KC(l._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function s1(){return this.isValid()?!this._isUTC:!1}function r1(){return this.isValid()?this._isUTC:!1}function Sf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var o1=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,a1=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ot(l,h){var m=l,b=null,w,E,A;return ho(l)?m={ms:l._milliseconds,d:l._days,M:l._months}:c(l)||!isNaN(+l)?(m={},h?m[h]=+l:m.milliseconds=+l):(b=o1.exec(l))?(w=b[1]==="-"?-1:1,m={y:0,d:ne(b[Rt])*w,h:ne(b[Ie])*w,m:ne(b[Tt])*w,s:ne(b[Yt])*w,ms:ne(mc(b[Gn]*1e3))*w}):(b=a1.exec(l))?(w=b[1]==="-"?-1:1,m={y:Kn(b[2],w),M:Kn(b[3],w),w:Kn(b[4],w),d:Kn(b[5],w),h:Kn(b[6],w),m:Kn(b[7],w),s:Kn(b[8],w)}):m==null?m={}:typeof m=="object"&&("from"in m||"to"in m)&&(A=l1(Ce(m.from),Ce(m.to)),m={},m.ms=A.milliseconds,m.M=A.months),E=new uo(m),ho(l)&&r(l,"_locale")&&(E._locale=l._locale),ho(l)&&r(l,"_isValid")&&(E._isValid=l._isValid),E}Ot.fn=uo.prototype,Ot.invalid=GC;function Kn(l,h){var m=l&&parseFloat(l.replace(",","."));return(isNaN(m)?0:m)*h}function Cf(l,h){var m={};return m.months=h.month()-l.month()+(h.year()-l.year())*12,l.clone().add(m.months,"M").isAfter(h)&&--m.months,m.milliseconds=+h-+l.clone().add(m.months,"M"),m}function l1(l,h){var m;return l.isValid()&&h.isValid()?(h=bc(h,l),l.isBefore(h)?m=Cf(l,h):(m=Cf(h,l),m.milliseconds=-m.milliseconds,m.months=-m.months),m):{milliseconds:0,months:0}}function kf(l,h){return function(m,b){var w,E;return b!==null&&!isNaN(+b)&&(R(h,"moment()."+h+"(period, number) is deprecated. Please use moment()."+h+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),E=m,m=b,b=E),w=Ot(m,b),Tf(this,w,l),this}}function Tf(l,h,m,b){var w=h._milliseconds,E=mc(h._days),A=mc(h._months);!l.isValid()||(b=b??!0,A&&af(l,Qr(l,"Month")+A*m),E&&Qh(l,"Date",Qr(l,"Date")+E*m),w&&l._d.setTime(l._d.valueOf()+w*m),b&&e.updateOffset(l,E||A))}var c1=kf(1,"add"),d1=kf(-1,"subtract");function Of(l){return typeof l=="string"||l instanceof String}function u1(l){return P(l)||d(l)||Of(l)||c(l)||f1(l)||h1(l)||l===null||l===void 0}function h1(l){var h=s(l)&&!o(l),m=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],w,E,A=b.length;for(w=0;w<A;w+=1)E=b[w],m=m||r(l,E);return h&&m}function f1(l){var h=i(l),m=!1;return h&&(m=l.filter(function(b){return!c(b)&&Of(l)}).length===0),h&&m}function p1(l){var h=s(l)&&!o(l),m=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],w,E;for(w=0;w<b.length;w+=1)E=b[w],m=m||r(l,E);return h&&m}function g1(l,h){var m=l.diff(h,"days",!0);return m<-6?"sameElse":m<-1?"lastWeek":m<0?"lastDay":m<1?"sameDay":m<2?"nextDay":m<7?"nextWeek":"sameElse"}function m1(l,h){arguments.length===1&&(arguments[0]?u1(arguments[0])?(l=arguments[0],h=void 0):p1(arguments[0])&&(h=arguments[0],l=void 0):(l=void 0,h=void 0));var m=l||Ce(),b=bc(m,this).startOf("day"),w=e.calendarFormat(this,b)||"sameElse",E=h&&(L(h[w])?h[w].call(this,m):h[w]);return this.format(E||this.localeData().calendar(w,this,Ce(m)))}function y1(){return new k(this)}function b1(l,h){var m=P(l)?l:Ce(l);return this.isValid()&&m.isValid()?(h=gt(h)||"millisecond",h==="millisecond"?this.valueOf()>m.valueOf():m.valueOf()<this.clone().startOf(h).valueOf()):!1}function v1(l,h){var m=P(l)?l:Ce(l);return this.isValid()&&m.isValid()?(h=gt(h)||"millisecond",h==="millisecond"?this.valueOf()<m.valueOf():this.clone().endOf(h).valueOf()<m.valueOf()):!1}function w1(l,h,m,b){var w=P(l)?l:Ce(l),E=P(h)?h:Ce(h);return this.isValid()&&w.isValid()&&E.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(w,m):!this.isBefore(w,m))&&(b[1]===")"?this.isBefore(E,m):!this.isAfter(E,m))):!1}function x1(l,h){var m=P(l)?l:Ce(l),b;return this.isValid()&&m.isValid()?(h=gt(h)||"millisecond",h==="millisecond"?this.valueOf()===m.valueOf():(b=m.valueOf(),this.clone().startOf(h).valueOf()<=b&&b<=this.clone().endOf(h).valueOf())):!1}function _1(l,h){return this.isSame(l,h)||this.isAfter(l,h)}function S1(l,h){return this.isSame(l,h)||this.isBefore(l,h)}function C1(l,h,m){var b,w,E;if(!this.isValid())return NaN;if(b=bc(l,this),!b.isValid())return NaN;switch(w=(b.utcOffset()-this.utcOffset())*6e4,h=gt(h),h){case"year":E=fo(this,b)/12;break;case"month":E=fo(this,b);break;case"quarter":E=fo(this,b)/3;break;case"second":E=(this-b)/1e3;break;case"minute":E=(this-b)/6e4;break;case"hour":E=(this-b)/36e5;break;case"day":E=(this-b-w)/864e5;break;case"week":E=(this-b-w)/6048e5;break;default:E=this-b}return m?E:mt(E)}function fo(l,h){if(l.date()<h.date())return-fo(h,l);var m=(h.year()-l.year())*12+(h.month()-l.month()),b=l.clone().add(m,"months"),w,E;return h-b<0?(w=l.clone().add(m-1,"months"),E=(h-b)/(b-w)):(w=l.clone().add(m+1,"months"),E=(h-b)/(w-b)),-(m+E)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function k1(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function T1(l){if(!this.isValid())return null;var h=l!==!0,m=h?this.clone().utc():this;return m.year()<0||m.year()>9999?ve(m,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ve(m,"Z")):ve(m,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function O1(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var l="moment",h="",m,b,w,E;return this.isLocal()||(l=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),m="["+l+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",w="-MM-DD[T]HH:mm:ss.SSS",E=h+'[")]',this.format(m+b+w+E)}function D1(l){l||(l=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=ve(this,l);return this.localeData().postformat(h)}function E1(l,h){return this.isValid()&&(P(l)&&l.isValid()||Ce(l).isValid())?Ot({to:this,from:l}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function M1(l){return this.from(Ce(),l)}function P1(l,h){return this.isValid()&&(P(l)&&l.isValid()||Ce(l).isValid())?Ot({from:this,to:l}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function N1(l){return this.to(Ce(),l)}function Df(l){var h;return l===void 0?this._locale._abbr:(h=$t(l),h!=null&&(this._locale=h),this)}var Ef=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(l){return l===void 0?this.localeData():this.locale(l)});function Mf(){return this._locale}var po=1e3,Li=60*po,go=60*Li,Pf=(365*400+97)*24*go;function Ii(l,h){return(l%h+h)%h}function Nf(l,h,m){return l<100&&l>=0?new Date(l+400,h,m)-Pf:new Date(l,h,m).valueOf()}function Rf(l,h,m){return l<100&&l>=0?Date.UTC(l+400,h,m)-Pf:Date.UTC(l,h,m)}function R1(l){var h,m;if(l=gt(l),l===void 0||l==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Rf:Nf,l){case"year":h=m(this.year(),0,1);break;case"quarter":h=m(this.year(),this.month()-this.month()%3,1);break;case"month":h=m(this.year(),this.month(),1);break;case"week":h=m(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":h=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":h=m(this.year(),this.month(),this.date());break;case"hour":h=this._d.valueOf(),h-=Ii(h+(this._isUTC?0:this.utcOffset()*Li),go);break;case"minute":h=this._d.valueOf(),h-=Ii(h,Li);break;case"second":h=this._d.valueOf(),h-=Ii(h,po);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function A1(l){var h,m;if(l=gt(l),l===void 0||l==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Rf:Nf,l){case"year":h=m(this.year()+1,0,1)-1;break;case"quarter":h=m(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":h=m(this.year(),this.month()+1,1)-1;break;case"week":h=m(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":h=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":h=m(this.year(),this.month(),this.date()+1)-1;break;case"hour":h=this._d.valueOf(),h+=go-Ii(h+(this._isUTC?0:this.utcOffset()*Li),go)-1;break;case"minute":h=this._d.valueOf(),h+=Li-Ii(h,Li)-1;break;case"second":h=this._d.valueOf(),h+=po-Ii(h,po)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function L1(){return this._d.valueOf()-(this._offset||0)*6e4}function I1(){return Math.floor(this.valueOf()/1e3)}function F1(){return new Date(this.valueOf())}function B1(){var l=this;return[l.year(),l.month(),l.date(),l.hour(),l.minute(),l.second(),l.millisecond()]}function z1(){var l=this;return{years:l.year(),months:l.month(),date:l.date(),hours:l.hours(),minutes:l.minutes(),seconds:l.seconds(),milliseconds:l.milliseconds()}}function H1(){return this.isValid()?this.toISOString():null}function W1(){return x(this)}function j1(){return f({},p(this))}function V1(){return p(this).overflow}function Y1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}z("N",0,0,"eraAbbr"),z("NN",0,0,"eraAbbr"),z("NNN",0,0,"eraAbbr"),z("NNNN",0,0,"eraName"),z("NNNNN",0,0,"eraNarrow"),z("y",["y",1],"yo","eraYear"),z("y",["yy",2],0,"eraYear"),z("y",["yyy",3],0,"eraYear"),z("y",["yyyy",4],0,"eraYear"),Y("N",wc),Y("NN",wc),Y("NNN",wc),Y("NNNN",tk),Y("NNNNN",nk),ge(["N","NN","NNN","NNNN","NNNNN"],function(l,h,m,b){var w=m._locale.erasParse(l,b,m._strict);w?p(m).era=w:p(m).invalidEra=l}),Y("y",Ri),Y("yy",Ri),Y("yyy",Ri),Y("yyyy",Ri),Y("yo",ik),ge(["y","yy","yyy","yyyy"],Ge),ge(["yo"],function(l,h,m,b){var w;m._locale._eraYearOrdinalRegex&&(w=l.match(m._locale._eraYearOrdinalRegex)),m._locale.eraYearOrdinalParse?h[Ge]=m._locale.eraYearOrdinalParse(l,w):h[Ge]=parseInt(l,10)});function U1(l,h){var m,b,w,E=this._eras||$t("en")._eras;for(m=0,b=E.length;m<b;++m){switch(typeof E[m].since){case"string":w=e(E[m].since).startOf("day"),E[m].since=w.valueOf();break}switch(typeof E[m].until){case"undefined":E[m].until=1/0;break;case"string":w=e(E[m].until).startOf("day").valueOf(),E[m].until=w.valueOf();break}}return E}function $1(l,h,m){var b,w,E=this.eras(),A,Z,te;for(l=l.toUpperCase(),b=0,w=E.length;b<w;++b)if(A=E[b].name.toUpperCase(),Z=E[b].abbr.toUpperCase(),te=E[b].narrow.toUpperCase(),m)switch(h){case"N":case"NN":case"NNN":if(Z===l)return E[b];break;case"NNNN":if(A===l)return E[b];break;case"NNNNN":if(te===l)return E[b];break}else if([A,Z,te].indexOf(l)>=0)return E[b]}function G1(l,h){var m=l.since<=l.until?1:-1;return h===void 0?e(l.since).year():e(l.since).year()+(h-l.offset)*m}function K1(){var l,h,m,b=this.localeData().eras();for(l=0,h=b.length;l<h;++l)if(m=this.clone().startOf("day").valueOf(),b[l].since<=m&&m<=b[l].until||b[l].until<=m&&m<=b[l].since)return b[l].name;return""}function q1(){var l,h,m,b=this.localeData().eras();for(l=0,h=b.length;l<h;++l)if(m=this.clone().startOf("day").valueOf(),b[l].since<=m&&m<=b[l].until||b[l].until<=m&&m<=b[l].since)return b[l].narrow;return""}function X1(){var l,h,m,b=this.localeData().eras();for(l=0,h=b.length;l<h;++l)if(m=this.clone().startOf("day").valueOf(),b[l].since<=m&&m<=b[l].until||b[l].until<=m&&m<=b[l].since)return b[l].abbr;return""}function Z1(){var l,h,m,b,w=this.localeData().eras();for(l=0,h=w.length;l<h;++l)if(m=w[l].since<=w[l].until?1:-1,b=this.clone().startOf("day").valueOf(),w[l].since<=b&&b<=w[l].until||w[l].until<=b&&b<=w[l].since)return(this.year()-e(w[l].since).year())*m+w[l].offset;return this.year()}function J1(l){return r(this,"_erasNameRegex")||xc.call(this),l?this._erasNameRegex:this._erasRegex}function Q1(l){return r(this,"_erasAbbrRegex")||xc.call(this),l?this._erasAbbrRegex:this._erasRegex}function ek(l){return r(this,"_erasNarrowRegex")||xc.call(this),l?this._erasNarrowRegex:this._erasRegex}function wc(l,h){return h.erasAbbrRegex(l)}function tk(l,h){return h.erasNameRegex(l)}function nk(l,h){return h.erasNarrowRegex(l)}function ik(l,h){return h._eraYearOrdinalRegex||Ri}function xc(){var l=[],h=[],m=[],b=[],w,E,A=this.eras();for(w=0,E=A.length;w<E;++w)h.push(rt(A[w].name)),l.push(rt(A[w].abbr)),m.push(rt(A[w].narrow)),b.push(rt(A[w].name)),b.push(rt(A[w].abbr)),b.push(rt(A[w].narrow));this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+h.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+m.join("|")+")","i")}z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100});function mo(l,h){z(0,[l,l.length],0,h)}mo("gggg","weekYear"),mo("ggggg","weekYear"),mo("GGGG","isoWeekYear"),mo("GGGGG","isoWeekYear"),Ue("weekYear","gg"),Ue("isoWeekYear","GG"),$e("weekYear",1),$e("isoWeekYear",1),Y("G",io),Y("g",io),Y("GG",Se,st),Y("gg",Se,st),Y("GGGG",oc,rc),Y("gggg",oc,rc),Y("GGGGG",no,eo),Y("ggggg",no,eo),As(["gggg","ggggg","GGGG","GGGGG"],function(l,h,m,b){h[b.substr(0,2)]=ne(l)}),As(["gg","GG"],function(l,h,m,b){h[b]=e.parseTwoDigitYear(l)});function sk(l){return Af.call(this,l,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function rk(l){return Af.call(this,l,this.isoWeek(),this.isoWeekday(),1,4)}function ok(){return Ut(this.year(),1,4)}function ak(){return Ut(this.isoWeekYear(),1,4)}function lk(){var l=this.localeData()._week;return Ut(this.year(),l.dow,l.doy)}function ck(){var l=this.localeData()._week;return Ut(this.weekYear(),l.dow,l.doy)}function Af(l,h,m,b,w){var E;return l==null?Fs(this,b,w).year:(E=Ut(l,b,w),h>E&&(h=E),dk.call(this,l,h,m,b,w))}function dk(l,h,m,b,w){var E=uf(l,h,m,b,w),A=Is(E.year,0,E.dayOfYear);return this.year(A.getUTCFullYear()),this.month(A.getUTCMonth()),this.date(A.getUTCDate()),this}z("Q",0,"Qo","quarter"),Ue("quarter","Q"),$e("quarter",7),Y("Q",ef),ge("Q",function(l,h){h[Vt]=(ne(l)-1)*3});function uk(l){return l==null?Math.ceil((this.month()+1)/3):this.month((l-1)*3+this.month()%3)}z("D",["DD",2],"Do","date"),Ue("date","D"),$e("date",9),Y("D",Se),Y("DD",Se,st),Y("Do",function(l,h){return l?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),ge(["D","DD"],Rt),ge("Do",function(l,h){h[Rt]=ne(l.match(Se)[0])});var Lf=Ni("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),Ue("dayOfYear","DDD"),$e("dayOfYear",4),Y("DDD",to),Y("DDDD",tf),ge(["DDD","DDDD"],function(l,h,m){m._dayOfYear=ne(l)});function hk(l){var h=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return l==null?h:this.add(l-h,"d")}z("m",["mm",2],0,"minute"),Ue("minute","m"),$e("minute",14),Y("m",Se),Y("mm",Se,st),ge(["m","mm"],Tt);var fk=Ni("Minutes",!1);z("s",["ss",2],0,"second"),Ue("second","s"),$e("second",15),Y("s",Se),Y("ss",Se,st),ge(["s","ss"],Yt);var pk=Ni("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return this.millisecond()*10}),z(0,["SSSSS",5],0,function(){return this.millisecond()*100}),z(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),z(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),z(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),z(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ue("millisecond","ms"),$e("millisecond",16),Y("S",to,ef),Y("SS",to,st),Y("SSS",to,tf);var wn,If;for(wn="SSSS";wn.length<=9;wn+="S")Y(wn,Ri);function gk(l,h){h[Gn]=ne(("0."+l)*1e3)}for(wn="S";wn.length<=9;wn+="S")ge(wn,gk);If=Ni("Milliseconds",!1),z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");function mk(){return this._isUTC?"UTC":""}function yk(){return this._isUTC?"Coordinated Universal Time":""}var H=k.prototype;H.add=c1,H.calendar=m1,H.clone=y1,H.diff=C1,H.endOf=A1,H.format=D1,H.from=E1,H.fromNow=M1,H.to=P1,H.toNow=N1,H.get=vS,H.invalidAt=V1,H.isAfter=b1,H.isBefore=v1,H.isBetween=w1,H.isSame=x1,H.isSameOrAfter=_1,H.isSameOrBefore=S1,H.isValid=W1,H.lang=Ef,H.locale=Df,H.localeData=Mf,H.max=WC,H.min=HC,H.parsingFlags=j1,H.set=wS,H.startOf=R1,H.subtract=d1,H.toArray=B1,H.toObject=z1,H.toDate=F1,H.toISOString=T1,H.inspect=O1,typeof Symbol<"u"&&Symbol.for!=null&&(H[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),H.toJSON=H1,H.toString=k1,H.unix=I1,H.valueOf=L1,H.creationData=Y1,H.eraName=K1,H.eraNarrow=q1,H.eraAbbr=X1,H.eraYear=Z1,H.year=df,H.isLeapYear=zS,H.weekYear=sk,H.isoWeekYear=rk,H.quarter=H.quarters=uk,H.month=lf,H.daysInMonth=IS,H.week=H.weeks=US,H.isoWeek=H.isoWeeks=$S,H.weeksInYear=lk,H.weeksInWeekYear=ck,H.isoWeeksInYear=ok,H.isoWeeksInISOWeekYear=ak,H.date=Lf,H.day=H.days=rC,H.weekday=oC,H.isoWeekday=aC,H.dayOfYear=hk,H.hour=H.hours=pC,H.minute=H.minutes=fk,H.second=H.seconds=pk,H.millisecond=H.milliseconds=If,H.utcOffset=XC,H.utc=JC,H.local=QC,H.parseZone=e1,H.hasAlignedHourOffset=t1,H.isDST=n1,H.isLocal=s1,H.isUtcOffset=r1,H.isUtc=Sf,H.isUTC=Sf,H.zoneAbbr=mk,H.zoneName=yk,H.dates=M("dates accessor is deprecated. Use date instead.",Lf),H.months=M("months accessor is deprecated. Use month instead",lf),H.years=M("years accessor is deprecated. Use year instead",df),H.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ZC),H.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",i1);function bk(l){return Ce(l*1e3)}function vk(){return Ce.apply(null,arguments).parseZone()}function Ff(l){return l}var ue=I.prototype;ue.calendar=V,ue.longDateFormat=Pi,ue.invalidDate=uS,ue.ordinal=pS,ue.preparse=Ff,ue.postformat=Ff,ue.relativeTime=mS,ue.pastFuture=yS,ue.set=B,ue.eras=U1,ue.erasParse=$1,ue.erasConvertYear=G1,ue.erasAbbrRegex=Q1,ue.erasNameRegex=J1,ue.erasNarrowRegex=ek,ue.months=NS,ue.monthsShort=RS,ue.monthsParse=LS,ue.monthsRegex=BS,ue.monthsShortRegex=FS,ue.week=WS,ue.firstDayOfYear=YS,ue.firstDayOfWeek=VS,ue.weekdays=eC,ue.weekdaysMin=nC,ue.weekdaysShort=tC,ue.weekdaysParse=sC,ue.weekdaysRegex=lC,ue.weekdaysShortRegex=cC,ue.weekdaysMinRegex=dC,ue.isPM=hC,ue.meridiem=gC;function yo(l,h,m,b){var w=$t(),E=y().set(b,h);return w[m](E,l)}function Bf(l,h,m){if(c(l)&&(h=l,l=void 0),l=l||"",h!=null)return yo(l,h,m,"month");var b,w=[];for(b=0;b<12;b++)w[b]=yo(l,b,m,"month");return w}function _c(l,h,m,b){typeof l=="boolean"?(c(h)&&(m=h,h=void 0),h=h||""):(h=l,m=h,l=!1,c(h)&&(m=h,h=void 0),h=h||"");var w=$t(),E=l?w._week.dow:0,A,Z=[];if(m!=null)return yo(h,(m+E)%7,b,"day");for(A=0;A<7;A++)Z[A]=yo(h,(A+E)%7,b,"day");return Z}function wk(l,h){return Bf(l,h,"months")}function xk(l,h){return Bf(l,h,"monthsShort")}function _k(l,h,m){return _c(l,h,m,"weekdays")}function Sk(l,h,m){return _c(l,h,m,"weekdaysShort")}function Ck(l,h,m){return _c(l,h,m,"weekdaysMin")}vn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(l){var h=l%10,m=ne(l%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th";return l+m}}),e.lang=M("moment.lang is deprecated. Use moment.locale instead.",vn),e.langData=M("moment.langData is deprecated. Use moment.localeData instead.",$t);var Gt=Math.abs;function kk(){var l=this._data;return this._milliseconds=Gt(this._milliseconds),this._days=Gt(this._days),this._months=Gt(this._months),l.milliseconds=Gt(l.milliseconds),l.seconds=Gt(l.seconds),l.minutes=Gt(l.minutes),l.hours=Gt(l.hours),l.months=Gt(l.months),l.years=Gt(l.years),this}function zf(l,h,m,b){var w=Ot(h,m);return l._milliseconds+=b*w._milliseconds,l._days+=b*w._days,l._months+=b*w._months,l._bubble()}function Tk(l,h){return zf(this,l,h,1)}function Ok(l,h){return zf(this,l,h,-1)}function Hf(l){return l<0?Math.floor(l):Math.ceil(l)}function Dk(){var l=this._milliseconds,h=this._days,m=this._months,b=this._data,w,E,A,Z,te;return l>=0&&h>=0&&m>=0||l<=0&&h<=0&&m<=0||(l+=Hf(Sc(m)+h)*864e5,h=0,m=0),b.milliseconds=l%1e3,w=mt(l/1e3),b.seconds=w%60,E=mt(w/60),b.minutes=E%60,A=mt(E/60),b.hours=A%24,h+=mt(A/24),te=mt(Wf(h)),m+=te,h-=Hf(Sc(te)),Z=mt(m/12),m%=12,b.days=h,b.months=m,b.years=Z,this}function Wf(l){return l*4800/146097}function Sc(l){return l*146097/4800}function Ek(l){if(!this.isValid())return NaN;var h,m,b=this._milliseconds;if(l=gt(l),l==="month"||l==="quarter"||l==="year")switch(h=this._days+b/864e5,m=this._months+Wf(h),l){case"month":return m;case"quarter":return m/3;case"year":return m/12}else switch(h=this._days+Math.round(Sc(this._months)),l){case"week":return h/7+b/6048e5;case"day":return h+b/864e5;case"hour":return h*24+b/36e5;case"minute":return h*1440+b/6e4;case"second":return h*86400+b/1e3;case"millisecond":return Math.floor(h*864e5)+b;default:throw new Error("Unknown unit "+l)}}function Mk(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+ne(this._months/12)*31536e6:NaN}function Kt(l){return function(){return this.as(l)}}var Pk=Kt("ms"),Nk=Kt("s"),Rk=Kt("m"),Ak=Kt("h"),Lk=Kt("d"),Ik=Kt("w"),Fk=Kt("M"),Bk=Kt("Q"),zk=Kt("y");function Hk(){return Ot(this)}function Wk(l){return l=gt(l),this.isValid()?this[l+"s"]():NaN}function qn(l){return function(){return this.isValid()?this._data[l]:NaN}}var jk=qn("milliseconds"),Vk=qn("seconds"),Yk=qn("minutes"),Uk=qn("hours"),$k=qn("days"),Gk=qn("months"),Kk=qn("years");function qk(){return mt(this.days()/7)}var qt=Math.round,Fi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Xk(l,h,m,b,w){return w.relativeTime(h||1,!!m,l,b)}function Zk(l,h,m,b){var w=Ot(l).abs(),E=qt(w.as("s")),A=qt(w.as("m")),Z=qt(w.as("h")),te=qt(w.as("d")),me=qt(w.as("M")),Xe=qt(w.as("w")),Xt=qt(w.as("y")),xn=E<=m.ss&&["s",E]||E<m.s&&["ss",E]||A<=1&&["m"]||A<m.m&&["mm",A]||Z<=1&&["h"]||Z<m.h&&["hh",Z]||te<=1&&["d"]||te<m.d&&["dd",te];return m.w!=null&&(xn=xn||Xe<=1&&["w"]||Xe<m.w&&["ww",Xe]),xn=xn||me<=1&&["M"]||me<m.M&&["MM",me]||Xt<=1&&["y"]||["yy",Xt],xn[2]=h,xn[3]=+l>0,xn[4]=b,Xk.apply(null,xn)}function Jk(l){return l===void 0?qt:typeof l=="function"?(qt=l,!0):!1}function Qk(l,h){return Fi[l]===void 0?!1:h===void 0?Fi[l]:(Fi[l]=h,l==="s"&&(Fi.ss=h-1),!0)}function eT(l,h){if(!this.isValid())return this.localeData().invalidDate();var m=!1,b=Fi,w,E;return typeof l=="object"&&(h=l,l=!1),typeof l=="boolean"&&(m=l),typeof h=="object"&&(b=Object.assign({},Fi,h),h.s!=null&&h.ss==null&&(b.ss=h.s-1)),w=this.localeData(),E=Zk(this,!m,b,w),m&&(E=w.pastFuture(+this,E)),w.postformat(E)}var Cc=Math.abs;function Bi(l){return(l>0)-(l<0)||+l}function bo(){if(!this.isValid())return this.localeData().invalidDate();var l=Cc(this._milliseconds)/1e3,h=Cc(this._days),m=Cc(this._months),b,w,E,A,Z=this.asSeconds(),te,me,Xe,Xt;return Z?(b=mt(l/60),w=mt(b/60),l%=60,b%=60,E=mt(m/12),m%=12,A=l?l.toFixed(3).replace(/\.?0+$/,""):"",te=Z<0?"-":"",me=Bi(this._months)!==Bi(Z)?"-":"",Xe=Bi(this._days)!==Bi(Z)?"-":"",Xt=Bi(this._milliseconds)!==Bi(Z)?"-":"",te+"P"+(E?me+E+"Y":"")+(m?me+m+"M":"")+(h?Xe+h+"D":"")+(w||b||l?"T":"")+(w?Xt+w+"H":"")+(b?Xt+b+"M":"")+(l?Xt+A+"S":"")):"P0D"}var re=uo.prototype;re.isValid=$C,re.abs=kk,re.add=Tk,re.subtract=Ok,re.as=Ek,re.asMilliseconds=Pk,re.asSeconds=Nk,re.asMinutes=Rk,re.asHours=Ak,re.asDays=Lk,re.asWeeks=Ik,re.asMonths=Fk,re.asQuarters=Bk,re.asYears=zk,re.valueOf=Mk,re._bubble=Dk,re.clone=Hk,re.get=Wk,re.milliseconds=jk,re.seconds=Vk,re.minutes=Yk,re.hours=Uk,re.days=$k,re.weeks=qk,re.months=Gk,re.years=Kk,re.humanize=eT,re.toISOString=bo,re.toString=bo,re.toJSON=bo,re.locale=Df,re.localeData=Mf,re.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bo),re.lang=Ef,z("X",0,0,"unix"),z("x",0,0,"valueOf"),Y("x",io),Y("X",_S),ge("X",function(l,h,m){m._d=new Date(parseFloat(l)*1e3)}),ge("x",function(l,h,m){m._d=new Date(ne(l))});return e.version="2.29.4",t(Ce),e.fn=H,e.min=jC,e.max=VC,e.now=YC,e.utc=y,e.unix=bk,e.months=wk,e.isDate=d,e.locale=vn,e.invalid=_,e.duration=Ot,e.isMoment=P,e.weekdays=_k,e.parseZone=vk,e.localeData=$t,e.isDuration=ho,e.monthsShort=xk,e.weekdaysMin=Ck,e.defineLocale=uc,e.updateLocale=vC,e.locales=wC,e.weekdaysShort=Sk,e.normalizeUnits=gt,e.relativeTimeRounding=Jk,e.relativeTimeThreshold=Qk,e.calendarFormat=g1,e.prototype=H,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var lp,Mc,Jt,js=O(()=>{Dc();lp=oe(ap()),Mc=class{storeTimeout={};callStoreApi(e,t){if(!!window.getGenie.blogWizardData?.post_id)if(window.getGenie.config.saveData)window.getGenie.config.saveData(e,t);else{let i=zi.storeApiUrl+"/"+e+"/";fetch(i,{method:"POST",body:JSON.stringify(t),headers:{"Content-type":"application/json; charset=UTF-8","X-WP-Nonce":window.getGenie.config?.restNonce||""}})}}storeData=e=>{this.storeTimeout[e]&&clearTimeout(this.storeTimeout[e]),this.storeTimeout[e]=setTimeout(()=>{let t=wp.data.select("getgenie").getInputs();this.callStoreApi(e,t[e]||"")},3e3)};copyToClipboard(e){if(navigator?.clipboard&&window?.isSecureContext)return navigator.clipboard.writeText(e);{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),new Promise((i,s)=>{document.execCommand("copy")?i():s(),t.remove()})}}formatLargeNumber(e){if(e<1e3)return e;if(e>=1e3&&e<1e6)return+(e/1e3).toFixed(1)+"K";if(e>=1e6&&e<1e9)return+(e/1e6).toFixed(1)+"M";if(e>=1e9&&e<1e12)return+(e/1e9).toFixed(1)+"B";if(e>=1e12)return+(e/1e12).toFixed(1)+"T"}getDomainName(e){try{return new URL(e).hostname.split(".").slice(-2).join(".")}catch{return""}}saveSidebarControllerOption(e,t){!e||!t||(localStorage.setItem(e,JSON.stringify(t)),e=="getgenie-language"&&wp.data.dispatch("getgenie").setSidebar({currentLanguage:t}))}snakeToTitleCase=e=>e.replace(/^[_]*(.)/,(s,r)=>r.toUpperCase()).replace(/[_]+(.)/g,(s,r)=>" "+r.toUpperCase());camelCaseToTitleCase(e){let t=e.replace(/([A-Z])/g," $1").trim();return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}hyphenatedToCamelCase(e){return e.replace(/-([a-z])/g,t=>t[1].toUpperCase())}joinArray(e,t="-"){return e&&e.length>1?e.join(t):""}sortObjArray(e,t){return e.last_nom<t.last_nom?-1:e.last_nom>t.last_nom?1:0}convertToSlug(e){return e?.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}getCurrentDateTime=e=>window.getGenie?.isPlayground?(0,lp.default)(e,"YYYY-MM-DD HH:mm:ssZ").format("YYYY-MM-DD, h:mm:ss A"):e;isExistDomain=e=>["shopify","wikipedia","youtube","amazon","aliexpress","walmart","alibaba","bookshop","etsy","flipkart","netflix","reddit","quora"].some(i=>e?.includes(i))},Jt=new Mc});var Zn,cp=O(()=>{Oc();js();Zt();Zn=class{focusKeyword="";scrapping(e,t=""){let i=e?.html||"",s=e?.rank||"",r=e?.pageContent||{};this.focusKeyword=t.trim();let o={};o.content=[];let c=new DOMParser().parseFromString(i,"text/html").querySelector("link[rel~='icon']")?.href||"";c.startsWith(location?.origin)&&(c="");let d={},u=(r?.content||"").replace(/<(\/?(ul|ol|li|div|br|hr)|>)[^>]*>/gim,`
`).replace(/<(?!\/?(h1|h2|h3|h4|h5|h6|a|p|div)|>)[^>]*>/gim,"");u=this.cleanText(u);let f=this.getHeadings(u);if(f.count>50)return;let y=this.getContents(f.headings)||[],g=r?.content?.match(/<img [^>]*src="[^"]*"[^>]*>/gi)?.length||0;if(g>50)return;let p=r?.content?.match(/<a\s+(?:[^>]*?\s+)?href=(["'])(.*?)\1/gmi),v=0,x=0,_=Jt.getDomainName(r?.url);p&&_&&(v=p.filter(D=>D.includes(_)).length,x=p.filter(D=>!D.includes(_)).length);let C=1,S=new Ee,T=r?.content?.match(/<img\s+(?:[^>]*?\s+)?alt=(["'])(.*?)\1/gi);if(T){let D=T.join(" ");C=S.findSingleMatch(D,this.focusKeyword),C=C?0:1}let k=So((u||" ").replace(/<[^>]*>/gmi," "))?.word_count||0;if(k>8e3)return;let P=Jt.isExistDomain(_);return d={rank:s,url:e?.url,keySlug:e?.keySlug,title:r?.title,description:r?.excerpt,favicon:c,content:y,source:u,textContent:(u||"").replace(/<[^>]*>/gim," ")},d.stat={images:P?0:g,internalLinks:P?0:v,externalLinks:P?0:x,focusKeywordInAltText:P?0:C,headings:P?0:f.count,words:P?0:k},d}getHeadings=(e,t=5,i=50)=>{let s=document.createElement("div");s.innerHTML=e;let r="h2, h3",o=jQuery(s).find(r);for(let a of["h4","h5","h6"])if(o?.length<t&&o?.length<i)r+=", "+a,o=jQuery(s).find(r);else break;return{headings:o,count:o?.length||0}};getContents(e){if(!e||e?.length===0)return;let t=this.cleanText,i=[];return e.each(function(s){let r=jQuery(this).prop("tagName").toLowerCase(),o=jQuery(this).text();if(o=t(o.replace(/<(\/?(a)|>)[^>]*>/gim,"")),o=o.replace(/\ /g," "),o==""||o.match(/\d*(,|\/)\d*/gis)||o.match(/(\w+)/gis)?.length<2)return;let a="",c=d=>{let u=d?.textContent||"";u.trim()===""||u.match(/(\w+)/gis)?.length<5||(a+=jQuery(d).html())};s===e.length-1?jQuery(this).nextAll("div, p").each(function(d,u){c(u)}):jQuery(this).nextUntil(e[s+1]).each(function(d,u){c(u)}),a=t(a.replace(/<(\/?(p)|>)[^>]*>/gim,`
`)),a!=""&&i.push({tag:r,title:o,text:a})}),i}cleanText=e=>(e=e.replace(/\s\s+/gm," "),e=e.replace(/ +/gm," "),e=e.replace(/\n+/gm,`
`),e.trim());getStat=(e,t=[])=>{let i={},s={},r=new Ee,o={total:{},max:{}};for(let[d,u]of t.entries()){let f=u?.keyword||"",y=f.trim().toLowerCase(),g=0,p=0,v=0,x=0,_=0,C=0,S=0,T=1,k=1,P=0,D=0,M=0,N=0;if(e.map(R=>{if(d===0)for(let[I,F]of Object.entries(R?.stat||{}))o?.total?.[I]||(o.total[I]=0),o?.max?.[I]||(o.max[I]=0),o.total[I]+=F,o.max[I]<F&&(o.max[I]=F);let L=0,B=0,W=0;if(R.content.map(I=>{let F=(I?.title||"").toLowerCase(),j=(I?.text||"").toLowerCase();F&&(x++,B+=r.findSingleMatch(F,y)),j&&(_++,W+=r.findSingleMatch(j,y))}),p<B&&(p=B),v<W&&(v=W),L=B+W,g<L&&(g=L),C+=B,S+=W,u.type==="focus"){let I=r.findSingleMatch(R.title,y),F=r.findSingleMatch(R.description,y);I>0&&(M+=R.title.split(y)?.length-1,P++,T=T<M?M:T),F>0&&(N+=R.description.split(y)?.length-1,D++,k=k<N?N:k),s[f]={type:"focus"},g===0&&(g=1)}}),u.type==="focus"&&(s[f]||(s[f]={type:"focus"}),s[f].metaTitle=[Math.ceil(M/P)||1,T],s[f].metaDescription=[Math.ceil(N/D)||1,k]),g!==0&&(s[f]||(s[f]={type:u.type}),p>0&&(s[f].heading=[Math.ceil(C/x),p]),v>0&&(s[f].content=[Math.ceil(S/_),v]),g>0)){let R=Math.ceil((C+S)/(x+_));s[f].total=[R<1?1:R,g]}}s?.[this.focusKeyword]&&(s[this.focusKeyword].imgAltText=[Math.ceil(o.total.focusKeywordInAltText/o.total.images),o.max.focusKeywordInAltText]),i.keywords=s,i.HtmlTagUsage={},i.HtmlTagUsage.paragraphUsage=[0,0],i.HtmlTagUsage.headingUsage=[Math.ceil(o.total.headings/e.length)||0,o.max.headings],i.HtmlTagUsage.imageUsage=[Math.ceil(o.total.images/e.length)||0,o.max.images],i.HtmlTagUsage.wordUsage=[Math.round(o.total.words/e.length)||0,o.max.words];let a=[1,1];o.max.internalLinks>0&&(a=[Math.ceil(o.total.internalLinks/e.length)||0,o.max.internalLinks]);let c=[1,1];return o.max.externalLinks>0&&(c=[Math.ceil(o.total.externalLinks/e.length)||0,o.max.externalLinks]),i.HtmlTagUsage.internalLinkUsage=a,i.HtmlTagUsage.externalLinkUsage=c,i}}});var Qt,Co=O(()=>{Qt=class{insertionField=null;editorName=null;currentDocument=document;constructor(e){e?(this.editorName="gutenberg",this.insertionField=document.querySelector(".is-root-container.wp-block-post-content")):this.findInsertionField()}findInsertionField=()=>{let e=document.getElementById("wp-content-editor-container"),t=document.querySelector(".wp-editor-area"),i="none";t&&(i=window.getComputedStyle(t).display);let s=document.getElementById("content_ifr"),r=s?.contentDocument||s?.contentWindow?.document;if(e&&r){this.editorName="classic",this.currentDocument=r;let o=r.body;this.insertionField=o}e&&i==="block"&&(this.editorName="classic",this.currentDocument=document,this.insertionField=t),document.querySelector("#web-view-editor .ql-editor")&&(this.insertionField=document.querySelector("#web-view-editor .ql-editor"),this.editorName="classic")};insertInClassicEditor=(e,t,i,s)=>{if(this.insertionField.innerHTML="",document.getElementById("post-body-content")&&document.getElementById("title")){let r=document.getElementById("title");r.value=e,document.getElementById("title-prompt-text").classList.add("screen-reader-text")}if(document.querySelector("#web-view-editor .ql-editor")){let r=this.currentDocument.createElement("h1");r.classList.add("blog-title"),r.innerHTML=e,this.insertionField.appendChild(r)}if(t=t.replace(/\n+/gm,`
`).replace(/\n/gm,"<br/> <br/>"),this.insertionField?.tagName==="TEXTAREA")this.insertionField.value=this.insertionField.value+t;else{let r=this.currentDocument.createElement("p");r.innerHTML=t,this.insertionField.appendChild(r)}this.appendInClassicEditor(i,s)};appendInClassicEditor=(e,t)=>{let i=[],s=[];Array.from(this.insertionField.children).forEach(o=>{s.push(o?.textContent)}),i=e.filter(o=>s.indexOf(o)===-1);for(let o of i){let a=this.currentDocument.createElement("h2");a.innerHTML=o,this.insertionField?.tagName==="TEXTAREA"?this.insertionField.value=this.insertionField.value+a.outerHTML:this.insertionField.appendChild(a);let c=t[o];if(!c)continue;let d=this.currentDocument.createElement("p");d.innerHTML=c?.paragraph,this.insertionField?.tagName==="TEXTAREA"?this.insertionField.value=this.insertionField.value+d.outerHTML:this.insertionField.appendChild(d)}};insertInGutenbergBlock=(e,t,i,s)=>{t=t.replace(/\n+/gm,`
`).replace(/\n/gm,"<br/> <br/>"),wp.data.dispatch("core/editor").editPost({title:e}),wp.data.dispatch("core/editor").editPost({excerpt:t}),wp.data.dispatch("core/block-editor").resetBlocks(wp.blocks.parse("")),wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:t})),this.appendInGutenbergBlock(i,s)};appendInGutenbergBlock=(e,t)=>{let i=[],s=[],r=wp.data.select("core/block-editor").getBlocks();for(let o of r)o?.name=="core/heading"&&(o?.originalContent?i.push(o?.originalContent.replace(/<\/?[^>]+(>|$)/g,"")):i.push(o?.attributes?.content?.replace(/<\/?[^>]+(>|$)/g,"")));s=e.filter(o=>i.indexOf(o)===-1);for(let o of s){wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:o}));let a=t[o];!a||wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:a?.paragraph}))}};appendOutlines=(e,t)=>{this.editorName==="classic"?this.appendInClassicEditor(e,t):this.editorName==="gutenberg"&&this.appendInGutenbergBlock(e,t),this.closeSidebar()};closeSidebar=()=>{window.getGenie?.isPlayground?wp.data.dispatch("getgenie").setSidebar({open:!0,component:"TemplateListScreen",currentTemplate:"list"}):wp.data.dispatch("getgenie").setSidebar({open:!1})};insertContent=(e,t,i,s)=>{this.editorName==="classic"?this.insertInClassicEditor(e,t,i,s):this.editorName==="gutenberg"&&this.insertInGutenbergBlock(e,t,i,s),this.closeSidebar()};insertCompetitorContentGutenberg=(e,t,i,s)=>{let r=wp.data.select("core/block-editor"),o=r.getBlocks(),a=r.getSelectedBlockClientId(),c=o.findIndex(d=>d.clientId===a);wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:i}),c+1),wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:s}),c+2),e(t)};insertCompetitorContentIframe=(e,t,i,s,r)=>{let o=document.getElementById(e),a=o.contentDocument||o.contentWindow.document,c=a.getSelection().focusNode?.parentElement,d=a.createElement("h2");d.innerHTML=s;let u=a.createElement("p");u.innerHTML=r,c.insertAdjacentElement("afterend",d),d.insertAdjacentElement("afterend",u),t(i)};insertCompetitorContentWebview=(e,t,i,s)=>{let r=document.querySelector("#web-view-editor .ql-editor"),o=document.createElement("h2");o.innerHTML=i;let a=document.createElement("p");a.innerHTML=s,r.appendChild(o),r.appendChild(a),e(t)}}});var Jn,oO,aO,dp,lO,cO,ko,dO,uO,Vs,Pc,hO,up,To,Nc=O(()=>{Co();({Libs:Jn,Utilities:oO}=window.getGenie.Components.Common),{GenieHelpers:aO}=oO,{Button:dp,Card:lO,Checkbox:cO,Col:ko,Divider:dO,Row:uO,Typography:Vs,Tooltip:Pc}=window.antd,{ComposeComponents:hO}=window.getGenie.Components.Common.ReduxManager,{useState:up}=window.React,To=hO(({data:n,loading:e=!1,loadingText:t="",page:i=0,getInputs:s,limitUsage:r,setInput:o,sidebar:a,fetchData:c=null,setSidebar:d})=>{let[u,f]=up(""),[y,g]=up(""),p=new Qt(window.getGenie.config.isBlockEditor),v=s.selectedOutlines||[],x=n,_=(R,L)=>{let B=[...v];B.indexOf(L)!=-1?B.splice(B.indexOf(L),1):B.push(L),o("selectedOutlines",B)},C=R=>{let L=document.createElement("div");return L.innerHTML=R,L.querySelectorAll("a").forEach(B=>{B.setAttribute("target","_blank")}),L.innerHTML},S=(R,L)=>{R.stopPropagation(),y!==L&&Jn.ConfirmModal("Insert Content?",`To avoid plagiarism from using someone else's content,
you're advised to either edit the content to add unique value or use GetGenie's
"text rewriter" template.`,()=>{let B=L.split(/<br\s*\/?>/gi);B=B.filter(F=>F!=="");let W=B[0],I=B.slice(1).join(`
`);window.getGenie.config.isBlockEditor&&p.insertCompetitorContentGutenberg(g,L,W,I),document.getElementById("post-body-content")&&p.insertCompetitorContentIframe("content_ifr",g,L,W,I),document.querySelector("#web-view-editor .ql-editor")&&p.insertCompetitorContentWebview(g,L,W,I)})},T=(R,L)=>{R.stopPropagation();let B=L.replace(/<br\s*\/?>/gi,`
`);B=B.replace(/<\/?[^>]+(>|$)/g,""),aO.copyToClipboard(B).then(()=>{f(L)}).catch(()=>console.log("error"))},k=R=>{try{return new URL(R),!0}catch{return!1}},P=()=>{c()},D=x||[];Array.isArray(D)||(D=[]);let M=(i<3||e)&&c&&s.competitorData?.length>0,N=()=>{o("competitorData",""),d({analyzingCompetitors:!0}),c()};return React.createElement(React.Fragment,null,e?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,t),React.createElement(Jn.Loading,{size:22})," "):Array.isArray(s.competitorData)?M?React.createElement("div",{className:"refetch-icon",onClick:N},React.createElement(Pc,{placement:"topLeft",title:"Refetch the competitor list"},React.createElement("span",{className:"refetch-text"},"Refetch")),React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},React.createElement("circle",{cx:"11",cy:"11",r:"11",fill:"#031233",fillOpacity:"0.1"}),React.createElement("path",{d:"M16.3793 10.3795H16.3787C16.2972 10.3796 16.2165 10.3957 16.1412 10.4269C16.066 10.4582 15.9976 10.504 15.94 10.5617C15.8824 10.6194 15.8367 10.6878 15.8056 10.7632C15.7745 10.8385 15.7585 10.9192 15.7586 11.0007C15.7578 11.871 15.5185 12.7243 15.0667 13.4681C14.6149 14.2118 13.9678 14.8175 13.1959 15.2192C12.424 15.621 11.5567 15.8034 10.6883 15.7468C9.81997 15.6902 8.98373 15.3966 8.27053 14.898C6.12132 13.3931 5.5971 10.4202 7.10202 8.27094C8.60693 6.1217 11.5798 5.59743 13.7291 7.1024C14.0542 7.32948 14.3497 7.59629 14.6087 7.89665H12.8619C12.6973 7.89665 12.5394 7.96205 12.423 8.07845C12.3066 8.19486 12.2412 8.35274 12.2412 8.51736C12.2412 8.68198 12.3066 8.83986 12.423 8.95627C12.5394 9.07268 12.6973 9.13807 12.8619 9.13807H15.7586C15.9232 9.13807 16.0811 9.07268 16.1975 8.95627C16.3139 8.83986 16.3793 8.68198 16.3793 8.51736V5.62071C16.3793 5.45609 16.3139 5.29821 16.1975 5.1818C16.0811 5.0654 15.9232 5 15.7586 5C15.594 5 15.4361 5.0654 15.3197 5.1818C15.2033 5.29821 15.1379 5.45609 15.1379 5.62071V6.65438C14.92 6.4477 14.6872 6.25752 14.4411 6.08539C13.7957 5.63347 13.0676 5.3131 12.2984 5.14257C11.5291 4.97204 10.7339 4.95469 9.95793 5.09151C9.182 5.22833 8.44061 5.51665 7.7761 5.93999C7.1116 6.36333 6.53698 6.91341 6.08506 7.55883C5.17237 8.8623 4.81486 10.475 5.09118 12.042C5.3675 13.6091 6.25502 15.0022 7.5585 15.9149C8.56207 16.6218 9.75954 17.0013 10.9871 17.0015C11.3406 17.0014 11.6935 16.9703 12.0417 16.9088C13.4309 16.6637 14.6893 15.9371 15.5961 14.8565C16.5028 13.7758 16.9999 12.4103 17 10.9997C16.9999 10.8351 16.9344 10.6774 16.818 10.5611C16.7016 10.4448 16.5438 10.3795 16.3793 10.3795Z",fill:"#57595F"}))):"":React.createElement(dp,{className:"getgenie-fetch-competitor-btn",onClick:c},a.__("Fetch Data","getgenie")),React.createElement("div",{className:"getgenie-competitor-tab"},x?.length===0?React.createElement(Vs.Title,{level:5,className:"getgenie-not-found-title"},a.__("No related data was found.","getgenie")):"",React.createElement(Jn.BlurElement,{show:D?.length>3&&r.subscription_type!=="pro",top:960,text:"Analyze competitors for insights to stay ahead of them.",btnText:"Upgrade Now",href:"https://getgenie.ai/pricing/",textMargin:0},D?.map((R,L,B)=>React.createElement("div",{key:L},React.createElement("div",null,React.createElement(uO,{className:"getgenie-competitor-overview",gutter:8},React.createElement(ko,{className:"gutter-row"},e?"":React.createElement("div",{className:"getgenie-text"},a.__("Rank:","getgenie")," ",L+1)),React.createElement(ko,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Words:","getgenie")," ",R?.stat?.words)),React.createElement(ko,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Heading:","getgenie")," ",R?.stat?.headings)),React.createElement(ko,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Images:","getgenie")," ",R?.stat?.images))),React.createElement(lO,{className:"getgenie-competitor-card"},React.createElement("a",{href:R?.url,className:"getgenie-competitor-link",target:"_blank"},k(R?.favicon)?React.createElement("img",{className:"page-favicon",src:R?.favicon}):React.createElement("span",{className:"page-url getgenie-icon-earth"}),React.createElement(Vs.Text,{className:"page-url",ellipsis:{tooltip:R?.url}},R?.url)),React.createElement(Vs.Title,{level:5,className:"getgenie-competitor-title"},R.title),React.createElement("p",{className:"getgenie-competitor-text",dangerouslySetInnerHTML:{__html:C(R?.description||"")}}),React.createElement(Jn.Popover,{content:React.createElement("div",{className:"getgenie-tags-popover"},React.createElement(Jn.Collapse,{showArrow:!1,accordion:!0},R?.content?.map((W,I)=>React.createElement(Jn.Collapse.Panel,{key:I,header:React.createElement("div",{className:"getgenie-competitor-tag-container"},a.currentScreen==="outlineScreen"?React.createElement("div",{onClick:F=>F.stopPropagation()},React.createElement(cO,{checked:v.indexOf(W.title)!=-1,onChange:F=>_(F,W?.title)},React.createElement("div",{className:"tag-content"},React.createElement("h5",{className:"tag-name"},W?.tag),React.createElement("h5",{className:"tag-title"},W?.title)))):React.createElement("div",{className:"tag-content"},React.createElement("h5",{className:"tag-name"},W?.tag),React.createElement("h5",{className:"tag-title"},W?.title)),React.createElement("div",{className:"actions"},a.currentScreen!=="outlineScreen"?React.createElement("div",{className:"item-button"},React.createElement("div",{className:"copy"},React.createElement(Pc,{placement:"bottom",zIndex:99999,title:u===W?.title+" "+W?.text?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:F=>T(F,W?.title+" "+W?.text)}))),React.createElement("div",{className:"insert"},React.createElement(Pc,{title:y!==W?.title+"<br>"+W?.text?"Insert into the editor":"Already inserted",placement:"bottom",zIndex:99999},React.createElement("span",{className:`insert-icon ${y===W?.title+"<br>"+W?.text?"getgenie-icon-check":"getgenie-icon-insert"}`,onClick:F=>S(F,W?.title+"<br>"+W?.text)})))):" ",React.createElement("span",{className:"custom-collapse-icon getgenie-icon-arrow_down"})))},React.createElement("p",{dangerouslySetInnerHTML:{__html:C(W?.text)}}))))),overlayStyle:{width:"500px",height:"350px"},overlayClassName:"getgenie-competitor-popover",placement:"left"},React.createElement("div",{className:"getgenie-competitor-tag"},React.createElement("div",{className:"getgenie-competitor-tag-list"},React.createElement(Vs.Title,{level:5,className:"getgenie-competitor-tag-name"},R?.content[0]?.tag),React.createElement(Vs.Title,{level:5,className:"getgenie-competitor-tag-content"},R?.content[0]?.title)),React.createElement(dp,{disabled:R?.content?.length===0,className:"getgenie-competitor-tag-moreBtn",type:"link"},a.__("more contents","getgenie"),React.createElement("span",{className:"getgenie-icon-arrow-up-right"})))))),L!=B.length-1&&React.createElement(dO,null))),M?React.createElement(Jn.Button,{loading:e,onClick:P},"Load More"):"")))},["sidebar","getInputs","setInput","limitUsage","setSidebar"])});var Rc,fO,At,pO,gO,hp,fp=O(()=>{({Col:Rc,Row:fO,Typography:At,Divider:pO}=window.antd),{ComposeComponents:gO}=window.getGenie.Components.Common.ReduxManager,hp=gO(({getInputs:n,sidebar:e})=>{let t=n.searchVolume,i=[{title:"Last Month",value:t?.searchVolume?.lastMonth},{title:"Average 12 month",value:t?.searchVolume?.avg12Month},{title:"Highest",value:t?.searchVolume?.highest},{title:"Lowest",value:t?.searchVolume?.lowest}];return React.createElement("div",{className:"getgenie-keyword-analysis"},React.createElement(At.Title,{level:4,className:"getgenie-title"},e.__("Keyword Analysis","getgenie")),t?React.createElement(React.Fragment,null,React.createElement(fO,{gutter:6},React.createElement(Rc,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result volume"},React.createElement(At.Title,{level:5,className:"getgenie-title"},e.__("Search Volume","getgenie")),React.createElement("div",{className:"getgenie-result-item"},React.createElement(At.Text,{className:"getgenie-text"},t?.searchVolume?.total||"-"),React.createElement("span",{className:"getgenie-icon-search"})))),React.createElement(Rc,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result competition"},React.createElement(At.Title,{level:5,className:"getgenie-title"},e.__("Competition","getgenie")),React.createElement("div",{className:"getgenie-result-item"},React.createElement(At.Text,{className:"getgenie-text"},t?.searchVolume?.competition||"-"),React.createElement("span",{className:"getgenie-icon-competition_icon"})))),React.createElement(Rc,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result cpc"},React.createElement(At.Title,{level:5,className:"getgenie-title"},"CPC"),React.createElement("div",{className:"getgenie-result-item"},React.createElement(At.Text,{className:"getgenie-text"},t?.searchVolume?.cpc?.currency||"-"," ",t?.searchVolume?.cpc?.value),React.createElement("span",{className:"getgenie-icon-cpc_icon"}))))),i?.[1]?.value?React.createElement("div",{className:"getgenie-list-data"},i.map((s,r)=>React.createElement("div",{key:r},React.createElement("div",{className:"getgenie-list-data-container"},React.createElement(At.Title,{level:5,className:"getgenie-list-data-title"},s.title),React.createElement(At.Title,{level:5,className:"getgenie-list-data-value"},s.value)),r!==i.length-1&&React.createElement(pO,null)))):""):React.createElement(At.Title,{level:5,className:"getgenie-not-found-title"},e.__("No magic found for this keyword. Maybe try a different one?","getgenie")))},["getInputs","sidebar"])});var mO,pp,yO,bO,vO,gp,mp=O(()=>{({Libs:mO}=window.getGenie.Components.Common),{useState:pp,memo:yO,useEffect:bO}=window.React,vO=yO(({data:n})=>{let[e,t]=pp(null),[i,s]=pp(!0);return bO(()=>{if(!n)return;let o=encodeURIComponent(n),a="https://trends.google.com:443/trends/embed/explore/TIMESERIES?req=%7B%22comparisonItem%22%3A%5B%7B%22keyword%22%3A%22#ENCODED_KEYWORD#%22%2C%22geo%22%3A%22%22%2C%22time%22%3A%22today%2012-m%22%7D%5D%2C%22category%22%3A0%2C%22property%22%3A%22%22%7D&tz=-360&eq=q%3D#DOUBLE_ENCODED_KEYWORD#%26date%3Dtoday%2012-m";a=a.replace("#ENCODED_KEYWORD#",o),a=a.replace("#DOUBLE_ENCODED_KEYWORD#",encodeURIComponent(o)),t(a)},[n]),e&&React.createElement(React.Fragment,null,React.createElement("iframe",{onLoad:o=>{o.target.style.display="block",s(!1)},id:"trends-widget-1",title:"trends-widget-1",src:e,className:"getgenie-chart",frameBorder:"0",scrolling:"0",style:{height:"370px",width:"300px",padding:0,display:"none"}}),i?React.createElement(mO.Loading,null):"")}),gp=vO});function Dt(){}function ie(n){return n===null||typeof n>"u"}function he(n){if(Array.isArray&&Array.isArray(n))return!0;let e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Q(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function et(n,e){return Pe(n)?n:e}function J(n,e){return typeof n>"u"?e:n}function le(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ce(n,e,t,i){let s,r,o;if(he(n))if(r=n.length,i)for(s=r-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<r;s++)e.call(t,n[s],s);else if(Q(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)e.call(t,n[o[s]],o[s])}function $i(n,e){let t,i,s,r;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],r=e[t],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function $s(n){if(he(n))return n.map($s);if(Q(n)){let e=Object.create(null),t=Object.keys(n),i=t.length,s=0;for(;s<i;++s)e[t[s]]=$s(n[t[s]]);return e}return n}function Pp(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Np(n,e,t,i){if(!Pp(n))return;let s=e[n],r=t[n];Q(s)&&Q(r)?at(s,r,i):e[n]=$s(r)}function at(n,e,t){let i=he(e)?e:[e],s=i.length;if(!Q(n))return n;t=t||{};let r=t.merger||Np;for(let o=0;o<s;++o){if(e=i[o],!Q(e))continue;let a=Object.keys(e);for(let c=0,d=a.length;c<d;++c)r(a[c],n,e,t)}return n}function ni(n,e){return at(n,e,{merger:Rp})}function Rp(n,e,t){if(!Pp(n))return;let i=e[n],s=t[n];Q(i)&&Q(s)?ni(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=$s(s))}function It(n,e){return(yp[e]||(yp[e]=wO(e)))(n)}function wO(n){let e=Ap(n);return t=>{for(let i of e){if(i==="")break;t=t&&t[i]}return t}}function Ap(n){let e=n.split("."),t=[],i="";for(let s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ks(n){return n.charAt(0).toUpperCase()+n.slice(1)}function jc(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}function Fo(n){let e=Math.round(n);n=ii(n,e,n/1e3)?e:n;let t=Math.pow(10,Math.floor(tt(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Vc(n){let e=[],t=Math.sqrt(n),i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,r)=>s-r).pop(),e}function Tn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ii(n,e,t){return Math.abs(n-e)<t}function Yc(n,e){let t=Math.round(n);return t-e<=n&&t+e>=n}function Bo(n,e,t){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function Me(n){return n*(ae/180)}function si(n){return n*(180/ae)}function zo(n){if(!Pe(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Ho(n,e){let t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i),r=Math.atan2(i,t);return r<-.5*ae&&(r+=fe),{angle:r,distance:s}}function Cn(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Ip(n,e){return(n-e+Lp)%fe-ae}function ot(n){return(n%fe+fe)%fe}function ri(n,e,t,i){let s=ot(n),r=ot(e),o=ot(t),a=ot(r-s),c=ot(o-s),d=ot(s-r),u=ot(s-o);return s===r||s===o||i&&r===o||a>c&&d<u}function ze(n,e,t){return Math.max(e,Math.min(t,n))}function Uc(n){return ze(n,-32768,32767)}function Ft(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qs(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,t(r)?s=r:i=r;return{lo:s,hi:i}}function Gc(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}function Kc(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Fp.forEach(t=>{let i="_onData"+Ks(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...r){let o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Wo(n,e){let t=n._chartjs;if(!t)return;let i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Fp.forEach(r=>{delete n[r]}),delete n._chartjs)}function jo(n){let e=new Set,t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}function Yo(n,e,t){let i=t||(o=>Array.prototype.slice.call(o)),s=!1,r=[];return function(...o){r=i(o),s||(s=!0,Vo.call(window,()=>{s=!1,n.apply(e,r)}))}}function qc(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}function Uo(n,e,t){let i=e.length,s=0,r=i;if(n._sorted){let{iScale:o,_parsed:a}=n,c=o.axis,{min:d,max:u,minDefined:f,maxDefined:y}=o.getUserBounds();f&&(s=ze(Math.min(nn(a,o.axis,d).lo,t?i:nn(e,c,o.getPixelForValue(d)).lo),0,i-1)),y?r=ze(Math.max(nn(a,o.axis,u,!0).hi+1,t?0:nn(e,c,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function $o(n){let{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;let r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),r}function Zs(n){return n+.5|0}function Ys(n){return _n(Zs(n*2.55),0,255)}function Sn(n){return _n(Zs(n*255),0,255)}function en(n){return _n(Zs(n/2.55)/100,0,1)}function xp(n){return _n(Zs(n*100),0,100)}function CO(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&yt[n[1]]*17,g:255&yt[n[2]]*17,b:255&yt[n[3]]*17,a:e===5?yt[n[4]]*17:255}:(e===7||e===9)&&(t={r:yt[n[1]]<<4|yt[n[2]],g:yt[n[3]]<<4|yt[n[4]],b:yt[n[5]]<<4|yt[n[6]],a:e===9?yt[n[7]]<<4|yt[n[8]]:255})),t}function TO(n){var e=SO(n)?xO:_O;return n?"#"+e(n.r)+e(n.g)+e(n.b)+kO(n.a,e):void 0}function Bp(n,e,t){let i=e*Math.min(t,1-t),s=(r,o=(r+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function DO(n,e,t){let i=(s,r=(s+n/60)%6)=>t-t*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function EO(n,e,t){let i=Bp(n,1,.5),s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function MO(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Zc(n){let t=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s),a=(r+o)/2,c,d,u;return r!==o&&(u=r-o,d=a>.5?u/(2-r-o):u/(r+o),c=MO(t,i,s,u,r),c=c*60+.5),[c|0,d||0,a]}function Jc(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Sn)}function Qc(n,e,t){return Jc(Bp,n,e,t)}function PO(n,e,t){return Jc(EO,n,e,t)}function NO(n,e,t){return Jc(DO,n,e,t)}function zp(n){return(n%360+360)%360}function RO(n){let e=OO.exec(n),t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ys(+e[5]):Sn(+e[5]));let s=zp(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=PO(s,r,o):e[1]==="hsv"?i=NO(s,r,o):i=Qc(s,r,o),{r:i[0],g:i[1],b:i[2],a:t}}function AO(n,e){var t=Zc(n);t[0]=zp(t[0]+e),t=Qc(t),n.r=t[0],n.g=t[1],n.b=t[2]}function LO(n){if(!n)return;let e=Zc(n),t=e[0],i=xp(e[1]),s=xp(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${en(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}function IO(){let n={},e=Object.keys(Sp),t=Object.keys(_p),i,s,r,o,a;for(i=0;i<e.length;i++){for(o=a=e[i],s=0;s<t.length;s++)r=t[s],a=a.replace(r,_p[r]);r=parseInt(Sp[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}function FO(n){Eo||(Eo=IO(),Eo.transparent=[0,0,0,0]);let e=Eo[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}function zO(n){let e=BO.exec(n),t=255,i,s,r;if(!!e){if(e[7]!==i){let o=+e[7];t=e[8]?Ys(o):_n(o*255,0,255)}return i=+e[1],s=+e[3],r=+e[5],i=255&(e[2]?Ys(i):_n(i,0,255)),s=255&(e[4]?Ys(s):_n(s,0,255)),r=255&(e[6]?Ys(r):_n(r,0,255)),{r:i,g:s,b:r,a:t}}}function HO(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${en(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}function WO(n,e,t){let i=Wi(en(n.r)),s=Wi(en(n.g)),r=Wi(en(n.b));return{r:Sn(Ac(i+t*(Wi(en(e.r))-i))),g:Sn(Ac(s+t*(Wi(en(e.g))-s))),b:Sn(Ac(r+t*(Wi(en(e.b))-r))),a:n.a+t*(e.a-n.a)}}function Mo(n,e,t){if(n){let i=Zc(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Qc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Hp(n,e){return n&&Object.assign(e||{},n)}function Cp(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Sn(n[3]))):(e=Hp(n,{r:0,g:0,b:0,a:1}),e.a=Sn(e.a)),e}function jO(n){return n.charAt(0)==="r"?zO(n):RO(n)}function Wp(n){return new Vi(n)}function ed(n){if(n&&typeof n=="object"){let e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Go(n){return ed(n)?n:Wp(n)}function No(n){return ed(n)?n:Wp(n).saturate(.5).darken(.1).hexString()}function Us(n,e){if(!e)return n;let t=e.split(".");for(let i=0,s=t.length;i<s;++i){let r=t[i];n=n[r]||(n[r]=Object.create(null))}return n}function Lc(n,e,t){return typeof e=="string"?at(Us(n,e),t):at(Us(n,""),e)}function jp(n){return!n||ie(n.size)||ie(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Yi(n,e,t,i,s){let r=e[s];return r||(r=e[s]=n.measureText(s).width,t.push(s)),r>i&&(i=r),i}function td(n,e,t,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},r=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0,a=t.length,c,d,u,f,y;for(c=0;c<a;c++)if(f=t[c],f!=null&&he(f)!==!0)o=Yi(n,s,r,o,f);else if(he(f))for(d=0,u=f.length;d<u;d++)y=f[d],y!=null&&!he(y)&&(o=Yi(n,s,r,o,y));n.restore();let g=r.length/2;if(g>t.length){for(c=0;c<g;c++)delete s[r[c]];r.splice(0,g)}return o}function sn(n,e,t){let i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function qo(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function oi(n,e,t,i){Xo(n,e,t,i,null)}function Xo(n,e,t,i,s){let r,o,a,c,d,u,f=e.pointStyle,y=e.rotation,g=e.radius,p=(y||0)*Io;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(p),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),f){default:s?n.ellipse(t,i,s/2,g,0,0,fe):n.arc(t,i,g,0,fe),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(p)*g,i-Math.cos(p)*g),p+=Fc,n.lineTo(t+Math.sin(p)*g,i-Math.cos(p)*g),p+=Fc,n.lineTo(t+Math.sin(p)*g,i-Math.cos(p)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,o=Math.cos(p+ji)*c,a=Math.sin(p+ji)*c,n.arc(t-o,i-a,d,p-ae,p-Oe),n.arc(t+a,i-o,d,p-Oe,p),n.arc(t+o,i+a,d,p,p+Oe),n.arc(t-a,i+o,d,p+Oe,p+ae),n.closePath();break;case"rect":if(!y){c=Math.SQRT1_2*g,u=s?s/2:c,n.rect(t-u,i-c,2*u,2*c);break}p+=ji;case"rectRot":o=Math.cos(p)*g,a=Math.sin(p)*g,n.moveTo(t-o,i-a),n.lineTo(t+a,i-o),n.lineTo(t+o,i+a),n.lineTo(t-a,i+o),n.closePath();break;case"crossRot":p+=ji;case"cross":o=Math.cos(p)*g,a=Math.sin(p)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o);break;case"star":o=Math.cos(p)*g,a=Math.sin(p)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o),p+=ji,o=Math.cos(p)*g,a=Math.sin(p)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o);break;case"line":o=s?s/2:Math.cos(p)*g,a=Math.sin(p)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(p)*g,i+Math.sin(p)*g);break}n.fill(),e.borderWidth>0&&n.stroke()}}function ti(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function ai(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function li(n){n.restore()}function nd(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){let r=(e.x+t.x)/2;n.lineTo(r,e.y),n.lineTo(r,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function id(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function rn(n,e,t,i,s,r={}){let o=he(e)?e:[e],a=r.strokeWidth>0&&r.strokeColor!=="",c,d;for(n.save(),n.font=s.string,VO(n,r),c=0;c<o.length;++c)d=o[c],a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),ie(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(d,t,i,r.maxWidth)),n.fillText(d,t,i,r.maxWidth),YO(n,t,i,d,r),i+=s.lineHeight;n.restore()}function VO(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),ie(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function YO(n,e,t,i,s){if(s.strikethrough||s.underline){let r=n.measureText(i),o=e-r.actualBoundingBoxLeft,a=e+r.actualBoundingBoxRight,c=t-r.actualBoundingBoxAscent,d=t+r.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function on(n,e){let{x:t,y:i,w:s,h:r,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-Oe,ae,!0),n.lineTo(t,i+r-o.bottomLeft),n.arc(t+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ae,Oe,!0),n.lineTo(t+s-o.bottomRight,i+r),n.arc(t+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Oe,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-Oe,!0),n.lineTo(t+o.topLeft,i)}function Vp(n,e){let t=(""+n).match(UO);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}function Js(n,e){let t={},i=Q(e),s=i?Object.keys(e):e,r=Q(n)?i?o=>J(n[o],n[e[o]]):o=>n[o]:()=>n;for(let o of s)t[o]=GO(r(o));return t}function Zo(n){return Js(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Et(n){return Js(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ke(n){let e=Zo(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function we(n,e){n=n||{},e=e||ee.font;let t=J(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=J(n.style,e.style);i&&!(""+i).match($O)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let s={family:J(n.family,e.family),lineHeight:Vp(J(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:J(n.weight,e.weight),string:""};return s.string=jp(s),s}function ye(n,e,t,i){let s=!0,r,o,a;for(r=0,o=n.length;r<o;++r)if(a=n[r],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),s=!1),t!==void 0&&he(a)&&(a=a[t%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function sd(n,e,t){let{min:i,max:s}=n,r=Ao(e,(s-i)/2),o=(a,c)=>t&&a===0?0:a+c;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Bt(n,e){return Object.assign(Object.create(n),e)}function Qs(n,e=[""],t=n,i,s=()=>n[0]){De(i)||(i=$p("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Qs([o,...n],e,t,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete n[0][a],!0},get(o,a){return Yp(o,a,()=>tD(a,e,n,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,a){return Tp(o).includes(a)},ownKeys(o){return Tp(o)},set(o,a,c){let d=o._storage||(o._storage=s());return o[a]=d[a]=c,delete o._keys,!0}})}function kn(n,e,t,i){let s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Jo(n,i),setContext:r=>kn(n,r,t,i),override:r=>kn(n.override(r),e,t,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Yp(r,o,()=>qO(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Jo(n,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Lt(t)?t:()=>t,isIndexable:Lt(i)?i:()=>i}}function Yp(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];let i=t();return n[e]=i,i}function qO(n,e,t){let{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n,a=i[e];return Lt(a)&&o.isScriptable(e)&&(a=XO(e,a,n,t)),he(a)&&a.length&&(a=ZO(e,a,n,o.isIndexable)),rd(e,a)&&(a=kn(a,s,r&&r[e],o)),a}function XO(n,e,t,i){let{_proxy:s,_context:r,_subProxy:o,_stack:a}=t;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);return a.add(n),e=e(r,o||i),a.delete(n),rd(n,e)&&(e=od(s._scopes,s,n,e)),e}function ZO(n,e,t,i){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=t;if(De(r.index)&&i(n))e=e[r.index%e.length];else if(Q(e[0])){let c=e,d=s._scopes.filter(u=>u!==c);e=[];for(let u of c){let f=od(d,s,n,u);e.push(kn(f,r,o&&o[n],a))}}return e}function Up(n,e,t){return Lt(n)?n(e,t):n}function QO(n,e,t,i,s){for(let r of e){let o=JO(t,r);if(o){n.add(o);let a=Up(o._fallback,t,s);if(De(a)&&a!==t&&a!==i)return a}else if(o===!1&&De(i)&&t!==i)return null}return!1}function od(n,e,t,i){let s=e._rootScopes,r=Up(e._fallback,t,i),o=[...n,...s],a=new Set;a.add(i);let c=kp(a,o,t,r||t,i);return c===null||De(r)&&r!==t&&(c=kp(a,o,r,c,i),c===null)?!1:Qs(Array.from(a),[""],s,r,()=>eD(e,t,i))}function kp(n,e,t,i,s){for(;t;)t=QO(n,e,t,i,s);return t}function eD(n,e,t){let i=n._getTarget();e in i||(i[e]={});let s=i[e];return he(s)&&Q(t)?t:s}function tD(n,e,t,i){let s;for(let r of e)if(s=$p(KO(r,n),t),De(s))return rd(n,s)?od(t,i,n,s):s}function $p(n,e){for(let t of e){if(!t)continue;let i=t[n];if(De(i))return i}}function Tp(n){let e=n._keys;return e||(e=n._keys=nD(n._scopes)),e}function nD(n){let e=new Set;for(let t of n)for(let i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Qo(n,e,t,i){let{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i),a,c,d,u;for(a=0,c=i;a<c;++a)d=a+t,u=e[d],o[a]={r:s.parse(It(u,r),d)};return o}function Kp(n,e,t,i){let s=n.skip?e:n,r=e,o=t.skip?e:t,a=Cn(r,s),c=Cn(o,r),d=a/(a+c),u=c/(a+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;let f=i*d,y=i*u;return{previous:{x:r.x-f*(o.x-s.x),y:r.y-f*(o.y-s.y)},next:{x:r.x+y*(o.x-s.x),y:r.y+y*(o.y-s.y)}}}function sD(n,e,t){let i=n.length,s,r,o,a,c,d=Ui(n,0);for(let u=0;u<i-1;++u)if(c=d,d=Ui(n,u+1),!(!c||!d)){if(ii(e[u],0,iD)){t[u]=t[u+1]=0;continue}s=t[u]/e[u],r=t[u+1]/e[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),t[u]=s*o*e[u],t[u+1]=r*o*e[u])}}function rD(n,e,t="x"){let i=Gp(t),s=n.length,r,o,a,c=Ui(n,0);for(let d=0;d<s;++d){if(o=a,a=c,c=Ui(n,d+1),!a)continue;let u=a[t],f=a[i];o&&(r=(u-o[t])/3,a[`cp1${t}`]=u-r,a[`cp1${i}`]=f-r*e[d]),c&&(r=(c[t]-u)/3,a[`cp2${t}`]=u+r,a[`cp2${i}`]=f+r*e[d])}}function qp(n,e="x"){let t=Gp(e),i=n.length,s=Array(i).fill(0),r=Array(i),o,a,c,d=Ui(n,0);for(o=0;o<i;++o)if(a=c,c=d,d=Ui(n,o+1),!!c){if(d){let u=d[e]-c[e];s[o]=u!==0?(d[t]-c[t])/u:0}r[o]=a?d?bt(s[o-1])!==bt(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}sD(n,s,r),rD(n,r,e)}function Po(n,e,t){return Math.max(Math.min(n,t),e)}function oD(n,e){let t,i,s,r,o,a=ti(n[0],e);for(t=0,i=n.length;t<i;++t)o=r,r=a,a=t<i-1&&ti(n[t+1],e),r&&(s=n[t],o&&(s.cp1x=Po(s.cp1x,e.left,e.right),s.cp1y=Po(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=Po(s.cp2x,e.left,e.right),s.cp2y=Po(s.cp2y,e.top,e.bottom)))}function ad(n,e,t,i,s){let r,o,a,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")qp(n,s);else{let d=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],c=Kp(d,a,n[Math.min(r+1,o-(i?0:1))%o],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,d=a}e.capBezierPoints&&oD(n,t)}function ea(){return typeof window<"u"&&typeof document<"u"}function er(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ro(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}function Xp(n,e){return ta(n).getPropertyValue(e)}function ei(n,e,t){let i={};t=t?"-"+t:"";for(let s=0;s<4;s++){let r=aD[s];i[r]=parseFloat(n[e+"-"+r+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function cD(n,e){let t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:r}=i,o=!1,a,c;if(lD(s,r,n.target))a=s,c=r;else{let d=e.getBoundingClientRect();a=i.clientX-d.left,c=i.clientY-d.top,o=!0}return{x:a,y:c,box:o}}function an(n,e){if("native"in n)return n;let{canvas:t,currentDevicePixelRatio:i}=e,s=ta(t),r=s.boxSizing==="border-box",o=ei(s,"padding"),a=ei(s,"border","width"),{x:c,y:d,box:u}=cD(n,t),f=o.left+(u&&a.left),y=o.top+(u&&a.top),{width:g,height:p}=e;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((c-f)/g*t.width/i),y:Math.round((d-y)/p*t.height/i)}}function dD(n,e,t){let i,s;if(e===void 0||t===void 0){let r=er(n);if(!r)e=n.clientWidth,t=n.clientHeight;else{let o=r.getBoundingClientRect(),a=ta(r),c=ei(a,"border","width"),d=ei(a,"padding");e=o.width-d.width-c.width,t=o.height-d.height-c.height,i=Ro(a.maxWidth,r,"clientWidth"),s=Ro(a.maxHeight,r,"clientHeight")}}return{width:e,height:t,maxWidth:i||Gs,maxHeight:s||Gs}}function ld(n,e,t,i){let s=ta(n),r=ei(s,"margin"),o=Ro(s.maxWidth,n,"clientWidth")||Gs,a=Ro(s.maxHeight,n,"clientHeight")||Gs,c=dD(n,e,t),{width:d,height:u}=c;if(s.boxSizing==="content-box"){let f=ei(s,"border","width"),y=ei(s,"padding");d-=y.width+f.width,u-=y.height+f.height}return d=Math.max(0,d-r.width),u=Math.max(0,i?Math.floor(d/i):u-r.height),d=Ic(Math.min(d,o,c.maxWidth)),u=Ic(Math.min(u,a,c.maxHeight)),d&&!u&&(u=Ic(d/2)),{width:d,height:u}}function na(n,e,t){let i=e||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=s/i,n.width=r/i;let o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}function ia(n,e){let t=Xp(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function tn(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function dd(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function ud(n,e,t,i){let s={x:n.cp2x,y:n.cp2y},r={x:e.cp1x,y:e.cp1y},o=tn(n,s,t),a=tn(s,r,t),c=tn(r,e,t),d=tn(o,a,t),u=tn(a,c,t);return tn(d,u,t)}function uD(n,e){e=e||{};let t=n+JSON.stringify(e),i=Op.get(t);return i||(i=new Intl.NumberFormat(n,e),Op.set(t,i)),i}function ci(n,e,t){return uD(e,t).format(n)}function Dn(n,e,t){return n?hD(e,t):fD()}function sa(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function ra(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Zp(n){return n==="angle"?{between:ri,compare:Ip,normalize:ot}:{between:Ft,compare:(e,t)=>e-t,normalize:e=>e}}function Dp({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function pD(n,e,t){let{property:i,start:s,end:r}=t,{between:o,normalize:a}=Zp(i),c=e.length,{start:d,end:u,loop:f}=n,y,g;if(f){for(d+=c,u+=c,y=0,g=c;y<g&&o(a(e[d%c][i]),s,r);++y)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:n.style}}function hd(n,e,t){if(!t)return[n];let{property:i,start:s,end:r}=t,o=e.length,{compare:a,between:c,normalize:d}=Zp(i),{start:u,end:f,loop:y,style:g}=pD(n,e,t),p=[],v=!1,x=null,_,C,S,T=()=>c(s,S,_)&&a(s,S)!==0,k=()=>a(r,_)===0||c(r,S,_),P=()=>v||T(),D=()=>!v||k();for(let M=u,N=u;M<=f;++M)C=e[M%o],!C.skip&&(_=d(C[i]),_!==S&&(v=c(_,s,r),x===null&&P()&&(x=a(_,s)===0?M:N),x!==null&&D()&&(p.push(Dp({start:x,end:M,loop:y,count:o,style:g})),x=null),N=M,S=_));return x!==null&&p.push(Dp({start:x,end:f,loop:y,count:o,style:g})),p}function fd(n,e){let t=[],i=n.segments;for(let s=0;s<i.length;s++){let r=hd(i[s],n.points,e);r.length&&t.push(...r)}return t}function gD(n,e,t,i){let s=0,r=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(r+=s);r>s&&n[r%e].skip;)r--;return r%=e,{start:s,end:r}}function mD(n,e,t,i){let s=n.length,r=[],o=e,a=n[e],c;for(c=e+1;c<=t;++c){let d=n[c%s];d.skip||d.stop?a.skip||(i=!1,r.push({start:e%s,end:(c-1)%s,loop:i}),e=o=d.stop?c:null):(o=c,a.skip&&(e=c)),a=d}return o!==null&&r.push({start:e%s,end:o%s,loop:i}),r}function pd(n,e){let t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];let r=!!n._loop,{start:o,end:a}=gD(t,s,r,i);if(i===!0)return Ep(n,[{start:o,end:a,loop:r}],t,e);let c=a<o?a+s:a,d=!!n._fullLoop&&o===0&&a===s-1;return Ep(n,mD(t,o,c,d),t,e)}function Ep(n,e,t,i){return!i||!i.setContext||!t?e:yD(n,e,t,i)}function yD(n,e,t,i){let s=n._chart.getContext(),r=Mp(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,c=t.length,d=[],u=r,f=e[0].start,y=f;function g(p,v,x,_){let C=a?-1:1;if(p!==v){for(p+=c;t[p%c].skip;)p-=C;for(;t[v%c].skip;)v+=C;p%c!==v%c&&(d.push({start:p%c,end:v%c,loop:x,style:_}),u=_,f=v%c)}}for(let p of e){f=a?f:p.start;let v=t[f%c],x;for(y=f+1;y<=p.end;y++){let _=t[y%c];x=Mp(i.setContext(Bt(s,{type:"segment",p0:v,p1:_,p0DataIndex:(y-1)%c,p1DataIndex:y%c,datasetIndex:o}))),bD(x,u)&&g(f,y-1,p.loop,u),v=_,u=x}f<y-1&&g(f,y-1,p.loop,u)}return d}function Mp(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function bD(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}var Hc,Pe,Wc,Ao,yp,De,Lt,Lo,ae,fe,Lp,Gs,Io,Oe,ji,Fc,tt,bt,nn,$c,Fp,Vo,Xs,He,Xc,Oo,bp,vp,Qn,_n,yt,Bc,xO,_O,Do,SO,kO,OO,_p,Sp,Eo,BO,Ac,Wi,Vi,On,Ko,zc,ee,UO,$O,GO,KO,rd,JO,iD,Ui,Gp,ta,aD,lD,Ic,cd,Op,hD,fD,oa=O(()=>{Hc=function(){let n=0;return function(){return n++}}();Pe=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);Wc=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ao=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;yp={"":n=>n,x:n=>n.x,y:n=>n.y};De=n=>typeof n<"u",Lt=n=>typeof n=="function",Lo=(n,e)=>{if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0};ae=Math.PI,fe=2*ae,Lp=fe+ae,Gs=Number.POSITIVE_INFINITY,Io=ae/180,Oe=ae/2,ji=ae/4,Fc=ae*2/3,tt=Math.log10,bt=Math.sign;nn=(n,e,t,i)=>qs(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),$c=(n,e,t)=>qs(n,t,i=>n[i][e]>=t);Fp=["push","pop","shift","splice","unshift"];Vo=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();Xs=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,Xc=(n,e,t,i)=>n===(i?"left":"right")?t:n==="center"?(e+t)/2:e;Oo=n=>n===0||n===1,bp=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*fe/t)),vp=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*fe/t)+1,Qn={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Oe)+1,easeOutSine:n=>Math.sin(n*Oe),easeInOutSine:n=>-.5*(Math.cos(ae*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Oo(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Oo(n)?n:bp(n,.075,.3),easeOutElastic:n=>Oo(n)?n:vp(n,.075,.3),easeInOutElastic(n){return Oo(n)?n:n<.5?.5*bp(n*2,.1125,.45):.5+.5*vp(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Qn.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Qn.easeInBounce(n*2)*.5:Qn.easeOutBounce(n*2-1)*.5+.5};_n=(n,e,t)=>Math.max(Math.min(n,t),e);yt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Bc=[..."0123456789ABCDEF"],xO=n=>Bc[n&15],_O=n=>Bc[(n&240)>>4]+Bc[n&15],Do=n=>(n&240)>>4===(n&15),SO=n=>Do(n.r)&&Do(n.g)&&Do(n.b)&&Do(n.a);kO=(n,e)=>n<255?e(n):"";OO=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;_p={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Sp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};BO=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;Ac=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);Vi=class{constructor(e){if(e instanceof Vi)return e;let t=typeof e,i;t==="object"?i=Cp(e):t==="string"&&(i=CO(e)||FO(e)||jO(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Hp(this._rgb);return e&&(e.a=en(e.a)),e}set rgb(e){this._rgb=Cp(e)}rgbString(){return this._valid?HO(this._rgb):void 0}hexString(){return this._valid?TO(this._rgb):void 0}hslString(){return this._valid?LO(this._rgb):void 0}mix(e,t){if(e){let i=this.rgb,s=e.rgb,r,o=t===r?.5:t,a=2*o-1,c=i.a-s.a,d=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;r=1-d,i.r=255&d*i.r+r*s.r+.5,i.g=255&d*i.g+r*s.g+.5,i.b=255&d*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=WO(this._rgb,e._rgb,t)),this}clone(){return new Vi(this.rgb)}alpha(e){return this._rgb.a=Sn(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=Zs(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Mo(this._rgb,2,e),this}darken(e){return Mo(this._rgb,2,-e),this}saturate(e){return Mo(this._rgb,1,e),this}desaturate(e){return Mo(this._rgb,1,-e),this}rotate(e){return AO(this._rgb,e),this}};On=Object.create(null),Ko=Object.create(null);zc=class{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>No(i.backgroundColor),this.hoverBorderColor=(t,i)=>No(i.borderColor),this.hoverColor=(t,i)=>No(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return Lc(this,e,t)}get(e){return Us(this,e)}describe(e,t){return Lc(Ko,e,t)}override(e,t){return Lc(On,e,t)}route(e,t,i,s){let r=Us(this,e),o=Us(this,i),a="_"+t;Object.defineProperties(r,{[a]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){let c=this[a],d=o[s];return Q(c)?Object.assign({},d,c):J(c,d)},set(c){this[a]=c}}})}},ee=new zc({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});UO=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),$O=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);GO=n=>+n||0;KO=(n,e)=>n?n+Ks(e):e,rd=(n,e)=>Q(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);JO=(n,e)=>n===!0?e:typeof n=="string"?It(e,n):void 0;iD=Number.EPSILON||1e-14,Ui=(n,e)=>e<n.length&&!n[e].skip&&n[e],Gp=n=>n==="x"?"y":"x";ta=n=>window.getComputedStyle(n,null);aD=["top","right","bottom","left"];lD=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);Ic=n=>Math.round(n*10)/10;cd=function(){let n=!1;try{let e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();Op=new Map;hD=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},fD=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}}});function SD(n,e){let t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){let r=n[i[s]];r&&r.active()&&t.push(r.wait())}return Promise.all(t)}function CD(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Qp(n,e){let t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,r=t.max===void 0?e:0;return{start:i?r:s,end:i?s:r}}function kD(n,e,t){if(t===!1)return!1;let i=Qp(n,t),s=Qp(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function TD(n){let e,t,i,s;return Q(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function Fg(n,e){let t=[],i=n._getSortedDatasetMetas(e),s,r;for(s=0,r=i.length;s<r;++s)t.push(i[s].index);return t}function eg(n,e,t,i={}){let s=n.keys,r=i.mode==="single",o,a,c,d;if(e!==null){for(o=0,a=s.length;o<a;++o){if(c=+s[o],c===t){if(i.all)continue;break}d=n.values[c],Pe(d)&&(r||e===0||bt(e)===bt(d))&&(e+=d)}return e}}function OD(n){let e=Object.keys(n),t=new Array(e.length),i,s,r;for(i=0,s=e.length;i<s;++i)r=e[i],t[i]={x:r,y:n[r]};return t}function tg(n,e){let t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function DD(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function ED(n){let{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function MD(n,e,t){let i=n[e]||(n[e]={});return i[t]||(i[t]={})}function ng(n,e,t,i){for(let s of e.getMatchingVisibleMetas(i).reverse()){let r=n[s.index];if(t&&r>0||!t&&r<0)return s.index}return null}function ig(n,e){let{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:r,vScale:o,index:a}=i,c=r.axis,d=o.axis,u=DD(r,o,i),f=e.length,y;for(let g=0;g<f;++g){let p=e[g],{[c]:v,[d]:x}=p,_=p._stacks||(p._stacks={});y=_[d]=MD(s,u,v),y[a]=x,y._top=ng(y,o,!0,i.type),y._bottom=ng(y,o,!1,i.type)}}function gd(n,e){let t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function PD(n,e){return Bt(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ND(n,e,t){return Bt(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function tr(n,e){let t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(let s of e){let r=s._stacks;if(!r||r[i]===void 0||r[i][t]===void 0)return;delete r[i][t]}}}function AD(n,e){if(!n._cache.$bar){let t=n.getMatchingVisibleMetas(e),i=[];for(let s=0,r=t.length;s<r;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=jo(i.sort((s,r)=>s-r))}return n._cache.$bar}function LD(n){let e=n.iScale,t=AD(e,n.type),i=e._length,s,r,o,a,c=()=>{o===32767||o===-32768||(De(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=t.length;s<r;++s)o=e.getPixelForValue(t[s]),c();for(a=void 0,s=0,r=e.ticks.length;s<r;++s)o=e.getPixelForTick(s),c();return i}function ID(n,e,t,i){let s=t.barThickness,r,o;return ie(s)?(r=e.min*t.categoryPercentage,o=t.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:e.pixels[n]-r/2}}function FD(n,e,t,i){let s=e.pixels,r=s[n],o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null,c=t.categoryPercentage;o===null&&(o=r-(a===null?e.end-e.start:a-r)),a===null&&(a=r+r-o);let d=r-(r-Math.min(o,a))/2*c;return{chunk:Math.abs(a-o)/2*c/i,ratio:t.barPercentage,start:d}}function BD(n,e,t,i){let s=t.parse(n[0],i),r=t.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r),c=o,d=a;Math.abs(o)>Math.abs(a)&&(c=a,d=o),e[t.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:r,min:o,max:a}}function Bg(n,e,t,i){return he(n)?BD(n,e,t,i):e[t.axis]=t.parse(n,i),e}function rg(n,e,t,i){let s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,c=[],d,u,f,y;for(d=t,u=t+i;d<u;++d)y=e[d],f={},f[s.axis]=a||s.parse(o[d],d),c.push(Bg(y,f,r,d));return c}function yd(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function zD(n,e,t){return n!==0?bt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function HD(n){let e,t,i,s,r;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",r="start"):(s="start",r="end"),{start:t,end:i,reverse:e,top:s,bottom:r}}function WD(n,e,t,i){let s=e.borderSkipped,r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:c,top:d,bottom:u}=HD(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=d:(t._bottom||0)===i?s=u:(r[og(u,o,a,c)]=!0,s=d)),r[og(s,o,a,c)]=!0,n.borderSkipped=r}function og(n,e,t,i){return i?(n=jD(n,e,t),n=ag(n,t,e)):n=ag(n,e,t),n}function jD(n,e,t){return n===e?t:n===t?e:n}function ag(n,e,t){return n==="start"?e:n==="end"?t:n}function VD(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}function YD(n,e,t){let i=1,s=1,r=0,o=0;if(e<fe){let a=n,c=a+e,d=Math.cos(a),u=Math.sin(a),f=Math.cos(c),y=Math.sin(c),g=(S,T,k)=>ri(S,a,c,!0)?1:Math.max(T,T*t,k,k*t),p=(S,T,k)=>ri(S,a,c,!0)?-1:Math.min(T,T*t,k,k*t),v=g(0,d,f),x=g(Oe,u,y),_=p(ae,d,f),C=p(ae+Oe,u,y);i=(v-_)/2,s=(x-C)/2,r=-(v+_)/2,o=-(x+C)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}function UD(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}function $D(n,e){let t=n.options.ticks,i=t.maxTicksLimit||GD(n),s=t.major.enabled?qD(e):[],r=s.length,o=s[0],a=s[r-1],c=[];if(r>i)return XD(e,c,s,r/i),c;let d=KD(s,e,i);if(r>0){let u,f,y=r>1?Math.round((a-o)/(r-1)):null;for(aa(e,c,d,ie(y)?0:o-y,o),u=0,f=r-1;u<f;u++)aa(e,c,d,s[u],s[u+1]);return aa(e,c,d,a,ie(y)?e.length:a+y),c}return aa(e,c,d),c}function GD(n){let e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function KD(n,e,t){let i=ZD(n),s=e.length/t;if(!i)return Math.max(s,1);let r=Vc(i);for(let o=0,a=r.length-1;o<a;o++){let c=r[o];if(c>s)return c}return Math.max(s,1)}function qD(n){let e=[],t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function XD(n,e,t,i){let s=0,r=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(e.push(n[o]),s++,r=t[s*i])}function aa(n,e,t,i,s){let r=J(i,0),o=Math.min(J(s,n.length),n.length),a=0,c,d,u;for(t=Math.ceil(t),s&&(c=s-i,t=c/Math.floor(c/t)),u=r;u<0;)a++,u=Math.round(r+a*t);for(d=Math.max(r,0);d<o;d++)d===u&&(e.push(n[d]),a++,u=Math.round(r+a*t))}function ZD(n){let e=n.length,t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}function cg(n,e){let t=[],i=n.length/e,s=n.length,r=0;for(;r<s;r+=i)t.push(n[Math.floor(r)]);return t}function QD(n,e,t){let i=n.ticks.length,s=Math.min(e,i-1),r=n._startPixel,o=n._endPixel,a=1e-6,c=n.getPixelForTick(s),d;if(!(t&&(i===1?d=Math.max(c-r,o-c):e===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<r-a||c>o+a)))return c}function eE(n,e){ce(n,t=>{let i=t.gc,s=i.length/2,r;if(s>e){for(r=0;r<s;++r)delete t.data[i[r]];i.splice(0,s)}})}function nr(n){return n.drawTicks?n.tickLength:0}function dg(n,e){if(!n.display)return 0;let t=we(n.font,e),i=ke(n.padding);return(he(n.text)?n.text.length:1)*t.lineHeight+i.height}function tE(n,e){return Bt(n,{scale:e,type:"scale"})}function nE(n,e,t){return Bt(n,{tick:t,index:e,type:"tick"})}function iE(n,e,t){let i=Xs(n);return(t&&e!=="right"||!t&&e==="right")&&(i=JD(i)),i}function sE(n,e,t,i){let{top:s,left:r,bottom:o,right:a,chart:c}=n,{chartArea:d,scales:u}=c,f=0,y,g,p,v=o-s,x=a-r;if(n.isHorizontal()){if(g=He(i,r,a),Q(t)){let _=Object.keys(t)[0],C=t[_];p=u[_].getPixelForValue(C)+v-e}else t==="center"?p=(d.bottom+d.top)/2+v-e:p=lg(n,t,e);y=a-r}else{if(Q(t)){let _=Object.keys(t)[0],C=t[_];g=u[_].getPixelForValue(C)-x+e}else t==="center"?g=(d.left+d.right)/2-x+e:g=lg(n,t,e);p=He(i,o,s),f=t==="left"?-Oe:Oe}return{titleX:g,titleY:p,maxWidth:y,rotation:f}}function rE(n,e,t){let i=at(Object.create(null),[t?ee.get(t):{},ee.get(e),n.defaults]);ee.set(e,i),n.defaultRoutes&&oE(e,n.defaultRoutes),n.descriptors&&ee.describe(e,n.descriptors)}function oE(n,e){Object.keys(e).forEach(t=>{let i=t.split("."),s=i.pop(),r=[n].concat(i).join("."),o=e[t].split("."),a=o.pop(),c=o.join(".");ee.route(r,s,c,a)})}function aE(n){return"id"in n&&"defaults"in n}function di(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function cE(n,e,t,i){let{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){let c=a._reversePixels?$c:nn;if(i){if(s._sharedOptions){let d=r[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){let f=c(r,e,t-u),y=c(r,e,t+u);return{lo:f.lo,hi:y.hi}}}}else return c(r,e,t)}return{lo:0,hi:r.length-1}}function hr(n,e,t,i,s){let r=n.getSortedVisibleDatasetMetas(),o=t[e];for(let a=0,c=r.length;a<c;++a){let{index:d,data:u}=r[a],{lo:f,hi:y}=cE(r[a],e,o,s);for(let g=f;g<=y;++g){let p=u[g];p.skip||i(p,d,g)}}}function dE(n){let e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){let r=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function bd(n,e,t,i,s){let r=[];return!s&&!n.isPointInArea(e)||hr(n,t,e,function(a,c,d){!s&&!ti(a,n.chartArea,0)||a.inRange(e.x,e.y,i)&&r.push({element:a,datasetIndex:c,index:d})},!0),r}function uE(n,e,t,i){let s=[];function r(o,a,c){let{startAngle:d,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:f}=Ho(o,{x:e.x,y:e.y});ri(f,d,u)&&s.push({element:o,datasetIndex:a,index:c})}return hr(n,t,e,r),s}function hE(n,e,t,i,s,r){let o=[],a=dE(t),c=Number.POSITIVE_INFINITY;function d(u,f,y){let g=u.inRange(e.x,e.y,s);if(i&&!g)return;let p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;let x=a(e,p);x<c?(o=[{element:u,datasetIndex:f,index:y}],c=x):x===c&&o.push({element:u,datasetIndex:f,index:y})}return hr(n,t,e,d),o}function vd(n,e,t,i,s,r){return!r&&!n.isPointInArea(e)?[]:t==="r"&&!i?uE(n,e,t,s):hE(n,e,t,i,s,r)}function ug(n,e,t,i,s){let r=[],o=t==="x"?"inXRange":"inYRange",a=!1;return hr(n,t,e,(c,d,u)=>{c[o](e[t],s)&&(r.push({element:c,datasetIndex:d,index:u}),a=a||c.inRange(e.x,e.y,s))}),i&&!a?[]:r}function ir(n,e){return n.filter(t=>t.pos===e)}function hg(n,e){return n.filter(t=>Hg.indexOf(t.pos)===-1&&t.box.axis===e)}function sr(n,e){return n.sort((t,i)=>{let s=e?i:t,r=e?t:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function pE(n){let e=[],t,i,s,r,o,a;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:r,options:{stack:o,stackWeight:a=1}}=s,e.push({index:t,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return e}function gE(n){let e={};for(let t of n){let{stack:i,pos:s,stackWeight:r}=t;if(!i||!Hg.includes(s))continue;let o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}function mE(n,e){let t=gE(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e,r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];let{fullSize:c}=a.box,d=t[a.stack],u=d&&a.stackWeight/d.weight;a.horizontal?(a.width=u?u*i:c&&e.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:c&&e.availableHeight)}return t}function yE(n){let e=pE(n),t=sr(e.filter(d=>d.box.fullSize),!0),i=sr(ir(e,"left"),!0),s=sr(ir(e,"right")),r=sr(ir(e,"top"),!0),o=sr(ir(e,"bottom")),a=hg(e,"x"),c=hg(e,"y");return{fullSize:t,leftAndTop:i.concat(r),rightAndBottom:s.concat(c).concat(o).concat(a),chartArea:ir(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:r.concat(o).concat(a)}}function fg(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Wg(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function bE(n,e,t,i){let{pos:s,box:r}=t,o=n.maxPadding;if(!Q(s)){t.size&&(n[s]-=t.size);let f=i[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?r.height:r.width),t.size=f.size/f.count,n[s]+=t.size}r.getPadding&&Wg(o,r.getPadding());let a=Math.max(0,e.outerWidth-fg(o,n,"left","right")),c=Math.max(0,e.outerHeight-fg(o,n,"top","bottom")),d=a!==n.w,u=c!==n.h;return n.w=a,n.h=c,t.horizontal?{same:d,other:u}:{same:u,other:d}}function vE(n){let e=n.maxPadding;function t(i){let s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function wE(n,e){let t=e.maxPadding;function i(s){let r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(e[o],t[o])}),r}return i(n?["left","right"]:["top","bottom"])}function or(n,e,t,i){let s=[],r,o,a,c,d,u;for(r=0,o=n.length,d=0;r<o;++r){a=n[r],c=a.box,c.update(a.width||e.w,a.height||e.h,wE(a.horizontal,e));let{same:f,other:y}=bE(e,t,a,i);d|=f&&s.length,u=u||y,c.fullSize||s.push(a)}return d&&or(s,e,t,i)||u}function la(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function pg(n,e,t,i){let s=t.padding,{x:r,y:o}=e;for(let a of n){let c=a.box,d=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/d.weight||1;if(a.horizontal){let f=e.w*u,y=d.size||c.height;De(d.start)&&(o=d.start),c.fullSize?la(c,s.left,o,t.outerWidth-s.right-s.left,y):la(c,e.left+d.placed,o,f,y),d.start=o,d.placed+=f,o=c.bottom}else{let f=e.h*u,y=d.size||c.width;De(d.start)&&(r=d.start),c.fullSize?la(c,r,s.top,y,t.outerHeight-s.bottom-s.top):la(c,r,e.top+d.placed,y,f),d.start=r,d.placed+=f,r=c.right}}e.x=r,e.y=o}function _E(n,e){let t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ha]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",gg(s)){let r=ia(n,"width");r!==void 0&&(n.width=r)}if(gg(i))if(n.style.height==="")n.height=n.width/(e||2);else{let r=ia(n,"height");r!==void 0&&(n.height=r)}return n}function SE(n,e,t){n.addEventListener(e,t,jg)}function CE(n,e,t){n.canvas.removeEventListener(e,t,jg)}function kE(n,e){let t=xE[n.type]||n.type,{x:i,y:s}=an(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function pa(n,e){for(let t of n)if(t===e||t.contains(e))return!0}function TE(n,e,t){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||pa(a.addedNodes,i),o=o&&!pa(a.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function OE(n,e,t){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||pa(a.removedNodes,i),o=o&&!pa(a.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Vg(){let n=window.devicePixelRatio;n!==mg&&(mg=n,dr.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function DE(n,e){dr.size||window.addEventListener("resize",Vg),dr.set(n,e)}function EE(n){dr.delete(n),dr.size||window.removeEventListener("resize",Vg)}function ME(n,e,t){let i=n.canvas,s=i&&er(i);if(!s)return;let r=Yo((a,c)=>{let d=s.clientWidth;t(a,c),d<s.clientWidth&&t()},window),o=new ResizeObserver(a=>{let c=a[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||r(d,u)});return o.observe(s),DE(n,r),o}function wd(n,e,t){t&&t.disconnect(),e==="resize"&&EE(n)}function PE(n,e,t){let i=n.canvas,s=Yo(r=>{n.ctx!==null&&t(kE(r,n))},n,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return SE(i,e,s),s}function NE(n){return!ea()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Td:Od}function RE(n){let e={},t=[],i=Object.keys(Ht.plugins.items);for(let r=0;r<i.length;r++)t.push(Ht.getPlugin(i[r]));let s=n.plugins||[];for(let r=0;r<s.length;r++){let o=s[r];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function AE(n,e){return!e&&n===!1?null:n===!0?{}:n}function LE(n,{plugins:e,localIds:t},i,s){let r=[],o=n.getContext();for(let a of e){let c=a.id,d=AE(i[c],s);d!==null&&r.push({plugin:a,options:IE(n.config,{plugin:a,local:t[c]},d,o)})}return r}function IE(n,{plugin:e,local:t},i,s){let r=n.pluginScopeKeys(e),o=n.getOptionScopes(i,r);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ed(n,e){let t=ee.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function FE(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function BE(n,e){return n===e?"_index_":"_value_"}function zE(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Md(n,e){return n==="x"||n==="y"?n:e.axis||zE(e.position)||n.charAt(0).toLowerCase()}function HE(n,e){let t=On[n.type]||{scales:{}},i=e.scales||{},s=Ed(n.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(a=>{let c=i[a];if(!Q(c))return console.error(`Invalid scale configuration for scale: ${a}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let d=Md(a,c),u=BE(d,s),f=t.scales||{};r[d]=r[d]||a,o[a]=ni(Object.create(null),[{axis:d},c,f[d],f[u]])}),n.data.datasets.forEach(a=>{let c=a.type||n.type,d=a.indexAxis||Ed(c,e),f=(On[c]||{}).scales||{};Object.keys(f).forEach(y=>{let g=FE(y,d),p=a[g+"AxisID"]||r[g]||g;o[p]=o[p]||Object.create(null),ni(o[p],[{axis:g},i[p],f[y]])})}),Object.keys(o).forEach(a=>{let c=o[a];ni(c,[ee.scales[c.type],ee.scale])}),o}function Yg(n){let e=n.options||(n.options={});e.plugins=J(e.plugins,{}),e.scales=HE(n,e)}function Ug(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function WE(n){return n=n||{},n.data=Ug(n.data),Yg(n),n}function ca(n,e){let t=yg.get(n);return t||(t=e(),yg.set(n,t),$g.add(t)),t}function bg(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));let s=t.join(),r=i.get(s);return r||(r={resolver:Qs(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}function VE(n,e){let{isScriptable:t,isIndexable:i}=Jo(n);for(let s of e){let r=t(s),o=i(s),a=(o||r)&&n[s];if(r&&(Lt(a)||jE(a))||o&&he(a))return!0}return!1}function vg(n,e){return n==="top"||n==="bottom"||UE.indexOf(n)===-1&&e==="x"}function wg(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function xg(n){let e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),le(t&&t.onComplete,[n],e)}function $E(n){let e=n.chart,t=e.options.animation;le(t&&t.onProgress,[n],e)}function Gg(n){return ea()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}function GE(n,e,t){let i=Object.keys(n);for(let s of i){let r=+s;if(r>=e){let o=n[s];delete n[s],(t>0||r>e)&&(n[r+t]=o)}}}function KE(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function qg(n,e,t){let{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:c}=e,d=s/a;n.beginPath(),n.arc(r,o,a,i-d,t+d),c>s?(d=s/c,n.arc(r,o,c,t+d,i-d,!0)):n.arc(r,o,s,t+Oe,i-Oe),n.closePath(),n.clip()}function qE(n){return Js(n,["outerStart","outerEnd","innerStart","innerEnd"])}function XE(n,e,t,i){let s=qE(n.options.borderRadius),r=(t-e)/2,o=Math.min(r,i*e/2),a=c=>{let d=(t-Math.min(r,c))*i/2;return ze(c,0,Math.min(r,d))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ze(s.innerStart,0,o),innerEnd:ze(s.innerEnd,0,o)}}function Gi(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Nd(n,e,t,i,s,r){let{x:o,y:a,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+t-d,0),y=u>0?u+i+t+d:0,g=0,p=s-c;if(i){let F=u>0?u-i:0,j=f>0?f-i:0,V=(F+j)/2,q=V!==0?p*V/(V+i):p;g=(p-q)/2}let v=Math.max(.001,p*f-t/ae)/f,x=(p-v)/2,_=c+x+g,C=s-x-g,{outerStart:S,outerEnd:T,innerStart:k,innerEnd:P}=XE(e,y,f,C-_),D=f-S,M=f-T,N=_+S/D,R=C-T/M,L=y+k,B=y+P,W=_+k/L,I=C-P/B;if(n.beginPath(),r){if(n.arc(o,a,f,N,R),T>0){let V=Gi(M,R,o,a);n.arc(V.x,V.y,T,R,C+Oe)}let F=Gi(B,C,o,a);if(n.lineTo(F.x,F.y),P>0){let V=Gi(B,I,o,a);n.arc(V.x,V.y,P,C+Oe,I+Math.PI)}if(n.arc(o,a,y,C-P/y,_+k/y,!0),k>0){let V=Gi(L,W,o,a);n.arc(V.x,V.y,k,W+Math.PI,_-Oe)}let j=Gi(D,_,o,a);if(n.lineTo(j.x,j.y),S>0){let V=Gi(D,N,o,a);n.arc(V.x,V.y,S,_-Oe,N)}}else{n.moveTo(o,a);let F=Math.cos(N)*f+o,j=Math.sin(N)*f+a;n.lineTo(F,j);let V=Math.cos(R)*f+o,q=Math.sin(R)*f+a;n.lineTo(V,q)}n.closePath()}function ZE(n,e,t,i,s){let{fullCircles:r,startAngle:o,circumference:a}=e,c=e.endAngle;if(r){Nd(n,e,t,i,o+fe,s);for(let d=0;d<r;++d)n.fill();isNaN(a)||(c=o+a%fe,a%fe===0&&(c+=fe))}return Nd(n,e,t,i,c,s),n.fill(),c}function JE(n,e,t){let{x:i,y:s,startAngle:r,pixelMargin:o,fullCircles:a}=e,c=Math.max(e.outerRadius-o,0),d=e.innerRadius+o,u;for(t&&qg(n,e,r+fe),n.beginPath(),n.arc(i,s,d,r+fe,r,!0),u=0;u<a;++u)n.stroke();for(n.beginPath(),n.arc(i,s,c,r,r+fe),u=0;u<a;++u)n.stroke()}function QE(n,e,t,i,s,r){let{options:o}=e,{borderWidth:a,borderJoinStyle:c}=o,d=o.borderAlign==="inner";!a||(d?(n.lineWidth=a*2,n.lineJoin=c||"round"):(n.lineWidth=a,n.lineJoin=c||"bevel"),e.fullCircles&&JE(n,e,d),d&&qg(n,e,s),Nd(n,e,t,i,s,r),n.stroke())}function Xg(n,e,t=e){n.lineCap=J(t.borderCapStyle,e.borderCapStyle),n.setLineDash(J(t.borderDash,e.borderDash)),n.lineDashOffset=J(t.borderDashOffset,e.borderDashOffset),n.lineJoin=J(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=J(t.borderWidth,e.borderWidth),n.strokeStyle=J(t.borderColor,e.borderColor)}function eM(n,e,t){n.lineTo(t.x,t.y)}function tM(n){return n.stepped?nd:n.tension||n.cubicInterpolationMode==="monotone"?id:eM}function Zg(n,e,t={}){let i=n.length,{start:s=0,end:r=i-1}=t,{start:o,end:a}=e,c=Math.max(s,o),d=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function nM(n,e,t,i){let{points:s,options:r}=e,{count:o,start:a,loop:c,ilen:d}=Zg(s,t,i),u=tM(r),{move:f=!0,reverse:y}=i||{},g,p,v;for(g=0;g<=d;++g)p=s[(a+(y?d-g:g))%o],!p.skip&&(f?(n.moveTo(p.x,p.y),f=!1):u(n,v,p,y,r.stepped),v=p);return c&&(p=s[(a+(y?d:0))%o],u(n,v,p,y,r.stepped)),!!c}function iM(n,e,t,i){let s=e.points,{count:r,start:o,ilen:a}=Zg(s,t,i),{move:c=!0,reverse:d}=i||{},u=0,f=0,y,g,p,v,x,_,C=T=>(o+(d?a-T:T))%r,S=()=>{v!==x&&(n.lineTo(u,x),n.lineTo(u,v),n.lineTo(u,_))};for(c&&(g=s[C(0)],n.moveTo(g.x,g.y)),y=0;y<=a;++y){if(g=s[C(y)],g.skip)continue;let T=g.x,k=g.y,P=T|0;P===p?(k<v?v=k:k>x&&(x=k),u=(f*u+T)/++f):(S(),n.lineTo(T,k),p=P,f=0,v=x=k),_=k}S()}function Rd(n){let e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?iM:nM}function sM(n){return n.stepped?dd:n.tension||n.cubicInterpolationMode==="monotone"?ud:tn}function rM(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),Xg(n,e.options),n.stroke(s)}function oM(n,e,t,i){let{segments:s,options:r}=e,o=Rd(e);for(let a of s)Xg(n,r,a.style),n.beginPath(),o(n,e,a,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}function lM(n,e,t,i){aM&&!e.options.segment?rM(n,e,t,i):oM(n,e,t,i)}function Sg(n,e,t,i){let s=n.options,{[t]:r}=n.getProps([t],i);return Math.abs(e-r)<s.radius+s.hitRadius}function Jg(n,e){let{x:t,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],e),a,c,d,u,f;return n.horizontal?(f=o/2,a=Math.min(t,s),c=Math.max(t,s),d=i-f,u=i+f):(f=r/2,a=t-f,c=t+f,d=Math.min(i,s),u=Math.max(i,s)),{left:a,top:d,right:c,bottom:u}}function Mn(n,e,t,i){return n?0:ze(e,t,i)}function cM(n,e,t){let i=n.options.borderWidth,s=n.borderSkipped,r=Zo(i);return{t:Mn(s.top,r.top,0,t),r:Mn(s.right,r.right,0,e),b:Mn(s.bottom,r.bottom,0,t),l:Mn(s.left,r.left,0,e)}}function dM(n,e,t){let{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=Et(s),o=Math.min(e,t),a=n.borderSkipped,c=i||Q(s);return{topLeft:Mn(!c||a.top||a.left,r.topLeft,0,o),topRight:Mn(!c||a.top||a.right,r.topRight,0,o),bottomLeft:Mn(!c||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Mn(!c||a.bottom||a.right,r.bottomRight,0,o)}}function uM(n){let e=Jg(n),t=e.right-e.left,i=e.bottom-e.top,s=cM(n,t/2,i/2),r=dM(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:r},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function xd(n,e,t,i){let s=e===null,r=t===null,a=n&&!(s&&r)&&Jg(n,i);return a&&(s||Ft(e,a.left,a.right))&&(r||Ft(t,a.top,a.bottom))}function hM(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function fM(n,e){n.rect(e.x,e.y,e.w,e.h)}function _d(n,e,t={}){let i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,r=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}function gM(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}function mM(n,e){let t=new ya({ctx:n.ctx,options:e,chart:n});vt.configure(n,t,e),vt.addBox(n,t),n.titleBlock=t}function zt(n,e){return e&&(he(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function cn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function yM(n,e){let{element:t,datasetIndex:i,index:s}=e,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function kg(n,e){let t=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=e,c=we(e.bodyFont),d=we(e.titleFont),u=we(e.footerFont),f=r.length,y=s.length,g=i.length,p=ke(e.padding),v=p.height,x=0,_=i.reduce((T,k)=>T+k.before.length+k.lines.length+k.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,f&&(v+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),_){let T=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;v+=g*T+(_-g)*c.lineHeight+(_-1)*e.bodySpacing}y&&(v+=e.footerMarginTop+y*u.lineHeight+(y-1)*e.footerSpacing);let C=0,S=function(T){x=Math.max(x,t.measureText(T).width+C)};return t.save(),t.font=d.string,ce(n.title,S),t.font=c.string,ce(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,ce(i,T=>{ce(T.before,S),ce(T.lines,S),ce(T.after,S)}),C=0,t.font=u.string,ce(n.footer,S),t.restore(),x+=p.width,{width:x,height:v}}function bM(n,e){let{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function vM(n,e,t,i){let{x:s,width:r}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+r+o>e.width||n==="right"&&s-r-o<0)return!0}function wM(n,e,t,i){let{x:s,width:r}=t,{width:o,chartArea:{left:a,right:c}}=n,d="center";return i==="center"?d=s<=(a+c)/2?"left":"right":s<=r/2?d="left":s>=o-r/2&&(d="right"),vM(d,n,e,t)&&(d="center"),d}function Tg(n,e,t){let i=t.yAlign||e.yAlign||bM(n,t);return{xAlign:t.xAlign||e.xAlign||wM(n,e,t,i),yAlign:i}}function xM(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function _M(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Og(n,e,t,i){let{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:c}=t,d=s+r,{topLeft:u,topRight:f,bottomLeft:y,bottomRight:g}=Et(o),p=xM(e,a),v=_M(e,c,d);return c==="center"?a==="left"?p+=d:a==="right"&&(p-=d):a==="left"?p-=Math.max(u,y)+s:a==="right"&&(p+=Math.max(f,g)+s),{x:ze(p,0,i.width-e.width),y:ze(v,0,i.height-e.height)}}function da(n,e,t){let i=ke(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Dg(n){return zt([],cn(n))}function SM(n,e,t){return Bt(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Eg(n,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}function kM(n,e,t,i){let s=n.indexOf(e);if(s===-1)return CM(n,e,t,i);let r=n.lastIndexOf(e);return s!==r?t:s}function OM(n,e){let t=[],{bounds:s,step:r,min:o,max:a,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:y}=n,g=r||1,p=u-1,{min:v,max:x}=e,_=!ie(o),C=!ie(a),S=!ie(d),T=(x-v)/(f+1),k=Fo((x-v)/p/g)*g,P,D,M,N;if(k<1e-14&&!_&&!C)return[{value:v},{value:x}];N=Math.ceil(x/k)-Math.floor(v/k),N>p&&(k=Fo(N*k/p/g)*g),ie(c)||(P=Math.pow(10,c),k=Math.ceil(k*P)/P),s==="ticks"?(D=Math.floor(v/k)*k,M=Math.ceil(x/k)*k):(D=v,M=x),_&&C&&r&&Yc((a-o)/r,k/1e3)?(N=Math.round(Math.min((a-o)/k,u)),k=(a-o)/N,D=o,M=a):S?(D=_?o:D,M=C?a:M,N=d-1,k=(M-D)/N):(N=(M-D)/k,ii(N,Math.round(N),k/1e3)?N=Math.round(N):N=Math.ceil(N));let R=Math.max(zo(k),zo(D));P=Math.pow(10,ie(c)?R:c),D=Math.round(D*P)/P,M=Math.round(M*P)/P;let L=0;for(_&&(y&&D!==o?(t.push({value:o}),D<o&&L++,ii(Math.round((D+L*k)*P)/P,o,Mg(o,T,n))&&L++):D<o&&L++);L<N;++L)t.push({value:Math.round((D+L*k)*P)/P});return C&&y&&M!==a?t.length&&ii(t[t.length-1].value,a,Mg(a,T,n))?t[t.length-1].value=a:t.push({value:a}):(!C||M===a)&&t.push({value:M}),t}function Mg(n,e,{horizontal:t,minRotation:i}){let s=Me(i),r=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/r,o)}function Pg(n){return n/Math.pow(10,Math.floor(tt(n)))===1}function DM(n,e){let t=Math.floor(tt(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[],r=et(n.min,Math.pow(10,Math.floor(tt(e.min)))),o=Math.floor(tt(r)),a=Math.floor(r/Math.pow(10,o)),c=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:Pg(r)}),++a,a===10&&(a=1,++o,c=o>=0?1:c),r=Math.round(a*Math.pow(10,o)*c)/c;while(o<t||o===t&&a<i);let d=et(n.max,r);return s.push({value:d,major:Pg(r)}),s}function Ad(n){let e=n.ticks;if(e.display&&n.display){let t=ke(e.backdropPadding);return J(e.font&&e.font.size,ee.font.size)+t.height}return 0}function EM(n,e,t){return t=he(t)?t:[t],{w:td(n,e.string,t),h:t.length*e.lineHeight}}function Ng(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function MM(n){let e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ae/r:0;for(let c=0;c<r;c++){let d=o.setContext(n.getPointLabelContext(c));s[c]=d.padding;let u=n.getPointPosition(c,n.drawingArea+s[c],a),f=we(d.font),y=EM(n.ctx,f,n._pointLabels[c]);i[c]=y;let g=ot(n.getIndexAngle(c)+a),p=Math.round(si(g)),v=Ng(p,u.x,y.w,0,180),x=Ng(p,u.y,y.h,90,270);PM(t,e,g,v,x)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=NM(n,i,s)}function PM(n,e,t,i,s){let r=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t)),a=0,c=0;i.start<e.l?(a=(e.l-i.start)/r,n.l=Math.min(n.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/r,n.r=Math.max(n.r,e.r+a)),s.start<e.t?(c=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+c))}function NM(n,e,t){let i=[],s=n._pointLabels.length,r=n.options,o=Ad(r)/2,a=n.drawingArea,c=r.pointLabels.centerPointLabels?ae/s:0;for(let d=0;d<s;d++){let u=n.getPointPosition(d,a+o+t[d],c),f=Math.round(si(ot(u.angle+Oe))),y=e[d],g=LM(u.y,y.h,f),p=RM(f),v=AM(u.x,y.w,p);i.push({x:u.x,y:g,textAlign:p,left:v,top:g,right:v+y.w,bottom:g+y.h})}return i}function RM(n){return n===0||n===180?"center":n<180?"left":"right"}function AM(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function LM(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function IM(n,e){let{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){let r=i.setContext(n.getPointLabelContext(s)),o=we(r.font),{x:a,y:c,textAlign:d,left:u,top:f,right:y,bottom:g}=n._pointLabelItems[s],{backdropColor:p}=r;if(!ie(p)){let v=Et(r.borderRadius),x=ke(r.backdropPadding);t.fillStyle=p;let _=u-x.left,C=f-x.top,S=y-u+x.width,T=g-f+x.height;Object.values(v).some(k=>k!==0)?(t.beginPath(),on(t,{x:_,y:C,w:S,h:T,radius:v}),t.fill()):t.fillRect(_,C,S,T)}rn(t,n._pointLabels[s],a,c+o.lineHeight/2,o,{color:r.color,textAlign:d,textBaseline:"middle"})}}function Qg(n,e,t,i){let{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,fe);else{let r=n.getPointPosition(0,e);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,e),s.lineTo(r.x,r.y)}}function FM(n,e,t,i){let s=n.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!i||!o||!a||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),Qg(n,t,r,i),s.closePath(),s.stroke(),s.restore())}function BM(n,e,t){return Bt(n,{label:t,index:e,type:"pointLabel"})}function zM(n,e){return n-e}function Rg(n,e){if(ie(e))return null;let t=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts,o=e;return typeof i=="function"&&(o=i(o)),Pe(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Tn(r)||r===!0)?t.startOf(o,"isoWeek",r):t.startOf(o,s)),+o)}function Ag(n,e,t,i){let s=nt.length;for(let r=nt.indexOf(n);r<s-1;++r){let o=Sa[nt[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(a*o.size))<=i)return nt[r]}return nt[s-1]}function HM(n,e,t,i,s){for(let r=nt.length-1;r>=nt.indexOf(t);r--){let o=nt[r];if(Sa[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return nt[t?nt.indexOf(t):0]}function WM(n){for(let e=nt.indexOf(n)+1,t=nt.length;e<t;++e)if(Sa[nt[e]].common)return nt[e]}function Lg(n,e,t){if(!t)n[e]=!0;else if(t.length){let{lo:i,hi:s}=qs(t,e),r=t[i]>=e?t[i]:t[s];n[r]=!0}}function jM(n,e,t,i){let s=n._adapter,r=+s.startOf(e[0].value,i),o=e[e.length-1].value,a,c;for(a=r;a<=o;a=+s.add(a,1,i))c=t[a],c>=0&&(e[c].major=!0);return e}function Ig(n,e,t){let i=[],s={},r=e.length,o,a;for(o=0;o<r;++o)a=e[o],s[a]=o,i.push({value:a,major:!1});return r===0||!t?i:jM(n,i,s,t)}function ua(n,e,t){let i=0,s=n.length-1,r,o,a,c;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=nn(n,"pos",e)),{pos:r,time:a}=n[i],{pos:o,time:c}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=nn(n,"time",e)),{time:r,pos:a}=n[i],{time:o,pos:c}=n[s]);let d=o-r;return d?a+(c-a)*(e-r)/d:a}var Sd,ln,Jp,vD,Cd,wD,xD,_D,qi,md,sg,RD,lt,ui,Xi,dn,Zi,Ji,lr,Qi,Ae,zg,wa,JD,lg,un,Ki,kd,Ht,es,cr,lE,fE,Hg,vt,fa,Td,ha,xE,gg,jg,dr,mg,Od,Dd,yg,$g,rr,Pd,jE,YE,UE,ga,Kg,Ye,_g,En,hn,aM,ts,hi,Mt,Cg,pM,ma,rs,ya,xa,ar,ur,_a,CM,TM,fn,ns,Pn,ba,is,Sa,nt,ss,va,fi=O(()=>{oa();oa();Sd=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){let r=t.listeners[s],o=t.duration;r.forEach(a=>a({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Vo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,c;for(;o>=0;--o)c=r[o],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,e,"progress")),r.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=r.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let i=t.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},ln=new Sd,Jp="transparent",vD={boolean(n,e,t){return t>.5?e:n},color(n,e,t){let i=Go(n||Jp),s=i.valid&&Go(e||Jp);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}},Cd=class{constructor(e,t,i,s){let r=t[i];s=ye([e.to,s,r,e.from]);let o=ye([e.from,r,s]);this._active=!0,this._fn=e.fn||vD[e.type||typeof o],this._easing=Qn[e.easing]||Qn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);let s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=ye([e.to,t,s,e.from]),this._from=ye([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to,c;if(this._active=r!==a&&(o||t<i),!this._active){this._target[s]=a,this._notify(!0);return}if(t<0){this._target[s]=r;return}c=t/i%2,c=o&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(r,a,c)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){let t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}},wD=["x","y","borderWidth","radius","tension"],xD=["color","borderColor","backgroundColor"];ee.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});_D=Object.keys(ee.animation);ee.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ee.set("animations",{colors:{type:"color",properties:xD},numbers:{type:"number",properties:wD}});ee.describe("animations",{_fallback:"animation"});ee.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});qi=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Q(e))return;let t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{let s=e[i];if(!Q(s))return;let r={};for(let o of _D)r[o]=s[o];(he(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,r)})})}_animateOptions(e,t){let i=t.options,s=CD(e,i);if(!s)return[];let r=this._createAnimations(s,i);return i.$shared&&SD(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,t){let i=this._properties,s=[],r=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now(),c;for(c=o.length-1;c>=0;--c){let d=o[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,t));continue}let u=t[d],f=r[d],y=i.get(d);if(f)if(y&&f.active()){f.update(y,u,a);continue}else f.cancel();if(!y||!y.duration){e[d]=u;continue}r[d]=f=new Cd(y,e,d,u),s.push(f)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let i=this._createAnimations(e,t);if(i.length)return ln.add(this._chart,i),!0}};md=n=>n==="reset"||n==="none",sg=(n,e)=>e?n:Object.assign({},n),RD=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Fg(t,!0),values:null},lt=class{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=tg(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&tr(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(f,y,g,p)=>f==="x"?y:f==="r"?p:g,r=t.xAxisID=J(i.xAxisID,gd(e,"x")),o=t.yAxisID=J(i.yAxisID,gd(e,"y")),a=t.rAxisID=J(i.rAxisID,gd(e,"r")),c=t.indexAxis,d=t.iAxisID=s(c,r,o,a),u=t.vAxisID=s(c,o,r,a);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(d),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){let e=this._cachedMeta;this._data&&Wo(this._data,this),e._stacked&&tr(e)}_dataCheck(){let e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Q(t))this._data=OD(t);else if(i!==t){if(i){Wo(i,this);let s=this._cachedMeta;tr(s),s._parsed=[]}t&&Object.isExtensible(t)&&Kc(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let r=t._stacked;t._stacked=tg(t.vScale,t),t.stack!==i.stack&&(s=!0,tr(t),t.stack=i.stack),this._resyncElements(e),(s||r!==t._stacked)&&ig(this,t._parsed)}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis,c=e===0&&t===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,y;if(this._parsing===!1)i._parsed=s,i._sorted=!0,y=s;else{he(s[e])?y=this.parseArrayData(i,s,e,t):Q(s[e])?y=this.parseObjectData(i,s,e,t):y=this.parsePrimitiveData(i,s,e,t);let g=()=>f[a]===null||d&&f[a]<d[a];for(u=0;u<t;++u)i._parsed[u+e]=f=y[u],c&&(g()&&(c=!1),d=f);i._sorted=c}o&&ig(this,y)}parsePrimitiveData(e,t,i,s){let{iScale:r,vScale:o}=e,a=r.axis,c=o.axis,d=r.getLabels(),u=r===o,f=new Array(s),y,g,p;for(y=0,g=s;y<g;++y)p=y+i,f[y]={[a]:u||r.parse(d[p],p),[c]:o.parse(t[p],p)};return f}parseArrayData(e,t,i,s){let{xScale:r,yScale:o}=e,a=new Array(s),c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=t[u],a[c]={x:r.parse(f[0],u),y:o.parse(f[1],u)};return a}parseObjectData(e,t,i,s){let{xScale:r,yScale:o}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=new Array(s),u,f,y,g;for(u=0,f=s;u<f;++u)y=u+i,g=t[y],d[u]={x:r.parse(It(g,a),y),y:o.parse(It(g,c),y)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){let s=this.chart,r=this._cachedMeta,o=t[e.axis],a={keys:Fg(s,!0),values:t._stacks[e.axis]};return eg(a,o,r.index,{mode:i})}updateRangeFromParsed(e,t,i,s){let r=i[t.axis],o=r===null?NaN:r,a=s&&i._stacks[t.axis];s&&a&&(s.values=a,o=eg(s,r,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){let i=this._cachedMeta,s=i._parsed,r=i._sorted&&e===i.iScale,o=s.length,a=this._getOtherScale(e),c=RD(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=ED(a),y,g;function p(){g=s[y];let v=g[a.axis];return!Pe(g[e.axis])||u>v||f<v}for(y=0;y<o&&!(!p()&&(this.updateRangeFromParsed(d,e,g,c),r));++y);if(r){for(y=o-1;y>=0;--y)if(!p()){this.updateRangeFromParsed(d,e,g,c);break}}return d}getAllParsedValues(e){let t=this._cachedMeta._parsed,i=[],s,r,o;for(s=0,r=t.length;s<r;++s)o=t[s][e.axis],Pe(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,i=t.iScale,s=t.vScale,r=this.getParsed(e);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(e){let t=this._cachedMeta;this.update(e||"default"),t._clip=TD(J(this.options.clip,kD(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],r=t.chartArea,o=[],a=this._drawStart||0,c=this._drawCount||s.length-a,d=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(e,r,a,c),u=a;u<a+c;++u){let f=s[u];f.hidden||(f.active&&d?o.push(f):f.draw(e,r))}for(u=0;u<o.length;++u)o[u].draw(e,r)}getStyle(e,t){let i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){let s=this.getDataset(),r;if(e>=0&&e<this._cachedMeta.data.length){let o=this._cachedMeta.data[e];r=o.$context||(o.$context=ND(this.getContext(),e,o)),r.parsed=this.getParsed(e),r.raw=s.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=PD(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){let s=t==="active",r=this._cachedDataOpts,o=e+"-"+t,a=r[o],c=this.enableOptionSharing&&De(i);if(a)return sg(a,c);let d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],y=d.getOptionScopes(this.getDataset(),u),g=Object.keys(ee.elements[e]),p=()=>this.getContext(i,s),v=d.resolveNamedOptions(y,g,p,f);return v.$shared&&(v.$shared=c,r[o]=Object.freeze(sg(v,c))),v}_resolveAnimations(e,t,i){let s=this.chart,r=this._cachedDataOpts,o=`animation-${t}`,a=r[o];if(a)return a;let c;if(s.options.animation!==!1){let u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,t),y=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(y,this.getContext(e,i,t))}let d=new qi(s,c&&c.animations);return c&&c._cacheable&&(r[o]=Object.freeze(d)),d}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||md(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(t,r)||r!==s;return this.updateSharedOptions(r,t,i),{sharedOptions:r,includeOptions:o}}updateElement(e,t,i,s){md(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!md(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;let r=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){let t=this._data,i=this._cachedMeta.data;for(let[a,c,d]of this._syncList)this[a](c,d);this._syncList=[];let s=i.length,r=t.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,e):r<s&&this._removeElements(r,s-r)}_insertElements(e,t,i=!0){let s=this._cachedMeta,r=s.data,o=e+t,a,c=d=>{for(d.length+=t,a=d.length-1;a>=o;a--)d[a]=d[a-t]};for(c(r),a=e;a<o;++a)r[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,t),i&&this.updateElements(r,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(e,t);i._stacked&&tr(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);let i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};lt.defaults={};lt.prototype.datasetElementType=null;lt.prototype.dataElementType=null;ui=class extends lt{parsePrimitiveData(e,t,i,s){return rg(e,t,i,s)}parseArrayData(e,t,i,s){return rg(e,t,i,s)}parseObjectData(e,t,i,s){let{iScale:r,vScale:o}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=r.axis==="x"?a:c,u=o.axis==="x"?a:c,f=[],y,g,p,v;for(y=i,g=i+s;y<g;++y)v=t[y],p={},p[r.axis]=r.parse(It(v,d),y),f.push(Bg(It(v,u),p,o,y));return f}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);let r=i._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let t=this._cachedMeta,{iScale:i,vScale:s}=t,r=this.getParsed(e),o=r._custom,a=yd(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){let r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),d=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:y}=this._getSharedOptions(t,s);for(let g=t;g<t+i;g++){let p=this.getParsed(g),v=r||ie(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),_=(p._stacks||{})[a.axis],C={horizontal:d,base:v.base,enableBorderRadius:!_||yd(p._custom)||o===_._top||o===_._bottom,x:d?v.head:x.center,y:d?x.center:v.head,height:d?x.size:Math.abs(v.size),width:d?Math.abs(v.size):x.size};y&&(C.options=f||this.resolveDataElementOptions(g,e[g].active?"active":s));let S=C.options||e[g].options;WD(C,S,_,o),VD(C,S,u.ratio),this.updateElement(e[g],g,C,s)}}_getStacks(e,t){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),r=i.options.stacked,o=[],a=c=>{let d=c.controller.getParsed(t),u=d&&d[c.vScale.axis];if(ie(u)||isNaN(u))return!0};for(let c of s)if(!(t!==void 0&&a(c))&&((r===!1||o.indexOf(c.stack)===-1||r===void 0&&c.stack===void 0)&&o.push(c.stack),c.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){let s=this._getStacks(e,i),r=t!==void 0?s.indexOf(t):-1;return r===-1?s.length-1:r}_getRuler(){let e=this.options,t=this._cachedMeta,i=t.iScale,s=[],r,o;for(r=0,o=t.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));let a=e.barThickness;return{min:a||LD(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:r}}=this,o=s||0,a=this.getParsed(e),c=a._custom,d=yd(c),u=a[t.axis],f=0,y=i?this.applyStack(t,a,i):u,g,p;y!==u&&(f=y-u,y=u),d&&(u=c.barStart,y=c.barEnd-c.barStart,u!==0&&bt(u)!==bt(c.barEnd)&&(f=0),f+=u);let v=!ie(s)&&!d?s:f,x=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?g=t.getPixelForValue(f+y):g=x,p=g-x,Math.abs(p)<r){p=zD(p,t,o)*r,u===o&&(x-=p/2);let _=t.getPixelForDecimal(0),C=t.getPixelForDecimal(1),S=Math.min(_,C),T=Math.max(_,C);x=Math.max(Math.min(x,T),S),g=x+p}if(x===t.getPixelForValue(o)){let _=bt(p)*t.getLineWidthForValue(o)/2;x+=_,p-=_}return{size:p,base:x,head:g,center:g+p/2}}_calculateBarIndexPixels(e,t){let i=t.scale,s=this.options,r=s.skipNull,o=J(s.maxBarThickness,1/0),a,c;if(t.grouped){let d=r?this._getStackCount(e):t.stackCount,u=s.barThickness==="flex"?FD(e,t,s,d):ID(e,t,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);a=u.start+u.chunk*f+u.chunk/2,c=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(o,t.min*t.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){let e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length,r=0;for(;r<s;++r)this.getParsed(r)[t.axis]!==null&&i[r].draw(this._ctx)}};ui.id="bar";ui.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};ui.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};Xi=class extends lt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){let r=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(e,t,i,s){let r=super.parseArrayData(e,t,i,s);for(let o=0;o<r.length;o++){let a=t[i+o];r[o]._custom=J(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(e,t,i,s){let r=super.parseObjectData(e,t,i,s);for(let o=0;o<r.length;o++){let a=t[i+o];r[o]._custom=J(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){let e=this._cachedMeta.data,t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,{xScale:i,yScale:s}=t,r=this.getParsed(e),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),c=r._custom;return{label:t.label,value:"("+o+", "+a+(c?", "+c:"")+")"}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s),u=o.axis,f=a.axis;for(let y=t;y<t+i;y++){let g=e[y],p=!r&&this.getParsed(y),v={},x=v[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),_=v[f]=r?a.getBasePixel():a.getPixelForValue(p[f]);v.skip=isNaN(x)||isNaN(_),d&&(v.options=c||this.resolveDataElementOptions(y,g.active?"active":s),r&&(v.options.radius=0)),this.updateElement(g,y,v,s)}}resolveDataElementOptions(e,t){let i=this.getParsed(e),s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let r=s.radius;return t!=="active"&&(s.radius=0),s.radius+=J(i&&i._custom,r),s}};Xi.id="bubble";Xi.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Xi.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};dn=class extends lt{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=c=>+i[c];if(Q(i[e])){let{key:c="value"}=this._parsing;r=d=>+It(i[d],c)}let o,a;for(o=e,a=e+t;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Me(this.options.rotation-90)}_getCircumference(){return Me(this.options.circumference)}_getRotationExtents(){let e=fe,t=-fe;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){let s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();e=Math.min(e,r),t=Math.max(t,r+o)}return{rotation:e,circumference:t-e}}update(e){let t=this.chart,{chartArea:i}=t,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),c=Math.min(Wc(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:y,ratioY:g,offsetX:p,offsetY:v}=YD(f,u,c),x=(i.width-o)/y,_=(i.height-o)/g,C=Math.max(Math.min(x,_)/2,0),S=Ao(this.options.radius,C),T=Math.max(S*c,0),k=(S-T)/this._getVisibleDatasetWeightTotal();this.offsetX=p*S,this.offsetY=v*S,s.total=this.calculateTotal(),this.outerRadius=S-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let i=this.options,s=this._cachedMeta,r=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*r/fe)}updateElements(e,t,i,s){let r=s==="reset",o=this.chart,a=o.chartArea,d=o.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,y=r&&d.animateScale,g=y?0:this.innerRadius,p=y?0:this.outerRadius,{sharedOptions:v,includeOptions:x}=this._getSharedOptions(t,s),_=this._getRotation(),C;for(C=0;C<t;++C)_+=this._circumference(C,r);for(C=t;C<t+i;++C){let S=this._circumference(C,r),T=e[C],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+S,circumference:S,outerRadius:p,innerRadius:g};x&&(k.options=v||this.resolveDataElementOptions(C,T.active?"active":s)),_+=S,this.updateElement(T,C,k,s)}}calculateTotal(){let e=this._cachedMeta,t=e.data,i=0,s;for(s=0;s<t.length;s++){let r=e._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?fe*(Math.abs(e)/t):0}getLabelAndValue(e){let t=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ci(t._parsed[e],i.options.locale);return{label:s[e]||"",value:r}}getMaxBorderWidth(e){let t=0,i=this.chart,s,r,o,a,c;if(!e){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,a=o.controller;break}}if(!e)return 0;for(s=0,r=e.length;s<r;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(t=Math.max(t,c.borderWidth||0,c.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){let r=this.resolveDataElementOptions(i);t=Math.max(t,r.offset||0,r.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(J(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};dn.id="doughnut";dn.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};dn.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let e=n.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label,t=": "+n.formattedValue;return he(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};Zi=class extends lt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=t,o=this.chart._animationsDisabled,{start:a,count:c}=Uo(t,s,o);this._drawStart=a,this._drawCount=c,$o(t)&&(a=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;let d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:d},e),this.updateElements(s,a,c,e)}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(t,s),y=o.axis,g=a.axis,{spanGaps:p,segment:v}=this.options,x=Tn(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||s==="none",C=t>0&&this.getParsed(t-1);for(let S=t;S<t+i;++S){let T=e[S],k=this.getParsed(S),P=_?T:{},D=ie(k[g]),M=P[y]=o.getPixelForValue(k[y],S),N=P[g]=r||D?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,k,c):k[g],S);P.skip=isNaN(M)||isNaN(N)||D,P.stop=S>0&&Math.abs(k[y]-C[y])>x,v&&(P.parsed=k,P.raw=d.data[S]),f&&(P.options=u||this.resolveDataElementOptions(S,T.active?"active":s)),_||this.updateElement(T,S,P,s),C=k}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;let r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};Zi.id="line";Zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};Ji=class extends lt{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ci(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:r}}parseObjectData(e,t,i,s){return Qo.bind(this)(e,t,i,s)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{let r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/e.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,i,s){let r=s==="reset",o=this.chart,c=o.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,y=d.getIndexAngle(0)-.5*ae,g=y,p,v=360/this.countVisibleElements();for(p=0;p<t;++p)g+=this._computeAngle(p,s,v);for(p=t;p<t+i;p++){let x=e[p],_=g,C=g+this._computeAngle(p,s,v),S=o.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=C,r&&(c.animateScale&&(S=0),c.animateRotate&&(_=C=y));let T={x:u,y:f,innerRadius:0,outerRadius:S,startAngle:_,endAngle:C,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,T,s)}}countVisibleElements(){let e=this._cachedMeta,t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Me(this.resolveDataElementOptions(e,t).angle||i):0}};Ji.id="polarArea";Ji.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ji.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let e=n.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};lr=class extends dn{};lr.id="pie";lr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};Qi=class extends lt{getLabelAndValue(e){let t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Qo.bind(this)(e,t,i,s)}update(e){let t=this._cachedMeta,i=t.dataset,s=t.data||[],r=t.iScale.getLabels();if(i.points=s,e!=="resize"){let o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){let r=this._cachedMeta.rScale,o=s==="reset";for(let a=t;a<t+i;a++){let c=e[a],d=this.resolveDataElementOptions(a,c.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),f=o?r.xCenter:u.x,y=o?r.yCenter:u.y,g={x:f,y,angle:u.angle,skip:isNaN(f)||isNaN(y),options:d};this.updateElement(c,a,g,s)}}};Qi.id="radar";Qi.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Qi.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};Ae=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){let{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(e,t){let i=this.$animations;if(!t||!i)return this;let s={};return e.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};Ae.defaults={};Ae.defaultRoutes=void 0;zg={values(n){return he(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";let i=this.chart.options.locale,s,r=n;if(t.length>1){let d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),r=UD(n,t)}let o=tt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),ci(n,i,c)},logarithmic(n,e,t){if(n===0)return"0";let i=n/Math.pow(10,Math.floor(tt(n)));return i===1||i===2||i===5?zg.numeric.call(this,n,e,t):""}};wa={formatters:zg};ee.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:wa.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});ee.route("scale.ticks","color","","color");ee.route("scale.grid","color","","borderColor");ee.route("scale.grid","borderColor","","borderColor");ee.route("scale.title","color","","color");ee.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});ee.describe("scales",{_fallback:"scale"});ee.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});JD=n=>n==="left"?"right":n==="right"?"left":n,lg=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;un=class extends Ae{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=et(e,Number.POSITIVE_INFINITY),t=et(t,Number.NEGATIVE_INFINITY),i=et(i,Number.POSITIVE_INFINITY),s=et(s,Number.NEGATIVE_INFINITY),{min:et(e,i),max:et(t,s),minDefined:Pe(e),maxDefined:Pe(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:t,max:i};let a=this.getMatchingVisibleMetas();for(let c=0,d=a.length;c<d;++c)o=a[c].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),r||(i=Math.max(i,o.max));return t=r&&t>i?i:t,i=s&&t>i?t:i,{min:et(t,et(i,t)),max:et(i,et(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){le(this.options.beforeUpdate,[this])}update(e,t,i){let{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sd(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=a<this.ticks.length;this._convertTicksToLabels(c?cg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$D(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){le(this.options.afterUpdate,[this])}beforeSetDimensions(){le(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){le(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),le(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){le(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,i,s,r;for(i=0,s=e.length;i<s;i++)r=e[i],r.label=le(t.callback,[r.value,i,e],this)}afterTickToLabelConversion(){le(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){le(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,r=t.maxRotation,o=s,a,c,d;if(!this._isVisible()||!t.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),f=u.widest.width,y=u.highest.height,g=ze(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/i:g/(i-1),f+6>a&&(a=g/(i-(e.offset?.5:1)),c=this.maxHeight-nr(e.grid)-t.padding-dg(e.title,this.chart.options.font),d=Math.sqrt(f*f+y*y),o=si(Math.min(Math.asin(ze((u.highest.height+6)/a,-1,1)),Math.asin(ze(c/d,-1,1))-Math.asin(ze(y/d,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){le(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){le(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let c=dg(s,t.options.font);if(a?(e.width=this.maxWidth,e.height=nr(r)+c):(e.height=this.maxHeight,e.width=nr(r)+c),i.display&&this.ticks.length){let{first:d,last:u,widest:f,highest:y}=this._getLabelSizes(),g=i.padding*2,p=Me(this.labelRotation),v=Math.cos(p),x=Math.sin(p);if(a){let _=i.mirror?0:x*f.width+v*y.height;e.height=Math.min(this.maxHeight,e.height+_+g)}else{let _=i.mirror?0:v*f.width+x*y.height;e.width=Math.min(this.maxWidth,e.width+_+g)}this._calculatePadding(d,u,x,v)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){let{ticks:{align:r,padding:o},position:a}=this.options,c=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),y=0,g=0;c?d?(y=s*e.width,g=i*t.height):(y=i*e.height,g=s*t.width):r==="start"?g=t.width:r==="end"?y=e.width:r!=="inner"&&(y=e.width/2,g=t.width/2),this.paddingLeft=Math.max((y-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-f+o)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;r==="start"?(u=0,f=e.height):r==="end"&&(u=t.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){le(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)ie(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,i=this.ticks;t<i.length&&(i=cg(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){let{ctx:i,_longestTextCache:s}=this,r=[],o=[],a=0,c=0,d,u,f,y,g,p,v,x,_,C,S;for(d=0;d<t;++d){if(y=e[d].label,g=this._resolveTickFontOptions(d),i.font=p=g.string,v=s[p]=s[p]||{data:{},gc:[]},x=g.lineHeight,_=C=0,!ie(y)&&!he(y))_=Yi(i,v.data,v.gc,_,y),C=x;else if(he(y))for(u=0,f=y.length;u<f;++u)S=y[u],!ie(S)&&!he(S)&&(_=Yi(i,v.data,v.gc,_,S),C+=x);r.push(_),o.push(C),a=Math.max(_,a),c=Math.max(C,c)}eE(s,t);let T=r.indexOf(a),k=o.indexOf(c),P=D=>({width:r[D]||0,height:o[D]||0});return{first:P(0),last:P(t-1),widest:P(T),highest:P(k),widths:r,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return Uc(this._alignToPixels?sn(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let i=t[e];return i.$context||(i.$context=nE(this.getContext(),e,i))}return this.$context||(this.$context=tE(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=Me(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),r=this._getLabelSizes(),o=e.autoSkipPadding||0,a=r?r.widest.width+o:0,c=r?r.highest.height+o:0;return this.isHorizontal()?c*i>a*s?a/i:c/s:c*s<a*i?c/i:a/s}_isVisible(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,c=this.isHorizontal(),u=this.ticks.length+(a?1:0),f=nr(r),y=[],g=r.setContext(this.getContext()),p=g.drawBorder?g.borderWidth:0,v=p/2,x=function(F){return sn(i,F,p)},_,C,S,T,k,P,D,M,N,R,L,B;if(o==="top")_=x(this.bottom),P=this.bottom-f,M=_-v,R=x(e.top)+v,B=e.bottom;else if(o==="bottom")_=x(this.top),R=e.top,B=x(e.bottom)-v,P=_+v,M=this.top+f;else if(o==="left")_=x(this.right),k=this.right-f,D=_-v,N=x(e.left)+v,L=e.right;else if(o==="right")_=x(this.left),N=e.left,L=x(e.right)-v,k=_+v,D=this.left+f;else if(t==="x"){if(o==="center")_=x((e.top+e.bottom)/2+.5);else if(Q(o)){let F=Object.keys(o)[0],j=o[F];_=x(this.chart.scales[F].getPixelForValue(j))}R=e.top,B=e.bottom,P=_+v,M=P+f}else if(t==="y"){if(o==="center")_=x((e.left+e.right)/2);else if(Q(o)){let F=Object.keys(o)[0],j=o[F];_=x(this.chart.scales[F].getPixelForValue(j))}k=_-v,D=k-f,N=e.left,L=e.right}let W=J(s.ticks.maxTicksLimit,u),I=Math.max(1,Math.ceil(u/W));for(C=0;C<u;C+=I){let F=r.setContext(this.getContext(C)),j=F.lineWidth,V=F.color,q=F.borderDash||[],$=F.borderDashOffset,K=F.tickWidth,U=F.tickColor,G=F.tickBorderDash||[],z=F.tickBorderDashOffset;S=QD(this,C,a),S!==void 0&&(T=sn(i,S,j),c?k=D=N=L=T:P=M=R=B=T,y.push({tx1:k,ty1:P,tx2:D,ty2:M,x1:N,y1:R,x2:L,y2:B,width:j,color:V,borderDash:q,borderDashOffset:$,tickWidth:K,tickColor:U,tickBorderDash:G,tickBorderDashOffset:z}))}return this._ticksLength=u,this._borderValue=_,y}_computeLabelItems(e){let t=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=r,y=nr(i.grid),g=y+u,p=f?-u:g,v=-Me(this.labelRotation),x=[],_,C,S,T,k,P,D,M,N,R,L,B,W="middle";if(s==="top")P=this.bottom-p,D=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+p,D=this._getXAxisLabelAlignment();else if(s==="left"){let F=this._getYAxisLabelAlignment(y);D=F.textAlign,k=F.x}else if(s==="right"){let F=this._getYAxisLabelAlignment(y);D=F.textAlign,k=F.x}else if(t==="x"){if(s==="center")P=(e.top+e.bottom)/2+g;else if(Q(s)){let F=Object.keys(s)[0],j=s[F];P=this.chart.scales[F].getPixelForValue(j)+g}D=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")k=(e.left+e.right)/2-g;else if(Q(s)){let F=Object.keys(s)[0],j=s[F];k=this.chart.scales[F].getPixelForValue(j)}D=this._getYAxisLabelAlignment(y).textAlign}t==="y"&&(c==="start"?W="top":c==="end"&&(W="bottom"));let I=this._getLabelSizes();for(_=0,C=a.length;_<C;++_){S=a[_],T=S.label;let F=r.setContext(this.getContext(_));M=this.getPixelForTick(_)+r.labelOffset,N=this._resolveTickFontOptions(_),R=N.lineHeight,L=he(T)?T.length:1;let j=L/2,V=F.color,q=F.textStrokeColor,$=F.textStrokeWidth,K=D;o?(k=M,D==="inner"&&(_===C-1?K=this.options.reverse?"left":"right":_===0?K=this.options.reverse?"right":"left":K="center"),s==="top"?d==="near"||v!==0?B=-L*R+R/2:d==="center"?B=-I.highest.height/2-j*R+R:B=-I.highest.height+R/2:d==="near"||v!==0?B=R/2:d==="center"?B=I.highest.height/2-j*R:B=I.highest.height-L*R,f&&(B*=-1)):(P=M,B=(1-L)*R/2);let U;if(F.showLabelBackdrop){let G=ke(F.backdropPadding),z=I.heights[_],de=I.widths[_],be=P+B-G.top,ve=k-G.left;switch(W){case"middle":be-=z/2;break;case"bottom":be-=z;break}switch(D){case"center":ve-=de/2;break;case"right":ve-=de;break}U={left:ve,top:be,width:de+G.width,height:z+G.height,color:F.backdropColor}}x.push({rotation:v,label:T,font:N,color:V,strokeColor:q,strokeWidth:$,textOffset:B,textAlign:K,textBaseline:W,translation:[k,P],backdrop:U})}return x}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Me(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,c=o.widest.width,d,u;return t==="left"?s?(u=this.right+r,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-a,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):t==="right"?s?(u=this.left+r,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+a,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:i,top:s,width:r,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,r,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let s=this.ticks.findIndex(r=>r.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){let t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),r,o,a=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(r=0,o=s.length;r<o;++r){let c=s[r];t.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),t.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),r=i.drawBorder?s.borderWidth:0;if(!r)return;let o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue,c,d,u,f;this.isHorizontal()?(c=sn(e,this.left,r)-r/2,d=sn(e,this.right,o)+o/2,u=f=a):(u=sn(e,this.top,r)-r/2,f=sn(e,this.bottom,o)+o/2,c=d=a),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(c,u),t.lineTo(d,f),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&ai(i,s);let r=this._labelItems||(this._labelItems=this._computeLabelItems(e)),o,a;for(o=0,a=r.length;o<a;++o){let c=r[o],d=c.font,u=c.label;c.backdrop&&(i.fillStyle=c.backdrop.color,i.fillRect(c.backdrop.left,c.backdrop.top,c.backdrop.width,c.backdrop.height));let f=c.textOffset;rn(i,u,0,f,d,c)}s&&li(i)}drawTitle(){let{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;let r=we(i.font),o=ke(i.padding),a=i.align,c=r.lineHeight/2;t==="bottom"||t==="center"||Q(t)?(c+=o.bottom,he(i.text)&&(c+=r.lineHeight*(i.text.length-1))):c+=o.top;let{titleX:d,titleY:u,maxWidth:f,rotation:y}=sE(this,c,t,a);rn(e,i.text,0,0,r,{color:i.color,maxWidth:f,rotation:y,textAlign:iE(a,t,s),textBaseline:"middle",translation:[d,u]})}draw(e){!this._isVisible()||(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,i=J(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==un.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],r,o;for(r=0,o=t.length;r<o;++r){let a=t[r];a[i]===this.id&&(!e||a.type===e)&&s.push(a)}return s}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return we(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ki=class{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),i;aE(t)&&(i=this.register(t));let s=this.items,r=e.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in s||(s[r]=e,rE(e,o,i),this.override&&ee.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){let t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in ee[s]&&(delete ee[s][i],this.override&&delete On[i])}};kd=class{constructor(){this.controllers=new Ki(lt,"datasets",!0),this.elements=new Ki(Ae,"elements"),this.plugins=new Ki(Object,"plugins"),this.scales=new Ki(un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{let r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(e,r,s):ce(s,o=>{let a=i||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,t,i){let s=Ks(e);le(i["before"+s],[],i),t[e](i),le(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){let s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}},Ht=new kd,es=class extends lt{update(e){let t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled,{start:r,count:o}=Uo(t,i,s);if(this._drawStart=r,this._drawCount=o,$o(t)&&(r=0,o=i.length),this.options.showLine){let{dataset:a,_dataset:c}=t;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=i;let d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:d},e)}this.updateElements(i,r,o,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Ht.getElement("line")),super.addElements()}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(t,s),f=this.getSharedOptions(u),y=this.includeOptions(s,f),g=o.axis,p=a.axis,{spanGaps:v,segment:x}=this.options,_=Tn(v)?v:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||r||s==="none",S=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){let k=e[T],P=this.getParsed(T),D=C?k:{},M=ie(P[p]),N=D[g]=o.getPixelForValue(P[g],T),R=D[p]=r||M?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,P,c):P[p],T);D.skip=isNaN(N)||isNaN(R)||M,D.stop=T>0&&Math.abs(P[g]-S[g])>_,x&&(D.parsed=P,D.raw=d.data[T]),y&&(D.options=f||this.resolveDataElementOptions(T,k.active?"active":s)),C||this.updateElement(k,T,D,s),S=P}this.updateSharedOptions(f,s,u)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let a=0;for(let c=t.length-1;c>=0;--c)a=Math.max(a,t[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}let i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;let r=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,r,o)/2}};es.id="scatter";es.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};es.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};cr=class{constructor(e){this.options=e||{}}init(e){}formats(){return di()}parse(e,t){return di()}format(e,t){return di()}add(e,t,i){return di()}diff(e,t,i){return di()}startOf(e,t,i){return di()}endOf(e,t){return di()}};cr.override=function(n){Object.assign(cr.prototype,n)};lE={_date:cr};fE={evaluateInteractionItems:hr,modes:{index(n,e,t,i){let s=an(e,n),r=t.axis||"x",o=t.includeInvisible||!1,a=t.intersect?bd(n,s,r,i,o):vd(n,s,r,!1,i,o),c=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{let u=a[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(n,e,t,i){let s=an(e,n),r=t.axis||"xy",o=t.includeInvisible||!1,a=t.intersect?bd(n,s,r,i,o):vd(n,s,r,!1,i,o);if(a.length>0){let c=a[0].datasetIndex,d=n.getDatasetMeta(c).data;a=[];for(let u=0;u<d.length;++u)a.push({element:d[u],datasetIndex:c,index:u})}return a},point(n,e,t,i){let s=an(e,n),r=t.axis||"xy",o=t.includeInvisible||!1;return bd(n,s,r,i,o)},nearest(n,e,t,i){let s=an(e,n),r=t.axis||"xy",o=t.includeInvisible||!1;return vd(n,s,r,t.intersect,i,o)},x(n,e,t,i){let s=an(e,n);return ug(n,s,"x",t.intersect,i)},y(n,e,t,i){let s=an(e,n);return ug(n,s,"y",t.intersect,i)}}},Hg=["left","top","right","bottom"];ee.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});vt={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){let t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;let s=ke(n.options.layout.padding),r=Math.max(e-s.width,0),o=Math.max(t-s.height,0),a=yE(n.boxes),c=a.vertical,d=a.horizontal;ce(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});let u=c.reduce((v,x)=>x.box.options&&x.box.options.display===!1?v:v+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),y=Object.assign({},s);Wg(y,ke(i));let g=Object.assign({maxPadding:y,w:r,h:o,x:s.left,y:s.top},s),p=mE(c.concat(d),f);or(a.fullSize,g,f,p),or(c,g,f,p),or(d,g,f,p)&&or(c,g,f,p),vE(g),pg(a.leftAndTop,g,f,p),g.x+=g.w,g.y+=g.h,pg(a.rightAndBottom,g,f,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},ce(a.chartArea,v=>{let x=v.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}},fa=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}},Td=class extends fa{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},ha="$chartjs",xE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gg=n=>n===null||n==="";jg=cd?{passive:!0}:!1;dr=new Map,mg=0;Od=class extends fa{acquireContext(e,t){let i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(_E(e,t),i):null}releaseContext(e){let t=e.canvas;if(!t[ha])return!1;let i=t[ha].initial;["height","width"].forEach(r=>{let o=i[r];ie(o)?t.removeAttribute(r):t.setAttribute(r,o)});let s=i.style||{};return Object.keys(s).forEach(r=>{t.style[r]=s[r]}),t.width=t.width,delete t[ha],!0}addEventListener(e,t,i){this.removeEventListener(e,t);let s=e.$proxies||(e.$proxies={}),o={attach:TE,detach:OE,resize:ME}[t]||PE;s[t]=o(e,t,i)}removeEventListener(e,t){let i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:wd,detach:wd,resize:wd}[t]||CE)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return ld(e,t,i,s)}isAttached(e){let t=er(e);return!!(t&&t.isConnected)}};Dd=class{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let r=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(r,e,t,i);return t==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(let r of e){let o=r.plugin,a=o[i],c=[t,s,r.options];if(le(a,c,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ie(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let i=e&&e.config,s=J(i.options&&i.options.plugins,{}),r=RE(i);return s===!1&&!t?[]:LE(e,r,s,t)}_notifyStateChanges(e){let t=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(c=>a.plugin.id===c.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}};yg=new Map,$g=new Set;rr=(n,e,t)=>{let i=It(e,t);i!==void 0&&n.add(i)},Pd=class{constructor(e){this._config=WE(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ug(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Yg(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ca(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return ca(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return ca(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,i=this.type;return ca(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let i=this._scopeCache,s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){let{options:s,type:r}=this,o=this._cachedScopes(e,i),a=o.get(t);if(a)return a;let c=new Set;t.forEach(u=>{e&&(c.add(e),u.forEach(f=>rr(c,e,f))),u.forEach(f=>rr(c,s,f)),u.forEach(f=>rr(c,On[r]||{},f)),u.forEach(f=>rr(c,ee,f)),u.forEach(f=>rr(c,Ko,f))});let d=Array.from(c);return d.length===0&&d.push(Object.create(null)),$g.has(t)&&o.set(t,d),d}chartOptionScopes(){let{options:e,type:t}=this;return[e,On[t]||{},ee.datasets[t]||{},{type:t},ee,Ko]}resolveNamedOptions(e,t,i,s=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=bg(this._resolverCache,e,s),c=o;if(VE(o,t)){r.$shared=!1,i=Lt(i)?i():i;let d=this.createResolver(e,i,a);c=kn(o,i,d)}for(let d of t)r[d]=c[d];return r}createResolver(e,t,i=[""],s){let{resolver:r}=bg(this._resolverCache,e,i);return Q(t)?kn(r,t,void 0,s):r}};jE=n=>Q(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Lt(n[t]),!1);YE="3.9.1",UE=["top","bottom","left","right","chartArea"];ga={},Kg=n=>{let e=Gg(n);return Object.values(ga).filter(t=>t.canvas===e).pop()};Ye=class{constructor(e,t){let i=this.config=new Pd(t),s=Gg(e),r=Kg(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||NE(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,o.aspectRatio),c=a&&a.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Hc(),this.ctx=a,this.canvas=c,this.width=u,this.height=d,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Dd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qc(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],ga[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}ln.listen(this,"complete",xg),ln.listen(this,"progress",$E),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:r}=this;return ie(e)?t&&r?r:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():na(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qo(this.canvas,this.ctx),this}stop(){return ln.stop(this),this}resize(e,t){ln.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,na(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),le(i.onResize,[this,o],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let t=this.options.scales||{};ce(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){let e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];t&&(r=r.concat(Object.keys(t).map(o=>{let a=t[o],c=Md(o,a),d=c==="r",u=c==="x";return{options:a,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),ce(r,o=>{let a=o.options,c=a.id,d=Md(c,a),u=J(a.type,o.dtype);(a.position===void 0||vg(a.position,d)!==vg(o.dposition))&&(a.position=o.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{let y=Ht.getScale(u);f=new y({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,e)}),ce(s,(o,a)=>{o||delete i[a]}),ce(i,o=>{vt.configure(this,o,o.options),vt.addBox(this,o)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,r)=>s.index-r.index),i>t){for(let s=t;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(wg("order","index"))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){let r=t[i],o=this.getDatasetMeta(i),a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Ed(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{let c=Ht.getController(a),{datasetElementType:d,dataElementType:u}=ee.datasets[a];Object.assign(c.prototype,{dataElementType:Ht.getElement(u),datasetElementType:d&&Ht.getElement(d)}),o.controller=new c(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ce(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){let t=this.config;t.update();let i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let d=0,u=this.data.datasets.length;d<u;d++){let{controller:f}=this.getDatasetMeta(d),y=!s&&r.indexOf(f)===-1;f.buildOrUpdateElements(y),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||ce(r,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(wg("z","_idx"));let{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ce(this.scales,e=>{vt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Lo(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:r}of t){let o=i==="_removeElements"?-r:r;GE(e,s,o)}}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,i=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<t;r++)if(!Lo(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,e);let t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ce(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Lt(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){let i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ln.has(this)?this.attached&&!ln.running(this)&&ln.start(this):(this.draw(),xg({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){let t=this._sortedMetasets,i=[],s,r;for(s=0,r=t.length;s<r;++s){let o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){let t=this.ctx,i=e._clip,s=!i.disabled,r=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&ai(t,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),e.controller.draw(),s&&li(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ti(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){let r=fE.modes[t];return typeof r=="function"?r(this,e,i,s):[]}getDatasetMeta(e){let t=this.data.datasets[e],i=this._metasets,s=i.filter(r=>r&&r._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Bt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){let i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){let s=i?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,s);De(t)?(r.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ln.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),qo(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ga[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,i=(r,o)=>{t.addEventListener(this,r,o),e[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};ce(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,t=this.platform,i=(c,d)=>{t.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(t.removeEventListener(this,c,d),delete e[c])},r=(c,d)=>{this.canvas&&this.resize(c,d)},o,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():o()}unbindEvents(){ce(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ce(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){let s=i?"set":"remove",r,o,a,c;for(t==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){o=e[a];let d=o&&this.getDatasetMeta(o.datasetIndex).controller;d&&d[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],i=e.map(({datasetIndex:r,index:o})=>{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!$i(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){let s=this.options.hover,r=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),o=r(t,e),a=i?e:r(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,t){let i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let r=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(e,t,i){let{_active:s=[],options:r}=this,o=t,a=this._getActiveElements(e,s,i,o),c=jc(e),d=KE(e,this._lastEvent,i,c);i&&(this._lastEvent=null,le(r.onHover,[e,a,this],this),c&&le(r.onClick,[e,a,this],this));let u=!$i(a,s);return(u||t)&&(this._active=a,this._updateHoverStyles(a,s,t)),this._lastEvent=d,u}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;let r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,s)}},_g=()=>ce(Ye.instances,n=>n._plugins.invalidate()),En=!0;Object.defineProperties(Ye,{defaults:{enumerable:En,value:ee},instances:{enumerable:En,value:ga},overrides:{enumerable:En,value:On},registry:{enumerable:En,value:Ht},version:{enumerable:En,value:YE},getChart:{enumerable:En,value:Kg},register:{enumerable:En,value:(...n)=>{Ht.add(...n),_g()}},unregister:{enumerable:En,value:(...n)=>{Ht.remove(...n),_g()}}});hn=class extends Ae{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){let s=this.getProps(["x","y"],i),{angle:r,distance:o}=Ho(s,{x:e,y:t}),{startAngle:a,endAngle:c,innerRadius:d,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=this.options.spacing/2,p=J(f,c-a)>=fe||ri(r,a,c),v=Ft(o,d+y,u+y);return p&&v}getCenterPoint(e){let{x:t,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:c,spacing:d}=this.options,u=(s+r)/2,f=(o+a+d+c)/2;return{x:t+Math.cos(u)*f,y:i+Math.sin(u)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:i}=this,s=(t.offset||0)/2,r=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>fe?Math.floor(i/fe):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=0;if(s){a=s/2;let d=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(d)*a,Math.sin(d)*a),this.circumference>=ae&&(a=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;let c=ZE(e,this,a,r,o);QE(e,this,a,r,c,o),e.restore()}};hn.id="arc";hn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};hn.defaultRoutes={backgroundColor:"backgroundColor"};aM=typeof Path2D=="function";ts=class extends Ae{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;ad(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=pd(this,this.options.segment))}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){let i=this.options,s=e[t],r=this.points,o=fd(this,{property:t,start:s,end:s});if(!o.length)return;let a=[],c=sM(i),d,u;for(d=0,u=o.length;d<u;++d){let{start:f,end:y}=o[d],g=r[f],p=r[y];if(g===p){a.push(g);continue}let v=Math.abs((s-g[t])/(p[t]-g[t])),x=c(g,p,v,i.stepped);x[t]=e[t],a.push(x)}return a.length===1?a[0]:a}pathSegment(e,t,i){return Rd(this)(e,this,t,i)}path(e,t,i){let s=this.segments,r=Rd(this),o=this._loop;t=t||0,i=i||this.points.length-t;for(let a of s)o&=r(e,this,a,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),lM(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};ts.id="line";ts.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};ts.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};ts.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};hi=class extends Ae{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){let s=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(e-r,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return Sg(this,e,"x",t)}inYRange(e,t){return Sg(this,e,"y",t)}getCenterPoint(e){let{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){let i=this.options;this.skip||i.radius<.1||!ti(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,oi(e,i,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};hi.id="point";hi.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};hi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Mt=class extends Ae{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=uM(this),a=hM(o.radius)?on:fM;e.save(),(o.w!==r.w||o.h!==r.h)&&(e.beginPath(),a(e,_d(o,t,r)),e.clip(),a(e,_d(r,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,_d(r,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return xd(this,e,t,i)}inXRange(e,t){return xd(this,e,null,t)}inYRange(e,t){return xd(this,null,e,t)}getCenterPoint(e){let{x:t,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+s)/2:t,y:r?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}};Mt.id="bar";Mt.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Mt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Cg=(n,e)=>{let{boxHeight:t=e,boxWidth:i=e}=n;return n.usePointStyle&&(t=Math.min(t,e),i=n.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},pM=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index,ma=class extends Ae{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=le(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let i=e.labels,s=we(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Cg(i,r),d,u;t.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(o,r,a,c)+10):(u=this.maxHeight,d=this._fitCols(o,r,a,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,s){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+a,f=e;r.textAlign="left",r.textBaseline="middle";let y=-1,g=-u;return this.legendItems.forEach((p,v)=>{let x=i+t/2+r.measureText(p.text).width;(v===0||d[d.length-1]+x+2*a>o)&&(f+=u,d[d.length-(v>0?0:1)]=0,g+=u,y++),c[v]={left:0,top:g,row:y,width:x,height:s},d[d.length-1]+=x+a}),f}_fitCols(e,t,i,s){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=o-e,f=a,y=0,g=0,p=0,v=0;return this.legendItems.forEach((x,_)=>{let C=i+t/2+r.measureText(x.text).width;_>0&&g+s+2*a>u&&(f+=y+a,d.push({width:y,height:g}),p+=y+a,v++,y=g=0),c[_]={left:p,top:g,col:v,width:C,height:s},y=Math.max(y,C),g+=s+a}),f+=y,d.push({width:y,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Dn(r,this.left,this.width);if(this.isHorizontal()){let a=0,c=He(i,this.left+s,this.right-this.lineWidths[a]);for(let d of t)a!==d.row&&(a=d.row,c=He(i,this.left+s,this.right-this.lineWidths[a])),d.top+=this.top+e+s,d.left=o.leftForLtr(o.x(c),d.width),c+=d.width+s}else{let a=0,c=He(i,this.top+e+s,this.bottom-this.columnSizes[a].height);for(let d of t)d.col!==a&&(a=d.col,c=He(i,this.top+e+s,this.bottom-this.columnSizes[a].height)),d.top=c,d.left+=this.left+s,d.left=o.leftForLtr(o.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;ai(e,this),this._draw(),li(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:i,ctx:s}=this,{align:r,labels:o}=e,a=ee.color,c=Dn(e.rtl,this.left,this.width),d=we(o.font),{color:u,padding:f}=o,y=d.size,g=y/2,p;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;let{boxWidth:v,boxHeight:x,itemHeight:_}=Cg(o,y),C=function(D,M,N){if(isNaN(v)||v<=0||isNaN(x)||x<0)return;s.save();let R=J(N.lineWidth,1);if(s.fillStyle=J(N.fillStyle,a),s.lineCap=J(N.lineCap,"butt"),s.lineDashOffset=J(N.lineDashOffset,0),s.lineJoin=J(N.lineJoin,"miter"),s.lineWidth=R,s.strokeStyle=J(N.strokeStyle,a),s.setLineDash(J(N.lineDash,[])),o.usePointStyle){let L={radius:x*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:R},B=c.xPlus(D,v/2),W=M+g;Xo(s,L,B,W,o.pointStyleWidth&&v)}else{let L=M+Math.max((y-x)/2,0),B=c.leftForLtr(D,v),W=Et(N.borderRadius);s.beginPath(),Object.values(W).some(I=>I!==0)?on(s,{x:B,y:L,w:v,h:x,radius:W}):s.rect(B,L,v,x),s.fill(),R!==0&&s.stroke()}s.restore()},S=function(D,M,N){rn(s,N.text,D,M+_/2,d,{strikethrough:N.hidden,textAlign:c.textAlign(N.textAlign)})},T=this.isHorizontal(),k=this._computeTitleHeight();T?p={x:He(r,this.left+f,this.right-i[0]),y:this.top+f+k,line:0}:p={x:this.left+f,y:He(r,this.top+k+f,this.bottom-t[0].height),line:0},sa(this.ctx,e.textDirection);let P=_+f;this.legendItems.forEach((D,M)=>{s.strokeStyle=D.fontColor||u,s.fillStyle=D.fontColor||u;let N=s.measureText(D.text).width,R=c.textAlign(D.textAlign||(D.textAlign=o.textAlign)),L=v+g+N,B=p.x,W=p.y;c.setWidth(this.width),T?M>0&&B+L+f>this.right&&(W=p.y+=P,p.line++,B=p.x=He(r,this.left+f,this.right-i[p.line])):M>0&&W+P>this.bottom&&(B=p.x=B+t[p.line].width+f,p.line++,W=p.y=He(r,this.top+k+f,this.bottom-t[p.line].height));let I=c.x(B);C(I,W,D),B=Xc(R,B+v+g,T?B+L:this.right,e.rtl),S(c.x(B),W,D),T?p.x+=L+f:p.y+=P}),ra(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,i=we(t.font),s=ke(t.padding);if(!t.display)return;let r=Dn(e.rtl,this.left,this.width),o=this.ctx,a=t.position,c=i.size/2,d=s.top+c,u,f=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),u=this.top+d,f=He(e.align,f,this.right-y);else{let p=this.columnSizes.reduce((v,x)=>Math.max(v,x.height),0);u=d+He(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}let g=He(a,f,f+y);o.textAlign=r.textAlign(Xs(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=i.string,rn(o,t.text,g,u,i)}_computeTitleHeight(){let e=this.options.title,t=we(e.font),i=ke(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,r;if(Ft(e,this.left,this.right)&&Ft(t,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ft(e,s.left,s.left+s.width)&&Ft(t,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){let t=this.options;if(!gM(e.type,t))return;let i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let s=this._hoveredItem,r=pM(s,i);s&&!r&&le(t.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!r&&le(t.onHover,[e,i,this],this)}else i&&le(t.onClick,[e,i,this],this)}};rs={id:"legend",_element:ma,start(n,e,t){let i=n.legend=new ma({ctx:n.ctx,options:t,chart:n});vt.configure(n,i,t),vt.addBox(n,i)},stop(n){vt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){let i=n.legend;vt.configure(n,i,t),i.options=t},afterUpdate(n){let e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){let i=e.datasetIndex,s=t.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:s,color:r}}=n.legend.options;return n._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(t?0:void 0),c=ke(a.borderWidth);return{text:e[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},ya=class extends Ae{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let s=he(i.text)?i.text.length:1;this._padding=ke(i.padding);let r=s*we(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:i,bottom:s,right:r,options:o}=this,a=o.align,c=0,d,u,f;return this.isHorizontal()?(u=He(a,i,r),f=t+e,d=r-i):(o.position==="left"?(u=i+e,f=He(a,s,t),c=ae*-.5):(u=r-e,f=He(a,t,s),c=ae*.5),d=s-t),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let i=we(t.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:c,rotation:d}=this._drawArgs(r);rn(e,t.text,0,0,i,{color:t.color,maxWidth:c,rotation:d,textAlign:Xs(t.align),textBaseline:"middle",translation:[o,a]})}};xa={id:"title",_element:ya,start(n,e,t){mM(n,t)},stop(n){let e=n.titleBlock;vt.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){let i=n.titleBlock;vt.configure(n,i,t),i.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ar={average(n){if(!n.length)return!1;let e,t,i=0,s=0,r=0;for(e=0,t=n.length;e<t;++e){let o=n[e].element;if(o&&o.hasValue()){let a=o.tooltipPosition();i+=a.x,s+=a.y,++r}}return{x:i/r,y:s/r}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){let c=n[r].element;if(c&&c.hasValue()){let d=c.getCenterPoint(),u=Cn(e,d);u<s&&(s=u,a=c)}}if(a){let c=a.tooltipPosition();t=c.x,i=c.y}return{x:t,y:i}}};ur=class extends Ae{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,r=new qi(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=SM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){let{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]),a=[];return a=zt(a,cn(s)),a=zt(a,cn(r)),a=zt(a,cn(o)),a}getBeforeBody(e,t){return Dg(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){let{callbacks:i}=t,s=[];return ce(e,r=>{let o={before:[],lines:[],after:[]},a=Eg(i,r);zt(o.before,cn(a.beforeLabel.call(this,r))),zt(o.lines,a.label.call(this,r)),zt(o.after,cn(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(e,t){return Dg(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){let{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]),a=[];return a=zt(a,cn(s)),a=zt(a,cn(r)),a=zt(a,cn(o)),a}_createItems(e){let t=this._active,i=this.chart.data,s=[],r=[],o=[],a=[],c,d;for(c=0,d=t.length;c<d;++c)a.push(yM(this.chart,t[c]));return e.filter&&(a=a.filter((u,f,y)=>e.filter(u,f,y,i))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,i))),ce(a,u=>{let f=Eg(e.callbacks,u);s.push(f.labelColor.call(this,u)),r.push(f.labelPointStyle.call(this,u)),o.push(f.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,t){let i=this.options.setContext(this.getContext()),s=this._active,r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{let a=ar[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let c=this._size=kg(this,i),d=Object.assign({},a,c),u=Tg(this.chart,i,d),f=Og(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){let r=this.getCaretPosition(e,i,s);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,i){let{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Et(a),{x:y,y:g}=e,{width:p,height:v}=t,x,_,C,S,T,k;return r==="center"?(T=g+v/2,s==="left"?(x=y,_=x-o,S=T+o,k=T-o):(x=y+p,_=x+o,S=T-o,k=T+o),C=x):(s==="left"?_=y+Math.max(c,u)+o:s==="right"?_=y+p-Math.max(d,f)-o:_=this.caretX,r==="top"?(S=g,T=S-o,x=_-o,C=_+o):(S=g+v,T=S+o,x=_+o,C=_-o),k=S),{x1:x,x2:_,x3:C,y1:S,y2:T,y3:k}}drawTitle(e,t,i){let s=this.title,r=s.length,o,a,c;if(r){let d=Dn(i.rtl,this.x,this.width);for(e.x=da(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",o=we(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,c=0;c<r;++c)t.fillText(s[c],d.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,c+1===r&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,s,r){let o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:c,boxWidth:d,boxPadding:u}=r,f=we(r.bodyFont),y=da(this,"left",r),g=s.x(y),p=c<f.lineHeight?(f.lineHeight-c)/2:0,v=t.y+p;if(r.usePointStyle){let x={radius:Math.min(d,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},_=s.leftForLtr(g,d)+d/2,C=v+c/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,oi(e,x,_,C),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,oi(e,x,_,C)}else{e.lineWidth=Q(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;let x=s.leftForLtr(g,d-u),_=s.leftForLtr(s.xPlus(g,1),d-u-2),C=Et(o.borderRadius);Object.values(C).some(S=>S!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,on(e,{x,y:v,w:d,h:c,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),on(e,{x:_,y:v+1,w:d-2,h:c-2,radius:C}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(x,v,d,c),e.strokeRect(x,v,d,c),e.fillStyle=o.backgroundColor,e.fillRect(_,v+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){let{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=we(i.bodyFont),y=f.lineHeight,g=0,p=Dn(i.rtl,this.x,this.width),v=function(M){t.fillText(M,p.x(e.x+g),e.y+y/2),e.y+=y+r},x=p.textAlign(o),_,C,S,T,k,P,D;for(t.textAlign=o,t.textBaseline="middle",t.font=f.string,e.x=da(this,x,i),t.fillStyle=i.bodyColor,ce(this.beforeBody,v),g=a&&x!=="right"?o==="center"?d/2+u:d+2+u:0,T=0,P=s.length;T<P;++T){for(_=s[T],C=this.labelTextColors[T],t.fillStyle=C,ce(_.before,v),S=_.lines,a&&S.length&&(this._drawColorBox(t,e,T,p,i),y=Math.max(f.lineHeight,c)),k=0,D=S.length;k<D;++k)v(S[k]),y=f.lineHeight;ce(_.after,v)}g=0,y=f.lineHeight,ce(this.afterBody,v),e.y-=r}drawFooter(e,t,i){let s=this.footer,r=s.length,o,a;if(r){let c=Dn(i.rtl,this.x,this.width);for(e.x=da(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=c.textAlign(i.footerAlign),t.textBaseline="middle",o=we(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,a=0;a<r;++a)t.fillText(s[a],c.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){let{xAlign:r,yAlign:o}=this,{x:a,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:y,bottomLeft:g,bottomRight:p}=Et(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(a+f,c),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(a+d-y,c),t.quadraticCurveTo(a+d,c,a+d,c+y),o==="center"&&r==="right"&&this.drawCaret(e,t,i,s),t.lineTo(a+d,c+u-p),t.quadraticCurveTo(a+d,c+u,a+d-p,c+u),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(a+g,c+u),t.quadraticCurveTo(a,c+u,a,c+u-g),o==="center"&&r==="left"&&this.drawCaret(e,t,i,s),t.lineTo(a,c+f),t.quadraticCurveTo(a,c,a+f,c),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){let o=ar[e.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=kg(this,e),c=Object.assign({},o,this._size),d=Tg(t,e,c),u=Og(e,c,d,t);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(t);let s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=ke(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,s,t),sa(e,t.textDirection),r.y+=o.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),ra(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let i=this._active,s=e.map(({datasetIndex:a,index:c})=>{let d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[c],index:c}}),r=!$i(i,s),o=this._positionChanged(s,t);(r||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,r=this._active||[],o=this._getActiveElements(e,r,t,i),a=this._positionChanged(o,e),c=t||!$i(o,r)||a;return c&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),c}_getActiveElements(e,t,i,s){let r=this.options;if(e.type==="mouseout")return[];if(!s)return t;let o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,t){let{caretX:i,caretY:s,options:r}=this,o=ar[r.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}};ur.positioners=ar;_a={id:"tooltip",_element:ur,positioners:ar,afterInit(n,e,t){t&&(n.tooltip=new ur({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){let e=n.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){let t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:Dt,title(n){if(n.length>0){let e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Dt,beforeBody:Dt,beforeLabel:Dt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");let t=n.formattedValue;return ie(t)||(e+=t),e},labelColor(n){let t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){let t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},CM=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);TM=(n,e)=>n===null?null:ze(Math.round(n),0,e),fn=class extends un{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let i=this.getLabels();for(let{index:s,label:r}of t)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ie(e))return null;let i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:kM(i,e,J(t,e),this._addedLabels),TM(t,i.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let e=this.min,t=this.max,i=this.options.offset,s=[],r=this.getLabels();r=e===0&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};fn.id="category";fn.defaults={ticks:{callback:fn.prototype.getLabelForValue}};ns=class extends un{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return ie(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:s,max:r}=this,o=c=>s=t?s:c,a=c=>r=i?r:c;if(e){let c=bt(s),d=bt(r);c<0&&d<0?a(0):c>0&&d>0&&o(0)}if(s===r){let c=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(c=Math.abs(r*.05)),a(r+c),e||o(s-c)}this.min=s,this.max=r}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},r=this._range||this,o=OM(s,r);return e.bounds==="ticks"&&Bo(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let e=this.ticks,t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){let s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return ci(e,this.chart.options.locale,this.options.ticks.format)}},Pn=class extends ns{determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Pe(e)?e:0,this.max=Pe(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,i=Me(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}};Pn.id="linear";Pn.defaults={ticks:{callback:wa.formatters.numeric}};ba=class extends un{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let i=ns.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Pe(i)&&i>0?i:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Pe(e)?Math.max(0,e):null,this.max=Pe(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),i=this.min,s=this.max,r=c=>i=e?i:c,o=c=>s=t?s:c,a=(c,d)=>Math.pow(10,Math.floor(tt(c))+d);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},i=DM(t,this);return e.bounds==="ticks"&&Bo(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":ci(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=tt(e),this._valueRange=tt(this.max)-tt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(tt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};ba.id="logarithmic";ba.defaults={ticks:{callback:wa.formatters.logarithmic,major:{enabled:!0}}};is=class extends ns{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ke(Ad(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=Pe(e)&&!isNaN(e)?e:0,this.max=Pe(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ad(this.options))}generateTickLabels(e){ns.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{let s=le(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){let e=this.options;e.display&&e.pointLabels.display?MM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){let t=fe/(this._pointLabels.length||1),i=this.options.startAngle||0;return ot(e*t+Me(i))}getDistanceFromCenterForValue(e){if(ie(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ie(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let i=t[e];return BM(this.getContext(),e,i)}}getPointPosition(e,t,i=0){let s=this.getIndexAngle(e)-Oe+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:i,right:s,bottom:r}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:r}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let i=this.ctx;i.save(),i.beginPath(),Qg(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,r=this._pointLabels.length,o,a,c;if(t.pointLabels.display&&IM(this,r),s.display&&this.ticks.forEach((d,u)=>{if(u!==0){a=this.getDistanceFromCenterForValue(d.value);let f=s.setContext(this.getContext(u-1));FM(this,f,a,r)}}),i.display){for(e.save(),o=r-1;o>=0;o--){let d=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:f}=d;!f||!u||(e.lineWidth=f,e.strokeStyle=u,e.setLineDash(d.borderDash),e.lineDashOffset=d.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;let s=this.getIndexAngle(0),r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!t.reverse)return;let d=i.setContext(this.getContext(c)),u=we(d.font);if(r=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=d.backdropColor;let f=ke(d.backdropPadding);e.fillRect(-o/2-f.left,-r-u.size/2-f.top,o+f.width,u.size+f.height)}rn(e,a.label,0,-r,u,{color:d.color})}),e.restore()}drawTitle(){}};is.id="radialLinear";is.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:wa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};is.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};is.descriptors={angleLines:{_fallback:"grid"}};Sa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},nt=Object.keys(Sa);ss=class extends un{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){let i=e.time||(e.time={}),s=this._adapter=new lE._date(e.adapters.date);s.init(t),ni(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Rg(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,i=e.time.unit||"day",{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function c(d){!o&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!a&&!isNaN(d.max)&&(r=Math.max(r,d.max))}(!o||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Pe(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),r=Pe(r)&&!isNaN(r)?r:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){let e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let r=this.min,o=this.max,a=Gc(s,r,o);return this._unit=t.unit||(i.autoSkip?Ag(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):HM(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:WM(this._unit),this.initOffsets(s),e.reverse&&a.reverse(),Ig(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let t=0,i=0,s,r;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);let o=e.length<3?.5:.25;t=ze(t,0,o),i=ze(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){let e=this._adapter,t=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Ag(r.minUnit,t,i,this._getLabelCapacity(t)),a=J(r.stepSize,1),c=o==="week"?r.isoWeekday:!1,d=Tn(c)||c===!0,u={},f=t,y,g;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":o),e.diff(i,t,o)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+o);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(y=f,g=0;y<i;y=+e.add(y,a,o),g++)Lg(u,y,p);return(y===i||s.bounds==="ticks"||g===1)&&Lg(u,y,p),Object.keys(u).sort((v,x)=>v-x).map(v=>+v)}getLabelForValue(e){let t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){let r=this.options,o=r.time.displayFormats,a=this._unit,c=this._majorUnit,d=a&&o[a],u=c&&o[c],f=i[t],y=c&&u&&f&&f.major,g=this._adapter.format(e,s||(y?u:d)),p=r.ticks.callback;return p?le(p,[g,t,i],this):g}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){let t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,i=this.ctx.measureText(e).width,s=Me(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(e){let t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,r=this._tickFormatFunction(e,0,Ig(this,[e],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,i;if(e.length)return e;let s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(Rg(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return jo(e.sort(zM))}};ss.id="time";ss.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};va=class extends ss{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ua(t,this.min),this._tableRange=ua(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:i}=this,s=[],r=[],o,a,c,d,u;for(o=0,a=e.length;o<a;++o)d=e[o],d>=t&&d<=i&&s.push(d);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],c=s[o-1],d=s[o],Math.round((u+c)/2)!==d&&r.push({time:d,pos:o/(a-1)});return r}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(ua(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return ua(this._table,i*this._tableRange+this._minPos,!0)}};va.id="timeseries";va.defaults=ss.defaults});var em=O(()=>{oa();});var Ld=O(()=>{em()});function Id(n,e){var t=e.x,i=e.y;if(t===null)return{x:0,y:-1};if(i===null)return{x:1,y:0};var s=n.x-t,r=n.y-i,o=Math.sqrt(s*s+r*r);return{x:o?s/o:0,y:o?r/o:-1}}function VM(n,e,t,i,s){switch(s){case"center":t=i=0;break;case"bottom":t=0,i=1;break;case"right":t=1,i=0;break;case"left":t=-1,i=0;break;case"top":t=0,i=-1;break;case"start":t=-t,i=-i;break;case"end":break;default:s*=Math.PI/180,t=Math.cos(s),i=Math.sin(s);break}return{x:n,y:e,vx:t,vy:i}}function Ca(n,e,t){var i=YM;return n<t.left?i|=im:n>t.right&&(i|=sm),e<t.top?i|=om:e>t.bottom&&(i|=rm),i}function UM(n,e){for(var t=n.x0,i=n.y0,s=n.x1,r=n.y1,o=Ca(t,i,e),a=Ca(s,r,e),c,d,u;!(!(o|a)||o&a);)c=o||a,c&om?(d=t+(s-t)*(e.top-i)/(r-i),u=e.top):c&rm?(d=t+(s-t)*(e.bottom-i)/(r-i),u=e.bottom):c&sm?(u=i+(r-i)*(e.right-t)/(s-t),d=e.right):c&im&&(u=i+(r-i)*(e.left-t)/(s-t),d=e.left),c===o?(t=d,i=u,o=Ca(t,i,e)):(s=d,r=u,a=Ca(s,r,e));return{x0:t,x1:s,y0:i,y1:r}}function ka(n,e){var t=e.anchor,i=n,s,r;return e.clamp&&(i=UM(i,e.area)),t==="start"?(s=i.x0,r=i.y0):t==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),VM(s,r,n.vx,n.vy,e.align)}function $M(n){var e=n.borderWidth||0,t=n.padding,i=n.size.height,s=n.size.width,r=-s/2,o=-i/2;return{frame:{x:r-t.left-e,y:o-t.top-e,w:s+t.width+e*2,h:i+t.height+e*2},text:{x:r,y:o,w:s,h:i}}}function GM(n,e){var t=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!t)return null;if(t.xCenter!==void 0&&t.yCenter!==void 0)return{x:t.xCenter,y:t.yCenter};var i=t.getBasePixel();return n.horizontal?{x:i,y:null}:{x:null,y:i}}function KM(n){return n instanceof hn?Ta.arc:n instanceof hi?Ta.point:n instanceof Mt?Ta.bar:Ta.fallback}function qM(n,e,t,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),c=e+a,d=t+a,u=e+i-a,f=t+s-a;n.moveTo(e,d),c<u&&d<f?(n.arc(c,d,a,-Math.PI,-o),n.arc(u,d,a,-o,0),n.arc(u,f,a,0,o),n.arc(c,f,a,o,Math.PI)):c<u?(n.moveTo(c,t),n.arc(u,d,a,-o,o),n.arc(c,d,a,o,Math.PI+o)):d<f?(n.arc(c,d,a,-Math.PI,0),n.arc(c,f,a,0,Math.PI)):n.arc(c,d,a,-Math.PI,Math.PI),n.closePath(),n.moveTo(e,t)}else n.rect(e,t,i,s)}function XM(n,e,t){var i=t.backgroundColor,s=t.borderColor,r=t.borderWidth;!i&&(!s||!r)||(n.beginPath(),qM(n,pn(e.x)+r/2,pn(e.y)+r/2,pn(e.w)-r,pn(e.h)-r,t.borderRadius),n.closePath(),i&&(n.fillStyle=i,n.fill()),s&&r&&(n.strokeStyle=s,n.lineWidth=r,n.lineJoin="miter",n.stroke()))}function ZM(n,e,t){var i=t.lineHeight,s=n.w,r=n.x,o=n.y+i/2;return e==="center"?r+=s/2:(e==="end"||e==="right")&&(r+=s),{h:i,w:s,x:r,y:o}}function JM(n,e,t){var i=n.shadowBlur,s=t.stroked,r=pn(t.x),o=pn(t.y),a=pn(t.w);s&&n.strokeText(e,r,o,a),t.filled&&(i&&s&&(n.shadowBlur=0),n.fillText(e,r,o,a),i&&s&&(n.shadowBlur=i))}function QM(n,e,t,i){var s=i.textAlign,r=i.color,o=!!r,a=i.font,c=e.length,d=i.textStrokeColor,u=i.textStrokeWidth,f=d&&u,y;if(!(!c||!o&&!f))for(t=ZM(t,s,a),n.font=a.string,n.textAlign=s,n.textBaseline="middle",n.shadowBlur=i.textShadowBlur,n.shadowColor=i.textShadowColor,o&&(n.fillStyle=r),f&&(n.lineJoin="round",n.lineWidth=u,n.strokeStyle=d),y=0,c=e.length;y<c;++y)JM(n,e[y],{stroked:f,filled:o,w:t.w,x:t.x,y:t.y+t.h*y})}function fr(n,e,t){var i=Math.cos(t),s=Math.sin(t),r=e.x,o=e.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}function nm(n,e){var t=tP,i=eP,s=e.origin,r,o,a,c,d;for(r=0;r<n.length;++r)o=n[r],a=o.x-s.x,c=o.y-s.y,d=e.vx*a+e.vy*c,t=Math.min(t,d),i=Math.max(i,d);return{min:t,max:i}}function Oa(n,e){var t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);return{vx:(e.x-n.x)/s,vy:(e.y-n.y)/s,origin:n,ln:s}}function cm(n,e,t){var i=e.positioner(n,e),s=i.vx,r=i.vy;if(!s&&!r)return{x:i.x,y:i.y};var o=t.w,a=t.h,c=e.rotation,d=Math.abs(o/2*Math.cos(c))+Math.abs(a/2*Math.sin(c)),u=Math.abs(o/2*Math.sin(c))+Math.abs(a/2*Math.cos(c)),f=1/Math.max(Math.abs(s),Math.abs(r));return d*=s*f,u*=r*f,d+=e.offset*s,u+=e.offset*r,{x:i.x+d,y:i.y+u}}function nP(n,e){var t,i,s,r;for(t=n.length-1;t>=0;--t)for(s=n[t].$layout,i=t-1;i>=0&&s._visible;--i)r=n[i].$layout,r._visible&&s._box.intersects(r._box)&&e(s,r);return n}function iP(n){var e,t,i,s,r,o,a;for(e=0,t=n.length;e<t;++e)i=n[e],s=i.$layout,s._visible&&(a=new Proxy(i._el,{get:(c,d)=>c.getProps([d],!0)[d]}),r=i.geometry(),o=cm(a,i.model(),r),s._box.update(o,r,i.rotation()));return nP(n,function(c,d){var u=c._hidable,f=d._hidable;u&&f||f?d._visible=!1:u&&(c._visible=!1)})}function oP(n,e){var t=n.datalabels,i={},s=[],r,o;return t===!1?null:(t===!0&&(t={}),e=at({},[e,t]),r=e.labels||{},o=Object.keys(r),delete e.labels,o.length?o.forEach(function(a){r[a]&&s.push(at({},[e,r[a],{_key:a}]))}):s.push(e),i=s.reduce(function(a,c){return ce(c.listeners||{},function(d,u){a[u]=a[u]||{},a[u][c._key||dm]=d}),delete c.listeners,a},{}),{labels:s,listeners:i})}function Fd(n,e,t,i){if(!!e){var s=t.$context,r=t.$groups,o;!e[r._set]||(o=e[r._set][r._key],!!o&&le(o,[s,i])===!0&&(n[it]._dirty=!0,t.update(s)))}}function aP(n,e,t,i,s){var r,o;!t&&!i||(t?i?t!==i&&(o=r=!0):o=!0:r=!0,o&&Fd(n,e.leave,t,s),r&&Fd(n,e.enter,i,s))}function lP(n,e){var t=n[it],i=t._listeners,s,r;if(!(!i.enter&&!i.leave)){if(e.type==="mousemove")r=gr.lookup(t._labels,e);else if(e.type!=="mouseout")return;s=t._hovered,t._hovered=r,aP(n,i,s,r,e)}}function cP(n,e){var t=n[it],i=t._listeners.click,s=i&&gr.lookup(t._labels,e);s&&Fd(n,i,s,e)}var tm,pr,YM,im,sm,rm,om,Ta,pn,am,eP,tP,lm,gr,sP,rP,it,dm,Da,Bd=O(()=>{Ld();fi();tm=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var n=window.screen;if(n)return(n.deviceXDPI||1)/(n.logicalXDPI||1)}return 1}(),pr={toTextLines:function(n){var e=[],t;for(n=[].concat(n);n.length;)t=n.pop(),typeof t=="string"?e.unshift.apply(e,t.split(`
`)):Array.isArray(t)?n.push.apply(n,t):ie(n)||e.unshift(""+t);return e},textSize:function(n,e,t){var i=[].concat(e),s=i.length,r=n.font,o=0,a;for(n.font=t.string,a=0;a<s;++a)o=Math.max(n.measureText(i[a]).width,o);return n.font=r,{height:s*t.lineHeight,width:o}},bound:function(n,e,t){return Math.max(n,Math.min(e,t))},arrayDiff:function(n,e){var t=n.slice(),i=[],s,r,o,a;for(s=0,o=e.length;s<o;++s)a=e[s],r=t.indexOf(a),r===-1?i.push([a,1]):t.splice(r,1);for(s=0,o=t.length;s<o;++s)i.push([t[s],-1]);return i},rasterize:function(n){return Math.round(n*tm)/tm}};YM=0,im=1,sm=2,rm=4,om=8;Ta={arc:function(n,e){var t=(n.startAngle+n.endAngle)/2,i=Math.cos(t),s=Math.sin(t),r=n.innerRadius,o=n.outerRadius;return ka({x0:n.x+i*r,y0:n.y+s*r,x1:n.x+i*o,y1:n.y+s*o,vx:i,vy:s},e)},point:function(n,e){var t=Id(n,e.origin),i=t.x*n.options.radius,s=t.y*n.options.radius;return ka({x0:n.x-i,y0:n.y-s,x1:n.x+i,y1:n.y+s,vx:t.x,vy:t.y},e)},bar:function(n,e){var t=Id(n,e.origin),i=n.x,s=n.y,r=0,o=0;return n.horizontal?(i=Math.min(n.x,n.base),r=Math.abs(n.base-n.x)):(s=Math.min(n.y,n.base),o=Math.abs(n.base-n.y)),ka({x0:i,y0:s+o,x1:i+r,y1:s,vx:t.x,vy:t.y},e)},fallback:function(n,e){var t=Id(n,e.origin);return ka({x0:n.x,y0:n.y,x1:n.x+(n.width||0),y1:n.y+(n.height||0),vx:t.x,vy:t.y},e)}},pn=pr.rasterize;am=function(n,e,t,i){var s=this;s._config=n,s._index=i,s._model=null,s._rects=null,s._ctx=e,s._el=t};at(am.prototype,{_modelize:function(n,e,t,i){var s=this,r=s._index,o=we(ye([t.font,{}],i,r)),a=ye([t.color,ee.color],i,r);return{align:ye([t.align,"center"],i,r),anchor:ye([t.anchor,"center"],i,r),area:i.chart.chartArea,backgroundColor:ye([t.backgroundColor,null],i,r),borderColor:ye([t.borderColor,null],i,r),borderRadius:ye([t.borderRadius,0],i,r),borderWidth:ye([t.borderWidth,0],i,r),clamp:ye([t.clamp,!1],i,r),clip:ye([t.clip,!1],i,r),color:a,display:n,font:o,lines:e,offset:ye([t.offset,4],i,r),opacity:ye([t.opacity,1],i,r),origin:GM(s._el,i),padding:ke(ye([t.padding,4],i,r)),positioner:KM(s._el),rotation:ye([t.rotation,0],i,r)*(Math.PI/180),size:pr.textSize(s._ctx,e,o),textAlign:ye([t.textAlign,"start"],i,r),textShadowBlur:ye([t.textShadowBlur,0],i,r),textShadowColor:ye([t.textShadowColor,a],i,r),textStrokeColor:ye([t.textStrokeColor,a],i,r),textStrokeWidth:ye([t.textStrokeWidth,0],i,r)}},update:function(n){var e=this,t=null,i=null,s=e._index,r=e._config,o,a,c,d=ye([r.display,!0],n,s);d&&(o=n.dataset.data[s],a=J(le(r.formatter,[o,n]),o),c=ie(a)?[]:pr.toTextLines(a),c.length&&(t=e._modelize(d,c,r,n),i=$M(t))),e._model=t,e._rects=i},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(n,e){var t=this,i=n.ctx,s=t._model,r=t._rects,o;!this.visible()||(i.save(),s.clip&&(o=s.area,i.beginPath(),i.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),i.clip()),i.globalAlpha=pr.bound(0,s.opacity,1),i.translate(pn(e.x),pn(e.y)),i.rotate(s.rotation),XM(i,r.frame,s),QM(i,s.lines,r.text,s),i.restore())}});eP=Number.MIN_SAFE_INTEGER||-9007199254740991,tP=Number.MAX_SAFE_INTEGER||9007199254740991;lm=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};at(lm.prototype,{center:function(){var n=this._rect;return{x:n.x+n.w/2,y:n.y+n.h/2}},update:function(n,e,t){this._rotation=t,this._rect={x:e.x+n.x,y:e.y+n.y,w:e.w,h:e.h}},contains:function(n){var e=this,t=1,i=e._rect;return n=fr(n,e.center(),-e._rotation),!(n.x<i.x-t||n.y<i.y-t||n.x>i.x+i.w+t*2||n.y>i.y+i.h+t*2)},intersects:function(n){var e=this._points(),t=n._points(),i=[Oa(e[0],e[1]),Oa(e[0],e[3])],s,r,o;for(this._rotation!==n._rotation&&i.push(Oa(t[0],t[1]),Oa(t[0],t[3])),s=0;s<i.length;++s)if(r=nm(e,i[s]),o=nm(t,i[s]),r.max<o.min||o.max<r.min)return!1;return!0},_points:function(){var n=this,e=n._rect,t=n._rotation,i=n.center();return[fr({x:e.x,y:e.y},i,t),fr({x:e.x+e.w,y:e.y},i,t),fr({x:e.x+e.w,y:e.y+e.h},i,t),fr({x:e.x,y:e.y+e.h},i,t)]}});gr={prepare:function(n){var e=[],t,i,s,r,o;for(t=0,s=n.length;t<s;++t)for(i=0,r=n[t].length;i<r;++i)o=n[t][i],e.push(o),o.$layout={_box:new lm,_hidable:!1,_visible:!0,_set:t,_idx:o._index};return e.sort(function(a,c){var d=a.$layout,u=c.$layout;return d._idx===u._idx?u._set-d._set:u._idx-d._idx}),this.update(e),e},update:function(n){var e=!1,t,i,s,r,o;for(t=0,i=n.length;t<i;++t)s=n[t],r=s.model(),o=s.$layout,o._hidable=r&&r.display==="auto",o._visible=s.visible(),e|=o._hidable;e&&iP(n)},lookup:function(n,e){var t,i;for(t=n.length-1;t>=0;--t)if(i=n[t].$layout,i&&i._visible&&i._box.contains(e))return n[t];return null},draw:function(n,e){var t,i,s,r,o,a;for(t=0,i=e.length;t<i;++t)s=e[t],r=s.$layout,r._visible&&(o=s.geometry(),a=cm(s._el,s.model(),o),r._box.update(a,o,s.rotation()),s.draw(n,a))}},sP=function(n){if(ie(n))return null;var e=n,t,i,s;if(Q(n))if(!ie(n.label))e=n.label;else if(!ie(n.r))e=n.r;else for(e="",t=Object.keys(n),s=0,i=t.length;s<i;++s)e+=(s!==0?", ":"")+t[s]+": "+n[t[s]];return""+e},rP={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:sP,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},it="$datalabels",dm="$default";Da={id:"datalabels",defaults:rP,beforeInit:function(n){n[it]={_actives:[]}},beforeUpdate:function(n){var e=n[it];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(n,e,t){var i=e.index,s=n[it],r=s._datasets[i]=[],o=n.isDatasetVisible(i),a=n.data.datasets[i],c=oP(a,t),d=e.meta.data||[],u=n.ctx,f,y,g,p,v,x,_,C;for(u.save(),f=0,g=d.length;f<g;++f)if(_=d[f],_[it]=[],o&&_&&n.getDataVisibility(f)&&!_.skip)for(y=0,p=c.labels.length;y<p;++y)v=c.labels[y],x=v._key,C=new am(v,u,_,f),C.$groups={_set:i,_key:x||dm},C.$context={active:!1,chart:n,dataIndex:f,dataset:a,datasetIndex:i},C.update(C.$context),_[it].push(C),r.push(C);u.restore(),at(s._listeners,c.listeners,{merger:function(S,T,k){T[S]=T[S]||{},T[S][e.index]=k[S],s._listened=!0}})},afterUpdate:function(n){n[it]._labels=gr.prepare(n[it]._datasets)},afterDatasetsDraw:function(n){gr.draw(n,n[it]._labels)},beforeEvent:function(n,e){if(n[it]._listened){var t=e.event;switch(t.type){case"mousemove":case"mouseout":lP(n,t);break;case"click":cP(n,t);break}}},afterEvent:function(n){var e=n[it],t=e._actives,i=e._actives=n.getActiveElements(),s=pr.arrayDiff(t,i),r,o,a,c,d,u,f;for(r=0,o=s.length;r<o;++r)if(d=s[r],d[1])for(f=d[0].element[it]||[],a=0,c=f.length;a<c;++a)u=f[a],u.$context.active=d[1]===1,u.update(u.$context);(e._dirty||s.length)&&(gr.update(e._labels),n.render()),delete e._dirty}}});var xe=Re((LF,um)=>{um.exports=window.React});function hm(n,e){typeof n=="function"?n(e):n&&(n.current=e)}function dP(n,e){Object.assign(n.options,e)}function pm(n,e){n.labels=e}function gm(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fm,i=[];n.datasets=e.map(s=>{let r=n.datasets.find(o=>o[t]===s[t]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function uP(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fm,t={labels:[],datasets:[]};return pm(t,n.labels),gm(t,n.datasets,e),t}function hP(n,e){let{height:t=150,width:i=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:c,plugins:d=[],fallbackContent:u,updateMode:f,...y}=n,g=(0,Ke.useRef)(null),p=(0,Ke.useRef)(),v=()=>{!g.current||(p.current=new Ye(g.current,{type:o,data:uP(a,r),options:c&&{...c},plugins:d}),hm(e,p.current))},x=()=>{hm(e,null),p.current&&(p.current.destroy(),p.current=null)};return(0,Ke.useEffect)(()=>{!s&&p.current&&c&&dP(p.current,c)},[s,c]),(0,Ke.useEffect)(()=>{!s&&p.current&&pm(p.current.config.data,a.labels)},[s,a.labels]),(0,Ke.useEffect)(()=>{!s&&p.current&&a.datasets&&gm(p.current.config.data,a.datasets,r)},[s,a.datasets]),(0,Ke.useEffect)(()=>{!p.current||(s?(x(),setTimeout(v)):p.current.update(f))},[s,c,a.labels,a.datasets,f]),(0,Ke.useEffect)(()=>{!p.current||(x(),setTimeout(v))},[o]),(0,Ke.useEffect)(()=>(v(),()=>x()),[]),Ke.default.createElement("canvas",Object.assign({ref:g,role:"img",height:t,width:i},y),u)}function mm(n,e){return Ye.register(e),(0,Ke.forwardRef)((t,i)=>Ke.default.createElement(fP,Object.assign({},t,{ref:i,type:n})))}var Ke,fm,fP,Ea,zd,Ma=O(()=>{Ke=oe(xe());fi();fm="label";fP=(0,Ke.forwardRef)(hP);Ea=mm("bar",ui),zd=mm("doughnut",dn)});var pP,gP,ym,bm,Hd=O(()=>{fi();Bd();Ma();({Empty:pP}=window.antd),{memo:gP}=window.React,ym=wp.data.select("getgenie").sidebar();Ye.register(fn,Pn,Mt,xa,_a,rs,Da);bm=gP(({data:n})=>{let e={responsive:!1,layout:{padding:{top:25,right:0,left:0,bottom:0}},plugins:{datalabels:{display:!0,color:"#7999D0",align:"end",rotation:270,anchor:"end",font:{size:"10"},formatter:function(s){if(s<1e3)return s;if(s>=1e3&&s<1e6)return+(s/1e3).toFixed(1)+"K";if(s>=1e6&&s<1e9)return+(s/1e6).toFixed(1)+"M";if(s>=1e9&&s<1e12)return+(s/1e9).toFixed(1)+"B";if(s>=1e12)return+(s/1e12).toFixed(1)+"T"}},legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{autoSkip:!0,maxRotation:0,minRotation:0}},y:{grid:{borderWidth:0},ticks:{callback:function(s){if(s<1e3)return s;if(s>=1e3&&s<1e6)return+(s/1e3).toFixed(1)+"K";if(s>=1e6&&s<1e9)return+(s/1e6).toFixed(1)+"M";if(s>=1e9&&s<1e12)return+(s/1e9).toFixed(1)+"B";if(s>=1e12)return+(s/1e12).toFixed(1)+"T"}}}}},i={labels:n.map(s=>s?.date),datasets:[{label:ym.__("Volume","getgenie"),data:n.map(s=>s?.volume),backgroundColor:"#DBE7FD"}]};return n.length===0?React.createElement(pP,{description:ym.__("No Search Volume Trend data found","getgenie"),className:"getgenie-chart empty"}):React.createElement(Ea,{className:"getgenie-chart",width:"298",height:"300",options:e,data:i})})});var mP,yP,bP,jF,vP,vm,wm=O(()=>{mp();Hd();({Typography:mP}=window.antd),{Libs:yP}=window.getGenie.Components.Common,{useState:bP,useEffect:jF}=window.React,{ComposeComponents:vP}=window.getGenie.Components.Common.ReduxManager,vm=vP(({setInput:n,getInputs:e,sidebar:t})=>{let[i,s]=bP("searchVolTrend"),r=[{label:t.__("Search Vol. Trend","getgenie"),key:"searchVolTrend",children:React.createElement(bm,{data:e.searchVolume?.chart?.searchVolTrend||[]})},{label:t.__("Google Trends","getgenie"),key:"googleTrend",children:React.createElement(gp,{data:e.searchVolume?.keyword||""})}];return React.createElement("div",{className:"getgenie-seo-result-chart-container"},React.createElement(mP.Title,{level:5,className:"getgenie-title"},t.__("Overview Chart","getgenie")),React.createElement(yP.Navbar,{tabPaneList:r,activeKey:i,handleActiveKey:s,destroyInactiveTabPane:!1,className:"keyword-analysis-chart"}))},["setInput","getInputs","sidebar"])});var $F,Wd=O(()=>{({Libs:$F}=window.getGenie.Components.Common)});var jd,wP,xP,_P,SP,Pa,CP,KF,kP,TP,xm,_m=O(()=>{Zt();Wd();({Libs:jd,Utilities:wP}=window.getGenie.Components.Common),{HandleFetch:xP,HandleResponse:_P}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:SP}=window.getGenie.Components.Common.ReduxManager,{Typography:Pa,Tooltip:CP,notification:KF}=window.antd,{useEffect:kP}=window.React,TP=new Ee,xm=SP(({getInputs:n,setInput:e,sidebar:t,setSidebar:i,limitUsage:s})=>{let r=n.relatedKeywords||[],o=n.customKeywords||[],a=Object.keys(t.statisticsData?.keywords||{});kP(()=>{if(t.analyzingSearchVolume){let g=(n.keyword||"").replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g,"").toLowerCase();c(g,n.inputContext)}},[t.analyzingSearchVolume]);let c=(g,p)=>{let v={input:{keyword:g,context:p},location:n.seoCountry,templateSlug:"keyword-analysis"};xP(x=>{_P(x,()=>{let _=x?.data||[];e("relatedKeywords",_);let C=_.find(S=>(S?.keyword||"").trim()===g.trim());if(C){let S={...C,keyword:n.keyword||"",country:n.seoCountry||"usa"};e("searchVolume",S),wP.GenieHelpers.callStoreApi("keywordData",{searchVolume:S,relatedKeywords:_})}}),i({analyzingSearchVolume:!1})},"keywordsData",v)},d=(g,p)=>{let v=o;if(p)v=o.filter(x=>x.keyword!==g);else{let x=TP.findSingleMatch(t.currentPostContent,g);v=[...o,{keyword:g,usage:x}]}e("customKeywords",v)},u=g=>!!o?.find(p=>p?.keyword===g),f=g=>!a.find(p=>p===g)&&n.competitorData,y=g=>{let p=g?.searchVolume||{},{cpc:v,total:x="-"}=p,{currency:_="$",value:C=0}=v||{};return React.createElement("div",{className:"getgenie-data-column"},React.createElement(Pa.Title,{className:"getgenie-data-value"},"CPC: ",_,parseFloat(C).toFixed(3)),React.createElement(Pa.Title,{className:"getgenie-data-value"},"Search: ",x))};return React.createElement("div",{className:"getgenie-seo-result-related-keyword",style:{paddingBottom:n.peopleAlsoSearched?0:"150px"}},React.createElement(Pa.Title,{level:5,className:"getgenie-title"},t.__("Related Keyword","getgenie")),t.analyzingSearchVolume?React.createElement("div",{style:{padding:"8px"}},React.createElement(jd.SkeletonSingle,{count:10})):React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-related-keywords"},r.length),r.length===0?React.createElement(Pa.Title,{level:5,className:"getgenie-not-found-title"},t.__("No related keyword found","getgenie")):React.createElement(jd.BlurElement,{show:s.subscription_type!=="pro",top:360,text:"Go Pro, Reveal Untapped Keywords!",btnText:"Upgrade for Success",href:"https://getgenie.ai/pricing/"},React.createElement(jd.Card,{list:r,column:1},(g,p)=>{let v=u(g?.keyword),x=v?"getgenie-icon-minus remove":"getgenie-icon-plus add",_=f(g?.keyword);return React.createElement("div",{className:"getgenie-data-container"},_?React.createElement(CP,{title:t.__("Add/remove this keyword for SEO analysis","getgenie"),placement:"topLeft"},React.createElement("span",{className:`getgenie-related-keyword-card-button ${x}`,onClick:()=>d(g?.keyword,v)})):"",React.createElement("h5",{className:"getgenie-data-title"},g?.keyword),y(g))}))))},["getInputs","sidebar","setInput","setSidebar","limitUsage"])});var OP,DP,EP,MP,PP,Sm,Cm=O(()=>{Zt();({Libs:OP}=window.getGenie.Components.Common),{ComposeComponents:DP}=window.getGenie.Components.Common.ReduxManager,{Typography:EP,Tooltip:MP}=window.antd,PP=new Ee,Sm=DP(({getInputs:n,sidebar:e,setInput:t})=>{let i=n.customKeywords||[],s=Object.keys(e.statisticsData?.keywords||{}),r=n.peopleAlsoSearched;if(!r)return"";r=r.map(u=>({...u,keyword:u?.title}));let o=r.findIndex(u=>u?.title&&u?.title.toLowerCase()==="see more");o!==-1&&(r=r.slice(o+1,r.length));let a=(u,f)=>{if(!u)return;let y=i;if(f)y=i.filter(g=>g.keyword!==u);else{let g=PP.findSingleMatch(e.currentPostContent,u);y=[...i,{keyword:u,usage:g}]}t("customKeywords",y)},c=u=>!!i?.find(f=>f?.keyword===u),d=u=>!s.find(f=>f===u)&&n.competitorData;return React.createElement("div",{className:"getgenie-seo-result-related-keyword getgenie-seo-result-people-also-searched-keyword"},React.createElement(EP.Title,{level:5,className:"getgenie-title"},e.__("People also searched for","getgenie")),React.createElement("span",{className:"getgenie-related-keywords"},r.length),React.createElement(OP.Card,{list:r,column:1},u=>{let f=c(u?.keyword),y=f?"getgenie-icon-minus remove":"getgenie-icon-plus add",g=d(u?.keyword);return React.createElement("div",{className:"getgenie-data-container"},g?React.createElement(MP,{title:e.__("Add/remove this keyword for SEO analysis","getgenie"),placement:"topLeft"},React.createElement("span",{className:`getgenie-related-keyword-card-button ${y}`,onClick:()=>a(u?.keyword,f)})):"",React.createElement("h5",{className:"getgenie-data-title"},typeof u=="string"?u:u?.title))}))},["getInputs","sidebar","setSidebar","setInput"])});var NP,RP,AP,LP,km,Tm=O(()=>{fp();wm();_m();Wd();Cm();Zt();({ComposeComponents:NP}=window.getGenie.Components.Common.ReduxManager),{Libs:RP}=window.getGenie.Components.Common,{useEffect:AP}=window.React,LP=new Ee,km=NP(({sidebar:n,setInput:e,getInputs:t})=>{let i=t.customKeywords||[];return AP(()=>{let s=i.map(r=>{let o=LP.findSingleMatch(n.currentPostContent,r?.keyword);return{...r,usage:o}});e("customKeywords",s)},[n.currentPostContent]),React.createElement(React.Fragment,null,n.analyzingSearchVolume?React.createElement(RP.SkeletonCard,{count:2}):React.createElement("div",{style:{backgroundColor:"#fff",paddingBottom:"10px"}}," ",React.createElement(hp,null),React.createElement(vm,null)),React.createElement(xm,null),React.createElement(Sm,null))},["sidebar","getInputs","setInput"])});var IP,FP,Vd,BP,zP,HP,WP,jP,Om,Dm,Em=O(()=>{({Checkbox:IP,Typography:FP,Tooltip:Vd,Button:BP}=window.antd),{Utilities:zP,Libs:HP}=window.getGenie.Components.Common,{GenieHelpers:WP}=zP,{ComposeComponents:jP}=window.getGenie.Components.Common.ReduxManager,{useState:Om}=window.React,Dm=jP(({loading:n,loadingText:e,setInput:t,fetchData:i,getInputs:s,sidebar:r})=>{let o=s.questionsAsked,a=s.selectedOutlines||[],[c,d]=Om(""),[u,f]=Om(""),y=(v,x)=>{if(r.currentScreen!=="outlineScreen")return;let _=[...a];_.indexOf(x)!=-1?_.splice(_.indexOf(x),1):_.push(x),t("selectedOutlines",_)},g=(v,x)=>{if(v.stopPropagation(),u!==x){if(window.getGenie.config.isBlockEditor){let _=wp.data.select("core/block-editor"),C=_.getBlocks(),S=_.getSelectedBlockClientId(),T=C.findIndex(k=>k.clientId===S);wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:x}),T+1),f(x)}if(document.getElementById("post-body-content")){let _=document.getElementById("content_ifr"),C=_.contentDocument||_.contentWindow.document,S=C.getSelection().focusNode?.parentElement,T=C.createElement("h2");T.textContent=x,S.parentNode.insertBefore(T,S.nextSibling),f(x)}if(document.querySelector("#web-view-editor .ql-editor")){let _=document.querySelector("#web-view-editor .ql-editor"),C=document.createElement("h2");C.textContent=x,_.appendChild(C),f(x)}}},p=(v,x)=>{v.stopPropagation();let _=x.replace(/<br\s*\/?>/gi,`
`);WP.copyToClipboard(_).then(()=>{d(x)}).catch(()=>console.log("error"))};return React.createElement(React.Fragment,null,n?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,e),React.createElement(HP.Loading,{size:25})," "):o?"":React.createElement(BP,{className:"getgenie-fetch-competitor-btn",onClick:i},r.__("Fetch Data","getgenie")),React.createElement("div",{className:"getgenie-questions-tab"},React.createElement("div",{className:`getgenie-checkbox ${r.currentScreen==="outlineScreen"?"":"disable"}`},o?o?.length===0?React.createElement(FP.Title,{level:5,className:"getgenie-not-found-title"},r.__("No questions are found.","getgenie")):o?.map((v,x)=>{let _=(v?.title||"").replace(/[0-9]/g,"");return React.createElement("div",{key:x,className:`getgenie-checkbox-container${a.indexOf(_)!=-1?" active":""}`},React.createElement("div",{className:"actions"},React.createElement("div",{className:"copy"},React.createElement(Vd,{placement:"bottom",zIndex:9999,title:c===_?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:C=>p(C,_)}))),React.createElement("div",{className:"insert"},React.createElement(Vd,{title:u!==_?"Insert into the editor":"Already inserted",placement:"bottom",zIndex:9999},React.createElement("span",{className:`insert-icon ${u===_?"getgenie-icon-check":"getgenie-icon-insert"}`,onClick:C=>g(C,_)}))),React.createElement("div",{className:"link"},React.createElement(Vd,{title:"Go to the link",placement:"bottom",zIndex:9999},React.createElement("a",{target:"_blank",href:v?.url},React.createElement("span",{className:"link-icon getgenie-icon-link"}))))),React.createElement(IP,{checked:a.indexOf(v.title)>-1,onChange:C=>y(C,v.title)},React.createElement("h4",{className:"question-title"},_)))}):"")))},["setInput","getInputs","sidebar"])});var Pt,mr,Mm,Yd=O(()=>{Pt=Object.create(null);Pt.open="0";Pt.close="1";Pt.ping="2";Pt.pong="3";Pt.message="4";Pt.upgrade="5";Pt.noop="6";mr=Object.create(null);Object.keys(Pt).forEach(n=>{mr[Pt[n]]=n});Mm={type:"error",data:"parser error"}});var VP,YP,UP,$P,Pm,Na,Nm=O(()=>{Yd();VP=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",YP=typeof ArrayBuffer=="function",UP=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,$P=({type:n,data:e},t,i)=>VP&&e instanceof Blob?t?i(e):Pm(e,i):YP&&(e instanceof ArrayBuffer||UP(e))?t?i(e):Pm(new Blob([e]),i):i(Pt[n]+(e||"")),Pm=(n,e)=>{let t=new FileReader;return t.onload=function(){let i=t.result.split(",")[1];e("b"+i)},t.readAsDataURL(n)},Na=$P});var Rm,yr,Am,Lm=O(()=>{Rm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<Rm.length;n++)yr[Rm.charCodeAt(n)]=n;Am=n=>{let e=n.length*.75,t=n.length,i,s=0,r,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);let d=new ArrayBuffer(e),u=new Uint8Array(d);for(i=0;i<t;i+=4)r=yr[n.charCodeAt(i)],o=yr[n.charCodeAt(i+1)],a=yr[n.charCodeAt(i+2)],c=yr[n.charCodeAt(i+3)],u[s++]=r<<2|o>>4,u[s++]=(o&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return d}});var GP,KP,qP,Im,Ra,Fm=O(()=>{Yd();Lm();GP=typeof ArrayBuffer=="function",KP=(n,e)=>{if(typeof n!="string")return{type:"message",data:Im(n,e)};let t=n.charAt(0);return t==="b"?{type:"message",data:qP(n.substring(1),e)}:mr[t]?n.length>1?{type:mr[t],data:n.substring(1)}:{type:mr[t]}:Mm},qP=(n,e)=>{if(GP){let t=Am(n);return Im(t,e)}else return{base64:!0,data:n}},Im=(n,e)=>{switch(e){case"blob":return n instanceof ArrayBuffer?new Blob([n]):n;case"arraybuffer":default:return n}},Ra=KP});var Bm,zm,Hm,Ud,br=O(()=>{Nm();Fm();Bm=String.fromCharCode(30),zm=(n,e)=>{let t=n.length,i=new Array(t),s=0;n.forEach((r,o)=>{Na(r,!1,a=>{i[o]=a,++s===t&&e(i.join(Bm))})})},Hm=(n,e)=>{let t=n.split(Bm),i=[];for(let s=0;s<t.length;s++){let r=Ra(t[s],e);if(i.push(r),r.type==="error")break}return i},Ud=4});function _e(n){if(n)return XP(n)}function XP(n){for(var e in _e.prototype)n[e]=_e.prototype[e];return n}var pi=O(()=>{_e.prototype.on=_e.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};_e.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};_e.prototype.off=_e.prototype.removeListener=_e.prototype.removeAllListeners=_e.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};_e.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};_e.prototype.emitReserved=_e.prototype.emit;_e.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};_e.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var wt,vr=O(()=>{wt=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())()});function Aa(n,...e){return e.reduce((t,i)=>(n.hasOwnProperty(i)&&(t[i]=n[i]),t),{})}function gn(n,e){e.useNativeTimers?(n.setTimeoutFn=ZP.bind(wt),n.clearTimeoutFn=JP.bind(wt)):(n.setTimeoutFn=setTimeout.bind(wt),n.clearTimeoutFn=clearTimeout.bind(wt))}function Wm(n){return typeof n=="string"?e2(n):Math.ceil((n.byteLength||n.size)*QP)}function e2(n){let e=0,t=0;for(let i=0,s=n.length;i<s;i++)e=n.charCodeAt(i),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(i++,t+=4);return t}var ZP,JP,QP,os=O(()=>{vr();ZP=setTimeout,JP=clearTimeout;QP=1.33});var $d,gi,La=O(()=>{br();pi();os();$d=class extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}},gi=class extends _e{constructor(e){super(),this.writable=!1,gn(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,i){return super.emitReserved("error",new $d(e,t,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=Ra(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}});function Ym(n){let e="";do e=Um[n%Gd]+e,n=Math.floor(n/Gd);while(n>0);return e}function Fa(){let n=Ym(+new Date);return n!==Vm?(jm=0,Vm=n):n+"."+Ym(jm++)}var Um,Gd,t2,jm,Ia,Vm,Kd=O(()=>{"use strict";Um="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Gd=64,t2={},jm=0,Ia=0;for(;Ia<Gd;Ia++)t2[Um[Ia]]=Ia});function Ba(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function $m(n){let e={},t=n.split("&");for(let i=0,s=t.length;i<s;i++){let r=t[i].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}var za=O(()=>{});var Gm,Km,qm=O(()=>{Gm=!1;try{Gm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Km=Gm});function qd(n){let e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Km))return new XMLHttpRequest}catch{}if(!e)try{return new wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Xm=O(()=>{qm();vr()});function n2(){}function Zm(){for(let n in xt.requests)xt.requests.hasOwnProperty(n)&&xt.requests[n].abort()}var i2,Ha,xt,Jm=O(()=>{La();Kd();za();br();Xm();pi();os();vr();i2=function(){return new qd({xdomain:!1}).responseType!=null}(),Ha=class extends gi{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){let i=location.protocol==="https:",s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port,this.xs=e.secure!==i}let t=e&&e.forceBase64;this.supportsBinary=i2&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Hm(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,zm(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{},t=this.opts.secure?"https":"http",i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Fa()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);let s=Ba(e),r=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(s.length?"?"+s:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new xt(this.uri(),e)}doWrite(e,t){let i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(s,r)=>{this.onError("xhr post error",s,r)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}},xt=class extends _e{constructor(e,t){super(),gn(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){let e=Aa(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let t=this.xhr=new qd(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=xt.requestsCount++,xt.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=n2,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete xt.requests[this.index],this.xhr=null}}onLoad(){let e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};xt.requestsCount=0;xt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Zm);else if(typeof addEventListener=="function"){let n="onpagehide"in wt?"pagehide":"unload";addEventListener(n,Zm,!1)}}});var Qm,wr,Wa,ey,ty=O(()=>{vr();Qm=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),wr=wt.WebSocket||wt.MozWebSocket,Wa=!0,ey="arraybuffer"});var ny,ja,iy=O(()=>{La();za();Kd();os();ty();br();ny=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ja=class extends gi{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let e=this.uri(),t=this.opts.protocols,i=ny?{}:Aa(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=Wa&&!ny?t?new wr(e,t):new wr(e):new wr(e,t,i)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType||ey,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let i=e[t],s=t===e.length-1;Na(i,this.supportsBinary,r=>{let o={};Wa||(i.options&&(o.compress=i.options.compress),this.opts.perMessageDeflate&&(typeof r=="string"?Buffer.byteLength(r):r.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Wa?this.ws.send(r):this.ws.send(r,o)}catch{}s&&Qm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{},t=this.opts.secure?"wss":"ws",i="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Fa()),this.supportsBinary||(e.b64=1);let s=Ba(e),r=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(s.length?"?"+s:"")}check(){return!!wr}}});var Xd,Zd=O(()=>{Jm();iy();Xd={websocket:ja,polling:Ha}});function as(n){let e=n,t=n.indexOf("["),i=n.indexOf("]");t!=-1&&i!=-1&&(n=n.substring(0,t)+n.substring(t,i).replace(/:/g,";")+n.substring(i,n.length));let s=s2.exec(n||""),r={},o=14;for(;o--;)r[r2[o]]=s[o]||"";return t!=-1&&i!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=o2(r,r.path),r.queryKey=a2(r,r.query),r}function o2(n,e){let t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&i.splice(0,1),e.substr(e.length-1,1)=="/"&&i.splice(i.length-1,1),i}function a2(n,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,s,r){s&&(t[s]=r)}),t}var s2,r2,Jd=O(()=>{s2=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r2=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]});var ct,sy=O(()=>{Zd();os();za();Jd();pi();br();ct=class extends _e{constructor(e,t={}){super(),e&&typeof e=="object"&&(t=e,e=null),e?(e=as(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=as(t.host).host),gn(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=$m(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=Ud,t.transport=e,this.id&&(t.sid=this.id);let i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Xd[e](i)}open(){let e;if(this.opts.rememberUpgrade&&ct.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),i=!1;ct.priorWebsocketSuccess=!1;let s=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!i)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ct.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let y=new Error("probe error");y.transport=t.name,this.emitReserved("upgradeError",y)}}))};function r(){i||(i=!0,u(),t.close(),t=null)}let o=f=>{let y=new Error("probe error: "+f);y.transport=t.name,r(),this.emitReserved("upgradeError",y)};function a(){o("transport closed")}function c(){o("socket closed")}function d(f){t&&f.name!==t.name&&r()}let u=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",s),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),t.open()}onOpen(){if(this.readyState="open",ct.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0,t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i<this.writeBuffer.length;i++){let s=this.writeBuffer[i].data;if(s&&(t+=Wm(s)),i>0&&t>this.maxPayload)return this.writeBuffer.slice(0,i);t+=2}return this.writeBuffer}write(e,t,i){return this.sendPacket("message",e,t,i),this}send(e,t,i){return this.sendPacket("message",e,t,i),this}sendPacket(e,t,i,s){if(typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let r={type:e,data:t,options:i};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),s&&this.once("flush",s),this.flush()}close(){let e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){ct.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],i=0,s=e.length;for(;i<s;i++)~this.transports.indexOf(e[i])&&t.push(e[i]);return t}};ct.protocol=Ud});var d6,Qd=O(()=>{sy();La();Zd();os();Jd();d6=ct.protocol});function ry(n,e="",t){let i=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),i=as(n)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let r=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+r+":"+i.port+e,i.href=i.protocol+"://"+r+(t&&t.port===i.port?"":":"+i.port),i}var oy=O(()=>{Qd()});function _r(n){return l2&&(n instanceof ArrayBuffer||c2(n))||d2&&n instanceof Blob||u2&&n instanceof File}function xr(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;t++)if(xr(n[t]))return!0;return!1}if(_r(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return xr(n.toJSON(),!0);for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&xr(n[t]))return!0;return!1}var l2,c2,ay,d2,u2,eu=O(()=>{l2=typeof ArrayBuffer=="function",c2=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,ay=Object.prototype.toString,d2=typeof Blob=="function"||typeof Blob<"u"&&ay.call(Blob)==="[object BlobConstructor]",u2=typeof File=="function"||typeof File<"u"&&ay.call(File)==="[object FileConstructor]"});function ly(n){let e=[],t=n.data,i=n;return i.data=tu(t,e),i.attachments=e.length,{packet:i,buffers:e}}function tu(n,e){if(!n)return n;if(_r(n)){let t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){let t=new Array(n.length);for(let i=0;i<n.length;i++)t[i]=tu(n[i],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){let t={};for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=tu(n[i],e));return t}return n}function cy(n,e){return n.data=nu(n.data,e),n.attachments=void 0,n}function nu(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=nu(n[t],e);else if(typeof n=="object")for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=nu(n[t],e));return n}var dy=O(()=>{eu()});var ru={};xo(ru,{Decoder:()=>Sr,Encoder:()=>iu,PacketType:()=>se,protocol:()=>uy});var uy,se,iu,Sr,su,Va=O(()=>{pi();dy();eu();uy=5;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(se||(se={}));iu=class{constructor(e){this.replacer=e}encode(e){return(e.type===se.EVENT||e.type===se.ACK)&&xr(e)?(e.type=e.type===se.EVENT?se.BINARY_EVENT:se.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===se.BINARY_EVENT||e.type===se.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=ly(e),i=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(i),s}},Sr=class extends _e{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e),t.type===se.BINARY_EVENT||t.type===se.BINARY_ACK?(this.reconstructor=new su(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(_r(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,i={type:Number(e.charAt(0))};if(se[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===se.BINARY_EVENT||i.type===se.BINARY_ACK){let r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");i.attachments=Number(o)}if(e.charAt(t+1)==="/"){let r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););i.nsp=e.substring(r,t)}else i.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let r=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}i.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(Sr.isPayloadValid(i.type,r))i.data=r;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case se.CONNECT:return typeof t=="object";case se.DISCONNECT:return t===void 0;case se.CONNECT_ERROR:return typeof t=="string"||typeof t=="object";case se.EVENT:case se.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case se.ACK:case se.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}},su=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=cy(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});function dt(n,e,t){return n.on(e,t),function(){n.off(e,t)}}var ou=O(()=>{});var h2,ls,au=O(()=>{Va();ou();pi();h2=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ls=class extends _e{constructor(e,t,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[dt(e,"open",this.onopen.bind(this)),dt(e,"packet",this.onpacket.bind(this)),dt(e,"error",this.onerror.bind(this)),dt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(h2.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');t.unshift(e);let i={type:se.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let o=this.ids++,a=t.pop();this._registerAckCallback(o,a),i.id=o}let s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){let i=this.flags.timeout;if(i===void 0){this.acks[e]=t;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let r=0;r<this.sendBuffer.length;r++)this.sendBuffer[r].id===e&&this.sendBuffer.splice(r,1);t.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...r)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...r])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:se.CONNECT,data:e})}):this.packet({type:se.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case se.CONNECT:if(e.data&&e.data.sid){let s=e.data.sid;this.onconnect(s)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case se.EVENT:case se.BINARY_EVENT:this.onevent(e);break;case se.ACK:case se.BINARY_ACK:this.onack(e);break;case se.DISCONNECT:this.ondisconnect();break;case se.CONNECT_ERROR:this.destroy();let i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let i of t)i.apply(this,e)}super.emit.apply(this,e)}ack(e){let t=this,i=!1;return function(...s){i||(i=!0,t.packet({type:se.ACK,id:e,data:s}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let i of t)i.apply(this,e.data)}}}});function mi(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}var hy=O(()=>{mi.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};mi.prototype.reset=function(){this.attempts=0};mi.prototype.setMin=function(n){this.ms=n};mi.prototype.setMax=function(n){this.max=n};mi.prototype.setJitter=function(n){this.jitter=n}});var cs,fy=O(()=>{Qd();au();Va();ou();hy();pi();cs=class extends _e{constructor(e,t){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,gn(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new mi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let s=t.parser||ru;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ct(this.uri,this.opts);let t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let s=dt(t,"open",function(){i.onopen(),e&&e()}),r=dt(t,"error",o=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",o),e?e(o):i.maybeReconnectOnOpen()});if(this._timeout!==!1){let o=this._timeout;o===0&&s();let a=this.setTimeoutFn(()=>{s(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(s),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(dt(e,"ping",this.onping.bind(this)),dt(e,"data",this.ondata.bind(this)),dt(e,"error",this.onerror.bind(this)),dt(e,"close",this.onclose.bind(this)),dt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i||(i=new ls(this,e,t),this.nsps[e]=i),i}_destroy(e){let t=Object.keys(this.nsps);for(let i of t)if(this.nsps[i].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let i=0;i<t.length;i++)this.engine.write(t[i],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}});function yi(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};let t=ry(n,e.path||"/socket.io"),i=t.source,s=t.id,r=t.path,o=Cr[s]&&r in Cr[s].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,c;return a?c=new cs(i,e):(Cr[s]||(Cr[s]=new cs(i,e)),c=Cr[s]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}var Cr,lu=O(()=>{oy();fy();au();Va();Cr={};Object.assign(yi,{Manager:cs,Socket:ls,io:yi,connect:yi})});var bi,cu=O(()=>{Dc();bi=class{constructor(e,t,i){this.ContentAnalysis=e,this.KeywordFinder=t,this.GenieHelpers=i}getDomainName(e){try{return new URL(e).hostname.split(".").slice(-2).join(".")}catch{return""}}saveCompetitor=e=>{this.GenieHelpers.callStoreApi("serpData",{competitorData:e})};getNlpKeywords=async(e,t,i,s)=>new Promise((r,o)=>{let a=window.getGenie.config,c={method:"POST",headers:{"Content-type":"application/json; charset=UTF-8","Site-Token":a?.siteToken||"","Auth-Token":a?.authToken||"","X-WP-Nonce":a?.restNonce||"","Plugin-Version":a?.version}};(async()=>{let d=i||[],u=[];for(let g of t){c.body=JSON.stringify({textContent:g?.textContent,requestId:g?.requestId});let v=await(await fetch(s,c)).json();for(let x of v?.data||[])u.push(x[0].toLowerCase())}u=[...new Set(u)],c.body=JSON.stringify({mainKeywords:i.length===0?[e]:i.map(g=>g?.keyword||"").slice(0,10),nlpKeywords:u});let f=await fetch(zi.filterNlpKeywordsUrl,c).catch(g=>r(d));if(!f.ok){r(d);return}let y=await f.json();try{let g=(y?.data||u)?.map(p=>({keyword:Array.isArray(p)?p[0]:p,type:"nlp"}));d=[...d,...g||[]],d=d.filter((p,v,x)=>v===x.findIndex(_=>_?.keyword===p?.keyword)),r(d)}catch(g){r(d),console.log(g)}})()});analyze=async(e,t)=>new Promise((i,s)=>{let r=[],o={},a={},c=new this.KeywordFinder,d=0,u=0,f=0,y=0;for(let p of e){let v=this.getDomainName(p?.url),_=new this.ContentAnalysis({content:p?.source,url:v,title:p?.title,description:p?.description},t).getStat(),C=c.findAllMatch(p?.source,Object.keys(t.keywords));a[p.keySlug]={url:p.url,title:p.title,rank:y,favicon:p.favicon};for(let T of C)!t.keywords?.[T.keyword]?.total||(o[T.keyword]?o[T.keyword].heatMap[p.keySlug]={matchedKeyPhrase:T.count}:o[T.keyword]={keyPhrase:T.keyword,recommendation:t.keywords?.[T.keyword]?.total,heatMap:{[p.keySlug]:{matchedKeyPhrase:T.count}}});if(y++,p.title==="myContent")continue;let S=parseFloat(_.contentStats.totalScore);r.push({url:p.url,statistics:_.statistics,score:parseInt(Math.ceil(S))||0}),u<S&&(u=parseInt(Math.ceil(S))||0),f+=S}d=Math.ceil(f/r.length-1),d=parseInt(d)||0;let g={headToHeadData:{serpDomains:a,statistics:o},analyzedCompetitors:r,avgScore:d,maxScore:u,firstCompetitorScore:r?.[1]?.score||0};i(g)})}});var kr,Ya,py,f2,p2,g2,m2,Ua,$a,gy,q6,my=O(()=>{Tr();Nc();Tm();Em();lu();cu();({useEffect:kr,useState:Ya}=window.React),{HandleResponse:py,EndPoints:f2}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:p2}=window.getGenie.Components.Common.ReduxManager,{Libs:g2,Utilities:m2}=window.getGenie.Components.Common,{GenieHelpers:Ua}=m2,$a=!1,gy=!1,q6=p2(({sidebar:n,getInputs:e,setInput:t,setSidebar:i})=>{let[s,r]=Ya(""),[o,a]=Ya(e.competitorData),[c,d]=Ya(getGenie.blogWizardData?.serpData?.pageCount||0),[u,f]=Ya(!1),y=e.seoDataTab||"keywords",g=e.searchVolume;kr(()=>{u||r("")},[u]),kr(()=>{e.competitorData?a(e.competitorData):(a(null),d(0))},[e.competitorData]),kr(()=>{Object.keys(e.searchVolume||{})?.length&&n.component==="OutlineScreen"&&t("seoDataTab","competitor")},[e.generatedOutlines]),kr(()=>{n.statisticsScreen.triggered&&!e.competitorData&&(t("seoDataTab","competitor"),x())},[n.statisticsScreen.triggered,e.competitorData]),kr(()=>{e.searchVolume||t("seoDataTab","keywords"),r("")},[e.searchVolume]);let p=C=>new Promise(S=>{setTimeout(S,C)});async function v(){r(n.__("Getting competitor list ","getgenie")),await p(15e3),!e.questionsAsked&&!$a&&r(n.__("Fetching competitor websites ","getgenie"))}let x=()=>{let C=wp.data.select("getgenie").getInputs()?.competitorData;if(u)return;f(!0),i({analyzingCompetitors:!0}),v();let S=e.relatedKeywords||[],T=(e.peopleAlsoSearched||[]).map(j=>j.title);S=[...S,...T].map((j,V)=>{let q=typeof j=="string"?j.toLowerCase():j.keyword.toLowerCase(),$=(e.keyword||"").toLowerCase();q=q.trim(),$=$.trim();let K=q==$?"focus":"common";return{keyword:q,type:K}});let k=yi(window.getGenie.config?.parserApi,{extraHeaders:{"Site-Token":window.getGenie.config?.siteToken,"Auth-Token":window.getGenie.config?.authToken,"Plugin-Version":window.getGenie.config?.version,"Plugin-Name":"getgenie"},query:{location:e.seoCountry,keyword:e.keyword,page:c},reconnection:!1});window.getGenie?.isPlayground&&(window.getGenie.socket=k),k.io.engine.on("close",j=>{window.getGenie.webview?.isDocumentClicked&&(f(!1),i({analyzingCompetitors:!1}))});let D=new Zn,M=[],N=[],R=[...S],L,B=0,W=[];k.on("connect",()=>{k.on("DATASET_DETAIL",j=>{W=W.map(V=>V?.datasetId===j.datasetDetail.datasetId?{...V,offset:j.datasetDetail.offset,rank:j.datasetDetail.rank}:V)}),k.on("DATASETS",j=>{W=j}),k.emit("TRANSPORT_DATA",{datasetDetail:W,datasetLogs:{}}),k.on("COMPETITOR_LIST",j=>{if(py(j,()=>{N=j.data?.question||[],t("questionsAsked",[...e.questionsAsked||[],...N]),t("peopleAlsoSearched",j.data?.peopleAlsoSearched),Ua.callStoreApi("keywordData",{searchVolume:e.searchVolume,relatedKeywords:e.relatedKeywords,peopleAlsoSearched:j.data?.peopleAlsoSearched})}),j?.status==="fail"){r(""),f(!1),i({analyzingCompetitors:!1}),$a=!0;return}r(n.__("Analyzing and fetching data ","getgenie"))}),k.on("SCRAPED_URLS",j=>{L&&clearTimeout(L),r(n.__("Analyzing and fetching data ","getgenie")),py(j,async()=>{let V=D.scrapping(j.data,(e.keyword||"").trim());if(!!V&&!M.find(q=>q?.url===V?.url)){let q={...V,requestId:j?.requestId,url:j.data?.url,keySlug:j.data?.keySlug};M.push(q),a([...o||[],...M]),Ua.callStoreApi("serpData",{competitorData:[q]})}}),j?.status==="fail"&&($a=!0,f(!1),i({analyzingCompetitors:!1}))})});let I=["ping timeout","transport close","transport error"],F=0;k.on("disconnect",async j=>{if(console.log(j),I.includes(j)&&F<4){W=W.sort((V,q)=>V?.offset-q?.offset),W=W.slice(-2),W=W.reduce((V,q)=>V.find(K=>K?.datasetId===q?.datasetId)?V:V.concat([q]),[]),F++,f(!0),i({analyzingCompetitors:!1}),k.connect();return}else gy=!1,W=[],window.getGenie?.isPlayground&&(window.getGenie.socket=null);if(M.length===0){f(!1);return}try{let V=[...C||[],...M];V=V.sort(($,K)=>$.rank-K.rank),V=V.reduce(($,K)=>$.find(G=>G.url===K.url)?$:$.concat([K]),[]);let q=c+1;if(!C){R=await new bi(Xn,Ee,Ua).getNlpKeywords(e.keyword,V.slice(0,10),R,f2.nlpKeywordsUrl);let K=D.getStat(V,R);i({statisticsData:K,statisticsScreen:{loading:!1}}),Ua.callStoreApi("serpData",{pageCount:q,questionsAsked:N,statisticsData:K})}t("competitorData",V),gy=!1,d(q),f(!1),r(""),i({analyzingCompetitors:!1})}catch(V){f(!1),console.log(V)}}),k.on("connect_error",()=>{console.log("error"),B++,B>2?(f(!1),r(""),$a=!0):(f(!0),k.connect())})},_=[{label:n.__("Keywords","getgenie"),key:"keywords",children:React.createElement(km,null)},{label:n.__("Competitor","getgenie"),key:"competitor",children:React.createElement(To,{loadingText:s,page:c,loading:u,data:o,fetchData:x}),disabled:!g},{label:n.__("Questions Asked","getgenie"),key:"questionsAsked",children:React.createElement(Dm,{loadingText:s,loading:!e.questionsAsked&&u,fetchData:x}),disabled:!g}];return React.createElement("div",{className:"getgenie-seo-keyword-tab"},React.createElement("div",{className:"getgenie-seo-container"},React.createElement(g2.Navbar,{tabPaneList:_,activeKey:y,destroyInactiveTabPane:!1,handleActiveKey:C=>t("seoDataTab",C),className:"keyword-analysis-navbar"})))},["getInputs","sidebar","setInput","setSidebar"])});var du=O(()=>{my()});var yy=O(()=>{du()});var by,v2,e3,vy=O(()=>{({Radio:by}=window.antd),{ComposeComponents:v2}=window.getGenie.Components.Common.ReduxManager,e3=v2(({sidebar:n,navigation:e="title",setSidebar:t,getInputs:i})=>{let s={title:{title:"Title",screen:"TitleScreen",selected:!!i.generatedTitles},intro:{title:"Intro",screen:"IntroScreen",selected:!!i.generatedIntros},outline:{title:"Outline",screen:"OutlineScreen",selected:!!(i.selectedOutlines||i.generatedOutlines)}},r=o=>{let a=o.target,c=a.value,d=a.screen;if(!s[c].selected)return!1;t({component:d}),d!=="OutlineScreen"&&t({generatedOutlines:{...n.generatedOutlines,open:!1}})};return React.createElement("div",{className:"genie-nav-container"},React.createElement(by.Group,{onChange:r,value:e},Object.keys(s).map((o,a)=>{let c=s[o];return React.createElement(by.Button,{key:a,className:c.selected?"selected":"",value:o,screen:c.screen},c.title)})))},["sidebar","setSidebar","getInputs"])});var w2,wy,xy=O(()=>{w2={countries:[{label:"Global",value:"global"},{label:"Australia",value:2036},{label:"Canada",value:2124},{label:"India",value:2356},{label:"New Zealand",value:2554},{label:"South Africa",value:2710},{label:"United States (USA)",value:2840},{label:"United Kingdom",value:2826},{label:"Germany",value:2276},{label:"Portugal",value:2620},{label:"Spain",value:2724},{label:"Vietnam",value:2704},{label:"Indonesia",value:2360},{label:"Malaysia",value:2458},{label:"South Korea",value:2410},{label:"Japan",value:2392},{label:"China",value:2156},{label:"Turkey",value:2792},{label:"Ukraine",value:2804},{label:"Italy",value:2380},{label:"France",value:2250},{label:"Poland",value:2616},{label:"Netherland",value:2528},{label:"Lithuania",value:2440},{label:"Hungary",value:2348},{label:"Denmark",value:2208},{label:"Czechia",value:2203},{label:"Thailand",value:2764},{label:"Latvia",value:2428},{label:"Slovakia",value:2703},{label:"Greece",value:2300},{label:"Sweden",value:2752},{label:"Saudi Arabia",value:2682},{label:"Russia",value:2643},{label:"Bulgaria",value:2100},{label:"Mexico",value:2484},{label:"Norway",value:2578},{label:"Pakistan",value:2586},{label:"Israel",value:2376}],languages:[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"de",label:"German"}],outputSizes:[{label:"Small",value:"sm"},{label:"Medium",value:"md"},{label:"Large",value:"lg"}],maxToken:[{label:"Small",value:200},{label:"Medium",value:400},{label:"Large",value:1200}],chatCharacters:[{label:"Professional Writer",value:"professional-writer"},{label:"General Purpose",value:"general-purpose"},{label:"Standup Comedian",value:"standup-comedian"},{label:"Life Coach",value:"life-coach"},{label:"Career Counselor",value:"career-counselor"},{label:"Nutritionist",value:"nutritionist"},{label:"Product Manager",value:"product-manager"},{label:"Personal Trainer",value:"personal-trainer"},{label:"Life Hacker",value:"life-hacker"},{label:"Travel Advisor",value:"travel-advisor"},{label:"Mindfulness Coach",value:"mindfulness-coach"},{label:"Financial Advisor",value:"financial-advisor"},{label:"Language Tutor",value:"language-tutor"},{label:"Travel Guide",value:"travel-guide"},{label:"Marketing Expert",value:"marketing-expert"},{label:"Software Developer",value:"software-developer"},{label:"Dating Coach",value:"dating-coach"},{label:"DIY Expert",value:"diy-expert"},{label:"Journalist",value:"journalist"},{label:"Tech Writer",value:"tech-writer"},{label:"Pro Chef",value:"professional-chef"},{label:"Pro Salesperson",value:"professional-salesperson"},{label:"Startup Tech Lawyer",value:"startup-tech-lawyer"},{label:"Email Copywriter",value:"email-copywriter"}]},wy=w2});var _y,Ga,Nn,Sy,x2,_2,Cy,S2,ds,Ka=O(()=>{xy();({Row:_y,Col:Ga}=window.antd),{Libs:Nn,Utilities:Sy,PromotionalNotice:x2}=window.getGenie.Components.Common,{ComposeComponents:_2}=window.getGenie.Components.Common.ReduxManager,{useEffect:Cy}=window.React,S2=_2(({unsupportedLanguages:n,setSidebar:e,sidebar:t,getInputs:i,className:s="",language:r=!0,tone:o=!0,creativity:a=!0,result:c=!0,outputSize:d=!1})=>{if(!Sy)return;let{GenieHelpers:u}=Sy;Cy(()=>{u.storeData("creativity")},[i.creativity]),Cy(()=>{u.storeData("numberOfResult")},[i.numberOfResult]);let f=Object.values(window.getGenie.config?.templateAssets?.toneOfVoice||{});return f=f.map(y=>({label:y,value:y})),f=f.sort(),f=f.reverse(),React.createElement(React.Fragment,null,React.createElement(_y,{gutter:16,className:s},r&&React.createElement(Ga,{span:24},React.createElement(Nn.Select,{handleOnChange:y=>u.saveSidebarControllerOption("getgenie-language",y),name:"selectedLanguage",except:n,label:React.createElement(React.Fragment,null,t.__("Language","getgenie"),React.createElement(Nn.Tooltip,{title:t.__("Choose the desired language of your input and the outputs","getgenie"),placement:"top"})),options:t.languages,defaultValue:t.currentLanguage})),d&&React.createElement(Ga,{span:12},React.createElement(Nn.Select,{handleOnChange:y=>u.saveSidebarControllerOption("getgenie-outputSize",y),name:"outputSize",label:React.createElement(React.Fragment,null,t.__("Output Size","getgenie"),React.createElement(Nn.Tooltip,{title:t.__("Define what type of size you want the outputs to have","getgenie"),placement:"top"})),options:wy.outputSizes,defaultValue:t.outputSize}))),React.createElement(_y,{style:{marginTop:"10px"},gutter:16,className:s},a&&React.createElement(Ga,{span:12},React.createElement(Nn.Slider,{name:"creativity",handleOnChange:y=>u.saveSidebarControllerOption("getgenie-creativity",y),label:React.createElement(React.Fragment,null,t.__("Creativity","getgenie")," ",React.createElement(Nn.Tooltip,{title:t.__("How much creative you want genie to be","getgenie"),placement:"top"})),message:!1,defaultValue:t?.creativityLevel})),c&&React.createElement(Ga,{span:12},React.createElement(Nn.NumberInput,{name:"numberOfResult",handleOnChange:y=>u.saveSidebarControllerOption("getgenie-numberOfResult",y),className:"ResultLimitNumberInput",max:6,type:"text",defaultValue:t?.numberOfResult,label:React.createElement(React.Fragment,null,t.__("Max Results","getgenie")," ",React.createElement(Nn.Tooltip,{title:t.__("Maximum content you want to generate","getgenie"),placement:"top"})),required:!0,errorMessage:t.__("Please choose valid limit","getgenie")}))),React.createElement(x2,{type:"promotionalNotice",names:["word_generate"]}))},["sidebar","getInputs","setSidebar"]),ds=S2});var Ze,C2,k2,T2,r3,O2,uu,o3,Rn,D2,E2,M2,us,hu,P2,ky,Ty=O(()=>{Ka();({Libs:Ze,Utilities:C2,ContentFeedback:k2,StaticData:T2,PromotionalNotice:r3}=window.getGenie.Components.Common),{Form:O2,Divider:uu,Button:o3}=window.antd,{GenieHelpers:Rn}=C2,{ComposeComponents:D2}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:E2,HandleResponse:M2}=window.getGenie.Components.Common.RequestManager,{useEffect:us,useState:hu}=window.React,P2=D2(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let[s,r]=hu(T2.countries),[o,a]=hu(!1),c=t.generatedTitles||[],d=t.seoEnabled||!1,[u,f]=hu(!1),y=n.analyzingSearchVolume||n.analyzingRelatedKeyword;us(()=>{t.searchVolume||i("seoEnabled",!0)},[]),us(()=>{n.analyzeKeyword?.triggered&&t.keyword&&p()},[n.analyzeKeyword?.triggered]);let g=()=>{a(!0);let _={input:{keyword:(t.keyword||"").replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g,""),context:t.inputContext},templateSlug:"blog-wizard-title"};i("generatedTitles",[]),E2(C=>{a(!1),M2(C,()=>{let S=C.data.map(T=>({title:T,like:!1,dislike:!1}));i("generatedTitles",S),Rn.callStoreApi("generatedTitles",S)})},"writeTitle",_)},p=()=>{(t.keyword!==t.searchVolume?.keyword||t.seoCountry!==t.searchVolume?.country)&&(i("searchVolume",""),i("relatedKeywords",""),i("competitorData",""),i("questionsAsked",""),i("peopleAlsoSearched",""),Rn.callStoreApi("serpData",{competitorData:"",pageCount:0,questionsAsked:"",statisticsData:"",restStatisticsKeyword:"",selectedKeywordList:"",nlpKeywordList:""}),e({statisticsData:"",analyzeKeyword:{open:!0,triggered:!1},analyzingSearchVolume:!0}))},v=(_,C)=>{i("selectedTitle",C.title)},x=()=>{e({component:"TemplateListScreen"})};return us(()=>{Rn.storeData("keyword"),document.getElementsByClassName("block-editor__container").length&&wp.data.dispatch("core/editor").editPost({excerpt:" "})},[t.keyword]),us(()=>{Rn.storeData("seoEnabled")},[t.seoEnabled]),us(()=>{Rn.storeData("seoCountry")},[t.seoCountry]),us(()=>{Rn.storeData("selectedTitle")},[t.selectedTitle]),React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-title-form getgenie-wrapper-screen"},React.createElement(O2,{layout:"vertical",onFinish:g},React.createElement("div",{className:"getgenie-screen-content title"},React.createElement(Ze.Input,{name:"keyword",type:"text",label:React.createElement(React.Fragment,null,n.__("Keyword","getgenie"),React.createElement(Ze.Tooltip,{title:n.__("Enter the focus keyword or topic of your blog post.","getgenie"),placement:"top"})),placeholder:n.__("e.g. bean coffee, best coffee maker, how to make coffee, etc.","getgenie"),required:!0,errorMessage:n.__("Keyword is missing. Please enter keyword.","getgenie")}),React.createElement(Ze.Select,{handleOnChange:_=>Rn.saveSidebarControllerOption("getgenie-language",_),name:"selectedLanguage",label:React.createElement(React.Fragment,null,n.__("Language","getgenie"),React.createElement(Ze.Tooltip,{title:n.__("Choose the desired language of your input and the outputs","getgenie"),placement:"top"})),options:n.languages,defaultValue:n.currentLanguage}),React.createElement(uu,null),React.createElement(Ze.Switch,{label:React.createElement(React.Fragment,null,n.__("SEO Mode","getgenie"),React.createElement(Ze.Tooltip,{title:n.__("Turn on the SEO mode for better search engine optimization.","getgenie"),placement:"top"})),defaultChecked:d,name:"seoEnabled"}),d&&React.createElement(Ze.Select,{name:"seoCountry",handleOnChange:_=>Rn.saveSidebarControllerOption("getgenie-seoCountry",_),loading:u,className:"seoCountry",options:s,defaultValue:n?.seoCountry}),d&&React.createElement(React.Fragment,null,React.createElement(Ze.Button,{onClick:p,className:"getgenie-analyze-btn",type:"primary",loading:y,disabled:!t.keyword},n.__("Analyze keyword","getgenie"))),React.createElement(uu,null),React.createElement(Ze.Textarea,{label:React.createElement(React.Fragment,null,n.__("Context (Optional)","getgenie"),React.createElement(Ze.Tooltip,{title:n.__("Let the genie know the context of your blog post.","getgenie"),placement:"top"})),name:"inputContext",rows:4,placeholder:n.__("Enter a context for this keyword. e.g. a list of best selling coffee maker on amazon, step-by-step process to make coffee at home. etc.","getgenie"),errorMessage:n.__("Please enter the context here","getgenie")}),React.createElement(uu,null),React.createElement(ds,{language:!1,className:"getgenie-sidebar-controller-options"}),React.createElement(Ze.Button,{htmlType:"submit",className:"submit-btn",type:"primary",loading:o,disabled:!t.keyword},React.createElement("span",{className:"getgenie-icon-edit"}),n.__("Generate title","getgenie"))),React.createElement(Ze.TitleMsg,{list:c,loading:o,title:"title"}),React.createElement("div",{className:"getgenie-card-container getgenie-title-cards",style:{backgroundColor:c.length===0&&"transparent"}},React.createElement(Ze.Card,{showActiveItem:!0,value:t.selectedTitle,list:c,handleClick:v,column:1,skeleton:o?()=>React.createElement(Ze.SkeletonSingle,{count:10}):""},_=>React.createElement(React.Fragment,null,React.createElement("h5",{className:"generated-content"},_.title),React.createElement(k2,{content:_,input:t.keyword,contentType:"blogWizard-title",creativityLevel:t.creativity,listName:"generatedTitles"}))))),React.createElement(Ze.DrawerFooter,{handleNext:()=>i("writingScreen","introScreen"),handlePrev:x,enableNextBtn:!!c.find(_=>_.title===t.selectedTitle)})))},["setSidebar","getInputs","setInput","sidebar"]),ky=P2});var N2,R2,A2,mn,L2,I2,F2,B2,z2,H2,Oy,Dy=O(()=>{Ka();({Form:N2,Divider:R2}=window.antd),{ContentFeedback:A2,Libs:mn,Utilities:L2}=window.getGenie.Components.Common,{HandleFetch:I2,HandleResponse:F2}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:B2}=window.getGenie.Components.Common.ReduxManager,{useState:z2}=window.React,H2=B2(({getInputs:n,setInput:e,setSidebar:t,sidebar:i})=>{let[s,r]=z2(!1),o=n.generatedIntros||[],a=()=>{r(!0);let f={input:{keyword:n.keyword||"",title:n.selectedTitle,context:n.inputContext},templateSlug:"blog-wizard-intro"};e("generatedIntros",[]),I2(y=>{r(!1),F2(y,()=>{let g=y.data.map(p=>({title:p,like:!1,dislike:!1}));e("generatedIntros",g),L2.GenieHelpers.callStoreApi("generatedIntros",g)})},"writeIntro",f)},c=(f,y)=>{e("selectedIntro",y.title)},d=()=>{e("writingScreen","outlineScreen")},u=()=>{e("writingScreen","titleScreen"),t({generatedOutlines:{...i.generatedOutlines,open:!1}})};return React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-title-form getgenie-wrapper-screen"},React.createElement(N2,{layout:"vertical",onFinish:a},React.createElement("div",{className:"getgenie-screen-content intro"},React.createElement(mn.Collapse,{defaultActiveKey:["generated-content"],className:"getgenie-collapse"},React.createElement(mn.Collapse.Panel,{header:React.createElement("div",{className:"getgenie-collapse-header"},React.createElement("span",{className:"getgenie-collapse-header-title"},"Title"),React.createElement(mn.Tooltip,{title:i.__("Edit or change the blog post title","getgenie"),placement:"top"})," "),key:"generated-content"},React.createElement(mn.Textarea,{name:"selectedTitle",type:"text",placeholder:i.__("Enter the blog post title here.","getgenie"),required:!0,errorMessage:i.__("Please enter the title here","getgenie")}))),React.createElement(R2,null),React.createElement(ds,{className:"getgenie-sidebar-controller-options"}),React.createElement(mn.Button,{htmlType:"submit",type:"primary",className:"submit-btn",loading:s},React.createElement("span",{className:"getgenie-icon-edit"}),i.__("Generate Intro","getgenie"))),React.createElement(mn.TitleMsg,{list:o,loading:s,title:"intro"}),React.createElement("div",{className:"getgenie-card-container getgenie-title-cards",style:{backgroundColor:o.length===0&&"transparent"}},React.createElement(mn.Card,{showActiveItem:!0,value:n.selectedIntro,list:o,handleClick:c,skeleton:s?()=>React.createElement(mn.SkeletonSingle,{count:10}):""},f=>React.createElement(React.Fragment,null,React.createElement("h5",{className:"generated-content"},f.title),React.createElement(A2,{content:f,input:n.selectedTitle,contentType:"blogWizard-intro",creativityLevel:n.creativity,listName:"generatedIntros"}))))),React.createElement(mn.DrawerFooter,{handleNext:d,handlePrev:u,enableNextBtn:!!o.find(f=>f.title===n.selectedIntro)})))},["getInputs","setInput","setSidebar","sidebar"]),Oy=H2});var Ey,qa,fu=O(()=>{Ey=oe(xe(),1),qa=(0,Ey.createContext)({dragDropManager:void 0})});var Ny=Re((h3,Py)=>{"use strict";var My=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,j2=Object.prototype.propertyIsEnumerable;function V2(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function Y2(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Py.exports=Y2()?Object.assign:function(n,e){for(var t,i=V2(n),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)W2.call(t,o)&&(i[o]=t[o]);if(My){s=My(t);for(var a=0;a<s.length;a++)j2.call(t,s[a])&&(i[s[a]]=t[s[a]])}}return i}});var Ly=Re(Or=>{"use strict";Ny();var U2=xe(),Ry=60103;Or.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(pu=Symbol.for,Ry=pu("react.element"),Or.Fragment=pu("react.fragment"));var pu,$2=U2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,G2=Object.prototype.hasOwnProperty,K2={key:!0,ref:!0,__self:!0,__source:!0};function Ay(n,e,t){var i,s={},r=null,o=null;t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)G2.call(e,i)&&!K2.hasOwnProperty(i)&&(s[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:Ry,type:n,key:r,ref:o,props:s,_owner:$2.current}}Or.jsx=Ay;Or.jsxs=Ay});var Fy=Re((p3,Iy)=>{"use strict";Iy.exports=Ly()});var gu=O(()=>{});var By=O(()=>{gu()});var zy=O(()=>{gu();By()});var Hy=O(()=>{zy()});var Wy=O(()=>{Hy()});function _t(n){return"Minified Redux error #"+n+"; visit https://redux.js.org/Errors?code="+n+" for the full message or use the non-minified dev environment for full errors. "}function X2(n){if(typeof n!="object"||n===null)return!1;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function yu(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(_t(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(_t(1));return t(yu)(n,e)}if(typeof n!="function")throw new Error(_t(2));var s=n,r=e,o=[],a=o,c=!1;function d(){a===o&&(a=o.slice())}function u(){if(c)throw new Error(_t(3));return r}function f(v){if(typeof v!="function")throw new Error(_t(4));if(c)throw new Error(_t(5));var x=!0;return d(),a.push(v),function(){if(!!x){if(c)throw new Error(_t(6));x=!1,d();var C=a.indexOf(v);a.splice(C,1),o=null}}}function y(v){if(!X2(v))throw new Error(_t(7));if(typeof v.type>"u")throw new Error(_t(8));if(c)throw new Error(_t(9));try{c=!0,r=s(r,v)}finally{c=!1}for(var x=o=a,_=0;_<x.length;_++){var C=x[_];C()}return v}function g(v){if(typeof v!="function")throw new Error(_t(10));s=v,y({type:Vy.REPLACE})}function p(){var v,x=f;return v={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(_t(11));function S(){C.next&&C.next(u())}S();var T=x(S);return{unsubscribe:T}}},v[jy]=function(){return this},v}return y({type:Vy.INIT}),i={dispatch:y,subscribe:f,getState:u,replaceReducer:g},i[jy]=p,i}var jy,mu,Vy,Yy=O(()=>{Wy();jy=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),mu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vy={INIT:"@@redux/INIT"+mu(),REPLACE:"@@redux/REPLACE"+mu(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+mu()}}});function X(n,e,...t){if(Z2()&&e===void 0)throw new Error("invariant requires an error message argument");if(!n){let i;if(e===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let s=0;i=new Error(e.replace(/%s/g,function(){return t[s++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}function Z2(){return typeof process<"u"&&!0}var Je=O(()=>{});function Uy(n,e,t){return e.split(".").reduce((i,s)=>i&&i[s]?i[s]:t||null,n)}function $y(n,e){return n.filter(t=>t!==e)}function Xa(n){return typeof n=="object"}function Gy(n,e){let t=new Map,i=r=>{t.set(r,t.has(r)?t.get(r)+1:1)};n.forEach(i),e.forEach(i);let s=[];return t.forEach((r,o)=>{r===1&&s.push(o)}),s}function Ky(n,e){return n.filter(t=>e.indexOf(t)>-1)}var vi=O(()=>{});var hs,An,fs,Ln,In,Fn,Bn=O(()=>{hs="dnd-core/INIT_COORDS",An="dnd-core/BEGIN_DRAG",fs="dnd-core/PUBLISH_DRAG_SOURCE",Ln="dnd-core/HOVER",In="dnd-core/DROP",Fn="dnd-core/END_DRAG"});function bu(n,e){return{type:hs,payload:{sourceClientOffset:e||null,clientOffset:n||null}}}var qy=O(()=>{Bn()});function Xy(n){return function(t=[],i={publishSource:!0}){let{publishSource:s=!0,clientOffset:r,getSourceClientOffset:o}=i,a=n.getMonitor(),c=n.getRegistry();n.dispatch(bu(r)),Q2(t,a,c);let d=nN(t,a);if(d==null){n.dispatch(J2);return}let u=null;if(r){if(!o)throw new Error("getSourceClientOffset must be defined");eN(o),u=o(d)}n.dispatch(bu(r,u));let y=c.getSource(d).beginDrag(a,d);if(y==null)return;tN(y),c.pinSource(d);let g=c.getSourceType(d);return{type:An,payload:{itemType:g,item:y,sourceId:d,clientOffset:r||null,sourceClientOffset:u||null,isSourcePublic:!!s}}}}function Q2(n,e,t){X(!e.isDragging(),"Cannot call beginDrag while dragging."),n.forEach(function(i){X(t.getSource(i),"Expected sourceIds to be registered.")})}function eN(n){X(typeof n=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function tN(n){X(Xa(n),"Item must be an object.")}function nN(n,e){let t=null;for(let i=n.length-1;i>=0;i--)if(e.canDragSource(n[i])){t=n[i];break}return t}var J2,Zy=O(()=>{Je();vi();qy();Bn();J2={type:hs,payload:{clientOffset:null,sourceClientOffset:null}}});function iN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){iN(n,s,t[s])})}return n}function Jy(n){return function(t={}){let i=n.getMonitor(),s=n.getRegistry();rN(i),lN(i).forEach((o,a)=>{let c=oN(o,a,s,i),d={type:In,payload:{dropResult:sN({},t,c)}};n.dispatch(d)})}}function rN(n){X(n.isDragging(),"Cannot call drop while not dragging."),X(!n.didDrop(),"Cannot call drop twice during one drag operation.")}function oN(n,e,t,i){let s=t.getTarget(n),r=s?s.drop(i,n):void 0;return aN(r),typeof r>"u"&&(r=e===0?{}:i.getDropResult()),r}function aN(n){X(typeof n>"u"||Xa(n),"Drop result must either be an object or undefined.")}function lN(n){let e=n.getTargetIds().filter(n.canDropOnTarget,n);return e.reverse(),e}var Qy=O(()=>{Je();vi();Bn()});function eb(n){return function(){let t=n.getMonitor(),i=n.getRegistry();cN(t);let s=t.getSourceId();return s!=null&&(i.getSource(s,!0).endDrag(t,s),i.unpinSource()),{type:Fn}}}function cN(n){X(n.isDragging(),"Cannot call endDrag while not dragging.")}var tb=O(()=>{Je();Bn()});function Dr(n,e){return e===null?n===null:Array.isArray(n)?n.some(t=>t===e):n===e}var vu=O(()=>{});function nb(n){return function(t,{clientOffset:i}={}){dN(t);let s=t.slice(0),r=n.getMonitor(),o=n.getRegistry(),a=r.getItemType();return hN(s,o,a),uN(s,r,o),fN(s,r,o),{type:Ln,payload:{targetIds:s,clientOffset:i||null}}}}function dN(n){X(Array.isArray(n),"Expected targetIds to be an array.")}function uN(n,e,t){X(e.isDragging(),"Cannot call hover while not dragging."),X(!e.didDrop(),"Cannot call hover after drop.");for(let i=0;i<n.length;i++){let s=n[i];X(n.lastIndexOf(s)===i,"Expected targetIds to be unique in the passed array.");let r=t.getTarget(s);X(r,"Expected targetIds to be registered.")}}function hN(n,e,t){for(let i=n.length-1;i>=0;i--){let s=n[i],r=e.getTargetType(s);Dr(r,t)||n.splice(i,1)}}function fN(n,e,t){n.forEach(function(i){t.getTarget(i).hover(e,i)})}var ib=O(()=>{Je();vu();Bn()});function sb(n){return function(){if(n.getMonitor().isDragging())return{type:fs}}}var rb=O(()=>{Bn()});function ob(n){return{beginDrag:Xy(n),publishDragSource:sb(n),hover:nb(n),drop:Jy(n),endDrag:eb(n)}}var Er=O(()=>{Zy();Qy();tb();ib();rb();Bn()});var Za,ab=O(()=>{Er();Za=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function i(r){return(...o)=>{let a=r.apply(e,o);typeof a<"u"&&t(a)}}let s=ob(this);return Object.keys(s).reduce((r,o)=>{let a=s[o];return r[o]=i(a),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let i=this.store.getState().refCount>0;this.backend&&(i&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!i&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}});function pN(n,e){return{x:n.x+e.x,y:n.y+e.y}}function lb(n,e){return{x:n.x-e.x,y:n.y-e.y}}function cb(n){let{clientOffset:e,initialClientOffset:t,initialSourceClientOffset:i}=n;return!e||!t||!i?null:lb(pN(e,i),t)}function db(n){let{clientOffset:e,initialClientOffset:t}=n;return!e||!t?null:lb(e,t)}var ub=O(()=>{});function hb(n,e){return n===ps?!1:n===Ja||typeof e>"u"?!0:Ky(e,n).length>0}var ps,Ja,wu=O(()=>{vi();ps=[],Ja=[];ps.__IS_NONE__=!0;Ja.__IS_ALL__=!0});var Qa,fb=O(()=>{Je();ub();wu();vu();Qa=class{subscribeToStateChange(e,t={}){let{handlerIds:i}=t;X(typeof e=="function","listener must be a function."),X(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");let s=this.store.getState().stateId,r=()=>{let o=this.store.getState(),a=o.stateId;try{a===s||a===s+1&&!hb(o.dirtyHandlerIds,i)||e()}finally{s=a}};return this.store.subscribe(r)}subscribeToOffsetChange(e){X(typeof e=="function","listener must be a function.");let t=this.store.getState().dragOffset,i=()=>{let s=this.store.getState().dragOffset;s!==t&&(t=s,e())};return this.store.subscribe(i)}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return X(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);if(X(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;let i=this.registry.getTargetType(e),s=this.getItemType();return Dr(i,s)&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);if(X(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;let i=this.registry.getSourceType(e),s=this.getItemType();return i!==s?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:i}=t;if(!this.isDragging())return!1;let s=this.registry.getTargetType(e),r=this.getItemType();if(r&&!Dr(s,r))return!1;let o=this.getTargetIds();if(!o.length)return!1;let a=o.indexOf(e);return i?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return cb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return db(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}});function xu(n){return function(){let t=setTimeout(s,0),i=setInterval(s,50);function s(){clearTimeout(t),clearInterval(i),n()}}}function gN(n){let e=1,t=new gb(n),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}var pb,gb,mb,yb=O(()=>{pb=typeof global<"u"?global:self,gb=pb.MutationObserver||pb.WebKitMutationObserver;mb=typeof gb=="function"?gN:xu});var el,_u=O(()=>{yb();el=class{enqueueTask(e){let{queue:t,requestFlush:i}=this;t.length||(i(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let i=0,s=e.length-this.index;i<s;i++)e[i]=e[i+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=mb(this.flush),this.requestErrorThrow=xu(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}});var tl,bb=O(()=>{tl=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}});var nl,Su=O(()=>{bb();nl=class{create(e){let t=this.freeTasks,i=t.length?t.pop():new tl(this.onError,s=>t[t.length]=s);return i.task=e,i}constructor(e){this.onError=e,this.freeTasks=[]}}});function wb(n){vb.enqueueTask(mN.create(n))}var vb,mN,xb=O(()=>{_u();Su();vb=new el,mN=new nl(vb.registerPendingError)});var _b=O(()=>{});var Sb=O(()=>{xb();_u();Su();_b()});function Cb(n){return{type:Mr,payload:{sourceId:n}}}function kb(n){return{type:Pr,payload:{targetId:n}}}function Tb(n){return{type:Nr,payload:{sourceId:n}}}function Ob(n){return{type:wi,payload:{targetId:n}}}var Mr,Pr,Nr,wi,Rr=O(()=>{Mr="dnd-core/ADD_SOURCE",Pr="dnd-core/ADD_TARGET",Nr="dnd-core/REMOVE_SOURCE",wi="dnd-core/REMOVE_TARGET"});function Db(n){X(typeof n.canDrag=="function","Expected canDrag to be a function."),X(typeof n.beginDrag=="function","Expected beginDrag to be a function."),X(typeof n.endDrag=="function","Expected endDrag to be a function.")}function Eb(n){X(typeof n.canDrop=="function","Expected canDrop to be a function."),X(typeof n.hover=="function","Expected hover to be a function."),X(typeof n.drop=="function","Expected beginDrag to be a function.")}function il(n,e){if(e&&Array.isArray(n)){n.forEach(t=>il(t,!1));return}X(typeof n=="string"||typeof n=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Mb=O(()=>{Je()});var ut,Cu=O(()=>{(function(n){n.SOURCE="SOURCE",n.TARGET="TARGET"})(ut||(ut={}))});function Pb(){return yN++}var yN,Nb=O(()=>{yN=0});function bN(n){let e=Pb().toString();switch(n){case ut.SOURCE:return`S${e}`;case ut.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${n}`)}}function Rb(n){switch(n[0]){case"S":return ut.SOURCE;case"T":return ut.TARGET;default:throw new Error(`Cannot parse handler ID: ${n}`)}}function Ab(n,e){let t=n.entries(),i=!1;do{let{done:s,value:[,r]}=t.next();if(r===e)return!0;i=!!s}while(!i);return!1}var sl,Lb=O(()=>{Sb();Je();Rr();Mb();Cu();Nb();sl=class{addSource(e,t){il(e),Db(t);let i=this.addHandler(ut.SOURCE,e,t);return this.store.dispatch(Cb(i)),i}addTarget(e,t){il(e,!0),Eb(t);let i=this.addHandler(ut.TARGET,e,t);return this.store.dispatch(kb(i)),i}containsHandler(e){return Ab(this.dragSources,e)||Ab(this.dropTargets,e)}getSource(e,t=!1){return X(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return X(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return X(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return X(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Rb(e)===ut.SOURCE}isTargetId(e){return Rb(e)===ut.TARGET}removeSource(e){X(this.getSource(e),"Expected an existing source."),this.store.dispatch(Tb(e)),wb(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){X(this.getTarget(e),"Expected an existing target."),this.store.dispatch(Ob(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);X(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){X(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,i){let s=bN(e);return this.types.set(s,t),e===ut.SOURCE?this.dragSources.set(s,i):e===ut.TARGET&&this.dropTargets.set(s,i),s}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}});function Ib(n,e){return!n&&!e?!0:!n||!e?!1:n.x===e.x&&n.y===e.y}function Fb(n,e,t=vN){if(n.length!==e.length)return!1;for(let i=0;i<n.length;++i)if(!t(n[i],e[i]))return!1;return!0}var vN,ku=O(()=>{vN=(n,e)=>n===e});function Bb(n=ps,e){switch(e.type){case Ln:break;case Mr:case Pr:case wi:case Nr:return ps;case An:case fs:case Fn:case In:default:return Ja}let{targetIds:t=[],prevTargetIds:i=[]}=e.payload,s=Gy(t,i);if(!(s.length>0||!Fb(t,i)))return ps;let o=i[i.length-1],a=t[t.length-1];return o!==a&&(o&&s.push(o),a&&s.push(a)),s}var zb=O(()=>{Er();Rr();wu();ku();vi()});function wN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){wN(n,s,t[s])})}return n}function Wb(n=Hb,e){let{payload:t}=e;switch(e.type){case hs:case An:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case Ln:return Ib(n.clientOffset,t.clientOffset)?n:xN({},n,{clientOffset:t.clientOffset});case Fn:case In:return Hb;default:return n}}var Hb,jb=O(()=>{Er();ku();Hb={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}});function _N(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){_N(n,s,t[s])})}return n}function Vb(n=SN,e){let{payload:t}=e;switch(e.type){case An:return gs({},n,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case fs:return gs({},n,{isSourcePublic:!0});case Ln:return gs({},n,{targetIds:t.targetIds});case wi:return n.targetIds.indexOf(t.targetId)===-1?n:gs({},n,{targetIds:$y(n.targetIds,t.targetId)});case In:return gs({},n,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case Fn:return gs({},n,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}var SN,Yb=O(()=>{Er();Rr();vi();SN={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null}});function Ub(n=0,e){switch(e.type){case Mr:case Pr:return n+1;case Nr:case wi:return n-1;default:return n}}var $b=O(()=>{Rr()});function Gb(n=0){return n+1}var Kb=O(()=>{});function CN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){CN(n,s,t[s])})}return n}function qb(n={},e){return{dirtyHandlerIds:Bb(n.dirtyHandlerIds,{type:e.type,payload:kN({},e.payload,{prevTargetIds:Uy(n,"dragOperation.targetIds",[])})}),dragOffset:Wb(n.dragOffset,e),refCount:Ub(n.refCount,e),dragOperation:Vb(n.dragOperation,e),stateId:Gb(n.stateId)}}var Xb=O(()=>{vi();zb();jb();Yb();$b();Kb()});function Zb(n,e=void 0,t={},i=!1){let s=TN(i),r=new Qa(s,new sl(s)),o=new Za(s,r),a=n(o,e,t);return o.receiveBackend(a),o}function TN(n){let e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return yu(qb,n&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var Jb=O(()=>{Yy();ab();fb();Lb();Xb()});var Qb=O(()=>{Jb();Cu()});function ON(n,e){if(n==null)return{};var t=DN(n,e),i,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,i)||(t[i]=n[i]))}return t}function DN(n,e){if(n==null)return{};var t={},i=Object.keys(n),s,r;for(r=0;r<i.length;r++)s=i[r],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function EN(n){if("manager"in n)return[{dragDropManager:n.manager},!1];let e=MN(n.backend,n.context,n.options,n.debugMode),t=!n.context;return[e,t]}function MN(n,e=iv(),t,i){let s=e;return s[rl]||(s[rl]={dragDropManager:Zb(n,e,t,i)}),s[rl]}function iv(){return typeof global<"u"?global:window}var tv,ol,ev,rl,nv,sv=O(()=>{tv=oe(Fy(),1);Qb();ol=oe(xe(),1);fu();ev=0,rl=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),nv=(0,ol.memo)(function(e){var{children:t}=e,i=ON(e,["children"]);let[s,r]=EN(i);return(0,ol.useEffect)(()=>{if(r){let o=iv();return++ev,()=>{--ev===0&&(o[rl]=null)}}},[]),(0,tv.jsx)(qa.Provider,{value:s,children:t})})});var al,T4,rv=O(()=>{al=oe(xe(),1),T4=(0,al.memo)(function({connect:e,src:t}){return(0,al.useEffect)(()=>{if(typeof Image>"u")return;let i=!1,s=new Image;return s.src=t,s.onload=()=>{e(s),i=!0},()=>{i&&e(null)}}),null})});var Tu=O(()=>{fu();sv();rv()});var ov=O(()=>{});var lv=Re((N4,av)=>{"use strict";av.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var i,s,r;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(s=i;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(r=Object.keys(e),i=r.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return!1;for(s=i;s--!==0;){var o=r[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var ll,ht,xi=O(()=>{ll=oe(xe(),1),ht=typeof window<"u"?ll.useLayoutEffect:ll.useEffect});function dv(n,e,t){let[i,s]=(0,cl.useState)(()=>e(n)),r=(0,cl.useCallback)(()=>{let o=e(n);(0,cv.default)(i,o)||(s(o),t&&t())},[i,n,t]);return ht(r),[i,r]}var cv,cl,uv=O(()=>{cv=oe(lv(),1),cl=oe(xe(),1);xi()});function hv(n,e,t){let[i,s]=dv(n,e,t);return ht(function(){let o=n.getHandlerId();if(o!=null)return n.subscribeToStateChange(s,{handlerIds:[o]})},[n,s]),i}var fv=O(()=>{uv();xi()});function dl(n,e,t){return hv(e,n||(()=>({})),()=>t.reconnect())}var Ou=O(()=>{fv()});function ul(n,e){let t=[...e||[]];return e==null&&typeof n!="function"&&t.push(n),(0,pv.useMemo)(()=>typeof n=="function"?n():n,t)}var pv,Du=O(()=>{pv=oe(xe(),1)});function gv(n){return(0,Eu.useMemo)(()=>n.hooks.dragSource(),[n])}function mv(n){return(0,Eu.useMemo)(()=>n.hooks.dragPreview(),[n])}var Eu,yv=O(()=>{Eu=oe(xe(),1)});var Mu,Pu,hl,bv=O(()=>{Je();Mu=!1,Pu=!1,hl=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){X(!Mu,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Mu=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Mu=!1}}isDragging(){if(!this.sourceId)return!1;X(!Pu,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pu=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pu=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}});var Nu,fl,vv=O(()=>{Je();Nu=!1,fl=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;X(!Nu,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Nu=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Nu=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}});function wv(n,e,t){let i=t.getRegistry(),s=i.addTarget(n,e);return[s,()=>i.removeTarget(s)]}function xv(n,e,t){let i=t.getRegistry(),s=i.addSource(n,e);return[s,()=>i.removeSource(s)]}var _v=O(()=>{});function Ar(n,e,t,i){let s=t?t.call(i,n,e):void 0;if(s!==void 0)return!!s;if(n===e)return!0;if(typeof n!="object"||!n||typeof e!="object"||!e)return!1;let r=Object.keys(n),o=Object.keys(e);if(r.length!==o.length)return!1;let a=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<r.length;c++){let d=r[c];if(!a(d))return!1;let u=n[d],f=e[d];if(s=t?t.call(i,u,f,d):void 0,s===!1||s===void 0&&u!==f)return!1}return!0}var Ru=O(()=>{});function Lr(n){return n!==null&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}var Au=O(()=>{});function PN(n){if(typeof n.type=="string")return;let e=n.type.displayName||n.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function NN(n){return(e=null,t=null)=>{if(!(0,Ir.isValidElement)(e)){let r=e;return n(r,t),r}let i=e;return PN(i),RN(i,t?r=>n(r,t):n)}}function pl(n){let e={};return Object.keys(n).forEach(t=>{let i=n[t];if(t.endsWith("Ref"))e[t]=n[t];else{let s=NN(i);e[t]=()=>s}}),e}function Sv(n,e){typeof n=="function"?n(e):n.current=e}function RN(n,e){let t=n.ref;return X(typeof t!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),t?(0,Ir.cloneElement)(n,{ref:i=>{Sv(t,i),Sv(e,i)}}):(0,Ir.cloneElement)(n,{ref:e})}var Ir,Lu=O(()=>{Je();Ir=oe(xe(),1)});var gl,Cv=O(()=>{Ru();Au();Lu();gl=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,i=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(i&&this.disconnectDragPreview(),!!this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Ar(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Ar(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=pl({dragSource:(t,i)=>{this.clearDragSource(),this.dragSourceOptions=i||null,Lr(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,i)=>{this.clearDragPreview(),this.dragPreviewOptions=i||null,Lr(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}});var ml,kv=O(()=>{Ru();Au();Lu();ml=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(!!this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Ar(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=pl({dropTarget:(t,i)=>{this.clearDropTarget(),this.dropTargetOptions=i,Lr(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}});var _i=O(()=>{bv();vv();_v();Cv();kv()});function St(){let{dragDropManager:n}=(0,Tv.useContext)(qa);return X(n!=null,"Expected drag drop context"),n}var Tv,zn=O(()=>{Je();Tv=oe(xe(),1);Tu()});function Dv(n,e){let t=St(),i=(0,Ov.useMemo)(()=>new gl(t.getBackend()),[t]);return ht(()=>(i.dragSourceOptions=n||null,i.reconnect(),()=>i.disconnectDragSource()),[i,n]),ht(()=>(i.dragPreviewOptions=e||null,i.reconnect(),()=>i.disconnectDragPreview()),[i,e]),i}var Ov,Ev=O(()=>{Ov=oe(xe(),1);_i();zn();xi()});function Pv(){let n=St();return(0,Mv.useMemo)(()=>new hl(n),[n])}var Mv,Nv=O(()=>{Mv=oe(xe(),1);_i();zn()});var yl,Rv=O(()=>{yl=class{beginDrag(){let e=this.spec,t=this.monitor,i=null;return typeof e.item=="object"?i=e.item:typeof e.item=="function"?i=e.item(t):i={},i??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){let i=this.spec,s=this.monitor,{isDragging:r}=i;return r?r(s):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,i=this.connector,{end:s}=e;s&&s(t.getItem(),t),i.reconnect()}constructor(e,t,i){this.spec=e,this.monitor=t,this.connector=i}}});function Av(n,e,t){let i=(0,bl.useMemo)(()=>new yl(n,e,t),[e,t]);return(0,bl.useEffect)(()=>{i.spec=n},[n]),i}var bl,Lv=O(()=>{bl=oe(xe(),1);Rv()});function Fv(n){return(0,Iv.useMemo)(()=>{let e=n.type;return X(e!=null,"spec.type must be defined"),e},[n])}var Iv,Bv=O(()=>{Je();Iv=oe(xe(),1)});function zv(n,e,t){let i=St(),s=Av(n,e,t),r=Fv(n);ht(function(){if(r!=null){let[a,c]=xv(r,s,i);return e.receiveHandlerId(a),t.receiveHandlerId(a),c}},[i,e,t,s,r])}var Hv=O(()=>{_i();zn();xi();Lv();Bv()});function Wv(n,e){let t=ul(n,e);X(!t.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");let i=Pv(),s=Dv(t.options,t.previewOptions);return zv(t,i,s),[dl(t.collect,i,s),gv(s),mv(s)]}var jv=O(()=>{Je();Ou();Du();yv();Ev();Nv();Hv()});var Vv=O(()=>{jv()});var AN,Yv=O(()=>{AN=oe(xe(),1)});function $v(n){return(0,Uv.useMemo)(()=>n.hooks.dropTarget(),[n])}var Uv,Gv=O(()=>{Uv=oe(xe(),1)});function qv(n){let e=St(),t=(0,Kv.useMemo)(()=>new ml(e.getBackend()),[e]);return ht(()=>(t.dropTargetOptions=n||null,t.reconnect(),()=>t.disconnectDropTarget()),[n]),t}var Kv,Xv=O(()=>{Kv=oe(xe(),1);_i();zn();xi()});function Jv(){let n=St();return(0,Zv.useMemo)(()=>new fl(n),[n])}var Zv,Qv=O(()=>{Zv=oe(xe(),1);_i();zn()});function tw(n){let{accept:e}=n;return(0,ew.useMemo)(()=>(X(n.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}var ew,nw=O(()=>{Je();ew=oe(xe(),1)});var vl,iw=O(()=>{vl=class{canDrop(){let e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}});function sw(n,e){let t=(0,wl.useMemo)(()=>new vl(n,e),[e]);return(0,wl.useEffect)(()=>{t.spec=n},[n]),t}var wl,rw=O(()=>{wl=oe(xe(),1);iw()});function ow(n,e,t){let i=St(),s=sw(n,e),r=tw(n);ht(function(){let[a,c]=wv(r,s,i);return e.receiveHandlerId(a),t.receiveHandlerId(a),c},[i,e,s,t,r.map(o=>o.toString()).join("|")])}var aw=O(()=>{_i();zn();xi();nw();rw()});function lw(n,e){let t=ul(n,e),i=Jv(),s=qv(t.options);return ow(t,i,s),[dl(t.collect,i,s),$v(s)]}var cw=O(()=>{Ou();Du();Gv();Xv();Qv();aw()});var dw=O(()=>{cw()});var uw=O(()=>{ov();Vv();zn();Yv();dw()});var hw=O(()=>{});var fw=O(()=>{});var pw=O(()=>{});var gw=O(()=>{hw();fw();pw()});var Iu=O(()=>{Tu();uw();gw()});function Fu(n){let e=null;return()=>(e==null&&(e=n()),e)}function mw(n,e){return n.filter(t=>t!==e)}function yw(n,e){let t=new Set,i=r=>t.add(r);n.forEach(i),e.forEach(i);let s=[];return t.forEach(r=>s.push(r)),s}var Bu=O(()=>{});var xl,bw=O(()=>{Bu();xl=class{enter(e){let t=this.entered.length,i=s=>this.isNodeInDocument(s)&&(!s.contains||s.contains(e));return this.entered=yw(this.entered.filter(i),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=mw(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}});var _l,vw=O(()=>{_l=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(i=>{let s=this.config.exposeProperties[i];s!=null&&(t[i]={value:s(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}});var Fr={};xo(Fr,{FILE:()=>zu,HTML:()=>ju,TEXT:()=>Wu,URL:()=>Hu});var zu,Hu,Wu,ju,Vu=O(()=>{zu="__NATIVE_FILE__",Hu="__NATIVE_URL__",Wu="__NATIVE_TEXT__",ju="__NATIVE_HTML__"});function Sl(n,e,t){let i=e.reduce((s,r)=>s||n.getData(r),"");return i??t}var ww=O(()=>{});var Cl,xw=O(()=>{Vu();ww();Cl={[zu]:{exposeProperties:{files:n=>Array.prototype.slice.call(n.files),items:n=>n.items,dataTransfer:n=>n},matchesTypes:["Files"]},[ju]:{exposeProperties:{html:(n,e)=>Sl(n,e,""),dataTransfer:n=>n},matchesTypes:["Html","text/html"]},[Hu]:{exposeProperties:{urls:(n,e)=>Sl(n,e,"").split(`
`),dataTransfer:n=>n},matchesTypes:["Url","text/uri-list"]},[Wu]:{exposeProperties:{text:(n,e)=>Sl(n,e,""),dataTransfer:n=>n},matchesTypes:["Text","text/plain"]}}});function _w(n,e){let t=Cl[n];if(!t)throw new Error(`native type ${n} has no configuration`);let i=new _l(t);return i.loadDataTransfer(e),i}function kl(n){if(!n)return null;let e=Array.prototype.slice.call(n.types||[]);return Object.keys(Cl).filter(t=>{let i=Cl[t];return i?.matchesTypes?i.matchesTypes.some(s=>e.indexOf(s)>-1):!1})[0]||null}var Sw=O(()=>{vw();xw()});var Cw,Yu,kw=O(()=>{Bu();Cw=Fu(()=>/firefox/i.test(navigator.userAgent)),Yu=Fu(()=>Boolean(window.safari))});var Br,Tw=O(()=>{Br=class{interpolate(e){let{xs:t,ys:i,c1s:s,c2s:r,c3s:o}=this,a=t.length-1;if(e===t[a])return i[a];let c=0,d=o.length-1,u;for(;c<=d;){u=Math.floor(.5*(c+d));let g=t[u];if(g<e)c=u+1;else if(g>e)d=u-1;else return i[u]}a=Math.max(0,d);let f=e-t[a],y=f*f;return i[a]+s[a]*f+r[a]*y+o[a]*f*y}constructor(e,t){let{length:i}=e,s=[];for(let p=0;p<i;p++)s.push(p);s.sort((p,v)=>e[p]<e[v]?-1:1);let r=[],o=[],a=[],c,d;for(let p=0;p<i-1;p++)c=e[p+1]-e[p],d=t[p+1]-t[p],o.push(c),r.push(d),a.push(d/c);let u=[a[0]];for(let p=0;p<o.length-1;p++){let v=a[p],x=a[p+1];if(v*x<=0)u.push(0);else{c=o[p];let _=o[p+1],C=c+_;u.push(3*C/((C+_)/v+(C+c)/x))}}u.push(a[a.length-1]);let f=[],y=[],g;for(let p=0;p<u.length-1;p++){g=a[p];let v=u[p],x=1/o[p],_=v+u[p+1]-g-g;f.push((g-v-_)*x),y.push(_*x*x)}this.xs=e,this.ys=t,this.c1s=u,this.c2s=f,this.c3s=y}}});function Uu(n){let e=n.nodeType===LN?n:n.parentElement;if(!e)return null;let{top:t,left:i}=e.getBoundingClientRect();return{x:i,y:t}}function zr(n){return{x:n.clientX,y:n.clientY}}function IN(n){var e;return n.nodeName==="IMG"&&(Cw()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(n)))}function FN(n,e,t,i){let s=n?e.width:t,r=n?e.height:i;return Yu()&&n&&(r/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:r}}function Ow(n,e,t,i,s){let r=IN(e),a=Uu(r?n:e),c={x:t.x-a.x,y:t.y-a.y},{offsetWidth:d,offsetHeight:u}=n,{anchorX:f,anchorY:y}=i,{dragPreviewWidth:g,dragPreviewHeight:p}=FN(r,e,d,u),v=()=>{let P=new Br([0,.5,1],[c.y,c.y/u*p,c.y+p-u]).interpolate(y);return Yu()&&r&&(P+=(window.devicePixelRatio-1)*p),P},x=()=>new Br([0,.5,1],[c.x,c.x/d*g,c.x+g-d]).interpolate(f),{offsetX:_,offsetY:C}=s,S=_===0||_,T=C===0||C;return{x:S?_:x(),y:T?C:v()}}var LN,Dw=O(()=>{kw();Tw();LN=1});var Tl,Ew=O(()=>{Tl=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}});function BN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mw(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){BN(n,s,t[s])})}return n}var Ol,Pw=O(()=>{bw();Sw();Vu();Dw();Ew();Ol=class{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)===null||t===void 0||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,i){return this.sourcePreviewNodeOptions.set(e,i),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,i){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,i);let s=o=>this.handleDragStart(o,e),r=o=>this.handleSelectStart(o);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",s),t.addEventListener("selectstart",r),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",s),t.removeEventListener("selectstart",r),t.setAttribute("draggable","false")}}connectDropTarget(e,t){let i=o=>this.handleDragEnter(o,e),s=o=>this.handleDragOver(o,e),r=o=>this.handleDrop(o,e);return t.addEventListener("dragenter",i),t.addEventListener("dragover",s),t.addEventListener("drop",r),()=>{t.removeEventListener("dragenter",i),t.removeEventListener("dragover",s),t.removeEventListener("drop",r)}}addEventListeners(e){!e.addEventListener||(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){!e.removeEventListener||(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Mw({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions.get(e);return Mw({anchorX:.5,anchorY:.5,captureDraggingState:!1},t||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(Fr).some(t=>Fr[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=_w(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;let t=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var i;return(i=this.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},t)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,i){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=s=>{let r=this.sourceNodes.get(s);return r&&Uu(r)||null},this.endDragNativeItem=()=>{!this.isDraggingNativeItem()||(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=s=>Boolean(s&&this.document&&this.document.body&&this.document.body.contains(s)),this.endDragIfSourceWasRemovedFromDOM=()=>{let s=this.currentDragSourceNode;s==null||this.isNodeInDocument(s)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=s=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(s||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=s=>{if(s.defaultPrevented)return;let{dragStartSourceIds:r}=this;this.dragStartSourceIds=null;let o=zr(s);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(r||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});let{dataTransfer:a}=s,c=kl(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){let u=this.monitor.getSourceId(),f=this.sourceNodes.get(u),y=this.sourcePreviewNodes.get(u)||f;if(y){let{anchorX:g,anchorY:p,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),S=Ow(f,y,o,{anchorX:g,anchorY:p},{offsetX:v,offsetY:x});a.setDragImage(y,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(s.target);let{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(a&&!a.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=s=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var r;(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}if(!this.enterLeaveCounter.enter(s.target)||this.monitor.isDragging())return;let{dataTransfer:a}=s,c=kl(a);c&&this.beginDragNativeItem(c,a)},this.handleTopDragEnter=s=>{let{dragEnterTargetIds:r}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=s.altKey,r.length>0&&this.actions.hover(r,{clientOffset:zr(s)}),r.some(a=>this.monitor.canDropOnTarget(a))&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=s=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var r;(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}},this.handleTopDragOver=s=>{let{dragOverTargetIds:r}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none");return}this.altKeyPressed=s.altKey,this.lastClientOffset=zr(s),this.scheduleHover(r),(r||[]).some(a=>this.monitor.canDropOnTarget(a))?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=s=>{this.isDraggingNativeItem()&&s.preventDefault(),this.enterLeaveCounter.leave(s.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=s=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var r;s.preventDefault(),(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}else kl(s.dataTransfer)&&s.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=s=>{let{dropTargetIds:r}=this;this.dropTargetIds=[],this.actions.hover(r,{clientOffset:zr(s)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=s=>{let r=s.target;typeof r.dragDrop=="function"&&(r.tagName==="INPUT"||r.tagName==="SELECT"||r.tagName==="TEXTAREA"||r.isContentEditable||(s.preventDefault(),r.dragDrop()))},this.options=new Tl(t,i),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new xl(this.isNodeInDocument)}}});var Nw,Rw=O(()=>{Pw();Nw=function(e,t,i){return new Ol(e,t,i)}});var zN,HN,WN,jN,Aw,VN,YN,Lw,Iw=O(()=>{({Libs:zN}=window.getGenie.Components.Common),{Button:HN,Card:WN,Checkbox:jN,Typography:Aw,Tooltip:VN}=window.antd,{ComposeComponents:YN}=window.getGenie.Components.Common.ReduxManager,Lw=YN(({setInput:n,getInputs:e,sidebar:t,visible:i,width:s})=>{let r=e.selectedOutlines||[],o=e.generatedOutlines||[],a=t.generatedOutlines.loading,c=f=>{let y=[...r];y.indexOf(f)!=-1?y.splice(y.indexOf(f),1):y.push(f),n("selectedOutlines",y)},d=(f=[])=>[...f].filter(y=>r.includes(y)).length===f.length,u=(f,y)=>{let g=[...r];if(y){let p=[];r.forEach((v,x)=>{f.indexOf(v)==-1&&p.indexOf(v)===-1&&p.push(v)}),g=p}else g=[...r,...f];n("selectedOutlines",g)};return React.createElement("div",{className:`getgenie-generated-outlines ${i?"":"d-none"}`,style:{width:`${s}px`}},React.createElement("div",{className:"getgenie-empty-tag"}),React.createElement("h5",{className:"getgenie-generated-outlines-title"},React.createElement(VN,{title:t.__("Select subheadings to create your content outline.","getgenie"),placement:"top"},t.__("Generated Outlines","getgenie")),React.createElement(Aw.Text,{className:"generateMsg outline"},React.createElement("span",{className:"resultNumber"},o.length))),a?React.createElement(zN.SkeletonCard,{count:5}):o.length===0?React.createElement(Aw.Title,{level:5,className:"getgenie-not-found-title"}," ",t.__("Something Went Wrong! Please Try Again.","getgenie")," "):React.createElement("div",{className:"getgenie-generated-outlines-cards"},o.map((f,y)=>React.createElement(WN,{key:y,className:"getgenie-generated-outlines-card"},React.createElement(HN,{className:"getgenie-generated-outlines-card-select-btn",type:"link",onClick:()=>u(f,d(f))},d(f)?t.__("Unselect All","getgenie"):t.__("Select All","getgenie")),React.createElement("div",{className:"getgenie-checkbox"},f.map((g,p)=>React.createElement("div",{key:p,className:`getgenie-checkbox-container${r.indexOf(g)!=-1?t.__(" active","getgenie"):""}`},React.createElement(jN,{checked:r.indexOf(g)!=-1,onChange:()=>c(g)},g))))))))},["setInput","getInputs","sidebar"])});var UN,Fw,$u,$N,Gu,GN,KN,Bw,zw=O(()=>{Iu();({useRef:UN,useState:Fw}=window.React),{Button:$u,Dropdown:$N,Menu:Gu}=window.antd,{ComposeComponents:GN}=window.getGenie.Components.Common.ReduxManager,{GenieHelpers:KN}=window.getGenie.Components.Common.Utilities,Bw=GN(({outlines:n,setOutlines:e,swapOutlines:t,id:i,text:s,index:r,setInput:o,getInputs:a,sidebar:c})=>{let[d,u]=Fw(""),[f,y]=Fw(""),g=UN(null),[{handlerId:p},v]=lw({accept:"card",collect(D){return{handlerId:D.getHandlerId()}},hover(D,M){if(!g.current)return;let N=D.index,R=r;if(N===R)return;let L=g.current?.getBoundingClientRect(),B=(L.bottom-L.top)/2,I=M.getClientOffset().y-L.top;N<R&&I<B||N>R&&I>B||(t(N,R),D.index=R)}}),[{isDragging:x},_]=Wv({type:"card",item:()=>({id:i,index:r}),collect:D=>({isDragging:D.isDragging()})}),C=x?0:1;_(v(g));let S=(D,M)=>{if(D.type==="keyup"&&(D.key!=="Enter"||D?.which!==13)){y(D.target.value);return}let N=n.map((R,L)=>L===M?{...R,text:f}:R);N=N.filter(R=>R.text),e(N),o("selectedOutlines",N.map(R=>R.text)),u(""),D.type==="keyup"&&y("")},T=D=>{u(D),y(D)},k=D=>{let M=n.filter(R=>R.text!==D),N=a.generatedParagraphs;delete N?.[D],o("generatedParagraphs",N),KN.callStoreApi("generatedParagraphs",N),e(M)};return React.createElement("div",{ref:g,"data-handler-id":p,style:{cursor:"grab",opacity:C},className:`getgenie-single-outline ${d===s?"outline-input":"outline-content"}`},React.createElement("div",{className:"getgenie-outline-cards-content"},d===s?React.createElement("textarea",{autoFocus:!0,onFocus:D=>D.target.selectionStart=s.length,onBlur:D=>S(D,r),className:"getgenie-outline-cards-input",defaultValue:s,onKeyDown:D=>D.stopPropagation(),onKeyUp:D=>S(D,r)}):React.createElement(React.Fragment,null,React.createElement("h5",{onDoubleClick:()=>T(s),className:"generated-content"},s),React.createElement($N,{overlay:(D=>React.createElement(Gu,{className:"getgenie-outline-menu"},React.createElement(Gu.Item,{key:"0"},React.createElement($u,{type:"text",onClick:()=>T(D)},React.createElement("span",{className:"getgenie-icon-edit icon"}),c.__("Edit","getgenie"))),React.createElement(Gu.Item,{key:"1"},React.createElement($u,{type:"text",onClick:()=>k(D)},React.createElement("span",{className:"getgenie-icon-trash icon"}),c.__("Delete","getgenie")))))(s),trigger:["click"],zIndex:9999},React.createElement($u,{type:"text",className:"getgenie-outline-cards-menuBtn"},React.createElement("span",{className:"getgenie-icon-more-vertical"}))))))},["getInputs","setInput","sidebar"])});var Uw=Re((Wt,Yw)=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});function Nt(n){return typeof n=="object"&&!("toString"in n)?Object.prototype.toString.call(n).slice(8,-1):n}var qN=typeof process=="object"&&!0;function Ct(n,e){if(!n)throw qN?new Error("Invariant failed"):new Error(e())}Wt.invariant=Ct;var Ku=Object.prototype.hasOwnProperty,XN=Array.prototype.splice,ZN=Object.prototype.toString;function Si(n){return ZN.call(n).slice(8,-1)}var Dl=Object.assign||function(n,e){return qu(e).forEach(function(t){Ku.call(e,t)&&(n[t]=e[t])}),n},qu=typeof Object.getOwnPropertySymbols=="function"?function(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.keys(n)};function Hn(n){return Array.isArray(n)?Dl(n.constructor(n.length),n):Si(n)==="Map"?new Map(n):Si(n)==="Set"?new Set(n):n&&typeof n=="object"?Dl(Object.create(Object.getPrototypeOf(n)),n):n}var jw=function(){function n(){this.commands=Dl({},JN),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(e,t){return e===t},this.update.newContext=function(){return new n().update}}return Object.defineProperty(n.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(e){this.update.isEquals=e},enumerable:!0,configurable:!0}),n.prototype.extend=function(e,t){this.commands[e]=t},n.prototype.update=function(e,t){var i=this,s=typeof t=="function"?{$apply:t}:t;Array.isArray(e)&&Array.isArray(s)||Ct(!Array.isArray(s),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),Ct(typeof s=="object"&&s!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(i.commands).join(", ")+".")});var r=e;return qu(s).forEach(function(o){if(Ku.call(i.commands,o)){var a=e===r;r=i.commands[o](s[o],r,s,e),a&&i.isEquals(r,e)&&(r=e)}else{var c=Si(e)==="Map"?i.update(e.get(o),s[o]):i.update(e[o],s[o]),d=Si(r)==="Map"?r.get(o):r[o];(!i.isEquals(c,d)||typeof c>"u"&&!Ku.call(e,o))&&(r===e&&(r=Hn(e)),Si(r)==="Map"?r.set(o,c):r[o]=c)}}),r},n}();Wt.Context=jw;var JN={$push:function(n,e,t){return Hw(e,t,"$push"),n.length?e.concat(n):e},$unshift:function(n,e,t){return Hw(e,t,"$unshift"),n.length?n.concat(e):e},$splice:function(n,e,t,i){return QN(e,t),n.forEach(function(s){Vw(s),e===i&&s.length&&(e=Hn(i)),XN.apply(e,s)}),e},$set:function(n,e,t){return tR(t),n},$toggle:function(n,e){Hr(n,"$toggle");var t=n.length?Hn(e):e;return n.forEach(function(i){t[i]=!e[i]}),t},$unset:function(n,e,t,i){return Hr(n,"$unset"),n.forEach(function(s){Object.hasOwnProperty.call(e,s)&&(e===i&&(e=Hn(i)),delete e[s])}),e},$add:function(n,e,t,i){return Ww(e,"$add"),Hr(n,"$add"),Si(e)==="Map"?n.forEach(function(s){var r=s[0],o=s[1];e===i&&e.get(r)!==o&&(e=Hn(i)),e.set(r,o)}):n.forEach(function(s){e===i&&!e.has(s)&&(e=Hn(i)),e.add(s)}),e},$remove:function(n,e,t,i){return Ww(e,"$remove"),Hr(n,"$remove"),n.forEach(function(s){e===i&&e.has(s)&&(e=Hn(i)),e.delete(s)}),e},$merge:function(n,e,t,i){return nR(e,n),qu(n).forEach(function(s){n[s]!==e[s]&&(e===i&&(e=Hn(i)),e[s]=n[s])}),e},$apply:function(n,e){return eR(n),n(e)}},Xu=new jw;Wt.isEquals=Xu.update.isEquals;Wt.extend=Xu.extend;Wt.default=Xu.update;Wt.default.default=Yw.exports=Dl(Wt.default,Wt);function Hw(n,e,t){Ct(Array.isArray(n),function(){return"update(): expected target of "+Nt(t)+" to be an array; got "+Nt(n)+"."}),Hr(e[t],t)}function Hr(n,e){Ct(Array.isArray(n),function(){return"update(): expected spec of "+Nt(e)+" to be an array; got "+Nt(n)+". Did you forget to wrap your parameter in an array?"})}function QN(n,e){Ct(Array.isArray(n),function(){return"Expected $splice target to be an array; got "+Nt(n)}),Vw(e.$splice)}function Vw(n){Ct(Array.isArray(n),function(){return"update(): expected spec of $splice to be an array of arrays; got "+Nt(n)+". Did you forget to wrap your parameters in an array?"})}function eR(n){Ct(typeof n=="function",function(){return"update(): expected spec of $apply to be a function; got "+Nt(n)+"."})}function tR(n){Ct(Object.keys(n).length===1,function(){return"Cannot have more than one key in an object with $set"})}function nR(n,e){Ct(e&&typeof e=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+Nt(e)}),Ct(n&&typeof n=="object",function(){return"update(): $merge expects a target of type 'object'; got "+Nt(n)})}function Ww(n,e){var t=Si(n);Ct(t==="Map"||t==="Set",function(){return"update(): "+Nt(e)+" expects a target of type Set or Map; got "+Nt(t)})}});var Gw,iR,sR,$w,rR,oR,Kw,qw=O(()=>{zw();Gw=oe(Uw()),{useState:iR,useCallback:sR,useEffect:$w}=window.React,{ComposeComponents:rR}=window.getGenie.Components.Common.ReduxManager,{Button:oR}=window.antd,Kw=rR(({getInputs:n,setInput:e,sidebar:t})=>{let i=n.selectedOutlines?[...new Set(n.selectedOutlines)]:[],s=()=>{o(d=>[...d,{text:"",id:""}])},[r,o]=iR(i.map((d,u)=>({text:d,id:u+1})));$w(()=>{let d=r.map(u=>u.text);i.length>=r.length&&e("selectedOutlines",d)},[r]),$w(()=>{i.length!==r.length&&o(i.map((d,u)=>({text:d,id:u+1})))},[n.selectedOutlines]);let a=sR((d,u)=>{o(f=>(0,Gw.default)(f,{$splice:[[d,1],[u,0,f[d]]]}))},[]),c=t.languages.find(d=>d.value===t.currentLanguage)?.writingDirection;return React.createElement("div",{className:`getgenie-card ${c}`},r.map((d,u)=>React.createElement(Bw,{key:d.id,index:u,id:d.id,text:d.text,swapOutlines:a,outlines:r,setOutlines:o})),React.createElement(oR,{onClick:s,type:"primary",className:"add-outline-btn"},t.__("Add Outline","getgenie")))},["getInputs","setInput","sidebar"])});var yn,ms,aR,lR,cR,Zw,dR,uR,hR,fR,Xw,Wr,jr,El,Jw,Zu,Ju=O(()=>{lu();Iu();Rw();Ka();Co();Iw();qw();({Libs:yn,Utilities:ms}=window.getGenie.Components.Common),{Alert:aR,Form:lR,Modal:cR,Steps:Zw,Divider:dR}=window.antd,{Step:uR}=Zw,{ComposeComponents:hR}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:fR,HandleResponse:Xw}=window.getGenie.Components.Common.RequestManager,{useEffect:Wr,useState:jr}=window.React,Jw=hR(({setSidebar:n,sidebar:e,getInputs:t,setInput:i})=>{let s=e.generatedOutlines.loading,r=t.selectedOutlines?[...new Set(t.selectedOutlines)]:[],[o,a]=jr(!1),[c,d]=jr(!1),[u,f]=jr(!1),y="Do you want to create the entire blog with just one click, or would you prefer to generate the content step-by-step?",[g,p]=jr(y),[v,x]=jr(0),_=new Qt(window.getGenie.config.isBlockEditor),C=e.languages.find(I=>I.value===e.currentLanguage)?.oneClick,S=["Researching","Getting data","Adding keywords","Cooking content"];Wr(()=>{ms.GenieHelpers.callStoreApi("selectedTitle",t.selectedTitle),ms.GenieHelpers.callStoreApi("selectedIntro",t.selectedIntro)},[]),Wr(()=>{u?El=setInterval(()=>{x(I=>I===3?(clearInterval(El),I):I+1)},5e3):(El&&clearInterval(El),x(0))},[u]);let T=()=>{let I={input:{title:t.selectedTitle,intro:t.selectedIntro,context:t.inputContext},templateSlug:"blog-wizard-outline"};i("generatedOutlines",""),n({generatedOutlines:{open:!0,loading:!0}}),fR(F=>{n({generatedOutlines:{open:!0,loading:!1}}),Xw(F,()=>{i("generatedOutlines",F.data),i("seoEnabled",!0),a(!0),ms.GenieHelpers.callStoreApi("generatedOutlines",F.data)})},"outlines",I)};function k(I){return(I.startsWith("<br>")||I.startsWith("<br/>")||I.startsWith("<br />"))&&(I=I.substring(4)),(I.endsWith("<br>")||I.endsWith("<br/>")||I.endsWith("<br />"))&&(I=I.substring(0,I.length-4)),I}function P(I){return I=I.replace(/<br\/?>/g,`
`),I=I.replace(/<\/?p>/g,"<br>"),I=I.replace(/\n\s*\n/g,`
`),I=I.trim(),I=I.replace(/\s\s+/g,""),k(I)}function D(I,F){for(let j=0;j<I.length;j++){let V=I[j];j===0?F=F.replace(V,`<h2>${V}</h2><p>`):F=F.replace(V,`</p><h2>${V}</h2><p>`)}return F+"</p>"}Wr(()=>{t.generatedOutlines&&(n({generatedOutlines:{...e.generatedOutlines,open:!0}}),i("seoEnabled",!0))},[]);let M=()=>{i("writingScreen","introScreen"),n({generatedOutlines:{...e.generatedOutlines,open:!1}})};Wr(()=>{ms.GenieHelpers.storeData("selectedIntro")},[t.selectedIntro]);let N;Wr(()=>{r.length>1&&o&&(N=setTimeout(()=>{a(!1)},1e4)),ms.GenieHelpers.storeData("selectedOutlines")},[t.selectedOutlines]);let R=()=>{if(t.selectedOutlines.length<=1){p(" Add at least two headings to generate the blog");return}f(!0);let I=`<p>${t.selectedIntro}</p>`,F=t.selectedOutlines.map(q=>`<h2>${q}</h2>`).join(""),j=0,V=yi(window.getGenie.config?.parserApi,{query:{"Site-Token":window.getGenie.config?.siteToken,"Auth-Token":window.getGenie.config?.authToken,"Plugin-Version":window.getGenie.config?.version,"Plugin-Name":"getgenie"},transports:["websocket"],reconnection:!1});V.on("connect",()=>{V.emit("ONE_CLICK_BLOG_PAYLOAD",{keyword:t.keyword,title:t.selectedTitle,context:t.inputContext,intro:I,outline:F,selectedLanguage:e.currentLanguage}),V.on("ONE_CLICK_BLOG_RESPONSE",q=>{Xw(q,()=>{let $=q?.data?.[0];if(typeof $!="string")return;$=$.replace(/(<h(?!(>|\s))[^<]+?>)|(\s(?!(direction|text-align|)\b)[\w])/gm,"<h2>");let K=$?.match(/<h2>([^\<]*?)<\/h2>/g)||[],U={};K?.length||($=D(t.selectedOutlines,$),K=$.match(/<h2>([^\<]*?)<\/h2>/g));for(let be=0;be<K.length;be++){let ve=$.split(K[be])[1].split(K[be+1])[0].replace(/ *\[[^\]]*]/,"");ve=P(ve),U[K[be].replace(/<\/?h2>/gi,"")]={paragraph:ve}}let G=K?.map(be=>be.replace(/<\/?h2>/gi,""));i("generatedParagraphs",U),ms.GenieHelpers.callStoreApi("generatedParagraphs",U);let z=(t.selectedIntro||"").replace(/<br\s*[\/]?>/g,""),de=t.selectedTitle||"";e.currentPostContent?.trim().length>0?yn.ConfirmModal("This page has some content","Do you want to replace that?",()=>{_.insertContent(de,z,G,U)},()=>{_.appendOutlines(G,U)}):_.insertContent(de,z,G,U)})})}),V.on("disconnect",async q=>{f(!1),d(!1)}),V.on("connect_error",q=>{j++,j>2?(f(!1),d(!1)):(x(0),f(!0),V.connect())})},L=()=>{C?d(!0):(i("writingScreen","paragraphScreen"),W())},B=I=>{if(I.target.className.includes("getgenie-icon-close1")){d(!1);return}p(y),d(!1),W()},W=()=>{i("writingScreen","paragraphScreen"),n({generatedOutlines:{...e.generatedOutlines,open:!1}})};return React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-sidebar-outline getgenie-wrapper-screen"},React.createElement(lR,{layout:"vertical",onFinish:T},React.createElement("div",{className:"getgenie-screen-content intro"},React.createElement(yn.Collapse,{defaultActiveKey:["Title-Intro"],className:"getgenie-collapse"},React.createElement(yn.Collapse.Panel,{header:React.createElement("div",{className:"getgenie-collapse-header"},React.createElement("span",{className:"getgenie-collapse-header-title"},"Title & Intro"),React.createElement(yn.Tooltip,{title:e.__("Edit or change the blog title & intro","getgenie"),placement:"top"})),key:"Title-Intro"},React.createElement(yn.Textarea,{rows:2,name:"selectedTitle",type:"text",placeholder:e.__("Enter blog post title here.","getgenie")}),React.createElement(yn.Textarea,{rows:6,name:"selectedIntro",placeholder:e.__("Enter blog intro here.","getgenie")}))),React.createElement(dR,null),React.createElement(ds,{className:"getgenie-sidebar-controller-options"}),React.createElement(yn.Button,{htmlType:"submit",type:"primary",className:"submit-btn",loading:s},React.createElement("span",{className:"getgenie-icon-edit"}),e.__("Generate Outline","getgenie"))),React.createElement(yn.TitleMsg,{list:r,loading:s,title:"outline"}),React.createElement("div",{className:"getgenie-card-container getgenie-outline-cards"},r.length===0&&e.generatedOutlines.open&&React.createElement("span",{className:"getgenie-outline-loading-text"},e.__("Selected Outlines will Appear here","getgenie")),React.createElement(nv,{backend:Nw,debugMode:!0},React.createElement(Kw,null)),r.length>1&&o&&React.createElement(aR,{className:"getgenie-outline-cards-alert",message:e.__("You can also Edit, Delete & Rearrange these Selected Outlines","getgenie"),closeText:e.__("Okay","getgenie"),closable:!0}))),React.createElement(cR,{className:"getgenie-one-click-modal",title:React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-icon-alert"}),React.createElement("span",{className:"title"}," ",u?"Content in progress\u2026":"Generate the entire blog with a single click")),visible:c,closeIcon:React.createElement("span",{className:"getgenie-icon-close1"}),closable:!u,maskClosable:!1,zIndex:9999,onOk:R,confirmLoading:u,onCancel:B,okText:"One-click blog",cancelText:"Customized content",cancelButtonProps:{disabled:u},getContainer:()=>e.rootContainer},u?React.createElement(Zw,{progressDot:(I,{status:F})=>F==="process"?React.createElement("span",{className:"ant-steps-icon-dot border-spinner"}):I,current:v,direction:"vertical"},S.map((I,F)=>React.createElement(uR,{key:F,title:I}))):g),React.createElement(yn.DrawerFooter,{handlePrev:M,handleNext:L,nextScreen:!0,enableNextBtn:r.length>0})))},["setSidebar","sidebar","getInputs","setInput"]);Jw.GeneratedOutlines=Lw;Zu=Jw});var Qw,pR,e0,gR,mR,yR,t0,n0=O(()=>{Co();({Libs:Qw}=window.getGenie.Components.Common),{Tooltip:pR,Button:e0}=window.antd,{ComposeComponents:gR}=window.getGenie.Components.Common.ReduxManager,{useEffect:mR}=window.React,yR=gR(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let s=new Qt(window.getGenie.config.isBlockEditor),r=t.generatedParagraphs||{},o=t.selectedOutlines?[...new Set(t.selectedOutlines)]:[];mR(()=>{e({paragraphEditorScreen:{...n.paragraphEditorScreen,currentOutline:o[0],currentOutlineIndex:0}})},[]);let a=()=>{i("writingScreen","outlineScreen"),e({generatedOutlines:{...n.generatedOutlines,open:!0}})},c=()=>{let y=(t.selectedIntro||"").replace(/<br\s*[\/]?>/g,""),g=t.selectedTitle||"";n.currentPostContent?.trim().length>0?Qw.ConfirmModal("This page has some content","Do you want to replace that?",()=>{s.insertContent(g,y,o,r)},()=>{s.appendOutlines(o,r)}):s.insertContent(g,y,o,r)},d=React.createElement(pR,{title:n.__("Insert all paragraphs","getgenie"),placement:"topLeft"},React.createElement(e0,{type:"primary",onClick:c,size:"small",disabled:!1,className:"insertBtn"},n.__("Insert","getgenie"))),u=(y,g)=>{e({paragraphEditorScreen:{...n.paragraphEditorScreen,currentOutline:y,currentOutlineIndex:g}})},f=n.paragraphEditorScreen?.currentOutlineIndex||0;return React.createElement("div",{className:"getgenie-wrapper-screen"},React.createElement("div",{className:"getgenie-paragraph-screen-container"},o.map((y,g)=>React.createElement(e0,{onClick:()=>u(y,g),key:g,className:`paragraph-outline-header ${f===g?"active-outline":""} ${r[o[g]]?.paragraph?"generated-outline":""}`},y))),React.createElement(Qw.DrawerFooter,{nextScreen:!1,insertData:c,insertBtn:d,handlePrev:a}))},["setSidebar","setInput","getInputs","sidebar"]),t0=yR});var bR,Ml,vR,Qu,i0=O(()=>{bR="keyword_research",Ml="keywords_data_store",vR=()=>new Promise((n,e)=>{let t=window.indexedDB.open(bR,2);t.onupgradeneeded=i=>{let s=i.target.result;s.objectStoreNames.contains(Ml)||s.createObjectStore(Ml,{keyPath:"key"})},t.onsuccess=i=>{n(i.target.result)},t.onerror=i=>{e(i.target.error)}}),Qu=async n=>{try{let e=await vR();return new Promise((t,i)=>{let o=e.transaction(Ml,"readonly").objectStore(Ml).get(n);o.onsuccess=a=>{t(a.target.result)},o.onerror=a=>{i(a.target.error)}})}catch(e){console.error("Error getting data:",e)}}});var s0,yH,wR,bH,r0,TH,o0=O(()=>{Ty();Dy();Ju();n0();Hd();i0();({Libs:s0,Utilities:yH}=window.getGenie.Components.Common),{ComposeComponents:wR}=window.getGenie.Components.Common.ReduxManager,{useState:bH,useEffect:r0}=window.React,TH=wR(({setSidebar:n,sidebar:e,setInput:t,getInputs:i})=>{let s=i.generatedTitles||[],r=i.generatedIntros||[],o=i.writingScreen||"titleScreen",a=new URLSearchParams(window.location.search).get("keyword");r0(()=>{o!=="outlineScreen"?n({generatedOutlines:{...e.generatedOutlines,open:!1}}):i.generatedOutlines&&(n({generatedOutlines:{...e.generatedOutlines,open:!0}}),t("seoEnabled",!0)),n({currentScreen:o})},[o]),r0(()=>{if(!a)return;(async()=>{let g=await Qu("searchVolume")||{},p=await Qu("wizardRelatedKeywords")||[];t("keyword",a),t("relatedKeywords",p?.data),t("searchVolume",g?.data)})()},[]);let c=!s.find(y=>y.title===i.selectedTitle),d=!r.find(y=>y.title===i.selectedIntro),u=(i.selectedOutlines||[]).length===0,f=[{label:e.__("Title","getgenie"),key:"titleScreen",children:React.createElement(ky,null)},{label:e.__("Intro","getgenie"),key:"introScreen",children:React.createElement(Oy,null),disabled:c},{label:e.__("Outline","getgenie"),key:"outlineScreen",children:React.createElement(Zu,null),disabled:c||d},{label:e.__("Content","getgenie"),key:"paragraphScreen",children:React.createElement(t0,null),disabled:c||d||u}];return React.createElement(React.Fragment,null,React.createElement(s0.DrawerHeader,{screenName:o}),React.createElement(s0.Navbar,{tabPaneList:f,activeKey:o,destroyInactiveTabPane:!1,handleActiveKey:y=>t("writingScreen",y),className:"getgenie-blog-screen-navbar"}))},["setSidebar","sidebar","setInput","getInputs"])});var a0,xR,_R,SR,eh,CR,l0,c0=O(()=>{({Libs:a0}=window.getGenie.Components.Common),{ComposeComponents:xR}=window.getGenie.Components.Common.ReduxManager,{Select:_R,Input:SR,Form:eh}=window.antd,CR=xR(({getInputs:n,sidebar:e,setInput:t})=>{let i=(n.relatedKeywords||[]).map(g=>g.keyword),s=(n.peopleAlsoSearched||[]).map(g=>g.title),r=n.selectedOutlines?[...new Set(n.selectedOutlines)]:[],o=n.generatedParagraphs||{},a=e.paragraphEditorScreen?.currentOutline||r[0],c=[...i,...s];c=[...new Set(c)];let d=c.map(g=>({label:g,value:g})),u=g=>{let p=n.generatedParagraphs||{};p[a]={...p[a],...g},t("generatedParagraphs",p)},f=g=>{u({paragraphInstruction:g.target.value})},y=g=>{u({headingKeywords:g})};return React.createElement(eh,{layout:"vertical",className:"getgenie-instruction-container"},React.createElement(eh.Item,{label:React.createElement(React.Fragment,null,e.__("Context (Optional)","getgenie"),React.createElement(a0.Tooltip,{title:e.__("Let the genie know the context of this outline","getgenie"),zIndex:999999,placement:"left"})),className:"genie-input paragraph-instruction-textarea"},React.createElement(SR.TextArea,{value:o?.[a]?.paragraphInstruction,placeholder:"Type instruction here.",onChange:f})),React.createElement(eh.Item,{label:React.createElement(React.Fragment,null,e.__("Keywords (Optional)","getgenie"),React.createElement(a0.Tooltip,{title:e.__("Select/Add keywords for better result.","getgenie"),zIndex:999999,placement:"left"}))},React.createElement(_R,{showSearch:!0,suffixIcon:null,onChange:y,value:o?.[a]?.headingKeywords||[],mode:"tags",style:{width:"100%"},placeholder:"Keywords...",options:d,getPopupContainer:()=>e.rootContainer,placement:"bottomLeft"})))},["getInputs","setInput","sidebar"]),l0=CR});var Vr,kR,TR,OR,DR,d0,ER,MR,Pl,PR,NR,RR,u0,AR,LR,MH,h0=O(()=>{c0();({Libs:Vr,Utilities:kR,StaticData:TR}=window.getGenie.Components.Common),{Popover:OR,Tooltip:DR,Form:d0,Input:ER,Alert:MR}=window.antd,{GenieHelpers:Pl}=kR,{ComposeComponents:PR}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:NR,HandleResponse:RR}=window.getGenie.Components.Common.RequestManager,{useState:u0}=window.React,AR=`${window.getGenie.config.assetsUrl}dist/admin/images/empty-content.svg`,LR=`${window.getGenie.config.assetsUrl}dist/admin/images/scroll-down.svg`,MH=PR(({setInput:n,getInputs:e,sidebar:t,setSidebar:i,getTemplateInputs:s,visible:r,width:o})=>{let a=e.selectedOutlines?[...new Set(e.selectedOutlines)]:[],c=e.generatedParagraphs||{},d=t.paragraphEditorScreen?.currentOutline||a[0],u=t.paragraphEditorScreen?.currentOutlineIndex||0,[f,y]=u0(!1),[g,p]=u0(""),v=d;d?.length>30&&(v=d.substring(0,30).concat("..."));let x=(M,N,R,L)=>{let B=L;R=="paragraph"&&(B=L||" "),N[M]={...N[M],[R]:B},n("generatedParagraphs",N),R=="alert"&&L==!1&&Pl.callStoreApi("generatedParagraphs",N)},_=(M,N)=>{let R="expandOutline";x(M,N,"loading",!0);let L={title:wp.data.select("core/editor")?.getCurrentPost()?.title||s?.blogWizard?.selectedTitle||"",keyword:s?.blogWizard?.keyword||"",context:N[M]?.paragraphInstruction||"",instructionKeywords:N[M]?.headingKeywords||"",textContent:M},B={numberOfResult:1,templateSlug:t.currentTemplate,outputSize:e.outputSize,input:L};NR(W=>{x(M,N,"loading",!1),RR(W,()=>{N[M]={paragraph:W.data?.[0],paragraphInstruction:N[M]?.paragraphInstruction||"",headingKeywords:N[M]?.headingKeywords||""},n("generatedParagraphs",N),Pl.callStoreApi("generatedParagraphs",N),x(M,N,"alert",!0)})},R,B)},C=()=>{let M=(t.paragraphEditorScreen?.currentOutlineIndex||0)+1,N=a.find((R,L)=>L===M);i({paragraphEditorScreen:{...t.paragraphEditorScreen,currentOutline:N,currentOutlineIndex:M}})},S=(M,N)=>{M.stopPropagation(),Pl.copyToClipboard(N).then(()=>{p(N)}).catch(()=>console.log("error"))},T=(c?.[d]?.paragraph||"").replace(/(<([^>]+)>)/g,`
`),k=c?.[d]?.paragraph,P=c?.[d]?.loading,D=c?.[d]?.alert;return React.createElement("div",{className:`getgenie-paragraph-editor ${r?"":"d-none"}`,style:{width:`${o}px`}},React.createElement("div",{className:"getgenie-empty-tag"}),React.createElement("h5",{className:"getgenie-generated-outlines-title"},t.__(`${v}`,"getgenie")),React.createElement("div",{className:"getgenie-paragraph-result-container"},React.createElement("div",{className:"paragraph-instruction-keyword-header"},React.createElement("p",{className:"paragraph-instruction-keyword-header-title"},"Instructions or Keywords",React.createElement("span",{className:"option-text"}," (Optional)"),React.createElement("span",{className:"option-title"}," Add instruction or keywords to consider")),React.createElement(OR,{content:React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-icon-close1 popover-close",onClick:()=>y(!1)}),React.createElement(l0,null)),overlayClassName:"instruction-keyword-popover",overlayStyle:{width:"352px",position:"fixed",top:"20%",left:"40%"},placement:"left",trigger:"click",zIndex:9999,visible:f,align:{offset:[-330,50]},destroyTooltipOnHide:!0,onVisibleChange:M=>y(M)},React.createElement("div",{style:{width:"2rem",height:"1rem",visibility:f?"hidden":"visible"}},React.createElement("span",{className:"getgenie-icon-edit1 edit-icon"})))),React.createElement(d0,{layout:"vertical",className:"paragraph-generate-form"},React.createElement("div",{className:"instruction-keyword-selected-label"},React.createElement("label",{htmlFor:"instruction-label"},"Length:",React.createElement(Vr.Tooltip,{title:"Set output length of your paragraph",placement:"top"})),React.createElement(Vr.Select,{name:"outputSize",handleOnChange:M=>Pl.saveSidebarControllerOption("getgenie-outputSize",M),className:"outputSize",options:TR.outputSizes,defaultValue:t.outputSize,disableList:["more"]})),P&&React.createElement(Vr.SkeletonCard,{count:1}),!k&&!P&&React.createElement("div",{className:"paragraph-generate-icon"},React.createElement("img",{src:AR,alt:"empty-content"}),React.createElement("p",{className:"generate-outline-content-text"},"Click the ",React.createElement("span",null,"Generate")," button below to get content for this heading"),React.createElement("img",{src:LR,alt:"scroll-down"})),k&&React.createElement("div",{style:{display:P?"none":"block"}},React.createElement(d0.Item,{className:"genie-input paragraph-generate-textarea"},React.createElement(ER.TextArea,{value:T,placeholder:"Your Text",onChange:M=>x(d,c,"paragraph",M.target.value),autoSize:!0}),React.createElement("div",{className:"copy-generate-paragraph"},React.createElement(DR,{placement:"bottom",zIndex:9999,title:g===T?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:M=>S(M,T)})))),D&&React.createElement(MR,{className:"outline-paragraph-output-alert",message:t.__("Looking for something different?","getgenie"),description:t.__("You can regenerate the content by clicking the button below.","getgenie"),type:"info",showIcon:!0,closable:!0,onClose:()=>x(d,c,"alert",!1)})))),React.createElement("div",{className:`paragraph-generate-btnGrp ${k?"generated-btnGrp":""}`},k&&u!=a.length-1?React.createElement(Vr.Button,{htmlType:"submit",className:"getgenie-continue-btn",type:"primary",onClick:C},"Continue"):"",React.createElement(Vr.Button,{htmlType:"submit",className:"getgenie-generate-btn",onClick:()=>_(d,c),loading:P,type:"primary"},k?"Regenerate":"Generate")))},["setInput","getInputs","sidebar","setSidebar","getTemplateInputs"])});var f0=O(()=>{o0();Ju();h0()});var FH,FR,BR,zR,HR,p0,g0=O(()=>{th();js();({Libs:FH}=window.getGenie.Components.Common),{Row:FR,Col:BR}=window.antd,{ComposeComponents:zR}=window.getGenie.Components.Common.ReduxManager,HR=zR(({sidebar:n})=>{if(!n.analyzedContent?.statistics)return"";let{nlp:e,heading:t,image:i,imgAltText:s,word:r,internalLink:o}=n.analyzedContent?.statistics,a={word:r,heading:t,nlp:e,image:i,imgAltText:s,internalLink:o},c=u=>u>=70?"#14A645":u>=40?"#F5B008":"#F02F54",d=(u,f)=>{let y="#F5B008";return u>=f[0]&&(y="#14A645"),y};return React.createElement("div",{className:"getgenie-statistics-score-details"},React.createElement(FR,{gutter:[0,38]},Object.keys(a).map((u,f)=>React.createElement(BR,{key:f,span:8},React.createElement("div",{className:"getgenie-statistics-score-content"},React.createElement("div",{className:"sc-container"},React.createElement("div",{className:"item"},React.createElement("div",{className:"output"},React.createElement("h6",{className:"title"},a[u]?.title),React.createElement("h5",{className:"value",style:{color:u==="nlp"?c(a[u].count):d(a[u].count,a[u].analyzedRecommendation)}},a[u].count,u==="nlp"?"%":React.createElement("span",{className:"icon"},a[u].analyzedRecommendation&&a[u].count>=a[u].analyzedRecommendation[0]?React.createElement("i",{className:"getgenie-icon-check"}):React.createElement("i",{className:"getgenie-icon-arrow-right"}))))),a[u].analyzedRecommendation&&React.createElement("div",{className:`label ${(u||"").toLowerCase()}`},React.createElement("div",{className:"output"},React.createElement("h6",{className:"title"},n.__("Recommended","getgenie")),React.createElement("span",{className:"value"},u==="nlp"?a[u]?.scoreRecommendation+"%":Jt.joinArray(a[u].analyzedRecommendation))))))))))},["sidebar"]),p0=HR});var WR,jR,VR,m0,y0=O(()=>{({Alert:WR}=window.antd),{ComposeComponents:jR}=window.getGenie.Components.Common.ReduxManager,VR=jR(({sidebar:n})=>{let{feedbacks:e}=n.analyzedContent,t=i=>i==="problems"?"error":i==="results"?"success":"warning";return React.createElement("div",{className:"getgenie-statistics-score-analysis"},React.createElement("div",{className:"getgenie-statistics-score-analysis-heading"},React.createElement("h5",{className:"title"},n.__("Score Analysis","getgenie"))),Object.keys(e).map((i,s)=>e[i].length!==0?React.createElement("div",{key:s,className:`getgenie-statistics-score-analysis-info ${i}`},React.createElement("h5",{className:"title"},i),React.createElement("div",{className:"analyzed-list"},e[i].map((r,o)=>React.createElement(WR,{key:o,description:r,type:t(i),showIcon:!0})))):""))},["sidebar"]),m0=VR});var b0,YR,UH,v0,UR,Yr,w0,$R,Nl,GR,x0,_0=O(()=>{fi();Ma();({Typography:b0,Button:YR,Row:UH,Col:v0}=window.antd),{useEffect:UR,useState:Yr}=window.React,{Libs:w0}=window.getGenie.Components.Common,{memo:$R}=window.React,Nl=wp.data.select("getgenie").sidebar();Ye.register(hn,rs);GR=$R(({totalContentStats:n,competitorStat:e,handleShowAnalysis:t,showAnalysis:i})=>{let s=n?.totalScore||0,r="#F5B008",o="#14A645",a="#F02F54",[c,d]=Yr(0),[u,f]=Yr(0),[y,g]=Yr(0),[p,v]=Yr(0),[x,_]=Yr(0);UR(()=>{_(s),s<=25&&d(s),s>25&&s<=45&&(f(s-25),d(25)),s>45&&s<=65&&(g(s-45),f(20),d(25)),s>65&&(v(s-65),g(20),f(20),d(25))},[s]);let C={labels:["Red","Orange","Green"],datasets:[{label:"# of Votes",data:[c,25-c,u,20-u,y,20-y,p,35-p],backgroundColor:["rgba(201, 62, 39, 1)","#EAECEF","rgba(235, 107, 67, 1)","#EAECEF","rgba(248, 191, 28, 1)","#EAECEF","rgba(46, 204, 113, 1)","#EAECEF"],borderWidth:2}]},S={rotation:270,circumference:180,plugins:{datalabels:{display:!1},legend:{display:!1},tooltip:{enabled:!1}},cutout:"80%"},T={labels:["","Purple",""],datasets:[{data:[x,.2,99.8-x],backgroundColor:["rgba(0,0,0,0)","#000","rgba(0,0,0,0)"],borderColor:["rgba(0, 0, 0 ,0)","#000","rgba(0, 0, 0 ,0)"],borderWidth:2}]},k={rotation:270,circumference:180,plugins:{datalabels:{display:!1},legend:{display:!1},tooltip:{enabled:!1}},cutout:"80%"};function P(M){if(M>69)return o;if(M<70&&M>49)return r;if(M<50)return a}let D=React.createElement("div",{className:"competitor-tooltip"},React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.09033 9.73494V11",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M4.07837 13.0482H10.1025V12.4458C10.1025 11.7831 9.5603 11.241 8.89765 11.241H5.28319C4.62054 11.241 4.07837 11.7831 4.07837 12.4458V13.0482V13.0482Z",stroke:"white",strokeWidth:"1.2",strokeMiterlimit:"10"}),React.createElement("path",{d:"M3.47607 13.0482H10.705",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M6.99983 9.43373C4.6685 9.43373 2.78296 7.54819 2.78296 5.21687V3.40964C2.78296 2.07831 3.86127 1 5.1926 1H8.80705C10.1384 1 11.2167 2.07831 11.2167 3.40964V5.21687C11.2167 7.54819 9.33115 9.43373 6.99983 9.43373Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.06626 6.81325C2.61446 6.66867 2.21687 6.40361 1.90361 6.09036C1.36145 5.48795 1 4.76505 1 3.92168C1 3.07831 1.66265 2.41566 2.50602 2.41566H2.89759C2.77711 2.69277 2.71687 2.99999 2.71687 3.31927V5.1265C2.71687 5.72891 2.84337 6.29517 3.06626 6.81325Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M10.9336 6.81325C11.3854 6.66867 11.783 6.40361 12.0962 6.09036C12.6384 5.48795 12.9999 4.76505 12.9999 3.92168C12.9999 3.07831 12.3372 2.41566 11.4938 2.41566H11.1023C11.2227 2.69277 11.283 2.99999 11.283 3.31927V5.1265C11.283 5.72891 11.1565 6.29517 10.9336 6.81325Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"Competitor's Highest Score: ",React.createElement("span",null,e?.maxScore))),React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"12",height:"18",viewBox:"0 0 12 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.293 10.2072L2.42871 16.7143L6.00014 14.5714L9.57157 16.7143L8.70728 10.2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"Average score from SERP: ",React.createElement("span",null,e?.avgScore))),React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M9.82906 11.1514H4.2143C3.96343 11.1514 3.68269 10.9543 3.59907 10.7153L1.12619 3.79842C0.773769 2.80688 1.18592 2.50225 2.0341 3.11151L4.36363 4.77802C4.75189 5.04681 5.1939 4.90943 5.36115 4.47339L6.41242 1.67198C6.74692 0.776007 7.30242 0.776007 7.63692 1.67198L8.68819 4.47339C8.85544 4.90943 9.29745 5.04681 9.67974 4.77802L11.8659 3.21903C12.7977 2.55003 13.2457 2.8905 12.8634 3.97164L10.4503 10.7273C10.3607 10.9543 10.0799 11.1514 9.82906 11.1514Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.73657 12.9553H10.307",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M5.52832 8.17674H8.51489",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"SERP's #1 Competitor's Score: ",React.createElement("span",null,e?.firstCompetitorScore))));return React.createElement("div",{className:"getgenie-statistics-score-meter"},React.createElement("div",{className:"chart-label"},React.createElement(zd,{data:C,options:S}),React.createElement(zd,{data:T,options:k}),React.createElement("div",{className:"meter-text"},React.createElement(b0.Text,null,s,"/"),React.createElement(b0.Text,null,Nl.__("100","getgenie"))),React.createElement("div",{className:"getgenie-statistics-score-heading"},React.createElement(YR,{onClick:t,type:"link"},i?Nl.__("Hide Analysis","getgenie"):Nl.__("Details Analysis","getgenie")))),React.createElement("div",{className:"side-info"},React.createElement(v0,null,React.createElement("div",{className:"side-info-content"},React.createElement("p",{className:"readability-score"},"Competitor's Best: ",React.createElement("span",{className:"result",style:{color:P(e?.maxScore)}},e?.maxScore)),React.createElement(w0.Tooltip,{className:"getgenie-statistics-score-tooltip",placement:"top",title:D,color:"#031233"}))),React.createElement(v0,null,React.createElement("div",{className:"side-info-content"},React.createElement("p",null,"Readability Score:",React.createElement("span",{className:"result",style:{color:P(n.readabilityScore)}}," "+n.readabilityScore)),React.createElement(w0.Tooltip,{className:"getgenie-statistics-score-tooltip",placement:"top",title:Nl.__(`${n.readabilityTooltipText}`),color:"#031233"})))))}),x0=GR});var KR,qR,XR,ZR,JR,QR,eA,tA,Rl,S0=O(()=>{({ComposeComponents:KR}=window.getGenie.Components.Common.ReduxManager),{Libs:qR,Utilities:XR}=window.getGenie.Components.Common,{GenieHelpers:ZR}=XR,{useState:JR,useEffect:QR}=window.React,{Tooltip:eA}=window.antd,tA=KR(({category:n,keyword:e=[],screenName:t,tooltipText:i="",sidebar:s,setSidebar:r,getInputs:o,setInput:a})=>{let[c,d]=JR(!1),u=o.selectedKeywordList||[],f=o.nlpKeywordList||[],y=o.restStatisticsKeyword||{},g=s.statisticsData,p=g.keywords,v=n==="NLP Keywords";if(QR(()=>{ZR.callStoreApi("serpData",{statisticsData:g,restStatisticsKeyword:y,selectedKeywordList:u,nlpKeywordList:f})},[c]),e.length===0)return"";let x=[];!t||t==="all"?(x=e,v&&(x=[...e,...u])):(x=e.filter(P=>P.foundIn.includes(t)),v&&(x=[...e,...u].filter(P=>P.foundIn.includes(t))));let _=P=>{if(P?.recommendation?.[t]){let D=P.usage[t],M=P.recommendation[t][0],N=P.recommendation[t][1];return D<M?"yellow":D>N?"red":"green"}else return"yellow"},C=P=>{a("nlpKeywordList",[...f,P]);let D=p[P];a("restStatisticsKeyword",{...y,[P]:D});let M=e.find(({keyword:R})=>R===P);a("selectedKeywordList",[...u,M]),delete p[P];let N={...s.statisticsData,keywords:{...p}};r({statisticsData:N}),d(R=>!R)},S=P=>{a("nlpKeywordList",f.filter(N=>N!==P)),a("selectedKeywordList",u.filter(({keyword:N})=>N!==P));let D=y[P],M={...s.statisticsData,keywords:{...p,[P]:D}};delete y[P],r({statisticsData:M}),d(N=>!N)},T=P=>{let D=v?"nlp-keywords":"";return f.includes(P)&&v?`inactive-el ${D}`:`active-el ${D}`},k=P=>{v&&(u.find(({keyword:D})=>D===P)?S(P):C(P))};return React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-container"},["NLP Keywords","Custom Keywords"].includes(n)?React.createElement("h5",{className:"getgenie-statistics-keyword-analysis-category-title"},n,":",React.createElement(qR.Tooltip,{title:s.__(i,"getgenie"),placement:"top"})):"",React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-keywords"},x.map((P,D)=>React.createElement("div",{key:D,className:`getgenie-statistics-keyword-analysis-category-keyword ${_(P)} ${T(P.keyword)} `},React.createElement("div",{className:`getgenie-statistics-keyword-analysis-category-keyword-title ${_(P)}`},P.keyword),React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-keyword-usage"},typeof P?.usage=="object"?P?.usage[t]:P?.usage,P?.recommendation?.[t]&&" / "+P.recommendation[t][0]+" - "+P?.recommendation?.[t][1]),v&&React.createElement("div",{onClick:()=>k(P.keyword),className:"select-deselect-btn"},React.createElement(eA,{placement:"top",zIndex:9999,title:"Select/Deselect this keyword from analysis."},React.createElement("span",{className:`select-deselect-common ${u.find(({keyword:M})=>M===P.keyword)?"getgenie-icon-plus add":" getgenie-icon-minus remove"}`})))))))},["sidebar","setSidebar","getInputs","setInput"]),Rl=tA});var C0,nh,nA,iA,Ur,ih=O(()=>{S0();({useState:C0,useEffect:nh}=window.React),{ComposeComponents:nA}=window.getGenie.Components.Common.ReduxManager,iA=nA(({sidebar:n,getInputs:e,screenName:t="AllKeyword"})=>{let[i,s]=C0({}),[r,o]=C0([]),a={nlp:"The AI-filtered NLP keyword suggestions for further optimization.",custom:"The keywords you inputted or selected manually for adding to your content."},c;n.analyzedContent.statistics.keywords?.focus?n.analyzedContent.statistics.keywords?.common?c={...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus,...n.analyzedContent.statistics.keywords.common]}:c={...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus]}:c=n.analyzedContent.statistics.keywords;let d={common:"Common Keywords",nlp:"NLP Keywords",focus:"Focus Keywords"};return nh(()=>{n.analyzedContent.statistics.keywords?.focus?n.analyzedContent.statistics.keywords?.common?s({...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.common,...n.analyzedContent.statistics.keywords.focus]}):s({...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus]}):s(n.analyzedContent.statistics.keywords)},[n.analyzedContent.statistics.keywords]),nh(()=>{if(n.contentScoreSearchKeyword!==""){let u={};for(let[f,y]of Object.entries(c))u[f]=y.filter(g=>g.keyword.toLowerCase().includes(n.contentScoreSearchKeyword.toLowerCase()));s(u),o(e.customKeywords.filter(f=>f.keyword.toLowerCase().includes(n.contentScoreSearchKeyword.toLowerCase())))}else s(c),o(e.customKeywords)},[n.contentScoreSearchKeyword]),nh(()=>{o(e.customKeywords||[])},[e.customKeywords]),React.createElement("div",{className:"getgenie-statistics-keyword-analysis"},["metaTitle","metaDescription"].includes(t)?React.createElement(Rl,{category:d.focus,keyword:i.focus,screenName:t}):React.createElement(React.Fragment,null,Object.keys(d).map((u,f)=>{if(u!=="focus")return React.createElement(Rl,{key:f,category:d[u],keyword:i[u],screenName:t,tooltipText:a[u]})}),React.createElement(Rl,{category:"Custom Keywords",keyword:r,tooltipText:a.custom})))},["sidebar","setSidebar","getInputs"]),Ur=iA});var sA,rA,k0,T0=O(()=>{ih();({ComposeComponents:sA}=window.getGenie.Components.Common.ReduxManager),rA=sA(({sidebar:n,setSidebar:e})=>React.createElement("div",{className:"getgenie-statistics-keyword-analysis-meta-keyword"},React.createElement("h4",{className:"getgenie-statistics-keyword-analysis-meta-title"},"Meta Title:"),React.createElement(Ur,{screenName:"metaTitle"}),React.createElement("h4",{className:"getgenie-statistics-keyword-analysis-meta-description"},"Meta Description:"),React.createElement(Ur,{screenName:"metaDescription"})),["sidebar","setSidebar"]),k0=rA});var oA,aA,lA,sh,cA,dA,uA,hA,fA,O0,D0=O(()=>{Zt();({ComposeComponents:oA}=window.getGenie.Components.Common.ReduxManager),{Utilities:aA}=window.getGenie.Components.Common,{GenieHelpers:lA}=aA,{useState:sh,useEffect:cA}=window.React,{Button:dA,Input:uA}=window.antd,hA=new Ee,fA=oA(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let[s,r]=sh(!1),[o,a]=sh(""),[c,d]=sh(!1),u=g=>{e({...n,contentScoreSearchKeyword:g.target.value})},f=()=>{d(!1),e({...n,contentScoreSearchKeyword:""})},y=g=>{if(g.type==="keyup"&&(g.key!=="Shift"&&g.key==="Enter"||g?.which===13)){a("");let p=t.customKeywords||[],v=hA.findSingleMatch(n.currentPostContent,o),x=[...p,{keyword:o,usage:v}];i("customKeywords",x),r(!1)}};return cA(()=>{lA.storeData("customKeywords")},[t.customKeywords]),React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-custom-button"},React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-custom-button-container"},!c&&React.createElement(dA,{className:"add-outline-btn",onMouseDown:g=>{g.preventDefault(),r(!s)}},n.__("Add Custom Keyword","getgenie")),c&&React.createElement(uA,{bordered:!1,className:"getgenie-input-search-bar",placeholder:n.__("Search...","getgenie"),autoFocus:!0,onBlur:f,onChange:g=>u(g),prefix:React.createElement("span",{className:"getgenie-icon-search"})}),!c&&React.createElement("div",{onClick:()=>{d(!0)},className:"getgenie-search-icon"},React.createElement("span",{className:"getgenie-icon-search"}))),s&&React.createElement(React.Fragment,null,React.createElement("textarea",{autoFocus:!0,onChange:g=>{a(g.target.value.replace(`
`,""))},onBlur:()=>r(!1),className:"getgenie-outline-cards-input",value:o,style:{display:"block",marginTop:"4px"},placeholder:n.__("Please enter your custom keyword","getgenie"),onKeyUp:g=>y(g)})))},["sidebar","setSidebar","setInput","getInputs"]),O0=fA});var pA,e8,gA,mA,E0,yA,M0,P0=O(()=>{g0();y0();_0();ih();T0();D0();({Button:pA}=window.antd),{Libs:e8}=window.getGenie.Components.Common,{ComposeComponents:gA}=window.getGenie.Components.Common.ReduxManager,{useEffect:mA,useState:E0}=window.React,yA=gA(({setSidebar:n,sidebar:e})=>{let[t,i]=E0({currentScreen:"all",activeIndex:0}),{contentStats:s}=e?.analyzedContent,{competitorStats:r}=e,[o,a]=E0(!1),{imageUrl:c}=e;mA(()=>{n({analyzeKeyword:{...e.analyzeKeyword,open:!1},generatedOutlines:{...e.generatedOutlines,open:!1}})},[]);let d=()=>{a(!o)},u=[{keywordName:"All",screen:"all"},{keywordName:"Heading",screen:"heading"},{keywordName:"Content",screen:"content"},{keywordName:"Meta",screen:"meta"}],f=(y,g)=>{i({currentScreen:y,activeIndex:g})};return React.createElement("div",{className:"getgenie-statistics"},React.createElement("div",{className:"getgenie-statistics-container"},React.createElement("div",{className:"getgenie-statistics-container-data"},React.createElement("div",{className:"getgenie-statistics-score"},React.createElement(x0,{imageUrl:c,totalContentStats:s,handleShowAnalysis:d,showAnalysis:o,competitorStat:r}),!o&&React.createElement("div",{className:"getgenie-statistics-score-detail-container"},React.createElement(p0,null),React.createElement(O0,null),React.createElement("div",{className:"keyword-tab-container"},u.map((y,g)=>React.createElement(pA,{key:g,onClick:()=>f(y.screen,g),className:`keyword-btn-tab ${t.activeIndex===g?"active-keyword-tab":"in-active-keyword-tab"}`},y.keywordName))),React.createElement("h6",{className:"help-text-statistics-keyword"},"Used / Average - Highest"),t.currentScreen!=="meta"?React.createElement(Ur,{screenName:t.currentScreen}):React.createElement(k0,null)),o&&React.createElement(m0,null)))))},["setSidebar","sidebar"]),M0=yA});function ch(n,e,t){return(N0.modes[t.mode]||N0.modes.nearest)(n,e,t)}function bA(n,e,t){return t!=="x"&&t!=="y"?n.inRange(e.x,e.y,"x",!0)||n.inRange(e.x,e.y,"y",!0):n.inRange(e.x,e.y,t,!0)}function vA(n,e,t){return t==="x"?{x:n.x,y:e.y}:t==="y"?{x:e.x,y:n.y}:e}function Ll(n,e,t){return n.visibleElements.filter(i=>t.intersect?i.inRange(e.x,e.y):bA(i,e,t.axis))}function wA(n,e,t){let i=Number.POSITIVE_INFINITY;return Ll(n,e,t).reduce((s,r)=>{let o=r.getCenterPoint(),a=vA(e,o,t.axis),c=Cn(e,a);return c<i?(s=[r],i=c):c===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function xA(n,e,t){e.listened=!1,e.moveListened=!1,e._getElements=ch,dh.forEach(i=>{typeof t[i]=="function"?(e.listened=!0,e.listeners[i]=t[i]):De(e.listeners[i])&&delete e.listeners[i]}),oh.forEach(i=>{typeof t[i]=="function"&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(i=>{!e.listened&&typeof i.click=="function"&&(e.listened=!0),e.moveListened||oh.forEach(s=>{typeof i[s]=="function"&&(e.listened=!0,e.moveListened=!0)})})}function _A(n,e,t){if(n.listened)switch(e.type){case"mousemove":case"mouseout":return SA(n,e,t);case"click":return CA(n,e,t)}}function SA(n,e,t){if(!n.moveListened)return;let i;e.type==="mousemove"?i=ch(n,e,t.interaction):i=[];let s=n.hovered;n.hovered=i;let r={state:n,event:e},o=R0(r,"leave",s,i);return R0(r,"enter",i,s)||o}function R0({state:n,event:e},t,i,s){let r;for(let o of i)s.indexOf(o)<0&&(r=G0(o.options[t]||n.listeners[t],o,e)||r);return r}function CA(n,e,t){let i=n.listeners,s=ch(n,e,t.interaction),r;for(let o of s)r=G0(o.options.click||i.click,o,e)||r;return r}function G0(n,e,t){return le(n,[e.$context,t])===!0}function TA(n,e,t){for(let i of Object.keys(n))n[i]=uh(n[i],e,t);return n}function OA(n,e,t,i){if(!n||!e||t<=0)return!1;let s=i/2;return Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)<=Math.pow(t+s,2)}function K0(n,{x:e,y:t,x2:i,y2:s},r,o){let a=o/2,c=n.x>=e-a-Ci&&n.x<=i+a+Ci,d=n.y>=t-a-Ci&&n.y<=s+a+Ci;return r==="x"?c:(r==="y"||c)&&d}function xs(n,e){let{centerX:t,centerY:i}=n.getProps(["centerX","centerY"],e);return{x:t,y:i}}function DA(n,e,t,i=!0){let s=t.split("."),r=0;for(let o of e.split(".")){let a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(kA(a,o)){if(i)throw new Error(`${n} v${t} is not supported. v${e} or newer is required.`);return!1}}return!0}function hh(n,e){return e==="start"?0:e==="end"?n:q0(e)?X0(e)*n:n/2}function ys(n,e){return typeof e=="number"?e:q0(e)?X0(e)*n:n}function EA(n,e){let{x:t,width:i}=n,s=e.textAlign;return s==="center"?t+i/2:s==="end"||s==="right"?t+i:t}function Z0(n){return Q(n)?{x:J(n.x,"center"),y:J(n.y,"center")}:(n=J(n,"center"),{x:n,y:n})}function J0(n){return n&&(De(n.xValue)||De(n.yValue))}function fh(n){if(n&&typeof n=="object"){let e=n.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function ph(n,{x:e,y:t},i){i&&(n.translate(e,t),n.rotate(Me(i)),n.translate(-e,-t))}function Di(n,e){if(e&&e.borderWidth)return n.lineCap=e.borderCapStyle,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.lineJoin=e.borderJoinStyle,n.lineWidth=e.borderWidth,n.strokeStyle=e.borderColor,!0}function _s(n,e){n.shadowColor=e.backgroundShadowColor,n.shadowBlur=e.shadowBlur,n.shadowOffsetX=e.shadowOffsetX,n.shadowOffsetY=e.shadowOffsetY}function gh(n,e){let t=e.content;if(fh(t))return{width:ys(t.width,e.width),height:ys(t.height,e.height)};let i=we(e.font),s=e.textStrokeWidth,r=he(t)?t:[t],o=r.join()+i.string+s+(n._measureText?"-spriting":"");if(!rh.has(o)){n.save(),n.font=i.string;let a=r.length,c=0;for(let u=0;u<a;u++){let f=r[u];c=Math.max(c,n.measureText(f).width+s)}n.restore();let d=a*i.lineHeight+s;rh.set(o,{width:c,height:d})}return rh.get(o)}function Q0(n,e,t){let{x:i,y:s,width:r,height:o}=e;n.save(),_s(n,t);let a=Di(n,t);n.fillStyle=t.backgroundColor,n.beginPath(),on(n,{x:i,y:s,w:r,h:o,radius:TA(Et(t.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=t.borderShadowColor,n.stroke()),n.restore()}function MA(n,e,t){let i=t.content;if(fh(i)){n.drawImage(i,e.x,e.y,e.width,e.height);return}let s=he(i)?i:[i],r=we(t.font),o=r.lineHeight,a=EA(e,t),c=e.y+o/2+t.textStrokeWidth/2;n.save(),n.font=r.string,n.textBaseline="middle",n.textAlign=t.textAlign,PA(n,t)&&s.forEach((d,u)=>n.strokeText(d,a,c+u*o)),n.fillStyle=t.color,s.forEach((d,u)=>n.fillText(d,a,c+u*o)),n.restore()}function PA(n,e){if(e.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=e.textStrokeWidth,n.strokeStyle=e.textStrokeColor,!0}function bs(n,e,t){return e=typeof e=="number"?e:n.parse(e),Pe(e)?n.getPixelForValue(e):t}function Vn(n,e,t){let i=e[t];if(i||t==="scaleID")return i;let s=t.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function ex(n,e){if(n){let t=n.options.reverse,i=bs(n,e.min,t?e.end:e.start),s=bs(n,e.max,t?e.start:e.end);return{start:i,end:s}}}function tx(n,e){let{chartArea:t,scales:i}=n,s=i[Vn(i,e,"xScaleID")],r=i[Vn(i,e,"yScaleID")],o=t.width/2,a=t.height/2;return s&&(o=bs(s,e.xValue,s.left+s.width/2)),r&&(a=bs(r,e.yValue,r.top+r.height/2)),{x:o,y:a}}function mh(n,e){let t=n.scales,i=t[Vn(t,e,"xScaleID")],s=t[Vn(t,e,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:c}=s||n.chartArea,d=A0(i,{min:e.xMin,max:e.xMax,start:r,end:o});r=d.start,o=d.end;let u=A0(s,{min:e.yMin,max:e.yMax,start:c,end:a});return a=u.start,c=u.end,{x:r,y:a,x2:o,y2:c,width:o-r,height:c-a,centerX:r+(o-r)/2,centerY:a+(c-a)/2}}function nx(n,e){if(!J0(e)){let t=mh(n,e),i=e.radius;(!i||isNaN(i))&&(i=Math.min(t.width,t.height)/2,e.radius=i);let s=i*2;return{x:t.x+e.xAdjust,y:t.y+e.yAdjust,x2:t.x+s+e.xAdjust,y2:t.y+s+e.yAdjust,centerX:t.centerX+e.xAdjust,centerY:t.centerY+e.yAdjust,width:s,height:s}}return NA(n,e)}function ix(n,e){let t=mh(n,e),{x:i,y:s}=t;return t.elements=[{type:"label",optionScope:"label",properties:LA(n,t,e)}],t.initProperties={x:i,y:s},t}function NA(n,e){let t=tx(n,e),i=e.radius*2;return{x:t.x-e.radius+e.xAdjust,y:t.y-e.radius+e.yAdjust,x2:t.x+e.radius+e.xAdjust,y2:t.y+e.radius+e.yAdjust,centerX:t.x+e.xAdjust,centerY:t.y+e.yAdjust,width:i,height:i}}function A0(n,e){let t=ex(n,e)||e;return{start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)}}function RA({properties:n,options:e},t,i,s){let{x:r,x2:o,width:a}=n;return sx({start:r,end:o,size:a,borderWidth:e.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:e.label.xAdjust,size:t.width})}function AA({properties:n,options:e},t,i,s){let{y:r,y2:o,height:a}=n;return sx({start:r,end:o,size:a,borderWidth:e.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:e.label.yAdjust,size:t.height})}function sx(n,e){let{start:t,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:c}=e,d=i-s-t-o-a-e.size;return t+s/2+c+hh(d,r)}function LA(n,e,t){let i=t.label;i.backgroundColor="transparent",i.callout.display=!1;let s=Z0(i.position),r=ke(i.padding),o=gh(n.ctx,i),a=RA({properties:e,options:t},o,s,r),c=AA({properties:e,options:t},o,s,r),d=o.width+r.width,u=o.height+r.height;return{x:a,y:c,x2:a+d,y2:c+u,width:d,height:u,centerX:a+d/2,centerY:c+u/2,rotation:i.rotation}}function Ss(n,e,t){let i=Math.cos(t),s=Math.sin(t),r=e.x,o=e.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}function IA(n,e,t){let i=WA(n.scales,e,t),s=L0(e,i,"min","suggestedMin");s=L0(e,i,"max","suggestedMax")||s,s&&typeof e.handleTickRangeOptions=="function"&&e.handleTickRangeOptions()}function FA(n,e){for(let t of n)zA(t,e)}function L0(n,e,t,i){if(Pe(e[t])&&!BA(n.options,t,i)){let s=n[t]!==e[t];return n[t]=e[t],s}}function BA(n,e,t){return De(n[e])||De(n[t])}function zA(n,e){for(let t of["scaleID","xScaleID","yScaleID"]){let i=Vn(e,n,t);i&&!e[i]&&HA(n,t)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function HA(n,e){if(e==="scaleID")return!0;let t=e.charAt(0);for(let i of["Min","Max","Value"])if(De(n[t+i]))return!0;return!1}function WA(n,e,t){let i=e.axis,s=e.id,r=i+"ScaleID",o={min:J(e.min,Number.NEGATIVE_INFINITY),max:J(e.max,Number.POSITIVE_INFINITY)};for(let a of t)a.scaleID===s?I0(a,e,["value","endValue"],o):Vn(n,a,r)===s&&I0(a,e,[i+"Min",i+"Max",i+"Value"],o);return o}function I0(n,e,t,i){for(let s of t){let r=n[s];if(De(r)){let o=e.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}function jA(n,e,t,i){let s=e.width+i.width+t.borderWidth,r=e.height+i.height+t.borderWidth,o=Z0(t.position),a=F0(n.x,s,t.xAdjust,o.x),c=F0(n.y,r,t.yAdjust,o.y);return{x:a,y:c,x2:a+s,y2:c+r,width:s,height:r,centerX:a+s/2,centerY:c+r/2}}function F0(n,e,t=0,i){return n-hh(e,i)+t}function VA(n,e){let{pointX:t,pointY:i,options:s}=e,r=s.callout,o=r&&r.display&&KA(e,r);if(!o||ZA(e,r,o))return;if(n.save(),n.beginPath(),!Di(n,r))return n.restore();let{separatorStart:c,separatorEnd:d}=YA(e,o),{sideStart:u,sideEnd:f}=$A(e,o,c);(r.margin>0||s.borderWidth===0)&&(n.moveTo(c.x,c.y),n.lineTo(d.x,d.y)),n.moveTo(u.x,u.y),n.lineTo(f.x,f.y);let y=Ss({x:t,y:i},e.getCenterPoint(),Me(-e.rotation));n.lineTo(y.x,y.y),n.stroke(),n.restore()}function YA(n,e){let{x:t,y:i,x2:s,y2:r}=n,o=UA(n,e),a,c;return e==="left"||e==="right"?(a={x:t+o,y:i},c={x:a.x,y:r}):(a={x:t,y:i+o},c={x:s,y:a.y}),{separatorStart:a,separatorEnd:c}}function UA(n,e){let{width:t,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return e==="right"?t+r:e==="bottom"?i+r:-r}function $A(n,e,t){let{y:i,width:s,height:r,options:o}=n,a=o.callout.start,c=GA(e,o.callout),d,u;return e==="left"||e==="right"?(d={x:t.x,y:i+ys(r,a)},u={x:d.x+c,y:d.y}):(d={x:t.x+ys(s,a),y:t.y},u={x:d.x,y:d.y+c}),{sideStart:d,sideEnd:u}}function GA(n,e){let t=e.side;return n==="left"||n==="top"?-t:t}function KA(n,e){let t=e.position;return rx.includes(t)?t:qA(n,e)}function qA(n,e){let{x:t,y:i,x2:s,y2:r,width:o,height:a,pointX:c,pointY:d,centerX:u,centerY:f,rotation:y}=n,g={x:u,y:f},p=e.start,v=ys(o,p),x=ys(a,p),_=[t,t+v,t+v,s],C=[i+x,r,i,r],S=[];for(let T=0;T<4;T++){let k=Ss({x:_[T],y:C[T]},g,Me(y));S.push({position:rx[T],distance:Cn(k,{x:c,y:d})})}return S.sort((T,k)=>T.distance-k.distance)[0].position}function XA({x:n,y:e,width:t,height:i,options:s}){let r=s.borderWidth/2,o=ke(s.padding);return{x:n+o.left+r,y:e+o.top+r,width:t-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}function ZA(n,e,t){let{pointX:i,pointY:s}=n,r=e.margin,o=i,a=s;return t==="left"?o+=r:t==="right"?o-=r:t==="top"?a+=r:t==="bottom"&&(a-=r),n.inRange(o,a)}function QA({x:n,y:e,x2:t,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&t<a||n>r&&t>r||e<s&&i<s||e>o&&i>o)}function H0({x:n,y:e},t,{top:i,right:s,bottom:r,left:o}){return n<o&&(e=B0(o,{x:n,y:e},t),n=o),n>s&&(e=B0(s,{x:n,y:e},t),n=s),e<i&&(n=ah(i,{x:n,y:e},t),e=i),e>r&&(n=ah(r,{x:n,y:e},t),e=r),{x:n,y:e}}function eL(n,e,t){let{x:i,y:s}=H0(n,e,t),{x:r,y:o}=H0(e,n,t);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function tL(n,{mouseX:e,mouseY:t},i=Ci,s){let{x:r,y:o,x2:a,y2:c}=n.getProps(["x","y","x2","y2"],s),d=a-r,u=c-o,f=$r(d)+$r(u),y=f===0?-1:((e-r)*d+(t-o)*u)/f,g,p;return y<0?(g=r,p=o):y>1?(g=a,p=c):(g=r+y*d,p=o+y*u),$r(e-g)+$r(t-p)<=i}function W0(n,{mouseX:e,mouseY:t},i,s){let r=n.label;return r.options.display&&r.inRange(e,t,s,i)}function j0(n,e,t){let i=ex(e,t);n[t.startProp]=i.start,n[t.endProp]=i.end}function nL(n,e,t){let i=t.borderWidth,s=ke(t.padding),r=gh(n.ctx,t),o=r.width+s.width+i,a=r.height+s.height+i;return sL(e,t,{width:o,height:a,padding:s},n.chartArea)}function iL(n){let{x:e,y:t,x2:i,y2:s}=n,r=Math.atan2(s-t,i-e);return r>ae/2?r-ae:r<ae/-2?r+ae:r}function sL(n,e,t,i){let{width:s,height:r,padding:o}=t,{xAdjust:a,yAdjust:c}=e,d={x:n.x,y:n.y},u={x:n.x2,y:n.y2},f=e.rotation==="auto"?iL(n):Me(e.rotation),y=rL(s,r,f),g=oL(n,e,{labelSize:y,padding:o},i),p=yh(d,u,g),v={size:y.w,min:i.left,max:i.right,padding:o.left},x={size:y.h,min:i.top,max:i.bottom,padding:o.top},_=Y0(p.x,v)+a,C=Y0(p.y,x)+c;return{x:_-s/2,y:C-r/2,x2:_+s/2,y2:C+r/2,centerX:_,centerY:C,pointX:p.x,pointY:p.y,width:s,height:r,rotation:si(f)}}function rL(n,e,t){let i=Math.cos(t),s=Math.sin(t);return{w:Math.abs(n*i)+Math.abs(e*s),h:Math.abs(n*s)+Math.abs(e*i)}}function oL(n,e,t,i){let s,r=aL(n,i);return e.position==="start"?s=V0({w:n.x2-n.x,h:n.y2-n.y},t,e,r):e.position==="end"?s=1-V0({w:n.x-n.x2,h:n.y-n.y2},t,e,r):s=hh(1,e.position),s}function V0(n,e,t,i){let{labelSize:s,padding:r}=e,o=n.w*i.dx,a=n.h*i.dy,c=o>0&&(s.w/2+r.left-i.x)/o,d=a>0&&(s.h/2+r.top-i.y)/a;return uh(Math.max(c,d),0,.25)}function aL(n,e){let{x:t,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-e.top,a=Math.min(t,i)-e.left,c=e.bottom-Math.max(s,r),d=e.right-Math.max(t,i);return{x:Math.min(a,d),y:Math.min(o,c),dx:a<=d?1:-1,dy:o<=c?1:-1}}function Y0(n,e){let{size:t,min:i,max:s,padding:r}=e,o=t/2;return t>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function lL(n){let e=n.options,t=e.arrowHeads&&e.arrowHeads.start,i=e.arrowHeads&&e.arrowHeads.end;return{startOpts:t,endOpts:i,startAdjust:U0(n,t),endAdjust:U0(n,i)}}function U0(n,e){if(!e||!e.display)return 0;let{length:t,width:i}=e,s=n.options.borderWidth/2,r={x:t,y:i+s};return Math.abs(ah(0,r,{x:0,y:s}))}function $0(n,e,t,i){if(!i||!i.display)return;let{length:s,width:r,fill:o,backgroundColor:a,borderColor:c}=i,d=Math.abs(e-s)+t;n.beginPath(),_s(n,i),Di(n,i),n.moveTo(d,-r),n.lineTo(e+t,0),n.lineTo(d,r),o===!0?(n.fillStyle=a||c,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function cL(n,e,t,i){let{width:s,height:r,centerX:o,centerY:a}=e,c=s/2,d=r/2;if(c<=0||d<=0)return!1;let u=Me(t||0),f=i/2||0,y=Math.cos(u),g=Math.sin(u),p=Math.pow(y*(n.x-o)+g*(n.y-a),2),v=Math.pow(g*(n.x-o)-y*(n.y-a),2);return p/Math.pow(c+f,2)+v/Math.pow(d+f,2)<=1.0001}function dL({centerX:n,centerY:e},{radius:t,borderWidth:i},s){let r=i/2,o=Math.sin(s),a=Math.cos(s),c={x:n+o*t,y:e-a*t};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(t+r),bY:e-a*(t+r)}}}function uL(n,e,t,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(let o of n){let a=o.getProps(["bX","bY"],i);a.bY>t!=r.bY>t&&e<(r.bX-a.bX)*(t-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}function bh(n="line"){return jn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function fL(n,e,t,i){let s=gL(n,t.animations,i),r=e.annotations,o=bL(e.elements,r);for(let a=0;a<r.length;a++){let c=r[a],d=ox(o,a,c.type),u=c.setContext(yL(n,d,c)),f=d.resolveElementProperties(n,u);f.skip=pL(f),"elements"in f&&(mL(d,f,u,s),delete f.elements),De(d.x)||Object.assign(d,f),f.options=ax(u),s.update(d,f)}}function pL(n){return isNaN(n.x)||isNaN(n.y)}function gL(n,e,t){return t==="reset"||t==="none"||t==="resize"?hL:new qi(n,e)}function mL(n,{elements:e,initProperties:t},i,s){let r=n.elements||(n.elements=[]);r.length=e.length;for(let o=0;o<e.length;o++){let a=e[o],c=a.properties,d=ox(r,o,a.type,t),u=i[a.optionScope].override(a);c.options=ax(u),s.update(d,c)}}function ox(n,e,t,i){let s=jn[bh(t)],r=n[e];return(!r||!(r instanceof s))&&(r=n[e]=new s,Q(i)&&Object.assign(r,i)),r}function ax(n){let e=jn[bh(n.type)],t={};t.id=n.id,t.type=n.type,t.drawTime=n.drawTime,Object.assign(t,lh(n,e.defaults),lh(n,e.defaultRoutes));for(let i of dh)t[i]=n[i];return t}function lh(n,e){let t={};for(let i of Object.keys(e)){let s=e[i],r=n[i];t[i]=Q(s)?lh(r,s):r}return t}function yL(n,e,t){return e.$context||(e.$context=Object.assign(Object.create(n.getContext()),{element:e,id:t.id,type:"annotation"}))}function bL(n,e){let t=e.length,i=n.length;if(i<t){let s=t-i;n.splice(i,0,...new Array(s))}else i>t&&n.splice(t,i-t);return n}function Al(n,e,t){let{ctx:i,chartArea:s}=n,{visibleElements:r}=Wn.get(n);t&&ai(i,s);let o=wL(r,e).sort((a,c)=>a.options.z-c.options.z);for(let a of o)a.draw(n.ctx,s);t&&li(i)}function wL(n,e){let t=[];for(let i of n)if(i.options.drawTime===e&&t.push(i),i.elements&&i.elements.length)for(let s of i.elements)s.options.display&&s.options.drawTime===e&&t.push(s);return t}var N0,oh,dh,kA,Ci,uh,q0,X0,rh,Yn,rx,ki,yh,ah,B0,$r,JA,Ti,z0,Oi,vs,ws,jn,hL,vL,Wn,lx,cx=O(()=>{fi();Ld();N0={modes:{point(n,e){return Ll(n,e,{intersect:!0})},nearest(n,e,t){return wA(n,e,t)},x(n,e,t){return Ll(n,e,{intersect:t.intersect,axis:"x"})},y(n,e,t){return Ll(n,e,{intersect:t.intersect,axis:"y"})}}};oh=["enter","leave"],dh=oh.concat("click");kA=(n,e)=>e>n||n.length>e.length&&n.slice(0,e.length)===e,Ci=.001,uh=(n,e,t)=>Math.min(t,Math.max(e,n));q0=n=>typeof n=="string"&&n.endsWith("%"),X0=n=>uh(parseFloat(n)/100,0,1);rh=new Map;Yn=class extends Ae{inRange(e,t,i,s){let{x:r,y:o}=Ss({x:e,y:t},this.getCenterPoint(s),Me(-this.options.rotation));return K0({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(e){return xs(this,e)}draw(e){e.save(),ph(e,this.getCenterPoint(),this.options.rotation),Q0(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){return ix(e,t)}};Yn.id="boxAnnotation";Yn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Yn.defaultRoutes={borderColor:"color",backgroundColor:"color"};Yn.descriptors={label:{_fallback:!0}};rx=["left","bottom","top","right"],ki=class extends Ae{inRange(e,t,i,s){let{x:r,y:o}=Ss({x:e,y:t},this.getCenterPoint(s),Me(-this.rotation));return K0({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(e){return xs(this,e)}draw(e){let t=this.options,i=!De(this._visible)||this._visible;!t.display||!t.content||!i||(e.save(),ph(e,this.getCenterPoint(),this.rotation),VA(e,this),Q0(e,this,t),MA(e,XA(this),t),e.restore())}resolveElementProperties(e,t){let i;if(J0(t))i=tx(e,t);else{let{centerX:a,centerY:c}=mh(e,t);i={x:a,y:c}}let s=ke(t.padding),r=gh(e.ctx,t),o=jA(i,r,t,s);return{pointX:i.x,pointY:i.y,...o,rotation:t.rotation}}};ki.id="labelAnnotation";ki.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ki.defaultRoutes={borderColor:"color"};yh=(n,e,t)=>({x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}),ah=(n,e,t)=>yh(e,t,Math.abs((n-e.y)/(t.y-e.y))).x,B0=(n,e,t)=>yh(e,t,Math.abs((n-e.x)/(t.x-e.x))).y,$r=n=>n*n,JA=(n,e,{x:t,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:e}:{start:Math.min(t,s),end:Math.max(t,s),value:n},Ti=class extends Ae{inRange(e,t,i,s){let r=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){let a=$r(r),c={mouseX:e,mouseY:t};return tL(this,c,a,s)||W0(this,c,s)}let o=JA(e,t,this.getProps(["x","y","x2","y2"],s),i);return o.value>=o.start-r&&o.value<=o.end+r||W0(this,{mouseX:e,mouseY:t},s,i)}getCenterPoint(e){return xs(this,e)}draw(e){let{x:t,y:i,x2:s,y2:r,options:o}=this;if(e.save(),!Di(e,o))return e.restore();_s(e,o);let a=Math.atan2(r-i,s-t),c=Math.sqrt(Math.pow(s-t,2)+Math.pow(r-i,2)),{startOpts:d,endOpts:u,startAdjust:f,endAdjust:y}=lL(this);e.translate(t,i),e.rotate(a),e.beginPath(),e.moveTo(0+f,0),e.lineTo(c-y,0),e.shadowColor=o.borderShadowColor,e.stroke(),$0(e,0,f,d),$0(e,c,-y,u),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){let{scales:i,chartArea:s}=e,r=i[t.scaleID],o={x:s.left,y:s.top,x2:s.right,y2:s.bottom},a,c;if(r)a=bs(r,t.value,NaN),c=bs(r,t.endValue,a),r.isHorizontal()?(o.x=a,o.x2=c):(o.y=a,o.y2=c);else{let x=i[Vn(i,t,"xScaleID")],_=i[Vn(i,t,"yScaleID")];x&&j0(o,x,{min:t.xMin,max:t.xMax,start:x.left,end:x.right,startProp:"x",endProp:"x2"}),_&&j0(o,_,{min:t.yMin,max:t.yMax,start:_.bottom,end:_.top,startProp:"y",endProp:"y2"})}let{x:d,y:u,x2:f,y2:y}=o,g=QA(o,e.chartArea),p=g?eL({x:d,y:u},{x:f,y},e.chartArea):{x:d,y:u,x2:f,y2:y,width:Math.abs(f-d),height:Math.abs(y-u)};p.centerX=(f+d)/2,p.centerY=(y+u)/2;let v=nL(e,p,t.label);return v._visible=g,p.elements=[{type:"label",optionScope:"label",properties:v}],p}};Ti.id="lineAnnotation";z0={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ti.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},z0),fill:!1,length:12,start:Object.assign({},z0),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,display:!0,endValue:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ki.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ti.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};Ti.defaultRoutes={borderColor:"color"};Oi=class extends Ae{inRange(e,t,i,s){let r=this.options.rotation,o=this.options.borderWidth;if(i!=="x"&&i!=="y")return cL({x:e,y:t},this.getProps(["width","height","centerX","centerY"],s),r,o);let{x:a,y:c,x2:d,y2:u}=this.getProps(["x","y","x2","y2"],s),f=o/2,y=i==="y"?{start:c,end:u}:{start:a,end:d},g=Ss({x:e,y:t},this.getCenterPoint(s),Me(-r));return g[i]>=y.start-f-Ci&&g[i]<=y.end+f+Ci}getCenterPoint(e){return xs(this,e)}draw(e){let{width:t,height:i,centerX:s,centerY:r,options:o}=this;e.save(),ph(e,this.getCenterPoint(),o.rotation),_s(e,this.options),e.beginPath(),e.fillStyle=o.backgroundColor;let a=Di(e,o);e.ellipse(s,r,i/2,t/2,ae/2,0,2*ae),e.fill(),a&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){return ix(e,t)}};Oi.id="ellipseAnnotation";Oi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,label:Object.assign({},Yn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Oi.defaultRoutes={borderColor:"color",backgroundColor:"color"};Oi.descriptors={label:{_fallback:!0}};vs=class extends Ae{inRange(e,t,i,s){let{x:r,y:o,x2:a,y2:c,width:d}=this.getProps(["x","y","x2","y2","width"],s),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return OA({x:e,y:t},this.getCenterPoint(s),d/2,u);let f=u/2,y=i==="y"?{start:o,end:c,value:t}:{start:r,end:a,value:e};return y.value>=y.start-f&&y.value<=y.end+f}getCenterPoint(e){return xs(this,e)}draw(e){let t=this.options,i=t.borderWidth;if(t.radius<.1)return;e.save(),e.fillStyle=t.backgroundColor,_s(e,t);let s=Di(e,t);t.borderWidth=0,oi(e,t,this.centerX,this.centerY),s&&!fh(t.pointStyle)&&(e.shadowColor=t.borderShadowColor,e.stroke()),e.restore(),t.borderWidth=i}resolveElementProperties(e,t){return nx(e,t)}};vs.id="pointAnnotation";vs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};vs.defaultRoutes={borderColor:"color",backgroundColor:"color"};ws=class extends Ae{inRange(e,t,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&uL(this.elements,e,t,s);let r=Ss({x:e,y:t},this.getCenterPoint(s),Me(-this.options.rotation)),o=this.elements.map(d=>i==="y"?d.bY:d.bX),a=Math.min(...o),c=Math.max(...o);return r[i]>=a&&r[i]<=c}getCenterPoint(e){return xs(this,e)}draw(e){let{elements:t,options:i}=this;e.save(),e.beginPath(),e.fillStyle=i.backgroundColor,_s(e,i);let s=Di(e,i),r=!0;for(let o of t)r?(e.moveTo(o.x,o.y),r=!1):e.lineTo(o.x,o.y);e.closePath(),e.fill(),s&&(e.shadowColor=i.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,t){let i=nx(e,t),{x:s,y:r}=i,{sides:o,rotation:a}=t,c=[],d=2*ae/o,u=a*Io;for(let f=0;f<o;f++,u+=d)c.push(dL(i,t,u));return i.elements=c,i.initProperties={x:s,y:r},i}};ws.id="polygonAnnotation";ws.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ws.defaultRoutes={borderColor:"color",backgroundColor:"color"};jn={box:Yn,ellipse:Oi,label:ki,line:Ti,point:vs,polygon:ws};Object.keys(jn).forEach(n=>{ee.describe(`elements.${jn[n].id}`,{_fallback:"plugins.annotation.common"})});hL={update:Object.assign};vL="2.1.1",Wn=new Map,lx={id:"annotation",version:vL,beforeRegister(){DA("chart.js","3.7",Ye.version)},afterRegister(){Ye.register(jn)},afterUnregister(){Ye.unregister(jn)},beforeInit(n){Wn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hovered:[]})},beforeUpdate(n,e,t){let i=Wn.get(n),s=i.annotations=[],r=t.annotations;Q(r)?Object.keys(r).forEach(o=>{let a=r[o];Q(a)&&(a.id=o,s.push(a))}):he(r)&&s.push(...r),FA(s,n.scales)},afterDataLimits(n,e){let t=Wn.get(n);IA(n,e.scale,t.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,e,t){let i=Wn.get(n);xA(n,i,t),fL(n,i,t,e.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display)},beforeDatasetsDraw(n,e,t){Al(n,"beforeDatasetsDraw",t.clip)},afterDatasetsDraw(n,e,t){Al(n,"afterDatasetsDraw",t.clip)},beforeDraw(n,e,t){Al(n,"beforeDraw",t.clip)},afterDraw(n,e,t){Al(n,"afterDraw",t.clip)},beforeEvent(n,e,t){let i=Wn.get(n);_A(i,e.event,t)&&(e.changed=!0)},afterDestroy(n){Wn.delete(n)},_getState(n){return Wn.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!dh.includes(n),annotations:{_allKeys:!1,_fallback:(n,e)=>`elements.${jn[bh(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_fallback:!0}}},additionalOptionScopes:[""]}});var xL,dx,u8,h8,f8,_L,SL,CL,kL,TL,OL,ux,hx=O(()=>{fi();Bd();Ma();cx();({useEffect:xL,useState:dx}=window.React),{HandleFetch:u8,HandleResponse:h8}=window.getGenie.Components.Common.RequestManager,{Libs:f8,Utilities:_L}=window.getGenie.Components.Common,{ComposeComponents:SL}=window.getGenie.Components.Common.ReduxManager,{Empty:CL,Popover:kL}=window.antd,{isExistDomain:TL}=_L.GenieHelpers;Ye.register(fn,Pn,Mt,xa,_a,rs,Da,lx);OL=SL(({setSidebar:n,sidebar:e,getInputs:t})=>{let[i,s]=dx({name:"Word count",dataName:"words",activeTabIndex:0}),r=(t.competitorData||[]).filter(S=>!TL(S?.url)).slice(0,10),o=t.serpVisualize,a={words:[],headings:[],images:[],internalLinks:[],externalLinks:[]};for(let S of r)for(let[T,k]of Object.entries(S?.stat||{}))!a[T]||a[T].push(k);let[c,d]=dx([]);xL(()=>{let S=a[i.dataName];d(S)},[i]);let u=0,f=0,y=0;c.length>0&&(u=c?.reduce((S,T)=>S+T,0),u=Math.ceil(u/c?.length),f=c?.reduce((S,T)=>Math.min(S,T)),y=c?.reduce((S,T)=>Math.max(S,T),0));let g=S=>{let T=S.chart.data.datasets[0].data;return T.reduce((P,D)=>P+D,0)/T.length},p=[{name:"word count",dataName:"words"},{name:"headings",dataName:"headings"},{name:"images",dataName:"images"},{name:"internal links",dataName:"internalLinks"},{name:"external links",dataName:"externalLinks"}],v=(S,T)=>{s({...S,activeTabIndex:T})},x={responsive:!0,layout:{padding:{top:25,right:0,left:0,bottom:0}},plugins:{datalabels:{display:!1,color:"#97ACFF",align:"end",rotation:270,anchor:"end",font:{size:"10"},formatter:function(S){if(S<1e3)return S;if(S>=1e3&&S<1e6)return+(S/1e3).toFixed(1)+"K";if(S>=1e6&&S<1e9)return+(S/1e6).toFixed(1)+"M";if(S>=1e9&&S<1e12)return+(S/1e9).toFixed(1)+"B";if(S>=1e12)return+(S/1e12).toFixed(1)+"T"}},legend:{display:!1},tooltip:{enabled:!0,rtl:!1,backgroundColor:"#031233",callback:{}},annotation:{annotations:{line1:{type:"line",borderColor:"#14A645",borderDash:[4,4],borderDashOffset:0,borderWidth:1,scaleID:"y",value:S=>g(S)}}}},scales:{x:{grid:{display:!0},ticks:{callback:function(S,T,k){return(r[T]?.keySlug||"").replace(/www.|\.[^.]+$/gm,"")}}},y:{grid:{borderWidth:0},ticks:{callback:function(S){if(S<1e3)return S;if(S>=1e3&&S<1e6)return+(S/1e3).toFixed(1)+"K";if(S>=1e6&&S<1e9)return+(S/1e6).toFixed(1)+"M";if(S>=1e9&&S<1e12)return+(S/1e9).toFixed(1)+"B";if(S>=1e12)return+(S/1e12).toFixed(1)+"T"}}}}},C={labels:c.map(S=>S),datasets:[{label:e.__("Content","getgenie"),data:c.map(S=>S),backgroundColor:"#97ACFF",barPercentage:.2,borderRadius:10}]};return React.createElement("div",{className:"getgenie-serp-visualization"},React.createElement(kL,{content:React.createElement("div",{className:"getgenie-serpVisualization-container"},React.createElement("h5",{className:"serpVisualization-header"},"SERP Visualizer"),React.createElement("h6",{className:"serpVisualization-sub-header"},"Metrics"),React.createElement("div",{className:"getgenie-serpVisualization-tab-container"},p.map((S,T)=>React.createElement("p",{key:T,className:`tab-name ${i.activeTabIndex===T?"active-tab":""}`,onClick:()=>v(S,T)},S.name))),c?.length===0||c?.every(S=>S==0)?React.createElement(CL,{description:e.__("No data found.","getgenie"),className:"getgenie-chart empty"}):React.createElement(React.Fragment,null,React.createElement("div",{className:"visualization-data-highlights"},React.createElement("p",null," ",React.createElement("span",{className:"data-name average-data"},"Average : ")," ",React.createElement("span",{className:"data-count"},u)," "),React.createElement("p",null," ",React.createElement("span",{className:"data-name"},"Min : ")," ",React.createElement("span",{className:"data-count"},f)," "),React.createElement("p",null," ",React.createElement("span",{className:"data-name"},"Max : ")," ",React.createElement("span",{className:"data-count"},y)," ")),React.createElement(Ea,{options:x,data:C}))),overlayClassName:"getgenie-serpVisualization-popover",overlayStyle:{width:"700px",height:"494px"},placement:"left",visible:o,zIndex:9999}))},["setSidebar","sidebar","getInputs"]),ux=OL});var fx,px,DL,EL,ML,gx,PL,mx,yx=O(()=>{Nc();hx();({Libs:fx}=window.getGenie.Components.Common),{Col:px,Divider:DL,Row:EL}=window.antd,{ComposeComponents:ML}=window.getGenie.Components.Common.ReduxManager,{useEffect:gx}=window.React,PL=ML(({getInputs:n,setInput:e,setSidebar:t,sidebar:i})=>{let s=n.headTohead||!1,r=n.serpVisualize||!1;return gx(()=>{n.serpVisualize&&e("headTohead",!1)},[n.serpVisualize]),gx(()=>{n.headTohead&&e("serpVisualize",!1)},[n.headTohead]),React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-scoreanalysis-competitor-screen"},React.createElement("div",{className:"getgenie-headtohead"},React.createElement(EL,{justify:"space-between",align:"middle"},React.createElement(px,{order:2,span:10,className:"comparison-switch"},React.createElement(fx.Switch,{label:"SERP Visualizer",defaultChecked:r,name:"serpVisualize"})),React.createElement(px,{order:1,span:10,className:"comparison-switch"},React.createElement(fx.Switch,{className:"h2h-comparison",label:"H2H Comparison",defaultChecked:s,name:"headTohead"})))),React.createElement(ux,null),React.createElement(DL,{className:"genie-divider"}),React.createElement("div",{className:"getgenie-statistics-container"},React.createElement(To,{data:n.competitorData}))))},["sidebar","getInputs","setInput","setSidebar"]),mx=PL});var NL,RL,AL,bx,S8,vx=O(()=>{js();({ComposeComponents:NL}=window.getGenie.Components.Common.ReduxManager),{Libs:RL}=window.getGenie.Components.Common,{useState:AL,useEffect:bx}=window.React,S8=NL(({sidebar:n,visible:e,width:t,limitUsage:i})=>{let[s,r]=AL({});bx(()=>{r(n.competitorStats?.headToHeadData||{})},[n.competitorStats]);let o=(p,v)=>{if(p==0||!v||v?.length<2)return"";if(p>=v[0]&&p<=parseInt(v[1]))return"heatmap-green";if(p>=parseInt(v[1]))return"heatmap-red";if(p<v[0])return"heatmap-yellow"},a=p=>{var v=/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;return!!v.test(p)},c="",d="";if(Object.keys(s).length>0){var u="",f=!1;c+=`<div class="header-statistic">
<div><p>Google Rank:</p></div></div>`;for(let[p,v]of Object.entries(s.serpDomains)){if(c+=`<div class="domain-content statistic statistic-url domain-content-url ${p=="myContent_0"?"my_content_el":""}">
<div class="url-text">
`,c+=`<span class='text-content'>
${v?.rank!==0?a(v?.favicon)?`<img class="favicon" src="${v?.favicon}" />`:'<span class="getgenie-icon-earth favicon"></span>':""}
${v?.rank==0?"My Content":(v?.url||"").replace(/http(s)?(:)?(\/\/)?|(\/\/)?(www\.)?/g,"")}
</span></div>${v?.rank==0?`<span class="google-rank">
<img src="${window.getGenie.config.assetsUrl}dist/admin/images/myContent.svg" />
</span>`:`<span class="google-rank">${v?.rank}</span>`}
</div>`,v.rank<4)var y='<div class="statistic statistic-heatmap-col">';else var y='<div class="statistic statistic-heatmap-col blur-element">';for(let[x,_]of Object.entries(s.statistics))f===!1&&(u+='<div style="display: flex;">',u+=`<div class="keyPhrase"> <span class="getgenie-icon-copy"></span>
<p class="keyPhrase-keyword">${_?.keyPhrase}</p>
<p class="getgenie-custom-tooltip"></p>
<p class="getgenie-hover-tooltip"></p>
</div>`,u+='<div class="keyword-recommendation">'+(_?.recommendation||[]).join("-")+'<span class="getgenie-hover-tooltip">Ideal range of keyword count</span></div> </div>'),y+=`<div class="statisticData ${o(_?.heatMap[p]?.matchedKeyPhrase||0,_?.recommendation)}">${_?.heatMap[p]?.matchedKeyPhrase||0}</div>`;y+="</div>",f===!1&&(d+='<div class="statistic">'+u+"</div>",f=!0),d+=y}}let g=(p,v,x,_)=>{p.forEach((C,S)=>{let T=_[S],k=v[S];k&&(k.scrollWidth>k.clientWidth?T=_[S]:_[S].classList.add("d-none"));let P=k?.innerText,D="";typeof P=="string"?D=P.replace(/<br\s*[\/]?>/g,`
`):Array.isArray(P)&&(D=P.join(",").replace(/<br\s*[\/]?>/g,`
`)),T.innerText=D,C.addEventListener("click",()=>{let M=x[S];M.style.display="block",M.innerText="Copied",setTimeout(()=>{M.style.display="none",M.innerText=""},1500),Jt.copyToClipboard(D).then(()=>{}).catch(()=>console.log("error"))})})};return bx(()=>{let p=document.getElementById("getgenie-container"),v=p.shadowRoot?.querySelector(".keyword-heatmap-wrapper");var x=new MutationObserver(function(_,C){for(let S of _)if(S.target.className.includes("keyword-heatmap-wrapper")===!0){let T=p.shadowRoot.querySelectorAll(".keyPhrase"),k=p.shadowRoot.querySelectorAll(".keyPhrase .keyPhrase-keyword"),P=p.shadowRoot.querySelectorAll(".keyPhrase .getgenie-custom-tooltip"),D=p.shadowRoot.querySelectorAll(".keyPhrase .getgenie-hover-tooltip");g(T,k,P,D)}});x.observe(v,{subtree:!0,attributes:!0,childList:!0})},[s]),React.createElement("div",{className:`keyword-heatmap-wrapper ${e?"":"d-none"}`,style:{width:`${t}px`}},React.createElement(RL.BlurElement,{top:730,show:i.subscription_type!=="pro",text:"Reveal NLP keywords, optimize, and rank better.",btnText:"Upgrade and optimize now",href:"https://getgenie.ai/pricing/",textMargin:0},React.createElement("div",{id:"header",dangerouslySetInnerHTML:{__html:c}}),React.createElement("div",{id:"body",dangerouslySetInnerHTML:{__html:d}})))},["sidebar","limitUsage"])});var LL,vh,IL,FL,wx,BL,zL,xx,HL,WL,jL,_x,Sx=O(()=>{({useEffect:LL,useState:vh}=window.React),{HandleFetch:IL,HandleResponse:FL}=window.getGenie.Components.Common.RequestManager,{Libs:wx,Utilities:BL}=window.getGenie.Components.Common,{ComposeComponents:zL}=window.getGenie.Components.Common.ReduxManager,{Collapse:xx,Button:HL}=window.antd,{Panel:WL}=xx,jL=zL(({setSidebar:n,sidebar:e})=>{let t=window.getGenie.blogWizardData.plagiarismStat?.plagiarismData,[i,s]=vh(t||[]),[r,o]=vh(!1),[a,c]=vh(!1);return LL(()=>{window.getGenie.blogWizardData.PlagiarismStat={plagiarismData:i},BL.GenieHelpers.callStoreApi("plagiarismStat",{plagiarismData:i})},[i]),React.createElement("div",{className:"getgenie-Plagiarism"},React.createElement("div",{className:"getgenie-Plagiarism-container"},React.createElement("div",{className:"getgenie-Plagiarism-container-child"},React.createElement("div",{className:"getgenie-Plagiarism-data-fetchBtn"},r?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,"Scanning your content"),React.createElement(wx.Loading,{size:25})," "):React.createElement(HL,{className:"getgenie-fetch-competitor-btn",onClick:()=>{let u=e.currentPostContent;u=u.replace(/<\/?[^>]+(>|$)/g,""),u=u.split(/\r?\n/).filter(f=>f.trim()!=="").join(`
`),o(!0),c(!1),IL(f=>{o(!1),FL(f,()=>{let y=f.data?.result||[];if(s(y),y.length===0){c(!0);return}})},"plagiarismData",{input:{textContent:u}})}},e.__("Check Plagiarism","getgenie"))),r&&[...Array(5).keys()].map((u,f)=>React.createElement(wx.SkeletonCard,{count:1,key:f})),i.length>0&&React.createElement(xx,{expandIconPosition:"right",accordion:!0,expandIcon:()=>React.createElement("span",{className:"getgenie-icon-arrow_down"})},i.map((u,f)=>React.createElement(WL,{header:React.createElement("h5",{className:"getgenie-Plagiarism-accordian-heading"},u.title),key:f},React.createElement("div",{className:"getgenie-Plagiarism-link-container"},React.createElement("p",null,React.createElement("span",null,`${u.minwordsmatched}+`)," Words Matched"),React.createElement("a",{href:u.viewurl,className:"getgenie-Plagiarism-link",target:"_blank"},React.createElement("span",null,"See Details"),React.createElement("img",{src:e.imageUrl+"/new_tab.png",alt:""}))),React.createElement("p",{className:"getgenie-content-container"},u.textsnippet)))),a&&React.createElement("p",{className:"getgenie-Plagiarism-notfound"},"No match found!"))))},["setSidebar","sidebar"]),_x=jL});var Cx,O8,VL,YL,D8,UL,$L,R8,kx=O(()=>{P0();yx();vx();Sx();({Libs:Cx,Utilities:O8}=window.getGenie.Components.Common),{ComposeComponents:VL}=window.getGenie.Components.Common.ReduxManager,{Tabs:YL}=window.antd,{TabPane:D8}=YL,{useState:UL,useEffect:$L}=window.React,R8=VL(({setSidebar:n,sidebar:e,setInput:t})=>{let[i,s]=UL("blogAnalysis");$L(()=>{t("headTohead",!1),t("serpVisualize",!1)},[i,e.open]);let r=a=>{s(a)},o=[{label:"Content Score",key:"blogAnalysis",children:React.createElement(M0,null)},{label:"Competitor",key:"competitor",children:React.createElement(mx,null)},{label:"Plagiarism",key:"plagiarism",children:React.createElement(_x,null)}];return React.createElement(React.Fragment,null,React.createElement(Cx.DrawerHeader,null),React.createElement(Cx.Navbar,{tabPaneList:o,activeKey:i,handleActiveKey:r,className:"getgenie-statistics-navbar"}))},["setSidebar","sidebar","setInput"])});var th=O(()=>{yy();du();vy();f0();kx();Tr()});var wh,KL,xh,Tx,_h,z8,qL,Ox,Sh,XL,ZL,JL,Cs,Dx=O(()=>{th();({Button:wh,Tooltip:KL,Modal:xh}=window.antd),{useEffect:Tx,useState:_h}=window.React,{Libs:z8}=window.getGenie.Components.Common,{ComposeComponents:qL}=window.getGenie.Components.Common.ReduxManager,Ox=["BlogScreen"],Sh=["ScoreAnalysis"],XL=["GenieChat"],ZL=["UserHistory","UserHistoryDetails"],JL=qL(({setSidebar:n,sidebar:e,getInputs:t,setInput:i,getTemplateInputs:s,setContextMenu:r})=>{let o=e.currentPostContent&&e.analyzedContent?.contentStats?.totalScore||0,[a,c]=_h({}),[d,u]=_h(""),[f,y]=_h(!1),{component:g,currentTemplate:p}=e;Tx(()=>{if(!e.toolbarWriting)if([...Ox,"WriteTemplatesScreen"].includes(g)){let k=Ox.includes(g)?"blogWizard":e.currentTemplate;c({component:g,template:k})}else Sh.includes(g)&&u(g)},[e.component,e.currentTemplate]),Tx(()=>{window.location.hash==="#getgenie-open-blogwizard"&&(x(),n({component:"BlogScreen",currentTemplate:"blogWizard"}))},[]);let v=()=>{i("competitorData",null),i("seoDataTab","competitor"),n({open:!0,component:"BlogScreen",analyzeKeyword:{...e.analyzeKeyword,open:!0},statisticsScreen:{...e.statisticsScreen,triggered:!0}})},x=()=>{let k=!e.open;if(i("headTohead",!1),i("serpVisualize",!1),[...Sh,...ZL,...XL,"WriteTemplatesScreen"].includes(g)){n({open:!0,component:a?.component||"TemplateListScreen",currentTemplate:a?.template||e.currentTemplate});return}n({open:k,component:g||"TemplateListScreen"})},_=()=>{n({open:!0,component:"BlogScreen",analyzeKeyword:{open:!0,triggered:!0}})},C=(k,P)=>{let{competitorData:D,keyword:M,searchVolume:N}=P?.blogWizard||{};if(!M&&!D&&!N||M&&!D&&!N){xh.warning({title:"Score not generated",content:"Please Fetch keyword and competitor data for content score.",className:"getgenie-confirm-modal",getContainer:()=>k.rootContainer,zIndex:99999,maskClosable:!0,...M?{okText:React.createElement("div",null,"Analyze Keyword ",React.createElement("span",{className:"getgenie-icon-arrow-right fetch"})),onOk:_}:{}});return}if(k.analyzingCompetitors){xh.warning({title:"Fetching competitors data to provide the updated content score.",className:"getgenie-confirm-modal",getContainer:()=>k.rootContainer,zIndex:99999,maskClosable:!0});return}if(Array.isArray(k.statisticsData?.keywords)||!D&&!k.analyzingCompetitors){xh.warning({title:"The score will need some updating!",onOk:v,content:"Please click the button below and re- fetch the SERP competitor data to get updated content score for your content.",okText:React.createElement("div",null,"Fetch ",React.createElement("span",{className:"getgenie-icon-arrow-right fetch"})),className:"getgenie-confirm-modal",getContainer:()=>k.rootContainer,zIndex:99999,maskClosable:!0});return}if(window.rankMathEditor||window.YoastSEO){let W,I;if(window.rankMathEditor){let F=window.rankMathEditor?.assessor?.analyzer?.researcher?.paper?.args||{};W=F.title,I=F.description}else{let F=window.YoastSEO?.app?.callbacks?.getData()||{};W=F.metaTitle,I=F.snippetMeta}n({currentPostTitle:W||"",currentPostDescription:I||"",currentPostContent:k.currentPostContent+" "})}let L=wp.data.select("core/editor")?.getEditedPostAttribute("title");if(L&&!k.currentPostContent.includes(L)){let W=`<h1>${L}</h1>`+k.currentPostContent;n({currentPostContent:W})}if(!k.currentPostContent&&D&&(y(!0),setTimeout(()=>{y(!1)},2e3)),Object.keys(k.statisticsData).length===0||!k.currentPostContent)return!1;let B=!k.open;Sh.includes(g)||(B=!0),n({open:B,component:d||"ScoreAnalysis",currentTemplate:"blogWizard",analyzeKeyword:{...k.analyzeKeyword,open:!1},generatedOutlines:{...k.generatedOutlines,open:!1}})},S=k=>{let P=g=="GenieChat"?!k.open:!0;n({open:P,component:"GenieChat",currentTemplate:"genieChat",analyzeKeyword:{...k.analyzeKeyword,open:!1},generatedOutlines:{...k.generatedOutlines,open:!1}})},T=`${window.getGenie.config.assetsUrl}dist/admin/images/genie-chat.svg`;return React.createElement(React.Fragment,null,window.getGenie?.config?.isBlockEditor?React.createElement(React.Fragment,null,React.createElement(wh,{onClick:x,type:"primary",icon:React.createElement("span",{className:"getgenie-icon-edit ant-btn-icon"})},e.__("Write for me","getgenie")),React.createElement(wh,{onClick:()=>S(e),className:"genie-chat-opener-btn"},React.createElement("img",{src:T,alt:"genie-chat",width:"25"}),e.__("Chat","getgenie"))):"",React.createElement(KL,{placement:"bottom",trigger:"click",getPopupContainer:k=>window.getGenie.shadow||document.body,title:"No post content found!",visible:f},React.createElement(wh,{onClick:()=>C(e,s),style:{backgroundColor:Il.ColorByStatScore(o||0)},loading:e.statisticsScreen.loading,type:"primary",className:"getgenie-toolbar-write-btn stat"},React.createElement("span",{className:"getgenie-icon-meter score ant-btn-icon"}),o,"/100")))},["setSidebar","setInput","sidebar","getInputs","getTemplateInputs","setContextMenu"]),Cs=JL});var QL,Ex,Mx=O(()=>{QL=(n,e=[],t=!1,i=!1)=>{let s="#FF4131";return t?n<e[0]?s="#F5B008":!i&&n>=e[0]||i&&n>e[0]&&n<e[1]?s="#14A645":i&&n>=e[1]&&(s="#F02F54"):n>25&&n<=50?s="#FDC500":n>50&&n<80?s="#f5b008":n>=80&&(s="#00B81D"),s},Ex=QL});var Il={};xo(Il,{ColorByStatScore:()=>Ex,ContentAnalysis:()=>Xn,KeywordFinder:()=>Ee,WPEditorTopButtons:()=>Cs,WebSourceAnalysis:()=>Zn});var Tr=O(()=>{tp();cp();Dx();Mx();Zt()});var Nx=Re(Px=>{"use strict";var ks=xe();function eI(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var tI=typeof Object.is=="function"?Object.is:eI,nI=ks.useState,iI=ks.useEffect,sI=ks.useLayoutEffect,rI=ks.useDebugValue;function oI(n,e){var t=e(),i=nI({inst:{value:t,getSnapshot:e}}),s=i[0].inst,r=i[1];return sI(function(){s.value=t,s.getSnapshot=e,Ch(s)&&r({inst:s})},[n,t,e]),iI(function(){return Ch(s)&&r({inst:s}),n(function(){Ch(s)&&r({inst:s})})},[n]),rI(t),t}function Ch(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!tI(n,t)}catch{return!0}}function aI(n,e){return e()}var lI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aI:oI;Px.useSyncExternalStore=ks.useSyncExternalStore!==void 0?ks.useSyncExternalStore:lI});var Ax=Re((q8,Rx)=>{"use strict";Rx.exports=Nx()});var Lx,cI,dI,uI,hI,fI,pI,gI,Ix,Fx=O(()=>{Lx=oe(Ax());Tr();({ComposeComponents:cI}=window.getGenie.Components.Common.ReduxManager),{RenderElement:dI}=window.getGenie.Components.Common,{useRef:uI,useEffect:hI}=window.React,{subscribe:fI}=wp.data,pI=()=>(0,Lx.useSyncExternalStore)(n=>{let e=fI(n);return()=>e()},()=>document.querySelector(".edit-post-header__toolbar, .editor-header__toolbar, .edit-site-header-edit-mode__start")),gI=cI(()=>{let n=uI(null),e=pI();return hI(()=>{if(!e)return;let t=document.getElementById("getgenie-editor-custom-toolbar");return t||(t=document.createElement("div"),t.id="getgenie-editor-custom-toolbar",t.className="getgenie",e.appendChild(t)),n.current||(n.current=t,dI(React.createElement(Cs,null),t)),()=>n.current=null},[e]),null},[]),Ix=gI});var bI={};var mI,Fl,yI,Bx=O(()=>{Tr();Fx();({RenderElement:mI}=window.getGenie.Components.Common),{doAction:Fl}=wp.hooks,{registerPlugin:yI}=wp.plugins;yI("getgenie",{render:Ix});(function(n){n.addEventListener("load",function(){let e=document.querySelector("#getgenie-editor-custom-toolbar.classic");e&&n.getGenie?.config?.wizardScreen==="post"?mI(React.createElement(Cs,null),e):console.warn("No toolbar is found.");let t=0,i=setInterval(function(){t++,jQuery("#wp-admin-bar-getgenie-template-list").length===1&&(Fl("getgenie_adminbar_menu","getgenie_hooks"),Fl("getgenie_adminbar_chat","getgenie_hooks"),clearInterval(i)),t>=30&&clearInterval(i)},500),s=0,r=setInterval(function(){s++,jQuery(".woocommerce-layout__header-wrapper").length===1&&n.getGenie?.config?.wizardScreen&&(jQuery('<div id="getgenie-editor-custom-toolbar" class="getgenie">').insertAfter(".woocommerce-layout__header-wrapper .woocommerce-layout__header-heading"),Fl("getgenie_woocommerce_menu","getgenie_hooks"),clearInterval(r)),s>=30&&clearInterval(r)},500);jQuery("#getgenie-container").length||jQuery("body").append('<div id="getgenie-container" class="getgenie getgenie-main-container"></div>'),Fl("getgenie-render-app","getgenie_hooks"),jQuery.fn.menu_current=function(){this.addClass("current").siblings().removeClass("current")};let o=jQuery(".toplevel_page_getgenie.wp-menu-open");o.addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu").find("a.menu-top").addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu").next().find("li").each(function(a,c){let{hash:d,search:u}=n.location,f=jQuery(c).children("a").attr("href");if(d===""&&u.includes("?page=getgenie"))return o.find("ul > li.wp-first-item").menu_current(),!1;f&&f.includes(d)&&jQuery(c).menu_current()}).on("click",function(){jQuery(this).menu_current()})})})(window)});var vI,iW,wI,Yx,kh,zx,Hx,Wx,jx,Vx,Ts,xI,Ux,$x=O(()=>{Zt();cu();js();({Libs:vI,Utilities:iW}=window.getGenie.Components.Common),{ComposeComponents:wI}=window.getGenie.Components.Common.ReduxManager,{Sidebar:Yx,BlogWizardUtils:kh}=window.getGenie.Components,{OutlineScreen:zx,ParagraphGenerator:Hx,AnalyzeKeywordScreen:Wx,KeywordHeatMap:jx}=Yx||{},{Col:Vx}=window.antd,{useEffect:Ts}=window.React,xI=wI(({sidebar:n,setSidebar:e,setInput:t,getInputs:i})=>{let s=window.getGenie.blogWizardData,r=window.getGenie.config.isBlockEditor||window.getGenie.config.wizardScreen==="post",{open:o,generatedOutlines:a,analyzeKeyword:c,paragraphEditorScreen:d}=n;Ts(()=>{n.open?document.body.classList.add("genie-sidebar-open"):document.body.classList.contains("genie-sidebar-open")&&document.body.classList.remove("genie-sidebar-open"),navigator?.platform==="Win32"&&document.body.classList.add("genie-scrollbar-windows")},[n.open]),Ts(()=>{if(!r)return;i.seoEnabled?i.searchVolume&&n.component=="BlogScreen"&&e({analyzeKeyword:{...n.analyzeKeyword,open:!0}}):e({analyzeKeyword:{...n.analyzeKeyword,open:!1,loading:!1}})},[i.searchVolume,i.seoEnabled,n.component]),Ts(()=>{if(!r)return;let g=wp.data.select("core/editor")?.getEditedPostContent();if(g){let p=wp.data.select("core/editor")?.getEditedPostAttribute("title");p&&!g.includes(p)&&(g=`<h1>${p}</h1>`+g),e({currentPostContent:g})}if(!(!s||Object.values(s).filter(Boolean).length<2)){e({component:"BlogScreen",currentTemplate:"blogWizard"});for(let[p,v]of Object.entries(s))if(!(!v||p=="post_id"))if(p==="keywordData"){if(v&&Object.values(v).length>0)for(let[x,_]of Object.entries(v))t(x,_)}else if(p==="serpData"){if(v&&Object.values(v).length>0)for(let[x,_]of Object.entries(v))x==="statisticsData"?e({statisticsData:_}):t(x,_)}else JSON.parse(localStorage.getItem("getgenie-"+p))||t(p,v)}},[]),Ts(()=>{if(!r)return;let g=n.statisticsData,p=n.currentPostContent;if(!Array.isArray(g?.keywords)&&kh&&g){let v="",x="";document.getElementsByClassName("block-editor__container")?.length>0?(v=wp.data.select("core/editor")?.getEditedPostAttribute("title"),x=wp.data.select("core/editor")?.getEditedPostAttribute("excerpt")):document.getElementById("wp-content-editor-container")&&(v=document.getElementById("title")?.value,x=document.getElementById("excerpt")?.value),n.currentPostTitle&&(v=n.currentPostTitle),n.currentPostDescription&&(x=n.currentPostDescription);let _={content:p,url:location.origin,title:v,description:x},C=new kh.ContentAnalysis(_,g),S=n.competitorStats;if(S?.headToHeadData?.statistics){let T=new Ee;for(let k of Object.keys(S?.headToHeadData?.statistics)){let P=T.findSingleMatch(p,k);S.headToHeadData.statistics[k]?.heatMap?.myContent_0||(S.headToHeadData.statistics[k].heatMap.myContent_0={matchedKeyPhrase:0}),S.headToHeadData.statistics[k].heatMap.myContent_0.matchedKeyPhrase=P}}e({analyzedContent:C.getStat(),competitorStats:S})}},[n.statisticsData,n.currentPostContent]),Ts(()=>{let g=n.component==="BlogScreen"&&n.currentScreen==="paragraphScreen";e({paragraphEditorScreen:{...n.paragraphEditorScreen,open:g}})},[n.component,n.currentScreen]),Ts(()=>{(async()=>{let g=i.competitorData;if(!g||!n.statisticsData||Object.values(n.statisticsData).length===0)return;let p={source:n.currentPostContent,url:location.hostname||"myContent.com",title:"myContent",keySlug:"myContent_0",rank:0,favicon:"default"},v=new bi(kh.ContentAnalysis,Ee),x=(g||[]).filter(C=>!Jt.isExistDomain(C?.url)).slice(0,10),_=await v.analyze([p,...x],n.statisticsData);e({competitorStats:_})})()},[n.statisticsData,i.competitorData]);let u=Yx[n.component]||(()=>""),f=i.headTohead||!1,y=(g,p)=>{let v=g-(c.open?p.analyzeKeywordScreen:0)-(a.open?p.generatedOutlines:0)-(f?p.keywordHeatMap:0)-(d.open?p.paragraphEditorScreen:0);return v>=p.main?v:p.main};return React.createElement(vI.DrawerWrapper,null,(g,p)=>React.createElement("div",{className:"getgenie-sidebar-content"},React.createElement(Vx,{className:"extended-panel"},Wx&&React.createElement(Wx,{visible:n.open&&c.open,width:p.analyzeKeywordScreen}),zx&&React.createElement(zx.GeneratedOutlines,{visible:n.open&&a.open,width:p.generatedOutlines}),Hx&&React.createElement(Hx,{visible:n.open&&d.open,width:p.paragraphEditorScreen}),jx&&React.createElement(jx,{visible:n.open&&f,width:p.keywordHeatMap})),React.createElement(Vx,{className:"wizard-screen",style:{width:`${y(g,p)}px`}},React.createElement(u,null))))},["sidebar","setSidebar","setInput","getInputs"]),Ux=xI});var _I,Gx,Kx=O(()=>{_I={calculateEventPosition:(n,e)=>{if(e==="viewport")return n.target.getBoundingClientRect();if(e==="body"){let t=function(s,r){var o=0;do isNaN(s?.["offset"+r])||(o+=s?.["offset"+r]);while(s=s?.offsetParent);return o};return{top:t(n.target,"Top"),left:t(n.target,"Left"),right:t(n.target,"Right"),bottom:t(n.target,"Bottom"),width:n.target.getBoundingClientRect().width,height:n.target.getBoundingClientRect().height}}},insertContextMenu:n=>{let e=!wp.data.select("getgenie").contextMenu().open;wp.data.dispatch("getgenie").setContextMenu({open:e,buttonEvent:n})},showSidebar:n=>{let e=wp.data.select("getgenie").sidebar().existingInputValue||"",t="WriteTemplatesScreen",i=n.slug;i==="list"&&(t="TemplateListScreen"),wp.data.dispatch("getgenie").setContextMenu({open:!1}),wp.data.dispatch("getgenie").setSidebar({open:!0,currentWritingMode:n?.mode,component:t,currentTemplate:i,existingInputValue:e.replace(/<br\s*[\/]?>/g,"")})}},Gx=_I});var SI,qx,Bl,CI,kI,TI,OI,Xx,DI,EI,MI,Zx,Jx=O(()=>{Kx();({Row:SI,Col:qx,List:Bl}=window.antd),{ComposeComponents:CI}=window.getGenie.Components.Common.ReduxManager,kI=`${window.getGenie.config.assetsUrl}dist/admin/images/hamburger.svg`,TI=`${window.getGenie.config.assetsUrl}dist/admin/images/close.svg`,OI=`${window.getGenie.config.assetsUrl}dist/admin/images/Genie_logo_black.svg`,{useState:Xx,useEffect:DI}=window.React,EI=["Writing History","Statistics"],MI=CI(({contextMenu:n,setContextMenu:e,sidebar:t,setSidebar:i})=>{let[s,r]=Xx(!1),[o,a]=Xx({}),{open:c,buttonEvent:d,inputContent:u}=n,{selectedText:f}=u,y=[{title:"Write Using Templates",mode:"template",slug:"list",disable:!1},{title:"Expand Outline",mode:"advance",slug:"expandOutline",disable:!f||n?.isDisable?.expandOutline},{title:"Continue Writing",mode:"advance",slug:"continueWriting",disable:!1},{title:"Re-write Texts",mode:"advance",slug:"content-rewriter",disable:!f},{title:"Write Using Genie Mode",mode:"advance",slug:"genieMode"}],g=T=>{r(!s)};DI(()=>{let k=document.getElementById("getgenie-container").shadowRoot?.querySelector(".getgenie-advance-writing-context-menu")?.getBoundingClientRect();!k||!c||a({menuWidth:k?.width,menuHeight:k?.height})},[c]);let p,v,x=window.innerHeight-d.bottom,_=window.innerWidth-d.right;p=d.top,v=d.left,x<o.menuHeight&&(p=d.bottom-o.menuHeight),_<o.menuWidth&&(v=v-o.menuWidth),window.innerWidth<760&&(v=0);let C={position:"fixed",left:`${v}px`,top:`${p}px`,zIndex:999999},S=T=>{T=="Statistics"?i({isUsageModalOpen:!0}):T=="Writing History"&&i({open:!0,component:"UserHistory",analyzeKeyword:{...t.analyzeKeyword,open:!1},generatedOutlines:{...t.generatedOutlines,open:!1}}),e({open:!1})};return c?React.createElement("div",{style:C,className:"getgenie-advance-writing-context-menu"},React.createElement("div",{className:"getgenie-advance-writing-context-menu-header"},React.createElement(SI,{justify:"space-between",align:"middle",className:"getgenie-advance-writing-context-menu-header-row"},React.createElement(qx,{span:12},React.createElement("img",{style:{width:"84px"},src:OI,alt:""})),React.createElement(qx,{span:12},React.createElement("div",{className:"getgenie-advance-writing-hamburger-wrapper"},React.createElement("img",{onClick:T=>g(T),className:"getgenie-advance-writing-hamburger-icon",src:s?TI:kI,alt:""}))))),React.createElement("div",{className:"getgenie-advance-writing-context-menu-content"},s?React.createElement(Bl,{size:"large",dataSource:EI,renderItem:T=>React.createElement(Bl.Item,{onClick:()=>S(T)},T)}):React.createElement(Bl,{className:"getgenie-advance-writing-main-list",size:"large",dataSource:y,renderItem:T=>React.createElement(Bl.Item,{onClick:()=>Gx.showSidebar(T),className:T.disable?"disable":""},T.title)}))):""},["contextMenu","setContextMenu","sidebar","setSidebar"]),Zx=MI});var PI,NI,Un,RI,Qx,e_=O(()=>{({Typography:PI,Spin:NI}=window.antd),Un=wp.data.select("getgenie").sidebar(),RI=({data:n,loading:e,title:t,currentSubscriptions:i=[]})=>React.createElement(NI,{tip:"Loading...",spinning:e},React.createElement(PI.Title,{level:4},t,":"),React.createElement("div",null,i.map((s,r)=>s?.package_name&&s?.expires_at?React.createElement("h5",{key:r,className:"limit-usage-package-name"},s?.package_name,React.createElement("span",{className:"limit-usage-expiration"},"Expires at: ",s?.expires_at)):"")),React.createElement("table",{className:"user-stats-table"},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",null,Un.__("Feature Type","getgenie")),React.createElement("th",null,Un.__("Limit","getgenie")),React.createElement("th",null,Un.__("Usage","getgenie")),React.createElement("th",null,Un.__("Remaining Usage","getgenie")))),React.createElement("tbody",null,e?React.createElement(React.Fragment,null,React.createElement("tr",null,React.createElement("td",null,Un.__("Word Generate","getgenie"),":"),React.createElement("td",null,"---"),React.createElement("td",null,"---"),React.createElement("td",null,"---")),React.createElement("tr",null,React.createElement("td",null,Un.__("Serp Analysis","getgenie"),":"),React.createElement("td",null,"---"),React.createElement("td",null,"---"),React.createElement("td",null,"---")),React.createElement("tr",null,React.createElement("td",null,Un.__("Keyword Lookup","getgenie"),":"),React.createElement("td",null,"---"),React.createElement("td",null,"---"),React.createElement("td",null,"---")),React.createElement("tr",{className:"Domain Limit"},React.createElement("td",null,Un.__("Domain Limit","getgenie"),":"),React.createElement("td",null,"---"),React.createElement("td",null,"---"),React.createElement("td",null,"---"))):n?.map((s,r)=>React.createElement("tr",{key:r,className:s?.[0]},s?.map((o,a)=>React.createElement("td",{key:a},o))))))),Qx=RI});var AI,Th,t_=O(()=>{AI=["pages_per_site","keywords_per_site","data_fetch_count_per_week","keywords_latest_overview","top_pages_insights","competing_pages_insights","device_country_insights","lost_keyword_insights","new_keyword_insights","improved_declined_keywords","keywords_top3_top10_outside10","low_hanging_fruits","pages_needed_attention","export_topical_map_image","export_topical_map_csv","related_keyword_details","nlp_keyword_details","semantic_keyword_details","nlp_semantic_one_click_blog"],Th=AI});var Os,Oh,LI,II,FI,BI,zI,HI,n_,i_=O(()=>{e_();t_();({useState:Os,useEffect:Oh}=window.React),{ComposeComponents:LI}=window.getGenie.Components.Common.ReduxManager,{Libs:II,LicenseNotice:FI}=window.getGenie.Components.Common,{HandleFetch:BI,HandleResponse:zI}=window.getGenie.Components.Common.RequestManager,HI=LI(({sidebar:n,setSidebar:e,limitUsage:t,setLimitUsage:i})=>{let[s,r]=Os(!!window.getGenie.config.siteToken),[o,a]=Os(n.isUsageModalOpen),[c,d]=Os(!1),[u,f]=Os(Object.keys(t.siteUsagesLimit)),[y,g]=Os(Object.keys(t.subscriptionUsagesLimit)),[p,v]=Os("Current site");Oh(()=>{a(n.isUsageModalOpen)},[n.isUsageModalOpen]),Oh(()=>{s&&u.length===0&&y.length===0&&(d(!0),BI(S=>{zI(S,()=>{i({...S?.data})}),d(!1)},"limitUsage"))},[]);let x=()=>{e({isUsageModalOpen:!1})},_=S=>S.replace(/^[_]*(.)/,(P,D)=>D.toUpperCase()).replace(/[_]+(.)/g,(P,D)=>" "+D.toUpperCase()),C=S=>{if(Object.values(S).length===0)return;let k=S?.limits,P=S?.usages,D=[];if(Array.isArray(k)){let M=Th.filter(R=>k.includes(R));D=k.filter(R=>!M.includes(R)).map(R=>{let L=[],B=R.value||"~",W=P.find(I=>I.key===R.key).value||0;return L.push(R.title),L.push(B),L.push(W),L.push(`${isNaN(B)?"~":Math.max(0,parseInt(B)-parseInt(W))||0}`),L})}else if(typeof k=="object"){let M=Th.filter(R=>k.hasOwnProperty(R)),N=Object.keys(k).reduce((R,L)=>(M.includes(L)||(R[L]=k[L]),R),{});D=Object.keys(N).map(R=>{let L=[],B=N?.[R]||"~",W=P?.[R]||0;return L.push(_(R)),L.push(B),L.push(W),L.push(`${isNaN(B)?"~":Math.max(0,parseInt(B)-parseInt(W))||0}`),L})}return D};return Oh(()=>{if(Object.values(t?.subscriptionUsagesLimit).length===0)return;let S={limits:{},usages:{}},T=[];for(let M of Object.values(t?.subscriptionUsagesLimit||{})){T.push({package_name:M?.package_name,expires_at:M?.expires_at,isFree:M?.isFree});for(let N in M)if(Object.keys(S).includes(N)){let R=M[N];for(let L in R){let B=R[L];S?.[N]?.[L]==null?S[N][L]=B:S[N][L]=parseInt(S?.[N]?.[L])+parseInt(B)}}}let k=C(S),P=C(Object.values(t?.siteUsagesLimit||{})?.[0]||{});v(Object.keys(t?.siteUsagesLimit||{})?.[0]||"Current site"),g(k),f(P);let D={};for(let M in S.limits)D[M]=Math.floor((S.usages?.[M]||0)/(S.limits?.[M]||0)*100);wp.data.dispatch("getgenie").setSidebar({subscriptionStatistics:{usagePercentage:{...D}}})},[t]),React.createElement(II.Modal,{closeIcon:React.createElement("span",{className:"getgenie-icon-close1"}),isModalVisible:o,setIsModalVisible:a,onClose:x,className:"getgenie-limit-usage-modal",centered:!0,footer:null},React.createElement("div",{className:"getgenie-info-wrapper-modal"},React.createElement("div",{className:"getgenie-license-form",layout:"vertical"},s?React.createElement(React.Fragment,null,React.createElement(Qx,{title:`${p} usage details`,loading:c,data:u})):React.createElement(FI,null))))},["sidebar","setSidebar","limitUsage","setLimitUsage"]),n_=HI});function zl(n,e){return zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},zl(n,e)}var s_=O(()=>{});function ft(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,zl(n,e)}var Hl=O(()=>{s_()});var o_=Re((mW,r_)=>{"use strict";var WI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";r_.exports=WI});var d_=Re((yW,c_)=>{"use strict";var jI=o_();function a_(){}function l_(){}l_.resetWarningCache=a_;c_.exports=function(){function n(i,s,r,o,a,c){if(c!==jI){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:l_,resetWarningCache:a_};return t.PropTypes=t,t}});var h_=Re((wW,u_)=>{u_.exports=d_()();var bW,vW});function We(){return We=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},We.apply(null,arguments)}var Wl=O(()=>{});function jl(n){return n.charAt(0)==="/"}function Dh(n,e){for(var t=e,i=t+1,s=n.length;i<s;t+=1,i+=1)n[t]=n[i];n.pop()}function VI(n,e){e===void 0&&(e="");var t=n&&n.split("/")||[],i=e&&e.split("/")||[],s=n&&jl(n),r=e&&jl(e),o=s||r;if(n&&jl(n)?i=t:t.length&&(i.pop(),i=i.concat(t)),!i.length)return"/";var a;if(i.length){var c=i[i.length-1];a=c==="."||c===".."||c===""}else a=!1;for(var d=0,u=i.length;u>=0;u--){var f=i[u];f==="."?Dh(i,u):f===".."?(Dh(i,u),d++):d&&(Dh(i,u),d--)}if(!o)for(;d--;d)i.unshift("..");o&&i[0]!==""&&(!i[0]||!jl(i[0]))&&i.unshift("");var y=i.join("/");return a&&y.substr(-1)!=="/"&&(y+="/"),y}var f_,p_=O(()=>{f_=VI});var g_=O(()=>{});function jt(n,e){if(!n){if(YI)throw new Error(Eh);var t=typeof e=="function"?e():e,i=t?Eh+": "+t:Eh;throw new Error(i)}}var YI,Eh,Vl=O(()=>{YI=!0,Eh="Invariant failed"});function Kr(n){return n.charAt(0)==="/"?n:"/"+n}function m_(n){return n.charAt(0)==="/"?n.substr(1):n}function UI(n,e){return n.toLowerCase().indexOf(e.toLowerCase())===0&&"/?#".indexOf(n.charAt(e.length))!==-1}function __(n,e){return UI(n,e)?n.substr(e.length):n}function S_(n){return n.charAt(n.length-1)==="/"?n.slice(0,-1):n}function $I(n){var e=n||"/",t="",i="",s=e.indexOf("#");s!==-1&&(i=e.substr(s),e=e.substr(0,s));var r=e.indexOf("?");return r!==-1&&(t=e.substr(r),e=e.substr(0,r)),{pathname:e,search:t==="?"?"":t,hash:i==="#"?"":i}}function qe(n){var e=n.pathname,t=n.search,i=n.hash,s=e||"/";return t&&t!=="?"&&(s+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(s+=i.charAt(0)==="#"?i:"#"+i),s}function Qe(n,e,t,i){var s;typeof n=="string"?(s=$I(n),s.state=e):(s=We({},n),s.pathname===void 0&&(s.pathname=""),s.search?s.search.charAt(0)!=="?"&&(s.search="?"+s.search):s.search="",s.hash?s.hash.charAt(0)!=="#"&&(s.hash="#"+s.hash):s.hash="",e!==void 0&&s.state===void 0&&(s.state=e));try{s.pathname=decodeURI(s.pathname)}catch(r){throw r instanceof URIError?new URIError('Pathname "'+s.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):r}return t&&(s.key=t),i?s.pathname?s.pathname.charAt(0)!=="/"&&(s.pathname=f_(s.pathname,i.pathname)):s.pathname=i.pathname:s.pathname||(s.pathname="/"),s}function Ph(){var n=null;function e(o){return n=o,function(){n===o&&(n=null)}}function t(o,a,c,d){if(n!=null){var u=typeof n=="function"?n(o,a):n;typeof u=="string"?typeof c=="function"?c(u,d):d(!0):d(u!==!1)}else d(!0)}var i=[];function s(o){var a=!0;function c(){a&&o.apply(void 0,arguments)}return i.push(c),function(){a=!1,i=i.filter(function(d){return d!==c})}}function r(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];i.forEach(function(d){return d.apply(void 0,a)})}return{setPrompt:e,confirmTransitionTo:t,appendListener:s,notifyListeners:r}}function k_(n,e){e(window.confirm(n))}function GI(){var n=window.navigator.userAgent;return(n.indexOf("Android 2.")!==-1||n.indexOf("Android 4.0")!==-1)&&n.indexOf("Mobile Safari")!==-1&&n.indexOf("Chrome")===-1&&n.indexOf("Windows Phone")===-1?!1:window.history&&"pushState"in window.history}function KI(){return window.navigator.userAgent.indexOf("Trident")===-1}function qI(){return window.navigator.userAgent.indexOf("Firefox")===-1}function XI(n){return n.state===void 0&&navigator.userAgent.indexOf("CriOS")===-1}function v_(){try{return window.history.state||{}}catch{return{}}}function T_(n){n===void 0&&(n={}),C_||jt(!1);var e=window.history,t=GI(),i=!KI(),s=n,r=s.forceRefresh,o=r===void 0?!1:r,a=s.getUserConfirmation,c=a===void 0?k_:a,d=s.keyLength,u=d===void 0?6:d,f=n.basename?S_(Kr(n.basename)):"";function y($){var K=$||{},U=K.key,G=K.state,z=window.location,de=z.pathname,be=z.search,ve=z.hash,Ve=de+be+ve;return f&&(Ve=__(Ve,f)),Qe(Ve,G,U)}function g(){return Math.random().toString(36).substr(2,u)}var p=Ph();function v($){We(q,$),q.length=e.length,p.notifyListeners(q.location,q.action)}function x($){XI($)||S(y($.state))}function _(){S(y(v_()))}var C=!1;function S($){if(C)C=!1,v();else{var K="POP";p.confirmTransitionTo($,K,c,function(U){U?v({action:K,location:$}):T($)})}}function T($){var K=q.location,U=P.indexOf(K.key);U===-1&&(U=0);var G=P.indexOf($.key);G===-1&&(G=0);var z=U-G;z&&(C=!0,R(z))}var k=y(v_()),P=[k.key];function D($){return f+qe($)}function M($,K){var U="PUSH",G=Qe($,K,g(),q.location);p.confirmTransitionTo(G,U,c,function(z){if(!!z){var de=D(G),be=G.key,ve=G.state;if(t)if(e.pushState({key:be,state:ve},null,de),o)window.location.href=de;else{var Ve=P.indexOf(q.location.key),bn=P.slice(0,Ve+1);bn.push(G.key),P=bn,v({action:U,location:G})}else window.location.href=de}})}function N($,K){var U="REPLACE",G=Qe($,K,g(),q.location);p.confirmTransitionTo(G,U,c,function(z){if(!!z){var de=D(G),be=G.key,ve=G.state;if(t)if(e.replaceState({key:be,state:ve},null,de),o)window.location.replace(de);else{var Ve=P.indexOf(q.location.key);Ve!==-1&&(P[Ve]=G.key),v({action:U,location:G})}else window.location.replace(de)}})}function R($){e.go($)}function L(){R(-1)}function B(){R(1)}var W=0;function I($){W+=$,W===1&&$===1?(window.addEventListener(y_,x),i&&window.addEventListener(b_,_)):W===0&&(window.removeEventListener(y_,x),i&&window.removeEventListener(b_,_))}var F=!1;function j($){$===void 0&&($=!1);var K=p.setPrompt($);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),K()}}function V($){var K=p.appendListener($);return I(1),function(){I(-1),K()}}var q={length:e.length,action:"POP",location:k,createHref:D,push:M,replace:N,go:R,goBack:L,goForward:B,block:j,listen:V};return q}function O_(n){var e=n.indexOf("#");return e===-1?n:n.slice(0,e)}function Gr(){var n=window.location.href,e=n.indexOf("#");return e===-1?"":n.substring(e+1)}function JI(n){window.location.hash=n}function Mh(n){window.location.replace(O_(window.location.href)+"#"+n)}function D_(n){n===void 0&&(n={}),C_||jt(!1);var e=window.history,t=qI(),i=n,s=i.getUserConfirmation,r=s===void 0?k_:s,o=i.hashType,a=o===void 0?"slash":o,c=n.basename?S_(Kr(n.basename)):"",d=ZI[a],u=d.encodePath,f=d.decodePath;function y(){var U=f(Gr());return c&&(U=__(U,c)),Qe(U)}var g=Ph();function p(U){We(K,U),K.length=e.length,g.notifyListeners(K.location,K.action)}var v=!1,x=null;function _(U,G){return U.pathname===G.pathname&&U.search===G.search&&U.hash===G.hash}function C(){var U=Gr(),G=u(U);if(U!==G)Mh(G);else{var z=y(),de=K.location;if(!v&&_(de,z)||x===qe(z))return;x=null,S(z)}}function S(U){if(v)v=!1,p();else{var G="POP";g.confirmTransitionTo(U,G,r,function(z){z?p({action:G,location:U}):T(U)})}}function T(U){var G=K.location,z=M.lastIndexOf(qe(G));z===-1&&(z=0);var de=M.lastIndexOf(qe(U));de===-1&&(de=0);var be=z-de;be&&(v=!0,B(be))}var k=Gr(),P=u(k);k!==P&&Mh(P);var D=y(),M=[qe(D)];function N(U){var G=document.querySelector("base"),z="";return G&&G.getAttribute("href")&&(z=O_(window.location.href)),z+"#"+u(c+qe(U))}function R(U,G){var z="PUSH",de=Qe(U,void 0,void 0,K.location);g.confirmTransitionTo(de,z,r,function(be){if(!!be){var ve=qe(de),Ve=u(c+ve),bn=Gr()!==Ve;if(bn){x=ve,JI(Ve);var Pi=M.lastIndexOf(qe(K.location)),Zr=M.slice(0,Pi+1);Zr.push(ve),M=Zr,p({action:z,location:de})}else p()}})}function L(U,G){var z="REPLACE",de=Qe(U,void 0,void 0,K.location);g.confirmTransitionTo(de,z,r,function(be){if(!!be){var ve=qe(de),Ve=u(c+ve),bn=Gr()!==Ve;bn&&(x=ve,Mh(Ve));var Pi=M.indexOf(qe(K.location));Pi!==-1&&(M[Pi]=ve),p({action:z,location:de})}})}function B(U){e.go(U)}function W(){B(-1)}function I(){B(1)}var F=0;function j(U){F+=U,F===1&&U===1?window.addEventListener(w_,C):F===0&&window.removeEventListener(w_,C)}var V=!1;function q(U){U===void 0&&(U=!1);var G=g.setPrompt(U);return V||(j(1),V=!0),function(){return V&&(V=!1,j(-1)),G()}}function $(U){var G=g.appendListener(U);return j(1),function(){j(-1),G()}}var K={length:e.length,action:"POP",location:D,createHref:N,push:R,replace:L,go:B,goBack:W,goForward:I,block:q,listen:$};return K}function x_(n,e,t){return Math.min(Math.max(n,e),t)}function E_(n){n===void 0&&(n={});var e=n,t=e.getUserConfirmation,i=e.initialEntries,s=i===void 0?["/"]:i,r=e.initialIndex,o=r===void 0?0:r,a=e.keyLength,c=a===void 0?6:a,d=Ph();function u(M){We(D,M),D.length=D.entries.length,d.notifyListeners(D.location,D.action)}function f(){return Math.random().toString(36).substr(2,c)}var y=x_(o,0,s.length-1),g=s.map(function(M){return typeof M=="string"?Qe(M,void 0,f()):Qe(M,void 0,M.key||f())}),p=qe;function v(M,N){var R="PUSH",L=Qe(M,N,f(),D.location);d.confirmTransitionTo(L,R,t,function(B){if(!!B){var W=D.index,I=W+1,F=D.entries.slice(0);F.length>I?F.splice(I,F.length-I,L):F.push(L),u({action:R,location:L,index:I,entries:F})}})}function x(M,N){var R="REPLACE",L=Qe(M,N,f(),D.location);d.confirmTransitionTo(L,R,t,function(B){!B||(D.entries[D.index]=L,u({action:R,location:L}))})}function _(M){var N=x_(D.index+M,0,D.entries.length-1),R="POP",L=D.entries[N];d.confirmTransitionTo(L,R,t,function(B){B?u({action:R,location:L,index:N}):u()})}function C(){_(-1)}function S(){_(1)}function T(M){var N=D.index+M;return N>=0&&N<D.entries.length}function k(M){return M===void 0&&(M=!1),d.setPrompt(M)}function P(M){return d.appendListener(M)}var D={length:g.length,action:"POP",location:g[y],index:y,entries:g,createHref:p,push:v,replace:x,go:_,goBack:C,goForward:S,canGo:T,block:k,listen:P};return D}var C_,y_,b_,w_,ZI,Nh=O(()=>{Wl();p_();g_();Vl();C_=!!(typeof window<"u"&&window.document&&window.document.createElement);y_="popstate",b_="hashchange";w_="hashchange",ZI={hashbang:{encodePath:function(e){return e.charAt(0)==="!"?e:"!/"+m_(e)},decodePath:function(e){return e.charAt(0)==="!"?e.substr(1):e}},noslash:{encodePath:m_,decodePath:Kr},slash:{encodePath:Kr,decodePath:Kr}}});function QI(){var n="__global_unique_id__";return M_[n]=(M_[n]||0)+1}function e5(n,e){return n===e?n!==0||1/n===1/e:n!==n&&e!==e}function t5(n){var e=[];return{on:function(i){e.push(i)},off:function(i){e=e.filter(function(s){return s!==i})},get:function(){return n},set:function(i,s){n=i,e.forEach(function(r){return r(n,s)})}}}function n5(n){return Array.isArray(n)?n[0]:n}function i5(n,e){var t,i,s="__create-react-context-"+QI()+"__",r=function(a){ft(c,a);function c(){var u;return u=a.apply(this,arguments)||this,u.emitter=t5(u.props.value),u}var d=c.prototype;return d.getChildContext=function(){var f;return f={},f[s]=this.emitter,f},d.componentWillReceiveProps=function(f){if(this.props.value!==f.value){var y=this.props.value,g=f.value,p;e5(y,g)?p=0:(p=typeof e=="function"?e(y,g):Rh,p|=0,p!==0&&this.emitter.set(f.value,p))}},d.render=function(){return this.props.children},c}(qr.Component);r.childContextTypes=(t={},t[s]=Ah.default.object.isRequired,t);var o=function(a){ft(c,a);function c(){var u;return u=a.apply(this,arguments)||this,u.state={value:u.getValue()},u.onUpdate=function(f,y){var g=u.observedBits|0;(g&y)!==0&&u.setState({value:u.getValue()})},u}var d=c.prototype;return d.componentWillReceiveProps=function(f){var y=f.observedBits;this.observedBits=y??Rh},d.componentDidMount=function(){this.context[s]&&this.context[s].on(this.onUpdate);var f=this.props.observedBits;this.observedBits=f??Rh},d.componentWillUnmount=function(){this.context[s]&&this.context[s].off(this.onUpdate)},d.getValue=function(){return this.context[s]?this.context[s].get():n},d.render=function(){return n5(this.props.children)(this.state.value)},c}(qr.Component);return o.contextTypes=(i={},i[s]=Ah.default.object,i),{Provider:r,Consumer:o}}var qr,Ah,Rh,M_,s5,P_,N_=O(()=>{qr=oe(xe());Hl();Ah=oe(h_()),Rh=1073741823,M_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{};s5=qr.default.createContext||i5,P_=s5});var A_=Re((RW,R_)=>{R_.exports=Array.isArray||function(n){return Object.prototype.toString.call(n)=="[object Array]"}});var B_=Re((AW,Ds)=>{var Ul=A_();Ds.exports=F_;Ds.exports.parse=Lh;Ds.exports.compile=o5;Ds.exports.tokensToFunction=L_;Ds.exports.tokensToRegExp=I_;var r5=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function Lh(n,e){for(var t=[],i=0,s=0,r="",o=e&&e.delimiter||"/",a;(a=r5.exec(n))!=null;){var c=a[0],d=a[1],u=a.index;if(r+=n.slice(s,u),s=u+c.length,d){r+=d[1];continue}var f=n[s],y=a[2],g=a[3],p=a[4],v=a[5],x=a[6],_=a[7];r&&(t.push(r),r="");var C=y!=null&&f!=null&&f!==y,S=x==="+"||x==="*",T=x==="?"||x==="*",k=a[2]||o,P=p||v;t.push({name:g||i++,prefix:y||"",delimiter:k,optional:T,repeat:S,partial:C,asterisk:!!_,pattern:P?c5(P):_?".*":"[^"+Yl(k)+"]+?"})}return s<n.length&&(r+=n.substr(s)),r&&t.push(r),t}function o5(n,e){return L_(Lh(n,e),e)}function a5(n){return encodeURI(n).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function l5(n){return encodeURI(n).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function L_(n,e){for(var t=new Array(n.length),i=0;i<n.length;i++)typeof n[i]=="object"&&(t[i]=new RegExp("^(?:"+n[i].pattern+")$",Fh(e)));return function(s,r){for(var o="",a=s||{},c=r||{},d=c.pretty?a5:encodeURIComponent,u=0;u<n.length;u++){var f=n[u];if(typeof f=="string"){o+=f;continue}var y=a[f.name],g;if(y==null)if(f.optional){f.partial&&(o+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(Ul(y)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(y)+"`");if(y.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var p=0;p<y.length;p++){if(g=d(y[p]),!t[u].test(g))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(g)+"`");o+=(p===0?f.prefix:f.delimiter)+g}continue}if(g=f.asterisk?l5(y):d(y),!t[u].test(g))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+g+'"');o+=f.prefix+g}return o}}function Yl(n){return n.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c5(n){return n.replace(/([=!:$\/()])/g,"\\$1")}function Ih(n,e){return n.keys=e,n}function Fh(n){return n&&n.sensitive?"":"i"}function d5(n,e){var t=n.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return Ih(n,e)}function u5(n,e,t){for(var i=[],s=0;s<n.length;s++)i.push(F_(n[s],e,t).source);var r=new RegExp("(?:"+i.join("|")+")",Fh(t));return Ih(r,e)}function h5(n,e,t){return I_(Lh(n,t),e,t)}function I_(n,e,t){Ul(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,s=t.end!==!1,r="",o=0;o<n.length;o++){var a=n[o];if(typeof a=="string")r+=Yl(a);else{var c=Yl(a.prefix),d="(?:"+a.pattern+")";e.push(a),a.repeat&&(d+="(?:"+c+d+")*"),a.optional?a.partial?d=c+"("+d+")?":d="(?:"+c+"("+d+"))?":d=c+"("+d+")",r+=d}}var u=Yl(t.delimiter||"/"),f=r.slice(-u.length)===u;return i||(r=(f?r.slice(0,-u.length):r)+"(?:"+u+"(?=$))?"),s?r+="$":r+=i&&f?"":"(?="+u+"|$)",Ih(new RegExp("^"+r,Fh(t)),e)}function F_(n,e,t){return Ul(e)||(t=e||t,e=[]),t=t||{},n instanceof RegExp?d5(n,e):Ul(n)?u5(n,e,t):h5(n,e,t)}});var H_=Re(pe=>{"use strict";var je=typeof Symbol=="function"&&Symbol.for,Bh=je?Symbol.for("react.element"):60103,zh=je?Symbol.for("react.portal"):60106,$l=je?Symbol.for("react.fragment"):60107,Gl=je?Symbol.for("react.strict_mode"):60108,Kl=je?Symbol.for("react.profiler"):60114,ql=je?Symbol.for("react.provider"):60109,Xl=je?Symbol.for("react.context"):60110,Hh=je?Symbol.for("react.async_mode"):60111,Zl=je?Symbol.for("react.concurrent_mode"):60111,Jl=je?Symbol.for("react.forward_ref"):60112,Ql=je?Symbol.for("react.suspense"):60113,f5=je?Symbol.for("react.suspense_list"):60120,ec=je?Symbol.for("react.memo"):60115,tc=je?Symbol.for("react.lazy"):60116,p5=je?Symbol.for("react.block"):60121,g5=je?Symbol.for("react.fundamental"):60117,m5=je?Symbol.for("react.responder"):60118,y5=je?Symbol.for("react.scope"):60119;function pt(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case Bh:switch(n=n.type,n){case Hh:case Zl:case $l:case Kl:case Gl:case Ql:return n;default:switch(n=n&&n.$$typeof,n){case Xl:case Jl:case tc:case ec:case ql:return n;default:return e}}case zh:return e}}}function z_(n){return pt(n)===Zl}pe.AsyncMode=Hh;pe.ConcurrentMode=Zl;pe.ContextConsumer=Xl;pe.ContextProvider=ql;pe.Element=Bh;pe.ForwardRef=Jl;pe.Fragment=$l;pe.Lazy=tc;pe.Memo=ec;pe.Portal=zh;pe.Profiler=Kl;pe.StrictMode=Gl;pe.Suspense=Ql;pe.isAsyncMode=function(n){return z_(n)||pt(n)===Hh};pe.isConcurrentMode=z_;pe.isContextConsumer=function(n){return pt(n)===Xl};pe.isContextProvider=function(n){return pt(n)===ql};pe.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===Bh};pe.isForwardRef=function(n){return pt(n)===Jl};pe.isFragment=function(n){return pt(n)===$l};pe.isLazy=function(n){return pt(n)===tc};pe.isMemo=function(n){return pt(n)===ec};pe.isPortal=function(n){return pt(n)===zh};pe.isProfiler=function(n){return pt(n)===Kl};pe.isStrictMode=function(n){return pt(n)===Gl};pe.isSuspense=function(n){return pt(n)===Ql};pe.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===$l||n===Zl||n===Kl||n===Gl||n===Ql||n===f5||typeof n=="object"&&n!==null&&(n.$$typeof===tc||n.$$typeof===ec||n.$$typeof===ql||n.$$typeof===Xl||n.$$typeof===Jl||n.$$typeof===g5||n.$$typeof===m5||n.$$typeof===y5||n.$$typeof===p5)};pe.typeOf=pt});var Wh=Re((IW,W_)=>{"use strict";W_.exports=H_()});function Es(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var jh=O(()=>{});var K_=Re((BW,G_)=>{"use strict";var Vh=Wh(),b5={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},v5={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w5={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},U_={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yh={};Yh[Vh.ForwardRef]=w5;Yh[Vh.Memo]=U_;function j_(n){return Vh.isMemo(n)?U_:Yh[n.$$typeof]||b5}var x5=Object.defineProperty,_5=Object.getOwnPropertyNames,V_=Object.getOwnPropertySymbols,S5=Object.getOwnPropertyDescriptor,C5=Object.getPrototypeOf,Y_=Object.prototype;function $_(n,e,t){if(typeof e!="string"){if(Y_){var i=C5(e);i&&i!==Y_&&$_(n,i,t)}var s=_5(e);V_&&(s=s.concat(V_(e)));for(var r=j_(n),o=j_(e),a=0;a<s.length;++a){var c=s[a];if(!v5[c]&&!(t&&t[c])&&!(o&&o[c])&&!(r&&r[c])){var d=S5(e,c);try{x5(n,c,d)}catch{}}}}return n}G_.exports=$_});function E5(n,e){var t=""+e.end+e.strict+e.sensitive,i=q_[t]||(q_[t]={});if(i[n])return i[n];var s=[],r=(0,Q_.default)(n,s,e),o={regexp:r,keys:s};return X_<D5&&(i[n]=o,X_++),o}function Xr(n,e){e===void 0&&(e={}),(typeof e=="string"||Array.isArray(e))&&(e={path:e});var t=e,i=t.path,s=t.exact,r=s===void 0?!1:s,o=t.strict,a=o===void 0?!1:o,c=t.sensitive,d=c===void 0?!1:c,u=[].concat(i);return u.reduce(function(f,y){if(!y&&y!=="")return null;if(f)return f;var g=E5(y,{end:r,strict:a,sensitive:d}),p=g.regexp,v=g.keys,x=p.exec(n);if(!x)return null;var _=x[0],C=x.slice(1),S=n===_;return r&&!S?null:{path:y,url:y==="/"&&_===""?"/":_,isExact:S,params:v.reduce(function(T,k,P){return T[k.name]=C[P],T},{})}},null)}function M5(n){return Le.default.Children.count(n)===0}function $h(n){return n.charAt(0)==="/"?n:"/"+n}function P5(n,e){return n?We({},e,{pathname:$h(n)+e.pathname}):e}function N5(n,e){if(!n)return e;var t=$h(n);return e.pathname.indexOf(t)!==0?e:We({},e,{pathname:e.pathname.substr(t.length)})}function Z_(n){return typeof n=="string"?n:qe(n)}function Uh(n){return function(){jt(!1)}}function J_(){}var Le,Q_,UW,k5,eS,T5,Ei,Ms,O5,KW,q_,D5,X_,$n,R5,Gh,qW,Kh=O(()=>{Hl();Le=oe(xe());Nh();N_();Vl();Wl();Q_=oe(B_()),UW=oe(Wh());jh();k5=oe(K_()),eS=function(e){var t=P_();return t.displayName=e,t},T5=eS("Router-History"),Ei=eS("Router"),Ms=function(n){ft(e,n),e.computeRootMatch=function(s){return{path:"/",url:"/",params:{},isExact:s==="/"}};function e(i){var s;return s=n.call(this,i)||this,s.state={location:i.history.location},s._isMounted=!1,s._pendingLocation=null,i.staticContext||(s.unlisten=i.history.listen(function(r){s._pendingLocation=r})),s}var t=e.prototype;return t.componentDidMount=function(){var s=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(r){s._isMounted&&s.setState({location:r})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},t.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},t.render=function(){return Le.default.createElement(Ei.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},Le.default.createElement(T5.Provider,{children:this.props.children||null,value:this.props.history}))},e}(Le.default.Component),O5=function(n){ft(e,n);function e(){for(var i,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return i=n.call.apply(n,[this].concat(r))||this,i.history=E_(i.props),i}var t=e.prototype;return t.render=function(){return Le.default.createElement(Ms,{history:this.history,children:this.props.children})},e}(Le.default.Component),KW=function(n){ft(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},t.componentDidUpdate=function(s){this.props.onUpdate&&this.props.onUpdate.call(this,this,s)},t.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},t.render=function(){return null},e}(Le.default.Component),q_={},D5=1e4,X_=0;$n=function(n){ft(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var s=this;return Le.default.createElement(Ei.Consumer,null,function(r){r||jt(!1);var o=s.props.location||r.location,a=s.props.computedMatch?s.props.computedMatch:s.props.path?Xr(o.pathname,s.props):r.match,c=We({},r,{location:o,match:a}),d=s.props,u=d.children,f=d.component,y=d.render;return Array.isArray(u)&&M5(u)&&(u=null),Le.default.createElement(Ei.Provider,{value:c},c.match?u?typeof u=="function"?u(c):u:f?Le.default.createElement(f,c):y?y(c):null:typeof u=="function"?u(c):null)})},e}(Le.default.Component);R5=function(n){ft(e,n);function e(){for(var i,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return i=n.call.apply(n,[this].concat(r))||this,i.handlePush=function(a){return i.navigateTo(a,"PUSH")},i.handleReplace=function(a){return i.navigateTo(a,"REPLACE")},i.handleListen=function(){return J_},i.handleBlock=function(){return J_},i}var t=e.prototype;return t.navigateTo=function(s,r){var o=this.props,a=o.basename,c=a===void 0?"":a,d=o.context,u=d===void 0?{}:d;u.action=r,u.location=P5(c,Qe(s)),u.url=Z_(u.location)},t.render=function(){var s=this.props,r=s.basename,o=r===void 0?"":r,a=s.context,c=a===void 0?{}:a,d=s.location,u=d===void 0?"/":d,f=Es(s,["basename","context","location"]),y={createHref:function(p){return $h(o+Z_(p))},action:"POP",location:N5(o,Qe(u)),push:this.handlePush,replace:this.handleReplace,go:Uh("go"),goBack:Uh("goBack"),goForward:Uh("goForward"),listen:this.handleListen,block:this.handleBlock};return Le.default.createElement(Ms,We({},f,{history:y,staticContext:c}))},e}(Le.default.Component),Gh=function(n){ft(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var s=this;return Le.default.createElement(Ei.Consumer,null,function(r){r||jt(!1);var o=s.props.location||r.location,a,c;return Le.default.Children.forEach(s.props.children,function(d){if(c==null&&Le.default.isValidElement(d)){a=d;var u=d.props.path||d.props.from;c=u?Xr(o.pathname,We({},d.props,{path:u})):r.match}}),c?Le.default.cloneElement(a,{location:o,computedMatch:c}):null})},e}(Le.default.Component),qW=Le.default.useContext});function A5(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function F5(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(function(i){return i}).join(" ")}var kt,uj,tS,qh,Xh,Zh,Ps,L5,I5,nS,nc,hj,iS=O(()=>{Kh();Kh();Hl();kt=oe(xe());Nh();Wl();jh();Vl();uj=function(n){ft(e,n);function e(){for(var i,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return i=n.call.apply(n,[this].concat(r))||this,i.history=T_(i.props),i}var t=e.prototype;return t.render=function(){return kt.default.createElement(Ms,{history:this.history,children:this.props.children})},e}(kt.default.Component),tS=function(n){ft(e,n);function e(){for(var i,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return i=n.call.apply(n,[this].concat(r))||this,i.history=D_(i.props),i}var t=e.prototype;return t.render=function(){return kt.default.createElement(Ms,{history:this.history,children:this.props.children})},e}(kt.default.Component),qh=function(e,t){return typeof e=="function"?e(t):e},Xh=function(e,t){return typeof e=="string"?Qe(e,null,null,t):e},Zh=function(e){return e},Ps=kt.default.forwardRef;typeof Ps>"u"&&(Ps=Zh);L5=Ps(function(n,e){var t=n.innerRef,i=n.navigate,s=n.onClick,r=Es(n,["innerRef","navigate","onClick"]),o=r.target,a=We({},r,{onClick:function(d){try{s&&s(d)}catch(u){throw d.preventDefault(),u}!d.defaultPrevented&&d.button===0&&(!o||o==="_self")&&!A5(d)&&(d.preventDefault(),i())}});return Zh!==Ps?a.ref=e||t:a.ref=t,kt.default.createElement("a",a)}),I5=Ps(function(n,e){var t=n.component,i=t===void 0?L5:t,s=n.replace,r=n.to,o=n.innerRef,a=Es(n,["component","replace","to","innerRef"]);return kt.default.createElement(Ei.Consumer,null,function(c){c||jt(!1);var d=c.history,u=Xh(qh(r,c.location),c.location),f=u?d.createHref(u):"",y=We({},a,{href:f,navigate:function(){var p=qh(r,c.location),v=qe(c.location)===qe(Xh(p)),x=s||v?d.replace:d.push;x(p)}});return Zh!==Ps?y.ref=e||o:y.innerRef=o,kt.default.createElement(i,y)})}),nS=function(e){return e},nc=kt.default.forwardRef;typeof nc>"u"&&(nc=nS);hj=nc(function(n,e){var t=n["aria-current"],i=t===void 0?"page":t,s=n.activeClassName,r=s===void 0?"active":s,o=n.activeStyle,a=n.className,c=n.exact,d=n.isActive,u=n.location,f=n.sensitive,y=n.strict,g=n.style,p=n.to,v=n.innerRef,x=Es(n,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return kt.default.createElement(Ei.Consumer,null,function(_){_||jt(!1);var C=u||_.location,S=Xh(qh(p,C),C),T=S.pathname,k=T&&T.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),P=k?Xr(C.pathname,{path:k,exact:c,sensitive:f,strict:y}):null,D=!!(d?d(P,C):P),M=typeof a=="function"?a(D):a,N=typeof g=="function"?g(D):g;D&&(M=F5(M,r),N=We({},N,o));var R=We({"aria-current":D&&i||null,className:M,style:N,to:S},x);return nS!==nc?R.ref=e||v:R.innerRef=v,kt.default.createElement(I5,R)})})});var Mi,sS,B5,z5,rS,oS=O(()=>{$x();Jx();i_();iS();({AdminPages:Mi,AutocompleteTemplates:sS}=window.getGenie.Components),{ConfigProvider:B5}=window.antd,z5=()=>{let n=wp.data.select("getgenie").sidebar();return React.createElement(B5,{getPopupContainer:e=>n.rootContainer||document.body,theme:{components:{Typography:{fontWeightStrong:500},Slider:{handleSize:14,controlSize:14,handleSizeHover:16,handleColor:"#4F6FEC",trackBg:"#4F6FEC",trackHoverBg:"#4F6FEC",handleLineWidth:2,borderRadiusXS:4,handleLineWidthHover:3,margin:0},Tabs:{cardHeight:44,padding:16,titleFontSize:13,inkBarColor:"#4f6fec",colorTextHeading:"rgba(0, 0, 0, 0.88)",colorText:"#031233",colorTextDisabled:"#031233",colorPrimaryHover:"#031233",margin:0}},token:{colorPrimary:"#4570f4",borderRadius:4}}}," ",sS&&React.createElement(sS,null),React.createElement(Ux,null),React.createElement(Zx,null),React.createElement(n_,null),Mi?React.createElement(tS,{hashType:"noslash"},React.createElement(Gh,null,React.createElement($n,{exact:!0,path:"/getting-started",component:Mi.GettingStarted}),React.createElement($n,{exact:!0,path:"/write-for-me",component:Mi.WriteForMeAdminPage}),React.createElement($n,{exact:!0,path:"/keyword-research",component:Mi.KeywordResearchAdminPage}),React.createElement($n,{exact:!0,path:"/license",component:Mi.LicenseAdminPage}),React.createElement($n,{exact:!0,path:"/settings",component:Mi.SettingsAdminPage}),React.createElement($n,{exact:!0,path:"/help",component:Mi.HelpAdminPage}))):"")},rS=z5});var j5={};var H5,W5,aS=O(()=>{oS();({addAction:H5}=wp.hooks),{RenderElement:W5}=window.getGenie.Components.Common;H5("getgenie-render-app","getgenie_hooks",async()=>{let n=document.getElementById("getgenie-container");function e(i){return new Promise((s,r)=>{i.onload=()=>{s(i)},i.onerror=r})}let t=async(i,s)=>{let r=i;if(document.getElementById(r)==null){let o=document.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("href",i),s.appendChild(o),await e(o);return}};if(n){let i=n.attachShadow({mode:"open"}),s=`${window.getGenie.config.assetsUrl+`dist/admin/styles/admin.css?ver=${window.getGenie.config?.version}`}`;await t(s,i);let r=document.createElement("div");r.classList.add("getgenie"),r.classList.add("getgenie-version-"+window.getGenie.config?.version),r.classList.add("getgenie-root"),i.appendChild(r),wp.data.dispatch("getgenie").setSidebar({rootContainer:n.shadowRoot.querySelector(".getgenie-root")}),window.getGenie.shadow=i,W5(React.createElement(rS,null),r);let o=a=>{jQuery(a.target).parents(".getgenie").length||a.target.id==="getgenie-container"||a.target.id==="genie-head"||wp.data.dispatch("getgenie").setContextMenu({open:!1})};jQuery("body").click(o),jQuery("iframe").each(function(){let a=this;if(a.contentDocument){let{body:c}=a.contentDocument;jQuery(c)?.click(o)}})}else console.warn("There is no toolbar.")});window.getGenie?.isPlayground||setInterval(async()=>{let n=await fetch(window.getGenie.config?.authTokenLeaserApi+"&_wpnonce="+window.getGenie.config.restNonce).catch(e=>{});if(!!n&&n.ok)try{let e=await n.text();window.getGenie.config.authToken=e}catch{}},180*1e3)});var{addAction:ic}=wp.hooks,{WPEditorTopButtons:lS}=window.getGenie.Components?.BlogWizardUtils||{},{WooCommerceTopButtons:cS}=window.getGenie.Components?.WooWizardUtils||{},{RenderElement:dS}=window.getGenie.Components.Common;Bx();aS();ic("getgenie-render-toolbar","getgenie_hooks",()=>{if(typeof lS>"u")return;let n=document.getElementById("getgenie-editor-custom-toolbar");n?dS(React.createElement(lS,null),n):console.warn("No toolbar is found.")});ic("getgenie_woocommerce_menu","getgenie_hooks",()=>{if(typeof cS>"u")return;let n=document.getElementById("getgenie-editor-custom-toolbar");n?dS(React.createElement(cS,null),n):console.warn("No toolbar is found.")});ic("getgenie_adminbar_menu","getgenie_hooks",()=>{document.getElementById("wp-admin-bar-getgenie-template-list").addEventListener("click",function(e){e.preventDefault(),wp.data.dispatch("getgenie").setSidebar({open:!0,component:"TemplateListScreen"})})});ic("getgenie_adminbar_chat","getgenie_hooks",()=>{document.getElementById("wp-admin-bar-getgenie-chat").addEventListener("click",function(e){e.preventDefault(),wp.data.dispatch("getgenie").setSidebar({open:!0,component:"GenieChat",analyzeKeyword:{open:!1,triggered:!1},generatedOutlines:{open:!1}})})});})();
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/
/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/
/*!
* chartjs-plugin-datalabels v2.1.0
* https://chartjs-plugin-datalabels.netlify.app
* (c) 2017-2022 chartjs-plugin-datalabels contributors
* Released under the MIT license
*/
/*!
* chartjs-plugin-annotation v2.1.1
* https://www.chartjs.org/chartjs-plugin-annotation/index
* (c) 2022 chartjs-plugin-annotation Contributors
* Released under the MIT License
*/
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! moment.js
//! momentjs.com
//! version : 2.29.4