JezK
Edit File: product-editor-store.js
/*! For license information please see product-editor-store.js.LICENSE.txt */ (()=>{"use strict";var t={1674(t,e,n){n(7723)},2847(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:a,getOwnPropertyDescriptor:r}=Object;let{freeze:o,seal:i,create:s}=Object,{apply:c,construct:l}="undefined"!=typeof Reflect&&Reflect;o||(o=function(t){return t}),i||(i=function(t){return t}),c||(c=function(t,e){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];return t.apply(e,a)}),l||(l=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++)n[a-1]=arguments[a];return new t(...n)});const u=v(Array.prototype.forEach),d=v(Array.prototype.lastIndexOf),p=v(Array.prototype.pop),m=v(Array.prototype.push),f=v(Array.prototype.splice),h=v(String.prototype.toLowerCase),g=v(String.prototype.toString),T=v(String.prototype.match),y=v(String.prototype.replace),E=v(String.prototype.indexOf),_=v(String.prototype.trim),b=v(Object.prototype.hasOwnProperty),S=v(RegExp.prototype.test),A=(w=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return l(w,e)});var w;function v(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return c(t,e,a)}}function N(t,a){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;e&&e(t,null);let o=a.length;for(;o--;){let e=a[o];if("string"==typeof e){const t=r(e);t!==e&&(n(a)||(a[o]=t),e=t)}t[e]=!0}return t}function O(t){for(let e=0;e<t.length;e++)b(t,e)||(t[e]=null);return t}function I(e){const n=s(null);for(const[a,r]of t(e))b(e,a)&&(Array.isArray(r)?n[a]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[a]=I(r):n[a]=r);return n}function R(t,e){for(;null!==t;){const n=r(t,e);if(n){if(n.get)return v(n.get);if("function"==typeof n.value)return v(n.value)}t=a(t)}return function(){return null}}const D=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),k=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),x=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),C=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=o(["#text"]),F=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),U=o(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),H=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=i(/\{\{[\w\W]*|[\w\W]*\}\}/gm),B=i(/<%[\w\W]*|[\w\W]*%>/gm),G=i(/\$\{[\w\W]*/gm),W=i(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=i(/^aria-[\-\w]+$/),Y=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=i(/^(?:\w+script|data):/i),X=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q=i(/^html$/i),K=i(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:K,DATA_ATTR:W,DOCTYPE_NAME:q,ERB_EXPR:B,IS_ALLOWED_URI:Y,IS_SCRIPT_OR_DATA:$,MUSTACHE_EXPR:V,TMPLIT_EXPR:G});const J=function(){return"undefined"==typeof window?null:window};!function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J();const a=t=>e(t);if(a.version="3.3.1",a.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return a.isSupported=!1,a;let{document:r}=n;const i=r,c=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:w,Node:v,Element:O,NodeFilter:V,NamedNodeMap:B=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:W,trustedTypes:j}=n,$=O.prototype,X=R($,"cloneNode"),K=R($,"remove"),Q=R($,"nextSibling"),tt=R($,"childNodes"),et=R($,"parentNode");if("function"==typeof w){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let nt,at="";const{implementation:rt,createNodeIterator:ot,createDocumentFragment:it,getElementsByTagName:st}=r,{importNode:ct}=i;let lt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};a.isSupported="function"==typeof t&&"function"==typeof et&&rt&&void 0!==rt.createHTMLDocument;const{MUSTACHE_EXPR:ut,ERB_EXPR:dt,TMPLIT_EXPR:pt,DATA_ATTR:mt,ARIA_ATTR:ft,IS_SCRIPT_OR_DATA:ht,ATTR_WHITESPACE:gt,CUSTOM_ELEMENT:Tt}=Z;let{IS_ALLOWED_URI:yt}=Z,Et=null;const _t=N({},[...D,...k,...L,...C,...M]);let bt=null;const St=N({},[...F,...U,...z,...H]);let At=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wt=null,vt=null;const Nt=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ot=!0,It=!0,Rt=!1,Dt=!0,kt=!1,Lt=!0,xt=!1,Ct=!1,Pt=!1,Mt=!1,Ft=!1,Ut=!1,zt=!0,Ht=!1,Vt=!0,Bt=!1,Gt={},Wt=null;const jt=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Yt=null;const $t=N({},["audio","video","img","source","image","track"]);let Xt=null;const qt=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Zt="http://www.w3.org/2000/svg",Jt="http://www.w3.org/1999/xhtml";let Qt=Jt,te=!1,ee=null;const ne=N({},[Kt,Zt,Jt],g);let ae=N({},["mi","mo","mn","ms","mtext"]),re=N({},["annotation-xml"]);const oe=N({},["title","style","font","a","script"]);let ie=null;const se=["application/xhtml+xml","text/html"];let ce=null,le=null;const ue=r.createElement("form"),de=function(t){return t instanceof RegExp||t instanceof Function},pe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!le||le!==t){if(t&&"object"==typeof t||(t={}),t=I(t),ie=-1===se.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ce="application/xhtml+xml"===ie?g:h,Et=b(t,"ALLOWED_TAGS")?N({},t.ALLOWED_TAGS,ce):_t,bt=b(t,"ALLOWED_ATTR")?N({},t.ALLOWED_ATTR,ce):St,ee=b(t,"ALLOWED_NAMESPACES")?N({},t.ALLOWED_NAMESPACES,g):ne,Xt=b(t,"ADD_URI_SAFE_ATTR")?N(I(qt),t.ADD_URI_SAFE_ATTR,ce):qt,Yt=b(t,"ADD_DATA_URI_TAGS")?N(I($t),t.ADD_DATA_URI_TAGS,ce):$t,Wt=b(t,"FORBID_CONTENTS")?N({},t.FORBID_CONTENTS,ce):jt,wt=b(t,"FORBID_TAGS")?N({},t.FORBID_TAGS,ce):I({}),vt=b(t,"FORBID_ATTR")?N({},t.FORBID_ATTR,ce):I({}),Gt=!!b(t,"USE_PROFILES")&&t.USE_PROFILES,Ot=!1!==t.ALLOW_ARIA_ATTR,It=!1!==t.ALLOW_DATA_ATTR,Rt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,kt=t.SAFE_FOR_TEMPLATES||!1,Lt=!1!==t.SAFE_FOR_XML,xt=t.WHOLE_DOCUMENT||!1,Mt=t.RETURN_DOM||!1,Ft=t.RETURN_DOM_FRAGMENT||!1,Ut=t.RETURN_TRUSTED_TYPE||!1,Pt=t.FORCE_BODY||!1,zt=!1!==t.SANITIZE_DOM,Ht=t.SANITIZE_NAMED_PROPS||!1,Vt=!1!==t.KEEP_CONTENT,Bt=t.IN_PLACE||!1,yt=t.ALLOWED_URI_REGEXP||Y,Qt=t.NAMESPACE||Jt,ae=t.MATHML_TEXT_INTEGRATION_POINTS||ae,re=t.HTML_INTEGRATION_POINTS||re,At=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&de(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(At.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&de(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(At.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(At.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),kt&&(It=!1),Ft&&(Mt=!0),Gt&&(Et=N({},M),bt=[],!0===Gt.html&&(N(Et,D),N(bt,F)),!0===Gt.svg&&(N(Et,k),N(bt,U),N(bt,H)),!0===Gt.svgFilters&&(N(Et,L),N(bt,U),N(bt,H)),!0===Gt.mathMl&&(N(Et,C),N(bt,z),N(bt,H))),t.ADD_TAGS&&("function"==typeof t.ADD_TAGS?Nt.tagCheck=t.ADD_TAGS:(Et===_t&&(Et=I(Et)),N(Et,t.ADD_TAGS,ce))),t.ADD_ATTR&&("function"==typeof t.ADD_ATTR?Nt.attributeCheck=t.ADD_ATTR:(bt===St&&(bt=I(bt)),N(bt,t.ADD_ATTR,ce))),t.ADD_URI_SAFE_ATTR&&N(Xt,t.ADD_URI_SAFE_ATTR,ce),t.FORBID_CONTENTS&&(Wt===jt&&(Wt=I(Wt)),N(Wt,t.FORBID_CONTENTS,ce)),t.ADD_FORBID_CONTENTS&&(Wt===jt&&(Wt=I(Wt)),N(Wt,t.ADD_FORBID_CONTENTS,ce)),Vt&&(Et["#text"]=!0),xt&&N(Et,["html","head","body"]),Et.table&&(N(Et,["tbody"]),delete wt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');nt=t.TRUSTED_TYPES_POLICY,at=nt.createHTML("")}else void 0===nt&&(nt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const a="data-tt-policy-suffix";e&&e.hasAttribute(a)&&(n=e.getAttribute(a));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==nt&&"string"==typeof at&&(at=nt.createHTML(""));o&&o(t),le=t}},me=N({},[...k,...L,...x]),fe=N({},[...C,...P]),he=function(t){m(a.removed,{element:t});try{et(t).removeChild(t)}catch(e){K(t)}},ge=function(t,e){try{m(a.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){m(a.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Mt||Ft)try{he(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Te=function(t){let e=null,n=null;if(Pt)t="<remove></remove>"+t;else{const e=T(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===ie&&Qt===Jt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const a=nt?nt.createHTML(t):t;if(Qt===Jt)try{e=(new W).parseFromString(a,ie)}catch(t){}if(!e||!e.documentElement){e=rt.createDocument(Qt,"template",null);try{e.documentElement.innerHTML=te?at:a}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Qt===Jt?st.call(e,xt?"html":"body")[0]:xt?e.documentElement:o},ye=function(t){return ot.call(t.ownerDocument||t,t,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT|V.SHOW_PROCESSING_INSTRUCTION|V.SHOW_CDATA_SECTION,null)},Ee=function(t){return t instanceof G&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof B)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},_e=function(t){return"function"==typeof v&&t instanceof v};function be(t,e,n){u(t,t=>{t.call(a,e,n,le)})}const Se=function(t){let e=null;if(be(lt.beforeSanitizeElements,t,null),Ee(t))return he(t),!0;const n=ce(t.nodeName);if(be(lt.uponSanitizeElement,t,{tagName:n,allowedTags:Et}),Lt&&t.hasChildNodes()&&!_e(t.firstElementChild)&&S(/<[/\w!]/g,t.innerHTML)&&S(/<[/\w!]/g,t.textContent))return he(t),!0;if(7===t.nodeType)return he(t),!0;if(Lt&&8===t.nodeType&&S(/<[/\w]/g,t.data))return he(t),!0;if(!(Nt.tagCheck instanceof Function&&Nt.tagCheck(n))&&(!Et[n]||wt[n])){if(!wt[n]&&we(n)){if(At.tagNameCheck instanceof RegExp&&S(At.tagNameCheck,n))return!1;if(At.tagNameCheck instanceof Function&&At.tagNameCheck(n))return!1}if(Vt&&!Wt[n]){const e=et(t)||t.parentNode,n=tt(t)||t.childNodes;if(n&&e)for(let a=n.length-1;a>=0;--a){const r=X(n[a],!0);r.__removalCount=(t.__removalCount||0)+1,e.insertBefore(r,Q(t))}}return he(t),!0}return t instanceof O&&!function(t){let e=et(t);e&&e.tagName||(e={namespaceURI:Qt,tagName:"template"});const n=h(t.tagName),a=h(e.tagName);return!!ee[t.namespaceURI]&&(t.namespaceURI===Zt?e.namespaceURI===Jt?"svg"===n:e.namespaceURI===Kt?"svg"===n&&("annotation-xml"===a||ae[a]):Boolean(me[n]):t.namespaceURI===Kt?e.namespaceURI===Jt?"math"===n:e.namespaceURI===Zt?"math"===n&&re[a]:Boolean(fe[n]):t.namespaceURI===Jt?!(e.namespaceURI===Zt&&!re[a])&&!(e.namespaceURI===Kt&&!ae[a])&&!fe[n]&&(oe[n]||!me[n]):!("application/xhtml+xml"!==ie||!ee[t.namespaceURI]))}(t)?(he(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,t.innerHTML)?(kt&&3===t.nodeType&&(e=t.textContent,u([ut,dt,pt],t=>{e=y(e,t," ")}),t.textContent!==e&&(m(a.removed,{element:t.cloneNode()}),t.textContent=e)),be(lt.afterSanitizeElements,t,null),!1):(he(t),!0)},Ae=function(t,e,n){if(zt&&("id"===e||"name"===e)&&(n in r||n in ue))return!1;if(It&&!vt[e]&&S(mt,e));else if(Ot&&S(ft,e));else if(Nt.attributeCheck instanceof Function&&Nt.attributeCheck(e,t));else if(!bt[e]||vt[e]){if(!(we(t)&&(At.tagNameCheck instanceof RegExp&&S(At.tagNameCheck,t)||At.tagNameCheck instanceof Function&&At.tagNameCheck(t))&&(At.attributeNameCheck instanceof RegExp&&S(At.attributeNameCheck,e)||At.attributeNameCheck instanceof Function&&At.attributeNameCheck(e,t))||"is"===e&&At.allowCustomizedBuiltInElements&&(At.tagNameCheck instanceof RegExp&&S(At.tagNameCheck,n)||At.tagNameCheck instanceof Function&&At.tagNameCheck(n))))return!1}else if(Xt[e]);else if(S(yt,y(n,gt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==E(n,"data:")||!Yt[t])if(Rt&&!S(ht,y(n,gt,"")));else if(n)return!1;return!0},we=function(t){return"annotation-xml"!==t&&T(t,Tt)},ve=function(t){be(lt.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Ee(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:bt,forceKeepAttr:void 0};let r=e.length;for(;r--;){const o=e[r],{name:i,namespaceURI:s,value:c}=o,l=ce(i),d=c;let m="value"===i?d:_(d);if(n.attrName=l,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,be(lt.uponSanitizeAttribute,t,n),m=n.attrValue,!Ht||"id"!==l&&"name"!==l||(ge(i,t),m="user-content-"+m),Lt&&S(/((--!?|])>)|<\/(style|title|textarea)/i,m)){ge(i,t);continue}if("attributename"===l&&T(m,"href")){ge(i,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){ge(i,t);continue}if(!Dt&&S(/\/>/i,m)){ge(i,t);continue}kt&&u([ut,dt,pt],t=>{m=y(m,t," ")});const f=ce(t.nodeName);if(Ae(f,l,m)){if(nt&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(s);else switch(j.getAttributeType(f,l)){case"TrustedHTML":m=nt.createHTML(m);break;case"TrustedScriptURL":m=nt.createScriptURL(m)}if(m!==d)try{s?t.setAttributeNS(s,i,m):t.setAttribute(i,m),Ee(t)?he(t):p(a.removed)}catch(e){ge(i,t)}}else ge(i,t)}be(lt.afterSanitizeAttributes,t,null)},Ne=function t(e){let n=null;const a=ye(e);for(be(lt.beforeSanitizeShadowDOM,e,null);n=a.nextNode();)be(lt.uponSanitizeShadowNode,n,null),Se(n),ve(n),n.content instanceof l&&t(n.content);be(lt.afterSanitizeShadowDOM,e,null)};return a.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,o=null,s=null;if(te=!t,te&&(t="\x3c!--\x3e"),"string"!=typeof t&&!_e(t)){if("function"!=typeof t.toString)throw A("toString is not a function");if("string"!=typeof(t=t.toString()))throw A("dirty is not a string, aborting")}if(!a.isSupported)return t;if(Ct||pe(e),a.removed=[],"string"==typeof t&&(Bt=!1),Bt){if(t.nodeName){const e=ce(t.nodeName);if(!Et[e]||wt[e])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof v)n=Te("\x3c!----\x3e"),r=n.ownerDocument.importNode(t,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Mt&&!kt&&!xt&&-1===t.indexOf("<"))return nt&&Ut?nt.createHTML(t):t;if(n=Te(t),!n)return Mt?null:Ut?at:""}n&&Pt&&he(n.firstChild);const c=ye(Bt?t:n);for(;o=c.nextNode();)Se(o),ve(o),o.content instanceof l&&Ne(o.content);if(Bt)return t;if(Mt){if(Ft)for(s=it.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(bt.shadowroot||bt.shadowrootmode)&&(s=ct.call(i,s,!0)),s}let d=xt?n.outerHTML:n.innerHTML;return xt&&Et["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(q,n.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+d),kt&&u([ut,dt,pt],t=>{d=y(d,t," ")}),nt&&Ut?nt.createHTML(d):d},a.setConfig=function(){pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ct=!0},a.clearConfig=function(){le=null,Ct=!1},a.isValidAttribute=function(t,e,n){le||pe({});const a=ce(t),r=ce(e);return Ae(a,r,n)},a.addHook=function(t,e){"function"==typeof e&&m(lt[t],e)},a.removeHook=function(t,e){if(void 0!==e){const n=d(lt[t],e);return-1===n?void 0:f(lt[t],n,1)[0]}return p(lt[t])},a.removeHooks=function(t){lt[t]=[]},a.removeAllHooks=function(){lt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},a}()},2956(t,e,n){n(7374),n(2847),n(3958),n(1674)},3958(){window.wc.csvExport},7374(t){t.exports=window.wc.date},7723(t){t.exports=window.wp.i18n}},e={};function n(a){var r=e[a];if(void 0!==r)return r.exports;var o=e[a]={exports:{}};return t[a](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};n.r(a),n.d(a,{DOKAN_PRODUCT_EDITOR_STORE:()=>_,default:()=>S});const r=window.wp.data,o={forms:{},submitting:{},variations:{},variationsLoading:{},variationsPagination:{},error:null},i=window.wp.apiFetch;var s=n.n(i);function c(t){if("field"!==t.type)return;const e=t.value;return"checkbox"===t.variant?"yes"===e||"on"===e||!0===e||1===e||"1"===e:null!=e?e:""}n(2956),window.ReactJSXRuntime;const l="SET_FORM",u="UPDATE_PRODUCT",d="SET_SUBMITTING",p="SET_ERROR",m="REMOVE_FORM",f="SET_VARIATIONS",h="SET_VARIATION",g="SET_VARIATIONS_LOADING",T="SET_VARIATIONS_PAGINATION",y={setForm:(t,e,n)=>({type:l,productId:t,product:e,formItems:n}),updateProduct:(t,e)=>({type:u,productId:t,data:e}),setSubmitting:(t,e)=>({type:d,productId:t,isSubmitting:e}),setError:t=>({type:p,error:t}),removeForm:t=>({type:m,productId:t}),setVariations:(t,e)=>({type:f,productId:t,variations:e}),setVariation:(t,e)=>({type:h,productId:t,variation:e}),setVariationsLoading:(t,e)=>({type:g,productId:t,isLoading:e}),setVariationsPagination:(t,e)=>({type:T,productId:t,pagination:e}),initForm:(t,e,n)=>({dispatch:a})=>{const r=e.filter(t=>"field"===t.type).map(t=>[t.id,c(t)]),o=Object.fromEntries(r);a(y.setForm(t,{...o,id:t,vendor_earning:n,product_editor:!0},e))},saveProduct:t=>async({dispatch:e,select:n})=>{e(y.setSubmitting(t,!0));try{const a=n.getProduct(t);if(await s()({path:`dokan/v3/products/${t||""}`,method:t?"PUT":"POST",data:a}),t){const a=(n.getVariations(t)||[]).filter(t=>n.hasForm(t.id));a.length>0&&await Promise.all(a.map(t=>{const a=n.getProduct(t.id);return a?e(y.saveVariation(t,a)):Promise.resolve()}))}}catch(t){throw e(y.setError(t)),t}finally{e(y.setSubmitting(t,!1))}},batchUpdateProducts:(t,e)=>async({dispatch:n})=>{try{return await s()({path:"/dokan/v3/products/batch",method:"POST",data:{update:t.map(t=>({id:t,...e}))}})}catch(t){throw n(y.setError(t)),t}},batchDeleteProducts:t=>async({dispatch:e})=>{try{return await s()({path:"/dokan/v3/products/batch",method:"POST",data:{delete:t}})}catch(t){throw e(y.setError(t)),t}},batchUpdateProductsStatus:(t,e)=>async({dispatch:n})=>{try{return await s()({path:"/dokan/v3/products/batch",method:"POST",data:{update:t.map(t=>({id:t,status:e}))}})}catch(t){throw n(y.setError(t)),t}},fetchVariationForm:t=>async({dispatch:e})=>{var n,a;const r=await s()({path:`/dokan/v3/products/${t}/fields`});e(y.initForm(t,null!==(n=r.form_items)&&void 0!==n?n:[],null!==(a=r.vendor_earning)&&void 0!==a?a:0))},refreshExpandedForms:t=>async({dispatch:e,select:n})=>{const a=n.getVariations(t)||[];await Promise.all(a.filter(t=>n.hasForm(t.id)).map(t=>e(y.fetchVariationForm(t.id))))},fetchVariations:(t,e=1,n=10)=>async({dispatch:a})=>{a(y.setVariationsLoading(t,!0));try{const r=await s()({path:`/dokan/v2/products/${t}/variations?per_page=${n}&page=${e}`,parse:!1}),o=await r.json(),i=parseInt(r.headers.get("X-WP-Total")||"0",10),c=parseInt(r.headers.get("X-WP-TotalPages")||"1",10);a(y.setVariations(t,o||[])),a(y.setVariationsPagination(t,{totalCount:i,totalPages:c,currentPage:e,perPage:n}))}catch(t){throw a(y.setError(t)),t}finally{a(y.setVariationsLoading(t,!1))}},saveVariation:(t,e)=>async({dispatch:n})=>{try{const a={...e};t.attributes?.length&&(a.attributes=t.attributes.filter(t=>t.selected_value).map(t=>({name:t.value,option:t.selected_value?.label||""}))),await s()({path:`/dokan/v2/products/${t.parent_id}/variations/${t.id}`,method:"PUT",data:a}),await n(y.fetchVariationForm(t.id))}catch(t){throw n(y.setError(t)),t}},generateVariations:t=>async({dispatch:e})=>{try{await s()({path:`/dokan/v2/products/${t}/variations/generate`,method:"POST",data:{delete:!0}}),await e(y.fetchVariations(t))}catch(t){throw e(y.setError(t)),t}},addVariation:t=>async({dispatch:e})=>{try{await s()({path:`/dokan/v2/products/${t}/variations`,method:"POST",data:{regular_price:""}}),await e(y.fetchVariations(t))}catch(t){throw e(y.setError(t)),t}},removeVariation:t=>async({dispatch:e})=>{try{await s()({path:`/dokan/v2/products/${t.parent_id}/variations/${t.id}`,method:"DELETE",data:{force:!0}}),await e(y.fetchVariations(t.parent_id))}catch(t){throw e(y.setError(t)),t}},bulkEditVariations:(t,e,n={})=>async({dispatch:a})=>{a(y.setVariationsLoading(t,!0));try{const r=window.dokan,o=new FormData;if(o.append("action","dokan_bulk_edit_variations"),o.append("security",r.bulk_edit_variations_nonce),o.append("product_id",String(t)),o.append("bulk_action",e),Object.entries(n).forEach(([t,e])=>{o.append(`data[${t}]`,String(e))}),!(await fetch(r.ajaxurl,{method:"POST",body:o})).ok)throw new Error("Bulk edit failed");await a(y.fetchVariations(t)),await a(y.refreshExpandedForms(t))}catch(t){throw a(y.setError(t)),t}finally{a(y.setVariationsLoading(t,!1))}},reorderVariations:(t,e)=>async({dispatch:n})=>{n(y.setVariations(t,e));try{await s()({path:`/dokan/v2/products/${t}/variations/batch`,method:"POST",data:{update:e.map((t,e)=>({id:t.id,menu_order:e}))}})}catch(e){throw n(y.setError(e)),await n(y.fetchVariations(t)),e}}},E={getVariations:(t,e=1,n=10)=>async({dispatch:a})=>{await a(y.fetchVariations(t,e,n))}},_="dokan/product-editor",b=(0,r.createReduxStore)(_,{reducer:(t=o,e)=>{switch(e.type){case l:return{...t,forms:{...t.forms,[e.productId]:{product:e.product,formItems:e.formItems}},error:null};case u:{const n=t.forms[e.productId];return n?{...t,forms:{...t.forms,[e.productId]:{...n,product:{...n.product,...e.data}}}}:t}case d:return{...t,submitting:{...t.submitting,[e.productId]:e.isSubmitting}};case p:return{...t,error:e.error};case m:{const{[e.productId]:n,...a}=t.forms,{[e.productId]:r,...o}=t.submitting;return{...t,forms:a,submitting:o}}case f:return{...t,variations:{...t.variations,[e.productId]:e.variations},error:null};case h:{const n=t.variations[e.productId];if(!n)return t;const a=n.findIndex(t=>t.id===e.variation.id);if(-1===a)return t;const r=[...n];return r[a]=e.variation,{...t,variations:{...t.variations,[e.productId]:r}}}case g:return{...t,variationsLoading:{...t.variationsLoading,[e.productId]:e.isLoading}};case T:return{...t,variationsPagination:{...t.variationsPagination,[e.productId]:e.pagination}};default:return t}},actions:y,selectors:{getProduct:(t,e)=>t.forms[e]?.product,getFormItems:(t,e)=>t.forms[e]?.formItems,isSubmitting:(t,e)=>!!t.submitting[e],hasForm:(t,e)=>!!t.forms[e],getVariations:(t,e)=>t.variations[e],isVariationsLoading:(t,e)=>!!t.variationsLoading[e],getVariationsPagination:(t,e)=>t.variationsPagination[e],getError:t=>t.error},resolvers:E});(0,r.register)(b);const S=b;(window.dokan=window.dokan||{}).productEditorStore=a})();