diff --git a/.github/workflows/i18n-crowdin-download.yml b/.github/workflows/i18n-crowdin-download.yml new file mode 100644 index 0000000..f363867 --- /dev/null +++ b/.github/workflows/i18n-crowdin-download.yml @@ -0,0 +1,20 @@ +name: Crowdin Download Action + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch for the pull request' + required: false + default: 'main' + +jobs: + call-crowdin-workflow: + uses: newfold-labs/workflows/.github/workflows/i18n-crowdin-download.yml@main + with: + base_branch: ${{ inputs.base_branch }} + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + vars: + CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} diff --git a/.github/workflows/i18n-crowdin-upload.yml b/.github/workflows/i18n-crowdin-upload.yml new file mode 100644 index 0000000..65d8be6 --- /dev/null +++ b/.github/workflows/i18n-crowdin-upload.yml @@ -0,0 +1,13 @@ +name: Crowdin Upload Action + +on: + workflow_dispatch: + +jobs: + call-crowdin-upload-workflow: + uses: newfold-labs/workflows/.github/workflows/i18n-crowdin-upload.yml@main + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + vars: + CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 129a18e..1235d24 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '7.3' coverage: none tools: composer, cs2pr diff --git a/build/index.asset.php b/build/index.asset.php index 58fdd4c..78d9f8e 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'f032c348783b7743b18d'); + array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '1506d30cd20535172ad5'); diff --git a/build/index.js b/build/index.js index 5eb81da..1fd27ee 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(()=>{var e={974:(e,t)=>{(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{HiiveAnalytics:()=>S,HiiveEvent:()=>i});var r={};e.r(r),e.d(r,{initializeNamespace:()=>o,updateHiiveDebounceInstance:()=>d,updateHiiveDebounceTime:()=>p,updateHiiveEventsQueue:()=>u,updateHiiveEventsQueueThreshold:()=>h,updateHiiveUrls:()=>c});var s={};e.r(s),e.d(s,{getHiiveBatchUrl:()=>k,getHiiveDebounce:()=>w,getHiiveEventsQueue:()=>g,getHiiveEventsQueueThreshold:()=>f,getHiiveSingleUrl:()=>m});const l=window.wp.data;class i{constructor(e,t,n,r){this.category=e,this.action=t,this.data=n,this.namespace=r}}const a={urls:{single:void 0,batch:void 0},queue:{events:[],threshold:100},debounce:{time:void 0,instance:void 0}};function o(e){return{type:"INITIALIZE_NAMESPACE",namespace:e}}function c(e,t){return{type:"UPDATE_HIIVE_URLS",urls:e,namespace:t}}function u(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE",events:e,namespace:t}}function h(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD",threshold:e,namespace:t}}function p(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_TIME",debounceTime:e,namespace:t}}function d(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_INSTANCE",instance:e,namespace:t}}function g(e,t){return e.hiive[t]?.queue.events}function f(e,t){return e.hiive[t]?.queue.threshold}function m(e,t){return e.hiive[t]?.urls.single}function k(e,t){return e.hiive[t]?.urls.batch}function w(e,t){return e.hiive[t]?.debounce}const b={reducer:(0,l.combineReducers)({hiive:(e,t)=>{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:a};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:r,selectors:s},x=(0,l.createReduxStore)("newfold/ui-analytics",b);(0,l.register)(x);const y=window.wp.apiFetch;var v=e.n(y);const E=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,A=e=>e instanceof i,I=async e=>{if(!e||!E(e))return!1;const t=(0,l.select)(x).getHiiveBatchUrl(e);if(!t)return!1;const n=(0,l.select)(x).getHiiveEventsQueue(e);if(0===n.length)return!0;(0,l.dispatch)(x).updateHiiveEventsQueue([],e);try{await v()({url:t,method:"POST",data:n})}catch(t){console.error(t),(0,l.dispatch)(x).updateHiiveEventsQueue(n,e)}return!0},S={initialize:async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:s=100}={}}={}})=>!(!e||!E(e)&&(!t&&!n||((0,l.dispatch)(x).initializeNamespace(e),(0,l.dispatch)(x).updateHiiveUrls({single:t,batch:n},e),(0,l.dispatch)(x).updateHiiveDebounceTime(r,e),(0,l.dispatch)(x).updateHiiveEventsQueueThreshold(s,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}},0))),initialized:E,validate:A,track:e=>{if(!A(e)||!E(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,l.select)(x).getHiiveEventsQueue(t);n.push(e),(0,l.dispatch)(x).updateHiiveEventsQueue(n,t);const r=(0,l.select)(x).getHiiveEventsQueueThreshold(t);return r&&r{if(!e)return!1;const t=(0,l.select)(x).getHiiveDebounce(e);t.time&&(clearInterval(t.instance),(0,l.dispatch)(x).updateHiiveDebounceInstance(setTimeout((()=>{I(e),(0,l.dispatch)(x).updateHiiveDebounceInstance(void 0,e)}),t.time),e))})(t),!0},send:async e=>{if(!A(e)||!E(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,l.select)(x).getHiiveSingleUrl(t);if(!n)return!1;try{await v()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}},dispatchEvents:I,disableDebounce:e=>{if(!e)return!1;const t=(0,l.select)(x).getHiiveDebounce(e);return t.instance&&(clearInterval(t.instance),(0,l.dispatch)(x).updateHiiveDebounceInstance(void 0,e),(0,l.dispatch)(x).updateHiiveDebounceTime(void 0,e)),!0}};var R=t;for(var T in n)R[T]=n[T];n.__esModule&&Object.defineProperty(R,"__esModule",{value:!0})})()},452:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},i=l.iterator||"@@iterator",a=l.asyncIterator||"@@asyncIterator",o=l.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var l=t&&t.prototype instanceof k?t:k,i=Object.create(l.prototype),a=new C(r||[]);return s(i,"_invoke",{value:S(e,n,a)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",d="suspendedYield",g="executing",f="completed",m={};function k(){}function w(){}function b(){}var x={};c(x,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(z([])));v&&v!==n&&r.call(v,i)&&(x=v);var E=b.prototype=k.prototype=Object.create(x);function A(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(s,l,i,a){var o=h(e[s],e,l);if("throw"!==o.type){var c=o.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,a)}),(function(e){n("throw",e,i,a)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,a)}))}a(o.arg)}var l;s(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,s){n(e,r,t,s)}))}return l=l?l.then(s,s):s()}})}function S(e,n,r){var s=p;return function(l,i){if(s===g)throw new Error("Generator is already running");if(s===f){if("throw"===l)throw i;return{value:t,done:!0}}for(r.method=l,r.arg=i;;){var a=r.delegate;if(a){var o=R(a,r);if(o){if(o===m)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(s===p)throw s=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);s=g;var c=h(e,n,r);if("normal"===c.type){if(s=r.done?f:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(s=f,r.method="throw",r.arg=c.arg)}}}function R(e,n){var r=n.method,s=e.iterator[r];if(s===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var l=h(s,e.iterator,n.arg);if("throw"===l.type)return n.method="throw",n.arg=l.arg,n.delegate=null,m;var i=l.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function z(e){if(null!=e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,l=function n(){for(;++s=0;--l){var i=this.tryEntries[l],a=i.completion;if("root"===i.tryLoc)return s("end");if(i.tryLoc<=this.prev){var o=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(o&&c){if(this.prev=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var s=r.arg;N(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{"use strict";n.d(r,{m:()=>gt});const e=window.React;n(452);const t=window.wp.element,s=window.wp.data;var l=n.n(s);const i=window.wp.apiFetch;var a=n.n(i);const o=window.wp.domReady;var c=n.n(o),u=n(974);const h=window.wp.i18n;var p,d;function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;ta()({path:y+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>a()({path:y+"/search/default",method:"POST"})},E=async(e,t)=>{try{return await a()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error in getMultiSearchResults:",e),{}}},A={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t,n)=>{if(!e||""===e.trim())return;const r=A.getResultInfo(),s={searchInput:n,resultContent:e,postId:t};r.push(s),localStorage.setItem("helpResultContent",JSON.stringify(r))},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>{const e=localStorage.getItem("helpResultContent");return e&&R(e)?JSON.parse(e):[]},getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag:e=>localStorage.getItem(e),clearSearchInput(){localStorage.removeItem("searchInput")},setFeatureFlag(e,t){localStorage.setItem(e,t)},updateFeedbackStatus:e=>{const t=A.getResultInfo().map((t=>t.postId===e?{...t,feedbackSubmitted:!0}:t));localStorage.setItem("helpResultContent",JSON.stringify(t))}},I=(e,t)=>{const n=new u.HiiveEvent("wonder_help",e,t,"wonder_help");u.HiiveAnalytics.send(n)},S=(e,n=100,r=!1)=>{const[s,l]=(0,t.useState)(""),[i,a]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{if(!e)return l(""),void a(!1);if(r){const t=e.trim().split(" ").filter(Boolean);let r=0;l(t[0]),a(!1);const s=setInterval((()=>{re+" "+t[r]))):(clearInterval(s),a(!0))}),n);return()=>clearInterval(s)}l(e),a(!0)}),[e,n,r]),{displayedText:s,isComplete:i}},R=e=>{try{return JSON.parse(e),!0}catch(e){return!1}},T=({postId:n,source:r})=>{const[s,l]=(0,t.useState)(""),[i,o]=(0,t.useState)(!1),[c,u]=(0,t.useState)(!1),p=(0,t.useRef)(null),d=(0,t.useRef)(null);(0,t.useEffect)((()=>{l(""),d.current.className="feedback-button no",p.current.className="feedback-button yes"}),[n]),(0,t.useEffect)((()=>{if((async()=>{"helpful"!==s&&"notHelpful"!==s||(((e,t)=>{a()({path:"nfd-help-center/v1/feedback",method:"POST",data:{post_id:e,status:t}})})(n,s),I("help_feedback_submitted",{label_key:"type",type:"helpful"===s?"positive":"negative",source:r,post_id:n,page:window.location.href.toString()}))})(),"helpful"===s||"notHelpful"===s){o(!0),u(!0);const e=setTimeout((()=>{u(!1)}),3e3);return()=>clearTimeout(e)}}),[s]);const g=e=>{l(e),A.updateFeedbackStatus(n)};return(0,e.createElement)("div",{className:"feedback-container"},!i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"feedback-question"},(0,e.createElement)("p",null,(0,h.__)("Did this result help you?","wp-module-help-center"))),(0,e.createElement)("div",{className:"icon"},(0,e.createElement)("button",{ref:p,onClick:()=>g("helpful"),className:"feedback-button yes"},(0,h.__)("Yes","wp-module-help-center")),(0,e.createElement)("button",{onClick:()=>g("notHelpful"),ref:d,className:"feedback-button no"},(0,h.__)("No","wp-module-help-center")))),i&&c&&(0,e.createElement)("div",{className:"thanks-message"},(0,h.__)("Thanks for the feedback!","wp-module-help-center")))};var N;function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?(0,e.createElement)("p",{className:"helpcenter-results",dangerouslySetInnerHTML:{__html:a}}):null))};var L,H;function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t"']/,B=new RegExp(U.source,"g"),D=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,V=new RegExp(D.source,"g"),F={"&":"&","<":"<",">":">",'"':""","'":"'"},M=e=>F[e];function G(e,t){if(t){if(U.test(e))return e.replace(B,M)}else if(D.test(e))return e.replace(V,M);return e}const Y=/(^|[^\[])\^/g;function W(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(Y,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function J(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const X={exec:()=>null};function Z(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:K(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=K(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:K(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],"\n").split("\n"),n="",r="";const s=[];for(;e.length>0;){let t=!1;const l=[];let i;for(i=0;i/.test(e[i]))l.push(e[i]),t=!0;else{if(t)break;l.push(e[i])}e=e.slice(i);const a=l.join("\n"),o=a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${o}`:o;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,s,!0),this.lexer.state.top=c,0===e.length)break;const u=s[s.length-1];if("code"===u?.type)break;if("blockquote"===u?.type){const t=u,l=t.raw+"\n"+e.join("\n"),i=this.blockquote(l);s[s.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"!==u?.type);else{const t=u,l=t.raw+"\n"+e.join("\n"),i=this.list(l);s[s.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=l.substring(s[s.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i=!1;for(;e;){let n=!1,r="",a="";if(!(t=l.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let o=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!o.trim(),h=0;if(this.options.pedantic?(h=2,a=o.trimStart()):u?h=t[1].length+1:(h=t[2].search(/[^ ]/),h=h>4?1:h,a=o.slice(h),h+=t[1].length),u&&/^ *$/.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),l=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const i=e.split("\n",1)[0];if(c=i,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(c))break;if(l.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())a+="\n"+c.slice(h);else{if(u)break;if(o.search(/[^ ]/)>=4)break;if(s.test(o))break;if(l.test(o))break;if(n.test(o))break;a+="\n"+c}u||c.trim()||(u=!0),r+=i+"\n",e=e.substring(i.length+1),o=c.slice(h)}}s.loose||(i?s.loose=!0:/\n *\n *$/.test(r)&&(i=!0));let p,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(a),d&&(p="[ ] "!==d[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:r,task:!!d,checked:p,loose:!1,text:a,tokens:[]}),s.raw+=r}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=Z(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?l.align.push("right"):/^ *:-+: *$/.test(e)?l.align.push("center"):/^ *:-+ *$/.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]}))));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:G(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=K(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),$(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return $(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let s,l,i=n,a=0;const o="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=o.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){i+=l;continue}if((r[5]||r[6])&&n%3&&!((n+l)%3)){a+=l;continue}if(i-=l,i>0)continue;l=Math.min(l,l+i+a);const t=[...r[0]][0].length,o=e.slice(0,n+r.index+t+l);if(Math.min(n,l)%2){const e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}const c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=G(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=G(t[1]),n="mailto:"+e):(e=G(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=G(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=G(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:G(t[0]),{type:"text",raw:t[0],text:e}}}}const te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ne=/(?:[*+-]|\d{1,9}[.)])/,re=W(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ne).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),se=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie=W(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=W(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),oe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce=/|$))/,ue=W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",ce).replace("tag",oe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=W(se).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),pe={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",he).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ie,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:te,html:ue,lheading:re,list:ae,newline:/^(?: *(?:\n|$))+/,paragraph:he,table:X,text:/^[^\n]+/},de=W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),ge={...pe,table:de,paragraph:W(se).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",de).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex()},fe={...pe,html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ce).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(se).replace("hr",te).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},me=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ke=/^( {2,}|\\)\n(?!\s*$)/,we="\\p{P}\\p{S}",be=W(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,we).getRegex(),xe=W(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,we).getRegex(),ye=W("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,we).getRegex(),ve=W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,we).getRegex(),Ee=W(/\\([punct])/,"gu").replace(/punct/g,we).getRegex(),Ae=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ie=W(ce).replace("(?:--\x3e|$)","--\x3e").getRegex(),Se=W("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ie).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Te=W(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ne=W(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),Ce=W(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),ze={_backpedal:X,anyPunctuation:Ee,autolink:Ae,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:ke,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:X,emStrongLDelim:xe,emStrongRDelimAst:ye,emStrongRDelimUnd:ve,escape:me,link:Te,nolink:Ce,punctuation:be,reflink:Ne,reflinkSearch:W("reflink|nolink(?!\\()","g").replace("reflink",Ne).replace("nolink",Ce).getRegex(),tag:Se,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(r):(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(s.raw+="\n"+r.raw,s.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(l=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(l=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(l)))s=t[t.length-1],n&&"paragraph"===s?.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r),n=l.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,l,i,a,o=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(o));)e.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(o));)o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.anyPunctuation.exec(o));)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,o,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Pe{options;parser;constructor(e){this.options=e||P}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return r?'
'+(n?s:G(s,!0))+"
\n":"
"+(n?s:G(s,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=J(e);if(null===s)return r;let l='
    ",l}image({href:e,title:t,text:n}){const r=J(e);if(null===r)return n;let s=`${n}{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Pe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,s=e.renderer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ee(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Be;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],l=t[r];Be.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>l.call(t,e)));const n=s.call(t,e);return l.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return qe.lex(e,t??this.defaults)}parser(e,t){return Ue.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const s={...r},l={...this.defaults,...s},i=this.onError(!!l.silent,!!l.async);if(!0===this.defaults.async&&!1===s.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l),l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then((t=>e(t,l))).then((e=>l.hooks?l.hooks.processAllTokens(e):e)).then((e=>l.walkTokens?Promise.all(this.walkTokens(e,l.walkTokens)).then((()=>e)):e)).then((e=>t(e,l))).then((e=>l.hooks?l.hooks.postprocess(e):e)).catch(i);try{l.hooks&&(n=l.hooks.preprocess(n));let r=e(n,l);l.hooks&&(r=l.hooks.processAllTokens(r)),l.walkTokens&&this.walkTokens(r,l.walkTokens);let s=t(r,l);return l.hooks&&(s=l.hooks.postprocess(s)),s}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+G(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ve(e,t){return De.parse(e,t)}Ve.options=Ve.setOptions=function(e){return De.setOptions(e),Ve.defaults=De.defaults,O(Ve.defaults),Ve},Ve.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},Ve.defaults=P,Ve.use=function(...e){return De.use(...e),Ve.defaults=De.defaults,O(Ve.defaults),Ve},Ve.walkTokens=function(e,t){return De.walkTokens(e,t)},Ve.parseInline=De.parseInline,Ve.Parser=Ue,Ve.parser=Ue.parse,Ve.Renderer=Pe,Ve.TextRenderer=Oe,Ve.Lexer=qe,Ve.lexer=qe.lex,Ve.Tokenizer=ee,Ve.Hooks=Be,Ve.parse=Ve,Ve.options,Ve.setOptions,Ve.use,Ve.walkTokens,Ve.parseInline,Ue.parse,qe.lex;const Fe=({content:n,noResult:r,postId:s,source:l,showFeedbackSection:i,questionBlock:a,isLoading:o,loadingQuery:c,loadingIndex:u,index:h,isNewResult:p,wrapper:d,feedbackSubmitted:g})=>{const f=p&&h===A.getResultInfo().length-1,m=(0,t.useRef)(null),[k,w]=(0,t.useState)(!1);(0,t.useEffect)((()=>{(f&&m.current||o)&&b()}),[f,o]);const b=()=>{const e=window.innerHeight-332;m.current.style.minHeight=`${e}px`;const t=d.current.scrollHeight;d.current.scrollBy({top:t,left:0,behavior:"smooth"}),w(!0)},{displayedText:x,isComplete:y}=S(n||"",50,k),v=(0,t.useMemo)((()=>{const e=(e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("p").forEach((e=>{const t=document.createDocumentFragment();for(;e.firstChild;)t.appendChild(e.firstChild);const n=document.createElement("br"),r=document.createElement("br");t.appendChild(n),t.appendChild(r),e.parentNode.replaceChild(t,e)})),t.body.innerHTML}return""})(x);return e?Ve(e):""}),[x]);return(0,e.createElement)("div",{ref:m,className:"helpcenter-response-block"},(0,e.createElement)(q,{noResult:r,isNewEntry:f,questionBlock:a}),(0,e.createElement)(_,{noResult:r,isNewEntry:f,content:v,isLoading:o,loadingQuery:c,loadingIndex:u,index:h,questionBlock:a,source:l}),!r&&!g&&i&&n&&y&&n.length>0&&(0,e.createElement)(T,{postId:s,source:l}))},Me=({isNewResult:n})=>{const r=(0,t.useRef)(null),s=window?.nfdHelpCenter?.resourceLink||"#",l=(0,h.__)('You can try searching our
    Resource center. though to see if there’s a helpful article or video on that subject.',"wp-module-help-center").replace("{link}",s);return(0,e.createElement)("div",{ref:r,className:"helpcenter-response-block"},(0,e.createElement)(q,{noResult:!0,isNewEntry:n}),(0,e.createElement)("div",{className:"helpcenter-result-block"},(0,e.createElement)("div",{className:"helpcenter-result-block__aistars"},(0,e.createElement)(z,null)),(0,e.createElement)("div",null,(0,e.createElement)("p",null,(0,h.__)("Sorry, I don’t have any information on that topic yet.","wp-module-help-center")),(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:l}}))))},Ge=({wrapper:t,noResult:n,loadingQuery:r,loadingIndex:s,isNewResult:l,isLoading:i,source:a,resultContent:o,resultsContainer:c,searchInput:u})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"hc-results-container",ref:c,style:{visibility:"hidden"}},o?.length>0&&o.map(((o,c)=>(0,e.createElement)(Fe,{key:c,content:o.resultContent,noResult:n,postId:o.postId,source:a,showFeedbackSection:!o.resultContent.includes("do not possess the answer"),questionBlock:o.searchInput,isLoading:i,loadingQuery:r,loadingIndex:s,index:c,isNewResult:l,searchInput:u,wrapper:t,feedbackSubmitted:o.feedbackSubmitted||!1}))),i&&(0,e.createElement)(Fe,{key:"loading",content:null,noResult:!1,postId:null,source:"ai",showFeedbackSection:!1,questionBlock:r,isLoading:i,loadingQuery:r,loadingIndex:s,index:o.length,isNewResult:l,searchInput:u,wrapper:t,feedbackSubmitted:!1}),n&&l&&(0,e.createElement)(Me,{isNewResult:l}))),Ye=({introRef:n})=>{const[r,s]=(0,t.useState)(!1);(0,t.useEffect)((()=>{s(A.getResultInfo().length<=0)}),[]);const l=(0,h.__)("Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.","wp-module-help-center"),{displayedText:i}=S(l||"",50,r);return(0,e.createElement)("div",{role:"region","aria-labelledby":"helpcenter-intro-heading",className:"helpcenter-intro",ref:n,style:{visibility:A.getResultInfo().length>0?"hidden":"visible"}},(0,e.createElement)("div",null,(0,e.createElement)(z,null)),(0,e.createElement)("div",{className:"helpcenter-intro__text",dangerouslySetInnerHTML:{__html:i}}))};var We;function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,e.createElement)("div",{role:"search","aria-label":(0,h.__)("Search Help Center","wp-module-help-center")},(0,e.createElement)("div",{className:"helpcenter-input-wrapper"},(0,e.createElement)("div",{className:"search-container__wrapper"},(0,e.createElement)("div",{className:"search-container"},(0,e.createElement)("input",{type:"text",id:"search-input-box",value:t,maxLength:"144",placeholder:(0,h.__)("Ask about WordPress","wp-module-help-center"),onChange:e=>n(e),onKeyDown:e=>"Enter"===e.key&&r()}),(0,e.createElement)("button",{"aria-label":(0,h.__)("submit text","wp-module-help-center"),title:(0,h.__)("submit text","wp-module-help-center"),onClick:()=>r()},(0,e.createElement)(Xe,null))),s&&(0,e.createElement)("p",{className:"hc-input-error-message"},s),(0,e.createElement)("div",{className:"attribute"},(0,e.createElement)("p",{className:"hc-input-counter"},(0,e.createElement)("span",null,t?t.length:0,"/144"))))));function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;tn?.hits?.length?(0,e.createElement)("div",{className:"suggestions-wrapper",id:"suggestionsWrapper",ref:t},n.hits.length>0&&(0,e.createElement)("p",null,(0,e.createElement)("b",null,(0,h.__)("Common Topics","wp-module-help-center"))),n.hits.map(((t,n)=>{var s;const l=null!==(s=t?.group_key?.[0])&&void 0!==s?s:"";return(0,e.createElement)("div",{className:"algolia-result",key:n,onClick:()=>((e,t)=>{r(e,t)})(t,l)},(0,e.createElement)("p",null,l),(0,e.createElement)("div",{className:"svg"},(0,e.createElement)($e,null)))}))):null,tt=n=>{const[r,s]=(0,t.useState)({visible:!1,helpEnabled:!1,noResult:!1,isNewResult:!1,source:"kb",searchInput:A.getSearchInput(),isLoading:!1,loadingQuery:null,loadingIndex:null,resultContent:[],multiResults:{},showSuggestions:!1,initComplete:!1,errorMsg:""}),l=(0,t.useRef)(),i=(0,t.useRef)(),a=(0,t.useRef)(),o=(0,t.useRef)(),c=(()=>{const e=window.NewfoldRuntime?.plugin?.brand||"wordpress";return e.includes("hostgator")&&window.NewfoldRuntime?.plugin?.region?e+"-"+window.NewfoldRuntime?.plugin?.region:e})();(0,t.useEffect)((()=>{u(),g();const e=()=>{s((e=>({...e,visible:A.getHelpVisible()})))};return window.addEventListener("storage",e),()=>{d.cancel(),window.removeEventListener("storage",e)}}),[]),(0,t.useEffect)((()=>{(r.initComplete||r.visible)&&setTimeout((()=>{!function(e,t,n){if(!e?.current)return;const r=e.current.scrollHeight;e.current.scrollBy({top:r,left:0,behavior:"auto"}),setTimeout((()=>{t?.current&&(t.current.style.visibility="visible"),n?.current&&(n.current.style.visibility="visible")}),100)}(a,o,i)}),100)}),[r.initComplete,r.visible]),(0,t.useEffect)((()=>{!function(e,t,n){let r=0;n&&t?.current&&(r=`${t.current.getBoundingClientRect().height}px`),e?.current&&(e.current.style.paddingBottom=r)}(a,l,r.showSuggestions)}),[r.showSuggestions]);const u=async()=>{try{const e=await(window.NewfoldRuntime?.capabilities?.canAccessHelpCenter||!1);s((t=>({...t,helpEnabled:e})))}catch(e){s((e=>({...e,helpEnabled:!1})))}},p=(e,t,n)=>{const r=e?function(e=""){return e.replace(/\n/g,"
    ")}(e):"";A.persistResult(r,t,n),s((e=>({...e,resultContent:A.getResultInfo()}))),t&&(s((e=>({...e,isNewResult:!!t,searchInput:""}))),I("help_search",{label_key:"term",term:n,page:window.location.href.toString()}))},d=(0,t.useMemo)((()=>(0,x.debounce)((async e=>{if(e)try{const t=await E(e,c),n=t?.results?.[0]?.grouped_hits;n&&s((e=>({...e,multiResults:{hits:n},showSuggestions:!!n})))}catch(e){console.error("Error fetching debounced results:",e)}else s((e=>({...e,multiResults:{},showSuggestions:!1})))}),500)),[]),g=async()=>{try{const e=A.getResultInfo();e&&s((t=>({...t,resultContent:e})));const t=await E(r.searchInput,c);s((e=>({...e,showSuggestions:!0,initComplete:!0,multiResults:{hits:t?.results?.[0]?.grouped_hits}})))}catch(e){console.error("Error fetching initial data:",e)}},f=e=>!!(e?.length>0&&function(e,t,n){const r=t/e.replace(/[^\w\s]|_/g,"").replace(/\s{2,}/g," ").trim().split(/\s+/).length;return n>=1&&r>=.99}(r.searchInput,e[0]?.text_match_info?.tokens_matched,e[0]?.text_match_info?.fields_matched))&&(p(e[0].document.post_content,e[0].document.post_id||e[0].document.id,r.searchInput),!0);return r.helpEnabled&&r.visible?(0,e.createElement)("div",{className:"nfd-help-center",id:"helpcenterResultsWrapper",ref:a},(0,e.createElement)(Ye,{introRef:o}),(0,e.createElement)(Ge,{...r,wrapper:a,introRef:o,resultsContainer:i,suggestionsRef:l,...n}),r.showSuggestions&&(0,e.createElement)(et,{suggestionsRef:l,multiResults:r.multiResults,handleSuggestionsClick:(e,t)=>{s((e=>({...e,showSuggestions:!1}))),p(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,t)}}),(0,e.createElement)(Ze,{searchInput:r.searchInput,handleOnChange:e=>{p("",void 0,e.target.value),d(e.target.value),s((t=>({...t,noResult:!1,errorMsg:"",searchInput:e.target.value})))},handleSubmit:async()=>{(()=>{const e=r.searchInput.trim().length>0;return s((t=>({...t,errorMsg:e?"":(0,h.__)("Please enter a specific search term to get results.","wp-module-help-center")}))),e})()&&await(async()=>{s((e=>({...e,isLoading:!0,showSuggestions:!1,loadingQuery:e.searchInput,loadingIndex:e.resultContent.length})));try{let e=r.multiResults?.hits?.[0]?.hits;const t=r.multiResults?.results?.[0]?.request_params?.q;if(r.searchInput===t&&f(e))return;const n=await E(r.searchInput,c);if(e=n?.results?.[0]?.grouped_hits?.[0]?.hits,f(e))return;const l=await v.getSearchResult(r.searchInput,"helpcenter");l.result[0]?(s((e=>({...e,source:"ai"}))),p(l.result[0].text,l.post_id,r.searchInput)):s((e=>({...e,noResult:!0})))}catch(e){console.error("An error occurred:",e),s((e=>({...e,noResult:!0,isNewResult:!0})))}finally{s((e=>({...e,searchInput:"",isLoading:!1,loadingIndex:null,loadingQuery:null,showSuggestions:!1}))),A.persistSearchInput(r.searchInput)}})()},errorMsg:r.errorMsg})):null};var nt;function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,t.useEffect)((()=>{const e=!window.newfoldHelpCenter?.closeOnLoad&&A.getHelpVisible();gt(e)}),[]),(0,e.createElement)("div",{role:"dialog","aria-labelledby":"helpcenter-modal-heading","aria-describedby":"helpcenter-modal-description","aria-modal":"true",className:"nfd-hc-modal"},(0,e.createElement)("div",{className:"nfd-hc-modal__header"},(0,e.createElement)("h3",{id:"helpcenter-modal-heading",className:"nfd-hc-modal__header__heading"},(0,e.createElement)("span",{className:"nfd-hc-modal__header__heading__icon"},(0,e.createElement)(b,null)),(0,e.createElement)("span",null,(0,h.__)("Help with WordPress","wp-module-help-center"))),(0,e.createElement)("button",{"aria-label":(0,h.__)("Close Help Modal","wp-module-help-center"),title:(0,h.__)("Close Help Modal","wp-module-help-center"),className:"nfd-hc-modal__header__close-button",onClick:()=>{n()}},(0,e.createElement)(k,{"aria-hidden":"true"}))),(0,e.createElement)("div",{id:"helpcenter-modal-description",className:"nfd-hc-modal__content"},(0,e.createElement)(tt,null)),(0,e.createElement)(ot,null)));var ut;function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&u.HiiveAnalytics.initialize({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"},dependencies:{wpData:l(),wpApiFetch:a()}})}));const dt=document.getElementById("wpcontent"),gt=e=>{dt.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),A.updateHelpVisible(e),window.dispatchEvent(new Event("storage")),e||A.clearSearchInput()};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=A.getHelpVisible();if(Object.is(e,void 0))return gt(!0),void I("help_sidebar_opened",{page:window.location.href.toString()});e||I("help_sidebar_opened",{page:window.location.href.toString()}),gt(!e)})()},renderEmbeddedHelp:()=>{const n=document.createElement("div");n.id="nfd-help-center",n.style.display="none",dt.appendChild(n);const r=document.getElementById("nfd-help-center");null!==r&&("undefined"!==t.createRoot?(0,t.createRoot)(r).render((0,e.createElement)(ct,{onClose:()=>{gt(!1)}})):"undefined"!==t.render&&(0,t.render)((0,e.createElement)(ct,{onClose:()=>{gt(!1)}}),r))}};const ft=(0,s.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?ft():c()((()=>{const n=document.querySelector(".edit-post-header__settings");if(!n)return;const r=document.createElement("div");r.id="nfd-help-menu-button-wrapper",r.classList.add("nfd-help-menu-button-wrapper");const s=n.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");s?n.insertBefore(r,s):n.appendChild(r);const l=(0,e.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,e.createElement)(pt,null));(0,t.render)(l,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=A.getHelpVisible();A.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),gt(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),s=document.getElementById("nfd-help-center");let l=0;const i=setInterval((()=>{if(l++,s&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(s)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(i)}else l>=5&&clearInterval(i)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))})()})(); \ No newline at end of file +(()=>{var e={974:(e,t)=>{(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{HiiveAnalytics:()=>I,HiiveEvent:()=>i});var r={};e.r(r),e.d(r,{initializeNamespace:()=>o,updateHiiveDebounceInstance:()=>d,updateHiiveDebounceTime:()=>p,updateHiiveEventsQueue:()=>u,updateHiiveEventsQueueThreshold:()=>h,updateHiiveUrls:()=>c});var s={};e.r(s),e.d(s,{getHiiveBatchUrl:()=>k,getHiiveDebounce:()=>w,getHiiveEventsQueue:()=>g,getHiiveEventsQueueThreshold:()=>f,getHiiveSingleUrl:()=>m});const l=window.wp.data;class i{constructor(e,t,n,r){this.category=e,this.action=t,this.data=n,this.namespace=r}}const a={urls:{single:void 0,batch:void 0},queue:{events:[],threshold:100},debounce:{time:void 0,instance:void 0}};function o(e){return{type:"INITIALIZE_NAMESPACE",namespace:e}}function c(e,t){return{type:"UPDATE_HIIVE_URLS",urls:e,namespace:t}}function u(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE",events:e,namespace:t}}function h(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD",threshold:e,namespace:t}}function p(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_TIME",debounceTime:e,namespace:t}}function d(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_INSTANCE",instance:e,namespace:t}}function g(e,t){return e.hiive[t]?.queue.events}function f(e,t){return e.hiive[t]?.queue.threshold}function m(e,t){return e.hiive[t]?.urls.single}function k(e,t){return e.hiive[t]?.urls.batch}function w(e,t){return e.hiive[t]?.debounce}const b={reducer:(0,l.combineReducers)({hiive:(e,t)=>{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:a};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:r,selectors:s},x=(0,l.createReduxStore)("newfold/ui-analytics",b);(0,l.register)(x);const y=window.wp.apiFetch;var v=e.n(y);const E=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,A=e=>e instanceof i,S=async e=>{if(!e||!E(e))return!1;const t=(0,l.select)(x).getHiiveBatchUrl(e);if(!t)return!1;const n=(0,l.select)(x).getHiiveEventsQueue(e);if(0===n.length)return!0;(0,l.dispatch)(x).updateHiiveEventsQueue([],e);try{await v()({url:t,method:"POST",data:n})}catch(t){console.error(t),(0,l.dispatch)(x).updateHiiveEventsQueue(n,e)}return!0},I={initialize:async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:s=100}={}}={}})=>!(!e||!E(e)&&(!t&&!n||((0,l.dispatch)(x).initializeNamespace(e),(0,l.dispatch)(x).updateHiiveUrls({single:t,batch:n},e),(0,l.dispatch)(x).updateHiiveDebounceTime(r,e),(0,l.dispatch)(x).updateHiiveEventsQueueThreshold(s,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}},0))),initialized:E,validate:A,track:e=>{if(!A(e)||!E(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,l.select)(x).getHiiveEventsQueue(t);n.push(e),(0,l.dispatch)(x).updateHiiveEventsQueue(n,t);const r=(0,l.select)(x).getHiiveEventsQueueThreshold(t);return r&&r{if(!e)return!1;const t=(0,l.select)(x).getHiiveDebounce(e);t.time&&(clearInterval(t.instance),(0,l.dispatch)(x).updateHiiveDebounceInstance(setTimeout((()=>{S(e),(0,l.dispatch)(x).updateHiiveDebounceInstance(void 0,e)}),t.time),e))})(t),!0},send:async e=>{if(!A(e)||!E(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,l.select)(x).getHiiveSingleUrl(t);if(!n)return!1;try{await v()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}},dispatchEvents:S,disableDebounce:e=>{if(!e)return!1;const t=(0,l.select)(x).getHiiveDebounce(e);return t.instance&&(clearInterval(t.instance),(0,l.dispatch)(x).updateHiiveDebounceInstance(void 0,e),(0,l.dispatch)(x).updateHiiveDebounceTime(void 0,e)),!0}};var R=t;for(var T in n)R[T]=n[T];n.__esModule&&Object.defineProperty(R,"__esModule",{value:!0})})()},452:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},i=l.iterator||"@@iterator",a=l.asyncIterator||"@@asyncIterator",o=l.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var l=t&&t.prototype instanceof k?t:k,i=Object.create(l.prototype),a=new C(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",d="suspendedYield",g="executing",f="completed",m={};function k(){}function w(){}function b(){}var x={};c(x,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(_([])));v&&v!==n&&r.call(v,i)&&(x=v);var E=b.prototype=k.prototype=Object.create(x);function A(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(s,l,i,a){var o=h(e[s],e,l);if("throw"!==o.type){var c=o.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,a)}),(function(e){n("throw",e,i,a)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,a)}))}a(o.arg)}var l;s(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,s){n(e,r,t,s)}))}return l=l?l.then(s,s):s()}})}function I(e,n,r){var s=p;return function(l,i){if(s===g)throw new Error("Generator is already running");if(s===f){if("throw"===l)throw i;return{value:t,done:!0}}for(r.method=l,r.arg=i;;){var a=r.delegate;if(a){var o=R(a,r);if(o){if(o===m)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(s===p)throw s=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);s=g;var c=h(e,n,r);if("normal"===c.type){if(s=r.done?f:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(s=f,r.method="throw",r.arg=c.arg)}}}function R(e,n){var r=n.method,s=e.iterator[r];if(s===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var l=h(s,e.iterator,n.arg);if("throw"===l.type)return n.method="throw",n.arg=l.arg,n.delegate=null,m;var i=l.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function _(e){if(null!=e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,l=function n(){for(;++s=0;--l){var i=this.tryEntries[l],a=i.completion;if("root"===i.tryLoc)return s("end");if(i.tryLoc<=this.prev){var o=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(o&&c){if(this.prev=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var s=r.arg;N(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{toggleHelp:()=>gt});const e=window.React;n(452);const t=window.wp.element,s=window.wp.data;var l=n.n(s);const i=window.wp.apiFetch;var a=n.n(i);const o=window.wp.domReady;var c=n.n(o),u=n(974);const h=window.wp.i18n;var p,d;function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;ta()({path:y+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>a()({path:y+"/search/default",method:"POST"})},E=async(e,t)=>{try{return await a()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error in getMultiSearchResults:",e),{}}},A={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t,n)=>{if(!e||""===e.trim())return;const r=A.getResultInfo(),s={searchInput:n,resultContent:e,postId:t};r.push(s),localStorage.setItem("helpResultContent",JSON.stringify(r))},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>{const e=localStorage.getItem("helpResultContent");return e&&R(e)?JSON.parse(e):[]},getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag:e=>localStorage.getItem(e),clearSearchInput(){localStorage.removeItem("searchInput")},setFeatureFlag(e,t){localStorage.setItem(e,t)},updateFeedbackStatus:e=>{const t=A.getResultInfo().map((t=>t.postId===e?{...t,feedbackSubmitted:!0}:t));localStorage.setItem("helpResultContent",JSON.stringify(t))}},S=(e,t)=>{const n=new u.HiiveEvent("wonder_help",e,t,"wonder_help");u.HiiveAnalytics.send(n)},I=(e,n=100,r=!1)=>{const[s,l]=(0,t.useState)(""),[i,a]=(0,t.useState)(!1);return(0,t.useEffect)((()=>{if(!e)return l(""),void a(!1);if(r){const t=e.trim().split(" ").filter(Boolean);let r=0;l(t[0]),a(!1);const s=setInterval((()=>{re+" "+t[r]))):(clearInterval(s),a(!0))}),n);return()=>clearInterval(s)}l(e),a(!0)}),[e,n,r]),{displayedText:s,isComplete:i}},R=e=>{try{return JSON.parse(e),!0}catch(e){return!1}},T=({postId:n,source:r})=>{const[s,l]=(0,t.useState)(""),[i,o]=(0,t.useState)(!1),[c,u]=(0,t.useState)(!1),p=(0,t.useRef)(null),d=(0,t.useRef)(null);(0,t.useEffect)((()=>{l(""),d.current.className="feedback-button no",p.current.className="feedback-button yes"}),[n]),(0,t.useEffect)((()=>{if((async()=>{"helpful"!==s&&"notHelpful"!==s||(((e,t)=>{a()({path:"nfd-help-center/v1/feedback",method:"POST",data:{post_id:e,status:t}})})(n,s),S("help_feedback_submitted",{label_key:"type",type:"helpful"===s?"positive":"negative",source:r,post_id:n,page:window.location.href.toString()}))})(),"helpful"===s||"notHelpful"===s){o(!0),u(!0);const e=setTimeout((()=>{u(!1)}),3e3);return()=>clearTimeout(e)}}),[s]);const g=e=>{l(e),A.updateFeedbackStatus(n)};return(0,e.createElement)("div",{className:"feedback-container"},!i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"feedback-question"},(0,e.createElement)("p",null,(0,h.__)("Did this result help you?","wp-module-help-center"))),(0,e.createElement)("div",{className:"icon"},(0,e.createElement)("button",{ref:p,onClick:()=>g("helpful"),className:"feedback-button yes"},(0,h.__)("Yes","wp-module-help-center")),(0,e.createElement)("button",{onClick:()=>g("notHelpful"),ref:d,className:"feedback-button no"},(0,h.__)("No","wp-module-help-center")))),i&&c&&(0,e.createElement)("div",{className:"thanks-message"},(0,h.__)("Thanks for the feedback!","wp-module-help-center")))};var N;function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?(0,e.createElement)("p",{className:"helpcenter-results",dangerouslySetInnerHTML:{__html:a}}):null))};var L,H;function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t"']/,B=new RegExp(U.source,"g"),D=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,V=new RegExp(D.source,"g"),M={"&":"&","<":"<",">":">",'"':""","'":"'"},F=e=>M[e];function G(e,t){if(t){if(U.test(e))return e.replace(B,F)}else if(D.test(e))return e.replace(V,F);return e}const Y=/(^|[^\[])\^/g;function W(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(Y,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function J(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const X={exec:()=>null};function Z(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:K(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=K(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:K(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],"\n").split("\n"),n="",r="";const s=[];for(;e.length>0;){let t=!1;const l=[];let i;for(i=0;i/.test(e[i]))l.push(e[i]),t=!0;else{if(t)break;l.push(e[i])}e=e.slice(i);const a=l.join("\n"),o=a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${o}`:o;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,s,!0),this.lexer.state.top=c,0===e.length)break;const u=s[s.length-1];if("code"===u?.type)break;if("blockquote"===u?.type){const t=u,l=t.raw+"\n"+e.join("\n"),i=this.blockquote(l);s[s.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"!==u?.type);else{const t=u,l=t.raw+"\n"+e.join("\n"),i=this.list(l);s[s.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=l.substring(s[s.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i=!1;for(;e;){let n=!1,r="",a="";if(!(t=l.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let o=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!o.trim(),h=0;if(this.options.pedantic?(h=2,a=o.trimStart()):u?h=t[1].length+1:(h=t[2].search(/[^ ]/),h=h>4?1:h,a=o.slice(h),h+=t[1].length),u&&/^ *$/.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),l=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const i=e.split("\n",1)[0];if(c=i,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(c))break;if(l.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())a+="\n"+c.slice(h);else{if(u)break;if(o.search(/[^ ]/)>=4)break;if(s.test(o))break;if(l.test(o))break;if(n.test(o))break;a+="\n"+c}u||c.trim()||(u=!0),r+=i+"\n",e=e.substring(i.length+1),o=c.slice(h)}}s.loose||(i?s.loose=!0:/\n *\n *$/.test(r)&&(i=!0));let p,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(a),d&&(p="[ ] "!==d[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:r,task:!!d,checked:p,loose:!1,text:a,tokens:[]}),s.raw+=r}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=Z(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?l.align.push("right"):/^ *:-+: *$/.test(e)?l.align.push("center"):/^ *:-+ *$/.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]}))));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:G(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=K(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),$(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return $(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let s,l,i=n,a=0;const o="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=o.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){i+=l;continue}if((r[5]||r[6])&&n%3&&!((n+l)%3)){a+=l;continue}if(i-=l,i>0)continue;l=Math.min(l,l+i+a);const t=[...r[0]][0].length,o=e.slice(0,n+r.index+t+l);if(Math.min(n,l)%2){const e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}const c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=G(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=G(t[1]),n="mailto:"+e):(e=G(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=G(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=G(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:G(t[0]),{type:"text",raw:t[0],text:e}}}}const te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ne=/(?:[*+-]|\d{1,9}[.)])/,re=W(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ne).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),se=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie=W(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=W(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),oe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce=/|$))/,ue=W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",ce).replace("tag",oe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=W(se).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),pe={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",he).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ie,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:te,html:ue,lheading:re,list:ae,newline:/^(?: *(?:\n|$))+/,paragraph:he,table:X,text:/^[^\n]+/},de=W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),ge={...pe,table:de,paragraph:W(se).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",de).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex()},fe={...pe,html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ce).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(se).replace("hr",te).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},me=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ke=/^( {2,}|\\)\n(?!\s*$)/,we="\\p{P}\\p{S}",be=W(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,we).getRegex(),xe=W(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,we).getRegex(),ye=W("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,we).getRegex(),ve=W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,we).getRegex(),Ee=W(/\\([punct])/,"gu").replace(/punct/g,we).getRegex(),Ae=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Se=W(ce).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ie=W("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Se).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Te=W(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ne=W(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),Ce=W(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),_e={_backpedal:X,anyPunctuation:Ee,autolink:Ae,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:ke,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:X,emStrongLDelim:xe,emStrongRDelimAst:ye,emStrongRDelimUnd:ve,escape:me,link:Te,nolink:Ce,punctuation:be,reflink:Ne,reflinkSearch:W("reflink|nolink(?!\\()","g").replace("reflink",Ne).replace("nolink",Ce).getRegex(),tag:Ie,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(r):(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(s.raw+="\n"+r.raw,s.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(l=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(l=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(l)))s=t[t.length-1],n&&"paragraph"===s?.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r),n=l.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,l,i,a,o=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(o));)e.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(o));)o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.anyPunctuation.exec(o));)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,o,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class qe{options;parser;constructor(e){this.options=e||q}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return r?'
    '+(n?s:G(s,!0))+"
    \n":"
    "+(n?s:G(s,!0))+"
    \n"}blockquote({tokens:e}){return`
    \n${this.parser.parse(e)}
    \n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
    \n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=J(e);if(null===s)return r;let l='
    ",l}image({href:e,title:t,text:n}){const r=J(e);if(null===r)return n;let s=`${n}{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new qe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,s=e.renderer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ee(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Be;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],l=t[r];Be.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>l.call(t,e)));const n=s.call(t,e);return l.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Qe.lex(e,t??this.defaults)}parser(e,t){return Ue.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const s={...r},l={...this.defaults,...s},i=this.onError(!!l.silent,!!l.async);if(!0===this.defaults.async&&!1===s.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l),l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then((t=>e(t,l))).then((e=>l.hooks?l.hooks.processAllTokens(e):e)).then((e=>l.walkTokens?Promise.all(this.walkTokens(e,l.walkTokens)).then((()=>e)):e)).then((e=>t(e,l))).then((e=>l.hooks?l.hooks.postprocess(e):e)).catch(i);try{l.hooks&&(n=l.hooks.preprocess(n));let r=e(n,l);l.hooks&&(r=l.hooks.processAllTokens(r)),l.walkTokens&&this.walkTokens(r,l.walkTokens);let s=t(r,l);return l.hooks&&(s=l.hooks.postprocess(s)),s}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+G(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ve(e,t){return De.parse(e,t)}Ve.options=Ve.setOptions=function(e){return De.setOptions(e),Ve.defaults=De.defaults,O(Ve.defaults),Ve},Ve.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},Ve.defaults=q,Ve.use=function(...e){return De.use(...e),Ve.defaults=De.defaults,O(Ve.defaults),Ve},Ve.walkTokens=function(e,t){return De.walkTokens(e,t)},Ve.parseInline=De.parseInline,Ve.Parser=Ue,Ve.parser=Ue.parse,Ve.Renderer=qe,Ve.TextRenderer=Oe,Ve.Lexer=Qe,Ve.lexer=Qe.lex,Ve.Tokenizer=ee,Ve.Hooks=Be,Ve.parse=Ve,Ve.options,Ve.setOptions,Ve.use,Ve.walkTokens,Ve.parseInline,Ue.parse,Qe.lex;const Me=({content:n,noResult:r,postId:s,source:l,showFeedbackSection:i,questionBlock:a,isLoading:o,loadingQuery:c,loadingIndex:u,index:h,isNewResult:p,wrapper:d,feedbackSubmitted:g})=>{const f=p&&h===A.getResultInfo().length-1,m=(0,t.useRef)(null),[k,w]=(0,t.useState)(!1);(0,t.useEffect)((()=>{(f&&m.current||o)&&b()}),[f,o]);const b=()=>{const e=window.innerHeight-332;m.current.style.minHeight=`${e}px`;const t=d.current.scrollHeight;d.current.scrollBy({top:t,left:0,behavior:"smooth"}),w(!0)},{displayedText:x,isComplete:y}=I(n||"",50,k),v=(0,t.useMemo)((()=>{const e=(e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("p").forEach((e=>{const t=document.createDocumentFragment();for(;e.firstChild;)t.appendChild(e.firstChild);const n=document.createElement("br"),r=document.createElement("br");t.appendChild(n),t.appendChild(r),e.parentNode.replaceChild(t,e)})),t.body.innerHTML}return""})(x);return e?Ve(e):""}),[x]);return(0,e.createElement)("div",{ref:m,className:"helpcenter-response-block"},(0,e.createElement)(Q,{noResult:r,isNewEntry:f,questionBlock:a}),(0,e.createElement)(z,{noResult:r,isNewEntry:f,content:v,isLoading:o,loadingQuery:c,loadingIndex:u,index:h,questionBlock:a,source:l}),!r&&!g&&i&&n&&y&&n.length>0&&(0,e.createElement)(T,{postId:s,source:l}))},Fe=({isNewResult:n})=>{const r=(0,t.useRef)(null),s=window?.nfdHelpCenter?.resourceLink||"#",l=(0,h.__)('You can try searching our
    Resource center. though to see if there’s a helpful article or video on that subject.',"wp-module-help-center").replace("{link}",s);return(0,e.createElement)("div",{ref:r,className:"helpcenter-response-block"},(0,e.createElement)(Q,{noResult:!0,isNewEntry:n}),(0,e.createElement)("div",{className:"helpcenter-result-block"},(0,e.createElement)("div",{className:"helpcenter-result-block__aistars"},(0,e.createElement)(_,null)),(0,e.createElement)("div",null,(0,e.createElement)("p",null,(0,h.__)("Sorry, I don’t have any information on that topic yet.","wp-module-help-center")),(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:l}}))))},Ge=({wrapper:t,noResult:n,loadingQuery:r,loadingIndex:s,isNewResult:l,isLoading:i,source:a,resultContent:o,resultsContainer:c,searchInput:u})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"hc-results-container",ref:c,style:{visibility:"hidden"}},o?.length>0&&o.map(((o,c)=>(0,e.createElement)(Me,{key:c,content:o.resultContent,noResult:n,postId:o.postId,source:a,showFeedbackSection:!o.resultContent.includes("do not possess the answer"),questionBlock:o.searchInput,isLoading:i,loadingQuery:r,loadingIndex:s,index:c,isNewResult:l,searchInput:u,wrapper:t,feedbackSubmitted:o.feedbackSubmitted||!1}))),i&&(0,e.createElement)(Me,{key:"loading",content:null,noResult:!1,postId:null,source:"ai",showFeedbackSection:!1,questionBlock:r,isLoading:i,loadingQuery:r,loadingIndex:s,index:o.length,isNewResult:l,searchInput:u,wrapper:t,feedbackSubmitted:!1}),n&&l&&(0,e.createElement)(Fe,{isNewResult:l}))),Ye=({introRef:n})=>{const[r,s]=(0,t.useState)(!1);(0,t.useEffect)((()=>{s(A.getResultInfo().length<=0)}),[]);const l=(0,h.__)("Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.","wp-module-help-center"),{displayedText:i}=I(l||"",50,r);return(0,e.createElement)("div",{role:"region","aria-labelledby":"helpcenter-intro-heading",className:"helpcenter-intro",ref:n,style:{visibility:A.getResultInfo().length>0?"hidden":"visible"}},(0,e.createElement)("div",null,(0,e.createElement)(_,null)),(0,e.createElement)("div",{className:"helpcenter-intro__text",dangerouslySetInnerHTML:{__html:i}}))};var We;function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,e.createElement)("div",{role:"search","aria-label":(0,h.__)("Search Help Center","wp-module-help-center")},(0,e.createElement)("div",{className:"helpcenter-input-wrapper"},(0,e.createElement)("div",{className:"search-container__wrapper"},(0,e.createElement)("div",{className:"search-container"},(0,e.createElement)("input",{type:"text",id:"search-input-box",value:t,maxLength:"144",placeholder:(0,h.__)("Ask about WordPress","wp-module-help-center"),onChange:e=>n(e),onKeyDown:e=>"Enter"===e.key&&r()}),(0,e.createElement)("button",{"aria-label":(0,h.__)("submit text","wp-module-help-center"),title:(0,h.__)("submit text","wp-module-help-center"),onClick:()=>r()},(0,e.createElement)(Xe,null))),s&&(0,e.createElement)("p",{className:"hc-input-error-message"},s),(0,e.createElement)("div",{className:"attribute"},(0,e.createElement)("p",{className:"hc-input-counter"},(0,e.createElement)("span",null,t?t.length:0,"/144"))))));function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;tn?.hits?.length?(0,e.createElement)("div",{className:"suggestions-wrapper",id:"suggestionsWrapper",ref:t},n.hits.length>0&&(0,e.createElement)("p",null,(0,e.createElement)("b",null,(0,h.__)("Common Topics","wp-module-help-center"))),n.hits.map(((t,n)=>{var s;const l=null!==(s=t?.group_key?.[0])&&void 0!==s?s:"";return(0,e.createElement)("div",{className:"algolia-result",key:n,onClick:()=>((e,t)=>{r(e,t)})(t,l)},(0,e.createElement)("p",null,l),(0,e.createElement)("div",{className:"svg"},(0,e.createElement)($e,null)))}))):null,tt=n=>{const[r,s]=(0,t.useState)({visible:!1,helpEnabled:!1,noResult:!1,isNewResult:!1,source:"kb",searchInput:A.getSearchInput(),isLoading:!1,loadingQuery:null,loadingIndex:null,resultContent:[],multiResults:{},showSuggestions:!1,initComplete:!1,errorMsg:""}),l=(0,t.useRef)(),i=(0,t.useRef)(),a=(0,t.useRef)(),o=(0,t.useRef)(),c=(()=>{const e=window.NewfoldRuntime?.plugin?.brand||"wordpress";return e.includes("hostgator")&&window.NewfoldRuntime?.plugin?.region?e+"-"+window.NewfoldRuntime?.plugin?.region:e})();(0,t.useEffect)((()=>{u(),g();const e=()=>{s((e=>({...e,visible:A.getHelpVisible()})))};return window.addEventListener("storage",e),()=>{d.cancel(),window.removeEventListener("storage",e)}}),[]),(0,t.useEffect)((()=>{(r.initComplete||r.visible)&&setTimeout((()=>{!function(e,t,n){if(!e?.current)return;const r=e.current.scrollHeight;e.current.scrollBy({top:r,left:0,behavior:"auto"}),setTimeout((()=>{t?.current&&(t.current.style.visibility="visible"),n?.current&&(n.current.style.visibility="visible")}),100)}(a,o,i)}),100)}),[r.initComplete,r.visible]),(0,t.useEffect)((()=>{!function(e,t,n){let r=0;n&&t?.current&&(r=`${t.current.getBoundingClientRect().height}px`),e?.current&&(e.current.style.paddingBottom=r)}(a,l,r.showSuggestions)}),[r.showSuggestions]);const u=async()=>{try{const e=await(window.NewfoldRuntime?.capabilities?.canAccessHelpCenter||!1);s((t=>({...t,helpEnabled:e})))}catch(e){s((e=>({...e,helpEnabled:!1})))}},p=(e,t,n)=>{const r=e?function(e=""){return e.replace(/\n/g,"
    ")}(e):"";A.persistResult(r,t,n),s((e=>({...e,resultContent:A.getResultInfo()}))),t&&(s((e=>({...e,isNewResult:!!t,searchInput:""}))),S("help_search",{label_key:"term",term:n,page:window.location.href.toString()}))},d=(0,t.useMemo)((()=>(0,x.debounce)((async e=>{if(e)try{const t=await E(e,c),n=t?.results?.[0]?.grouped_hits;n&&s((e=>({...e,multiResults:{hits:n},showSuggestions:!!n})))}catch(e){console.error("Error fetching debounced results:",e)}else s((e=>({...e,multiResults:{},showSuggestions:!1})))}),500)),[]),g=async()=>{try{const e=A.getResultInfo();e&&s((t=>({...t,resultContent:e})));const t=await E(r.searchInput,c);s((e=>({...e,showSuggestions:!0,initComplete:!0,multiResults:{hits:t?.results?.[0]?.grouped_hits}})))}catch(e){console.error("Error fetching initial data:",e)}},f=e=>!!(e?.length>0&&function(e,t,n){const r=t/e.replace(/[^\w\s]|_/g,"").replace(/\s{2,}/g," ").trim().split(/\s+/).length;return n>=1&&r>=.99}(r.searchInput,e[0]?.text_match_info?.tokens_matched,e[0]?.text_match_info?.fields_matched))&&(p(e[0].document.post_content,e[0].document.post_id||e[0].document.id,r.searchInput),!0);return r.helpEnabled&&r.visible?(0,e.createElement)("div",{className:"nfd-help-center",id:"helpcenterResultsWrapper",ref:a},(0,e.createElement)(Ye,{introRef:o}),(0,e.createElement)(Ge,{...r,wrapper:a,introRef:o,resultsContainer:i,suggestionsRef:l,...n}),r.showSuggestions&&(0,e.createElement)(et,{suggestionsRef:l,multiResults:r.multiResults,handleSuggestionsClick:(e,t)=>{s((e=>({...e,showSuggestions:!1}))),p(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,t)}}),(0,e.createElement)(Ze,{searchInput:r.searchInput,handleOnChange:e=>{p("",void 0,e.target.value),d(e.target.value),s((t=>({...t,noResult:!1,errorMsg:"",searchInput:e.target.value})))},handleSubmit:async()=>{(()=>{const e=r.searchInput.trim().length>0;return s((t=>({...t,errorMsg:e?"":(0,h.__)("Please enter a specific search term to get results.","wp-module-help-center")}))),e})()&&await(async()=>{s((e=>({...e,isLoading:!0,showSuggestions:!1,loadingQuery:e.searchInput,loadingIndex:e.resultContent.length})));try{let e=r.multiResults?.hits?.[0]?.hits;const t=r.multiResults?.results?.[0]?.request_params?.q;if(r.searchInput===t&&f(e))return;const n=await E(r.searchInput,c);if(e=n?.results?.[0]?.grouped_hits?.[0]?.hits,f(e))return;const l=await v.getSearchResult(r.searchInput,"helpcenter");l.result[0]?(s((e=>({...e,source:"ai"}))),p(l.result[0].text,l.post_id,r.searchInput)):s((e=>({...e,noResult:!0})))}catch(e){console.error("An error occurred:",e),s((e=>({...e,noResult:!0,isNewResult:!0})))}finally{s((e=>({...e,searchInput:"",isLoading:!1,loadingIndex:null,loadingQuery:null,showSuggestions:!1}))),A.persistSearchInput(r.searchInput)}})()},errorMsg:r.errorMsg})):null};var nt;function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,t.useEffect)((()=>{const e=!window.newfoldHelpCenter?.closeOnLoad&&A.getHelpVisible();gt(e)}),[]),(0,e.createElement)("div",{role:"dialog","aria-labelledby":"helpcenter-modal-heading","aria-describedby":"helpcenter-modal-description","aria-modal":"true",className:"nfd-hc-modal"},(0,e.createElement)("div",{className:"nfd-hc-modal__header"},(0,e.createElement)("h3",{id:"helpcenter-modal-heading",className:"nfd-hc-modal__header__heading"},(0,e.createElement)("span",{className:"nfd-hc-modal__header__heading__icon"},(0,e.createElement)(b,null)),(0,e.createElement)("span",null,(0,h.__)("Help with WordPress","wp-module-help-center"))),(0,e.createElement)("button",{"aria-label":(0,h.__)("Close Help Modal","wp-module-help-center"),title:(0,h.__)("Close Help Modal","wp-module-help-center"),className:"nfd-hc-modal__header__close-button",onClick:()=>{n()}},(0,e.createElement)(k,{"aria-hidden":"true"}))),(0,e.createElement)("div",{id:"helpcenter-modal-description",className:"nfd-hc-modal__content"},(0,e.createElement)(tt,null)),(0,e.createElement)(ot,null)));var ut;function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&u.HiiveAnalytics.initialize({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"},dependencies:{wpData:l(),wpApiFetch:a()}})}));const dt=document.getElementById("wpcontent"),gt=e=>{dt.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),A.updateHelpVisible(e),window.dispatchEvent(new Event("storage")),e||A.clearSearchInput()};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=A.getHelpVisible();if(Object.is(e,void 0))return gt(!0),void S("help_sidebar_opened",{page:window.location.href.toString()});e||S("help_sidebar_opened",{page:window.location.href.toString()}),gt(!e)})()},renderEmbeddedHelp:()=>{const n=document.createElement("div");n.id="nfd-help-center",n.style.display="none",dt.appendChild(n);const r=document.getElementById("nfd-help-center");null!==r&&("undefined"!==t.createRoot?(0,t.createRoot)(r).render((0,e.createElement)(ct,{onClose:()=>{gt(!1)}})):"undefined"!==t.render&&(0,t.render)((0,e.createElement)(ct,{onClose:()=>{gt(!1)}}),r))}};const ft=(0,s.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?ft():c()((()=>{const n=document.querySelector(".edit-post-header__settings");if(!n)return;const r=document.createElement("div");r.id="nfd-help-menu-button-wrapper",r.classList.add("nfd-help-menu-button-wrapper");const s=n.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");s?n.insertBefore(r,s):n.appendChild(r);const l=(0,e.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,e.createElement)(pt,null));(0,t.render)(l,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=A.getHelpVisible();A.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),gt(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),s=document.getElementById("nfd-help-center");let l=0;const i=setInterval((()=>{if(l++,s&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(s)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(i)}else l>=5&&clearInterval(i)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))})();var s=exports;for(var l in r)s[l]=r[l];r.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/composer.json b/composer.json index a900785..0079c17 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ } ], "require-dev": { - "newfold-labs/wp-php-standards": "@stable" + "newfold-labs/wp-php-standards": "@stable", + "wp-cli/i18n-command": "^2.6.3" }, "require": { "newfold-labs/wp-module-ai": "^1.1.13", @@ -43,5 +44,19 @@ "platform": { "php": "7.3" } + }, + "scripts": { + "fix": "vendor/bin/phpcbf --standard=phpcs.xml .", + "i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-module-help-center.pot --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/newfold-labs/wp-module-help-center/issues\",\"POT-Creation-Date\":\"2025-02-13T09:55:55+00:00\"}' --exclude=tests,src", + "i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-module-help-center.pot ./languages", + "i18n-php": "vendor/bin/wp i18n make-php ./languages", + "i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print", + "i18n": [ + "@i18n-pot", + "@i18n-po", + "@i18n-php", + "@i18n-json" + ], + "lint": "vendor/bin/phpcs --standard=phpcs.xml -s ." } } diff --git a/composer.lock b/composer.lock index f3ad343..5f03cf8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4d029722ca9100fc02c27852b786be17", + "content-hash": "de2b4340e9a0d701273cfd85d8913b5a", "packages": [ { "name": "doctrine/inflector", @@ -104,34 +104,36 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.3.0", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "7008573787b430c1c1f650e3722d9bba59967628" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", - "reference": "7008573787b430c1c1f650e3722d9bba59967628", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7 || ^2.0", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0" + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "psr/log": "^1.1" + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { "ext-curl": "Required for CURL handler support", @@ -140,8 +142,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.3-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -157,19 +160,43 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", @@ -183,7 +210,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.3.0" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -195,41 +222,41 @@ "type": "github" }, { - "url": "https://github.com/alexeyshockov", - "type": "github" - }, - { - "url": "https://github.com/gmponos", - "type": "github" + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" } ], - "time": "2021-03-23T11:33:13+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -266,7 +293,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.3" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -282,7 +309,7 @@ "type": "tidelift" } ], - "time": "2023-05-21T12:31:43+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", @@ -540,16 +567,16 @@ }, { "name": "newfold-labs/wp-module-data", - "version": "2.6.9", + "version": "2.6.10", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-data.git", - "reference": "368b604257780658caa4d83c3cc15f8fa2d48ffa" + "reference": "ddafe7e2fe8f9e71ffdd898b00f5c3f6e5d92070" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/368b604257780658caa4d83c3cc15f8fa2d48ffa", - "reference": "368b604257780658caa4d83c3cc15f8fa2d48ffa", + "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/ddafe7e2fe8f9e71ffdd898b00f5c3f6e5d92070", + "reference": "ddafe7e2fe8f9e71ffdd898b00f5c3f6e5d92070", "shasum": "" }, "require": { @@ -636,10 +663,10 @@ ], "description": "Newfold Data Module", "support": { - "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.9", + "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.10", "issues": "https://github.com/newfold-labs/wp-module-data/issues" }, - "time": "2025-01-22T18:55:15+00:00" + "time": "2025-02-06T18:33:49+00:00" }, { "name": "newfold-labs/wp-module-features", @@ -1041,6 +1068,73 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:11:13+00:00" + }, { "name": "typesense/typesense-php", "version": "v2.0.4", @@ -1446,210 +1540,522 @@ "time": "2023-01-05T11:28:13+00:00" }, { - "name": "newfold-labs/wp-php-standards", - "version": "1.2.4", + "name": "eftec/bladeone", + "version": "3.52", "source": { "type": "git", - "url": "https://github.com/newfold-labs/wp-php-standards.git", - "reference": "7ef8833b93f8bcdf52c6006f3adb53972d0799a6" + "url": "https://github.com/EFTEC/BladeOne.git", + "reference": "a19bf66917de0b29836983db87a455a4f6e32148" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-php-standards/zipball/7ef8833b93f8bcdf52c6006f3adb53972d0799a6", - "reference": "7ef8833b93f8bcdf52c6006f3adb53972d0799a6", + "url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148", + "reference": "a19bf66917de0b29836983db87a455a4f6e32148", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "@stable", - "phpcompatibility/phpcompatibility-wp": "@stable", - "squizlabs/php_codesniffer": "@stable", - "wp-coding-standards/wpcs": "@stable" + "ext-json": "*", + "php": ">=5.6" }, - "type": "phpcodesniffer-standard", + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16.1", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.5.4" + }, + "suggest": { + "eftec/bladeonehtml": "Extension to create forms", + "ext-mbstring": "This extension is used if it's active" + }, + "type": "library", + "autoload": { + "psr-4": { + "eftec\\bladeone\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-or-later" + "MIT" ], "authors": [ { - "name": "Micah Wood", - "email": "micah@wpscholar.com" + "name": "Jorge Patricio Castro Castillo", + "email": "jcastro@eftec.cl" } ], - "description": "PHP Code Sniffer Standards for Newfold WordPress projects.", + "description": "The standalone version Blade Template Engine from Laravel in a single php file", + "homepage": "https://github.com/EFTEC/BladeOne", + "keywords": [ + "blade", + "php", + "template", + "templating", + "view" + ], "support": { - "source": "https://github.com/newfold-labs/wp-php-standards/tree/1.2.4", - "issues": "https://github.com/newfold-labs/wp-php-standards/issues" + "issues": "https://github.com/EFTEC/BladeOne/issues", + "source": "https://github.com/EFTEC/BladeOne/tree/3.52" }, - "time": "2024-07-22T23:16:21+00:00" + "time": "2021-04-17T13:49:01+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "gettext/gettext", + "version": "v4.8.12", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/php-gettext/Gettext.git", + "reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/11af89ee6c087db3cf09ce2111a150bca5c46e12", + "reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "gettext/languages": "^2.3", + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "illuminate/view": "^5.0.x-dev", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0", + "symfony/yaml": "~2", + "twig/extensions": "*", + "twig/twig": "^1.31|^2.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "illuminate/view": "Is necessary if you want to use the Blade extractor", + "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator", + "twig/extensions": "Is necessary if you want to use the Twig extractor", + "twig/twig": "Is necessary if you want to use the Twig extractor" + }, + "type": "library", + "autoload": { + "psr-4": { + "Gettext\\": "src" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "PHP gettext manager", + "homepage": "https://github.com/oscarotero/Gettext", "keywords": [ - "compatibility", - "phpcs", - "standards" + "JS", + "gettext", + "i18n", + "mo", + "po", + "translation" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Gettext/issues", + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.12" }, - "time": "2019-12-27T09:44:58+00:00" + "funding": [ + { + "url": "https://paypal.me/oscarotero", + "type": "custom" + }, + { + "url": "https://github.com/oscarotero", + "type": "github" + }, + { + "url": "https://www.patreon.com/misteroom", + "type": "patreon" + } + ], + "time": "2024-05-18T10:25:07+00:00" }, { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", + "name": "gettext/languages", + "version": "2.10.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + "url": "https://github.com/php-gettext/Languages.git", + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "url": "https://api.github.com/repos/php-gettext/Languages/zipball/4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0" + "php": ">=5.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "bin": [ + "bin/export-plural-rules" + ], + "type": "library", + "autoload": { + "psr-4": { + "Gettext\\Languages\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Michele Locati", + "email": "mlocati@gmail.com", + "role": "Developer" } ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", + "description": "gettext languages with plural rules", + "homepage": "https://github.com/php-gettext/Languages", "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards", - "static analysis" + "cldr", + "i18n", + "internationalization", + "l10n", + "language", + "languages", + "localization", + "php", + "plural", + "plural rules", + "plurals", + "translate", + "translations", + "unicode" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + "issues": "https://github.com/php-gettext/Languages/issues", + "source": "https://github.com/php-gettext/Languages/tree/2.10.0" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", - "type": "github" + "url": "https://paypal.me/mlocati", + "type": "custom" }, { - "url": "https://github.com/jrfnl", + "url": "https://github.com/mlocati", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" } ], - "time": "2024-04-24T21:30:46+00:00" + "time": "2022-10-18T15:00:10+00:00" }, { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.6", + "name": "mck89/peast", + "version": "v1.16.3", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" + "url": "https://github.com/mck89/peast.git", + "reference": "645ec21b650bc2aced18285c85f220d22afc1430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", - "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", + "url": "https://api.github.com/repos/mck89/peast/zipball/645ec21b650bc2aced18285c85f220d22afc1430", + "reference": "645ec21b650bc2aced18285c85f220d22afc1430", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "ext-mbstring": "*", + "php": ">=5.4.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.16.3-dev" + } + }, + "autoload": { + "psr-4": { + "Peast\\": "lib/Peast/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" + "name": "Marco Marchiò", + "email": "marco.mm89@gmail.com" + } + ], + "description": "Peast is PHP library that generates AST for JavaScript code", + "support": { + "issues": "https://github.com/mck89/peast/issues", + "source": "https://github.com/mck89/peast/tree/v1.16.3" + }, + "time": "2024-07-23T14:00:32+00:00" + }, + { + "name": "mustache/mustache", + "version": "v2.14.2", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/mustache.php.git", + "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e62b7c3849d22ec55f3ec425507bf7968193a6cb", + "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~1.11", + "phpunit/phpunit": "~3.7|~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mustache": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "A Mustache implementation in PHP.", + "homepage": "https://github.com/bobthecow/mustache.php", + "keywords": [ + "mustache", + "templating" + ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/v2.14.2" + }, + "time": "2022-08-23T13:07:01+00:00" + }, + { + "name": "newfold-labs/wp-php-standards", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/newfold-labs/wp-php-standards.git", + "reference": "7ef8833b93f8bcdf52c6006f3adb53972d0799a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/newfold-labs/wp-php-standards/zipball/7ef8833b93f8bcdf52c6006f3adb53972d0799a6", + "reference": "7ef8833b93f8bcdf52c6006f3adb53972d0799a6", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "@stable", + "phpcompatibility/phpcompatibility-wp": "@stable", + "squizlabs/php_codesniffer": "@stable", + "wp-coding-standards/wpcs": "@stable" + }, + "type": "phpcodesniffer-standard", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Micah Wood", + "email": "micah@wpscholar.com" + } + ], + "description": "PHP Code Sniffer Standards for Newfold WordPress projects.", + "support": { + "source": "https://github.com/newfold-labs/wp-php-standards/tree/1.2.4", + "issues": "https://github.com/newfold-labs/wp-php-standards/issues" + }, + "time": "2024-07-22T23:16:21+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.6", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" }, { "name": "Juliette Reinders Folmer", @@ -1936,6 +2342,402 @@ ], "time": "2025-01-23T17:04:15+00:00" }, + { + "name": "symfony/finder", + "version": "v5.4.45", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "63741784cd7b9967975eec610b256eed3ede022b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.45" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-28T13:32:08+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "wp-cli/i18n-command", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/i18n-command.git", + "reference": "065bb3758fcbff922f1b7a01ab702aab0da79803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/065bb3758fcbff922f1b7a01ab702aab0da79803", + "reference": "065bb3758fcbff922f1b7a01ab702aab0da79803", + "shasum": "" + }, + "require": { + "eftec/bladeone": "3.52", + "gettext/gettext": "^4.8", + "mck89/peast": "^1.13.11", + "wp-cli/wp-cli": "^2.5" + }, + "require-dev": { + "wp-cli/scaffold-command": "^1.2 || ^2", + "wp-cli/wp-cli-tests": "^4" + }, + "suggest": { + "ext-json": "Used for reading and generating JSON translation files", + "ext-mbstring": "Used for calculating include/exclude matches in code extraction" + }, + "type": "wp-cli-package", + "extra": { + "bundled": true, + "commands": [ + "i18n", + "i18n make-pot", + "i18n make-json", + "i18n make-mo", + "i18n make-php", + "i18n update-po" + ], + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "i18n-command.php" + ], + "psr-4": { + "WP_CLI\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Pascal Birchler", + "homepage": "https://pascalbirchler.com/" + } + ], + "description": "Provides internationalization tools for WordPress projects.", + "homepage": "https://github.com/wp-cli/i18n-command", + "support": { + "issues": "https://github.com/wp-cli/i18n-command/issues", + "source": "https://github.com/wp-cli/i18n-command/tree/v2.6.3" + }, + "time": "2024-10-01T11:16:25+00:00" + }, + { + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "files": [ + "includes/functions.php" + ], + "psr-4": { + "Mustangostang\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, + "time": "2017-04-25T11:26:20+00:00" + }, + { + "name": "wp-cli/php-cli-tools", + "version": "v0.11.22", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "a6bb94664ca36d0962f9c2ff25591c315a550c51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/a6bb94664ca36d0962f9c2ff25591c315a550c51", + "reference": "a6bb94664ca36d0962f9c2ff25591c315a550c51", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "require-dev": { + "roave/security-advisories": "dev-latest", + "wp-cli/wp-cli-tests": "^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11.x-dev" + } + }, + "autoload": { + "files": [ + "lib/cli/cli.php" + ], + "psr-0": { + "cli": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@handbuilt.co", + "role": "Maintainer" + }, + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + } + ], + "description": "Console utilities for PHP", + "homepage": "http://github.com/wp-cli/php-cli-tools", + "keywords": [ + "cli", + "console" + ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.22" + }, + "time": "2023-12-03T19:25:05+00:00" + }, + { + "name": "wp-cli/wp-cli", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/wp-cli.git", + "reference": "53f0df112901fcf95099d0f501912a209429b6a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/53f0df112901fcf95099d0f501912a209429b6a9", + "reference": "53f0df112901fcf95099d0f501912a209429b6a9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "mustache/mustache": "^2.14.1", + "php": "^5.6 || ^7.0 || ^8.0", + "symfony/finder": ">2.7", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/php-cli-tools": "~0.11.2" + }, + "require-dev": { + "roave/security-advisories": "dev-latest", + "wp-cli/db-command": "^1.3 || ^2", + "wp-cli/entity-command": "^1.2 || ^2", + "wp-cli/extension-command": "^1.1 || ^2", + "wp-cli/package-command": "^1 || ^2", + "wp-cli/wp-cli-tests": "^4.0.1" + }, + "suggest": { + "ext-readline": "Include for a better --prompt implementation", + "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" + }, + "bin": [ + "bin/wp", + "bin/wp.bat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.11.x-dev" + } + }, + "autoload": { + "psr-0": { + "WP_CLI\\": "php/" + }, + "classmap": [ + "php/class-wp-cli.php", + "php/class-wp-cli-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WP-CLI framework", + "homepage": "https://wp-cli.org", + "keywords": [ + "cli", + "wordpress" + ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, + "time": "2024-08-08T03:04:55+00:00" + }, { "name": "wp-coding-standards/wpcs", "version": "3.1.0", diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000..0c98ae3 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,23 @@ +"project_id_env": "CROWDIN_PROJECT_ID" +"api_token_env": "CROWDIN_PERSONAL_TOKEN" +"base_path": "." + +"preserve_hierarchy": true + +"files": [ + { + "source": "/languages/wp-module-help-center.pot", + "translation": "/languages/wp-module-help-center-%locale%.po", + "languages_mapping": { + "locale": { + "de": "de_DE", + "en-AU": "en_AU", + "en-GB": "en_GB", + "es-ES": "es_ES", + "fr": "fr_FR", + "it": "it_IT", + "nl": "nl_NL" + } + } + } +] \ No newline at end of file diff --git a/includes/HelpCenter.php b/includes/HelpCenter.php index 7d7f85b..a3efc3b 100644 --- a/includes/HelpCenter.php +++ b/includes/HelpCenter.php @@ -2,10 +2,11 @@ namespace NewfoldLabs\WP\Module\HelpCenter; -use NewfoldLabs\WP\Module\HelpCenter\I18nLoader; use NewfoldLabs\WP\ModuleLoader\Container; use NewfoldLabs\WP\Module\HelpCenter\Data\Brands; +use function NewfoldLabs\WP\ModuleLoader\container; + /** * The class to initialize and load the module. */ @@ -19,11 +20,18 @@ class HelpCenter { protected $container; /** - * Identifier for page and assets. + * Identifier for script handle. * * @var string */ - public static $slug = 'nfd-help-center'; + public static $handle = 'nfd-help-center'; + + /** + * Text-domain + * + * @var string + */ + public static $text_domain = 'wp-module-help-center'; /** * Constructor. @@ -32,21 +40,55 @@ class HelpCenter { */ public function __construct( Container $container ) { $this->container = $container; - add_action( 'init', array( $this, 'load_php_textdomain' ) ); + add_action( 'init', array( $this, 'load_textdomains' ), 0 ); add_action( 'rest_api_init', array( $this, 'initialize_rest' ) ); - add_action( 'admin_init', array( $this, 'register_assets' ) ); + add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); add_action( 'admin_bar_menu', array( $this, 'newfold_help_center' ), 11 ); + add_filter( + 'load_script_translation_file', + array( $this, 'load_script_translation_file' ), + 10, + 3 + ); } /** - * Loads the textdomain for the module. This applies only to PHP strings. + * Filters the file path for the JS translation JSON. + * + * If the script handle matches the module's handle, builds a custom path using + * the languages directory, current locale, text domain, and a hash of the script. * - * @return boolean + * @param string $file Default translation file path. + * @param string $handle Script handle. + * @param string $domain Text domain. + * @return string Modified file path for the translation JSON. */ - public static function load_php_textdomain() { - return I18nLoader::load_php_translations( - 'wp-module-help-center', - NFD_HELPCENTER_PLUGIN_DIRNAME . '/vendor/newfold-labs/wp-module-help-center/languages' + public function load_script_translation_file( $file, $handle, $domain ) { + + if ( $handle === self::$handle ) { + $path = NFD_HELPCENTER_DIR . '/languages/'; + $locale = determine_locale(); + + $file_base = 'default' === $domain + ? $locale + : $domain . '-' . $locale; + $file = $path . $file_base . '-' . md5( 'build/index.js' ) + . '.json'; + + } + + return $file; + } + + /** + * Loads the textdomain for the module. This applies only to PHP strings. + */ + public static function load_textdomains() { + $langdir = dirname( container()->plugin()->basename ) . '/vendor/newfold-labs/wp-module-help-center/languages'; + \load_plugin_textdomain( + self::$text_domain, + false, + $langdir ); } @@ -104,75 +146,78 @@ public function newfold_help_center( \WP_Admin_Bar $admin_bar ) { /** * Load WP dependencies into the page. */ - public function register_assets() { + public function assets() { + $dir = container()->plugin()->url . 'vendor/newfold-labs/wp-module-help-center/'; $asset_file = NFD_HELPCENTER_BUILD_DIR . 'index.asset.php'; $help_enabled = $this->container->get( 'capabilities' )->get( 'canAccessHelpCenter' ); - if ( file_exists( $asset_file ) && $help_enabled ) { + if ( file_exists( $asset_file ) ) { $asset = require_once $asset_file; + \wp_register_script( - self::$slug, - NFD_HELPCENTER_PLUGIN_URL . 'vendor/newfold-labs/wp-module-help-center/build/index.js', - array_merge( $asset['dependencies'], array(), array( 'jquery', 'heartbeat' ) ), + self::$handle, + $dir . '/build/index.js', + array_merge( $asset['dependencies'], array( 'jquery', 'heartbeat' ) ), $asset['version'], true ); - I18nLoader::load_js_translations( - 'wp-module-help-center', - self::$slug, - NFD_HELPCENTER_DIR . '/languages' - ); - - \wp_enqueue_script( self::$slug ); - - \wp_enqueue_style( - self::$slug, - NFD_HELPCENTER_PLUGIN_URL . 'vendor/newfold-labs/wp-module-help-center/build/index.css', - array(), - $asset['version'], - 'screen' - ); - - \wp_add_inline_script( - self::$slug, - 'var nfdHelpCenter =' . wp_json_encode( - array( - 'restUrl' => \get_home_url() . '/index.php?rest_route=', - 'resourceLink' => Brands::get_resource_link_for_brand( NFD_HELPCENTER_PLUGIN_BRAND ), - ) - ) . ';', - 'before' + \wp_set_script_translations( + self::$handle, + self::$text_domain, + $dir . '/languages' ); - /* Hide the helpcenter on onboarding flow */ - \wp_localize_script( self::$slug, 'newfoldHelpCenter', array( 'closeOnLoad' => ( isset( $_GET['page'] ) && 'nfd-onboarding' === sanitize_text_field( $_GET['page'] ) ) ) ); - - /* Remove values on log out */ - $logout_listener_js = << \get_home_url() . '/index.php?rest_route=', + 'resourceLink' => Brands::get_resource_link_for_brand( NFD_HELPCENTER_PLUGIN_BRAND ), + ) + ) . ';', + 'before' + ); + + /* Hide the helpcenter on onboarding flow */ + \wp_localize_script( self::$handle, 'newfoldHelpCenter', array( 'closeOnLoad' => ( isset( $_GET['page'] ) && 'nfd-onboarding' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) ) ); + + /* Remove values on log out */ + $logout_listener_js = <<Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "Du kannst versuchen, in unserem Ressourcenzentrum zu suchen.<\/a> , um zu sehen, ob es einen hilfreichen Artikel oder ein Video zu diesem Thema gibt." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Leider habe ich noch keine Informationen zu diesem Thema." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Hallo! Ich bin dein WordPress AI Assistent. <\/br><\/br> Fragen Sie mich, wie man Dinge in WordPress macht, und ich werde Schritt f\u00fcr Schritt Anweisungen zur Verf\u00fcgung stellen.<\/br><\/br> Ich lerne noch immer und habe noch nicht alle Antworten." + ], + "Search Help Center": [ + "Hilfe-Center suchen" + ], + "Ask about WordPress": [ + "Nach WordPress fragen" + ], + "submit text": [ + "sende Text" + ], + "Common Topics": [ + "Gew\u00f6hnliche Themen" + ], + "Please enter a specific search term to get results.": [ + "Bitte geben Sie einen bestimmten Suchbegriff ein, um Ergebnisse zu erhalten." + ], + "Account Support": [ + "Kundenunterst\u00fctzung" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "Wenn Sie Hilfe f\u00fcr Ihren Bluehost-Account ben\u00f6tigen, kontaktieren Sie unser Support-Team:" + ], + "Chat with support": [ + "Mit Unterst\u00fctzung chatten" + ], + "Help with WordPress": [ + "Hilfe bei WordPress" + ], + "Close Help Modal": [ + "Hilfe Modal schlie\u00dfen" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-de_DE.l10n.php b/languages/wp-module-help-center-de_DE.l10n.php new file mode 100644 index 0000000..87b99b9 --- /dev/null +++ b/languages/wp-module-help-center-de_DE.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'de_DE','project-id-version'=>'newfold-labswp-module-staging','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 16:04','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'Wir konnten die Marke nicht finden','You must be authenticated to make this call'=>'Sie müssen authentifiziert sein, um diesen Anruf zu tätigen','Help'=>'Hilfe','Did this result help you?'=>'Hat Ihnen dieses Ergebnis geholfen?','Yes'=>'Ja','No'=>'Nein','Thanks for the feedback!'=>'Danke für das Feedback!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'Du kannst versuchen, in unserem Ressourcenzentrum zu suchen. , um zu sehen, ob es einen hilfreichen Artikel oder ein Video zu diesem Thema gibt.','Sorry, I don’t have any information on that topic yet.'=>'Leider habe ich noch keine Informationen zu diesem Thema.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Hallo! Ich bin dein WordPress AI Assistent.

    Fragen Sie mich, wie man Dinge in WordPress macht, und ich werde Schritt für Schritt Anweisungen zur Verfügung stellen.

    Ich lerne noch immer und habe noch nicht alle Antworten.','Search Help Center'=>'Hilfe-Center suchen','Ask about WordPress'=>'Nach WordPress fragen','submit text'=>'sende Text','Common Topics'=>'Gewöhnliche Themen','Please enter a specific search term to get results.'=>'Bitte geben Sie einen bestimmten Suchbegriff ein, um Ergebnisse zu erhalten.','Account Support'=>'Kundenunterstützung','If you need help with your Bluehost account, contact our support team:'=>'Wenn Sie Hilfe für Ihren Bluehost-Account benötigen, kontaktieren Sie unser Support-Team:','Chat with support'=>'Mit Unterstützung chatten','Help with WordPress'=>'Hilfe bei WordPress','Close Help Modal'=>'Hilfe Modal schließen']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-de_DE.po b/languages/wp-module-help-center-de_DE.po new file mode 100644 index 0000000..f7e1a8e --- /dev/null +++ b/languages/wp-module-help-center-de_DE.po @@ -0,0 +1,102 @@ +msgid "" +msgstr "" +"Project-Id-Version: newfold-labswp-module-staging\n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: \n" +"Language-Team: German\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 16:04\n" +"Language: de_DE\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: newfold-labswp-module-staging\n" +"X-Crowdin-Project-ID: 764889\n" +"X-Crowdin-Language: de\n" +"X-Crowdin-File: wp-module-help-center.pot\n" +"X-Crowdin-File-ID: 44\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "Wir konnten die Marke nicht finden" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "Sie müssen authentifiziert sein, um diesen Anruf zu tätigen" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Hilfe" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Hat Ihnen dieses Ergebnis geholfen?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Ja" + +#: build/index.js:1 +msgid "No" +msgstr "Nein" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Danke für das Feedback!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "Du kannst versuchen, in unserem Ressourcenzentrum zu suchen. , um zu sehen, ob es einen hilfreichen Artikel oder ein Video zu diesem Thema gibt." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Leider habe ich noch keine Informationen zu diesem Thema." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Hallo! Ich bin dein WordPress AI Assistent.

    Fragen Sie mich, wie man Dinge in WordPress macht, und ich werde Schritt für Schritt Anweisungen zur Verfügung stellen.

    Ich lerne noch immer und habe noch nicht alle Antworten." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Hilfe-Center suchen" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Nach WordPress fragen" + +#: build/index.js:1 +msgid "submit text" +msgstr "sende Text" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Gewöhnliche Themen" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Bitte geben Sie einen bestimmten Suchbegriff ein, um Ergebnisse zu erhalten." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Kundenunterstützung" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "Wenn Sie Hilfe für Ihren Bluehost-Account benötigen, kontaktieren Sie unser Support-Team:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Mit Unterstützung chatten" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Hilfe bei WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Hilfe Modal schließen" diff --git a/languages/wp-module-help-center-en_AU-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-en_AU-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..047ed0b --- /dev/null +++ b/languages/wp-module-help-center-en_AU-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 21:36+0530", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "en_AU", + "plural-forms": "nplurals=2; plural=(n != 1);" + }, + "Did this result help you?": [ + "Did this result help you?" + ], + "Yes": [ + "Yes" + ], + "No": [ + "No" + ], + "Thanks for the feedback!": [ + "Thanks for the feedback!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Sorry, I don\u2019t have any information on that topic yet." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet." + ], + "Search Help Center": [ + "Search Help Center" + ], + "Ask about WordPress": [ + "Ask about WordPress" + ], + "submit text": [ + "submit text" + ], + "Common Topics": [ + "Common Topics" + ], + "Please enter a specific search term to get results.": [ + "Please enter a specific search term to get results." + ], + "Account Support": [ + "Account Support" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "If you need help with your Bluehost account, contact our support team:" + ], + "Chat with support": [ + "Chat with support" + ], + "Help with WordPress": [ + "Help with WordPress" + ], + "Close Help Modal": [ + "Close Help Modal" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-en_AU.l10n.php b/languages/wp-module-help-center-en_AU.l10n.php new file mode 100644 index 0000000..b4e7030 --- /dev/null +++ b/languages/wp-module-help-center-en_AU.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'en_AU','project-id-version'=>'','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 21:36+0530','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'We could not find the brand','You must be authenticated to make this call'=>'You must be authenticated to make this call','Help'=>'Help','Did this result help you?'=>'Did this result help you?','Yes'=>'Yes','No'=>'No','Thanks for the feedback!'=>'Thanks for the feedback!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.','Sorry, I don’t have any information on that topic yet.'=>'Sorry, I don’t have any information on that topic yet.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.','Search Help Center'=>'Search Help Center','Ask about WordPress'=>'Ask about WordPress','submit text'=>'submit text','Common Topics'=>'Common Topics','Please enter a specific search term to get results.'=>'Please enter a specific search term to get results.','Account Support'=>'Account Support','If you need help with your Bluehost account, contact our support team:'=>'If you need help with your Bluehost account, contact our support team:','Chat with support'=>'Chat with support','Help with WordPress'=>'Help with WordPress','Close Help Modal'=>'Close Help Modal']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-en_AU.po b/languages/wp-module-help-center-en_AU.po new file mode 100644 index 0000000..cffa6e5 --- /dev/null +++ b/languages/wp-module-help-center-en_AU.po @@ -0,0 +1,97 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: Vara Prasad Maruboina \n" +"Language-Team: English\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 21:36+0530\n" +"Language: en_AU\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "We could not find the brand" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "You must be authenticated to make this call" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Help" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Did this result help you?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Yes" + +#: build/index.js:1 +msgid "No" +msgstr "No" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Thanks for the feedback!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Sorry, I don’t have any information on that topic yet." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Search Help Center" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Ask about WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "submit text" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Common Topics" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Please enter a specific search term to get results." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Account Support" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "If you need help with your Bluehost account, contact our support team:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Chat with support" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Help with WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Close Help Modal" diff --git a/languages/wp-module-help-center-en_GB-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-en_GB-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..3fd9566 --- /dev/null +++ b/languages/wp-module-help-center-en_GB-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 21:35+0530", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "en_GB", + "plural-forms": "nplurals=2; plural=(n != 1);" + }, + "Did this result help you?": [ + "Did this result help you?" + ], + "Yes": [ + "Yes" + ], + "No": [ + "No" + ], + "Thanks for the feedback!": [ + "Thanks for the feedback!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Sorry, I don\u2019t have any information on that topic yet." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet." + ], + "Search Help Center": [ + "Search Help Center" + ], + "Ask about WordPress": [ + "Ask about WordPress" + ], + "submit text": [ + "submit text" + ], + "Common Topics": [ + "Common Topics" + ], + "Please enter a specific search term to get results.": [ + "Please enter a specific search term to get results." + ], + "Account Support": [ + "Account Support" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "If you need help with your Bluehost account, contact our support team:" + ], + "Chat with support": [ + "Chat with support" + ], + "Help with WordPress": [ + "Help with WordPress" + ], + "Close Help Modal": [ + "Close Help Modal" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-en_GB.l10n.php b/languages/wp-module-help-center-en_GB.l10n.php new file mode 100644 index 0000000..24b87f9 --- /dev/null +++ b/languages/wp-module-help-center-en_GB.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'en_GB','project-id-version'=>'','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 21:35+0530','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'We could not find the brand','You must be authenticated to make this call'=>'You must be authenticated to make this call','Help'=>'Help','Did this result help you?'=>'Did this result help you?','Yes'=>'Yes','No'=>'No','Thanks for the feedback!'=>'Thanks for the feedback!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.','Sorry, I don’t have any information on that topic yet.'=>'Sorry, I don’t have any information on that topic yet.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.','Search Help Center'=>'Search Help Center','Ask about WordPress'=>'Ask about WordPress','submit text'=>'submit text','Common Topics'=>'Common Topics','Please enter a specific search term to get results.'=>'Please enter a specific search term to get results.','Account Support'=>'Account Support','If you need help with your Bluehost account, contact our support team:'=>'If you need help with your Bluehost account, contact our support team:','Chat with support'=>'Chat with support','Help with WordPress'=>'Help with WordPress','Close Help Modal'=>'Close Help Modal']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-en_GB.po b/languages/wp-module-help-center-en_GB.po new file mode 100644 index 0000000..cd5d656 --- /dev/null +++ b/languages/wp-module-help-center-en_GB.po @@ -0,0 +1,97 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: Vara Prasad Maruboina \n" +"Language-Team: English (British) <(nothing)>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 21:35+0530\n" +"Language: en_GB\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "We could not find the brand" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "You must be authenticated to make this call" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Help" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Did this result help you?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Yes" + +#: build/index.js:1 +msgid "No" +msgstr "No" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Thanks for the feedback!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Sorry, I don’t have any information on that topic yet." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Search Help Center" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Ask about WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "submit text" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Common Topics" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Please enter a specific search term to get results." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Account Support" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "If you need help with your Bluehost account, contact our support team:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Chat with support" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Help with WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Close Help Modal" diff --git a/languages/wp-module-help-center-es_ES-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-es_ES-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..8047ce7 --- /dev/null +++ b/languages/wp-module-help-center-es_ES-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 16:04", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "es_ES", + "plural-forms": "nplurals=2; plural=(n != 1);" + }, + "Did this result help you?": [ + "\u00bfTe ha ayudado este resultado?" + ], + "Yes": [ + "S\u00ed" + ], + "No": [ + "Nu" + ], + "Thanks for the feedback!": [ + "\u00a1Gracias por sus comentarios!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "Puedes intentar buscar en nuestro centro Recursos.<\/a> aunque para ver si hay un art\u00edculo o v\u00eddeo \u00fatil sobre este tema." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Lo siento, todav\u00eda no tengo informaci\u00f3n sobre ese tema." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "\u00a1Hola! Soy tu asistente de IA de WordPress. <\/br><\/br> Preg\u00fantame c\u00f3mo hacer cosas en WordPress y te proporcionar\u00e9 instrucciones paso a paso.<\/br><\/br> A\u00fan estoy aprendiendo, as\u00ed que todav\u00eda no tengo todas las respuestas." + ], + "Search Help Center": [ + "Buscar Centro de Ayuda" + ], + "Ask about WordPress": [ + "Preguntar sobre WordPress" + ], + "submit text": [ + "enviar texto" + ], + "Common Topics": [ + "Temas comunes" + ], + "Please enter a specific search term to get results.": [ + "Por favor, introduzca un t\u00e9rmino de b\u00fasqueda espec\u00edfico para obtener resultados." + ], + "Account Support": [ + "Soporte de Cuenta" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "Si necesitas ayuda con tu cuenta Bluehost, contacta con nuestro equipo de soporte:" + ], + "Chat with support": [ + "Chatear con soporte" + ], + "Help with WordPress": [ + "Ayuda con WordPress" + ], + "Close Help Modal": [ + "Cerrar m\u00f3dulo de ayuda" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-es_ES.l10n.php b/languages/wp-module-help-center-es_ES.l10n.php new file mode 100644 index 0000000..8654d70 --- /dev/null +++ b/languages/wp-module-help-center-es_ES.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'es_ES','project-id-version'=>'newfold-labswp-module-staging','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 16:04','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'No pudimos encontrar la marca','You must be authenticated to make this call'=>'Debes estar autenticado para hacer esta llamada','Help'=>'Ayuda','Did this result help you?'=>'¿Te ha ayudado este resultado?','Yes'=>'Sí','No'=>'Nu','Thanks for the feedback!'=>'¡Gracias por sus comentarios!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'Puedes intentar buscar en nuestro centro Recursos. aunque para ver si hay un artículo o vídeo útil sobre este tema.','Sorry, I don’t have any information on that topic yet.'=>'Lo siento, todavía no tengo información sobre ese tema.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'¡Hola! Soy tu asistente de IA de WordPress.

    Pregúntame cómo hacer cosas en WordPress y te proporcionaré instrucciones paso a paso.

    Aún estoy aprendiendo, así que todavía no tengo todas las respuestas.','Search Help Center'=>'Buscar Centro de Ayuda','Ask about WordPress'=>'Preguntar sobre WordPress','submit text'=>'enviar texto','Common Topics'=>'Temas comunes','Please enter a specific search term to get results.'=>'Por favor, introduzca un término de búsqueda específico para obtener resultados.','Account Support'=>'Soporte de Cuenta','If you need help with your Bluehost account, contact our support team:'=>'Si necesitas ayuda con tu cuenta Bluehost, contacta con nuestro equipo de soporte:','Chat with support'=>'Chatear con soporte','Help with WordPress'=>'Ayuda con WordPress','Close Help Modal'=>'Cerrar módulo de ayuda']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-es_ES.po b/languages/wp-module-help-center-es_ES.po new file mode 100644 index 0000000..b33a9ac --- /dev/null +++ b/languages/wp-module-help-center-es_ES.po @@ -0,0 +1,102 @@ +msgid "" +msgstr "" +"Project-Id-Version: newfold-labswp-module-staging\n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: \n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 16:04\n" +"Language: es_ES\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: newfold-labswp-module-staging\n" +"X-Crowdin-Project-ID: 764889\n" +"X-Crowdin-Language: es-ES\n" +"X-Crowdin-File: wp-module-help-center.pot\n" +"X-Crowdin-File-ID: 44\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "No pudimos encontrar la marca" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "Debes estar autenticado para hacer esta llamada" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Ayuda" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "¿Te ha ayudado este resultado?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Sí" + +#: build/index.js:1 +msgid "No" +msgstr "Nu" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "¡Gracias por sus comentarios!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "Puedes intentar buscar en nuestro centro Recursos. aunque para ver si hay un artículo o vídeo útil sobre este tema." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Lo siento, todavía no tengo información sobre ese tema." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "¡Hola! Soy tu asistente de IA de WordPress.

    Pregúntame cómo hacer cosas en WordPress y te proporcionaré instrucciones paso a paso.

    Aún estoy aprendiendo, así que todavía no tengo todas las respuestas." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Buscar Centro de Ayuda" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Preguntar sobre WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "enviar texto" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Temas comunes" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Por favor, introduzca un término de búsqueda específico para obtener resultados." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Soporte de Cuenta" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "Si necesitas ayuda con tu cuenta Bluehost, contacta con nuestro equipo de soporte:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Chatear con soporte" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Ayuda con WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Cerrar módulo de ayuda" diff --git a/languages/wp-module-help-center-fr_FR-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-fr_FR-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..2fac2ad --- /dev/null +++ b/languages/wp-module-help-center-fr_FR-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 16:04", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "fr_FR", + "plural-forms": "nplurals=2; plural=(n > 1);" + }, + "Did this result help you?": [ + "Ce r\u00e9sultat vous a-t-il aid\u00e9?" + ], + "Yes": [ + "Oui" + ], + "No": [ + "Non" + ], + "Thanks for the feedback!": [ + "Merci pour vos commentaires!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "Vous pouvez essayer de rechercher dans notre Centre de ressources.<\/a> pour voir s'il y a un article ou une vid\u00e9o utile sur ce sujet." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "D\u00e9sol\u00e9, je n\u2019ai pas encore d\u2019informations sur ce sujet." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Bonjour ! Je suis votre assistant IA WordPress. <\/br><\/br> Demandez-moi comment faire des choses dans WordPress et je vais fournir des instructions \u00e9tape par \u00e9tape.<\/br><\/br> Je suis toujours en train d\u2019apprendre pour que je n\u2019aie pas encore toutes les r\u00e9ponses." + ], + "Search Help Center": [ + "Centre d'aide \u00e0 la recherche" + ], + "Ask about WordPress": [ + "Demander \u00e0 propos de WordPress" + ], + "submit text": [ + "envoyer le texte" + ], + "Common Topics": [ + "Sujets communs" + ], + "Please enter a specific search term to get results.": [ + "Veuillez entrer un terme de recherche sp\u00e9cifique pour obtenir des r\u00e9sultats." + ], + "Account Support": [ + "Support du compte" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "Si vous avez besoin d\u2019aide avec votre compte Bluehost, contactez notre \u00e9quipe d\u2019assistance :" + ], + "Chat with support": [ + "Discuter avec le support" + ], + "Help with WordPress": [ + "Aide sur WordPress" + ], + "Close Help Modal": [ + "Fermer la fen\u00eatre d'aide" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-fr_FR.l10n.php b/languages/wp-module-help-center-fr_FR.l10n.php new file mode 100644 index 0000000..92a2541 --- /dev/null +++ b/languages/wp-module-help-center-fr_FR.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n > 1);','language'=>'fr_FR','project-id-version'=>'newfold-labswp-module-staging','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 16:04','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'Nous n\'avons pas pu trouver la marque','You must be authenticated to make this call'=>'Vous devez être authentifié pour passer cet appel','Help'=>'Aide','Did this result help you?'=>'Ce résultat vous a-t-il aidé?','Yes'=>'Oui','No'=>'Non','Thanks for the feedback!'=>'Merci pour vos commentaires!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'Vous pouvez essayer de rechercher dans notre Centre de ressources. pour voir s\'il y a un article ou une vidéo utile sur ce sujet.','Sorry, I don’t have any information on that topic yet.'=>'Désolé, je n’ai pas encore d’informations sur ce sujet.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Bonjour ! Je suis votre assistant IA WordPress.

    Demandez-moi comment faire des choses dans WordPress et je vais fournir des instructions étape par étape.

    Je suis toujours en train d’apprendre pour que je n’aie pas encore toutes les réponses.','Search Help Center'=>'Centre d\'aide à la recherche','Ask about WordPress'=>'Demander à propos de WordPress','submit text'=>'envoyer le texte','Common Topics'=>'Sujets communs','Please enter a specific search term to get results.'=>'Veuillez entrer un terme de recherche spécifique pour obtenir des résultats.','Account Support'=>'Support du compte','If you need help with your Bluehost account, contact our support team:'=>'Si vous avez besoin d’aide avec votre compte Bluehost, contactez notre équipe d’assistance :','Chat with support'=>'Discuter avec le support','Help with WordPress'=>'Aide sur WordPress','Close Help Modal'=>'Fermer la fenêtre d\'aide']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-fr_FR.po b/languages/wp-module-help-center-fr_FR.po new file mode 100644 index 0000000..1d34296 --- /dev/null +++ b/languages/wp-module-help-center-fr_FR.po @@ -0,0 +1,102 @@ +msgid "" +msgstr "" +"Project-Id-Version: newfold-labswp-module-staging\n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 16:04\n" +"Language: fr_FR\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Crowdin-Project: newfold-labswp-module-staging\n" +"X-Crowdin-Project-ID: 764889\n" +"X-Crowdin-Language: fr\n" +"X-Crowdin-File: wp-module-help-center.pot\n" +"X-Crowdin-File-ID: 44\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "Nous n'avons pas pu trouver la marque" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "Vous devez être authentifié pour passer cet appel" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Aide" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Ce résultat vous a-t-il aidé?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Oui" + +#: build/index.js:1 +msgid "No" +msgstr "Non" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Merci pour vos commentaires!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "Vous pouvez essayer de rechercher dans notre Centre de ressources. pour voir s'il y a un article ou une vidéo utile sur ce sujet." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Désolé, je n’ai pas encore d’informations sur ce sujet." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Bonjour ! Je suis votre assistant IA WordPress.

    Demandez-moi comment faire des choses dans WordPress et je vais fournir des instructions étape par étape.

    Je suis toujours en train d’apprendre pour que je n’aie pas encore toutes les réponses." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Centre d'aide à la recherche" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Demander à propos de WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "envoyer le texte" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Sujets communs" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Veuillez entrer un terme de recherche spécifique pour obtenir des résultats." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Support du compte" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "Si vous avez besoin d’aide avec votre compte Bluehost, contactez notre équipe d’assistance :" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Discuter avec le support" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Aide sur WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Fermer la fenêtre d'aide" diff --git a/languages/wp-module-help-center-it_IT-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-it_IT-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..2a96ef4 --- /dev/null +++ b/languages/wp-module-help-center-it_IT-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 16:04", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "it_IT", + "plural-forms": "nplurals=2; plural=(n != 1);" + }, + "Did this result help you?": [ + "Questo risultato ti ha aiutato?" + ], + "Yes": [ + "S\u00ec" + ], + "No": [ + "No" + ], + "Thanks for the feedback!": [ + "Grazie per il feedback!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "Puoi provare a cercare il nostro centro risorse .<\/a> per vedere se c'\u00e8 un utile articolo o video su questo argomento." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Mi dispiace, non ho ancora alcuna informazione su questo argomento." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Ciao! Sono il tuo assistente WordPress AI. <\/br><\/br> Mi chiede come fare le cose in WordPress e fornir\u00f2 istruzioni passo dopo passo.<\/br><\/br> Sto ancora imparando quindi non ho ancora tutte le risposte." + ], + "Search Help Center": [ + "Search Help Center" + ], + "Ask about WordPress": [ + "Chiedi su WordPress" + ], + "submit text": [ + "invia testo" + ], + "Common Topics": [ + "Argomenti Comuni" + ], + "Please enter a specific search term to get results.": [ + "Inserisci un termine di ricerca specifico per ottenere risultati." + ], + "Account Support": [ + "Supporto Account" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "Se hai bisogno di aiuto con il tuo account Bluehost, contatta il nostro team di supporto:" + ], + "Chat with support": [ + "Chatta con supporto" + ], + "Help with WordPress": [ + "Aiuto con WordPress" + ], + "Close Help Modal": [ + "Chiudi Aiuto Modal" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-it_IT.l10n.php b/languages/wp-module-help-center-it_IT.l10n.php new file mode 100644 index 0000000..5e5ac80 --- /dev/null +++ b/languages/wp-module-help-center-it_IT.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'it_IT','project-id-version'=>'newfold-labswp-module-staging','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 16:04','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'Non siamo riusciti a trovare il marchio','You must be authenticated to make this call'=>'Devi essere autenticato per effettuare questa chiamata','Help'=>'Aiuto','Did this result help you?'=>'Questo risultato ti ha aiutato?','Yes'=>'Sì','No'=>'No','Thanks for the feedback!'=>'Grazie per il feedback!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'Puoi provare a cercare il nostro centro risorse . per vedere se c\'è un utile articolo o video su questo argomento.','Sorry, I don’t have any information on that topic yet.'=>'Mi dispiace, non ho ancora alcuna informazione su questo argomento.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Ciao! Sono il tuo assistente WordPress AI.

    Mi chiede come fare le cose in WordPress e fornirò istruzioni passo dopo passo.

    Sto ancora imparando quindi non ho ancora tutte le risposte.','Search Help Center'=>'Search Help Center','Ask about WordPress'=>'Chiedi su WordPress','submit text'=>'invia testo','Common Topics'=>'Argomenti Comuni','Please enter a specific search term to get results.'=>'Inserisci un termine di ricerca specifico per ottenere risultati.','Account Support'=>'Supporto Account','If you need help with your Bluehost account, contact our support team:'=>'Se hai bisogno di aiuto con il tuo account Bluehost, contatta il nostro team di supporto:','Chat with support'=>'Chatta con supporto','Help with WordPress'=>'Aiuto con WordPress','Close Help Modal'=>'Chiudi Aiuto Modal']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-it_IT.po b/languages/wp-module-help-center-it_IT.po new file mode 100644 index 0000000..809049e --- /dev/null +++ b/languages/wp-module-help-center-it_IT.po @@ -0,0 +1,102 @@ +msgid "" +msgstr "" +"Project-Id-Version: newfold-labswp-module-staging\n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: \n" +"Language-Team: Italian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 16:04\n" +"Language: it_IT\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: newfold-labswp-module-staging\n" +"X-Crowdin-Project-ID: 764889\n" +"X-Crowdin-Language: it\n" +"X-Crowdin-File: wp-module-help-center.pot\n" +"X-Crowdin-File-ID: 44\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "Non siamo riusciti a trovare il marchio" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "Devi essere autenticato per effettuare questa chiamata" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Aiuto" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Questo risultato ti ha aiutato?" + +#: build/index.js:1 +msgid "Yes" +msgstr "Sì" + +#: build/index.js:1 +msgid "No" +msgstr "No" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Grazie per il feedback!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "Puoi provare a cercare il nostro centro risorse . per vedere se c'è un utile articolo o video su questo argomento." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Mi dispiace, non ho ancora alcuna informazione su questo argomento." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Ciao! Sono il tuo assistente WordPress AI.

    Mi chiede come fare le cose in WordPress e fornirò istruzioni passo dopo passo.

    Sto ancora imparando quindi non ho ancora tutte le risposte." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Search Help Center" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Chiedi su WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "invia testo" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Argomenti Comuni" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Inserisci un termine di ricerca specifico per ottenere risultati." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Supporto Account" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "Se hai bisogno di aiuto con il tuo account Bluehost, contatta il nostro team di supporto:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Chatta con supporto" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Aiuto con WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Chiudi Aiuto Modal" diff --git a/languages/wp-module-help-center-nl_NL-dfbff627e6c248bcb3b61d7d06da9ca9.json b/languages/wp-module-help-center-nl_NL-dfbff627e6c248bcb3b61d7d06da9ca9.json new file mode 100644 index 0000000..08acd69 --- /dev/null +++ b/languages/wp-module-help-center-nl_NL-dfbff627e6c248bcb3b61d7d06da9ca9.json @@ -0,0 +1,66 @@ +{ + "translation-revision-date": "2025-02-19 16:04", + "generator": "WP-CLI\/2.11.0", + "source": "build\/index.js", + "domain": "messages", + "locale_data": { + "messages": { + "": { + "domain": "messages", + "lang": "nl_NL", + "plural-forms": "nplurals=2; plural=(n != 1);" + }, + "Did this result help you?": [ + "Heeft dit resultaat u geholpen?" + ], + "Yes": [ + "ja" + ], + "No": [ + "Neen" + ], + "Thanks for the feedback!": [ + "Bedankt voor de feedback!" + ], + "You can try searching our Resource center.<\/a> though to see if there\u2019s a helpful article or video on that subject.": [ + "Je kunt proberen in ons Kenniscentrum<\/a> te zoeken om te zien of er een nuttig artikel of video over dat onderwerp is." + ], + "Sorry, I don\u2019t have any information on that topic yet.": [ + "Sorry, ik heb nog geen informatie over dat onderwerp." + ], + "Hi! I\u2019m your WordPress AI assistant. <\/br><\/br> Ask me how to do things in WordPress and I\u2019ll provide step by step instructions.<\/br><\/br> I\u2019m still learning so I don\u2019t have all the answers just yet.": [ + "Hallo! Ik ben jouw WordPress AI assistent. <\/br><\/br> Vraag me hoe je dingen kunt doen in WordPress, dan zal ik stap voor stap instructies geven.<\/br><\/br> Ik leer nog steeds, zodat ik nog niet alle antwoorden heb." + ], + "Search Help Center": [ + "Zoek naar hulpcentrum" + ], + "Ask about WordPress": [ + "Vraag over WordPress" + ], + "submit text": [ + "dien tekst in" + ], + "Common Topics": [ + "Algemene Onderwerpen" + ], + "Please enter a specific search term to get results.": [ + "Voer een specifieke zoekterm in om zoekresultaten te krijgen." + ], + "Account Support": [ + "Ondersteuning voor account" + ], + "If you need help with your Bluehost account, contact our support team:": [ + "Als je hulp nodig hebt met je Bluehost account, neem dan contact op met ons ondersteuningsteam:" + ], + "Chat with support": [ + "Chat met ondersteuning" + ], + "Help with WordPress": [ + "Help met WordPress" + ], + "Close Help Modal": [ + "Help Modal sluiten" + ] + } + } +} \ No newline at end of file diff --git a/languages/wp-module-help-center-nl_NL.l10n.php b/languages/wp-module-help-center-nl_NL.l10n.php new file mode 100644 index 0000000..1261f39 --- /dev/null +++ b/languages/wp-module-help-center-nl_NL.l10n.php @@ -0,0 +1,2 @@ +'wp-module-help-center','plural-forms'=>'nplurals=2; plural=(n != 1);','language'=>'nl_NL','project-id-version'=>'newfold-labswp-module-staging','pot-creation-date'=>'2025-02-13T09:55:55+00:00','po-revision-date'=>'2025-02-19 16:04','x-generator'=>'WP-CLI 2.11.0','messages'=>['We could not find the brand'=>'We konden het merk niet vinden','You must be authenticated to make this call'=>'U moet geverifieerd zijn om deze oproep te kunnen doen','Help'=>'Hulp','Did this result help you?'=>'Heeft dit resultaat u geholpen?','Yes'=>'ja','No'=>'Neen','Thanks for the feedback!'=>'Bedankt voor de feedback!','You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.'=>'Je kunt proberen in ons Kenniscentrum te zoeken om te zien of er een nuttig artikel of video over dat onderwerp is.','Sorry, I don’t have any information on that topic yet.'=>'Sorry, ik heb nog geen informatie over dat onderwerp.','Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.'=>'Hallo! Ik ben jouw WordPress AI assistent.

    Vraag me hoe je dingen kunt doen in WordPress, dan zal ik stap voor stap instructies geven.

    Ik leer nog steeds, zodat ik nog niet alle antwoorden heb.','Search Help Center'=>'Zoek naar hulpcentrum','Ask about WordPress'=>'Vraag over WordPress','submit text'=>'dien tekst in','Common Topics'=>'Algemene Onderwerpen','Please enter a specific search term to get results.'=>'Voer een specifieke zoekterm in om zoekresultaten te krijgen.','Account Support'=>'Ondersteuning voor account','If you need help with your Bluehost account, contact our support team:'=>'Als je hulp nodig hebt met je Bluehost account, neem dan contact op met ons ondersteuningsteam:','Chat with support'=>'Chat met ondersteuning','Help with WordPress'=>'Help met WordPress','Close Help Modal'=>'Help Modal sluiten']]; \ No newline at end of file diff --git a/languages/wp-module-help-center-nl_NL.po b/languages/wp-module-help-center-nl_NL.po new file mode 100644 index 0000000..19dc8ef --- /dev/null +++ b/languages/wp-module-help-center-nl_NL.po @@ -0,0 +1,102 @@ +msgid "" +msgstr "" +"Project-Id-Version: newfold-labswp-module-staging\n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: \n" +"Language-Team: Dutch\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: 2025-02-19 16:04\n" +"Language: nl_NL\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: newfold-labswp-module-staging\n" +"X-Crowdin-Project-ID: 764889\n" +"X-Crowdin-Language: nl\n" +"X-Crowdin-File: wp-module-help-center.pot\n" +"X-Crowdin-File-ID: 44\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "We konden het merk niet vinden" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "U moet geverifieerd zijn om deze oproep te kunnen doen" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "Hulp" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "Heeft dit resultaat u geholpen?" + +#: build/index.js:1 +msgid "Yes" +msgstr "ja" + +#: build/index.js:1 +msgid "No" +msgstr "Neen" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "Bedankt voor de feedback!" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "Je kunt proberen in ons Kenniscentrum te zoeken om te zien of er een nuttig artikel of video over dat onderwerp is." + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "Sorry, ik heb nog geen informatie over dat onderwerp." + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "Hallo! Ik ben jouw WordPress AI assistent.

    Vraag me hoe je dingen kunt doen in WordPress, dan zal ik stap voor stap instructies geven.

    Ik leer nog steeds, zodat ik nog niet alle antwoorden heb." + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "Zoek naar hulpcentrum" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "Vraag over WordPress" + +#: build/index.js:1 +msgid "submit text" +msgstr "dien tekst in" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "Algemene Onderwerpen" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "Voer een specifieke zoekterm in om zoekresultaten te krijgen." + +#: build/index.js:1 +msgid "Account Support" +msgstr "Ondersteuning voor account" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "Als je hulp nodig hebt met je Bluehost account, neem dan contact op met ons ondersteuningsteam:" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "Chat met ondersteuning" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "Help met WordPress" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "Help Modal sluiten" diff --git a/languages/wp-module-help-center.pot b/languages/wp-module-help-center.pot new file mode 100644 index 0000000..705d15b --- /dev/null +++ b/languages/wp-module-help-center.pot @@ -0,0 +1,95 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/newfold-labs/wp-module-help-center/issues\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2025-02-13T09:55:55+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wp-module-help-center\n" + +#: includes/CapabilityController.php:75 +msgid "We could not find the brand" +msgstr "" + +#: includes/CapabilityController.php:92 +#: includes/MultiSearchController.php:128 +#: includes/UserInteractionController.php:81 +msgid "You must be authenticated to make this call" +msgstr "" + +#: includes/HelpCenter.php:91 +msgid "Help" +msgstr "" + +#: build/index.js:1 +msgid "Did this result help you?" +msgstr "" + +#: build/index.js:1 +msgid "Yes" +msgstr "" + +#: build/index.js:1 +msgid "No" +msgstr "" + +#: build/index.js:1 +msgid "Thanks for the feedback!" +msgstr "" + +#: build/index.js:1 +msgid "You can try searching our Resource center. though to see if there’s a helpful article or video on that subject." +msgstr "" + +#: build/index.js:1 +msgid "Sorry, I don’t have any information on that topic yet." +msgstr "" + +#: build/index.js:1 +msgid "Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet." +msgstr "" + +#: build/index.js:1 +msgid "Search Help Center" +msgstr "" + +#: build/index.js:1 +msgid "Ask about WordPress" +msgstr "" + +#: build/index.js:1 +msgid "submit text" +msgstr "" + +#: build/index.js:1 +msgid "Common Topics" +msgstr "" + +#: build/index.js:1 +msgid "Please enter a specific search term to get results." +msgstr "" + +#: build/index.js:1 +msgid "Account Support" +msgstr "" + +#: build/index.js:1 +msgid "If you need help with your Bluehost account, contact our support team:" +msgstr "" + +#: build/index.js:1 +msgid "Chat with support" +msgstr "" + +#: build/index.js:1 +msgid "Help with WordPress" +msgstr "" + +#: build/index.js:1 +msgid "Close Help Modal" +msgstr "" diff --git a/package.json b/package.json index 80678cd..0b6bcdc 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ }, "scripts": { "prepare": "npm run build", - "build": "wp-scripts build ./src/index.js", + "build": "wp-scripts build ./src/index.js --config ./scripts/webpack.config.js", "lint": "wp-scripts lint-js src", "lint:css": "wp-scripts lint-style src/styles/*.scss", "lint:css:fix": "wp-scripts lint-style src/styles/*.scss --fix", "format": "wp-scripts format src", - "start": "wp-scripts start ./src/index.js", + "start": "wp-scripts start ./src/index.js --config ./scripts/webpack.config.js", "test:unit": "echo \"No tests implemented\"", "test:e2e": "npx cypress run" }, diff --git a/phpcs.xml b/phpcs.xml index 06c515a..64fe0b1 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,8 +1,8 @@ - - + + @@ -20,4 +20,10 @@ + + + + + + diff --git a/scripts/webpack.config.js b/scripts/webpack.config.js new file mode 100644 index 0000000..2a0ed2a --- /dev/null +++ b/scripts/webpack.config.js @@ -0,0 +1,11 @@ +/** + * Import @wordpress/scripts base webpack config. + * @see https://github.com/WordPress/gutenberg/tree/master/packages/scripts#extending-the-webpack-config + */ +const wpScriptsConfig = require( '@wordpress/scripts/config/webpack.config' ); + +wpScriptsConfig.output.library = { + type: 'commonjs', +}; + +module.exports = wpScriptsConfig;