var x=Object.defineProperty;var O=n=>{throw TypeError(n)};var J=(n,t,e)=>t in n?x(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var m=(n,t,e)=>J(n,typeof t!="symbol"?t+"":t,e),w=(n,t,e)=>t.has(n)||O("Cannot "+e);var l=(n,t,e)=>(w(n,t,"read from private field"),e?e.call(n):t.get(n)),y=(n,t,e)=>t.has(n)?O("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),j=(n,t,e,s)=>(w(n,t,"write to private field"),s?s.call(n,e):t.set(n,e),e),u=(n,t,e)=>(w(n,t,"access private method"),e);import{J as M}from"./vue.esm-bundler.js?ver=1.5.4";import{A as N}from"./Arr.js?ver=1.5.4";class b{constructor(){m(this,"_data",{})}static form(t){const e=new this;return e._data=t,e}get(t=null,e=""){return t===null?this._data:N.get(this._data,t,e)}}var t,i,h,a,S,f;const r=class r{static onShopUpdate(t){l(r,h).push(t)}static setConfig(t){var e;if(u(e=r,a,f).call(e,t),Object.keys(r._data).forEach(s=>delete r._data[s]),Object.assign(r._data,t),l(r,i))try{l(r,i).postMessage({type:"set",config:JSON.parse(JSON.stringify(t))})}catch{}}static mergeConfig(t){var e;if(u(e=r,a,f).call(e,t),Object.assign(r._data,t),l(r,i))try{l(r,i).postMessage({type:"merge",config:JSON.parse(JSON.stringify(t))})}catch{}}static get(t=null,e=null){return t===null?r._data:b.form(r._data).get(t,e)}static assetUrl(t=""){return r.get("asset_url")+t}static get shop(){return b.form(r.get("shop"))}static get config(){return b.form(r.get("app_config"))}};i=new WeakMap,h=new WeakMap,a=new WeakSet,S=function(){l(r,h).forEach(t=>t())},f=function(t){if(!t||typeof t!="object")return;const e=document.createElement("textarea");t.shop&&t.shop.currency_sign&&(e.innerHTML=t.shop.currency_sign,t.shop.currency_sign=e.value),t.currency_signs&&typeof t.currency_signs=="object"&&Object.keys(t.currency_signs).forEach(function(s){e.innerHTML=t.currency_signs[s],t.currency_signs[s]=e.value})},y(r,a),m(r,"_data",M(window.fluentCartAdminApp||{})),y(r,i,null),y(r,h,[]),u(t=r,a,f).call(t,r._data),typeof BroadcastChannel<"u"&&(j(r,i,new BroadcastChannel("fluent-cart-config:"+window.location.origin)),l(r,i).onmessage=function(e){var c,o,p,d;const s=e.data;if(s){if(s.type==="merge"&&s.config)u(c=r,a,f).call(c,s.config),Object.assign(r._data,s.config),s.config.shop&&(u(o=r,a,S).call(o),window.dispatchEvent(new CustomEvent("fluentCartCurrencyChange")));else if(s.type==="set"&&s.config){u(p=r,a,f).call(p,s.config);const v=r._data.shop&&r._data.shop.currency_sign;Object.keys(r._data).forEach(_=>delete r._data[_]),Object.assign(r._data,s.config);const E=r._data.shop&&r._data.shop.currency_sign;v!==E&&(u(d=r,a,S).call(d),window.dispatchEvent(new CustomEvent("fluentCartCurrencyChange")))}}});let g=r;window.fluentCartAdminApp=g._data;function C(n){const t=g.get("trans")||{};g.get("app_config.env")==="dev"&&!t[n]&&window.console.warn("Missing translation:",n),n=t[n]||n;const e=Array.prototype.slice.call(arguments,1);if(e.length===0)return n;const s=/%(\d*\$?)s|%d/g;let c=0;return n=n.replace(s,(o,p)=>{if(p){const d=parseInt(p,10)-1;return d<e.length?e[d]:o}else return c<e.length?e[c++]:o}),n}function T(n,t,e,s=null){let c=parseInt(e.toString().replace(/,/g,""),10);return c>1?C(t,e):C(c===0?s??n:n,e)}function B(n){const t=g.get("datei18");n=n.toString();const s=(t.numericSystem||"0_1_2_3_4_5_6_7_8_9").split("_");return n.split("").map(o=>s[o]||o).join("")}export{g as A,B as a,T as p,C as t};
