shopify-theme-devtools 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -12
- package/dist/theme-devtools.js +2218 -815
- package/package.json +1 -1
- package/src/liquid/theme-devtools-bridge.liquid +0 -65
package/dist/theme-devtools.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,__publicField=(t,e,i)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,i);!function(){"use strict";var t;const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new r(i,t,s)},o=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:h,getPrototypeOf:u}=Object,g=globalThis,v=g.trustedTypes,m=v?v.emptyScript:"",f=g.reactiveElementPolyfillSupport,b=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(s){i=null}}return i}},x=(t,e)=>!l(t,e),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&c(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:a}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=null==s?void 0:s.call(this);null==a||a.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...p(t),...h(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(i)t.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of s){const s=document.createElement("style"),a=e.litNonce;void 0!==a&&s.setAttribute("nonce",a),s.textContent=i.cssText,t.appendChild(s)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const s=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,s);if(void 0!==a&&!0===s.reflect){const r=(void 0!==(null==(i=s.converter)?void 0:i.toAttribute)?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,s;const a=this.constructor,r=a._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=a.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:y;this._$Em=r;const o=n.fromAttribute(e,t.type);this[r]=o??(null==(s=this._$Ej)?void 0:s.get(r))??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,a){var r;if(void 0!==t){const n=this.constructor;if(!1===s&&(a=this[t]),i??(i=n.getPropertyOptions(t)),!((i.hasChanged??x)(a,e)||i.useDefault&&i.reflect&&a===(null==(r=this._$Ej)?void 0:r.get(t))&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==a||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(i)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[b("elementProperties")]=new Map,w[b("finalized")]=new Map,null==f||f({ReactiveElement:w}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.2");const k=globalThis,$=t=>t,S=k.trustedTypes,T=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+E,O=`<${A}>`,L=document,z=()=>L.createComment(""),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,F="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,N=/>/g,D=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,M=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),V=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,J=L.createTreeWalker(L,129);var K;function W(t,e){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==T?T.createHTML(e):e}class Y{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let a=0,r=0;const n=t.length-1,o=this.parts,[l,c]=((t,e)=>{const i=t.length-1,s=[];let a,r=2===e?"<svg>":3===e?"<math>":"",n=I;for(let o=0;o<i;o++){const e=t[o];let i,l,c=-1,d=0;for(;d<e.length&&(n.lastIndex=d,l=n.exec(e),null!==l);)d=n.lastIndex,n===I?"!--"===l[1]?n=R:void 0!==l[1]?n=N:void 0!==l[2]?(H.test(l[2])&&(a=RegExp("</"+l[2],"g")),n=D):void 0!==l[3]&&(n=D):n===D?">"===l[0]?(n=a??I,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,i=l[1],n=void 0===l[3]?D:'"'===l[3]?M:q):n===M||n===q?n=D:n===R||n===N?n=I:(n=D,a=void 0);const p=n===D&&t[o+1].startsWith("/>")?" ":"";r+=n===I?e+O:c>=0?(s.push(i),e.slice(0,c)+C+e.slice(c)+E+p):e+E+(-2===c?o:p)}return[W(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=Y.createElement(l,i),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=J.nextNode())&&o.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=c[r++],i=s.getAttribute(t).split(E),n=/([.?@])?(.*)/.exec(e);o.push({type:1,index:a,name:n[2],strings:i,ctor:"."===n[1]?et:"?"===n[1]?it:"@"===n[1]?st:tt}),s.removeAttribute(t)}else t.startsWith(E)&&(o.push({type:6,index:a}),s.removeAttribute(t));if(H.test(s.tagName)){const t=s.textContent.split(E),e=t.length-1;if(e>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],z()),J.nextNode(),o.push({type:2,index:++a});s.append(t[e],z())}}}else if(8===s.nodeType)if(s.data===A)o.push({type:2,index:a});else{let t=-1;for(;-1!==(t=s.data.indexOf(E,t+1));)o.push({type:7,index:a}),t+=E.length-1}a++}}static createElement(t,e){const i=L.createElement("template");return i.innerHTML=t,i}}function Q(t,e,i=t,s){var a,r;if(e===V)return e;let n=void 0!==s?null==(a=i._$Co)?void 0:a[s]:i._$Cl;const o=j(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==o&&(null==(r=null==n?void 0:n._$AO)||r.call(n,!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,i,s)),void 0!==s?(i._$Co??(i._$Co=[]))[s]=n:i._$Cl=n),void 0!==n&&(e=Q(t,n._$AS(t,e.values),n,s)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((null==t?void 0:t.creationScope)??L).importNode(e,!0);J.currentNode=s;let a=J.nextNode(),r=0,n=0,o=i[0];for(;void 0!==o;){if(r===o.index){let e;2===o.type?e=new Z(a,a.nextSibling,this,t):1===o.type?e=new o.ctor(a,o.name,o.strings,this,t):6===o.type&&(e=new at(a,this,t)),this._$AV.push(e),o=i[++n]}r!==(null==o?void 0:o.index)&&(a=J.nextNode(),r++)}return J.currentNode=L,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(null==s?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),j(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>P(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&j(this._$AH)?this._$AA.nextSibling.data=t:this.T(L.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,a="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Y.createElement(W(s.h,s.h[0]),this.options)),s);if((null==(e=this._$AH)?void 0:e._$AD)===a)this._$AH.p(i);else{const t=new X(a,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Y(t)),e}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const a of t)s===e.length?e.push(i=new Z(this.O(z()),this.O(z()),this,this.options)):i=e[s],i._$AI(a),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t!==this._$AB;){const e=$(t).nextSibling;$(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,a){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}_$AI(t,e=this,i,s){const a=this.strings;let r=!1;if(void 0===a)t=Q(this,t,e,0),r=!j(t)||t!==this._$AH&&t!==V,r&&(this._$AH=t);else{const s=t;let n,o;for(t=a[0],n=0;n<a.length-1;n++)o=Q(this,s[i+n],e,n),o===V&&(o=this._$AH[n]),r||(r=!j(o)||o!==this._$AH[n]),o===B?t=B:t!==B&&(t+=(o??"")+a[n+1]),this._$AH[n]=o}r&&!s&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class st extends tt{constructor(t,e,i,s,a){super(t,e,i,s,a),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??B)===V)return;const i=this._$AH,s=t===B&&i!==B||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==B&&(i===B||s);s&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const rt=k.litHtmlPolyfillSupport;null==rt||rt(Y,Z),(k.litHtmlVersions??(k.litHtmlVersions=[])).push("3.3.2");const nt=globalThis;class ot extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=(null==i?void 0:i.renderBefore)??e;let a=s._$litPart$;if(void 0===a){const t=(null==i?void 0:i.renderBefore)??null;s._$litPart$=a=new Z(e.insertBefore(z(),t),t,void 0,i??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return V}}ot._$litElement$=!0,ot.finalized=!0,null==(t=nt.litElementHydrateSupport)||t.call(nt,{LitElement:ot});const lt=nt.litElementPolyfillSupport;null==lt||lt({LitElement:ot}),(nt.litElementVersions??(nt.litElementVersions=[])).push("4.2.2");const ct={dark:{"--tdt-bg":"#1a1a1a","--tdt-bg-secondary":"#242424","--tdt-bg-hover":"#2a2a2a","--tdt-border":"#333","--tdt-text":"#e0e0e0","--tdt-text-muted":"#888","--tdt-accent":"#3b82f6","--tdt-accent-hover":"#2563eb","--tdt-success":"#22c55e","--tdt-warning":"#eab308","--tdt-error":"#ef4444","--tdt-danger":"#ef4444","--tdt-string":"#a5d6ff","--tdt-number":"#79c0ff","--tdt-boolean":"#ff7b72","--tdt-null":"#888","--tdt-key":"#c792ea"},light:{"--tdt-bg":"#ffffff","--tdt-bg-secondary":"#f5f5f5","--tdt-bg-hover":"#ebebeb","--tdt-border":"#e0e0e0","--tdt-text":"#1a1a1a","--tdt-text-muted":"#666","--tdt-accent":"#2563eb","--tdt-accent-hover":"#1d4ed8","--tdt-success":"#16a34a","--tdt-warning":"#ca8a04","--tdt-error":"#dc2626","--tdt-danger":"#dc2626","--tdt-string":"#0969da","--tdt-number":"#0550ae","--tdt-boolean":"#cf222e","--tdt-null":"#666","--tdt-key":"#8250df"}},dt={small:.9,medium:1,large:1.15},pt=n`
|
|
1
|
+
var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,__publicField=(t,e,i)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,i);!function(){"use strict";var t;const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new r(i,t,s)},o=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,g=globalThis,v=g.trustedTypes,m=v?v.emptyScript:"",b=g.reactiveElementPolyfillSupport,f=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(s){i=null}}return i}},x=(t,e)=>!l(t,e),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&d(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:a}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=null==s?void 0:s.call(this);null==a||a.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const t=this.properties,e=[...p(t),...u(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(i)t.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of s){const s=document.createElement("style"),a=e.litNonce;void 0!==a&&s.setAttribute("nonce",a),s.textContent=i.cssText,t.appendChild(s)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const s=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,s);if(void 0!==a&&!0===s.reflect){const r=(void 0!==(null==(i=s.converter)?void 0:i.toAttribute)?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,s;const a=this.constructor,r=a._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=a.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:y;this._$Em=r;const o=n.fromAttribute(e,t.type);this[r]=o??(null==(s=this._$Ej)?void 0:s.get(r))??o,this._$Em=null}}requestUpdate(t,e,i,s=!1,a){var r;if(void 0!==t){const n=this.constructor;if(!1===s&&(a=this[t]),i??(i=n.getPropertyOptions(t)),!((i.hasChanged??x)(a,e)||i.useDefault&&i.reflect&&a===(null==(r=this._$Ej)?void 0:r.get(t))&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==a||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(i)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[f("elementProperties")]=new Map,w[f("finalized")]=new Map,null==b||b({ReactiveElement:w}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.2");const k=globalThis,$=t=>t,S=k.trustedTypes,T=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+E,O=`<${A}>`,L=document,j=()=>L.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,q=Array.isArray,P="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,N=/>/g,D=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,M=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),B=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),J=new WeakMap,G=L.createTreeWalker(L,129);var K;function Q(t,e){if(!q(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==T?T.createHTML(e):e}class W{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let a=0,r=0;const n=t.length-1,o=this.parts,[l,d]=((t,e)=>{const i=t.length-1,s=[];let a,r=2===e?"<svg>":3===e?"<math>":"",n=I;for(let o=0;o<i;o++){const e=t[o];let i,l,d=-1,c=0;for(;c<e.length&&(n.lastIndex=c,l=n.exec(e),null!==l);)c=n.lastIndex,n===I?"!--"===l[1]?n=R:void 0!==l[1]?n=N:void 0!==l[2]?(H.test(l[2])&&(a=RegExp("</"+l[2],"g")),n=D):void 0!==l[3]&&(n=D):n===D?">"===l[0]?(n=a??I,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,i=l[1],n=void 0===l[3]?D:'"'===l[3]?M:F):n===M||n===F?n=D:n===R||n===N?n=I:(n=D,a=void 0);const p=n===D&&t[o+1].startsWith("/>")?" ":"";r+=n===I?e+O:d>=0?(s.push(i),e.slice(0,d)+C+e.slice(d)+E+p):e+E+(-2===d?o:p)}return[Q(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=W.createElement(l,i),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=G.nextNode())&&o.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=d[r++],i=s.getAttribute(t).split(E),n=/([.?@])?(.*)/.exec(e);o.push({type:1,index:a,name:n[2],strings:i,ctor:"."===n[1]?et:"?"===n[1]?it:"@"===n[1]?st:tt}),s.removeAttribute(t)}else t.startsWith(E)&&(o.push({type:6,index:a}),s.removeAttribute(t));if(H.test(s.tagName)){const t=s.textContent.split(E),e=t.length-1;if(e>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],j()),G.nextNode(),o.push({type:2,index:++a});s.append(t[e],j())}}}else if(8===s.nodeType)if(s.data===A)o.push({type:2,index:a});else{let t=-1;for(;-1!==(t=s.data.indexOf(E,t+1));)o.push({type:7,index:a}),t+=E.length-1}a++}}static createElement(t,e){const i=L.createElement("template");return i.innerHTML=t,i}}function Y(t,e,i=t,s){var a,r;if(e===B)return e;let n=void 0!==s?null==(a=i._$Co)?void 0:a[s]:i._$Cl;const o=z(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==o&&(null==(r=null==n?void 0:n._$AO)||r.call(n,!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,i,s)),void 0!==s?(i._$Co??(i._$Co=[]))[s]=n:i._$Cl=n),void 0!==n&&(e=Y(t,n._$AS(t,e.values),n,s)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((null==t?void 0:t.creationScope)??L).importNode(e,!0);G.currentNode=s;let a=G.nextNode(),r=0,n=0,o=i[0];for(;void 0!==o;){if(r===o.index){let e;2===o.type?e=new Z(a,a.nextSibling,this,t):1===o.type?e=new o.ctor(a,o.name,o.strings,this,t):6===o.type&&(e=new at(a,this,t)),this._$AV.push(e),o=i[++n]}r!==(null==o?void 0:o.index)&&(a=G.nextNode(),r++)}return G.currentNode=L,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(null==s?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),z(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>q(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==V&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(L.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,a="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=W.createElement(Q(s.h,s.h[0]),this.options)),s);if((null==(e=this._$AH)?void 0:e._$AD)===a)this._$AH.p(i);else{const t=new X(a,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new W(t)),e}k(t){q(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const a of t)s===e.length?e.push(i=new Z(this.O(j()),this.O(j()),this,this.options)):i=e[s],i._$AI(a),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t!==this._$AB;){const e=$(t).nextSibling;$(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,a){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(t,e=this,i,s){const a=this.strings;let r=!1;if(void 0===a)t=Y(this,t,e,0),r=!z(t)||t!==this._$AH&&t!==B,r&&(this._$AH=t);else{const s=t;let n,o;for(t=a[0],n=0;n<a.length-1;n++)o=Y(this,s[i+n],e,n),o===B&&(o=this._$AH[n]),r||(r=!z(o)||o!==this._$AH[n]),o===V?t=V:t!==V&&(t+=(o??"")+a[n+1]),this._$AH[n]=o}r&&!s&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==V)}}class st extends tt{constructor(t,e,i,s,a){super(t,e,i,s,a),this.type=5}_$AI(t,e=this){if((t=Y(this,t,e,0)??V)===B)return;const i=this._$AH,s=t===V&&i!==V||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==V&&(i===V||s);s&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const rt=k.litHtmlPolyfillSupport;null==rt||rt(W,Z),(k.litHtmlVersions??(k.litHtmlVersions=[])).push("3.3.2");const nt=globalThis;class ot extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=(null==i?void 0:i.renderBefore)??e;let a=s._$litPart$;if(void 0===a){const t=(null==i?void 0:i.renderBefore)??null;s._$litPart$=a=new Z(e.insertBefore(j(),t),t,void 0,i??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return B}}ot._$litElement$=!0,ot.finalized=!0,null==(t=nt.litElementHydrateSupport)||t.call(nt,{LitElement:ot});const lt=nt.litElementPolyfillSupport;null==lt||lt({LitElement:ot}),(nt.litElementVersions??(nt.litElementVersions=[])).push("4.2.2");const dt={dark:{"--tdt-bg":"#1a1a1a","--tdt-bg-secondary":"#242424","--tdt-bg-hover":"#2a2a2a","--tdt-border":"#333","--tdt-text":"#e0e0e0","--tdt-text-muted":"#888","--tdt-accent":"#3b82f6","--tdt-accent-hover":"#2563eb","--tdt-success":"#22c55e","--tdt-warning":"#eab308","--tdt-error":"#ef4444","--tdt-danger":"#ef4444","--tdt-string":"#a5d6ff","--tdt-number":"#79c0ff","--tdt-boolean":"#ff7b72","--tdt-null":"#888","--tdt-key":"#c792ea","--tdt-serp-bg":"#202124","--tdt-serp-border":"#3c4043","--tdt-serp-favicon-bg":"#303134","--tdt-serp-domain":"#bdc1c6","--tdt-serp-breadcrumb":"#9aa0a6","--tdt-serp-title":"#8ab4f8","--tdt-serp-description":"#bdc1c6"},light:{"--tdt-bg":"#ffffff","--tdt-bg-secondary":"#f5f5f5","--tdt-bg-hover":"#ebebeb","--tdt-border":"#e0e0e0","--tdt-text":"#1a1a1a","--tdt-text-muted":"#666","--tdt-accent":"#2563eb","--tdt-accent-hover":"#1d4ed8","--tdt-success":"#16a34a","--tdt-warning":"#ca8a04","--tdt-error":"#dc2626","--tdt-danger":"#dc2626","--tdt-string":"#0969da","--tdt-number":"#0550ae","--tdt-boolean":"#cf222e","--tdt-null":"#666","--tdt-key":"#8250df","--tdt-serp-bg":"#ffffff","--tdt-serp-border":"#dfe1e5","--tdt-serp-favicon-bg":"#f1f3f4","--tdt-serp-domain":"#202124","--tdt-serp-breadcrumb":"#5f6368","--tdt-serp-title":"#1a0dab","--tdt-serp-description":"#4d5156"}},ct={small:.9,medium:1,large:1.15},pt=n`
|
|
2
2
|
:host {
|
|
3
3
|
/* Inherit all CSS custom properties from parent */
|
|
4
4
|
font-family: var(--tdt-font);
|
|
@@ -106,7 +106,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
106
106
|
outline: none;
|
|
107
107
|
border-color: var(--tdt-accent);
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,ut=n`
|
|
110
110
|
:host {
|
|
111
111
|
/* Default dark theme - will be overridden by JS */
|
|
112
112
|
--tdt-bg: #1a1a1a;
|
|
@@ -129,6 +129,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
129
129
|
--tdt-font: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
|
|
130
130
|
--tdt-scale: 1;
|
|
131
131
|
--tdt-radius: 4px;
|
|
132
|
+
/* SERP preview defaults (dark theme) */
|
|
133
|
+
--tdt-serp-bg: #202124;
|
|
134
|
+
--tdt-serp-border: #3c4043;
|
|
135
|
+
--tdt-serp-favicon-bg: #303134;
|
|
136
|
+
--tdt-serp-domain: #bdc1c6;
|
|
137
|
+
--tdt-serp-breadcrumb: #9aa0a6;
|
|
138
|
+
--tdt-serp-title: #8ab4f8;
|
|
139
|
+
--tdt-serp-description: #bdc1c6;
|
|
132
140
|
|
|
133
141
|
all: initial;
|
|
134
142
|
font-family: var(--tdt-font);
|
|
@@ -141,7 +149,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
141
149
|
*, *::before, *::after {
|
|
142
150
|
box-sizing: border-box;
|
|
143
151
|
}
|
|
144
|
-
`;const ut=new class{constructor(){this.context=null}parse(){const t=document.getElementById("__THEME_DEVTOOLS_CONTEXT__");if(!t)return console.warn("[Theme Devtools] Context element not found"),null;try{return this.context=JSON.parse(t.textContent),this.context}catch(e){return console.error("[Theme Devtools] Failed to parse context:",e),null}}get(t){if(this.context)return t.split(".").reduce((t,e)=>null==t?void 0:t[e],this.context)}getMeta(){var t;return(null==(t=this.context)?void 0:t.meta)||{}}getObjects(){var t;return(null==(t=this.context)?void 0:t.objects)||{}}};function gt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const vt=class t{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null,this._isRestoring=!1,this._restoreEndTime=0,this._loadPersistedHistory()}startRestore(){this._isRestoring=!0}endRestore(t=null){this._isRestoring=!1,this._restoreEndTime=Date.now()+500,t&&(this.currentCart=t)}isRestoring(){return this._isRestoring||Date.now()<this._restoreEndTime}_loadPersistedHistory(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.cartHistory=JSON.parse(e))}catch(e){console.warn("[Theme Devtools] Failed to load cart history:",e)}}_persistHistory(){try{const e=this.cartHistory.slice(-50);sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}cartsEqual(t,e){var i,s,a,r;if(!t||!e)return!1;if(t.item_count!==e.item_count)return!1;if(t.total_price!==e.total_price)return!1;if((t.note||"")!==(e.note||""))return!1;if(JSON.stringify(t.attributes||{})!==JSON.stringify(e.attributes||{}))return!1;const n=t.items||[],o=e.items||[];if(n.length!==o.length)return!1;for(let l=0;l<n.length;l++){const t=n[l],e=o[l];if(t.variant_id!==e.variant_id)return!1;if(t.quantity!==e.quantity)return!1;if(JSON.stringify(t.properties||{})!==JSON.stringify(e.properties||{}))return!1;if((null==(s=null==(i=t.selling_plan_allocation)?void 0:i.selling_plan)?void 0:s.id)!==(null==(r=null==(a=e.selling_plan_allocation)?void 0:a.selling_plan)?void 0:r.id))return!1}return!0}async fetch(){try{const t=await fetch("/cart.js",{headers:{Accept:"application/json"}});return await t.json()}catch(t){return console.error("[Theme Devtools] Cart fetch failed:",t),null}}async update(t){try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:t})}),i=await e.json();return this.setCart(i),i}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const i=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),s=await i.json();return this.setCart(s),s}catch(i){return console.error("[Theme Devtools] Cart change failed:",i),null}}async clear(){try{const t=await fetch("/cart/clear.js",{method:"POST",headers:{Accept:"application/json"}}),e=await t.json();return this.setCart(e),e}catch(t){return console.error("[Theme Devtools] Cart clear failed:",t),null}}setCart(t){const e=this.currentCart;if(this.currentCart=t,this.isRestoring())this.notify(t,e);else if(e&&this.cartsEqual(e,t))this.notify(t,e);else{if(e){const i=this.cartHistory[this.cartHistory.length-1];i&&this.cartsEqual(i.snapshot,e)||(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:gt(e)}),this.cartHistory.length>50&&this.cartHistory.shift(),this._persistHistory())}this.notify(t,e)}}diffCart(t,e){const i={itemCount:{old:(null==t?void 0:t.item_count)||0,new:(null==e?void 0:e.item_count)||0},totalPrice:{old:(null==t?void 0:t.total_price)||0,new:(null==e?void 0:e.total_price)||0},items:{added:[],removed:[],modified:[]},noteChanged:((null==t?void 0:t.note)||"")!==((null==e?void 0:e.note)||""),attributesChanged:JSON.stringify((null==t?void 0:t.attributes)||{})!==JSON.stringify((null==e?void 0:e.attributes)||{}),discountChanged:JSON.stringify((null==t?void 0:t.discount_codes)||[])!==JSON.stringify((null==e?void 0:e.discount_codes)||[])},s=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),a=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return a.forEach((t,e)=>{const a=s.get(e);a?a.quantity!==t.quantity&&i.items.modified.push({item:t,oldQuantity:a.quantity,newQuantity:t.quantity}):i.items.added.push(t)}),s.forEach((t,e)=>{a.has(e)||i.items.removed.push(t)}),i}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(i=>{try{i(t,e)}catch(s){console.error("[Theme Devtools] Cart listener error:",s)}})}startPolling(t=2e3){if(this.pollInterval)return;const e=async()=>{const t=await this.fetch();t&&JSON.stringify(t)!==JSON.stringify(this.currentCart)&&this.setCart(t)};e(),this.pollInterval=setInterval(e,t)}stopPolling(){this.pollInterval&&(clearInterval(this.pollInterval),this.pollInterval=null)}interceptAjax(){const t=this,e=window.fetch;window.fetch=async function(i,s){const a=await e.apply(this,arguments);if("string"==typeof i&&i.includes("/cart"))try{const e=a.clone(),i=await e.json();i&&void 0!==i.item_count&&(t.isRestoring()?(t.currentCart=i,t.notify(i,null)):setTimeout(()=>t.setCart(i),0))}catch{}return a};const i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,s){return"string"==typeof s&&s.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&(t.isRestoring()?(t.currentCart=e,t.notify(e,null)):setTimeout(()=>t.setCart(e),0))}catch{}}),i.apply(this,arguments)}}};__publicField(vt,"STORAGE_KEY","tdt-cart-history");const mt=new vt;const ft=new class{constructor(){this.currentProduct=null,this.listeners=new Set,this._fetchPromise=null}async fetch(t){if(!t)return null;try{const e=await fetch(`/products/${t}.json`,{headers:{Accept:"application/json"}});if(!e.ok)return console.warn(`[Theme Devtools] Product fetch failed: ${e.status}`),null;return(await e.json()).product||null}catch(e){return console.error("[Theme Devtools] Product fetch failed:",e),null}}async initialize(t){if(!(null==t?void 0:t.handle))return this.currentProduct=t,t;if(this._fetchPromise)return this._fetchPromise;this._fetchPromise=this._doInitialize(t);const e=await this._fetchPromise;return this._fetchPromise=null,e}async _doInitialize(t){const e=await this.fetch(t.handle);return this.currentProduct=e?{...t,variants:e.variants||[],images:e.images||[],options:e.options||t.options,body_html:e.body_html,selected_variant:t.selected_variant,selected_or_first_available_variant:t.selected_or_first_available_variant,metafields_count:t.metafields_count}:t,this.notify(this.currentProduct),this.currentProduct}getVariant(t){var e;return(null==(e=this.currentProduct)?void 0:e.variants)&&this.currentProduct.variants.find(e=>e.id===t)||null}getVariants(){var t;return(null==(t=this.currentProduct)?void 0:t.variants)||[]}getImages(){var t;return(null==(t=this.currentProduct)?void 0:t.images)||[]}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t){this.listeners.forEach(e=>{try{e(t)}catch(i){console.error("[Theme Devtools] Product listener error:",i)}})}};const bt=new class{constructor(){this.overlay=null,this.currentSection=null}init(){this.overlay=document.createElement("div"),this.overlay.className="tdt-section-overlay",Object.assign(this.overlay.style,{position:"fixed",pointerEvents:"none",border:"2px solid #3b82f6",backgroundColor:"rgba(59, 130, 246, 0.1)",zIndex:"2147483646",display:"none",transition:"all 0.2s ease"}),document.body.appendChild(this.overlay)}findSections(){const t=[];Array.from(document.querySelectorAll('[id^="shopify-section-"]')).forEach(e=>{var i;const s=e.id.replace("shopify-section-",""),a=e.dataset.sectionType||(null==(i=e.className.match(/section-(\w+)/))?void 0:i[1])||"unknown",r=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:s,type:a,element:e,blockCount:r.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const i=e.dataset.sectionId;if(!t.find(t=>t.id===i)){const s=e.dataset.sectionType||"unknown",a=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:i,type:s,element:e,blockCount:a.length,rect:e.getBoundingClientRect()})}}),t}highlight(t){const e=this.findSections().find(e=>e.id===t);if(!e||!e.element)return void this.hide();const i=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${i.top}px`,left:`${i.left}px`,width:`${i.width}px`,height:`${i.height}px`}),this.currentSection=t,e.element.scrollIntoView({behavior:"smooth",block:"center"})}hide(){this.overlay&&(this.overlay.style.display="none"),this.currentSection=null}destroy(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},yt={theme:"dark",fontSize:"medium",defaultTab:"objects",panelHeight:"50",panelPosition:"bottom",persistAcrossSessions:!0,keyboardShortcut:{key:"D",ctrl:!0,shift:!0,alt:!1,meta:!1}},xt=class t{constructor(){this._settings={...yt},this._listeners=new Set,this._load()}getAll(){return{...this._settings}}get(t){return this._settings[t]}set(t,e){const i=this._settings[t];this._settings[t]=e,this._save(),this._notify(t,e,i)}setMultiple(t){const e={};for(const[i,s]of Object.entries(t))this._settings[i]!==s&&(e[i]={old:this._settings[i],new:s},this._settings[i]=s);this._save();for(const[i,{old:s,new:a}]of Object.entries(e))this._notify(i,a,s)}reset(){this._settings={...yt},this._save(),this._notify("*",this._settings,null)}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}getStorage(){return this._settings.persistAcrossSessions?localStorage:sessionStorage}matchesShortcut(t){const e=this._settings.keyboardShortcut,i=t.key.toUpperCase()===e.key.toUpperCase(),s=t.ctrlKey===e.ctrl,a=t.shiftKey===e.shift,r=t.altKey===e.alt,n=t.metaKey===e.meta;return navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.ctrl&&!e.meta?i&&(s||t.metaKey)&&a&&r:i&&s&&a&&r&&n}formatShortcut(){const t=this._settings.keyboardShortcut,e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),i.push(t.key.toUpperCase()),i.join(e?"":"+")}_load(){try{let e=localStorage.getItem(t.STORAGE_KEY);if(e||(e=sessionStorage.getItem(t.STORAGE_KEY)),e){const t=JSON.parse(e);this._settings={...yt,...t}}}catch(e){console.warn("[Theme Devtools] Failed to load settings:",e)}}_save(){try{const e=JSON.stringify(this._settings);this._settings.persistAcrossSessions?(localStorage.setItem(t.STORAGE_KEY,e),sessionStorage.removeItem(t.STORAGE_KEY)):(sessionStorage.setItem(t.STORAGE_KEY,e),localStorage.removeItem(t.STORAGE_KEY))}catch(e){console.warn("[Theme Devtools] Failed to save settings:",e)}}_notify(t,e,i){this._listeners.forEach(s=>{try{s(t,e,i)}catch(a){console.error("[Theme Devtools] Settings listener error:",a)}})}};__publicField(xt,"STORAGE_KEY","tdt-settings");const _t=new xt;class wt extends ot{constructor(){super(),this.data=null,this.path="",this.expanded=new Set,this.searchQuery="",this.forceExpandAll=!1,this._matchingPaths=new Set,this._lastForceExpandAll=!1}updated(t){(t.has("searchQuery")||t.has("data"))&&this._updateMatchingPaths(),t.has("forceExpandAll")&&(this.forceExpandAll&&!this._lastForceExpandAll?this._expandAllPaths():!this.forceExpandAll&&this._lastForceExpandAll&&(this.expanded=new Set),this._lastForceExpandAll=this.forceExpandAll)}_expandAllPaths(){const t=new Set;this._collectAllPaths(this.data,this.path,t),this.expanded=t}_collectAllPaths(t,e,i){if(null==t)return;if(!this._isExpandable(t))return;let s;i.add(e);try{s=Object.entries(t)}catch{return}for(const[a,r]of s){const t=e?`${e}.${a}`:a;this._collectAllPaths(r,t,i)}}_updateMatchingPaths(){const t=(this.searchQuery||"").toLowerCase().trim();if(!t||!this.data)return this._matchingPaths=new Set,void this._dispatchMatchCount(0);const e=new Set;if(this._findMatches(this.data,this.path,t,e),this._matchingPaths=e,this._dispatchMatchCount(e.size),e.size>0){const t=new Set(this.expanded);for(const i of e){const e=i.split(".");let s="";for(let i=0;i<e.length-1;i++)s=s?`${s}.${e[i]}`:e[i],t.add(s)}this.expanded=t}}_dispatchMatchCount(t){this.dispatchEvent(new CustomEvent("match-count-changed",{detail:{count:t},bubbles:!0,composed:!0}))}_findMatches(t,e,i,s){if(null==t)return;const a=this._getType(t);if("object"!==a&&"array"!==a){return void(String(t).toLowerCase().includes(i)&&s.add(e))}let r;try{r=Object.entries(t)}catch{return}for(const[n,o]of r){const t=e?`${e}.${n}`:n;n.toLowerCase().includes(i)&&s.add(t),this._findMatches(o,t,i,s)}}_isPathVisible(t){if(!this.searchQuery||0===this._matchingPaths.size)return!0;for(const e of this._matchingPaths)if(e===t||e.startsWith(t+"."))return!0;return!1}_highlightText(t,e){if(!e)return t;const i=String(t).toLowerCase(),s=e.toLowerCase(),a=i.indexOf(s);if(-1===a)return t;const r=String(t).slice(0,a),n=String(t).slice(a,a+e.length),o=String(t).slice(a+e.length);return U`${r}<span class="highlight">${n}</span>${o}`}_getType(t){return null===t?"null":void 0===t?"undefined":Array.isArray(t)?"array":typeof t}_isExpandable(t){if(null==t)return!1;const e=this._getType(t);if("object"!==e&&"array"!==e)return!1;try{return Object.keys(t).length>0}catch{return!1}}_getKeys(t){try{return Object.keys(t)}catch{return[]}}_isURL(t){return"string"==typeof t&&(/^(https?:\/\/|\/\/|\/[a-z])/i.test(t)||/\.(jpg|jpeg|png|gif|webp|svg|css|js|json)(\?|$)/i.test(t))}_toggleExpand(t,e){e.stopPropagation();const i=new Set(this.expanded);i.has(t)?i.delete(t):i.add(t),this.expanded=i}async _copyPath(t,e){e.stopPropagation();const i=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${i} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(s){console.error("Failed to copy:",s)}}async _copyValue(t,e){let i;if(e.stopPropagation(),"object"==typeof t&&null!==t)try{i=JSON.stringify(t,null,2)}catch{i=String(t)}else i=String(t);try{await navigator.clipboard.writeText(i);const t=e.target;t.classList.add("copy-value-btn--copied"),t.textContent="✓",setTimeout(()=>{t.classList.remove("copy-value-btn--copied"),t.textContent="copy"},1e3)}catch(s){console.error("Failed to copy value:",s)}}_openURL(t,e){e.stopPropagation();let i=t;t.startsWith("//")?i=window.location.protocol+t:t.startsWith("/")&&(i=window.location.origin+t),window.open(i,"_blank")}_renderValue(t,e){switch(e){case"string":const e=this._isURL(t),i=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${i}"</span>`:U`<span class="value value--string">"${i}"</span>`;case"number":return U`<span class="value value--number">${t}</span>`;case"boolean":return U`<span class="value value--boolean">${t}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${String(t)}</span>`}}_renderValueWithHighlight(t,e,i){if(!i)return this._renderValue(t,e);switch(e){case"string":const e=this._isURL(t),s=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${this._highlightText(s,i)}"</span>`:U`<span class="value value--string">"${this._highlightText(s,i)}"</span>`;case"number":return U`<span class="value value--number">${this._highlightText(String(t),i)}</span>`;case"boolean":return U`<span class="value value--boolean">${this._highlightText(String(t),i)}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${this._highlightText(String(t),i)}</span>`}}_renderPreview(t,e){let i;try{i=Object.keys(t).length}catch{i=0}if("array"===e){const e=[],s=3;for(let r=0;r<Math.min(i,s);r++){const i=t[r],s=this._getType(i);if("string"===s){const t=i.length>15?i.slice(0,15)+"…":i;e.push(U`<span class="array-preview-item array-preview-item--string">"${t}"</span>`)}else"number"===s?e.push(U`<span class="array-preview-item array-preview-item--number">${i}</span>`):"object"===s||"array"===s?e.push(U`<span class="array-preview-item">{…}</span>`):e.push(U`<span class="array-preview-item">${String(i)}</span>`)}const a=i>s;return U`
|
|
152
|
+
`;const ht=new class{constructor(){this.context=null}parse(){const t=document.getElementById("__THEME_DEVTOOLS_CONTEXT__");if(!t)return console.warn("[Theme Devtools] Context element not found"),null;try{return this.context=JSON.parse(t.textContent),this.context}catch(e){return console.error("[Theme Devtools] Failed to parse context:",e),null}}get(t){if(this.context)return t.split(".").reduce((t,e)=>null==t?void 0:t[e],this.context)}getMeta(){var t;return(null==(t=this.context)?void 0:t.meta)||{}}getObjects(){var t;return(null==(t=this.context)?void 0:t.objects)||{}}};function gt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const vt=class t{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null,this._isRestoring=!1,this._restoreEndTime=0,this._loadPersistedHistory()}startRestore(){this._isRestoring=!0}endRestore(t=null){this._isRestoring=!1,this._restoreEndTime=Date.now()+500,t&&(this.currentCart=t)}isRestoring(){return this._isRestoring||Date.now()<this._restoreEndTime}_loadPersistedHistory(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);e&&(this.cartHistory=JSON.parse(e))}catch(e){console.warn("[Theme Devtools] Failed to load cart history:",e)}}_persistHistory(){try{const e=this.cartHistory.slice(-50);sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}cartsEqual(t,e){var i,s,a,r;if(!t||!e)return!1;if(t.item_count!==e.item_count)return!1;if(t.total_price!==e.total_price)return!1;if((t.note||"")!==(e.note||""))return!1;if(JSON.stringify(t.attributes||{})!==JSON.stringify(e.attributes||{}))return!1;const n=t.items||[],o=e.items||[];if(n.length!==o.length)return!1;for(let l=0;l<n.length;l++){const t=n[l],e=o[l];if(t.variant_id!==e.variant_id)return!1;if(t.quantity!==e.quantity)return!1;if(JSON.stringify(t.properties||{})!==JSON.stringify(e.properties||{}))return!1;if((null==(s=null==(i=t.selling_plan_allocation)?void 0:i.selling_plan)?void 0:s.id)!==(null==(r=null==(a=e.selling_plan_allocation)?void 0:a.selling_plan)?void 0:r.id))return!1}return!0}async fetch(){try{const t=await fetch("/cart.js",{headers:{Accept:"application/json"},_tdtInternal:!0});return await t.json()}catch(t){return console.error("[Theme Devtools] Cart fetch failed:",t),null}}async update(t){try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:t})}),i=await e.json();return this.setCart(i),i}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const i=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),s=await i.json();return this.setCart(s),s}catch(i){return console.error("[Theme Devtools] Cart change failed:",i),null}}async clear(){try{const t=await fetch("/cart/clear.js",{method:"POST",headers:{Accept:"application/json"}}),e=await t.json();return this.setCart(e),e}catch(t){return console.error("[Theme Devtools] Cart clear failed:",t),null}}setCart(t){const e=this.currentCart;if(this.currentCart=t,this.isRestoring())this.notify(t,e);else if(e&&this.cartsEqual(e,t))this.notify(t,e);else{if(e){const i=this.cartHistory[this.cartHistory.length-1];i&&this.cartsEqual(i.snapshot,e)||(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:gt(e)}),this.cartHistory.length>50&&this.cartHistory.shift(),this._persistHistory())}this.notify(t,e)}}diffCart(t,e){const i={itemCount:{old:(null==t?void 0:t.item_count)||0,new:(null==e?void 0:e.item_count)||0},totalPrice:{old:(null==t?void 0:t.total_price)||0,new:(null==e?void 0:e.total_price)||0},items:{added:[],removed:[],modified:[]},noteChanged:((null==t?void 0:t.note)||"")!==((null==e?void 0:e.note)||""),attributesChanged:JSON.stringify((null==t?void 0:t.attributes)||{})!==JSON.stringify((null==e?void 0:e.attributes)||{}),discountChanged:JSON.stringify((null==t?void 0:t.discount_codes)||[])!==JSON.stringify((null==e?void 0:e.discount_codes)||[])},s=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),a=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return a.forEach((t,e)=>{const a=s.get(e);a?a.quantity!==t.quantity&&i.items.modified.push({item:t,oldQuantity:a.quantity,newQuantity:t.quantity}):i.items.added.push(t)}),s.forEach((t,e)=>{a.has(e)||i.items.removed.push(t)}),i}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(i=>{try{i(t,e)}catch(s){console.error("[Theme Devtools] Cart listener error:",s)}})}startPolling(t=2e3){if(this.pollInterval)return;const e=async()=>{const t=await this.fetch();t&&JSON.stringify(t)!==JSON.stringify(this.currentCart)&&this.setCart(t)};e(),this.pollInterval=setInterval(e,t)}stopPolling(){this.pollInterval&&(clearInterval(this.pollInterval),this.pollInterval=null)}interceptAjax(){const t=this,e=window.fetch;window.fetch=async function(i,s){const a=await e.apply(this,arguments);if("string"==typeof i&&i.includes("/cart"))try{const e=a.clone(),i=await e.json();i&&void 0!==i.item_count&&(t.isRestoring()?(t.currentCart=i,t.notify(i,null)):setTimeout(()=>t.setCart(i),0))}catch{}return a};const i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,s){return"string"==typeof s&&s.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&(t.isRestoring()?(t.currentCart=e,t.notify(e,null)):setTimeout(()=>t.setCart(e),0))}catch{}}),i.apply(this,arguments)}}};__publicField(vt,"STORAGE_KEY","tdt-cart-history");const mt=new vt;const bt=new class{constructor(){this.currentProduct=null,this.listeners=new Set,this._fetchPromise=null}async fetch(t){if(!t)return null;try{const e=await fetch(`/products/${t}.json`,{headers:{Accept:"application/json"}});if(!e.ok)return console.warn(`[Theme Devtools] Product fetch failed: ${e.status}`),null;return(await e.json()).product||null}catch(e){return console.error("[Theme Devtools] Product fetch failed:",e),null}}async initialize(t){if(!(null==t?void 0:t.handle))return this.currentProduct=t,t;if(this._fetchPromise)return this._fetchPromise;this._fetchPromise=this._doInitialize(t);const e=await this._fetchPromise;return this._fetchPromise=null,e}async _doInitialize(t){const e=await this.fetch(t.handle);return this.currentProduct=e?{...t,variants:e.variants||[],images:e.images||[],options:e.options||t.options,body_html:e.body_html,selected_variant:t.selected_variant,selected_or_first_available_variant:t.selected_or_first_available_variant,metafields_count:t.metafields_count}:t,this.notify(this.currentProduct),this.currentProduct}getVariant(t){var e;return(null==(e=this.currentProduct)?void 0:e.variants)&&this.currentProduct.variants.find(e=>e.id===t)||null}getVariants(){var t;return(null==(t=this.currentProduct)?void 0:t.variants)||[]}getImages(){var t;return(null==(t=this.currentProduct)?void 0:t.images)||[]}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t){this.listeners.forEach(e=>{try{e(t)}catch(i){console.error("[Theme Devtools] Product listener error:",i)}})}};const ft=new class{constructor(){this.overlay=null,this.currentSection=null}init(){this.overlay=document.createElement("div"),this.overlay.className="tdt-section-overlay",Object.assign(this.overlay.style,{position:"fixed",pointerEvents:"none",border:"2px solid #3b82f6",backgroundColor:"rgba(59, 130, 246, 0.1)",zIndex:"2147483646",display:"none",transition:"all 0.2s ease"}),document.body.appendChild(this.overlay)}findSections(){const t=[];Array.from(document.querySelectorAll('[id^="shopify-section-"]')).forEach(e=>{var i;const s=e.id.replace("shopify-section-",""),a=e.dataset.sectionType||(null==(i=e.className.match(/section-(\w+)/))?void 0:i[1])||"unknown",r=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:s,type:a,element:e,blockCount:r.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const i=e.dataset.sectionId;if(!t.find(t=>t.id===i)){const s=e.dataset.sectionType||"unknown",a=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:i,type:s,element:e,blockCount:a.length,rect:e.getBoundingClientRect()})}}),t}highlight(t){const e=this.findSections().find(e=>e.id===t);if(!e||!e.element)return void this.hide();const i=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${i.top}px`,left:`${i.left}px`,width:`${i.width}px`,height:`${i.height}px`}),this.currentSection=t,e.element.scrollIntoView({behavior:"smooth",block:"center"})}hide(){this.overlay&&(this.overlay.style.display="none"),this.currentSection=null}destroy(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}},yt={theme:"dark",fontSize:"medium",defaultTab:"objects",panelHeight:"50",panelPosition:"bottom",persistAcrossSessions:!0,keyboardShortcut:{key:"D",ctrl:!0,shift:!0,alt:!1,meta:!1}},xt=class t{constructor(){this._settings={...yt},this._listeners=new Set,this._load()}getAll(){return{...this._settings}}get(t){return this._settings[t]}set(t,e){const i=this._settings[t];this._settings[t]=e,this._save(),this._notify(t,e,i)}setMultiple(t){const e={};for(const[i,s]of Object.entries(t))this._settings[i]!==s&&(e[i]={old:this._settings[i],new:s},this._settings[i]=s);this._save();for(const[i,{old:s,new:a}]of Object.entries(e))this._notify(i,a,s)}reset(){this._settings={...yt},this._save(),this._notify("*",this._settings,null)}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}getStorage(){return this._settings.persistAcrossSessions?localStorage:sessionStorage}matchesShortcut(t){const e=this._settings.keyboardShortcut,i=t.key.toUpperCase()===e.key.toUpperCase(),s=t.ctrlKey===e.ctrl,a=t.shiftKey===e.shift,r=t.altKey===e.alt,n=t.metaKey===e.meta;return navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.ctrl&&!e.meta?i&&(s||t.metaKey)&&a&&r:i&&s&&a&&r&&n}formatShortcut(){const t=this._settings.keyboardShortcut,e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),i.push(t.key.toUpperCase()),i.join(e?"":"+")}_load(){try{let e=localStorage.getItem(t.STORAGE_KEY);if(e||(e=sessionStorage.getItem(t.STORAGE_KEY)),e){const t=JSON.parse(e);this._settings={...yt,...t}}}catch(e){console.warn("[Theme Devtools] Failed to load settings:",e)}}_save(){try{const e=JSON.stringify(this._settings);this._settings.persistAcrossSessions?(localStorage.setItem(t.STORAGE_KEY,e),sessionStorage.removeItem(t.STORAGE_KEY)):(sessionStorage.setItem(t.STORAGE_KEY,e),localStorage.removeItem(t.STORAGE_KEY))}catch(e){console.warn("[Theme Devtools] Failed to save settings:",e)}}_notify(t,e,i){this._listeners.forEach(s=>{try{s(t,e,i)}catch(a){console.error("[Theme Devtools] Settings listener error:",a)}})}};__publicField(xt,"STORAGE_KEY","tdt-settings");const _t=new xt;class wt extends ot{constructor(){super(),this.data=null,this.path="",this.expanded=new Set,this.searchQuery="",this.forceExpandAll=!1,this._matchingPaths=new Set,this._lastForceExpandAll=!1}updated(t){(t.has("searchQuery")||t.has("data"))&&this._updateMatchingPaths(),t.has("forceExpandAll")&&(this.forceExpandAll&&!this._lastForceExpandAll?this._expandAllPaths():!this.forceExpandAll&&this._lastForceExpandAll&&(this.expanded=new Set),this._lastForceExpandAll=this.forceExpandAll)}_expandAllPaths(){const t=new Set;this._collectAllPaths(this.data,this.path,t),this.expanded=t}_collectAllPaths(t,e,i){if(null==t)return;if(!this._isExpandable(t))return;let s;i.add(e);try{s=Object.entries(t)}catch{return}for(const[a,r]of s){const t=e?`${e}.${a}`:a;this._collectAllPaths(r,t,i)}}_updateMatchingPaths(){const t=(this.searchQuery||"").toLowerCase().trim();if(!t||!this.data)return this._matchingPaths=new Set,void this._dispatchMatchCount(0);const e=new Set;if(this._findMatches(this.data,this.path,t,e),this._matchingPaths=e,this._dispatchMatchCount(e.size),e.size>0){const t=new Set(this.expanded);for(const i of e){const e=i.split(".");let s="";for(let i=0;i<e.length-1;i++)s=s?`${s}.${e[i]}`:e[i],t.add(s)}this.expanded=t}}_dispatchMatchCount(t){this.dispatchEvent(new CustomEvent("match-count-changed",{detail:{count:t},bubbles:!0,composed:!0}))}_findMatches(t,e,i,s){if(null==t)return;const a=this._getType(t);if("object"!==a&&"array"!==a){return void(String(t).toLowerCase().includes(i)&&s.add(e))}let r;try{r=Object.entries(t)}catch{return}for(const[n,o]of r){const t=e?`${e}.${n}`:n;n.toLowerCase().includes(i)&&s.add(t),this._findMatches(o,t,i,s)}}_isPathVisible(t){if(!this.searchQuery||0===this._matchingPaths.size)return!0;for(const e of this._matchingPaths)if(e===t||e.startsWith(t+"."))return!0;return!1}_highlightText(t,e){if(!e)return t;const i=String(t).toLowerCase(),s=e.toLowerCase(),a=i.indexOf(s);if(-1===a)return t;const r=String(t).slice(0,a),n=String(t).slice(a,a+e.length),o=String(t).slice(a+e.length);return U`${r}<span class="highlight">${n}</span>${o}`}_getType(t){return null===t?"null":void 0===t?"undefined":Array.isArray(t)?"array":typeof t}_isExpandable(t){if(null==t)return!1;const e=this._getType(t);if("object"!==e&&"array"!==e)return!1;try{return Object.keys(t).length>0}catch{return!1}}_getKeys(t){try{return Object.keys(t)}catch{return[]}}_isURL(t){return"string"==typeof t&&(/^(https?:\/\/|\/\/|\/[a-z])/i.test(t)||/\.(jpg|jpeg|png|gif|webp|svg|css|js|json)(\?|$)/i.test(t))}_toggleExpand(t,e){e.stopPropagation();const i=new Set(this.expanded);i.has(t)?i.delete(t):i.add(t),this.expanded=i}async _copyPath(t,e){e.stopPropagation();const i=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${i} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(s){console.error("Failed to copy:",s)}}async _copyValue(t,e){let i;if(e.stopPropagation(),"object"==typeof t&&null!==t)try{i=JSON.stringify(t,null,2)}catch{i=String(t)}else i=String(t);try{await navigator.clipboard.writeText(i);const t=e.target;t.classList.add("copy-value-btn--copied"),t.textContent="✓",setTimeout(()=>{t.classList.remove("copy-value-btn--copied"),t.textContent="copy"},1e3)}catch(s){console.error("Failed to copy value:",s)}}_openURL(t,e){e.stopPropagation();let i=t;t.startsWith("//")?i=window.location.protocol+t:t.startsWith("/")&&(i=window.location.origin+t),window.open(i,"_blank")}_renderValue(t,e){switch(e){case"string":const e=this._isURL(t),i=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${i}"</span>`:U`<span class="value value--string">"${i}"</span>`;case"number":return U`<span class="value value--number">${t}</span>`;case"boolean":return U`<span class="value value--boolean">${t}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${String(t)}</span>`}}_renderValueWithHighlight(t,e,i){if(!i)return this._renderValue(t,e);switch(e){case"string":const e=this._isURL(t),s=t.length>80?t.slice(0,80)+"...":t;return e?U`<span class="value value--url" @click=${e=>this._openURL(t,e)} title="Click to open: ${t}">"${this._highlightText(s,i)}"</span>`:U`<span class="value value--string">"${this._highlightText(s,i)}"</span>`;case"number":return U`<span class="value value--number">${this._highlightText(String(t),i)}</span>`;case"boolean":return U`<span class="value value--boolean">${this._highlightText(String(t),i)}</span>`;case"null":return U`<span class="value value--null">null</span>`;case"undefined":return U`<span class="value value--undefined">undefined</span>`;case"object":case"array":return U`<span class="preview">{}</span>`;default:return U`<span class="value">${this._highlightText(String(t),i)}</span>`}}_renderPreview(t,e){let i;try{i=Object.keys(t).length}catch{i=0}if("array"===e){const e=[],s=3;for(let r=0;r<Math.min(i,s);r++){const i=t[r],s=this._getType(i);if("string"===s){const t=i.length>15?i.slice(0,15)+"…":i;e.push(U`<span class="array-preview-item array-preview-item--string">"${t}"</span>`)}else"number"===s?e.push(U`<span class="array-preview-item array-preview-item--number">${i}</span>`):"object"===s||"array"===s?e.push(U`<span class="array-preview-item">{…}</span>`):e.push(U`<span class="array-preview-item">${String(i)}</span>`)}const a=i>s;return U`
|
|
145
153
|
<span class="preview">Array(${i})</span>
|
|
146
154
|
${e.length>0?U`
|
|
147
155
|
<span class="preview-keys">[${e.map((t,i)=>U`${t}${i<e.length-1?", ":""}`)}${a?", …":""}]</span>
|
|
@@ -151,16 +159,16 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
151
159
|
${a.length>0?U`
|
|
152
160
|
<span class="preview-keys">{${a.join(", ")}${r?", …":""}}</span>
|
|
153
161
|
`:""}
|
|
154
|
-
`}_renderNode(t,e,i,s=!1,a=!1){const r=this._getType(e),n=this._isExpandable(e),o=this.expanded.has(i),l=this._isPathVisible(i),
|
|
162
|
+
`}_renderNode(t,e,i,s=!1,a=!1){const r=this._getType(e),n=this._isExpandable(e),o=this.expanded.has(i),l=this._isPathVisible(i),d=(this.searchQuery||"").trim(),c=["node",s?"node--root":"",n?"node--expandable":"",o?"node--expanded":"",l?"":"node--hidden"].filter(Boolean).join(" "),p=a?`[${t}]`:t,u=d?this._highlightText(p,d):p;let h=0;if(n&&d&&this._matchingPaths.size>0)for(const g of this._matchingPaths)g.startsWith(i+".")&&h++;return U`
|
|
155
163
|
<div
|
|
156
|
-
class=${
|
|
164
|
+
class=${c}
|
|
157
165
|
@click=${n?t=>this._toggleExpand(i,t):null}
|
|
158
166
|
>
|
|
159
167
|
<span class="node-content">
|
|
160
|
-
<span class="key" @click=${t=>this._copyPath(i,t)} title="Click to copy Liquid path">${
|
|
168
|
+
<span class="key" @click=${t=>this._copyPath(i,t)} title="Click to copy Liquid path">${u}</span>
|
|
161
169
|
<span class="separator">: </span>
|
|
162
|
-
${n?this._renderPreview(e,r):this._renderValueWithHighlight(e,r,
|
|
163
|
-
${
|
|
170
|
+
${n?this._renderPreview(e,r):this._renderValueWithHighlight(e,r,d)}
|
|
171
|
+
${h>0&&!o?U`<span class="match-count">${h} match${h>1?"es":""}</span>`:""}
|
|
164
172
|
<button class="copy-value-btn" @click=${t=>this._copyValue(e,t)} title="Copy value">copy</button>
|
|
165
173
|
</span>
|
|
166
174
|
${n&&o?U`
|
|
@@ -604,7 +612,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
604
612
|
text-transform: uppercase;
|
|
605
613
|
letter-spacing: 0.5px;
|
|
606
614
|
}
|
|
607
|
-
`]);let $t=kt;customElements.define("tdt-objects-panel",$t);
|
|
615
|
+
`]);let $t=kt;customElements.define("tdt-objects-panel",$t);const St=class t extends ot{constructor(){super(),this.cart=null,this.previousCart=null,this.diff=null,this.showHistory=!1,this.cartHistory=[],this.showAddProduct=!1,this.showAttributes=!1,this.showDiscountInput=!1,this.expandedItems=new Set,this.variantIdInput="",this.quantityInput=1,this.discountInput="",this.editingNote=!1,this.noteInput="",this.editingAttributes=!1,this.attributesInput={},this._toastTimeout=null,this.showScenarios=!1,this.scenarios=[],this.editingScenario=null,this.scenarioNameInput="",this._loadScenarios()}_loadScenarios(){try{const e=localStorage.getItem(t.SCENARIOS_STORAGE_KEY);e&&(this.scenarios=JSON.parse(e))}catch(e){console.warn("[TDT] Failed to load scenarios:",e)}}_saveScenarios(){try{localStorage.setItem(t.SCENARIOS_STORAGE_KEY,JSON.stringify(this.scenarios))}catch(e){console.warn("[TDT] Failed to save scenarios:",e)}}updated(t){if(t.has("cart")&&this.cart){const e=t.get("cart");e&&(this.previousCart=e,this.diff=mt.diffCart(e,this.cart)),this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}}async _refresh(){const t=await mt.fetch();t&&mt.setCart(t)}async _clear(){confirm("Clear entire cart?")&&await mt.clear()}async _updateQuantity(t,e){await mt.change(t+1,e)}async _remove(t){await mt.change(t+1,0)}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}_exportCartJSON(){if(!this.cart)return;const t=JSON.stringify(this.cart,null,2),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=`cart-${(new Date).toISOString().slice(0,10)}.json`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}_copyCartPermalink(){if(!this.cart||0===this.cart.items.length)return;const t=this.cart.items.map(t=>`${t.variant_id}:${t.quantity}`).join(","),e=`${window.location.origin}/cart/${t}`;navigator.clipboard.writeText(e),this._showToast("Cart permalink copied!")}_showToast(t){this._toastTimeout&&clearTimeout(this._toastTimeout),this._toastMessage=t,this.requestUpdate(),this._toastTimeout=setTimeout(()=>{this._toastMessage=null,this.requestUpdate()},2e3)}_toggleHistory(){this.showHistory=!this.showHistory,this.showHistory&&(this.cartHistory=[...mt.cartHistory].reverse())}_formatHistoryTime(t){const e=new Date(t),i=new Date-e;return i<6e4?"Just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}async _restoreCart(t){if(!t.snapshot)return;const e=t.snapshot;try{if(mt.startRestore(),await mt.clear(),e.items&&e.items.length>0){const t=e.items.map(t=>{var e,i;const s={id:t.variant_id,quantity:t.quantity};return t.properties&&Object.keys(t.properties).length>0&&(s.properties=t.properties),(null==(i=null==(e=t.selling_plan_allocation)?void 0:e.selling_plan)?void 0:i.id)&&(s.selling_plan=t.selling_plan_allocation.selling_plan.id),s});await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({items:t})})}const t={};e.attributes&&Object.keys(e.attributes).length>0&&(t.attributes=e.attributes),e.note&&(t.note=e.note),Object.keys(t).length>0&&await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)});const i=await mt.fetch();mt.endRestore(i),i&&mt.notify(i,null),this._showToast("Cart restored!")}catch(i){mt.endRestore(),console.error("[Theme Devtools] Cart restore failed:",i),this._showToast(`Restore failed: ${i.message}`)}}_getHistoryLabel(t){var e,i,s,a,r,n,o,l,d,c;const p=[];if((null==(i=null==(e=t.items)?void 0:e.added)?void 0:i.length)>0&&t.items.added.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`+ ${e}`,class:"diff__added"})}),(null==(a=null==(s=t.items)?void 0:s.removed)?void 0:a.length)>0&&t.items.removed.forEach(t=>{const e=t.product_title||t.title||"Item";p.push({text:`− ${e}`,class:"diff__removed"})}),(null==(n=null==(r=t.items)?void 0:r.modified)?void 0:n.length)>0&&t.items.modified.forEach(t=>{var e,i;const s=(null==(e=t.item)?void 0:e.product_title)||(null==(i=t.item)?void 0:i.title)||"Item";p.push({text:`${s}: ${t.oldQuantity} → ${t.newQuantity}`,class:"diff__modified"})}),t.noteChanged&&p.push({text:"Note updated",class:""}),t.attributesChanged&&p.push({text:"Attrs updated",class:""}),t.discountChanged&&p.push({text:"Discount changed",class:""}),0===p.length){const e=(null==(o=t.itemCount)?void 0:o.old)??0,i=(null==(l=t.itemCount)?void 0:l.new)??0;i>e?p.push({text:`+${i-e} item(s) added`,class:"diff__added"}):i<e?p.push({text:`−${e-i} item(s) removed`,class:"diff__removed"}):(null==(d=t.totalPrice)?void 0:d.old)!==(null==(c=t.totalPrice)?void 0:c.new)?p.push({text:"Price changed",class:""}):p.push({text:"Cart refreshed",class:""})}return p}_clearHistory(){0!==this.cartHistory.length&&confirm("Clear cart history?")&&(mt.cartHistory=[],sessionStorage.removeItem(mt.constructor.STORAGE_KEY),this.cartHistory=[])}_renderHistoryPanel(){return this.showHistory?U`
|
|
608
616
|
<div class="history-panel">
|
|
609
617
|
<div class="history-header">
|
|
610
618
|
<span>Cart History</span>
|
|
@@ -653,7 +661,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
653
661
|
@input=${t=>this.quantityInput=parseInt(t.target.value,10)||1}
|
|
654
662
|
>
|
|
655
663
|
<button class="btn btn--sm btn--mini" @click=${this._addByVariantId}>+Add</button>
|
|
656
|
-
<span style="margin-left: auto; color: var(--tdt-text-muted);"
|
|
664
|
+
<span style="margin-left: auto; color: var(--tdt-text-muted);"></span>
|
|
657
665
|
<span class="label">Discount:</span>
|
|
658
666
|
<div class="discount-input-inline">
|
|
659
667
|
<input
|
|
@@ -757,6 +765,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
757
765
|
</div>
|
|
758
766
|
`}_renderItemExpanded(t){var e,i;const s=t.properties||{},a=Object.keys(s).length>0,r=t.selling_plan_allocation;return t.original_line_price&&(t.original_line_price,t.line_price),U`
|
|
759
767
|
<div class="item-expanded">
|
|
768
|
+
<div class="item-detail-row">
|
|
769
|
+
<span class="item-detail-label">Vendor:</span>
|
|
770
|
+
<span class="item-detail-value">${t.vendor||"—"}</span>
|
|
771
|
+
</div>
|
|
772
|
+
<div class="item-detail-row">
|
|
773
|
+
<span class="item-detail-label">Product Type:</span>
|
|
774
|
+
<span class="item-detail-value">${t.product_type||"—"}</span>
|
|
775
|
+
</div>
|
|
760
776
|
<div class="item-detail-row">
|
|
761
777
|
<span class="item-detail-label">Variant ID:</span>
|
|
762
778
|
<span class="item-detail-value">${t.variant_id}</span>
|
|
@@ -836,6 +852,122 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
836
852
|
</button>
|
|
837
853
|
</div>
|
|
838
854
|
</div>
|
|
855
|
+
`}_toggleScenarios(){this.showScenarios=!this.showScenarios,this.showScenarios||(this.editingScenario=null)}_createNewScenario(){this.editingScenario={id:null,name:"",items:[{variantId:"",quantity:1,properties:{}}],note:"",attributes:{}},this.scenarioNameInput=""}_saveCurrentCartAsScenario(){if(!this.cart||0===this.cart.items.length)return void this._showToast("Cart is empty");const t=prompt("Enter scenario name:",`Cart ${(new Date).toLocaleDateString()}`);if(!t)return;const e={id:Date.now(),name:t,items:this.cart.items.map(t=>({variantId:String(t.variant_id),quantity:t.quantity,properties:t.properties||{},_title:t.product_title,_variant:t.variant_title,_sku:t.sku})),note:this.cart.note||"",attributes:this.cart.attributes||{},createdAt:(new Date).toISOString()};this.scenarios=[...this.scenarios,e],this._saveScenarios(),this._showToast("Scenario saved!")}_editScenario(t){this.editingScenario={...t,items:t.items.map(t=>({...t,properties:{...t.properties}}))},this.scenarioNameInput=t.name}_deleteScenario(t){confirm("Delete this scenario?")&&(this.scenarios=this.scenarios.filter(e=>e.id!==t),this._saveScenarios(),this._showToast("Scenario deleted"))}_cancelEditScenario(){this.editingScenario=null,this.scenarioNameInput=""}_saveEditingScenario(){if(!this.scenarioNameInput.trim())return void this._showToast("Please enter a scenario name");const t=this.editingScenario.items.filter(t=>t.variantId.trim());if(0===t.length)return void this._showToast("Add at least one item with a variant ID");const e={...this.editingScenario,name:this.scenarioNameInput.trim(),items:t,id:this.editingScenario.id||Date.now(),createdAt:this.editingScenario.createdAt||(new Date).toISOString()};this.editingScenario.id?this.scenarios=this.scenarios.map(t=>t.id===e.id?e:t):this.scenarios=[...this.scenarios,e],this._saveScenarios(),this.editingScenario=null,this.scenarioNameInput="",this._showToast("Scenario saved!")}_addScenarioItem(){this.editingScenario={...this.editingScenario,items:[...this.editingScenario.items,{variantId:"",quantity:1,properties:{}}]}}_removeScenarioItem(t){const e=[...this.editingScenario.items];e.splice(t,1),this.editingScenario={...this.editingScenario,items:e}}_updateScenarioItem(t,e,i){const s=[...this.editingScenario.items];s[t]={...s[t],[e]:i},this.editingScenario={...this.editingScenario,items:s}}_addScenarioItemProperty(t){const e=[...this.editingScenario.items],i={...e[t].properties,"":""};e[t]={...e[t],properties:i},this.editingScenario={...this.editingScenario,items:e}}_updateScenarioItemProperty(t,e,i,s){const a=[...this.editingScenario.items],r={...a[t].properties};e!==i&&delete r[e],r[i]=s,a[t]={...a[t],properties:r},this.editingScenario={...this.editingScenario,items:a}}_removeScenarioItemProperty(t,e){const i=[...this.editingScenario.items],s={...i[t].properties};delete s[e],i[t]={...i[t],properties:s},this.editingScenario={...this.editingScenario,items:i}}async _loadScenario(t,e=!1){try{e&&await mt.clear();const i=t.items.map(t=>{const e={id:parseInt(t.variantId,10),quantity:t.quantity};return t.properties&&Object.keys(t.properties).length>0&&(e.properties=t.properties),e}),s=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({items:i})});if(!s.ok){const t=await s.json();throw new Error(t.message||t.description||"Failed to add items")}const a={};t.note&&(a.note=t.note),t.attributes&&Object.keys(t.attributes).length>0&&(a.attributes=t.attributes),Object.keys(a).length>0&&await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)}),await this._refresh(),this._showToast(`Loaded "${t.name}"`)}catch(i){this._showToast(`Error: ${i.message}`)}}_renderScenarioPanel(){return this.showScenarios?U`
|
|
856
|
+
<div class="scenario-panel">
|
|
857
|
+
<div class="scenario-header">
|
|
858
|
+
<span>Cart Scenarios</span>
|
|
859
|
+
<div class="scenario-header-actions">
|
|
860
|
+
<span style="font-weight: normal; color: var(--tdt-text-muted);">${this.scenarios.length} saved</span>
|
|
861
|
+
<button class="scenario-btn" @click=${this._saveCurrentCartAsScenario} title="Save current cart as scenario">
|
|
862
|
+
Save Current
|
|
863
|
+
</button>
|
|
864
|
+
<button class="scenario-btn scenario-btn--primary" @click=${this._createNewScenario}>
|
|
865
|
+
+ New
|
|
866
|
+
</button>
|
|
867
|
+
</div>
|
|
868
|
+
</div>
|
|
869
|
+
|
|
870
|
+
${this.editingScenario?this._renderScenarioEditor():U`
|
|
871
|
+
${0===this.scenarios.length?U`
|
|
872
|
+
<div class="scenario-empty">
|
|
873
|
+
No scenarios saved yet. Save your current cart or create a new scenario.
|
|
874
|
+
</div>
|
|
875
|
+
`:U`
|
|
876
|
+
<div class="scenario-list">
|
|
877
|
+
${this.scenarios.map(t=>U`
|
|
878
|
+
<div class="scenario-item">
|
|
879
|
+
<div class="scenario-info">
|
|
880
|
+
<div class="scenario-name">${t.name}</div>
|
|
881
|
+
<div class="scenario-meta">
|
|
882
|
+
${t.items.length} item${1!==t.items.length?"s":""}
|
|
883
|
+
${t.items.slice(0,2).map(t=>t._title||`#${t.variantId}`).join(", ")}
|
|
884
|
+
${t.items.length>2?"...":""}
|
|
885
|
+
</div>
|
|
886
|
+
</div>
|
|
887
|
+
<div class="scenario-actions">
|
|
888
|
+
<button class="scenario-btn scenario-btn--primary" @click=${()=>this._loadScenario(t,!0)} title="Clear cart and load">
|
|
889
|
+
Replace
|
|
890
|
+
</button>
|
|
891
|
+
<button class="scenario-btn" @click=${()=>this._loadScenario(t,!1)} title="Add to existing cart">
|
|
892
|
+
Append
|
|
893
|
+
</button>
|
|
894
|
+
<button class="scenario-btn" @click=${()=>this._editScenario(t)} title="Edit scenario">
|
|
895
|
+
Edit
|
|
896
|
+
</button>
|
|
897
|
+
<button class="scenario-btn scenario-btn--danger" @click=${()=>this._deleteScenario(t.id)} title="Delete">
|
|
898
|
+
×
|
|
899
|
+
</button>
|
|
900
|
+
</div>
|
|
901
|
+
</div>
|
|
902
|
+
`)}
|
|
903
|
+
</div>
|
|
904
|
+
`}
|
|
905
|
+
`}
|
|
906
|
+
</div>
|
|
907
|
+
`:""}_renderScenarioEditor(){return U`
|
|
908
|
+
<div class="scenario-editor">
|
|
909
|
+
<div class="scenario-editor-header">
|
|
910
|
+
<input
|
|
911
|
+
type="text"
|
|
912
|
+
placeholder="Scenario name..."
|
|
913
|
+
.value=${this.scenarioNameInput}
|
|
914
|
+
@input=${t=>this.scenarioNameInput=t.target.value}
|
|
915
|
+
>
|
|
916
|
+
</div>
|
|
917
|
+
|
|
918
|
+
<div class="scenario-items-list">
|
|
919
|
+
${this.editingScenario.items.map((t,e)=>U`
|
|
920
|
+
<div class="scenario-item-row">
|
|
921
|
+
<input
|
|
922
|
+
type="text"
|
|
923
|
+
class="variant-input"
|
|
924
|
+
placeholder="Variant ID"
|
|
925
|
+
.value=${t.variantId}
|
|
926
|
+
@input=${t=>this._updateScenarioItem(e,"variantId",t.target.value)}
|
|
927
|
+
>
|
|
928
|
+
<input
|
|
929
|
+
type="number"
|
|
930
|
+
class="qty-input"
|
|
931
|
+
min="1"
|
|
932
|
+
.value=${t.quantity}
|
|
933
|
+
@input=${t=>this._updateScenarioItem(e,"quantity",parseInt(t.target.value,10)||1)}
|
|
934
|
+
>
|
|
935
|
+
<div class="scenario-item-props">
|
|
936
|
+
${Object.entries(t.properties).map(([t,i])=>U`
|
|
937
|
+
<div class="scenario-item-props-row">
|
|
938
|
+
<input
|
|
939
|
+
type="text"
|
|
940
|
+
placeholder="key"
|
|
941
|
+
.value=${t}
|
|
942
|
+
@input=${s=>this._updateScenarioItemProperty(e,t,s.target.value,i)}
|
|
943
|
+
>
|
|
944
|
+
<input
|
|
945
|
+
type="text"
|
|
946
|
+
placeholder="value"
|
|
947
|
+
.value=${i}
|
|
948
|
+
@input=${i=>this._updateScenarioItemProperty(e,t,t,i.target.value)}
|
|
949
|
+
>
|
|
950
|
+
<button class="scenario-btn scenario-btn--danger" style="padding: 2px 6px;" @click=${()=>this._removeScenarioItemProperty(e,t)}>×</button>
|
|
951
|
+
</div>
|
|
952
|
+
`)}
|
|
953
|
+
<button class="scenario-add-prop-btn" @click=${()=>this._addScenarioItemProperty(e)}>+ property</button>
|
|
954
|
+
</div>
|
|
955
|
+
${this.editingScenario.items.length>1?U`
|
|
956
|
+
<button class="scenario-btn scenario-btn--danger" @click=${()=>this._removeScenarioItem(e)}>×</button>
|
|
957
|
+
`:""}
|
|
958
|
+
</div>
|
|
959
|
+
`)}
|
|
960
|
+
</div>
|
|
961
|
+
|
|
962
|
+
<button class="scenario-add-item-btn" @click=${this._addScenarioItem}>
|
|
963
|
+
+ Add Item
|
|
964
|
+
</button>
|
|
965
|
+
|
|
966
|
+
<div class="scenario-editor-actions">
|
|
967
|
+
<button class="scenario-btn" @click=${this._cancelEditScenario}>Cancel</button>
|
|
968
|
+
<button class="scenario-btn scenario-btn--primary" @click=${this._saveEditingScenario}>Save Scenario</button>
|
|
969
|
+
</div>
|
|
970
|
+
</div>
|
|
839
971
|
`}render(){if(!this.cart)return U`<div class="empty-state">Loading cart...</div>`;const t=this.diff&&(this.diff.items.added.length>0||this.diff.items.removed.length>0||this.diff.items.modified.length>0);return U`
|
|
840
972
|
<div class="toolbar">
|
|
841
973
|
<div class="stats">
|
|
@@ -845,6 +977,13 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
845
977
|
${this._renderInlineDiscounts()}
|
|
846
978
|
</div>
|
|
847
979
|
<div class="actions">
|
|
980
|
+
<button
|
|
981
|
+
class="history-toggle ${this.showScenarios?"active":""}"
|
|
982
|
+
@click=${this._toggleScenarios}
|
|
983
|
+
title="Cart scenarios"
|
|
984
|
+
>
|
|
985
|
+
Scenarios ${this.scenarios.length>0?`(${this.scenarios.length})`:""}
|
|
986
|
+
</button>
|
|
848
987
|
<button
|
|
849
988
|
class="history-toggle ${this.showHistory?"active":""}"
|
|
850
989
|
@click=${this._toggleHistory}
|
|
@@ -866,6 +1005,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
866
1005
|
${this._renderQuickAddRow()}
|
|
867
1006
|
${this._renderMetaRow()}
|
|
868
1007
|
${this._renderMetaPanel()}
|
|
1008
|
+
${this._renderScenarioPanel()}
|
|
869
1009
|
${this._renderHistoryPanel()}
|
|
870
1010
|
|
|
871
1011
|
${this._toastMessage?U`<div class="copied-toast">${this._toastMessage}</div>`:""}
|
|
@@ -951,7 +1091,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
951
1091
|
</tbody>
|
|
952
1092
|
</table>
|
|
953
1093
|
`}
|
|
954
|
-
`}}__publicField(St,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0},showHistory:{type:Boolean,state:!0},cartHistory:{type:Array,state:!0},showAddProduct:{type:Boolean,state:!0},showAttributes:{type:Boolean,state:!0},showDiscountInput:{type:Boolean,state:!0},expandedItems:{type:Set,state:!0},variantIdInput:{type:String,state:!0},quantityInput:{type:Number,state:!0},discountInput:{type:String,state:!0},editingNote:{type:Boolean,state:!0},noteInput:{type:String,state:!0},editingAttributes:{type:Boolean,state:!0},attributesInput:{type:Object,state:!0}}),__publicField(St,"styles",[pt,n`
|
|
1094
|
+
`}};__publicField(St,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0},showHistory:{type:Boolean,state:!0},cartHistory:{type:Array,state:!0},showAddProduct:{type:Boolean,state:!0},showAttributes:{type:Boolean,state:!0},showDiscountInput:{type:Boolean,state:!0},expandedItems:{type:Set,state:!0},variantIdInput:{type:String,state:!0},quantityInput:{type:Number,state:!0},discountInput:{type:String,state:!0},editingNote:{type:Boolean,state:!0},noteInput:{type:String,state:!0},editingAttributes:{type:Boolean,state:!0},attributesInput:{type:Object,state:!0},showScenarios:{type:Boolean,state:!0},scenarios:{type:Array,state:!0},editingScenario:{type:Object,state:!0},scenarioNameInput:{type:String,state:!0}}),__publicField(St,"SCENARIOS_STORAGE_KEY","tdt_cart_scenarios"),__publicField(St,"styles",[pt,n`
|
|
955
1095
|
:host {
|
|
956
1096
|
display: block;
|
|
957
1097
|
padding: 8px 12px;
|
|
@@ -1584,7 +1724,236 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
1584
1724
|
font-size: calc(10px * var(--tdt-scale, 1));
|
|
1585
1725
|
margin-left: 8px;
|
|
1586
1726
|
}
|
|
1587
|
-
|
|
1727
|
+
|
|
1728
|
+
/* Scenario Builder Styles */
|
|
1729
|
+
.scenario-panel {
|
|
1730
|
+
background: var(--tdt-bg-secondary);
|
|
1731
|
+
border: 1px solid var(--tdt-border);
|
|
1732
|
+
border-radius: var(--tdt-radius);
|
|
1733
|
+
margin-bottom: 12px;
|
|
1734
|
+
overflow: hidden;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
.scenario-header {
|
|
1738
|
+
display: flex;
|
|
1739
|
+
align-items: center;
|
|
1740
|
+
justify-content: space-between;
|
|
1741
|
+
padding: 8px 12px;
|
|
1742
|
+
background: var(--tdt-bg);
|
|
1743
|
+
border-bottom: 1px solid var(--tdt-border);
|
|
1744
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
1745
|
+
font-weight: 600;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
.scenario-header-actions {
|
|
1749
|
+
display: flex;
|
|
1750
|
+
gap: 6px;
|
|
1751
|
+
align-items: center;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.scenario-list {
|
|
1755
|
+
max-height: 300px;
|
|
1756
|
+
overflow-y: auto;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
.scenario-item {
|
|
1760
|
+
display: flex;
|
|
1761
|
+
align-items: center;
|
|
1762
|
+
justify-content: space-between;
|
|
1763
|
+
padding: 10px 12px;
|
|
1764
|
+
border-bottom: 1px solid var(--tdt-border);
|
|
1765
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
.scenario-item:last-child {
|
|
1769
|
+
border-bottom: none;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
.scenario-item:hover {
|
|
1773
|
+
background: var(--tdt-bg-hover);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.scenario-info {
|
|
1777
|
+
flex: 1;
|
|
1778
|
+
min-width: 0;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
.scenario-name {
|
|
1782
|
+
font-weight: 600;
|
|
1783
|
+
color: var(--tdt-text);
|
|
1784
|
+
margin-bottom: 2px;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.scenario-meta {
|
|
1788
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
1789
|
+
color: var(--tdt-text-muted);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
.scenario-actions {
|
|
1793
|
+
display: flex;
|
|
1794
|
+
gap: 4px;
|
|
1795
|
+
flex-shrink: 0;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.scenario-btn {
|
|
1799
|
+
padding: 4px 8px;
|
|
1800
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
1801
|
+
background: var(--tdt-bg-secondary);
|
|
1802
|
+
border: 1px solid var(--tdt-border);
|
|
1803
|
+
border-radius: var(--tdt-radius);
|
|
1804
|
+
color: var(--tdt-text-muted);
|
|
1805
|
+
cursor: pointer;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
.scenario-btn:hover {
|
|
1809
|
+
background: var(--tdt-bg-hover);
|
|
1810
|
+
color: var(--tdt-text);
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
.scenario-btn--primary {
|
|
1814
|
+
background: var(--tdt-accent);
|
|
1815
|
+
border-color: var(--tdt-accent);
|
|
1816
|
+
color: white;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.scenario-btn--primary:hover {
|
|
1820
|
+
opacity: 0.9;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.scenario-btn--danger {
|
|
1824
|
+
color: var(--tdt-danger);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
.scenario-btn--danger:hover {
|
|
1828
|
+
background: var(--tdt-danger);
|
|
1829
|
+
border-color: var(--tdt-danger);
|
|
1830
|
+
color: white;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
.scenario-empty {
|
|
1834
|
+
padding: 20px;
|
|
1835
|
+
text-align: center;
|
|
1836
|
+
color: var(--tdt-text-muted);
|
|
1837
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/* Scenario Editor */
|
|
1841
|
+
.scenario-editor {
|
|
1842
|
+
padding: 12px;
|
|
1843
|
+
background: var(--tdt-bg);
|
|
1844
|
+
border-top: 1px solid var(--tdt-border);
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
.scenario-editor-header {
|
|
1848
|
+
display: flex;
|
|
1849
|
+
align-items: center;
|
|
1850
|
+
gap: 8px;
|
|
1851
|
+
margin-bottom: 12px;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
.scenario-editor-header input {
|
|
1855
|
+
flex: 1;
|
|
1856
|
+
padding: 6px 10px;
|
|
1857
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
1858
|
+
border: 1px solid var(--tdt-border);
|
|
1859
|
+
border-radius: var(--tdt-radius);
|
|
1860
|
+
background: var(--tdt-bg-secondary);
|
|
1861
|
+
color: var(--tdt-text);
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
.scenario-items-list {
|
|
1865
|
+
display: flex;
|
|
1866
|
+
flex-direction: column;
|
|
1867
|
+
gap: 8px;
|
|
1868
|
+
margin-bottom: 12px;
|
|
1869
|
+
max-height: 200px;
|
|
1870
|
+
overflow-y: auto;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
.scenario-item-row {
|
|
1874
|
+
display: flex;
|
|
1875
|
+
align-items: flex-start;
|
|
1876
|
+
gap: 8px;
|
|
1877
|
+
padding: 8px;
|
|
1878
|
+
background: var(--tdt-bg-secondary);
|
|
1879
|
+
border-radius: var(--tdt-radius);
|
|
1880
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
.scenario-item-row input {
|
|
1884
|
+
padding: 4px 6px;
|
|
1885
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
1886
|
+
border: 1px solid var(--tdt-border);
|
|
1887
|
+
border-radius: 3px;
|
|
1888
|
+
background: var(--tdt-bg);
|
|
1889
|
+
color: var(--tdt-text);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.scenario-item-row input.variant-input {
|
|
1893
|
+
width: 100px;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
.scenario-item-row input.qty-input {
|
|
1897
|
+
width: 45px;
|
|
1898
|
+
text-align: center;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
.scenario-item-props {
|
|
1902
|
+
flex: 1;
|
|
1903
|
+
min-width: 0;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
.scenario-item-props-row {
|
|
1907
|
+
display: flex;
|
|
1908
|
+
gap: 4px;
|
|
1909
|
+
margin-bottom: 4px;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
.scenario-item-props-row input {
|
|
1913
|
+
flex: 1;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
.scenario-add-prop-btn {
|
|
1917
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
1918
|
+
color: var(--tdt-accent);
|
|
1919
|
+
background: none;
|
|
1920
|
+
border: none;
|
|
1921
|
+
cursor: pointer;
|
|
1922
|
+
padding: 2px 4px;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
.scenario-add-prop-btn:hover {
|
|
1926
|
+
text-decoration: underline;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
.scenario-editor-actions {
|
|
1930
|
+
display: flex;
|
|
1931
|
+
gap: 8px;
|
|
1932
|
+
justify-content: flex-end;
|
|
1933
|
+
padding-top: 8px;
|
|
1934
|
+
border-top: 1px solid var(--tdt-border);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
.scenario-add-item-btn {
|
|
1938
|
+
display: flex;
|
|
1939
|
+
align-items: center;
|
|
1940
|
+
justify-content: center;
|
|
1941
|
+
padding: 8px;
|
|
1942
|
+
background: var(--tdt-bg-secondary);
|
|
1943
|
+
border: 1px dashed var(--tdt-border);
|
|
1944
|
+
border-radius: var(--tdt-radius);
|
|
1945
|
+
color: var(--tdt-text-muted);
|
|
1946
|
+
cursor: pointer;
|
|
1947
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
1948
|
+
margin-bottom: 12px;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
.scenario-add-item-btn:hover {
|
|
1952
|
+
background: var(--tdt-bg-hover);
|
|
1953
|
+
color: var(--tdt-text);
|
|
1954
|
+
border-color: var(--tdt-accent);
|
|
1955
|
+
}
|
|
1956
|
+
`]);let Tt=St;customElements.define("tdt-cart-panel",Tt);class Ct extends ot{constructor(){super(),this.meta={}}_renderSection(t,e){return U`
|
|
1588
1957
|
<div class="section">
|
|
1589
1958
|
<h4 class="section__title">${t}</h4>
|
|
1590
1959
|
<table class="table">
|
|
@@ -1596,9 +1965,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
1596
1965
|
`)}
|
|
1597
1966
|
</table>
|
|
1598
1967
|
</div>
|
|
1599
|
-
`}render(){var t,e,i,s,a,r,n,o,l,c,
|
|
1968
|
+
`}render(){var t,e,i,s,a,r,n,o,l,d,c,p,u,h,g,v,m,b,f,y,x,_,w,k,$,S,T;if(!this.meta)return U`<div class="empty-state">No metadata available</div>`;const C=[{title:"Theme",items:[["ID",null==(t=this.meta.theme)?void 0:t.id],["Name",null==(e=this.meta.theme)?void 0:e.name],["Role",null==(i=this.meta.theme)?void 0:i.role]]},{title:"Template",items:[["Name",null==(s=this.meta.template)?void 0:s.name],["Suffix",(null==(a=this.meta.template)?void 0:a.suffix)||"—"],["Directory",(null==(r=this.meta.template)?void 0:r.directory)||"—"]]},{title:"Request",items:[["Page Type",null==(n=this.meta.request)?void 0:n.page_type],["Path",null==(o=this.meta.request)?void 0:o.path],["Host",null==(l=this.meta.request)?void 0:l.host],["Design Mode",(null==(d=this.meta.request)?void 0:d.design_mode)?"Yes":"No"],["Visual Preview",(null==(c=this.meta.request)?void 0:c.visual_preview_mode)?"Yes":"No"]]},{title:"Localization",items:[["Locale",`${(null==(u=null==(p=this.meta.request)?void 0:p.locale)?void 0:u.name)||""} (${(null==(g=null==(h=this.meta.request)?void 0:h.locale)?void 0:g.iso_code)||""})`],["Country",`${(null==(m=null==(v=this.meta.localization)?void 0:v.country)?void 0:m.name)||""} (${(null==(f=null==(b=this.meta.localization)?void 0:b.country)?void 0:f.iso_code)||""})`],["Currency",`${(null==(_=null==(x=null==(y=this.meta.localization)?void 0:y.country)?void 0:x.currency)?void 0:_.symbol)||""} ${(null==($=null==(k=null==(w=this.meta.localization)?void 0:w.country)?void 0:k.currency)?void 0:$.iso_code)||""}`],["Market",(null==(T=null==(S=this.meta.localization)?void 0:S.market)?void 0:T.handle)||"—"]]}];return U`
|
|
1600
1969
|
${C.map(t=>this._renderSection(t.title,t.items))}
|
|
1601
|
-
`}}__publicField(
|
|
1970
|
+
`}}__publicField(Ct,"properties",{meta:{type:Object}}),__publicField(Ct,"styles",[pt,n`
|
|
1602
1971
|
:host {
|
|
1603
1972
|
display: block;
|
|
1604
1973
|
padding: 12px;
|
|
@@ -1640,7 +2009,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
1640
2009
|
color: var(--tdt-text);
|
|
1641
2010
|
word-break: break-all;
|
|
1642
2011
|
}
|
|
1643
|
-
`]),customElements.define("tdt-info-panel",
|
|
2012
|
+
`]),customElements.define("tdt-info-panel",Ct);class Et extends ot{constructor(){super(),this.metafields=null,this.metafieldsSchema=null,this.searchQuery="",this.expandedPaths=new Set,this.copiedPath=null,this.showEmptyFields=!0,this.activeResource=null}_getMergedData(){var t,e,i;const s={},a=this.metafieldsSchema||{},r=this.metafields||{};for(const[n,o]of Object.entries(a))if(Array.isArray(o)&&0!==o.length){s[n]={schema:o,values:r[n]||{},byNamespace:{}};for(const i of o){const a=i.namespace;s[n].byNamespace[a]||(s[n].byNamespace[a]=[]);const o=null==(e=null==(t=r[n])?void 0:t[a])?void 0:e[i.key];s[n].byNamespace[a].push({...i,hasValue:null!=o,actualValue:null==o?void 0:o.value,actualType:null==o?void 0:o.type})}}for(const[n,o]of Object.entries(r))if(o&&"object"==typeof o){s[n]||(s[n]={schema:[],values:o,byNamespace:{}});for(const[t,e]of Object.entries(o))if(e&&"object"==typeof e){s[n].byNamespace[t]||(s[n].byNamespace[t]=[]);for(const[a,r]of Object.entries(e)){(null==(i=s[n].byNamespace[t])?void 0:i.find(t=>t.key===a))||s[n].byNamespace[t].push({key:a,namespace:t,name:a,description:"",type:{name:(null==r?void 0:r.type)||"unknown",category:"UNKNOWN"},hasValue:!0,actualValue:null==r?void 0:r.value,actualType:null==r?void 0:r.type})}}}return s}_getResourceStats(t){let e=0,i=0;for(const s of Object.values(t.byNamespace))e+=s.length,i+=s.filter(t=>t.hasValue).length;return{total:e,filled:i}}_getTypeClass(t){if(!t)return"unknown";const e=t.toLowerCase().replace(/\./g,"_");return e.startsWith("list_")?"list":e.includes("text")?e.includes("multi")||e.includes("rich")?"multi_line_text_field":"single_line_text_field":e.includes("number")||e.includes("integer")||e.includes("decimal")?"number_integer":e.includes("boolean")?"boolean":e.includes("json")?"json":e.includes("date")?"date":e.includes("url")?"url":e.includes("color")?"color":e.includes("file")?"file_reference":e.includes("product")||e.includes("collection")||e.includes("metaobject")?"product_reference":e.includes("rating")?"rating":e.includes("money")?"money":"unknown"}_toggleNamespace(t){const e=new Set(this.expandedPaths);e.has(t)?e.delete(t):e.add(t),this.expandedPaths=e}async _copyLiquidPath(t,e,i,s){null==s||s.stopPropagation();const a=`{{ ${t}.metafields.${e}.${i} }}`;try{await navigator.clipboard.writeText(a),this.copiedPath=`${t}.${e}.${i}`,setTimeout(()=>{this.copiedPath=null},1500)}catch(r){console.error("Failed to copy:",r)}}async _copyValue(t,e){null==e||e.stopPropagation();const i="object"==typeof t?JSON.stringify(t,null,2):String(t);try{await navigator.clipboard.writeText(i)}catch(s){console.error("Failed to copy value:",s)}}_formatValue(t){if(null==t)return U`<span class="value--null">null</span>`;if("object"==typeof t){const e=JSON.stringify(t,null,2);return U`<span class="value--json">${e}</span>`}return"string"==typeof t?U`<span class="value--string">"${t}"</span>`:"number"==typeof t?U`<span class="value--number">${t}</span>`:"boolean"==typeof t?U`<span class="value--boolean">${t}</span>`:U`<span>${String(t)}</span>`}_deepSearchValue(t,e){if(null==t)return!1;if("object"!=typeof t)return String(t).toLowerCase().includes(e);if(Array.isArray(t))return t.some(t=>this._deepSearchValue(t,e));for(const[i,s]of Object.entries(t)){if(i.toLowerCase().includes(e))return!0;if(this._deepSearchValue(s,e))return!0}return!1}_filterData(t){if(!this.searchQuery.trim())return t;const e=this.searchQuery.toLowerCase(),i={};for(const[s,a]of Object.entries(t)){const t={};for(const[i,s]of Object.entries(a.byNamespace)){const a=s.filter(t=>{var s,a;const r=t.key.toLowerCase().includes(e),n=i.toLowerCase().includes(e),o=null==(s=t.name)?void 0:s.toLowerCase().includes(e),l=null==(a=t.description)?void 0:a.toLowerCase().includes(e),d=void 0!==t.actualValue&&null!==t.actualValue&&this._deepSearchValue(t.actualValue,e);return r||n||o||l||d});a.length>0&&(t[i]=a)}Object.keys(t).length>0&&(i[s]={...a,byNamespace:t})}return i}_renderMetafield(t,e){var i,s;const a=`${t}.${e.namespace}.${e.key}`,r=this.copiedPath===a,n=(null==(i=e.type)?void 0:i.name)||e.actualType||"unknown";return this.showEmptyFields||e.hasValue?U`
|
|
1644
2013
|
<div class="metafield ${e.hasValue?"":"metafield--empty"}">
|
|
1645
2014
|
<div class="metafield__header">
|
|
1646
2015
|
<span
|
|
@@ -1739,7 +2108,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
1739
2108
|
</div>
|
|
1740
2109
|
|
|
1741
2110
|
${r?Object.entries(a.byNamespace).map(([t,e])=>this._renderNamespace(this.activeResource,t,e)):U`<div class="no-results">No metafields match "${this.searchQuery}"</div>`}
|
|
1742
|
-
`}}__publicField(
|
|
2111
|
+
`}}__publicField(Et,"properties",{metafields:{type:Object},metafieldsSchema:{type:Object},searchQuery:{type:String,state:!0},expandedPaths:{type:Object,state:!0},copiedPath:{type:String,state:!0},showEmptyFields:{type:Boolean,state:!0},activeResource:{type:String,state:!0}}),__publicField(Et,"styles",[pt,n`
|
|
1743
2112
|
:host {
|
|
1744
2113
|
display: block;
|
|
1745
2114
|
padding: 8px 12px;
|
|
@@ -2113,7 +2482,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
2113
2482
|
margin-bottom: 4px;
|
|
2114
2483
|
color: var(--tdt-accent);
|
|
2115
2484
|
}
|
|
2116
|
-
`]),customElements.define("tdt-metafields-panel",
|
|
2485
|
+
`]),customElements.define("tdt-metafields-panel",Et);class At extends ot{constructor(){super(),this.cookies=[],this.filter="",this.editingCookie=null,this.newCookie=null}connectedCallback(){super.connectedCallback(),this._loadCookies()}_loadCookies(){const t=document.cookie;this.cookies=t?t.split(";").map(t=>{const[e,...i]=t.trim().split("="),s=i.join("=");return{name:e.trim(),value:decodeURIComponent(s||""),rawValue:s}}).filter(t=>t.name):[]}_filterCookies(t){this.filter=t.target.value}_getFilteredCookies(){if(!this.filter)return this.cookies;const t=this.filter.toLowerCase();return this.cookies.filter(e=>e.name.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_copyValue(t){navigator.clipboard.writeText(t.value)}_copyName(t){navigator.clipboard.writeText(t.name)}_deleteCookie(t){document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`,this._loadCookies()}_openAddModal(){this.newCookie={name:"",value:"",path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_openEditModal(t){this.editingCookie={originalName:t.name,name:t.name,value:t.value,path:"/",days:7,secure:"https:"===window.location.protocol,sameSite:"Lax"}}_closeModal(){this.newCookie=null,this.editingCookie=null}_saveCookie(){const t=this.newCookie||this.editingCookie;if(!t||!t.name)return;this.editingCookie&&this.editingCookie.originalName!==t.name&&this._deleteCookie({name:this.editingCookie.originalName});const e=new Date;e.setTime(e.getTime()+24*t.days*60*60*1e3);let i=`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`;i+=`; expires=${e.toUTCString()}`,i+=`; path=${t.path}`,t.secure&&(i+="; secure"),i+=`; samesite=${t.sameSite}`,document.cookie=i,this._loadCookies(),this._closeModal()}_updateCookieField(t,e){this.newCookie?this.newCookie={...this.newCookie,[t]:e}:this.editingCookie&&(this.editingCookie={...this.editingCookie,[t]:e})}_formatSize(t){const e=new Blob([t]).size;return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}_clearAllCookies(){0!==this.cookies.length&&confirm(`Clear all ${this.cookies.length} cookies? This may log you out.`)&&(this.cookies.forEach(t=>{document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${t.name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`}),this._loadCookies())}_renderModal(){const t=this.newCookie||this.editingCookie;if(!t)return null;const e=!!this.editingCookie;return U`
|
|
2117
2486
|
<div class="modal-overlay" @click=${this._closeModal}>
|
|
2118
2487
|
<div class="modal" @click=${t=>t.stopPropagation()}>
|
|
2119
2488
|
<div class="modal-title">${e?"Edit Cookie":"Add Cookie"}</div>
|
|
@@ -2243,7 +2612,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
2243
2612
|
`}
|
|
2244
2613
|
|
|
2245
2614
|
${this._renderModal()}
|
|
2246
|
-
`}}__publicField(
|
|
2615
|
+
`}}__publicField(At,"properties",{cookies:{type:Array,state:!0},filter:{type:String,state:!0},editingCookie:{type:Object,state:!0},newCookie:{type:Object,state:!0}}),__publicField(At,"styles",[pt,n`
|
|
2247
2616
|
:host {
|
|
2248
2617
|
display: block;
|
|
2249
2618
|
padding: 12px;
|
|
@@ -2518,7 +2887,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
2518
2887
|
font-weight: 600;
|
|
2519
2888
|
color: var(--tdt-text);
|
|
2520
2889
|
}
|
|
2521
|
-
`]),customElements.define("tdt-cookies-panel",
|
|
2890
|
+
`]),customElements.define("tdt-cookies-panel",At);class Ot extends ot{constructor(){super(),__publicField(this,"_handleStorageChange",()=>{this._loadItems()}),this.activeStorage="local",this.items=[],this.filter="",this.editingItem=null,this.newItem=null,this.expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._loadItems(),window.addEventListener("storage",this._handleStorageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("storage",this._handleStorageChange)}_getStorage(){return"local"===this.activeStorage?localStorage:sessionStorage}_loadItems(){const t=this._getStorage(),e=[];for(let i=0;i<t.length;i++){const s=t.key(i),a=t.getItem(s);let r=a,n=!1;try{r=JSON.parse(a),n="object"==typeof r&&null!==r}catch{n=!1}e.push({key:s,value:a,parsedValue:n?r:a,isJson:n,size:new Blob([a]).size})}e.sort((t,e)=>t.key.localeCompare(e.key)),this.items=e}_switchStorage(t){this.activeStorage=t,this.expandedItems=new Set,this._loadItems()}_filterItems(t){this.filter=t.target.value}_getFilteredItems(){if(!this.filter)return this.items;const t=this.filter.toLowerCase();return this.items.filter(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}_toggleExpand(t,e){e.stopPropagation();const i=new Set(this.expandedItems);i.has(t)?i.delete(t):i.add(t),this.expandedItems=i}_copyKey(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.key)}_copyValue(t,e){e.stopPropagation(),navigator.clipboard.writeText(t.value)}_deleteItem(t,e){e.stopPropagation(),this._getStorage().removeItem(t.key),this._loadItems()}_clearAll(){confirm(`Clear all ${"local"===this.activeStorage?"localStorage":"sessionStorage"} items?`)&&(this._getStorage().clear(),this._loadItems())}_openAddModal(){this.newItem={key:"",value:""}}_openEditModal(t,e){e.stopPropagation(),this.editingItem={originalKey:t.key,key:t.key,value:t.value}}_closeModal(){this.newItem=null,this.editingItem=null}_saveItem(){const t=this.newItem||this.editingItem;if(!t||!t.key)return;const e=this._getStorage();this.editingItem&&this.editingItem.originalKey!==t.key&&e.removeItem(this.editingItem.originalKey),e.setItem(t.key,t.value),this._loadItems(),this._closeModal()}_updateItemField(t,e){this.newItem?this.newItem={...this.newItem,[t]:e}:this.editingItem&&(this.editingItem={...this.editingItem,[t]:e})}_formatSize(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}_getTotalSize(){return this.items.reduce((t,e)=>t+e.size+e.key.length,0)}_renderModal(){const t=this.newItem||this.editingItem;if(!t)return null;const e=!!this.editingItem;return U`
|
|
2522
2891
|
<div class="modal-overlay" @click=${this._closeModal}>
|
|
2523
2892
|
<div class="modal" @click=${t=>t.stopPropagation()}>
|
|
2524
2893
|
<div class="modal-title">${e?"Edit Item":"Add Item"}</div>
|
|
@@ -2636,7 +3005,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
2636
3005
|
`}
|
|
2637
3006
|
|
|
2638
3007
|
${this._renderModal()}
|
|
2639
|
-
`}}__publicField(
|
|
3008
|
+
`}}__publicField(Ot,"properties",{activeStorage:{type:String,state:!0},items:{type:Array,state:!0},filter:{type:String,state:!0},editingItem:{type:Object,state:!0},newItem:{type:Object,state:!0},expandedItems:{type:Set,state:!0}}),__publicField(Ot,"styles",[pt,n`
|
|
2640
3009
|
:host {
|
|
2641
3010
|
display: block;
|
|
2642
3011
|
padding: 12px;
|
|
@@ -2963,122 +3332,22 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
2963
3332
|
font-weight: 600;
|
|
2964
3333
|
color: var(--tdt-text);
|
|
2965
3334
|
}
|
|
2966
|
-
`]),customElements.define("tdt-storage-panel",At);class Ot{constructor(t,e,i,s,a){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=a}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class Lt{liquidMethodMissing(t,e){}}const zt=Object.prototype.toString,jt=String.prototype.toLowerCase,Pt=Object.hasOwnProperty;function Ft(t){return"string"==typeof t}function It(t){return"function"==typeof t}function Rt(t){return t&&It(t.then)}function Nt(t){return t&&It(t.next)&&It(t.throw)&&It(t.return)}function Dt(t){return Ft(t=Ht(t))?t:Gt(t)?"":Kt(t)?t.map(t=>Dt(t)).join(""):String(t)}function qt(t){return Kt(t=Ht(t))?t:Ft(t)&&t.length>0?[t]:Xt(e=t)&&Symbol.iterator in e?Array.from(t):Xt(t)?Object.keys(t).map(e=>[e,t[e]]):[];var e}function Mt(t){return Gt(t=Ht(t))?[]:Kt(t)?t:[t]}function Ht(t){return t instanceof Lt&&It(t.valueOf)?t.valueOf():t}function Ut(t){return+Ht(t)||0}function Vt(t){return"number"==typeof t}function Bt(t){return t&&It(t.toLiquid)?Bt(t.toLiquid()):t}function Gt(t){return null==t}function Jt(t){return void 0===t}function Kt(t){return"[object Array]"===zt.call(t)}function Wt(t){return t&&Vt(t.length)}function Yt(t,e){t=t||{};for(const i in t)if(Pt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Qt(t){return t[t.length-1]}function Xt(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Zt(t,e,i=1){const s=[];for(let a=t;a<e;a+=i)s.push(a);return s}function te(t,e,i=" "){return ee(t,e,i,(t,e)=>e+t)}function ee(t,e,i,s){let a=e-(t=String(t)).length;for(;a-- >0;)t=s(t,i);return t}function ie(t){return t}function se(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=jt.call(t))<(e=jt.call(e))?-1:t>e?1:0}function ae(t){return function(...e){return t.call(this,...e.map(Ht))}}function re(t){return function(...e){return t.call(this,...e.map(Ut))}}function ne(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*oe(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const le="__liquidClass__";class ce extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,le,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:fe(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[le])}}class de extends ce{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class pe extends ce{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class he extends ce{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class ue extends ce{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class ge extends ce{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class ve extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class me extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function fe(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),a=Math.max(e-2,1),r=Math.min(e+3,s.length);return Zt(a,r+1).map(t=>{let a=`${t===e?">> ":" "}${te(String(t),String(r).length)}| `;const n=t===e?"\n"+te("^",i+a.length):"";return a+=s[t-1],a+=n,a}).join("\n")}const be=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function ye(t){const e=t.charCodeAt(0);return e>=128?!be[e]:!!(1&be[e])}function xe(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new me(i)}}function _e(t,e=`unexpected ${JSON.stringify(t)}`){xe(!t,e)}be[160]=be[5760]=be[6158]=be[8192]=be[8193]=be[8194]=be[8195]=be[8196]=be[8197]=be[8198]=be[8199]=be[8200]=be[8201]=be[8202]=be[8232]=be[8233]=be[8239]=be[8287]=be[12288]=4,be[8220]=be[8221]=128;class we extends Lt{equals(t){return!(t instanceof we)&&(Ft(t=Ht(t))||Kt(t)?0===t.length:!!Xt(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof we}}class ke extends we{equals(t){return!1===t||(!!Gt(Ht(t))||(Ft(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof ke}}class $e extends Lt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class Se{constructor(){this.buffer=""}write(t){this.buffer+=Dt(t)}}class Te{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Ce{constructor(){this.buffer=""}write(t){"string"!=typeof(t=Ht(t))&&""===this.buffer?this.buffer=t:this.buffer=Dt(this.buffer)+Dt(t)}}class Ee extends Lt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Se;return yield this.superBlockRender(t),t.buffer}}function Ae(t){return t&&It(t.equals)&&It(t.gt)&&It(t.geq)&&It(t.lt)&&It(t.leq)}const Oe=new class extends Lt{equals(t){return Gt(Ht(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},Le={true:!0,false:!1,nil:Oe,null:Oe,empty:new we,blank:new ke};function ze(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&ye(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var je=function(){return je=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},je.apply(this,arguments)};function Pe(t,e,i,s){return new(i||(i=Promise))(function(e,a){function r(t){try{o(s.next(t))}catch(e){a(e)}}function n(t){try{o(s.throw(t))}catch(e){a(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof i?s:new i(function(t){t(s)})).then(r,n)}o((s=s.apply(t,[])).next())})}function Fe(t){return Pe(this,0,void 0,function*(){if(!Nt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);i=r.done,e=r.value,s="next";try{Nt(e)&&(e=Fe(e)),Rt(e)&&(e=yield e)}catch(a){s="throw",e=a}}while(!i);return e})}function Ie(t){if(!Nt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);if(i=r.done,e=r.value,s="next",Nt(e))try{e=Ie(e)}catch(a){s="throw",e=a}}while(!i);return e}const Re=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function Ne(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function De(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=Ne(t)[i];return e+t.getDate()}function qe(t,e){const i=De(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const Me={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},He=new Set("aAbBceklpP");function Ue(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),a=i%60;return(t.getTimezoneOffset()>0?"-":"+")+te(s,2,"0")+(e.flags[":"]?":":"")+te(a,2,"0")}const Ve={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>De(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return ee(t,e,i,(t,e)=>t+e)}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>qe(t,0),w:t=>t.getDay(),W:t=>qe(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:Ue,Z:(t,e)=>t.getTimeZoneName()||Ue(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function Be(t,e){let i,s="",a=e;for(;i=Re.exec(a);)s+=a.slice(0,i.index),a=a.slice(i.index+i[0].length),s+=Ge(t,i);return s+a}function Ge(t,e){const[i,s="",a,r,n]=e,o=Ve[n];if(!o)return i;const l={};for(const u of s)l[u]=!0;let c=String(o(t,{flags:l,width:a,modifier:r})),d=He.has(n)?" ":"0",p=a||Me[n]||0;var h;return l["^"]?c=c.toUpperCase():l["#"]&&(h=c,c=[...h].some(t=>t>="a"&&t<="z")?h.toUpperCase():h.toLowerCase()),l._?d=" ":l[0]&&(d="0"),l["-"]&&(p=0),te(c,p,d)}function Je(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}Ve.h=Ve.b;const Ke=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ye=We.map(t=>t.slice(0,3)),Qe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Xe=Qe.map(t=>t.slice(0,3));class Ze{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Je(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=Ft(i)?Ze.getTimezoneOffset(i,this.date):i,this.timezoneName=Ft(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),a=this.date.getTime()+s;this.displayDate=new Date(a)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:We[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Ye[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:Qe[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Xe[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(Ke);if(i&&"Z"===i[1])return new Ze(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,a,r]=i,n=("+"===s?-1:1)*(60*parseInt(a,10)+parseInt(r,10));return new Ze(+new Date(t),e,n)}return new Ze(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),a=new Date(i);return(+new Date(s)-+a)/6e4}}class ti{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=+t||0,xe(this.base+t<=this.limit,this.message),this.base+=t}check(t){xe((t=+t||0)<=this.limit,this.message)}}class ei extends Ot{constructor(t,[e,i],s,a,r,n,o,l){super(t,s,a,r,l),this.trimLeft=!1,this.trimRight=!1;const c="-"===s[e],d="-"===s[i-1];let p=c?e+1:e,h=d?i-1:i;for(;p<h&&4&be[s.charCodeAt(p)];)p++;for(;h>p&&4&be[s.charCodeAt(h-1)];)h--;this.contentRange=[p,h],this.trimLeft=c||n,this.trimRight=d||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class ii extends ei{constructor(t,e,i,s,a){const{trimTagLeft:r,trimTagRight:n,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[c,d]=[e+o.length,i-l.length];super(ys.Tag,[c,d],t,e,i,r,n,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class si extends ei{constructor(t,e,i,s,a){const{trimOutputLeft:r,trimOutputRight:n,outputDelimiterLeft:o,outputDelimiterRight:l}=s,c=[e+o.length,i-l.length];super(ys.Output,c,t,e,i,r,n,a)}}class ai extends Ot{constructor(t,e,i,s){super(ys.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class ri extends Ot{constructor(t,e,i,s){super(ys.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class ni extends Ot{constructor(t,e,i,s){super(ys.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class oi extends Ot{constructor(t,e,i,s){super(ys.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=Le[this.literal]}}const li={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},ci={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class di extends Ot{constructor(t,e,i,s){super(ys.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in li?li[t]:1}}class pi extends Ot{constructor(t,e,i,s,a,r){super(ys.PropertyAccess,i,s,a,r),this.variable=t,this.props=e}}class hi extends Ot{constructor(t,e,i,s,a,r){super(ys.Filter,i,s,a,r),this.name=t,this.args=e}}class ui extends Ot{constructor(t,e,i,s,a,r){super(ys.Hash,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=a,this.file=r}}const gi=/[\da-fA-F]/,vi=/[0-7]/,mi={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function fi(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class bi extends Ot{constructor(t,e,i,s){super(ys.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==mi[t[i+1]])e+=mi[t[++i]];else if("u"===t[i+1]){let s=0,a=i+2;for(;a<=i+5&&gi.test(t[a]);)s=16*s+fi(t[a++]);i=a-1,e+=String.fromCharCode(s)}else if(vi.test(t[i+1])){let s=i+1,a=0;for(;s<=i+3&&vi.test(t[s]);)a=8*a+fi(t[s++]);i=s-1,e+=String.fromCharCode(a)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class yi extends Ot{constructor(t,e,i,s,a,r){super(ys.Range,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=a,this.file=r}}class xi extends ei{constructor(t,e,i,s,a){super(ys.Tag,[e,i],t,e,i,!1,!1,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class _i extends Ot{constructor(t,e,i,s,a,r){super(ys.FilteredValue,i,s,a,r),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=a,this.file=r}}const wi={now:()=>Date.now()};function ki(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||wi}class $i{renderTemplatesToNodeStream(t,e){const i=new Te;return Promise.resolve().then(()=>Fe(this.renderTemplates(t,e,i))).then(()=>i.end(),t=>i.error(t)),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new Ce:new Se);const s=[];for(const r of t){e.renderLimit.check(ki().now());try{const t=yield r.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(a){const t=ce.is(a)?a:new he(a,r);if(!e.opts.catchAllErrors)throw t;s.push(t)}}if(s.length)throw new ue(s);return i.buffer}}class Si{constructor(t){this.postfix=[...Ci(t)]}*evaluate(t,e){xe(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Ts(s)){const e=i.pop();let a;if(1===ci[s.operator])a=yield t.opts.operators[s.operator](e,t);else{const r=i.pop();a=yield t.opts.operators[s.operator](r,e,t)}i.push(a)}else i.push(yield Ti(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*Ti(t,e,i=!1){if(t)return"content"in t?t.content:Ls(t)?yield function*(t,e,i){const s=[];for(const r of t.props)s.push(yield Ti(r,e,!1));try{if(t.variable){const a=yield Ti(t.variable,e,i);return yield e._getFromScope(a,s)}return yield e._get(s)}catch(a){if(i&&"InternalUndefinedVariableError"===a.name)return null;throw new ge(a,t)}}(t,e,i):js(t)?yield function*(t,e){const i=yield Ti(t.lhs,e),s=yield Ti(t.rhs,e);return e.memoryLimit.use(s-i+1),Zt(+i,+s+1)}(t,e):void 0}function*Ci(t){const e=[];for(const i of t)if(Ts(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function Ei(t,e){return!Ai(t,e)}function Ai(t,e){return t=Ht(t),e.opts.jsTruthy?!t:!1===t||null==t}const Oi={"==":Li,"!=":(t,e)=>!Li(t,e),">":(t,e)=>Ae(t)?t.gt(e):Ae(e)?e.lt(t):Ht(t)>Ht(e),"<":(t,e)=>Ae(t)?t.lt(e):Ae(e)?e.gt(t):Ht(t)<Ht(e),">=":(t,e)=>Ae(t)?t.geq(e):Ae(e)?e.leq(t):Ht(t)>=Ht(e),"<=":(t,e)=>Ae(t)?t.leq(e):Ae(e)?e.geq(t):Ht(t)<=Ht(e),contains:(t,e)=>Kt(t=Ht(t))?t.some(t=>Li(t,e)):!!It(null==t?void 0:t.indexOf)&&t.indexOf(Ht(e))>-1,not:(t,e)=>Ai(Ht(t),e),and:(t,e,i)=>Ei(Ht(t),i)&&Ei(Ht(e),i),or:(t,e,i)=>Ei(Ht(t),i)||Ei(Ht(e),i)};function Li(t,e){return Ae(t)?t.equals(e):Ae(e)?e.equals(t):(t=Ht(t),e=Ht(e),Kt(t)?Kt(e)&&function(t,e){return t.length===e.length&&!t.some((t,i)=>!Li(t,e[i]))}(t,e):t===e)}class zi{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}}class ji{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new zi("HEAD",null,null,null),this.tail=new zi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new zi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function Pi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const a=document.createElement("a");a.href=e;const r=a.href;return s.removeChild(i),r}var Fi=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Qt(t)&&(t+="/"),Pi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(t,e,s)=>{const a=s.split("/").pop();return/\.\w+$/.test(a)?t:e+s+i})},readFile:function(t){return Pe(this,0,void 0,function*(){return new Promise((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()})})},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return Pe(this,0,void 0,function*(){return!0})},existsSync:function(t){return!0},dirname:function(t){return Pi(t,".")},sep:"/"});function Ii(t,e=0){return JSON.stringify(t,null,e)}var Ri={default:function(t,e,...i){return Kt(t=Ht(t))||Ft(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(Ai(t,this.context)?e:t)},raw:{raw:!0,handler:ie},jsonify:Ii,to_integer:function(t){return Number(t)},json:Ii,inspect:function(t,e=0){const i=[];return JSON.stringify(t,function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)},e)}};const Ni={"&":"&","<":"<",">":">",'"':""","'":"'"},Di={"&":"&","<":"<",">":">",""":'"',"'":"'"};function qi(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,t=>Ni[t])}function Mi(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,t=>Di[t])}var Hi=Object.freeze({__proto__:null,escape:qi,xml_escape:function(t){return qi.call(this,t)},escape_once:function(t){return qi.call(this,Mi.call(this,t))},newline_to_br:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class Ui{constructor(t){this.mapping=t,this.sep="/"}exists(t){return Pe(this,0,void 0,function*(){return this.existsSync(t)})}existsSync(t){return!Gt(this.mapping[t])}readFile(t){return Pe(this,0,void 0,function*(){return this.readFileSync(t)})}readFileSync(t){const e=this.mapping[t];if(Gt(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const a of e.split(this.sep))"."!==a&&""!==a&&(".."===a?(s.length>1||""!==s[0])&&s.pop():s.push(a));return s.join(this.sep)}}const Vi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:Fi,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:Oi,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function Bi(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new ji(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new ji(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},Vi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=Gi(t.root),t.partials=Gi(t.partials),t.layouts=Gi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?qi:"json"===s?Ri.json:(xe(It(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Je())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new Ui(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function Gi(t){let e=[];return Kt(t)&&(e=t),Ft(t)&&(e=[t]),e}function Ji(t,e){if(!t||!Cs(t))return;const i=e?4:16;for(;be[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function Ki(t,e){if(!t||!Cs(t))return;const i=e?4:16;for(;be[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Wi{constructor(t,e=Vi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=ze(e),this.literalTrie=ze(Le)}readExpression(){return new Si(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new di(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&ye(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new _i(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),()=>`unexpected character ${this.snapshot()}`)}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new hi(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const a=t[s];Ss(a)&&(!i&&a.trimLeft&&Ji(t[s-1],e.greedy),Es(a)&&("raw"===a.name?i=!0:"endraw"===a.name&&(i=!1)),!i&&a.trimRight&&Ki(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some(t=>this.match(t));)++this.p;return new ai(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const a=new ii(i,s,this.p,t,e);return"raw"===a.name&&(this.rawBeginAt=s),a}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=Vi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,a=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(a)} not closed`,a);return new si(i,a,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let a=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===a?(this.rawBeginAt=-1,new ii(this.input,s,e,t,this.file)):(this.p=a,new ai(this.input,s,a,this.file))}if(this.rmatch(e))break;this.p++}else a=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new xi(this.input,e,i,t,this.file)}error(t,e=this.p){return new de(t,new ni(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify((e=this.input.slice(t,this.N),i=32,e.length>i?e.slice(0,i-3)+"...":e));var e,i}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&ye(this.peek());)++this.p;return new ni(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const a=Ft(t)?t:t?"=":":";return this.peek()===a&&(++this.p,s=this.readValue()),new ui(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new pi(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new pi(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;){if("["===this.peek()){this.p++;const t=this.readValue()||new ni(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t);continue}if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."===this.peek()&&"."!==this.peek(1)){this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t);continue}break}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!ye(this.peek(i))){const t=new ri(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new oi(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new yi(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new bi(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:be[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Yi{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(Es(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class Qi{constructor(t){this.token=t}}class Xi extends Qi{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class Zi{constructor(t,e){this.hash={};const i=t instanceof Wi?t:new Wi(t,{});for(const s of i.readHashes(e))this.hash[s.name.content]=s.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield Ti(this.hash[i],t));return e}}function ts(t){return Kt(t)}class es{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=It(e)?e:It(null==e?void 0:e.handler)?e.handler:ie,this.raw=!It(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const s of this.args)ts(s)?i.push([s[0],yield Ti(s[1],e)]):i.push(yield Ti(s,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class is{constructor(t,e){this.filters=[];const i="string"==typeof t?new Wi(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map(t=>new es(t,this.getFilter(e,t.name),e))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const s of this.filters)i=yield s.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return xe(i||!t.options.strictFilters,()=>`undefined filter: ${e}`),i}}class ss extends Qi{constructor(t,e){var i;super(t);const s=new Wi(t.input,e.options.operators,t.file,t.contentRange);this.value=new is(s.readFilteredValue(),e);const a=this.value.filters,r=e.options.outputEscape;if(!(null===(i=a[a.length-1])||void 0===i?void 0:i.raw)&&r){const t=new hi(toString.call(r),[],"",0,0);a.push(new es(t,r,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class as extends Qi{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class rs{constructor(t,e){this.segments=t,this.location=e}toString(){return ms(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof rs?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class ns{constructor(){this.map=new Map}get(t){const e=ms([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(ms([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const os={partials:!0};function*ls(t,e,i){const s=new ns,a=new ns,r=new ns,n=new ps(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];Ft(t)&&!n.has(t)&&a.push(i)}else{const i=t.segments[0];Ft(i)&&!e.has(i)&&a.push(t)}for(const s of t.segments)s instanceof rs&&l(s,e)}function*c(t,s){if(t.arguments)for(const e of t.arguments())for(const t of hs(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();r.push(new rs([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const a=t.partialScope();if(void 0===a){for(const a of yield t.children(e,i))yield c(a,s);return}if(o.has(a.name))return;const r=new Set,n=a.isolated?new ps(r):s.push(r);for(const t of a.scope)if(Ft(t))r.add(t);else{const[e,i]=t;r.add(e);const s=Array.from(hs(i));s.length&&n.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield c(s,n),o.add(a.name);n.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const a of yield t.children(e,i))yield c(a,s);t.blockScope&&s.pop()}}for(const d of t)yield c(d,n);return{variables:s.asObject(),globals:a.asObject(),locals:r.asObject()}}function cs(t,e={}){return Fe(ls(t,Object.assign(Object.assign({},os),e).partials,!1))}function ds(t,e={}){return Ie(ls(t,Object.assign(Object.assign({},os),e).partials,!0))}class ps{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!Ft(e))return;const i=this.getAlias(e);return void 0!==i?new rs([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*hs(t){Ps(t)?yield*us(t):t instanceof is&&(yield*function*(t){for(const e of t.initial.postfix)Ps(e)&&(yield*us(e));for(const e of t.filters)for(const t of e.args)ts(t)&&t[1]?yield*us(t[1]):Ps(t)&&(yield*us(t))}(t))}function*us(t){js(t)?(yield*us(t.lhs),yield*us(t.rhs)):Ls(t)&&(yield gs(t))}function gs(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,As(s)||Os(s)||zs(s)?e.push(s.content):Ls(s)&&e.push(...gs(s).segments);for(const n of t.props.slice(1))i=i||n.file,As(n)||Os(n)||zs(n)?e.push(n.content):Ls(n)&&e.push(gs(n));const[a,r]=t.getPosition();return new rs(e,{row:a,col:r,file:i})}const vs=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function ms(t,e=!1){const i=[],s=t[0];Ft(s)&&(!e||s.match(vs)?i.push(`${s}`):i.push(`['${s}']`));for(const a of t.slice(1))a instanceof rs?i.push(`[${ms(a.segments)}]`):Ft(a)?a.match(vs)?i.push(`.${a}`):i.push(`['${a}']`):i.push(`[${a}]`);return i.join("")}var fs,bs,ys,xs,_s,ws;(bs=fs||(fs={})).Partials="partials",bs.Layouts="layouts",bs.Root="root";class ks{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;xe(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map(t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:a}=this.options,r=this.options[e];for(const n of this.candidates(t,r,s,e!==fs.Root))if(i?a.existsSync(n):yield a.exists(n))return n;throw this.lookupError(t,r)}*candidates(t,e,i,s){const{fs:a,extname:r}=this.options;if(this.shouldLoadRelative(t)&&i){const n=a.resolve(this.dirname(i),t,r);for(const t of e)if(!s||this.contains(t,n)){yield n;break}}for(const n of e){const e=a.resolve(n,t,r);s&&!this.contains(n,e)||(yield e)}if(void 0!==a.fallback){const e=a.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return xe(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class $s{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new ks(this.liquid.options),this.parseLimit=new ti("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Wi(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(a){if(!this.liquid.options.catchAllErrors)throw a;s.push(a)}if(s.length)throw new ue(s);return i}parseToken(t,e){try{if(Es(t)){const i=this.liquid.tags[t.name];return xe(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return Fs(t)===ys.Output?new ss(t,this.liquid):new as(t)}catch(i){if(ce.is(i))throw i;throw new pe(i,t)}}parseStream(t){return new Yi(t,(t,e)=>this.parseToken(t,e))}*_parseFileCached(t,e,i=fs.Root,s){const a=this.cache,r=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,n=yield a.read(r);if(n)return n;const o=this._parseFile(t,e,i,s),l=e?yield o:Fe(o);a.write(r,l);try{return yield l}catch(c){throw a.remove(r),c}}*_parseFile(t,e,i=fs.Root,s){const a=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(a):yield this.fs.readFile(a),a)}}function Ss(t){return!!(Fs(t)&ys.Delimited)}function Ts(t){return Fs(t)===ys.Operator}function Cs(t){return Fs(t)===ys.HTML}function Es(t){return Fs(t)===ys.Tag}function As(t){return Fs(t)===ys.Quoted}function Os(t){return Fs(t)===ys.Number}function Ls(t){return Fs(t)===ys.PropertyAccess}function zs(t){return Fs(t)===ys.Word}function js(t){return Fs(t)===ys.Range}function Ps(t){return(1667&Fs(t))>0}function Fs(t){return t?t.kind:-1}(xs=ys||(ys={}))[xs.Number=1]="Number",xs[xs.Literal=2]="Literal",xs[xs.Tag=4]="Tag",xs[xs.Output=8]="Output",xs[xs.HTML=16]="HTML",xs[xs.Filter=32]="Filter",xs[xs.Hash=64]="Hash",xs[xs.PropertyAccess=128]="PropertyAccess",xs[xs.Word=256]="Word",xs[xs.Range=512]="Range",xs[xs.Quoted=1024]="Quoted",xs[xs.Operator=2048]="Operator",xs[xs.FilteredValue=4096]="FilteredValue",xs[xs.Delimited=12]="Delimited";class Is{constructor(t={},e=Vi,i={},{memoryLimit:s,renderLimit:a}={}){var r,n,o,l,c;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(r=i.globals)&&void 0!==r?r:e.globals,this.environments=Xt(t)?t:Object(t),this.strictVariables=null!==(n=i.strictVariables)&&void 0!==n?n:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new ti("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=a?a:new ti("template render",ki().now()+(null!==(c=i.renderLimit)&&void 0!==c?c:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map(t=>[t,this.getRegister(t)])}restoreRegister(t){return t.forEach(([t,e])=>this.setRegister(t,e))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,e)=>je(t,e),{})}get(t){return this.getSync(t)}getSync(t){return Ie(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return Ie(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){Ft(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield this.readProperty(t,e[s]),i&&Jt(t))throw new ve(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new Is(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const i=this.scopes[e];if(t in i)return i}return t in this.environments?this.environments:this.globals}readProperty(t,e){if(t=Bt(t),e=Ht(e),Gt(t))return t;if(Kt(t)&&e<0)return t[t.length+ +e];const i=function(t,e,i){return!i||Pt.call(t,e)||t instanceof Lt?t[e]:void 0}(t,e,this.ownPropertyOnly);return void 0===i&&t instanceof Lt?t.liquidMethodMissing(e,this):It(i)?i.call(t):"size"===e?function(t){if(Pt.call(t,"size")||void 0!==t.size)return t.size;if(Kt(t)||Ft(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return Kt(t)?t[0]:t.first}(t):"last"===e?function(t){return Kt(t)?t[t.length-1]:t.last}(t):i}}(ws=_s||(_s={}))[ws.OUTPUT=0]="OUTPUT",ws[ws.STORE=1]="STORE";const Rs=re(Math.abs),Ns=re(Math.max),Ds=re(Math.min),qs=re(Math.ceil),Ms=re((t,e,i=!1)=>i?Math.floor(t/e):t/e),Hs=re(Math.floor),Us=re((t,e)=>t-e),Vs=re((t,e)=>t+e),Bs=re((t,e)=>t%e),Gs=re((t,e)=>t*e);var Js=Object.freeze({__proto__:null,abs:Rs,at_least:Ns,at_most:Ds,ceil:qs,divided_by:Ms,floor:Hs,minus:Us,plus:Vs,modulo:Bs,times:Gs,round:function(t,e=0){t=Ut(t),e=Ut(e);const i=Math.pow(10,e);return Math.round(t*i)/i}});const Ks=/[^\p{M}\p{L}\p{Nd}]+/gu,Ws={raw:/\s+/g,default:Ks,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:Ks,none:null};var Ys=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(Dt(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(Dt(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(Dt(t)).replace(/%20/g,"+").replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()),uri_escape:t=>encodeURI(Dt(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=Dt(t);const s=Ws[e];return s&&("latin"===e&&(t=function(t){return t.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(t)),t=t.replace(s,"-").replace(/^-|-$/g,"")),i?t:t.toLowerCase()}});const Qs=ae(function(t,e){const i=Mt(t),s=Gt(e)?" ":Dt(e),a=i.length*(1+s.length);return this.context.memoryLimit.use(a),i.join(s)}),Xs=ae(t=>Wt(t)?Qt(t):""),Zs=ae(t=>Wt(t)?t[0]:""),ta=ae(function(t){const e=Mt(t);return this.context.memoryLimit.use(e.length),[...e].reverse()});function ea(t,e=[]){const i=Mt(t),s=Mt(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function ia(t){return this.context.opts.jekyllWhere?e=>{return we.is(t)?Li(e,t):Kt(e)?(i=t,e.some(t=>Li(t,i))):Li(e,t);var i}:void 0===t?t=>Ei(t,this.context):e=>Li(e,t)}function*sa(t,e,i,s){const a=[];e=Mt(e),this.context.memoryLimit.use(e.length);const r=new Wi(Dt(i)).readScopeValue();for(const o of e)a.push(yield Ti(r,this.context.spawn(o)));const n=ia.call(this,s);return e.filter((e,i)=>n(a[i])===t)}function*aa(t,e,i,s){const a=[],r=new is(Dt(s),this.liquid),n=Mt(e);this.context.memoryLimit.use(n.length);for(const o of n){this.context.push({[i]:o});const e=yield r.value(this.context);this.context.pop(),e===t&&a.push(o)}return a}function*ra(t,e,i){const s=new Wi(Dt(e)).readScopeValue(),a=Mt(t),r=ia.call(this,i);for(let n=0;n<a.length;n++){if(r(yield Ti(s,this.context.spawn(a[n]))))return[n,a[n]]}}function*na(t,e,i){const s=new is(Dt(i),this.liquid),a=Mt(t);for(let r=0;r<a.length;r++){this.context.push({[e]:a[r]});const t=yield s.value(this.context);if(this.context.pop(),t)return[r,a[r]]}}var oa=Object.freeze({__proto__:null,join:Qs,last:Xs,first:Zs,reverse:ta,sort:function*(t,e){const i=[],s=Mt(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push([a,e?yield this.context._getFromScope(a,Dt(e).split("."),!1):a]);return i.sort((t,e)=>{const i=t[1],s=e[1];return i<s?-1:i>s?1:0}).map(t=>t[0])},sort_natural:function(t,e){const i=Dt(e),s=void 0===e?se:(t,e)=>se(t[i],e[i]),a=Mt(t);return this.context.memoryLimit.use(a.length),[...a].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=Mt(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push(yield this.context._getFromScope(a,Dt(e),!1));return i},sum:function*(t,e){let i=0;const s=Mt(t);for(const a of s){const t=Number(e?yield this.context._getFromScope(a,Dt(e),!1):a);i+=Number.isNaN(t)?0:t}return i},compact:function(t){const e=Mt(t);return this.context.memoryLimit.use(e.length),e.filter(t=>!Gt(Ht(t)))},concat:ea,push:function(t,e){return ea.call(this,t,[e])},unshift:function(t,e){const i=Mt(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...Mt(t)];return e.pop(),e},shift:function(t){const e=Mt(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return Gt(t=Ht(t))?[]:(Kt(t)||(t=Dt(t)),e=e<0?t.length+e:e,this.context.memoryLimit.use(i),t.slice(e,e+i))},where:function*(t,e,i){return yield*sa.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*sa.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*aa.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*aa.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=qt(t);const s=new Wi(Dt(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const a of t){const t=yield Ti(s,this.context.spawn(a));i.has(t)||i.set(t,[]),i.get(t).push(a)}return[...i.entries()].map(([t,e])=>({name:t,items:e}))},group_by_exp:function*(t,e,i){const s=new Map,a=new is(Dt(i),this.liquid);t=qt(t),this.context.memoryLimit.use(t.length);for(const r of t){this.context.push({[e]:r});const t=yield a.value(this.context);this.context.pop(),s.has(t)||s.set(t,[]),s.get(t).push(r)}return[...s.entries()].map(([t,e])=>({name:t,items:e}))},has:function*(t,e,i){return!!(yield*ra.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*na.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*ra.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*ra.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=Mt(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(Gt(t=Ht(t)))return[];Kt(t)||(t=Dt(t)),this.context.memoryLimit.use(e);const i=[...t].sort(()=>Math.random()-.5);return 1===e?i[0]:i.slice(0,e)}});function la(t,e,i){var s,a,r;const n=(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(a=null==e?void 0:e.length)&&void 0!==a?a:0)+(null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0);this.context.memoryLimit.use(n);const o=da(t,this.context.opts,i);return o?Be(o,e=Gt(e=Ht(e))?this.context.opts.dateFormat:Dt(e)):t}function ca(t,e,i,s){const a=da(t,this.context.opts);if(!a)return t;if("ordinal"===i){const t=a.getDate();return Be(a,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return Be(a,`%d ${e} %Y`)}function da(t,e,i){let s;const a=null!=i?i:e.timezoneOffset,r=e.locale;return s="now"===(t=Ht(t))||"today"===t?new Ze(Date.now(),r,a):Vt(t)?new Ze(1e3*t,r,a):Ft(t)?/^\d+$/.test(t)?new Ze(1e3*+t,r,a):e.preserveTimezones&&void 0===i?Ze.createDateFixedToTimezone(t,r):new Ze(t,r,a):new Ze(t,r,a),s.valid()?s:void 0}var pa=Object.freeze({__proto__:null,date:la,date_to_xmlschema:function(t){return la.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return la.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return ca.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return ca.call(this,t,"%B",e,i)}});const ha=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,ua=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var ga=Object.freeze({__proto__:null,append:function(t,e){xe(2===arguments.length,"append expect 2 arguments");const i=Dt(t),s=Dt(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){xe(2===arguments.length,"prepend expect 2 arguments");const i=Dt(t),s=Dt(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),e?(e=ne(Dt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),Dt(e).toUpperCase()},remove:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),i.split(Dt(e)).join("")},remove_first:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),i.replace(Dt(e),"")},remove_last:function(t,e){const i=Dt(t);this.context.memoryLimit.use(i.length);const s=Dt(e),a=i.lastIndexOf(s);return-1===a?i:i.substring(0,a)+i.substring(a+s.length)},rstrip:function(t,e){return t=Dt(t),this.context.memoryLimit.use(t.length),e?(e=ne(Dt(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=Dt(t);this.context.memoryLimit.use(i.length);const s=i.split(Dt(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=Dt(t);return this.context.memoryLimit.use(i.length),e?(e=ne(Dt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=Dt(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.split(Dt(e)).join(i)},replace_first:function(t,e,i){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.replace(Dt(e),i)},replace_last:function(t,e,i){const s=Dt(t);this.context.memoryLimit.use(s.length);const a=Dt(e),r=s.lastIndexOf(a);if(-1===r)return s;const n=Dt(i);return s.substring(0,r)+n+s.substring(r+a.length)},truncate:function(t,e=50,i="..."){const s=Dt(t);return this.context.memoryLimit.use(s.length),s.length<=e?t:s.substring(0,e-i.length)+i},truncatewords:function(t,e=15,i="..."){const s=Dt(t);this.context.memoryLimit.use(s.length);const a=s.split(/\s+/);e<=0&&(e=1);let r=a.slice(0,e).join(" ");return a.length>=e&&(r+=i),r},normalize_whitespace:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=Dt(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(ha)||[]).length+(t.match(ua)||[]).length;case"auto":return ha.test(t)?t.match(ha).length+(t.match(ua)||[]).length:t.split(/\s+/).length;default:return t.split(/\s+/).length}},array_to_sentence_string:function(t,e="and"){switch(this.context.memoryLimit.use(t.length),t.length){case 0:return"";case 1:return t[0];case 2:return`${t[0]} ${e} ${t[1]}`;default:return`${t.slice(0,-1).join(", ")}, ${e} ${t[t.length-1]}`}}});var va=Object.freeze({__proto__:null,base64_encode:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),function(t){return btoa(String.fromCharCode(...(new TextEncoder).encode(t)))}(e)},base64_decode:function(t){const e=Dt(t);return this.context.memoryLimit.use(e.length),function(t){return(new TextDecoder).decode(Uint8Array.from(atob(t),t=>t.charCodeAt(0)))}(e)}});const ma=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Hi),Js),Ys),oa),pa),ga),va),Ri);const fa=["offset","limit","reversed"];function ba(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(As(e)){return ya(i.parse(e.content))}return e}const s=[...t.readFileNameTemplate(e.options)],a=ya(i.parseTokens(s));return"none"===a?void 0:a}function ya(t){return 1===t.length&&Cs(t[0].token)?t[0].token.getContent():t}function*xa(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield Ti(t,e)}class _a extends $e{constructor(t,e,i,s){super(t,i,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const wa={assign:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new is(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier(),r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if(!a.size()||"in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.hash=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:else",t=>{_e(t.args),o=this.elseTemplates}).on("tag:endfor",t=>{_e(t.args),l.stop()}).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){const i=this.liquid.renderer;let s=qt(yield Ti(this.collection,t));if(!s.length)return void(yield i.renderTemplates(this.elseTemplates,t,e));const a="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(a)});const r=yield this.hash.render(t);t.pop();s=(this.liquid.options.orderedFilterParameters?Object.keys(r).filter(t=>fa.includes(t)):fa.filter(t=>void 0!==r[t])).reduce((t,e)=>{return"offset"===e?(i=t,s=r.offset,i.slice(s)):"limit"===e?function(t,e){return t.slice(0,e)}(t,r.limit):function(t){return[...t].reverse()}(t);var i,s},s),t.setRegister(a,(r.offset||0)+s.length);const n={forloop:new $e(s.length,this.collection.getText(),this.variable)};t.push(n);for(const o of s){if(n[this.variable]=o,t.continueCalled=t.breakCalled=!1,yield i.renderTemplates(this.templates,t,e),t.breakCalled)break;n.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Xi{constructor(t,e,i,s){for(super(t,e,i),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const t=e.shift();if(Es(t)&&"endcapture"===t.name)return;this.templates.push(s.parseToken(t,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content)return t;if(t=this.tokenizer.readQuoted(),t)return t;throw this.tokenizer.error("invalid capture name")}*render(t){const e=this.liquid.renderer,i=yield e.renderTemplates(this.templates,t);t.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new is(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let a=[],r=0;const n=s.parseStream(e).on("tag:when",t=>{if(r>0)return;a=[];const e=[];for(;!t.tokenizer.end();)e.push(t.tokenizer.readValueOrThrow()),t.tokenizer.skipBlank(),","===t.tokenizer.peek()?t.tokenizer.readTo(","):t.tokenizer.readTo("or");this.branches.push({values:e,templates:a})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endcase",()=>n.stop()).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});n.start()}*render(t,e){const i=this.liquid.renderer,s=Ht(yield this.value.value(t,t.opts.lenientIf));let a=!1;for(const r of this.branches)for(const n of r.values){if(Li(s,yield Ti(n,t,t.opts.lenientIf))){yield i.renderTemplates(r.templates,t,e),a=!0;break}}a||(yield i.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap(t=>t.values)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}},comment:class extends Xi{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Es(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends Xi{constructor(t,e,i,s){super(t,e,i);const{tokenizer:a}=t;this.file=ba(a,this.liquid,s),this.currentFile=t.file;const r=a.p;"with"===a.readIdentifier().content?(a.skipBlank(),":"!==a.peek()?this.withVar=a.readValue():a.p=r):a.p=r,this.hash=new Zi(a,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:a}=this,{renderer:r}=i,n=yield xa(this.file,t,i);xe(n,()=>`illegal file path "${n}"`);const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",_s.OUTPUT);const l=yield s.render(t);a&&(l[n]=yield Ti(a,t));const c=yield i._parsePartialFile(n,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:l}:l),yield r.renderTemplates(c,t,e),t.pop(),t.restoreRegister(o)}*children(t,e){return t&&Ft(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(Ft(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(Ps),Ps(this.file)&&(yield this.file),Ps(this.withVar)&&(yield this.withVar)}},render:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer;for(this.file=ba(a,this.liquid,s),this.currentFile=t.file;!a.end();){a.skipBlank();const t=a.p,e=a.readIdentifier();if(("with"===e.content||"for"===e.content)&&(a.skipBlank(),":"!==a.peek())){const t=a.readValue();if(t){const i=a.p;let s;"as"===a.readIdentifier().content?s=a.readIdentifier():a.p=i,this[e.content]={value:t,alias:s&&s.content},a.skipBlank(),","===a.peek()&&a.advance();continue}}a.p=t;break}this.hash=new Zi(a,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,a=yield xa(this.file,t,i);xe(a,()=>`illegal file path "${a}"`);const r=t.spawn(),n=r.bottom();if(je(n,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;n[i||a]=yield Ti(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=qt(yield Ti(s,t));n.forloop=new $e(l.length,s.getText(),o);for(const t of l){n[o]=t;const s=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(s,r,e),n.forloop.next()}}else{const t=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(t,r,e)}}*children(t,e){return t&&Ft(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(Ft(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;Ft(i)?t.push([i,e]):Ft(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;Ft(i)?t.push([i,e]):Ft(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t);if(this.with){const{value:t}=this.with;Ps(t)&&(yield t)}if(this.for){const{value:t}=this.for;Ps(t)&&(yield t)}}},decrement:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0),e.write(Dt(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Xi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(Dt(s))}*localScope(){yield this.identifier}},cycle:class extends Xi{constructor(t,e,i){super(t,e,i),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(":"===this.tokenizer.peek()?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const t=this.tokenizer.readValue();t&&this.candidates.push(t),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,()=>`empty candidates: "${t.getText()}"`)}*render(t,e){const i=`cycle:${yield Ti(this.group,t)}:`+this.candidates.join(","),s=t.getRegister("cycle");let a=s[i];void 0===a&&(a=s[i]=0);const r=this.candidates[a];return a=(a+1)%this.candidates.length,s[i]=a,yield Ti(r,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[];let a=[];s.parseStream(e).on("start",()=>this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})).on("tag:elsif",t=>{xe(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})}).on("tag:else",t=>{_e(t.args),xe(!this.elseTemplates,"duplicated else"),a=this.elseTemplates=[]}).on("tag:endif",function(t){_e(t.args),this.stop()}).on("template",t=>a.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,templates:a}of this.branches){if(Ei(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(a,t,e))}yield i.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},layout:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.file=ba(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:i,args:s,file:a}=this,{renderer:r}=i;if(void 0===a)return t.setRegister("blockMode",_s.OUTPUT),void(yield r.renderTemplates(this.templates,t,e));const n=yield xa(this.file,t,i);xe(n,()=>`illegal file path "${n}"`);const o=yield i._parseLayoutFile(n,t.sync,this.currentFile);t.setRegister("blockMode",_s.STORE);const l=yield r.renderTemplates(this.templates,t),c=t.getRegister("blocks");void 0===c[""]&&(c[""]=(t,e)=>e.write(l)),t.setRegister("blockMode",_s.OUTPUT),t.push(yield s.render(t)),yield r.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&Ft(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))Ps(t)&&(yield t);Ps(this.file)&&(yield this.file)}partialScope(){if(Ft(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.templates=[];const a=/\w+/.exec(t.args);for(this.block=a?a[0]:"";e.length;){const t=e.shift();if(Es(t)&&"endblock"===t.name)return;const i=s.parseToken(t,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const i=this.getBlockRender(t);t.getRegister("blockMode")===_s.STORE?t.getRegister("blocks")[this.block]=i:yield i(new Ee,e)}getBlockRender(t){const{liquid:e,templates:i}=this,s=t.getRegister("blocks")[this.block],a=function*(s,a){t.push({block:s}),yield e.renderer.renderTemplates(i,t,a),t.pop()};return s?(t,e)=>s(new Ee(e=>a(t,e)),e):a}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Xi{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Es(t)&&"endraw"===t.name)return;this.tokens.push(t)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map(t=>t.getText()).join("")}},tablerow:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if("in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.args=new Zi(this.tokenizer,i.options.keyValueSeparator),this.templates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:endtablerow",()=>l.stop()).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){let i=qt(yield Ti(this.collection,t));const s=yield this.args.render(t),a=s.offset||0,r=void 0===s.limit?i.length:s.limit;i=i.slice(a,a+r);const n=s.cols||i.length,o=this.liquid.renderer,l=new _a(i.length,n,this.collection.getText(),this.variable),c={tablerowloop:l};t.push(c);for(let d=0;d<i.length;d++,l.next())c[this.variable]=i[d],0===l.col0()&&(1!==l.row()&&e.write("</tr>"),e.write(`<tr class="row${l.row()}">`)),e.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,t,e),e.write("</td>");i.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Xi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[];let a=[],r=0;s.parseStream(e).on("start",()=>this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),test:Ai,templates:a=[]})).on("tag:elsif",t=>{r>0?a=[]:this.branches.push({value:new is(t.tokenizer.readFilteredValue(),this.liquid),test:Ei,templates:a=[]})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,test:a,templates:r}of this.branches){if(a(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(r,t,e))}yield i.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},break:class extends Xi{render(t,e){t.breakCalled=!0}},continue:class extends Xi{render(t,e){t.continueCalled=!0}},echo:class extends Xi{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new is(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const i=yield this.value.value(t,!1);e.write(i)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Xi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(a)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}},"#":class extends Xi{constructor(t,e,i){if(super(t,e,i),-1!==t.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class ka{constructor(t={}){this.renderer=new $i,this.filters={},this.tags={},this.options=Bi(t),this.parser=new $s(this),Yt(wa,(t,e)=>this.registerTag(e,t)),Yt(ma,(t,e)=>this.registerFilter(e,t))}parse(t,e){return new $s(this).parse(t,e)}_render(t,e,i){const s=e instanceof Is?e:new Is(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderSync(t,e,i){return Ie(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new Is(e,this.options,i);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,i){const s=this.parse(t);return this._render(s,e,i)}parseAndRender(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}parseAndRenderSync(t,e,i){return Ie(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new $s(this).parseFile(t,e,fs.Partials,i)}_parseLayoutFile(t,e,i){return new $s(this).parseFile(t,e,fs.Layouts,i)}_parseFile(t,e,i,s){return new $s(this).parseFile(t,e,i,s)}parseFile(t,e){return Pe(this,0,void 0,function*(){return Fe(new $s(this).parseFile(t,!1,e))})}parseFileSync(t,e){return Ie(new $s(this).parseFile(t,!0,e))}*_renderFile(t,e,i){const s=yield this._parseFile(t,i.sync,i.lookupType);return yield this._render(s,e,i)}renderFile(t,e,i){return Pe(this,0,void 0,function*(){return Fe(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderFileSync(t,e,i){return Ie(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return Pe(this,0,void 0,function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)})}_evalValue(t,e){const i=new is(t,this),s=e instanceof Is?e:new Is(e,this.options);return i.value(s)}evalValue(t,e){return Pe(this,0,void 0,function*(){return Fe(this._evalValue(t,e))})}evalValueSync(t,e){return Ie(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){var i;this.tags[t]=It(e)?e:(i=e,class extends Xi{constructor(t,e,s){super(t,e,s),It(i.parse)&&i.parse.call(this,t,e)}*render(t,e){const s=yield new Zi(this.token.args,t.opts.keyValueSeparator).render(t);return yield i.render.call(this,t,e,s)}})}plugin(t){return t.call(this,ka)}express(){const t=this;let e=!0;return function(i,s,a){if(e){e=!1;const i=Gi(this.root);t.options.root.unshift(...i),t.options.layouts.unshift(...i),t.options.partials.unshift(...i)}t.renderFile(i,s).then(t=>a(null,t),a)}}analyze(t,e={}){return Pe(this,0,void 0,function*(){return cs(t,e)})}analyzeSync(t,e={}){return ds(t,e)}parseAndAnalyze(t,e,i={}){return Pe(this,0,void 0,function*(){return cs(this.parse(t,e),i)})}parseAndAnalyzeSync(t,e,i={}){return ds(this.parse(t,e),i)}variables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Object.keys(i.variables)})}variablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))})}fullVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))}variableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))})}variableSegmentsSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))}globalVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Object.keys(i.globals)})}globalVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))})}globalFullVariablesSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))}globalVariableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))})}globalVariableSegmentsSync(t,e={}){const i=ds(Ft(t)?this.parse(t):t,e);return Array.from(oe(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))}}const $a=new class{constructor(){this.context=null,this.flattenedContext=null,this.history=[],this.maxHistory=50,this.engine=new ka({strictFilters:!1,strictVariables:!1,lenientIf:!0}),this._registerShopifyFilters()}_registerShopifyFilters(){this.engine.registerFilter("money",t=>"$"+(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_without_currency",t=>(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_with_currency",t=>{var e,i,s;const a=Number(t)/100,r=(null==(s=null==(i=null==(e=this.context)?void 0:e.objects)?void 0:i.shop)?void 0:s.currency)||"USD";return"$"+a.toFixed(2)+" "+r}),this.engine.registerFilter("type_of",t=>null==t?"nil":Array.isArray(t)?"array":typeof t),this.engine.registerFilter("json_pretty",t=>JSON.stringify(t,null,2)),this.engine.registerFilter("asset_url",t=>`/assets/${t}`),this.engine.registerFilter("img_url",(t,e="medium")=>"string"==typeof t?t:(null==t?void 0:t.src)||""),this.engine.registerFilter("handle",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("handleize",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("pluralize",(t,e,i)=>1===t?e:i||e+"s"),this.engine.registerFilter("within",(t,e)=>e&&e.url?`${e.url}${t}`:t),this.engine.registerFilter("link_to",(t,e,i="")=>`<a href="${e}" title="${i}">${t}</a>`),this.engine.registerFilter("link_to_tag",(t,e=null)=>`<a href="/collections/all/${t}">${t}</a>`),this.engine.registerFilter("link_to_vendor",t=>`<a href="/collections/vendors?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("link_to_type",t=>`<a href="/collections/types?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("highlight",(t,e)=>{if(!e)return t;const i=new RegExp(`(${e})`,"gi");return String(t).replace(i,"<strong>$1</strong>")}),this.engine.registerFilter("metafield_value",t=>t&&"object"==typeof t&&"value"in t?t.value:t)}setContext(t){this.context=t,this.flattenedContext=null}_buildLiquidContext(){var t,e,i,s;if(!this.context)return{};const a=mt.currentCart,r=ft.currentProduct,n={...this.context.objects||{},...a?{cart:a}:{},...r?{product:r}:{},template:null==(t=this.context.meta)?void 0:t.template,request:null==(e=this.context.meta)?void 0:e.request,theme:null==(i=this.context.meta)?void 0:i.theme,localization:null==(s=this.context.meta)?void 0:s.localization,settings:this.context.settings};if(this.context.metafields)for(const[o,l]of Object.entries(this.context.metafields))if(n[o]){const t={};for(const[e,i]of Object.entries(l)){t[e]={};for(const[s,a]of Object.entries(i))t[e][s]=(null==a?void 0:a.value)??a}n[o]={...n[o],metafields:t}}return n}async evaluate(t){if(!t||!t.trim())return{success:!1,error:"Empty expression",expression:t};const e=t.trim(),i=this._buildLiquidContext();try{if(/^[\w.\[\]0-9]+$/.test(e)&&!e.includes("{%")&&!e.includes("{{")&&!e.includes("|")){const t=this._resolvePath(e,i);return this.addToHistory(e),{success:!0,value:t,expression:e}}let t=e;e.includes("{%")||e.includes("{{")||(t=`{{ ${e} }}`);const s=await this.engine.parseAndRender(t,i);this.addToHistory(e);return{success:!0,value:this._parseResult(s.trim()),expression:e}}catch(s){return{success:!1,error:s.message,expression:e}}}_resolvePath(t,e){if(!e)return;const i=t.replace(/\[(\d+)\]/g,".$1").split(".").filter(t=>""!==t);let s=e;for(const a of i){if(null==s)return;s=s[a]}return s}_parseResult(t){if(""===t)return"";if(""===t||"nil"===t||"null"===t)return null;if("true"===t)return!0;if("false"===t)return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}"))try{return JSON.parse(t)}catch{}return t}getCompletions(t){if(!this.context)return[];let e=t.replace(/^\{\{\s*/,"").replace(/\s*\}\}$/,"").trim();const i=e.match(/\{%\s*(\w+)?\s*$/);if(i)return this._getTagCompletions(i[1]||"");const s=e.lastIndexOf("|");if(-1!==s){const t=e.slice(s+1).trim();if(""===t||/^\w*$/.test(t))return this._getFilterCompletions(t)}const a=e.match(/^(.+\[\d+\])\.(\w*)$/);if(a){const t=a[1],e=a[2];return this._getDynamicCompletions(t,e)}const r=this._getAllPaths(),n=e.toLowerCase();return r.filter(t=>t.path.toLowerCase().startsWith(n)).slice(0,20).map(t=>({value:t.path,type:t.type,preview:t.preview}))}_getDynamicCompletions(t,e){const i=this._buildLiquidContext(),s=this._resolvePath(t,i);if(null==s||"object"!=typeof s)return[];const a=[],r=e.toLowerCase();for(const[n,o]of Object.entries(s))if(n.toLowerCase().startsWith(r)){const e=`${t}.${n}`;let i="property",s=o;Array.isArray(o)?(i="array",s=`[${o.length} items]`):"object"==typeof o&&null!==o?(i="object",s=`{${Object.keys(o).length} keys}`):"string"==typeof o?(i="string",s=o.length>50?o.substring(0,50)+"...":o):"number"==typeof o?i="number":"boolean"==typeof o&&(i="boolean"),a.push({value:e,type:i,preview:s})}return a.slice(0,20)}_getTagCompletions(t){const e=t.toLowerCase();return[{value:"if",type:"tag",preview:"Conditional"},{value:"elsif",type:"tag",preview:"Else if"},{value:"else",type:"tag",preview:"Else"},{value:"endif",type:"tag",preview:"End if"},{value:"unless",type:"tag",preview:"Negative conditional"},{value:"endunless",type:"tag",preview:"End unless"},{value:"case",type:"tag",preview:"Switch statement"},{value:"when",type:"tag",preview:"Case option"},{value:"endcase",type:"tag",preview:"End case"},{value:"for",type:"tag",preview:"Loop"},{value:"endfor",type:"tag",preview:"End loop"},{value:"break",type:"tag",preview:"Exit loop"},{value:"continue",type:"tag",preview:"Skip iteration"},{value:"assign",type:"tag",preview:"Assign variable"},{value:"capture",type:"tag",preview:"Capture output"},{value:"endcapture",type:"tag",preview:"End capture"},{value:"increment",type:"tag",preview:"Increment counter"},{value:"decrement",type:"tag",preview:"Decrement counter"},{value:"comment",type:"tag",preview:"Comment block"},{value:"endcomment",type:"tag",preview:"End comment"},{value:"raw",type:"tag",preview:"Raw output"},{value:"endraw",type:"tag",preview:"End raw"},{value:"render",type:"tag",preview:"Render snippet"},{value:"section",type:"tag",preview:"Render section"},{value:"form",type:"tag",preview:"Form tag"},{value:"endform",type:"tag",preview:"End form"},{value:"paginate",type:"tag",preview:"Pagination"},{value:"endpaginate",type:"tag",preview:"End pagination"}].filter(t=>t.value.startsWith(e)).slice(0,15)}_getFilterCompletions(t){const e=t.toLowerCase();return[{value:"append",preview:"Append string"},{value:"prepend",preview:"Prepend string"},{value:"capitalize",preview:"Capitalize first letter"},{value:"downcase",preview:"Convert to lowercase"},{value:"upcase",preview:"Convert to uppercase"},{value:"strip",preview:"Trim whitespace"},{value:"lstrip",preview:"Trim left whitespace"},{value:"rstrip",preview:"Trim right whitespace"},{value:"strip_html",preview:"Remove HTML tags"},{value:"strip_newlines",preview:"Remove newlines"},{value:"newline_to_br",preview:"Convert newlines to <br>"},{value:"replace",preview:"Replace substring"},{value:"replace_first",preview:"Replace first occurrence"},{value:"remove",preview:"Remove substring"},{value:"remove_first",preview:"Remove first occurrence"},{value:"truncate",preview:"Truncate to length"},{value:"truncatewords",preview:"Truncate to word count"},{value:"split",preview:"Split into array"},{value:"slice",preview:"Extract substring"},{value:"escape",preview:"HTML escape"},{value:"escape_once",preview:"HTML escape once"},{value:"url_encode",preview:"URL encode"},{value:"url_decode",preview:"URL decode"},{value:"base64_encode",preview:"Base64 encode"},{value:"base64_decode",preview:"Base64 decode"},{value:"handle",preview:"Convert to handle"},{value:"handleize",preview:"Convert to handle"},{value:"abs",preview:"Absolute value"},{value:"ceil",preview:"Round up"},{value:"floor",preview:"Round down"},{value:"round",preview:"Round to precision"},{value:"plus",preview:"Add number"},{value:"minus",preview:"Subtract number"},{value:"times",preview:"Multiply"},{value:"divided_by",preview:"Divide"},{value:"modulo",preview:"Remainder"},{value:"at_least",preview:"Minimum value"},{value:"at_most",preview:"Maximum value"},{value:"join",preview:"Join array"},{value:"first",preview:"Get first element"},{value:"last",preview:"Get last element"},{value:"size",preview:"Get length"},{value:"reverse",preview:"Reverse array"},{value:"sort",preview:"Sort array"},{value:"sort_natural",preview:"Natural sort"},{value:"uniq",preview:"Remove duplicates"},{value:"map",preview:"Extract property"},{value:"where",preview:"Filter array"},{value:"compact",preview:"Remove nil values"},{value:"concat",preview:"Concatenate arrays"},{value:"date",preview:"Format date"},{value:"default",preview:"Default if nil"},{value:"json",preview:"Convert to JSON"},{value:"json_pretty",preview:"Pretty JSON"},{value:"type_of",preview:"Get type"},{value:"money",preview:"Format as money"},{value:"money_with_currency",preview:"Money with currency"},{value:"money_without_currency",preview:"Money without currency"},{value:"asset_url",preview:"Asset URL"},{value:"img_url",preview:"Image URL"},{value:"link_to",preview:"Create link"},{value:"pluralize",preview:"Pluralize word"},{value:"highlight",preview:"Highlight text"},{value:"metafield_value",preview:"Get metafield value"}].filter(t=>t.value.startsWith(e)).slice(0,15).map(t=>({...t,type:"filter"}))}_getAllPaths(){var t,e,i,s,a,r,n,o;if(!this.flattenedContext){const a=[];if(null==(t=this.context)?void 0:t.objects)for(const[t,e]of Object.entries(this.context.objects))null!=e&&"cart"!==t&&"product"!==t&&this._addPaths(a,t,e,3);if((null==(e=this.context)?void 0:e.meta)&&(this._addPaths(a,"template",this.context.meta.template,2),this._addPaths(a,"request",this.context.meta.request,2),this._addPaths(a,"theme",this.context.meta.theme,2)),null==(i=this.context)?void 0:i.metafields)for(const[t,e]of Object.entries(this.context.metafields))if(e&&(null==(s=this.context.objects)?void 0:s[t]))for(const[i,s]of Object.entries(e))for(const[e,r]of Object.entries(s))a.push({path:`${t}.metafields.${i}.${e}`,type:(null==r?void 0:r.type)||"metafield",preview:null==r?void 0:r.value});this.flattenedContext=a}const l=[...this.flattenedContext],c=mt.currentCart;c?this._addPaths(l,"cart",c,3):(null==(r=null==(a=this.context)?void 0:a.objects)?void 0:r.cart)&&this._addPaths(l,"cart",this.context.objects.cart,3);const d=ft.currentProduct;return d?this._addPaths(l,"product",d,3):(null==(o=null==(n=this.context)?void 0:n.objects)?void 0:o.product)&&this._addPaths(l,"product",this.context.objects.product,3),l}_addPaths(t,e,i,s,a=0){if(a>=s||null==i)return;const r=Array.isArray(i)?"array":typeof i;if(t.push({path:e,type:r,preview:this._getPreview(i)}),"object"!=typeof i||Array.isArray(i))Array.isArray(i)&&i.length>0&&this._addPaths(t,`${e}[0]`,i[0],s,a+1);else for(const[n,o]of Object.entries(i))n.startsWith("_")||this._addPaths(t,`${e}.${n}`,o,s,a+1)}_getPreview(t){return null==t?"null":"string"==typeof t?t.length>50?t.slice(0,50)+"...":t:"number"==typeof t||"boolean"==typeof t?t:Array.isArray(t)?`Array(${t.length})`:"object"==typeof t?`Object(${Object.keys(t).length})`:String(t)}addToHistory(t){this.history[this.history.length-1]!==t&&(this.history.push(t),this.history.length>this.maxHistory&&(this.history=this.history.slice(-this.maxHistory)))}getHistory(){return[...this.history]}clearHistory(){this.history=[]}},Sa=class t extends ot{constructor(){super(),this.logs=[],this.liquidErrors=[],this.filter="",this.activeFilter="all",this.showThemeOnly=!0,this.expandedLogs=new Set,this.groupedErrors=new Map,this.networkErrors=[],this.groupStack=[],this._originalConsole={},this._originalFetch=null,this._currentGroupId=null,this.inputValue="",this.inputHistory=[],this.historyIndex=-1,this.suggestions=[],this.selectedSuggestion=-1,this.showSuggestions=!1,this.showFilterDropdown=!1,this.context=null,this._loadPersistedLogs()}_loadPersistedLogs(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.logs=(t.logs||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.networkErrors=(t.networkErrors||[]).map(t=>({...t,timestamp:new Date(t.timestamp),persisted:!0})),this.logs.forEach(t=>{if("error"===t.type||"warn"===t.type){const e=this._getGroupKey(t),i=this.groupedErrors.get(e);i?i.count++:this.groupedErrors.set(e,{...t,count:1})}}),this.groupedErrors=new Map(this.groupedErrors)}}catch(e){console.warn("Failed to load persisted logs:",e)}}_persistLogs(){try{const e={logs:this.logs.slice(-500).map(t=>({...t,args:void 0})),networkErrors:this.networkErrors.slice(-100)};sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){}}_getGroupKey(t){let e=t.message||"";return e=e.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/g,"[timestamp]"),e=e.replace(/\d{2}:\d{2}:\d{2}\.\d{3}/g,"[time]"),e=e.replace(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/gi,"[uuid]"),e=e.replace(/\/\d+\//g,"/[id]/"),e=e.replace(/=\d+(&|$)/g,"=[num]$1"),`${t.type}:${e.substring(0,200)}`}connectedCallback(){super.connectedCallback(),this._interceptConsole(),this._interceptNetwork(),this._scanForLiquidErrors(),this._captureGlobalErrors()}disconnectedCallback(){super.disconnectedCallback(),this._restoreConsole(),this._restoreNetwork(),window.removeEventListener("error",this._handleGlobalError),window.removeEventListener("unhandledrejection",this._handleUnhandledRejection)}updated(t){super.updated(t),t.has("context")&&this.context&&$a.setContext(this.context)}willUpdate(t){t.has("context")&&this.context&&!$a.context&&$a.setContext(this.context)}_interceptConsole(){const t=this;["log","info","warn","error","debug"].forEach(e=>{this._originalConsole[e]=console[e],console[e]=function(...i){t._addLog(e,i),t._originalConsole[e].apply(console,i)}}),this._originalConsole.table=console.table,console.table=function(e,i){t._addLog("table",[e],{columns:i,isTable:!0}),t._originalConsole.table.apply(console,[e,i])},this._originalConsole.group=console.group,this._originalConsole.groupCollapsed=console.groupCollapsed,this._originalConsole.groupEnd=console.groupEnd,console.group=function(...e){const i=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",i,!1),t._originalConsole.group.apply(console,e)},console.groupCollapsed=function(...e){const i=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",i,!0),t._originalConsole.groupCollapsed.apply(console,e)},console.groupEnd=function(){t._endGroup(),t._originalConsole.groupEnd.apply(console)}}_restoreConsole(){Object.keys(this._originalConsole).forEach(t=>{this._originalConsole[t]&&(console[t]=this._originalConsole[t])})}_startGroup(t,e,i){const s={id:e,type:"group",message:t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t,""),collapsed:i,children:[],parentGroupId:this._currentGroupId};if(this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t&&t.children.push(s)}else this.logs=[...this.logs,s];this.groupStack.push(e),this._currentGroupId=e}_endGroup(){this.groupStack.pop(),this._currentGroupId=this.groupStack.length>0?this.groupStack[this.groupStack.length-1]:null}_findGroupById(t,e=this.logs){for(const i of e){if(i.id===t)return i;if(i.children){const e=this._findGroupById(t,i.children);if(e)return e}}return null}_interceptNetwork(){const t=this;this._originalFetch=window.fetch,window.fetch=async function(e,i){const s="string"==typeof e?e:e.url,a=(null==i?void 0:i.method)||"GET",r=performance.now();try{const n=await t._originalFetch.apply(window,[e,i]),o=performance.now()-r;return n.ok||t._addNetworkError({url:s,method:a,status:n.status,statusText:n.statusText,duration:o,type:"fetch"}),n}catch(n){const e=performance.now()-r;throw t._addNetworkError({url:s,method:a,status:0,statusText:n.message||"Network Error",duration:e,type:"fetch",error:!0}),n}};const e=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,i){return this._tdtMethod=t,this._tdtUrl=i,this._tdtStartTime=null,e.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){return this._tdtStartTime=performance.now(),this.addEventListener("loadend",function(){const e=performance.now()-this._tdtStartTime;(this.status>=400||0===this.status)&&t._addNetworkError({url:this._tdtUrl,method:this._tdtMethod,status:this.status,statusText:this.statusText||(0===this.status?"Network Error":""),duration:e,type:"xhr"})}),i.apply(this,arguments)},this._originalXHROpen=e,this._originalXHRSend=i}_restoreNetwork(){this._originalFetch&&(window.fetch=this._originalFetch),this._originalXHROpen&&(XMLHttpRequest.prototype.open=this._originalXHROpen),this._originalXHRSend&&(XMLHttpRequest.prototype.send=this._originalXHRSend)}_addNetworkError(t){const e={id:Date.now()+Math.random(),...t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t.url,"")};this.networkErrors=[...this.networkErrors,e],this._persistLogs()}_captureGlobalErrors(){this._handleGlobalError=t=>{var e;this._addLog("error",[t.message],{stack:null==(e=t.error)?void 0:e.stack,source:`${t.filename}:${t.lineno}:${t.colno}`})},this._handleUnhandledRejection=t=>{var e;this._addLog("error",[`Unhandled Promise Rejection: ${t.reason}`],{stack:null==(e=t.reason)?void 0:e.stack})},window.addEventListener("error",this._handleGlobalError),window.addEventListener("unhandledrejection",this._handleUnhandledRejection)}_addLog(t,e,i={}){const s=e.map(t=>{if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}).join(" "),a=this._isThemeRelated(s,i.source),r={id:Date.now()+Math.random(),type:t,message:s,args:e,timestamp:new Date,isThemeRelated:a,stack:i.stack,source:i.source,hasObjects:e.some(t=>"object"==typeof t&&null!==t),isTable:i.isTable||!1,tableColumns:i.columns,groupId:this._currentGroupId},n=this._getGroupKey(r),o=this.groupedErrors.get(n);if(!o||"error"!==t&&"warn"!==t)if("error"!==t&&"warn"!==t||(this.groupedErrors.set(n,{...r,count:1}),this.groupedErrors=new Map(this.groupedErrors)),this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t?(t.children.push(r),this.logs=[...this.logs]):this.logs=[...this.logs,r]}else this.logs=[...this.logs,r];else o.count++,o.lastTime=r.timestamp,this.groupedErrors=new Map(this.groupedErrors);this._persistLogs()}_isThemeRelated(e,i=""){const s=(e+" "+i).toLowerCase();return t.THEME_KEYWORDS.some(t=>s.includes(t))}_scanForLiquidErrors(){const t=[],e=new Set,i=(i,s,a=null)=>{const r=i.trim();e.has(r)||(e.add(r),t.push({id:Date.now()+Math.random(),type:"liquid",category:s,message:r,timestamp:new Date,element:a?this._getElementPath(a):null}))},s=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;s.nextNode();){const t=s.currentNode.textContent;(t.includes("Liquid error")||t.includes("Liquid syntax error"))&&i(t,"comment")}const a=document.body.innerHTML;[/Liquid\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+error:\s*[^<\n]+/gi,/Liquid\s+syntax\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,/Liquid\s+syntax\s+error:\s*[^<\n]+/gi,/Error\s+in\s+schema:\s*[^<\n]+/gi,/Invalid\s+JSON\s+in\s+schema\s+tag/gi,/Error\s+parsing\s+schema:\s*[^<\n]+/gi].forEach(t=>{let e;for(;null!==(e=t.exec(a));)i(e[0],"inline")});const r=/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/gi;let n;for(;null!==(n=r.exec(a));){const t=n[1];i(`Raw ${t} Drop object rendered: ${n[0]} — Use .title, .url, or other property instead of outputting the object directly`,"drop")}const o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;const i=t.parentElement;if(!i)return NodeFilter.FILTER_REJECT;const s=null==(e=i.tagName)?void 0:e.toLowerCase();return"script"===s||"style"===s||"noscript"===s?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;o.nextNode();){const t=o.currentNode.textContent;if(/Liquid\s+(error|syntax error)/i.test(t)){const e=t.match(/Liquid\s+(?:error|syntax error)[^]*/i);e&&i(e[0],"text",o.currentNode.parentElement)}if(/#<\w+Drop:0x/i.test(t)){const e=t.match(/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/i);e&&i(`Raw ${e[1]} Drop object in page: ${e[0]}`,"drop",o.currentNode.parentElement)}/unknown\s+image\s+file/i.test(t)&&i(`Unknown image file error: ${t.substring(0,200)}`,"asset",o.currentNode.parentElement)}document.querySelectorAll("img").forEach(t=>{const e=t.src||t.dataset.src,s=t.alt;s&&/Liquid\s+error|Could\s+not\s+find\s+asset/i.test(s)&&i(`Image error: ${s}`,"asset",t),e&&/Liquid%20error|Could%20not%20find/i.test(e)&&i(`Broken image URL contains error: ${decodeURIComponent(e.substring(0,200))}`,"asset",t)});document.querySelectorAll(".shopify-section, [data-section-type], .template-").forEach(t=>{const e=t.textContent;if(/form\s+'product'\s+needs\s+a\s+product\s+object/i.test(e)&&i("Liquid error: form 'product' needs a product object","form",t),/form\s+'customer_address'\s+requires\s+an\s+address/i.test(e)&&i("Liquid error: form 'customer_address' requires an address","form",t),/invalid\s+form\s+type/i.test(e)){const s=e.match(/invalid\s+form\s+type\s*['"]?(\w+)['"]?/i);i(`Liquid error: invalid form type '${(null==s?void 0:s[1])||"unknown"}'`,"form",t)}}),this._checkDeprecations(),this.liquidErrors=t}_getElementPath(t){var e;if(!t)return null;const i=[];let s=t;for(;s&&s!==document.body&&i.length<5;){let t=(null==(e=s.tagName)?void 0:e.toLowerCase())||"";if(s.id)t+=`#${s.id}`;else if(s.className&&"string"==typeof s.className){const e=s.className.split(" ").filter(t=>t&&!t.startsWith("js-")).slice(0,2);e.length&&(t+=`.${e.join(".")}`)}t&&i.unshift(t),s=s.parentElement}return i.join(" > ")}_checkDeprecations(){document.querySelectorAll("script:not([src])");const e=document.documentElement.innerHTML;t.LIQUID_DEPRECATIONS.forEach(t=>{t.pattern.test(e)&&this._addLog("warn",[`Liquid Deprecation: ${t.message}`],{deprecation:t})})}_filterLogs(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t,this.showFilterDropdown=!1}_toggleFilterDropdown(){this.showFilterDropdown=!this.showFilterDropdown}_closeFilterDropdown(){this.showFilterDropdown=!1}_getFilterLabel(t){return{all:"📋 All",error:"❌ Errors",warn:"⚠️ Warnings",info:"ℹ️ Info",log:"📝 Logs",liquid:"💧 Liquid",network:"🌐 Network"}[t]||"📋 All"}_toggleThemeOnly(){this.showThemeOnly=!this.showThemeOnly}_clearLogs(){this.logs=[],this.networkErrors=[],this.groupedErrors=new Map,this.groupStack=[],this._currentGroupId=null,sessionStorage.removeItem(t.STORAGE_KEY)}_handleInputKeydown(t){switch(t.key){case"Enter":if(t.shiftKey)return;t.preventDefault(),this.showSuggestions&&this.selectedSuggestion>=0?this._selectSuggestion(this.selectedSuggestion):this._evaluateExpression();break;case"ArrowUp":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion<=0?this.suggestions.length-1:this.selectedSuggestion-1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtFirstLine(t.target)||(t.preventDefault(),this._navigateHistory(-1));break;case"ArrowDown":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion>=this.suggestions.length-1?0:this.selectedSuggestion+1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtLastLine(t.target)||(t.preventDefault(),this._navigateHistory(1));break;case"Tab":if(this.showSuggestions&&this.suggestions.length>0){t.preventDefault();const e=this.selectedSuggestion>=0?this.selectedSuggestion:0;this._selectSuggestion(e)}break;case"Escape":this.showSuggestions&&(t.preventDefault(),this.showSuggestions=!1,this.selectedSuggestion=-1)}}_isAtFirstLine(t){const e=t.selectionStart;return!t.value.substring(0,e).includes("\n")}_isAtLastLine(t){const e=t.selectionStart;return!t.value.substring(e).includes("\n")}_scrollSuggestionIntoView(){this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".autocomplete-dropdown"),e=this.shadowRoot.querySelector(".autocomplete-item--selected");t&&e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})})}_handleInput(t){this.inputValue=t.target.value,this.historyIndex=-1,this._updateSuggestions(),this._autoGrowTextarea(t.target)}_autoGrowTextarea(t){t.style.height="auto",t.style.height=Math.min(t.scrollHeight,150)+"px"}_updateSuggestions(){if(!this.inputValue.trim())return this.suggestions=[],this.showSuggestions=!1,void(this.selectedSuggestion=-1);this.suggestions=$a.getCompletions(this.inputValue),this.showSuggestions=this.suggestions.length>0,this.selectedSuggestion=-1}_selectSuggestion(t){const e=this.suggestions[t];if(!e)return;const i=this.inputValue.lastIndexOf("|");-1!==i&&"filter"===e.type?this.inputValue=this.inputValue.slice(0,i+1)+" "+e.value:this.inputValue=e.value,this.showSuggestions=!1,this.selectedSuggestion=-1,this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-input");t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length),this._autoGrowTextarea(t))})}_navigateHistory(t){const e=$a.getHistory();0!==e.length&&(-1===t?this.historyIndex<e.length-1&&(this.historyIndex++,this.inputValue=e[e.length-1-this.historyIndex]):this.historyIndex>0?(this.historyIndex--,this.inputValue=e[e.length-1-this.historyIndex]):0===this.historyIndex&&(this.historyIndex=-1,this.inputValue=""),this.showSuggestions=!1)}async _evaluateExpression(){if(!this.inputValue.trim())return;const t=this.inputValue;this.inputValue="",this.historyIndex=-1,this.showSuggestions=!1;const e=await $a.evaluate(t),i={id:Date.now()+Math.random(),type:"eval",expression:e.expression,message:e.expression,result:e.success?e.value:null,error:e.success?null:e.error,success:e.success,timestamp:new Date,isThemeRelated:!0};this.logs=[...this.logs,i],this._persistLogs(),this.inputHistory=$a.getHistory(),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-content");t&&(t.scrollTop=t.scrollHeight)})}_renderEvalResult(t){if(!t.success)return U`<span class="eval-result eval-result--error">${t.error}</span>`;const e=t.result;return void 0===e?U`<span class="eval-result eval-result--undefined">undefined</span>`:null===e?U`<span class="eval-result eval-result--null">null</span>`:"string"==typeof e?U`<span class="eval-result eval-result--string">"${e}"</span>`:"number"==typeof e?U`<span class="eval-result eval-result--number">${e}</span>`:"boolean"==typeof e?U`<span class="eval-result eval-result--boolean">${e}</span>`:"object"==typeof e?U`
|
|
3335
|
+
`]),customElements.define("tdt-storage-panel",Ot);class Lt{constructor(t,e,i,s,a){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=a}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class jt{liquidMethodMissing(t,e){}}const zt=Object.prototype.toString,qt=String.prototype.toLowerCase,Pt=Object.hasOwnProperty;function It(t){return"string"==typeof t}function Rt(t){return"function"==typeof t}function Nt(t){return t&&Rt(t.then)}function Dt(t){return t&&Rt(t.next)&&Rt(t.throw)&&Rt(t.return)}function Ft(t){return It(t=Ut(t))?t:Gt(t)?"":Qt(t)?t.map(t=>Ft(t)).join(""):String(t)}function Mt(t){return Qt(t=Ut(t))?t:It(t)&&t.length>0?[t]:Zt(e=t)&&Symbol.iterator in e?Array.from(t):Zt(t)?Object.keys(t).map(e=>[e,t[e]]):[];var e}function Ht(t){return Gt(t=Ut(t))?[]:Qt(t)?t:[t]}function Ut(t){return t instanceof jt&&Rt(t.valueOf)?t.valueOf():t}function Bt(t){return+Ut(t)||0}function Vt(t){return"number"==typeof t}function Jt(t){return t&&Rt(t.toLiquid)?Jt(t.toLiquid()):t}function Gt(t){return null==t}function Kt(t){return void 0===t}function Qt(t){return"[object Array]"===zt.call(t)}function Wt(t){return t&&Vt(t.length)}function Yt(t,e){t=t||{};for(const i in t)if(Pt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Xt(t){return t[t.length-1]}function Zt(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function te(t,e,i=1){const s=[];for(let a=t;a<e;a+=i)s.push(a);return s}function ee(t,e,i=" "){return ie(t,e,i,(t,e)=>e+t)}function ie(t,e,i,s){let a=e-(t=String(t)).length;for(;a-- >0;)t=s(t,i);return t}function se(t){return t}function ae(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=qt.call(t))<(e=qt.call(e))?-1:t>e?1:0}function re(t){return function(...e){return t.call(this,...e.map(Ut))}}function ne(t){return function(...e){return t.call(this,...e.map(Bt))}}function oe(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*le(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const de="__liquidClass__";class ce extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,de,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:fe(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[de])}}class pe extends ce{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class ue extends ce{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class he extends ce{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class ge extends ce{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class ve extends ce{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class me extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class be extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function fe(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),a=Math.max(e-2,1),r=Math.min(e+3,s.length);return te(a,r+1).map(t=>{let a=`${t===e?">> ":" "}${ee(String(t),String(r).length)}| `;const n=t===e?"\n"+ee("^",i+a.length):"";return a+=s[t-1],a+=n,a}).join("\n")}const ye=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function xe(t){const e=t.charCodeAt(0);return e>=128?!ye[e]:!!(1&ye[e])}function _e(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new be(i)}}function we(t,e=`unexpected ${JSON.stringify(t)}`){_e(!t,e)}ye[160]=ye[5760]=ye[6158]=ye[8192]=ye[8193]=ye[8194]=ye[8195]=ye[8196]=ye[8197]=ye[8198]=ye[8199]=ye[8200]=ye[8201]=ye[8202]=ye[8232]=ye[8233]=ye[8239]=ye[8287]=ye[12288]=4,ye[8220]=ye[8221]=128;class ke extends jt{equals(t){return!(t instanceof ke)&&(It(t=Ut(t))||Qt(t)?0===t.length:!!Zt(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof ke}}class $e extends ke{equals(t){return!1===t||(!!Gt(Ut(t))||(It(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof $e}}class Se extends jt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class Te{constructor(){this.buffer=""}write(t){this.buffer+=Ft(t)}}class Ce{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Ee{constructor(){this.buffer=""}write(t){"string"!=typeof(t=Ut(t))&&""===this.buffer?this.buffer=t:this.buffer=Ft(this.buffer)+Ft(t)}}class Ae extends jt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Te;return yield this.superBlockRender(t),t.buffer}}function Oe(t){return t&&Rt(t.equals)&&Rt(t.gt)&&Rt(t.geq)&&Rt(t.lt)&&Rt(t.leq)}const Le=new class extends jt{equals(t){return Gt(Ut(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},je={true:!0,false:!1,nil:Le,null:Le,empty:new ke,blank:new $e};function ze(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&xe(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var qe=function(){return qe=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},qe.apply(this,arguments)};function Pe(t,e,i,s){return new(i||(i=Promise))(function(e,a){function r(t){try{o(s.next(t))}catch(e){a(e)}}function n(t){try{o(s.throw(t))}catch(e){a(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof i?s:new i(function(t){t(s)})).then(r,n)}o((s=s.apply(t,[])).next())})}function Ie(t){return Pe(this,0,void 0,function*(){if(!Dt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);i=r.done,e=r.value,s="next";try{Dt(e)&&(e=Ie(e)),Nt(e)&&(e=yield e)}catch(a){s="throw",e=a}}while(!i);return e})}function Re(t){if(!Dt(t))return t;let e,i=!1,s="next";do{const r=t[s](e);if(i=r.done,e=r.value,s="next",Dt(e))try{e=Re(e)}catch(a){s="throw",e=a}}while(!i);return e}const Ne=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function De(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function Fe(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=De(t)[i];return e+t.getDate()}function Me(t,e){const i=Fe(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const He={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},Ue=new Set("aAbBceklpP");function Be(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),a=i%60;return(t.getTimezoneOffset()>0?"-":"+")+ee(s,2,"0")+(e.flags[":"]?":":"")+ee(a,2,"0")}const Ve={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>Fe(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return ie(t,e,i,(t,e)=>t+e)}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>Me(t,0),w:t=>t.getDay(),W:t=>Me(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:Be,Z:(t,e)=>t.getTimeZoneName()||Be(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function Je(t,e){let i,s="",a=e;for(;i=Ne.exec(a);)s+=a.slice(0,i.index),a=a.slice(i.index+i[0].length),s+=Ge(t,i);return s+a}function Ge(t,e){const[i,s="",a,r,n]=e,o=Ve[n];if(!o)return i;const l={};for(const h of s)l[h]=!0;let d=String(o(t,{flags:l,width:a,modifier:r})),c=Ue.has(n)?" ":"0",p=a||He[n]||0;var u;return l["^"]?d=d.toUpperCase():l["#"]&&(u=d,d=[...u].some(t=>t>="a"&&t<="z")?u.toUpperCase():u.toLowerCase()),l._?c=" ":l[0]&&(c="0"),l["-"]&&(p=0),ee(d,p,c)}function Ke(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}Ve.h=Ve.b;const Qe=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ye=We.map(t=>t.slice(0,3)),Xe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ze=Xe.map(t=>t.slice(0,3));class ti{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Ke(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=It(i)?ti.getTimezoneOffset(i,this.date):i,this.timezoneName=It(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),a=this.date.getTime()+s;this.displayDate=new Date(a)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:We[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Ye[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:Xe[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ze[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(Qe);if(i&&"Z"===i[1])return new ti(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,a,r]=i,n=("+"===s?-1:1)*(60*parseInt(a,10)+parseInt(r,10));return new ti(+new Date(t),e,n)}return new ti(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),a=new Date(i);return(+new Date(s)-+a)/6e4}}class ei{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=+t||0,_e(this.base+t<=this.limit,this.message),this.base+=t}check(t){_e((t=+t||0)<=this.limit,this.message)}}class ii extends Lt{constructor(t,[e,i],s,a,r,n,o,l){super(t,s,a,r,l),this.trimLeft=!1,this.trimRight=!1;const d="-"===s[e],c="-"===s[i-1];let p=d?e+1:e,u=c?i-1:i;for(;p<u&&4&ye[s.charCodeAt(p)];)p++;for(;u>p&&4&ye[s.charCodeAt(u-1)];)u--;this.contentRange=[p,u],this.trimLeft=d||n,this.trimRight=c||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class si extends ii{constructor(t,e,i,s,a){const{trimTagLeft:r,trimTagRight:n,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[d,c]=[e+o.length,i-l.length];super(xs.Tag,[d,c],t,e,i,r,n,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class ai extends ii{constructor(t,e,i,s,a){const{trimOutputLeft:r,trimOutputRight:n,outputDelimiterLeft:o,outputDelimiterRight:l}=s,d=[e+o.length,i-l.length];super(xs.Output,d,t,e,i,r,n,a)}}class ri extends Lt{constructor(t,e,i,s){super(xs.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class ni extends Lt{constructor(t,e,i,s){super(xs.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class oi extends Lt{constructor(t,e,i,s){super(xs.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class li extends Lt{constructor(t,e,i,s){super(xs.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=je[this.literal]}}const di={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},ci={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class pi extends Lt{constructor(t,e,i,s){super(xs.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in di?di[t]:1}}class ui extends Lt{constructor(t,e,i,s,a,r){super(xs.PropertyAccess,i,s,a,r),this.variable=t,this.props=e}}class hi extends Lt{constructor(t,e,i,s,a,r){super(xs.Filter,i,s,a,r),this.name=t,this.args=e}}class gi extends Lt{constructor(t,e,i,s,a,r){super(xs.Hash,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=a,this.file=r}}const vi=/[\da-fA-F]/,mi=/[0-7]/,bi={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function fi(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class yi extends Lt{constructor(t,e,i,s){super(xs.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==bi[t[i+1]])e+=bi[t[++i]];else if("u"===t[i+1]){let s=0,a=i+2;for(;a<=i+5&&vi.test(t[a]);)s=16*s+fi(t[a++]);i=a-1,e+=String.fromCharCode(s)}else if(mi.test(t[i+1])){let s=i+1,a=0;for(;s<=i+3&&mi.test(t[s]);)a=8*a+fi(t[s++]);i=s-1,e+=String.fromCharCode(a)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class xi extends Lt{constructor(t,e,i,s,a,r){super(xs.Range,t,e,i,r),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=a,this.file=r}}class _i extends ii{constructor(t,e,i,s,a){super(xs.Tag,[e,i],t,e,i,!1,!1,a),this.tokenizer=new Wi(t,s.operators,a,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class wi extends Lt{constructor(t,e,i,s,a,r){super(xs.FilteredValue,i,s,a,r),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=a,this.file=r}}const ki={now:()=>Date.now()};function $i(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||ki}class Si{renderTemplatesToNodeStream(t,e){const i=new Ce;return Promise.resolve().then(()=>Ie(this.renderTemplates(t,e,i))).then(()=>i.end(),t=>i.error(t)),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new Ee:new Te);const s=[];for(const r of t){e.renderLimit.check($i().now());try{const t=yield r.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(a){const t=ce.is(a)?a:new he(a,r);if(!e.opts.catchAllErrors)throw t;s.push(t)}}if(s.length)throw new ge(s);return i.buffer}}class Ti{constructor(t){this.postfix=[...Ei(t)]}*evaluate(t,e){_e(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Cs(s)){const e=i.pop();let a;if(1===ci[s.operator])a=yield t.opts.operators[s.operator](e,t);else{const r=i.pop();a=yield t.opts.operators[s.operator](r,e,t)}i.push(a)}else i.push(yield Ci(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*Ci(t,e,i=!1){if(t)return"content"in t?t.content:js(t)?yield function*(t,e,i){const s=[];for(const r of t.props)s.push(yield Ci(r,e,!1));try{if(t.variable){const a=yield Ci(t.variable,e,i);return yield e._getFromScope(a,s)}return yield e._get(s)}catch(a){if(i&&"InternalUndefinedVariableError"===a.name)return null;throw new ve(a,t)}}(t,e,i):qs(t)?yield function*(t,e){const i=yield Ci(t.lhs,e),s=yield Ci(t.rhs,e);return e.memoryLimit.use(s-i+1),te(+i,+s+1)}(t,e):void 0}function*Ei(t){const e=[];for(const i of t)if(Cs(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function Ai(t,e){return!Oi(t,e)}function Oi(t,e){return t=Ut(t),e.opts.jsTruthy?!t:!1===t||null==t}const Li={"==":ji,"!=":(t,e)=>!ji(t,e),">":(t,e)=>Oe(t)?t.gt(e):Oe(e)?e.lt(t):Ut(t)>Ut(e),"<":(t,e)=>Oe(t)?t.lt(e):Oe(e)?e.gt(t):Ut(t)<Ut(e),">=":(t,e)=>Oe(t)?t.geq(e):Oe(e)?e.leq(t):Ut(t)>=Ut(e),"<=":(t,e)=>Oe(t)?t.leq(e):Oe(e)?e.geq(t):Ut(t)<=Ut(e),contains:(t,e)=>Qt(t=Ut(t))?t.some(t=>ji(t,e)):!!Rt(null==t?void 0:t.indexOf)&&t.indexOf(Ut(e))>-1,not:(t,e)=>Oi(Ut(t),e),and:(t,e,i)=>Ai(Ut(t),i)&&Ai(Ut(e),i),or:(t,e,i)=>Ai(Ut(t),i)||Ai(Ut(e),i)};function ji(t,e){return Oe(t)?t.equals(e):Oe(e)?e.equals(t):(t=Ut(t),e=Ut(e),Qt(t)?Qt(e)&&function(t,e){return t.length===e.length&&!t.some((t,i)=>!ji(t,e[i]))}(t,e):t===e)}let zi=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class qi{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new zi("HEAD",null,null,null),this.tail=new zi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new zi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function Pi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const a=document.createElement("a");a.href=e;const r=a.href;return s.removeChild(i),r}var Ii=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Xt(t)&&(t+="/"),Pi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(t,e,s)=>{const a=s.split("/").pop();return/\.\w+$/.test(a)?t:e+s+i})},readFile:function(t){return Pe(this,0,void 0,function*(){return new Promise((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()})})},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return Pe(this,0,void 0,function*(){return!0})},existsSync:function(t){return!0},dirname:function(t){return Pi(t,".")},sep:"/"});function Ri(t,e=0){return JSON.stringify(t,null,e)}var Ni={default:function(t,e,...i){return Qt(t=Ut(t))||It(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(Oi(t,this.context)?e:t)},raw:{raw:!0,handler:se},jsonify:Ri,to_integer:function(t){return Number(t)},json:Ri,inspect:function(t,e=0){const i=[];return JSON.stringify(t,function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)},e)}};const Di={"&":"&","<":"<",">":">",'"':""","'":"'"},Fi={"&":"&","<":"<",">":">",""":'"',"'":"'"};function Mi(t){return t=Ft(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,t=>Di[t])}function Hi(t){return t=Ft(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,t=>Fi[t])}var Ui=Object.freeze({__proto__:null,escape:Mi,xml_escape:function(t){return Mi.call(this,t)},escape_once:function(t){return Mi.call(this,Hi.call(this,t))},newline_to_br:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class Bi{constructor(t){this.mapping=t,this.sep="/"}exists(t){return Pe(this,0,void 0,function*(){return this.existsSync(t)})}existsSync(t){return!Gt(this.mapping[t])}readFile(t){return Pe(this,0,void 0,function*(){return this.readFileSync(t)})}readFileSync(t){const e=this.mapping[t];if(Gt(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const a of e.split(this.sep))"."!==a&&""!==a&&(".."===a?(s.length>1||""!==s[0])&&s.pop():s.push(a));return s.join(this.sep)}}const Vi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:Ii,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:Li,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function Ji(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new qi(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new qi(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},Vi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=Gi(t.root),t.partials=Gi(t.partials),t.layouts=Gi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?Mi:"json"===s?Ni.json:(_e(Rt(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Ke())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new Bi(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function Gi(t){let e=[];return Qt(t)&&(e=t),It(t)&&(e=[t]),e}function Ki(t,e){if(!t||!Es(t))return;const i=e?4:16;for(;ye[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function Qi(t,e){if(!t||!Es(t))return;const i=e?4:16;for(;ye[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Wi{constructor(t,e=Vi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=ze(e),this.literalTrie=ze(je)}readExpression(){return new Ti(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new pi(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&xe(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new wi(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),()=>`unexpected character ${this.snapshot()}`)}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new hi(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const a=t[s];Ts(a)&&(!i&&a.trimLeft&&Ki(t[s-1],e.greedy),As(a)&&("raw"===a.name?i=!0:"endraw"===a.name&&(i=!1)),!i&&a.trimRight&&Qi(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some(t=>this.match(t));)++this.p;return new ri(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const a=new si(i,s,this.p,t,e);return"raw"===a.name&&(this.rawBeginAt=s),a}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=Vi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,a=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(a)} not closed`,a);return new ai(i,a,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let a=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===a?(this.rawBeginAt=-1,new si(this.input,s,e,t,this.file)):(this.p=a,new ri(this.input,s,a,this.file))}if(this.rmatch(e))break;this.p++}else a=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=Vi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new _i(this.input,e,i,t,this.file)}error(t,e=this.p){return new pe(t,new oi(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify((e=this.input.slice(t,this.N),i=32,e.length>i?e.slice(0,i-3)+"...":e));var e,i}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&xe(this.peek());)++this.p;return new oi(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const a=It(t)?t:t?"=":":";return this.peek()===a&&(++this.p,s=this.readValue()),new gi(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new ui(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new ui(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;){if("["===this.peek()){this.p++;const t=this.readValue()||new oi(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t);continue}if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."===this.peek()&&"."!==this.peek(1)){this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t);continue}break}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!xe(this.peek(i))){const t=new ni(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new li(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new xi(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new yi(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:ye[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Yi{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(As(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class Xi{constructor(t){this.token=t}}class Zi extends Xi{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class ts{constructor(t,e){this.hash={};const i=t instanceof Wi?t:new Wi(t,{});for(const s of i.readHashes(e))this.hash[s.name.content]=s.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield Ci(this.hash[i],t));return e}}function es(t){return Qt(t)}class is{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=Rt(e)?e:Rt(null==e?void 0:e.handler)?e.handler:se,this.raw=!Rt(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const s of this.args)es(s)?i.push([s[0],yield Ci(s[1],e)]):i.push(yield Ci(s,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class ss{constructor(t,e){this.filters=[];const i="string"==typeof t?new Wi(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map(t=>new is(t,this.getFilter(e,t.name),e))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const s of this.filters)i=yield s.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return _e(i||!t.options.strictFilters,()=>`undefined filter: ${e}`),i}}class as extends Xi{constructor(t,e){var i;super(t);const s=new Wi(t.input,e.options.operators,t.file,t.contentRange);this.value=new ss(s.readFilteredValue(),e);const a=this.value.filters,r=e.options.outputEscape;if(!(null===(i=a[a.length-1])||void 0===i?void 0:i.raw)&&r){const t=new hi(toString.call(r),[],"",0,0);a.push(new is(t,r,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class rs extends Xi{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class ns{constructor(t,e){this.segments=t,this.location=e}toString(){return bs(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof ns?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class os{constructor(){this.map=new Map}get(t){const e=bs([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(bs([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const ls={partials:!0};function*ds(t,e,i){const s=new os,a=new os,r=new os,n=new us(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];It(t)&&!n.has(t)&&a.push(i)}else{const i=t.segments[0];It(i)&&!e.has(i)&&a.push(t)}for(const s of t.segments)s instanceof ns&&l(s,e)}function*d(t,s){if(t.arguments)for(const e of t.arguments())for(const t of hs(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();r.push(new ns([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const a=t.partialScope();if(void 0===a){for(const a of yield t.children(e,i))yield d(a,s);return}if(o.has(a.name))return;const r=new Set,n=a.isolated?new us(r):s.push(r);for(const t of a.scope)if(It(t))r.add(t);else{const[e,i]=t;r.add(e);const s=Array.from(hs(i));s.length&&n.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield d(s,n),o.add(a.name);n.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const a of yield t.children(e,i))yield d(a,s);t.blockScope&&s.pop()}}for(const c of t)yield d(c,n);return{variables:s.asObject(),globals:a.asObject(),locals:r.asObject()}}function cs(t,e={}){return Ie(ds(t,Object.assign(Object.assign({},ls),e).partials,!1))}function ps(t,e={}){return Re(ds(t,Object.assign(Object.assign({},ls),e).partials,!0))}class us{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!It(e))return;const i=this.getAlias(e);return void 0!==i?new ns([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*hs(t){Ps(t)?yield*gs(t):t instanceof ss&&(yield*function*(t){for(const e of t.initial.postfix)Ps(e)&&(yield*gs(e));for(const e of t.filters)for(const t of e.args)es(t)&&t[1]?yield*gs(t[1]):Ps(t)&&(yield*gs(t))}(t))}function*gs(t){qs(t)?(yield*gs(t.lhs),yield*gs(t.rhs)):js(t)&&(yield vs(t))}function vs(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,Os(s)||Ls(s)||zs(s)?e.push(s.content):js(s)&&e.push(...vs(s).segments);for(const n of t.props.slice(1))i=i||n.file,Os(n)||Ls(n)||zs(n)?e.push(n.content):js(n)&&e.push(vs(n));const[a,r]=t.getPosition();return new ns(e,{row:a,col:r,file:i})}const ms=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function bs(t,e=!1){const i=[],s=t[0];It(s)&&(!e||s.match(ms)?i.push(`${s}`):i.push(`['${s}']`));for(const a of t.slice(1))a instanceof ns?i.push(`[${bs(a.segments)}]`):It(a)?a.match(ms)?i.push(`.${a}`):i.push(`['${a}']`):i.push(`[${a}]`);return i.join("")}var fs,ys,xs,_s,ws,ks;(ys=fs||(fs={})).Partials="partials",ys.Layouts="layouts",ys.Root="root";class $s{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;_e(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map(t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:a}=this.options,r=this.options[e];for(const n of this.candidates(t,r,s,e!==fs.Root))if(i?a.existsSync(n):yield a.exists(n))return n;throw this.lookupError(t,r)}*candidates(t,e,i,s){const{fs:a,extname:r}=this.options;if(this.shouldLoadRelative(t)&&i){const n=a.resolve(this.dirname(i),t,r);for(const t of e)if(!s||this.contains(t,n)){yield n;break}}for(const n of e){const e=a.resolve(n,t,r);s&&!this.contains(n,e)||(yield e)}if(void 0!==a.fallback){const e=a.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return _e(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class Ss{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new $s(this.liquid.options),this.parseLimit=new ei("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Wi(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(a){if(!this.liquid.options.catchAllErrors)throw a;s.push(a)}if(s.length)throw new ge(s);return i}parseToken(t,e){try{if(As(t)){const i=this.liquid.tags[t.name];return _e(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return Is(t)===xs.Output?new as(t,this.liquid):new rs(t)}catch(i){if(ce.is(i))throw i;throw new ue(i,t)}}parseStream(t){return new Yi(t,(t,e)=>this.parseToken(t,e))}*_parseFileCached(t,e,i=fs.Root,s){const a=this.cache,r=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,n=yield a.read(r);if(n)return n;const o=this._parseFile(t,e,i,s),l=e?yield o:Ie(o);a.write(r,l);try{return yield l}catch(d){throw a.remove(r),d}}*_parseFile(t,e,i=fs.Root,s){const a=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(a):yield this.fs.readFile(a),a)}}function Ts(t){return!!(Is(t)&xs.Delimited)}function Cs(t){return Is(t)===xs.Operator}function Es(t){return Is(t)===xs.HTML}function As(t){return Is(t)===xs.Tag}function Os(t){return Is(t)===xs.Quoted}function Ls(t){return Is(t)===xs.Number}function js(t){return Is(t)===xs.PropertyAccess}function zs(t){return Is(t)===xs.Word}function qs(t){return Is(t)===xs.Range}function Ps(t){return(1667&Is(t))>0}function Is(t){return t?t.kind:-1}(_s=xs||(xs={}))[_s.Number=1]="Number",_s[_s.Literal=2]="Literal",_s[_s.Tag=4]="Tag",_s[_s.Output=8]="Output",_s[_s.HTML=16]="HTML",_s[_s.Filter=32]="Filter",_s[_s.Hash=64]="Hash",_s[_s.PropertyAccess=128]="PropertyAccess",_s[_s.Word=256]="Word",_s[_s.Range=512]="Range",_s[_s.Quoted=1024]="Quoted",_s[_s.Operator=2048]="Operator",_s[_s.FilteredValue=4096]="FilteredValue",_s[_s.Delimited=12]="Delimited";class Rs{constructor(t={},e=Vi,i={},{memoryLimit:s,renderLimit:a}={}){var r,n,o,l,d;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(r=i.globals)&&void 0!==r?r:e.globals,this.environments=Zt(t)?t:Object(t),this.strictVariables=null!==(n=i.strictVariables)&&void 0!==n?n:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new ei("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=a?a:new ei("template render",$i().now()+(null!==(d=i.renderLimit)&&void 0!==d?d:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map(t=>[t,this.getRegister(t)])}restoreRegister(t){return t.forEach(([t,e])=>this.setRegister(t,e))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,e)=>qe(t,e),{})}get(t){return this.getSync(t)}getSync(t){return Re(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return Re(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){It(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield this.readProperty(t,e[s]),i&&Kt(t))throw new me(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new Rs(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const i=this.scopes[e];if(t in i)return i}return t in this.environments?this.environments:this.globals}readProperty(t,e){if(t=Jt(t),e=Ut(e),Gt(t))return t;if(Qt(t)&&e<0)return t[t.length+ +e];const i=function(t,e,i){return!i||Pt.call(t,e)||t instanceof jt?t[e]:void 0}(t,e,this.ownPropertyOnly);return void 0===i&&t instanceof jt?t.liquidMethodMissing(e,this):Rt(i)?i.call(t):"size"===e?function(t){if(Pt.call(t,"size")||void 0!==t.size)return t.size;if(Qt(t)||It(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return Qt(t)?t[0]:t.first}(t):"last"===e?function(t){return Qt(t)?t[t.length-1]:t.last}(t):i}}(ks=ws||(ws={}))[ks.OUTPUT=0]="OUTPUT",ks[ks.STORE=1]="STORE";const Ns=ne(Math.abs),Ds=ne(Math.max),Fs=ne(Math.min),Ms=ne(Math.ceil),Hs=ne((t,e,i=!1)=>i?Math.floor(t/e):t/e),Us=ne(Math.floor),Bs=ne((t,e)=>t-e),Vs=ne((t,e)=>t+e),Js=ne((t,e)=>t%e),Gs=ne((t,e)=>t*e);var Ks=Object.freeze({__proto__:null,abs:Ns,at_least:Ds,at_most:Fs,ceil:Ms,divided_by:Hs,floor:Us,minus:Bs,plus:Vs,modulo:Js,times:Gs,round:function(t,e=0){t=Bt(t),e=Bt(e);const i=Math.pow(10,e);return Math.round(t*i)/i}});const Qs=/[^\p{M}\p{L}\p{Nd}]+/gu,Ws={raw:/\s+/g,default:Qs,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:Qs,none:null};var Ys=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(Ft(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(Ft(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(Ft(t)).replace(/%20/g,"+").replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()),uri_escape:t=>encodeURI(Ft(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=Ft(t);const s=Ws[e];return s&&("latin"===e&&(t=function(t){return t.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(t)),t=t.replace(s,"-").replace(/^-|-$/g,"")),i?t:t.toLowerCase()}});const Xs=re(function(t,e){const i=Ht(t),s=Gt(e)?" ":Ft(e),a=i.length*(1+s.length);return this.context.memoryLimit.use(a),i.join(s)}),Zs=re(t=>Wt(t)?Xt(t):""),ta=re(t=>Wt(t)?t[0]:""),ea=re(function(t){const e=Ht(t);return this.context.memoryLimit.use(e.length),[...e].reverse()});function ia(t,e=[]){const i=Ht(t),s=Ht(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function sa(t){return this.context.opts.jekyllWhere?e=>{return ke.is(t)?ji(e,t):Qt(e)?(i=t,e.some(t=>ji(t,i))):ji(e,t);var i}:void 0===t?t=>Ai(t,this.context):e=>ji(e,t)}function*aa(t,e,i,s){const a=[];e=Ht(e),this.context.memoryLimit.use(e.length);const r=new Wi(Ft(i)).readScopeValue();for(const o of e)a.push(yield Ci(r,this.context.spawn(o)));const n=sa.call(this,s);return e.filter((e,i)=>n(a[i])===t)}function*ra(t,e,i,s){const a=[],r=new ss(Ft(s),this.liquid),n=Ht(e);this.context.memoryLimit.use(n.length);for(const o of n){this.context.push({[i]:o});const e=yield r.value(this.context);this.context.pop(),e===t&&a.push(o)}return a}function*na(t,e,i){const s=new Wi(Ft(e)).readScopeValue(),a=Ht(t),r=sa.call(this,i);for(let n=0;n<a.length;n++){if(r(yield Ci(s,this.context.spawn(a[n]))))return[n,a[n]]}}function*oa(t,e,i){const s=new ss(Ft(i),this.liquid),a=Ht(t);for(let r=0;r<a.length;r++){this.context.push({[e]:a[r]});const t=yield s.value(this.context);if(this.context.pop(),t)return[r,a[r]]}}var la=Object.freeze({__proto__:null,join:Xs,last:Zs,first:ta,reverse:ea,sort:function*(t,e){const i=[],s=Ht(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push([a,e?yield this.context._getFromScope(a,Ft(e).split("."),!1):a]);return i.sort((t,e)=>{const i=t[1],s=e[1];return i<s?-1:i>s?1:0}).map(t=>t[0])},sort_natural:function(t,e){const i=Ft(e),s=void 0===e?ae:(t,e)=>ae(t[i],e[i]),a=Ht(t);return this.context.memoryLimit.use(a.length),[...a].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=Ht(t);this.context.memoryLimit.use(s.length);for(const a of s)i.push(yield this.context._getFromScope(a,Ft(e),!1));return i},sum:function*(t,e){let i=0;const s=Ht(t);for(const a of s){const t=Number(e?yield this.context._getFromScope(a,Ft(e),!1):a);i+=Number.isNaN(t)?0:t}return i},compact:function(t){const e=Ht(t);return this.context.memoryLimit.use(e.length),e.filter(t=>!Gt(Ut(t)))},concat:ia,push:function(t,e){return ia.call(this,t,[e])},unshift:function(t,e){const i=Ht(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...Ht(t)];return e.pop(),e},shift:function(t){const e=Ht(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return Gt(t=Ut(t))?[]:(Qt(t)||(t=Ft(t)),e=e<0?t.length+e:e,this.context.memoryLimit.use(i),t.slice(e,e+i))},where:function*(t,e,i){return yield*aa.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*aa.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*ra.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*ra.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=Mt(t);const s=new Wi(Ft(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const a of t){const t=yield Ci(s,this.context.spawn(a));i.has(t)||i.set(t,[]),i.get(t).push(a)}return[...i.entries()].map(([t,e])=>({name:t,items:e}))},group_by_exp:function*(t,e,i){const s=new Map,a=new ss(Ft(i),this.liquid);t=Mt(t),this.context.memoryLimit.use(t.length);for(const r of t){this.context.push({[e]:r});const t=yield a.value(this.context);this.context.pop(),s.has(t)||s.set(t,[]),s.get(t).push(r)}return[...s.entries()].map(([t,e])=>({name:t,items:e}))},has:function*(t,e,i){return!!(yield*na.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*oa.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*oa.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*na.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*oa.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=Ht(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(Gt(t=Ut(t)))return[];Qt(t)||(t=Ft(t)),this.context.memoryLimit.use(e);const i=[...t].sort(()=>Math.random()-.5);return 1===e?i[0]:i.slice(0,e)}});function da(t,e,i){var s,a,r;const n=(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(a=null==e?void 0:e.length)&&void 0!==a?a:0)+(null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0);this.context.memoryLimit.use(n);const o=pa(t,this.context.opts,i);return o?Je(o,e=Gt(e=Ut(e))?this.context.opts.dateFormat:Ft(e)):t}function ca(t,e,i,s){const a=pa(t,this.context.opts);if(!a)return t;if("ordinal"===i){const t=a.getDate();return Je(a,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return Je(a,`%d ${e} %Y`)}function pa(t,e,i){let s;const a=null!=i?i:e.timezoneOffset,r=e.locale;return s="now"===(t=Ut(t))||"today"===t?new ti(Date.now(),r,a):Vt(t)?new ti(1e3*t,r,a):It(t)?/^\d+$/.test(t)?new ti(1e3*+t,r,a):e.preserveTimezones&&void 0===i?ti.createDateFixedToTimezone(t,r):new ti(t,r,a):new ti(t,r,a),s.valid()?s:void 0}var ua=Object.freeze({__proto__:null,date:da,date_to_xmlschema:function(t){return da.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return da.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return ca.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return ca.call(this,t,"%B",e,i)}});const ha=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,ga=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var va=Object.freeze({__proto__:null,append:function(t,e){_e(2===arguments.length,"append expect 2 arguments");const i=Ft(t),s=Ft(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){_e(2===arguments.length,"prepend expect 2 arguments");const i=Ft(t),s=Ft(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=Ft(t);return this.context.memoryLimit.use(i.length),e?(e=oe(Ft(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),Ft(e).toUpperCase()},remove:function(t,e){const i=Ft(t);return this.context.memoryLimit.use(i.length),i.split(Ft(e)).join("")},remove_first:function(t,e){const i=Ft(t);return this.context.memoryLimit.use(i.length),i.replace(Ft(e),"")},remove_last:function(t,e){const i=Ft(t);this.context.memoryLimit.use(i.length);const s=Ft(e),a=i.lastIndexOf(s);return-1===a?i:i.substring(0,a)+i.substring(a+s.length)},rstrip:function(t,e){return t=Ft(t),this.context.memoryLimit.use(t.length),e?(e=oe(Ft(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=Ft(t);this.context.memoryLimit.use(i.length);const s=i.split(Ft(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=Ft(t);return this.context.memoryLimit.use(i.length),e?(e=oe(Ft(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=Ft(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=Ft(t);return this.context.memoryLimit.use(s.length),s.split(Ft(e)).join(i)},replace_first:function(t,e,i){const s=Ft(t);return this.context.memoryLimit.use(s.length),s.replace(Ft(e),i)},replace_last:function(t,e,i){const s=Ft(t);this.context.memoryLimit.use(s.length);const a=Ft(e),r=s.lastIndexOf(a);if(-1===r)return s;const n=Ft(i);return s.substring(0,r)+n+s.substring(r+a.length)},truncate:function(t,e=50,i="..."){const s=Ft(t);return this.context.memoryLimit.use(s.length),s.length<=e?t:s.substring(0,e-i.length)+i},truncatewords:function(t,e=15,i="..."){const s=Ft(t);this.context.memoryLimit.use(s.length);const a=s.split(/\s+/);e<=0&&(e=1);let r=a.slice(0,e).join(" ");return a.length>=e&&(r+=i),r},normalize_whitespace:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=Ft(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(ha)||[]).length+(t.match(ga)||[]).length;case"auto":return ha.test(t)?t.match(ha).length+(t.match(ga)||[]).length:t.split(/\s+/).length;default:return t.split(/\s+/).length}},array_to_sentence_string:function(t,e="and"){switch(this.context.memoryLimit.use(t.length),t.length){case 0:return"";case 1:return t[0];case 2:return`${t[0]} ${e} ${t[1]}`;default:return`${t.slice(0,-1).join(", ")}, ${e} ${t[t.length-1]}`}}});var ma=Object.freeze({__proto__:null,base64_encode:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),function(t){return btoa(String.fromCharCode(...(new TextEncoder).encode(t)))}(e)},base64_decode:function(t){const e=Ft(t);return this.context.memoryLimit.use(e.length),function(t){return(new TextDecoder).decode(Uint8Array.from(atob(t),t=>t.charCodeAt(0)))}(e)}});const ba=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ui),Ks),Ys),la),ua),va),ma),Ni);const fa=["offset","limit","reversed"];function ya(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(Os(e)){return xa(i.parse(e.content))}return e}const s=[...t.readFileNameTemplate(e.options)],a=xa(i.parseTokens(s));return"none"===a?void 0:a}function xa(t){return 1===t.length&&Es(t[0].token)?t[0].token.getContent():t}function*_a(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield Ci(t,e)}class wa extends Se{constructor(t,e,i,s){super(t,i,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const ka={assign:class extends Zi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new ss(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Zi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier(),r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if(!a.size()||"in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.hash=new ts(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:else",t=>{we(t.args),o=this.elseTemplates}).on("tag:endfor",t=>{we(t.args),l.stop()}).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){const i=this.liquid.renderer;let s=Mt(yield Ci(this.collection,t));if(!s.length)return void(yield i.renderTemplates(this.elseTemplates,t,e));const a="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(a)});const r=yield this.hash.render(t);t.pop();s=(this.liquid.options.orderedFilterParameters?Object.keys(r).filter(t=>fa.includes(t)):fa.filter(t=>void 0!==r[t])).reduce((t,e)=>{return"offset"===e?(i=t,s=r.offset,i.slice(s)):"limit"===e?function(t,e){return t.slice(0,e)}(t,r.limit):function(t){return[...t].reverse()}(t);var i,s},s),t.setRegister(a,(r.offset||0)+s.length);const n={forloop:new Se(s.length,this.collection.getText(),this.variable)};t.push(n);for(const o of s){if(n[this.variable]=o,t.continueCalled=t.breakCalled=!1,yield i.renderTemplates(this.templates,t,e),t.breakCalled)break;n.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Zi{constructor(t,e,i,s){for(super(t,e,i),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const t=e.shift();if(As(t)&&"endcapture"===t.name)return;this.templates.push(s.parseToken(t,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content)return t;if(t=this.tokenizer.readQuoted(),t)return t;throw this.tokenizer.error("invalid capture name")}*render(t){const e=this.liquid.renderer,i=yield e.renderTemplates(this.templates,t);t.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Zi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new ss(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let a=[],r=0;const n=s.parseStream(e).on("tag:when",t=>{if(r>0)return;a=[];const e=[];for(;!t.tokenizer.end();)e.push(t.tokenizer.readValueOrThrow()),t.tokenizer.skipBlank(),","===t.tokenizer.peek()?t.tokenizer.readTo(","):t.tokenizer.readTo("or");this.branches.push({values:e,templates:a})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endcase",()=>n.stop()).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});n.start()}*render(t,e){const i=this.liquid.renderer,s=Ut(yield this.value.value(t,t.opts.lenientIf));let a=!1;for(const r of this.branches)for(const n of r.values){if(ji(s,yield Ci(n,t,t.opts.lenientIf))){yield i.renderTemplates(r.templates,t,e),a=!0;break}}a||(yield i.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap(t=>t.values)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}},comment:class extends Zi{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(As(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends Zi{constructor(t,e,i,s){super(t,e,i);const{tokenizer:a}=t;this.file=ya(a,this.liquid,s),this.currentFile=t.file;const r=a.p;"with"===a.readIdentifier().content?(a.skipBlank(),":"!==a.peek()?this.withVar=a.readValue():a.p=r):a.p=r,this.hash=new ts(a,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:a}=this,{renderer:r}=i,n=yield _a(this.file,t,i);_e(n,()=>`illegal file path "${n}"`);const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",ws.OUTPUT);const l=yield s.render(t);a&&(l[n]=yield Ci(a,t));const d=yield i._parsePartialFile(n,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:l}:l),yield r.renderTemplates(d,t,e),t.pop(),t.restoreRegister(o)}*children(t,e){return t&&It(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(It(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(Ps),Ps(this.file)&&(yield this.file),Ps(this.withVar)&&(yield this.withVar)}},render:class extends Zi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer;for(this.file=ya(a,this.liquid,s),this.currentFile=t.file;!a.end();){a.skipBlank();const t=a.p,e=a.readIdentifier();if(("with"===e.content||"for"===e.content)&&(a.skipBlank(),":"!==a.peek())){const t=a.readValue();if(t){const i=a.p;let s;"as"===a.readIdentifier().content?s=a.readIdentifier():a.p=i,this[e.content]={value:t,alias:s&&s.content},a.skipBlank(),","===a.peek()&&a.advance();continue}}a.p=t;break}this.hash=new ts(a,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,a=yield _a(this.file,t,i);_e(a,()=>`illegal file path "${a}"`);const r=t.spawn(),n=r.bottom();if(qe(n,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;n[i||a]=yield Ci(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=Mt(yield Ci(s,t));n.forloop=new Se(l.length,s.getText(),o);for(const t of l){n[o]=t;const s=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(s,r,e),n.forloop.next()}}else{const t=yield i._parsePartialFile(a,r.sync,this.currentFile);yield i.renderer.renderTemplates(t,r,e)}}*children(t,e){return t&&It(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(It(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;It(i)?t.push([i,e]):It(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;It(i)?t.push([i,e]):It(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))Ps(t)&&(yield t);if(this.with){const{value:t}=this.with;Ps(t)&&(yield t)}if(this.for){const{value:t}=this.for;Ps(t)&&(yield t)}}},decrement:class extends Zi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0),e.write(Ft(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Zi{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;Vt(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(Ft(s))}*localScope(){yield this.identifier}},cycle:class extends Zi{constructor(t,e,i){super(t,e,i),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(":"===this.tokenizer.peek()?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const t=this.tokenizer.readValue();t&&this.candidates.push(t),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,()=>`empty candidates: "${t.getText()}"`)}*render(t,e){const i=`cycle:${yield Ci(this.group,t)}:`+this.candidates.join(","),s=t.getRegister("cycle");let a=s[i];void 0===a&&(a=s[i]=0);const r=this.candidates[a];return a=(a+1)%this.candidates.length,s[i]=a,yield Ci(r,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Zi{constructor(t,e,i,s){super(t,e,i),this.branches=[];let a=[];s.parseStream(e).on("start",()=>this.branches.push({value:new ss(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})).on("tag:elsif",t=>{_e(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new ss(t.tokenizer.readFilteredValue(),this.liquid),templates:a=[]})}).on("tag:else",t=>{we(t.args),_e(!this.elseTemplates,"duplicated else"),a=this.elseTemplates=[]}).on("tag:endif",function(t){we(t.args),this.stop()}).on("template",t=>a.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,templates:a}of this.branches){if(Ai(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(a,t,e))}yield i.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},layout:class extends Zi{constructor(t,e,i,s){super(t,e,i),this.file=ya(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new ts(this.tokenizer,i.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:i,args:s,file:a}=this,{renderer:r}=i;if(void 0===a)return t.setRegister("blockMode",ws.OUTPUT),void(yield r.renderTemplates(this.templates,t,e));const n=yield _a(this.file,t,i);_e(n,()=>`illegal file path "${n}"`);const o=yield i._parseLayoutFile(n,t.sync,this.currentFile);t.setRegister("blockMode",ws.STORE);const l=yield r.renderTemplates(this.templates,t),d=t.getRegister("blocks");void 0===d[""]&&(d[""]=(t,e)=>e.write(l)),t.setRegister("blockMode",ws.OUTPUT),t.push(yield s.render(t)),yield r.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&It(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))Ps(t)&&(yield t);Ps(this.file)&&(yield this.file)}partialScope(){if(It(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Zi{constructor(t,e,i,s){super(t,e,i),this.templates=[];const a=/\w+/.exec(t.args);for(this.block=a?a[0]:"";e.length;){const t=e.shift();if(As(t)&&"endblock"===t.name)return;const i=s.parseToken(t,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const i=this.getBlockRender(t);t.getRegister("blockMode")===ws.STORE?t.getRegister("blocks")[this.block]=i:yield i(new Ae,e)}getBlockRender(t){const{liquid:e,templates:i}=this,s=t.getRegister("blocks")[this.block],a=function*(s,a){t.push({block:s}),yield e.renderer.renderTemplates(i,t,a),t.pop()};return s?(t,e)=>s(new Ae(e=>a(t,e)),e):a}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Zi{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(As(t)&&"endraw"===t.name)return;this.tokens.push(t)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map(t=>t.getText()).join("")}},tablerow:class extends Zi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const r=this.tokenizer.readIdentifier(),n=this.tokenizer.readValue();if("in"!==r.content||!n)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=a.content,this.collection=n,this.args=new ts(this.tokenizer,i.options.keyValueSeparator),this.templates=[];const l=s.parseStream(e).on("start",()=>o=this.templates).on("tag:endtablerow",()=>l.stop()).on("template",t=>o.push(t)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});l.start()}*render(t,e){let i=Mt(yield Ci(this.collection,t));const s=yield this.args.render(t),a=s.offset||0,r=void 0===s.limit?i.length:s.limit;i=i.slice(a,a+r);const n=s.cols||i.length,o=this.liquid.renderer,l=new wa(i.length,n,this.collection.getText(),this.variable),d={tablerowloop:l};t.push(d);for(let c=0;c<i.length;c++,l.next())d[this.variable]=i[c],0===l.col0()&&(1!==l.row()&&e.write("</tr>"),e.write(`<tr class="row${l.row()}">`)),e.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,t,e),e.write("</td>");i.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))Ps(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Zi{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[];let a=[],r=0;s.parseStream(e).on("start",()=>this.branches.push({value:new ss(t.tokenizer.readFilteredValue(),this.liquid),test:Oi,templates:a=[]})).on("tag:elsif",t=>{r>0?a=[]:this.branches.push({value:new ss(t.tokenizer.readFilteredValue(),this.liquid),test:Ai,templates:a=[]})}).on("tag:else",()=>{r++,a=this.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",t=>{a===this.elseTemplates&&1!==r||a.push(t)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,test:a,templates:r}of this.branches){if(a(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(r,t,e))}yield i.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap(t=>t.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}},break:class extends Zi{render(t,e){t.breakCalled=!0}},continue:class extends Zi{render(t,e){t.continueCalled=!0}},echo:class extends Zi{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new ss(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const i=yield this.value.value(t,!1);e.write(i)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Zi{constructor(t,e,i,s){super(t,e,i);const a=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(a)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}},"#":class extends Zi{constructor(t,e,i){if(super(t,e,i),-1!==t.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class $a{constructor(t={}){this.renderer=new Si,this.filters={},this.tags={},this.options=Ji(t),this.parser=new Ss(this),Yt(ka,(t,e)=>this.registerTag(e,t)),Yt(ba,(t,e)=>this.registerFilter(e,t))}parse(t,e){return new Ss(this).parse(t,e)}_render(t,e,i){const s=e instanceof Rs?e:new Rs(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return Pe(this,0,void 0,function*(){return Ie(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderSync(t,e,i){return Re(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new Rs(e,this.options,i);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,i){const s=this.parse(t);return this._render(s,e,i)}parseAndRender(t,e,i){return Pe(this,0,void 0,function*(){return Ie(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}parseAndRenderSync(t,e,i){return Re(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new Ss(this).parseFile(t,e,fs.Partials,i)}_parseLayoutFile(t,e,i){return new Ss(this).parseFile(t,e,fs.Layouts,i)}_parseFile(t,e,i,s){return new Ss(this).parseFile(t,e,i,s)}parseFile(t,e){return Pe(this,0,void 0,function*(){return Ie(new Ss(this).parseFile(t,!1,e))})}parseFileSync(t,e){return Re(new Ss(this).parseFile(t,!0,e))}*_renderFile(t,e,i){const s=yield this._parseFile(t,i.sync,i.lookupType);return yield this._render(s,e,i)}renderFile(t,e,i){return Pe(this,0,void 0,function*(){return Ie(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))})}renderFileSync(t,e,i){return Re(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return Pe(this,0,void 0,function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)})}_evalValue(t,e){const i=new ss(t,this),s=e instanceof Rs?e:new Rs(e,this.options);return i.value(s)}evalValue(t,e){return Pe(this,0,void 0,function*(){return Ie(this._evalValue(t,e))})}evalValueSync(t,e){return Re(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){var i;this.tags[t]=Rt(e)?e:(i=e,class extends Zi{constructor(t,e,s){super(t,e,s),Rt(i.parse)&&i.parse.call(this,t,e)}*render(t,e){const s=yield new ts(this.token.args,t.opts.keyValueSeparator).render(t);return yield i.render.call(this,t,e,s)}})}plugin(t){return t.call(this,$a)}express(){const t=this;let e=!0;return function(i,s,a){if(e){e=!1;const i=Gi(this.root);t.options.root.unshift(...i),t.options.layouts.unshift(...i),t.options.partials.unshift(...i)}t.renderFile(i,s).then(t=>a(null,t),a)}}analyze(t,e={}){return Pe(this,0,void 0,function*(){return cs(t,e)})}analyzeSync(t,e={}){return ps(t,e)}parseAndAnalyze(t,e,i={}){return Pe(this,0,void 0,function*(){return cs(this.parse(t,e),i)})}parseAndAnalyzeSync(t,e,i={}){return ps(this.parse(t,e),i)}variables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Object.keys(i.variables)})}variablesSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))})}fullVariablesSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap(t=>t.map(t=>String(t)))))}variableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Array.from(le(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))})}variableSegmentsSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Array.from(le(Object.values(i.variables).flatMap(t=>t.map(t=>t.toArray()))))}globalVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Object.keys(i.globals)})}globalVariablesSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))})}globalFullVariablesSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap(t=>t.map(t=>String(t)))))}globalVariableSegments(t,e={}){return Pe(this,0,void 0,function*(){const i=yield cs(It(t)?this.parse(t):t,e);return Array.from(le(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))})}globalVariableSegmentsSync(t,e={}){const i=ps(It(t)?this.parse(t):t,e);return Array.from(le(Object.values(i.globals).flatMap(t=>t.map(t=>t.toArray()))))}}const Sa=new class{constructor(){this.context=null,this.flattenedContext=null,this.history=[],this.maxHistory=50,this.engine=new $a({strictFilters:!1,strictVariables:!1,lenientIf:!0}),this._registerShopifyFilters()}_registerShopifyFilters(){this.engine.registerFilter("money",t=>"$"+(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_without_currency",t=>(Number(t)/100).toFixed(2)),this.engine.registerFilter("money_with_currency",t=>{var e,i,s;const a=Number(t)/100,r=(null==(s=null==(i=null==(e=this.context)?void 0:e.objects)?void 0:i.shop)?void 0:s.currency)||"USD";return"$"+a.toFixed(2)+" "+r}),this.engine.registerFilter("type_of",t=>null==t?"nil":Array.isArray(t)?"array":typeof t),this.engine.registerFilter("json_pretty",t=>JSON.stringify(t,null,2)),this.engine.registerFilter("asset_url",t=>`/assets/${t}`),this.engine.registerFilter("img_url",(t,e="medium")=>"string"==typeof t?t:(null==t?void 0:t.src)||""),this.engine.registerFilter("handle",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("handleize",t=>String(t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")),this.engine.registerFilter("pluralize",(t,e,i)=>1===t?e:i||e+"s"),this.engine.registerFilter("within",(t,e)=>e&&e.url?`${e.url}${t}`:t),this.engine.registerFilter("link_to",(t,e,i="")=>`<a href="${e}" title="${i}">${t}</a>`),this.engine.registerFilter("link_to_tag",(t,e=null)=>`<a href="/collections/all/${t}">${t}</a>`),this.engine.registerFilter("link_to_vendor",t=>`<a href="/collections/vendors?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("link_to_type",t=>`<a href="/collections/types?q=${encodeURIComponent(t)}">${t}</a>`),this.engine.registerFilter("highlight",(t,e)=>{if(!e)return t;const i=new RegExp(`(${e})`,"gi");return String(t).replace(i,"<strong>$1</strong>")}),this.engine.registerFilter("metafield_value",t=>t&&"object"==typeof t&&"value"in t?t.value:t)}setContext(t){this.context=t,this.flattenedContext=null}_buildLiquidContext(){var t,e,i,s;if(!this.context)return{};const a=mt.currentCart,r=bt.currentProduct,n={...this.context.objects||{},...a?{cart:a}:{},...r?{product:r}:{},template:null==(t=this.context.meta)?void 0:t.template,request:null==(e=this.context.meta)?void 0:e.request,theme:null==(i=this.context.meta)?void 0:i.theme,localization:null==(s=this.context.meta)?void 0:s.localization,settings:this.context.settings};if(this.context.metafields)for(const[o,l]of Object.entries(this.context.metafields))if(n[o]){const t={};for(const[e,i]of Object.entries(l)){t[e]={};for(const[s,a]of Object.entries(i))t[e][s]=(null==a?void 0:a.value)??a}n[o]={...n[o],metafields:t}}return n}async evaluate(t){if(!t||!t.trim())return{success:!1,error:"Empty expression",expression:t};const e=t.trim(),i=this._buildLiquidContext();try{if(/^[\w.\[\]0-9]+$/.test(e)&&!e.includes("{%")&&!e.includes("{{")&&!e.includes("|")){const t=this._resolvePath(e,i);return this.addToHistory(e),{success:!0,value:t,expression:e}}let t=e;e.includes("{%")||e.includes("{{")||(t=`{{ ${e} }}`);const s=await this.engine.parseAndRender(t,i);this.addToHistory(e);return{success:!0,value:this._parseResult(s.trim()),expression:e}}catch(s){return{success:!1,error:s.message,expression:e}}}_resolvePath(t,e){if(!e)return;const i=t.replace(/\[(\d+)\]/g,".$1").split(".").filter(t=>""!==t);let s=e;for(const a of i){if(null==s)return;s=s[a]}return s}_parseResult(t){if(""===t)return"";if(""===t||"nil"===t||"null"===t)return null;if("true"===t)return!0;if("false"===t)return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}"))try{return JSON.parse(t)}catch{}return t}getCompletions(t){if(!this.context)return[];let e=t.replace(/^\{\{\s*/,"").replace(/\s*\}\}$/,"").trim();const i=e.match(/\{%\s*(\w+)?\s*$/);if(i)return this._getTagCompletions(i[1]||"");const s=e.lastIndexOf("|");if(-1!==s){const t=e.slice(s+1).trim();if(""===t||/^\w*$/.test(t))return this._getFilterCompletions(t)}const a=e.match(/^(.+\[\d+\])\.(\w*)$/);if(a){const t=a[1],e=a[2];return this._getDynamicCompletions(t,e)}const r=this._getAllPaths(),n=e.toLowerCase();return r.filter(t=>t.path.toLowerCase().startsWith(n)).slice(0,20).map(t=>({value:t.path,type:t.type,preview:t.preview}))}_getDynamicCompletions(t,e){const i=this._buildLiquidContext(),s=this._resolvePath(t,i);if(null==s||"object"!=typeof s)return[];const a=[],r=e.toLowerCase();for(const[n,o]of Object.entries(s))if(n.toLowerCase().startsWith(r)){const e=`${t}.${n}`;let i="property",s=o;Array.isArray(o)?(i="array",s=`[${o.length} items]`):"object"==typeof o&&null!==o?(i="object",s=`{${Object.keys(o).length} keys}`):"string"==typeof o?(i="string",s=o.length>50?o.substring(0,50)+"...":o):"number"==typeof o?i="number":"boolean"==typeof o&&(i="boolean"),a.push({value:e,type:i,preview:s})}return a.slice(0,20)}_getTagCompletions(t){const e=t.toLowerCase();return[{value:"if",type:"tag",preview:"Conditional"},{value:"elsif",type:"tag",preview:"Else if"},{value:"else",type:"tag",preview:"Else"},{value:"endif",type:"tag",preview:"End if"},{value:"unless",type:"tag",preview:"Negative conditional"},{value:"endunless",type:"tag",preview:"End unless"},{value:"case",type:"tag",preview:"Switch statement"},{value:"when",type:"tag",preview:"Case option"},{value:"endcase",type:"tag",preview:"End case"},{value:"for",type:"tag",preview:"Loop"},{value:"endfor",type:"tag",preview:"End loop"},{value:"break",type:"tag",preview:"Exit loop"},{value:"continue",type:"tag",preview:"Skip iteration"},{value:"assign",type:"tag",preview:"Assign variable"},{value:"capture",type:"tag",preview:"Capture output"},{value:"endcapture",type:"tag",preview:"End capture"},{value:"increment",type:"tag",preview:"Increment counter"},{value:"decrement",type:"tag",preview:"Decrement counter"},{value:"comment",type:"tag",preview:"Comment block"},{value:"endcomment",type:"tag",preview:"End comment"},{value:"raw",type:"tag",preview:"Raw output"},{value:"endraw",type:"tag",preview:"End raw"},{value:"render",type:"tag",preview:"Render snippet"},{value:"section",type:"tag",preview:"Render section"},{value:"form",type:"tag",preview:"Form tag"},{value:"endform",type:"tag",preview:"End form"},{value:"paginate",type:"tag",preview:"Pagination"},{value:"endpaginate",type:"tag",preview:"End pagination"}].filter(t=>t.value.startsWith(e)).slice(0,15)}_getFilterCompletions(t){const e=t.toLowerCase();return[{value:"append",preview:"Append string"},{value:"prepend",preview:"Prepend string"},{value:"capitalize",preview:"Capitalize first letter"},{value:"downcase",preview:"Convert to lowercase"},{value:"upcase",preview:"Convert to uppercase"},{value:"strip",preview:"Trim whitespace"},{value:"lstrip",preview:"Trim left whitespace"},{value:"rstrip",preview:"Trim right whitespace"},{value:"strip_html",preview:"Remove HTML tags"},{value:"strip_newlines",preview:"Remove newlines"},{value:"newline_to_br",preview:"Convert newlines to <br>"},{value:"replace",preview:"Replace substring"},{value:"replace_first",preview:"Replace first occurrence"},{value:"remove",preview:"Remove substring"},{value:"remove_first",preview:"Remove first occurrence"},{value:"truncate",preview:"Truncate to length"},{value:"truncatewords",preview:"Truncate to word count"},{value:"split",preview:"Split into array"},{value:"slice",preview:"Extract substring"},{value:"escape",preview:"HTML escape"},{value:"escape_once",preview:"HTML escape once"},{value:"url_encode",preview:"URL encode"},{value:"url_decode",preview:"URL decode"},{value:"base64_encode",preview:"Base64 encode"},{value:"base64_decode",preview:"Base64 decode"},{value:"handle",preview:"Convert to handle"},{value:"handleize",preview:"Convert to handle"},{value:"abs",preview:"Absolute value"},{value:"ceil",preview:"Round up"},{value:"floor",preview:"Round down"},{value:"round",preview:"Round to precision"},{value:"plus",preview:"Add number"},{value:"minus",preview:"Subtract number"},{value:"times",preview:"Multiply"},{value:"divided_by",preview:"Divide"},{value:"modulo",preview:"Remainder"},{value:"at_least",preview:"Minimum value"},{value:"at_most",preview:"Maximum value"},{value:"join",preview:"Join array"},{value:"first",preview:"Get first element"},{value:"last",preview:"Get last element"},{value:"size",preview:"Get length"},{value:"reverse",preview:"Reverse array"},{value:"sort",preview:"Sort array"},{value:"sort_natural",preview:"Natural sort"},{value:"uniq",preview:"Remove duplicates"},{value:"map",preview:"Extract property"},{value:"where",preview:"Filter array"},{value:"compact",preview:"Remove nil values"},{value:"concat",preview:"Concatenate arrays"},{value:"date",preview:"Format date"},{value:"default",preview:"Default if nil"},{value:"json",preview:"Convert to JSON"},{value:"json_pretty",preview:"Pretty JSON"},{value:"type_of",preview:"Get type"},{value:"money",preview:"Format as money"},{value:"money_with_currency",preview:"Money with currency"},{value:"money_without_currency",preview:"Money without currency"},{value:"asset_url",preview:"Asset URL"},{value:"img_url",preview:"Image URL"},{value:"link_to",preview:"Create link"},{value:"pluralize",preview:"Pluralize word"},{value:"highlight",preview:"Highlight text"},{value:"metafield_value",preview:"Get metafield value"}].filter(t=>t.value.startsWith(e)).slice(0,15).map(t=>({...t,type:"filter"}))}_getAllPaths(){var t,e,i,s,a,r,n,o;if(!this.flattenedContext){const a=[];if(null==(t=this.context)?void 0:t.objects)for(const[t,e]of Object.entries(this.context.objects))null!=e&&"cart"!==t&&"product"!==t&&this._addPaths(a,t,e,3);if((null==(e=this.context)?void 0:e.meta)&&(this._addPaths(a,"template",this.context.meta.template,2),this._addPaths(a,"request",this.context.meta.request,2),this._addPaths(a,"theme",this.context.meta.theme,2)),null==(i=this.context)?void 0:i.metafields)for(const[t,e]of Object.entries(this.context.metafields))if(e&&(null==(s=this.context.objects)?void 0:s[t]))for(const[i,s]of Object.entries(e))for(const[e,r]of Object.entries(s))a.push({path:`${t}.metafields.${i}.${e}`,type:(null==r?void 0:r.type)||"metafield",preview:null==r?void 0:r.value});this.flattenedContext=a}const l=[...this.flattenedContext],d=mt.currentCart;d?this._addPaths(l,"cart",d,3):(null==(r=null==(a=this.context)?void 0:a.objects)?void 0:r.cart)&&this._addPaths(l,"cart",this.context.objects.cart,3);const c=bt.currentProduct;return c?this._addPaths(l,"product",c,3):(null==(o=null==(n=this.context)?void 0:n.objects)?void 0:o.product)&&this._addPaths(l,"product",this.context.objects.product,3),l}_addPaths(t,e,i,s,a=0){if(a>=s||null==i)return;const r=Array.isArray(i)?"array":typeof i;if(t.push({path:e,type:r,preview:this._getPreview(i)}),"object"!=typeof i||Array.isArray(i))Array.isArray(i)&&i.length>0&&this._addPaths(t,`${e}[0]`,i[0],s,a+1);else for(const[n,o]of Object.entries(i))n.startsWith("_")||this._addPaths(t,`${e}.${n}`,o,s,a+1)}_getPreview(t){return null==t?"null":"string"==typeof t?t.length>50?t.slice(0,50)+"...":t:"number"==typeof t||"boolean"==typeof t?t:Array.isArray(t)?`Array(${t.length})`:"object"==typeof t?`Object(${Object.keys(t).length})`:String(t)}addToHistory(t){this.history[this.history.length-1]!==t&&(this.history.push(t),this.history.length>this.maxHistory&&(this.history=this.history.slice(-this.maxHistory)))}getHistory(){return[...this.history]}clearHistory(){this.history=[]}};class Ta extends ot{constructor(){super(),this.liquidErrors=[],this.evalLogs=[],this.expandedLogs=new Set,this.inputValue="",this.historyIndex=-1,this.suggestions=[],this.selectedSuggestion=-1,this.showSuggestions=!1,this.context=null}connectedCallback(){super.connectedCallback(),this._scanForLiquidErrors()}updated(t){super.updated(t),t.has("context")&&this.context&&Sa.setContext(this.context)}willUpdate(t){t.has("context")&&this.context&&!Sa.context&&Sa.setContext(this.context)}_scanForLiquidErrors(){const t=[],e=new Set,i=(i,s,a=null)=>{const r=i.trim();e.has(r)||(e.add(r),t.push({id:Date.now()+Math.random(),type:"liquid",category:s,message:r,timestamp:new Date,element:a?this._getElementPath(a):null}))},s=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;s.nextNode();){const t=s.currentNode.textContent;(t.includes("Liquid error")||t.includes("Liquid syntax error"))&&i(t,"comment")}const a=document.body.innerHTML;[{pattern:/Liquid\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,category:"inline"},{pattern:/Liquid\s+error:\s*[^<\n]+/gi,category:"inline"},{pattern:/Liquid\s+syntax\s+error\s*\(line\s*\d+\):\s*[^<\n]+/gi,category:"inline"},{pattern:/Liquid\s+syntax\s+error:\s*[^<\n]+/gi,category:"inline"},{pattern:/Error\s+in\s+schema:\s*[^<\n]+/gi,category:"schema"},{pattern:/Invalid\s+JSON\s+in\s+schema\s+tag/gi,category:"schema"},{pattern:/Error\s+parsing\s+schema:\s*[^<\n]+/gi,category:"schema"}].forEach(({pattern:t,category:e})=>{let s;for(;null!==(s=t.exec(a));)i(s[0],e)});const r=/\{"error"\s*:\s*"([^"]+)"\}/gi;let n;for(;null!==(n=r.exec(a));){const t=n[1];i(`JSON filter error: ${t} — This occurs when using | json on objects that cannot be serialized`,"json")}const o=/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/gi;let l;for(;null!==(l=o.exec(a));){const t=l[1];i(`Raw ${t} Drop object rendered: ${l[0]} — Use .title, .url, or other property instead of outputting the object directly`,"drop")}const d=/\b(Shop|Product|Collection|Cart|Customer|Article|Blog|Page|Variant|Image|Metafield|Address|Order|LineItem|Fulfillment|Transaction|Country|Currency|Locale|Market|Policy|Section|Block|Theme|Font|Link|Linklist|Comment|Form|Paginate|TableRow|ForLoop)Drop\b/g;let c;for(;null!==(c=d.exec(a));){const t=c[1];i(`Raw ${t}Drop object rendered on page — Use a property like .title, .name, .url instead of outputting {{ ${t.toLowerCase()} }} directly`,"drop")}const p=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;const i=t.parentElement;if(!i)return NodeFilter.FILTER_REJECT;const s=null==(e=i.tagName)?void 0:e.toLowerCase();return"script"===s||"style"===s||"noscript"===s?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;p.nextNode();){const t=p.currentNode.textContent;if(/Liquid\s+(error|syntax error)/i.test(t)){const e=t.match(/Liquid\s+(?:error|syntax error)[^]*/i);e&&i(e[0],"text",p.currentNode.parentElement)}if(/#<\w+Drop:0x/i.test(t)){const e=t.match(/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/i);e&&i(`Raw ${e[1]} Drop object in page: ${e[0]}`,"drop",p.currentNode.parentElement)}/unknown\s+image\s+file/i.test(t)&&i(`Unknown image file error: ${t.substring(0,200)}`,"asset",p.currentNode.parentElement)}document.querySelectorAll("img").forEach(t=>{const e=t.src||t.dataset.src,s=t.alt;s&&/Liquid\s+error|Could\s+not\s+find\s+asset/i.test(s)&&i(`Image error: ${s}`,"asset",t),e&&/Liquid%20error|Could%20not%20find/i.test(e)&&i(`Broken image URL contains error: ${decodeURIComponent(e.substring(0,200))}`,"asset",t)});document.querySelectorAll(".shopify-section, [data-section-type], .template-").forEach(t=>{const e=t.textContent;if(/form\s+'product'\s+needs\s+a\s+product\s+object/i.test(e)&&i("Liquid error: form 'product' needs a product object","form",t),/form\s+'customer_address'\s+requires\s+an\s+address/i.test(e)&&i("Liquid error: form 'customer_address' requires an address","form",t),/invalid\s+form\s+type/i.test(e)){const s=e.match(/invalid\s+form\s+type\s*['"]?(\w+)['"]?/i);i(`Liquid error: invalid form type '${(null==s?void 0:s[1])||"unknown"}'`,"form",t)}}),this.liquidErrors=t}_getElementPath(t){var e;if(!t)return null;const i=[];let s=t;for(;s&&s!==document.body&&i.length<5;){let t=(null==(e=s.tagName)?void 0:e.toLowerCase())||"";if(s.id)t+=`#${s.id}`;else if(s.className&&"string"==typeof s.className){const e=s.className.split(" ").filter(t=>t&&!t.startsWith("js-")).slice(0,2);e.length&&(t+=`.${e.join(".")}`)}t&&i.unshift(t),s=s.parentElement}return i.join(" > ")}_clearEvalLogs(){this.evalLogs=[]}_toggleExpand(t){const e=new Set(this.expandedLogs);e.has(t)?e.delete(t):e.add(t),this.expandedLogs=e}_handleInputKeydown(t){switch(t.key){case"Enter":if(t.shiftKey)return;t.preventDefault(),this.showSuggestions&&this.selectedSuggestion>=0?this._selectSuggestion(this.selectedSuggestion):this._evaluateExpression();break;case"ArrowUp":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion<=0?this.suggestions.length-1:this.selectedSuggestion-1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtFirstLine(t.target)||(t.preventDefault(),this._navigateHistory(-1));break;case"ArrowDown":this.showSuggestions&&this.suggestions.length>0?(t.preventDefault(),this.selectedSuggestion=this.selectedSuggestion>=this.suggestions.length-1?0:this.selectedSuggestion+1,this._scrollSuggestionIntoView()):this.inputValue.includes("\n")&&!this._isAtLastLine(t.target)||(t.preventDefault(),this._navigateHistory(1));break;case"Tab":if(this.showSuggestions&&this.suggestions.length>0){t.preventDefault();const e=this.selectedSuggestion>=0?this.selectedSuggestion:0;this._selectSuggestion(e)}break;case"Escape":this.showSuggestions&&(t.preventDefault(),this.showSuggestions=!1,this.selectedSuggestion=-1)}}_isAtFirstLine(t){const e=t.selectionStart;return!t.value.substring(0,e).includes("\n")}_isAtLastLine(t){const e=t.selectionStart;return!t.value.substring(e).includes("\n")}_scrollSuggestionIntoView(){this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".autocomplete-dropdown"),e=this.shadowRoot.querySelector(".autocomplete-item--selected");t&&e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})})}_handleInput(t){this.inputValue=t.target.value,this.historyIndex=-1,this._updateSuggestions(),this._autoGrowTextarea(t.target)}_autoGrowTextarea(t){t.style.height="auto",t.style.height=Math.min(t.scrollHeight,150)+"px"}_updateSuggestions(){if(!this.inputValue.trim())return this.suggestions=[],this.showSuggestions=!1,void(this.selectedSuggestion=-1);this.suggestions=Sa.getCompletions(this.inputValue),this.showSuggestions=this.suggestions.length>0,this.selectedSuggestion=-1}_selectSuggestion(t){const e=this.suggestions[t];if(!e)return;const i=this.inputValue.lastIndexOf("|");-1!==i&&"filter"===e.type?this.inputValue=this.inputValue.slice(0,i+1)+" "+e.value:this.inputValue=e.value,this.showSuggestions=!1,this.selectedSuggestion=-1,this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-input");t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length),this._autoGrowTextarea(t))})}_navigateHistory(t){const e=Sa.getHistory();0!==e.length&&(-1===t?this.historyIndex<e.length-1&&(this.historyIndex++,this.inputValue=e[e.length-1-this.historyIndex]):this.historyIndex>0?(this.historyIndex--,this.inputValue=e[e.length-1-this.historyIndex]):0===this.historyIndex&&(this.historyIndex=-1,this.inputValue=""),this.showSuggestions=!1)}async _evaluateExpression(){if(!this.inputValue.trim())return;const t=this.inputValue;this.inputValue="",this.historyIndex=-1,this.showSuggestions=!1;const e=await Sa.evaluate(t),i={id:Date.now()+Math.random(),type:"eval",expression:e.expression,result:e.success?e.value:null,error:e.success?null:e.error,success:e.success,timestamp:new Date};this.evalLogs=[...this.evalLogs,i],this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(".console-content");t&&(t.scrollTop=t.scrollHeight)})}_formatTime(t){return t instanceof Date||(t=new Date(t)),isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_renderEvalResult(t){if(!t.success)return U`<span class="eval-result eval-result--error">${t.error}</span>`;const e=t.result;return void 0===e?U`<span class="eval-result eval-result--undefined">undefined</span>`:null===e?U`<span class="eval-result eval-result--null">null</span>`:"string"==typeof e?U`<span class="eval-result eval-result--string">"${e}"</span>`:"number"==typeof e?U`<span class="eval-result eval-result--number">${e}</span>`:"boolean"==typeof e?U`<span class="eval-result eval-result--boolean">${e}</span>`:"object"==typeof e?U`
|
|
2967
3336
|
<div class="eval-result">
|
|
2968
3337
|
<tdt-object-inspector .data=${e} .path=${"result"}></tdt-object-inspector>
|
|
2969
3338
|
</div>
|
|
2970
|
-
`:U`<span class="eval-result">${String(e)}</span>`}
|
|
2971
|
-
<div class="log-content">
|
|
2972
|
-
${this._renderTable(t.args[0],t.tableColumns)}
|
|
2973
|
-
</div>
|
|
2974
|
-
`;if(t.hasObjects){const e=t.args.filter(t=>"object"==typeof t&&null!==t);return U`
|
|
2975
|
-
<div class="log-content">
|
|
2976
|
-
${e.map(t=>U`
|
|
2977
|
-
<tdt-object-inspector .data=${t} .path=${"console"}></tdt-object-inspector>
|
|
2978
|
-
`)}
|
|
2979
|
-
${t.stack?U`<pre class="log-stack">${t.stack}</pre>`:""}
|
|
2980
|
-
${t.source?U`<div class="log-source">Source: <a href="#">${t.source}</a></div>`:""}
|
|
2981
|
-
</div>
|
|
2982
|
-
`}return t.stack||t.source?U`
|
|
2983
|
-
<div class="log-content">
|
|
2984
|
-
${t.stack?U`<pre class="log-stack">${t.stack}</pre>`:""}
|
|
2985
|
-
${t.source?U`<div class="log-source">Source: ${t.source}</div>`:""}
|
|
2986
|
-
</div>
|
|
2987
|
-
`:null}_renderTable(t,e){if(!t)return null;let i=Array.isArray(t)?t:Object.entries(t).map(([t,e])=>({"(index)":t,...e}));if(0===i.length)return U`<span class="preview">Empty table</span>`;let s=new Set;i.forEach(t=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(t=>s.add(t))});let a=e?e.filter(t=>s.has(t)):Array.from(s);return a.includes("(index)")||(a=["(index)",...a]),U`
|
|
2988
|
-
<table class="log-table">
|
|
2989
|
-
<thead>
|
|
2990
|
-
<tr>
|
|
2991
|
-
${a.map(t=>U`<th>${t}</th>`)}
|
|
2992
|
-
</tr>
|
|
2993
|
-
</thead>
|
|
2994
|
-
<tbody>
|
|
2995
|
-
${i.map((t,e)=>U`
|
|
2996
|
-
<tr>
|
|
2997
|
-
${a.map(i=>{if("(index)"===i)return U`<td>${t["(index)"]??e}</td>`;const s=t&&"object"==typeof t?t[i]:t;return U`<td>${this._formatTableValue(s)}</td>`})}
|
|
2998
|
-
</tr>
|
|
2999
|
-
`)}
|
|
3000
|
-
</tbody>
|
|
3001
|
-
</table>
|
|
3002
|
-
`}_formatTableValue(t){if(null===t)return"null";if(void 0===t)return"undefined";if("object"==typeof t)try{return JSON.stringify(t)}catch{return"[Object]"}return String(t)}_renderGroupChildren(t){return t&&0!==t.length?U`
|
|
3003
|
-
<div class="log-group-children">
|
|
3004
|
-
${t.map(t=>this._renderLogItem(t))}
|
|
3005
|
-
</div>
|
|
3006
|
-
`:null}_renderNetworkErrors(){const t=this._getFilteredNetworkErrors();return 0===t.length?null:U`
|
|
3339
|
+
`:U`<span class="eval-result">${String(e)}</span>`}_renderLiquidErrors(){if(0===this.liquidErrors.length)return null;return U`
|
|
3007
3340
|
<div class="liquid-section">
|
|
3008
|
-
<div class="section-title">
|
|
3009
|
-
${
|
|
3010
|
-
<div class="log-item log-item--
|
|
3011
|
-
<div class="log-header" @click=${()=>this._toggleExpand(t.id)}>
|
|
3012
|
-
<span class="log-type log-type--
|
|
3013
|
-
<span class="
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
<div class="log-content">
|
|
3019
|
-
<dl class="network-details">
|
|
3020
|
-
<dt>URL</dt>
|
|
3021
|
-
<dd>${t.url}</dd>
|
|
3022
|
-
<dt>Method</dt>
|
|
3023
|
-
<dd>${t.method}</dd>
|
|
3024
|
-
<dt>Status</dt>
|
|
3025
|
-
<dd>${t.status} ${t.statusText}</dd>
|
|
3026
|
-
<dt>Duration</dt>
|
|
3027
|
-
<dd>${t.duration.toFixed(2)}ms</dd>
|
|
3028
|
-
<dt>Type</dt>
|
|
3029
|
-
<dd>${t.type}</dd>
|
|
3030
|
-
</dl>
|
|
3031
|
-
</div>
|
|
3032
|
-
`:""}
|
|
3033
|
-
</div>
|
|
3034
|
-
`})}
|
|
3035
|
-
</div>
|
|
3036
|
-
`}_renderLogItem(t){var e;const i=this._getGroupKey(t),s=this.groupedErrors.get(i),a=(null==s?void 0:s.count)||1,r=this.expandedLogs.has(t.id),n=t.hasObjects||t.stack||t.source||t.isTable||"group"===t.type;return"eval"===t.type?U`
|
|
3037
|
-
<div class="log-item log-item--eval">
|
|
3038
|
-
<div class="log-header">
|
|
3039
|
-
<span class="log-type log-type--eval">EVAL</span>
|
|
3040
|
-
<span class="log-message">
|
|
3041
|
-
<span class="eval-expression">${t.expression}</span>
|
|
3042
|
-
</span>
|
|
3043
|
-
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3044
|
-
</div>
|
|
3045
|
-
<div class="log-content">
|
|
3046
|
-
${this._renderEvalResult(t)}
|
|
3047
|
-
</div>
|
|
3048
|
-
</div>
|
|
3049
|
-
`:"group"===t.type?U`
|
|
3050
|
-
<div class="log-item log-item--group">
|
|
3051
|
-
<div class="log-header" @click=${()=>this._toggleExpand(t.id)}>
|
|
3052
|
-
<span class="log-type log-type--group">GROUP</span>
|
|
3053
|
-
<span class="log-message">${t.message}</span>
|
|
3054
|
-
${(null==(e=t.children)?void 0:e.length)?U`<span class="log-count">${t.children.length} items</span>`:""}
|
|
3055
|
-
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3056
|
-
</div>
|
|
3057
|
-
${r||!t.collapsed?this._renderGroupChildren(t.children):""}
|
|
3058
|
-
</div>
|
|
3059
|
-
`:U`
|
|
3060
|
-
<div class="log-item log-item--${t.type}${t.isTable?" log-item--table":""}">
|
|
3061
|
-
<div class="log-header" @click=${()=>n&&this._toggleExpand(t.id)}>
|
|
3062
|
-
<span class="log-type log-type--${t.isTable?"info":t.type}">${t.isTable?"TABLE":t.type}</span>
|
|
3063
|
-
<span class="log-message">${t.message}</span>
|
|
3064
|
-
${a>1?U`<span class="log-count">${a}</span>`:""}
|
|
3065
|
-
${t.persisted?U`<span class="persist-indicator">from previous page</span>`:""}
|
|
3066
|
-
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3067
|
-
</div>
|
|
3068
|
-
${r?this._renderLogContent(t):""}
|
|
3069
|
-
</div>
|
|
3070
|
-
`}_renderLiquidErrors(){if(0===this.liquidErrors.length)return null;return U`
|
|
3071
|
-
<div class="liquid-section">
|
|
3072
|
-
<div class="section-title">Liquid Errors Found on Page (${this.liquidErrors.length})</div>
|
|
3073
|
-
${this.liquidErrors.map(t=>{const e=this.expandedLogs.has(t.id),i=t.element||"drop"===t.category;return U`
|
|
3074
|
-
<div class="log-item ${(t=>{switch(t){case"drop":return"log-item--drop";case"asset":return"log-item--asset";case"schema":return"log-item--schema";default:return"log-item--liquid"}})(t.category)}">
|
|
3075
|
-
<div class="log-header" @click=${()=>i&&this._toggleExpand(t.id)}>
|
|
3076
|
-
<span class="log-type ${(t=>{switch(t){case"drop":return"log-type--drop";case"asset":return"log-type--asset";case"schema":return"log-type--schema";default:return"log-type--liquid"}})(t.category)}">${(t=>{switch(t){case"drop":return"DROP";case"asset":return"ASSET";case"schema":return"SCHEMA";case"form":return"FORM";default:return"LIQUID"}})(t.category)}</span>
|
|
3077
|
-
<span class="log-message">${t.message}</span>
|
|
3078
|
-
${t.category&&"inline"!==t.category?U`
|
|
3079
|
-
<span class="liquid-category">${t.category}</span>
|
|
3080
|
-
`:""}
|
|
3081
|
-
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3341
|
+
<div class="section-title">Liquid Errors Found on Page (${this.liquidErrors.length})</div>
|
|
3342
|
+
${this.liquidErrors.map(t=>{const e=this.expandedLogs.has(t.id),i=t.element||"drop"===t.category||"json"===t.category;return U`
|
|
3343
|
+
<div class="log-item ${(t=>{switch(t){case"drop":return"log-item--drop";case"asset":return"log-item--asset";case"schema":return"log-item--schema";case"json":return"log-item--json";default:return"log-item--liquid"}})(t.category)}">
|
|
3344
|
+
<div class="log-header" @click=${()=>i&&this._toggleExpand(t.id)}>
|
|
3345
|
+
<span class="log-type ${(t=>{switch(t){case"drop":return"log-type--drop";case"asset":return"log-type--asset";case"schema":return"log-type--schema";case"json":return"log-type--json";default:return"log-type--liquid"}})(t.category)}">${(t=>{switch(t){case"drop":return"DROP";case"asset":return"ASSET";case"schema":return"SCHEMA";case"json":return"JSON";case"form":return"FORM";default:return"LIQUID"}})(t.category)}</span>
|
|
3346
|
+
<span class="log-message">${t.message}</span>
|
|
3347
|
+
${t.category&&"inline"!==t.category?U`
|
|
3348
|
+
<span class="liquid-category">${t.category}</span>
|
|
3349
|
+
`:""}
|
|
3350
|
+
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3082
3351
|
</div>
|
|
3083
3352
|
${e?U`
|
|
3084
3353
|
<div class="log-content">
|
|
@@ -3113,123 +3382,61 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3113
3382
|
<div class="liquid-hint">
|
|
3114
3383
|
Add a check before dividing: <code>{% if divisor != 0 %}{{ value | divided_by: divisor }}{% endif %}</code>
|
|
3115
3384
|
</div>
|
|
3385
|
+
`:"json"===t.category?U`
|
|
3386
|
+
<div class="liquid-hint">
|
|
3387
|
+
The <code>| json</code> filter cannot serialize certain objects like forms, images, or media.
|
|
3388
|
+
Use specific properties instead: <code>{{ object.property | json }}</code> or manually build the JSON structure.
|
|
3389
|
+
</div>
|
|
3116
3390
|
`:null})(t)}
|
|
3117
3391
|
</div>
|
|
3118
3392
|
`:""}
|
|
3119
3393
|
</div>
|
|
3120
3394
|
`})}
|
|
3121
3395
|
</div>
|
|
3122
|
-
`}
|
|
3396
|
+
`}_renderEvalLogs(){return 0===this.evalLogs.length?null:U`
|
|
3397
|
+
<div class="liquid-section">
|
|
3398
|
+
<div class="section-title">Expression Results (${this.evalLogs.length})</div>
|
|
3399
|
+
${this.evalLogs.map(t=>U`
|
|
3400
|
+
<div class="log-item log-item--eval">
|
|
3401
|
+
<div class="log-header">
|
|
3402
|
+
<span class="log-type log-type--eval">EVAL</span>
|
|
3403
|
+
<span class="log-message">
|
|
3404
|
+
<span class="eval-expression">${t.expression}</span>
|
|
3405
|
+
</span>
|
|
3406
|
+
<span class="log-time">${this._formatTime(t.timestamp)}</span>
|
|
3407
|
+
</div>
|
|
3408
|
+
<div class="log-content">
|
|
3409
|
+
${this._renderEvalResult(t)}
|
|
3410
|
+
</div>
|
|
3411
|
+
</div>
|
|
3412
|
+
`)}
|
|
3413
|
+
</div>
|
|
3414
|
+
`}render(){const t=this.liquidErrors.length>0||this.evalLogs.length>0;return U`
|
|
3123
3415
|
<div class="console-container">
|
|
3124
3416
|
<div class="console-content">
|
|
3125
3417
|
<div class="toolbar">
|
|
3126
|
-
<
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
>
|
|
3131
|
-
${this._getFilterLabel(this.activeFilter)}
|
|
3132
|
-
${e.all>0?U`<span class="filter-dropdown-trigger__count">${e.all}</span>`:""}
|
|
3133
|
-
<span class="filter-dropdown-trigger__icon ${this.showFilterDropdown?"filter-dropdown-trigger__icon--open":""}">▼</span>
|
|
3134
|
-
</button>
|
|
3135
|
-
${this.showFilterDropdown?U`
|
|
3136
|
-
<div class="filter-dropdown-menu" @mouseleave=${this._closeFilterDropdown}>
|
|
3137
|
-
<button
|
|
3138
|
-
class="filter-dropdown-item ${"all"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3139
|
-
@click=${()=>this._setFilter("all")}
|
|
3140
|
-
>
|
|
3141
|
-
<span class="filter-dropdown-item__icon">📋</span>
|
|
3142
|
-
<span class="filter-dropdown-item__label">All</span>
|
|
3143
|
-
<span class="filter-dropdown-item__count">${e.all}</span>
|
|
3144
|
-
</button>
|
|
3145
|
-
<button
|
|
3146
|
-
class="filter-dropdown-item filter-dropdown-item--error ${"error"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3147
|
-
@click=${()=>this._setFilter("error")}
|
|
3148
|
-
>
|
|
3149
|
-
<span class="filter-dropdown-item__icon">❌</span>
|
|
3150
|
-
<span class="filter-dropdown-item__label">Errors</span>
|
|
3151
|
-
<span class="filter-dropdown-item__count">${e.error}</span>
|
|
3152
|
-
</button>
|
|
3153
|
-
<button
|
|
3154
|
-
class="filter-dropdown-item filter-dropdown-item--warn ${"warn"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3155
|
-
@click=${()=>this._setFilter("warn")}
|
|
3156
|
-
>
|
|
3157
|
-
<span class="filter-dropdown-item__icon">⚠️</span>
|
|
3158
|
-
<span class="filter-dropdown-item__label">Warnings</span>
|
|
3159
|
-
<span class="filter-dropdown-item__count">${e.warn}</span>
|
|
3160
|
-
</button>
|
|
3161
|
-
<button
|
|
3162
|
-
class="filter-dropdown-item ${"info"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3163
|
-
@click=${()=>this._setFilter("info")}
|
|
3164
|
-
>
|
|
3165
|
-
<span class="filter-dropdown-item__icon">ℹ️</span>
|
|
3166
|
-
<span class="filter-dropdown-item__label">Info</span>
|
|
3167
|
-
<span class="filter-dropdown-item__count">${e.info}</span>
|
|
3168
|
-
</button>
|
|
3169
|
-
<button
|
|
3170
|
-
class="filter-dropdown-item ${"log"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3171
|
-
@click=${()=>this._setFilter("log")}
|
|
3172
|
-
>
|
|
3173
|
-
<span class="filter-dropdown-item__icon">📝</span>
|
|
3174
|
-
<span class="filter-dropdown-item__label">Logs</span>
|
|
3175
|
-
<span class="filter-dropdown-item__count">${e.log}</span>
|
|
3176
|
-
</button>
|
|
3177
|
-
${e.liquid>0?U`
|
|
3178
|
-
<button
|
|
3179
|
-
class="filter-dropdown-item ${"liquid"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3180
|
-
@click=${()=>this._setFilter("liquid")}
|
|
3181
|
-
>
|
|
3182
|
-
<span class="filter-dropdown-item__icon">💧</span>
|
|
3183
|
-
<span class="filter-dropdown-item__label">Liquid</span>
|
|
3184
|
-
<span class="filter-dropdown-item__count">${e.liquid}</span>
|
|
3185
|
-
</button>
|
|
3186
|
-
`:""}
|
|
3187
|
-
${e.network>0?U`
|
|
3188
|
-
<button
|
|
3189
|
-
class="filter-dropdown-item filter-dropdown-item--error ${"network"===this.activeFilter?"filter-dropdown-item--active":""}"
|
|
3190
|
-
@click=${()=>this._setFilter("network")}
|
|
3191
|
-
>
|
|
3192
|
-
<span class="filter-dropdown-item__icon">🌐</span>
|
|
3193
|
-
<span class="filter-dropdown-item__label">Network</span>
|
|
3194
|
-
<span class="filter-dropdown-item__count">${e.network}</span>
|
|
3195
|
-
</button>
|
|
3196
|
-
`:""}
|
|
3197
|
-
</div>
|
|
3198
|
-
`:""}
|
|
3199
|
-
</div>
|
|
3200
|
-
<input
|
|
3201
|
-
type="search"
|
|
3202
|
-
class="search"
|
|
3203
|
-
placeholder="Filter logs..."
|
|
3204
|
-
.value=${this.filter}
|
|
3205
|
-
@input=${this._filterLogs}
|
|
3206
|
-
>
|
|
3207
|
-
<button
|
|
3208
|
-
class="toggle-btn ${this.showThemeOnly?"toggle-btn--active":""}"
|
|
3209
|
-
@click=${this._toggleThemeOnly}
|
|
3210
|
-
title="Show only theme-related logs"
|
|
3211
|
-
>
|
|
3212
|
-
Theme Only
|
|
3213
|
-
</button>
|
|
3214
|
-
<button class="btn-clear" @click=${this._clearLogs}>
|
|
3215
|
-
Clear
|
|
3418
|
+
<span class="toolbar-title">Liquid Inspector</span>
|
|
3419
|
+
<span class="toolbar-spacer"></span>
|
|
3420
|
+
<button class="btn-rescan" @click=${()=>this._scanForLiquidErrors()}>
|
|
3421
|
+
Rescan Page
|
|
3216
3422
|
</button>
|
|
3423
|
+
${this.evalLogs.length>0?U`
|
|
3424
|
+
<button class="btn-clear" @click=${this._clearEvalLogs}>
|
|
3425
|
+
Clear Results
|
|
3426
|
+
</button>
|
|
3427
|
+
`:""}
|
|
3217
3428
|
</div>
|
|
3218
3429
|
|
|
3219
|
-
${
|
|
3430
|
+
${this._renderLiquidErrors()}
|
|
3431
|
+
${this._renderEvalLogs()}
|
|
3220
3432
|
|
|
3221
|
-
${"
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
<div
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
`:U`
|
|
3229
|
-
<div class="log-list">
|
|
3230
|
-
${t.map(t=>this._renderLogItem(t))}
|
|
3231
|
-
</div>
|
|
3232
|
-
`}
|
|
3433
|
+
${t?"":U`
|
|
3434
|
+
<div class="empty-state">
|
|
3435
|
+
<div class="empty-state__icon">✓</div>
|
|
3436
|
+
<div>No Liquid errors found on this page</div>
|
|
3437
|
+
<div style="font-size: 11px; margin-top: 8px;">Use the expression input below to evaluate Liquid variables</div>
|
|
3438
|
+
</div>
|
|
3439
|
+
`}
|
|
3233
3440
|
</div>
|
|
3234
3441
|
|
|
3235
3442
|
<div class="console-input-container">
|
|
@@ -3265,8 +3472,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3265
3472
|
rows="1"
|
|
3266
3473
|
></textarea>
|
|
3267
3474
|
</div>
|
|
3475
|
+
<div class="console-disclaimer">
|
|
3476
|
+
Uses LiquidJS engine — results may differ slightly from Shopify's native Liquid
|
|
3477
|
+
</div>
|
|
3268
3478
|
</div>
|
|
3269
|
-
`}}
|
|
3479
|
+
`}}__publicField(Ta,"properties",{liquidErrors:{type:Array,state:!0},evalLogs:{type:Array,state:!0},expandedLogs:{type:Set,state:!0},inputValue:{type:String,state:!0},historyIndex:{type:Number,state:!0},suggestions:{type:Array,state:!0},selectedSuggestion:{type:Number,state:!0},showSuggestions:{type:Boolean,state:!0},context:{type:Object}}),__publicField(Ta,"styles",[pt,n`
|
|
3270
3480
|
:host {
|
|
3271
3481
|
display: block;
|
|
3272
3482
|
padding: 12px;
|
|
@@ -3286,163 +3496,33 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3286
3496
|
padding: 0 0 12px 0;
|
|
3287
3497
|
}
|
|
3288
3498
|
|
|
3289
|
-
.
|
|
3290
|
-
|
|
3291
|
-
min-width: 120px;
|
|
3292
|
-
}
|
|
3293
|
-
|
|
3294
|
-
/* Filter Dropdown */
|
|
3295
|
-
.filter-dropdown {
|
|
3296
|
-
position: relative;
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
.filter-dropdown-trigger {
|
|
3300
|
-
display: flex;
|
|
3301
|
-
align-items: center;
|
|
3302
|
-
gap: 6px;
|
|
3303
|
-
background: var(--tdt-bg-secondary);
|
|
3304
|
-
border: 1px solid var(--tdt-border);
|
|
3305
|
-
border-radius: var(--tdt-radius);
|
|
3306
|
-
padding: 4px 10px;
|
|
3307
|
-
color: var(--tdt-text);
|
|
3308
|
-
font-family: var(--tdt-font);
|
|
3309
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3310
|
-
cursor: pointer;
|
|
3311
|
-
transition: all 0.15s ease;
|
|
3312
|
-
min-width: 150px;
|
|
3313
|
-
}
|
|
3314
|
-
|
|
3315
|
-
.filter-dropdown-trigger:hover {
|
|
3316
|
-
background: var(--tdt-bg-hover);
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
|
-
.filter-dropdown-trigger--active {
|
|
3320
|
-
border-color: var(--tdt-accent);
|
|
3321
|
-
}
|
|
3322
|
-
|
|
3323
|
-
.filter-dropdown-trigger__icon {
|
|
3324
|
-
margin-left: auto;
|
|
3325
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3326
|
-
transition: transform 0.15s ease;
|
|
3327
|
-
}
|
|
3328
|
-
|
|
3329
|
-
.filter-dropdown-trigger__icon--open {
|
|
3330
|
-
transform: rotate(180deg);
|
|
3331
|
-
}
|
|
3332
|
-
|
|
3333
|
-
.filter-dropdown-trigger__count {
|
|
3334
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3335
|
-
background: var(--tdt-accent);
|
|
3336
|
-
color: white;
|
|
3337
|
-
padding: 1px 6px;
|
|
3338
|
-
border-radius: 8px;
|
|
3499
|
+
.toolbar-title {
|
|
3500
|
+
font-size: calc(12px * var(--tdt-scale, 1));
|
|
3339
3501
|
font-weight: 600;
|
|
3340
|
-
}
|
|
3341
|
-
|
|
3342
|
-
.filter-dropdown-menu {
|
|
3343
|
-
position: absolute;
|
|
3344
|
-
top: 100%;
|
|
3345
|
-
left: 0;
|
|
3346
|
-
margin-top: 4px;
|
|
3347
|
-
min-width: 180px;
|
|
3348
|
-
background: var(--tdt-bg);
|
|
3349
|
-
border: 1px solid var(--tdt-border);
|
|
3350
|
-
border-radius: var(--tdt-radius);
|
|
3351
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
|
|
3352
|
-
z-index: 100;
|
|
3353
|
-
overflow: hidden;
|
|
3354
|
-
}
|
|
3355
|
-
|
|
3356
|
-
.filter-dropdown-item {
|
|
3357
|
-
display: flex;
|
|
3358
|
-
align-items: center;
|
|
3359
|
-
gap: 8px;
|
|
3360
|
-
padding: 8px 12px;
|
|
3361
|
-
cursor: pointer;
|
|
3362
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3363
3502
|
color: var(--tdt-text);
|
|
3364
|
-
border: none;
|
|
3365
|
-
background: none;
|
|
3366
|
-
width: 100%;
|
|
3367
|
-
text-align: left;
|
|
3368
|
-
transition: background 0.1s ease;
|
|
3369
|
-
}
|
|
3370
|
-
|
|
3371
|
-
.filter-dropdown-item:hover {
|
|
3372
|
-
background: var(--tdt-bg-hover);
|
|
3373
|
-
}
|
|
3374
|
-
|
|
3375
|
-
.filter-dropdown-item--active {
|
|
3376
|
-
background: var(--tdt-accent);
|
|
3377
|
-
color: white;
|
|
3378
|
-
}
|
|
3379
|
-
|
|
3380
|
-
.filter-dropdown-item--active:hover {
|
|
3381
|
-
background: var(--tdt-accent);
|
|
3382
|
-
}
|
|
3383
|
-
|
|
3384
|
-
.filter-dropdown-item__icon {
|
|
3385
|
-
width: 16px;
|
|
3386
|
-
text-align: center;
|
|
3387
|
-
flex-shrink: 0;
|
|
3388
3503
|
}
|
|
3389
3504
|
|
|
3390
|
-
.
|
|
3505
|
+
.toolbar-spacer {
|
|
3391
3506
|
flex: 1;
|
|
3392
3507
|
}
|
|
3393
3508
|
|
|
3394
|
-
.
|
|
3395
|
-
|
|
3396
|
-
opacity: 0.7;
|
|
3397
|
-
background: rgba(255, 255, 255, 0.15);
|
|
3398
|
-
padding: 1px 6px;
|
|
3399
|
-
border-radius: 8px;
|
|
3400
|
-
}
|
|
3401
|
-
|
|
3402
|
-
.filter-dropdown-item--active .filter-dropdown-item__count {
|
|
3403
|
-
background: rgba(255, 255, 255, 0.25);
|
|
3404
|
-
opacity: 1;
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
.filter-dropdown-item--error {
|
|
3408
|
-
color: var(--tdt-error);
|
|
3409
|
-
}
|
|
3410
|
-
|
|
3411
|
-
.filter-dropdown-item--error.filter-dropdown-item--active {
|
|
3412
|
-
background: var(--tdt-error);
|
|
3413
|
-
color: white;
|
|
3414
|
-
}
|
|
3415
|
-
|
|
3416
|
-
.filter-dropdown-item--warn {
|
|
3417
|
-
color: var(--tdt-warning);
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
.filter-dropdown-item--warn.filter-dropdown-item--active {
|
|
3421
|
-
background: var(--tdt-warning);
|
|
3422
|
-
color: var(--tdt-bg);
|
|
3423
|
-
}
|
|
3424
|
-
|
|
3425
|
-
.toggle-btn {
|
|
3426
|
-
background: var(--tdt-bg-secondary);
|
|
3509
|
+
.btn-clear {
|
|
3510
|
+
background: transparent;
|
|
3427
3511
|
border: 1px solid var(--tdt-border);
|
|
3512
|
+
color: var(--tdt-text-muted);
|
|
3428
3513
|
border-radius: var(--tdt-radius);
|
|
3429
3514
|
padding: 4px 10px;
|
|
3430
|
-
color: var(--tdt-text-muted);
|
|
3431
3515
|
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3432
3516
|
cursor: pointer;
|
|
3433
3517
|
}
|
|
3434
3518
|
|
|
3435
|
-
.
|
|
3436
|
-
background: var(--tdt-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
.toggle-btn--active {
|
|
3440
|
-
background: var(--tdt-accent);
|
|
3441
|
-
border-color: var(--tdt-accent);
|
|
3519
|
+
.btn-clear:hover {
|
|
3520
|
+
background: var(--tdt-error);
|
|
3521
|
+
border-color: var(--tdt-error);
|
|
3442
3522
|
color: white;
|
|
3443
3523
|
}
|
|
3444
3524
|
|
|
3445
|
-
.btn-
|
|
3525
|
+
.btn-rescan {
|
|
3446
3526
|
background: transparent;
|
|
3447
3527
|
border: 1px solid var(--tdt-border);
|
|
3448
3528
|
color: var(--tdt-text-muted);
|
|
@@ -3452,18 +3532,12 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3452
3532
|
cursor: pointer;
|
|
3453
3533
|
}
|
|
3454
3534
|
|
|
3455
|
-
.btn-
|
|
3456
|
-
background: var(--tdt-
|
|
3457
|
-
border-color: var(--tdt-
|
|
3535
|
+
.btn-rescan:hover {
|
|
3536
|
+
background: var(--tdt-accent);
|
|
3537
|
+
border-color: var(--tdt-accent);
|
|
3458
3538
|
color: white;
|
|
3459
3539
|
}
|
|
3460
3540
|
|
|
3461
|
-
.log-list {
|
|
3462
|
-
display: flex;
|
|
3463
|
-
flex-direction: column;
|
|
3464
|
-
gap: 4px;
|
|
3465
|
-
}
|
|
3466
|
-
|
|
3467
3541
|
.log-item {
|
|
3468
3542
|
background: var(--tdt-bg-secondary);
|
|
3469
3543
|
border: 1px solid var(--tdt-border);
|
|
@@ -3473,28 +3547,34 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3473
3547
|
margin-bottom: 4px;
|
|
3474
3548
|
}
|
|
3475
3549
|
|
|
3476
|
-
.log-item--
|
|
3477
|
-
border-left: 3px solid
|
|
3478
|
-
background: rgba(
|
|
3550
|
+
.log-item--liquid {
|
|
3551
|
+
border-left: 3px solid #9382ff;
|
|
3552
|
+
background: rgba(147, 130, 255, 0.05);
|
|
3479
3553
|
}
|
|
3480
3554
|
|
|
3481
|
-
.log-item--
|
|
3482
|
-
border-left: 3px solid
|
|
3483
|
-
background: rgba(
|
|
3555
|
+
.log-item--drop {
|
|
3556
|
+
border-left: 3px solid #f97316;
|
|
3557
|
+
background: rgba(249, 115, 22, 0.05);
|
|
3484
3558
|
}
|
|
3485
3559
|
|
|
3486
|
-
.log-item--
|
|
3487
|
-
border-left: 3px solid
|
|
3560
|
+
.log-item--asset {
|
|
3561
|
+
border-left: 3px solid #eab308;
|
|
3562
|
+
background: rgba(234, 179, 8, 0.05);
|
|
3488
3563
|
}
|
|
3489
3564
|
|
|
3490
|
-
.log-item--
|
|
3491
|
-
border-left: 3px solid #
|
|
3492
|
-
background: rgba(
|
|
3565
|
+
.log-item--schema {
|
|
3566
|
+
border-left: 3px solid #ec4899;
|
|
3567
|
+
background: rgba(236, 72, 153, 0.05);
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3570
|
+
.log-item--json {
|
|
3571
|
+
border-left: 3px solid #ef4444;
|
|
3572
|
+
background: rgba(239, 68, 68, 0.05);
|
|
3493
3573
|
}
|
|
3494
3574
|
|
|
3495
|
-
.log-item--
|
|
3496
|
-
border-left: 3px solid
|
|
3497
|
-
background: rgba(
|
|
3575
|
+
.log-item--eval {
|
|
3576
|
+
border-left: 3px solid var(--tdt-accent);
|
|
3577
|
+
background: rgba(59, 130, 246, 0.05);
|
|
3498
3578
|
}
|
|
3499
3579
|
|
|
3500
3580
|
.log-header {
|
|
@@ -3518,33 +3598,33 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3518
3598
|
flex-shrink: 0;
|
|
3519
3599
|
}
|
|
3520
3600
|
|
|
3521
|
-
.log-type--
|
|
3522
|
-
background:
|
|
3601
|
+
.log-type--liquid {
|
|
3602
|
+
background: #9382ff;
|
|
3523
3603
|
color: white;
|
|
3524
3604
|
}
|
|
3525
3605
|
|
|
3526
|
-
.log-type--
|
|
3527
|
-
background:
|
|
3528
|
-
color:
|
|
3606
|
+
.log-type--drop {
|
|
3607
|
+
background: #f97316;
|
|
3608
|
+
color: white;
|
|
3529
3609
|
}
|
|
3530
3610
|
|
|
3531
|
-
.log-type--
|
|
3532
|
-
background:
|
|
3533
|
-
color:
|
|
3611
|
+
.log-type--asset {
|
|
3612
|
+
background: #eab308;
|
|
3613
|
+
color: var(--tdt-bg);
|
|
3534
3614
|
}
|
|
3535
3615
|
|
|
3536
|
-
.log-type--
|
|
3537
|
-
background:
|
|
3538
|
-
color:
|
|
3616
|
+
.log-type--schema {
|
|
3617
|
+
background: #ec4899;
|
|
3618
|
+
color: white;
|
|
3539
3619
|
}
|
|
3540
3620
|
|
|
3541
|
-
.log-type--
|
|
3542
|
-
background: #
|
|
3621
|
+
.log-type--json {
|
|
3622
|
+
background: #ef4444;
|
|
3543
3623
|
color: white;
|
|
3544
3624
|
}
|
|
3545
3625
|
|
|
3546
|
-
.log-type--
|
|
3547
|
-
background:
|
|
3626
|
+
.log-type--eval {
|
|
3627
|
+
background: var(--tdt-accent);
|
|
3548
3628
|
color: white;
|
|
3549
3629
|
}
|
|
3550
3630
|
|
|
@@ -3554,16 +3634,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3554
3634
|
color: var(--tdt-text);
|
|
3555
3635
|
}
|
|
3556
3636
|
|
|
3557
|
-
.log-count {
|
|
3558
|
-
background: var(--tdt-bg);
|
|
3559
|
-
color: var(--tdt-text-muted);
|
|
3560
|
-
padding: 2px 8px;
|
|
3561
|
-
border-radius: 10px;
|
|
3562
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3563
|
-
font-weight: 600;
|
|
3564
|
-
flex-shrink: 0;
|
|
3565
|
-
}
|
|
3566
|
-
|
|
3567
3637
|
.log-time {
|
|
3568
3638
|
color: var(--tdt-text-muted);
|
|
3569
3639
|
font-size: calc(10px * var(--tdt-scale, 1));
|
|
@@ -3576,34 +3646,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3576
3646
|
background: var(--tdt-bg);
|
|
3577
3647
|
}
|
|
3578
3648
|
|
|
3579
|
-
.log-stack {
|
|
3580
|
-
font-family: var(--tdt-font-mono);
|
|
3581
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3582
|
-
color: var(--tdt-text-muted);
|
|
3583
|
-
white-space: pre-wrap;
|
|
3584
|
-
max-height: 150px;
|
|
3585
|
-
overflow: auto;
|
|
3586
|
-
margin-top: 8px;
|
|
3587
|
-
padding: 8px;
|
|
3588
|
-
background: var(--tdt-bg-secondary);
|
|
3589
|
-
border-radius: var(--tdt-radius);
|
|
3590
|
-
}
|
|
3591
|
-
|
|
3592
|
-
.log-source {
|
|
3593
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3594
|
-
color: var(--tdt-text-muted);
|
|
3595
|
-
margin-top: 6px;
|
|
3596
|
-
}
|
|
3597
|
-
|
|
3598
|
-
.log-source a {
|
|
3599
|
-
color: var(--tdt-accent);
|
|
3600
|
-
text-decoration: none;
|
|
3601
|
-
}
|
|
3602
|
-
|
|
3603
|
-
.log-source a:hover {
|
|
3604
|
-
text-decoration: underline;
|
|
3605
|
-
}
|
|
3606
|
-
|
|
3607
3649
|
.empty-state {
|
|
3608
3650
|
text-align: center;
|
|
3609
3651
|
padding: 40px 20px;
|
|
@@ -3638,177 +3680,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3638
3680
|
background: var(--tdt-border);
|
|
3639
3681
|
}
|
|
3640
3682
|
|
|
3641
|
-
.deprecation-item {
|
|
3642
|
-
background: var(--tdt-bg-secondary);
|
|
3643
|
-
border: 1px solid var(--tdt-border);
|
|
3644
|
-
border-left: 3px solid #ff9f43;
|
|
3645
|
-
border-radius: var(--tdt-radius);
|
|
3646
|
-
padding: 10px 12px;
|
|
3647
|
-
margin-bottom: 8px;
|
|
3648
|
-
}
|
|
3649
|
-
|
|
3650
|
-
.deprecation-tag {
|
|
3651
|
-
font-family: var(--tdt-font-mono);
|
|
3652
|
-
font-weight: 600;
|
|
3653
|
-
color: #ff9f43;
|
|
3654
|
-
}
|
|
3655
|
-
|
|
3656
|
-
.deprecation-message {
|
|
3657
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3658
|
-
color: var(--tdt-text);
|
|
3659
|
-
margin-top: 4px;
|
|
3660
|
-
}
|
|
3661
|
-
|
|
3662
|
-
.deprecation-replacement {
|
|
3663
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3664
|
-
color: var(--tdt-text-muted);
|
|
3665
|
-
margin-top: 4px;
|
|
3666
|
-
}
|
|
3667
|
-
|
|
3668
|
-
.deprecation-replacement code {
|
|
3669
|
-
background: var(--tdt-bg);
|
|
3670
|
-
padding: 2px 6px;
|
|
3671
|
-
border-radius: var(--tdt-radius);
|
|
3672
|
-
color: var(--tdt-success);
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
|
-
.log-item--network {
|
|
3676
|
-
border-left: 3px solid #ef4444;
|
|
3677
|
-
background: rgba(239, 68, 68, 0.05);
|
|
3678
|
-
}
|
|
3679
|
-
|
|
3680
|
-
.log-type--network {
|
|
3681
|
-
background: #ef4444;
|
|
3682
|
-
color: white;
|
|
3683
|
-
}
|
|
3684
|
-
|
|
3685
|
-
.log-item--group {
|
|
3686
|
-
border-left: 3px solid #6366f1;
|
|
3687
|
-
background: rgba(99, 102, 241, 0.05);
|
|
3688
|
-
}
|
|
3689
|
-
|
|
3690
|
-
.log-type--group {
|
|
3691
|
-
background: #6366f1;
|
|
3692
|
-
color: white;
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
|
-
.log-group-children {
|
|
3696
|
-
margin-left: 16px;
|
|
3697
|
-
padding-left: 12px;
|
|
3698
|
-
border-left: 2px solid var(--tdt-border);
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
.log-table {
|
|
3702
|
-
width: 100%;
|
|
3703
|
-
border-collapse: collapse;
|
|
3704
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3705
|
-
margin-top: 8px;
|
|
3706
|
-
}
|
|
3707
|
-
|
|
3708
|
-
.log-table th,
|
|
3709
|
-
.log-table td {
|
|
3710
|
-
border: 1px solid var(--tdt-border);
|
|
3711
|
-
padding: 4px 8px;
|
|
3712
|
-
text-align: left;
|
|
3713
|
-
}
|
|
3714
|
-
|
|
3715
|
-
.log-table th {
|
|
3716
|
-
background: var(--tdt-bg-secondary);
|
|
3717
|
-
color: var(--tdt-text-muted);
|
|
3718
|
-
font-weight: 600;
|
|
3719
|
-
}
|
|
3720
|
-
|
|
3721
|
-
.log-table td {
|
|
3722
|
-
color: var(--tdt-text);
|
|
3723
|
-
}
|
|
3724
|
-
|
|
3725
|
-
.log-table tr:nth-child(even) td {
|
|
3726
|
-
background: rgba(255, 255, 255, 0.02);
|
|
3727
|
-
}
|
|
3728
|
-
|
|
3729
|
-
.network-details {
|
|
3730
|
-
display: grid;
|
|
3731
|
-
grid-template-columns: auto 1fr;
|
|
3732
|
-
gap: 4px 12px;
|
|
3733
|
-
font-size: calc(11px * var(--tdt-scale, 1));
|
|
3734
|
-
margin-top: 8px;
|
|
3735
|
-
}
|
|
3736
|
-
|
|
3737
|
-
.network-details dt {
|
|
3738
|
-
color: var(--tdt-text-muted);
|
|
3739
|
-
}
|
|
3740
|
-
|
|
3741
|
-
.network-details dd {
|
|
3742
|
-
color: var(--tdt-text);
|
|
3743
|
-
margin: 0;
|
|
3744
|
-
word-break: break-all;
|
|
3745
|
-
}
|
|
3746
|
-
|
|
3747
|
-
.status-badge {
|
|
3748
|
-
display: inline-block;
|
|
3749
|
-
padding: 2px 6px;
|
|
3750
|
-
border-radius: var(--tdt-radius);
|
|
3751
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3752
|
-
font-weight: 600;
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
.status-badge--error {
|
|
3756
|
-
background: var(--tdt-error);
|
|
3757
|
-
color: white;
|
|
3758
|
-
}
|
|
3759
|
-
|
|
3760
|
-
.status-badge--success {
|
|
3761
|
-
background: var(--tdt-success);
|
|
3762
|
-
color: white;
|
|
3763
|
-
}
|
|
3764
|
-
|
|
3765
|
-
.persist-indicator {
|
|
3766
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3767
|
-
color: var(--tdt-text-muted);
|
|
3768
|
-
margin-left: auto;
|
|
3769
|
-
display: flex;
|
|
3770
|
-
align-items: center;
|
|
3771
|
-
gap: 4px;
|
|
3772
|
-
}
|
|
3773
|
-
|
|
3774
|
-
.persist-indicator::before {
|
|
3775
|
-
content: '';
|
|
3776
|
-
width: 6px;
|
|
3777
|
-
height: 6px;
|
|
3778
|
-
background: var(--tdt-success);
|
|
3779
|
-
border-radius: 50%;
|
|
3780
|
-
}
|
|
3781
|
-
|
|
3782
|
-
.log-item--drop {
|
|
3783
|
-
border-left: 3px solid #f97316;
|
|
3784
|
-
background: rgba(249, 115, 22, 0.05);
|
|
3785
|
-
}
|
|
3786
|
-
|
|
3787
|
-
.log-type--drop {
|
|
3788
|
-
background: #f97316;
|
|
3789
|
-
color: white;
|
|
3790
|
-
}
|
|
3791
|
-
|
|
3792
|
-
.log-item--asset {
|
|
3793
|
-
border-left: 3px solid #eab308;
|
|
3794
|
-
background: rgba(234, 179, 8, 0.05);
|
|
3795
|
-
}
|
|
3796
|
-
|
|
3797
|
-
.log-type--asset {
|
|
3798
|
-
background: #eab308;
|
|
3799
|
-
color: var(--tdt-bg);
|
|
3800
|
-
}
|
|
3801
|
-
|
|
3802
|
-
.log-item--schema {
|
|
3803
|
-
border-left: 3px solid #ec4899;
|
|
3804
|
-
background: rgba(236, 72, 153, 0.05);
|
|
3805
|
-
}
|
|
3806
|
-
|
|
3807
|
-
.log-type--schema {
|
|
3808
|
-
background: #ec4899;
|
|
3809
|
-
color: white;
|
|
3810
|
-
}
|
|
3811
|
-
|
|
3812
3683
|
.liquid-category {
|
|
3813
3684
|
font-size: calc(9px * var(--tdt-scale, 1));
|
|
3814
3685
|
padding: 1px 4px;
|
|
@@ -3911,6 +3782,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3911
3782
|
padding: 2px 4px;
|
|
3912
3783
|
}
|
|
3913
3784
|
|
|
3785
|
+
.console-disclaimer {
|
|
3786
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
3787
|
+
color: var(--tdt-text-muted);
|
|
3788
|
+
opacity: 0.7;
|
|
3789
|
+
padding: 4px 0 0 20px;
|
|
3790
|
+
font-style: italic;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3914
3793
|
.autocomplete-dropdown {
|
|
3915
3794
|
position: absolute;
|
|
3916
3795
|
bottom: 100%;
|
|
@@ -3996,17 +3875,6 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
3996
3875
|
white-space: nowrap;
|
|
3997
3876
|
}
|
|
3998
3877
|
|
|
3999
|
-
/* Eval log styles */
|
|
4000
|
-
.log-item--eval {
|
|
4001
|
-
border-left: 3px solid var(--tdt-accent);
|
|
4002
|
-
background: rgba(59, 130, 246, 0.05);
|
|
4003
|
-
}
|
|
4004
|
-
|
|
4005
|
-
.log-type--eval {
|
|
4006
|
-
background: var(--tdt-accent);
|
|
4007
|
-
color: white;
|
|
4008
|
-
}
|
|
4009
|
-
|
|
4010
3878
|
.eval-expression {
|
|
4011
3879
|
color: var(--tdt-text-muted);
|
|
4012
3880
|
font-family: var(--tdt-font-mono);
|
|
@@ -4042,30 +3910,36 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
4042
3910
|
.eval-result--null {
|
|
4043
3911
|
color: var(--tdt-text-muted);
|
|
4044
3912
|
}
|
|
4045
|
-
`]),
|
|
3913
|
+
`]),customElements.define("tdt-console-panel",Ta);const Ca=class t extends ot{constructor(){super(),this.meta={},this.translations=[],this.missingTranslations=[],this.availableLocales=[],this.availableCountries=[],this.filter="",this.activeTab="overview",this._selectedLocale=null,this._selectedCountry=null}connectedCallback(){super.connectedCallback(),this._scanTranslations(),this._loadAvailableLocales()}updated(t){var e,i,s,a;t.has("meta")&&this.meta&&(this._selectedLocale=null==(i=null==(e=this.meta.request)?void 0:e.locale)?void 0:i.iso_code,this._selectedCountry=null==(a=null==(s=this.meta.localization)?void 0:s.country)?void 0:a.iso_code)}_loadAvailableLocales(){var t,e,i;const s=document.querySelector("[data-locale-selector]")||document.querySelector('form[action*="/localization"]');if(s){const t=s.querySelectorAll("option[value], [data-locale]");this.availableLocales=Array.from(t).map(t=>{var e;return{code:t.value||t.dataset.locale,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}const a=document.querySelector("[data-country-selector]")||document.querySelector('select[name="country_code"]');if(a){const t=a.querySelectorAll("option[value]");this.availableCountries=Array.from(t).map(t=>{var e;return{code:t.value,name:(null==(e=t.textContent)?void 0:e.trim())||t.value}})}if(0===this.availableLocales.length){const s=null==(i=null==(e=null==(t=window.__THEME_DEVTOOLS_CONTEXT__)?void 0:t.objects)?void 0:e.shop)?void 0:i.enabled_locales;s&&(this.availableLocales=s.map(t=>({code:t,name:new Intl.DisplayNames(["en"],{type:"language"}).of(t)||t})))}}_scanTranslations(){var t;const e=[],i=[],s=document.body.innerHTML,a=new Set;[/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t\s*\}\}/g,/\{\{\s*['"]([^'"]+)['"]\s*\|\s*t:\s*[^}]+\}\}/g,/data-translation-key=["']([^"']+)["']/g].forEach(t=>{let e;for(;null!==(e=t.exec(s));)a.has(e[1])||a.add(e[1])});const r=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1);for(;r.nextNode();){const e=r.currentNode.textContent.trim();if(e.startsWith("translation missing:")||e.includes("Translation missing")||e.match(/^[a-z_]+\.[a-z_]+(\.[a-z_]+)*$/i)){const s=e.match(/translation missing:\s*([^\s]+)/i)||e.match(/^([a-z_]+\.[a-z_]+(?:\.[a-z_]+)*)$/i);s&&i.push({key:s[1],context:(null==(t=r.currentNode.parentElement)?void 0:t.tagName)||"unknown",element:r.currentNode.parentElement})}}document.querySelectorAll("[data-t], [data-translate]").forEach(t=>{var s;const a=t.dataset.t||t.dataset.translate,r=null==(s=t.textContent)?void 0:s.trim();a&&(e.push({key:a,value:r||"(empty)",element:t.tagName,isMissing:!r||r.includes("translation missing")}),r&&!r.includes("translation missing")||i.push({key:a,context:t.tagName,element:t}))}),a.forEach(t=>{e.some(e=>e.key===t)||e.push({key:t,value:"(rendered)",element:"Liquid",isMissing:!1})}),this.translations=e,this.missingTranslations=i}_getFlag(e,i="country"){if("language"===i){const i=e.split("-")[0].toLowerCase();return t.LANGUAGE_FLAGS[i]||"🌐"}return t.COUNTRY_FLAGS[null==e?void 0:e.toUpperCase()]||"🏳️"}_setTab(t){this.activeTab=t}_filterTranslations(t){this.filter=t.target.value}_getFilteredTranslations(){const t="missing"===this.activeTab?this.missingTranslations:this.translations;if(!this.filter)return t;const e=this.filter.toLowerCase();return t.filter(t=>t.key.toLowerCase().includes(e)||t.value&&t.value.toLowerCase().includes(e))}_copyKey(t){const e=`{{ '${t}' | t }}`;navigator.clipboard.writeText(e)}_selectLocale(t){this._selectedLocale=t,this.requestUpdate()}_selectCountry(t){this._selectedCountry=t,this.requestUpdate()}_buildLocaleUrl(){var t,e,i,s,a;const r=new URL(window.location.href),n=r.pathname.split("/").filter(Boolean);null==(e=null==(t=this.meta.request)?void 0:t.locale)||e.iso_code;const o=this._selectedLocale;this._selectedCountry,(null==(i=n[0])?void 0:i.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&n.shift();let l="";return o&&o!==(null==(a=null==(s=this.meta.request)?void 0:s.locale)?void 0:a.primary_locale)&&(l=`/${o}`),l+="/"+n.join("/"),r.pathname=l||"/",r.toString()}_goToLocale(){const t=this._buildLocaleUrl();window.location.href=t}_copyLocaleUrl(){const t=this._buildLocaleUrl();navigator.clipboard.writeText(t)}_renderMarketInfo(){var t,e,i,s,a,r,n,o,l,d,c,p,u;const{localization:h,request:g}=this.meta,v=null==(t=window.Shopify)?void 0:t.currency,m=null==v?void 0:v.rate,b=null==v?void 0:v.active;return U`
|
|
4046
3914
|
<div class="market-info">
|
|
4047
3915
|
<div class="info-card">
|
|
4048
3916
|
<div class="info-card__label">Country</div>
|
|
4049
|
-
<div class="info-card__value">${(null==(
|
|
4050
|
-
<div class="info-card__subvalue">${(null==(
|
|
3917
|
+
<div class="info-card__value">${(null==(e=null==h?void 0:h.country)?void 0:e.name)||"—"}</div>
|
|
3918
|
+
<div class="info-card__subvalue">${(null==(i=null==h?void 0:h.country)?void 0:i.iso_code)||""}</div>
|
|
4051
3919
|
</div>
|
|
4052
|
-
|
|
3920
|
+
|
|
4053
3921
|
<div class="info-card">
|
|
4054
3922
|
<div class="info-card__label">Language</div>
|
|
4055
|
-
<div class="info-card__value">${(null==(
|
|
4056
|
-
<div class="info-card__subvalue">${(null==(
|
|
3923
|
+
<div class="info-card__value">${(null==(s=null==g?void 0:g.locale)?void 0:s.name)||(null==(a=null==h?void 0:h.language)?void 0:a.name)||"—"}</div>
|
|
3924
|
+
<div class="info-card__subvalue">${(null==(r=null==g?void 0:g.locale)?void 0:r.iso_code)||""} ${(null==(n=null==g?void 0:g.locale)?void 0:n.primary)?"(Primary)":""}</div>
|
|
4057
3925
|
</div>
|
|
4058
|
-
|
|
3926
|
+
|
|
4059
3927
|
<div class="info-card">
|
|
4060
3928
|
<div class="info-card__label">Currency</div>
|
|
4061
|
-
<div class="info-card__value">${(null==(
|
|
4062
|
-
<div class="info-card__subvalue">${(null==(c=null==(
|
|
3929
|
+
<div class="info-card__value">${b||(null==(l=null==(o=null==h?void 0:h.country)?void 0:o.currency)?void 0:l.iso_code)||"—"}</div>
|
|
3930
|
+
<div class="info-card__subvalue">${(null==(c=null==(d=null==h?void 0:h.country)?void 0:d.currency)?void 0:c.symbol)||""}</div>
|
|
4063
3931
|
</div>
|
|
4064
|
-
|
|
3932
|
+
|
|
3933
|
+
<div class="info-card">
|
|
3934
|
+
<div class="info-card__label">Conversion Rate</div>
|
|
3935
|
+
<div class="info-card__value">${null!=m?m:"—"}</div>
|
|
3936
|
+
<div class="info-card__subvalue">${null!=m&&1!==m?`1 ${(null==v?void 0:v.active)||"base"} = ${m} shop currency`:1===m?"No conversion":""}</div>
|
|
3937
|
+
</div>
|
|
3938
|
+
|
|
4065
3939
|
<div class="info-card">
|
|
4066
3940
|
<div class="info-card__label">Market</div>
|
|
4067
|
-
<div class="info-card__value">${(null==(
|
|
4068
|
-
<div class="info-card__subvalue">ID: ${(null==(
|
|
3941
|
+
<div class="info-card__value">${(null==(p=null==h?void 0:h.market)?void 0:p.handle)||"—"}</div>
|
|
3942
|
+
<div class="info-card__subvalue">ID: ${(null==(u=null==h?void 0:h.market)?void 0:u.id)||"—"}</div>
|
|
4069
3943
|
</div>
|
|
4070
3944
|
</div>
|
|
4071
3945
|
`}_renderLocaleSwitcher(){var t,e,i,s;const a=null==(e=null==(t=this.meta.request)?void 0:t.locale)?void 0:e.iso_code;return null==(s=null==(i=this.meta.localization)?void 0:i.country)||s.iso_code,U`
|
|
@@ -4546,7 +4420,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
4546
4420
|
.stat-value--warning {
|
|
4547
4421
|
color: var(--tdt-warning);
|
|
4548
4422
|
}
|
|
4549
|
-
`]),__publicField(Ca,"COUNTRY_FLAGS",{US:"🇺🇸",CA:"🇨🇦",GB:"🇬🇧",AU:"🇦🇺",DE:"🇩🇪",FR:"🇫🇷",ES:"🇪🇸",IT:"🇮🇹",JP:"🇯🇵",CN:"🇨🇳",BR:"🇧🇷",MX:"🇲🇽",NL:"🇳🇱",SE:"🇸🇪",NO:"🇳🇴",DK:"🇩🇰",FI:"🇫🇮",PL:"🇵🇱",AT:"🇦🇹",CH:"🇨🇭",BE:"🇧🇪",IE:"🇮🇪",NZ:"🇳🇿",SG:"🇸🇬",HK:"🇭🇰",KR:"🇰🇷",IN:"🇮🇳",AE:"🇦🇪",SA:"🇸🇦",ZA:"🇿🇦",PT:"🇵🇹",CZ:"🇨🇿",RO:"🇷🇴",HU:"🇭🇺",IL:"🇮🇱"}),__publicField(Ca,"LANGUAGE_FLAGS",{en:"🇬🇧",es:"🇪🇸",fr:"🇫🇷",de:"🇩🇪",it:"🇮🇹",pt:"🇵🇹",nl:"🇳🇱",pl:"🇵🇱",ja:"🇯🇵",zh:"🇨🇳",ko:"🇰🇷",ar:"🇸🇦",ru:"🇷🇺",sv:"🇸🇪",da:"🇩🇰",fi:"🇫🇮",no:"🇳🇴",cs:"🇨🇿",hu:"🇭🇺",ro:"🇷🇴"});let Ea=Ca;customElements.define("tdt-localization-panel",Ea);const Aa=class t extends ot{constructor(){super(),this.events=[],this.dataLayerSnapshots=[],this.filter="",this.activeFilter="all",this.expandedEvents=new Set,this.isPaused=!1,this._detectedProviders=new Set}connectedCallback(){super.connectedCallback(),this._loadPersistedEvents(),this._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptGaUniversal(),this._interceptFbPixel(),this._interceptTikTok(),this._interceptPinterest(),this._interceptSnapchat(),this._interceptKlaviyo(),this._interceptShopifyAnalytics(),this._interceptWebPixels(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_loadPersistedEvents(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.events=t.map(t=>({...t,timestamp:new Date(t.timestamp),isLive:!1}))}}catch(e){console.warn("[TDT] Failed to load persisted events:",e)}}_persistEvents(){try{const e=this.events.slice(-500).map(t=>({...t,timestamp:t.timestamp.toISOString()}));sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){console.warn("[TDT] Failed to persist events:",e)}}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.ga&&this._detectedProviders.add("ga"),window.fbq&&this._detectedProviders.add("fbpixel"),window.ttq&&this._detectedProviders.add("tiktok"),window.pintrk&&this._detectedProviders.add("pinterest"),window.snaptr&&this._detectedProviders.add("snapchat"),window._learnq&&this._detectedProviders.add("klaviyo"),(null==(t=window.Shopify)?void 0:t.analytics)&&this._detectedProviders.add("shopify")}_interceptDataLayer(){window.dataLayer||(window.dataLayer=[]);const t=window.dataLayer.push.bind(window.dataLayer),e=this;window.dataLayer.push=function(...i){return i.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...i)},this._originalDataLayerPush=t,window.dataLayer.forEach(t=>{t&&"object"==typeof t&&this._addEvent("datalayer",t.event||"push",t,!1)})}_interceptGtag(){if(!window.gtag)return;const t=window.gtag,e=this;window.gtag=function(i,...s){if(!e.isPaused)if("event"===i){const[t,i]=s;e._addEvent("ga4",t,i||{}),e._detectedProviders.add("ga4")}else"config"===i&&e._addEvent("ga4","config",{measurementId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGtag=t}_interceptGaUniversal(){if(!window.ga)return;const t=window.ga,e=this;window.ga=function(i,...s){if(!e.isPaused)if("send"===i){const[t,...i]=s;if("event"===t){const[t,s,a,r]=i;e._addEvent("ga",s||"event",{category:t,action:s,label:a,value:r})}else"pageview"===t&&e._addEvent("ga","pageview",{page:i[0]});e._detectedProviders.add("ga")}else"function"==typeof i||"create"===i&&e._addEvent("ga","create",{trackingId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGa=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(i,...s){if(!e.isPaused)if("track"===i||"trackCustom"===i){const[t,i]=s;e._addEvent("fbpixel",t,i||{}),e._detectedProviders.add("fbpixel")}else"init"===i&&e._addEvent("fbpixel","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalFbq=t}_interceptTikTok(){if(!window.ttq)return;const t=window.ttq,e=this;if(t.track){const i=t.track.bind(t);t.track=function(t,s){return e.isPaused||(e._addEvent("tiktok",t,s||{}),e._detectedProviders.add("tiktok")),i(t,s)},this._originalTtqTrack=i}if(t.page){const i=t.page.bind(t);t.page=function(){return e.isPaused||(e._addEvent("tiktok","PageView",{}),e._detectedProviders.add("tiktok")),i()},this._originalTtqPage=i}}_interceptPinterest(){if(!window.pintrk)return;const t=window.pintrk,e=this;window.pintrk=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("pinterest",t,i||{}),e._detectedProviders.add("pinterest")}else"load"===i&&e._addEvent("pinterest","load",{tagId:s[0]});return t.call(this,i,...s)},this._originalPintrk=t}_interceptSnapchat(){if(!window.snaptr)return;const t=window.snaptr,e=this;window.snaptr=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("snapchat",t,i||{}),e._detectedProviders.add("snapchat")}else"init"===i&&e._addEvent("snapchat","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalSnaptr=t}_interceptKlaviyo(){if(!window._learnq)return;const t=window._learnq,e=this;if(Array.isArray(t)){const i=t.push.bind(t);t.push=function(t){if(!e.isPaused&&Array.isArray(t)){const[i,...s]=t;if("track"===i){const[t,i]=s;e._addEvent("klaviyo",t,i||{}),e._detectedProviders.add("klaviyo")}else"identify"===i&&e._addEvent("klaviyo","identify",s[0]||{})}return i(t)},this._originalLearnqPush=i}}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,i=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,s){return i.isPaused||(i._addEvent("shopify",e,s||{}),i._detectedProviders.add("shopify")),t(e,s)},this._originalShopifyPublish=t}}_interceptWebPixels(){var t,e;if(!(null==(e=null==(t=window.Shopify)?void 0:t.analytics)?void 0:e.subscribe))return;const i=window.Shopify.analytics,s=this,a=i.subscribe.bind(i);i.subscribe=function(t,e){return a(t,i=>(s.isPaused||(s._addEvent("webpixel",t,i||{}),s._detectedProviders.add("webpixel")),e(i)))},this._originalWebPixelSubscribe=a}_interceptCustomEvents(){const t=this;this._customEventHandler=e=>{!t.isPaused&&e.detail&&t._addEvent("custom",e.type,e.detail)},["analytics","tracking","gtm","conversion"].forEach(t=>{document.addEventListener(t,this._customEventHandler)})}_restoreInterceptors(){this._originalDataLayerPush&&window.dataLayer&&(window.dataLayer.push=this._originalDataLayerPush),this._originalGtag&&(window.gtag=this._originalGtag),this._originalFbq&&(window.fbq=this._originalFbq),["analytics","tracking","gtm","conversion"].forEach(t=>{document.removeEventListener(t,this._customEventHandler)})}_getEventKey(t,e,i){return`${t}:${e}:${JSON.stringify(i,Object.keys(i||{}).sort())}`}_addEvent(e,i,s,a=!0){const r=t.CONVERSION_EVENTS.some(t=>i.toLowerCase().includes(t.toLowerCase())),n=this._getEventKey(e,i,s),o=this.events.find(t=>Date.now()-t.timestamp.getTime()<500&&this._getEventKey(t.provider,t.eventName,t.data)===n);if(o)return o.count=(o.count||1)+1,this.events=[...this.events],void this._persistEvents();const l={id:Date.now()+Math.random(),provider:e,eventName:i,data:s,timestamp:new Date,isConversion:r,isLive:a,count:1};this.events=a?[...this.events,l]:[l,...this.events],a&&this._persistEvents()}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[],sessionStorage.removeItem(t.STORAGE_KEY)}_exportEvents(){const t=this._getFilteredEvents().map(t=>({provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion,count:t.count||1})),e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=`analytics-events-${(new Date).toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(i)}async _copyEvent(t,e){e.stopPropagation();const i={provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion};try{await navigator.clipboard.writeText(JSON.stringify(i,null,2));const t=e.target;t.classList.add("btn-copy--copied"),t.textContent="Copied!",setTimeout(()=>{t.classList.remove("btn-copy--copied"),t.textContent="Copy"},1500)}catch(s){console.error("[TDT] Failed to copy event:",s)}}_filterEvents(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t}_toggleExpand(t){const e=new Set(this.expandedEvents);e.has(t)?e.delete(t):e.add(t),this.expandedEvents=e}_getFilteredEvents(){let t=this.events;if("all"!==this.activeFilter&&(t="conversion"===this.activeFilter?t.filter(t=>t.isConversion):t.filter(t=>t.provider===this.activeFilter)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.eventName.toLowerCase().includes(e)||JSON.stringify(t.data).toLowerCase().includes(e))}return t}_getCounts(){const e={all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length},i=Object.keys(t.PROVIDERS);for(const t of i)e[t]=this.events.filter(e=>e.provider===t).length;return e}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,i;const{data:s}=t,a=[];return s.currency&&a.push({label:"Currency",value:s.currency}),void 0!==s.value&&a.push({label:"Value",value:s.value}),s.transaction_id&&a.push({label:"Order",value:s.transaction_id}),(null==(e=s.items)?void 0:e.length)&&a.push({label:"Items",value:s.items.length}),s.item_id&&a.push({label:"Item ID",value:s.item_id}),s.item_name&&a.push({label:"Item",value:s.item_name}),s.content_name&&a.push({label:"Content",value:s.content_name}),(null==(i=s.content_ids)?void 0:i.length)&&a.push({label:"IDs",value:s.content_ids.length}),a}_renderProviderBadges(){const e=["ga4","ga","fbpixel","tiktok","pinterest","snapchat","klaviyo","shopify","webpixel","datalayer"].filter(t=>this._detectedProviders.has(t));return 0===e.length?U`<span style="color: var(--tdt-text-muted); font-size: calc(10px * var(--tdt-scale, 1));">None detected</span>`:U`
|
|
4423
|
+
`]),__publicField(Ca,"COUNTRY_FLAGS",{US:"🇺🇸",CA:"🇨🇦",GB:"🇬🇧",AU:"🇦🇺",DE:"🇩🇪",FR:"🇫🇷",ES:"🇪🇸",IT:"🇮🇹",JP:"🇯🇵",CN:"🇨🇳",BR:"🇧🇷",MX:"🇲🇽",NL:"🇳🇱",SE:"🇸🇪",NO:"🇳🇴",DK:"🇩🇰",FI:"🇫🇮",PL:"🇵🇱",AT:"🇦🇹",CH:"🇨🇭",BE:"🇧🇪",IE:"🇮🇪",NZ:"🇳🇿",SG:"🇸🇬",HK:"🇭🇰",KR:"🇰🇷",IN:"🇮🇳",AE:"🇦🇪",SA:"🇸🇦",ZA:"🇿🇦",PT:"🇵🇹",CZ:"🇨🇿",RO:"🇷🇴",HU:"🇭🇺",IL:"🇮🇱"}),__publicField(Ca,"LANGUAGE_FLAGS",{en:"🇬🇧",es:"🇪🇸",fr:"🇫🇷",de:"🇩🇪",it:"🇮🇹",pt:"🇵🇹",nl:"🇳🇱",pl:"🇵🇱",ja:"🇯🇵",zh:"🇨🇳",ko:"🇰🇷",ar:"🇸🇦",ru:"🇷🇺",sv:"🇸🇪",da:"🇩🇰",fi:"🇫🇮",no:"🇳🇴",cs:"🇨🇿",hu:"🇭🇺",ro:"🇷🇴"});let Ea=Ca;customElements.define("tdt-localization-panel",Ea);const Aa=class t extends ot{constructor(){super(),this.events=[],this.dataLayerSnapshots=[],this.filter="",this.activeFilter="all",this.expandedEvents=new Set,this.isPaused=!1,this._detectedProviders=new Set}connectedCallback(){super.connectedCallback(),this._loadPersistedEvents(),this._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptGaUniversal(),this._interceptFbPixel(),this._interceptTikTok(),this._interceptPinterest(),this._interceptSnapchat(),this._interceptKlaviyo(),this._interceptShopifyAnalytics(),this._interceptWebPixels(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_loadPersistedEvents(){try{const e=sessionStorage.getItem(t.STORAGE_KEY);if(e){const t=JSON.parse(e);this.events=t.map(t=>({...t,timestamp:new Date(t.timestamp),isLive:!1}))}}catch(e){console.warn("[TDT] Failed to load persisted events:",e)}}_persistEvents(){try{const e=this.events.slice(-500).map(t=>({id:t.id,provider:t.provider,eventName:t.eventName,data:this._safeCloneData(t.data),timestamp:t.timestamp.toISOString(),isConversion:t.isConversion,isLive:t.isLive,count:t.count}));sessionStorage.setItem(t.STORAGE_KEY,JSON.stringify(e))}catch(e){console.warn("[TDT] Failed to persist events:",e)}}_safeCloneData(t,e=new WeakSet){if(null===t||"object"!=typeof t)return t;if(e.has(t))return"[Circular]";if(t instanceof Element||t instanceof Node)return"[DOM Element]";if("function"==typeof t)return"[Function]";if(e.add(t),Array.isArray(t))return t.map(t=>this._safeCloneData(t,e));const i={};for(const s of Object.keys(t))try{const a=t[s];if("renderOptions"===s||"host"===s||s.startsWith("__"))continue;i[s]=this._safeCloneData(a,e)}catch{i[s]="[Unserializable]"}return i}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.ga&&this._detectedProviders.add("ga"),window.fbq&&this._detectedProviders.add("fbpixel"),window.ttq&&this._detectedProviders.add("tiktok"),window.pintrk&&this._detectedProviders.add("pinterest"),window.snaptr&&this._detectedProviders.add("snapchat"),window._learnq&&this._detectedProviders.add("klaviyo"),(null==(t=window.Shopify)?void 0:t.analytics)&&this._detectedProviders.add("shopify")}_interceptDataLayer(){window.dataLayer||(window.dataLayer=[]);const t=window.dataLayer.push.bind(window.dataLayer),e=this;window.dataLayer.push=function(...i){return i.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...i)},this._originalDataLayerPush=t,window.dataLayer.forEach(t=>{t&&"object"==typeof t&&this._addEvent("datalayer",t.event||"push",t,!1)})}_interceptGtag(){if(!window.gtag)return;const t=window.gtag,e=this;window.gtag=function(i,...s){if(!e.isPaused)if("event"===i){const[t,i]=s;e._addEvent("ga4",t,i||{}),e._detectedProviders.add("ga4")}else"config"===i&&e._addEvent("ga4","config",{measurementId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGtag=t}_interceptGaUniversal(){if(!window.ga)return;const t=window.ga,e=this;window.ga=function(i,...s){if(!e.isPaused)if("send"===i){const[t,...i]=s;if("event"===t){const[t,s,a,r]=i;e._addEvent("ga",s||"event",{category:t,action:s,label:a,value:r})}else"pageview"===t&&e._addEvent("ga","pageview",{page:i[0]});e._detectedProviders.add("ga")}else"function"==typeof i||"create"===i&&e._addEvent("ga","create",{trackingId:s[0],...s[1]});return t.call(this,i,...s)},this._originalGa=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(i,...s){if(!e.isPaused)if("track"===i||"trackCustom"===i){const[t,i]=s;e._addEvent("fbpixel",t,i||{}),e._detectedProviders.add("fbpixel")}else"init"===i&&e._addEvent("fbpixel","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalFbq=t}_interceptTikTok(){if(!window.ttq)return;const t=window.ttq,e=this;if(t.track){const i=t.track.bind(t);t.track=function(t,s){return e.isPaused||(e._addEvent("tiktok",t,s||{}),e._detectedProviders.add("tiktok")),i(t,s)},this._originalTtqTrack=i}if(t.page){const i=t.page.bind(t);t.page=function(){return e.isPaused||(e._addEvent("tiktok","PageView",{}),e._detectedProviders.add("tiktok")),i()},this._originalTtqPage=i}}_interceptPinterest(){if(!window.pintrk)return;const t=window.pintrk,e=this;window.pintrk=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("pinterest",t,i||{}),e._detectedProviders.add("pinterest")}else"load"===i&&e._addEvent("pinterest","load",{tagId:s[0]});return t.call(this,i,...s)},this._originalPintrk=t}_interceptSnapchat(){if(!window.snaptr)return;const t=window.snaptr,e=this;window.snaptr=function(i,...s){if(!e.isPaused)if("track"===i){const[t,i]=s;e._addEvent("snapchat",t,i||{}),e._detectedProviders.add("snapchat")}else"init"===i&&e._addEvent("snapchat","init",{pixelId:s[0]});return t.call(this,i,...s)},this._originalSnaptr=t}_interceptKlaviyo(){if(!window._learnq)return;const t=window._learnq,e=this;if(Array.isArray(t)){const i=t.push.bind(t);t.push=function(t){if(!e.isPaused&&Array.isArray(t)){const[i,...s]=t;if("track"===i){const[t,i]=s;e._addEvent("klaviyo",t,i||{}),e._detectedProviders.add("klaviyo")}else"identify"===i&&e._addEvent("klaviyo","identify",s[0]||{})}return i(t)},this._originalLearnqPush=i}}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,i=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,s){return i.isPaused||(i._addEvent("shopify",e,s||{}),i._detectedProviders.add("shopify")),t(e,s)},this._originalShopifyPublish=t}}_interceptWebPixels(){var t,e;if(!(null==(e=null==(t=window.Shopify)?void 0:t.analytics)?void 0:e.subscribe))return;const i=window.Shopify.analytics,s=this,a=i.subscribe.bind(i);i.subscribe=function(t,e){return a(t,i=>(s.isPaused||(s._addEvent("webpixel",t,i||{}),s._detectedProviders.add("webpixel")),e(i)))},this._originalWebPixelSubscribe=a}_interceptCustomEvents(){const t=this;this._customEventHandler=e=>{!t.isPaused&&e.detail&&t._addEvent("custom",e.type,e.detail)},["analytics","tracking","gtm","conversion"].forEach(t=>{document.addEventListener(t,this._customEventHandler)})}_restoreInterceptors(){this._originalDataLayerPush&&window.dataLayer&&(window.dataLayer.push=this._originalDataLayerPush),this._originalGtag&&(window.gtag=this._originalGtag),this._originalFbq&&(window.fbq=this._originalFbq),["analytics","tracking","gtm","conversion"].forEach(t=>{document.removeEventListener(t,this._customEventHandler)})}_getEventKey(t,e,i){return`${t}:${e}:${JSON.stringify(i,Object.keys(i||{}).sort())}`}_addEvent(e,i,s,a=!0){const r=t.CONVERSION_EVENTS.some(t=>i.toLowerCase().includes(t.toLowerCase())),n=this._getEventKey(e,i,s),o=this.events.find(t=>Date.now()-t.timestamp.getTime()<500&&this._getEventKey(t.provider,t.eventName,t.data)===n);if(o)return o.count=(o.count||1)+1,this.events=[...this.events],void this._persistEvents();const l={id:Date.now()+Math.random(),provider:e,eventName:i,data:s,timestamp:new Date,isConversion:r,isLive:a,count:1};this.events=a?[...this.events,l]:[l,...this.events],a&&this._persistEvents()}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[],sessionStorage.removeItem(t.STORAGE_KEY)}_exportEvents(){const t=this._getFilteredEvents().map(t=>({provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion,count:t.count||1})),e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(e),s=document.createElement("a");s.href=i,s.download=`analytics-events-${(new Date).toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(i)}async _copyEvent(t,e){e.stopPropagation();const i={provider:t.provider,eventName:t.eventName,data:t.data,timestamp:t.timestamp.toISOString(),isConversion:t.isConversion};try{await navigator.clipboard.writeText(JSON.stringify(i,null,2));const t=e.target;t.classList.add("btn-copy--copied"),t.textContent="Copied!",setTimeout(()=>{t.classList.remove("btn-copy--copied"),t.textContent="Copy"},1500)}catch(s){console.error("[TDT] Failed to copy event:",s)}}_filterEvents(t){this.filter=t.target.value}_setFilter(t){this.activeFilter=t}_toggleExpand(t){const e=new Set(this.expandedEvents);e.has(t)?e.delete(t):e.add(t),this.expandedEvents=e}_getFilteredEvents(){let t=this.events;if("all"!==this.activeFilter&&(t="conversion"===this.activeFilter?t.filter(t=>t.isConversion):t.filter(t=>t.provider===this.activeFilter)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.eventName.toLowerCase().includes(e)||JSON.stringify(t.data).toLowerCase().includes(e))}return t}_getCounts(){const e={all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length},i=Object.keys(t.PROVIDERS);for(const t of i)e[t]=this.events.filter(e=>e.provider===t).length;return e}_formatTime(t){return t instanceof Date||(t=new Date(t)),isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,i;const{data:s}=t,a=[];return s.currency&&a.push({label:"Currency",value:s.currency}),void 0!==s.value&&a.push({label:"Value",value:s.value}),s.transaction_id&&a.push({label:"Order",value:s.transaction_id}),(null==(e=s.items)?void 0:e.length)&&a.push({label:"Items",value:s.items.length}),s.item_id&&a.push({label:"Item ID",value:s.item_id}),s.item_name&&a.push({label:"Item",value:s.item_name}),s.content_name&&a.push({label:"Content",value:s.content_name}),(null==(i=s.content_ids)?void 0:i.length)&&a.push({label:"IDs",value:s.content_ids.length}),a}_renderProviderBadges(){const e=["ga4","ga","fbpixel","tiktok","pinterest","snapchat","klaviyo","shopify","webpixel","datalayer"].filter(t=>this._detectedProviders.has(t));return 0===e.length?U`<span style="color: var(--tdt-text-muted); font-size: calc(10px * var(--tdt-scale, 1));">None detected</span>`:U`
|
|
4550
4424
|
<div class="detected-providers">
|
|
4551
4425
|
${e.map(e=>{const i=t.PROVIDERS[e];return U`
|
|
4552
4426
|
<span class="provider-badge provider-badge--active">
|
|
@@ -5096,7 +4970,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5096
4970
|
background: rgba(92, 106, 196, 0.2);
|
|
5097
4971
|
color: #5c6ac4;
|
|
5098
4972
|
}
|
|
5099
|
-
`]),__publicField(Aa,"CONVERSION_EVENTS",["purchase","add_to_cart","begin_checkout","add_payment_info","add_shipping_info","view_item","view_item_list","select_item","remove_from_cart","view_cart","sign_up","login","search","Purchase","AddToCart","InitiateCheckout","AddPaymentInfo","ViewContent","Lead","CompleteRegistration","Subscribe"]),__publicField(Aa,"PROVIDERS",{ga4:{name:"GA4",color:"#4285f4"},ga:{name:"GA Universal",color:"#e37400"},fbpixel:{name:"FB Pixel",color:"#1877f2"},tiktok:{name:"TikTok",color:"#000000"},pinterest:{name:"Pinterest",color:"#e60023"},snapchat:{name:"Snapchat",color:"#fffc00"},klaviyo:{name:"Klaviyo",color:"#2d2d2d"},shopify:{name:"Shopify",color:"#96bf48"},webpixel:{name:"Web Pixel",color:"#5c6ac4"},datalayer:{name:"DataLayer",color:"#f9ab00"},custom:{name:"Custom",color:"#9382ff"}}),__publicField(Aa,"STORAGE_KEY","tdt-analytics-events");let Oa=Aa;customElements.define("tdt-analytics-panel",Oa);const La=class t extends ot{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this.headings=[],this.links={internal:[],external:[],nofollow:[]},this.contentStats={},this.copiedField=null,this._expandedSchemas=new Set,this._previewType="google"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._scanHeadings(),this._scanLinks(),this._analyzeContent(),this._generateIssues()}_scanMetaTags(){var e;const i=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let s="";e&&(s=t.attr?e.getAttribute(t.attr):e.textContent);const a=(null==s?void 0:s.length)||0;let r="success",n="";s?t.maxLength&&a>t.maxLength?(r="warning",n=`Too long (${a}/${t.maxLength} chars)`):t.minLength&&a<t.minLength&&(r="warning",n=`Too short (${a}/${t.minLength} min chars)`):(r="error",n="Missing - this tag is required"),i.push({name:t.name,value:s||null,length:a,maxLength:t.maxLength,minLength:t.minLength,status:r,hint:n})});const s=document.querySelector('link[rel="canonical"]');i.push({name:"canonical",value:(null==s?void 0:s.href)||null,status:s?"success":"warning",hint:s?"":"Recommended for SEO"});const a=document.querySelector('meta[name="robots"]');i.push({name:"robots",value:(null==a?void 0:a.content)||null,status:"success",hint:(null==(e=null==a?void 0:a.content)?void 0:e.includes("noindex"))?"⚠️ Page is set to noindex":""}),this.metaTags=i}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const i=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const i=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,i)=>{try{const s=JSON.parse(t.textContent);(Array.isArray(s)?s:[s]).forEach(t=>{e.push({id:`schema-${i}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(s){e.push({id:`schema-${i}`,type:"Invalid JSON",data:{error:s.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,i)=>{const s=t.getAttribute("alt"),a=t.src||t.dataset.src;a&&!a.startsWith("data:")&&e.push({id:i,src:a,alt:s,hasAlt:null!==s&&""!==s,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_scanHeadings(){const t=[];document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((e,i)=>{var s;const a=parseInt(e.tagName[1]),r=(null==(s=e.textContent)?void 0:s.trim())||"";(null!==e.offsetParent||e.closest('[style*="display: none"]'))&&t.push({id:i,level:a,tag:e.tagName.toLowerCase(),text:r.substring(0,200),isEmpty:!r})}),this.headings=t}_scanLinks(){const t=document.querySelectorAll("a[href]"),e=[],i=[],s=[],a=window.location.hostname;t.forEach((t,r)=>{var n;const o=t.href,l=(null==(n=t.textContent)?void 0:n.trim().substring(0,100))||"",
|
|
4973
|
+
`]),__publicField(Aa,"CONVERSION_EVENTS",["purchase","add_to_cart","begin_checkout","add_payment_info","add_shipping_info","view_item","view_item_list","select_item","remove_from_cart","view_cart","sign_up","login","search","Purchase","AddToCart","InitiateCheckout","AddPaymentInfo","ViewContent","Lead","CompleteRegistration","Subscribe"]),__publicField(Aa,"PROVIDERS",{ga4:{name:"GA4",color:"#4285f4"},ga:{name:"GA Universal",color:"#e37400"},fbpixel:{name:"FB Pixel",color:"#1877f2"},tiktok:{name:"TikTok",color:"#000000"},pinterest:{name:"Pinterest",color:"#e60023"},snapchat:{name:"Snapchat",color:"#fffc00"},klaviyo:{name:"Klaviyo",color:"#2d2d2d"},shopify:{name:"Shopify",color:"#96bf48"},webpixel:{name:"Web Pixel",color:"#5c6ac4"},datalayer:{name:"DataLayer",color:"#f9ab00"},custom:{name:"Custom",color:"#9382ff"}}),__publicField(Aa,"STORAGE_KEY","tdt-analytics-events");let Oa=Aa;customElements.define("tdt-analytics-panel",Oa);const La=class t extends ot{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this.headings=[],this.links={internal:[],external:[],nofollow:[]},this.contentStats={},this.copiedField=null,this._expandedSchemas=new Set,this._previewType="google"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._scanHeadings(),this._scanLinks(),this._analyzeContent(),this._generateIssues()}_scanMetaTags(){var e;const i=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let s="";e&&(s=t.attr?e.getAttribute(t.attr):e.textContent);const a=(null==s?void 0:s.length)||0;let r="success",n="";s?t.maxLength&&a>t.maxLength?(r="warning",n=`Too long (${a}/${t.maxLength} chars)`):t.minLength&&a<t.minLength&&(r="warning",n=`Too short (${a}/${t.minLength} min chars)`):(r="error",n="Missing - this tag is required"),i.push({name:t.name,value:s||null,length:a,maxLength:t.maxLength,minLength:t.minLength,status:r,hint:n})});const s=document.querySelector('link[rel="canonical"]');i.push({name:"canonical",value:(null==s?void 0:s.href)||null,status:s?"success":"warning",hint:s?"":"Recommended for SEO"});const a=document.querySelector('meta[name="robots"]');i.push({name:"robots",value:(null==a?void 0:a.content)||null,status:"success",hint:(null==(e=null==a?void 0:a.content)?void 0:e.includes("noindex"))?"⚠️ Page is set to noindex":""}),this.metaTags=i}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const i=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const i=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==i?void 0:i.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,i)=>{try{const s=JSON.parse(t.textContent);(Array.isArray(s)?s:[s]).forEach(t=>{e.push({id:`schema-${i}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(s){e.push({id:`schema-${i}`,type:"Invalid JSON",data:{error:s.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,i)=>{const s=t.getAttribute("alt"),a=t.src||t.dataset.src;a&&!a.startsWith("data:")&&e.push({id:i,src:a,alt:s,hasAlt:null!==s&&""!==s,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_scanHeadings(){const t=[];document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((e,i)=>{var s;const a=parseInt(e.tagName[1]),r=(null==(s=e.textContent)?void 0:s.trim())||"";(null!==e.offsetParent||e.closest('[style*="display: none"]'))&&t.push({id:i,level:a,tag:e.tagName.toLowerCase(),text:r.substring(0,200),isEmpty:!r})}),this.headings=t}_scanLinks(){const t=document.querySelectorAll("a[href]"),e=[],i=[],s=[],a=window.location.hostname;t.forEach((t,r)=>{var n;const o=t.href,l=(null==(n=t.textContent)?void 0:n.trim().substring(0,100))||"",d=t.getAttribute("rel")||"",c=d.includes("nofollow");try{const t=new URL(o),n=t.hostname===a||t.hostname.endsWith("."+a),p={id:r,href:o,text:l,rel:d,isNofollow:c};c&&s.push(p),n?e.push(p):t.protocol.startsWith("http")&&i.push(p)}catch{}}),this.links={internal:e,external:i,nofollow:s}}_analyzeContent(){const t=document.body.innerText||"",e=t.split(/\s+/).filter(t=>t.length>0).length,i=Math.ceil(e/200),s=t.split(/[.!?]+/).filter(t=>t.trim().length>0).length,a=document.querySelectorAll("p").length;this.contentStats={wordCount:e,readingTime:i,sentences:s,paragraphs:a,charCount:t.length}}_generateIssues(){var t,e;const i=[],s=this.metaTags.find(t=>"title"===t.name);(null==s?void 0:s.value)?s.length>60&&i.push({type:"warning",title:"Title too long",description:`Title is ${s.length} characters (recommended: 60 max)`}):i.push({type:"error",title:"Missing page title",description:"Every page should have a unique title tag"});const a=this.metaTags.find(t=>"description"===t.name);(null==a?void 0:a.value)?a.length>160&&i.push({type:"warning",title:"Description too long",description:`Description is ${a.length} characters (recommended: 160 max)`}):i.push({type:"error",title:"Missing meta description",description:"Add a meta description for better SEO"}),(null==(t=this.openGraph["og:image"])?void 0:t.value)||i.push({type:"warning",title:"Missing og:image",description:"Add an Open Graph image for social sharing"}),(null==(e=this.openGraph["og:title"])?void 0:e.value)||i.push({type:"warning",title:"Missing og:title",description:"Add an Open Graph title for social sharing"});const r=this.images.filter(t=>!t.hasAlt);r.length>0&&i.push({type:"warning",title:`${r.length} image${r.length>1?"s":""} missing alt text`,description:"Alt text improves accessibility and SEO"});this.jsonLdData.filter(t=>!t.isValid).length>0&&i.push({type:"error",title:"Invalid JSON-LD schema",description:"Fix JSON syntax errors in structured data"});const n=this.metaTags.find(t=>"canonical"===t.name);(null==n?void 0:n.value)||i.push({type:"warning",title:"Missing canonical URL",description:"Add a canonical link to prevent duplicate content issues"});const o=this.headings.filter(t=>1===t.level).length;0===o?i.push({type:"error",title:"Missing H1 heading",description:"Every page should have exactly one H1 tag"}):o>1&&i.push({type:"warning",title:"Multiple H1 headings",description:`Found ${o} H1 tags. Recommended: 1`});const l=this.headings.map(t=>t.level);for(let d=1;d<l.length;d++)if(l[d]>l[d-1]+1){i.push({type:"warning",title:"Skipped heading level",description:`H${l[d-1]} followed by H${l[d]}. Don't skip levels.`});break}this.issues=i}async _copyValue(t,e){if(t)try{await navigator.clipboard.writeText(t),this.copiedField=e,setTimeout(()=>{this.copiedField=null},1500)}catch(i){console.error("Failed to copy:",i)}}_exportReport(){var t,e,i,s;const a=null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value,r=null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value,n={exportedAt:(new Date).toISOString(),url:window.location.href,score:this._getScore(),meta:{title:{value:a,length:(null==a?void 0:a.length)||0,maxLength:60},description:{value:r,length:(null==r?void 0:r.length)||0,maxLength:160},canonical:null==(i=this.metaTags.find(t=>"canonical"===t.name))?void 0:i.value,robots:null==(s=this.metaTags.find(t=>"robots"===t.name))?void 0:s.value},openGraph:Object.fromEntries(Object.entries(this.openGraph).map(([t,e])=>[t,e.value])),twitterCard:Object.fromEntries(Object.entries(this.twitterCard).map(([t,e])=>[t,e.value])),headings:{structure:this.headings.map(t=>({tag:t.tag,text:t.text})),h1Count:this.headings.filter(t=>1===t.level).length,totalHeadings:this.headings.length},links:{internalCount:this.links.internal.length,externalCount:this.links.external.length,nofollowCount:this.links.nofollow.length,internal:this.links.internal.slice(0,50).map(t=>({href:t.href,text:t.text})),external:this.links.external.slice(0,50).map(t=>({href:t.href,text:t.text}))},content:this.contentStats,images:{total:this.images.length,missingAlt:this.images.filter(t=>!t.hasAlt).length,withAlt:this.images.filter(t=>t.hasAlt).length},schema:this.jsonLdData.map(t=>({type:t.type,isValid:t.isValid,data:t.data})),issues:this.issues},o=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),l=URL.createObjectURL(o),d=document.createElement("a");d.href=l,d.download=`seo-report-${(new Date).toISOString().slice(0,10)}.json`,d.click(),URL.revokeObjectURL(l)}_getScore(){let t=10;return this.issues.forEach(e=>{"error"===e.type?t-=2:"warning"===e.type&&(t-=1)}),Math.max(0,t)}_getScoreClass(t){return t>=8?"good":t>=5?"warning":"error"}_setTab(t){this.activeTab=t}_setPreviewType(t){this._previewType=t,this.requestUpdate()}_toggleSchema(t){const e=new Set(this._expandedSchemas);e.has(t)?e.delete(t):e.add(t),this._expandedSchemas=e,this.requestUpdate()}_openRichResultsTest(){const t=`https://search.google.com/test/rich-results?url=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank")}_renderOverview(){var t,e;const i=this._getScore(),s=this._getScoreClass(i),a=this.issues.filter(t=>"error"===t.type).length,r=this.issues.filter(t=>"warning"===t.type).length,n=(null==(t=this.metaTags.find(t=>"title"===t.name))?void 0:t.value)||"",o=(null==(e=this.metaTags.find(t=>"description"===t.name))?void 0:e.value)||"";return U`
|
|
5100
4974
|
<div class="score-card">
|
|
5101
4975
|
<div class="score score--${s}">${i}/10</div>
|
|
5102
4976
|
<div class="score-details">
|
|
@@ -5181,7 +5055,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5181
5055
|
`)}
|
|
5182
5056
|
</div>
|
|
5183
5057
|
</div>
|
|
5184
|
-
`}_renderSocialPreview(){var t,e,i,s,a,r,n,o,l;const
|
|
5058
|
+
`}_renderSocialPreview(){var t,e,i,s,a,r,n,o,l;const d=null==(t=this.openGraph["og:image"])?void 0:t.value,c=(null==(e=this.openGraph["og:title"])?void 0:e.value)||(null==(i=this.metaTags.find(t=>"title"===t.name))?void 0:i.value),p=(null==(s=this.openGraph["og:description"])?void 0:s.value)||(null==(a=this.metaTags.find(t=>"description"===t.name))?void 0:a.value),u=(null==(r=this.openGraph["og:site_name"])?void 0:r.value)||window.location.hostname,h=(null==(n=this.twitterCard["twitter:image"])?void 0:n.value)||d,g=(null==(o=this.twitterCard["twitter:title"])?void 0:o.value)||c,v=(null==(l=this.twitterCard["twitter:description"])?void 0:l.value)||p;return U`
|
|
5185
5059
|
<div class="preview-tabs">
|
|
5186
5060
|
<button
|
|
5187
5061
|
class="preview-tab ${"facebook"===this._previewType?"preview-tab--active":""}"
|
|
@@ -5206,18 +5080,18 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5206
5080
|
${"facebook"===this._previewType||"linkedin"===this._previewType?U`
|
|
5207
5081
|
<div class="og-preview">
|
|
5208
5082
|
<div class="og-preview__image">
|
|
5209
|
-
${
|
|
5083
|
+
${d?U`<img src="${d}" alt="OG Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
|
|
5210
5084
|
</div>
|
|
5211
5085
|
<div class="og-preview__content">
|
|
5212
|
-
<div class="og-preview__site">${
|
|
5213
|
-
<div class="og-preview__title">${
|
|
5086
|
+
<div class="og-preview__site">${u}</div>
|
|
5087
|
+
<div class="og-preview__title">${c||"No title set"}</div>
|
|
5214
5088
|
<div class="og-preview__description">${p||"No description set"}</div>
|
|
5215
5089
|
</div>
|
|
5216
5090
|
</div>
|
|
5217
5091
|
`:U`
|
|
5218
5092
|
<div class="twitter-preview">
|
|
5219
5093
|
<div class="twitter-preview__image">
|
|
5220
|
-
${
|
|
5094
|
+
${h?U`<img src="${h}" alt="Twitter Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
|
|
5221
5095
|
</div>
|
|
5222
5096
|
<div class="twitter-preview__content">
|
|
5223
5097
|
<div class="twitter-preview__title">${g||"No title set"}</div>
|
|
@@ -5929,10 +5803,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5929
5803
|
color: var(--tdt-error);
|
|
5930
5804
|
}
|
|
5931
5805
|
|
|
5932
|
-
/* SERP Preview -
|
|
5806
|
+
/* SERP Preview - Respects theme preference */
|
|
5933
5807
|
.serp-preview {
|
|
5934
|
-
background:
|
|
5935
|
-
border: 1px solid
|
|
5808
|
+
background: var(--tdt-bg-secondary);
|
|
5809
|
+
border: 1px solid var(--tdt-serp-border);
|
|
5936
5810
|
border-radius: 8px;
|
|
5937
5811
|
padding: 16px;
|
|
5938
5812
|
max-width: 600px;
|
|
@@ -5950,7 +5824,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5950
5824
|
width: 26px;
|
|
5951
5825
|
height: 26px;
|
|
5952
5826
|
border-radius: 50%;
|
|
5953
|
-
background:
|
|
5827
|
+
background: var(--tdt-serp-favicon-bg);
|
|
5954
5828
|
display: flex;
|
|
5955
5829
|
align-items: center;
|
|
5956
5830
|
justify-content: center;
|
|
@@ -5959,17 +5833,17 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5959
5833
|
|
|
5960
5834
|
.serp-preview__domain {
|
|
5961
5835
|
font-size: calc(14px * var(--tdt-scale, 1));
|
|
5962
|
-
color:
|
|
5836
|
+
color: var(--tdt-serp-domain);
|
|
5963
5837
|
}
|
|
5964
5838
|
|
|
5965
5839
|
.serp-preview__breadcrumb {
|
|
5966
5840
|
font-size: calc(12px * var(--tdt-scale, 1));
|
|
5967
|
-
color:
|
|
5841
|
+
color: var(--tdt-serp-breadcrumb);
|
|
5968
5842
|
}
|
|
5969
5843
|
|
|
5970
5844
|
.serp-preview__title {
|
|
5971
5845
|
font-size: calc(20px * var(--tdt-scale, 1));
|
|
5972
|
-
color:
|
|
5846
|
+
color: var(--tdt-serp-title);
|
|
5973
5847
|
line-height: 1.3;
|
|
5974
5848
|
margin-bottom: 4px;
|
|
5975
5849
|
cursor: pointer;
|
|
@@ -5985,7 +5859,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
5985
5859
|
|
|
5986
5860
|
.serp-preview__description {
|
|
5987
5861
|
font-size: calc(14px * var(--tdt-scale, 1));
|
|
5988
|
-
color:
|
|
5862
|
+
color: var(--tdt-serp-description);
|
|
5989
5863
|
line-height: 1.58;
|
|
5990
5864
|
display: -webkit-box;
|
|
5991
5865
|
-webkit-line-clamp: 2;
|
|
@@ -6507,7 +6381,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
6507
6381
|
border-color: var(--tdt-accent);
|
|
6508
6382
|
color: white;
|
|
6509
6383
|
}
|
|
6510
|
-
`]),__publicField(La,"REQUIRED_META",[{name:"title",selector:"title",maxLength:60,minLength:30},{name:"description",selector:'meta[name="description"]',attr:"content",maxLength:160,minLength:70},{name:"viewport",selector:'meta[name="viewport"]',attr:"content"},{name:"charset",selector:"meta[charset]",attr:"charset"}]),__publicField(La,"OG_TAGS",[{name:"og:title",required:!0},{name:"og:description",required:!0},{name:"og:image",required:!0},{name:"og:url",required:!0},{name:"og:type",required:!1},{name:"og:site_name",required:!1}]),__publicField(La,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let
|
|
6384
|
+
`]),__publicField(La,"REQUIRED_META",[{name:"title",selector:"title",maxLength:60,minLength:30},{name:"description",selector:'meta[name="description"]',attr:"content",maxLength:160,minLength:70},{name:"viewport",selector:'meta[name="viewport"]',attr:"content"},{name:"charset",selector:"meta[charset]",attr:"charset"}]),__publicField(La,"OG_TAGS",[{name:"og:title",required:!0},{name:"og:description",required:!0},{name:"og:image",required:!0},{name:"og:url",required:!0},{name:"og:type",required:!1},{name:"og:site_name",required:!1}]),__publicField(La,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let ja=La;customElements.define("tdt-seo-panel",ja);const za=class t extends ot{constructor(){super(),this.appBlocks=[],this.scripts=[],this.appEmbeds=[],this.pixelScripts=[],this.activeTab="all",this.searchTerm="",this._expandedItems=new Set}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanAppBlocks(),this._scanScripts(),this._scanAppEmbeds(),this._categorizeScripts()}_scanAppBlocks(){const t=[];document.querySelectorAll('[data-shopify-editor-block], [data-block-type*="shopify://apps"], .shopify-app-block').forEach((e,i)=>{var s;const a=e.getAttribute("data-block-type")||"",r=e.getAttribute("data-block-id")||e.id||`block-${i}`,n=(null==(s=e.closest("[data-section-id]"))?void 0:s.getAttribute("data-section-id"))||"unknown";let o="Unknown App";const l=a.match(/shopify:\/\/apps\/([^/]+)/);l&&(o=l[1].replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())),t.push({id:r,type:"app-block",name:o,blockType:a,sectionId:n,element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})});document.querySelectorAll('[id*="shopify-block"], [class*="shopify-app"]').forEach((e,i)=>{t.find(t=>t.element===e)||t.push({id:e.id||`theme-block-${i}`,type:"theme-block",name:"Theme App Block",element:e,tagName:e.tagName.toLowerCase(),classes:Array.from(e.classList).slice(0,5).join(", ")})}),this.appBlocks=t}_scanScripts(){const t=[];document.querySelectorAll("script").forEach((e,i)=>{var s;const a=e.src||"",r=e.type||"text/javascript",n=e.async,o=e.defer,l=!a,d=l?null==(s=e.textContent)?void 0:s.substring(0,500):"";if(l&&!(null==d?void 0:d.trim()))return;const c=this._identifyVendor(a||d),p=this._isPixelScript(a,d),u=this._isShopifyCoreScript(a),h=this._extractVersion(a,d);u&&!p||t.push({id:`script-${i}`,src:a,type:r,isAsync:n,isDefer:o,isInline:l,content:d,vendor:c,isPixel:p,version:h,element:e,size:l?new Blob([d]).size:null})}),this.scripts=t}_scanAppEmbeds(){const t=[];document.querySelectorAll("[data-app-embed], [data-shopify-app-embed], .shopify-app-embed").forEach((e,i)=>{const s=e.getAttribute("data-app-embed")||e.getAttribute("data-shopify-app-embed")||"";t.push({id:`embed-${i}`,type:"embed",appId:s,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})});document.querySelectorAll('[style*="position: fixed"], [style*="position:fixed"]').forEach((e,i)=>{if(e.closest("theme-devtools"))return;const s=this._identifyVendorFromElement(e);if(s){t.find(t=>t.element===e)||t.push({id:`widget-${i}`,type:"widget",name:s.name,vendor:s.key,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})}}),this.appEmbeds=t}_categorizeScripts(){this.pixelScripts=this.scripts.filter(t=>t.isPixel)}_extractVersion(t,e=""){const i=[/[?&/]v(\d+\.\d+(?:\.\d+)?)/i,/version[=:](\d+\.\d+(?:\.\d+)?)/i,/@(\d+\.\d+(?:\.\d+)?)/,/\/(\d+\.\d+\.\d+)\//,/[-.](\d+\.\d+\.\d+)\.(?:min\.)?js/i,/_v(\d+\.\d+(?:\.\d+)?)/i];for(const s of i){const e=t.match(s);if(e)return e[1]}if(e){const t=[/version['":\s]+['"]?(\d+\.\d+(?:\.\d+)?)/i,/VERSION\s*[=:]\s*['"](\d+\.\d+(?:\.\d+)?)/i,/\bv(\d+\.\d+\.\d+)\b/,/shopify-(\d+\.\d+\.\d+)/i];for(const i of t){const t=e.match(i);if(t)return t[1]}}return null}_identifyVendor(e){const i=e.toLowerCase();for(const[s,a]of Object.entries(t.KNOWN_APPS))if(a.patterns.some(t=>i.includes(t)))return{key:s,...a};return null}_identifyVendorFromElement(e){var i,s,a;const r=(null==(i=e.className)?void 0:i.toLowerCase())||"",n=(null==(s=e.id)?void 0:s.toLowerCase())||"",o=(null==(a=e.innerHTML)?void 0:a.substring(0,1e3).toLowerCase())||"";for(const[l,d]of Object.entries(t.KNOWN_APPS))if(d.patterns.some(t=>r.includes(t)||n.includes(t)||o.includes(t)))return{key:l,...d};return null}_isPixelScript(t,e){const i=(t+e).toLowerCase();return["fbevents","facebook","pixel","gtag","gtm.js","googletagmanager","google-analytics","analytics.tiktok","tiktok","pintrk","pinterest","snapchat","sc-static","monorail","trekkie"].some(t=>i.includes(t))}_isShopifyCoreScript(t){return["cdn.shopify.com/shopifycloud","cdn.shopify.com/s/files","/assets/"].some(e=>t.includes(e))}_getPosition(t){t.getBoundingClientRect();const e=window.getComputedStyle(t);return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,position:e.position}}_toggleExpand(t){this._expandedItems.has(t)?this._expandedItems.delete(t):this._expandedItems.add(t),this.requestUpdate()}_highlightElement(t){if(!t)return;t.scrollIntoView({behavior:"smooth",block:"center"});const e=t.style.outline,i=t.style.transition;t.style.transition="outline 0.2s ease",t.style.outline="3px solid #3b82f6",setTimeout(()=>{t.style.outline=e,t.style.transition=i},2e3)}_copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this._showFeedback("Copied!")})}_showFeedback(t){const e=new CustomEvent("show-feedback",{detail:{message:t},bubbles:!0,composed:!0});this.dispatchEvent(e)}_setActiveTab(t){this.activeTab=t}_handleSearch(t){this.searchTerm=t.target.value}_getFilteredItems(){const t=this.searchTerm.toLowerCase();let e=[];return"all"!==this.activeTab&&"blocks"!==this.activeTab||(e=[...e,...this.appBlocks.map(t=>({...t,category:"block"}))]),"all"!==this.activeTab&&"scripts"!==this.activeTab||(e=[...e,...this.scripts.filter(t=>!t.isPixel).map(t=>({...t,category:"script"}))]),"all"!==this.activeTab&&"pixels"!==this.activeTab||(e=[...e,...this.pixelScripts.map(t=>({...t,category:"pixel"}))]),"all"!==this.activeTab&&"embeds"!==this.activeTab||(e=[...e,...this.appEmbeds.map(t=>({...t,category:"embed"}))]),t&&(e=e.filter(e=>this._matchesSearch(e,t))),e}_matchesSearch(t,e){var i;if((t.name||(null==(i=t.vendor)?void 0:i.name)||"").toLowerCase().includes(e))return!0;if((t.src||"").toLowerCase().includes(e))return!0;if((t.blockType||"").toLowerCase().includes(e))return!0;if((t.appId||"").toLowerCase().includes(e))return!0;if((t.content||"").toLowerCase().includes(e))return!0;if((t.classes||"").toLowerCase().includes(e))return!0;return!!(t.version||"").toLowerCase().includes(e)}_getVendorIcon(t){return t?U`<span class="vendor-icon vendor-icon--${t.key}">${t.icon}</span>`:U`<span class="vendor-icon vendor-icon--unknown">?</span>`}_renderItem(t){const e=this._expandedItems.has(t.id),i=t.vendor,s=t.name||(null==i?void 0:i.name)||this._extractNameFromSrc(t.src)||"Unknown";return U`
|
|
6511
6385
|
<div class="item item--${"pixel"===t.category?"warning":"embed"===t.category?"success":"info"}">
|
|
6512
6386
|
<div class="item__header" @click=${()=>this._toggleExpand(t.id)}>
|
|
6513
6387
|
<div class="item__main">
|
|
@@ -6678,7 +6552,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
6678
6552
|
${t.map(t=>this._renderItem(t))}
|
|
6679
6553
|
</div>
|
|
6680
6554
|
`}
|
|
6681
|
-
`}};__publicField(
|
|
6555
|
+
`}};__publicField(za,"properties",{appBlocks:{type:Array,state:!0},scripts:{type:Array,state:!0},appEmbeds:{type:Array,state:!0},pixelScripts:{type:Array,state:!0},activeTab:{type:String,state:!0},searchTerm:{type:String,state:!0}}),__publicField(za,"styles",[pt,n`
|
|
6682
6556
|
:host {
|
|
6683
6557
|
display: block;
|
|
6684
6558
|
padding: 12px;
|
|
@@ -6957,130 +6831,1531 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
6957
6831
|
background: var(--tdt-bg);
|
|
6958
6832
|
}
|
|
6959
6833
|
|
|
6960
|
-
.item__detail {
|
|
6961
|
-
display: flex;
|
|
6962
|
-
gap: 8px;
|
|
6963
|
-
margin-bottom: 4px;
|
|
6964
|
-
font-size: calc(10px * var(--tdt-scale, 1));
|
|
6834
|
+
.item__detail {
|
|
6835
|
+
display: flex;
|
|
6836
|
+
gap: 8px;
|
|
6837
|
+
margin-bottom: 4px;
|
|
6838
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
6839
|
+
}
|
|
6840
|
+
|
|
6841
|
+
.item__detail:last-child {
|
|
6842
|
+
margin-bottom: 0;
|
|
6843
|
+
}
|
|
6844
|
+
|
|
6845
|
+
.item__detail-label {
|
|
6846
|
+
color: var(--tdt-text-muted);
|
|
6847
|
+
flex-shrink: 0;
|
|
6848
|
+
min-width: 60px;
|
|
6849
|
+
}
|
|
6850
|
+
|
|
6851
|
+
.item__detail-value {
|
|
6852
|
+
color: var(--tdt-text);
|
|
6853
|
+
word-break: break-all;
|
|
6854
|
+
font-family: var(--tdt-font-mono);
|
|
6855
|
+
}
|
|
6856
|
+
|
|
6857
|
+
.item__detail-value--link {
|
|
6858
|
+
color: var(--tdt-accent);
|
|
6859
|
+
cursor: pointer;
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
.item__detail-value--link:hover {
|
|
6863
|
+
text-decoration: underline;
|
|
6864
|
+
}
|
|
6865
|
+
|
|
6866
|
+
.item__code {
|
|
6867
|
+
background: var(--tdt-bg);
|
|
6868
|
+
border: 1px solid var(--tdt-border);
|
|
6869
|
+
border-radius: var(--tdt-radius);
|
|
6870
|
+
padding: 6px 8px;
|
|
6871
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
6872
|
+
font-family: var(--tdt-font-mono);
|
|
6873
|
+
color: var(--tdt-text);
|
|
6874
|
+
max-height: 100px;
|
|
6875
|
+
overflow: auto;
|
|
6876
|
+
white-space: pre-wrap;
|
|
6877
|
+
word-break: break-all;
|
|
6878
|
+
margin-top: 6px;
|
|
6879
|
+
}
|
|
6880
|
+
|
|
6881
|
+
.empty-state {
|
|
6882
|
+
text-align: center;
|
|
6883
|
+
padding: 24px 16px;
|
|
6884
|
+
color: var(--tdt-text-muted);
|
|
6885
|
+
font-family: var(--tdt-font);
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6888
|
+
.empty-state__icon {
|
|
6889
|
+
font-size: calc(32px * var(--tdt-scale, 1));
|
|
6890
|
+
margin-bottom: 8px;
|
|
6891
|
+
opacity: 0.5;
|
|
6892
|
+
}
|
|
6893
|
+
|
|
6894
|
+
.highlight-btn {
|
|
6895
|
+
background: transparent;
|
|
6896
|
+
border: 1px solid var(--tdt-border);
|
|
6897
|
+
border-radius: var(--tdt-radius);
|
|
6898
|
+
padding: 2px 6px;
|
|
6899
|
+
color: var(--tdt-text-muted);
|
|
6900
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
6901
|
+
cursor: pointer;
|
|
6902
|
+
font-family: var(--tdt-font);
|
|
6903
|
+
}
|
|
6904
|
+
|
|
6905
|
+
.highlight-btn:hover {
|
|
6906
|
+
background: var(--tdt-bg-hover);
|
|
6907
|
+
border-color: var(--tdt-accent);
|
|
6908
|
+
color: var(--tdt-accent);
|
|
6909
|
+
}
|
|
6910
|
+
|
|
6911
|
+
.btn-export {
|
|
6912
|
+
background: var(--tdt-bg-secondary);
|
|
6913
|
+
border: 1px solid var(--tdt-border);
|
|
6914
|
+
color: var(--tdt-text-muted);
|
|
6915
|
+
border-radius: var(--tdt-radius);
|
|
6916
|
+
padding: 4px 10px;
|
|
6917
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
6918
|
+
cursor: pointer;
|
|
6919
|
+
font-family: var(--tdt-font);
|
|
6920
|
+
}
|
|
6921
|
+
|
|
6922
|
+
.btn-export:hover {
|
|
6923
|
+
background: var(--tdt-accent);
|
|
6924
|
+
border-color: var(--tdt-accent);
|
|
6925
|
+
color: white;
|
|
6926
|
+
}
|
|
6927
|
+
|
|
6928
|
+
.item__badge--version {
|
|
6929
|
+
background: rgba(168, 85, 247, 0.2);
|
|
6930
|
+
color: #a855f7;
|
|
6931
|
+
}
|
|
6932
|
+
|
|
6933
|
+
.vendor-icon {
|
|
6934
|
+
width: 16px;
|
|
6935
|
+
height: 16px;
|
|
6936
|
+
border-radius: 3px;
|
|
6937
|
+
display: flex;
|
|
6938
|
+
align-items: center;
|
|
6939
|
+
justify-content: center;
|
|
6940
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
6941
|
+
font-weight: 600;
|
|
6942
|
+
flex-shrink: 0;
|
|
6943
|
+
}
|
|
6944
|
+
|
|
6945
|
+
.vendor-icon--klaviyo { background: #2f2f2f; color: #00d4aa; }
|
|
6946
|
+
.vendor-icon--judgeme { background: #000; color: #ffd700; }
|
|
6947
|
+
.vendor-icon--recharge { background: #00a3e0; color: white; }
|
|
6948
|
+
.vendor-icon--privy { background: #3b5998; color: white; }
|
|
6949
|
+
.vendor-icon--omnisend { background: #ff6b35; color: white; }
|
|
6950
|
+
.vendor-icon--shopify { background: #96bf48; color: white; }
|
|
6951
|
+
.vendor-icon--facebook { background: #1877f2; color: white; }
|
|
6952
|
+
.vendor-icon--google { background: #4285f4; color: white; }
|
|
6953
|
+
.vendor-icon--tiktok { background: #000; color: white; }
|
|
6954
|
+
.vendor-icon--pinterest { background: #e60023; color: white; }
|
|
6955
|
+
.vendor-icon--hotjar { background: #fd3a5c; color: white; }
|
|
6956
|
+
.vendor-icon--unknown { background: var(--tdt-bg-secondary); color: var(--tdt-text-muted); }
|
|
6957
|
+
`]),__publicField(za,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},okendo:{name:"Okendo",icon:"O",patterns:["okendo"]},"reviews-io":{name:"Reviews.io",icon:"R",patterns:["reviews.io","reviewsio"]},trustpilot:{name:"Trustpilot",icon:"T",patterns:["trustpilot"]},bazaarvoice:{name:"Bazaarvoice",icon:"B",patterns:["bazaarvoice","bvapi"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},afterpay:{name:"Afterpay",icon:"A",patterns:["afterpay","portal.afterpay"]},klarna:{name:"Klarna",icon:"K",patterns:["klarna"]},affirm:{name:"Affirm",icon:"A",patterns:["affirm"]},sezzle:{name:"Sezzle",icon:"S",patterns:["sezzle"]},clearpay:{name:"Clearpay",icon:"C",patterns:["clearpay"]},zip:{name:"Zip",icon:"Z",patterns:["quadpay","zip.co"]},paypal:{name:"PayPal",icon:"P",patterns:["paypal","paypalobjects"]},stripe:{name:"Stripe",icon:"S",patterns:["stripe.com","js.stripe"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},mailchimp:{name:"Mailchimp",icon:"M",patterns:["mailchimp","chimpstatic"]},drip:{name:"Drip",icon:"D",patterns:["getdrip","drip.com"]},attentive:{name:"Attentive",icon:"A",patterns:["attentive","attn.tv"]},postscript:{name:"Postscript",icon:"P",patterns:["postscript"]},sendlane:{name:"Sendlane",icon:"S",patterns:["sendlane"]},retention:{name:"Retention.com",icon:"R",patterns:["retention.com"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},loyaltylion:{name:"LoyaltyLion",icon:"L",patterns:["loyaltylion"]},"yotpo-loyalty":{name:"Yotpo Loyalty",icon:"Y",patterns:["yotpo-loyalty","swell.is"]},"rise-ai":{name:"Rise.ai",icon:"R",patterns:["rise.ai","riseai"]},gorgias:{name:"Gorgias",icon:"G",patterns:["gorgias"]},zendesk:{name:"Zendesk",icon:"Z",patterns:["zendesk","zopim"]},tidio:{name:"Tidio",icon:"T",patterns:["tidio"]},intercom:{name:"Intercom",icon:"I",patterns:["intercom"]},freshdesk:{name:"Freshdesk",icon:"F",patterns:["freshdesk","freshchat"]},livechat:{name:"LiveChat",icon:"L",patterns:["livechat","livechatinc"]},crisp:{name:"Crisp",icon:"C",patterns:["crisp.chat"]},drift:{name:"Drift",icon:"D",patterns:["drift.com","driftt"]},reamaze:{name:"Reamaze",icon:"R",patterns:["reamaze"]},hotjar:{name:"Hotjar",icon:"H",patterns:["hotjar"]},facebook:{name:"Meta Pixel",icon:"M",patterns:["facebook","fbevents","connect.facebook"]},google:{name:"Google",icon:"G",patterns:["googletagmanager","google-analytics","gtag","gtm.js"]},tiktok:{name:"TikTok",icon:"T",patterns:["tiktok","analytics.tiktok"]},pinterest:{name:"Pinterest",icon:"P",patterns:["pintrk","pinterest"]},snapchat:{name:"Snapchat",icon:"S",patterns:["snapchat","sc-static"]},shopify:{name:"Shopify",icon:"S",patterns:["shopify","cdn.shopify","monorail-edge"]},segment:{name:"Segment",icon:"S",patterns:["segment.com","segment.io"]},heap:{name:"Heap",icon:"H",patterns:["heap-analytics","heapanalytics"]},mixpanel:{name:"Mixpanel",icon:"M",patterns:["mixpanel"]},fullstory:{name:"FullStory",icon:"F",patterns:["fullstory"]},"lucky-orange":{name:"Lucky Orange",icon:"L",patterns:["luckyorange"]},clarity:{name:"Microsoft Clarity",icon:"C",patterns:["clarity.ms"]},reddit:{name:"Reddit Pixel",icon:"R",patterns:["redditmedia","reddit.com/pixel"]},twitter:{name:"Twitter Pixel",icon:"T",patterns:["static.ads-twitter","analytics.twitter"]},criteo:{name:"Criteo",icon:"C",patterns:["criteo"]},taboola:{name:"Taboola",icon:"T",patterns:["taboola"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]},gempage:{name:"GemPages",icon:"G",patterns:["gempages"]},zipify:{name:"Zipify",icon:"Z",patterns:["zipify"]},rebuy:{name:"Rebuy",icon:"R",patterns:["rebuyengine","rebuy"]},"recom-ai":{name:"Recom.ai",icon:"R",patterns:["recom.ai"]},"frequently-bought":{name:"Frequently Bought",icon:"F",patterns:["frequently-bought","also-bought"]},honeycomb:{name:"Honeycomb",icon:"H",patterns:["honeycomb-upsell"]},"candy-rack":{name:"Candy Rack",icon:"C",patterns:["candy-rack","candyrack"]},reconvert:{name:"ReConvert",icon:"R",patterns:["reconvert"]},shipstation:{name:"ShipStation",icon:"S",patterns:["shipstation"]},shippo:{name:"Shippo",icon:"S",patterns:["goshippo"]},easyship:{name:"Easyship",icon:"E",patterns:["easyship"]},aftership:{name:"AfterShip",icon:"A",patterns:["aftership"]},route:{name:"Route",icon:"R",patterns:["route.com","routeapp"]},justuno:{name:"Justuno",icon:"J",patterns:["justuno"]},optinmonster:{name:"OptinMonster",icon:"O",patterns:["optinmonster"]},wisepops:{name:"Wisepops",icon:"W",patterns:["wisepops"]},wheelio:{name:"Wheelio",icon:"W",patterns:["wheelio"]},"spin-a-sale":{name:"Spin-a-Sale",icon:"S",patterns:["spin-a-sale","spinasale"]},fomo:{name:"Fomo",icon:"F",patterns:["fomo.com","usefomo"]},nudgify:{name:"Nudgify",icon:"N",patterns:["nudgify"]},proof:{name:"Proof",icon:"P",patterns:["useproof"]},fera:{name:"Fera",icon:"F",patterns:["fera.ai"]},searchspring:{name:"Searchspring",icon:"S",patterns:["searchspring"]},algolia:{name:"Algolia",icon:"A",patterns:["algolia"]},"boost-commerce":{name:"Boost Commerce",icon:"B",patterns:["boost-commerce","boostcommerce"]},klevu:{name:"Klevu",icon:"K",patterns:["klevu"]},elfsight:{name:"Elfsight",icon:"E",patterns:["elfsight","static.elfsight"]},instafeed:{name:"Instafeed",icon:"I",patterns:["instafeed"]},beeketing:{name:"Beeketing",icon:"B",patterns:["beeketing"]},vitals:{name:"Vitals",icon:"V",patterns:["vitals.co","vitalsapp"]},hextom:{name:"Hextom",icon:"H",patterns:["hextom"]},"cart-upsell":{name:"Cart Upsell",icon:"C",patterns:["incart-upsell"]}});let qa=za;customElements.define("tdt-apps-panel",qa);const Pa=[/\/cart\.js$/,/\/cart\/(add|update|change|clear)\.js/,/\/products\/[^/]+\.js$/,/\/collections\/[^/]+\.js$/,/\/search/,/\/recommendations\/products/,/\/api\/\d+(-\d+)?\/graphql\.json/,/\/variants\.js/,/\/localization\.json/];function Ia(t){return/\/cart\/(add|update|change|clear)\.js/.test(t)?"cart-mutation":/\/cart\.js/.test(t)?"cart":/\/products\//.test(t)?"product":/\/collections\//.test(t)?"collection":/\/search/.test(t)?"search":/\/recommendations/.test(t)?"recommendation":/graphql/.test(t)?"graphql":/\/localization/.test(t)?"localization":"other"}function Ra(t){try{const e=new URL(t,window.location.origin),i=e.pathname;if(/\/cart\/(add|update|change|clear)\.js/.test(i)){return`cart/${i.match(/\/cart\/(\w+)\.js/)[1]}.js`}if(/\/cart\.js$/.test(i))return"cart.js";if(/\/products\//.test(i)){const t=i.match(/\/products\/([^/]+)\.js/);return t?`products/${t[1]}.js`:i}if(/\/collections\//.test(i)){const t=i.match(/\/collections\/([^/]+)\.js/);return t?`collections/${t[1]}.js`:i}if(/\/search/.test(i)){const t=e.searchParams.get("q");return t?`search?q=${t.substring(0,20)}${t.length>20?"...":""}`:"search"}return/graphql/.test(i)?"graphql":/\/recommendations/.test(i)?"recommendations":/\/localization/.test(i)?"localization.json":i}catch{return t}}function Na(t){try{const e=new URL(t,window.location.origin).pathname;return Pa.some(t=>t.test(e))}catch{return!1}}async function Da(t){try{const e=await t("/cart.js",{headers:{Accept:"application/json"},_tdtInternal:!0});return await e.json()}catch{return null}}function Fa(){return`req_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}const Ma="tdt_network_requests";const Ha=new class{constructor(){this.requests=[],this.listeners=new Set,this._originalFetch=null,this._originalXHROpen=null,this._originalXHRSend=null,this._installed=!1,this._staleTimeout=3e4,this._loadFromStorage()}_loadFromStorage(){try{const t=localStorage.getItem(Ma);if(t){const e=JSON.parse(t);this.requests=e.map(t=>({...t,startTime:new Date(t.startTime),endTime:t.endTime?new Date(t.endTime):null,status:(t.status,"stale")}))}}catch(t){console.error("[TDT Network] Failed to load from storage:",t),this.requests=[]}}_saveToStorage(){try{const t=this.requests.filter(t=>"pending"!==t.status).slice(0,32).map(t=>({...t,startTime:t.startTime instanceof Date?t.startTime.toISOString():t.startTime,endTime:t.endTime instanceof Date?t.endTime.toISOString():t.endTime,cartBefore:null,cartAfter:null}));localStorage.setItem(Ma,JSON.stringify(t))}catch(t){console.error("[TDT Network] Failed to save to storage:",t)}}install(){this._installed||(this._interceptFetch(),this._interceptXHR(),this._installed=!0,this._staleInterval=setInterval(()=>this._checkStale(),5e3))}uninstall(){this._installed&&(this._originalFetch&&(window.fetch=this._originalFetch),this._originalXHROpen&&(XMLHttpRequest.prototype.open=this._originalXHROpen),this._originalXHRSend&&(XMLHttpRequest.prototype.send=this._originalXHRSend),this._staleInterval&&clearInterval(this._staleInterval),this._installed=!1)}_interceptFetch(){this._originalFetch=window.fetch;const t=this;window.fetch=async function(e,i={}){const s="string"==typeof e?e:e.url;if(!Na(s)||function(t){var e;return"true"===(null==(e=null==t?void 0:t.headers)?void 0:e["X-TDT-Internal"])||!0===(null==t?void 0:t._tdtInternal)}(i))return t._originalFetch.apply(this,arguments);const a=Fa(),r=i.method||"GET";let n=null;if(i.body)try{"string"==typeof i.body?n=i.body:(i.body instanceof FormData||i.body instanceof URLSearchParams)&&(n=Object.fromEntries(i.body.entries()))}catch{n="[Unable to parse body]"}const o=function(t){return/\/cart\/(add|update|change|clear)\.js/.test(t)}(s);let l=null;o&&(l=await Da(t._originalFetch));const d={id:a,url:s,fullUrl:new URL(s,window.location.origin).href,displayName:Ra(s),method:r.toUpperCase(),category:Ia(s),startTime:new Date,endTime:null,duration:null,status:"pending",statusCode:null,requestBody:n,requestHeaders:i.headers?Object.fromEntries(new Headers(i.headers).entries()):{},responseBody:null,responseHeaders:{},error:null,cartBefore:l,cartAfter:null,cartDiff:null};t._addRequest(d);try{const e=await t._originalFetch.apply(this,arguments),i=e.clone();d.endTime=new Date,d.duration=d.endTime-d.startTime,d.statusCode=e.status,d.status=e.ok?"success":"error",d.responseHeaders=Object.fromEntries(e.headers.entries());try{(e.headers.get("content-type")||"").includes("application/json")?d.responseBody=await i.json():d.responseBody=await i.text()}catch{d.responseBody="[Unable to parse response]"}if(o&&e.ok){const e=await Da(t._originalFetch);e&&(d.cartAfter=e,d.cartDiff=t._calculateCartDiff(l,e))}return t._updateRequest(d),e}catch(c){throw d.endTime=new Date,d.duration=d.endTime-d.startTime,d.status="error",d.error=c.message,t._updateRequest(d),c}}}_interceptXHR(){this._originalXHROpen=XMLHttpRequest.prototype.open,this._originalXHRSend=XMLHttpRequest.prototype.send;const t=this;XMLHttpRequest.prototype.open=function(e,i){return this._tdtUrl=i,this._tdtMethod=e,t._originalXHROpen.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e){const i=this._tdtUrl;if(!Na(i))return t._originalXHRSend.apply(this,arguments);const s=Fa();let a=null;if(e)try{"string"==typeof e?a=e:e instanceof FormData&&(a=Object.fromEntries(e.entries()))}catch{a="[Unable to parse body]"}const r={id:s,url:i,fullUrl:new URL(i,window.location.origin).href,displayName:Ra(i),method:(this._tdtMethod||"GET").toUpperCase(),category:Ia(i),startTime:new Date,endTime:null,duration:null,status:"pending",statusCode:null,requestBody:a,requestHeaders:{},responseBody:null,responseHeaders:{},error:null};return t._addRequest(r),this.addEventListener("load",function(){r.endTime=new Date,r.duration=r.endTime-r.startTime,r.statusCode=this.status,r.status=this.status>=200&&this.status<300?"success":"error";const e=this.getAllResponseHeaders();e&&e.split("\r\n").forEach(t=>{const e=t.split(": ");2===e.length&&(r.responseHeaders[e[0].toLowerCase()]=e[1])});try{(this.getResponseHeader("content-type")||"").includes("application/json")?r.responseBody=JSON.parse(this.responseText):r.responseBody=this.responseText}catch{r.responseBody=this.responseText||"[Unable to parse response]"}t._updateRequest(r)}),this.addEventListener("error",function(){r.endTime=new Date,r.duration=r.endTime-r.startTime,r.status="error",r.error="Network error",t._updateRequest(r)}),this.addEventListener("abort",function(){r.endTime=new Date,r.duration=r.endTime-r.startTime,r.status="error",r.error="Request aborted",t._updateRequest(r)}),t._originalXHRSend.apply(this,arguments)}}_calculateCartDiff(t,e){var i,s;if(!e)return null;const a={itemsBefore:(null==t?void 0:t.item_count)||0,itemsAfter:e.item_count||0,totalBefore:(null==t?void 0:t.total_price)||0,totalAfter:e.total_price||0,added:[],removed:[],changed:[]};if(e.items_added&&e.items_added.length>0&&e.items_added.forEach(t=>{a.added.push({title:t.title||t.product_title,variant_title:t.variant_title,quantity:t.quantity,price:t.price?Math.round(100*parseFloat(t.price)):t.final_line_price||t.line_price,variant_id:t.variant_id})}),e.items_removed&&e.items_removed.length>0&&e.items_removed.forEach(t=>{a.removed.push({title:t.title||t.product_title,variant_title:t.variant_title,quantity:t.quantity,price:t.price?Math.round(100*parseFloat(t.price)):t.final_line_price||t.line_price,variant_id:t.variant_id})}),(null==(i=e.items_added)?void 0:i.length)>0||(null==(s=e.items_removed)?void 0:s.length)>0){if(t){const i=t=>{const e=t.properties?JSON.stringify(t.properties):"";return`${t.variant_id}:${e}`},s=new Map,r=new Map;(t.items||[]).forEach(t=>{s.set(i(t),t)}),(e.items||[]).forEach(t=>{r.set(i(t),t)}),r.forEach((t,e)=>{const i=s.get(e);i&&i.quantity!==t.quantity&&a.changed.push({title:t.title,variant_title:t.variant_title,quantityBefore:i.quantity,quantityAfter:t.quantity,priceBefore:i.final_line_price||i.line_price,priceAfter:t.final_line_price||t.line_price,variant_id:t.variant_id})})}return 0===a.added.length&&0===a.removed.length&&0===a.changed.length?null:a}if(!t)return null;const r=t=>{const e=t.properties?JSON.stringify(t.properties):"";return`${t.variant_id}:${e}`},n=new Map,o=new Map;return(t.items||[]).forEach(t=>{const e=r(t);n.set(e,t)}),(e.items||[]).forEach(t=>{const e=r(t);o.set(e,t)}),o.forEach((t,e)=>{const i=n.get(e);i?i.quantity!==t.quantity&&a.changed.push({title:t.title,variant_title:t.variant_title,quantityBefore:i.quantity,quantityAfter:t.quantity,priceBefore:i.final_line_price||i.line_price,priceAfter:t.final_line_price||t.line_price,variant_id:t.variant_id}):a.added.push({title:t.title,variant_title:t.variant_title,quantity:t.quantity,price:t.final_line_price||t.line_price,variant_id:t.variant_id})}),n.forEach((t,e)=>{o.has(e)||a.removed.push({title:t.title,variant_title:t.variant_title,quantity:t.quantity,price:t.final_line_price||t.line_price,variant_id:t.variant_id})}),0===a.added.length&&0===a.removed.length&&0===a.changed.length?null:a}_addRequest(t){this.requests.unshift(t),this.requests.length>100&&(this.requests=this.requests.slice(0,100)),this._notify()}_updateRequest(t){const e=this.requests.findIndex(e=>e.id===t.id);-1!==e&&(this.requests[e]=t),this._notify()}_checkStale(){const t=Date.now();let e=!1;this.requests.forEach(i=>{if("success"===i.status&&i.endTime){t-i.endTime.getTime()>this._staleTimeout&&"stale"!==i.status&&(i.status="stale",e=!0)}}),e&&this._notify()}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}_notify(){this.listeners.forEach(t=>{try{t(this.requests)}catch(e){console.error("[TDT Network] Listener error:",e)}}),this._saveToStorage()}clear(){this.requests=[];try{localStorage.removeItem(Ma)}catch(t){console.error("[TDT Network] Failed to clear storage:",t)}this._notify()}getRequests(){return this.requests}getRequestsByCategory(t){return"all"===t?this.requests:this.requests.filter(e=>e.category===t)}};class Ua extends ot{constructor(){super(),this.requests=[],this.filter="all",this.searchQuery="",this.expandedId=null,this.detailTab="request",this.replayingId=null,this.copyMenuId=null,this.toastMessage=null,this.editingId=null,this.editData=null,this._unsubscribe=null}connectedCallback(){super.connectedCallback(),Ha.install(),this._unsubscribe=Ha.subscribe(t=>{this.requests=[...t]}),this.requests=[...Ha.getRequests()]}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe&&this._unsubscribe()}_formatTime(t){return t instanceof Date||(t=new Date(t)),isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}_formatDuration(t){return null==t?"...":t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}_getDurationClass(t){return null===t?"":t>3e3?"request-duration--very-slow":t>1e3?"request-duration--slow":""}_getFilteredRequests(){let t=this.requests;if("all"!==this.filter&&(t=t.filter(t=>t.category===this.filter||t.category===`${this.filter}-mutation`)),this.searchQuery.trim()){const e=this.searchQuery.toLowerCase().trim();t=t.filter(t=>this._requestMatchesSearch(t,e))}return t}_requestMatchesSearch(t,e){var i,s,a;if(null==(i=t.fullUrl)?void 0:i.toLowerCase().includes(e))return!0;if(null==(s=t.url)?void 0:s.toLowerCase().includes(e))return!0;if(null==(a=t.displayName)?void 0:a.toLowerCase().includes(e))return!0;if(t.requestBody){if(("object"==typeof t.requestBody?JSON.stringify(t.requestBody):String(t.requestBody)).toLowerCase().includes(e))return!0}if(t.responseBody){if(("object"==typeof t.responseBody?JSON.stringify(t.responseBody):String(t.responseBody)).toLowerCase().includes(e))return!0}return!1}_handleFilterChange(t){this.filter=t.target.value}_handleSearchInput(t){this.searchQuery=t.target.value}_clearSearch(){this.searchQuery=""}_handleClear(){Ha.clear()}_toggleExpand(t){this.expandedId=this.expandedId===t?null:t,this.detailTab="request"}_setDetailTab(t){this.detailTab=t}async _replayRequest(t,e){var i;if(e.stopPropagation(),this.replayingId!==t.id){this.replayingId=t.id;try{const e={method:t.method,headers:{...t.requestHeaders}};if("GET"!==t.method&&t.requestBody)if("object"==typeof t.requestBody){if(((null==(i=t.requestHeaders)?void 0:i["content-type"])||"").includes("application/json"))e.body=JSON.stringify(t.requestBody);else{const i=new URLSearchParams;for(const[e,s]of Object.entries(t.requestBody))i.append(e,s);e.body=i}}else e.body=t.requestBody;await fetch(t.fullUrl,e)}catch(s){console.error("[TDT Network] Replay failed:",s)}finally{this.replayingId=null}}}_toggleCopyMenu(t,e){e.stopPropagation(),this.copyMenuId=this.copyMenuId===t?null:t}_closeCopyMenu(){this.copyMenuId=null}_showToast(t){this.toastMessage=t,setTimeout(()=>{this.toastMessage=null},2e3)}async _copyToClipboard(t,e){try{await navigator.clipboard.writeText(t),this._showToast(`Copied as ${e}`)}catch{console.error("[TDT Network] Copy failed")}this._closeCopyMenu()}_generateCurl(t){const e=["curl"];"GET"!==t.method&&e.push(`-X ${t.method}`),e.push(`'${t.fullUrl}'`);const i=t.requestHeaders||{};for(const[s,a]of Object.entries(i))"content-length"!==s.toLowerCase()&&e.push(`-H '${s}: ${a}'`);if(t.requestBody&&"GET"!==t.method){let s;if("object"==typeof t.requestBody){s=(i["content-type"]||"").includes("application/json")?JSON.stringify(t.requestBody):new URLSearchParams(t.requestBody).toString()}else s=t.requestBody;e.push(`-d '${s.replace(/'/g,"'\\''")}'`)}return e.join(" \\\n ")}_generateFetch(t){const e=t.requestHeaders||{},i=[];if(i.push(` method: '${t.method}'`),Object.keys(e).length>0){const t=JSON.stringify(e,null,4).replace(/\n/g,"\n ");i.push(` headers: ${t}`)}if(t.requestBody&&"GET"!==t.method){let s;s=(e["content-type"]||"").includes("application/json")?"object"==typeof t.requestBody?`JSON.stringify(${JSON.stringify(t.requestBody,null,4).replace(/\n/g,"\n ")})`:`'${t.requestBody.replace(/'/g,"\\'")}'`:"object"==typeof t.requestBody?`new URLSearchParams(${JSON.stringify(t.requestBody)})`:`'${String(t.requestBody).replace(/'/g,"\\'")}'`,i.push(` body: ${s}`)}return`fetch('${t.fullUrl}', {\n${i.join(",\n")}\n})\n .then(response => response.json())\n .then(data => console.log(data))\n .catch(error => console.error('Error:', error));`}_copyAsCurl(t,e){e.stopPropagation();const i=this._generateCurl(t);this._copyToClipboard(i,"cURL")}_copyAsFetch(t,e){e.stopPropagation();const i=this._generateFetch(t);this._copyToClipboard(i,"Fetch")}_openEditor(t,e){e.stopPropagation(),this.editingId=t.id;const i=Object.entries(t.requestHeaders||{}).map(([t,e])=>({key:t,value:e,id:`header_${Date.now()}_${Math.random().toString(36).substr(2,5)}`}));let s="";t.requestBody&&(s="object"==typeof t.requestBody?JSON.stringify(t.requestBody,null,2):String(t.requestBody)),this.editData={method:t.method,url:t.fullUrl,headers:i,body:s,sending:!1}}_closeEditor(){this.editingId=null,this.editData=null}_updateEditMethod(t){this.editData={...this.editData,method:t.target.value}}_updateEditUrl(t){this.editData={...this.editData,url:t.target.value}}_updateEditHeaderKey(t,e){const i=this.editData.headers.map(i=>i.id===t?{...i,key:e.target.value}:i);this.editData={...this.editData,headers:i}}_updateEditHeaderValue(t,e){const i=this.editData.headers.map(i=>i.id===t?{...i,value:e.target.value}:i);this.editData={...this.editData,headers:i}}_removeEditHeader(t){const e=this.editData.headers.filter(e=>e.id!==t);this.editData={...this.editData,headers:e}}_addEditHeader(){const t={key:"",value:"",id:`header_${Date.now()}_${Math.random().toString(36).substr(2,5)}`};this.editData={...this.editData,headers:[...this.editData.headers,t]}}_updateEditBody(t){this.editData={...this.editData,body:t.target.value}}_formatEditBody(){if(this.editData.body)try{const t=JSON.parse(this.editData.body),e=JSON.stringify(t,null,2);this.editData={...this.editData,body:e}}catch{this._showToast("Invalid JSON - cannot format")}}async _sendEditedRequest(){if(this.editData&&!this.editData.sending){this.editData={...this.editData,sending:!0};try{const t={};this.editData.headers.forEach(e=>{e.key.trim()&&(t[e.key.trim()]=e.value)});const e={method:this.editData.method,headers:t};if("GET"!==this.editData.method&&this.editData.body.trim()){if((t["content-type"]||t["Content-Type"]||"").includes("application/json")||this.editData.body.trim().startsWith("{"))try{const i=JSON.parse(this.editData.body);e.body=JSON.stringify(i),t["content-type"]||t["Content-Type"]||(t["content-type"]="application/json",e.headers=t)}catch{e.body=this.editData.body}else e.body=this.editData.body}await fetch(this.editData.url,e),this._showToast("Request sent"),this._closeEditor()}catch(t){console.error("[TDT Network] Send edited request failed:",t),this._showToast("Request failed: "+t.message),this.editData={...this.editData,sending:!1}}}}_handleOverlayClick(t){t.target.classList.contains("editor-overlay")&&this._closeEditor()}_renderEditorModal(){return this.editingId&&this.editData?U`
|
|
6958
|
+
<div class="editor-overlay" @click=${t=>this._handleOverlayClick(t)}>
|
|
6959
|
+
<div class="request-editor">
|
|
6960
|
+
<div class="editor-header">
|
|
6961
|
+
<div class="editor-title">
|
|
6962
|
+
<span>Edit & Resend</span>
|
|
6963
|
+
</div>
|
|
6964
|
+
<button class="editor-close" @click=${()=>this._closeEditor()} title="Close">×</button>
|
|
6965
|
+
</div>
|
|
6966
|
+
|
|
6967
|
+
<div class="editor-body">
|
|
6968
|
+
<!-- Method & URL -->
|
|
6969
|
+
<div class="editor-section">
|
|
6970
|
+
<div class="editor-section-title">Request</div>
|
|
6971
|
+
<div class="editor-row">
|
|
6972
|
+
<select
|
|
6973
|
+
class="editor-method-select"
|
|
6974
|
+
.value=${this.editData.method}
|
|
6975
|
+
@change=${t=>this._updateEditMethod(t)}
|
|
6976
|
+
>
|
|
6977
|
+
<option value="GET">GET</option>
|
|
6978
|
+
<option value="POST">POST</option>
|
|
6979
|
+
<option value="PUT">PUT</option>
|
|
6980
|
+
<option value="PATCH">PATCH</option>
|
|
6981
|
+
<option value="DELETE">DELETE</option>
|
|
6982
|
+
</select>
|
|
6983
|
+
<input
|
|
6984
|
+
type="text"
|
|
6985
|
+
class="editor-url-input"
|
|
6986
|
+
.value=${this.editData.url}
|
|
6987
|
+
@input=${t=>this._updateEditUrl(t)}
|
|
6988
|
+
placeholder="URL"
|
|
6989
|
+
/>
|
|
6990
|
+
</div>
|
|
6991
|
+
</div>
|
|
6992
|
+
|
|
6993
|
+
<!-- Headers -->
|
|
6994
|
+
<div class="editor-section">
|
|
6995
|
+
<div class="editor-section-title">Headers</div>
|
|
6996
|
+
<div class="editor-headers">
|
|
6997
|
+
${this.editData.headers.map(t=>U`
|
|
6998
|
+
<div class="editor-header-row">
|
|
6999
|
+
<input
|
|
7000
|
+
type="text"
|
|
7001
|
+
class="editor-header-key"
|
|
7002
|
+
.value=${t.key}
|
|
7003
|
+
@input=${e=>this._updateEditHeaderKey(t.id,e)}
|
|
7004
|
+
placeholder="Header name"
|
|
7005
|
+
/>
|
|
7006
|
+
<input
|
|
7007
|
+
type="text"
|
|
7008
|
+
class="editor-header-value"
|
|
7009
|
+
.value=${t.value}
|
|
7010
|
+
@input=${e=>this._updateEditHeaderValue(t.id,e)}
|
|
7011
|
+
placeholder="Header value"
|
|
7012
|
+
/>
|
|
7013
|
+
<button
|
|
7014
|
+
class="editor-header-remove"
|
|
7015
|
+
@click=${()=>this._removeEditHeader(t.id)}
|
|
7016
|
+
title="Remove header"
|
|
7017
|
+
>×</button>
|
|
7018
|
+
</div>
|
|
7019
|
+
`)}
|
|
7020
|
+
<button class="editor-add-header" @click=${()=>this._addEditHeader()}>
|
|
7021
|
+
+ Add Header
|
|
7022
|
+
</button>
|
|
7023
|
+
</div>
|
|
7024
|
+
</div>
|
|
7025
|
+
|
|
7026
|
+
<!-- Body -->
|
|
7027
|
+
${"GET"!==this.editData.method?U`
|
|
7028
|
+
<div class="editor-section">
|
|
7029
|
+
<div class="editor-section-title" style="display: flex; justify-content: space-between; align-items: center;">
|
|
7030
|
+
<span>Body</span>
|
|
7031
|
+
<button class="editor-format-btn" @click=${()=>this._formatEditBody()}>
|
|
7032
|
+
Format JSON
|
|
7033
|
+
</button>
|
|
7034
|
+
</div>
|
|
7035
|
+
<textarea
|
|
7036
|
+
class="editor-body-textarea"
|
|
7037
|
+
.value=${this.editData.body}
|
|
7038
|
+
@input=${t=>this._updateEditBody(t)}
|
|
7039
|
+
placeholder='{"key": "value"}'
|
|
7040
|
+
></textarea>
|
|
7041
|
+
<div class="editor-hint">
|
|
7042
|
+
Tip: JSON body will be automatically parsed and sent with Content-Type: application/json
|
|
7043
|
+
</div>
|
|
7044
|
+
</div>
|
|
7045
|
+
`:""}
|
|
7046
|
+
</div>
|
|
7047
|
+
|
|
7048
|
+
<div class="editor-footer">
|
|
7049
|
+
<button class="btn-cancel" @click=${()=>this._closeEditor()}>
|
|
7050
|
+
Cancel
|
|
7051
|
+
</button>
|
|
7052
|
+
<button
|
|
7053
|
+
class="btn-send"
|
|
7054
|
+
@click=${()=>this._sendEditedRequest()}
|
|
7055
|
+
?disabled=${this.editData.sending}
|
|
7056
|
+
>
|
|
7057
|
+
${this.editData.sending?"Sending...":"Send Request"}
|
|
7058
|
+
</button>
|
|
7059
|
+
</div>
|
|
7060
|
+
</div>
|
|
7061
|
+
</div>
|
|
7062
|
+
`:""}_formatBody(t){if(null==t)return"No body";if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}if("string"==typeof t)try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return t}return String(t)}_extractGraphQLQuery(t){if(!t)return null;let e=t;if("string"==typeof t)try{e=JSON.parse(t)}catch{return null}return e.query||null}_extractGraphQLVariables(t){if(!t)return null;let e=t;if("string"==typeof t)try{e=JSON.parse(t)}catch{return null}return e.variables||null}_prettifyGraphQL(t){if(!t||"string"!=typeof t)return t;let e=0,i="",s=!1,a="",r=0;t=t.replace(/\s+/g," ").trim();const n=()=>{i+="\n"+" ".repeat(e)};for(;r<t.length;){const o=t[r],l=t[r+1];if('"'!==o&&"'"!==o||"\\"===t[r-1])if(s)i+=o,r++;else if('"'!==o||'"'!==l||'"'!==t[r+2])if("{"!==o)if("}"!==o)if("("!==o)if(")"!==o)if(","!==o)if(":"!==o){if("#"===o){let e="#";for(r++;r<t.length&&"\n"!==t[r];)e+=t[r],r++;i+=e,r<t.length&&(n(),r++);continue}i+=o,r++}else for(i+=": ",r++;" "===t[r];)r++;else{for(i+=",",r++;" "===t[r];)r++;t[r]&&")"!==t[r]&&"}"!==t[r]&&(i+=" ")}else i+=")",r++;else for(i+="(",r++;" "===t[r];)r++;else{for(e--,n(),i+="}",r++;" "===t[r];)r++;t[r]&&"}"!==t[r]&&")"!==t[r]&&n()}else for(i+=" {",e++,n(),r++;" "===t[r];)r++;else for(i+='"""',r+=3;r<t.length;){if('"'===t[r]&&'"'===t[r+1]&&'"'===t[r+2]){i+='"""',r+=3;break}i+=t[r],r++}else s?o===a&&(s=!1):(s=!0,a=o),i+=o,r++}return i.trim()}_highlightGraphQL(t){if(!t)return U`<span class="gql-comment">No query</span>`;const e=["query","mutation","subscription","fragment","on","type","interface","union","enum","input","scalar","extend","schema","directive"],i=["true","false","null"],s=[];let a=0;for(;a<t.length;){const r=t[a];if("#"===r){let e="";for(;a<t.length&&"\n"!==t[a];)e+=t[a],a++;s.push(U`<span class="gql-comment">${e}</span>`);continue}if('"'===r){let e='"';if(a++,'"'===t[a]&&'"'===t[a+1])for(e='"""',a+=2;a<t.length;){if('"'===t[a]&&'"'===t[a+1]&&'"'===t[a+2]){e+='"""',a+=3;break}e+=t[a],a++}else{for(;a<t.length&&'"'!==t[a];)"\\"===t[a]&&t[a+1]?(e+=t[a]+t[a+1],a+=2):(e+=t[a],a++);'"'===t[a]&&(e+='"',a++)}s.push(U`<span class="gql-string">${e}</span>`);continue}if("$"===r){let e="$";for(a++;a<t.length&&/[a-zA-Z0-9_]/.test(t[a]);)e+=t[a],a++;s.push(U`<span class="gql-variable">${e}</span>`);continue}if("@"===r){let e="@";for(a++;a<t.length&&/[a-zA-Z0-9_]/.test(t[a]);)e+=t[a],a++;s.push(U`<span class="gql-directive">${e}</span>`);continue}if(/[0-9]/.test(r)||"-"===r&&/[0-9]/.test(t[a+1])){let e=r;for(a++;a<t.length&&/[0-9.eE+-]/.test(t[a]);)e+=t[a],a++;s.push(U`<span class="gql-number">${e}</span>`);continue}if(/[a-zA-Z_]/.test(r)){let r="";for(;a<t.length&&/[a-zA-Z0-9_]/.test(t[a]);)r+=t[a],a++;let n=a;for(;n<t.length&&" "===t[n];)n++;e.includes(r.toLowerCase())?s.push(U`<span class="gql-keyword">${r}</span>`):i.includes(r.toLowerCase())?s.push(U`<span class="gql-boolean">${r}</span>`):":"===t[n]?s.push(U`<span class="gql-argument">${r}</span>`):r[0]===r[0].toUpperCase()&&/[a-z]/.test(r)?s.push(U`<span class="gql-type">${r}</span>`):s.push(U`<span class="gql-field">${r}</span>`);continue}/[{}()[\]:,!=]/.test(r)?(s.push(U`<span class="gql-punctuation">${r}</span>`),a++):"."!==r||"."!==t[a+1]||"."!==t[a+2]?(s.push(r),a++):(s.push(U`<span class="gql-punctuation">...</span>`),a+=3)}return s}_isGraphQLRequest(t){var e;return"graphql"===t.category||(null==(e=t.url)?void 0:e.includes("graphql"))}_renderGraphQLBody(t){const e=this._extractGraphQLQuery(t.requestBody),i=this._extractGraphQLVariables(t.requestBody);if(!e)return U`<div class="detail-body detail-body--json">${this._formatBody(t.requestBody)}</div>`;const s=this._prettifyGraphQL(e),a=this._highlightGraphQL(s);return U`
|
|
7063
|
+
<div style="margin-bottom: 8px; font-size: calc(10px * var(--tdt-scale, 1)); color: var(--tdt-text-muted); text-transform: uppercase; letter-spacing: 0.5px;">Query</div>
|
|
7064
|
+
<div class="graphql-body">${a}</div>
|
|
7065
|
+
${i&&Object.keys(i).length>0?U`
|
|
7066
|
+
<div style="margin-top: 12px; margin-bottom: 8px; font-size: calc(10px * var(--tdt-scale, 1)); color: var(--tdt-text-muted); text-transform: uppercase; letter-spacing: 0.5px;">Variables</div>
|
|
7067
|
+
<div class="detail-body detail-body--json">${JSON.stringify(i,null,2)}</div>
|
|
7068
|
+
`:""}
|
|
7069
|
+
`}_diagnoseError(t){var e,i,s,a,r,n;if("error"!==t.status||!t.responseBody)return null;const o=t.responseBody,l=t.statusCode,d=t.url||"",c=t.requestBody;let p="",u="";"object"==typeof o?(p=o.message||o.error||o.description||"",u=o.description||o.errors||""):"string"==typeof o&&(p=o);const h=(p+" "+JSON.stringify(u)).toLowerCase();if(d.includes("/cart/")){if(h.includes("not available")||h.includes("out of stock")||h.includes("inventory")){return{type:"Product Unavailable",message:p||"Product is not available",hint:`Variant ${(null==c?void 0:c.id)||(null==(i=null==(e=null==c?void 0:c.items)?void 0:e[0])?void 0:i.id)||"unknown"} may be out of stock, discontinued, or not published to this sales channel.`,suggestions:["Check inventory levels in Shopify Admin","Verify the variant is published to Online Store","The product may have been archived or deleted"]}}if(h.includes("quantity")||h.includes("limit")||h.includes("maximum"))return{type:"Quantity Limit",message:p||"Quantity limit exceeded",hint:"The requested quantity exceeds the available stock or cart limits.",suggestions:["Check the max quantity settings for this product","Verify inventory policy (continue selling when out of stock)","Customer may have hit a purchase limit"]};if(h.includes("invalid")||h.includes("not found")||h.includes("does not exist")){return{type:"Invalid Variant",message:p||"Variant not found",hint:`Variant ID ${(null==c?void 0:c.id)||(null==(a=null==(s=null==c?void 0:c.items)?void 0:s[0])?void 0:a.id)||"unknown"} does not exist or is invalid.`,suggestions:["The variant may have been deleted","Check if the variant ID is correct","Product options may have changed"]}}if(h.includes("cart")&&(h.includes("token")||h.includes("session")))return{type:"Cart Session Error",message:p||"Cart session issue",hint:"The cart session may have expired or become invalid.",suggestions:["Try refreshing the page","Clear cookies and try again","Cart may have been modified in another tab"]};if(h.includes("properties")||h.includes("line item"))return{type:"Line Item Properties Error",message:p||"Invalid line item properties",hint:"There is an issue with the custom properties being sent.",suggestions:["Check property key/value format","Properties must be strings","Some reserved keys may not be allowed"]}}if(d.includes("/search")&&429===l)return{type:"Rate Limited",message:"Too many search requests",hint:"Search requests are being rate limited by Shopify.",suggestions:["Add debouncing to search input","Reduce search request frequency","Consider using predictive search API instead"]};if(d.includes("graphql")&&o.errors&&Array.isArray(o.errors)){const t=o.errors[0];return{type:"GraphQL Error",message:t.message||"GraphQL query failed",hint:"The Storefront API query returned an error.",suggestions:["Check query syntax and field names","Verify you have access to requested fields","Check if required variables are provided"],details:t.locations?`Location: Line ${null==(r=t.locations[0])?void 0:r.line}, Column ${null==(n=t.locations[0])?void 0:n.column}`:null}}return 400===l?{type:"Bad Request",message:p||"Invalid request",hint:"The request was malformed or missing required fields.",suggestions:["Check request body format","Verify all required fields are present","Ensure data types are correct"]}:401===l||403===l?{type:"Authentication Error",message:p||"Access denied",hint:"The request lacks valid authentication or permissions.",suggestions:["Check if API credentials are valid","Verify the request is from an allowed origin","Some endpoints require customer authentication"]}:404===l?{type:"Not Found",message:p||"Resource not found",hint:"The requested resource does not exist.",suggestions:["Check if the URL/endpoint is correct","The resource may have been deleted","Verify product/collection handles"]}:422===l?{type:"Validation Error",message:p||"Unprocessable entity",hint:"The request was understood but could not be processed.",suggestions:["Check the request data for validation errors","Required fields may be missing or invalid","Business rules may prevent this action"]}:429===l?{type:"Rate Limited",message:"Too many requests",hint:"You have exceeded the API rate limit.",suggestions:["Reduce request frequency","Implement request throttling","Use batch operations where possible"]}:l>=500?{type:"Server Error",message:p||"Shopify server error",hint:"Shopify experienced an internal error processing this request.",suggestions:["This is usually temporary - try again","Check Shopify Status page for outages","If persistent, contact Shopify Support"]}:t.error&&!l?{type:"Network Error",message:t.error,hint:"The request failed to reach the server.",suggestions:["Check your internet connection","The request may have been blocked by CORS","Ad blockers may interfere with requests"]}:p?{type:"Request Failed",message:p,hint:"The request was not successful.",suggestions:["Check the response body for details","Verify the request parameters"]}:null}_renderErrorDiagnosis(t){const e=this._diagnoseError(t);return e?U`
|
|
7070
|
+
<div class="error-diagnosis">
|
|
7071
|
+
<div class="error-diagnosis__header">
|
|
7072
|
+
<span>⚠️</span>
|
|
7073
|
+
<span>${e.type}</span>
|
|
7074
|
+
</div>
|
|
7075
|
+
<div class="error-diagnosis__message">"${e.message}"</div>
|
|
7076
|
+
<div class="error-diagnosis__hint">
|
|
7077
|
+
<span class="error-diagnosis__hint-icon">💡</span>
|
|
7078
|
+
<div>
|
|
7079
|
+
<div>${e.hint}</div>
|
|
7080
|
+
${e.suggestions?U`
|
|
7081
|
+
<ul style="margin: 8px 0 0 0; padding-left: 16px;">
|
|
7082
|
+
${e.suggestions.map(t=>U`<li>${t}</li>`)}
|
|
7083
|
+
</ul>
|
|
7084
|
+
`:""}
|
|
7085
|
+
${e.details?U`
|
|
7086
|
+
<div class="error-diagnosis__details">${e.details}</div>
|
|
7087
|
+
`:""}
|
|
7088
|
+
</div>
|
|
7089
|
+
</div>
|
|
7090
|
+
</div>
|
|
7091
|
+
`:""}_formatPrice(t){return null==t?"$0.00":`$${(t/100).toFixed(2)}`}_renderCartDiff(t){const e=t.cartDiff;return e?U`
|
|
7092
|
+
<div class="cart-diff">
|
|
7093
|
+
<div class="cart-diff__header">
|
|
7094
|
+
<span>📦</span>
|
|
7095
|
+
<span>Cart Changes</span>
|
|
7096
|
+
</div>
|
|
7097
|
+
|
|
7098
|
+
<div class="cart-diff__summary">
|
|
7099
|
+
<div class="cart-diff__stat">
|
|
7100
|
+
<span>Items:</span>
|
|
7101
|
+
<span>${e.itemsBefore}</span>
|
|
7102
|
+
<span class="cart-diff__arrow">→</span>
|
|
7103
|
+
<span>${e.itemsAfter}</span>
|
|
7104
|
+
</div>
|
|
7105
|
+
<div class="cart-diff__stat">
|
|
7106
|
+
<span>Total:</span>
|
|
7107
|
+
<span>${this._formatPrice(e.totalBefore)}</span>
|
|
7108
|
+
<span class="cart-diff__arrow">→</span>
|
|
7109
|
+
<span>${this._formatPrice(e.totalAfter)}</span>
|
|
7110
|
+
</div>
|
|
7111
|
+
</div>
|
|
7112
|
+
|
|
7113
|
+
<div class="cart-diff__changes">
|
|
7114
|
+
${e.added.map(t=>U`
|
|
7115
|
+
<div class="cart-diff__item cart-diff__item--added">
|
|
7116
|
+
<span class="cart-diff__icon cart-diff__icon--added">+</span>
|
|
7117
|
+
<div class="cart-diff__item-info">
|
|
7118
|
+
<div class="cart-diff__item-title">${t.title}</div>
|
|
7119
|
+
${t.variant_title?U`
|
|
7120
|
+
<div class="cart-diff__item-variant">${t.variant_title}</div>
|
|
7121
|
+
`:""}
|
|
7122
|
+
</div>
|
|
7123
|
+
<span class="cart-diff__item-qty">× ${t.quantity}</span>
|
|
7124
|
+
<span class="cart-diff__item-price">${this._formatPrice(t.price)}</span>
|
|
7125
|
+
</div>
|
|
7126
|
+
`)}
|
|
7127
|
+
|
|
7128
|
+
${e.removed.map(t=>U`
|
|
7129
|
+
<div class="cart-diff__item cart-diff__item--removed">
|
|
7130
|
+
<span class="cart-diff__icon cart-diff__icon--removed">−</span>
|
|
7131
|
+
<div class="cart-diff__item-info">
|
|
7132
|
+
<div class="cart-diff__item-title">${t.title}</div>
|
|
7133
|
+
${t.variant_title?U`
|
|
7134
|
+
<div class="cart-diff__item-variant">${t.variant_title}</div>
|
|
7135
|
+
`:""}
|
|
7136
|
+
</div>
|
|
7137
|
+
<span class="cart-diff__item-qty">× ${t.quantity}</span>
|
|
7138
|
+
<span class="cart-diff__item-price">${this._formatPrice(t.price)}</span>
|
|
7139
|
+
</div>
|
|
7140
|
+
`)}
|
|
7141
|
+
|
|
7142
|
+
${e.changed.map(t=>U`
|
|
7143
|
+
<div class="cart-diff__item cart-diff__item--changed">
|
|
7144
|
+
<span class="cart-diff__icon cart-diff__icon--changed">~</span>
|
|
7145
|
+
<div class="cart-diff__item-info">
|
|
7146
|
+
<div class="cart-diff__item-title">${t.title}</div>
|
|
7147
|
+
${t.variant_title?U`
|
|
7148
|
+
<div class="cart-diff__item-variant">${t.variant_title}</div>
|
|
7149
|
+
`:""}
|
|
7150
|
+
</div>
|
|
7151
|
+
<span class="cart-diff__item-qty">
|
|
7152
|
+
${t.quantityBefore} → ${t.quantityAfter}
|
|
7153
|
+
</span>
|
|
7154
|
+
<span class="cart-diff__item-price">
|
|
7155
|
+
${this._formatPrice(t.priceBefore)} → ${this._formatPrice(t.priceAfter)}
|
|
7156
|
+
</span>
|
|
7157
|
+
</div>
|
|
7158
|
+
`)}
|
|
7159
|
+
</div>
|
|
7160
|
+
</div>
|
|
7161
|
+
`:""}_renderRequest(t){const e=this.expandedId===t.id,i=this.replayingId===t.id,s=this.copyMenuId===t.id;return U`
|
|
7162
|
+
<div class="request-item ${e?"request-item--expanded":""}">
|
|
7163
|
+
<div class="request-header" @click=${()=>this._toggleExpand(t.id)}>
|
|
7164
|
+
<div class="status-indicator status-indicator--${t.status}"></div>
|
|
7165
|
+
<span class="request-time">${this._formatTime(t.startTime)}</span>
|
|
7166
|
+
<span class="request-method request-method--${t.method.toLowerCase()}">${t.method}</span>
|
|
7167
|
+
<span class="request-name">${t.displayName}</span>
|
|
7168
|
+
<span class="request-category">${t.category}</span>
|
|
7169
|
+
${t.statusCode?U`
|
|
7170
|
+
<span class="request-status ${t.statusCode>=200&&t.statusCode<300?"request-status--success":"request-status--error"}">
|
|
7171
|
+
${t.statusCode}
|
|
7172
|
+
</span>
|
|
7173
|
+
`:""}
|
|
7174
|
+
<span class="request-duration ${this._getDurationClass(t.duration)}">
|
|
7175
|
+
${this._formatDuration(t.duration)}
|
|
7176
|
+
</span>
|
|
7177
|
+
${"stale"===t.status?U`<span class="request-stale">(stale)</span>`:""}
|
|
7178
|
+
|
|
7179
|
+
<div class="request-actions">
|
|
7180
|
+
<button
|
|
7181
|
+
class="request-action-btn"
|
|
7182
|
+
@click=${e=>this._openEditor(t,e)}
|
|
7183
|
+
?disabled=${"pending"===t.status}
|
|
7184
|
+
title="Edit and resend"
|
|
7185
|
+
>Edit</button>
|
|
7186
|
+
|
|
7187
|
+
<button
|
|
7188
|
+
class="request-action-btn ${i?"request-action-btn--replaying":""}"
|
|
7189
|
+
@click=${e=>this._replayRequest(t,e)}
|
|
7190
|
+
?disabled=${i||"pending"===t.status}
|
|
7191
|
+
title="Replay request"
|
|
7192
|
+
>${i?"...":"Replay"}</button>
|
|
7193
|
+
|
|
7194
|
+
<div class="copy-dropdown">
|
|
7195
|
+
<button
|
|
7196
|
+
class="request-action-btn"
|
|
7197
|
+
@click=${e=>this._toggleCopyMenu(t.id,e)}
|
|
7198
|
+
title="Copy as..."
|
|
7199
|
+
>Copy</button>
|
|
7200
|
+
${s?U`
|
|
7201
|
+
<div class="copy-menu">
|
|
7202
|
+
<button class="copy-menu-item" @click=${e=>this._copyAsCurl(t,e)}>
|
|
7203
|
+
Copy as cURL
|
|
7204
|
+
</button>
|
|
7205
|
+
<button class="copy-menu-item" @click=${e=>this._copyAsFetch(t,e)}>
|
|
7206
|
+
Copy as Fetch
|
|
7207
|
+
</button>
|
|
7208
|
+
</div>
|
|
7209
|
+
`:""}
|
|
7210
|
+
</div>
|
|
7211
|
+
</div>
|
|
7212
|
+
</div>
|
|
7213
|
+
${e?this._renderDetails(t):""}
|
|
7214
|
+
</div>
|
|
7215
|
+
`}_renderDetails(t){return U`
|
|
7216
|
+
<div class="request-details">
|
|
7217
|
+
${this._renderCartDiff(t)}
|
|
7218
|
+
${this._renderErrorDiagnosis(t)}
|
|
7219
|
+
|
|
7220
|
+
<div class="detail-tabs">
|
|
7221
|
+
<button
|
|
7222
|
+
class="detail-tab ${"request"===this.detailTab?"detail-tab--active":""}"
|
|
7223
|
+
@click=${()=>this._setDetailTab("request")}
|
|
7224
|
+
>Request</button>
|
|
7225
|
+
<button
|
|
7226
|
+
class="detail-tab ${"response"===this.detailTab?"detail-tab--active":""}"
|
|
7227
|
+
@click=${()=>this._setDetailTab("response")}
|
|
7228
|
+
>Response</button>
|
|
7229
|
+
<button
|
|
7230
|
+
class="detail-tab ${"headers"===this.detailTab?"detail-tab--active":""}"
|
|
7231
|
+
@click=${()=>this._setDetailTab("headers")}
|
|
7232
|
+
>Headers</button>
|
|
7233
|
+
</div>
|
|
7234
|
+
|
|
7235
|
+
<div class="detail-meta">
|
|
7236
|
+
<span class="detail-label">URL:</span>
|
|
7237
|
+
<span class="detail-value">${t.fullUrl}</span>
|
|
7238
|
+
<span class="detail-label">Status:</span>
|
|
7239
|
+
<span class="detail-value">${t.statusCode||"Pending"} ${t.error?`(${t.error})`:""}</span>
|
|
7240
|
+
<span class="detail-label">Duration:</span>
|
|
7241
|
+
<span class="detail-value">${this._formatDuration(t.duration)}</span>
|
|
7242
|
+
</div>
|
|
7243
|
+
|
|
7244
|
+
${"response"===this.detailTab?U`
|
|
7245
|
+
<div class="detail-body detail-body--json">${this._formatBody(t.responseBody)}</div>
|
|
7246
|
+
`:""}
|
|
7247
|
+
|
|
7248
|
+
${"request"===this.detailTab?this._isGraphQLRequest(t)?this._renderGraphQLBody(t):U`<div class="detail-body detail-body--json">${this._formatBody(t.requestBody)}</div>`:""}
|
|
7249
|
+
|
|
7250
|
+
${"headers"===this.detailTab?U`
|
|
7251
|
+
<div class="detail-body">
|
|
7252
|
+
<strong>Request Headers:</strong>
|
|
7253
|
+
${Object.entries(t.requestHeaders||{}).map(([t,e])=>`${t}: ${e}`).join("\n")||"None"}
|
|
7254
|
+
|
|
7255
|
+
<strong>Response Headers:</strong>
|
|
7256
|
+
${Object.entries(t.responseHeaders||{}).map(([t,e])=>`${t}: ${e}`).join("\n")||"None"}
|
|
7257
|
+
</div>
|
|
7258
|
+
`:""}
|
|
7259
|
+
</div>
|
|
7260
|
+
`}render(){const t=this._getFilteredRequests();return U`
|
|
7261
|
+
<div class="toolbar">
|
|
7262
|
+
<select class="filter-select" .value=${this.filter} @change=${this._handleFilterChange}>
|
|
7263
|
+
<option value="all">All requests</option>
|
|
7264
|
+
<option value="cart">Cart</option>
|
|
7265
|
+
<option value="product">Products</option>
|
|
7266
|
+
<option value="collection">Collections</option>
|
|
7267
|
+
<option value="search">Search</option>
|
|
7268
|
+
<option value="graphql">GraphQL</option>
|
|
7269
|
+
<option value="other">Other</option>
|
|
7270
|
+
</select>
|
|
7271
|
+
<div class="search-wrapper">
|
|
7272
|
+
<input
|
|
7273
|
+
type="text"
|
|
7274
|
+
class="search-input ${this.searchQuery?"search-input--active":""}"
|
|
7275
|
+
placeholder="Search requests... (e.g. variant ID)"
|
|
7276
|
+
.value=${this.searchQuery}
|
|
7277
|
+
@input=${this._handleSearchInput}
|
|
7278
|
+
/>
|
|
7279
|
+
${this.searchQuery?U`
|
|
7280
|
+
<button class="search-clear" @click=${this._clearSearch} title="Clear search">x</button>
|
|
7281
|
+
`:""}
|
|
7282
|
+
</div>
|
|
7283
|
+
<span class="request-count">${t.length} request${1!==t.length?"s":""}</span>
|
|
7284
|
+
<button class="btn-clear" @click=${this._handleClear}>Clear</button>
|
|
7285
|
+
</div>
|
|
7286
|
+
|
|
7287
|
+
${0===t.length?U`
|
|
7288
|
+
<div class="empty-state">
|
|
7289
|
+
<div class="empty-icon">${this.searchQuery?"🔍":"📡"}</div>
|
|
7290
|
+
<div>${this.searchQuery?`No requests matching "${this.searchQuery}"`:"No Shopify API requests captured yet."}</div>
|
|
7291
|
+
<div style="margin-top: 8px; font-size: calc(10px * var(--tdt-scale, 1));">
|
|
7292
|
+
${this.searchQuery?"Try a different search term or clear the filter.":"Interact with the store (add to cart, search, etc.) to see requests."}
|
|
7293
|
+
</div>
|
|
7294
|
+
</div>
|
|
7295
|
+
`:U`
|
|
7296
|
+
<div class="request-list">
|
|
7297
|
+
${t.map(t=>this._renderRequest(t))}
|
|
7298
|
+
</div>
|
|
7299
|
+
`}
|
|
7300
|
+
|
|
7301
|
+
${this.toastMessage?U`
|
|
7302
|
+
<div class="copy-toast">${this.toastMessage}</div>
|
|
7303
|
+
`:""}
|
|
7304
|
+
|
|
7305
|
+
${this._renderEditorModal()}
|
|
7306
|
+
`}}__publicField(Ua,"properties",{requests:{type:Array,state:!0},filter:{type:String,state:!0},searchQuery:{type:String,state:!0},expandedId:{type:String,state:!0},detailTab:{type:String,state:!0},replayingId:{type:String,state:!0},copyMenuId:{type:String,state:!0},toastMessage:{type:String,state:!0},editingId:{type:String,state:!0},editData:{type:Object,state:!0}}),__publicField(Ua,"styles",[pt,n`
|
|
7307
|
+
:host {
|
|
7308
|
+
display: block;
|
|
7309
|
+
padding: 12px;
|
|
7310
|
+
height: 100%;
|
|
7311
|
+
overflow: auto;
|
|
7312
|
+
}
|
|
7313
|
+
|
|
7314
|
+
.toolbar {
|
|
7315
|
+
display: flex;
|
|
7316
|
+
gap: 8px;
|
|
7317
|
+
margin-bottom: 12px;
|
|
7318
|
+
align-items: center;
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
.filter-select {
|
|
7322
|
+
background: var(--tdt-bg-secondary);
|
|
7323
|
+
border: 1px solid var(--tdt-border);
|
|
7324
|
+
border-radius: var(--tdt-radius);
|
|
7325
|
+
padding: 6px 10px;
|
|
7326
|
+
color: var(--tdt-text);
|
|
7327
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7328
|
+
cursor: pointer;
|
|
7329
|
+
}
|
|
7330
|
+
|
|
7331
|
+
.filter-select:focus {
|
|
7332
|
+
outline: none;
|
|
7333
|
+
border-color: var(--tdt-accent);
|
|
7334
|
+
}
|
|
7335
|
+
|
|
7336
|
+
.search-input {
|
|
7337
|
+
flex: 1;
|
|
7338
|
+
max-width: 250px;
|
|
7339
|
+
background: var(--tdt-bg-secondary);
|
|
7340
|
+
border: 1px solid var(--tdt-border);
|
|
7341
|
+
border-radius: var(--tdt-radius);
|
|
7342
|
+
padding: 6px 10px;
|
|
7343
|
+
color: var(--tdt-text);
|
|
7344
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7345
|
+
font-family: var(--tdt-font);
|
|
7346
|
+
}
|
|
7347
|
+
|
|
7348
|
+
.search-input:focus {
|
|
7349
|
+
outline: none;
|
|
7350
|
+
border-color: var(--tdt-accent);
|
|
7351
|
+
}
|
|
7352
|
+
|
|
7353
|
+
.search-input::placeholder {
|
|
7354
|
+
color: var(--tdt-text-muted);
|
|
7355
|
+
}
|
|
7356
|
+
|
|
7357
|
+
.search-input--active {
|
|
7358
|
+
border-color: var(--tdt-accent);
|
|
7359
|
+
background: var(--tdt-bg);
|
|
7360
|
+
}
|
|
7361
|
+
|
|
7362
|
+
.search-match {
|
|
7363
|
+
background: rgba(234, 179, 8, 0.3);
|
|
7364
|
+
border-radius: 2px;
|
|
7365
|
+
padding: 0 2px;
|
|
7366
|
+
}
|
|
7367
|
+
|
|
7368
|
+
.search-clear {
|
|
7369
|
+
background: transparent;
|
|
7370
|
+
border: none;
|
|
7371
|
+
color: var(--tdt-text-muted);
|
|
7372
|
+
cursor: pointer;
|
|
7373
|
+
padding: 4px;
|
|
7374
|
+
font-size: calc(12px * var(--tdt-scale, 1));
|
|
7375
|
+
line-height: 1;
|
|
7376
|
+
}
|
|
7377
|
+
|
|
7378
|
+
.search-clear:hover {
|
|
7379
|
+
color: var(--tdt-text);
|
|
7380
|
+
}
|
|
7381
|
+
|
|
7382
|
+
.search-wrapper {
|
|
7383
|
+
position: relative;
|
|
7384
|
+
display: flex;
|
|
7385
|
+
align-items: center;
|
|
7386
|
+
flex: 1;
|
|
7387
|
+
max-width: 250px;
|
|
7388
|
+
}
|
|
7389
|
+
|
|
7390
|
+
.search-wrapper .search-clear {
|
|
7391
|
+
position: absolute;
|
|
7392
|
+
right: 6px;
|
|
7393
|
+
}
|
|
7394
|
+
|
|
7395
|
+
.search-wrapper .search-input {
|
|
7396
|
+
padding-right: 24px;
|
|
7397
|
+
max-width: none;
|
|
7398
|
+
flex: 1;
|
|
7399
|
+
}
|
|
7400
|
+
|
|
7401
|
+
.btn-clear {
|
|
7402
|
+
background: transparent;
|
|
7403
|
+
color: var(--tdt-text-muted);
|
|
7404
|
+
border: 1px solid var(--tdt-border);
|
|
7405
|
+
border-radius: var(--tdt-radius);
|
|
7406
|
+
padding: 6px 12px;
|
|
7407
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7408
|
+
cursor: pointer;
|
|
7409
|
+
display: flex;
|
|
7410
|
+
align-items: center;
|
|
7411
|
+
gap: 4px;
|
|
7412
|
+
margin-left: auto;
|
|
7413
|
+
}
|
|
7414
|
+
|
|
7415
|
+
.btn-clear:hover {
|
|
7416
|
+
background: var(--tdt-bg-hover);
|
|
7417
|
+
color: var(--tdt-text);
|
|
7418
|
+
border-color: var(--tdt-accent);
|
|
7419
|
+
}
|
|
7420
|
+
|
|
7421
|
+
.request-count {
|
|
7422
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7423
|
+
color: var(--tdt-text-muted);
|
|
7424
|
+
}
|
|
7425
|
+
|
|
7426
|
+
.request-list {
|
|
7427
|
+
display: flex;
|
|
7428
|
+
flex-direction: column;
|
|
7429
|
+
gap: 4px;
|
|
7430
|
+
}
|
|
7431
|
+
|
|
7432
|
+
.request-item {
|
|
7433
|
+
background: var(--tdt-bg-secondary);
|
|
7434
|
+
border: 1px solid var(--tdt-border);
|
|
7435
|
+
border-radius: var(--tdt-radius);
|
|
7436
|
+
overflow: hidden;
|
|
7437
|
+
transition: border-color 0.15s;
|
|
7438
|
+
}
|
|
7439
|
+
|
|
7440
|
+
.request-item:hover {
|
|
7441
|
+
border-color: var(--tdt-accent);
|
|
7442
|
+
}
|
|
7443
|
+
|
|
7444
|
+
.request-item--expanded {
|
|
7445
|
+
border-color: var(--tdt-accent);
|
|
7446
|
+
}
|
|
7447
|
+
|
|
7448
|
+
.request-header {
|
|
7449
|
+
display: flex;
|
|
7450
|
+
align-items: center;
|
|
7451
|
+
gap: 10px;
|
|
7452
|
+
padding: 8px 12px;
|
|
7453
|
+
cursor: pointer;
|
|
7454
|
+
}
|
|
7455
|
+
|
|
7456
|
+
.request-header:hover {
|
|
7457
|
+
background: var(--tdt-bg-hover);
|
|
7458
|
+
}
|
|
7459
|
+
|
|
7460
|
+
.status-indicator {
|
|
7461
|
+
width: 8px;
|
|
7462
|
+
height: 8px;
|
|
7463
|
+
border-radius: 50%;
|
|
7464
|
+
flex-shrink: 0;
|
|
7465
|
+
}
|
|
7466
|
+
|
|
7467
|
+
.status-indicator--pending {
|
|
7468
|
+
background: var(--tdt-warning);
|
|
7469
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
7470
|
+
}
|
|
7471
|
+
|
|
7472
|
+
.status-indicator--success {
|
|
7473
|
+
background: var(--tdt-success);
|
|
7474
|
+
}
|
|
7475
|
+
|
|
7476
|
+
.status-indicator--error {
|
|
7477
|
+
background: var(--tdt-error);
|
|
7478
|
+
}
|
|
7479
|
+
|
|
7480
|
+
.status-indicator--stale {
|
|
7481
|
+
background: var(--tdt-text-muted);
|
|
7482
|
+
opacity: 0.5;
|
|
7483
|
+
}
|
|
7484
|
+
|
|
7485
|
+
@keyframes pulse {
|
|
7486
|
+
0%, 100% { opacity: 1; }
|
|
7487
|
+
50% { opacity: 0.4; }
|
|
7488
|
+
}
|
|
7489
|
+
|
|
7490
|
+
.request-time {
|
|
7491
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7492
|
+
color: var(--tdt-text-muted);
|
|
7493
|
+
font-family: var(--tdt-font);
|
|
7494
|
+
min-width: 70px;
|
|
7495
|
+
}
|
|
7496
|
+
|
|
7497
|
+
.request-method {
|
|
7498
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7499
|
+
font-weight: 600;
|
|
7500
|
+
padding: 2px 6px;
|
|
7501
|
+
border-radius: 3px;
|
|
7502
|
+
min-width: 40px;
|
|
7503
|
+
text-align: center;
|
|
7504
|
+
}
|
|
7505
|
+
|
|
7506
|
+
.request-method--get {
|
|
7507
|
+
background: rgba(59, 130, 246, 0.2);
|
|
7508
|
+
color: var(--tdt-accent);
|
|
7509
|
+
}
|
|
7510
|
+
|
|
7511
|
+
.request-method--post {
|
|
7512
|
+
background: rgba(34, 197, 94, 0.2);
|
|
7513
|
+
color: var(--tdt-success);
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7516
|
+
.request-method--put,
|
|
7517
|
+
.request-method--patch {
|
|
7518
|
+
background: rgba(234, 179, 8, 0.2);
|
|
7519
|
+
color: var(--tdt-warning);
|
|
7520
|
+
}
|
|
7521
|
+
|
|
7522
|
+
.request-method--delete {
|
|
7523
|
+
background: rgba(239, 68, 68, 0.2);
|
|
7524
|
+
color: var(--tdt-error);
|
|
7525
|
+
}
|
|
7526
|
+
|
|
7527
|
+
.request-name {
|
|
7528
|
+
flex: 1;
|
|
7529
|
+
font-size: calc(12px * var(--tdt-scale, 1));
|
|
7530
|
+
color: var(--tdt-text);
|
|
7531
|
+
font-family: var(--tdt-font);
|
|
7532
|
+
overflow: hidden;
|
|
7533
|
+
text-overflow: ellipsis;
|
|
7534
|
+
white-space: nowrap;
|
|
7535
|
+
}
|
|
7536
|
+
|
|
7537
|
+
.request-category {
|
|
7538
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
7539
|
+
padding: 2px 6px;
|
|
7540
|
+
border-radius: 3px;
|
|
7541
|
+
background: var(--tdt-bg);
|
|
7542
|
+
color: var(--tdt-text-muted);
|
|
7543
|
+
text-transform: uppercase;
|
|
7544
|
+
letter-spacing: 0.5px;
|
|
7545
|
+
}
|
|
7546
|
+
|
|
7547
|
+
.request-status {
|
|
7548
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7549
|
+
min-width: 30px;
|
|
7550
|
+
text-align: center;
|
|
7551
|
+
}
|
|
7552
|
+
|
|
7553
|
+
.request-status--success {
|
|
7554
|
+
color: var(--tdt-success);
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
.request-status--error {
|
|
7558
|
+
color: var(--tdt-error);
|
|
7559
|
+
}
|
|
7560
|
+
|
|
7561
|
+
.request-duration {
|
|
7562
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7563
|
+
color: var(--tdt-text-muted);
|
|
7564
|
+
min-width: 50px;
|
|
7565
|
+
text-align: right;
|
|
7566
|
+
}
|
|
7567
|
+
|
|
7568
|
+
.request-duration--slow {
|
|
7569
|
+
color: var(--tdt-warning);
|
|
7570
|
+
}
|
|
7571
|
+
|
|
7572
|
+
.request-duration--very-slow {
|
|
7573
|
+
color: var(--tdt-error);
|
|
7574
|
+
}
|
|
7575
|
+
|
|
7576
|
+
.request-stale {
|
|
7577
|
+
font-size: calc(9px * var(--tdt-scale, 1));
|
|
7578
|
+
color: var(--tdt-text-muted);
|
|
7579
|
+
font-style: italic;
|
|
7580
|
+
}
|
|
7581
|
+
|
|
7582
|
+
.request-details {
|
|
7583
|
+
border-top: 1px solid var(--tdt-border);
|
|
7584
|
+
background: var(--tdt-bg);
|
|
7585
|
+
padding: 12px;
|
|
7586
|
+
}
|
|
7587
|
+
|
|
7588
|
+
.detail-tabs {
|
|
7589
|
+
display: flex;
|
|
7590
|
+
gap: 4px;
|
|
7591
|
+
margin-bottom: 12px;
|
|
7592
|
+
}
|
|
7593
|
+
|
|
7594
|
+
.detail-tab {
|
|
7595
|
+
background: var(--tdt-bg-secondary);
|
|
7596
|
+
border: 1px solid var(--tdt-border);
|
|
7597
|
+
border-radius: var(--tdt-radius);
|
|
7598
|
+
padding: 4px 12px;
|
|
7599
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7600
|
+
color: var(--tdt-text-muted);
|
|
7601
|
+
cursor: pointer;
|
|
7602
|
+
}
|
|
7603
|
+
|
|
7604
|
+
.detail-tab:hover {
|
|
7605
|
+
background: var(--tdt-bg-hover);
|
|
7606
|
+
color: var(--tdt-text);
|
|
7607
|
+
}
|
|
7608
|
+
|
|
7609
|
+
.detail-tab--active {
|
|
7610
|
+
background: var(--tdt-accent);
|
|
7611
|
+
border-color: var(--tdt-accent);
|
|
7612
|
+
color: white;
|
|
7613
|
+
}
|
|
7614
|
+
|
|
7615
|
+
.detail-meta {
|
|
7616
|
+
display: grid;
|
|
7617
|
+
grid-template-columns: auto 1fr;
|
|
7618
|
+
gap: 4px 12px;
|
|
7619
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7620
|
+
margin-bottom: 12px;
|
|
7621
|
+
}
|
|
7622
|
+
|
|
7623
|
+
.detail-label {
|
|
7624
|
+
color: var(--tdt-text-muted);
|
|
7625
|
+
}
|
|
7626
|
+
|
|
7627
|
+
.detail-value {
|
|
7628
|
+
color: var(--tdt-text);
|
|
7629
|
+
word-break: break-all;
|
|
7630
|
+
}
|
|
7631
|
+
|
|
7632
|
+
.detail-body {
|
|
7633
|
+
background: var(--tdt-bg-secondary);
|
|
7634
|
+
border: 1px solid var(--tdt-border);
|
|
7635
|
+
border-radius: var(--tdt-radius);
|
|
7636
|
+
padding: 10px;
|
|
7637
|
+
font-family: var(--tdt-font);
|
|
7638
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7639
|
+
max-height: 300px;
|
|
7640
|
+
overflow: auto;
|
|
7641
|
+
white-space: pre-wrap;
|
|
7642
|
+
word-break: break-all;
|
|
7643
|
+
}
|
|
7644
|
+
|
|
7645
|
+
.detail-body--json {
|
|
7646
|
+
color: var(--tdt-text);
|
|
7647
|
+
}
|
|
7648
|
+
|
|
7649
|
+
.empty-state {
|
|
7650
|
+
text-align: center;
|
|
7651
|
+
color: var(--tdt-text-muted);
|
|
7652
|
+
padding: 40px 20px;
|
|
7653
|
+
font-style: italic;
|
|
7654
|
+
}
|
|
7655
|
+
|
|
7656
|
+
.empty-icon {
|
|
7657
|
+
font-size: 32px;
|
|
7658
|
+
margin-bottom: 12px;
|
|
7659
|
+
opacity: 0.5;
|
|
7660
|
+
}
|
|
7661
|
+
|
|
7662
|
+
.detail-actions {
|
|
7663
|
+
display: flex;
|
|
7664
|
+
gap: 8px;
|
|
7665
|
+
margin-bottom: 12px;
|
|
7666
|
+
}
|
|
7667
|
+
|
|
7668
|
+
.btn-replay {
|
|
7669
|
+
display: inline-flex;
|
|
7670
|
+
align-items: center;
|
|
7671
|
+
gap: 6px;
|
|
7672
|
+
background: var(--tdt-accent);
|
|
7673
|
+
color: white;
|
|
7674
|
+
border: none;
|
|
7675
|
+
border-radius: var(--tdt-radius);
|
|
7676
|
+
padding: 6px 12px;
|
|
7677
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7678
|
+
cursor: pointer;
|
|
7679
|
+
font-family: var(--tdt-font);
|
|
7680
|
+
}
|
|
7681
|
+
|
|
7682
|
+
.btn-replay:hover:not(:disabled) {
|
|
7683
|
+
opacity: 0.9;
|
|
7684
|
+
}
|
|
7685
|
+
|
|
7686
|
+
.btn-replay:disabled {
|
|
7687
|
+
opacity: 0.5;
|
|
7688
|
+
cursor: not-allowed;
|
|
7689
|
+
}
|
|
7690
|
+
|
|
7691
|
+
.btn-replay--loading {
|
|
7692
|
+
position: relative;
|
|
7693
|
+
}
|
|
7694
|
+
|
|
7695
|
+
.btn-replay--loading::after {
|
|
7696
|
+
content: '';
|
|
7697
|
+
width: 12px;
|
|
7698
|
+
height: 12px;
|
|
7699
|
+
border: 2px solid transparent;
|
|
7700
|
+
border-top-color: white;
|
|
7701
|
+
border-radius: 50%;
|
|
7702
|
+
animation: spin 0.8s linear infinite;
|
|
7703
|
+
}
|
|
7704
|
+
|
|
7705
|
+
@keyframes spin {
|
|
7706
|
+
to { transform: rotate(360deg); }
|
|
7707
|
+
}
|
|
7708
|
+
|
|
7709
|
+
.replay-result {
|
|
7710
|
+
margin-top: 12px;
|
|
7711
|
+
padding: 10px;
|
|
7712
|
+
border-radius: var(--tdt-radius);
|
|
7713
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7714
|
+
}
|
|
7715
|
+
|
|
7716
|
+
.replay-result--success {
|
|
7717
|
+
background: rgba(34, 197, 94, 0.1);
|
|
7718
|
+
border: 1px solid var(--tdt-success);
|
|
7719
|
+
color: var(--tdt-success);
|
|
7720
|
+
}
|
|
7721
|
+
|
|
7722
|
+
.replay-result--error {
|
|
7723
|
+
background: rgba(239, 68, 68, 0.1);
|
|
7724
|
+
border: 1px solid var(--tdt-error);
|
|
7725
|
+
color: var(--tdt-error);
|
|
7726
|
+
}
|
|
7727
|
+
|
|
7728
|
+
.error-diagnosis {
|
|
7729
|
+
background: rgba(239, 68, 68, 0.08);
|
|
7730
|
+
border: 1px solid var(--tdt-error);
|
|
7731
|
+
border-radius: var(--tdt-radius);
|
|
7732
|
+
padding: 12px;
|
|
7733
|
+
margin-bottom: 12px;
|
|
7734
|
+
}
|
|
7735
|
+
|
|
7736
|
+
.error-diagnosis__header {
|
|
7737
|
+
display: flex;
|
|
7738
|
+
align-items: center;
|
|
7739
|
+
gap: 8px;
|
|
7740
|
+
font-weight: 600;
|
|
7741
|
+
color: var(--tdt-error);
|
|
7742
|
+
margin-bottom: 8px;
|
|
7743
|
+
font-size: calc(12px * var(--tdt-scale, 1));
|
|
7744
|
+
}
|
|
7745
|
+
|
|
7746
|
+
.error-diagnosis__message {
|
|
7747
|
+
color: var(--tdt-text);
|
|
7748
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7749
|
+
margin-bottom: 8px;
|
|
7750
|
+
font-family: var(--tdt-font);
|
|
7751
|
+
}
|
|
7752
|
+
|
|
7753
|
+
.error-diagnosis__hint {
|
|
7754
|
+
display: flex;
|
|
7755
|
+
align-items: flex-start;
|
|
7756
|
+
gap: 8px;
|
|
7757
|
+
background: var(--tdt-bg-secondary);
|
|
7758
|
+
padding: 10px;
|
|
7759
|
+
border-radius: var(--tdt-radius);
|
|
7760
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7761
|
+
color: var(--tdt-text);
|
|
7762
|
+
line-height: 1.5;
|
|
7763
|
+
}
|
|
7764
|
+
|
|
7765
|
+
.error-diagnosis__hint-icon {
|
|
7766
|
+
flex-shrink: 0;
|
|
7767
|
+
font-size: calc(14px * var(--tdt-scale, 1));
|
|
7768
|
+
}
|
|
7769
|
+
|
|
7770
|
+
.error-diagnosis__details {
|
|
7771
|
+
margin-top: 8px;
|
|
7772
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7773
|
+
color: var(--tdt-text-muted);
|
|
7774
|
+
}
|
|
7775
|
+
|
|
7776
|
+
.error-diagnosis__code {
|
|
7777
|
+
font-family: var(--tdt-font);
|
|
7778
|
+
background: var(--tdt-bg);
|
|
7779
|
+
padding: 2px 6px;
|
|
7780
|
+
border-radius: 3px;
|
|
7781
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7782
|
+
}
|
|
7783
|
+
|
|
7784
|
+
/* Cart Diff Styles */
|
|
7785
|
+
.cart-diff {
|
|
7786
|
+
background: var(--tdt-bg-secondary);
|
|
7787
|
+
border: 1px solid var(--tdt-border);
|
|
7788
|
+
border-radius: var(--tdt-radius);
|
|
7789
|
+
padding: 12px;
|
|
7790
|
+
margin-bottom: 12px;
|
|
7791
|
+
}
|
|
7792
|
+
|
|
7793
|
+
.cart-diff__header {
|
|
7794
|
+
display: flex;
|
|
7795
|
+
align-items: center;
|
|
7796
|
+
gap: 8px;
|
|
7797
|
+
font-weight: 600;
|
|
7798
|
+
color: var(--tdt-text);
|
|
7799
|
+
margin-bottom: 10px;
|
|
7800
|
+
font-size: calc(12px * var(--tdt-scale, 1));
|
|
7801
|
+
}
|
|
7802
|
+
|
|
7803
|
+
.cart-diff__summary {
|
|
7804
|
+
display: flex;
|
|
7805
|
+
gap: 16px;
|
|
7806
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7807
|
+
color: var(--tdt-text-muted);
|
|
7808
|
+
margin-bottom: 10px;
|
|
7809
|
+
padding-bottom: 10px;
|
|
7810
|
+
border-bottom: 1px solid var(--tdt-border);
|
|
7811
|
+
}
|
|
7812
|
+
|
|
7813
|
+
.cart-diff__stat {
|
|
7814
|
+
display: flex;
|
|
7815
|
+
align-items: center;
|
|
7816
|
+
gap: 4px;
|
|
7817
|
+
}
|
|
7818
|
+
|
|
7819
|
+
.cart-diff__arrow {
|
|
7820
|
+
color: var(--tdt-text-muted);
|
|
7821
|
+
}
|
|
7822
|
+
|
|
7823
|
+
.cart-diff__changes {
|
|
7824
|
+
display: flex;
|
|
7825
|
+
flex-direction: column;
|
|
7826
|
+
gap: 6px;
|
|
7827
|
+
}
|
|
7828
|
+
|
|
7829
|
+
.cart-diff__item {
|
|
7830
|
+
display: flex;
|
|
7831
|
+
align-items: flex-start;
|
|
7832
|
+
gap: 8px;
|
|
7833
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7834
|
+
padding: 6px 8px;
|
|
7835
|
+
border-radius: var(--tdt-radius);
|
|
7836
|
+
background: var(--tdt-bg);
|
|
7837
|
+
}
|
|
7838
|
+
|
|
7839
|
+
.cart-diff__item--added {
|
|
7840
|
+
border-left: 3px solid var(--tdt-success);
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
|
+
.cart-diff__item--removed {
|
|
7844
|
+
border-left: 3px solid var(--tdt-error);
|
|
7845
|
+
}
|
|
7846
|
+
|
|
7847
|
+
.cart-diff__item--changed {
|
|
7848
|
+
border-left: 3px solid var(--tdt-warning);
|
|
7849
|
+
}
|
|
7850
|
+
|
|
7851
|
+
.cart-diff__icon {
|
|
7852
|
+
flex-shrink: 0;
|
|
7853
|
+
width: 16px;
|
|
7854
|
+
text-align: center;
|
|
7855
|
+
}
|
|
7856
|
+
|
|
7857
|
+
.cart-diff__icon--added {
|
|
7858
|
+
color: var(--tdt-success);
|
|
7859
|
+
}
|
|
7860
|
+
|
|
7861
|
+
.cart-diff__icon--removed {
|
|
7862
|
+
color: var(--tdt-error);
|
|
7863
|
+
}
|
|
7864
|
+
|
|
7865
|
+
.cart-diff__icon--changed {
|
|
7866
|
+
color: var(--tdt-warning);
|
|
7867
|
+
}
|
|
7868
|
+
|
|
7869
|
+
.cart-diff__item-info {
|
|
7870
|
+
flex: 1;
|
|
7871
|
+
min-width: 0;
|
|
7872
|
+
}
|
|
7873
|
+
|
|
7874
|
+
.cart-diff__item-title {
|
|
7875
|
+
color: var(--tdt-text);
|
|
7876
|
+
font-weight: 500;
|
|
7877
|
+
}
|
|
7878
|
+
|
|
7879
|
+
.cart-diff__item-variant {
|
|
7880
|
+
color: var(--tdt-text-muted);
|
|
7881
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7882
|
+
}
|
|
7883
|
+
|
|
7884
|
+
.cart-diff__item-qty {
|
|
7885
|
+
color: var(--tdt-text-muted);
|
|
7886
|
+
white-space: nowrap;
|
|
7887
|
+
}
|
|
7888
|
+
|
|
7889
|
+
.cart-diff__item-price {
|
|
7890
|
+
color: var(--tdt-text);
|
|
7891
|
+
font-weight: 500;
|
|
7892
|
+
white-space: nowrap;
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7895
|
+
/* Request header actions */
|
|
7896
|
+
.request-actions {
|
|
7897
|
+
display: flex;
|
|
7898
|
+
gap: 4px;
|
|
7899
|
+
margin-left: auto;
|
|
7900
|
+
}
|
|
7901
|
+
|
|
7902
|
+
.request-action-btn {
|
|
7903
|
+
background: transparent;
|
|
7904
|
+
border: 1px solid var(--tdt-border);
|
|
7905
|
+
border-radius: var(--tdt-radius);
|
|
7906
|
+
padding: 2px 6px;
|
|
7907
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7908
|
+
color: var(--tdt-text-muted);
|
|
7909
|
+
cursor: pointer;
|
|
7910
|
+
font-family: var(--tdt-font);
|
|
7911
|
+
transition: all 0.15s ease;
|
|
7912
|
+
}
|
|
7913
|
+
|
|
7914
|
+
.request-action-btn:hover:not(:disabled) {
|
|
7915
|
+
background: var(--tdt-bg-hover);
|
|
7916
|
+
color: var(--tdt-text);
|
|
7917
|
+
border-color: var(--tdt-accent);
|
|
7918
|
+
}
|
|
7919
|
+
|
|
7920
|
+
.request-action-btn:disabled {
|
|
7921
|
+
opacity: 0.5;
|
|
7922
|
+
cursor: not-allowed;
|
|
7923
|
+
}
|
|
7924
|
+
|
|
7925
|
+
.request-action-btn--replaying {
|
|
7926
|
+
color: var(--tdt-accent);
|
|
7927
|
+
}
|
|
7928
|
+
|
|
7929
|
+
/* Copy dropdown */
|
|
7930
|
+
.copy-dropdown {
|
|
7931
|
+
position: relative;
|
|
7932
|
+
display: inline-block;
|
|
7933
|
+
}
|
|
7934
|
+
|
|
7935
|
+
.copy-menu {
|
|
7936
|
+
position: absolute;
|
|
7937
|
+
top: 100%;
|
|
7938
|
+
right: 0;
|
|
7939
|
+
margin-top: 4px;
|
|
7940
|
+
background: var(--tdt-bg);
|
|
7941
|
+
border: 1px solid var(--tdt-border);
|
|
7942
|
+
border-radius: var(--tdt-radius);
|
|
7943
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
7944
|
+
z-index: 100;
|
|
7945
|
+
min-width: 120px;
|
|
7946
|
+
overflow: hidden;
|
|
7947
|
+
}
|
|
7948
|
+
|
|
7949
|
+
.copy-menu-item {
|
|
7950
|
+
display: block;
|
|
7951
|
+
width: 100%;
|
|
7952
|
+
padding: 8px 12px;
|
|
7953
|
+
background: none;
|
|
7954
|
+
border: none;
|
|
7955
|
+
text-align: left;
|
|
7956
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7957
|
+
color: var(--tdt-text);
|
|
7958
|
+
cursor: pointer;
|
|
7959
|
+
font-family: var(--tdt-font);
|
|
7960
|
+
}
|
|
7961
|
+
|
|
7962
|
+
.copy-menu-item:hover {
|
|
7963
|
+
background: var(--tdt-bg-hover);
|
|
7964
|
+
}
|
|
7965
|
+
|
|
7966
|
+
.copy-toast {
|
|
7967
|
+
position: fixed;
|
|
7968
|
+
bottom: 20px;
|
|
7969
|
+
left: 50%;
|
|
7970
|
+
transform: translateX(-50%);
|
|
7971
|
+
background: var(--tdt-bg-secondary);
|
|
7972
|
+
border: 1px solid var(--tdt-success);
|
|
7973
|
+
color: var(--tdt-success);
|
|
7974
|
+
padding: 8px 16px;
|
|
7975
|
+
border-radius: var(--tdt-radius);
|
|
7976
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7977
|
+
z-index: 1000;
|
|
7978
|
+
animation: fadeInOut 2s ease-in-out;
|
|
7979
|
+
}
|
|
7980
|
+
|
|
7981
|
+
@keyframes fadeInOut {
|
|
7982
|
+
0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
|
|
7983
|
+
15% { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
7984
|
+
85% { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
7985
|
+
100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
|
|
7986
|
+
}
|
|
7987
|
+
|
|
7988
|
+
/* GraphQL Syntax Highlighting */
|
|
7989
|
+
.graphql-body {
|
|
7990
|
+
background: var(--tdt-bg-secondary);
|
|
7991
|
+
border: 1px solid var(--tdt-border);
|
|
7992
|
+
border-radius: var(--tdt-radius);
|
|
7993
|
+
padding: 10px;
|
|
7994
|
+
font-family: var(--tdt-font);
|
|
7995
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7996
|
+
max-height: 300px;
|
|
7997
|
+
overflow: auto;
|
|
7998
|
+
white-space: pre;
|
|
7999
|
+
line-height: 1.6;
|
|
8000
|
+
}
|
|
8001
|
+
|
|
8002
|
+
.gql-keyword {
|
|
8003
|
+
color: var(--tdt-boolean);
|
|
8004
|
+
font-weight: 600;
|
|
8005
|
+
}
|
|
8006
|
+
|
|
8007
|
+
.gql-type {
|
|
8008
|
+
color: var(--tdt-warning);
|
|
8009
|
+
}
|
|
8010
|
+
|
|
8011
|
+
.gql-field {
|
|
8012
|
+
color: var(--tdt-accent);
|
|
8013
|
+
}
|
|
8014
|
+
|
|
8015
|
+
.gql-argument {
|
|
8016
|
+
color: var(--tdt-key);
|
|
8017
|
+
}
|
|
8018
|
+
|
|
8019
|
+
.gql-variable {
|
|
8020
|
+
color: var(--tdt-number);
|
|
8021
|
+
}
|
|
8022
|
+
|
|
8023
|
+
.gql-string {
|
|
8024
|
+
color: var(--tdt-string);
|
|
8025
|
+
}
|
|
8026
|
+
|
|
8027
|
+
.gql-number {
|
|
8028
|
+
color: var(--tdt-number);
|
|
8029
|
+
}
|
|
8030
|
+
|
|
8031
|
+
.gql-boolean {
|
|
8032
|
+
color: var(--tdt-boolean);
|
|
8033
|
+
}
|
|
8034
|
+
|
|
8035
|
+
.gql-directive {
|
|
8036
|
+
color: var(--tdt-success);
|
|
8037
|
+
font-style: italic;
|
|
8038
|
+
}
|
|
8039
|
+
|
|
8040
|
+
.gql-comment {
|
|
8041
|
+
color: var(--tdt-text-muted);
|
|
8042
|
+
font-style: italic;
|
|
8043
|
+
}
|
|
8044
|
+
|
|
8045
|
+
.gql-punctuation {
|
|
8046
|
+
color: var(--tdt-text-muted);
|
|
8047
|
+
}
|
|
8048
|
+
|
|
8049
|
+
.gql-fragment-name {
|
|
8050
|
+
color: var(--tdt-success);
|
|
8051
|
+
}
|
|
8052
|
+
|
|
8053
|
+
/* Request Editor Modal Styles */
|
|
8054
|
+
.editor-overlay {
|
|
8055
|
+
position: fixed;
|
|
8056
|
+
top: 0;
|
|
8057
|
+
left: 0;
|
|
8058
|
+
right: 0;
|
|
8059
|
+
bottom: 0;
|
|
8060
|
+
background: rgba(0, 0, 0, 0.6);
|
|
8061
|
+
display: flex;
|
|
8062
|
+
align-items: center;
|
|
8063
|
+
justify-content: center;
|
|
8064
|
+
z-index: 1000;
|
|
8065
|
+
padding: 20px;
|
|
8066
|
+
}
|
|
8067
|
+
|
|
8068
|
+
.request-editor {
|
|
8069
|
+
background: var(--tdt-bg);
|
|
8070
|
+
border: 1px solid var(--tdt-accent);
|
|
8071
|
+
border-radius: 8px;
|
|
8072
|
+
width: 100%;
|
|
8073
|
+
max-width: 600px;
|
|
8074
|
+
max-height: 80vh;
|
|
8075
|
+
display: flex;
|
|
8076
|
+
flex-direction: column;
|
|
8077
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
8078
|
+
}
|
|
8079
|
+
|
|
8080
|
+
.editor-header {
|
|
8081
|
+
display: flex;
|
|
8082
|
+
align-items: center;
|
|
8083
|
+
justify-content: space-between;
|
|
8084
|
+
padding: 12px 16px;
|
|
8085
|
+
background: var(--tdt-bg-secondary);
|
|
8086
|
+
border-bottom: 1px solid var(--tdt-border);
|
|
8087
|
+
border-radius: 8px 8px 0 0;
|
|
8088
|
+
flex-shrink: 0;
|
|
8089
|
+
}
|
|
8090
|
+
|
|
8091
|
+
.editor-title {
|
|
8092
|
+
font-weight: 600;
|
|
8093
|
+
font-size: calc(13px * var(--tdt-scale, 1));
|
|
8094
|
+
color: var(--tdt-text);
|
|
8095
|
+
display: flex;
|
|
8096
|
+
align-items: center;
|
|
8097
|
+
gap: 8px;
|
|
8098
|
+
}
|
|
8099
|
+
|
|
8100
|
+
.editor-title-url {
|
|
8101
|
+
font-weight: 400;
|
|
8102
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8103
|
+
color: var(--tdt-text-muted);
|
|
8104
|
+
max-width: 300px;
|
|
8105
|
+
overflow: hidden;
|
|
8106
|
+
text-overflow: ellipsis;
|
|
8107
|
+
white-space: nowrap;
|
|
8108
|
+
}
|
|
8109
|
+
|
|
8110
|
+
.editor-close {
|
|
8111
|
+
background: transparent;
|
|
8112
|
+
border: none;
|
|
8113
|
+
color: var(--tdt-text-muted);
|
|
8114
|
+
cursor: pointer;
|
|
8115
|
+
padding: 4px 8px;
|
|
8116
|
+
font-size: calc(18px * var(--tdt-scale, 1));
|
|
8117
|
+
line-height: 1;
|
|
8118
|
+
border-radius: var(--tdt-radius);
|
|
8119
|
+
}
|
|
8120
|
+
|
|
8121
|
+
.editor-close:hover {
|
|
8122
|
+
color: var(--tdt-text);
|
|
8123
|
+
background: var(--tdt-bg-hover);
|
|
8124
|
+
}
|
|
8125
|
+
|
|
8126
|
+
.editor-body {
|
|
8127
|
+
padding: 16px;
|
|
8128
|
+
overflow-y: auto;
|
|
8129
|
+
flex: 1;
|
|
8130
|
+
}
|
|
8131
|
+
|
|
8132
|
+
.editor-footer {
|
|
8133
|
+
display: flex;
|
|
8134
|
+
justify-content: flex-end;
|
|
8135
|
+
gap: 8px;
|
|
8136
|
+
padding: 12px 16px;
|
|
8137
|
+
background: var(--tdt-bg-secondary);
|
|
8138
|
+
border-top: 1px solid var(--tdt-border);
|
|
8139
|
+
border-radius: 0 0 8px 8px;
|
|
8140
|
+
flex-shrink: 0;
|
|
8141
|
+
}
|
|
8142
|
+
|
|
8143
|
+
.editor-section {
|
|
8144
|
+
margin-bottom: 16px;
|
|
8145
|
+
}
|
|
8146
|
+
|
|
8147
|
+
.editor-section:last-child {
|
|
8148
|
+
margin-bottom: 0;
|
|
8149
|
+
}
|
|
8150
|
+
|
|
8151
|
+
.editor-section-title {
|
|
8152
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
8153
|
+
color: var(--tdt-text-muted);
|
|
8154
|
+
text-transform: uppercase;
|
|
8155
|
+
letter-spacing: 0.5px;
|
|
8156
|
+
margin-bottom: 8px;
|
|
8157
|
+
}
|
|
8158
|
+
|
|
8159
|
+
.editor-row {
|
|
8160
|
+
display: flex;
|
|
8161
|
+
gap: 8px;
|
|
8162
|
+
margin-bottom: 8px;
|
|
8163
|
+
}
|
|
8164
|
+
|
|
8165
|
+
.editor-row:last-child {
|
|
8166
|
+
margin-bottom: 0;
|
|
8167
|
+
}
|
|
8168
|
+
|
|
8169
|
+
.editor-method-select {
|
|
8170
|
+
background: var(--tdt-bg-secondary);
|
|
8171
|
+
border: 1px solid var(--tdt-border);
|
|
8172
|
+
border-radius: var(--tdt-radius);
|
|
8173
|
+
padding: 8px 12px;
|
|
8174
|
+
color: var(--tdt-text);
|
|
8175
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8176
|
+
font-family: var(--tdt-font);
|
|
8177
|
+
font-weight: 600;
|
|
8178
|
+
cursor: pointer;
|
|
8179
|
+
min-width: 80px;
|
|
8180
|
+
}
|
|
8181
|
+
|
|
8182
|
+
.editor-method-select:focus {
|
|
8183
|
+
outline: none;
|
|
8184
|
+
border-color: var(--tdt-accent);
|
|
8185
|
+
}
|
|
8186
|
+
|
|
8187
|
+
.editor-url-input {
|
|
8188
|
+
flex: 1;
|
|
8189
|
+
background: var(--tdt-bg-secondary);
|
|
8190
|
+
border: 1px solid var(--tdt-border);
|
|
8191
|
+
border-radius: var(--tdt-radius);
|
|
8192
|
+
padding: 8px 12px;
|
|
8193
|
+
color: var(--tdt-text);
|
|
8194
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8195
|
+
font-family: var(--tdt-font);
|
|
8196
|
+
}
|
|
8197
|
+
|
|
8198
|
+
.editor-url-input:focus {
|
|
8199
|
+
outline: none;
|
|
8200
|
+
border-color: var(--tdt-accent);
|
|
8201
|
+
}
|
|
8202
|
+
|
|
8203
|
+
.editor-headers {
|
|
8204
|
+
display: flex;
|
|
8205
|
+
flex-direction: column;
|
|
8206
|
+
gap: 6px;
|
|
8207
|
+
}
|
|
8208
|
+
|
|
8209
|
+
.editor-header-row {
|
|
8210
|
+
display: flex;
|
|
8211
|
+
gap: 8px;
|
|
8212
|
+
align-items: center;
|
|
8213
|
+
}
|
|
8214
|
+
|
|
8215
|
+
.editor-header-key,
|
|
8216
|
+
.editor-header-value {
|
|
8217
|
+
flex: 1;
|
|
8218
|
+
background: var(--tdt-bg-secondary);
|
|
8219
|
+
border: 1px solid var(--tdt-border);
|
|
8220
|
+
border-radius: var(--tdt-radius);
|
|
8221
|
+
padding: 6px 10px;
|
|
8222
|
+
color: var(--tdt-text);
|
|
8223
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8224
|
+
font-family: var(--tdt-font);
|
|
8225
|
+
}
|
|
8226
|
+
|
|
8227
|
+
.editor-header-key {
|
|
8228
|
+
max-width: 180px;
|
|
8229
|
+
color: var(--tdt-key);
|
|
6965
8230
|
}
|
|
6966
8231
|
|
|
6967
|
-
.
|
|
6968
|
-
|
|
8232
|
+
.editor-header-key:focus,
|
|
8233
|
+
.editor-header-value:focus {
|
|
8234
|
+
outline: none;
|
|
8235
|
+
border-color: var(--tdt-accent);
|
|
6969
8236
|
}
|
|
6970
8237
|
|
|
6971
|
-
.
|
|
8238
|
+
.editor-header-remove {
|
|
8239
|
+
background: transparent;
|
|
8240
|
+
border: none;
|
|
6972
8241
|
color: var(--tdt-text-muted);
|
|
6973
|
-
|
|
6974
|
-
|
|
8242
|
+
cursor: pointer;
|
|
8243
|
+
padding: 4px 8px;
|
|
8244
|
+
font-size: calc(14px * var(--tdt-scale, 1));
|
|
8245
|
+
line-height: 1;
|
|
8246
|
+
border-radius: var(--tdt-radius);
|
|
6975
8247
|
}
|
|
6976
8248
|
|
|
6977
|
-
.
|
|
6978
|
-
color: var(--tdt-
|
|
6979
|
-
|
|
6980
|
-
font-family: var(--tdt-font-mono);
|
|
8249
|
+
.editor-header-remove:hover {
|
|
8250
|
+
color: var(--tdt-error);
|
|
8251
|
+
background: rgba(239, 68, 68, 0.1);
|
|
6981
8252
|
}
|
|
6982
8253
|
|
|
6983
|
-
.
|
|
6984
|
-
|
|
8254
|
+
.editor-add-header {
|
|
8255
|
+
background: transparent;
|
|
8256
|
+
border: 1px dashed var(--tdt-border);
|
|
8257
|
+
border-radius: var(--tdt-radius);
|
|
8258
|
+
padding: 6px 12px;
|
|
8259
|
+
color: var(--tdt-text-muted);
|
|
8260
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
6985
8261
|
cursor: pointer;
|
|
8262
|
+
width: 100%;
|
|
8263
|
+
text-align: center;
|
|
8264
|
+
font-family: var(--tdt-font);
|
|
6986
8265
|
}
|
|
6987
8266
|
|
|
6988
|
-
.
|
|
6989
|
-
|
|
8267
|
+
.editor-add-header:hover {
|
|
8268
|
+
border-color: var(--tdt-accent);
|
|
8269
|
+
color: var(--tdt-accent);
|
|
8270
|
+
background: rgba(59, 130, 246, 0.05);
|
|
6990
8271
|
}
|
|
6991
8272
|
|
|
6992
|
-
.
|
|
6993
|
-
|
|
8273
|
+
.editor-body-textarea {
|
|
8274
|
+
width: 100%;
|
|
8275
|
+
min-height: 120px;
|
|
8276
|
+
background: var(--tdt-bg-secondary);
|
|
6994
8277
|
border: 1px solid var(--tdt-border);
|
|
6995
8278
|
border-radius: var(--tdt-radius);
|
|
6996
|
-
padding:
|
|
6997
|
-
font-size: calc(9px * var(--tdt-scale, 1));
|
|
6998
|
-
font-family: var(--tdt-font-mono);
|
|
8279
|
+
padding: 10px;
|
|
6999
8280
|
color: var(--tdt-text);
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
margin-top: 6px;
|
|
8281
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8282
|
+
font-family: var(--tdt-font);
|
|
8283
|
+
resize: vertical;
|
|
8284
|
+
line-height: 1.5;
|
|
7005
8285
|
}
|
|
7006
8286
|
|
|
7007
|
-
.
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
color: var(--tdt-text-muted);
|
|
7011
|
-
font-family: var(--tdt-font);
|
|
8287
|
+
.editor-body-textarea:focus {
|
|
8288
|
+
outline: none;
|
|
8289
|
+
border-color: var(--tdt-accent);
|
|
7012
8290
|
}
|
|
7013
8291
|
|
|
7014
|
-
.
|
|
7015
|
-
|
|
7016
|
-
margin-bottom: 8px;
|
|
7017
|
-
opacity: 0.5;
|
|
8292
|
+
.editor-body-textarea::placeholder {
|
|
8293
|
+
color: var(--tdt-text-muted);
|
|
7018
8294
|
}
|
|
7019
8295
|
|
|
7020
|
-
.
|
|
7021
|
-
background:
|
|
7022
|
-
|
|
8296
|
+
.btn-send {
|
|
8297
|
+
background: var(--tdt-success);
|
|
8298
|
+
color: white;
|
|
8299
|
+
border: none;
|
|
7023
8300
|
border-radius: var(--tdt-radius);
|
|
7024
|
-
padding:
|
|
7025
|
-
|
|
7026
|
-
font-
|
|
8301
|
+
padding: 6px 16px;
|
|
8302
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
8303
|
+
font-weight: 600;
|
|
7027
8304
|
cursor: pointer;
|
|
7028
8305
|
font-family: var(--tdt-font);
|
|
8306
|
+
display: flex;
|
|
8307
|
+
align-items: center;
|
|
8308
|
+
gap: 6px;
|
|
7029
8309
|
}
|
|
7030
8310
|
|
|
7031
|
-
.
|
|
7032
|
-
|
|
7033
|
-
border-color: var(--tdt-accent);
|
|
7034
|
-
color: var(--tdt-accent);
|
|
8311
|
+
.btn-send:hover:not(:disabled) {
|
|
8312
|
+
opacity: 0.9;
|
|
7035
8313
|
}
|
|
7036
8314
|
|
|
7037
|
-
.btn-
|
|
7038
|
-
|
|
7039
|
-
|
|
8315
|
+
.btn-send:disabled {
|
|
8316
|
+
opacity: 0.5;
|
|
8317
|
+
cursor: not-allowed;
|
|
8318
|
+
}
|
|
8319
|
+
|
|
8320
|
+
.btn-cancel {
|
|
8321
|
+
background: transparent;
|
|
7040
8322
|
color: var(--tdt-text-muted);
|
|
8323
|
+
border: 1px solid var(--tdt-border);
|
|
7041
8324
|
border-radius: var(--tdt-radius);
|
|
7042
|
-
padding:
|
|
8325
|
+
padding: 6px 12px;
|
|
7043
8326
|
font-size: calc(11px * var(--tdt-scale, 1));
|
|
7044
8327
|
cursor: pointer;
|
|
7045
8328
|
font-family: var(--tdt-font);
|
|
7046
8329
|
}
|
|
7047
8330
|
|
|
7048
|
-
.btn-
|
|
7049
|
-
|
|
7050
|
-
border-color: var(--tdt-
|
|
7051
|
-
color: white;
|
|
8331
|
+
.btn-cancel:hover {
|
|
8332
|
+
color: var(--tdt-text);
|
|
8333
|
+
border-color: var(--tdt-text-muted);
|
|
7052
8334
|
}
|
|
7053
8335
|
|
|
7054
|
-
.
|
|
7055
|
-
|
|
7056
|
-
color:
|
|
8336
|
+
.editor-hint {
|
|
8337
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
8338
|
+
color: var(--tdt-text-muted);
|
|
8339
|
+
margin-top: 6px;
|
|
8340
|
+
font-style: italic;
|
|
7057
8341
|
}
|
|
7058
8342
|
|
|
7059
|
-
.
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
border-radius:
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
justify-content: center;
|
|
8343
|
+
.editor-format-btn {
|
|
8344
|
+
background: transparent;
|
|
8345
|
+
border: 1px solid var(--tdt-border);
|
|
8346
|
+
border-radius: var(--tdt-radius);
|
|
8347
|
+
padding: 4px 8px;
|
|
8348
|
+
color: var(--tdt-text-muted);
|
|
7066
8349
|
font-size: calc(10px * var(--tdt-scale, 1));
|
|
7067
|
-
|
|
7068
|
-
|
|
8350
|
+
cursor: pointer;
|
|
8351
|
+
font-family: var(--tdt-font);
|
|
7069
8352
|
}
|
|
7070
8353
|
|
|
7071
|
-
.
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
.vendor-icon--shopify { background: #96bf48; color: white; }
|
|
7077
|
-
.vendor-icon--facebook { background: #1877f2; color: white; }
|
|
7078
|
-
.vendor-icon--google { background: #4285f4; color: white; }
|
|
7079
|
-
.vendor-icon--tiktok { background: #000; color: white; }
|
|
7080
|
-
.vendor-icon--pinterest { background: #e60023; color: white; }
|
|
7081
|
-
.vendor-icon--hotjar { background: #fd3a5c; color: white; }
|
|
7082
|
-
.vendor-icon--unknown { background: var(--tdt-bg-secondary); color: var(--tdt-text-muted); }
|
|
7083
|
-
`]),__publicField(ja,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},okendo:{name:"Okendo",icon:"O",patterns:["okendo"]},"reviews-io":{name:"Reviews.io",icon:"R",patterns:["reviews.io","reviewsio"]},trustpilot:{name:"Trustpilot",icon:"T",patterns:["trustpilot"]},bazaarvoice:{name:"Bazaarvoice",icon:"B",patterns:["bazaarvoice","bvapi"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},afterpay:{name:"Afterpay",icon:"A",patterns:["afterpay","portal.afterpay"]},klarna:{name:"Klarna",icon:"K",patterns:["klarna"]},affirm:{name:"Affirm",icon:"A",patterns:["affirm"]},sezzle:{name:"Sezzle",icon:"S",patterns:["sezzle"]},clearpay:{name:"Clearpay",icon:"C",patterns:["clearpay"]},zip:{name:"Zip",icon:"Z",patterns:["quadpay","zip.co"]},paypal:{name:"PayPal",icon:"P",patterns:["paypal","paypalobjects"]},stripe:{name:"Stripe",icon:"S",patterns:["stripe.com","js.stripe"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},mailchimp:{name:"Mailchimp",icon:"M",patterns:["mailchimp","chimpstatic"]},drip:{name:"Drip",icon:"D",patterns:["getdrip","drip.com"]},attentive:{name:"Attentive",icon:"A",patterns:["attentive","attn.tv"]},postscript:{name:"Postscript",icon:"P",patterns:["postscript"]},sendlane:{name:"Sendlane",icon:"S",patterns:["sendlane"]},retention:{name:"Retention.com",icon:"R",patterns:["retention.com"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},loyaltylion:{name:"LoyaltyLion",icon:"L",patterns:["loyaltylion"]},"yotpo-loyalty":{name:"Yotpo Loyalty",icon:"Y",patterns:["yotpo-loyalty","swell.is"]},"rise-ai":{name:"Rise.ai",icon:"R",patterns:["rise.ai","riseai"]},gorgias:{name:"Gorgias",icon:"G",patterns:["gorgias"]},zendesk:{name:"Zendesk",icon:"Z",patterns:["zendesk","zopim"]},tidio:{name:"Tidio",icon:"T",patterns:["tidio"]},intercom:{name:"Intercom",icon:"I",patterns:["intercom"]},freshdesk:{name:"Freshdesk",icon:"F",patterns:["freshdesk","freshchat"]},livechat:{name:"LiveChat",icon:"L",patterns:["livechat","livechatinc"]},crisp:{name:"Crisp",icon:"C",patterns:["crisp.chat"]},drift:{name:"Drift",icon:"D",patterns:["drift.com","driftt"]},reamaze:{name:"Reamaze",icon:"R",patterns:["reamaze"]},hotjar:{name:"Hotjar",icon:"H",patterns:["hotjar"]},facebook:{name:"Meta Pixel",icon:"M",patterns:["facebook","fbevents","connect.facebook"]},google:{name:"Google",icon:"G",patterns:["googletagmanager","google-analytics","gtag","gtm.js"]},tiktok:{name:"TikTok",icon:"T",patterns:["tiktok","analytics.tiktok"]},pinterest:{name:"Pinterest",icon:"P",patterns:["pintrk","pinterest"]},snapchat:{name:"Snapchat",icon:"S",patterns:["snapchat","sc-static"]},shopify:{name:"Shopify",icon:"S",patterns:["shopify","cdn.shopify","monorail-edge"]},segment:{name:"Segment",icon:"S",patterns:["segment.com","segment.io"]},heap:{name:"Heap",icon:"H",patterns:["heap-analytics","heapanalytics"]},mixpanel:{name:"Mixpanel",icon:"M",patterns:["mixpanel"]},fullstory:{name:"FullStory",icon:"F",patterns:["fullstory"]},"lucky-orange":{name:"Lucky Orange",icon:"L",patterns:["luckyorange"]},clarity:{name:"Microsoft Clarity",icon:"C",patterns:["clarity.ms"]},reddit:{name:"Reddit Pixel",icon:"R",patterns:["redditmedia","reddit.com/pixel"]},twitter:{name:"Twitter Pixel",icon:"T",patterns:["static.ads-twitter","analytics.twitter"]},criteo:{name:"Criteo",icon:"C",patterns:["criteo"]},taboola:{name:"Taboola",icon:"T",patterns:["taboola"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]},gempage:{name:"GemPages",icon:"G",patterns:["gempages"]},zipify:{name:"Zipify",icon:"Z",patterns:["zipify"]},rebuy:{name:"Rebuy",icon:"R",patterns:["rebuyengine","rebuy"]},"recom-ai":{name:"Recom.ai",icon:"R",patterns:["recom.ai"]},"frequently-bought":{name:"Frequently Bought",icon:"F",patterns:["frequently-bought","also-bought"]},honeycomb:{name:"Honeycomb",icon:"H",patterns:["honeycomb-upsell"]},"candy-rack":{name:"Candy Rack",icon:"C",patterns:["candy-rack","candyrack"]},reconvert:{name:"ReConvert",icon:"R",patterns:["reconvert"]},shipstation:{name:"ShipStation",icon:"S",patterns:["shipstation"]},shippo:{name:"Shippo",icon:"S",patterns:["goshippo"]},easyship:{name:"Easyship",icon:"E",patterns:["easyship"]},aftership:{name:"AfterShip",icon:"A",patterns:["aftership"]},route:{name:"Route",icon:"R",patterns:["route.com","routeapp"]},justuno:{name:"Justuno",icon:"J",patterns:["justuno"]},optinmonster:{name:"OptinMonster",icon:"O",patterns:["optinmonster"]},wisepops:{name:"Wisepops",icon:"W",patterns:["wisepops"]},wheelio:{name:"Wheelio",icon:"W",patterns:["wheelio"]},"spin-a-sale":{name:"Spin-a-Sale",icon:"S",patterns:["spin-a-sale","spinasale"]},fomo:{name:"Fomo",icon:"F",patterns:["fomo.com","usefomo"]},nudgify:{name:"Nudgify",icon:"N",patterns:["nudgify"]},proof:{name:"Proof",icon:"P",patterns:["useproof"]},fera:{name:"Fera",icon:"F",patterns:["fera.ai"]},searchspring:{name:"Searchspring",icon:"S",patterns:["searchspring"]},algolia:{name:"Algolia",icon:"A",patterns:["algolia"]},"boost-commerce":{name:"Boost Commerce",icon:"B",patterns:["boost-commerce","boostcommerce"]},klevu:{name:"Klevu",icon:"K",patterns:["klevu"]},elfsight:{name:"Elfsight",icon:"E",patterns:["elfsight","static.elfsight"]},instafeed:{name:"Instafeed",icon:"I",patterns:["instafeed"]},beeketing:{name:"Beeketing",icon:"B",patterns:["beeketing"]},vitals:{name:"Vitals",icon:"V",patterns:["vitals.co","vitalsapp"]},hextom:{name:"Hextom",icon:"H",patterns:["hextom"]},"cart-upsell":{name:"Cart Upsell",icon:"C",patterns:["incart-upsell"]}});let Pa=ja;customElements.define("tdt-apps-panel",Pa);const Fa=class t extends ot{constructor(){super(),this.settings=_t.getAll(),this.isRecordingShortcut=!1,this.tempShortcut=null,this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=_t.subscribe(()=>{this.settings=_t.getAll()})}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe&&this._unsubscribe(),this._stopRecordingShortcut()}_handleThemeChange(t){_t.set("theme",t),this._dispatchSettingsChanged()}_handleFontSizeChange(t){_t.set("fontSize",t),this._dispatchSettingsChanged()}_handlePersistenceChange(){const t=!this.settings.persistAcrossSessions;_t.set("persistAcrossSessions",t)}_handleDefaultTabChange(t){_t.set("defaultTab",t),this._dispatchSettingsChanged()}_handlePanelHeightChange(t){_t.set("panelHeight",t),this._dispatchSettingsChanged()}_handlePanelPositionChange(t){_t.set("panelPosition",t),this._dispatchSettingsChanged()}_startRecordingShortcut(){this.isRecordingShortcut=!0,this.tempShortcut=null,this._recordingHandler=t=>{t.preventDefault(),t.stopPropagation(),["Control","Shift","Alt","Meta"].includes(t.key)||(this.tempShortcut={key:t.key.toUpperCase(),ctrl:t.ctrlKey,shift:t.shiftKey,alt:t.altKey,meta:t.metaKey},_t.set("keyboardShortcut",this.tempShortcut),this._stopRecordingShortcut(),this._dispatchSettingsChanged())},document.addEventListener("keydown",this._recordingHandler,{capture:!0})}_stopRecordingShortcut(){this.isRecordingShortcut=!1,this._recordingHandler&&(document.removeEventListener("keydown",this._recordingHandler,{capture:!0}),this._recordingHandler=null)}_cancelRecordingShortcut(){this.tempShortcut=null,this._stopRecordingShortcut()}_resetShortcut(){_t.set("keyboardShortcut",yt.keyboardShortcut),this._dispatchSettingsChanged()}_resetAllSettings(){confirm("Reset all settings to defaults? This cannot be undone.")&&(_t.reset(),this._dispatchSettingsChanged())}_dispatchSettingsChanged(){this.dispatchEvent(new CustomEvent("settings-changed",{bubbles:!0,composed:!0}))}_formatShortcutKey(t){const e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),{modifiers:i,key:t.key}}render(){const{modifiers:e,key:i}=this._formatShortcutKey(this.settings.keyboardShortcut);return U`
|
|
8354
|
+
.editor-format-btn:hover {
|
|
8355
|
+
color: var(--tdt-text);
|
|
8356
|
+
border-color: var(--tdt-accent);
|
|
8357
|
+
}
|
|
8358
|
+
`]),customElements.define("network-panel",Ua);const Ba=class t extends ot{constructor(){super(),this.settings=_t.getAll(),this.isRecordingShortcut=!1,this.tempShortcut=null,this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=_t.subscribe(()=>{this.settings=_t.getAll()})}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe&&this._unsubscribe(),this._stopRecordingShortcut()}_handleThemeChange(t){_t.set("theme",t),this._dispatchSettingsChanged()}_handleFontSizeChange(t){_t.set("fontSize",t),this._dispatchSettingsChanged()}_handlePersistenceChange(){const t=!this.settings.persistAcrossSessions;_t.set("persistAcrossSessions",t)}_handleDefaultTabChange(t){_t.set("defaultTab",t),this._dispatchSettingsChanged()}_handlePanelHeightChange(t){_t.set("panelHeight",t),this._dispatchSettingsChanged()}_handlePanelPositionChange(t){_t.set("panelPosition",t),this._dispatchSettingsChanged()}_startRecordingShortcut(){this.isRecordingShortcut=!0,this.tempShortcut=null,this._recordingHandler=t=>{t.preventDefault(),t.stopPropagation(),["Control","Shift","Alt","Meta"].includes(t.key)||(this.tempShortcut={key:t.key.toUpperCase(),ctrl:t.ctrlKey,shift:t.shiftKey,alt:t.altKey,meta:t.metaKey},_t.set("keyboardShortcut",this.tempShortcut),this._stopRecordingShortcut(),this._dispatchSettingsChanged())},document.addEventListener("keydown",this._recordingHandler,{capture:!0})}_stopRecordingShortcut(){this.isRecordingShortcut=!1,this._recordingHandler&&(document.removeEventListener("keydown",this._recordingHandler,{capture:!0}),this._recordingHandler=null)}_cancelRecordingShortcut(){this.tempShortcut=null,this._stopRecordingShortcut()}_resetShortcut(){_t.set("keyboardShortcut",yt.keyboardShortcut),this._dispatchSettingsChanged()}_resetAllSettings(){confirm("Reset all settings to defaults? This cannot be undone.")&&(_t.reset(),this._dispatchSettingsChanged())}_dispatchSettingsChanged(){this.dispatchEvent(new CustomEvent("settings-changed",{bubbles:!0,composed:!0}))}_formatShortcutKey(t){const e=navigator.platform.toUpperCase().indexOf("MAC")>=0,i=[];return t.ctrl&&i.push(e?"⌃":"Ctrl"),t.meta&&i.push(e?"⌘":"Win"),t.alt&&i.push(e?"⌥":"Alt"),t.shift&&i.push(e?"⇧":"Shift"),{modifiers:i,key:t.key}}render(){const{modifiers:e,key:i}=this._formatShortcutKey(this.settings.keyboardShortcut);return U`
|
|
7084
8359
|
<div class="settings-container">
|
|
7085
8360
|
<div class="section">
|
|
7086
8361
|
<div class="section-title">
|
|
@@ -7338,7 +8613,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7338
8613
|
</button>
|
|
7339
8614
|
</div>
|
|
7340
8615
|
</div>
|
|
7341
|
-
`}};__publicField(
|
|
8616
|
+
`}};__publicField(Ba,"properties",{settings:{type:Object,state:!0},isRecordingShortcut:{type:Boolean,state:!0},tempShortcut:{type:Object,state:!0}}),__publicField(Ba,"AVAILABLE_TABS",[{id:"objects",label:"Objects"},{id:"metafields",label:"Metafields"},{id:"cart",label:"Cart"},{id:"locale",label:"Locale"},{id:"analytics",label:"Analytics"},{id:"seo",label:"SEO"},{id:"apps",label:"Apps"},{id:"console",label:"Console"},{id:"cookies",label:"Cookies"},{id:"storage",label:"Storage"},{id:"info",label:"Info"}]),__publicField(Ba,"styles",[pt,n`
|
|
7342
8617
|
:host {
|
|
7343
8618
|
display: block;
|
|
7344
8619
|
padding: 16px;
|
|
@@ -7749,10 +9024,58 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7749
9024
|
border-color: var(--tdt-accent);
|
|
7750
9025
|
color: var(--tdt-accent);
|
|
7751
9026
|
}
|
|
7752
|
-
`]);let Ia=Fa;customElements.define("tdt-preferences-panel",Ia);const Ra=class t extends ot{constructor(){super(),this.isCollapsed=!1,this.activeTab=_t.get("defaultTab")||"objects",this.context=null,this.cart=null,this.product=null,this._unsubscribeCart=null,this._unsubscribeProduct=null,this._unsubscribeSettings=null,this.tabOrder=null,this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1,this.panelPosition=_t.get("panelPosition")||"bottom",this.panelHeight=_t.get("panelHeight")||"50",this.isDraggingPanel=!1,this._loadFloatingPosition()}_loadFloatingPosition(){try{const t=localStorage.getItem("tdt-floating-position");if(t){const{x:e,y:i,width:s,height:a}=JSON.parse(t);this.floatingX=e,this.floatingY=i,this.floatingWidth=s||700,this.floatingHeight=a||null}else this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}catch{this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}}_saveFloatingPosition(){try{localStorage.setItem("tdt-floating-position",JSON.stringify({x:this.floatingX,y:this.floatingY,width:this.floatingWidth,height:this.floatingHeight}))}catch{}}_setupResizeObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(t=>{if("floating"===this.panelPosition&&!this.isCollapsed)for(const e of t){const{width:t,height:i}=e.contentRect;(Math.abs(t-(this.floatingWidth||700))>5||Math.abs(i-(this.floatingHeight||300))>5)&&(this.floatingWidth=t,this.floatingHeight=i,this._saveFloatingPosition())}}))}_observeResize(){var t;if("floating"!==this.panelPosition)return;this._setupResizeObserver();const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".dock");e&&this._resizeObserver&&this._resizeObserver.observe(e)}_disconnectResizeObserver(){this._resizeObserver&&this._resizeObserver.disconnect()}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState(),this._applySettings(),this._subscribeToSettings(),this._listenForSystemTheme()}updated(t){super.updated(t),t.has("panelPosition")&&"floating"===this.panelPosition&&this._observeResize(),"floating"!==this.panelPosition||this._resizeObserver||this._observeResize()}disconnectedCallback(){var t;super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),this._unsubscribeProduct&&this._unsubscribeProduct(),this._unsubscribeSettings&&this._unsubscribeSettings(),this._mediaQueryListener&&(null==(t=this._systemThemeQuery)||t.removeEventListener("change",this._mediaQueryListener)),this._disconnectResizeObserver(),mt.stopPolling(),bt.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){var t;this.context=ut.parse(),this.context?(mt.interceptAjax(),mt.startPolling(3e3),mt.fetch().then(t=>{t&&mt.setCart(t)}),this._unsubscribeCart=mt.subscribe(t=>{this.cart=t}),(null==(t=this.context.objects)?void 0:t.product)&&(this._unsubscribeProduct=ft.subscribe(t=>{this.product=t}),ft.initialize(this.context.objects.product)),bt.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{_t.matchesShortcut(t)&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_subscribeToSettings(){this._unsubscribeSettings=_t.subscribe((t,e)=>{"theme"!==t&&"fontSize"!==t&&"*"!==t||this._applySettings(),"panelPosition"!==t&&"*"!==t||(this.panelPosition=_t.get("panelPosition")||"bottom"),"panelHeight"!==t&&"*"!==t||(this.panelHeight=_t.get("panelHeight")||"50",this._applyPanelHeight())})}_listenForSystemTheme(){this._systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._mediaQueryListener=()=>{"system"===_t.get("theme")&&this._applySettings()},this._systemThemeQuery.addEventListener("change",this._mediaQueryListener)}_applySettings(){const t=_t.getAll();let e=t.theme;"system"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");const i=ct[e]||ct.dark,s=dt[t.fontSize]||dt.medium;for(const[a,r]of Object.entries(i))this.style.setProperty(a,r);this.style.setProperty("--tdt-scale",s),this._applyPanelHeight()}_applyPanelHeight(){const t=this.panelHeight||"50";this.style.setProperty("--tdt-panel-height",`${t}vh`)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-active-tab"),i=t.DEFAULT_TABS.map(t=>t.id);e&&i.includes(e)&&(this.activeTab=e);const s=localStorage.getItem("theme-devtools-tab-order");if(s)try{const e=JSON.parse(s),i=t.DEFAULT_TABS.map(t=>t.id),a=e.filter(t=>i.includes(t)),r=i.filter(t=>!a.includes(t));this.tabOrder=[...a,...r]}catch{this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}else this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}_getOrderedTabs(){return this.tabOrder?this.tabOrder.map(e=>t.DEFAULT_TABS.find(t=>t.id===e)).filter(Boolean):t.DEFAULT_TABS}_handleDragStart(t,e){this.draggedTab=t,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t)}_handleDragOver(t,e){e.preventDefault(),e.dataTransfer.dropEffect="move",t!==this.draggedTab&&(this.dragOverTab=t)}_handleDragLeave(){this.dragOverTab=null}_handleDrop(t,e){if(e.preventDefault(),!this.draggedTab||this.draggedTab===t)return void this._resetDragState();const i=[...this.tabOrder],s=i.indexOf(this.draggedTab),a=i.indexOf(t);i.splice(s,1),i.splice(a,0,this.draggedTab),this.tabOrder=i,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(i)),this._resetDragState()}_handleDragEnd(){this._resetDragState()}_resetDragState(){this.draggedTab=null,this.dragOverTab=null}_resetTabOrder(){this.tabOrder=t.DEFAULT_TABS.map(t=>t.id),localStorage.removeItem("theme-devtools-tab-order")}_handlePanelDragStart(t){if("floating"!==this.panelPosition)return;if(t.target.closest(".dock__btn"))return;t.preventDefault();const e=this.shadowRoot.querySelector(".dock").getBoundingClientRect();this._dragOffsetX=t.clientX-e.left,this._dragOffsetY=t.clientY-e.top,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._didDrag=!1,this._handlePanelDragMove=this._handlePanelDragMove.bind(this),this._handlePanelDragEnd=this._handlePanelDragEnd.bind(this),document.addEventListener("mousemove",this._handlePanelDragMove),document.addEventListener("mouseup",this._handlePanelDragEnd)}_handlePanelDragMove(t){const e=Math.abs(t.clientX-this._dragStartX),i=Math.abs(t.clientY-this._dragStartY);if((e>5||i>5)&&(this._didDrag=!0,this.isDraggingPanel=!0),!this.isDraggingPanel)return;let s=t.clientX-this._dragOffsetX,a=t.clientY-this._dragOffsetY;const r=this.shadowRoot.querySelector(".dock").getBoundingClientRect();s=Math.max(0,Math.min(s,window.innerWidth-r.width)),a=Math.max(0,Math.min(a,window.innerHeight-r.height)),this.floatingX=s,this.floatingY=a}_handlePanelDragEnd(){document.removeEventListener("mousemove",this._handlePanelDragMove),document.removeEventListener("mouseup",this._handlePanelDragEnd),this._didDrag&&this._saveFloatingPosition(),this.isDraggingPanel=!1,this._didDrag=!1}_handleFloatingHandleClick(t){if(this._didDrag)return t.preventDefault(),void t.stopPropagation();this._toggleCollapse()}async _clearCart(){try{await fetch("/cart/clear.js",{method:"POST"}),this.cart={items:[],item_count:0,total_price:0},this._showActionFeedback("Cart cleared")}catch(t){console.error("Failed to clear cart:",t)}}_forceRefresh(){location.reload(!0)}_toggleDesignMode(){const t=new URL(window.location.href);t.searchParams.has("design_mode")?t.searchParams.delete("design_mode"):t.searchParams.set("design_mode","true"),window.location.href=t.toString()}_getShopURL(){return window.location.origin}_getAdminBaseUrl(){return`${this._getShopURL()}/admin`}_toggleAdminDropdown(t){if(null==t||t.stopPropagation(),this.showAdminDropdown=!this.showAdminDropdown,this.showAdminDropdown){const t=()=>{this.showAdminDropdown=!1,document.removeEventListener("click",t)};setTimeout(()=>document.addEventListener("click",t),0)}}_openAdminPage(t){window.open(`${this._getAdminBaseUrl()}${t}`,"_blank"),this.showAdminDropdown=!1}_openThemeEditor(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const s=window.location.pathname+window.location.search,a=`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`;window.open(a,"_blank")}_getThemeEditorUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return`${this._getAdminBaseUrl()}/themes`;const s=window.location.pathname+window.location.search;return`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`}async _copyThemeEditorUrl(){try{const t=this._getThemeEditorUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Editor URL copied")}catch(t){console.error("Failed to copy:",t)}}_getPreviewThemeUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return window.location.href;const s=new URL(window.location.href);return s.searchParams.set("preview_theme_id",i),s.toString()}async _copyPreviewThemeUrl(){try{const t=this._getPreviewThemeUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Preview URL copied")}catch(t){console.error("Failed to copy:",t)}}_openResourceInAdmin(){var t,e,i,s,a,r;const{meta:n,objects:o}=this.context||{},l=null==(t=null==n?void 0:n.request)?void 0:t.page_type;"product"===l&&(null==(e=null==o?void 0:o.product)?void 0:e.id)?this._openAdminPage(`/products/${o.product.id}`):"collection"===l&&(null==(i=null==o?void 0:o.collection)?void 0:i.id)?this._openAdminPage(`/collections/${o.collection.id}`):"article"===l&&(null==(s=null==o?void 0:o.article)?void 0:s.id)?this._openAdminPage(`/articles/${o.article.id}`):"page"===l&&(null==(a=null==o?void 0:o.page)?void 0:a.id)?this._openAdminPage(`/pages/${o.page.id}`):"blog"===l&&(null==(r=null==o?void 0:o.blog)?void 0:r.id)&&this._openAdminPage(`/blogs/${o.blog.id}`)}_getResourceLabel(){var t,e,i;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(i=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:i.page_type]||null}_clearLocalStorage(){confirm("Clear all localStorage? This may log you out or reset preferences.")&&(localStorage.clear(),this._showActionFeedback("Storage cleared"))}_clearSessionStorage(){sessionStorage.clear(),this._showActionFeedback("Session cleared")}_clearAllCookies(){const t=document.cookie.split(";");0===t.length||1===t.length&&!t[0].trim()?this._showActionFeedback("No cookies to clear"):confirm(`Clear all ${t.filter(t=>t.trim()).length} cookies? This may log you out.`)&&(t.forEach(t=>{const e=t.split("=")[0].trim();e&&(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`)}),this._showActionFeedback("Cookies cleared"))}_showActionFeedback(t){const e=document.createElement("div");e.textContent=t,e.style.cssText="\n position: fixed;\n bottom: calc(60vh + 10px);\n left: 50%;\n transform: translateX(-50%);\n background: var(--tdt-success, #22c55e);\n color: white;\n padding: 8px 16px;\n border-radius: 4px;\n font-size: calc(12px * var(--tdt-scale, 1));\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const i=document.createElement("style");i.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(i),document.body.appendChild(e),setTimeout(()=>e.remove(),2e3)}_toggleCollapse(){this.isCollapsed=!this.isCollapsed,localStorage.setItem("theme-devtools-collapsed",this.isCollapsed)}_setTab(t){this.activeTab=t,localStorage.setItem("theme-devtools-active-tab",t)}_close(){this.remove()}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){var t,e,i,s,a,r,n;if(!this.context)return U``;const{meta:o,objects:l,metafields:c,settings:d,sectionSettings:p,metafieldsSchema:h}=this.context,u={...l,cart:this.cart||l.cart,product:this.product||l.product},g=this._getOrderedTabs(),v=`dock--${this.panelPosition||"bottom"}`,m=this.isCollapsed?"▲":"▼";let f="";if("floating"===this.panelPosition){const t=[`left: ${this.floatingX}px`,`top: ${this.floatingY}px`];this.floatingWidth&&t.push(`width: ${this.floatingWidth}px`),this.floatingHeight&&t.push(`height: ${this.floatingHeight}px`),f=t.join("; ")+";"}return U`
|
|
9027
|
+
`]);let Va=Ba;customElements.define("tdt-preferences-panel",Va);const Ja=class t extends ot{constructor(){super(),this.isCollapsed=!1,this.activeTab=_t.get("defaultTab")||"objects",this.context=null,this.cart=null,this.product=null,this._unsubscribeCart=null,this._unsubscribeProduct=null,this._unsubscribeSettings=null,this.tabOrder=null,this.hiddenTabs=[],this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1,this.showTabContextMenu=!1,this.tabContextMenuPosition={x:0,y:0},this.contextMenuTabId=null,this.panelPosition=_t.get("panelPosition")||"bottom",this.panelHeight=_t.get("panelHeight")||"50",this.isDraggingPanel=!1,this._loadFloatingPosition()}_loadFloatingPosition(){try{const t=localStorage.getItem("tdt-floating-position");if(t){const{x:e,y:i,width:s,height:a}=JSON.parse(t);this.floatingX=e,this.floatingY=i,this.floatingWidth=s||700,this.floatingHeight=a||null}else this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}catch{this.floatingX=window.innerWidth-720,this.floatingY=window.innerHeight-400,this.floatingWidth=700,this.floatingHeight=null}}_saveFloatingPosition(){try{localStorage.setItem("tdt-floating-position",JSON.stringify({x:this.floatingX,y:this.floatingY,width:this.floatingWidth,height:this.floatingHeight}))}catch{}}_setupResizeObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(t=>{if("floating"===this.panelPosition&&!this.isCollapsed)for(const e of t){const{width:t,height:i}=e.contentRect;(Math.abs(t-(this.floatingWidth||700))>5||Math.abs(i-(this.floatingHeight||300))>5)&&(this.floatingWidth=t,this.floatingHeight=i,this._saveFloatingPosition())}}))}_observeResize(){var t;if("floating"!==this.panelPosition)return;this._setupResizeObserver();const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".dock");e&&this._resizeObserver&&this._resizeObserver.observe(e)}_disconnectResizeObserver(){this._resizeObserver&&this._resizeObserver.disconnect()}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState(),this._applySettings(),this._subscribeToSettings(),this._listenForSystemTheme()}updated(t){super.updated(t),t.has("panelPosition")&&"floating"===this.panelPosition&&this._observeResize(),"floating"!==this.panelPosition||this._resizeObserver||this._observeResize()}disconnectedCallback(){var t;super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),this._unsubscribeProduct&&this._unsubscribeProduct(),this._unsubscribeSettings&&this._unsubscribeSettings(),this._mediaQueryListener&&(null==(t=this._systemThemeQuery)||t.removeEventListener("change",this._mediaQueryListener)),this._disconnectResizeObserver(),mt.stopPolling(),ft.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){var t;this.context=ht.parse(),this.context?(mt.interceptAjax(),mt.startPolling(3e3),mt.fetch().then(t=>{t&&mt.setCart(t)}),this._unsubscribeCart=mt.subscribe(t=>{this.cart=t}),(null==(t=this.context.objects)?void 0:t.product)&&(this._unsubscribeProduct=bt.subscribe(t=>{this.product=t}),bt.initialize(this.context.objects.product)),ft.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{_t.matchesShortcut(t)&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_subscribeToSettings(){this._unsubscribeSettings=_t.subscribe((t,e)=>{"theme"!==t&&"fontSize"!==t&&"*"!==t||this._applySettings(),"panelPosition"!==t&&"*"!==t||(this.panelPosition=_t.get("panelPosition")||"bottom"),"panelHeight"!==t&&"*"!==t||(this.panelHeight=_t.get("panelHeight")||"50",this._applyPanelHeight())})}_listenForSystemTheme(){this._systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._mediaQueryListener=()=>{"system"===_t.get("theme")&&this._applySettings()},this._systemThemeQuery.addEventListener("change",this._mediaQueryListener)}_applySettings(){const t=_t.getAll();let e=t.theme;"system"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");const i=dt[e]||dt.dark,s=ct[t.fontSize]||ct.medium;for(const[a,r]of Object.entries(i))this.style.setProperty(a,r);this.style.setProperty("--tdt-scale",s),this._applyPanelHeight()}_applyPanelHeight(){const t=this.panelHeight||"50";this.style.setProperty("--tdt-panel-height",`${t}vh`)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-active-tab"),i=t.DEFAULT_TABS.map(t=>t.id);e&&i.includes(e)&&(this.activeTab=e);const s=localStorage.getItem("theme-devtools-tab-order");if(s)try{const e=JSON.parse(s),i=t.DEFAULT_TABS.map(t=>t.id),a=e.filter(t=>i.includes(t)),r=i.filter(t=>!a.includes(t));this.tabOrder=[...a,...r]}catch{this.tabOrder=t.DEFAULT_TABS.map(t=>t.id)}else this.tabOrder=t.DEFAULT_TABS.map(t=>t.id);const a=localStorage.getItem("theme-devtools-hidden-tabs");if(a)try{const t=JSON.parse(a);this.hiddenTabs=t.filter(t=>i.includes(t))}catch{this.hiddenTabs=[]}else this.hiddenTabs=[];if(this.hiddenTabs.includes(this.activeTab)){const t=this.tabOrder.filter(t=>!this.hiddenTabs.includes(t));this.activeTab=t[0]||"objects"}}_getOrderedTabs(){return this.tabOrder?this.tabOrder.filter(t=>!this.hiddenTabs.includes(t)).map(e=>t.DEFAULT_TABS.find(t=>t.id===e)).filter(Boolean):t.DEFAULT_TABS.filter(t=>!this.hiddenTabs.includes(t.id))}_handleDragStart(t,e){this.draggedTab=t,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t)}_handleDragOver(t,e){e.preventDefault(),e.dataTransfer.dropEffect="move",t!==this.draggedTab&&(this.dragOverTab=t)}_handleDragLeave(){this.dragOverTab=null}_handleDrop(t,e){if(e.preventDefault(),!this.draggedTab||this.draggedTab===t)return void this._resetDragState();const i=[...this.tabOrder],s=i.indexOf(this.draggedTab),a=i.indexOf(t);i.splice(s,1),i.splice(a,0,this.draggedTab),this.tabOrder=i,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(i)),this._resetDragState()}_handleDragEnd(){this._resetDragState()}_resetDragState(){this.draggedTab=null,this.dragOverTab=null}_resetTabOrder(){this.tabOrder=t.DEFAULT_TABS.map(t=>t.id),localStorage.removeItem("theme-devtools-tab-order")}_handleTabContextMenu(t,e){e.preventDefault(),this.contextMenuTabId=t,this.tabContextMenuPosition={x:e.clientX,y:e.clientY},this.showTabContextMenu=!0;const i=t=>{t.target.closest(".tab-context-menu")||(this.showTabContextMenu=!1,document.removeEventListener("click",i))};setTimeout(()=>document.addEventListener("click",i),0)}_closeTabContextMenu(){this.showTabContextMenu=!1,this.contextMenuTabId=null}_hideTab(t){if(!t||"preferences"===t)return void this._showActionFeedback("Cannot hide Preferences tab");if(this.tabOrder.filter(t=>!this.hiddenTabs.includes(t)).length<=2)this._showActionFeedback("Must keep at least 2 tabs visible");else{if(this.hiddenTabs=[...this.hiddenTabs,t],localStorage.setItem("theme-devtools-hidden-tabs",JSON.stringify(this.hiddenTabs)),this.activeTab===t){const t=this.tabOrder.filter(t=>!this.hiddenTabs.includes(t));this.activeTab=t[0]||"objects",localStorage.setItem("theme-devtools-active-tab",this.activeTab)}this._closeTabContextMenu()}}_showTab(t){this.hiddenTabs=this.hiddenTabs.filter(e=>e!==t),localStorage.setItem("theme-devtools-hidden-tabs",JSON.stringify(this.hiddenTabs)),this._closeTabContextMenu()}_showAllTabs(){this.hiddenTabs=[],localStorage.removeItem("theme-devtools-hidden-tabs"),this._closeTabContextMenu(),this._showActionFeedback("All tabs restored")}_resetTabsToDefaults(){this.tabOrder=t.DEFAULT_TABS.map(t=>t.id),this.hiddenTabs=[],localStorage.removeItem("theme-devtools-tab-order"),localStorage.removeItem("theme-devtools-hidden-tabs"),this._closeTabContextMenu(),this._showActionFeedback("Tabs reset to defaults")}_renderTabContextMenu(){if(!this.showTabContextMenu)return"";const e=t.DEFAULT_TABS.find(t=>t.id===this.contextMenuTabId),i=this.hiddenTabs.map(e=>t.DEFAULT_TABS.find(t=>t.id===e)).filter(Boolean);return U`
|
|
9028
|
+
<div
|
|
9029
|
+
class="tab-context-menu"
|
|
9030
|
+
style="left: ${this.tabContextMenuPosition.x}px; top: ${this.tabContextMenuPosition.y}px;"
|
|
9031
|
+
@click=${t=>t.stopPropagation()}
|
|
9032
|
+
>
|
|
9033
|
+
${e?U`
|
|
9034
|
+
<button
|
|
9035
|
+
class="tab-context-menu__item tab-context-menu__item--danger"
|
|
9036
|
+
@click=${()=>this._hideTab(this.contextMenuTabId)}
|
|
9037
|
+
?disabled=${"preferences"===this.contextMenuTabId}
|
|
9038
|
+
>
|
|
9039
|
+
Hide "${e.label}"
|
|
9040
|
+
</button>
|
|
9041
|
+
<div class="tab-context-menu__divider"></div>
|
|
9042
|
+
`:""}
|
|
9043
|
+
|
|
9044
|
+
${i.length>0?U`
|
|
9045
|
+
<div class="tab-context-menu__submenu-label">Hidden Tabs</div>
|
|
9046
|
+
<div class="tab-context-menu__hidden-list">
|
|
9047
|
+
${i.map(t=>U`
|
|
9048
|
+
<button
|
|
9049
|
+
class="tab-context-menu__item"
|
|
9050
|
+
@click=${()=>this._showTab(t.id)}
|
|
9051
|
+
>
|
|
9052
|
+
Show "${t.label}"
|
|
9053
|
+
</button>
|
|
9054
|
+
`)}
|
|
9055
|
+
</div>
|
|
9056
|
+
<div class="tab-context-menu__divider"></div>
|
|
9057
|
+
`:""}
|
|
9058
|
+
|
|
9059
|
+
${i.length>0?U`
|
|
9060
|
+
<button
|
|
9061
|
+
class="tab-context-menu__item"
|
|
9062
|
+
@click=${this._showAllTabs}
|
|
9063
|
+
>
|
|
9064
|
+
Show All Tabs
|
|
9065
|
+
</button>
|
|
9066
|
+
`:""}
|
|
9067
|
+
|
|
9068
|
+
<button
|
|
9069
|
+
class="tab-context-menu__item"
|
|
9070
|
+
@click=${this._resetTabsToDefaults}
|
|
9071
|
+
>
|
|
9072
|
+
Reset Tabs to Defaults
|
|
9073
|
+
</button>
|
|
9074
|
+
</div>
|
|
9075
|
+
`}_handlePanelDragStart(t){if("floating"!==this.panelPosition)return;if(t.target.closest(".dock__btn"))return;t.preventDefault();const e=this.shadowRoot.querySelector(".dock").getBoundingClientRect();this._dragOffsetX=t.clientX-e.left,this._dragOffsetY=t.clientY-e.top,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._didDrag=!1,this._handlePanelDragMove=this._handlePanelDragMove.bind(this),this._handlePanelDragEnd=this._handlePanelDragEnd.bind(this),document.addEventListener("mousemove",this._handlePanelDragMove),document.addEventListener("mouseup",this._handlePanelDragEnd)}_handlePanelDragMove(t){const e=Math.abs(t.clientX-this._dragStartX),i=Math.abs(t.clientY-this._dragStartY);if((e>5||i>5)&&(this._didDrag=!0,this.isDraggingPanel=!0),!this.isDraggingPanel)return;let s=t.clientX-this._dragOffsetX,a=t.clientY-this._dragOffsetY;const r=this.shadowRoot.querySelector(".dock").getBoundingClientRect();s=Math.max(0,Math.min(s,window.innerWidth-r.width)),a=Math.max(0,Math.min(a,window.innerHeight-r.height)),this.floatingX=s,this.floatingY=a}_handlePanelDragEnd(){document.removeEventListener("mousemove",this._handlePanelDragMove),document.removeEventListener("mouseup",this._handlePanelDragEnd),this._didDrag&&this._saveFloatingPosition(),this.isDraggingPanel=!1,this._didDrag=!1}_handleFloatingHandleClick(t){if(this._didDrag)return t.preventDefault(),void t.stopPropagation();this._toggleCollapse()}async _clearCart(){try{await fetch("/cart/clear.js",{method:"POST"}),this.cart={items:[],item_count:0,total_price:0},this._showActionFeedback("Cart cleared")}catch(t){console.error("Failed to clear cart:",t)}}_forceRefresh(){location.reload(!0)}_toggleDesignMode(){const t=new URL(window.location.href);t.searchParams.has("design_mode")?t.searchParams.delete("design_mode"):t.searchParams.set("design_mode","true"),window.location.href=t.toString()}_getShopURL(){return window.location.origin}_getAdminBaseUrl(){return`${this._getShopURL()}/admin`}_toggleAdminDropdown(t){if(null==t||t.stopPropagation(),this.showAdminDropdown=!this.showAdminDropdown,this.showAdminDropdown){const t=()=>{this.showAdminDropdown=!1,document.removeEventListener("click",t)};setTimeout(()=>document.addEventListener("click",t),0)}}_openAdminPage(t){window.open(`${this._getAdminBaseUrl()}${t}`,"_blank"),this.showAdminDropdown=!1}_openThemeEditor(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const s=window.location.pathname+window.location.search,a=`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`;window.open(a,"_blank")}_getThemeEditorUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return`${this._getAdminBaseUrl()}/themes`;const s=window.location.pathname+window.location.search;return`${this._getAdminBaseUrl()}/themes/${i}/editor?previewPath=${encodeURIComponent(s)}`}async _copyThemeEditorUrl(){try{const t=this._getThemeEditorUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Editor URL copied")}catch(t){console.error("Failed to copy:",t)}}_getPreviewThemeUrl(){var t;const{meta:e}=this.context||{},i=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!i)return window.location.href;const s=new URL(window.location.href);return s.searchParams.set("preview_theme_id",i),s.toString()}async _copyPreviewThemeUrl(){try{const t=this._getPreviewThemeUrl();await navigator.clipboard.writeText(t),this._showActionFeedback("Preview URL copied")}catch(t){console.error("Failed to copy:",t)}}_openResourceInAdmin(){var t,e,i,s,a,r;const{meta:n,objects:o}=this.context||{},l=null==(t=null==n?void 0:n.request)?void 0:t.page_type;"product"===l&&(null==(e=null==o?void 0:o.product)?void 0:e.id)?this._openAdminPage(`/products/${o.product.id}`):"collection"===l&&(null==(i=null==o?void 0:o.collection)?void 0:i.id)?this._openAdminPage(`/collections/${o.collection.id}`):"article"===l&&(null==(s=null==o?void 0:o.article)?void 0:s.id)?this._openAdminPage(`/articles/${o.article.id}`):"page"===l&&(null==(a=null==o?void 0:o.page)?void 0:a.id)?this._openAdminPage(`/pages/${o.page.id}`):"blog"===l&&(null==(r=null==o?void 0:o.blog)?void 0:r.id)&&this._openAdminPage(`/blogs/${o.blog.id}`)}_getResourceLabel(){var t,e,i;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(i=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:i.page_type]||null}_clearLocalStorage(){confirm("Clear all localStorage? This may log you out or reset preferences.")&&(localStorage.clear(),this._showActionFeedback("Storage cleared"))}_clearSessionStorage(){sessionStorage.clear(),this._showActionFeedback("Session cleared")}_clearAllCookies(){const t=document.cookie.split(";");0===t.length||1===t.length&&!t[0].trim()?this._showActionFeedback("No cookies to clear"):confirm(`Clear all ${t.filter(t=>t.trim()).length} cookies? This may log you out.`)&&(t.forEach(t=>{const e=t.split("=")[0].trim();e&&(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname}`)}),this._showActionFeedback("Cookies cleared"))}_showActionFeedback(t){const e=document.createElement("div");e.textContent=t,e.style.cssText="\n position: fixed;\n bottom: calc(60vh + 10px);\n left: 50%;\n transform: translateX(-50%);\n background: var(--tdt-success, #22c55e);\n color: white;\n padding: 8px 16px;\n border-radius: 4px;\n font-size: calc(12px * var(--tdt-scale, 1));\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const i=document.createElement("style");i.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(i),document.body.appendChild(e),setTimeout(()=>e.remove(),2e3)}_toggleCollapse(){this.isCollapsed=!this.isCollapsed,localStorage.setItem("theme-devtools-collapsed",this.isCollapsed)}_setTab(t){this.activeTab=t,localStorage.setItem("theme-devtools-active-tab",t)}_close(){this.remove()}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){var t,e,i,s,a,r,n;if(!this.context)return U``;const{meta:o,objects:l,metafields:d,metafieldsSchema:c}=this.context,p={...l,cart:this.cart||l.cart,product:this.product||l.product},u=this._getOrderedTabs(),h=`dock--${this.panelPosition||"bottom"}`,g=this.isCollapsed?"▲":"▼";let v="";if("floating"===this.panelPosition){const t=[`left: ${this.floatingX}px`,`top: ${this.floatingY}px`];this.floatingWidth&&t.push(`width: ${this.floatingWidth}px`),this.floatingHeight&&t.push(`height: ${this.floatingHeight}px`),v=t.join("; ")+";"}return U`
|
|
7753
9076
|
<div
|
|
7754
|
-
class="dock ${
|
|
7755
|
-
style="${
|
|
9077
|
+
class="dock ${h} ${this.isCollapsed?"dock--collapsed":""} ${this.isDraggingPanel?"dock--dragging":""}"
|
|
9078
|
+
style="${v}"
|
|
7756
9079
|
>
|
|
7757
9080
|
<div
|
|
7758
9081
|
class="dock__handle"
|
|
@@ -7765,7 +9088,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7765
9088
|
</div>
|
|
7766
9089
|
<div class="dock__controls">
|
|
7767
9090
|
<button class="dock__btn" @click=${t=>{t.stopPropagation(),this._toggleCollapse()}}>
|
|
7768
|
-
${
|
|
9091
|
+
${g}
|
|
7769
9092
|
</button>
|
|
7770
9093
|
<button class="dock__btn" @click=${t=>{t.stopPropagation(),this._close()}}>×</button>
|
|
7771
9094
|
</div>
|
|
@@ -7822,6 +9145,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7822
9145
|
Metaobjects
|
|
7823
9146
|
</button>
|
|
7824
9147
|
<div class="action-dropdown__divider"></div>
|
|
9148
|
+
<button class="action-dropdown__item" @click=${()=>this._openAdminPage("/themes")}>
|
|
9149
|
+
Themes
|
|
9150
|
+
</button>
|
|
7825
9151
|
<button class="action-dropdown__item" @click=${()=>this._openAdminPage("/customers")}>
|
|
7826
9152
|
Customers
|
|
7827
9153
|
</button>
|
|
@@ -7853,11 +9179,12 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7853
9179
|
</div>
|
|
7854
9180
|
|
|
7855
9181
|
<div class="tabs">
|
|
7856
|
-
${
|
|
7857
|
-
<button
|
|
9182
|
+
${u.map(t=>U`
|
|
9183
|
+
<button
|
|
7858
9184
|
class="tab ${this.activeTab===t.id?"tab--active":""} ${this.draggedTab===t.id?"tab--dragging":""} ${this.dragOverTab===t.id?"tab--drag-over":""}"
|
|
7859
9185
|
draggable="true"
|
|
7860
9186
|
@click=${()=>this._setTab(t.id)}
|
|
9187
|
+
@contextmenu=${e=>this._handleTabContextMenu(t.id,e)}
|
|
7861
9188
|
@dragstart=${e=>this._handleDragStart(t.id,e)}
|
|
7862
9189
|
@dragover=${e=>this._handleDragOver(t.id,e)}
|
|
7863
9190
|
@dragleave=${()=>this._handleDragLeave()}
|
|
@@ -7868,70 +9195,87 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7868
9195
|
</button>
|
|
7869
9196
|
`)}
|
|
7870
9197
|
</div>
|
|
9198
|
+
${this._renderTabContextMenu()}
|
|
7871
9199
|
|
|
7872
9200
|
<div class="content">
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
9201
|
+
${this.hiddenTabs.includes("objects")?"":U`
|
|
9202
|
+
<tdt-objects-panel
|
|
9203
|
+
class="panel ${"objects"===this.activeTab?"panel--active":""}"
|
|
9204
|
+
.objects=${p}
|
|
9205
|
+
></tdt-objects-panel>
|
|
9206
|
+
`}
|
|
9207
|
+
|
|
9208
|
+
${this.hiddenTabs.includes("metafields")?"":U`
|
|
9209
|
+
<tdt-metafields-panel
|
|
9210
|
+
class="panel ${"metafields"===this.activeTab?"panel--active":""}"
|
|
9211
|
+
.metafields=${d}
|
|
9212
|
+
.metafieldsSchema=${c}
|
|
9213
|
+
></tdt-metafields-panel>
|
|
9214
|
+
`}
|
|
9215
|
+
|
|
9216
|
+
${this.hiddenTabs.includes("cart")?"":U`
|
|
9217
|
+
<tdt-cart-panel
|
|
9218
|
+
class="panel ${"cart"===this.activeTab?"panel--active":""}"
|
|
9219
|
+
.cart=${this.cart}
|
|
9220
|
+
></tdt-cart-panel>
|
|
9221
|
+
`}
|
|
9222
|
+
|
|
9223
|
+
${this.hiddenTabs.includes("locale")?"":U`
|
|
9224
|
+
<tdt-localization-panel
|
|
9225
|
+
class="panel ${"locale"===this.activeTab?"panel--active":""}"
|
|
9226
|
+
.meta=${o}
|
|
9227
|
+
></tdt-localization-panel>
|
|
9228
|
+
`}
|
|
9229
|
+
|
|
9230
|
+
${this.hiddenTabs.includes("analytics")?"":U`
|
|
9231
|
+
<tdt-analytics-panel
|
|
9232
|
+
class="panel ${"analytics"===this.activeTab?"panel--active":""}"
|
|
9233
|
+
></tdt-analytics-panel>
|
|
9234
|
+
`}
|
|
9235
|
+
|
|
9236
|
+
${this.hiddenTabs.includes("seo")?"":U`
|
|
9237
|
+
<tdt-seo-panel
|
|
9238
|
+
class="panel ${"seo"===this.activeTab?"panel--active":""}"
|
|
9239
|
+
></tdt-seo-panel>
|
|
9240
|
+
`}
|
|
9241
|
+
|
|
9242
|
+
${this.hiddenTabs.includes("apps")?"":U`
|
|
9243
|
+
<tdt-apps-panel
|
|
9244
|
+
class="panel ${"apps"===this.activeTab?"panel--active":""}"
|
|
9245
|
+
></tdt-apps-panel>
|
|
9246
|
+
`}
|
|
9247
|
+
|
|
9248
|
+
${this.hiddenTabs.includes("network")?"":U`
|
|
9249
|
+
<network-panel
|
|
9250
|
+
class="panel ${"network"===this.activeTab?"panel--active":""}"
|
|
9251
|
+
></network-panel>
|
|
9252
|
+
`}
|
|
9253
|
+
|
|
9254
|
+
${this.hiddenTabs.includes("console")?"":U`
|
|
9255
|
+
<tdt-console-panel
|
|
9256
|
+
class="panel ${"console"===this.activeTab?"panel--active":""}"
|
|
9257
|
+
.context=${this.context}
|
|
9258
|
+
></tdt-console-panel>
|
|
9259
|
+
`}
|
|
9260
|
+
|
|
9261
|
+
${this.hiddenTabs.includes("cookies")?"":U`
|
|
9262
|
+
<tdt-cookies-panel
|
|
9263
|
+
class="panel ${"cookies"===this.activeTab?"panel--active":""}"
|
|
9264
|
+
></tdt-cookies-panel>
|
|
9265
|
+
`}
|
|
9266
|
+
|
|
9267
|
+
${this.hiddenTabs.includes("storage")?"":U`
|
|
9268
|
+
<tdt-storage-panel
|
|
9269
|
+
class="panel ${"storage"===this.activeTab?"panel--active":""}"
|
|
9270
|
+
></tdt-storage-panel>
|
|
9271
|
+
`}
|
|
9272
|
+
|
|
9273
|
+
${this.hiddenTabs.includes("info")?"":U`
|
|
9274
|
+
<tdt-info-panel
|
|
9275
|
+
class="panel ${"info"===this.activeTab?"panel--active":""}"
|
|
9276
|
+
.meta=${o}
|
|
9277
|
+
></tdt-info-panel>
|
|
9278
|
+
`}
|
|
7935
9279
|
|
|
7936
9280
|
<tdt-preferences-panel
|
|
7937
9281
|
class="panel ${"preferences"===this.activeTab?"panel--active":""}"
|
|
@@ -7939,7 +9283,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
7939
9283
|
></tdt-preferences-panel>
|
|
7940
9284
|
</div>
|
|
7941
9285
|
</div>
|
|
7942
|
-
`}};__publicField(
|
|
9286
|
+
`}};__publicField(Ja,"properties",{isCollapsed:{type:Boolean,state:!0},activeTab:{type:String,state:!0},context:{type:Object,state:!0},cart:{type:Object,state:!0},product:{type:Object,state:!0},tabOrder:{type:Array,state:!0},hiddenTabs:{type:Array,state:!0},draggedTab:{type:String,state:!0},dragOverTab:{type:String,state:!0},showAdminDropdown:{type:Boolean,state:!0},showTabContextMenu:{type:Boolean,state:!0},tabContextMenuPosition:{type:Object,state:!0},contextMenuTabId:{type:String,state:!0},panelPosition:{type:String,state:!0},panelHeight:{type:String,state:!0},floatingX:{type:Number,state:!0},floatingY:{type:Number,state:!0},isDraggingPanel:{type:Boolean,state:!0}}),__publicField(Ja,"DEFAULT_TABS",[{id:"objects",label:"Objects"},{id:"metafields",label:"Metafields"},{id:"cart",label:"Cart"},{id:"locale",label:"Locale"},{id:"analytics",label:"Analytics"},{id:"seo",label:"SEO"},{id:"apps",label:"Apps"},{id:"network",label:"Network"},{id:"console",label:"Console"},{id:"cookies",label:"Cookies"},{id:"storage",label:"Storage"},{id:"info",label:"Info"},{id:"preferences",label:"Preferences"}]),__publicField(Ja,"styles",[ut,n`
|
|
7943
9287
|
.dock {
|
|
7944
9288
|
position: fixed;
|
|
7945
9289
|
background: var(--tdt-bg);
|
|
@@ -8246,4 +9590,63 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,
|
|
|
8246
9590
|
.panel--active {
|
|
8247
9591
|
display: block;
|
|
8248
9592
|
}
|
|
8249
|
-
|
|
9593
|
+
|
|
9594
|
+
/* Tab context menu */
|
|
9595
|
+
.tab-context-menu {
|
|
9596
|
+
position: fixed;
|
|
9597
|
+
background: var(--tdt-bg);
|
|
9598
|
+
border: 1px solid var(--tdt-border);
|
|
9599
|
+
border-radius: var(--tdt-radius);
|
|
9600
|
+
padding: 4px 0;
|
|
9601
|
+
min-width: 180px;
|
|
9602
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
9603
|
+
z-index: 2147483647;
|
|
9604
|
+
}
|
|
9605
|
+
|
|
9606
|
+
.tab-context-menu__item {
|
|
9607
|
+
display: flex;
|
|
9608
|
+
align-items: center;
|
|
9609
|
+
gap: 8px;
|
|
9610
|
+
padding: 8px 12px;
|
|
9611
|
+
font-size: calc(11px * var(--tdt-scale, 1));
|
|
9612
|
+
color: var(--tdt-text);
|
|
9613
|
+
cursor: pointer;
|
|
9614
|
+
transition: background 0.1s ease;
|
|
9615
|
+
border: none;
|
|
9616
|
+
background: none;
|
|
9617
|
+
width: 100%;
|
|
9618
|
+
text-align: left;
|
|
9619
|
+
font-family: var(--tdt-font);
|
|
9620
|
+
}
|
|
9621
|
+
|
|
9622
|
+
.tab-context-menu__item:hover {
|
|
9623
|
+
background: var(--tdt-bg-hover);
|
|
9624
|
+
}
|
|
9625
|
+
|
|
9626
|
+
.tab-context-menu__item--danger {
|
|
9627
|
+
color: var(--tdt-error);
|
|
9628
|
+
}
|
|
9629
|
+
|
|
9630
|
+
.tab-context-menu__item--danger:hover {
|
|
9631
|
+
background: rgba(239, 68, 68, 0.1);
|
|
9632
|
+
}
|
|
9633
|
+
|
|
9634
|
+
.tab-context-menu__divider {
|
|
9635
|
+
height: 1px;
|
|
9636
|
+
background: var(--tdt-border);
|
|
9637
|
+
margin: 4px 0;
|
|
9638
|
+
}
|
|
9639
|
+
|
|
9640
|
+
.tab-context-menu__submenu-label {
|
|
9641
|
+
padding: 6px 12px;
|
|
9642
|
+
font-size: calc(10px * var(--tdt-scale, 1));
|
|
9643
|
+
color: var(--tdt-text-muted);
|
|
9644
|
+
text-transform: uppercase;
|
|
9645
|
+
letter-spacing: 0.5px;
|
|
9646
|
+
}
|
|
9647
|
+
|
|
9648
|
+
.tab-context-menu__hidden-list {
|
|
9649
|
+
max-height: 200px;
|
|
9650
|
+
overflow-y: auto;
|
|
9651
|
+
}
|
|
9652
|
+
`]);let Ga=Ja;customElements.define("theme-devtools",Ga);function Ka(){const t=document.getElementById("__THEME_DEVTOOLS_ROOT__");if(!t)return void console.warn("[Theme Devtools] Root element not found");const e=document.createElement("theme-devtools");t.appendChild(e),window.__THEME_DEVTOOLS__=e}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ka):Ka()}();
|