Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopware-ag/admin-extension-sdk

Package Overview
Dependencies
Maintainers
7
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopware-ag/admin-extension-sdk - npm Package Compare versions

Comparing version 0.0.50 to 0.0.51

2

cdn/index.js

@@ -1,1 +0,1 @@

var Ig=Object.defineProperty;var Ke=Object.getOwnPropertySymbols;var Mg=Object.prototype.hasOwnProperty,xg=Object.prototype.propertyIsEnumerable;var Et=(y,h,b)=>h in y?Ig(y,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[h]=b,Pt=(y,h)=>{for(var b in h||(h={}))Mg.call(h,b)&&Et(y,b,h[b]);if(Ke)for(var b of Ke(h))xg.call(h,b)&&Et(y,b,h[b]);return y};var f=(y,h,b)=>(Et(y,typeof h!="symbol"?h+"":h,b),b);(function(y,h){typeof exports=="object"&&typeof module!="undefined"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(y=typeof globalThis!="undefined"?globalThis:y||self,h(y.sw={}))})(this,function(y){var Be;"use strict";var h=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},b=Object.prototype,ke=b.hasOwnProperty;function qe(t,e){return t!=null&&ke.call(t,e)}var Ve=qe,We=Array.isArray,O=We,Je=typeof h=="object"&&h&&h.Object===Object&&h,It=Je,Qe=It,Ye=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Qe||Ye||Function("return this")(),T=Xe,Ze=T,tr=Ze.Symbol,W=tr,Mt=W,xt=Object.prototype,er=xt.hasOwnProperty,rr=xt.toString,R=Mt?Mt.toStringTag:void 0;function nr(t){var e=er.call(t,R),r=t[R];try{t[R]=void 0;var n=!0}catch{}var i=rr.call(t);return n&&(e?t[R]=r:delete t[R]),i}var ir=nr,ar=Object.prototype,sr=ar.toString;function or(t){return sr.call(t)}var cr=or,Dt=W,ur=ir,lr=cr,fr="[object Null]",gr="[object Undefined]",zt=Dt?Dt.toStringTag:void 0;function _r(t){return t==null?t===void 0?gr:fr:zt&&zt in Object(t)?ur(t):lr(t)}var G=_r;function dr(t){return t!=null&&typeof t=="object"}var E=dr,pr=G,hr=E,yr="[object Symbol]";function vr(t){return typeof t=="symbol"||hr(t)&&pr(t)==yr}var it=vr,br=O,$r=it,mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Sr=/^\w*$/;function wr(t,e){if(br(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||$r(t)?!0:Sr.test(t)||!mr.test(t)||e!=null&&t in Object(e)}var Tr=wr;function Ar(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var U=Ar,Or=G,jr=U,Cr="[object AsyncFunction]",Er="[object Function]",Pr="[object GeneratorFunction]",Ir="[object Proxy]";function Mr(t){if(!jr(t))return!1;var e=Or(t);return e==Er||e==Pr||e==Cr||e==Ir}var Ft=Mr,xr=T,Dr=xr["__core-js_shared__"],zr=Dr,at=zr,Lt=function(){var t=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Fr(t){return!!Lt&&Lt in t}var Lr=Fr,Nr=Function.prototype,Rr=Nr.toString;function Gr(t){if(t!=null){try{return Rr.call(t)}catch{}try{return t+""}catch{}}return""}var Nt=Gr,Ur=Ft,Hr=Lr,Br=U,Kr=Nt,kr=/[\\^$.*+?()[\]{}|]/g,qr=/^\[object .+?Constructor\]$/,Vr=Function.prototype,Wr=Object.prototype,Jr=Vr.toString,Qr=Wr.hasOwnProperty,Yr=RegExp("^"+Jr.call(Qr).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xr(t){if(!Br(t)||Hr(t))return!1;var e=Ur(t)?Yr:qr;return e.test(Kr(t))}var Zr=Xr;function tn(t,e){return t==null?void 0:t[e]}var en=tn,rn=Zr,nn=en;function an(t,e){var r=nn(t,e);return rn(r)?r:void 0}var j=an,sn=j,on=sn(Object,"create"),J=on,Rt=J;function cn(){this.__data__=Rt?Rt(null):{},this.size=0}var un=cn;function ln(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var fn=ln,gn=J,_n="__lodash_hash_undefined__",dn=Object.prototype,pn=dn.hasOwnProperty;function hn(t){var e=this.__data__;if(gn){var r=e[t];return r===_n?void 0:r}return pn.call(e,t)?e[t]:void 0}var yn=hn,vn=J,bn=Object.prototype,$n=bn.hasOwnProperty;function mn(t){var e=this.__data__;return vn?e[t]!==void 0:$n.call(e,t)}var Sn=mn,wn=J,Tn="__lodash_hash_undefined__";function An(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=wn&&e===void 0?Tn:e,this}var On=An,jn=un,Cn=fn,En=yn,Pn=Sn,In=On;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}P.prototype.clear=jn,P.prototype.delete=Cn,P.prototype.get=En,P.prototype.has=Pn,P.prototype.set=In;var Mn=P;function xn(){this.__data__=[],this.size=0}var Dn=xn;function zn(t,e){return t===e||t!==t&&e!==e}var Gt=zn,Fn=Gt;function Ln(t,e){for(var r=t.length;r--;)if(Fn(t[r][0],e))return r;return-1}var Q=Ln,Nn=Q,Rn=Array.prototype,Gn=Rn.splice;function Un(t){var e=this.__data__,r=Nn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Gn.call(e,r,1),--this.size,!0}var Hn=Un,Bn=Q;function Kn(t){var e=this.__data__,r=Bn(e,t);return r<0?void 0:e[r][1]}var kn=Kn,qn=Q;function Vn(t){return qn(this.__data__,t)>-1}var Wn=Vn,Jn=Q;function Qn(t,e){var r=this.__data__,n=Jn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Yn=Qn,Xn=Dn,Zn=Hn,ti=kn,ei=Wn,ri=Yn;function I(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}I.prototype.clear=Xn,I.prototype.delete=Zn,I.prototype.get=ti,I.prototype.has=ei,I.prototype.set=ri;var Y=I,ni=j,ii=T,ai=ni(ii,"Map"),st=ai,Ut=Mn,si=Y,oi=st;function ci(){this.size=0,this.__data__={hash:new Ut,map:new(oi||si),string:new Ut}}var ui=ci;function li(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var fi=li,gi=fi;function _i(t,e){var r=t.__data__;return gi(e)?r[typeof e=="string"?"string":"hash"]:r.map}var X=_i,di=X;function pi(t){var e=di(this,t).delete(t);return this.size-=e?1:0,e}var hi=pi,yi=X;function vi(t){return yi(this,t).get(t)}var bi=vi,$i=X;function mi(t){return $i(this,t).has(t)}var Si=mi,wi=X;function Ti(t,e){var r=wi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Ai=Ti,Oi=ui,ji=hi,Ci=bi,Ei=Si,Pi=Ai;function M(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}M.prototype.clear=Oi,M.prototype.delete=ji,M.prototype.get=Ci,M.prototype.has=Ei,M.prototype.set=Pi;var Ht=M,Bt=Ht,Ii="Expected a function";function ot(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ii);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(ot.Cache||Bt),r}ot.Cache=Bt;var Mi=ot,xi=Mi,Di=500;function zi(t){var e=xi(t,function(n){return r.size===Di&&r.clear(),n}),r=e.cache;return e}var Fi=zi,Li=Fi,Ni=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ri=/\\(\\)?/g,Gi=Li(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ni,function(r,n,i,a){e.push(i?a.replace(Ri,"$1"):n||r)}),e}),Ui=Gi;function Hi(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Bi=Hi,Kt=W,Ki=Bi,ki=O,qi=it,Vi=1/0,kt=Kt?Kt.prototype:void 0,qt=kt?kt.toString:void 0;function Vt(t){if(typeof t=="string")return t;if(ki(t))return Ki(t,Vt)+"";if(qi(t))return qt?qt.call(t):"";var e=t+"";return e=="0"&&1/t==-Vi?"-0":e}var Wi=Vt,Ji=Wi;function Qi(t){return t==null?"":Ji(t)}var Yi=Qi,Xi=O,Zi=Tr,ta=Ui,ea=Yi;function ra(t,e){return Xi(t)?t:Zi(t,e)?[t]:ta(ea(t))}var na=ra,ia=G,aa=E,sa="[object Arguments]";function oa(t){return aa(t)&&ia(t)==sa}var ca=oa,Wt=ca,ua=E,Jt=Object.prototype,la=Jt.hasOwnProperty,fa=Jt.propertyIsEnumerable,ga=Wt(function(){return arguments}())?Wt:function(t){return ua(t)&&la.call(t,"callee")&&!fa.call(t,"callee")},Qt=ga,_a=9007199254740991,da=/^(?:0|[1-9]\d*)$/;function pa(t,e){var r=typeof t;return e=e==null?_a:e,!!e&&(r=="number"||r!="symbol"&&da.test(t))&&t>-1&&t%1==0&&t<e}var Yt=pa,ha=9007199254740991;function ya(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ha}var ct=ya,va=it,ba=1/0;function $a(t){if(typeof t=="string"||va(t))return t;var e=t+"";return e=="0"&&1/t==-ba?"-0":e}var ma=$a,Sa=na,wa=Qt,Ta=O,Aa=Yt,Oa=ct,ja=ma;function Ca(t,e,r){e=Sa(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=ja(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Oa(i)&&Aa(s,i)&&(Ta(t)||wa(t)))}var Ea=Ca,Pa=Ve,Ia=Ea;function Ma(t,e){return t!=null&&Ia(t,e,Pa)}var xa=Ma;function Xt(){return String(Date.now().toString(36)+Math.random().toString(36).substr(2))}function Z(t){return t!==null&&typeof t=="object"}function ut(){return new URLSearchParams(window.location.search).get("location-id")}function Da(){const t=window.location;return new URL(t.pathname,t.origin).toString()}function H(t,e){return Z(e)&&e.__type__&&e.__type__===t}function za(t,e){return xa(t,e)}function Zt(t,e){for(let r in t){const n=t[r];e.apply(this,[t,r,n]),Z(n)&&Zt(n,e)}}const lt={notificationDispatch:{},windowRedirect:{},windowReload:{},contextLanguage:{},contextEnvironment:{},contextLocale:{},contextCurrency:{},contextShopwareVersion:{},contextAppInformation:{},getPageTitle:{},uiComponentSectionRenderer:{},uiTabsAddTabItem:{},locationUpdateHeight:{},menuItemAdd:{},settingsItemAdd:{},mainModuleAdd:{},uiModalOpen:{},uiModalClose:{},actionButtonAdd:{},actionExecute:{},datasetRegistration:{},datasetQuery:{},datasetUpdate:{},__function__:{},__registerWindow__:{},_criteriaTest:{},_collectionTest:{},_multiply:{},_subtract:{},_privileges:{create:["user"],read:["user"],update:["user"],delete:["user"]}};function Fa(t){const e=te(t),r=Na(window.location);return!e||Object.keys(e).length<=0?null:ee(e,r)}function La(t,e,r){const n=te(t),i=re(e,r);return i?ee(n,i.permissions):null}function te(t){var e;return(e=lt[t])!=null?e:{}}function Na(t){const r=new URLSearchParams(t.search).get("privileges");return r?JSON.parse(r):{}}function ee(t,e){const r=Object.keys(t),n=[];return r.forEach(i=>{var a;(a=t[i])==null||a.forEach(s=>{var c;(c=e[i])!=null&&c.includes(s)||n.push(`${i}:${s}`)})}),n.length>=1?n:null}function re(t,e){let r=null;return Object.values(t).forEach(n=>{n.baseUrl===e&&(r=n)}),r}class x extends Error{constructor(e,r){super(`Your app is missing the priviliges ${r.join(", ")} for action "${e}".`);f(this,"missingPrivileges");f(this,"messageType");this.missingPrivileges=r,this.messageType=e,Object.setPrototypeOf(this,x.prototype)}toJSON(){return{__type__:"__MissingPrivilegesError__",__messageType__:this.messageType,__data__:this.missingPrivileges}}}const Ra=({send:t,handleFactory:e})=>{const r={};let n=!1;function i(){if(n)return;n=!0,e({})("__function__",async({args:s,id:c})=>await Promise.resolve(r[c](...s)))}return{name:"function",serialize:({value:a})=>{if(typeof a=="function"){const s=Xt();return r[s]=a,i(),{__type__:"__function__",id:s,origin:window.origin}}},deserialize:({value:a,event:s})=>{var u;const c=(u=s==null?void 0:s.source)!=null?u:window;if(Z(a)&&a.__type__&&a.__type__==="__function__"&&typeof a.id=="string"){const o=a.id,l=a.origin;return(...g)=>t("__function__",{args:g,id:o},c,l)}}}};var Ga=Y;function Ua(){this.__data__=new Ga,this.size=0}var Ha=Ua;function Ba(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Ka=Ba;function ka(t){return this.__data__.get(t)}var qa=ka;function Va(t){return this.__data__.has(t)}var Wa=Va,Ja=Y,Qa=st,Ya=Ht,Xa=200;function Za(t,e){var r=this.__data__;if(r instanceof Ja){var n=r.__data__;if(!Qa||n.length<Xa-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ya(n)}return r.set(t,e),this.size=r.size,this}var ts=Za,es=Y,rs=Ha,ns=Ka,is=qa,as=Wa,ss=ts;function D(t){var e=this.__data__=new es(t);this.size=e.size}D.prototype.clear=rs,D.prototype.delete=ns,D.prototype.get=is,D.prototype.has=as,D.prototype.set=ss;var os=D;function cs(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var us=cs,ls=j,fs=function(){try{var t=ls(Object,"defineProperty");return t({},"",{}),t}catch{}}(),gs=fs,ne=gs;function _s(t,e,r){e=="__proto__"&&ne?ne(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ie=_s,ds=ie,ps=Gt,hs=Object.prototype,ys=hs.hasOwnProperty;function vs(t,e,r){var n=t[e];(!(ys.call(t,e)&&ps(n,r))||r===void 0&&!(e in t))&&ds(t,e,r)}var ae=vs,bs=ae,$s=ie;function ms(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var c=e[a],u=n?n(r[c],t[c],c,r,t):void 0;u===void 0&&(u=t[c]),i?$s(r,c,u):bs(r,c,u)}return r}var tt=ms;function Ss(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ws=Ss,et={exports:{}};function Ts(){return!1}var As=Ts;(function(t,e){var r=T,n=As,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,s=a&&a.exports===i,c=s?r.Buffer:void 0,u=c?c.isBuffer:void 0,o=u||n;t.exports=o})(et,et.exports);var Os=G,js=ct,Cs=E,Es="[object Arguments]",Ps="[object Array]",Is="[object Boolean]",Ms="[object Date]",xs="[object Error]",Ds="[object Function]",zs="[object Map]",Fs="[object Number]",Ls="[object Object]",Ns="[object RegExp]",Rs="[object Set]",Gs="[object String]",Us="[object WeakMap]",Hs="[object ArrayBuffer]",Bs="[object DataView]",Ks="[object Float32Array]",ks="[object Float64Array]",qs="[object Int8Array]",Vs="[object Int16Array]",Ws="[object Int32Array]",Js="[object Uint8Array]",Qs="[object Uint8ClampedArray]",Ys="[object Uint16Array]",Xs="[object Uint32Array]",p={};p[Ks]=p[ks]=p[qs]=p[Vs]=p[Ws]=p[Js]=p[Qs]=p[Ys]=p[Xs]=!0,p[Es]=p[Ps]=p[Hs]=p[Is]=p[Bs]=p[Ms]=p[xs]=p[Ds]=p[zs]=p[Fs]=p[Ls]=p[Ns]=p[Rs]=p[Gs]=p[Us]=!1;function Zs(t){return Cs(t)&&js(t.length)&&!!p[Os(t)]}var to=Zs;function eo(t){return function(e){return t(e)}}var ft=eo,B={exports:{}};(function(t,e){var r=It,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,s=a&&r.process,c=function(){try{var u=i&&i.require&&i.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}}();t.exports=c})(B,B.exports);var ro=to,no=ft,se=B.exports,oe=se&&se.isTypedArray,io=oe?no(oe):ro,ao=io,so=ws,oo=Qt,co=O,uo=et.exports,lo=Yt,fo=ao,go=Object.prototype,_o=go.hasOwnProperty;function po(t,e){var r=co(t),n=!r&&oo(t),i=!r&&!n&&uo(t),a=!r&&!n&&!i&&fo(t),s=r||n||i||a,c=s?so(t.length,String):[],u=c.length;for(var o in t)(e||_o.call(t,o))&&!(s&&(o=="length"||i&&(o=="offset"||o=="parent")||a&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||lo(o,u)))&&c.push(o);return c}var ce=po,ho=Object.prototype;function yo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ho;return t===r}var gt=yo;function vo(t,e){return function(r){return t(e(r))}}var ue=vo,bo=ue,$o=bo(Object.keys,Object),mo=$o,So=gt,wo=mo,To=Object.prototype,Ao=To.hasOwnProperty;function Oo(t){if(!So(t))return wo(t);var e=[];for(var r in Object(t))Ao.call(t,r)&&r!="constructor"&&e.push(r);return e}var jo=Oo,Co=Ft,Eo=ct;function Po(t){return t!=null&&Eo(t.length)&&!Co(t)}var le=Po,Io=ce,Mo=jo,xo=le;function Do(t){return xo(t)?Io(t):Mo(t)}var _t=Do,zo=tt,Fo=_t;function Lo(t,e){return t&&zo(e,Fo(e),t)}var No=Lo;function Ro(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Go=Ro,Uo=U,Ho=gt,Bo=Go,Ko=Object.prototype,ko=Ko.hasOwnProperty;function qo(t){if(!Uo(t))return Bo(t);var e=Ho(t),r=[];for(var n in t)n=="constructor"&&(e||!ko.call(t,n))||r.push(n);return r}var Vo=qo,Wo=ce,Jo=Vo,Qo=le;function Yo(t){return Qo(t)?Wo(t,!0):Jo(t)}var dt=Yo,Xo=tt,Zo=dt;function tc(t,e){return t&&Xo(e,Zo(e),t)}var ec=tc,pt={exports:{}};(function(t,e){var r=T,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,s=a?r.Buffer:void 0,c=s?s.allocUnsafe:void 0;function u(o,l){if(l)return o.slice();var g=o.length,_=c?c(g):new o.constructor(g);return o.copy(_),_}t.exports=u})(pt,pt.exports);function rc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var nc=rc;function ic(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}var ac=ic;function sc(){return[]}var fe=sc,oc=ac,cc=fe,uc=Object.prototype,lc=uc.propertyIsEnumerable,ge=Object.getOwnPropertySymbols,fc=ge?function(t){return t==null?[]:(t=Object(t),oc(ge(t),function(e){return lc.call(t,e)}))}:cc,ht=fc,gc=tt,_c=ht;function dc(t,e){return gc(t,_c(t),e)}var pc=dc;function hc(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var _e=hc,yc=ue,vc=yc(Object.getPrototypeOf,Object),de=vc,bc=_e,$c=de,mc=ht,Sc=fe,wc=Object.getOwnPropertySymbols,Tc=wc?function(t){for(var e=[];t;)bc(e,mc(t)),t=$c(t);return e}:Sc,pe=Tc,Ac=tt,Oc=pe;function jc(t,e){return Ac(t,Oc(t),e)}var Cc=jc,Ec=_e,Pc=O;function Ic(t,e,r){var n=e(t);return Pc(t)?n:Ec(n,r(t))}var he=Ic,Mc=he,xc=ht,Dc=_t;function zc(t){return Mc(t,Dc,xc)}var Fc=zc,Lc=he,Nc=pe,Rc=dt;function Gc(t){return Lc(t,Rc,Nc)}var Uc=Gc,Hc=j,Bc=T,Kc=Hc(Bc,"DataView"),kc=Kc,qc=j,Vc=T,Wc=qc(Vc,"Promise"),Jc=Wc,Qc=j,Yc=T,Xc=Qc(Yc,"Set"),Zc=Xc,tu=j,eu=T,ru=tu(eu,"WeakMap"),nu=ru,yt=kc,vt=st,bt=Jc,$t=Zc,mt=nu,ye=G,z=Nt,ve="[object Map]",iu="[object Object]",be="[object Promise]",$e="[object Set]",me="[object WeakMap]",Se="[object DataView]",au=z(yt),su=z(vt),ou=z(bt),cu=z($t),uu=z(mt),C=ye;(yt&&C(new yt(new ArrayBuffer(1)))!=Se||vt&&C(new vt)!=ve||bt&&C(bt.resolve())!=be||$t&&C(new $t)!=$e||mt&&C(new mt)!=me)&&(C=function(t){var e=ye(t),r=e==iu?t.constructor:void 0,n=r?z(r):"";if(n)switch(n){case au:return Se;case su:return ve;case ou:return be;case cu:return $e;case uu:return me}return e});var St=C,lu=Object.prototype,fu=lu.hasOwnProperty;function gu(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&fu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var _u=gu,du=T,pu=du.Uint8Array,hu=pu,we=hu;function yu(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}var wt=yu,vu=wt;function bu(t,e){var r=e?vu(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var $u=bu,mu=/\w*$/;function Su(t){var e=new t.constructor(t.source,mu.exec(t));return e.lastIndex=t.lastIndex,e}var wu=Su,Te=W,Ae=Te?Te.prototype:void 0,Oe=Ae?Ae.valueOf:void 0;function Tu(t){return Oe?Object(Oe.call(t)):{}}var Au=Tu,Ou=wt;function ju(t,e){var r=e?Ou(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Cu=ju,Eu=wt,Pu=$u,Iu=wu,Mu=Au,xu=Cu,Du="[object Boolean]",zu="[object Date]",Fu="[object Map]",Lu="[object Number]",Nu="[object RegExp]",Ru="[object Set]",Gu="[object String]",Uu="[object Symbol]",Hu="[object ArrayBuffer]",Bu="[object DataView]",Ku="[object Float32Array]",ku="[object Float64Array]",qu="[object Int8Array]",Vu="[object Int16Array]",Wu="[object Int32Array]",Ju="[object Uint8Array]",Qu="[object Uint8ClampedArray]",Yu="[object Uint16Array]",Xu="[object Uint32Array]";function Zu(t,e,r){var n=t.constructor;switch(e){case Hu:return Eu(t);case Du:case zu:return new n(+t);case Bu:return Pu(t,r);case Ku:case ku:case qu:case Vu:case Wu:case Ju:case Qu:case Yu:case Xu:return xu(t,r);case Fu:return new n;case Lu:case Gu:return new n(t);case Nu:return Iu(t);case Ru:return new n;case Uu:return Mu(t)}}var tl=Zu,el=U,je=Object.create,rl=function(){function t(){}return function(e){if(!el(e))return{};if(je)return je(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),nl=rl,il=nl,al=de,sl=gt;function ol(t){return typeof t.constructor=="function"&&!sl(t)?il(al(t)):{}}var cl=ol,ul=St,ll=E,fl="[object Map]";function gl(t){return ll(t)&&ul(t)==fl}var _l=gl,dl=_l,pl=ft,Ce=B.exports,Ee=Ce&&Ce.isMap,hl=Ee?pl(Ee):dl,yl=hl,vl=St,bl=E,$l="[object Set]";function ml(t){return bl(t)&&vl(t)==$l}var Sl=ml,wl=Sl,Tl=ft,Pe=B.exports,Ie=Pe&&Pe.isSet,Al=Ie?Tl(Ie):wl,Ol=Al,jl=os,Cl=us,El=ae,Pl=No,Il=ec,Ml=pt.exports,xl=nc,Dl=pc,zl=Cc,Fl=Fc,Ll=Uc,Nl=St,Rl=_u,Gl=tl,Ul=cl,Hl=O,Bl=et.exports,Kl=yl,kl=U,ql=Ol,Vl=_t,Wl=dt,Jl=1,Ql=2,Yl=4,Me="[object Arguments]",Xl="[object Array]",Zl="[object Boolean]",tf="[object Date]",ef="[object Error]",xe="[object Function]",rf="[object GeneratorFunction]",nf="[object Map]",af="[object Number]",De="[object Object]",sf="[object RegExp]",of="[object Set]",cf="[object String]",uf="[object Symbol]",lf="[object WeakMap]",ff="[object ArrayBuffer]",gf="[object DataView]",_f="[object Float32Array]",df="[object Float64Array]",pf="[object Int8Array]",hf="[object Int16Array]",yf="[object Int32Array]",vf="[object Uint8Array]",bf="[object Uint8ClampedArray]",$f="[object Uint16Array]",mf="[object Uint32Array]",d={};d[Me]=d[Xl]=d[ff]=d[gf]=d[Zl]=d[tf]=d[_f]=d[df]=d[pf]=d[hf]=d[yf]=d[nf]=d[af]=d[De]=d[sf]=d[of]=d[cf]=d[uf]=d[vf]=d[bf]=d[$f]=d[mf]=!0,d[ef]=d[xe]=d[lf]=!1;function rt(t,e,r,n,i,a){var s,c=e&Jl,u=e&Ql,o=e&Yl;if(r&&(s=i?r(t,n,i,a):r(t)),s!==void 0)return s;if(!kl(t))return t;var l=Hl(t);if(l){if(s=Rl(t),!c)return xl(t,s)}else{var g=Nl(t),_=g==xe||g==rf;if(Bl(t))return Ml(t,c);if(g==De||g==Me||_&&!i){if(s=u||_?{}:Ul(t),!c)return u?zl(t,Il(s,t)):Dl(t,Pl(s,t))}else{if(!d[g])return i?t:{};s=Gl(t,g,c)}}a||(a=new jl);var m=a.get(t);if(m)return m;a.set(t,s),ql(t)?t.forEach(function(S){s.add(rt(S,e,r,S,t,a))}):Kl(t)&&t.forEach(function(S,w){s.set(w,rt(S,e,r,w,t,a))});var N=o?u?Ll:Fl:u?Wl:Vl,A=l?void 0:N(t);return Cl(A||t,function(S,w){A&&(w=S,S=t[w]),El(s,w,rt(S,e,r,w,t,a))}),s}var ze=rt,Sf=ze,wf=1,Tf=4;function Af(t){return Sf(t,wf|Tf)}var Tt=Af;class F{constructor(e=1,r=25){f(this,"page");f(this,"limit");f(this,"term");f(this,"filters");f(this,"ids");f(this,"queries");f(this,"associations");f(this,"postFilter");f(this,"sortings");f(this,"aggregations");f(this,"grouping");f(this,"fields");f(this,"groupFields");f(this,"totalCountMode");f(this,"includes");this.page=e,this.limit=r,this.term=null,this.filters=[],this.includes=null,this.ids=[],this.queries=[],this.associations=[],this.postFilter=[],this.sortings=[],this.aggregations=[],this.grouping=[],this.groupFields=[],this.fields=[],this.totalCountMode=1}static fromCriteria(e){return Tt(e)}parse(){const e={};return this.ids.length>0&&(e.ids=this.ids.join("|")),this.page!==null&&(e.page=this.page),this.limit!==null&&(e.limit=this.limit),this.term!==null&&(e.term=this.term),this.queries.length>0&&(e.query=this.queries),this.filters.length>0&&(e.filter=this.filters),this.postFilter.length>0&&(e["post-filter"]=this.postFilter),this.sortings.length>0&&(e.sort=this.sortings),this.aggregations.length>0&&(e.aggregations=this.aggregations),this.groupFields.length>0&&(e.groupFields=this.groupFields),this.grouping.length>0&&(e.grouping=this.grouping),this.fields.length>0&&(e.fields=this.fields),this.associations.length>0&&(e.associations={},this.associations.forEach(r=>{!e.associations||(e.associations[r.association]=r.criteria.parse())})),this.includes!==null&&(e.includes=this.includes),this.totalCountMode!==null&&(e["total-count-mode"]=this.totalCountMode),e}setIds(e){return this.ids=e,this}setTotalCountMode(e){return typeof e!="number"&&(this.totalCountMode=null),this.totalCountMode=e<0||e>2?null:e,this}setPage(e){return this.page=e,this}setLimit(e){return this.limit=e,this}setTerm(e){return this.term=e,this}addFilter(e){return this.filters.push(e),this}addIncludes(e){return Object.entries(e).forEach(([r,n])=>{this.includes===null&&(this.includes={}),this.includes[r]||(this.includes[r]=[]),this.includes[r].push(...n)}),this}addPostFilter(e){return this.postFilter.push(e),this}addSorting(e){return this.sortings.push(e),this}addQuery(e,r,n=null){const i={score:r,query:e};return n&&(i[n]=n),this.queries.push(i),this}addGroupField(e){return this.groupFields.push(e),this}addGrouping(e){return this.grouping.push(e),this}addFields(...e){return this.fields.push(...e),this}addAggregation(e){return this.aggregations.push(e),this}addAssociation(e){const r=e.split(".");let n=this;return r.forEach(i=>{n=n.getAssociation(i)}),this}getAssociation(e){const r=e.split(".");let n=this;return r.forEach(i=>{n.hasAssociation(i)||n.associations.push({association:i,criteria:new F(null,null)}),n=n.getAssociationCriteria(i)}),n}getAssociationCriteria(e){let r=null;return this.associations.forEach(n=>{n.association===e&&(r=n.criteria)}),r}getLimit(){var e;return(e=this.limit)!=null?e:0}getPage(){var e;return(e=this.page)!=null?e:0}getCriteriaData(){return{page:this.page,limit:this.limit,term:this.term,filters:this.filters,ids:this.ids,queries:this.queries,associations:this.associations,postFilter:this.postFilter,sortings:this.sortings,aggregations:this.aggregations,grouping:this.grouping,fields:this.fields,groupFields:this.groupFields,totalCountMode:this.totalCountMode,includes:this.includes}}hasAssociation(e){return this.associations.some(r=>r.association===e)}resetSorting(){this.sortings=[]}static avg(e,r){return{type:"avg",name:e,field:r}}static count(e,r){return{type:"count",name:e,field:r}}static max(e,r){return{type:"max",name:e,field:r}}static min(e,r){return{type:"min",name:e,field:r}}static stats(e,r){return{type:"stats",name:e,field:r}}static sum(e,r){return{type:"sum",name:e,field:r}}static terms(e,r,n=null,i=null,a=null){return{type:"terms",name:e,field:r,limit:n,sort:i,aggregation:a}}static filter(e,r,n){return{type:"filter",name:e,filter:r,aggregation:n}}static histogram(e,r,n,i,a,s){return{type:"histogram",name:e,field:r,interval:n,format:i,aggregation:a,timeZone:s}}static sort(e,r="ASC",n=!1){return{field:e,order:r,naturalSorting:n}}static naturalSorting(e,r="ASC"){return{field:e,order:r,naturalSorting:!0}}static contains(e,r){return{type:"contains",field:e,value:r}}static prefix(e,r){return{type:"prefix",field:e,value:r}}static suffix(e,r){return{type:"suffix",field:e,value:r}}static equalsAny(e,r){return{type:"equalsAny",field:e,value:r.join("|")}}static range(e,r){return{type:"range",field:e,parameters:r}}static equals(e,r){return{type:"equals",field:e,value:r}}static not(e,r=[]){return{type:"not",operator:e,queries:r}}static multi(e,r=[]){return{type:"multi",operator:e,queries:r}}}const Of=()=>({name:"criteria",serialize:({value:t,customizerMethod:e})=>{if(t instanceof F)return{__type__:"__Criteria__",data:e(t.getCriteriaData())}},deserialize:({value:t,customizerMethod:e})=>{if(H("__Criteria__",t)&&typeof t.data=="object"){const r=t.data,n=new F;return n.setPage(r.page),n.setLimit(r.limit),n.setTerm(r.term),r.filters.forEach(i=>{n.addFilter(i)}),n.setIds(r.ids),r.queries.forEach(({query:i,score:a})=>{n.addQuery(i,a)}),r.associations.forEach(i=>{n.associations.push(e(i))}),r.postFilter.forEach(i=>{n.addPostFilter(i)}),r.sortings.forEach(i=>{n.addSorting(i)}),r.aggregations.forEach(i=>{n.addAggregation(i)}),r.grouping.forEach(i=>{n.addGrouping(i)}),r.fields.forEach(i=>{n.addFields(i)}),r.groupFields.forEach(i=>{n.addGroupField(i)}),r.includes&&n.addIncludes(r.includes),n.setTotalCountMode(r.totalCountMode),n}}});let jf=(t,e,r)=>{t[e]=r};class Cf{constructor(e,r,n,i={}){f(this,"id");f(this,"_origin");f(this,"_entityName");f(this,"_draft");f(this,"_isDirty");f(this,"_isNew");var s,c;this.id=e,this._origin=i.originData?Tt(i.originData):Tt(n),this._entityName=r,this._draft=n,this._isDirty=(s=i.isDirty)!=null?s:!1,this._isNew=(c=i.isNew)!=null?c:!1;const a=this;return new Proxy(this._draft,{get(u,o){return o in a._draft?a._draft[o]:a[o]},set(u,o,l){return jf(a._draft,o,l),a._isDirty=!0,!0}})}markAsNew(){this._isNew=!0}isNew(){return this._isNew}getIsDirty(){return this._isDirty}getOrigin(){return this._origin}getDraft(){return this._draft}getEntityName(){return this._entityName}}const Fe=function(e,r,n,i){return new Cf(e,r,n,i)},Ef=()=>({name:"entity",serialize:({value:t,customizerMethod:e})=>{if(!(!Z(t)||typeof t.getDraft!="function"))return{__type__:"__Entity__",__id__:t.id,__entityName__:t._entityName,__isDirty__:t._isDirty,__isNew__:t._isNew,__origin__:e(t._origin),__draft__:e(t._draft)}},deserialize:({value:t,customizerMethod:e})=>{if(H("__Entity__",t)&&typeof t.__origin__=="object")return new Fe(t.__id__,t.__entityName__,e(t.__draft__),{originData:e(t.__origin__),isDirty:t.__isDirty__,isNew:t.__isNew__})}});class L extends Array{constructor(e,r,n,i=null,a=[],s=null,c=null){super();f(this,"entity");f(this,"source");f(this,"context");f(this,"criteria");f(this,"aggregations");f(this,"total");f(this,"first");f(this,"last");f(this,"remove");f(this,"has");f(this,"get");f(this,"getAt");f(this,"getIds");f(this,"add");f(this,"addAt");f(this,"moveItem");this.entity=r,this.source=e,this.context=n,this.criteria=i,this.aggregations=c,this.total=s,this.push(...a),this.first=function(){return this.length<=0?null:this[0]},this.last=function(){return this.length<=0?null:this[this.length-1]},this.remove=function(o){const l=this.findIndex(g=>g.id===o);return l<0?!1:(this.splice(l,1),!0)},this.has=function(o){return this.some(l=>l.id===o)},this.get=function(o){const l=this.find(g=>g.id===o);return typeof l!="undefined"?l:null},this.getAt=function(o){const l=this[o];return typeof l!="undefined"?l:null},this.getIds=function(){return this.map(o=>o.id)},this.add=function(o){this.push(o)},this.addAt=function(o,l){if(typeof l=="undefined"){this.add(o);return}this.splice(l,0,o)},this.moveItem=function(o,l=null){if(l===null&&(l=this.length),o<0||o>=this.length)return null;if(l===o)return this.getAt(o);const g=this.find((N,A)=>A===o);if(typeof g=="undefined")return null;const _=this.filter((N,A)=>A!==o),m=[..._.slice(0,l),g,..._.slice(l)];return this.splice(0,this.length,...m),g},this.filter=function(o,l){const g=Object.getPrototypeOf(this).filter.call(this,o,l);return new L(this.source,this.entity,this.context,this.criteria,g,this.total,this.aggregations)}}static fromCollection(e){return new L(e.source,e.entity,e.context,e.criteria===null?e.criteria:F.fromCriteria(e.criteria),e,e.total,e.aggregations)}}const Pf=()=>({name:"entity-collection",serialize:({value:t,customizerMethod:e})=>{if(t instanceof L)return e({__type__:"__EntityCollection__",__source__:t.source,__entityName__:t.entity,__context__:t.context,__criteria__:t.criteria,__entities__:Array.from(t),__total__:t.total,__aggregations__:t.aggregations})},deserialize:({value:t,customizerMethod:e})=>{if(H("__EntityCollection__",t))return new L(t.__source__,t.__entityName__,t.__context__,e(t.__criteria__),e(t.__entities__),t.__total__,t.__aggregations__)}});class K extends Error{constructor(e,r){super(e);f(this,"code",500);!r||(this.code=r)}toJSON(){return{__type__:"__HandleError__",__code__:this.code,__message__:this.message}}}const If=()=>({name:"handle-error",serialize:()=>{},deserialize:({value:t})=>{if(H("__HandleError__",t))return new K(t.__message__,t.__code__)}});var Mf=ze,xf=1,Df=4;function zf(t,e){return e=typeof e=="function"?e:void 0,Mf(t,xf|Df,e)}var Le=zf;const Ff=[Of,Pf,Ef,Ra,If,()=>({name:"handle-error",serialize:()=>{},deserialize:({value:t})=>{if(H("__MissingPrivilegesError__",t))return new x(t.__messageType__,t.__data__)}})];function Lf(t){const e=Ff.map(s=>s(t));function r(){return e}function n(s){var c;return(c=e.find(u=>u.name===s))!=null?c:null}function i(s){return Le(s,(c,u,o,l)=>{for(const g of e){const _=g.serialize({value:c,key:u,object:o,stack:l,customizerMethod:i});if(_)return _}})}function a(s,c){return Le(s,(u,o,l,g)=>{for(const _ of e){const m=_.deserialize({value:u,key:o,object:l,stack:g,event:c,customizerMethod:a});if(m)return m}})}return{getSerializers:r,getSerializerByName:n,serialize:i,deserialize:a}}function Nf(t,e){if(typeof e=="string")return new K(e);if(!(e instanceof Error))return new K("An unknown error occurred.");if(za(e,"response.data.errors.0.code")&&e.response.data.errors.length){const r=e.response.data.errors.filter(i=>i.code==="FRAMEWORK__MISSING_PRIVILEGE_ERROR"),n=[];return r.forEach(i=>{const a=JSON.parse(i.detail);n.push(...a.missingPrivileges)}),n.length?new x(t,n):new K(e.response.data.errors[0].code,e.response.data.errors[0].status)}return new K(e.message)}function Ne({serializedData:t,extensions:e,origin:r,type:n,privilegesToCheck:i=[]}){const a=re(e,r);if(!a)return null;const s=[];return Zt(t,(c,u,o)=>{if(u==="__type__"&&["__EntityCollection__","__Entity__"].includes(o)){const l=c.__entityName__;[...i].sort().forEach(g=>{const _=a.permissions[g];(!_||!_.includes(l))&&s.push(`${g}:${l}`)})}}),s.length>0?new x(n,s):null}const{serialize:At,deserialize:Re}=Lf({handleFactory:Rf,send:$}),Ot=new Set;function $(t,e,r,n){const i=Fa(t);if(i!==null){const _=new x(t,i);return Promise.reject(_)}const a=Xt(),s=e!=null?e:{},u=At({_type:t,_data:s,_callbackId:a}),o=JSON.stringify(u);let l=!1;const g=7e3;return new Promise((_,m)=>{const N=function(w){if(typeof w.data!="string")return;let V;try{V=JSON.parse(w.data)}catch{return}if(!Hf(V)||V._callbackId!==a||!V.hasOwnProperty("_response"))return;const Pg=Re(V,w);if(window.removeEventListener("message",N),!l){l=!0;const Ct=Pg._response;if(Ct instanceof Error){m(Ct);return}_(Ct)}};window.addEventListener("message",N);let A=!0;try{A=!window.parent.origin}catch{}let S=A?document.referrer:window.parent.origin;n&&(S=n),r?r.postMessage(o,S):window.parent.postMessage(o,S),setTimeout(()=>{l||m("Send timeout expired. It could be possible that no handler for the postMessage request exists or that the handler freezed.")},g)})}function k(t,e,r){const n=async function(i){var g;if(lt[t]&&Object.keys(lt[t]).length&&(!r||La(t,r,i.origin)!==null)||typeof i.data!="string")return;let a;try{a=JSON.parse(i.data)}catch{return}if(!Uf(a)||a._type!==t)return;const s=Re(a,i),c=await Promise.resolve((()=>{const _=Ne({serializedData:a,extensions:r,origin:i.origin,type:t,privilegesToCheck:["create","delete","update","read"]});return _||e(s._data,{_event_:i})})()).catch(_=>Nf(t,_)),u={_callbackId:s._callbackId,_type:s._type,_response:c!=null?c:null},o=(()=>{let _=At(u);const m=Ne({serializedData:_,extensions:r,origin:i.origin,privilegesToCheck:["read"],type:t});return m&&(_._response=m,_=At(_)),_})(),l=JSON.stringify(o);i.source?i.source.postMessage(l,{targetOrigin:(g=i.origin)!=null?g:"*"}):window.postMessage(l,window.origin)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function Rf(t){return(e,r)=>k(e,r,t)}function Gf(t,e){[...Ot].forEach(({source:r,origin:n})=>$(t,e,r,n).catch(()=>{}))}function jt(t,e){return k(t,e,{})}function v(t,e){return r=>$(t,Pt(Pt({},e),r))}function Ge(t){return(e,r)=>r?jt(t,i=>{i.id===r&&e(i)}):jt(t,e)}const nt=new Map;(async()=>{k("__registerWindow__",(t,e)=>{let r,n;e._event_.source?(r=e._event_.source,n=e._event_.origin):(r=window,n=window.origin),Ot.add({source:r,origin:n}),nt.forEach((i,a)=>{$("datasetQuery",{id:a,data:i},r,n).catch(()=>{})})},{}),k("datasetRegistration",t=>(nt.set(t.id,t.data),Gf("datasetQuery",t),{id:t.id,data:t.data}),{}),k("datasetQuery",t=>{var e;return(e=nt.get(t.id))!=null?e:null},{}),await $("__registerWindow__",{})})().catch(t=>console.error(t)),window._swsdk={sourceRegistry:Ot,datasets:nt};function Uf(t){const e=t;return!!e._type&&!!e._data&&!!e._callbackId}function Hf(t){const e=t;return!!e._type&&!!e.hasOwnProperty("_response")&&!!e._callbackId}const Bf=v("windowRedirect"),Kf=v("windowReload",{});var kf=Object.freeze(Object.defineProperty({__proto__:null,redirect:Bf,reload:Kf},Symbol.toStringTag,{value:"Module"}));const qf=v("notificationDispatch");var Vf=Object.freeze(Object.defineProperty({__proto__:null,dispatch:qf},Symbol.toStringTag,{value:"Module"}));const Wf=v("contextLanguage",{}),Jf=Ge("contextLanguage"),Qf=v("contextEnvironment",{}),Yf=v("contextLocale",{}),Xf=Ge("contextLocale"),Zf=v("contextCurrency",{}),tg=v("contextShopwareVersion",{}),eg=v("contextAppInformation",{});var rg=Object.freeze(Object.defineProperty({__proto__:null,getLanguage:Wf,subscribeLanguage:Jf,getEnvironment:Qf,getLocale:Yf,subscribeLocale:Xf,getCurrency:Zf,getShopwareVersion:tg,getAppInformation:eg},Symbol.toStringTag,{value:"Module"}));const ng=v("uiComponentSectionRenderer",{src:(Be=Da())!=null?Be:void 0});var ig=Object.freeze(Object.defineProperty({__proto__:null,add:ng},Symbol.toStringTag,{value:"Module"})),ag=t=>({addTabItem:v("uiTabsAddTabItem",{positionId:t})});const sg=t=>ut()===t,og=()=>window!==window.parent,Ue=t=>{if(t)return $("locationUpdateHeight",{height:t,locationId:ut()});const e=document.documentElement.offsetHeight;return $("locationUpdateHeight",{height:e,locationId:ut()})};let q=null;var cg=Object.freeze(Object.defineProperty({__proto__:null,is:sg,isIframe:og,updateHeight:Ue,startAutoResizer:()=>{q=new ResizeObserver(()=>{Ue()}),q.observe(document.body)},stopAutoResizer:()=>{q&&(q.unobserve(document.body),q.disconnect())},MAIN_HIDDEN:"sw-main-hidden"},Symbol.toStringTag,{value:"Module"}));const ug=v("menuItemAdd");var lg=Object.freeze(Object.defineProperty({__proto__:null,addMenuItem:ug},Symbol.toStringTag,{value:"Module"}));const fg=v("settingsItemAdd");var gg=Object.freeze(Object.defineProperty({__proto__:null,addSettingsItem:fg},Symbol.toStringTag,{value:"Module"}));const _g=v("mainModuleAdd");var dg=Object.freeze(Object.defineProperty({__proto__:null,addMainModule:_g},Symbol.toStringTag,{value:"Module"}));const pg=v("uiModalOpen"),hg=v("uiModalClose");var yg=Object.freeze(Object.defineProperty({__proto__:null,open:pg,close:hg},Symbol.toStringTag,{value:"Module"}));const vg=v("actionButtonAdd");var bg=Object.freeze(Object.defineProperty({__proto__:null,add:vg},Symbol.toStringTag,{value:"Module"}));const $g=v("actionExecute");var mg=Object.freeze(Object.defineProperty({__proto__:null,actionExecute:$g},Symbol.toStringTag,{value:"Module"})),Sg=t=>({search:(e,r)=>$("repositorySearch",{entityName:t,context:r,criteria:e}),get:(e,r,n)=>$("repositoryGet",{entityName:t,id:e,context:r,criteria:n}),save:(e,r)=>$("repositorySave",{entityName:t,entity:e,context:r}),clone:(e,r,n)=>$("repositoryClone",{entityName:t,entityId:e,context:r,behavior:n}),hasChanges:e=>$("repositoryHasChanges",{entityName:t,entity:e}),saveAll:(e,r)=>$("repositorySaveAll",{entityName:t,entities:e,context:r}),delete:(e,r)=>$("repositoryDelete",{entityName:t,entityId:e,context:r}),create:(e,r)=>$("repositoryCreate",{entityName:t,entityId:r,context:e})});function He(t){return(e,r)=>jt(t,i=>{if(i&&i.id===e){const a=r(i);a&&a.catch(()=>{})}})}const wg=He("datasetQuery"),Tg=v("datasetUpdate"),Ag=v("datasetRegistration"),Og=He("datasetUpdate");var jg=Object.freeze(Object.defineProperty({__proto__:null,get:wg,update:Tg,register:Ag,updateSubscriber:Og,repository:Sg,Classes:{Criteria:F,Entity:Fe,EntityCollection:L}},Symbol.toStringTag,{value:"Module"}));const Cg={webhook:mg},Eg={componentSection:ig,tabs:ag,menu:lg,settings:gg,mainModule:dg,modal:yg,actionButton:bg};y.app=Cg,y.context=rg,y.data=jg,y.location=cg,y.notification=Vf,y.ui=Eg,y.window=kf,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
var Pg=Object.defineProperty;var Ke=Object.getOwnPropertySymbols;var Mg=Object.prototype.hasOwnProperty,xg=Object.prototype.propertyIsEnumerable;var Et=(y,h,b)=>h in y?Pg(y,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[h]=b,Pt=(y,h)=>{for(var b in h||(h={}))Mg.call(h,b)&&Et(y,b,h[b]);if(Ke)for(var b of Ke(h))xg.call(h,b)&&Et(y,b,h[b]);return y};var g=(y,h,b)=>(Et(y,typeof h!="symbol"?h+"":h,b),b);(function(y,h){typeof exports=="object"&&typeof module!="undefined"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(y=typeof globalThis!="undefined"?globalThis:y||self,h(y.sw={}))})(this,function(y){var ke;"use strict";var h=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},b=Object.prototype,qe=b.hasOwnProperty;function Ve(t,e){return t!=null&&qe.call(t,e)}var We=Ve,Je=Array.isArray,O=Je,Qe=typeof h=="object"&&h&&h.Object===Object&&h,Mt=Qe,Ye=Mt,Xe=typeof self=="object"&&self&&self.Object===Object&&self,Ze=Ye||Xe||Function("return this")(),w=Ze,tr=w,er=tr.Symbol,J=er,xt=J,Dt=Object.prototype,rr=Dt.hasOwnProperty,nr=Dt.toString,R=xt?xt.toStringTag:void 0;function ir(t){var e=rr.call(t,R),r=t[R];try{t[R]=void 0;var n=!0}catch{}var i=nr.call(t);return n&&(e?t[R]=r:delete t[R]),i}var ar=ir,sr=Object.prototype,or=sr.toString;function cr(t){return or.call(t)}var ur=cr,zt=J,lr=ar,fr=ur,gr="[object Null]",_r="[object Undefined]",Ft=zt?zt.toStringTag:void 0;function dr(t){return t==null?t===void 0?_r:gr:Ft&&Ft in Object(t)?lr(t):fr(t)}var G=dr;function pr(t){return t!=null&&typeof t=="object"}var I=pr,hr=G,yr=I,vr="[object Symbol]";function br(t){return typeof t=="symbol"||yr(t)&&hr(t)==vr}var at=br,$r=O,mr=at,Sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wr=/^\w*$/;function Tr(t,e){if($r(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||mr(t)?!0:wr.test(t)||!Sr.test(t)||e!=null&&t in Object(e)}var Ar=Tr;function Or(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var U=Or,Cr=G,jr=U,Ir="[object AsyncFunction]",Er="[object Function]",Pr="[object GeneratorFunction]",Mr="[object Proxy]";function xr(t){if(!jr(t))return!1;var e=Cr(t);return e==Er||e==Pr||e==Ir||e==Mr}var Lt=xr,Dr=w,zr=Dr["__core-js_shared__"],Fr=zr,st=Fr,Nt=function(){var t=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Lr(t){return!!Nt&&Nt in t}var Nr=Lr,Rr=Function.prototype,Gr=Rr.toString;function Ur(t){if(t!=null){try{return Gr.call(t)}catch{}try{return t+""}catch{}}return""}var Rt=Ur,Hr=Lt,Br=Nr,kr=U,Kr=Rt,qr=/[\\^$.*+?()[\]{}|]/g,Vr=/^\[object .+?Constructor\]$/,Wr=Function.prototype,Jr=Object.prototype,Qr=Wr.toString,Yr=Jr.hasOwnProperty,Xr=RegExp("^"+Qr.call(Yr).replace(qr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zr(t){if(!kr(t)||Br(t))return!1;var e=Hr(t)?Xr:Vr;return e.test(Kr(t))}var tn=Zr;function en(t,e){return t==null?void 0:t[e]}var rn=en,nn=tn,an=rn;function sn(t,e){var r=an(t,e);return nn(r)?r:void 0}var C=sn,on=C,cn=on(Object,"create"),Q=cn,Gt=Q;function un(){this.__data__=Gt?Gt(null):{},this.size=0}var ln=un;function fn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var gn=fn,_n=Q,dn="__lodash_hash_undefined__",pn=Object.prototype,hn=pn.hasOwnProperty;function yn(t){var e=this.__data__;if(_n){var r=e[t];return r===dn?void 0:r}return hn.call(e,t)?e[t]:void 0}var vn=yn,bn=Q,$n=Object.prototype,mn=$n.hasOwnProperty;function Sn(t){var e=this.__data__;return bn?e[t]!==void 0:mn.call(e,t)}var wn=Sn,Tn=Q,An="__lodash_hash_undefined__";function On(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Tn&&e===void 0?An:e,this}var Cn=On,jn=ln,In=gn,En=vn,Pn=wn,Mn=Cn;function E(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}E.prototype.clear=jn,E.prototype.delete=In,E.prototype.get=En,E.prototype.has=Pn,E.prototype.set=Mn;var xn=E;function Dn(){this.__data__=[],this.size=0}var zn=Dn;function Fn(t,e){return t===e||t!==t&&e!==e}var Ut=Fn,Ln=Ut;function Nn(t,e){for(var r=t.length;r--;)if(Ln(t[r][0],e))return r;return-1}var Y=Nn,Rn=Y,Gn=Array.prototype,Un=Gn.splice;function Hn(t){var e=this.__data__,r=Rn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Un.call(e,r,1),--this.size,!0}var Bn=Hn,kn=Y;function Kn(t){var e=this.__data__,r=kn(e,t);return r<0?void 0:e[r][1]}var qn=Kn,Vn=Y;function Wn(t){return Vn(this.__data__,t)>-1}var Jn=Wn,Qn=Y;function Yn(t,e){var r=this.__data__,n=Qn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Xn=Yn,Zn=zn,ti=Bn,ei=qn,ri=Jn,ni=Xn;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}P.prototype.clear=Zn,P.prototype.delete=ti,P.prototype.get=ei,P.prototype.has=ri,P.prototype.set=ni;var X=P,ii=C,ai=w,si=ii(ai,"Map"),ot=si,Ht=xn,oi=X,ci=ot;function ui(){this.size=0,this.__data__={hash:new Ht,map:new(ci||oi),string:new Ht}}var li=ui;function fi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var gi=fi,_i=gi;function di(t,e){var r=t.__data__;return _i(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Z=di,pi=Z;function hi(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e}var yi=hi,vi=Z;function bi(t){return vi(this,t).get(t)}var $i=bi,mi=Z;function Si(t){return mi(this,t).has(t)}var wi=Si,Ti=Z;function Ai(t,e){var r=Ti(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Oi=Ai,Ci=li,ji=yi,Ii=$i,Ei=wi,Pi=Oi;function M(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}M.prototype.clear=Ci,M.prototype.delete=ji,M.prototype.get=Ii,M.prototype.has=Ei,M.prototype.set=Pi;var Bt=M,kt=Bt,Mi="Expected a function";function ct(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Mi);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(ct.Cache||kt),r}ct.Cache=kt;var xi=ct,Di=xi,zi=500;function Fi(t){var e=Di(t,function(n){return r.size===zi&&r.clear(),n}),r=e.cache;return e}var Li=Fi,Ni=Li,Ri=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gi=/\\(\\)?/g,Ui=Ni(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ri,function(r,n,i,a){e.push(i?a.replace(Gi,"$1"):n||r)}),e}),Hi=Ui;function Bi(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var ki=Bi,Kt=J,Ki=ki,qi=O,Vi=at,Wi=1/0,qt=Kt?Kt.prototype:void 0,Vt=qt?qt.toString:void 0;function Wt(t){if(typeof t=="string")return t;if(qi(t))return Ki(t,Wt)+"";if(Vi(t))return Vt?Vt.call(t):"";var e=t+"";return e=="0"&&1/t==-Wi?"-0":e}var Ji=Wt,Qi=Ji;function Yi(t){return t==null?"":Qi(t)}var Xi=Yi,Zi=O,ta=Ar,ea=Hi,ra=Xi;function na(t,e){return Zi(t)?t:ta(t,e)?[t]:ea(ra(t))}var ia=na,aa=G,sa=I,oa="[object Arguments]";function ca(t){return sa(t)&&aa(t)==oa}var ua=ca,Jt=ua,la=I,Qt=Object.prototype,fa=Qt.hasOwnProperty,ga=Qt.propertyIsEnumerable,_a=Jt(function(){return arguments}())?Jt:function(t){return la(t)&&fa.call(t,"callee")&&!ga.call(t,"callee")},Yt=_a,da=9007199254740991,pa=/^(?:0|[1-9]\d*)$/;function ha(t,e){var r=typeof t;return e=e==null?da:e,!!e&&(r=="number"||r!="symbol"&&pa.test(t))&&t>-1&&t%1==0&&t<e}var Xt=ha,ya=9007199254740991;function va(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ya}var ut=va,ba=at,$a=1/0;function ma(t){if(typeof t=="string"||ba(t))return t;var e=t+"";return e=="0"&&1/t==-$a?"-0":e}var Sa=ma,wa=ia,Ta=Yt,Aa=O,Oa=Xt,Ca=ut,ja=Sa;function Ia(t,e,r){e=wa(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=ja(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Ca(i)&&Oa(s,i)&&(Aa(t)||Ta(t)))}var Ea=Ia,Pa=We,Ma=Ea;function xa(t,e){return t!=null&&Ma(t,e,Pa)}var Da=xa;function Zt(){return String(Date.now().toString(36)+Math.random().toString(36).substr(2))}function tt(t){return t!==null&&typeof t=="object"}function lt(){return new URLSearchParams(window.location.search).get("location-id")}function za(){const t=window.location;return new URL(t.pathname,t.origin).toString()}function H(t,e){return tt(e)&&e.__type__&&e.__type__===t}function Fa(t,e){return Da(t,e)}function te(t,e){for(let r in t){const n=t[r];e.apply(this,[t,r,n]),tt(n)&&te(n,e)}}const ft={notificationDispatch:{},windowRedirect:{},windowReload:{},contextLanguage:{},contextEnvironment:{},contextLocale:{},contextCurrency:{},contextShopwareVersion:{},contextAppInformation:{},getPageTitle:{},uiComponentSectionRenderer:{},uiTabsAddTabItem:{},locationUpdateHeight:{},menuItemAdd:{},settingsItemAdd:{},mainModuleAdd:{},uiModalOpen:{},uiModalClose:{},actionButtonAdd:{},actionExecute:{},datasetRegistration:{},datasetQuery:{},datasetUpdate:{},__function__:{},__registerWindow__:{},_criteriaTest:{},_collectionTest:{},_multiply:{},_subtract:{},_privileges:{create:["user"],read:["user"],update:["user"],delete:["user"]}};function La(t){const e=ee(t),r=Ra(window.location);return!e||Object.keys(e).length<=0?null:re(e,r)}function Na(t,e){const r=ee(t),n=ne(e);return n?re(r,n.permissions):null}function ee(t){var e;return(e=ft[t])!=null?e:{}}function Ra(t){const r=new URLSearchParams(t.search).get("privileges");return r?JSON.parse(r):{}}function re(t,e){const r=Object.keys(t),n=[];return r.forEach(i=>{var a;(a=t[i])==null||a.forEach(s=>{var u;(u=e[i])!=null&&u.includes(s)||n.push(`${i}:${s}`)})}),n.length>=1?n:null}function ne(t){return Object.values(Ge).find(e=>e.baseUrl===t)}class x extends Error{constructor(e,r){super(`Your app is missing the privileges ${r.join(", ")} for action "${e}".`);g(this,"missingPrivileges");g(this,"messageType");this.missingPrivileges=r,this.messageType=e,Object.setPrototypeOf(this,x.prototype)}toJSON(){return{__type__:"__MissingPrivilegesError__",__messageType__:this.messageType,__data__:this.missingPrivileges}}}const Ga=({send:t,handle:e})=>{const r={};let n=!1;function i(){n||(n=!0,e("__function__",async({args:a,id:s})=>await Promise.resolve(r[s](...a))))}return{name:"function",serialize:({value:a})=>{if(typeof a=="function"){const s=Zt();return r[s]=a,i(),{__type__:"__function__",id:s,origin:window.origin}}},deserialize:({value:a,event:s})=>{var c;const u=(c=s==null?void 0:s.source)!=null?c:window;if(tt(a)&&a.__type__&&a.__type__==="__function__"&&typeof a.id=="string"){const o=a.id,l=a.origin;return(...f)=>t("__function__",{args:f,id:o},u,l)}}}};var Ua=X;function Ha(){this.__data__=new Ua,this.size=0}var Ba=Ha;function ka(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Ka=ka;function qa(t){return this.__data__.get(t)}var Va=qa;function Wa(t){return this.__data__.has(t)}var Ja=Wa,Qa=X,Ya=ot,Xa=Bt,Za=200;function ts(t,e){var r=this.__data__;if(r instanceof Qa){var n=r.__data__;if(!Ya||n.length<Za-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Xa(n)}return r.set(t,e),this.size=r.size,this}var es=ts,rs=X,ns=Ba,is=Ka,as=Va,ss=Ja,os=es;function D(t){var e=this.__data__=new rs(t);this.size=e.size}D.prototype.clear=ns,D.prototype.delete=is,D.prototype.get=as,D.prototype.has=ss,D.prototype.set=os;var cs=D;function us(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var ls=us,fs=C,gs=function(){try{var t=fs(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_s=gs,ie=_s;function ds(t,e,r){e=="__proto__"&&ie?ie(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ae=ds,ps=ae,hs=Ut,ys=Object.prototype,vs=ys.hasOwnProperty;function bs(t,e,r){var n=t[e];(!(vs.call(t,e)&&hs(n,r))||r===void 0&&!(e in t))&&ps(t,e,r)}var se=bs,$s=se,ms=ae;function Ss(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var u=e[a],c=n?n(r[u],t[u],u,r,t):void 0;c===void 0&&(c=t[u]),i?ms(r,u,c):$s(r,u,c)}return r}var et=Ss;function ws(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ts=ws,rt={exports:{}};function As(){return!1}var Os=As;(function(t,e){var r=w,n=Os,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,s=a&&a.exports===i,u=s?r.Buffer:void 0,c=u?u.isBuffer:void 0,o=c||n;t.exports=o})(rt,rt.exports);var Cs=G,js=ut,Is=I,Es="[object Arguments]",Ps="[object Array]",Ms="[object Boolean]",xs="[object Date]",Ds="[object Error]",zs="[object Function]",Fs="[object Map]",Ls="[object Number]",Ns="[object Object]",Rs="[object RegExp]",Gs="[object Set]",Us="[object String]",Hs="[object WeakMap]",Bs="[object ArrayBuffer]",ks="[object DataView]",Ks="[object Float32Array]",qs="[object Float64Array]",Vs="[object Int8Array]",Ws="[object Int16Array]",Js="[object Int32Array]",Qs="[object Uint8Array]",Ys="[object Uint8ClampedArray]",Xs="[object Uint16Array]",Zs="[object Uint32Array]",d={};d[Ks]=d[qs]=d[Vs]=d[Ws]=d[Js]=d[Qs]=d[Ys]=d[Xs]=d[Zs]=!0,d[Es]=d[Ps]=d[Bs]=d[Ms]=d[ks]=d[xs]=d[Ds]=d[zs]=d[Fs]=d[Ls]=d[Ns]=d[Rs]=d[Gs]=d[Us]=d[Hs]=!1;function to(t){return Is(t)&&js(t.length)&&!!d[Cs(t)]}var eo=to;function ro(t){return function(e){return t(e)}}var gt=ro,B={exports:{}};(function(t,e){var r=Mt,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,s=a&&r.process,u=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=u})(B,B.exports);var no=eo,io=gt,oe=B.exports,ce=oe&&oe.isTypedArray,ao=ce?io(ce):no,so=ao,oo=Ts,co=Yt,uo=O,lo=rt.exports,fo=Xt,go=so,_o=Object.prototype,po=_o.hasOwnProperty;function ho(t,e){var r=uo(t),n=!r&&co(t),i=!r&&!n&&lo(t),a=!r&&!n&&!i&&go(t),s=r||n||i||a,u=s?oo(t.length,String):[],c=u.length;for(var o in t)(e||po.call(t,o))&&!(s&&(o=="length"||i&&(o=="offset"||o=="parent")||a&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||fo(o,c)))&&u.push(o);return u}var ue=ho,yo=Object.prototype;function vo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||yo;return t===r}var _t=vo;function bo(t,e){return function(r){return t(e(r))}}var le=bo,$o=le,mo=$o(Object.keys,Object),So=mo,wo=_t,To=So,Ao=Object.prototype,Oo=Ao.hasOwnProperty;function Co(t){if(!wo(t))return To(t);var e=[];for(var r in Object(t))Oo.call(t,r)&&r!="constructor"&&e.push(r);return e}var jo=Co,Io=Lt,Eo=ut;function Po(t){return t!=null&&Eo(t.length)&&!Io(t)}var fe=Po,Mo=ue,xo=jo,Do=fe;function zo(t){return Do(t)?Mo(t):xo(t)}var dt=zo,Fo=et,Lo=dt;function No(t,e){return t&&Fo(e,Lo(e),t)}var Ro=No;function Go(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Uo=Go,Ho=U,Bo=_t,ko=Uo,Ko=Object.prototype,qo=Ko.hasOwnProperty;function Vo(t){if(!Ho(t))return ko(t);var e=Bo(t),r=[];for(var n in t)n=="constructor"&&(e||!qo.call(t,n))||r.push(n);return r}var Wo=Vo,Jo=ue,Qo=Wo,Yo=fe;function Xo(t){return Yo(t)?Jo(t,!0):Qo(t)}var pt=Xo,Zo=et,tc=pt;function ec(t,e){return t&&Zo(e,tc(e),t)}var rc=ec,ht={exports:{}};(function(t,e){var r=w,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,s=a?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function c(o,l){if(l)return o.slice();var f=o.length,p=u?u(f):new o.constructor(f);return o.copy(p),p}t.exports=c})(ht,ht.exports);function nc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ic=nc;function ac(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}var sc=ac;function oc(){return[]}var ge=oc,cc=sc,uc=ge,lc=Object.prototype,fc=lc.propertyIsEnumerable,_e=Object.getOwnPropertySymbols,gc=_e?function(t){return t==null?[]:(t=Object(t),cc(_e(t),function(e){return fc.call(t,e)}))}:uc,yt=gc,_c=et,dc=yt;function pc(t,e){return _c(t,dc(t),e)}var hc=pc;function yc(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var de=yc,vc=le,bc=vc(Object.getPrototypeOf,Object),pe=bc,$c=de,mc=pe,Sc=yt,wc=ge,Tc=Object.getOwnPropertySymbols,Ac=Tc?function(t){for(var e=[];t;)$c(e,Sc(t)),t=mc(t);return e}:wc,he=Ac,Oc=et,Cc=he;function jc(t,e){return Oc(t,Cc(t),e)}var Ic=jc,Ec=de,Pc=O;function Mc(t,e,r){var n=e(t);return Pc(t)?n:Ec(n,r(t))}var ye=Mc,xc=ye,Dc=yt,zc=dt;function Fc(t){return xc(t,zc,Dc)}var Lc=Fc,Nc=ye,Rc=he,Gc=pt;function Uc(t){return Nc(t,Gc,Rc)}var Hc=Uc,Bc=C,kc=w,Kc=Bc(kc,"DataView"),qc=Kc,Vc=C,Wc=w,Jc=Vc(Wc,"Promise"),Qc=Jc,Yc=C,Xc=w,Zc=Yc(Xc,"Set"),tu=Zc,eu=C,ru=w,nu=eu(ru,"WeakMap"),iu=nu,vt=qc,bt=ot,$t=Qc,mt=tu,St=iu,ve=G,z=Rt,be="[object Map]",au="[object Object]",$e="[object Promise]",me="[object Set]",Se="[object WeakMap]",we="[object DataView]",su=z(vt),ou=z(bt),cu=z($t),uu=z(mt),lu=z(St),j=ve;(vt&&j(new vt(new ArrayBuffer(1)))!=we||bt&&j(new bt)!=be||$t&&j($t.resolve())!=$e||mt&&j(new mt)!=me||St&&j(new St)!=Se)&&(j=function(t){var e=ve(t),r=e==au?t.constructor:void 0,n=r?z(r):"";if(n)switch(n){case su:return we;case ou:return be;case cu:return $e;case uu:return me;case lu:return Se}return e});var wt=j,fu=Object.prototype,gu=fu.hasOwnProperty;function _u(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&gu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var du=_u,pu=w,hu=pu.Uint8Array,yu=hu,Te=yu;function vu(t){var e=new t.constructor(t.byteLength);return new Te(e).set(new Te(t)),e}var Tt=vu,bu=Tt;function $u(t,e){var r=e?bu(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var mu=$u,Su=/\w*$/;function wu(t){var e=new t.constructor(t.source,Su.exec(t));return e.lastIndex=t.lastIndex,e}var Tu=wu,Ae=J,Oe=Ae?Ae.prototype:void 0,Ce=Oe?Oe.valueOf:void 0;function Au(t){return Ce?Object(Ce.call(t)):{}}var Ou=Au,Cu=Tt;function ju(t,e){var r=e?Cu(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Iu=ju,Eu=Tt,Pu=mu,Mu=Tu,xu=Ou,Du=Iu,zu="[object Boolean]",Fu="[object Date]",Lu="[object Map]",Nu="[object Number]",Ru="[object RegExp]",Gu="[object Set]",Uu="[object String]",Hu="[object Symbol]",Bu="[object ArrayBuffer]",ku="[object DataView]",Ku="[object Float32Array]",qu="[object Float64Array]",Vu="[object Int8Array]",Wu="[object Int16Array]",Ju="[object Int32Array]",Qu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Xu="[object Uint16Array]",Zu="[object Uint32Array]";function tl(t,e,r){var n=t.constructor;switch(e){case Bu:return Eu(t);case zu:case Fu:return new n(+t);case ku:return Pu(t,r);case Ku:case qu:case Vu:case Wu:case Ju:case Qu:case Yu:case Xu:case Zu:return Du(t,r);case Lu:return new n;case Nu:case Uu:return new n(t);case Ru:return Mu(t);case Gu:return new n;case Hu:return xu(t)}}var el=tl,rl=U,je=Object.create,nl=function(){function t(){}return function(e){if(!rl(e))return{};if(je)return je(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),il=nl,al=il,sl=pe,ol=_t;function cl(t){return typeof t.constructor=="function"&&!ol(t)?al(sl(t)):{}}var ul=cl,ll=wt,fl=I,gl="[object Map]";function _l(t){return fl(t)&&ll(t)==gl}var dl=_l,pl=dl,hl=gt,Ie=B.exports,Ee=Ie&&Ie.isMap,yl=Ee?hl(Ee):pl,vl=yl,bl=wt,$l=I,ml="[object Set]";function Sl(t){return $l(t)&&bl(t)==ml}var wl=Sl,Tl=wl,Al=gt,Pe=B.exports,Me=Pe&&Pe.isSet,Ol=Me?Al(Me):Tl,Cl=Ol,jl=cs,Il=ls,El=se,Pl=Ro,Ml=rc,xl=ht.exports,Dl=ic,zl=hc,Fl=Ic,Ll=Lc,Nl=Hc,Rl=wt,Gl=du,Ul=el,Hl=ul,Bl=O,kl=rt.exports,Kl=vl,ql=U,Vl=Cl,Wl=dt,Jl=pt,Ql=1,Yl=2,Xl=4,xe="[object Arguments]",Zl="[object Array]",tf="[object Boolean]",ef="[object Date]",rf="[object Error]",De="[object Function]",nf="[object GeneratorFunction]",af="[object Map]",sf="[object Number]",ze="[object Object]",of="[object RegExp]",cf="[object Set]",uf="[object String]",lf="[object Symbol]",ff="[object WeakMap]",gf="[object ArrayBuffer]",_f="[object DataView]",df="[object Float32Array]",pf="[object Float64Array]",hf="[object Int8Array]",yf="[object Int16Array]",vf="[object Int32Array]",bf="[object Uint8Array]",$f="[object Uint8ClampedArray]",mf="[object Uint16Array]",Sf="[object Uint32Array]",_={};_[xe]=_[Zl]=_[gf]=_[_f]=_[tf]=_[ef]=_[df]=_[pf]=_[hf]=_[yf]=_[vf]=_[af]=_[sf]=_[ze]=_[of]=_[cf]=_[uf]=_[lf]=_[bf]=_[$f]=_[mf]=_[Sf]=!0,_[rf]=_[De]=_[ff]=!1;function nt(t,e,r,n,i,a){var s,u=e&Ql,c=e&Yl,o=e&Xl;if(r&&(s=i?r(t,n,i,a):r(t)),s!==void 0)return s;if(!ql(t))return t;var l=Bl(t);if(l){if(s=Gl(t),!u)return Dl(t,s)}else{var f=Rl(t),p=f==De||f==nf;if(kl(t))return xl(t,u);if(f==ze||f==xe||p&&!i){if(s=c||p?{}:Hl(t),!u)return c?Fl(t,Ml(s,t)):zl(t,Pl(s,t))}else{if(!_[f])return i?t:{};s=Ul(t,f,u)}}a||(a=new jl);var T=a.get(t);if(T)return T;a.set(t,s),Vl(t)?t.forEach(function(m){s.add(nt(m,e,r,m,t,a))}):Kl(t)&&t.forEach(function(m,S){s.set(S,nt(m,e,r,S,t,a))});var N=o?c?Nl:Ll:c?Jl:Wl,A=l?void 0:N(t);return Il(A||t,function(m,S){A&&(S=m,m=t[S]),El(s,S,nt(m,e,r,S,t,a))}),s}var Fe=nt,wf=Fe,Tf=1,Af=4;function Of(t){return wf(t,Tf|Af)}var At=Of;class F{constructor(e=1,r=25){g(this,"page");g(this,"limit");g(this,"term");g(this,"filters");g(this,"ids");g(this,"queries");g(this,"associations");g(this,"postFilter");g(this,"sortings");g(this,"aggregations");g(this,"grouping");g(this,"fields");g(this,"groupFields");g(this,"totalCountMode");g(this,"includes");this.page=e,this.limit=r,this.term=null,this.filters=[],this.includes=null,this.ids=[],this.queries=[],this.associations=[],this.postFilter=[],this.sortings=[],this.aggregations=[],this.grouping=[],this.groupFields=[],this.fields=[],this.totalCountMode=1}static fromCriteria(e){return At(e)}parse(){const e={};return this.ids.length>0&&(e.ids=this.ids.join("|")),this.page!==null&&(e.page=this.page),this.limit!==null&&(e.limit=this.limit),this.term!==null&&(e.term=this.term),this.queries.length>0&&(e.query=this.queries),this.filters.length>0&&(e.filter=this.filters),this.postFilter.length>0&&(e["post-filter"]=this.postFilter),this.sortings.length>0&&(e.sort=this.sortings),this.aggregations.length>0&&(e.aggregations=this.aggregations),this.groupFields.length>0&&(e.groupFields=this.groupFields),this.grouping.length>0&&(e.grouping=this.grouping),this.fields.length>0&&(e.fields=this.fields),this.associations.length>0&&(e.associations={},this.associations.forEach(r=>{!e.associations||(e.associations[r.association]=r.criteria.parse())})),this.includes!==null&&(e.includes=this.includes),this.totalCountMode!==null&&(e["total-count-mode"]=this.totalCountMode),e}setIds(e){return this.ids=e,this}setTotalCountMode(e){return typeof e!="number"&&(this.totalCountMode=null),this.totalCountMode=e<0||e>2?null:e,this}setPage(e){return this.page=e,this}setLimit(e){return this.limit=e,this}setTerm(e){return this.term=e,this}addFilter(e){return this.filters.push(e),this}addIncludes(e){return Object.entries(e).forEach(([r,n])=>{this.includes===null&&(this.includes={}),this.includes[r]||(this.includes[r]=[]),this.includes[r].push(...n)}),this}addPostFilter(e){return this.postFilter.push(e),this}addSorting(e){return this.sortings.push(e),this}addQuery(e,r,n=null){const i={score:r,query:e};return n&&(i[n]=n),this.queries.push(i),this}addGroupField(e){return this.groupFields.push(e),this}addGrouping(e){return this.grouping.push(e),this}addFields(...e){return this.fields.push(...e),this}addAggregation(e){return this.aggregations.push(e),this}addAssociation(e){const r=e.split(".");let n=this;return r.forEach(i=>{n=n.getAssociation(i)}),this}getAssociation(e){const r=e.split(".");let n=this;return r.forEach(i=>{n.hasAssociation(i)||n.associations.push({association:i,criteria:new F(null,null)}),n=n.getAssociationCriteria(i)}),n}getAssociationCriteria(e){let r=null;return this.associations.forEach(n=>{n.association===e&&(r=n.criteria)}),r}getLimit(){var e;return(e=this.limit)!=null?e:0}getPage(){var e;return(e=this.page)!=null?e:0}getCriteriaData(){return{page:this.page,limit:this.limit,term:this.term,filters:this.filters,ids:this.ids,queries:this.queries,associations:this.associations,postFilter:this.postFilter,sortings:this.sortings,aggregations:this.aggregations,grouping:this.grouping,fields:this.fields,groupFields:this.groupFields,totalCountMode:this.totalCountMode,includes:this.includes}}hasAssociation(e){return this.associations.some(r=>r.association===e)}resetSorting(){this.sortings=[]}static avg(e,r){return{type:"avg",name:e,field:r}}static count(e,r){return{type:"count",name:e,field:r}}static max(e,r){return{type:"max",name:e,field:r}}static min(e,r){return{type:"min",name:e,field:r}}static stats(e,r){return{type:"stats",name:e,field:r}}static sum(e,r){return{type:"sum",name:e,field:r}}static terms(e,r,n=null,i=null,a=null){return{type:"terms",name:e,field:r,limit:n,sort:i,aggregation:a}}static filter(e,r,n){return{type:"filter",name:e,filter:r,aggregation:n}}static histogram(e,r,n,i,a,s){return{type:"histogram",name:e,field:r,interval:n,format:i,aggregation:a,timeZone:s}}static sort(e,r="ASC",n=!1){return{field:e,order:r,naturalSorting:n}}static naturalSorting(e,r="ASC"){return{field:e,order:r,naturalSorting:!0}}static contains(e,r){return{type:"contains",field:e,value:r}}static prefix(e,r){return{type:"prefix",field:e,value:r}}static suffix(e,r){return{type:"suffix",field:e,value:r}}static equalsAny(e,r){return{type:"equalsAny",field:e,value:r.join("|")}}static range(e,r){return{type:"range",field:e,parameters:r}}static equals(e,r){return{type:"equals",field:e,value:r}}static not(e,r=[]){return{type:"not",operator:e,queries:r}}static multi(e,r=[]){return{type:"multi",operator:e,queries:r}}}const Cf=()=>({name:"criteria",serialize:({value:t,customizerMethod:e})=>{if(t instanceof F)return{__type__:"__Criteria__",data:e(t.getCriteriaData())}},deserialize:({value:t,customizerMethod:e})=>{if(H("__Criteria__",t)&&typeof t.data=="object"){const r=t.data,n=new F;return n.setPage(r.page),n.setLimit(r.limit),n.setTerm(r.term),r.filters.forEach(i=>{n.addFilter(i)}),n.setIds(r.ids),r.queries.forEach(({query:i,score:a})=>{n.addQuery(i,a)}),r.associations.forEach(i=>{n.associations.push(e(i))}),r.postFilter.forEach(i=>{n.addPostFilter(i)}),r.sortings.forEach(i=>{n.addSorting(i)}),r.aggregations.forEach(i=>{n.addAggregation(i)}),r.grouping.forEach(i=>{n.addGrouping(i)}),r.fields.forEach(i=>{n.addFields(i)}),r.groupFields.forEach(i=>{n.addGroupField(i)}),r.includes&&n.addIncludes(r.includes),n.setTotalCountMode(r.totalCountMode),n}}});let jf=(t,e,r)=>{t[e]=r};class If{constructor(e,r,n,i={}){g(this,"id");g(this,"_origin");g(this,"_entityName");g(this,"_draft");g(this,"_isDirty");g(this,"_isNew");var s,u;this.id=e,this._origin=i.originData?At(i.originData):At(n),this._entityName=r,this._draft=n,this._isDirty=(s=i.isDirty)!=null?s:!1,this._isNew=(u=i.isNew)!=null?u:!1;const a=this;return new Proxy(this._draft,{get(c,o){return o in a._draft?a._draft[o]:a[o]},set(c,o,l){return jf(a._draft,o,l),a._isDirty=!0,!0}})}markAsNew(){this._isNew=!0}isNew(){return this._isNew}getIsDirty(){return this._isDirty}getOrigin(){return this._origin}getDraft(){return this._draft}getEntityName(){return this._entityName}}const Le=function(e,r,n,i){return new If(e,r,n,i)},Ef=()=>({name:"entity",serialize:({value:t,customizerMethod:e})=>{if(!(!tt(t)||typeof t.getDraft!="function"))return{__type__:"__Entity__",__id__:t.id,__entityName__:t._entityName,__isDirty__:t._isDirty,__isNew__:t._isNew,__origin__:e(t._origin),__draft__:e(t._draft)}},deserialize:({value:t,customizerMethod:e})=>{if(H("__Entity__",t)&&typeof t.__origin__=="object")return new Le(t.__id__,t.__entityName__,e(t.__draft__),{originData:e(t.__origin__),isDirty:t.__isDirty__,isNew:t.__isNew__})}});class L extends Array{constructor(e,r,n,i=null,a=[],s=null,u=null){super();g(this,"entity");g(this,"source");g(this,"context");g(this,"criteria");g(this,"aggregations");g(this,"total");g(this,"first");g(this,"last");g(this,"remove");g(this,"has");g(this,"get");g(this,"getAt");g(this,"getIds");g(this,"add");g(this,"addAt");g(this,"moveItem");this.entity=r,this.source=e,this.context=n,this.criteria=i,this.aggregations=u,this.total=s,this.push(...a),this.first=function(){return this.length<=0?null:this[0]},this.last=function(){return this.length<=0?null:this[this.length-1]},this.remove=function(o){const l=this.findIndex(f=>f.id===o);return l<0?!1:(this.splice(l,1),!0)},this.has=function(o){return this.some(l=>l.id===o)},this.get=function(o){const l=this.find(f=>f.id===o);return typeof l!="undefined"?l:null},this.getAt=function(o){const l=this[o];return typeof l!="undefined"?l:null},this.getIds=function(){return this.map(o=>o.id)},this.add=function(o){this.push(o)},this.addAt=function(o,l){if(typeof l=="undefined"){this.add(o);return}this.splice(l,0,o)},this.moveItem=function(o,l=null){if(l===null&&(l=this.length),o<0||o>=this.length)return null;if(l===o)return this.getAt(o);const f=this.find((N,A)=>A===o);if(typeof f=="undefined")return null;const p=this.filter((N,A)=>A!==o),T=[...p.slice(0,l),f,...p.slice(l)];return this.splice(0,this.length,...T),f},this.filter=function(o,l){const f=Object.getPrototypeOf(this).filter.call(this,o,l);return new L(this.source,this.entity,this.context,this.criteria,f,this.total,this.aggregations)}}static fromCollection(e){return new L(e.source,e.entity,e.context,e.criteria===null?e.criteria:F.fromCriteria(e.criteria),e,e.total,e.aggregations)}}const Pf=()=>({name:"entity-collection",serialize:({value:t,customizerMethod:e})=>{if(t instanceof L)return e({__type__:"__EntityCollection__",__source__:t.source,__entityName__:t.entity,__context__:t.context,__criteria__:t.criteria,__entities__:Array.from(t),__total__:t.total,__aggregations__:t.aggregations})},deserialize:({value:t,customizerMethod:e})=>{if(H("__EntityCollection__",t))return new L(t.__source__,t.__entityName__,t.__context__,e(t.__criteria__),e(t.__entities__),t.__total__,t.__aggregations__)}});class k extends Error{constructor(e,r){super(e);g(this,"code",500);!r||(this.code=r)}toJSON(){return{__type__:"__HandleError__",__code__:this.code,__message__:this.message}}}const Mf=()=>({name:"handle-error",serialize:()=>{},deserialize:({value:t})=>{if(H("__HandleError__",t))return new k(t.__message__,t.__code__)}});var xf=Fe,Df=1,zf=4;function Ff(t,e){return e=typeof e=="function"?e:void 0,xf(t,Df|zf,e)}var Ne=Ff;const Lf=[Cf,Pf,Ef,Ga,Mf,()=>({name:"handle-error",serialize:()=>{},deserialize:({value:t})=>{if(H("__MissingPrivilegesError__",t))return new x(t.__messageType__,t.__data__)}})];function Nf(t){const e=Lf.map(s=>s(t));function r(){return e}function n(s){var u;return(u=e.find(c=>c.name===s))!=null?u:null}function i(s){return Ne(s,(u,c,o,l)=>{for(const f of e){const p=f.serialize({value:u,key:c,object:o,stack:l,customizerMethod:i});if(p)return p}})}function a(s,u){return Ne(s,(c,o,l,f)=>{for(const p of e){const T=p.deserialize({value:c,key:o,object:l,stack:f,event:u,customizerMethod:a});if(T)return T}})}return{getSerializers:r,getSerializerByName:n,serialize:i,deserialize:a}}function Rf(t,e){if(typeof e=="string")return new k(e);if(!(e instanceof Error))return new k("An unknown error occurred.");if(Fa(e,"response.data.errors.0.code")&&e.response.data.errors.length){const r=e.response.data.errors.filter(i=>i.code==="FRAMEWORK__MISSING_PRIVILEGE_ERROR"),n=[];return r.forEach(i=>{const a=JSON.parse(i.detail);n.push(...a.missingPrivileges)}),n.length?new x(t,n):new k(e.response.data.errors[0].code,e.response.data.errors[0].status)}return new k(e.message)}function Ot({serializedData:t,origin:e,type:r,privilegesToCheck:n=[]}){const i=ne(e);if(!i)return null;const a=[];return te(t,(s,u,c)=>{if(u==="__type__"&&["__EntityCollection__","__Entity__"].includes(c)){const o=s.__entityName__;[...n].sort().forEach(l=>{const f=i.permissions[l];(!f||!f.includes(o))&&a.push(`${l}:${o}`)})}}),a.length>0?new x(r,a):null}const{serialize:K,deserialize:Re}=Nf({handle:q,send:$});let Ge={};const Ct=new Set;function $(t,e,r,n){const i=La(t);if(i!==null){const p=new x(t,i);return Promise.reject(p)}const a=Zt(),s=e!=null?e:{};let c=K({_type:t,_data:s,_callbackId:a});if(n){const p=Ot({serializedData:c,origin:n,privilegesToCheck:["read"],type:t});p&&(["datasetQuery","datasetUpdate","datasetRegistration"].includes(c._type)?c=K({_type:c._type,_callbackId:c._callbackId,_data:{id:c._data.id,data:p}}):c=K({_type:c._type,_callbackId:c._callbackId,_data:p}))}const o=JSON.stringify(c);let l=!1;const f=7e3;return new Promise((p,T)=>{const N=function(S){if(typeof S.data!="string")return;let W;try{W=JSON.parse(S.data)}catch{return}if(!Hf(W)||W._callbackId!==a||!W.hasOwnProperty("_response"))return;const Eg=Re(W,S);if(window.removeEventListener("message",N),!l){l=!0;const It=Eg._response;if(It instanceof Error){T(It);return}p(It)}};window.addEventListener("message",N);let A=!0;try{A=!window.parent.origin}catch{}let m=A?document.referrer:window.parent.origin;n&&(m=n),r?r.postMessage(o,m):window.parent.postMessage(o,m),setTimeout(()=>{l||T("Send timeout expired. It could be possible that no handler for the postMessage request exists or that the handler freezed.")},f)})}function q(t,e){const r=async function(n){var l;if(ft[t]&&Object.keys(ft[t]).length&&(!Ge||Na(t,n.origin)!==null)||typeof n.data!="string")return;let i;try{i=JSON.parse(n.data)}catch{return}if(!Uf(i)||i._type!==t)return;const a=Re(i,n),s=await Promise.resolve((()=>{const f=Ot({serializedData:i,origin:n.origin,type:t,privilegesToCheck:["create","delete","update","read"]});return f||e(a._data,{_event_:n})})()).catch(f=>Rf(t,f)),u={_callbackId:a._callbackId,_type:a._type,_response:s!=null?s:null},c=(()=>{let f=K(u);const p=Ot({serializedData:f,origin:n.origin,privilegesToCheck:["read"],type:t});return p&&(f._response=p,f=K(f)),f})(),o=JSON.stringify(c);n.source?n.source.postMessage(o,{targetOrigin:(l=n.origin)!=null?l:"*"}):window.postMessage(o,window.origin)};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)}function Gf(t,e){[...Ct].forEach(({source:r,origin:n})=>$(t,e,r,n).catch(()=>{}))}function jt(t,e){return q(t,e)}function v(t,e){return r=>$(t,Pt(Pt({},e),r))}function Ue(t){return(e,r)=>r?jt(t,i=>{i.id===r&&e(i)}):jt(t,e)}const it=new Map;(async()=>{q("__registerWindow__",(t,e)=>{let r,n;e._event_.source?(r=e._event_.source,n=e._event_.origin):(r=window,n=window.origin),Ct.add({source:r,origin:n}),it.forEach((i,a)=>{$("datasetQuery",{id:a,data:i},r,n).catch(()=>{})})}),q("datasetRegistration",t=>(it.set(t.id,t.data),Gf("datasetQuery",t),{id:t.id,data:t.data})),q("datasetQuery",t=>{var e;return(e=it.get(t.id))!=null?e:null}),await $("__registerWindow__",{})})().catch(t=>console.error(t)),window._swsdk={sourceRegistry:Ct,datasets:it};function Uf(t){const e=t;return!!e._type&&!!e._data&&!!e._callbackId}function Hf(t){const e=t;return!!e._type&&!!e.hasOwnProperty("_response")&&!!e._callbackId}const Bf=v("windowRedirect"),kf=v("windowReload",{});var Kf=Object.freeze(Object.defineProperty({__proto__:null,redirect:Bf,reload:kf},Symbol.toStringTag,{value:"Module"}));const qf=v("notificationDispatch");var Vf=Object.freeze(Object.defineProperty({__proto__:null,dispatch:qf},Symbol.toStringTag,{value:"Module"}));const Wf=v("contextLanguage",{}),Jf=Ue("contextLanguage"),Qf=v("contextEnvironment",{}),Yf=v("contextLocale",{}),Xf=Ue("contextLocale"),Zf=v("contextCurrency",{}),tg=v("contextShopwareVersion",{}),eg=v("contextAppInformation",{});var rg=Object.freeze(Object.defineProperty({__proto__:null,getLanguage:Wf,subscribeLanguage:Jf,getEnvironment:Qf,getLocale:Yf,subscribeLocale:Xf,getCurrency:Zf,getShopwareVersion:tg,getAppInformation:eg},Symbol.toStringTag,{value:"Module"}));const ng=v("uiComponentSectionRenderer",{src:(ke=za())!=null?ke:void 0});var ig=Object.freeze(Object.defineProperty({__proto__:null,add:ng},Symbol.toStringTag,{value:"Module"})),ag=t=>({addTabItem:v("uiTabsAddTabItem",{positionId:t})});const sg=t=>lt()===t,og=()=>window!==window.parent,He=t=>{if(t)return $("locationUpdateHeight",{height:t,locationId:lt()});const e=document.documentElement.offsetHeight;return $("locationUpdateHeight",{height:e,locationId:lt()})};let V=null;var cg=Object.freeze(Object.defineProperty({__proto__:null,is:sg,isIframe:og,updateHeight:He,startAutoResizer:()=>{V=new ResizeObserver(()=>{He()}),V.observe(document.body)},stopAutoResizer:()=>{V&&(V.unobserve(document.body),V.disconnect())},MAIN_HIDDEN:"sw-main-hidden"},Symbol.toStringTag,{value:"Module"}));const ug=v("menuItemAdd");var lg=Object.freeze(Object.defineProperty({__proto__:null,addMenuItem:ug},Symbol.toStringTag,{value:"Module"}));const fg=v("settingsItemAdd");var gg=Object.freeze(Object.defineProperty({__proto__:null,addSettingsItem:fg},Symbol.toStringTag,{value:"Module"}));const _g=v("mainModuleAdd");var dg=Object.freeze(Object.defineProperty({__proto__:null,addMainModule:_g},Symbol.toStringTag,{value:"Module"}));const pg=v("uiModalOpen"),hg=v("uiModalClose");var yg=Object.freeze(Object.defineProperty({__proto__:null,open:pg,close:hg},Symbol.toStringTag,{value:"Module"}));const vg=v("actionButtonAdd");var bg=Object.freeze(Object.defineProperty({__proto__:null,add:vg},Symbol.toStringTag,{value:"Module"}));const $g=v("actionExecute");var mg=Object.freeze(Object.defineProperty({__proto__:null,actionExecute:$g},Symbol.toStringTag,{value:"Module"})),Sg=t=>({search:(e,r)=>$("repositorySearch",{entityName:t,context:r,criteria:e}),get:(e,r,n)=>$("repositoryGet",{entityName:t,id:e,context:r,criteria:n}),save:(e,r)=>$("repositorySave",{entityName:t,entity:e,context:r}),clone:(e,r,n)=>$("repositoryClone",{entityName:t,entityId:e,context:r,behavior:n}),hasChanges:e=>$("repositoryHasChanges",{entityName:t,entity:e}),saveAll:(e,r)=>$("repositorySaveAll",{entityName:t,entities:e,context:r}),delete:(e,r)=>$("repositoryDelete",{entityName:t,entityId:e,context:r}),create:(e,r)=>$("repositoryCreate",{entityName:t,entityId:r,context:e})});function Be(t){return(e,r)=>jt(t,i=>{if(i&&i.id===e){const a=r(i);a&&a.catch(()=>{})}})}const wg=Be("datasetQuery"),Tg=v("datasetUpdate"),Ag=v("datasetRegistration"),Og=Be("datasetUpdate");var Cg=Object.freeze(Object.defineProperty({__proto__:null,get:wg,update:Tg,register:Ag,updateSubscriber:Og,repository:Sg,Classes:{Criteria:F,Entity:Le,EntityCollection:L}},Symbol.toStringTag,{value:"Module"}));const jg={webhook:mg},Ig={componentSection:ig,tabs:ag,menu:lg,settings:gg,mainModule:dg,modal:yg,actionButton:bg};y.app=jg,y.context=rg,y.data=Cg,y.location=cg,y.notification=Vf,y.ui=Ig,y.window=Kf,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
import Criteria from "../../data/Criteria";
import SerializerFactory from './index';
import { handleFactory, send } from '../../channel';
import { handle, send } from '../../channel';
const { serialize, deserialize } = SerializerFactory({
handleFactory: handleFactory,
handle: handle,
send: send,

@@ -7,0 +7,0 @@ });

@@ -5,5 +5,5 @@ import EntityCollection from '../../data/_internals/EntityCollection';

import SerializerFactory from './index';
import { handleFactory, send } from '../../channel';
import { handle, send } from '../../channel';
const { serialize, deserialize } = SerializerFactory({
handleFactory: handleFactory,
handle: handle,
send: send,

@@ -10,0 +10,0 @@ });

import Entity from '../../data/_internals/Entity';
import cloneDeep from 'lodash/cloneDeep';
import SerializerFactory from './index';
import { handleFactory, send } from '../../channel';
import { handle, send } from '../../channel';
const { serialize, deserialize } = SerializerFactory({
handleFactory: handleFactory,
handle: handle,
send: send,

@@ -8,0 +8,0 @@ });

@@ -12,3 +12,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

/* eslint-disable */
const FunctionSerializerFactory = ({ send, handleFactory }) => {
const FunctionSerializerFactory = ({ send, handle }) => {
// only available on sender side

@@ -21,3 +21,2 @@ const methodRegistry = {};

isMethodHandlerStarted = true;
const handle = handleFactory({});
handle('__function__', ({ args, id }) => __awaiter(this, void 0, void 0, function* () {

@@ -24,0 +23,0 @@ return yield Promise.resolve(methodRegistry[id](...args));

@@ -1,5 +0,5 @@

import type { send, handleFactory } from '../../channel';
import type { send, handle } from '../../channel';
interface SerializerDependencies {
send: typeof send;
handleFactory: typeof handleFactory;
handle: typeof handle;
}

@@ -6,0 +6,0 @@ interface customizerProperties {

@@ -1,7 +0,5 @@

import type { extensions } from '../../privileges/privilege-resolver';
import type { privileges } from '../../privileges/privilege-resolver';
import type { ShopwareMessageTypes } from '../../messages.types';
export default function validate({ serializedData, extensions, origin, type, privilegesToCheck, }: {
export default function validate({ serializedData, origin, type, privilegesToCheck, }: {
serializedData: any;
extensions: extensions;
origin: string;

@@ -8,0 +6,0 @@ type: keyof ShopwareMessageTypes;

import { findExtensionByBaseUrl } from '../../privileges/privilege-resolver';
import { traverseObject } from '../utils';
import MissingPrivilegesError from '../../privileges/missing-privileges-error';
export default function validate({ serializedData, extensions, origin, type, privilegesToCheck = [], }) {
const extension = findExtensionByBaseUrl(extensions, origin);
export default function validate({ serializedData, origin, type, privilegesToCheck = [], }) {
const extension = findExtensionByBaseUrl(origin);
if (!extension) {

@@ -7,0 +7,0 @@ return null;

import type { ShopwareMessageTypes } from './messages.types';
import type { extensions } from './privileges/privilege-resolver';
import type { extension } from './privileges/privilege-resolver';
declare type extensions = {
[key: string]: extension;
};
export declare let adminExtensions: extensions;
export declare function setExtensions(extensions: extensions): void;
/**

@@ -53,5 +58,10 @@ * ----------------

export declare function send<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, data: MessageDataType<MESSAGE_TYPE>, _targetWindow?: Window, _origin?: string): Promise<ShopwareMessageTypes[MESSAGE_TYPE]['responseType'] | null>;
export declare function handleFactory(extensions: extensions): <MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: MessageDataType<MESSAGE_TYPE>, additionalInformation: {
/**
* @param type Choose a type of action from the {@link send-types}
* @param method This method should return the response value
* @returns The return value is a cancel function to stop listening to the events
*/
export declare function handle<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: MessageDataType<MESSAGE_TYPE>, additionalInformation: {
_event_: MessageEvent<string>;
}) => ShopwareMessageTypes[MESSAGE_TYPE]["responseType"] | Promise<ShopwareMessageTypes[MESSAGE_TYPE]["responseType"]>) => () => void;
}) => Promise<ShopwareMessageTypes[MESSAGE_TYPE]['responseType']> | ShopwareMessageTypes[MESSAGE_TYPE]['responseType']): () => void;
export declare function publish<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, data: ShopwareMessageTypes[MESSAGE_TYPE]['responseType']): void;

@@ -58,0 +68,0 @@ export declare function subscribe<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: ShopwareMessageTypes[MESSAGE_TYPE]['responseType']) => void | Promise<unknown>): () => void;

@@ -18,5 +18,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const { serialize, deserialize } = SerializerFactory({
handleFactory: handleFactory,
handle: handle,
send: send,
});
export let adminExtensions = {};
export function setExtensions(extensions) {
adminExtensions = extensions;
}
/**

@@ -56,3 +60,39 @@ * ----------------

};
const serializedData = serialize(messageData);
let serializedData = serialize(messageData);
// Validate if send value contains entity data where the app has no privileges for
if (_origin) {
const validationErrors = validate({
serializedData: serializedData,
origin: _origin,
privilegesToCheck: ['read'],
type: type,
});
if (validationErrors) {
// Datasets need the id for matching the response
if ([
'datasetQuery',
'datasetUpdate',
'datasetRegistration',
].includes(serializedData._type)) {
serializedData = serialize({
_type: serializedData._type,
_callbackId: serializedData._callbackId,
_data: {
// @ts-expect-error - We know with the includes that it has an ID
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
id: serializedData._data.id,
data: validationErrors,
},
});
}
// Everything else can overwrite the response
else {
serializedData = serialize({
_type: serializedData._type,
_callbackId: serializedData._callbackId,
_data: validationErrors,
});
}
}
}
// Convert message data to string for message sending

@@ -136,3 +176,3 @@ const message = JSON.stringify(serializedData);

*/
function handle(type, method, extensions) {
export function handle(type, method) {
const handleListener = function (event) {

@@ -143,6 +183,6 @@ var _a;

if (ShopwareMessageTypePrivileges[type] && Object.keys(ShopwareMessageTypePrivileges[type]).length) {
if (!extensions) {
if (!adminExtensions) {
return;
}
const missingPrivileges = handlePrivileged(type, extensions, event.origin);
const missingPrivileges = handlePrivileged(type, event.origin);
if (missingPrivileges !== null) {

@@ -182,3 +222,2 @@ return;

serializedData: shopwareMessageData,
extensions: extensions,
origin: event.origin,

@@ -205,3 +244,2 @@ type: type,

serializedData: serializedMessage,
extensions: extensions,
origin: event.origin,

@@ -237,5 +275,2 @@ privilegesToCheck: ['read'],

}
export function handleFactory(extensions) {
return (type, method) => handle(type, method, extensions);
}
export function publish(type, data) {

@@ -249,3 +284,3 @@ [...sourceRegistry].forEach(({ source, origin }) => {

export function subscribe(type, method) {
return handle(type, method, {});
return handle(type, method);
}

@@ -266,3 +301,3 @@ // MAIN FUNCTION WHICH INCLUDES ALL POSSIBILITES

return (method) => {
return handle(messageType, method, {});
return handle(messageType, method);
};

@@ -316,3 +351,3 @@ }

});
}, {});
});
// New dataset registered

@@ -326,7 +361,7 @@ handle('datasetRegistration', (data) => {

};
}, {});
});
handle('datasetQuery', (data) => {
var _a;
return (_a = datasets.get(data.id)) !== null && _a !== void 0 ? _a : null;
}, {});
});
// Register at parent window

@@ -333,0 +368,0 @@ yield send('__registerWindow__', {});

@@ -11,3 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import flushPromises from 'flush-promises';
import { send, handleFactory, createSender, createHandler, subscribe, publish } from './channel';
import { send, handle, createSender, createHandler, subscribe, publish, setExtensions } from './channel';
import MissingPrivilegesError from './privileges/missing-privileges-error';

@@ -17,5 +17,8 @@ // Channel send timout + 1000

describe('Test the channel bridge from iFrame to admin', () => {
const defaultHandle = handleFactory({});
beforeEach(() => {
// reset extensions
setExtensions({});
});
it('should send "reload" command to the admin', (done) => {
const removeListener = defaultHandle('windowReload', (result) => {
const removeListener = handle('windowReload', (result) => {
expect(result).toEqual({});

@@ -28,3 +31,3 @@ removeListener();

it('should send "reload" command to the admin also without options', (done) => {
const removeListener = defaultHandle('windowReload', (result) => {
const removeListener = handle('windowReload', (result) => {
expect(result).toEqual({});

@@ -40,3 +43,3 @@ removeListener();

const PAGE_TITLE = 'Awesome page title';
const removeListener = defaultHandle('getPageTitle', () => {
const removeListener = handle('getPageTitle', () => {
return PAGE_TITLE;

@@ -155,3 +158,3 @@ });

const callback = jest.fn();
const removeHandle = defaultHandle('_privileges', callback);
const removeHandle = handle('_privileges', callback);
// Simulate a postMessage call from an iFrame

@@ -165,3 +168,4 @@ window.dispatchEvent(new Event('message'));

const callback = jest.fn();
const handle = handleFactory({ foo: { baseUrl: url, permissions: { create: ['notification'] } } });
// change the extensions for this test
setExtensions({});
const removeHandle = handle('_privileges', callback);

@@ -168,0 +172,0 @@ const event = new Event('message');

export default class MissingPrivilegesError extends Error {
constructor(messageType, missingPrivileges) {
super(`Your app is missing the priviliges ${missingPrivileges.join(', ')} for action "${messageType}".`);
super(`Your app is missing the privileges ${missingPrivileges.join(', ')} for action "${messageType}".`);
Object.defineProperty(this, "missingPrivileges", {

@@ -5,0 +5,0 @@ enumerable: true,

@@ -13,7 +13,4 @@ import type { ShopwareMessageTypes } from '../messages.types';

};
export declare type extensions = {
[key: string]: extension;
};
export declare function sendPrivileged(messageType: keyof ShopwareMessageTypes): Array<privilegeString> | null;
export declare function handlePrivileged(messageType: keyof ShopwareMessageTypes, extensions: extensions, origin: string): Array<privilegeString> | null;
export declare function findExtensionByBaseUrl(extensions: extensions, baseUrl: string): extension | null;
export declare function handlePrivileged(messageType: keyof ShopwareMessageTypes, origin: string): Array<privilegeString> | null;
export declare function findExtensionByBaseUrl(baseUrl: string): extension | undefined;
import { ShopwareMessageTypePrivileges } from '.';
import { adminExtensions } from '../channel';
export function sendPrivileged(messageType) {

@@ -10,5 +11,5 @@ const requiredPrivileges = getRequiredPrivilegesForMessage(messageType);

}
export function handlePrivileged(messageType, extensions, origin) {
export function handlePrivileged(messageType, origin) {
const requiredPrivileges = getRequiredPrivilegesForMessage(messageType);
const extension = findExtensionByBaseUrl(extensions, origin);
const extension = findExtensionByBaseUrl(origin);
if (!extension) {

@@ -29,4 +30,3 @@ return null;

}
const privileges = JSON.parse(privilegeString);
return privileges;
return JSON.parse(privilegeString);
}

@@ -48,11 +48,6 @@ function getMissingPrivileges(requiredPrivileges, privileges) {

}
export function findExtensionByBaseUrl(extensions, baseUrl) {
let extension = null;
Object.values(extensions).forEach((ext) => {
if (ext.baseUrl === baseUrl) {
extension = ext;
}
});
return extension;
export function findExtensionByBaseUrl(baseUrl) {
return Object.values(adminExtensions)
.find((ext) => ext.baseUrl === baseUrl);
}
//# sourceMappingURL=privilege-resolver.js.map
{
"name": "@shopware-ag/admin-extension-sdk",
"license": "MIT",
"version": "0.0.50",
"version": "0.0.51",
"repository": "git://github.com/shopware/admin-extension-sdk.git",

@@ -6,0 +6,0 @@ "description": "The SDK for App iframes to communicate with the Shopware Adminstration",

@@ -19,3 +19,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

const { serialize, deserialize } = (0, index_1.default)({
handleFactory: channel_1.handleFactory,
handle: channel_1.handle,
send: channel_1.send,

@@ -22,0 +22,0 @@ });

@@ -21,3 +21,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

const { serialize, deserialize } = (0, index_1.default)({
handleFactory: channel_1.handleFactory,
handle: channel_1.handle,
send: channel_1.send,

@@ -24,0 +24,0 @@ });

@@ -20,3 +20,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

const { serialize, deserialize } = (0, index_1.default)({
handleFactory: channel_1.handleFactory,
handle: channel_1.handle,
send: channel_1.send,

@@ -23,0 +23,0 @@ });

@@ -23,3 +23,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

/* eslint-disable */
const FunctionSerializerFactory = ({ send, handleFactory }) => {
const FunctionSerializerFactory = ({ send, handle }) => {
// only available on sender side

@@ -32,3 +32,2 @@ const methodRegistry = {};

isMethodHandlerStarted = true;
const handle = handleFactory({});
handle('__function__', ({ args, id }) => __awaiter(this, void 0, void 0, function* () {

@@ -35,0 +34,0 @@ return yield Promise.resolve(methodRegistry[id](...args));

@@ -1,5 +0,5 @@

import type { send, handleFactory } from '../../channel';
import type { send, handle } from '../../channel';
interface SerializerDependencies {
send: typeof send;
handleFactory: typeof handleFactory;
handle: typeof handle;
}

@@ -6,0 +6,0 @@ interface customizerProperties {

@@ -1,7 +0,5 @@

import type { extensions } from '../../privileges/privilege-resolver';
import type { privileges } from '../../privileges/privilege-resolver';
import type { ShopwareMessageTypes } from '../../messages.types';
export default function validate({ serializedData, extensions, origin, type, privilegesToCheck, }: {
export default function validate({ serializedData, origin, type, privilegesToCheck, }: {
serializedData: any;
extensions: extensions;
origin: string;

@@ -8,0 +6,0 @@ type: keyof ShopwareMessageTypes;

@@ -18,4 +18,4 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

const missing_privileges_error_1 = __importDefault(require("../../privileges/missing-privileges-error"));
function validate({ serializedData, extensions, origin, type, privilegesToCheck = [], }) {
const extension = (0, privilege_resolver_1.findExtensionByBaseUrl)(extensions, origin);
function validate({ serializedData, origin, type, privilegesToCheck = [], }) {
const extension = (0, privilege_resolver_1.findExtensionByBaseUrl)(origin);
if (!extension) {

@@ -22,0 +22,0 @@ return null;

import type { ShopwareMessageTypes } from './messages.types';
import type { extensions } from './privileges/privilege-resolver';
import type { extension } from './privileges/privilege-resolver';
declare type extensions = {
[key: string]: extension;
};
export declare let adminExtensions: extensions;
export declare function setExtensions(extensions: extensions): void;
/**

@@ -53,5 +58,10 @@ * ----------------

export declare function send<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, data: MessageDataType<MESSAGE_TYPE>, _targetWindow?: Window, _origin?: string): Promise<ShopwareMessageTypes[MESSAGE_TYPE]['responseType'] | null>;
export declare function handleFactory(extensions: extensions): <MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: MessageDataType<MESSAGE_TYPE>, additionalInformation: {
/**
* @param type Choose a type of action from the {@link send-types}
* @param method This method should return the response value
* @returns The return value is a cancel function to stop listening to the events
*/
export declare function handle<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: MessageDataType<MESSAGE_TYPE>, additionalInformation: {
_event_: MessageEvent<string>;
}) => ShopwareMessageTypes[MESSAGE_TYPE]["responseType"] | Promise<ShopwareMessageTypes[MESSAGE_TYPE]["responseType"]>) => () => void;
}) => Promise<ShopwareMessageTypes[MESSAGE_TYPE]['responseType']> | ShopwareMessageTypes[MESSAGE_TYPE]['responseType']): () => void;
export declare function publish<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, data: ShopwareMessageTypes[MESSAGE_TYPE]['responseType']): void;

@@ -58,0 +68,0 @@ export declare function subscribe<MESSAGE_TYPE extends keyof ShopwareMessageTypes>(type: MESSAGE_TYPE, method: (data: ShopwareMessageTypes[MESSAGE_TYPE]['responseType']) => void | Promise<unknown>): () => void;

@@ -24,3 +24,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.createSubscriber = exports.createHandler = exports.createSender = exports.subscribe = exports.publish = exports.handleFactory = exports.send = void 0;
exports.createSubscriber = exports.createHandler = exports.createSender = exports.subscribe = exports.publish = exports.handle = exports.send = exports.setExtensions = exports.adminExtensions = void 0;
const utils_1 = require("./_internals/utils");

@@ -34,5 +34,10 @@ const privilege_resolver_1 = require("./privileges/privilege-resolver");

const { serialize, deserialize } = (0, serializer_1.default)({
handleFactory: handleFactory,
handle: handle,
send: send,
});
exports.adminExtensions = {};
function setExtensions(extensions) {
exports.adminExtensions = extensions;
}
exports.setExtensions = setExtensions;
/**

@@ -72,3 +77,39 @@ * ----------------

};
const serializedData = serialize(messageData);
let serializedData = serialize(messageData);
// Validate if send value contains entity data where the app has no privileges for
if (_origin) {
const validationErrors = (0, index_1.default)({
serializedData: serializedData,
origin: _origin,
privilegesToCheck: ['read'],
type: type,
});
if (validationErrors) {
// Datasets need the id for matching the response
if ([
'datasetQuery',
'datasetUpdate',
'datasetRegistration',
].includes(serializedData._type)) {
serializedData = serialize({
_type: serializedData._type,
_callbackId: serializedData._callbackId,
_data: {
// @ts-expect-error - We know with the includes that it has an ID
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
id: serializedData._data.id,
data: validationErrors,
},
});
}
// Everything else can overwrite the response
else {
serializedData = serialize({
_type: serializedData._type,
_callbackId: serializedData._callbackId,
_data: validationErrors,
});
}
}
}
// Convert message data to string for message sending

@@ -153,3 +194,3 @@ const message = JSON.stringify(serializedData);

*/
function handle(type, method, extensions) {
function handle(type, method) {
const handleListener = function (event) {

@@ -160,6 +201,6 @@ var _a;

if (privileges_1.ShopwareMessageTypePrivileges[type] && Object.keys(privileges_1.ShopwareMessageTypePrivileges[type]).length) {
if (!extensions) {
if (!exports.adminExtensions) {
return;
}
const missingPrivileges = (0, privilege_resolver_1.handlePrivileged)(type, extensions, event.origin);
const missingPrivileges = (0, privilege_resolver_1.handlePrivileged)(type, event.origin);
if (missingPrivileges !== null) {

@@ -199,3 +240,2 @@ return;

serializedData: shopwareMessageData,
extensions: extensions,
origin: event.origin,

@@ -222,3 +262,2 @@ type: type,

serializedData: serializedMessage,
extensions: extensions,
origin: event.origin,

@@ -254,6 +293,3 @@ privilegesToCheck: ['read'],

}
function handleFactory(extensions) {
return (type, method) => handle(type, method, extensions);
}
exports.handleFactory = handleFactory;
exports.handle = handle;
function publish(type, data) {

@@ -268,3 +304,3 @@ [...sourceRegistry].forEach(({ source, origin }) => {

function subscribe(type, method) {
return handle(type, method, {});
return handle(type, method);
}

@@ -287,3 +323,3 @@ exports.subscribe = subscribe;

return (method) => {
return handle(messageType, method, {});
return handle(messageType, method);
};

@@ -339,3 +375,3 @@ }

});
}, {});
});
// New dataset registered

@@ -349,7 +385,7 @@ handle('datasetRegistration', (data) => {

};
}, {});
});
handle('datasetQuery', (data) => {
var _a;
return (_a = datasets.get(data.id)) !== null && _a !== void 0 ? _a : null;
}, {});
});
// Register at parent window

@@ -356,0 +392,0 @@ yield send('__registerWindow__', {});

@@ -30,5 +30,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

describe('Test the channel bridge from iFrame to admin', () => {
const defaultHandle = (0, channel_1.handleFactory)({});
beforeEach(() => {
// reset extensions
(0, channel_1.setExtensions)({});
});
it('should send "reload" command to the admin', (done) => {
const removeListener = defaultHandle('windowReload', (result) => {
const removeListener = (0, channel_1.handle)('windowReload', (result) => {
expect(result).toEqual({});

@@ -41,3 +44,3 @@ removeListener();

it('should send "reload" command to the admin also without options', (done) => {
const removeListener = defaultHandle('windowReload', (result) => {
const removeListener = (0, channel_1.handle)('windowReload', (result) => {
expect(result).toEqual({});

@@ -53,3 +56,3 @@ removeListener();

const PAGE_TITLE = 'Awesome page title';
const removeListener = defaultHandle('getPageTitle', () => {
const removeListener = (0, channel_1.handle)('getPageTitle', () => {
return PAGE_TITLE;

@@ -168,3 +171,3 @@ });

const callback = jest.fn();
const removeHandle = defaultHandle('_privileges', callback);
const removeHandle = (0, channel_1.handle)('_privileges', callback);
// Simulate a postMessage call from an iFrame

@@ -178,4 +181,5 @@ window.dispatchEvent(new Event('message'));

const callback = jest.fn();
const handle = (0, channel_1.handleFactory)({ foo: { baseUrl: url, permissions: { create: ['notification'] } } });
const removeHandle = handle('_privileges', callback);
// change the extensions for this test
(0, channel_1.setExtensions)({});
const removeHandle = (0, channel_1.handle)('_privileges', callback);
const event = new Event('message');

@@ -182,0 +186,0 @@ // Simulate a postMessage call from an iFrame with a none registered origin

@@ -14,3 +14,3 @@ (function (factory) {

constructor(messageType, missingPrivileges) {
super(`Your app is missing the priviliges ${missingPrivileges.join(', ')} for action "${messageType}".`);
super(`Your app is missing the privileges ${missingPrivileges.join(', ')} for action "${messageType}".`);
Object.defineProperty(this, "missingPrivileges", {

@@ -17,0 +17,0 @@ enumerable: true,

@@ -13,7 +13,4 @@ import type { ShopwareMessageTypes } from '../messages.types';

};
export declare type extensions = {
[key: string]: extension;
};
export declare function sendPrivileged(messageType: keyof ShopwareMessageTypes): Array<privilegeString> | null;
export declare function handlePrivileged(messageType: keyof ShopwareMessageTypes, extensions: extensions, origin: string): Array<privilegeString> | null;
export declare function findExtensionByBaseUrl(extensions: extensions, baseUrl: string): extension | null;
export declare function handlePrivileged(messageType: keyof ShopwareMessageTypes, origin: string): Array<privilegeString> | null;
export declare function findExtensionByBaseUrl(baseUrl: string): extension | undefined;

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "."], factory);
define(["require", "exports", ".", "../channel"], factory);
}

@@ -15,2 +15,3 @@ })(function (require, exports) {

const _1 = require(".");
const channel_1 = require("../channel");
function sendPrivileged(messageType) {

@@ -25,5 +26,5 @@ const requiredPrivileges = getRequiredPrivilegesForMessage(messageType);

exports.sendPrivileged = sendPrivileged;
function handlePrivileged(messageType, extensions, origin) {
function handlePrivileged(messageType, origin) {
const requiredPrivileges = getRequiredPrivilegesForMessage(messageType);
const extension = findExtensionByBaseUrl(extensions, origin);
const extension = findExtensionByBaseUrl(origin);
if (!extension) {

@@ -45,4 +46,3 @@ return null;

}
const privileges = JSON.parse(privilegeString);
return privileges;
return JSON.parse(privilegeString);
}

@@ -64,10 +64,5 @@ function getMissingPrivileges(requiredPrivileges, privileges) {

}
function findExtensionByBaseUrl(extensions, baseUrl) {
let extension = null;
Object.values(extensions).forEach((ext) => {
if (ext.baseUrl === baseUrl) {
extension = ext;
}
});
return extension;
function findExtensionByBaseUrl(baseUrl) {
return Object.values(channel_1.adminExtensions)
.find((ext) => ext.baseUrl === baseUrl);
}

@@ -74,0 +69,0 @@ exports.findExtensionByBaseUrl = findExtensionByBaseUrl;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc