shopify-theme-devtools 1.1.1 → 1.1.3

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.
Files changed (2) hide show
  1. package/dist/theme-devtools.js +508 -199
  2. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,__publicField=(t,e,a)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,a);!function(){"use strict";var t;const e=globalThis,a=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let o=class{constructor(t,e,a){if(this._$cssResult$=!0,a!==i)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(a&&void 0===t){const a=void 0!==e&&1===e.length;a&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),a&&s.set(e,t))}return t}toString(){return this.cssText}};const r=(t,...e)=>{const a=1===t.length?t[0]:e.reduce((e,a,i)=>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.")})(a)+t[i+1],t[0]);return new o(a,t,i)},n=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const a of t.cssRules)e+=a.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,v=globalThis,g=v.trustedTypes,m=g?g.emptyScript:"",b=v.reactiveElementPolyfillSupport,f=(t,e)=>t,_={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 a=t;switch(e){case Boolean:a=null!==t;break;case Number:a=null===t?null:Number(t);break;case Object:case Array:try{a=JSON.parse(t)}catch(i){a=null}}return a}},x=(t,e)=>!l(t,e),y={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);let $=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=y){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 a=Symbol(),i=this.getPropertyDescriptor(t,a,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,a){const{get:i,set:s}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=null==i?void 0:i.call(this);null==s||s.call(this,e),this.requestUpdate(t,o,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}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 a of e)this.createProperty(a,t[a])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,a]of e)this.elementProperties.set(t,a)}this._$Eh=new Map;for(const[e,a]of this.elementProperties){const t=this._$Eu(e,a);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const a=new Set(t.flat(1/0).reverse());for(const t of a)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Eu(t,e){const a=e.attribute;return!1===a?void 0:"string"==typeof a?a:"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 a of e.keys())this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{if(a)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const a of i){const i=document.createElement("style"),s=e.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=a.cssText,t.appendChild(i)}})(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,a){this._$AK(t,a)}_$ET(t,e){var a;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==(null==(a=i.converter)?void 0:a.toAttribute)?i.converter:_).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var a,i;const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(a=t.converter)?void 0:a.fromAttribute)?t.converter:_;this._$Em=o;const n=r.fromAttribute(e,t.type);this[o]=n??(null==(i=this._$Ej)?void 0:i.get(o))??n,this._$Em=null}}requestUpdate(t,e,a,i=!1,s){var o;if(void 0!==t){const r=this.constructor;if(!1===i&&(s=this[t]),a??(a=r.getPropertyOptions(t)),!((a.hasChanged??x)(s,e)||a.useDefault&&a.reflect&&s===(null==(o=this._$Ej)?void 0:o.get(t))&&!this.hasAttribute(r._$Eu(t,a))))return;this.C(t,e,a)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:a,reflect:i,wrapped:s},o){a&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==s||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||a||(e=void 0),this._$AL.set(t,e)),!0===i&&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,a]of t){const{wrapped:t}=a,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,a,i)}}let e=!1;const a=this._$AL;try{e=this.shouldUpdate(a),e?(this.willUpdate(a),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(a)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(a)}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){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[f("elementProperties")]=new Map,$[f("finalized")]=new Map,null==b||b({ReactiveElement:$}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.1.2");const w=globalThis,k=t=>t,S=w.trustedTypes,C=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+A,z=`<${E}>`,L=document,j=()=>L.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,I="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,q=/>/g,D=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,R=/"/g,U=/^(?:script|style|textarea|title)$/i,B=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),H=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),G=new WeakMap,J=L.createTreeWalker(L,129);var K;function Q(t,e){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}class W{constructor({strings:t,_$litType$:e},a){let i;this.parts=[];let s=0,o=0;const r=t.length-1,n=this.parts,[l,d]=((t,e)=>{const a=t.length-1,i=[];let s,o=2===e?"<svg>":3===e?"<math>":"",r=N;for(let n=0;n<a;n++){const e=t[n];let a,l,d=-1,c=0;for(;c<e.length&&(r.lastIndex=c,l=r.exec(e),null!==l);)c=r.lastIndex,r===N?"!--"===l[1]?r=F:void 0!==l[1]?r=q:void 0!==l[2]?(U.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=D):void 0!==l[3]&&(r=D):r===D?">"===l[0]?(r=s??N,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?D:'"'===l[3]?R:M):r===R||r===M?r=D:r===F||r===q?r=N:(r=D,s=void 0);const p=r===D&&t[n+1].startsWith("/>")?" ":"";o+=r===N?e+z:d>=0?(i.push(a),e.slice(0,d)+T+e.slice(d)+A+p):e+A+(-2===d?n:p)}return[Q(t,o+(t[a]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=W.createElement(l,a),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&n.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(T)){const e=d[o++],a=i.getAttribute(t).split(A),r=/([.?@])?(.*)/.exec(e);n.push({type:1,index:s,name:r[2],strings:a,ctor:"."===r[1]?et:"?"===r[1]?at:"@"===r[1]?it:tt}),i.removeAttribute(t)}else t.startsWith(A)&&(n.push({type:6,index:s}),i.removeAttribute(t));if(U.test(i.tagName)){const t=i.textContent.split(A),e=t.length-1;if(e>0){i.textContent=S?S.emptyScript:"";for(let a=0;a<e;a++)i.append(t[a],j()),J.nextNode(),n.push({type:2,index:++s});i.append(t[e],j())}}}else if(8===i.nodeType)if(i.data===E)n.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(A,t+1));)n.push({type:7,index:s}),t+=A.length-1}s++}}static createElement(t,e){const a=L.createElement("template");return a.innerHTML=t,a}}function Y(t,e,a=t,i){var s,o;if(e===H)return e;let r=void 0!==i?null==(s=a._$Co)?void 0:s[i]:a._$Cl;const n=O(e)?void 0:e._$litDirective$;return(null==r?void 0:r.constructor)!==n&&(null==(o=null==r?void 0:r._$AO)||o.call(r,!1),void 0===n?r=void 0:(r=new n(t),r._$AT(t,a,i)),void 0!==i?(a._$Co??(a._$Co=[]))[i]=r:a._$Cl=r),void 0!==r&&(e=Y(t,r._$AS(t,e.values),r,i)),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:a}=this._$AD,i=((null==t?void 0:t.creationScope)??L).importNode(e,!0);J.currentNode=i;let s=J.nextNode(),o=0,r=0,n=a[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new Z(s,s.nextSibling,this,t):1===n.type?e=new n.ctor(s,n.name,n.strings,this,t):6===n.type&&(e=new st(s,this,t)),this._$AV.push(e),n=a[++r]}o!==(null==n?void 0:n.index)&&(s=J.nextNode(),o++)}return J.currentNode=L,i}p(t){let e=0;for(const a of this._$AV)void 0!==a&&(void 0!==a.strings?(a._$AI(t,a,e),e+=a.strings.length-2):a._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,a,i){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=a,this.options=i,this._$Cv=(null==i?void 0:i.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),O(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==H&&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!==V&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(L.createTextNode(t)),this._$AH=t}$(t){var e;const{values:a,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=W.createElement(Q(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===s)this._$AH.p(a);else{const t=new X(s,this),e=t.u(this.options);t.p(a),this.T(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new W(t)),e}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let a,i=0;for(const s of t)i===e.length?e.push(a=new Z(this.O(j()),this.O(j()),this,this.options)):a=e[i],a._$AI(s),i++;i<e.length&&(this._$AR(a&&a._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var a;for(null==(a=this._$AP)||a.call(this,!1,!0,e);t!==this._$AB;){const e=k(t).nextSibling;k(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,a,i,s){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,a.length>2||""!==a[0]||""!==a[1]?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=V}_$AI(t,e=this,a,i){const s=this.strings;let o=!1;if(void 0===s)t=Y(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==H,o&&(this._$AH=t);else{const i=t;let r,n;for(t=s[0],r=0;r<s.length-1;r++)n=Y(this,i[a+r],e,r),n===H&&(n=this._$AH[r]),o||(o=!O(n)||n!==this._$AH[r]),n===V?t=V:t!==V&&(t+=(n??"")+s[r+1]),this._$AH[r]=n}o&&!i&&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 at extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==V)}}class it extends tt{constructor(t,e,a,i,s){super(t,e,a,i,s),this.type=5}_$AI(t,e=this){if((t=Y(this,t,e,0)??V)===H)return;const a=this._$AH,i=t===V&&a!==V||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,s=t!==V&&(a===V||i);i&&this.element.removeEventListener(this.name,this,a),s&&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 st{constructor(t,e,a){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const ot=w.litHtmlPolyfillSupport;null==ot||ot(W,Z),(w.litHtmlVersions??(w.litHtmlVersions=[])).push("3.3.2");const rt=globalThis;class nt extends ${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,a)=>{const i=(null==a?void 0:a.renderBefore)??e;let s=i._$litPart$;if(void 0===s){const t=(null==a?void 0:a.renderBefore)??null;i._$litPart$=s=new Z(e.insertBefore(j(),t),t,void 0,a??{})}return s._$AI(t),s})(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 H}}nt._$litElement$=!0,nt.finalized=!0,null==(t=rt.litElementHydrateSupport)||t.call(rt,{LitElement:nt});const lt=rt.litElementPolyfillSupport;null==lt||lt({LitElement:nt}),(rt.litElementVersions??(rt.litElementVersions=[])).push("4.2.2");const dt=r`
1
+ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,__publicField=(t,e,a)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,a);!function(){"use strict";var t;const e=globalThis,a=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let r=class{constructor(t,e,a){if(this._$cssResult$=!0,a!==i)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(a&&void 0===t){const a=void 0!==e&&1===e.length;a&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),a&&s.set(e,t))}return t}toString(){return this.cssText}};const o=(t,...e)=>{const a=1===t.length?t[0]:e.reduce((e,a,i)=>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.")})(a)+t[i+1],t[0]);return new r(a,t,i)},n=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const a of t.cssRules)e+=a.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,i))(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,_={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 a=t;switch(e){case Boolean:a=null!==t;break;case Number:a=null===t?null:Number(t);break;case Object:case Array:try{a=JSON.parse(t)}catch(i){a=null}}return a}},x=(t,e)=>!l(t,e),y={attribute:!0,type:String,converter:_,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=y){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 a=Symbol(),i=this.getPropertyDescriptor(t,a,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,a){const{get:i,set:s}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=null==i?void 0:i.call(this);null==s||s.call(this,e),this.requestUpdate(t,r,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}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 a of e)this.createProperty(a,t[a])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,a]of e)this.elementProperties.set(t,a)}this._$Eh=new Map;for(const[e,a]of this.elementProperties){const t=this._$Eu(e,a);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const a=new Set(t.flat(1/0).reverse());for(const t of a)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Eu(t,e){const a=e.attribute;return!1===a?void 0:"string"==typeof a?a:"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 a of e.keys())this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{if(a)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const a of i){const i=document.createElement("style"),s=e.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=a.cssText,t.appendChild(i)}})(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,a){this._$AK(t,a)}_$ET(t,e){var a;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==(null==(a=i.converter)?void 0:a.toAttribute)?i.converter:_).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){var a,i;const s=this.constructor,r=s._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=s.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(a=t.converter)?void 0:a.fromAttribute)?t.converter:_;this._$Em=r;const n=o.fromAttribute(e,t.type);this[r]=n??(null==(i=this._$Ej)?void 0:i.get(r))??n,this._$Em=null}}requestUpdate(t,e,a,i=!1,s){var r;if(void 0!==t){const o=this.constructor;if(!1===i&&(s=this[t]),a??(a=o.getPropertyOptions(t)),!((a.hasChanged??x)(s,e)||a.useDefault&&a.reflect&&s===(null==(r=this._$Ej)?void 0:r.get(t))&&!this.hasAttribute(o._$Eu(t,a))))return;this.C(t,e,a)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:a,reflect:i,wrapped:s},r){a&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==s||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||a||(e=void 0),this._$AL.set(t,e)),!0===i&&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,a]of t){const{wrapped:t}=a,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,a,i)}}let e=!1;const a=this._$AL;try{e=this.shouldUpdate(a),e?(this.willUpdate(a),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(a)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(a)}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 $=globalThis,k=t=>t,S=$.trustedTypes,C=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+E,L=`<${A}>`,z=document,O=()=>z.createComment(""),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,N="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,q=/>/g,R=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,M=/"/g,U=/^(?:script|style|textarea|title)$/i,G=(K=1,(t,...e)=>({_$litType$:K,strings:t,values:e})),H=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),V=new WeakMap,J=z.createTreeWalker(z,129);var K;function Q(t,e){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}class W{constructor({strings:t,_$litType$:e},a){let i;this.parts=[];let s=0,r=0;const o=t.length-1,n=this.parts,[l,d]=((t,e)=>{const a=t.length-1,i=[];let s,r=2===e?"<svg>":3===e?"<math>":"",o=I;for(let n=0;n<a;n++){const e=t[n];let a,l,d=-1,c=0;for(;c<e.length&&(o.lastIndex=c,l=o.exec(e),null!==l);)c=o.lastIndex,o===I?"!--"===l[1]?o=F:void 0!==l[1]?o=q:void 0!==l[2]?(U.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=R):void 0!==l[3]&&(o=R):o===R?">"===l[0]?(o=s??I,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?R:'"'===l[3]?M:D):o===M||o===D?o=R:o===F||o===q?o=I:(o=R,s=void 0);const p=o===R&&t[n+1].startsWith("/>")?" ":"";r+=o===I?e+L:d>=0?(i.push(a),e.slice(0,d)+T+e.slice(d)+E+p):e+E+(-2===d?n:p)}return[Q(t,r+(t[a]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=W.createElement(l,a),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&n.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(T)){const e=d[r++],a=i.getAttribute(t).split(E),o=/([.?@])?(.*)/.exec(e);n.push({type:1,index:s,name:o[2],strings:a,ctor:"."===o[1]?et:"?"===o[1]?at:"@"===o[1]?it:tt}),i.removeAttribute(t)}else t.startsWith(E)&&(n.push({type:6,index:s}),i.removeAttribute(t));if(U.test(i.tagName)){const t=i.textContent.split(E),e=t.length-1;if(e>0){i.textContent=S?S.emptyScript:"";for(let a=0;a<e;a++)i.append(t[a],O()),J.nextNode(),n.push({type:2,index:++s});i.append(t[e],O())}}}else if(8===i.nodeType)if(i.data===A)n.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(E,t+1));)n.push({type:7,index:s}),t+=E.length-1}s++}}static createElement(t,e){const a=z.createElement("template");return a.innerHTML=t,a}}function X(t,e,a=t,i){var s,r;if(e===H)return e;let o=void 0!==i?null==(s=a._$Co)?void 0:s[i]:a._$Cl;const n=j(e)?void 0:e._$litDirective$;return(null==o?void 0:o.constructor)!==n&&(null==(r=null==o?void 0:o._$AO)||r.call(o,!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,a,i)),void 0!==i?(a._$Co??(a._$Co=[]))[i]=o:a._$Cl=o),void 0!==o&&(e=X(t,o._$AS(t,e.values),o,i)),e}class Y{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:a}=this._$AD,i=((null==t?void 0:t.creationScope)??z).importNode(e,!0);J.currentNode=i;let s=J.nextNode(),r=0,o=0,n=a[0];for(;void 0!==n;){if(r===n.index){let e;2===n.type?e=new Z(s,s.nextSibling,this,t):1===n.type?e=new n.ctor(s,n.name,n.strings,this,t):6===n.type&&(e=new st(s,this,t)),this._$AV.push(e),n=a[++o]}r!==(null==n?void 0:n.index)&&(s=J.nextNode(),r++)}return J.currentNode=z,i}p(t){let e=0;for(const a of this._$AV)void 0!==a&&(void 0!==a.strings?(a._$AI(t,a,e),e+=a.strings.length-2):a._$AI(t[e])),e++}}class Z{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,a,i){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=a,this.options=i,this._$Cv=(null==i?void 0:i.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=X(this,t,e),j(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==H&&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(z.createTextNode(t)),this._$AH=t}$(t){var e;const{values:a,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=W.createElement(Q(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===s)this._$AH.p(a);else{const t=new Y(s,this),e=t.u(this.options);t.p(a),this.T(e),this._$AH=t}}_$AC(t){let e=V.get(t.strings);return void 0===e&&V.set(t.strings,e=new W(t)),e}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let a,i=0;for(const s of t)i===e.length?e.push(a=new Z(this.O(O()),this.O(O()),this,this.options)):a=e[i],a._$AI(s),i++;i<e.length&&(this._$AR(a&&a._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var a;for(null==(a=this._$AP)||a.call(this,!1,!0,e);t!==this._$AB;){const e=k(t).nextSibling;k(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,a,i,s){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,a.length>2||""!==a[0]||""!==a[1]?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=B}_$AI(t,e=this,a,i){const s=this.strings;let r=!1;if(void 0===s)t=X(this,t,e,0),r=!j(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const i=t;let o,n;for(t=s[0],o=0;o<s.length-1;o++)n=X(this,i[a+o],e,o),n===H&&(n=this._$AH[o]),r||(r=!j(n)||n!==this._$AH[o]),n===B?t=B:t!==B&&(t+=(n??"")+s[o+1]),this._$AH[o]=n}r&&!i&&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 at extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class it extends tt{constructor(t,e,a,i,s){super(t,e,a,i,s),this.type=5}_$AI(t,e=this){if((t=X(this,t,e,0)??B)===H)return;const a=this._$AH,i=t===B&&a!==B||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,s=t!==B&&(a===B||i);i&&this.element.removeEventListener(this.name,this,a),s&&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 st{constructor(t,e,a){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const rt=$.litHtmlPolyfillSupport;null==rt||rt(W,Z),($.litHtmlVersions??($.litHtmlVersions=[])).push("3.3.2");const ot=globalThis;class nt 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,a)=>{const i=(null==a?void 0:a.renderBefore)??e;let s=i._$litPart$;if(void 0===s){const t=(null==a?void 0:a.renderBefore)??null;i._$litPart$=s=new Z(e.insertBefore(O(),t),t,void 0,a??{})}return s._$AI(t),s})(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 H}}nt._$litElement$=!0,nt.finalized=!0,null==(t=ot.litElementHydrateSupport)||t.call(ot,{LitElement:nt});const lt=ot.litElementPolyfillSupport;null==lt||lt({LitElement:nt}),(ot.litElementVersions??(ot.litElementVersions=[])).push("4.2.2");const dt=o`
2
2
  :host {
3
3
  --tdt-bg: #1a1a1a;
4
4
  --tdt-bg-secondary: #242424;
@@ -127,21 +127,22 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
127
127
  outline: none;
128
128
  border-color: var(--tdt-accent);
129
129
  }
130
- `;const ct=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 pt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const ut=new class{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null}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})}),a=await e.json();return this.setCart(a),a}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const a=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),i=await a.json();return this.setCart(i),i}catch(a){return console.error("[Theme Devtools] Cart change failed:",a),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;this.currentCart=t,e&&(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:pt(e)}),this.cartHistory.length>50&&this.cartHistory.shift()),this.notify(t,e)}diffCart(t,e){const a={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:[]}},i=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),s=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return s.forEach((t,e)=>{const s=i.get(e);s?s.quantity!==t.quantity&&a.items.modified.push({item:t,oldQuantity:s.quantity,newQuantity:t.quantity}):a.items.added.push(t)}),i.forEach((t,e)=>{s.has(e)||a.items.removed.push(t)}),a}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(a=>{try{a(t,e)}catch(i){console.error("[Theme Devtools] Cart listener error:",i)}})}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(a,i){const s=await e.apply(this,arguments);if("string"==typeof a&&a.includes("/cart"))try{const e=s.clone(),a=await e.json();a&&void 0!==a.item_count&&setTimeout(()=>t.setCart(a),0)}catch{}return s};const a=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,i){return"string"==typeof i&&i.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&setTimeout(()=>t.setCart(e),0)}catch{}}),a.apply(this,arguments)}}};const ht=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 a;const i=e.id.replace("shopify-section-",""),s=e.dataset.sectionType||(null==(a=e.className.match(/section-(\w+)/))?void 0:a[1])||"unknown",o=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:i,type:s,element:e,blockCount:o.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const a=e.dataset.sectionId;if(!t.find(t=>t.id===a)){const i=e.dataset.sectionType||"unknown",s=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:a,type:i,element:e,blockCount:s.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 a=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${a.top}px`,left:`${a.left}px`,width:`${a.width}px`,height:`${a.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)}};class vt extends nt{constructor(){super(),this.data=null,this.path="",this.expanded=new Set}_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[]}}_toggleExpand(t,e){e.stopPropagation();const a=new Set(this.expanded);a.has(t)?a.delete(t):a.add(t),this.expanded=a}async _copyPath(t,e){e.stopPropagation();const a=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${a} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(i){console.error("Failed to copy:",i)}}_renderValue(t,e){switch(e){case"string":const e=t.length>80?t.slice(0,80)+"...":t;return B`<span class="value value--string">"${e}"</span>`;case"number":return B`<span class="value value--number">${t}</span>`;case"boolean":return B`<span class="value value--boolean">${t}</span>`;case"null":return B`<span class="value value--null">null</span>`;case"undefined":return B`<span class="value value--undefined">undefined</span>`;case"object":case"array":return B`<span class="preview">{}</span>`;default:return B`<span class="value">${String(t)}</span>`}}_renderPreview(t,e){let a;try{a=Object.keys(t).length}catch{a=0}return B`<span class="preview">${"array"===e?`Array(${a})`:`{${a} ${1===a?"key":"keys"}}`}</span>`}_renderNode(t,e,a,i=!1,s=!1){const o=this._getType(e),r=this._isExpandable(e),n=this.expanded.has(a),l=["node",i?"node--root":"",r?"node--expandable":"",n?"node--expanded":""].filter(Boolean).join(" ");return B`
131
- <div
132
- class=${l}
133
- @click=${r?t=>this._toggleExpand(a,t):null}
130
+ `;const ct=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 pt(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const ut=new class{constructor(){this.listeners=new Set,this.currentCart=null,this.cartHistory=[],this.pollInterval=null}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})}),a=await e.json();return this.setCart(a),a}catch(e){return console.error("[Theme Devtools] Cart update failed:",e),null}}async change(t,e){try{const a=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({line:t,quantity:e})}),i=await a.json();return this.setCart(i),i}catch(a){return console.error("[Theme Devtools] Cart change failed:",a),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;this.currentCart=t,e&&(this.cartHistory.push({timestamp:Date.now(),diff:this.diffCart(e,t),snapshot:pt(e)}),this.cartHistory.length>50&&this.cartHistory.shift()),this.notify(t,e)}diffCart(t,e){const a={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:[]}},i=new Map(((null==t?void 0:t.items)||[]).map(t=>[t.key,t])),s=new Map(((null==e?void 0:e.items)||[]).map(t=>[t.key,t]));return s.forEach((t,e)=>{const s=i.get(e);s?s.quantity!==t.quantity&&a.items.modified.push({item:t,oldQuantity:s.quantity,newQuantity:t.quantity}):a.items.added.push(t)}),i.forEach((t,e)=>{s.has(e)||a.items.removed.push(t)}),a}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t,e){this.listeners.forEach(a=>{try{a(t,e)}catch(i){console.error("[Theme Devtools] Cart listener error:",i)}})}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(a,i){const s=await e.apply(this,arguments);if("string"==typeof a&&a.includes("/cart"))try{const e=s.clone(),a=await e.json();a&&void 0!==a.item_count&&setTimeout(()=>t.setCart(a),0)}catch{}return s};const a=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,i){return"string"==typeof i&&i.includes("/cart")&&this.addEventListener("load",function(){try{const e=JSON.parse(this.responseText);e&&void 0!==e.item_count&&setTimeout(()=>t.setCart(e),0)}catch{}}),a.apply(this,arguments)}}};const ht=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 a;const i=e.id.replace("shopify-section-",""),s=e.dataset.sectionType||(null==(a=e.className.match(/section-(\w+)/))?void 0:a[1])||"unknown",r=Array.from(e.querySelectorAll('[data-block-id], [id*="block"]'));t.push({id:i,type:s,element:e,blockCount:r.length,rect:e.getBoundingClientRect()})});return Array.from(document.querySelectorAll("[data-section-id]")).forEach(e=>{const a=e.dataset.sectionId;if(!t.find(t=>t.id===a)){const i=e.dataset.sectionType||"unknown",s=Array.from(e.querySelectorAll("[data-block-id]"));t.push({id:a,type:i,element:e,blockCount:s.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 a=e.element.getBoundingClientRect();Object.assign(this.overlay.style,{display:"block",top:`${a.top}px`,left:`${a.left}px`,width:`${a.width}px`,height:`${a.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)}};class gt extends nt{constructor(){super(),this.data=null,this.path="",this.expanded=new Set,this.searchQuery="",this._matchingPaths=new Set}updated(t){(t.has("searchQuery")||t.has("data"))&&this._updateMatchingPaths()}_updateMatchingPaths(){const t=(this.searchQuery||"").toLowerCase().trim();if(!t||!this.data)return void(this._matchingPaths=new Set);const e=new Set;if(this._findMatches(this.data,this.path,t,e),this._matchingPaths=e,e.size>0){const t=new Set(this.expanded);for(const a of e){const e=a.split(".");let i="";for(let a=0;a<e.length-1;a++)i=i?`${i}.${e[a]}`:e[a],t.add(i)}this.expanded=t}}_findMatches(t,e,a,i){if(null==t)return;const s=this._getType(t);if("object"!==s&&"array"!==s){return void(String(t).toLowerCase().includes(a)&&i.add(e))}let r;try{r=Object.entries(t)}catch{return}for(const[o,n]of r){const t=e?`${e}.${o}`:o;o.toLowerCase().includes(a)&&i.add(t),this._findMatches(n,t,a,i)}}_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 a=String(t).toLowerCase(),i=e.toLowerCase(),s=a.indexOf(i);if(-1===s)return t;const r=String(t).slice(0,s),o=String(t).slice(s,s+e.length),n=String(t).slice(s+e.length);return G`${r}<span class="highlight">${o}</span>${n}`}_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[]}}_toggleExpand(t,e){e.stopPropagation();const a=new Set(this.expanded);a.has(t)?a.delete(t):a.add(t),this.expanded=a}async _copyPath(t,e){e.stopPropagation();const a=t.replace(/^objects\./,"").replace(/^meta\./,"");try{await navigator.clipboard.writeText(`{{ ${a} }}`);const t=e.target;t.classList.add("key--copied"),setTimeout(()=>t.classList.remove("key--copied"),1e3)}catch(i){console.error("Failed to copy:",i)}}_renderValue(t,e){switch(e){case"string":const e=t.length>80?t.slice(0,80)+"...":t;return G`<span class="value value--string">"${e}"</span>`;case"number":return G`<span class="value value--number">${t}</span>`;case"boolean":return G`<span class="value value--boolean">${t}</span>`;case"null":return G`<span class="value value--null">null</span>`;case"undefined":return G`<span class="value value--undefined">undefined</span>`;case"object":case"array":return G`<span class="preview">{}</span>`;default:return G`<span class="value">${String(t)}</span>`}}_renderValueWithHighlight(t,e,a){if(!a)return this._renderValue(t,e);switch(e){case"string":const e=t.length>80?t.slice(0,80)+"...":t;return G`<span class="value value--string">"${this._highlightText(e,a)}"</span>`;case"number":return G`<span class="value value--number">${this._highlightText(String(t),a)}</span>`;case"boolean":return G`<span class="value value--boolean">${this._highlightText(String(t),a)}</span>`;case"null":return G`<span class="value value--null">null</span>`;case"undefined":return G`<span class="value value--undefined">undefined</span>`;case"object":case"array":return G`<span class="preview">{}</span>`;default:return G`<span class="value">${this._highlightText(String(t),a)}</span>`}}_renderPreview(t,e){let a;try{a=Object.keys(t).length}catch{a=0}return G`<span class="preview">${"array"===e?`Array(${a})`:`{${a} ${1===a?"key":"keys"}}`}</span>`}_renderNode(t,e,a,i=!1,s=!1){const r=this._getType(e),o=this._isExpandable(e),n=this.expanded.has(a),l=this._isPathVisible(a),d=(this.searchQuery||"").trim(),c=["node",i?"node--root":"",o?"node--expandable":"",n?"node--expanded":"",l?"":"node--hidden"].filter(Boolean).join(" "),p=s?`[${t}]`:t,u=d?this._highlightText(p,d):p;let h=0;if(o&&d&&this._matchingPaths.size>0)for(const g of this._matchingPaths)g.startsWith(a+".")&&h++;return G`
131
+ <div
132
+ class=${c}
133
+ @click=${o?t=>this._toggleExpand(a,t):null}
134
134
  >
135
- <span class="key" @click=${t=>this._copyPath(a,t)}>${s?`[${t}]`:t}</span>
135
+ <span class="key" @click=${t=>this._copyPath(a,t)}>${u}</span>
136
136
  <span class="separator">: </span>
137
- ${r?this._renderPreview(e,o):this._renderValue(e,o)}
138
- ${r&&n?B`
137
+ ${o?this._renderPreview(e,r):this._renderValueWithHighlight(e,r,d)}
138
+ ${h>0&&!n?G`<span class="match-count">${h} match${h>1?"es":""}</span>`:""}
139
+ ${o&&n?G`
139
140
  <div class="children">
140
141
  ${this._renderObject(e,a)}
141
142
  </div>
142
143
  `:""}
143
144
  </div>
144
- `}_renderObject(t,e=""){if(null==t)return B`<span class="value value--null">${null===t?"null":"undefined"}</span>`;const a=this._getType(t);let i;try{i=Object.entries(t)}catch{return B`<span class="preview">[Object]</span>`}return 0===i.length?B`<span class="preview">${"array"===a?"[]":"{}"}</span>`:i.map(([t,i])=>{const s=e?`${e}.${t}`:t;return this._renderNode(t,i,s,!e,"array"===a)})}render(){return null===this.data?B`<span class="value value--null">null</span>`:void 0===this.data?B`<span class="value value--undefined">undefined</span>`:B`${this._renderObject(this.data,this.path)}`}}__publicField(vt,"properties",{data:{type:Object},path:{type:String},expanded:{type:Object,state:!0}}),__publicField(vt,"styles",[dt,r`
145
+ `}_renderObject(t,e=""){if(null==t)return G`<span class="value value--null">${null===t?"null":"undefined"}</span>`;const a=this._getType(t);let i;try{i=Object.entries(t)}catch{return G`<span class="preview">[Object]</span>`}return 0===i.length?G`<span class="preview">${"array"===a?"[]":"{}"}</span>`:i.map(([t,i])=>{const s=e?`${e}.${t}`:t;return this._renderNode(t,i,s,!e,"array"===a)})}render(){return null===this.data?G`<span class="value value--null">null</span>`:void 0===this.data?G`<span class="value value--undefined">undefined</span>`:G`${this._renderObject(this.data,this.path)}`}}__publicField(gt,"properties",{data:{type:Object},path:{type:String},expanded:{type:Object,state:!0},searchQuery:{type:String},_matchingPaths:{type:Object,state:!0}}),__publicField(gt,"styles",[dt,o`
145
146
  :host {
146
147
  display: block;
147
148
  font-family: var(--tdt-font);
@@ -221,17 +222,36 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
221
222
  border-left: 1px solid var(--tdt-border);
222
223
  margin-left: 6px;
223
224
  }
224
- `]),customElements.define("tdt-object-inspector",vt);class gt extends nt{constructor(){super(),this.objects={},this.activeObject=null,this.searchQuery=""}updated(t){if(t.has("objects")&&this.objects){const t=Object.keys(this.objects).filter(t=>null!==this.objects[t]);t.length>0&&!this.activeObject&&(this.activeObject=t[0])}}_handleSearch(t){this.searchQuery=t.target.value}_selectObject(t){this.activeObject=t}render(){if(!this.objects||0===Object.keys(this.objects).length)return B`<div class="empty-state">No Liquid objects available on this page</div>`;const t=Object.keys(this.objects),e=this.activeObject?this.objects[this.activeObject]:null;return B`
225
- <input
226
- type="search"
227
- class="search"
228
- placeholder="Filter objects..."
225
+
226
+ .highlight {
227
+ background: rgba(250, 204, 21, 0.3);
228
+ border-radius: 2px;
229
+ padding: 0 1px;
230
+ }
231
+
232
+ .node--hidden {
233
+ display: none;
234
+ }
235
+
236
+ .match-count {
237
+ color: var(--tdt-text-muted);
238
+ font-size: 10px;
239
+ margin-left: 6px;
240
+ background: var(--tdt-bg-secondary);
241
+ padding: 1px 5px;
242
+ border-radius: 8px;
243
+ }
244
+ `]),customElements.define("tdt-object-inspector",gt);class vt extends nt{constructor(){super(),this.objects={},this.activeObject=null,this.searchQuery=""}updated(t){if(t.has("objects")&&this.objects){const t=Object.keys(this.objects).filter(t=>null!==this.objects[t]);t.length>0&&!this.activeObject&&(this.activeObject=t[0])}}_handleSearch(t){this.searchQuery=t.target.value}_selectObject(t){this.activeObject=t}render(){if(!this.objects||0===Object.keys(this.objects).length)return G`<div class="empty-state">No Liquid objects available on this page</div>`;const t=Object.keys(this.objects),e=this.activeObject?this.objects[this.activeObject]:null;return G`
245
+ <input
246
+ type="search"
247
+ class="search"
248
+ placeholder="Search keys and values..."
229
249
  .value=${this.searchQuery}
230
250
  @input=${this._handleSearch}
231
251
  >
232
252
 
233
253
  <div class="object-tabs">
234
- ${t.map(t=>B`
254
+ ${t.map(t=>G`
235
255
  <button
236
256
  class="object-tab ${this.activeObject===t?"object-tab--active":""} ${null===this.objects[t]?"object-tab--null":""}"
237
257
  @click=${()=>this._selectObject(t)}
@@ -242,14 +262,15 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
242
262
  </div>
243
263
 
244
264
  <div class="object-content">
245
- ${null===e?B`<div class="null-state">${this.activeObject} is null on this page</div>`:B`
246
- <tdt-object-inspector
247
- .data=${e}
265
+ ${null===e?G`<div class="null-state">${this.activeObject} is null on this page</div>`:G`
266
+ <tdt-object-inspector
267
+ .data=${e}
248
268
  .path=${"objects."+this.activeObject}
269
+ .searchQuery=${this.searchQuery}
249
270
  ></tdt-object-inspector>
250
271
  `}
251
272
  </div>
252
- `}}__publicField(gt,"properties",{objects:{type:Object},activeObject:{type:String,state:!0},searchQuery:{type:String,state:!0}}),__publicField(gt,"styles",[dt,r`
273
+ `}}__publicField(vt,"properties",{objects:{type:Object},activeObject:{type:String,state:!0},searchQuery:{type:String,state:!0}}),__publicField(vt,"styles",[dt,o`
253
274
  :host {
254
275
  display: block;
255
276
  padding: 12px;
@@ -306,7 +327,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
306
327
  text-align: center;
307
328
  font-style: italic;
308
329
  }
309
- `]),customElements.define("tdt-objects-panel",gt);class mt extends nt{constructor(){super(),this.cart=null,this.previousCart=null,this.diff=null}updated(t){if(t.has("cart")&&this.cart){const e=t.get("cart");e&&(this.previousCart=e,this.diff=ut.diffCart(e,this.cart))}}async _refresh(){const t=await ut.fetch();t&&ut.setCart(t)}async _clear(){confirm("Clear entire cart?")&&await ut.clear()}async _updateQuantity(t,e){await ut.change(t+1,e)}async _remove(t){await ut.change(t+1,0)}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){if(!this.cart)return B`<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 B`
330
+ `]),customElements.define("tdt-objects-panel",vt);class mt extends nt{constructor(){super(),this.cart=null,this.previousCart=null,this.diff=null}updated(t){if(t.has("cart")&&this.cart){const e=t.get("cart");e&&(this.previousCart=e,this.diff=ut.diffCart(e,this.cart))}}async _refresh(){const t=await ut.fetch();t&&ut.setCart(t)}async _clear(){confirm("Clear entire cart?")&&await ut.clear()}async _updateQuantity(t,e){await ut.change(t+1,e)}async _remove(t){await ut.change(t+1,0)}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){if(!this.cart)return G`<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 G`
310
331
  <div class="toolbar">
311
332
  <div class="stats">
312
333
  <span><strong>${this.cart.item_count}</strong> items</span>
@@ -319,21 +340,21 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
319
340
  </div>
320
341
  </div>
321
342
 
322
- ${t?B`
343
+ ${t?G`
323
344
  <div class="diff">
324
- ${this.diff.items.added.map(t=>B`
345
+ ${this.diff.items.added.map(t=>G`
325
346
  <span class="diff__added">+ ${t.title} ×${t.quantity}</span>
326
347
  `)}
327
- ${this.diff.items.removed.map(t=>B`
348
+ ${this.diff.items.removed.map(t=>G`
328
349
  <span class="diff__removed">− ${t.title}</span>
329
350
  `)}
330
- ${this.diff.items.modified.map(({item:t,oldQuantity:e,newQuantity:a})=>B`
351
+ ${this.diff.items.modified.map(({item:t,oldQuantity:e,newQuantity:a})=>G`
331
352
  <span class="diff__modified">~ ${t.title}: ${e}→${a}</span>
332
353
  `)}
333
354
  </div>
334
355
  `:""}
335
356
 
336
- ${0===this.cart.items.length?B`<div class="empty-state">Cart is empty</div>`:B`
357
+ ${0===this.cart.items.length?G`<div class="empty-state">Cart is empty</div>`:G`
337
358
  <table>
338
359
  <thead>
339
360
  <tr>
@@ -346,14 +367,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
346
367
  </tr>
347
368
  </thead>
348
369
  <tbody>
349
- ${this.cart.items.map((t,e)=>B`
370
+ ${this.cart.items.map((t,e)=>G`
350
371
  <tr>
351
372
  <td class="col-img">
352
- ${t.image?B`<img class="item-img" src="${t.image.replace(/(\.[^.]+)$/,"_60x60$1")}" alt="">`:B`<div class="item-img"></div>`}
373
+ ${t.image?G`<img class="item-img" src="${t.image.replace(/(\.[^.]+)$/,"_60x60$1")}" alt="">`:G`<div class="item-img"></div>`}
353
374
  </td>
354
375
  <td>
355
376
  <div class="item-title" title="${t.product_title}">${t.product_title}</div>
356
- ${t.variant_title?B`<div class="item-variant">${t.variant_title}</div>`:""}
377
+ ${t.variant_title?G`<div class="item-variant">${t.variant_title}</div>`:""}
357
378
  </td>
358
379
  <td class="item-sku">${t.sku||"—"}</td>
359
380
  <td>
@@ -374,7 +395,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
374
395
  </tbody>
375
396
  </table>
376
397
  `}
377
- `}}__publicField(mt,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0}}),__publicField(mt,"styles",[dt,r`
398
+ `}}__publicField(mt,"properties",{cart:{type:Object},previousCart:{type:Object,state:!0},diff:{type:Object,state:!0}}),__publicField(mt,"styles",[dt,o`
378
399
  :host {
379
400
  display: block;
380
401
  padding: 8px 12px;
@@ -516,11 +537,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
516
537
  border-color: var(--tdt-danger);
517
538
  color: white;
518
539
  }
519
- `]),customElements.define("tdt-cart-panel",mt);class bt extends nt{constructor(){super(),this.meta={}}_renderSection(t,e){return B`
540
+ `]),customElements.define("tdt-cart-panel",mt);class bt extends nt{constructor(){super(),this.meta={}}_renderSection(t,e){return G`
520
541
  <div class="section">
521
542
  <h4 class="section__title">${t}</h4>
522
543
  <table class="table">
523
- ${e.map(([t,e])=>B`
544
+ ${e.map(([t,e])=>G`
524
545
  <tr>
525
546
  <td class="table__label">${t}</td>
526
547
  <td class="table__value">${e??"—"}</td>
@@ -528,9 +549,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
528
549
  `)}
529
550
  </table>
530
551
  </div>
531
- `}render(){var t,e,a,i,s,o,r,n,l,d,c,p,u,h,v,g,m,b,f,_,x,y,$,w,k,S,C;if(!this.meta)return B`<div class="empty-state">No metadata available</div>`;const T=[{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==(a=this.meta.theme)?void 0:a.role]]},{title:"Template",items:[["Name",null==(i=this.meta.template)?void 0:i.name],["Suffix",(null==(s=this.meta.template)?void 0:s.suffix)||"—"],["Directory",(null==(o=this.meta.template)?void 0:o.directory)||"—"]]},{title:"Request",items:[["Page Type",null==(r=this.meta.request)?void 0:r.page_type],["Path",null==(n=this.meta.request)?void 0:n.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==(v=null==(h=this.meta.request)?void 0:h.locale)?void 0:v.iso_code)||""})`],["Country",`${(null==(m=null==(g=this.meta.localization)?void 0:g.country)?void 0:m.name)||""} (${(null==(f=null==(b=this.meta.localization)?void 0:b.country)?void 0:f.iso_code)||""})`],["Currency",`${(null==(y=null==(x=null==(_=this.meta.localization)?void 0:_.country)?void 0:x.currency)?void 0:y.symbol)||""} ${(null==(k=null==(w=null==($=this.meta.localization)?void 0:$.country)?void 0:w.currency)?void 0:k.iso_code)||""}`],["Market",(null==(C=null==(S=this.meta.localization)?void 0:S.market)?void 0:C.handle)||"—"]]}];return B`
552
+ `}render(){var t,e,a,i,s,r,o,n,l,d,c,p,u,h,g,v,m,b,f,_,x,y,w,$,k,S,C;if(!this.meta)return G`<div class="empty-state">No metadata available</div>`;const T=[{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==(a=this.meta.theme)?void 0:a.role]]},{title:"Template",items:[["Name",null==(i=this.meta.template)?void 0:i.name],["Suffix",(null==(s=this.meta.template)?void 0:s.suffix)||"—"],["Directory",(null==(r=this.meta.template)?void 0:r.directory)||"—"]]},{title:"Request",items:[["Page Type",null==(o=this.meta.request)?void 0:o.page_type],["Path",null==(n=this.meta.request)?void 0:n.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==(y=null==(x=null==(_=this.meta.localization)?void 0:_.country)?void 0:x.currency)?void 0:y.symbol)||""} ${(null==(k=null==($=null==(w=this.meta.localization)?void 0:w.country)?void 0:$.currency)?void 0:k.iso_code)||""}`],["Market",(null==(C=null==(S=this.meta.localization)?void 0:S.market)?void 0:C.handle)||"—"]]}];return G`
532
553
  ${T.map(t=>this._renderSection(t.title,t.items))}
533
- `}}__publicField(bt,"properties",{meta:{type:Object}}),__publicField(bt,"styles",[dt,r`
554
+ `}}__publicField(bt,"properties",{meta:{type:Object}}),__publicField(bt,"styles",[dt,o`
534
555
  :host {
535
556
  display: block;
536
557
  padding: 12px;
@@ -572,16 +593,16 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
572
593
  color: var(--tdt-text);
573
594
  word-break: break-all;
574
595
  }
575
- `]),customElements.define("tdt-info-panel",bt);const ft=class t extends nt{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,a;const i={},s=this.metafieldsSchema||{},o=this.metafields||{};for(const[r,n]of Object.entries(s))if(Array.isArray(n)&&0!==n.length){i[r]={schema:n,values:o[r]||{},byNamespace:{}};for(const a of n){const s=a.namespace;i[r].byNamespace[s]||(i[r].byNamespace[s]=[]);const n=null==(e=null==(t=o[r])?void 0:t[s])?void 0:e[a.key];i[r].byNamespace[s].push({...a,hasValue:null!=n,actualValue:null==n?void 0:n.value,actualType:null==n?void 0:n.type})}}for(const[r,n]of Object.entries(o))if(n&&"object"==typeof n){i[r]||(i[r]={schema:[],values:n,byNamespace:{}});for(const[t,e]of Object.entries(n))if(e&&"object"==typeof e){i[r].byNamespace[t]||(i[r].byNamespace[t]=[]);for(const[s,o]of Object.entries(e)){(null==(a=i[r].byNamespace[t])?void 0:a.find(t=>t.key===s))||i[r].byNamespace[t].push({key:s,namespace:t,name:s,description:"",type:{name:(null==o?void 0:o.type)||"unknown",category:"UNKNOWN"},hasValue:!0,actualValue:null==o?void 0:o.value,actualType:null==o?void 0:o.type})}}}return i}_getResourceStats(t){let e=0,a=0;for(const i of Object.values(t.byNamespace))e+=i.length,a+=i.filter(t=>t.hasValue).length;return{total:e,filled:a}}_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,a,i){null==i||i.stopPropagation();const s=`{{ ${t}.metafields.${e}.${a} }}`;try{await navigator.clipboard.writeText(s),this.copiedPath=`${t}.${e}.${a}`,setTimeout(()=>{this.copiedPath=null},1500)}catch(o){console.error("Failed to copy:",o)}}async _copyValue(t,e){null==e||e.stopPropagation();const a="object"==typeof t?JSON.stringify(t,null,2):String(t);try{await navigator.clipboard.writeText(a)}catch(i){console.error("Failed to copy value:",i)}}_formatValue(t){if(null==t)return B`<span class="value--null">null</span>`;if("object"==typeof t){const e=JSON.stringify(t,null,2);return B`<span class="value--json">${e}</span>`}return"string"==typeof t?B`<span class="value--string">"${t}"</span>`:"number"==typeof t?B`<span class="value--number">${t}</span>`:"boolean"==typeof t?B`<span class="value--boolean">${t}</span>`:B`<span>${String(t)}</span>`}_filterData(t){if(!this.searchQuery.trim())return t;const e=this.searchQuery.toLowerCase(),a={};for(const[i,s]of Object.entries(t)){const t={};for(const[a,i]of Object.entries(s.byNamespace)){const s=i.filter(t=>{var i,s;const o=t.key.toLowerCase().includes(e),r=a.toLowerCase().includes(e),n=null==(i=t.name)?void 0:i.toLowerCase().includes(e),l=null==(s=t.description)?void 0:s.toLowerCase().includes(e),d=t.actualValue&&String(t.actualValue).toLowerCase().includes(e);return o||r||n||l||d});s.length>0&&(t[a]=s)}Object.keys(t).length>0&&(a[i]={...s,byNamespace:t})}return a}_renderMetafield(t,e){var a,i;const s=`${t}.${e.namespace}.${e.key}`,o=this.copiedPath===s,r=(null==(a=e.type)?void 0:a.name)||e.actualType||"unknown";return this.showEmptyFields||e.hasValue?B`
596
+ `]),customElements.define("tdt-info-panel",bt);const ft=class t extends nt{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,a;const i={},s=this.metafieldsSchema||{},r=this.metafields||{};for(const[o,n]of Object.entries(s))if(Array.isArray(n)&&0!==n.length){i[o]={schema:n,values:r[o]||{},byNamespace:{}};for(const a of n){const s=a.namespace;i[o].byNamespace[s]||(i[o].byNamespace[s]=[]);const n=null==(e=null==(t=r[o])?void 0:t[s])?void 0:e[a.key];i[o].byNamespace[s].push({...a,hasValue:null!=n,actualValue:null==n?void 0:n.value,actualType:null==n?void 0:n.type})}}for(const[o,n]of Object.entries(r))if(n&&"object"==typeof n){i[o]||(i[o]={schema:[],values:n,byNamespace:{}});for(const[t,e]of Object.entries(n))if(e&&"object"==typeof e){i[o].byNamespace[t]||(i[o].byNamespace[t]=[]);for(const[s,r]of Object.entries(e)){(null==(a=i[o].byNamespace[t])?void 0:a.find(t=>t.key===s))||i[o].byNamespace[t].push({key:s,namespace:t,name:s,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 i}_getResourceStats(t){let e=0,a=0;for(const i of Object.values(t.byNamespace))e+=i.length,a+=i.filter(t=>t.hasValue).length;return{total:e,filled:a}}_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,a,i){null==i||i.stopPropagation();const s=`{{ ${t}.metafields.${e}.${a} }}`;try{await navigator.clipboard.writeText(s),this.copiedPath=`${t}.${e}.${a}`,setTimeout(()=>{this.copiedPath=null},1500)}catch(r){console.error("Failed to copy:",r)}}async _copyValue(t,e){null==e||e.stopPropagation();const a="object"==typeof t?JSON.stringify(t,null,2):String(t);try{await navigator.clipboard.writeText(a)}catch(i){console.error("Failed to copy value:",i)}}_formatValue(t){if(null==t)return G`<span class="value--null">null</span>`;if("object"==typeof t){const e=JSON.stringify(t,null,2);return G`<span class="value--json">${e}</span>`}return"string"==typeof t?G`<span class="value--string">"${t}"</span>`:"number"==typeof t?G`<span class="value--number">${t}</span>`:"boolean"==typeof t?G`<span class="value--boolean">${t}</span>`:G`<span>${String(t)}</span>`}_filterData(t){if(!this.searchQuery.trim())return t;const e=this.searchQuery.toLowerCase(),a={};for(const[i,s]of Object.entries(t)){const t={};for(const[a,i]of Object.entries(s.byNamespace)){const s=i.filter(t=>{var i,s;const r=t.key.toLowerCase().includes(e),o=a.toLowerCase().includes(e),n=null==(i=t.name)?void 0:i.toLowerCase().includes(e),l=null==(s=t.description)?void 0:s.toLowerCase().includes(e),d=t.actualValue&&String(t.actualValue).toLowerCase().includes(e);return r||o||n||l||d});s.length>0&&(t[a]=s)}Object.keys(t).length>0&&(a[i]={...s,byNamespace:t})}return a}_renderMetafield(t,e){var a,i;const s=`${t}.${e.namespace}.${e.key}`,r=this.copiedPath===s,o=(null==(a=e.type)?void 0:a.name)||e.actualType||"unknown";return this.showEmptyFields||e.hasValue?G`
576
597
  <div class="metafield ${e.hasValue?"":"metafield--empty"}">
577
598
  <div class="metafield__header">
578
599
  <span
579
- class="metafield__key ${o?"metafield__key--copied":""}"
600
+ class="metafield__key ${r?"metafield__key--copied":""}"
580
601
  @click=${a=>this._copyLiquidPath(t,e.namespace,e.key,a)}
581
602
  title="Click to copy Liquid path"
582
603
  >${e.key}</span>
583
- <span class="metafield__type type--${this._getTypeClass(r)}">${r}</span>
584
- ${(null==(i=e.type)?void 0:i.category)?B`
604
+ <span class="metafield__type type--${this._getTypeClass(o)}">${o}</span>
605
+ ${(null==(i=e.type)?void 0:i.category)?G`
585
606
  <span class="metafield__category">${e.type.category}</span>
586
607
  `:""}
587
608
  <div class="metafield__actions">
@@ -589,8 +610,8 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
589
610
  class="action-btn"
590
611
  @click=${a=>this._copyLiquidPath(t,e.namespace,e.key,a)}
591
612
  title="Copy Liquid path"
592
- >${o?"✓":"📋"}</button>
593
- ${e.hasValue?B`
613
+ >${r?"✓":"📋"}</button>
614
+ ${e.hasValue?G`
594
615
  <button
595
616
  class="action-btn"
596
617
  @click=${t=>this._copyValue(e.actualValue,t)}
@@ -599,33 +620,33 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
599
620
  `:""}
600
621
  </div>
601
622
  </div>
602
- ${e.name&&e.name!==e.key?B`
623
+ ${e.name&&e.name!==e.key?G`
603
624
  <div class="metafield__name">${e.name}</div>
604
625
  `:""}
605
- ${e.description?B`
626
+ ${e.description?G`
606
627
  <div class="metafield__description">${e.description}</div>
607
628
  `:""}
608
629
  <div class="metafield__value ${e.hasValue?"":"metafield__value--empty"}">
609
- ${e.hasValue?this._formatValue(e.actualValue):B`No value set`}
630
+ ${e.hasValue?this._formatValue(e.actualValue):G`No value set`}
610
631
  </div>
611
632
  </div>
612
- `:""}_renderNamespace(t,e,a){const i=`${t}.${e}`,s=this.expandedPaths.has(i),o=a.filter(t=>t.hasValue).length,r=a.length,n=this.showEmptyFields?a:a.filter(t=>t.hasValue);return 0===n.length?"":B`
633
+ `:""}_renderNamespace(t,e,a){const i=`${t}.${e}`,s=this.expandedPaths.has(i),r=a.filter(t=>t.hasValue).length,o=a.length,n=this.showEmptyFields?a:a.filter(t=>t.hasValue);return 0===n.length?"":G`
613
634
  <div class="namespace-group">
614
635
  <div class="namespace-header" @click=${()=>this._toggleNamespace(i)}>
615
636
  <span class="expand-icon ${s?"expand-icon--open":""}">â–ļ</span>
616
637
  <span class="namespace-name">${e}</span>
617
638
  <span class="namespace-stats">
618
- <span class="namespace-stats__filled">${o} filled</span>
619
- <span>/ ${r} total</span>
639
+ <span class="namespace-stats__filled">${r} filled</span>
640
+ <span>/ ${o} total</span>
620
641
  </span>
621
642
  </div>
622
- ${s?B`
643
+ ${s?G`
623
644
  <div class="metafield-list">
624
645
  ${n.map(e=>this._renderMetafield(t,e))}
625
646
  </div>
626
647
  `:""}
627
648
  </div>
628
- `}render(){const e=this._getMergedData(),a=this.metafieldsSchema&&Object.keys(this.metafieldsSchema).length>0;if(!(Object.keys(e).length>0))return B`
649
+ `}render(){const e=this._getMergedData(),a=this.metafieldsSchema&&Object.keys(this.metafieldsSchema).length>0;if(!(Object.keys(e).length>0))return G`
629
650
  <div class="empty-state">
630
651
  <div class="empty-state__icon">đŸˇī¸</div>
631
652
  <div class="empty-state__title">No Metafields Found</div>
@@ -633,8 +654,8 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
633
654
  ${a?"No metafields are defined in your metafields.json schema.":"Paste your metafields.json content into the devtools bridge snippet to see all defined metafields."}
634
655
  </div>
635
656
  </div>
636
- `;const i=this._filterData(e),s=Object.keys(i);this.activeResource&&i[this.activeResource]||(this.activeResource=s[0]);const o=i[this.activeResource],r=o&&Object.keys(o.byNamespace).length>0;let n=0,l=0;for(const t of Object.values(e)){const e=this._getResourceStats(t);n+=e.total,l+=e.filled}return B`
637
- ${a?B`
657
+ `;const i=this._filterData(e),s=Object.keys(i);this.activeResource&&i[this.activeResource]||(this.activeResource=s[0]);const r=i[this.activeResource],o=r&&Object.keys(r.byNamespace).length>0;let n=0,l=0;for(const t of Object.values(e)){const e=this._getResourceStats(t);n+=e.total,l+=e.filled}return G`
658
+ ${a?G`
638
659
  <div class="schema-notice">
639
660
  <div class="schema-notice__title">📋 Schema Loaded</div>
640
661
  Showing all ${n} defined metafields. ${l} have values.
@@ -658,20 +679,20 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
658
679
  </div>
659
680
 
660
681
  <div class="resource-tabs">
661
- ${s.map(e=>{const a=this._getResourceStats(i[e]),s=0===a.total;return B`
682
+ ${s.map(e=>{const a=this._getResourceStats(i[e]),s=0===a.total;return G`
662
683
  <button
663
684
  class="resource-tab ${this.activeResource===e?"resource-tab--active":""} ${s?"resource-tab--empty":""}"
664
685
  @click=${()=>this.activeResource=e}
665
686
  >
666
687
  ${t.RESOURCE_ICONS[e]||"📋"} ${e}
667
688
  <span class="resource-tab__count">${a.total}</span>
668
- ${a.filled>0?B`<span class="resource-tab__filled">✓${a.filled}</span>`:""}
689
+ ${a.filled>0?G`<span class="resource-tab__filled">✓${a.filled}</span>`:""}
669
690
  </button>
670
691
  `})}
671
692
  </div>
672
693
 
673
- ${r?Object.entries(o.byNamespace).map(([t,e])=>this._renderNamespace(this.activeResource,t,e)):B`<div class="no-results">No metafields match "${this.searchQuery}"</div>`}
674
- `}};__publicField(ft,"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(ft,"styles",[dt,r`
694
+ ${o?Object.entries(r.byNamespace).map(([t,e])=>this._renderNamespace(this.activeResource,t,e)):G`<div class="no-results">No metafields match "${this.searchQuery}"</div>`}
695
+ `}};__publicField(ft,"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(ft,"styles",[dt,o`
675
696
  :host {
676
697
  display: block;
677
698
  padding: 8px 12px;
@@ -1045,7 +1066,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1045
1066
  margin-bottom: 4px;
1046
1067
  color: var(--tdt-accent);
1047
1068
  }
1048
- `]),__publicField(ft,"RESOURCE_ICONS",{shop:"đŸĒ",product:"đŸ“Ļ",variant:"đŸˇī¸",collection:"📂",customer:"👤",article:"📝",blog:"📰",page:"📄",order:"🧾",company:"đŸĸ",company_location:"📍",location:"📍",market:"🌍"});let _t=ft;customElements.define("tdt-metafields-panel",_t);class xt extends nt{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,...a]=t.trim().split("="),i=a.join("=");return{name:e.trim(),value:decodeURIComponent(i||""),rawValue:i}}).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 a=`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`;a+=`; expires=${e.toUTCString()}`,a+=`; path=${t.path}`,t.secure&&(a+="; secure"),a+=`; samesite=${t.sameSite}`,document.cookie=a,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`}_renderModal(){const t=this.newCookie||this.editingCookie;if(!t)return null;const e=!!this.editingCookie;return B`
1069
+ `]),__publicField(ft,"RESOURCE_ICONS",{shop:"đŸĒ",product:"đŸ“Ļ",variant:"đŸˇī¸",collection:"📂",customer:"👤",article:"📝",blog:"📰",page:"📄",order:"🧾",company:"đŸĸ",company_location:"📍",location:"📍",market:"🌍"});let _t=ft;customElements.define("tdt-metafields-panel",_t);class xt extends nt{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,...a]=t.trim().split("="),i=a.join("=");return{name:e.trim(),value:decodeURIComponent(i||""),rawValue:i}}).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 a=`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`;a+=`; expires=${e.toUTCString()}`,a+=`; path=${t.path}`,t.secure&&(a+="; secure"),a+=`; samesite=${t.sameSite}`,document.cookie=a,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`}_renderModal(){const t=this.newCookie||this.editingCookie;if(!t)return null;const e=!!this.editingCookie;return G`
1049
1070
  <div class="modal-overlay" @click=${this._closeModal}>
1050
1071
  <div class="modal" @click=${t=>t.stopPropagation()}>
1051
1072
  <div class="modal-title">${e?"Edit Cookie":"Add Cookie"}</div>
@@ -1117,7 +1138,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1117
1138
  </div>
1118
1139
  </div>
1119
1140
  </div>
1120
- `}render(){const t=this._getFilteredCookies();return this.cookies.reduce((t,e)=>t+e.name.length+e.value.length,0),B`
1141
+ `}render(){const t=this._getFilteredCookies();return this.cookies.reduce((t,e)=>t+e.name.length+e.value.length,0),G`
1121
1142
  <div class="stats">
1122
1143
  <div class="stat">
1123
1144
  <span class="stat-label">Total Cookies</span>
@@ -1146,9 +1167,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1146
1167
  </button>
1147
1168
  </div>
1148
1169
 
1149
- ${0===t.length?B`<div class="empty-state">No cookies found</div>`:B`
1170
+ ${0===t.length?G`<div class="empty-state">No cookies found</div>`:G`
1150
1171
  <div class="cookie-list">
1151
- ${t.map(t=>B`
1172
+ ${t.map(t=>G`
1152
1173
  <div class="cookie-item">
1153
1174
  <div class="cookie-header">
1154
1175
  <span class="cookie-name" @click=${()=>this._copyName(t)} title="Click to copy name">
@@ -1170,7 +1191,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1170
1191
  `}
1171
1192
 
1172
1193
  ${this._renderModal()}
1173
- `}}__publicField(xt,"properties",{cookies:{type:Array,state:!0},filter:{type:String,state:!0},editingCookie:{type:Object,state:!0},newCookie:{type:Object,state:!0}}),__publicField(xt,"styles",[dt,r`
1194
+ `}}__publicField(xt,"properties",{cookies:{type:Array,state:!0},filter:{type:String,state:!0},editingCookie:{type:Object,state:!0},newCookie:{type:Object,state:!0}}),__publicField(xt,"styles",[dt,o`
1174
1195
  :host {
1175
1196
  display: block;
1176
1197
  padding: 12px;
@@ -1427,7 +1448,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1427
1448
  font-weight: 600;
1428
1449
  color: var(--tdt-text);
1429
1450
  }
1430
- `]),customElements.define("tdt-cookies-panel",xt);class yt extends nt{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 a=0;a<t.length;a++){const i=t.key(a),s=t.getItem(i);let o=s,r=!1;try{o=JSON.parse(s),r="object"==typeof o&&null!==o}catch{r=!1}e.push({key:i,value:s,parsedValue:r?o:s,isJson:r,size:new Blob([s]).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 a=new Set(this.expandedItems);a.has(t)?a.delete(t):a.add(t),this.expandedItems=a}_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 B`
1451
+ `]),customElements.define("tdt-cookies-panel",xt);class yt extends nt{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 a=0;a<t.length;a++){const i=t.key(a),s=t.getItem(i);let r=s,o=!1;try{r=JSON.parse(s),o="object"==typeof r&&null!==r}catch{o=!1}e.push({key:i,value:s,parsedValue:o?r:s,isJson:o,size:new Blob([s]).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 a=new Set(this.expandedItems);a.has(t)?a.delete(t):a.add(t),this.expandedItems=a}_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 G`
1431
1452
  <div class="modal-overlay" @click=${this._closeModal}>
1432
1453
  <div class="modal" @click=${t=>t.stopPropagation()}>
1433
1454
  <div class="modal-title">${e?"Edit Item":"Add Item"}</div>
@@ -1460,12 +1481,12 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1460
1481
  </div>
1461
1482
  </div>
1462
1483
  </div>
1463
- `}_renderItemContent(t){return t.isJson?B`
1484
+ `}_renderItemContent(t){return t.isJson?G`
1464
1485
  <tdt-object-inspector
1465
1486
  .data=${t.parsedValue}
1466
1487
  .path=${`${this.activeStorage}Storage.${t.key}`}
1467
1488
  ></tdt-object-inspector>
1468
- `:B`<div class="item-value">${t.value}</div>`}render(){const t=this._getFilteredItems(),e=localStorage.length,a=sessionStorage.length;return B`
1489
+ `:G`<div class="item-value">${t.value}</div>`}render(){const t=this._getFilteredItems(),e=localStorage.length,a=sessionStorage.length;return G`
1469
1490
  <div class="storage-tabs">
1470
1491
  <button
1471
1492
  class="storage-tab ${"local"===this.activeStorage?"storage-tab--active":""}"
@@ -1509,16 +1530,16 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1509
1530
  <button class="btn-add" @click=${this._openAddModal}>
1510
1531
  + Add Item
1511
1532
  </button>
1512
- ${this.items.length>0?B`
1533
+ ${this.items.length>0?G`
1513
1534
  <button class="btn-clear" @click=${this._clearAll}>
1514
1535
  Clear All
1515
1536
  </button>
1516
1537
  `:""}
1517
1538
  </div>
1518
1539
 
1519
- ${0===t.length?B`<div class="empty-state">No items in ${"local"===this.activeStorage?"localStorage":"sessionStorage"}</div>`:B`
1540
+ ${0===t.length?G`<div class="empty-state">No items in ${"local"===this.activeStorage?"localStorage":"sessionStorage"}</div>`:G`
1520
1541
  <div class="storage-list">
1521
- ${t.map(t=>B`
1542
+ ${t.map(t=>G`
1522
1543
  <div class="storage-item">
1523
1544
  <div class="item-header" @click=${e=>this._toggleExpand(t.key,e)}>
1524
1545
  <span class="item-key">${t.key}</span>
@@ -1534,7 +1555,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1534
1555
  </div>
1535
1556
  </div>
1536
1557
  </div>
1537
- ${this.expandedItems.has(t.key)?B`
1558
+ ${this.expandedItems.has(t.key)?G`
1538
1559
  <div class="item-content">
1539
1560
  ${this._renderItemContent(t)}
1540
1561
  </div>
@@ -1545,7 +1566,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1545
1566
  `}
1546
1567
 
1547
1568
  ${this._renderModal()}
1548
- `}}__publicField(yt,"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(yt,"styles",[dt,r`
1569
+ `}}__publicField(yt,"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(yt,"styles",[dt,o`
1549
1570
  :host {
1550
1571
  display: block;
1551
1572
  padding: 12px;
@@ -1872,32 +1893,146 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1872
1893
  font-weight: 600;
1873
1894
  color: var(--tdt-text);
1874
1895
  }
1875
- `]),customElements.define("tdt-storage-panel",yt);const $t=class t extends nt{constructor(){super(),this.logs=[],this.liquidErrors=[],this.filter="",this.activeFilter="all",this.showThemeOnly=!0,this.expandedLogs=new Set,this.groupedErrors=new Map,this._originalConsole={}}connectedCallback(){super.connectedCallback(),this._interceptConsole(),this._scanForLiquidErrors(),this._captureGlobalErrors()}disconnectedCallback(){super.disconnectedCallback(),this._restoreConsole(),window.removeEventListener("error",this._handleGlobalError),window.removeEventListener("unhandledrejection",this._handleUnhandledRejection)}_interceptConsole(){const t=this;["log","info","warn","error","debug"].forEach(e=>{this._originalConsole[e]=console[e],console[e]=function(...a){t._addLog(e,a),t._originalConsole[e].apply(console,a)}})}_restoreConsole(){Object.keys(this._originalConsole).forEach(t=>{console[t]=this._originalConsole[t]})}_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,a={}){const i=e.map(t=>{if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}).join(" "),s=this._isThemeRelated(i,a.source),o={id:Date.now()+Math.random(),type:t,message:i,args:e,timestamp:new Date,isThemeRelated:s,stack:a.stack,source:a.source,hasObjects:e.some(t=>"object"==typeof t&&null!==t)},r=`${t}:${i.substring(0,100)}`,n=this.groupedErrors.get(r);!n||"error"!==t&&"warn"!==t?("error"!==t&&"warn"!==t||(this.groupedErrors.set(r,{...o,count:1}),this.groupedErrors=new Map(this.groupedErrors)),this.logs=[...this.logs,o]):(n.count++,n.lastTime=o.timestamp,this.groupedErrors=new Map(this.groupedErrors))}_isThemeRelated(e,a=""){const i=(e+" "+a).toLowerCase();return t.THEME_KEYWORDS.some(t=>i.includes(t))}_scanForLiquidErrors(){const t=[],e=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;e.nextNode();){const a=e.currentNode.textContent;(a.includes("Liquid error")||a.includes("Liquid syntax error"))&&t.push({type:"liquid",message:a.trim(),timestamp:new Date})}const a=document.body.innerHTML,i=/Liquid\s+(error|syntax error)[^<]*/gi;let s;for(;null!==(s=i.exec(a));)t.some(t=>t.message.includes(s[0]))||t.push({type:"liquid",message:s[0].trim(),timestamp:new Date});this._checkDeprecations(),this.liquidErrors=t}_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}_toggleThemeOnly(){this.showThemeOnly=!this.showThemeOnly}_clearLogs(){this.logs=[],this.groupedErrors=new Map}_toggleExpand(t){const e=new Set(this.expandedLogs);e.has(t)?e.delete(t):e.add(t),this.expandedLogs=e}_getFilteredLogs(){let t=this.logs;if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),"all"!==this.activeFilter&&(t="liquid"===this.activeFilter?t.filter(t=>t.message.toLowerCase().includes("liquid")||this.liquidErrors.some(e=>e.message===t.message)):t.filter(t=>t.type===this.activeFilter)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.message.toLowerCase().includes(e))}return t}_getCounts(){const t=this.showThemeOnly?this.logs.filter(t=>t.isThemeRelated):this.logs;return{all:t.length,error:t.filter(t=>"error"===t.type).length,warn:t.filter(t=>"warn"===t.type).length,info:t.filter(t=>"info"===t.type).length,log:t.filter(t=>"log"===t.type||"debug"===t.type).length,liquid:this.liquidErrors.length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_renderLogContent(t){if(t.hasObjects){const e=t.args.filter(t=>"object"==typeof t&&null!==t);return B`
1896
+ `]),customElements.define("tdt-storage-panel",yt);const wt=class t extends nt{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._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),a=this.groupedErrors.get(e);a?a.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)}_interceptConsole(){const t=this;["log","info","warn","error","debug"].forEach(e=>{this._originalConsole[e]=console[e],console[e]=function(...a){t._addLog(e,a),t._originalConsole[e].apply(console,a)}}),this._originalConsole.table=console.table,console.table=function(e,a){t._addLog("table",[e],{columns:a,isTable:!0}),t._originalConsole.table.apply(console,[e,a])},this._originalConsole.group=console.group,this._originalConsole.groupCollapsed=console.groupCollapsed,this._originalConsole.groupEnd=console.groupEnd,console.group=function(...e){const a=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",a,!1),t._originalConsole.group.apply(console,e)},console.groupCollapsed=function(...e){const a=Date.now()+Math.random();t._startGroup(e.join(" ")||"Group",a,!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,a){const i={id:e,type:"group",message:t,timestamp:new Date,isThemeRelated:this._isThemeRelated(t,""),collapsed:a,children:[],parentGroupId:this._currentGroupId};if(this._currentGroupId){const t=this._findGroupById(this._currentGroupId);t&&t.children.push(i)}else this.logs=[...this.logs,i];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 a of e){if(a.id===t)return a;if(a.children){const e=this._findGroupById(t,a.children);if(e)return e}}return null}_interceptNetwork(){const t=this;this._originalFetch=window.fetch,window.fetch=async function(e,a){const i="string"==typeof e?e:e.url,s=(null==a?void 0:a.method)||"GET",r=performance.now();try{const o=await t._originalFetch.apply(window,[e,a]),n=performance.now()-r;return o.ok||t._addNetworkError({url:i,method:s,status:o.status,statusText:o.statusText,duration:n,type:"fetch"}),o}catch(o){const e=performance.now()-r;throw t._addNetworkError({url:i,method:s,status:0,statusText:o.message||"Network Error",duration:e,type:"fetch",error:!0}),o}};const e=XMLHttpRequest.prototype.open,a=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,a){return this._tdtMethod=t,this._tdtUrl=a,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"})}),a.apply(this,arguments)},this._originalXHROpen=e,this._originalXHRSend=a}_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,a={}){const i=e.map(t=>{if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}).join(" "),s=this._isThemeRelated(i,a.source),r={id:Date.now()+Math.random(),type:t,message:i,args:e,timestamp:new Date,isThemeRelated:s,stack:a.stack,source:a.source,hasObjects:e.some(t=>"object"==typeof t&&null!==t),isTable:a.isTable||!1,tableColumns:a.columns,groupId:this._currentGroupId},o=this._getGroupKey(r),n=this.groupedErrors.get(o);if(!n||"error"!==t&&"warn"!==t)if("error"!==t&&"warn"!==t||(this.groupedErrors.set(o,{...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 n.count++,n.lastTime=r.timestamp,this.groupedErrors=new Map(this.groupedErrors);this._persistLogs()}_isThemeRelated(e,a=""){const i=(e+" "+a).toLowerCase();return t.THEME_KEYWORDS.some(t=>i.includes(t))}_scanForLiquidErrors(){const t=[],e=new Set,a=(a,i,s=null)=>{const r=a.trim();e.has(r)||(e.add(r),t.push({id:Date.now()+Math.random(),type:"liquid",category:i,message:r,timestamp:new Date,element:s?this._getElementPath(s):null}))},i=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null,!1);for(;i.nextNode();){const t=i.currentNode.textContent;(t.includes("Liquid error")||t.includes("Liquid syntax error"))&&a(t,"comment")}const s=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(s));)a(e[0],"inline")});const r=/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/gi;let o;for(;null!==(o=r.exec(s));){const t=o[1];a(`Raw ${t} Drop object rendered: ${o[0]} — Use .title, .url, or other property instead of outputting the object directly`,"drop")}const n=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;const a=t.parentElement;if(!a)return NodeFilter.FILTER_REJECT;const i=null==(e=a.tagName)?void 0:e.toLowerCase();return"script"===i||"style"===i||"noscript"===i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;n.nextNode();){const t=n.currentNode.textContent;if(/Liquid\s+(error|syntax error)/i.test(t)){const e=t.match(/Liquid\s+(?:error|syntax error)[^]*/i);e&&a(e[0],"text",n.currentNode.parentElement)}if(/#<\w+Drop:0x/i.test(t)){const e=t.match(/#<(?:Shopify::)?(?:Liquid::)?(\w+)Drop:0x[a-f0-9]+>/i);e&&a(`Raw ${e[1]} Drop object in page: ${e[0]}`,"drop",n.currentNode.parentElement)}/unknown\s+image\s+file/i.test(t)&&a(`Unknown image file error: ${t.substring(0,200)}`,"asset",n.currentNode.parentElement)}document.querySelectorAll("img").forEach(t=>{const e=t.src||t.dataset.src,i=t.alt;i&&/Liquid\s+error|Could\s+not\s+find\s+asset/i.test(i)&&a(`Image error: ${i}`,"asset",t),e&&/Liquid%20error|Could%20not%20find/i.test(e)&&a(`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)&&a("Liquid error: form 'product' needs a product object","form",t),/form\s+'customer_address'\s+requires\s+an\s+address/i.test(e)&&a("Liquid error: form 'customer_address' requires an address","form",t),/invalid\s+form\s+type/i.test(e)){const i=e.match(/invalid\s+form\s+type\s*['"]?(\w+)['"]?/i);a(`Liquid error: invalid form type '${(null==i?void 0:i[1])||"unknown"}'`,"form",t)}}),this._checkDeprecations(),this.liquidErrors=t}_getElementPath(t){var e;if(!t)return null;const a=[];let i=t;for(;i&&i!==document.body&&a.length<5;){let t=(null==(e=i.tagName)?void 0:e.toLowerCase())||"";if(i.id)t+=`#${i.id}`;else if(i.className&&"string"==typeof i.className){const e=i.className.split(" ").filter(t=>t&&!t.startsWith("js-")).slice(0,2);e.length&&(t+=`.${e.join(".")}`)}t&&a.unshift(t),i=i.parentElement}return a.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}_toggleThemeOnly(){this.showThemeOnly=!this.showThemeOnly}_clearLogs(){this.logs=[],this.networkErrors=[],this.groupedErrors=new Map,this.groupStack=[],this._currentGroupId=null,sessionStorage.removeItem(t.STORAGE_KEY)}_toggleExpand(t){const e=new Set(this.expandedLogs);e.has(t)?e.delete(t):e.add(t),this.expandedLogs=e}_getFilteredLogs(){let t=this.logs.filter(t=>!t.groupId);if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),"all"!==this.activeFilter)if("liquid"===this.activeFilter)t=t.filter(t=>t.message.toLowerCase().includes("liquid")||this.liquidErrors.some(e=>e.message===t.message));else{if("network"===this.activeFilter)return[];t="table"===this.activeFilter?t.filter(t=>t.isTable):"group"===this.activeFilter?t.filter(t=>"group"===t.type):t.filter(t=>t.type===this.activeFilter)}if(this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.message.toLowerCase().includes(e))}return t}_getFilteredNetworkErrors(){let t=this.networkErrors;if(this.showThemeOnly&&(t=t.filter(t=>t.isThemeRelated)),this.filter){const e=this.filter.toLowerCase();t=t.filter(t=>t.url.toLowerCase().includes(e)||t.statusText.toLowerCase().includes(e))}return t}_getCounts(){const t=this.showThemeOnly?this.logs.filter(t=>t.isThemeRelated):this.logs,e=this.showThemeOnly?this.networkErrors.filter(t=>t.isThemeRelated):this.networkErrors;return{all:t.length+e.length,error:t.filter(t=>"error"===t.type).length,warn:t.filter(t=>"warn"===t.type).length,info:t.filter(t=>"info"===t.type).length,log:t.filter(t=>"log"===t.type||"debug"===t.type).length,liquid:this.liquidErrors.length,network:e.length,table:t.filter(t=>t.isTable).length,group:t.filter(t=>"group"===t.type).length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_renderLogContent(t){if(t.isTable&&t.args&&t.args[0])return G`
1876
1897
  <div class="log-content">
1877
- ${e.map(t=>B`
1898
+ ${this._renderTable(t.args[0],t.tableColumns)}
1899
+ </div>
1900
+ `;if(t.hasObjects){const e=t.args.filter(t=>"object"==typeof t&&null!==t);return G`
1901
+ <div class="log-content">
1902
+ ${e.map(t=>G`
1878
1903
  <tdt-object-inspector .data=${t} .path=${"console"}></tdt-object-inspector>
1879
1904
  `)}
1880
- ${t.stack?B`<pre class="log-stack">${t.stack}</pre>`:""}
1881
- ${t.source?B`<div class="log-source">Source: <a href="#">${t.source}</a></div>`:""}
1905
+ ${t.stack?G`<pre class="log-stack">${t.stack}</pre>`:""}
1906
+ ${t.source?G`<div class="log-source">Source: <a href="#">${t.source}</a></div>`:""}
1882
1907
  </div>
1883
- `}return t.stack||t.source?B`
1908
+ `}return t.stack||t.source?G`
1884
1909
  <div class="log-content">
1885
- ${t.stack?B`<pre class="log-stack">${t.stack}</pre>`:""}
1886
- ${t.source?B`<div class="log-source">Source: ${t.source}</div>`:""}
1910
+ ${t.stack?G`<pre class="log-stack">${t.stack}</pre>`:""}
1911
+ ${t.source?G`<div class="log-source">Source: ${t.source}</div>`:""}
1887
1912
  </div>
1888
- `:null}_renderLiquidErrors(){return 0===this.liquidErrors.length?null:B`
1913
+ `:null}_renderTable(t,e){if(!t)return null;let a=Array.isArray(t)?t:Object.entries(t).map(([t,e])=>({"(index)":t,...e}));if(0===a.length)return G`<span class="preview">Empty table</span>`;let i=new Set;a.forEach(t=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(t=>i.add(t))});let s=e?e.filter(t=>i.has(t)):Array.from(i);return s.includes("(index)")||(s=["(index)",...s]),G`
1914
+ <table class="log-table">
1915
+ <thead>
1916
+ <tr>
1917
+ ${s.map(t=>G`<th>${t}</th>`)}
1918
+ </tr>
1919
+ </thead>
1920
+ <tbody>
1921
+ ${a.map((t,e)=>G`
1922
+ <tr>
1923
+ ${s.map(a=>{if("(index)"===a)return G`<td>${t["(index)"]??e}</td>`;const i=t&&"object"==typeof t?t[a]:t;return G`<td>${this._formatTableValue(i)}</td>`})}
1924
+ </tr>
1925
+ `)}
1926
+ </tbody>
1927
+ </table>
1928
+ `}_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?G`
1929
+ <div class="log-group-children">
1930
+ ${t.map(t=>this._renderLogItem(t))}
1931
+ </div>
1932
+ `:null}_renderNetworkErrors(){const t=this._getFilteredNetworkErrors();return 0===t.length?null:G`
1889
1933
  <div class="liquid-section">
1890
- <div class="section-title">Liquid Errors Found on Page</div>
1891
- ${this.liquidErrors.map(t=>B`
1892
- <div class="log-item log-item--liquid">
1893
- <div class="log-header">
1894
- <span class="log-type log-type--liquid">LIQUID</span>
1895
- <span class="log-message">${t.message}</span>
1934
+ <div class="section-title">Network Errors</div>
1935
+ ${t.slice().reverse().map(t=>{const e=this.expandedLogs.has(t.id);return G`
1936
+ <div class="log-item log-item--network">
1937
+ <div class="log-header" @click=${()=>this._toggleExpand(t.id)}>
1938
+ <span class="log-type log-type--network">${t.type.toUpperCase()}</span>
1939
+ <span class="status-badge status-badge--error">${t.status||"ERR"}</span>
1940
+ <span class="log-message">${t.method} ${t.url}</span>
1941
+ <span class="log-time">${Math.round(t.duration)}ms</span>
1942
+ </div>
1943
+ ${e?G`
1944
+ <div class="log-content">
1945
+ <dl class="network-details">
1946
+ <dt>URL</dt>
1947
+ <dd>${t.url}</dd>
1948
+ <dt>Method</dt>
1949
+ <dd>${t.method}</dd>
1950
+ <dt>Status</dt>
1951
+ <dd>${t.status} ${t.statusText}</dd>
1952
+ <dt>Duration</dt>
1953
+ <dd>${t.duration.toFixed(2)}ms</dd>
1954
+ <dt>Type</dt>
1955
+ <dd>${t.type}</dd>
1956
+ </dl>
1957
+ </div>
1958
+ `:""}
1896
1959
  </div>
1960
+ `})}
1961
+ </div>
1962
+ `}_renderLogItem(t){var e;const a=this._getGroupKey(t),i=this.groupedErrors.get(a),s=(null==i?void 0:i.count)||1,r=this.expandedLogs.has(t.id),o=t.hasObjects||t.stack||t.source||t.isTable||"group"===t.type;return"group"===t.type?G`
1963
+ <div class="log-item log-item--group">
1964
+ <div class="log-header" @click=${()=>this._toggleExpand(t.id)}>
1965
+ <span class="log-type log-type--group">GROUP</span>
1966
+ <span class="log-message">${t.message}</span>
1967
+ ${(null==(e=t.children)?void 0:e.length)?G`<span class="log-count">${t.children.length} items</span>`:""}
1968
+ <span class="log-time">${this._formatTime(t.timestamp)}</span>
1897
1969
  </div>
1898
- `)}
1970
+ ${r||!t.collapsed?this._renderGroupChildren(t.children):""}
1971
+ </div>
1972
+ `:G`
1973
+ <div class="log-item log-item--${t.type}${t.isTable?" log-item--table":""}">
1974
+ <div class="log-header" @click=${()=>o&&this._toggleExpand(t.id)}>
1975
+ <span class="log-type log-type--${t.isTable?"info":t.type}">${t.isTable?"TABLE":t.type}</span>
1976
+ <span class="log-message">${t.message}</span>
1977
+ ${s>1?G`<span class="log-count">${s}</span>`:""}
1978
+ ${t.persisted?G`<span class="persist-indicator">from previous page</span>`:""}
1979
+ <span class="log-time">${this._formatTime(t.timestamp)}</span>
1980
+ </div>
1981
+ ${r?this._renderLogContent(t):""}
1982
+ </div>
1983
+ `}_renderLiquidErrors(){if(0===this.liquidErrors.length)return null;return G`
1984
+ <div class="liquid-section">
1985
+ <div class="section-title">Liquid Errors Found on Page (${this.liquidErrors.length})</div>
1986
+ ${this.liquidErrors.map(t=>{const e=this.expandedLogs.has(t.id),a=t.element||"drop"===t.category;return G`
1987
+ <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)}">
1988
+ <div class="log-header" @click=${()=>a&&this._toggleExpand(t.id)}>
1989
+ <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>
1990
+ <span class="log-message">${t.message}</span>
1991
+ ${t.category&&"inline"!==t.category?G`
1992
+ <span class="liquid-category">${t.category}</span>
1993
+ `:""}
1994
+ <span class="log-time">${this._formatTime(t.timestamp)}</span>
1995
+ </div>
1996
+ ${e?G`
1997
+ <div class="log-content">
1998
+ ${t.element?G`
1999
+ <div class="element-path">Found in: ${t.element}</div>
2000
+ `:""}
2001
+ ${(t=>{var e;if("drop"===t.category){const a=t.message.match(/Raw\s+(\w+)\s+Drop/i),i=(null==(e=null==a?void 0:a[1])?void 0:e.toLowerCase())||"object";return G`
2002
+ <div class="liquid-hint">
2003
+ Instead of <code>{{ ${i} }}</code>, use a specific property like
2004
+ <code>{{ ${i}.title }}</code>, <code>{{ ${i}.url }}</code>, or
2005
+ <code>{{ ${i}.handle }}</code>
2006
+ </div>
2007
+ `}if(t.message.includes("Could not find snippet")){const e=t.message.match(/Could not find snippet '([^']+)'/i),a=(null==e?void 0:e[1])||"snippet-name";return G`
2008
+ <div class="liquid-hint">
2009
+ Create the missing snippet file: <code>snippets/${a}.liquid</code>
2010
+ </div>
2011
+ `}if(t.message.includes("Could not find asset")){const e=t.message.match(/Could not find asset '([^']+)'/i),a=(null==e?void 0:e[1])||"asset-name";return G`
2012
+ <div class="liquid-hint">
2013
+ Upload the missing asset to: <code>assets/${a}</code>
2014
+ </div>
2015
+ `}if(t.message.includes("Unknown filter")){const e=t.message.match(/Unknown filter '([^']+)'/i),a=(null==e?void 0:e[1])||"filter";return G`
2016
+ <div class="liquid-hint">
2017
+ The filter <code>${a}</code> doesn't exist in Shopify Liquid. Check the
2018
+ <a href="https://shopify.dev/docs/api/liquid/filters" target="_blank" style="color: var(--tdt-accent)">Liquid filters reference</a>.
2019
+ </div>
2020
+ `}if(t.message.includes("Unknown tag")){const e=t.message.match(/Unknown tag '([^']+)'/i),a=(null==e?void 0:e[1])||"tag";return G`
2021
+ <div class="liquid-hint">
2022
+ The tag <code>${a}</code> doesn't exist in Shopify Liquid. Check the
2023
+ <a href="https://shopify.dev/docs/api/liquid/tags" target="_blank" style="color: var(--tdt-accent)">Liquid tags reference</a>.
2024
+ </div>
2025
+ `}return t.message.includes("divided by 0")?G`
2026
+ <div class="liquid-hint">
2027
+ Add a check before dividing: <code>{% if divisor != 0 %}{{ value | divided_by: divisor }}{% endif %}</code>
2028
+ </div>
2029
+ `:null})(t)}
2030
+ </div>
2031
+ `:""}
2032
+ </div>
2033
+ `})}
1899
2034
  </div>
1900
- `}render(){const t=this._getFilteredLogs(),e=this._getCounts();return B`
2035
+ `}render(){const t=this._getFilteredLogs(),e=this._getCounts();return G`
1901
2036
  <div class="toolbar">
1902
2037
  <input
1903
2038
  type="search"
@@ -1949,39 +2084,39 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
1949
2084
  >
1950
2085
  📝 Logs <span class="filter-tab__count">${e.log}</span>
1951
2086
  </button>
1952
- ${e.liquid>0?B`
1953
- <button
2087
+ ${e.liquid>0?G`
2088
+ <button
1954
2089
  class="filter-tab ${"liquid"===this.activeFilter?"filter-tab--active":""}"
1955
2090
  @click=${()=>this._setFilter("liquid")}
1956
2091
  >
1957
2092
  💧 Liquid <span class="filter-tab__count">${e.liquid}</span>
1958
2093
  </button>
1959
2094
  `:""}
2095
+ ${e.network>0?G`
2096
+ <button
2097
+ class="filter-tab filter-tab--error ${"network"===this.activeFilter?"filter-tab--active":""}"
2098
+ @click=${()=>this._setFilter("network")}
2099
+ >
2100
+ 🌐 Network <span class="filter-tab__count">${e.network}</span>
2101
+ </button>
2102
+ `:""}
1960
2103
  </div>
1961
2104
 
1962
2105
  ${"all"===this.activeFilter||"liquid"===this.activeFilter?this._renderLiquidErrors():""}
1963
2106
 
1964
- ${0===t.length?B`
2107
+ ${"all"===this.activeFilter||"network"===this.activeFilter?this._renderNetworkErrors():""}
2108
+
2109
+ ${"network"===this.activeFilter?"":0===t.length?G`
1965
2110
  <div class="empty-state">
1966
2111
  <div class="empty-state__icon">📋</div>
1967
2112
  <div>No ${this.showThemeOnly?"theme-related ":""}logs captured yet</div>
1968
2113
  </div>
1969
- `:B`
2114
+ `:G`
1970
2115
  <div class="log-list">
1971
- ${t.slice().reverse().map(t=>{const e=`${t.type}:${t.message.substring(0,100)}`,a=this.groupedErrors.get(e),i=(null==a?void 0:a.count)||1,s=this.expandedLogs.has(t.id),o=t.hasObjects||t.stack||t.source;return B`
1972
- <div class="log-item log-item--${t.type}">
1973
- <div class="log-header" @click=${()=>o&&this._toggleExpand(t.id)}>
1974
- <span class="log-type log-type--${t.type}">${t.type}</span>
1975
- <span class="log-message">${t.message}</span>
1976
- ${i>1?B`<span class="log-count">${i}</span>`:""}
1977
- <span class="log-time">${this._formatTime(t.timestamp)}</span>
1978
- </div>
1979
- ${s?this._renderLogContent(t):""}
1980
- </div>
1981
- `})}
2116
+ ${t.slice().reverse().map(t=>this._renderLogItem(t))}
1982
2117
  </div>
1983
2118
  `}
1984
- `}};__publicField($t,"properties",{logs:{type:Array,state:!0},liquidErrors:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},showThemeOnly:{type:Boolean,state:!0},expandedLogs:{type:Set,state:!0},groupedErrors:{type:Map,state:!0}}),__publicField($t,"styles",[dt,r`
2119
+ `}};__publicField(wt,"properties",{logs:{type:Array,state:!0},liquidErrors:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},showThemeOnly:{type:Boolean,state:!0},expandedLogs:{type:Set,state:!0},groupedErrors:{type:Map,state:!0},networkErrors:{type:Array,state:!0},groupStack:{type:Array,state:!0}}),__publicField(wt,"STORAGE_KEY","tdt-console-logs"),__publicField(wt,"styles",[dt,o`
1985
2120
  :host {
1986
2121
  display: block;
1987
2122
  padding: 12px;
@@ -2309,43 +2444,217 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2309
2444
  border-radius: var(--tdt-radius);
2310
2445
  color: var(--tdt-success);
2311
2446
  }
2312
- `]),__publicField($t,"THEME_KEYWORDS",["shopify","theme","liquid","cart","product","collection","variant","checkout","customer","section","block","snippet","asset","cdn.shopify","myshopify","storefront"]),__publicField($t,"LIQUID_DEPRECATIONS",[{pattern:/\{\%\s*include\s+/i,tag:"{% include %}",message:"The include tag is deprecated",replacement:"{% render %}"},{pattern:/\|\s*date_to_xmlschema/i,tag:"| date_to_xmlschema",message:"date_to_xmlschema is deprecated",replacement:'| date: "%Y-%m-%dT%H:%M:%S%z"'},{pattern:/\|\s*json_string/i,tag:"| json_string",message:"json_string is deprecated",replacement:"| json"},{pattern:/\.all\.size/i,tag:".all.size",message:"Using .all.size is deprecated",replacement:"Use .size directly or specific count properties"},{pattern:/product\.collections\[0\]/i,tag:"product.collections[0]",message:"Accessing collections by index is unreliable",replacement:"Use collection object directly"}]);let wt=$t;customElements.define("tdt-console-panel",wt);const kt=class t extends nt{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,a,i,s;t.has("meta")&&this.meta&&(this._selectedLocale=null==(a=null==(e=this.meta.request)?void 0:e.locale)?void 0:a.iso_code,this._selectedCountry=null==(s=null==(i=this.meta.localization)?void 0:i.country)?void 0:s.iso_code)}_loadAvailableLocales(){var t,e,a;const i=document.querySelector("[data-locale-selector]")||document.querySelector('form[action*="/localization"]');if(i){const t=i.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 s=document.querySelector("[data-country-selector]")||document.querySelector('select[name="country_code"]');if(s){const t=s.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 i=null==(a=null==(e=null==(t=window.__THEME_DEVTOOLS_CONTEXT__)?void 0:t.objects)?void 0:e.shop)?void 0:a.enabled_locales;i&&(this.availableLocales=i.map(t=>({code:t,name:new Intl.DisplayNames(["en"],{type:"language"}).of(t)||t})))}}_scanTranslations(){var t;const e=[],a=[],i=document.body.innerHTML,s=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(i));)s.has(e[1])||s.add(e[1])});const o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1);for(;o.nextNode();){const e=o.currentNode.textContent.trim();if(e.startsWith("translation missing:")||e.includes("Translation missing")||e.match(/^[a-z_]+\.[a-z_]+(\.[a-z_]+)*$/i)){const i=e.match(/translation missing:\s*([^\s]+)/i)||e.match(/^([a-z_]+\.[a-z_]+(?:\.[a-z_]+)*)$/i);i&&a.push({key:i[1],context:(null==(t=o.currentNode.parentElement)?void 0:t.tagName)||"unknown",element:o.currentNode.parentElement})}}document.querySelectorAll("[data-t], [data-translate]").forEach(t=>{var i;const s=t.dataset.t||t.dataset.translate,o=null==(i=t.textContent)?void 0:i.trim();s&&(e.push({key:s,value:o||"(empty)",element:t.tagName,isMissing:!o||o.includes("translation missing")}),o&&!o.includes("translation missing")||a.push({key:s,context:t.tagName,element:t}))}),s.forEach(t=>{e.some(e=>e.key===t)||e.push({key:t,value:"(rendered)",element:"Liquid",isMissing:!1})}),this.translations=e,this.missingTranslations=a}_getFlag(e,a="country"){if("language"===a){const a=e.split("-")[0].toLowerCase();return t.LANGUAGE_FLAGS[a]||"🌐"}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,a,i,s;const o=new URL(window.location.href),r=o.pathname.split("/").filter(Boolean);null==(e=null==(t=this.meta.request)?void 0:t.locale)||e.iso_code;const n=this._selectedLocale;this._selectedCountry,(null==(a=r[0])?void 0:a.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&r.shift();let l="";return n&&n!==(null==(s=null==(i=this.meta.request)?void 0:i.locale)?void 0:s.primary_locale)&&(l=`/${n}`),l+="/"+r.join("/"),o.pathname=l||"/",o.toString()}_goToLocale(){const t=this._buildLocaleUrl();window.location.href=t}_copyLocaleUrl(){const t=this._buildLocaleUrl();navigator.clipboard.writeText(t)}_renderMarketInfo(){var t,e,a,i,s,o,r,n,l,d,c,p,u,h;const{localization:v,request:g}=this.meta;return B`
2447
+
2448
+ .log-item--network {
2449
+ border-left: 3px solid #ef4444;
2450
+ background: rgba(239, 68, 68, 0.05);
2451
+ }
2452
+
2453
+ .log-type--network {
2454
+ background: #ef4444;
2455
+ color: white;
2456
+ }
2457
+
2458
+ .log-item--group {
2459
+ border-left: 3px solid #6366f1;
2460
+ background: rgba(99, 102, 241, 0.05);
2461
+ }
2462
+
2463
+ .log-type--group {
2464
+ background: #6366f1;
2465
+ color: white;
2466
+ }
2467
+
2468
+ .log-group-children {
2469
+ margin-left: 16px;
2470
+ padding-left: 12px;
2471
+ border-left: 2px solid var(--tdt-border);
2472
+ }
2473
+
2474
+ .log-table {
2475
+ width: 100%;
2476
+ border-collapse: collapse;
2477
+ font-size: 11px;
2478
+ margin-top: 8px;
2479
+ }
2480
+
2481
+ .log-table th,
2482
+ .log-table td {
2483
+ border: 1px solid var(--tdt-border);
2484
+ padding: 4px 8px;
2485
+ text-align: left;
2486
+ }
2487
+
2488
+ .log-table th {
2489
+ background: var(--tdt-bg-secondary);
2490
+ color: var(--tdt-text-muted);
2491
+ font-weight: 600;
2492
+ }
2493
+
2494
+ .log-table td {
2495
+ color: var(--tdt-text);
2496
+ }
2497
+
2498
+ .log-table tr:nth-child(even) td {
2499
+ background: rgba(255, 255, 255, 0.02);
2500
+ }
2501
+
2502
+ .network-details {
2503
+ display: grid;
2504
+ grid-template-columns: auto 1fr;
2505
+ gap: 4px 12px;
2506
+ font-size: 11px;
2507
+ margin-top: 8px;
2508
+ }
2509
+
2510
+ .network-details dt {
2511
+ color: var(--tdt-text-muted);
2512
+ }
2513
+
2514
+ .network-details dd {
2515
+ color: var(--tdt-text);
2516
+ margin: 0;
2517
+ word-break: break-all;
2518
+ }
2519
+
2520
+ .status-badge {
2521
+ display: inline-block;
2522
+ padding: 2px 6px;
2523
+ border-radius: var(--tdt-radius);
2524
+ font-size: 10px;
2525
+ font-weight: 600;
2526
+ }
2527
+
2528
+ .status-badge--error {
2529
+ background: var(--tdt-error);
2530
+ color: white;
2531
+ }
2532
+
2533
+ .status-badge--success {
2534
+ background: var(--tdt-success);
2535
+ color: white;
2536
+ }
2537
+
2538
+ .persist-indicator {
2539
+ font-size: 10px;
2540
+ color: var(--tdt-text-muted);
2541
+ margin-left: auto;
2542
+ display: flex;
2543
+ align-items: center;
2544
+ gap: 4px;
2545
+ }
2546
+
2547
+ .persist-indicator::before {
2548
+ content: '';
2549
+ width: 6px;
2550
+ height: 6px;
2551
+ background: var(--tdt-success);
2552
+ border-radius: 50%;
2553
+ }
2554
+
2555
+ .log-item--drop {
2556
+ border-left: 3px solid #f97316;
2557
+ background: rgba(249, 115, 22, 0.05);
2558
+ }
2559
+
2560
+ .log-type--drop {
2561
+ background: #f97316;
2562
+ color: white;
2563
+ }
2564
+
2565
+ .log-item--asset {
2566
+ border-left: 3px solid #eab308;
2567
+ background: rgba(234, 179, 8, 0.05);
2568
+ }
2569
+
2570
+ .log-type--asset {
2571
+ background: #eab308;
2572
+ color: #000;
2573
+ }
2574
+
2575
+ .log-item--schema {
2576
+ border-left: 3px solid #ec4899;
2577
+ background: rgba(236, 72, 153, 0.05);
2578
+ }
2579
+
2580
+ .log-type--schema {
2581
+ background: #ec4899;
2582
+ color: white;
2583
+ }
2584
+
2585
+ .liquid-category {
2586
+ font-size: 9px;
2587
+ padding: 1px 4px;
2588
+ border-radius: 3px;
2589
+ background: var(--tdt-bg);
2590
+ color: var(--tdt-text-muted);
2591
+ text-transform: uppercase;
2592
+ margin-left: 6px;
2593
+ }
2594
+
2595
+ .element-path {
2596
+ font-size: 10px;
2597
+ color: var(--tdt-text-muted);
2598
+ font-family: var(--tdt-font-mono);
2599
+ margin-top: 4px;
2600
+ padding: 4px 8px;
2601
+ background: var(--tdt-bg);
2602
+ border-radius: var(--tdt-radius);
2603
+ }
2604
+
2605
+ .liquid-hint {
2606
+ font-size: 11px;
2607
+ color: var(--tdt-text-muted);
2608
+ margin-top: 6px;
2609
+ padding: 6px 8px;
2610
+ background: rgba(99, 102, 241, 0.1);
2611
+ border-radius: var(--tdt-radius);
2612
+ border-left: 2px solid #6366f1;
2613
+ }
2614
+
2615
+ .liquid-hint code {
2616
+ background: var(--tdt-bg-secondary);
2617
+ padding: 1px 4px;
2618
+ border-radius: 2px;
2619
+ color: var(--tdt-success);
2620
+ }
2621
+ `]),__publicField(wt,"THEME_KEYWORDS",["shopify","theme","liquid","cart","product","collection","variant","checkout","customer","section","block","snippet","asset","cdn.shopify","myshopify","storefront"]),__publicField(wt,"LIQUID_DEPRECATIONS",[{pattern:/\{\%\s*include\s+/i,tag:"{% include %}",message:"The include tag is deprecated",replacement:"{% render %}"},{pattern:/\|\s*date_to_xmlschema/i,tag:"| date_to_xmlschema",message:"date_to_xmlschema is deprecated",replacement:'| date: "%Y-%m-%dT%H:%M:%S%z"'},{pattern:/\|\s*json_string/i,tag:"| json_string",message:"json_string is deprecated",replacement:"| json"},{pattern:/\.all\.size/i,tag:".all.size",message:"Using .all.size is deprecated",replacement:"Use .size directly or specific count properties"},{pattern:/product\.collections\[0\]/i,tag:"product.collections[0]",message:"Accessing collections by index is unreliable",replacement:"Use collection object directly"}]);let $t=wt;customElements.define("tdt-console-panel",$t);const kt=class t extends nt{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,a,i,s;t.has("meta")&&this.meta&&(this._selectedLocale=null==(a=null==(e=this.meta.request)?void 0:e.locale)?void 0:a.iso_code,this._selectedCountry=null==(s=null==(i=this.meta.localization)?void 0:i.country)?void 0:s.iso_code)}_loadAvailableLocales(){var t,e,a;const i=document.querySelector("[data-locale-selector]")||document.querySelector('form[action*="/localization"]');if(i){const t=i.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 s=document.querySelector("[data-country-selector]")||document.querySelector('select[name="country_code"]');if(s){const t=s.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 i=null==(a=null==(e=null==(t=window.__THEME_DEVTOOLS_CONTEXT__)?void 0:t.objects)?void 0:e.shop)?void 0:a.enabled_locales;i&&(this.availableLocales=i.map(t=>({code:t,name:new Intl.DisplayNames(["en"],{type:"language"}).of(t)||t})))}}_scanTranslations(){var t;const e=[],a=[],i=document.body.innerHTML,s=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(i));)s.has(e[1])||s.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 i=e.match(/translation missing:\s*([^\s]+)/i)||e.match(/^([a-z_]+\.[a-z_]+(?:\.[a-z_]+)*)$/i);i&&a.push({key:i[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 i;const s=t.dataset.t||t.dataset.translate,r=null==(i=t.textContent)?void 0:i.trim();s&&(e.push({key:s,value:r||"(empty)",element:t.tagName,isMissing:!r||r.includes("translation missing")}),r&&!r.includes("translation missing")||a.push({key:s,context:t.tagName,element:t}))}),s.forEach(t=>{e.some(e=>e.key===t)||e.push({key:t,value:"(rendered)",element:"Liquid",isMissing:!1})}),this.translations=e,this.missingTranslations=a}_getFlag(e,a="country"){if("language"===a){const a=e.split("-")[0].toLowerCase();return t.LANGUAGE_FLAGS[a]||"🌐"}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,a,i,s;const r=new URL(window.location.href),o=r.pathname.split("/").filter(Boolean);null==(e=null==(t=this.meta.request)?void 0:t.locale)||e.iso_code;const n=this._selectedLocale;this._selectedCountry,(null==(a=o[0])?void 0:a.match(/^[a-z]{2}(-[a-z]{2})?$/i))&&o.shift();let l="";return n&&n!==(null==(s=null==(i=this.meta.request)?void 0:i.locale)?void 0:s.primary_locale)&&(l=`/${n}`),l+="/"+o.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,a,i,s,r,o,n,l,d,c,p,u,h;const{localization:g,request:v}=this.meta;return G`
2313
2622
  <div class="market-info">
2314
2623
  <div class="info-card">
2315
- <div class="info-card__icon">${this._getFlag(null==(t=null==v?void 0:v.country)?void 0:t.iso_code)}</div>
2624
+ <div class="info-card__icon">${this._getFlag(null==(t=null==g?void 0:g.country)?void 0:t.iso_code)}</div>
2316
2625
  <div class="info-card__label">Country</div>
2317
- <div class="info-card__value">${(null==(e=null==v?void 0:v.country)?void 0:e.name)||"—"}</div>
2318
- <div class="info-card__subvalue">${(null==(a=null==v?void 0:v.country)?void 0:a.iso_code)||""}</div>
2626
+ <div class="info-card__value">${(null==(e=null==g?void 0:g.country)?void 0:e.name)||"—"}</div>
2627
+ <div class="info-card__subvalue">${(null==(a=null==g?void 0:g.country)?void 0:a.iso_code)||""}</div>
2319
2628
  </div>
2320
2629
 
2321
2630
  <div class="info-card">
2322
- <div class="info-card__icon">${this._getFlag(null==(i=null==g?void 0:g.locale)?void 0:i.iso_code,"language")}</div>
2631
+ <div class="info-card__icon">${this._getFlag(null==(i=null==v?void 0:v.locale)?void 0:i.iso_code,"language")}</div>
2323
2632
  <div class="info-card__label">Language</div>
2324
- <div class="info-card__value">${(null==(s=null==g?void 0:g.locale)?void 0:s.name)||(null==(o=null==v?void 0:v.language)?void 0:o.name)||"—"}</div>
2325
- <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>
2633
+ <div class="info-card__value">${(null==(s=null==v?void 0:v.locale)?void 0:s.name)||(null==(r=null==g?void 0:g.language)?void 0:r.name)||"—"}</div>
2634
+ <div class="info-card__subvalue">${(null==(o=null==v?void 0:v.locale)?void 0:o.iso_code)||""} ${(null==(n=null==v?void 0:v.locale)?void 0:n.primary)?"(Primary)":""}</div>
2326
2635
  </div>
2327
2636
 
2328
2637
  <div class="info-card">
2329
2638
  <div class="info-card__icon">💰</div>
2330
2639
  <div class="info-card__label">Currency</div>
2331
- <div class="info-card__value">${(null==(d=null==(l=null==v?void 0:v.country)?void 0:l.currency)?void 0:d.iso_code)||"—"}</div>
2332
- <div class="info-card__subvalue">${(null==(p=null==(c=null==v?void 0:v.country)?void 0:c.currency)?void 0:p.symbol)||""}</div>
2640
+ <div class="info-card__value">${(null==(d=null==(l=null==g?void 0:g.country)?void 0:l.currency)?void 0:d.iso_code)||"—"}</div>
2641
+ <div class="info-card__subvalue">${(null==(p=null==(c=null==g?void 0:g.country)?void 0:c.currency)?void 0:p.symbol)||""}</div>
2333
2642
  </div>
2334
2643
 
2335
2644
  <div class="info-card">
2336
2645
  <div class="info-card__icon">đŸĒ</div>
2337
2646
  <div class="info-card__label">Market</div>
2338
- <div class="info-card__value">${(null==(u=null==v?void 0:v.market)?void 0:u.handle)||"—"}</div>
2339
- <div class="info-card__subvalue">ID: ${(null==(h=null==v?void 0:v.market)?void 0:h.id)||"—"}</div>
2647
+ <div class="info-card__value">${(null==(u=null==g?void 0:g.market)?void 0:u.handle)||"—"}</div>
2648
+ <div class="info-card__subvalue">ID: ${(null==(h=null==g?void 0:g.market)?void 0:h.id)||"—"}</div>
2340
2649
  </div>
2341
2650
  </div>
2342
- `}_renderLocaleSwitcher(){var t,e,a,i;const s=null==(e=null==(t=this.meta.request)?void 0:t.locale)?void 0:e.iso_code;return null==(i=null==(a=this.meta.localization)?void 0:a.country)||i.iso_code,B`
2651
+ `}_renderLocaleSwitcher(){var t,e,a,i;const s=null==(e=null==(t=this.meta.request)?void 0:t.locale)?void 0:e.iso_code;return null==(i=null==(a=this.meta.localization)?void 0:a.country)||i.iso_code,G`
2343
2652
  <div class="section">
2344
2653
  <div class="section-title">Quick Locale Switch</div>
2345
2654
 
2346
- ${this.availableLocales.length>0?B`
2655
+ ${this.availableLocales.length>0?G`
2347
2656
  <div class="locale-switcher">
2348
- ${this.availableLocales.map(t=>B`
2657
+ ${this.availableLocales.map(t=>G`
2349
2658
  <button
2350
2659
  class="locale-btn ${this._selectedLocale===t.code?"locale-btn--active":""}"
2351
2660
  @click=${()=>this._selectLocale(t.code)}
@@ -2355,9 +2664,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2355
2664
  </button>
2356
2665
  `)}
2357
2666
  </div>
2358
- `:B`
2667
+ `:G`
2359
2668
  <div class="locale-switcher">
2360
- ${["en","es","fr","de","ja","zh"].map(t=>B`
2669
+ ${["en","es","fr","de","ja","zh"].map(t=>G`
2361
2670
  <button
2362
2671
  class="locale-btn ${this._selectedLocale===t?"locale-btn--active":""}"
2363
2672
  @click=${()=>this._selectLocale(t)}
@@ -2369,7 +2678,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2369
2678
  </div>
2370
2679
  `}
2371
2680
 
2372
- ${this._selectedLocale&&this._selectedLocale!==s?B`
2681
+ ${this._selectedLocale&&this._selectedLocale!==s?G`
2373
2682
  <div class="url-helper">
2374
2683
  <div class="url-helper__label">Preview URL for ${this._selectedLocale.toUpperCase()}</div>
2375
2684
  <div class="url-helper__url">
@@ -2382,7 +2691,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2382
2691
  </div>
2383
2692
  `:""}
2384
2693
  </div>
2385
- `}_renderTranslations(){const t=this._getFilteredTranslations();return B`
2694
+ `}_renderTranslations(){const t=this._getFilteredTranslations();return G`
2386
2695
  <div class="stats-row">
2387
2696
  <div class="stat">
2388
2697
  <span class="stat-label">Total Keys</span>
@@ -2419,14 +2728,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2419
2728
  @input=${this._filterTranslations}
2420
2729
  >
2421
2730
 
2422
- ${0===t.length?B`
2731
+ ${0===t.length?G`
2423
2732
  <div class="empty-state">
2424
2733
  <div class="empty-state__icon">🌐</div>
2425
2734
  <div>No ${"missing"===this.activeTab?"missing ":""}translations found</div>
2426
2735
  </div>
2427
- `:B`
2736
+ `:G`
2428
2737
  <div class="translation-list">
2429
- ${t.map(t=>B`
2738
+ ${t.map(t=>G`
2430
2739
  <div class="translation-item ${t.isMissing?"translation-item--missing":""}">
2431
2740
  <div class="translation-key" @click=${()=>this._copyKey(t.key)}>
2432
2741
  <span class="translation-key__path">${t.key}</span>
@@ -2442,7 +2751,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2442
2751
  `)}
2443
2752
  </div>
2444
2753
  `}
2445
- `}render(){return B`
2754
+ `}render(){return G`
2446
2755
  ${this._renderMarketInfo()}
2447
2756
  ${this._renderLocaleSwitcher()}
2448
2757
 
@@ -2450,7 +2759,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2450
2759
  <div class="section-title">Translation Keys on Page</div>
2451
2760
  ${this._renderTranslations()}
2452
2761
  </div>
2453
- `}};__publicField(kt,"properties",{meta:{type:Object},translations:{type:Array,state:!0},missingTranslations:{type:Array,state:!0},availableLocales:{type:Array,state:!0},availableCountries:{type:Array,state:!0},filter:{type:String,state:!0},activeTab:{type:String,state:!0}}),__publicField(kt,"styles",[dt,r`
2762
+ `}};__publicField(kt,"properties",{meta:{type:Object},translations:{type:Array,state:!0},missingTranslations:{type:Array,state:!0},availableLocales:{type:Array,state:!0},availableCountries:{type:Array,state:!0},filter:{type:String,state:!0},activeTab:{type:String,state:!0}}),__publicField(kt,"styles",[dt,o`
2454
2763
  :host {
2455
2764
  display: block;
2456
2765
  padding: 12px;
@@ -2817,15 +3126,15 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2817
3126
  .stat-value--warning {
2818
3127
  color: var(--tdt-warning);
2819
3128
  }
2820
- `]),__publicField(kt,"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(kt,"LANGUAGE_FLAGS",{en:"đŸ‡Ŧ🇧",es:"đŸ‡Ē🇸",fr:"đŸ‡Ģ🇷",de:"🇩đŸ‡Ē",it:"🇮🇹",pt:"đŸ‡ĩ🇹",nl:"đŸ‡ŗđŸ‡ą",pl:"đŸ‡ĩ🇱",ja:"đŸ‡¯đŸ‡ĩ",zh:"đŸ‡¨đŸ‡ŗ",ko:"🇰🇷",ar:"🇸đŸ‡Ļ",ru:"🇷đŸ‡ē",sv:"🇸đŸ‡Ē",da:"🇩🇰",fi:"đŸ‡Ģ🇮",no:"đŸ‡ŗđŸ‡´",cs:"🇨đŸ‡ŋ",hu:"🇭đŸ‡ē",ro:"🇷🇴"});let St=kt;customElements.define("tdt-localization-panel",St);const Ct=class t extends nt{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._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptFbPixel(),this._interceptShopifyAnalytics(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.fbq&&this._detectedProviders.add("fbpixel"),(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(...a){return a.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...a)},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(a,...i){if(!e.isPaused)if("event"===a){const[t,a]=i;e._addEvent("ga4",t,a||{}),e._detectedProviders.add("ga4")}else"config"===a&&e._addEvent("ga4","config",{measurementId:i[0],...i[1]});return t.call(this,a,...i)},this._originalGtag=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(a,...i){if(!e.isPaused)if("track"===a||"trackCustom"===a){const[t,a]=i;e._addEvent("fbpixel",t,a||{}),e._detectedProviders.add("fbpixel")}else"init"===a&&e._addEvent("fbpixel","init",{pixelId:i[0]});return t.call(this,a,...i)},this._originalFbq=t}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,a=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,i){return a.isPaused||(a._addEvent("shopify",e,i||{}),a._detectedProviders.add("shopify")),t(e,i)},this._originalShopifyPublish=t}}_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)})}_addEvent(e,a,i,s=!0){const o=t.CONVERSION_EVENTS.some(t=>a.toLowerCase().includes(t.toLowerCase())),r={id:Date.now()+Math.random(),provider:e,eventName:a,data:i,timestamp:new Date,isConversion:o,isLive:s};this.events=s?[...this.events,r]:[r,...this.events]}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[]}_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(){return{all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length,ga4:this.events.filter(t=>"ga4"===t.provider).length,fbpixel:this.events.filter(t=>"fbpixel"===t.provider).length,shopify:this.events.filter(t=>"shopify"===t.provider).length,datalayer:this.events.filter(t=>"datalayer"===t.provider).length,custom:this.events.filter(t=>"custom"===t.provider).length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,a;const{data:i}=t,s=[];return i.currency&&s.push({label:"Currency",value:i.currency}),void 0!==i.value&&s.push({label:"Value",value:i.value}),i.transaction_id&&s.push({label:"Order",value:i.transaction_id}),(null==(e=i.items)?void 0:e.length)&&s.push({label:"Items",value:i.items.length}),i.item_id&&s.push({label:"Item ID",value:i.item_id}),i.item_name&&s.push({label:"Item",value:i.item_name}),i.content_name&&s.push({label:"Content",value:i.content_name}),(null==(a=i.content_ids)?void 0:a.length)&&s.push({label:"IDs",value:i.content_ids.length}),s}_renderProviderBadges(){return B`
3129
+ `]),__publicField(kt,"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(kt,"LANGUAGE_FLAGS",{en:"đŸ‡Ŧ🇧",es:"đŸ‡Ē🇸",fr:"đŸ‡Ģ🇷",de:"🇩đŸ‡Ē",it:"🇮🇹",pt:"đŸ‡ĩ🇹",nl:"đŸ‡ŗđŸ‡ą",pl:"đŸ‡ĩ🇱",ja:"đŸ‡¯đŸ‡ĩ",zh:"đŸ‡¨đŸ‡ŗ",ko:"🇰🇷",ar:"🇸đŸ‡Ļ",ru:"🇷đŸ‡ē",sv:"🇸đŸ‡Ē",da:"🇩🇰",fi:"đŸ‡Ģ🇮",no:"đŸ‡ŗđŸ‡´",cs:"🇨đŸ‡ŋ",hu:"🇭đŸ‡ē",ro:"🇷🇴"});let St=kt;customElements.define("tdt-localization-panel",St);const Ct=class t extends nt{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._detectProviders(),this._interceptDataLayer(),this._interceptGtag(),this._interceptFbPixel(),this._interceptShopifyAnalytics(),this._interceptCustomEvents()}disconnectedCallback(){super.disconnectedCallback(),this._restoreInterceptors()}_detectProviders(){var t;window.dataLayer&&this._detectedProviders.add("datalayer"),window.gtag&&this._detectedProviders.add("ga4"),window.fbq&&this._detectedProviders.add("fbpixel"),(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(...a){return a.forEach(t=>{!e.isPaused&&t&&"object"==typeof t&&e._addEvent("datalayer",t.event||"push",t)}),t(...a)},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(a,...i){if(!e.isPaused)if("event"===a){const[t,a]=i;e._addEvent("ga4",t,a||{}),e._detectedProviders.add("ga4")}else"config"===a&&e._addEvent("ga4","config",{measurementId:i[0],...i[1]});return t.call(this,a,...i)},this._originalGtag=t}_interceptFbPixel(){if(!window.fbq)return;const t=window.fbq,e=this;window.fbq=function(a,...i){if(!e.isPaused)if("track"===a||"trackCustom"===a){const[t,a]=i;e._addEvent("fbpixel",t,a||{}),e._detectedProviders.add("fbpixel")}else"init"===a&&e._addEvent("fbpixel","init",{pixelId:i[0]});return t.call(this,a,...i)},this._originalFbq=t}_interceptShopifyAnalytics(){var t;if(!(null==(t=window.Shopify)?void 0:t.analytics))return;const e=window.Shopify.analytics,a=this;if(e.publish){const t=e.publish.bind(e);e.publish=function(e,i){return a.isPaused||(a._addEvent("shopify",e,i||{}),a._detectedProviders.add("shopify")),t(e,i)},this._originalShopifyPublish=t}}_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)})}_addEvent(e,a,i,s=!0){const r=t.CONVERSION_EVENTS.some(t=>a.toLowerCase().includes(t.toLowerCase())),o={id:Date.now()+Math.random(),provider:e,eventName:a,data:i,timestamp:new Date,isConversion:r,isLive:s};this.events=s?[...this.events,o]:[o,...this.events]}_togglePause(){this.isPaused=!this.isPaused}_clearEvents(){this.events=[]}_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(){return{all:this.events.length,conversion:this.events.filter(t=>t.isConversion).length,ga4:this.events.filter(t=>"ga4"===t.provider).length,fbpixel:this.events.filter(t=>"fbpixel"===t.provider).length,shopify:this.events.filter(t=>"shopify"===t.provider).length,datalayer:this.events.filter(t=>"datalayer"===t.provider).length,custom:this.events.filter(t=>"custom"===t.provider).length}}_formatTime(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}_getEventSummary(t){var e,a;const{data:i}=t,s=[];return i.currency&&s.push({label:"Currency",value:i.currency}),void 0!==i.value&&s.push({label:"Value",value:i.value}),i.transaction_id&&s.push({label:"Order",value:i.transaction_id}),(null==(e=i.items)?void 0:e.length)&&s.push({label:"Items",value:i.items.length}),i.item_id&&s.push({label:"Item ID",value:i.item_id}),i.item_name&&s.push({label:"Item",value:i.item_name}),i.content_name&&s.push({label:"Content",value:i.content_name}),(null==(a=i.content_ids)?void 0:a.length)&&s.push({label:"IDs",value:i.content_ids.length}),s}_renderProviderBadges(){return G`
2821
3130
  <div class="detected-providers">
2822
- ${["ga4","fbpixel","shopify","datalayer"].map(e=>{const a=this._detectedProviders.has(e),i=t.PROVIDERS[e];return B`
3131
+ ${["ga4","fbpixel","shopify","datalayer"].map(e=>{const a=this._detectedProviders.has(e),i=t.PROVIDERS[e];return G`
2823
3132
  <span class="provider-badge ${a?"provider-badge--active":""}">
2824
3133
  ${i.icon} ${i.name} ${a?"✓":"✗"}
2825
3134
  </span>
2826
3135
  `})}
2827
3136
  </div>
2828
- `}render(){const e=this._getFilteredEvents(),a=this._getCounts();return B`
3137
+ `}render(){const e=this._getFilteredEvents(),a=this._getCounts();return G`
2829
3138
  <div class="stats">
2830
3139
  <div class="stat">
2831
3140
  <span class="stat-label">Events</span>
@@ -2873,7 +3182,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2873
3182
  >
2874
3183
  💰 Conversions <span class="filter-tab__count">${a.conversion}</span>
2875
3184
  </button>
2876
- ${a.ga4>0?B`
3185
+ ${a.ga4>0?G`
2877
3186
  <button
2878
3187
  class="filter-tab ${"ga4"===this.activeFilter?"filter-tab--active":""}"
2879
3188
  @click=${()=>this._setFilter("ga4")}
@@ -2881,7 +3190,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2881
3190
  📊 GA4 <span class="filter-tab__count">${a.ga4}</span>
2882
3191
  </button>
2883
3192
  `:""}
2884
- ${a.fbpixel>0?B`
3193
+ ${a.fbpixel>0?G`
2885
3194
  <button
2886
3195
  class="filter-tab ${"fbpixel"===this.activeFilter?"filter-tab--active":""}"
2887
3196
  @click=${()=>this._setFilter("fbpixel")}
@@ -2889,7 +3198,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2889
3198
  📘 FB Pixel <span class="filter-tab__count">${a.fbpixel}</span>
2890
3199
  </button>
2891
3200
  `:""}
2892
- ${a.shopify>0?B`
3201
+ ${a.shopify>0?G`
2893
3202
  <button
2894
3203
  class="filter-tab ${"shopify"===this.activeFilter?"filter-tab--active":""}"
2895
3204
  @click=${()=>this._setFilter("shopify")}
@@ -2897,7 +3206,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2897
3206
  đŸ›ī¸ Shopify <span class="filter-tab__count">${a.shopify}</span>
2898
3207
  </button>
2899
3208
  `:""}
2900
- ${a.datalayer>0?B`
3209
+ ${a.datalayer>0?G`
2901
3210
  <button
2902
3211
  class="filter-tab ${"datalayer"===this.activeFilter?"filter-tab--active":""}"
2903
3212
  @click=${()=>this._setFilter("datalayer")}
@@ -2907,7 +3216,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2907
3216
  `:""}
2908
3217
  </div>
2909
3218
 
2910
- ${0===e.length?B`
3219
+ ${0===e.length?G`
2911
3220
  <div class="empty-state">
2912
3221
  <div class="empty-state__icon">📊</div>
2913
3222
  <div>No analytics events captured yet</div>
@@ -2915,9 +3224,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2915
3224
  Events will appear as they fire (GA4, FB Pixel, dataLayer, etc.)
2916
3225
  </div>
2917
3226
  </div>
2918
- `:B`
3227
+ `:G`
2919
3228
  <div class="event-list">
2920
- ${e.slice().reverse().map(e=>{const a=this.expandedEvents.has(e.id),i=this._getEventSummary(e),s=t.PROVIDERS[e.provider];return B`
3229
+ ${e.slice().reverse().map(e=>{const a=this.expandedEvents.has(e.id),i=this._getEventSummary(e),s=t.PROVIDERS[e.provider];return G`
2921
3230
  <div class="event-item event-item--${e.provider} ${e.isConversion?"event-item--conversion":""}">
2922
3231
  <div class="event-header" @click=${()=>this._toggleExpand(e.id)}>
2923
3232
  <span class="event-provider event-provider--${e.provider}">
@@ -2926,14 +3235,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2926
3235
  <span class="event-name ${e.isConversion?"event-name--conversion":""}">
2927
3236
  ${e.eventName}
2928
3237
  </span>
2929
- ${e.isConversion?B`<span class="event-badge">Conversion</span>`:""}
3238
+ ${e.isConversion?G`<span class="event-badge">Conversion</span>`:""}
2930
3239
  <span class="event-time">${this._formatTime(e.timestamp)}</span>
2931
3240
  </div>
2932
- ${a?B`
3241
+ ${a?G`
2933
3242
  <div class="event-content">
2934
- ${i.length>0?B`
3243
+ ${i.length>0?G`
2935
3244
  <div class="event-summary">
2936
- ${i.map(t=>B`
3245
+ ${i.map(t=>G`
2937
3246
  <span class="event-summary__item">
2938
3247
  <span class="event-summary__label">${t.label}:</span>
2939
3248
  <span class="event-summary__value">${t.value}</span>
@@ -2951,7 +3260,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
2951
3260
  `})}
2952
3261
  </div>
2953
3262
  `}
2954
- `}};__publicField(Ct,"properties",{events:{type:Array,state:!0},dataLayerSnapshots:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},expandedEvents:{type:Set,state:!0},isPaused:{type:Boolean,state:!0}}),__publicField(Ct,"styles",[dt,r`
3263
+ `}};__publicField(Ct,"properties",{events:{type:Array,state:!0},dataLayerSnapshots:{type:Array,state:!0},filter:{type:String,state:!0},activeFilter:{type:String,state:!0},expandedEvents:{type:Set,state:!0},isPaused:{type:Boolean,state:!0}}),__publicField(Ct,"styles",[dt,o`
2955
3264
  :host {
2956
3265
  display: block;
2957
3266
  padding: 12px;
@@ -3277,7 +3586,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3277
3586
  height: 1px;
3278
3587
  background: var(--tdt-border);
3279
3588
  }
3280
- `]),__publicField(Ct,"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(Ct,"PROVIDERS",{ga4:{name:"GA4",icon:"📊",color:"#4285f4"},fbpixel:{name:"FB Pixel",icon:"📘",color:"#1877f2"},shopify:{name:"Shopify",icon:"đŸ›ī¸",color:"#96bf48"},datalayer:{name:"DataLayer",icon:"đŸ“Ļ",color:"#f9ab00"},custom:{name:"Custom",icon:"⚡",color:"#9382ff"}});let Tt=Ct;customElements.define("tdt-analytics-panel",Tt);const At=class t extends nt{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this._expandedSchemas=new Set,this._previewType="facebook"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._generateIssues()}_scanMetaTags(){var e;const a=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let i="";e&&(i=t.attr?e.getAttribute(t.attr):e.textContent);const s=(null==i?void 0:i.length)||0;let o="success",r="";i?t.maxLength&&s>t.maxLength?(o="warning",r=`Too long (${s}/${t.maxLength} chars)`):t.minLength&&s<t.minLength&&(o="warning",r=`Too short (${s}/${t.minLength} min chars)`):(o="error",r="Missing - this tag is required"),a.push({name:t.name,value:i||null,length:s,maxLength:t.maxLength,minLength:t.minLength,status:o,hint:r})});const i=document.querySelector('link[rel="canonical"]');a.push({name:"canonical",value:(null==i?void 0:i.href)||null,status:i?"success":"warning",hint:i?"":"Recommended for SEO"});const s=document.querySelector('meta[name="robots"]');a.push({name:"robots",value:(null==s?void 0:s.content)||null,status:"success",hint:(null==(e=null==s?void 0:s.content)?void 0:e.includes("noindex"))?"âš ī¸ Page is set to noindex":""}),this.metaTags=a}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const a=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const a=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,a)=>{try{const i=JSON.parse(t.textContent);(Array.isArray(i)?i:[i]).forEach(t=>{e.push({id:`schema-${a}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(i){e.push({id:`schema-${a}`,type:"Invalid JSON",data:{error:i.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,a)=>{const i=t.getAttribute("alt"),s=t.src||t.dataset.src;s&&!s.startsWith("data:")&&e.push({id:a,src:s,alt:i,hasAlt:null!==i&&""!==i,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_generateIssues(){var t,e;const a=[],i=this.metaTags.find(t=>"title"===t.name);(null==i?void 0:i.value)?i.length>60&&a.push({type:"warning",title:"Title too long",description:`Title is ${i.length} characters (recommended: 60 max)`}):a.push({type:"error",title:"Missing page title",description:"Every page should have a unique title tag"});const s=this.metaTags.find(t=>"description"===t.name);(null==s?void 0:s.value)?s.length>160&&a.push({type:"warning",title:"Description too long",description:`Description is ${s.length} characters (recommended: 160 max)`}):a.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)||a.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)||a.push({type:"warning",title:"Missing og:title",description:"Add an Open Graph title for social sharing"});const o=this.images.filter(t=>!t.hasAlt);o.length>0&&a.push({type:"warning",title:`${o.length} image${o.length>1?"s":""} missing alt text`,description:"Alt text improves accessibility and SEO"});this.jsonLdData.filter(t=>!t.isValid).length>0&&a.push({type:"error",title:"Invalid JSON-LD schema",description:"Fix JSON syntax errors in structured data"});const r=this.metaTags.find(t=>"canonical"===t.name);(null==r?void 0:r.value)||a.push({type:"warning",title:"Missing canonical URL",description:"Add a canonical link to prevent duplicate content issues"}),this.issues=a}_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()}_renderOverview(){const t=this._getScore(),e=this._getScoreClass(t),a=this.issues.filter(t=>"error"===t.type).length,i=this.issues.filter(t=>"warning"===t.type).length;return B`
3589
+ `]),__publicField(Ct,"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(Ct,"PROVIDERS",{ga4:{name:"GA4",icon:"📊",color:"#4285f4"},fbpixel:{name:"FB Pixel",icon:"📘",color:"#1877f2"},shopify:{name:"Shopify",icon:"đŸ›ī¸",color:"#96bf48"},datalayer:{name:"DataLayer",icon:"đŸ“Ļ",color:"#f9ab00"},custom:{name:"Custom",icon:"⚡",color:"#9382ff"}});let Tt=Ct;customElements.define("tdt-analytics-panel",Tt);const Et=class t extends nt{constructor(){super(),this.metaTags=[],this.jsonLdData=[],this.openGraph={},this.twitterCard={},this.images=[],this.issues=[],this.activeTab="overview",this._expandedSchemas=new Set,this._previewType="facebook"}connectedCallback(){super.connectedCallback(),this._scanPage()}_scanPage(){this._scanMetaTags(),this._scanOpenGraph(),this._scanTwitterCard(),this._scanJsonLd(),this._scanImages(),this._generateIssues()}_scanMetaTags(){var e;const a=[];t.REQUIRED_META.forEach(t=>{const e=document.querySelector(t.selector);let i="";e&&(i=t.attr?e.getAttribute(t.attr):e.textContent);const s=(null==i?void 0:i.length)||0;let r="success",o="";i?t.maxLength&&s>t.maxLength?(r="warning",o=`Too long (${s}/${t.maxLength} chars)`):t.minLength&&s<t.minLength&&(r="warning",o=`Too short (${s}/${t.minLength} min chars)`):(r="error",o="Missing - this tag is required"),a.push({name:t.name,value:i||null,length:s,maxLength:t.maxLength,minLength:t.minLength,status:r,hint:o})});const i=document.querySelector('link[rel="canonical"]');a.push({name:"canonical",value:(null==i?void 0:i.href)||null,status:i?"success":"warning",hint:i?"":"Recommended for SEO"});const s=document.querySelector('meta[name="robots"]');a.push({name:"robots",value:(null==s?void 0:s.content)||null,status:"success",hint:(null==(e=null==s?void 0:s.content)?void 0:e.includes("noindex"))?"âš ī¸ Page is set to noindex":""}),this.metaTags=a}_scanOpenGraph(){const e={};t.OG_TAGS.forEach(t=>{const a=document.querySelector(`meta[property="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.openGraph=e}_scanTwitterCard(){const e={};t.TWITTER_TAGS.forEach(t=>{const a=document.querySelector(`meta[name="${t.name}"]`);e[t.name]={value:(null==a?void 0:a.content)||null,required:t.required}}),this.twitterCard=e}_scanJsonLd(){const t=document.querySelectorAll('script[type="application/ld+json"]'),e=[];t.forEach((t,a)=>{try{const i=JSON.parse(t.textContent);(Array.isArray(i)?i:[i]).forEach(t=>{e.push({id:`schema-${a}-${e.length}`,type:t["@type"]||"Unknown",data:t,isValid:!0})})}catch(i){e.push({id:`schema-${a}`,type:"Invalid JSON",data:{error:i.message,raw:t.textContent.substring(0,200)},isValid:!1})}}),this.jsonLdData=e}_scanImages(){const t=document.querySelectorAll("img"),e=[];t.forEach((t,a)=>{const i=t.getAttribute("alt"),s=t.src||t.dataset.src;s&&!s.startsWith("data:")&&e.push({id:a,src:s,alt:i,hasAlt:null!==i&&""!==i,width:t.naturalWidth||t.width,height:t.naturalHeight||t.height,loading:t.loading,isLazy:"lazy"===t.loading||t.dataset.src})}),this.images=e}_generateIssues(){var t,e;const a=[],i=this.metaTags.find(t=>"title"===t.name);(null==i?void 0:i.value)?i.length>60&&a.push({type:"warning",title:"Title too long",description:`Title is ${i.length} characters (recommended: 60 max)`}):a.push({type:"error",title:"Missing page title",description:"Every page should have a unique title tag"});const s=this.metaTags.find(t=>"description"===t.name);(null==s?void 0:s.value)?s.length>160&&a.push({type:"warning",title:"Description too long",description:`Description is ${s.length} characters (recommended: 160 max)`}):a.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)||a.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)||a.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&&a.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&&a.push({type:"error",title:"Invalid JSON-LD schema",description:"Fix JSON syntax errors in structured data"});const o=this.metaTags.find(t=>"canonical"===t.name);(null==o?void 0:o.value)||a.push({type:"warning",title:"Missing canonical URL",description:"Add a canonical link to prevent duplicate content issues"}),this.issues=a}_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()}_renderOverview(){const t=this._getScore(),e=this._getScoreClass(t),a=this.issues.filter(t=>"error"===t.type).length,i=this.issues.filter(t=>"warning"===t.type).length;return G`
3281
3590
  <div class="score-card">
3282
3591
  <div class="score score--${e}">${t}/10</div>
3283
3592
  <div class="score-details">
@@ -3290,11 +3599,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3290
3599
  </div>
3291
3600
  </div>
3292
3601
 
3293
- ${this.issues.length>0?B`
3602
+ ${this.issues.length>0?G`
3294
3603
  <div class="section">
3295
3604
  <div class="section-title">Issues Found</div>
3296
3605
  <div class="issue-list">
3297
- ${this.issues.map(t=>B`
3606
+ ${this.issues.map(t=>G`
3298
3607
  <div class="issue-item issue-item--${t.type}">
3299
3608
  <span class="issue-icon">${"error"===t.type?"❌":"âš ī¸"}</span>
3300
3609
  <div class="issue-content">
@@ -3310,11 +3619,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3310
3619
  <div class="section">
3311
3620
  <div class="section-title">Essential Meta Tags</div>
3312
3621
  <div class="meta-list">
3313
- ${this.metaTags.map(t=>B`
3622
+ ${this.metaTags.map(t=>G`
3314
3623
  <div class="meta-item meta-item--${t.status}">
3315
3624
  <div class="meta-header">
3316
3625
  <span class="meta-name">${t.name}</span>
3317
- ${t.maxLength?B`
3626
+ ${t.maxLength?G`
3318
3627
  <span class="meta-length ${t.length>t.maxLength?"meta-length--error":t.length<(t.minLength||0)?"meta-length--warning":""}">
3319
3628
  ${t.length}/${t.maxLength}
3320
3629
  </span>
@@ -3323,12 +3632,12 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3323
3632
  <div class="meta-value ${t.value?"":"meta-value--missing"}">
3324
3633
  ${t.value||"Not set"}
3325
3634
  </div>
3326
- ${t.hint?B`<div class="meta-hint">${t.hint}</div>`:""}
3635
+ ${t.hint?G`<div class="meta-hint">${t.hint}</div>`:""}
3327
3636
  </div>
3328
3637
  `)}
3329
3638
  </div>
3330
3639
  </div>
3331
- `}_renderSocialPreview(){var t,e,a,i,s,o,r,n,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==(a=this.metaTags.find(t=>"title"===t.name))?void 0:a.value),p=(null==(i=this.openGraph["og:description"])?void 0:i.value)||(null==(s=this.metaTags.find(t=>"description"===t.name))?void 0:s.value),u=(null==(o=this.openGraph["og:site_name"])?void 0:o.value)||window.location.hostname,h=(null==(r=this.twitterCard["twitter:image"])?void 0:r.value)||d,v=(null==(n=this.twitterCard["twitter:title"])?void 0:n.value)||c,g=(null==(l=this.twitterCard["twitter:description"])?void 0:l.value)||p;return B`
3640
+ `}_renderSocialPreview(){var t,e,a,i,s,r,o,n,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==(a=this.metaTags.find(t=>"title"===t.name))?void 0:a.value),p=(null==(i=this.openGraph["og:description"])?void 0:i.value)||(null==(s=this.metaTags.find(t=>"description"===t.name))?void 0:s.value),u=(null==(r=this.openGraph["og:site_name"])?void 0:r.value)||window.location.hostname,h=(null==(o=this.twitterCard["twitter:image"])?void 0:o.value)||d,g=(null==(n=this.twitterCard["twitter:title"])?void 0:n.value)||c,v=(null==(l=this.twitterCard["twitter:description"])?void 0:l.value)||p;return G`
3332
3641
  <div class="preview-tabs">
3333
3642
  <button
3334
3643
  class="preview-tab ${"facebook"===this._previewType?"preview-tab--active":""}"
@@ -3350,10 +3659,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3350
3659
  </button>
3351
3660
  </div>
3352
3661
 
3353
- ${"facebook"===this._previewType||"linkedin"===this._previewType?B`
3662
+ ${"facebook"===this._previewType||"linkedin"===this._previewType?G`
3354
3663
  <div class="og-preview">
3355
3664
  <div class="og-preview__image">
3356
- ${d?B`<img src="${d}" alt="OG Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
3665
+ ${d?G`<img src="${d}" alt="OG Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
3357
3666
  </div>
3358
3667
  <div class="og-preview__content">
3359
3668
  <div class="og-preview__site">${u}</div>
@@ -3361,14 +3670,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3361
3670
  <div class="og-preview__description">${p||"No description set"}</div>
3362
3671
  </div>
3363
3672
  </div>
3364
- `:B`
3673
+ `:G`
3365
3674
  <div class="twitter-preview">
3366
3675
  <div class="twitter-preview__image">
3367
- ${h?B`<img src="${h}" alt="Twitter Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
3676
+ ${h?G`<img src="${h}" alt="Twitter Image" @error=${t=>t.target.style.display="none"}>`:"No image set"}
3368
3677
  </div>
3369
3678
  <div class="twitter-preview__content">
3370
- <div class="twitter-preview__title">${v||"No title set"}</div>
3371
- <div class="twitter-preview__description">${g||"No description set"}</div>
3679
+ <div class="twitter-preview__title">${g||"No title set"}</div>
3680
+ <div class="twitter-preview__description">${v||"No description set"}</div>
3372
3681
  <div class="twitter-preview__domain">🔗 ${window.location.hostname}</div>
3373
3682
  </div>
3374
3683
  </div>
@@ -3377,11 +3686,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3377
3686
  <div class="section" style="margin-top: 20px;">
3378
3687
  <div class="section-title">Open Graph Tags</div>
3379
3688
  <div class="meta-list">
3380
- ${Object.entries(this.openGraph).map(([t,e])=>B`
3689
+ ${Object.entries(this.openGraph).map(([t,e])=>G`
3381
3690
  <div class="meta-item ${e.value?"meta-item--success":e.required?"meta-item--error":"meta-item--warning"}">
3382
3691
  <div class="meta-header">
3383
3692
  <span class="meta-name">${t}</span>
3384
- ${e.required?B`<span class="meta-badge ${e.value?"meta-badge--success":"meta-badge--error"}">${e.value?"✓":"Required"}</span>`:""}
3693
+ ${e.required?G`<span class="meta-badge ${e.value?"meta-badge--success":"meta-badge--error"}">${e.value?"✓":"Required"}</span>`:""}
3385
3694
  </div>
3386
3695
  <div class="meta-value ${e.value?"":"meta-value--missing"}">
3387
3696
  ${e.value||"Not set"}
@@ -3394,7 +3703,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3394
3703
  <div class="section">
3395
3704
  <div class="section-title">Twitter Card Tags</div>
3396
3705
  <div class="meta-list">
3397
- ${Object.entries(this.twitterCard).map(([t,e])=>B`
3706
+ ${Object.entries(this.twitterCard).map(([t,e])=>G`
3398
3707
  <div class="meta-item ${e.value?"meta-item--success":e.required?"meta-item--error":""}">
3399
3708
  <div class="meta-header">
3400
3709
  <span class="meta-name">${t}</span>
@@ -3406,7 +3715,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3406
3715
  `)}
3407
3716
  </div>
3408
3717
  </div>
3409
- `}_renderSchema(){return 0===this.jsonLdData.length?B`
3718
+ `}_renderSchema(){return 0===this.jsonLdData.length?G`
3410
3719
  <div class="empty-state">
3411
3720
  <div style="font-size: 32px; margin-bottom: 8px;">📋</div>
3412
3721
  <div>No JSON-LD structured data found</div>
@@ -3414,10 +3723,10 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3414
3723
  Add structured data to improve rich snippets in search results
3415
3724
  </div>
3416
3725
  </div>
3417
- `:B`
3726
+ `:G`
3418
3727
  <div class="section">
3419
3728
  <div class="section-title">Structured Data (${this.jsonLdData.length} schemas)</div>
3420
- ${this.jsonLdData.map(t=>B`
3729
+ ${this.jsonLdData.map(t=>G`
3421
3730
  <div class="schema-item">
3422
3731
  <div class="schema-header" @click=${()=>this._toggleSchema(t.id)}>
3423
3732
  <span class="schema-type">${t.type}</span>
@@ -3425,7 +3734,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3425
3734
  ${t.isValid?"✓ Valid":"✗ Invalid"}
3426
3735
  </span>
3427
3736
  </div>
3428
- ${this._expandedSchemas.has(t.id)?B`
3737
+ ${this._expandedSchemas.has(t.id)?G`
3429
3738
  <div class="schema-content">
3430
3739
  <tdt-object-inspector .data=${t.data} .path=${"schema"}></tdt-object-inspector>
3431
3740
  </div>
@@ -3433,19 +3742,19 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3433
3742
  </div>
3434
3743
  `)}
3435
3744
  </div>
3436
- `}_renderImages(){const t=this.images.filter(t=>!t.hasAlt),e=this.images.filter(t=>t.hasAlt);return B`
3437
- ${t.length>0?B`
3745
+ `}_renderImages(){const t=this.images.filter(t=>!t.hasAlt),e=this.images.filter(t=>t.hasAlt);return G`
3746
+ ${t.length>0?G`
3438
3747
  <div class="section">
3439
3748
  <div class="section-title">âš ī¸ Missing Alt Text (${t.length})</div>
3440
3749
  <div class="image-grid">
3441
- ${t.map(t=>B`
3750
+ ${t.map(t=>G`
3442
3751
  <div class="image-item image-item--error">
3443
3752
  <div class="image-item__preview">
3444
3753
  <img src="${t.src}" alt="" @error=${t=>t.target.style.display="none"}>
3445
3754
  </div>
3446
3755
  <div class="image-item__info">
3447
3756
  <div class="image-item__alt image-item__alt--missing">No alt text</div>
3448
- ${t.width&&t.height?B`
3757
+ ${t.width&&t.height?G`
3449
3758
  <div class="image-item__size">${t.width}×${t.height}</div>
3450
3759
  `:""}
3451
3760
  </div>
@@ -3457,35 +3766,35 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3457
3766
 
3458
3767
  <div class="section">
3459
3768
  <div class="section-title">✓ Images with Alt Text (${e.length})</div>
3460
- ${0===e.length?B`
3769
+ ${0===e.length?G`
3461
3770
  <div class="empty-state">No images with alt text found</div>
3462
- `:B`
3771
+ `:G`
3463
3772
  <div class="image-grid">
3464
- ${e.slice(0,20).map(t=>B`
3773
+ ${e.slice(0,20).map(t=>G`
3465
3774
  <div class="image-item">
3466
3775
  <div class="image-item__preview">
3467
3776
  <img src="${t.src}" alt="${t.alt}" @error=${t=>t.target.style.display="none"}>
3468
3777
  </div>
3469
3778
  <div class="image-item__info">
3470
3779
  <div class="image-item__alt">${t.alt}</div>
3471
- ${t.width&&t.height?B`
3780
+ ${t.width&&t.height?G`
3472
3781
  <div class="image-item__size">${t.width}×${t.height}</div>
3473
3782
  `:""}
3474
3783
  </div>
3475
3784
  </div>
3476
3785
  `)}
3477
3786
  </div>
3478
- ${e.length>20?B`<div style="text-align: center; color: var(--tdt-text-muted); margin-top: 12px;">... and ${e.length-20} more</div>`:""}
3787
+ ${e.length>20?G`<div style="text-align: center; color: var(--tdt-text-muted); margin-top: 12px;">... and ${e.length-20} more</div>`:""}
3479
3788
  `}
3480
3789
  </div>
3481
- `}render(){const t=this.issues.length,e=this.images.filter(t=>!t.hasAlt).length;return B`
3790
+ `}render(){const t=this.issues.length,e=this.images.filter(t=>!t.hasAlt).length;return G`
3482
3791
  <div class="tabs">
3483
3792
  <button
3484
3793
  class="tab ${"overview"===this.activeTab?"tab--active":""} ${t>0?"tab--warning":""}"
3485
3794
  @click=${()=>this._setTab("overview")}
3486
3795
  >
3487
3796
  📊 Overview
3488
- ${t>0?B`<span class="tab__count">${t}</span>`:""}
3797
+ ${t>0?G`<span class="tab__count">${t}</span>`:""}
3489
3798
  </button>
3490
3799
  <button
3491
3800
  class="tab ${"social"===this.activeTab?"tab--active":""}"
@@ -3504,7 +3813,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3504
3813
  @click=${()=>this._setTab("images")}
3505
3814
  >
3506
3815
  đŸ–ŧī¸ Images
3507
- ${e>0?B`<span class="tab__count">${e}</span>`:""}
3816
+ ${e>0?G`<span class="tab__count">${e}</span>`:""}
3508
3817
  </button>
3509
3818
  </div>
3510
3819
 
@@ -3512,7 +3821,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
3512
3821
  ${"social"===this.activeTab?this._renderSocialPreview():""}
3513
3822
  ${"schema"===this.activeTab?this._renderSchema():""}
3514
3823
  ${"images"===this.activeTab?this._renderImages():""}
3515
- `}};__publicField(At,"properties",{metaTags:{type:Array,state:!0},jsonLdData:{type:Array,state:!0},openGraph:{type:Object,state:!0},twitterCard:{type:Object,state:!0},images:{type:Array,state:!0},issues:{type:Array,state:!0},activeTab:{type:String,state:!0}}),__publicField(At,"styles",[dt,r`
3824
+ `}};__publicField(Et,"properties",{metaTags:{type:Array,state:!0},jsonLdData:{type:Array,state:!0},openGraph:{type:Object,state:!0},twitterCard:{type:Object,state:!0},images:{type:Array,state:!0},issues:{type:Array,state:!0},activeTab:{type:String,state:!0}}),__publicField(Et,"styles",[dt,o`
3516
3825
  :host {
3517
3826
  display: block;
3518
3827
  padding: 12px;
@@ -4044,11 +4353,11 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4044
4353
  border-color: var(--tdt-accent);
4045
4354
  color: white;
4046
4355
  }
4047
- `]),__publicField(At,"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(At,"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(At,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let Et=At;customElements.define("tdt-seo-panel",Et);const zt=class t extends nt{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,a)=>{var i;const s=e.getAttribute("data-block-type")||"",o=e.getAttribute("data-block-id")||e.id||`block-${a}`,r=(null==(i=e.closest("[data-section-id]"))?void 0:i.getAttribute("data-section-id"))||"unknown";let n="Unknown App";const l=s.match(/shopify:\/\/apps\/([^/]+)/);l&&(n=l[1].replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())),t.push({id:o,type:"app-block",name:n,blockType:s,sectionId:r,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,a)=>{t.find(t=>t.element===e)||t.push({id:e.id||`theme-block-${a}`,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,a)=>{var i;const s=e.src||"",o=e.type||"text/javascript",r=e.async,n=e.defer,l=!s,d=l?null==(i=e.textContent)?void 0:i.substring(0,500):"";if(l&&!(null==d?void 0:d.trim()))return;const c=this._identifyVendor(s||d),p=this._isPixelScript(s,d);this._isShopifyCoreScript(s)&&!p||t.push({id:`script-${a}`,src:s,type:o,isAsync:r,isDefer:n,isInline:l,content:d,vendor:c,isPixel:p,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,a)=>{const i=e.getAttribute("data-app-embed")||e.getAttribute("data-shopify-app-embed")||"";t.push({id:`embed-${a}`,type:"embed",appId:i,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})});document.querySelectorAll('[style*="position: fixed"], [style*="position:fixed"]').forEach((e,a)=>{if(e.closest("theme-devtools"))return;const i=this._identifyVendorFromElement(e);if(i){t.find(t=>t.element===e)||t.push({id:`widget-${a}`,type:"widget",name:i.name,vendor:i.key,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})}}),this.appEmbeds=t}_categorizeScripts(){this.pixelScripts=this.scripts.filter(t=>t.isPixel)}_identifyVendor(e){const a=e.toLowerCase();for(const[i,s]of Object.entries(t.KNOWN_APPS))if(s.patterns.some(t=>a.includes(t)))return{key:i,...s};return null}_identifyVendorFromElement(e){var a,i,s;const o=(null==(a=e.className)?void 0:a.toLowerCase())||"",r=(null==(i=e.id)?void 0:i.toLowerCase())||"",n=(null==(s=e.innerHTML)?void 0:s.substring(0,1e3).toLowerCase())||"";for(const[l,d]of Object.entries(t.KNOWN_APPS))if(d.patterns.some(t=>o.includes(t)||r.includes(t)||n.includes(t)))return{key:l,...d};return null}_isPixelScript(t,e){const a=(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=>a.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,a=t.style.transition;t.style.transition="outline 0.2s ease",t.style.outline="3px solid #3b82f6",setTimeout(()=>{t.style.outline=e,t.style.transition=a},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=>{var a;const i=e.name||(null==(a=e.vendor)?void 0:a.name)||"",s=e.src||"";return i.toLowerCase().includes(t)||s.toLowerCase().includes(t)})),e}_getVendorIcon(t){return t?B`<span class="vendor-icon vendor-icon--${t.key}">${t.icon}</span>`:B`<span class="vendor-icon vendor-icon--unknown">?</span>`}_renderItem(t){const e=this._expandedItems.has(t.id),a=t.vendor,i=t.name||(null==a?void 0:a.name)||this._extractNameFromSrc(t.src)||"Unknown";return B`
4356
+ `]),__publicField(Et,"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(Et,"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(Et,"TWITTER_TAGS",[{name:"twitter:card",required:!0},{name:"twitter:title",required:!1},{name:"twitter:description",required:!1},{name:"twitter:image",required:!1}]);let At=Et;customElements.define("tdt-seo-panel",At);const Lt=class t extends nt{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,a)=>{var i;const s=e.getAttribute("data-block-type")||"",r=e.getAttribute("data-block-id")||e.id||`block-${a}`,o=(null==(i=e.closest("[data-section-id]"))?void 0:i.getAttribute("data-section-id"))||"unknown";let n="Unknown App";const l=s.match(/shopify:\/\/apps\/([^/]+)/);l&&(n=l[1].replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())),t.push({id:r,type:"app-block",name:n,blockType:s,sectionId:o,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,a)=>{t.find(t=>t.element===e)||t.push({id:e.id||`theme-block-${a}`,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,a)=>{var i;const s=e.src||"",r=e.type||"text/javascript",o=e.async,n=e.defer,l=!s,d=l?null==(i=e.textContent)?void 0:i.substring(0,500):"";if(l&&!(null==d?void 0:d.trim()))return;const c=this._identifyVendor(s||d),p=this._isPixelScript(s,d);this._isShopifyCoreScript(s)&&!p||t.push({id:`script-${a}`,src:s,type:r,isAsync:o,isDefer:n,isInline:l,content:d,vendor:c,isPixel:p,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,a)=>{const i=e.getAttribute("data-app-embed")||e.getAttribute("data-shopify-app-embed")||"";t.push({id:`embed-${a}`,type:"embed",appId:i,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})});document.querySelectorAll('[style*="position: fixed"], [style*="position:fixed"]').forEach((e,a)=>{if(e.closest("theme-devtools"))return;const i=this._identifyVendorFromElement(e);if(i){t.find(t=>t.element===e)||t.push({id:`widget-${a}`,type:"widget",name:i.name,vendor:i.key,element:e,tagName:e.tagName.toLowerCase(),position:this._getPosition(e)})}}),this.appEmbeds=t}_categorizeScripts(){this.pixelScripts=this.scripts.filter(t=>t.isPixel)}_identifyVendor(e){const a=e.toLowerCase();for(const[i,s]of Object.entries(t.KNOWN_APPS))if(s.patterns.some(t=>a.includes(t)))return{key:i,...s};return null}_identifyVendorFromElement(e){var a,i,s;const r=(null==(a=e.className)?void 0:a.toLowerCase())||"",o=(null==(i=e.id)?void 0:i.toLowerCase())||"",n=(null==(s=e.innerHTML)?void 0:s.substring(0,1e3).toLowerCase())||"";for(const[l,d]of Object.entries(t.KNOWN_APPS))if(d.patterns.some(t=>r.includes(t)||o.includes(t)||n.includes(t)))return{key:l,...d};return null}_isPixelScript(t,e){const a=(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=>a.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,a=t.style.transition;t.style.transition="outline 0.2s ease",t.style.outline="3px solid #3b82f6",setTimeout(()=>{t.style.outline=e,t.style.transition=a},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=>{var a;const i=e.name||(null==(a=e.vendor)?void 0:a.name)||"",s=e.src||"";return i.toLowerCase().includes(t)||s.toLowerCase().includes(t)})),e}_getVendorIcon(t){return t?G`<span class="vendor-icon vendor-icon--${t.key}">${t.icon}</span>`:G`<span class="vendor-icon vendor-icon--unknown">?</span>`}_renderItem(t){const e=this._expandedItems.has(t.id),a=t.vendor,i=t.name||(null==a?void 0:a.name)||this._extractNameFromSrc(t.src)||"Unknown";return G`
4048
4357
  <div class="item item--${"pixel"===t.category?"warning":"embed"===t.category?"success":"info"}">
4049
4358
  <div class="item__header" @click=${()=>this._toggleExpand(t.id)}>
4050
4359
  <div class="item__main">
4051
- ${a?this._getVendorIcon(a):B`<span class="item__icon">${this._getCategoryIcon(t.category)}</span>`}
4360
+ ${a?this._getVendorIcon(a):G`<span class="item__icon">${this._getCategoryIcon(t.category)}</span>`}
4052
4361
  <div class="item__info">
4053
4362
  <div class="item__name">${i}</div>
4054
4363
  <div class="item__meta">
@@ -4060,34 +4369,34 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4060
4369
  ${this._renderBadges(t)}
4061
4370
  </div>
4062
4371
  <div class="item__actions">
4063
- ${t.element?B`
4372
+ ${t.element?G`
4064
4373
  <button class="item__btn" @click=${e=>{e.stopPropagation(),this._highlightElement(t.element)}} title="Highlight">đŸ‘ī¸</button>
4065
4374
  `:""}
4066
- ${t.src?B`
4375
+ ${t.src?G`
4067
4376
  <button class="item__btn" @click=${e=>{e.stopPropagation(),this._copyToClipboard(t.src)}} title="Copy URL">📋</button>
4068
4377
  `:""}
4069
4378
  </div>
4070
4379
  </div>
4071
- ${e?B`
4380
+ ${e?G`
4072
4381
  <div class="item__content">
4073
4382
  ${this._renderItemDetails(t)}
4074
4383
  </div>
4075
4384
  `:""}
4076
4385
  </div>
4077
- `}_renderBadges(t){const e=[];return"block"===t.category?e.push(B`<span class="item__badge item__badge--app">Block</span>`):"script"===t.category?e.push(B`<span class="item__badge item__badge--script">Script</span>`):"pixel"===t.category?e.push(B`<span class="item__badge item__badge--pixel">Pixel</span>`):"embed"===t.category&&e.push(B`<span class="item__badge item__badge--embed">Embed</span>`),t.isAsync&&e.push(B`<span class="item__badge item__badge--async">Async</span>`),t.isDefer&&e.push(B`<span class="item__badge item__badge--defer">Defer</span>`),t.isInline&&e.push(B`<span class="item__badge item__badge--inline">Inline</span>`),t.src&&!t.isInline&&e.push(B`<span class="item__badge item__badge--external">External</span>`),e}_renderItemDetails(t){return"block"===t.category?B`
4078
- ${t.blockType?B`
4386
+ `}_renderBadges(t){const e=[];return"block"===t.category?e.push(G`<span class="item__badge item__badge--app">Block</span>`):"script"===t.category?e.push(G`<span class="item__badge item__badge--script">Script</span>`):"pixel"===t.category?e.push(G`<span class="item__badge item__badge--pixel">Pixel</span>`):"embed"===t.category&&e.push(G`<span class="item__badge item__badge--embed">Embed</span>`),t.isAsync&&e.push(G`<span class="item__badge item__badge--async">Async</span>`),t.isDefer&&e.push(G`<span class="item__badge item__badge--defer">Defer</span>`),t.isInline&&e.push(G`<span class="item__badge item__badge--inline">Inline</span>`),t.src&&!t.isInline&&e.push(G`<span class="item__badge item__badge--external">External</span>`),e}_renderItemDetails(t){return"block"===t.category?G`
4387
+ ${t.blockType?G`
4079
4388
  <div class="item__detail">
4080
4389
  <span class="item__detail-label">Block Type:</span>
4081
4390
  <span class="item__detail-value">${t.blockType}</span>
4082
4391
  </div>
4083
4392
  `:""}
4084
- ${t.sectionId?B`
4393
+ ${t.sectionId?G`
4085
4394
  <div class="item__detail">
4086
4395
  <span class="item__detail-label">Section:</span>
4087
4396
  <span class="item__detail-value">${t.sectionId}</span>
4088
4397
  </div>
4089
4398
  `:""}
4090
- ${t.classes?B`
4399
+ ${t.classes?G`
4091
4400
  <div class="item__detail">
4092
4401
  <span class="item__detail-label">Classes:</span>
4093
4402
  <span class="item__detail-value">${t.classes}</span>
@@ -4096,36 +4405,36 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4096
4405
  <button class="highlight-btn" @click=${()=>this._highlightElement(t.element)}>
4097
4406
  Highlight in Page
4098
4407
  </button>
4099
- `:"script"===t.category||"pixel"===t.category?B`
4100
- ${t.src?B`
4408
+ `:"script"===t.category||"pixel"===t.category?G`
4409
+ ${t.src?G`
4101
4410
  <div class="item__detail">
4102
4411
  <span class="item__detail-label">Source:</span>
4103
4412
  <span class="item__detail-value item__detail-value--link" @click=${()=>window.open(t.src,"_blank")}>${t.src}</span>
4104
4413
  </div>
4105
4414
  `:""}
4106
- ${t.type&&"text/javascript"!==t.type?B`
4415
+ ${t.type&&"text/javascript"!==t.type?G`
4107
4416
  <div class="item__detail">
4108
4417
  <span class="item__detail-label">Type:</span>
4109
4418
  <span class="item__detail-value">${t.type}</span>
4110
4419
  </div>
4111
4420
  `:""}
4112
- ${t.size?B`
4421
+ ${t.size?G`
4113
4422
  <div class="item__detail">
4114
4423
  <span class="item__detail-label">Size:</span>
4115
4424
  <span class="item__detail-value">${this._formatSize(t.size)}</span>
4116
4425
  </div>
4117
4426
  `:""}
4118
- ${t.isInline&&t.content?B`
4427
+ ${t.isInline&&t.content?G`
4119
4428
  <div class="item__code">${t.content}${t.content.length>=500?"...":""}</div>
4120
4429
  `:""}
4121
- `:"embed"===t.category?B`
4122
- ${t.appId?B`
4430
+ `:"embed"===t.category?G`
4431
+ ${t.appId?G`
4123
4432
  <div class="item__detail">
4124
4433
  <span class="item__detail-label">App ID:</span>
4125
4434
  <span class="item__detail-value">${t.appId}</span>
4126
4435
  </div>
4127
4436
  `:""}
4128
- ${t.position?B`
4437
+ ${t.position?G`
4129
4438
  <div class="item__detail">
4130
4439
  <span class="item__detail-label">Position:</span>
4131
4440
  <span class="item__detail-value">${t.position.position} (${t.position.top||"auto"}, ${t.position.right||"auto"}, ${t.position.bottom||"auto"}, ${t.position.left||"auto"})</span>
@@ -4134,7 +4443,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4134
4443
  <button class="highlight-btn" @click=${()=>this._highlightElement(t.element)}>
4135
4444
  Highlight in Page
4136
4445
  </button>
4137
- `:""}_getCategoryIcon(t){switch(t){case"block":return"🧩";case"script":return"📜";case"pixel":return"📊";case"embed":return"🔌";default:return"❓"}}_extractNameFromSrc(t){if(!t)return null;try{const e=new URL(t).hostname,a=e.replace("www.","").split(".");return a.length>=2?a[a.length-2].charAt(0).toUpperCase()+a[a.length-2].slice(1):e}catch{const e=t.match(/\/([^/]+)\.(js|min\.js)(\?|$)/);return e?e[1]:null}}_truncateSrc(t){if(!t)return"";if(t.length<=60)return t;try{return new URL(t).hostname+"/..."+t.slice(-20)}catch{return t.substring(0,30)+"..."+t.slice(-20)}}_formatSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}_refresh(){this._expandedItems.clear(),this._scanPage()}render(){const t=this._getFilteredItems(),e=this.scripts.length,a=this.pixelScripts.length,i=this.appBlocks.length,s=this.appEmbeds.length;return B`
4446
+ `:""}_getCategoryIcon(t){switch(t){case"block":return"🧩";case"script":return"📜";case"pixel":return"📊";case"embed":return"🔌";default:return"❓"}}_extractNameFromSrc(t){if(!t)return null;try{const e=new URL(t).hostname,a=e.replace("www.","").split(".");return a.length>=2?a[a.length-2].charAt(0).toUpperCase()+a[a.length-2].slice(1):e}catch{const e=t.match(/\/([^/]+)\.(js|min\.js)(\?|$)/);return e?e[1]:null}}_truncateSrc(t){if(!t)return"";if(t.length<=60)return t;try{return new URL(t).hostname+"/..."+t.slice(-20)}catch{return t.substring(0,30)+"..."+t.slice(-20)}}_formatSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}_refresh(){this._expandedItems.clear(),this._scanPage()}render(){const t=this._getFilteredItems(),e=this.scripts.length,a=this.pixelScripts.length,i=this.appBlocks.length,s=this.appEmbeds.length;return G`
4138
4447
  <div class="tabs">
4139
4448
  <button
4140
4449
  class="tab ${"all"===this.activeTab?"tab--active":""}"
@@ -4202,17 +4511,17 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4202
4511
  />
4203
4512
  </div>
4204
4513
 
4205
- ${0===t.length?B`
4514
+ ${0===t.length?G`
4206
4515
  <div class="empty-state">
4207
4516
  <div class="empty-state__icon">🔌</div>
4208
4517
  <div>No ${"all"===this.activeTab?"items":this.activeTab} found</div>
4209
4518
  </div>
4210
- `:B`
4519
+ `:G`
4211
4520
  <div class="item-list">
4212
4521
  ${t.map(t=>this._renderItem(t))}
4213
4522
  </div>
4214
4523
  `}
4215
- `}};__publicField(zt,"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(zt,"styles",[dt,r`
4524
+ `}};__publicField(Lt,"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(Lt,"styles",[dt,o`
4216
4525
  :host {
4217
4526
  display: block;
4218
4527
  padding: 12px;
@@ -4592,7 +4901,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4592
4901
  .vendor-icon--pinterest { background: #e60023; color: white; }
4593
4902
  .vendor-icon--hotjar { background: #fd3a5c; color: white; }
4594
4903
  .vendor-icon--unknown { background: var(--tdt-bg-secondary); color: var(--tdt-text-muted); }
4595
- `]),__publicField(zt,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},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"]},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"]},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"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]}});let Lt=zt;customElements.define("tdt-apps-panel",Lt);const jt=class t extends nt{constructor(){super(),this.isCollapsed=!1,this.activeTab="objects",this.context=null,this.cart=null,this._unsubscribeCart=null,this.tabOrder=null,this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),ut.stopPolling(),ht.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){this.context=ct.parse(),this.context?(ut.interceptAjax(),ut.startPolling(3e3),ut.fetch().then(t=>{t&&ut.setCart(t)}),this._unsubscribeCart=ut.subscribe(t=>{this.cart=t}),ht.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{(t.metaKey||t.ctrlKey)&&t.shiftKey&&"D"===t.key&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-tab-order");if(e)try{const a=JSON.parse(e),i=t.DEFAULT_TABS.map(t=>t.id),s=a.filter(t=>i.includes(t)),o=i.filter(t=>!s.includes(t));this.tabOrder=[...s,...o]}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 a=[...this.tabOrder],i=a.indexOf(this.draggedTab),s=a.indexOf(t);a.splice(i,1),a.splice(s,0,this.draggedTab),this.tabOrder=a,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(a)),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")}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()}async _copyPageJSON(){try{const t=JSON.stringify(this.context,null,2);await navigator.clipboard.writeText(t),this._showActionFeedback("JSON copied")}catch(t){console.error("Failed to copy:",t)}}_getShopHandle(){return window.location.host}_getAdminBaseUrl(){return`https://admin.shopify.com/store/${this._getShopHandle()}`}_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||{},a=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!a)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const i=window.location.pathname+window.location.search,s=`${this._getAdminBaseUrl()}/themes/${a}/editor?previewPath=${encodeURIComponent(i)}`;window.open(s,"_blank")}_openResourceInAdmin(){var t,e,a,i,s,o;const{meta:r,objects:n}=this.context||{},l=null==(t=null==r?void 0:r.request)?void 0:t.page_type;"product"===l&&(null==(e=null==n?void 0:n.product)?void 0:e.id)?this._openAdminPage(`/products/${n.product.id}`):"collection"===l&&(null==(a=null==n?void 0:n.collection)?void 0:a.id)?this._openAdminPage(`/collections/${n.collection.id}`):"article"===l&&(null==(i=null==n?void 0:n.article)?void 0:i.id)?this._openAdminPage(`/articles/${n.article.id}`):"page"===l&&(null==(s=null==n?void 0:n.page)?void 0:s.id)?this._openAdminPage(`/pages/${n.page.id}`):"blog"===l&&(null==(o=null==n?void 0:n.blog)?void 0:o.id)&&this._openAdminPage(`/blogs/${n.blog.id}`)}_getResourceLabel(){var t,e,a;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(a=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:a.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")}_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: 12px;\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const a=document.createElement("style");a.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(a),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}_close(){this.remove()}_formatMoney(t){return null==t?"—":`$${(t/100).toFixed(2)}`}render(){var t,e,a,i,s,o,r,n;if(!this.context)return B``;const{meta:l,objects:d,metafields:c,settings:p,sectionSettings:u,metafieldsSchema:h}=this.context,v={...d,cart:this.cart||d.cart},g=this._getOrderedTabs();return B`
4904
+ `]),__publicField(Lt,"KNOWN_APPS",{klaviyo:{name:"Klaviyo",icon:"K",patterns:["klaviyo","klviyo"]},judgeme:{name:"Judge.me",icon:"J",patterns:["judge.me","judgeme"]},recharge:{name:"ReCharge",icon:"R",patterns:["recharge","rechargepayments"]},privy:{name:"Privy",icon:"P",patterns:["privy"]},omnisend:{name:"Omnisend",icon:"O",patterns:["omnisend"]},yotpo:{name:"Yotpo",icon:"Y",patterns:["yotpo"]},loox:{name:"Loox",icon:"L",patterns:["loox"]},stamped:{name:"Stamped",icon:"S",patterns:["stamped"]},smile:{name:"Smile.io",icon:"S",patterns:["smile.io","smileio"]},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"]},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"]},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"]},bold:{name:"Bold",icon:"B",patterns:["boldapps","boldcommerce"]},pagefly:{name:"PageFly",icon:"P",patterns:["pagefly"]},shogun:{name:"Shogun",icon:"S",patterns:["getshogun","shogun"]}});let zt=Lt;customElements.define("tdt-apps-panel",zt);const Ot=class t extends nt{constructor(){super(),this.isCollapsed=!1,this.activeTab="objects",this.context=null,this.cart=null,this._unsubscribeCart=null,this.tabOrder=null,this.draggedTab=null,this.dragOverTab=null,this.showAdminDropdown=!1}connectedCallback(){super.connectedCallback(),this._init(),this._bindKeyboard(),this._restoreState()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeCart&&this._unsubscribeCart(),ut.stopPolling(),ht.destroy(),document.removeEventListener("keydown",this._handleKeydown)}_init(){this.context=ct.parse(),this.context?(ut.interceptAjax(),ut.startPolling(3e3),ut.fetch().then(t=>{t&&ut.setCart(t)}),this._unsubscribeCart=ut.subscribe(t=>{this.cart=t}),ht.init()):console.warn("[Theme Devtools] No context available")}_bindKeyboard(){this._handleKeydown=t=>{(t.metaKey||t.ctrlKey)&&t.shiftKey&&"D"===t.key&&(t.preventDefault(),this._toggleCollapse())},document.addEventListener("keydown",this._handleKeydown)}_restoreState(){"true"===localStorage.getItem("theme-devtools-collapsed")&&(this.isCollapsed=!0);const e=localStorage.getItem("theme-devtools-active-tab"),a=t.DEFAULT_TABS.map(t=>t.id);e&&a.includes(e)&&(this.activeTab=e);const i=localStorage.getItem("theme-devtools-tab-order");if(i)try{const e=JSON.parse(i),a=t.DEFAULT_TABS.map(t=>t.id),s=e.filter(t=>a.includes(t)),r=a.filter(t=>!s.includes(t));this.tabOrder=[...s,...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 a=[...this.tabOrder],i=a.indexOf(this.draggedTab),s=a.indexOf(t);a.splice(i,1),a.splice(s,0,this.draggedTab),this.tabOrder=a,localStorage.setItem("theme-devtools-tab-order",JSON.stringify(a)),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")}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()}async _copyPageJSON(){try{const t=JSON.stringify(this.context,null,2);await navigator.clipboard.writeText(t),this._showActionFeedback("JSON copied")}catch(t){console.error("Failed to copy:",t)}}_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||{},a=null==(t=null==e?void 0:e.theme)?void 0:t.id;if(!a)return void window.open(this._getAdminBaseUrl()+"/themes","_blank");const i=window.location.pathname+window.location.search,s=`${this._getAdminBaseUrl()}/themes/${a}/editor?previewPath=${encodeURIComponent(i)}`;window.open(s,"_blank")}_openResourceInAdmin(){var t,e,a,i,s,r;const{meta:o,objects:n}=this.context||{},l=null==(t=null==o?void 0:o.request)?void 0:t.page_type;"product"===l&&(null==(e=null==n?void 0:n.product)?void 0:e.id)?this._openAdminPage(`/products/${n.product.id}`):"collection"===l&&(null==(a=null==n?void 0:n.collection)?void 0:a.id)?this._openAdminPage(`/collections/${n.collection.id}`):"article"===l&&(null==(i=null==n?void 0:n.article)?void 0:i.id)?this._openAdminPage(`/articles/${n.article.id}`):"page"===l&&(null==(s=null==n?void 0:n.page)?void 0:s.id)?this._openAdminPage(`/pages/${n.page.id}`):"blog"===l&&(null==(r=null==n?void 0:n.blog)?void 0:r.id)&&this._openAdminPage(`/blogs/${n.blog.id}`)}_getResourceLabel(){var t,e,a;return{product:"Product",collection:"Collection",article:"Article",page:"Page",blog:"Blog"}[null==(a=null==(e=null==(t=this.context)?void 0:t.meta)?void 0:e.request)?void 0:a.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")}_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: 12px;\n font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;\n z-index: 2147483647;\n animation: fadeOut 2s forwards;\n ";const a=document.createElement("style");a.textContent="\n @keyframes fadeOut {\n 0%, 70% { opacity: 1; }\n 100% { opacity: 0; }\n }\n ",e.appendChild(a),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,a,i,s,r,o,n;if(!this.context)return G``;const{meta:l,objects:d,metafields:c,settings:p,sectionSettings:u,metafieldsSchema:h}=this.context,g={...d,cart:this.cart||d.cart},v=this._getOrderedTabs();return G`
4596
4905
  <div class="dock ${this.isCollapsed?"dock--collapsed":""}">
4597
4906
  <div class="dock__handle" @click=${this._toggleCollapse}>
4598
4907
  <div class="dock__title">Theme Devtools</div>
@@ -4612,14 +4921,14 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4612
4921
  ${(null==(a=l.template)?void 0:a.name)||"Unknown"}${(null==(i=l.template)?void 0:i.suffix)?`.${l.template.suffix}`:""}
4613
4922
  </span>
4614
4923
  <span class="header__page-type">${(null==(s=l.request)?void 0:s.page_type)||"—"}</span>
4615
- ${(null==(o=l.request)?void 0:o.design_mode)?B`<span class="badge badge--design">Design Mode</span>`:""}
4924
+ ${(null==(r=l.request)?void 0:r.design_mode)?G`<span class="badge badge--design">Design Mode</span>`:""}
4616
4925
  <span class="header__cart">
4617
- 🛒 ${(null==(r=this.cart)?void 0:r.item_count)||0} items â€ĸ ${this._formatMoney(null==(n=this.cart)?void 0:n.total_price)}
4926
+ 🛒 ${(null==(o=this.cart)?void 0:o.item_count)||0} items â€ĸ ${this._formatMoney(null==(n=this.cart)?void 0:n.total_price)}
4618
4927
  </span>
4619
4928
  </div>
4620
4929
 
4621
4930
  <div class="tabs">
4622
- ${g.map(t=>B`
4931
+ ${v.map(t=>G`
4623
4932
  <button
4624
4933
  class="tab ${this.activeTab===t.id?"tab--active":""} ${this.draggedTab===t.id?"tab--dragging":""} ${this.dragOverTab===t.id?"tab--drag-over":""}"
4625
4934
  draggable="true"
@@ -4660,9 +4969,9 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4660
4969
  <button class="action-btn" @click=${this._toggleAdminDropdown} title="Open Shopify admin pages">
4661
4970
  <span class="action-btn__icon">âš™ī¸</span> Admin ▾
4662
4971
  </button>
4663
- ${this.showAdminDropdown?B`
4972
+ ${this.showAdminDropdown?G`
4664
4973
  <div class="action-dropdown__menu" @click=${t=>t.stopPropagation()}>
4665
- ${this._getResourceLabel()?B`
4974
+ ${this._getResourceLabel()?G`
4666
4975
  <button class="action-dropdown__item action-dropdown__item--highlight" @click=${this._openResourceInAdmin}>
4667
4976
  📄 Open ${this._getResourceLabel()} in Admin
4668
4977
  </button>
@@ -4708,7 +5017,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4708
5017
  <div class="content">
4709
5018
  <tdt-objects-panel
4710
5019
  class="panel ${"objects"===this.activeTab?"panel--active":""}"
4711
- .objects=${v}
5020
+ .objects=${g}
4712
5021
  ></tdt-objects-panel>
4713
5022
 
4714
5023
  <tdt-metafields-panel
@@ -4769,7 +5078,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
4769
5078
  ></tdt-info-panel>
4770
5079
  </div>
4771
5080
  </div>
4772
- `}};__publicField(jt,"properties",{isCollapsed:{type:Boolean,state:!0},activeTab:{type:String,state:!0},context:{type:Object,state:!0},cart:{type:Object,state:!0},tabOrder:{type:Array,state:!0},draggedTab:{type:String,state:!0},dragOverTab:{type:String,state:!0},showAdminDropdown:{type:Boolean,state:!0}}),__publicField(jt,"DEFAULT_TABS",[{id:"objects",label:"Objects",icon:"đŸ“Ļ"},{id:"metafields",label:"Metafields",icon:"đŸˇī¸"},{id:"cart",label:"Cart",icon:"🛒"},{id:"locale",label:"Locale",icon:"🌐"},{id:"analytics",label:"Analytics",icon:"📊"},{id:"seo",label:"SEO",icon:"🔍"},{id:"apps",label:"Apps",icon:"🔌"},{id:"console",label:"Console",icon:"📋"},{id:"cookies",label:"Cookies",icon:"đŸĒ"},{id:"storage",label:"Storage",icon:"💾"},{id:"info",label:"Info",icon:"â„šī¸"}]),__publicField(jt,"styles",[dt,r`
5081
+ `}};__publicField(Ot,"properties",{isCollapsed:{type:Boolean,state:!0},activeTab:{type:String,state:!0},context:{type:Object,state:!0},cart:{type:Object,state:!0},tabOrder:{type:Array,state:!0},draggedTab:{type:String,state:!0},dragOverTab:{type:String,state:!0},showAdminDropdown:{type:Boolean,state:!0}}),__publicField(Ot,"DEFAULT_TABS",[{id:"objects",label:"Objects",icon:"đŸ“Ļ"},{id:"metafields",label:"Metafields",icon:"đŸˇī¸"},{id:"cart",label:"Cart",icon:"🛒"},{id:"locale",label:"Locale",icon:"🌐"},{id:"analytics",label:"Analytics",icon:"📊"},{id:"seo",label:"SEO",icon:"🔍"},{id:"apps",label:"Apps",icon:"🔌"},{id:"console",label:"Console",icon:"📋"},{id:"cookies",label:"Cookies",icon:"đŸĒ"},{id:"storage",label:"Storage",icon:"💾"},{id:"info",label:"Info",icon:"â„šī¸"}]),__publicField(Ot,"styles",[dt,o`
4773
5082
  .dock {
4774
5083
  position: fixed;
4775
5084
  bottom: 0;
@@ -5032,4 +5341,4 @@ var __defProp=Object.defineProperty,__defNormalProp=(t,e,a)=>e in t?__defProp(t,
5032
5341
  .panel--active {
5033
5342
  display: block;
5034
5343
  }
5035
- `]);let Ot=jt;customElements.define("theme-devtools",Ot);function Pt(){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",Pt):Pt()}();
5344
+ `]);let jt=Ot;customElements.define("theme-devtools",jt);function Pt(){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",Pt):Pt()}();